forked from golang/hotime
1 line
17 KiB
JavaScript
1 line
17 KiB
JavaScript
|
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-ef454b32"],{"0748":function(e,t,n){"use strict";n.r(t);n("b0c0"),n("ac1f"),n("841c"),n("9911");var w=n("f2bf"),v={style:{width:"100%",display:"contents"}},T={style:{padding:"10px"}},k=Object(w.n)("添加 "),S=Object(w.n)("删除"),C=Object(w.n)("搜索:"),E={key:0,style:{}},D=Object(w.n)("详情 "),_=Object(w.n)("操作 "),F=Object(w.n)("删除");var a,r,l,c=n("b85c"),o=(n("4de4"),n("2934")),i={data:function(){return{skeleton:!0,templateData:{},nowSearchTree:null,treeConfig:{},removeList:[],showTreeTabName:null,showTabLabel:!0,formAddTree:{},form:{pageSize:10,page:1},total:20,cellStyle:{padding:"2px 0px","text-align":"center",height:"40px"},headerCellStyle:{padding:"5px 0px","text-align":"center",color:"#000000",background:"darkgray",height:"40px"},shortcuts:[{text:"最近一周",value:(e=new Date,(t=new Date).setTime(t.getTime()-6048e5),[t,e])},{text:"最近一个月",value:(t=new Date,(e=new Date).setTime(e.getTime()-2592e6),[e,t])},{text:"最近三个月",value:(e=new Date,(t=new Date).setTime(t.getTime()-7776e6),[t,e])}],tableData:[],filterText:"",defaultProps:{}};var e,t},methods:{removeListClick:function(){var a=this,r=this,l=this.removeList.length;0!=l?this.$confirm("此操作将删除"+this.removeList.length+"条数据,是否继续?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){var e,t=Object(c.a)(a.removeList);try{for(t.s();!(e=t.n()).done;){var n=e.value;Object(o.b)(window.Hotime.data.name+"/"+a.templateData.name+"/"+n.id).then(function(){0==--l&&(r.$message({type:"success",message:"删除成功!"}),r.removeList=[],r.formDebounce(r))})}}catch(e){t.e(e)}finally{t.f()}}):r.$message({type:"warning",message:"没有选择要删除的数据!"})},removeRow:function(e){var t=this,n=this;this.$confirm("此操作将进行删除操作,是否继续?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){Object(o.b)(window.Hotime.data.name+"/"+t.templateData.name+"/"+e).then(function(e){0==e.status?(n.$message({type:"success",message:"删除成功!"}),n.formDebounce(n)):n.$message({type:"warn",message:e.error.msg})})})},treeNodeClick:function(e,t){null!=this.nowSearchTree&&(this.form[this.nowSearchTree.name]=e.id)},tabClick:function(e){this.form[this.nowSearchTree.name]=null,this.nowSearchTree=this.treeConfig[e.paneName],this.filterText=""},loadNode:function(e,t){var n=window.Hotime;if(0===e.level){var a={label:n.data.label};return a[this.nowSearchTree.value]=n.data.label,this.formAddTree[this.nowSearchTree.name]=null,t([a])}e=e.data.id;null==(this.formAddTree[this.nowSearchTree.name]=e)&&(this.formAddTree[this.nowSearchTree.name]=null,e=0),Object(o.e)(n.data.name+"/"+this.nowSearchTree.link,{parent_id:e,pageSize:100}).then(function(e){0==e.status&&t(e.result.data)})},formDebounce:(a=function(e){var t=window.Hotime;e.search(t.data.name,e)},r=200,function(e){l&&clearTimeout(l),l=setTimeout(function(){a(e)},r)}),sortChange:function(e){null!=e.prop?"descending"===e.order?this.form.sort=e.prop+" DESC":this.form.sort=e.prop+" ASC":this.form.sort=null},filterNode:function(e,t){return!e||-1!==t[this.nowSearchTree.value].indexOf(e)},handleSizeChange:function(e){},search:function(e,t){Object(o.e)(e+"/"+t.templateData.name,t.form).then(function(e){t.tableData=e.result.data,t.total=e.result.count,t.skeleton=!1})},handleSelectionChange:function(e){this.removeList=e}},watch:{filterText:function(e){null!=this.$refs["tree:"+this.nowSearchTree.name]&&this.$refs["tree:"+this.nowSearchTree.name].filter(e)},form:{handler:function(){this.formDebounce(this)},deep:!(l="")}},mounted:function(){var e=window.Hotime;if(this.templateData=e.mapData[this.$route.path],null!=this.templateData){if(this.treeConfig={},null!=this.templateData.columns){var t,n=Object(c.a)(this.templateData.columns);try{for(n.s();!(t=n.n()).done;){var a=t.value;null==a.value&&(a.value=a.name)}}catch(e){n.e(e)}finally{n.f()}}if(this.nowSearchTree=null,this.showTabLabel=!0,this.defaultProps={},null!=this.templateData.sear
|