企微助手 ,仓库名 短剧

69.8878ad191e961de239e2.js 10KB

1
  1. webpackJsonp([69],{"+dzJ":function(a,t){},FblD:function(a,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n("Xxa5"),e=n.n(i),r=n("exGp"),o=n.n(r),s=n("McOJ"),l=n("//Fk"),c=n.n(l),p=n("Dd8w"),d=n.n(p),m={name:"addMiniProDialog",props:{dialogVisible:{type:Boolean,default:function(){return!1}},miniProInfo:{type:Object,default:function(){return{}}}},data:function(){return{loading:!1,platformOptions:[],form:{app_name:"",app_id:"",platform_id:"",status:1}}},computed:{isEdit:function(){return this.miniProInfo&&this.miniProInfo.data_id},dialogTitle:function(){return this.isEdit?"编辑小程序":"添加小程序"}},watch:{dialogVisible:function(a){a&&(this.handleGetPlatformOptions(),this.handleInitData())}},methods:{handleGetPlatformOptions:function(){var a=this;return o()(e.a.mark(function t(){var n,i,r;return e.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,a.$axios.post(a.URL.BASEURL+a.URL.getPlatformOptions,{});case 2:n=t.sent,i=n.data,(r=void 0===i?{}:i)&&0==r.errno?a.platformOptions=r.rst:4002!=r.errno&&a.$message.warning(r.err);case 6:case"end":return t.stop()}},t,a)}))()},handleInitData:function(){if(this.loading=!1,this.isEdit){var a=this.miniProInfo,t=a.app_name,n=a.app_id,i=a.platform_id,e=a.status;this.form.app_name=t,this.form.app_id=n,this.form.platform_id=i,this.form.status=e}else this.form.app_name="",this.form.app_id="",this.form.platform_id="",this.form.status=1},handleConfirm:function(){var a=this;return o()(e.a.mark(function t(){var n,i,r,o,s;return e.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,a.handleFormValidate();case 3:return n=""+a.URL.BASEURL+a.URL.miniProManage_addSmallApp,i=d()({},a.form),a.isEdit&&(n=""+a.URL.BASEURL+a.URL.miniProManage_editSmallApp,i.data_id=a.miniProInfo.data_id),a.loading=!0,t.next=9,a.$axios.post(n,i);case 9:r=t.sent,o=r.data,(s=void 0===o?{}:o)&&0==s.errno?(a.$message.success("操作成功"),a.$emit("confirm",{isEdit:a.isEdit})):4002!=s.errno&&a.$message.warning(s.err||"操作失败"),t.next=18;break;case 15:t.prev=15,t.t0=t.catch(0),console.log(t.t0);case 18:return t.prev=18,a.loading=!1,t.finish(18);case 21:case"end":return t.stop()}},t,a,[[0,15,18,21]])}))()},handleCancel:function(){this.$emit("cancel")},handleFormValidate:function(){var a=this;return new c.a(function(t,n){var i=a.form,e=i.app_name,r=i.app_id,o=i.platform_id;e?r?o?t("表单校验通过"):(a.$message.warning("请选择平台"),n("表单校验未通过")):(a.$message.warning("请输入APPID"),n("表单校验未通过")):(a.$message.warning("请输入小程序名称"),n("表单校验未通过"))})}}},u={render:function(){var a=this,t=a.$createElement,n=a._self._c||t;return n("el-dialog",{staticClass:"addMiniPro-dialog",attrs:{visible:a.dialogVisible,"before-close":a.handleCancel,title:a.dialogTitle,width:"450px"},on:{"update:visible":function(t){a.dialogVisible=t}}},[n("div",{directives:[{name:"loading",rawName:"v-loading",value:a.loading,expression:"loading"}],staticClass:"form-wrap"},[n("div",{staticClass:"form-item"},[n("span",{staticClass:"lable"},[n("em",[a._v("*")]),a._v("小程序名称")]),a._v(" "),n("el-input",{attrs:{size:"small",placeholder:"请输入小程序名称",clearable:""},model:{value:a.form.app_name,callback:function(t){a.$set(a.form,"app_name",t)},expression:"form.app_name"}})],1),a._v(" "),n("div",{staticClass:"form-item"},[n("span",{staticClass:"lable"},[n("em",[a._v("*")]),a._v("APPID")]),a._v(" "),n("el-input",{attrs:{size:"small",placeholder:"请输入APPID",clearable:""},model:{value:a.form.app_id,callback:function(t){a.$set(a.form,"app_id",t)},expression:"form.app_id"}})],1),a._v(" "),n("div",{staticClass:"form-item"},[n("span",{staticClass:"lable"},[n("em",[a._v("*")]),a._v("所属平台")]),a._v(" "),n("el-select",{attrs:{size:"small",placeholder:"请选择所属平台",clearable:"",filterable:""},model:{value:a.form.platform_id,callback:function(t){a.$set(a.form,"platform_id",t)},expression:"form.platform_id"}},a._l(a.platformOptions,function(a){return n("el-option",{key:a.platform_id,attrs:{label:a.platform_name,value:a.platform_id}})}),1)],1),a._v(" "),n("div",{staticClass:"form-item"},[n("span",{staticClass:"lable"},[n("em",[a._v("*")]),a._v("是否启用")]),a._v(" "),n("el-switch",{attrs:{"active-color":"#43B083","active-value":1,"inactive-color":"#ccc","inactive-value":2},model:{value:a.form.status,callback:function(t){a.$set(a.form,"status",t)},expression:"form.status"}})],1)]),a._v(" "),n("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{attrs:{size:"mini"},on:{click:a.handleCancel}},[a._v("取 消")]),a._v(" "),n("el-button",{attrs:{size:"mini",type:"primary",disabled:a.loading},on:{click:a.handleConfirm}},[a._v("确 定")])],1)])},staticRenderFns:[]};var f=n("VU/8")(m,u,!1,function(a){n("+dzJ")},"data-v-30f6a572",null).exports,g={name:"miniProManage",components:{selfInput:s.a,addMiniProDialog:f},data:function(){return{height:"",loading:!1,pagination:{page:1,page_size:20,pages:0,total:0},filter:{app_name:""},miniProList:[],addMiniProDialogVisible:!1,currentMiniProInfo:{}}},created:function(){this.height=document.documentElement.clientHeight-200>400?document.documentElement.clientHeight-200:400,this.handleGetMiniPro()},methods:{handleGetMiniPro:function(){var a=this;return o()(e.a.mark(function t(){var n,i,r,o,s;return e.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,a.loading=!0,n=""+a.URL.BASEURL+a.URL.miniProManage_smallAppIndex,i={app_name:a.filter.app_name,page:a.pagination.page,page_size:a.pagination.page_size},t.next=6,a.$axios.post(n,i);case 6:r=t.sent,o=r.data,(s=void 0===o?{}:o)&&0==s.errno&&Array.isArray(s.rst.data)?(a.miniProList=s.rst.data,a.pagination.total=s.rst.pageInfo.total,a.pagination.pages=s.rst.pageInfo.pages):4002!=s.errno&&(a.$message.warning(s.err),a.miniProList=[],a.pagination.total=0,a.pagination.pages=0),t.next=18;break;case 12:t.prev=12,t.t0=t.catch(0),console.log(t.t0),a.miniProList=[],a.pagination.total=0,a.pagination.pages=0;case 18:return t.prev=18,a.loading=!1,t.finish(18);case 21:case"end":return t.stop()}},t,a,[[0,12,18,21]])}))()},handleCurrentChange:function(a){this.pagination.page=a,this.handleGetMiniPro()},onInputAppName:function(a){this.filter.app_name=a||"",this.pagination.page=1,this.handleGetMiniPro()},onClickAddMiniPro:function(){this.currentMiniProInfo={},this.addMiniProDialogVisible=!0},onClickEditMiniPro:function(a){this.currentMiniProInfo=a,this.addMiniProDialogVisible=!0},handleAddMiniProConfirm:function(a){var t=a.isEdit;this.addMiniProDialogVisible=!1,t||(this.pagination.page=1),this.handleGetMiniPro()},handleAddMiniProCancel:function(){this.addMiniProDialogVisible=!1},onClickEnable:function(a,t){var n=this;return o()(e.a.mark(function i(){var r;return e.a.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.prev=0,r=n.$createElement,i.next=4,n.$confirm("",{message:r("div",null,[r("span",null,"确定"+(0===t?"禁用":"启用")),r("span",{style:"color: #32B38A;"},""+a.app_name),r("span",null,"吗?")]),confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"});case 4:n.handleEnable(a,t),i.next=10;break;case 7:i.prev=7,i.t0=i.catch(0),console.log(i.t0);case 10:case"end":return i.stop()}},i,n,[[0,7]])}))()},handleEnable:function(a,t){var n=this;return o()(e.a.mark(function i(){var r,o,s,l,c;return e.a.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.prev=0,r=""+n.URL.BASEURL+n.URL.miniProManage_editSmallApp,o={data_id:a.data_id,app_name:a.app_name,app_id:a.app_id,platform_id:a.platform_id,status:t},n.loading=!0,i.next=6,n.$axios.post(r,o);case 6:s=i.sent,l=s.data,(c=void 0===l?{}:l)&&0==c.errno?(n.$message.success("操作成功"),n.handleGetMiniPro()):4002!=c.errno&&n.$message.warning(c.err||"操作失败"),i.next=15;break;case 12:i.prev=12,i.t0=i.catch(0),console.log(i.t0);case 15:return i.prev=15,n.loading=!1,i.finish(15);case 18:case"end":return i.stop()}},i,n,[[0,12,15,18]])}))()}}},v={render:function(){var a=this,t=a.$createElement,n=a._self._c||t;return n("div",{directives:[{name:"loading",rawName:"v-loading",value:a.loading,expression:"loading"}],staticClass:"miniProManage-wrap"},[n("div",{staticClass:"screenBox flex"},[n("div",{staticClass:"flex"},[n("selfInput",{attrs:{label_name:"搜索小程序"},on:{inputChange:a.onInputAppName}})],1),a._v(" "),n("div",{staticClass:"right"},[n("el-button",{attrs:{type:"primary",size:"mini"},on:{click:a.onClickAddMiniPro}},[a._v("添加小程序")])],1)]),a._v(" "),n("el-table",{staticStyle:{width:"100%","margin-top":"10px"},attrs:{height:a.height,data:a.miniProList,"tooltip-effect":"dark"}},[n("el-table-column",{attrs:{label:"小程序",prop:"app_name","min-width":"200",align:"center"}}),a._v(" "),n("el-table-column",{attrs:{label:"APPID",prop:"app_id","min-width":"200",align:"center"}}),a._v(" "),n("el-table-column",{attrs:{label:"创建时间",prop:"create_time","min-width":"160",align:"center"}}),a._v(" "),n("el-table-column",{attrs:{label:"状态","min-width":"160",align:"center"},scopedSlots:a._u([{key:"default",fn:function(t){return[1==t.row.status?n("span",{staticClass:"c-448AFF"},[a._v("启用")]):n("span",{staticClass:"c-F03F5C"},[a._v("禁用")])]}}])}),a._v(" "),n("el-table-column",{attrs:{label:"操作","min-width":"160",align:"center"},scopedSlots:a._u([{key:"default",fn:function(t){var i=t.row;return[n("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(t){return a.onClickEditMiniPro(i)}}},[a._v("编辑")]),a._v(" "),1==i.status?n("el-button",{attrs:{type:"danger",size:"mini"},on:{click:function(t){return a.onClickEnable(i,2)}}},[a._v("禁用")]):n("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(t){return a.onClickEnable(i,1)}}},[a._v("启用")])]}}])})],1),a._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:a.pagination.total>0,expression:"pagination.total > 0"}],staticClass:"pagination"},[n("el-pagination",{attrs:{background:"","current-page":a.pagination.page,layout:"prev, pager, next","page-count":Number(a.pagination.pages)},on:{"current-change":a.handleCurrentChange}})],1),a._v(" "),n("addMiniProDialog",{attrs:{dialogVisible:a.addMiniProDialogVisible,miniProInfo:a.currentMiniProInfo},on:{confirm:a.handleAddMiniProConfirm,cancel:a.handleAddMiniProCancel}})],1)},staticRenderFns:[]};var h=n("VU/8")(g,v,!1,function(a){n("XonX")},"data-v-8a4a4310",null);t.default=h.exports},XonX:function(a,t){}});