"use strict";(self["webpackChunkscui"]=self["webpackChunkscui"]||[]).push([[5221],{34828:function(e,s,a){a.r(s),a.d(s,{default:function(){return m}});var t=a(66252);const i={class:"left-panel"},l={class:"right-panel"},n={class:"right-panel-search"},o=(0,t.Uk)("修改"),c=(0,t.Uk)("删除");function d(e,s,a,d,u,r){const h=(0,t.up)("el-button"),p=(0,t.up)("el-input"),m=(0,t.up)("el-header"),g=(0,t.up)("el-table-column"),w=(0,t.up)("el-switch"),b=(0,t.up)("scTable"),k=(0,t.up)("el-main"),v=(0,t.up)("el-container"),_=(0,t.up)("save-dialog");return(0,t.wg)(),(0,t.iD)(t.HY,null,[(0,t.Wm)(v,{style:{padding:"0 10px"}},{default:(0,t.w5)((()=>[(0,t.Wm)(m,null,{default:(0,t.w5)((()=>[(0,t._)("div",i,[(0,t.Wm)(h,{type:"primary",size:u.size,icon:"el-icon-plus",onClick:r.add},null,8,["size","onClick"]),(0,t.Wm)(h,{type:"danger",plain:"",icon:"el-icon-delete",size:u.size,disabled:0===u.selection.length,onClick:r.batch_del},null,8,["size","disabled","onClick"])]),(0,t._)("div",l,[(0,t._)("div",n,[(0,t.Wm)(p,{modelValue:u.params.keyword,"onUpdate:modelValue":s[0]||(s[0]=e=>u.params.keyword=e),size:u.size,placeholder:"等级名称",clearable:""},null,8,["modelValue","size"]),(0,t.Wm)(h,{type:"primary",icon:"el-icon-search",size:u.size,onClick:r.upSearch},null,8,["size","onClick"])])])])),_:1}),(0,t.Wm)(k,{class:"nopadding"},{default:(0,t.w5)((()=>[(0,t.Wm)(b,{ref:"table",tableName:"listCustomColumn",onSelectionChange:r.selectionChange,onSizeChange:r.sizeChange,apiObj:u.list.apiObj,column:u.list.column,"row-key":"id",stripe:"",params:u.params},{active_status:(0,t.w5)((e=>[(0,t.Wm)(w,{modelValue:e.row.active_status,"onUpdate:modelValue":s=>e.row.active_status=s,"active-value":!0,"inactive-value":!1,loading:e.row.$switch_yx,size:u.size,onChange:s=>r.changeSwitch(s,e.row)},null,8,["modelValue","onUpdate:modelValue","loading","size","onChange"])])),default:(0,t.w5)((()=>[(0,t.Wm)(g,{type:"selection",align:"center",width:"50"}),(0,t.Wm)(g,{label:"序号",align:"center",type:"index",width:"50"}),(0,t.Wm)(g,{label:"操作",fixed:"right",align:"center",width:"160"},{default:(0,t.w5)((e=>[(0,t.Wm)(h,{class:"table_btn_text",text:"",icon:"sc-icon-Edit",size:u.size,type:"primary",onClick:s=>r.handlerCommand(e.row,"edit")},{default:(0,t.w5)((()=>[o])),_:2},1032,["size","onClick"]),(0,t.Wm)(h,{class:"table_btn_text",text:"",icon:"sc-icon-Delete",size:u.size,type:"danger",onClick:s=>r.handlerCommand(e.row,"delete")},{default:(0,t.w5)((()=>[c])),_:2},1032,["size","onClick"])])),_:1})])),_:1},8,["onSelectionChange","onSizeChange","apiObj","column","params"])])),_:1})])),_:1}),u.dialog.save?((0,t.wg)(),(0,t.j4)(_,{key:0,ref:"saveDialog",onSuccess:r.handleSaveSuccess,onClosed:s[1]||(s[1]=e=>u.dialog.save=!1)},null,8,["onSuccess"])):(0,t.kq)("",!0)],64)}var u=a(11771),r={name:"device",components:{saveDialog:u["default"]},data(){return{size:"small",dialog:{save:!1},list:{apiObj:this.$API.system.upkeep.list,column:[]},selection:[],params:{keyword:"",url:"upkeep.item.list"}}},mounted(){},methods:{selectionChange(e){this.selection=e},sizeChange(e){this.size=e},changeSwitch(e,s){s.$switch_yx=!0,setTimeout((async()=>{let e={id:s.id,status:s.active_status};const a=await this.$API.system.upkeep.status.post(e);200==a.code||(s.active_status=!s.active_status),delete s.$switch_yx}),500)},upSearch(){this.$refs.table.reload(this.params)},add(){this.dialog.save=!0,this.$nextTick((()=>{this.$refs.saveDialog.open()}))},async batch_del(){const e={ids:this.selection.map((e=>e.id))},s=await this.$API.system.upkeep.del.post(e);200===s.code&&(this.$refs.table.refresh(),this.$message.success("删除成功"))},table_edit(e){this.dialog.save=!0,this.$nextTick((()=>{this.$refs.saveDialog.open("edit").setData(e)}))},async table_del(e){const s={ids:[e.id]},a=await this.$API.system.upkeep.del.post(s);200===a.code&&(this.$refs.table.refresh(),this.$message.success("删除成功"))},handlerCommand(e,s){"edit"==s?this.table_edit(e):"delete"==s&&this.table_del(e)},handleSaveSuccess(e,s){("add"===s||"edit"===s)&&this.$refs.table.refresh()}}},h=a(83744);const p=(0,h.Z)(r,[["render",d]]);var m=p}}]);