"use strict";(self["webpackChunkvoghion_vue_admin"]=self["webpackChunkvoghion_vue_admin"]||[]).push([[5178],{5178:function(t,e,o){o.r(e),o.d(e,{default:function(){return m}});var i=function(){var t=this,e=t._self._c;return e("div",{staticClass:"g-pa-md g-bg-white"},[e("h2",[t._v("分组管理")]),e("div",{staticClass:"create"},[e("el-button",{attrs:{type:"primary",icon:"e-icon-plus"},on:{click:t.doAdd}},[t._v("新建")])],1),e("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],attrs:{data:t.data}},[e("el-table-column",{attrs:{prop:"code",label:"分组名称",align:"center"}}),e("el-table-column",{attrs:{prop:"owner",label:"创建人",align:"center"}}),e("el-table-column",{attrs:{prop:"createTime",label:"创建时间",align:"center"}}),e("el-table-column",{attrs:{prop:"updateTime",label:"修改时间",align:"center"}}),e("el-table-column",{attrs:{label:"操作",align:"center"},scopedSlots:t._u([{key:"default",fn:function(o){return[e("el-button",{attrs:{type:"text"},on:{click:function(e){return t.doEdit(o.row)}}},[t._v("编辑")]),e("el-button",{attrs:{type:"text"},on:{click:function(e){return t.doDel(o.row)}}},[t._v("删除")])]}}])}),e("el-table-column",{attrs:{label:"查看"},scopedSlots:t._u([{key:"default",fn:function(o){return[e("el-button",{attrs:{type:"text"},on:{click:function(e){return t.doScene(o.row)}}},[t._v("查看场景")])]}}])})],1),e("EditAddGroup",{attrs:{"row-info":t.rowInfo,visible:t.editAddVisible},on:{"update:visible":function(e){t.editAddVisible=e},"update-list":t.getList}})],1)},l=[],s=(o(44114),function(){var t=this,e=t._self._c;return e("el-dialog",{attrs:{visible:t.visible,title:t.title,"before-close":t.doClose},on:{"update:visible":function(e){t.visible=e}},scopedSlots:t._u([{key:"footer",fn:function(){return[e("el-button",{attrs:{type:"primary"},on:{click:t.doSubmit}},[t._v("确定")]),e("el-button",{attrs:{type:"default"},on:{click:t.doClose}},[t._v("取消")])]},proxy:!0}])},[e("el-form",{attrs:{model:t.form,"label-width":"auto"}},[e("el-form-item",{attrs:{label:"分组名称",prop:"code"}},[e("el-input",{model:{value:t.form.code,callback:function(e){t.$set(t.form,"code",e)},expression:"form.code"}})],1)],1)],1)}),a=[],n={props:{visible:{type:Boolean,default:!1},rowInfo:{type:Object,default:()=>({})}},data(){return{form:{code:""}}},computed:{isEdit(){return!!this.rowInfo.id},title(){return this.isEdit?"编辑":"新增"}},watch:{visible(t){if(t){const{code:t}=this.rowInfo;this.$set(this.form,"code",t)}}},methods:{doClose(){this.$emit("update:visible",!1)},async doSubmit(){if(this.isEdit){const{id:t}=this.rowInfo,e={id:t,code:this.form.code};await this.$store.dispatch({type:"abplatform/modifyAbPlatformGroupInfo",payload:e})}else await this.$store.dispatch({type:"abplatform/addAbPlatformNewGroup",payload:this.form});this.$emit("update:visible",!1),this.$emit("update-list")}}},r=n,d=o(81656),c=(0,d.A)(r,s,a,!1,null,null,null),u=c.exports,p={components:{EditAddGroup:u},data(){return{data:[],rowInfo:{},editAddVisible:!1,loading:!1}},mounted(){this.getList()},methods:{reset(){this.$refs.form.resetFields()},getList(){this.loading=!0,this.$store.dispatch({type:"abplatform/fetchAbPlatformGroupList",payload:{}}).then((t=>{this.loading=!1,this.data=t||[]}))},doAdd(){this.rowInfo={},this.editAddVisible=!0},doEdit(t){console.log("row",t),this.rowInfo={...t},this.editAddVisible=!0},doDel(t){this.$confirm("确定删除？","tips").then((async()=>{console.log("row",t),this.$store.dispatch({type:"abplatform/deleteAbPlatformGroup",payload:{code:t.code}}).then((()=>{this.getList()}))}))},doScene(t){console.log("执行跳转",t),this.$router.push({name:"场景管理",params:{code:t.code}})}}},f=p,b=(0,d.A)(f,i,l,!1,null,"3f090384",null),m=b.exports}}]);