"use strict";(self["webpackChunkscui"]=self["webpackChunkscui"]||[]).push([[5992],{65388:function(e,t,s){s.r(t),s.d(t,{default:function(){return h}});var a=s(66252);const i={class:"left-panel"},l={class:"right-panel"},n={class:"right-panel-search"},c=(0,a.Uk)("修改"),o=(0,a.Uk)("删除");function d(e,t,s,d,r,u){const p=(0,a.up)("el-button"),h=(0,a.up)("el-input"),m=(0,a.up)("el-header"),w=(0,a.up)("el-table-column"),b=(0,a.up)("el-switch"),_=(0,a.up)("scTable"),g=(0,a.up)("el-main"),y=(0,a.up)("el-container");return(0,a.wg)(),(0,a.j4)(y,{class:"mainBox"},{default:(0,a.w5)((()=>[(0,a.Wm)(m,null,{default:(0,a.w5)((()=>[(0,a._)("div",i,[(0,a.Wm)(p,{type:"primary",icon:"el-icon-plus",onClick:u.add,size:r.size},null,8,["onClick","size"]),(0,a.Wm)(p,{type:"danger",plain:"",icon:"el-icon-delete",disabled:0===r.selection.length,size:r.size,onClick:u.batch_del},null,8,["disabled","size","onClick"])]),(0,a._)("div",l,[(0,a._)("div",n,[(0,a.Wm)(h,{size:r.size,modelValue:r.params.keyword,"onUpdate:modelValue":t[0]||(t[0]=e=>r.params.keyword=e),placeholder:"公司名称",clearable:""},null,8,["size","modelValue"]),(0,a.Wm)(p,{size:r.size,type:"primary",icon:"el-icon-search",onClick:u.upsearch},null,8,["size","onClick"])])])])),_:1}),(0,a.Wm)(g,{class:"nopadding"},{default:(0,a.w5)((()=>[(0,a.Wm)(_,{ref:"table",tableName:"listCustomColumn",onSelectionChange:u.selectionChange,apiObj:r.list.apiObj,column:r.list.column,"row-key":"id",stripe:"",params:r.params},{active_status:(0,a.w5)((e=>[(0,a.Wm)(b,{modelValue:e.row.active_status,"onUpdate:modelValue":t=>e.row.active_status=t,"active-value":!0,"inactive-value":!1,loading:e.row.$switch_yx,size:r.size,onChange:t=>u.changeSwitch(t,e.row)},null,8,["modelValue","onUpdate:modelValue","loading","size","onChange"])])),default:(0,a.w5)((()=>[(0,a.Wm)(w,{type:"selection",align:"center",width:"50"}),(0,a.Wm)(w,{label:"序号",align:"center",type:"index",width:"50"}),(0,a.Wm)(w,{label:"操作",fixed:"right",align:"center",width:"160"},{default:(0,a.w5)((e=>[(0,a.Wm)(p,{class:"table_btn_text",text:"",icon:"sc-icon-Edit",type:"primary",size:r.size,onClick:t=>u.handlerCommand(e.row,"edit")},{default:(0,a.w5)((()=>[c])),_:2},1032,["size","onClick"]),(0,a.Wm)(p,{class:"table_btn_text",text:"",icon:"sc-icon-Delete",type:"danger",size:r.size,onClick:t=>u.handlerCommand(e.row,"delete")},{default:(0,a.w5)((()=>[o])),_:2},1032,["size","onClick"])])),_:1})])),_:1},8,["onSelectionChange","apiObj","column","params"])])),_:1})])),_:1})}s(57658);var r={components:{},data(){return{size:"small",list:{apiObj:this.$API.system.process.list,column:[]},selection:[],params:{keyword:"",url:"process.list"}}},methods:{add(){this.$router.push({path:"/setting/process/add-process",query:{id:""}})},batch_del(){},table_edit(e){this.$nextTick((()=>{this.$router.push({path:"/setting/process/add-process",query:{id:e.id}})}))},async table_del(e){const t={ids:[e.id]},s=await this.$API.system.process.delete.post(t);200===s.code&&(this.$refs.table.refresh(),this.$message.success("删除成功"))},changeSwitch(e,t){t.$switch_yx=!0,setTimeout((async()=>{let e={id:t.id,status:t.active_status};const s=await this.$API.system.process.status.post(e);200==s.code||(t.active_status=!t.active_status),delete t.$switch_yx}),500)},upsearch(){this.$refs.table.upData(this.params)},handlerCommand(e,t){"edit"==t?this.table_edit(e):"delete"==t&&this.table_del(e)},handleSaveSuccess(e,t){("add"===t||"edit"===t)&&this.$refs.table.refresh()},selectionChange(e){this.selection=e},sizeChange(e){this.size=e}}},u=s(83744);const p=(0,u.Z)(r,[["render",d]]);var h=p}}]);