"use strict";(self["webpackChunkvoghion_vue_admin"]=self["webpackChunkvoghion_vue_admin"]||[]).push([[87491],{87491:function(e,t,o){o.r(t),o.d(t,{default:function(){return b}});var i=function(){var e=this,t=e._self._c;return t("div",{staticClass:"g-pa-md g-bg-white"},[t("h2",[e._v("域管理")]),t("div",{staticStyle:{"text-align":"right"}},[t("el-button",{attrs:{type:"primary",icon:"e-icon-plus"},on:{click:e.doAdd}},[e._v("新建")])],1),t("el-table",{attrs:{data:e.data}},[t("el-table-column",{attrs:{prop:"groupCode",align:"center",label:"分组"}}),t("el-table-column",{attrs:{prop:"sceneCode",align:"center",label:"场景"}}),t("el-table-column",{attrs:{prop:"code",align:"center",label:"域"}}),t("el-table-column",{attrs:{prop:"createTime",align:"center",label:"创建时间"}}),t("el-table-column",{attrs:{prop:"updateTime",align:"center",label:"修改时间"}}),t("el-table-column",{attrs:{align:"center",label:"操作"},scopedSlots:e._u([{key:"default",fn:function(o){return[t("el-button",{attrs:{type:"text"},on:{click:function(t){return e.doEdit(o.row)}}},[e._v("编辑")]),t("el-button",{attrs:{type:"text"},on:{click:function(t){return e.doDel(o.row)}}},[e._v("删除")])]}}])}),t("el-table-column",{attrs:{align:"center",label:"查看"},scopedSlots:e._u([{key:"default",fn:function(o){return[t("el-button",{attrs:{type:"text"},on:{click:function(t){return e.doViewLayer(o.row)}}},[e._v("查看层")])]}}])})],1),t("EditAddDomain",{attrs:{visible:e.addEditVisible,"row-info":e.rowInfo},on:{"update:visible":function(t){e.addEditVisible=t},"update-list":e.getList}})],1)},l=[],s=(o(44114),function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{title:e.title,visible:e.visible,"before-close":e.doClose},on:{"update:visible":function(t){e.visible=t}},scopedSlots:e._u([{key:"footer",fn:function(){return[t("el-button",{attrs:{loading:e.loading,type:"primary"},on:{click:e.doSubmit}},[e._v("确定")]),t("el-button",{attrs:{type:"default"},on:{click:e.doClose}},[e._v("取消")])]},proxy:!0}])},[t("el-form",{attrs:{model:e.form,"label-width":"auto"}},[t("el-form-item",{attrs:{label:"域"}},[t("el-input",{model:{value:e.form.code,callback:function(t){e.$set(e.form,"code",t)},expression:"form.code"}})],1),t("el-form-item",{attrs:{label:"分组"}},[t("el-select",{attrs:{disabled:""},model:{value:e.form.groupCode,callback:function(t){e.$set(e.form,"groupCode",t)},expression:"form.groupCode"}},e._l(e.groupList,(function(e){return t("el-option",{key:e.id+e.code,attrs:{label:e.code,value:e.code}})})),1)],1),t("el-form-item",{attrs:{label:"场景"}},[t("el-select",{attrs:{disabled:""},model:{value:e.form.sceneCode,callback:function(t){e.$set(e.form,"sceneCode",t)},expression:"form.sceneCode"}},e._l(e.sceneList,(function(e){return t("el-option",{key:e.id+e.code,attrs:{label:e.code,value:e.code}})})),1)],1)],1)],1)}),a=[],r={props:{visible:{type:Boolean,default:!1},rowInfo:{type:Object,default:()=>({})}},data(){return{form:{code:"",sceneCode:"",groupCode:""},loading:!1}},computed:{isEdit(){return!!this.rowInfo.id},title(){return this.rowInfo.id?"编辑":"新建"},groupList(){return console.log("this.$store.state",this.$store.state),this.$store.state.abplatform.groupList||[]},sceneList(){return this.$store.state.abplatform.sceneList||[]}},watch:{rowInfo(e){this.$set(this.form,"groupCode",e.groupCode),this.$set(this.form,"sceneCode",e.sceneCode),this.$set(this.form,"code",e.code)}},methods:{doClose(){this.$emit("update:visible",!1)},async doSubmit(){this.loading=!0,this.isEdit?await this.$store.dispatch({type:"abplatform/modifyDomain",payload:{...this.form,id:this.rowInfo.id}}):await this.$store.dispatch({type:"abplatform/addNewDomain",payload:this.form}),this.loading=!1,this.$emit("update:visible",!1),this.$emit("update-list")}}},n=r,d=o(81656),c=(0,d.A)(n,s,a,!1,null,null,null),u=c.exports,p={components:{EditAddDomain:u},data(){return{data:[],addEditVisible:!1,rowInfo:{}}},mounted(){this.getList()},methods:{getList(){const{sceneCode:e,groupCode:t}=this.$route.query;this.$store.dispatch({type:"abplatform/fetchDomainByGroupOrScene",payload:{sceneCode:e,groupCode:t}}).then((e=>{this.data=e}))},doEdit(e){this.rowInfo={...e},this.addEditVisible=!0},doAdd(e){const{sceneCode:t,groupCode:o}=this.$route.query;this.rowInfo={sceneCode:t,groupCode:o,code:""},this.addEditVisible=!0},doDel(e){this.$store.dispatch({type:"abplatform/deleteDomain",payload:{id:e.id}}).then((e=>{this.getList()}))},doViewLayer(e){console.log("row",e);const{groupCode:t,sceneCode:o,id:i,code:l}=e;this.$router.push({path:"/abPlatform/layer",query:{sceneCode:o,groupCode:t,domainId:i,domainCode:l}})}}},f=p,m=(0,d.A)(f,i,l,!1,null,"367ef2c0",null),b=m.exports}}]);