(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["p3"],{5319:function(e,t,a){"use strict";a.r(t);var r=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("Shell",{attrs:{tab:"app",breadcrumb:e.breadcrumb}},[a("Panel",{attrs:{type:"body"}},[a("VTApp")],1)],1)},i=[],n=a("9646"),l=a("a020"),o=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticStyle:{height:"100%"}},[a("SCPortal_Table",{attrs:{total:e.table.total,loading:e.table.loading,columns:e.table.columns,actions:e.table.actions,data:e.table.data,selectedItem:e.table.selectedItem},on:{"update:total":function(t){return e.$set(e.table,"total",t)},"update:loading":function(t){return e.$set(e.table,"loading",t)},"update:selectedItem":function(t){return e.$set(e.table,"selectedItem",t)},"update:selected-item":function(t){return e.$set(e.table,"selectedItem",t)},load:e.load,action:e.action}},[a("SCPortal_TableButton",{attrs:{type:"primary"},on:{click:e.refresh}},[e._v("刷新")]),a("SCPortal_TableButton",{attrs:{type:"primary"},on:{click:e.openCreate}},[e._v("新建")]),e.table.selectedItem.length>0?[a("SCPortal_TableButton",{attrs:{type:"danger"},on:{click:e.deleteRecord}},[e._v("删除")])]:e._e()],2),a("Dialog",{attrs:{width:"50%",title:"创建应用"},on:{confirm:e.createRecord},model:{value:e.visible.create,callback:function(t){e.$set(e.visible,"create",t)},expression:"visible.create"}},[a("SCPortal_Form",{attrs:{parameter:e.createParameter,data:e.createData,submitable:e.createEnable},on:{"update:data":function(t){e.createData=t},"update:submitable":function(t){e.createEnable=t}}})],1),a("Dialog",{attrs:{title:"编辑应用"},on:{confirm:e.editRecord},model:{value:e.visible.edit,callback:function(t){e.$set(e.visible,"edit",t)},expression:"visible.edit"}},[a("SCPortal_Form",{attrs:{parameter:e.editParameter,data:e.editData,submitable:e.editEnable},on:{"update:data":function(t){e.editData=t},"update:submitable":function(t){e.editEnable=t}}})],1)],1)},s=[],c=a("1da1"),d=a("76b2"),u=a("b67d"),b={components:{Dialog:l["Dialog"],SCPortal_Table:d["Table"],SCPortal_TableButton:d["TableButton"],SCPortal_Form:u["Form"]},props:[],data(){return{servicePrefix:"/admin/app/appInfo",table:{path:"/admin/app/appInfoQuery",total:0,loading:!1,parameter:{},data:[],selectedItem:[],columns:[{name:"id",text:"编号",key:!0},{name:"name",text:"应用名",sort:!0},{name:"desc",text:"描述"},{name:"url",text:"应用URL地址"}],actions:[{name:"edit",text:"编辑"},{name:"detail",text:"详情"}]},visible:{create:!1,edit:!1},createParameter:{},createData:{},createEnable:!1,editParameter:{},editData:{},editEnable:!1}},mounted(){const e=horizon.store.state.sumor.metadata;this.createParameter=e[this.servicePrefix+"Create"].parameters,this.editParameter=e[this.servicePrefix+"Edit"].parameters},methods:{load:function(){var e=Object(c["a"])((function*(e){yield horizon.query(this.table,e)}));function t(t){return e.apply(this,arguments)}return t}(),refresh:function(){var e=Object(c["a"])((function*(){yield horizon.query(this.table,null)}));function t(){return e.apply(this,arguments)}return t}(),createRecord:function(){var e=Object(c["a"])((function*(){if(this.createEnable){const e=yield horizon.call(this.servicePrefix+"Create",this.createData);"OK"===e.code?(this.visible.create=!1,this.refresh()):horizon.message.error(e.message)}else horizon.message.error("表单输入有误，请检查")}));function t(){return e.apply(this,arguments)}return t}(),editRecord:function(){var e=Object(c["a"])((function*(){if(this.editEnable){const e=yield horizon.call(this.servicePrefix+"Edit",this.editData);"OK"===e.code?(this.visible.edit=!1,this.table.selectedItem=[],this.refresh()):horizon.message.error(e.message)}else horizon.message.error("表单输入有误，请检查")}));function t(){return e.apply(this,arguments)}return t}(),deleteRecord:function(){var e=Object(c["a"])((function*(){const e=yield horizon.call(this.servicePrefix+"Delete",{id:this.table.selectedItem});"OK"===e.code?(this.table.selectedItem=[],this.refresh()):horizon.message.error(e.message)}));function t(){return e.apply(this,arguments)}return t}(),openCreate:function(){this.createData={},this.visible.create=!0},openEdit:function(e){for(let t in this.table.data)this.table.data[t].id===e&&(this.editData=JSON.parse(JSON.stringify(this.table.data[t])));this.visible.edit=!0},action:function(e){let t=e.action,a=e.id;switch(t){case"edit":this.openEdit(a);break;case"detail":this.$router.push("/admin/app/"+a);break}}}},m=b,p=a("2877"),h=Object(p["a"])(m,o,s,!1,null,"0051a867",null),f=h.exports,v={components:{Shell:n["a"],Panel:l["Panel"],VTApp:f},data(){return{breadcrumb:[{url:"/admin/apps",text:"应用管理"}]}}},P=v,y=Object(p["a"])(P,r,i,!1,null,null,null);t["default"]=y.exports}}]);