From 909d96c73b676f73050af847fa11f05ec221f4c4 Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@163.com> Date: 星期三, 20 一月 2021 17:23:25 +0800 Subject: [PATCH] # --- src/main/webapp/static/js/tag/tag.js | 86 +++++++------------------------------------ 1 files changed, 14 insertions(+), 72 deletions(-) diff --git a/src/main/webapp/static/js/tag/tag.js b/src/main/webapp/static/js/tag/tag.js index 046ff58..7488355 100644 --- a/src/main/webapp/static/js/tag/tag.js +++ b/src/main/webapp/static/js/tag/tag.js @@ -48,7 +48,7 @@ ]], done: function () { tableIdx.expandAll(); - $(".ew-tree-table .ew-tree-table-tool .ew-tree-table-tool-item").css("display", "none"); + // $(".ew-tree-table .ew-tree-table-tool .ew-tree-table-tool-item").css("display", "none"); limit() } }); @@ -57,91 +57,33 @@ tableRender(); - // 鐩戝惉澶村伐鍏锋爮浜嬩欢 - table.on('toolbar(tag)', function (obj) { - var checkStatus = table.checkStatus(obj.config.id); - switch(obj.event) { - case 'addData': + // 澶撮儴宸ュ叿鏍忕偣鍑讳簨浠� + treetable.on('toolbar(tag)', function (obj) { + switch (obj.event) { + case 'add': layer.open({ type: 2, - title: '鏂板', - maxmin: true, - area: [top.detailWidth, top.detailHeight], + title: '鏂板褰掔被', + skin: 'layui-cool-class', + area: ['30%', top.detailHeight], content: 'tag_detail.html', success: function(layero, index){ layer.getChildFrame('#data-detail-submit-edit', index).hide(); - clearFormVal(layer.getChildFrame('#detail', index)); + clearFormVal(layer.getChildFrame('#detail', index)); layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"}); } }); break; - case 'deleteData': - var data = checkStatus.data; - if (data.length === 0){ - layer.msg('璇烽�夋嫨鏁版嵁'); - } else { - layer.confirm('纭畾鍒犻櫎'+(data.length===1?'姝�':data.length)+'鏉℃暟鎹悧', function(){ - $.ajax({ - url: baseUrl+"/tag/delete/auth", - headers: {'token': localStorage.getItem('token')}, - data: {param: JSON.stringify(data)}, - method: 'POST', - traditional:true, - success: function (res) { - if (res.code === 200){ - layer.closeAll(); - tableReload(false); - } else if (res.code === 403){ - top.location.href = baseUrl+"/"; - } else { - layer.msg(res.msg) - } - } - }) - }); - } + case 'delete': + layer.msg('绂佺敤'); break; - case 'exportData': - layer.confirm('纭畾瀵煎嚭Excel鍚�', {shadeClose: true}, function(){ - var titles=[]; - var fields=[]; - obj.config.cols[0].map(function (col) { - if (col.type === 'normal' && col.hide === false && col.toolbar == null) { - titles.push(col.title); - fields.push(col.field); - } - }); - var exportData = {}; - $.each($('#search-box [name]').serializeArray(), function() { - exportData[this.name] = this.value; - }); - var param = { - 'tag': exportData, - 'fields': fields - }; - $.ajax({ - url: baseUrl+"/tag/export/auth", - headers: {'token': localStorage.getItem('token')}, - data: JSON.stringify(param), - dataType:'json', - contentType:'application/json;charset=UTF-8', - method: 'POST', - success: function (res) { - layer.closeAll(); - if (res.code === 200) { - table.exportFile(titles,res.data,'xls'); - } else if (res.code === 403) { - top.location.href = baseUrl+"/"; - } else { - layer.msg(res.msg) - } - } - }); - }); + case 'update': + layer.msg('绂佺敤'); break; } }); + // 鐩戝惉琛屽伐鍏蜂簨浠� table.on('tool(tag)', function(obj){ var data = obj.data; -- Gitblit v1.9.1