| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830 |
- function getP(name) {
- this.switchParam = {
- and: {
- source: [
- { desc: "与", value: "0" },
- { desc: "或", value: "1" },
- ],
- },
- date: {
- source: [
- { desc: "年", value: "1", className: "smallButton" },
- { desc: "月", value: "2", className: "smallButton" },
- { desc: "日", value: "3", className: "smallButton" },
- ],
- },
- /* 再改 management(String) 为 int -- 0 为未指定,99 为所有(原为 "0")。Lin
- management:{source:[{desc:"所有",value:"0"},{desc:"管理",value:"2"},{desc:"创建",value:"1"},{desc:"已办",value:"3"},{desc:"停用",value:"55"}]},
- */ management: {
- source: [
- { desc: "所有", value: 99 },
- { desc: "管理", value: 2 },
- { desc: "创建", value: 1 },
- { desc: "已办", value: 3 },
- { desc: "停用", value: 55 },
- ],
- },
- isfulltext: {
- source: [
- { desc: "全文", value: "0" },
- { desc: "全文", value: "1" },
- ],
- },
- };
- return this.switchParam[name];
- }
- function getPValue(name, v, findcurrent) {
- var c = getP(name);
- var cc = c["source"];
- if (!v) return cc[0];
- var i = 0;
- for (var i = 0; i < cc.length; i++) {
- if (cc[i].value == v) {
- if (findcurrent) {
- return cc[i];
- } else if (i + 1 < cc.length) {
- return cc[i + 1];
- }
- break;
- }
- }
- return cc[0];
- }
- //日期
- $("[ssType=date]") // [wdType=。Lin
- .css({ position: "absolute", right: "4px", top: "3px" }) //定位
- .each(function () {
- var wdName = $(this).attr("ssName"); // ("wdName")。Lin
- if ($("[name=" + wdName + "]").val()) {
- var matchNumArr = $("[name=" + wdName + "]")
- .val()
- .match(/\d+/g);
- if (matchNumArr) {
- var matchNum = matchNumArr.length;
- $(this).attr("ssVal", matchNum); // ("wdVal",。Lin
- }
- } else {
- //设置默认格式
- var matchNumArr = $("[name=" + wdName + "]")
- .attr("format")
- .match(/(yyyy|MM|dd)/g);
- if (matchNumArr) {
- var matchNum = matchNumArr.length;
- $(this).attr("ssVal", matchNum); // ("wdVal",。Lin
- }
- }
- $(this).click(function () {
- var ccc = getPValue("date", $(this).attr("ssVal")); // ("wdVal"))。Lin
- var ccc1 = getPValue("date", $(this).attr("ssVal"), true); // ("wdVal"),。Lin
- $(this)
- .val(ccc.desc)
- .attr("ssVal", ccc.value)
- .removeClass(ccc1.className)
- .addClass(ccc.className); // ("wdVal",。Lin
- });
- var ccc = getPValue("date", $(this).attr("ssVal"), true); // ("wdVal"),。Lin
- $(this).val(ccc.desc).attr("ssVal", ccc.value).addClass(ccc.className); // ("wdVal",。Lin
- $("[name=" + wdName + "]").click(function () {
- var radioVal = $('[ssName="' + $(this).attr("name") + '"]').attr("ssVal"); // ('[wdName="'+。("wdVal")。Lin
- if (1 == radioVal) {
- wd.edit.datePicker({
- dateFmt: "yyyy",
- });
- } else if (2 == radioVal) {
- wd.edit.datePicker({
- dateFmt: "yyyy-MM",
- });
- } else if (3 == radioVal) {
- wd.edit.datePicker({
- dateFmt: "yyyy-MM-dd",
- });
- }
- });
- });
- //与,或
- $("[ssType=and]").each(function () {
- // [wdType=。Lin
- $(this)
- .click(function () {
- var v = $(this).attr("ssVal"); // ("wdVal")。Lin
- var n = $(this).attr("ssName"); // ("wdName")。Lin
- var ccc = getPValue("and", v);
- $(this)
- .val(ccc.desc)
- .attr("ssVal", ccc.value)
- .addClass("content-onButton"); // ("wdVal",。Lin
- var isAndStr = $("[name=isAnd]").val();
- var isAnd = isAndStr ? JSON.parse(isAndStr) : {};
- isAnd[n] = ccc.value;
- $("[name=isAnd]").val(JSON.stringify(isAnd));
- })
- .trigger("click");
- });
- //全文
- $("[ssType=fts]")
- .hide()
- .each(function () {
- // [wdType=isFulltext。Lin
- var wdName = $(this).attr("ssName"); // ("wdName")。Lin
- $(this).click(function () {
- var v = $(this).attr("ssVal"); // ("wdVal")。Lin
- var ccc = getPValue("isfulltext", v);
- $(this)
- .val(ccc.desc)
- .attr("ssVal", ccc.value)
- .toggleClass("content-onButton", ccc.value == "1")
- .toggleClass("content-offButton", ccc.value == "0"); // ("wdVal",。Lin
- $("[name='isFulltext']").val(ccc.value);
- });
- var ccc = getPValue("isfulltext", $("[name='isFulltext']").val(), true);
- $("[name='isFulltext']").val(ccc.value);
- $(this)
- .val(ccc.desc)
- .attr("ssVal", ccc.value)
- .toggleClass("content-onButton", ccc.value == "1")
- .toggleClass("content-offButton", ccc.value == "0"); // ("wdVal",。Lin
- });
- //management
- var $m = $("[name=management]");
- /* 再改,management(String) 为 int -- 0 为未指定,99 为所有(原为 "0")。Lin
- if(! $m.val())
- */ if (!$m.val() || "0" == $m.val()) $m.val(getPValue("management").value);
- var TAB_NORMAL = "lightTab";
- var TAB_SELECTED = "lightTab-selected";
- $("[ssType=searchScope]")
- .addClass(TAB_NORMAL)
- .each(function () {
- // [wdType=manage。Lin
- var wdName = $(this).attr("ssName"); // ("wdName")。Lin
- $(this).click(function () {
- $("[ssType=searchScope]").removeClass(TAB_SELECTED).addClass(TAB_NORMAL); // [wdType=manage。Lin
- $(this).removeClass(TAB_NORMAL).addClass(TAB_SELECTED);
- var v = $(this).attr("ssVal"); // ("wdVal")。Lin
- $m.val(v);
- $("[name=ssSearch]").trigger("click"); // $("[name=wdSearch]").。Lin
- });
- if ($m.val() == $(this).attr("ssVal")) {
- // ("wdVal"))。Lin
- $(this).removeClass(TAB_NORMAL).addClass(TAB_SELECTED);
- }
- });
- var moveCount = 0;
- var ele = null;
- var resizeDom = null;
- var resizeStart = {};
- var GRAPH_CLASS = "graph-list";
- var ghost = $("#gho666");
- if (ghost.length == 0)
- ghost = $("<div id='gho666' class=\"" + GRAPH_CLASS + '"/>').css({
- width: 0,
- height: 50,
- border: "1px solid red",
- marginLeft: 0,
- marginRight: 0,
- padding: 0,
- display: "inline-block",
- });
- $(document.body)
- .on("mousedown", "." + GRAPH_CLASS, function (e) {
- console.log("mousedown");
- if (GRAPH_CLASS + "-mask" != e.target.getAttribute("class")) return true;
- ele = this;
- $(this).trigger("mouseenter");
- })
- .on("mouseenter", "." + GRAPH_CLASS, function () {
- if (!ele) return;
- $(this).before(ghost);
- })
- .on("mousedown", "." + GRAPH_CLASS + "-resize", function (e) {
- ele = null;
- resizeDom = this.parentNode;
- resizeStart = {
- x: e.pageX,
- y: e.pageY,
- width: $(resizeDom).width(),
- height: $(resizeDom).height(),
- };
- return false;
- })
- .on("mouseleave", function (e) {
- // $(this).before(ghost);
- console.log("bye");
- $("#gho666").css("");
- })
- .on("mouseup", function () {
- var saveSize = false;
- if (resizeDom || ele) {
- saveSize = true;
- if (ele) {
- var pos = ele.compareDocumentPosition(ghost[0]);
- saveSize = "2" != pos;
- }
- }
- if (saveSize) savegrtjSize(resizeDom.attributes.grtjid.value); // 改,增加入口参数 id -- 为 redrawPcht(。Lin
- if (ele) ghost.before(ele).remove();
- resizeDom = null;
- ele = null;
- })
- .on("mousemove", function (e) {
- if (!resizeDom) return;
- $(resizeDom)
- .width(resizeStart.width + (e.pageX - resizeStart.x) * 1)
- .height(resizeStart.height + (e.pageY - resizeStart.y) * 1);
- })
- .on("click", ".graphButton", function () {
- var url = $("[name=addgrtjUrl]").val();
- eval(url);
- /* $.post(url,function(data){
- data=eval("("+data+")");
- wd.display.alert(data.msg);
- window.location.reload();
- })*/
- });
- function initGraph() {
- if ($(".graphButton").length == 0) return false;
- window.onload = function () {
- $("." + GRAPH_CLASS).each(function (index, ele) {
- //var url=$("[name=getgrtjJsonUrl]").val();
- /* 去掉,共用 redrawPcht(id)。Lin
- * 对 个人统计表 部件,不调用 redrawPcht(
- var url=$("[name=getEChartData]").val();
- $.post(url,{grtjid:$(ele).attr("grtjid")},function(result){
- if(!result)return true;
- result=eval("("+result+")");
- var $body=$(ele).find("."+GRAPH_CLASS+"-body").attr("style","height: 100%;");
- if($body.width()==0){
- $body.parent().width(50);
- $body.width(50);
- }
- if($body.height()==0){
- $body.parent().height(50);
- $body.height(50);
- }
-
- // $body.empty();
- /// * 改,去掉 ZGZ:AjaxJson,AjaxJson.success(boolean) 改为 .ssCode(int) -- 用 ServU.wrOkDataByAjax(、ServU.wrErrMsgByAjax(、Map<String, Object> 了。Lin
- // if(result.success){
- /// *
- if(result.ssCode == 1){
- console.log(result);
- var data = result.data;
- var ECData = {};
- ECData.name = data.grtj.mc;
- ECData.id = $(ele).attr("grtjid");
- ECData.type = data.grtj.tjtlbm;
- ECData.rename = {name:"mc",value:"sl"};
- ECData.dom=$body[0];
-
- // /// *var map = new Map();
- // for(var i;i<data.dataArray.length;i++){
- // ECData.dataList.push({"sl":data.dataArray[i].sl});
- // if(data.dataArray[i].sanjzblist){
- // //有三级则为二级
- // ECData.dataList.push({"sl":data.dataArray[i].sl});
- // }else{
- // if(map.has()){
- //
- // }
- // }
- // } /// *
- ECData.dataList =data.dataArray;
- MyECharts.init(ECData);
- // /// *
- // var myChart=echarts.getInstanceByDom($body[0])
- // if(myChart)
- // myChart.dispose();
- //
- // myChart = echarts.init($body[0]);
- //
- // myChart.setOption(eval("("+data.data+")"));
- // /// *
-
- }else{
- if("0"==result.data){
- $(ele).animate({height:50,width:"100%"}).animate({width:0}).remove();
- }else{
- $body.html($body.html()+":"+result.msg);
- }
-
- }
- })
- */
- if ($(ele).attr("grtjlbm") == 1)
- // 个人统计图。Lin
- redrawPcht($(ele).attr("grtjid"));
- });
- };
- return true;
- }
- initGraph();
- var save_timeoutid = null;
- /* 改,增加入口参数 id -- 为 redrawPcht(。Lin
- function savegrtjSize(){
- */ function savegrtjSize(id) {
- clearTimeout(save_timeoutid);
- save_timeoutid = setTimeout(function () {
- var grtjlbm; // 再增加,只需要刷新 个人统计图 部件。Lin
- var grtjSize = [];
- $("." + GRAPH_CLASS).each(function (index, ele) {
- if ($(ele).attr("grtjid") == id) {
- // 再增加,滤出当前的部件 -- 只需要处理当前改变 Size 的部件。Lin
- var data = {
- xh: index + 1,
- kd: $(ele).width(),
- gd: $(ele).height(),
- grtjid: $(ele).attr("grtjid"),
- };
- grtjSize.push(data);
- grtjlbm = $(ele).attr("grtjlbm"); // 再增加,只需要刷新 个人统计图 部件。Lin
- } // 再增加,滤出当前的部件 -- 只需要处理当前改变 Size 的部件。Lin
- });
- var url = $("[name=grtjSizeUrl]").val();
- url = wd.display.replaceDynamicParam(url, {
- grtjSize: encodeURIComponent(JSON.stringify(grtjSize)),
- });
- $.post(url, function (data) {
- data = eval("(" + data + ")");
- //wd.display.alert(data.msg);
- wd.display.fixationAlert("保存成功");
- /* 改,改为新增加的 redrawPcht(id)。Lin
- initGraph();
- */
- /* 再改,只需要刷新 个人统计图 部件。Lin
- redrawPcht(id);
- */
- if (grtjlbm == 1)
- // 个人统计图。Lin
- redrawPcht(id);
- });
- }, 2000);
- }
- // 增加,从 objList.ss.jsp 里的 refreshTjt(id) 抽取到出来,共用。Lin
- // savegrtjSize() > savegrtjSize(id)、window.onload()
- // 原 savegrtjSize() 里,保存完 Size 后,调用的 initGraph() 只有 return true;
- function redrawPcht(id) {
- var url = $("[name=getEChartData]").val();
- $.post(url, { grtjid: id }, function (result) {
- if (!result) return true;
- result = eval("(" + result + ")");
- var $body = $("#tjt-" + id).attr("style", "height: 100%;");
- /* 改,去掉 ZGZ:AjaxJson,AjaxJson.success(boolean) 改为 .ssCode(int) -- 用 ServU.wrOkDataByAjax(、ServU.wrErrMsgByAjax(、Map<String, Object> 了。Lin
- * 统一 Ajax 返回标准 -- .ssCode、.ssMsg、.ssData
- if(result.success){
- */ if (result.ssCode == 0) {
- var data = result.ssData;
- var ECData = {};
- ECData.name = data.grtj.mc;
- ECData.id = id;
- ECData.type = data.grtj.tjtlbm;
- ECData.rename = { name: "mc", value: "sl" };
- ECData.dom = $body[0];
- ECData.dataList = data.dataArray;
- MyECharts.init(ECData);
- } else {
- if ("0" == result.ssData) {
- $("#tjt-" + id)
- .parent()
- .animate({ height: 50, width: "100%" })
- .animate({ width: 0 })
- .remove();
- } else {
- $body.html($body.html() + ":" + result.ssMsg);
- }
- }
- });
- }
- $(function () {
- $(".property").each(function (index, ele) {
- if (changeArray[index].length == 0) {
- $(this).hide().next().hide();
- return;
- }
- var a = changeArray[index][0];
- $(ele).html(
- "" +
- a.name +
- '从<span class="longCardList-warning">' +
- a.oldValue +
- '</span>改为<span class="longCardList-warning">' +
- a.newValue +
- "</span>"
- );
- var size = changeArray[index].length;
- $(ele).next(".icon-num").html(size);
- console.log($(ele));
- $(ele).on("mouseover", function () {
- if ($(".propertys").length > 0) {
- $(".propertys").remove();
- return false;
- }
- var html =
- "<thead><tr><th>修改项</th><th>更改后的值</th><th>原来的值</th></tr></thead><tbody>";
- for (var i = 0; i < changeArray[index].length; i++) {
- html += "<tr ";
- if (changeArray[index][i].url) {
- var url = changeArray[index][i].url.replace(/\s/g, "");
- html += " onclick=" + url;
- }
- html +=
- " ><td>" +
- changeArray[index][i].name +
- "</td><td>" +
- changeArray[index][i].newValue +
- "</td><td>" +
- changeArray[index][i].oldValue +
- "</td></tr>";
- }
- html =
- '<div class="propertys smallList-div" style="z-index: 99999;background: white;position: absolute;left: 13px;top: 15px;"><table>' +
- html +
- "</tbody></table></div>";
- $("body").append(html);
- var bounding = this.getBoundingClientRect();
- $(".propertys").css({
- left: bounding.left,
- top: bounding.top + bounding.height,
- });
- return false;
- });
- });
- });
- //拖动头
- $(function () {
- return; // 再增加,objList.ss.jsp 的首页,部分上、下两部分了。Lin
- try {
- if ($(".graphButton").length == 0) return;
- var graphDiv = document.querySelector(".graph");
- var cardlistDiv = document.querySelector(".longCardList-div");
- var lines = document.querySelectorAll("#line");
- if (lines.length == 0) {
- var line_div = document.createElement("div"); // 新增元素
- line_div.className = "content-hSeperator";
- line_div.id = "line";
- //拖动遮罩层
- var mask =
- '<div class="dragmask" style="display:none;position: absolute;width: 70px;height: 70px;top: -35px;right: 0px;"></div>';
- line_div.innerHTML = mask + "<span></span>";
- cardlistDiv.parentNode.insertBefore(line_div, cardlistDiv); // 在这个元素前面增加上去
- }
- var topDiv = graphDiv;
- var bottomDiv = cardlistDiv;
- // topDiv.style.display = "block";
- // bottomDiv.style.display = "block";
- // topDiv.style.height="100%"
- // bottomDiv.style.height="auto"
- var hh = parseInt($(".longCardList-div").css("height"));
- topDiv.style.height = hh * 0.7;
- bottomDiv.style.height = hh * 0.3;
- // topDiv.style.overflow="hidden"
- // bottomDiv.style.overflow="hidden"
- el = document.getElementById("line");
- el.style.zIndex = "99";
- //PC端的变量
- var start_Y;
- var top_Height;
- var middle_Height;
- var starty = 0;
- var topStartHeight = 0;
- var bottomStartHeight = 0;
- var dragmask = el.querySelector(".dragmask");
- var ismousedown = false;
- el.onmousedown = function (e) {
- ismousedown = true;
- e.preventDefault();
- starty = e.screenY;
- // topStartHeight = parseInt(topDiv.offsetHeight) || 50;
- // bottomStartHeight = parseInt(bottomDiv.offsetHeight) || 50;
- topStartHeight = parseInt(topDiv.style.height) || 0;
- bottomStartHeight = parseInt(bottomDiv.style.height) || 0;
- if (dragmask) {
- dragmask.style.display = "";
- }
- };
- document.onmouseup = function (e) {
- ismousedown = false;
- // wd.display.initWdFitHeight(window);
- //
- if (dragmask) {
- dragmask.style.display = "none";
- }
- };
- document.onmousemove = function (e) {
- e = e || window.event;
- if (ismousedown && e.which == 0) {
- ismousedown = false;
- // wd.display.initWdFitHeight(window);
- }
- if (ismousedown) {
- e.preventDefault();
- var pageY = e.screenY;
- // var topDivHeight = topStartHeight + (pageY - starty);
- // var bottomDivHeight = maxHeight - topDivHeight - 2;
- var topDivHeight = topStartHeight + (pageY - starty);
- var bottomDivHeight = bottomStartHeight - (pageY - starty);
- // console.log(topDivHeight+" "+bottomDivHeight)
- if (topDivHeight < 0 || bottomDivHeight < 0) {
- ismousedown = false;
- // wd.display.initWdFitHeight(window);
- return;
- }
- topDiv.style.height = topDivHeight + "px";
- bottomDiv.style.height = bottomDivHeight + "px";
- //console.log(e.which);
- }
- };
- } catch (e) {
- console.log(e);
- }
- });
- // 抽取图片布局处理逻辑为单独的函数
- function handleImageLayout($td, $img) {
- var tdW = $td.width();
- var thumbnailW = $td.find(".longCardList-thumbnail").width();
- var infoW = parseInt(tdW - thumbnailW - 18 - 76);
- $td.find('.longCardList-info').width(infoW);
-
- var thisH = $td.height();
- var infoH = $td.find('.longCardList-info').height();
- var imgH = $td.find('.longCardList-thumbnail').height();
-
- if (imgH > infoH) {
- var top = parseInt(imgH - infoH);
- $td.find('.longCardList').css("margin-top", top + "px");
- } else if (imgH < infoH) {
- var marginTop = (infoH - imgH) / 2;
- $td.find('.longCardList-thumbnail').css("margin-top", marginTop + "px");
- }
- }
- $(function () {
- try {
- console.log("1111111111");
- $(".longCardList-div td").each(function () {
- var $td = $(this);
- var $thumbnail = $td.find(".longCardList-thumbnail");
- var $img = $thumbnail.find("img");
- if ($thumbnail.length > 0) {
-
- //有图片的情况下
- $img.on("load", function () {
- handleImageLayout($td, $img);
- // var tdW = $(this).width();
- // var thumbnailW = $(this).find(".longCardList-thumbnail").width();
- // var infoW = parseInt(tdW - thumbnailW - 18 - 76);
- // $(this).find(".longCardList-info").width(infoW);
- // var thisH = $(this).height();
- // var infoH = $(this).find(".longCardList-info").height();
- // var imgH = $(this).find(".longCardList-thumbnail").height();
- // if (imgH > infoH) {
- // var top = parseInt(imgH - infoH);
- // $(this)
- // .find(".longCardList")
- // .css("margin-top", top + "px");
- // } else if (imgH < infoH) {
- // var marginTop = (infoH - imgH) / 2;
- // $(this)
- // .find(".longCardList-thumbnail")
- // .css("margin-top", marginTop + "px");
- // }
- });
- // 如果图片已经加载完成,直接触发load事件
- if ($img[0].complete) {
- handleImageLayout($(this), $img);
- }
- // $(this).find(".change-button").height(thisH).css("line-height",thisH);
- } else {
- var tdW = $(this).width();
- //没图片的情况下
- $(this)
- .find(".longCardList-info")
- .width(tdW - 85);
- }
- var thisH = $(this).height();
- // $(this).find('.button-change').css("height",thisH);
- // $(this).find('.button-revise').css("height",thisH);
- // $(this).find('.button-enable').css("height",thisH);
- // $(this).find('.button-reason').css("height",thisH);
- // $(this).find('.button-recruit').css("height",thisH);
- $(this)
- .find(".button")
- .css({
- "line-height": thisH + 22 + "px",
- height: thisH,
- });
- if (thisH < 45) {
- // $(this).find('.lbutton').css({
- // "font-size":"0px",
- // "background-position-y":"center",
- // "height":"36px",
- // "line-height":"36px"
- // })
- $(this).find(".button").css({
- "font-size": "0px",
- "background-position-y": "center",
- height: "36px",
- "line-height": "36px",
- });
- }
- });
- $(".ellipsisDiv").css({
- "text-overflow": "ellipsis",
- overflow: "hidden",
- "-webkit-line-clamp": "2",
- "-webkit-box-orient": "vertical",
- display: "-webkit-box",
- });
- } catch (e) {
- console.log(e);
- }
- //初始化growheight
- var ids = [];
- $(".growHeightDiv").each(function () {
- ids.push($(this).attr("id"));
- });
- if (ids.length > 0) {
- wd.display.initGrowHighByIds(ids, "150px");
- }
- // $(".ellipsisDiv").css({"text-overflow": "ellipsis","overflow": "hidden","-webkit-line-clamp": "2","-webkit-box-orient": "vertical","display": "-webkit-box"})
- // }catch(e){
- // console.log(e);
- // }
- });
- window.onresize = function() {
- $(".longCardList-div td").each(function () {
- var $td = $(this);
- var $thumbnail = $td.find(".longCardList-thumbnail");
- var $img = $thumbnail.find("img");
- if ($thumbnail.length > 0) {
- handleImageLayout($td, $img);
- }
-
- });
- }
- function wdRefresh() {
- if (initGraph()) {
- } else {
- $("form").submit();
- }
- }
- //折叠
- $(function () {
- var data = {};
- var all = {};
- var childData = {};
- var topData = {};
- $("[searchPId]").each(function () {
- var pid = $(this).attr("searchPId");
- var id = $(this).attr("searchId");
- all[id] = $(this);
- if (pid) {
- if (!data[pid]) data[pid] = [];
- childData[id] = $(this);
- data[pid].push($(this));
- } else {
- topData[id] = $(this);
- }
- });
- var defaultExpand = false;
- function showChildren(ishow, id) {
- if (!data[id]) return;
- for (var i = 0; i < data[id].length; i++) {
- if (ishow) {
- data[id][i].show();
- } else {
- data[id][i].hide();
- }
- arguments.callee(ishow, data[id][i].attr("searchId"));
- }
- }
- for (var key in topData) {
- if (!(data[key] && data[key].length > 0)) continue;
- // <div style="display:none" class="indenter" expandClass="list-expandedGroupIcon" collapseClass="list-groupIcon"></div>
- // $("<div id=\""+key+"\">喵夹</div>").prependTo(topData[key]).
- var $ele = topData[key].find(".indenter");
- console.log($ele);
- $ele
- .attr("id", key)
- .addClass($ele.attr(defaultExpand ? "expandClass" : "collapseClass"))
- .show()
- .on("click", function () {
- var iidd = this.getAttribute("id");
- this.isShow =
- typeof this.isShow == "undefined" ? !defaultExpand : !this.isShow;
- if (this.isShow) {
- $(this).attr("class", $(this).attr("expandClass"));
- } else {
- $(this).attr("class", $(this).attr("collapseClass"));
- }
- showChildren(this.isShow, iidd);
- return false;
- });
- showChildren(defaultExpand, key);
- }
- for (var key in data) {
- for (var i = 0; i < data[key].length; i++) {
- var THIS = data[key][i];
- var c = 1;
- THIS.css({ marginLeft: c * 20, width: "calc(100% - 20px)" });
- }
- }
- });
- $(function () {
- try {
- var availHeight =
- window.innerHeight -
- parseInt(initWdFitHeightFunction.toString().match(/[0-9]+/)[0]);
- var rowCountPerPage = parseInt(availHeight / 70);
- var ele = $("[name=rowCountPerPage]");
- if (ele.length == 0)
- ele = $('<input type="hidden" name="rowCountPerPage"/>').appendTo("form");
- ele.val(rowCountPerPage);
- } catch (e) {
- console.log(e);
- }
- });
- //草稿箱 如果没绑定点击事件 绑定查看
- $(function () {
- try {
- $(".cgxItem[clickPlay]").each(function () {
- var clickPlay = $(this).attr("clickPlay");
- console.log(clickPlay);
- console.log($(this).attr("onclick"));
- if (clickPlay && !$(this).attr("onclick")) {
- $(this).attr("onclick", clickPlay);
- }
- });
- } catch (e) {
- console.log(e);
- }
- });
|