"use strict";(self["webpackChunkmi_wifi_agent"]=self["webpackChunkmi_wifi_agent"]||[]).push([[3983],{7777:function(e,l,t){t.r(l),t.d(l,{default:function(){return u}});var i=t(641);const a={class:"left-panel"};function n(e,l,t,n,s,o){const d=(0,i.g2)("el-button"),r=(0,i.g2)("el-header"),c=(0,i.g2)("el-table-column"),u=(0,i.g2)("sc-status-indicator"),p=(0,i.g2)("el-popconfirm"),b=(0,i.g2)("scTable"),h=(0,i.g2)("el-main"),f=(0,i.g2)("el-container"),g=(0,i.g2)("save-dialog"),m=(0,i.g2)("info"),k=(0,i.g2)("el-drawer");return(0,i.uX)(),(0,i.CE)(i.FK,null,[(0,i.bF)(f,null,{default:(0,i.k6)((()=>[(0,i.bF)(r,null,{default:(0,i.k6)((()=>[(0,i.Lk)("div",a,[(0,i.bF)(d,{type:"primary",icon:"el-icon-plus",onClick:o.add},null,8,["onClick"]),(0,i.bF)(d,{type:"primary",icon:"el-icon-plus",onClick:o.addPage},{default:(0,i.k6)((()=>[(0,i.eW)("页面新增")])),_:1},8,["onClick"]),(0,i.bF)(d,{type:"danger",plain:"",icon:"el-icon-delete",disabled:0==s.selection.length,onClick:o.batch_del},null,8,["disabled","onClick"])])])),_:1}),(0,i.bF)(h,{class:"nopadding"},{default:(0,i.k6)((()=>[(0,i.bF)(b,{ref:"table",apiObj:s.list.apiObj,"row-key":"id",onSelectionChange:o.selectionChange,stripe:""},{default:(0,i.k6)((()=>[(0,i.bF)(c,{type:"selection",width:"50"}),(0,i.bF)(c,{label:"姓名",prop:"name",width:"180"}),(0,i.bF)(c,{label:"性别",prop:"sex",width:"150"}),(0,i.bF)(c,{label:"邮箱",prop:"email",width:"250"}),(0,i.bF)(c,{label:"状态",prop:"boolean",width:"60"},{default:(0,i.k6)((e=>[e.row.boolean?((0,i.uX)(),(0,i.Wv)(u,{key:0,type:"success"})):(0,i.Q3)("",!0),e.row.boolean?(0,i.Q3)("",!0):((0,i.uX)(),(0,i.Wv)(u,{key:1,pulse:"",type:"danger"}))])),_:1}),(0,i.bF)(c,{label:"评分",prop:"num",width:"150"}),(0,i.bF)(c,{label:"操作",fixed:"right",align:"right",width:"300"},{default:(0,i.k6)((e=>[(0,i.bF)(d,{plain:"",size:"small",onClick:l=>o.table_show(e.row)},{default:(0,i.k6)((()=>[(0,i.eW)("查看")])),_:2},1032,["onClick"]),(0,i.bF)(d,{type:"primary",plain:"",size:"small",onClick:l=>o.table_edit(e.row)},{default:(0,i.k6)((()=>[(0,i.eW)("编辑")])),_:2},1032,["onClick"]),(0,i.bF)(d,{type:"primary",plain:"",size:"small",onClick:l=>o.table_edit_page(e.row)},{default:(0,i.k6)((()=>[(0,i.eW)("页面编辑")])),_:2},1032,["onClick"]),(0,i.bF)(p,{title:"确定删除吗？",onConfirm:l=>o.table_del(e.row,e.$index)},{reference:(0,i.k6)((()=>[(0,i.bF)(d,{plain:"",type:"danger",size:"small"},{default:(0,i.k6)((()=>[(0,i.eW)("删除")])),_:1})])),_:2},1032,["onConfirm"])])),_:1})])),_:1},8,["apiObj","onSelectionChange"])])),_:1})])),_:1}),s.dialog.save?((0,i.uX)(),(0,i.Wv)(g,{key:0,ref:"saveDialog",onSuccess:o.handleSaveSuccess,onClosed:l[0]||(l[0]=e=>s.dialog.save=!1)},null,8,["onSuccess"])):(0,i.Q3)("",!0),(0,i.bF)(k,{modelValue:s.dialog.info,"onUpdate:modelValue":l[1]||(l[1]=e=>s.dialog.info=e),size:800,title:"详细",direction:"rtl","destroy-on-close":""},{default:(0,i.k6)((()=>[(0,i.bF)(m,{ref:"infoDialog"},null,512)])),_:1},8,["modelValue"])],64)}t(8743);var s=t(1628),o=t(253),d={name:"listCrud",components:{saveDialog:s["default"],info:o["default"]},data(){return{dialog:{save:!1,info:!1},list:{apiObj:this.$API.demo.list},selection:[]}},mounted(){},methods:{add(){this.dialog.save=!0,this.$nextTick((()=>{this.$refs.saveDialog.open()}))},table_edit(e){this.dialog.save=!0,this.$nextTick((()=>{this.$refs.saveDialog.open("edit").setData(e)}))},addPage(){this.$router.push({path:"/template/list/crud/detail"})},table_edit_page(e){this.$router.push({path:"/template/list/crud/detail",query:{id:e.id}})},table_show(e){this.dialog.info=!0,this.$nextTick((()=>{this.$refs.infoDialog.setData(e)}))},async table_del(e,l){var t={id:e.id},i=await this.$API.demo.post.post(t);200==i.code?(this.$refs.table.removeIndex(l),this.$message.success("删除成功")):this.$alert(i.message,"提示",{type:"error"})},async batch_del(){var e=await this.$confirm(`确定删除选中的 ${this.selection.length} 项吗？`,"提示",{type:"warning",confirmButtonText:"删除",confirmButtonClass:"el-button--danger"}).catch((()=>{}));if(!e)return!1;var l=this.selection.map((e=>e.id));this.$refs.table.removeKeys(l),this.$message.success("操作成功")},selectionChange(e){this.selection=e},handleSaveSuccess(e,l){"add"==l?this.$refs.table.unshiftRow(e):"edit"==l&&this.$refs.table.updateKey(e)}}},r=t(6262);const c=(0,r.A)(d,[["render",n]]);var u=c}}]);