"use strict";(self["webpackChunkscui"]=self["webpackChunkscui"]||[]).push([[4632],{16376:function(e,a,s){s.r(a),s.d(a,{default:function(){return p}});var t=s(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,a,s,d,r,u){const h=(0,t.up)("el-button"),m=(0,t.up)("el-input"),p=(0,t.up)("el-header"),g=(0,t.up)("el-table-column"),w=(0,t.up)("el-switch"),b=(0,t.up)("scTable"),v=(0,t.up)("el-main"),_=(0,t.up)("el-container"),C=(0,t.up)("save-dialog");return(0,t.wg)(),(0,t.iD)(t.HY,null,[(0,t.Wm)(_,{style:{padding:"0 10px"}},{default:(0,t.w5)((()=>[(0,t.Wm)(p,null,{default:(0,t.w5)((()=>[(0,t._)("div",i,[(0,t.Wm)(h,{type:"primary",size:r.size,icon:"el-icon-plus",onClick:u.add},null,8,["size","onClick"]),(0,t.Wm)(h,{type:"danger",plain:"",icon:"el-icon-delete",size:r.size,disabled:0===r.selection.length,onClick:u.batch_del},null,8,["size","disabled","onClick"])]),(0,t._)("div",l,[(0,t._)("div",n,[(0,t.Wm)(m,{modelValue:r.params.keyword,"onUpdate:modelValue":a[0]||(a[0]=e=>r.params.keyword=e),size:r.size,placeholder:"等级名称",clearable:""},null,8,["modelValue","size"]),(0,t.Wm)(h,{type:"primary",icon:"el-icon-search",size:r.size,onClick:u.upSearch},null,8,["size","onClick"])])])])),_:1}),(0,t.Wm)(v,{class:"nopadding"},{default:(0,t.w5)((()=>[(0,t.Wm)(b,{ref:"table",tableName:"listCustomColumn",onSelectionChange:u.selectionChange,onSizeChange:u.sizeChange,apiObj:r.list.apiObj,column:r.list.column,"row-key":"id",stripe:"",params:r.params},{active_status:(0,t.w5)((e=>[(0,t.Wm)(w,{modelValue:e.row.active_status,"onUpdate:modelValue":a=>e.row.active_status=a,"active-value":!0,"inactive-value":!1,loading:e.row.$switch_yx,size:r.size,onChange:a=>u.changeSwitch(a,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:r.size,type:"primary",onClick:a=>u.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:r.size,type:"danger",onClick:a=>u.handlerCommand(e.row,"delete")},{default:(0,t.w5)((()=>[c])),_:2},1032,["size","onClick"])])),_:1})])),_:1},8,["onSelectionChange","onSizeChange","apiObj","column","params"])])),_:1})])),_:1}),r.dialog.save?((0,t.wg)(),(0,t.j4)(C,{key:0,ref:"saveDialog",onSuccess:u.handleSaveSuccess,onClosed:a[1]||(a[1]=e=>r.dialog.save=!1)},null,8,["onSuccess"])):(0,t.kq)("",!0)],64)}var r=s(70300),u={name:"grade",components:{saveDialog:r["default"]},data(){return{size:"small",dialog:{save:!1},list:{apiObj:this.$API.system.grade.list,column:[]},selection:[],params:{keyword:"",url:"wood.level.list"}}},mounted(){},methods:{selectionChange(e){this.selection=e},sizeChange(e){this.size=e},changeSwitch(e,a){a.$switch_yx=!0,setTimeout((async()=>{let e={id:a.id,status:a.active_status};const s=await this.$API.system.grade.status.post(e);200==s.code||(a.active_status=!a.active_status),delete a.$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))},a=await this.$API.system.grade.del.post(e);200===a.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 a={ids:[e.id]},s=await this.$API.system.grade.del.post(a);200===s.code&&(this.$refs.table.refresh(),this.$message.success("删除成功"))},handlerCommand(e,a){"edit"==a?this.table_edit(e):"delete"==a&&this.table_del(e)},handleSaveSuccess(e,a){("add"===a||"edit"===a)&&this.$refs.table.refresh()}}},h=s(83744);const m=(0,h.Z)(u,[["render",d]]);var p=m}}]);