"use strict";(self["webpackChunkx_php_admin"]=self["webpackChunkx_php_admin"]||[]).push([[15],{3015:function(e,t,a){a.r(t),a.d(t,{default:function(){return m}});var l=a(6252),i=a(3577);const o={class:"left-panel"},s={key:0,class:"right-panel"};function n(e,t,a,n,r,p){const h=(0,l.up)("el-tab-pane"),d=(0,l.up)("el-tabs"),u=(0,l.up)("el-header"),c=(0,l.up)("el-button"),m=(0,l.up)("xFilterBar"),b=(0,l.up)("xEcharts"),f=(0,l.up)("el-popconfirm"),g=(0,l.up)("el-button-group"),k=(0,l.up)("el-table-column"),y=(0,l.up)("xTable"),w=(0,l.up)("el-main"),x=(0,l.up)("el-container"),C=(0,l.up)("x-update"),$=(0,l.up)("x-stat");return(0,l.wg)(),(0,l.iD)(l.HY,null,[(0,l.Wm)(x,{style:{padding:"10px 10px 6px 10px"}},{default:(0,l.w5)((()=>[(0,l.Wm)(x,{class:"container"},{default:(0,l.w5)((()=>[r.tabs&&r.tabs.length>0?((0,l.wg)(),(0,l.j4)(u,{key:0},{default:(0,l.w5)((()=>[(0,l.Wm)(d,{modelValue:r.search[r.tabskey],"onUpdate:modelValue":t[0]||(t[0]=e=>r.search[r.tabskey]=e),onTabChange:p.tabChange,style:{"--el-tabs-header-height":"58px","line-height":"58px"}},{default:(0,l.w5)((()=>[((0,l.wg)(!0),(0,l.iD)(l.HY,null,(0,l.Ko)(r.tabs,(e=>((0,l.wg)(),(0,l.j4)(h,{key:e.value,label:e.label+(e.num?"("+e.num+")":""),name:e.value},null,8,["label","name"])))),128))])),_:1},8,["modelValue","onTabChange"])])),_:1})):(0,l.kq)("",!0),r.operation.plus||r.operation.batchdeletion||r.filter.length>0?((0,l.wg)(),(0,l.j4)(u,{key:1},{default:(0,l.w5)((()=>[(0,l._)("div",o,[r.operation.plus?((0,l.wg)(),(0,l.j4)(c,{key:0,type:"primary",icon:"el-icon-plus",onClick:p.plus},null,8,["onClick"])):(0,l.kq)("",!0)]),r.filter.length>0||r.stat.length>0?((0,l.wg)(),(0,l.iD)("div",s,[((0,l.wg)(!0),(0,l.iD)(l.HY,null,(0,l.Ko)(r.stat,((e,t)=>((0,l.wg)(),(0,l.j4)(c,(0,l.dG)({key:t,class:"hidden-xs-only",onClick:t=>p.openStat(e)},e),{default:(0,l.w5)((()=>[(0,l.Uk)((0,i.zw)(e.label),1)])),_:2},1040,["onClick"])))),128)),r.filter.length>0?((0,l.wg)(),(0,l.j4)(m,{key:0,modelValue:r.search,"onUpdate:modelValue":t[1]||(t[1]=e=>r.search=e),filterName:e.$route.meta.tablename,options:r.filter,onFilterChange:p.filterChange},null,8,["modelValue","filterName","options","onFilterChange"])):(0,l.kq)("",!0)])):(0,l.kq)("",!0)])),_:1})):(0,l.kq)("",!0),"object"===typeof r.chartoption&&Object.keys(r.chartoption).length>0?((0,l.wg)(),(0,l.j4)(u,{key:2,style:{height:"120px"}},{default:(0,l.w5)((()=>[(0,l.Wm)(b,{height:"100%",option:r.chartoption},null,8,["option"])])),_:1})):(0,l.kq)("",!0),(0,l.Wm)(w,{class:"nopadding"},{default:(0,l.w5)((()=>[(0,l.Wm)(y,{ref:"table",isselection:r.isselection,tableColumn:r.column,name:r.tablename,params:r.search,batchoperation:r.batch,api:r.api,"row-key":r.key,remoteSort:!0,remoteFilter:!0,stripe:""},{default:(0,l.w5)((()=>[r.operation.edit||r.operation.delete?((0,l.wg)(),(0,l.j4)(k,{key:0,label:r.operation.label||"操作",width:r.operation.width||124,fixed:r.operation.fixed||"right",align:r.operation.align||"left"},{default:(0,l.w5)((e=>[(0,l.Wm)(g,null,{default:(0,l.w5)((()=>[r.operation.edit?((0,l.wg)(),(0,l.j4)(c,{key:0,type:r.operation.edit.type||"primary",size:r.operation.edit.size||"small",onClick:t=>p.operationEdit(e.row,e.$index)},{default:(0,l.w5)((()=>[(0,l.Uk)((0,i.zw)(r.operation.edit.label||"编辑"),1)])),_:2},1032,["type","size","onClick"])):(0,l.kq)("",!0),r.operation.delete?((0,l.wg)(),(0,l.j4)(f,{key:1,title:r.operation.delete.title||"确定删除吗?",onConfirm:t=>p.operationDelete(e.row,e.$index)},{reference:(0,l.w5)((()=>[(0,l.Wm)(c,{type:r.operation.delete.type||"info",size:r.operation.delete.size||"small"},{default:(0,l.w5)((()=>[(0,l.Uk)((0,i.zw)(r.operation.delete.label||"删除"),1)])),_:1},8,["type","size"])])),_:2},1032,["title","onConfirm"])):(0,l.kq)("",!0)])),_:2},1024)])),_:1},8,["label","width","fixed","align"])):(0,l.kq)("",!0)])),_:1},8,["isselection","tableColumn","name","params","batchoperation","api","row-key"])])),_:1})])),_:1})])),_:1}),r.dialog.save?((0,l.wg)(),(0,l.j4)(C,{key:0,column:r.column,name:r.key,ref:"saveDialog",onSuccess:p.handleSuccess,onClosed:t[2]||(t[2]=e=>r.dialog.save=!1)},null,8,["column","name","onSuccess"])):(0,l.kq)("",!0),r.dialog.stat?((0,l.wg)(),(0,l.j4)($,{key:1,ref:"xstatdialog",onClosed:t[3]||(t[3]=e=>r.dialog.stat=!1)},null,512)):(0,l.kq)("",!0)],64)}a(7658);var r=a(7203),p=a(7874),h=a(7015),d={name:"table_1",components:{xStat:r["default"],xEcharts:h.Z,xFilterBar:p.Z},props:{name:{type:String,default:""}},data(){return{dialog:{save:!1,stat:!1},isselection:!0,selection:[],batch:[],column:[],aside:{items:[]},filter:[],api:"",operation:{},key:"id",search:{},tabs:[],stat:[],chartoption:{},tablename:this.$route.meta.tablename,tableurl:this.$route.meta.tableurl,groupFilterText:"",tabskey:"",tabsdefaultvalue:""}},mounted(){if(this.name&&(this.tablename=this.name||this.$route.meta.tablename),this.tablename||this.tableurl){var e=this.tableurl?this.$http.get(this.tableurl,{},{cache:!0}):this.$api.system.table.get(this.tablename,{cache:this.$route.meta.tablecache||0});e.then((e=>{200==e.code&&(Object.assign(this.$data,e.data),e.data.tabsdefaultvalue&&e.data.tabskey&&(this.search[e.data.tabskey]=e.data.tabsdefaultvalue))}))}},computed:{filterObj(){const e=[];return this.filter.forEach((t=>{t.component&&e.push({name:t.value,label:t.label,component:t.component,options:t.options})})),e}},watch:{groupFilterText(e){this.$refs.group.filter(e)}},methods:{groupFilterNode(e,t){return!e||-1!==t.label.indexOf(e)},groupClick(e){this.search[this.aside.searchkey||"groupid"]=e[this.aside.key||"id"],this.$refs.table.reload(this.search)},filterChange(e){var t=Object.assign({},this.search,e);this.$refs.table.reload(t)},tabChange(){this.$refs.table.reload(this.search)},handleSuccess(e,t,a){"edit"==t?e?this.$refs.table.tableData.filter((t=>t[this.key]===e[this.key])).forEach((t=>{Object.assign(t,e,e)})):this.$refs.table.refresh():e?this.$refs.table.tableData.unshift(e):this.$refs.table.reload({}),this.$message.success(a||"操作成功")},plus(){this.dialog.save=!0,this.$nextTick((()=>{this.$refs.saveDialog.open("plus").getComponentType(this.operation.plus.component).setData({}).setConfig(this.operation.plus)}))},operationEdit(e){this.dialog.save=!0,this.$nextTick((()=>{this.$refs.saveDialog.open("edit").getComponentType(this.operation.edit.component).setData(e).setConfig(this.operation.edit)}))},openStat(e){this.dialog.stat=!0,this.$nextTick((()=>{this.$refs.xstatdialog.open().setData(e)}))},async operationDelete(e,t){const a="undefined"!==typeof this.operation.delete.key&&this.operation.delete.key?this.operation.delete.key:this.key;var l=await this.$http.post(this.operation.delete.url,{[a]:e[a],index:t});200!=l.code?this.$alert(l.message,"提示",{type:"error"}):this.$refs.table.refresh()},selectionChange(e){this.selection=e}}},u=a(3744);const c=(0,u.Z)(d,[["render",n],["__scopeId","data-v-6c12f8f6"]]);var m=c}}]);