x-php-Admin/dist/static/js/754.6b2626ae.js
2024-01-10 14:23:24 +08:00

1 line
5.9 KiB
JavaScript

"use strict";(self["webpackChunkx_php_admin"]=self["webpackChunkx_php_admin"]||[]).push([[754],{3754:function(e,t,a){a.r(t),a.d(t,{default:function(){return d}});var l=a(6808),i=a(9511);const o={class:"left-panel"},n={key:0,class:"right-panel"};function r(e,t,a,r,s,p){const h=(0,l.up)("el-tab-pane"),c=(0,l.up)("el-tabs"),u=(0,l.up)("el-header"),d=(0,l.up)("el-button"),b=(0,l.up)("xFilterBar"),m=(0,l.up)("xEcharts"),f=(0,l.up)("el-popconfirm"),k=(0,l.up)("el-button-group"),g=(0,l.up)("el-table-column"),y=(0,l.up)("xTable"),w=(0,l.up)("el-main"),x=(0,l.up)("el-container");return(0,l.wg)(),(0,l.j4)(x,{style:{padding:"10px 10px 6px 10px"}},{default:(0,l.w5)((()=>[(0,l.Wm)(x,{class:"container"},{default:(0,l.w5)((()=>[s.tabs&&s.tabs.length>0?((0,l.wg)(),(0,l.j4)(u,{key:0},{default:(0,l.w5)((()=>[(0,l.Wm)(c,{modelValue:s.search[s.tabskey],"onUpdate:modelValue":t[0]||(t[0]=e=>s.search[s.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)(s.tabs,(t=>((0,l.wg)(),(0,l.j4)(h,{key:t.value,label:t.label+(t.num||s.search[s.tabskey]==t.value&&!e.$refs.table.loading?"("+(s.search[s.tabskey]==t.value?e.$refs.table.total:t.num||0)+")":""),name:t.value},null,8,["label","name"])))),128))])),_:1},8,["modelValue","onTabChange"])])),_:1})):(0,l.kq)("",!0),s.operation.plus||s.operation.batchdeletion||s.filter.length>0?((0,l.wg)(),(0,l.j4)(u,{key:1},{default:(0,l.w5)((()=>[(0,l._)("div",o,[s.operation.plus?((0,l.wg)(),(0,l.j4)(d,{key:0,type:"primary",icon:"el-icon-plus",onClick:p.plus},null,8,["onClick"])):(0,l.kq)("",!0)]),s.filter.length>0||s.stat.length>0?((0,l.wg)(),(0,l.iD)("div",n,[((0,l.wg)(!0),(0,l.iD)(l.HY,null,(0,l.Ko)(s.stat,((e,t)=>((0,l.wg)(),(0,l.j4)(d,(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)),s.filter.length>0?((0,l.wg)(),(0,l.j4)(b,{key:0,modelValue:s.search,"onUpdate:modelValue":t[1]||(t[1]=e=>s.search=e),filterName:e.$route.meta.tablename,options:s.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 s.chartoption&&Object.keys(s.chartoption).length>0?((0,l.wg)(),(0,l.j4)(u,{key:2,style:{height:"120px"}},{default:(0,l.w5)((()=>[(0,l.Wm)(m,{height:"100%",option:s.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:s.isselection,tableColumn:s.column,name:s.tablename,params:s.search,batchoperation:s.batch,api:s.api,"row-key":s.key,remoteSort:!0,remoteFilter:!0,stripe:""},{default:(0,l.w5)((()=>[s.operation.edit||s.operation.delete?((0,l.wg)(),(0,l.j4)(g,{key:0,label:s.operation.label||"操作",width:s.operation.width||124,fixed:s.operation.fixed||"right",align:s.operation.align||"left"},{default:(0,l.w5)((e=>[(0,l.Wm)(k,null,{default:(0,l.w5)((()=>[s.operation.edit?((0,l.wg)(),(0,l.j4)(d,{key:0,type:s.operation.edit.type||"primary",size:s.operation.edit.size||"small",onClick:t=>p.operationEdit(e.row,e.$index)},{default:(0,l.w5)((()=>[(0,l.Uk)((0,i.zw)(s.operation.edit.label||"编辑"),1)])),_:2},1032,["type","size","onClick"])):(0,l.kq)("",!0),s.operation.delete?((0,l.wg)(),(0,l.j4)(f,{key:1,title:s.operation.delete.title||"确定删除吗?",onConfirm:t=>p.operationDelete(e.row,e.$index)},{reference:(0,l.w5)((()=>[(0,l.Wm)(d,{type:s.operation.delete.type||"info",size:s.operation.delete.size||"small"},{default:(0,l.w5)((()=>[(0,l.Uk)((0,i.zw)(s.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})}a(8311);var s=a(3679),p=a(7844),h={name:"table_1",components:{xEcharts:p.Z,xFilterBar:s.Z},props:{name:{type:String,default:""}},data(){return{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:""}},mounted(){if(this.name&&(this.tablename=this.name||this.$route.meta.tablename),this.tablename||this.tableurl){var e={cache:this.$route.meta.cache||!0,cacheparameters:this.$route.meta.cacheparameters||!1},t=this.tableurl?this.$http.get(this.tableurl,{},e):this.$api.system.table.get(this.tablename,e);t.then((e=>{if(200==e.code){Object.assign(this.$data,e.data);for(const e in this.search)Object.prototype.hasOwnProperty.call(this.$route.query,e)&&(this.search[e]=this.$route.query[e])}}))}},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:{filterChange(e){var t=Object.assign({},this.search,e);this.$refs.table.reload(t)},tabChange(){this.$refs.table.reload(this.search)},plus(){this.$nextTick((()=>{let e=this.operation.plus.data||{};for(const t in e)Object.prototype.hasOwnProperty.call(this.search,t)&&(e[t]=this.search[t]);this.$refs.table.xtablehandleClick(e,this.operation.plus,"update")}))},operationEdit(e){this.$nextTick((()=>{this.$refs.table.xtablehandleClick(e,this.operation.edit,"update")}))},openStat(e){this.$nextTick((()=>{this.$refs.table.xtablehandleClick({},e,"stat")}))},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}}},c=a(8700);const u=(0,c.Z)(h,[["render",r],["__scopeId","data-v-d1b55342"]]);var d=u}}]);