| | |
| | | .custom-tree-item-clicked { |
| | | color: #FC9003 |
| | | } |
| | | .layui-form-label { |
| | | width: 40px; |
| | | padding: 9px 5px; |
| | | } |
| | | |
| | | .layui-input-block { |
| | | margin-left: 50px; |
| | | } |
| | | </style> |
| | | </head> |
| | | <body> |
| | |
| | | |
| | | <div class="layui-form-item" style="border-top: solid 1px #F6F6F6;"> |
| | | <div class="layui-row" style="padding:10px 0"> |
| | | <div class="layui-col-xs3 layui-inline" style="width: 23%;"> |
| | | <div class="layui-col-xs3 layui-inline" style="width: 23%;display:none;"> |
| | | <div id="treeDepartment" lay-filter="treeDepartment" class="demo-tree demo-tree-box" style="height: 520px; overflow: scroll;"></div> |
| | | </div> |
| | | <div class="layui-col-xs9 layui-inline"> |
| | | <div class="layui-col-xs12 layui-inline"> |
| | | <div class="layui-row"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">代ç </label> |
| | |
| | | , tree = layui.tree |
| | | var sWhere = ""; |
| | | |
| | | tree.render({ |
| | | elem: '#treeDepartment', |
| | | data: getData(sWhere), |
| | | showCheckbox: false, //æ¯å¦æ¾ç¤ºå¤éæ¡ |
| | | id: 'demoId', |
| | | isJump: false, //æ¯å¦å
许ç¹å»èç¹æ¶å¼¹åºæ°çªå£è·³è½¬ |
| | | showLine: true,//æ¯å¦å¼å¯è¿æ¥çº¿ |
| | | onlyIconControl: true, //ç¹å»å䏿¶ç¼© |
| | | click: function (obj) { |
| | | //ç¹å»é«å
|
| | | if (obj.data.id !== treeCkData.id) { |
| | | $('div[data-id="' + obj.data.id + '"] span').eq(1).last().addClass("custom-tree-item-clicked"); |
| | | $('div[data-id="' + treeCkData.id + '"] span').eq(1).last().removeClass('custom-tree-item-clicked'); |
| | | treeCkData = obj.data; |
| | | TagId = obj.data.id; |
| | | TagParentId = obj.data.ParentID; |
| | | } |
| | | else { |
| | | $('div[data-id="' + treeCkData.id + '"] span').eq(1).last().removeClass('custom-tree-item-clicked'); |
| | | treeCkData = { id: 0 }; |
| | | TagId = ""; |
| | | TagParentId = ""; |
| | | } |
| | | //è·åææéä¸èç¹idæ°ç» |
| | | //var oCks = tree.getChecked('demoId'); //è·åéä¸èç¹çæ°æ® |
| | | //for (var i = 0; i < oCks.length; i++) { |
| | | // //console.log(oCks[0].id, obj.data.id); |
| | | // if (oCks[i].id != obj.data.id) { |
| | | // console.log(oCks[i]); |
| | | // //æ§è¡èç¹å¾é |
| | | //tree.render({ |
| | | // elem: '#treeDepartment', |
| | | // data: getData(sWhere), |
| | | // showCheckbox: false, //æ¯å¦æ¾ç¤ºå¤éæ¡ |
| | | // id: 'demoId', |
| | | // isJump: false, //æ¯å¦å
许ç¹å»èç¹æ¶å¼¹åºæ°çªå£è·³è½¬ |
| | | // showLine: true,//æ¯å¦å¼å¯è¿æ¥çº¿ |
| | | // onlyIconControl: true, //ç¹å»å䏿¶ç¼© |
| | | // click: function (obj) { |
| | | // //ç¹å»é«å
|
| | | // if (obj.data.id !== treeCkData.id) { |
| | | // $('div[data-id="' + obj.data.id + '"] span').eq(1).last().addClass("custom-tree-item-clicked"); |
| | | // $('div[data-id="' + treeCkData.id + '"] span').eq(1).last().removeClass('custom-tree-item-clicked'); |
| | | // treeCkData = obj.data; |
| | | // TagId = obj.data.id; |
| | | // TagParentId = obj.data.ParentID; |
| | | // } |
| | | // else { |
| | | // $('div[data-id="' + treeCkData.id + '"] span').eq(1).last().removeClass('custom-tree-item-clicked'); |
| | | // treeCkData = { id: 0 }; |
| | | // TagId = ""; |
| | | // TagParentId = ""; |
| | | // } |
| | | |
| | | // $(oCks[i]).prop("checked", false); |
| | | // $(this).prop("checked", false); |
| | | // } |
| | | //} |
| | | //form.render('checkbox'); |
| | | |
| | | |
| | | $.ajax({ |
| | | url: GetWEBURL() + '/Gy_MaintenanceMode/cx', |
| | | type: "GET", |
| | | data: { "HInterID": obj.data.id }, |
| | | success: function (data1) { |
| | | if (data1.count == 1) { |
| | | option.data = data1.data; |
| | | table.render(option); |
| | | layer.close(index); |
| | | } else { |
| | | layer.close(index); |
| | | layer.alert(data1.code + data1.Message, { icon: 5 }); |
| | | } |
| | | }, error: function () { |
| | | layer.close(index); |
| | | layer.alert("æ¥å£è¯·æ±å¤±è´¥!", { icon: 5 }); |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | // $.ajax({ |
| | | // url: GetWEBURL() + '/Gy_MaintenanceMode/cx', |
| | | // type: "GET", |
| | | // data: { "HInterID": obj.data.id }, |
| | | // success: function (data1) { |
| | | // if (data1.count == 1) { |
| | | // option.data = data1.data; |
| | | // table.render(option); |
| | | // layer.close(index); |
| | | // } else { |
| | | // layer.close(index); |
| | | // layer.alert(data1.code + data1.Message, { icon: 5 }); |
| | | // } |
| | | // }, error: function () { |
| | | // layer.close(index); |
| | | // layer.alert("æ¥å£è¯·æ±å¤±è´¥!", { icon: 5 }); |
| | | // } |
| | | // }); |
| | | // } |
| | | //}); |
| | | |
| | | |
| | | //$.ajax({ |