(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-69ec3821"],{"34b8":function(t,n,a){var i={"./app_plat_pic.png":"6494","./h5_plat_pic.png":"17c0","./pc_plat_pic.png":"79f5","./routine_plat_pic.png":"e10f","./wechat_plat_pic.png":"5da1"};function s(t){var n=e(t);return a(n)}function e(t){if(!a.o(i,t)){var n=new Error("Cannot find module '"+t+"'");throw n.code="MODULE_NOT_FOUND",n}return i[t]}s.keys=function(){return Object.keys(i)},s.resolve=e,t.exports=s,s.id="34b8"},3759:function(t,n,a){"use strict";a.r(n);var i=a("90e7"),s={routine:"/admin/app/routine/download",wechat:"/admin/app/wechat/base",h5:"/admin/setting/shop/base",app:"/admin/app/app",pc:"/admin/app/pc"},e={name:"appChannel",data:function(){return{columns:[{title:" ",slot:"type",width:50},{title:"渠道名称",slot:"title",minWidth:160},{title:"渠道介绍",key:"intro",minWidth:320},{title:"状态",slot:"status",miWidth:120,align:"center"},{title:"操作",slot:"action",minWidth:120,align:"center"}],channelList:[],loading:!1,switchLoading:""}},mounted:function(){this.getFeatureSwitch()},methods:{getFeatureSwitch:function(){var t=this;this.loading=!0,Object(i.m)("channel").then((function(n){var a=(n.data&&n.data.groups||[]).find((function(t){return"terminal_channel"===t.group_key}));t.channelList=a&&a.list||[]})).catch((function(n){t.$Message.error(n&&n.msg||"获取开关配置失败")})).finally((function(){t.loading=!1}))},changeStatus:function(t){var n=this,a=t.status,s=a?0:1;this.switchLoading=t.switch_key,Object(i.n)("channel",t.switch_key,a).then((function(t){n.$Message.success(t.msg),n.syncChannelList(t.data&&t.data.groups||[]),n.refreshMenusAuth()})).catch((function(a){t.status=s,n.$Message.error(a&&a.msg||"修改失败")})).finally((function(){n.switchLoading=""}))},syncChannelList:function(t){var n=t.find((function(t){return"terminal_channel"===t.group_key}));this.channelList=n&&n.list||[]},refreshMenusAuth:function(){var t=this;this.$store.dispatch("admin/menus/getMenusNavList").catch((function(n){t.$Message.error(n&&n.msg||"刷新菜单权限失败，请刷新后台后重试")}))},goConfig:function(t){if(this.canGoConfig(t)){var n=s[t.switch_key];this.$router.push({path:n})}},canGoConfig:function(t){return!(!t||1!==Number(t.status)||!s[t.switch_key])}}},c=(a("f19f"),a("2877")),o=Object(c.a)(e,(function(){var t=this,n=t._self._c;return n("div",{staticClass:"channel-switch"},[n("Card",{staticClass:"switch-card",attrs:{bordered:!1,"dis-hover":""}},[n("Table",{attrs:{columns:t.columns,data:t.channelList,loading:t.loading,"highlight-row":""},scopedSlots:t._u([{key:"title",fn:function(i){var s=i.row;return[n("div",{staticClass:"w-80 flex-y-center"},[n("img",{staticClass:"w-32 h-32",attrs:{src:a("34b8")("./".concat(s.switch_key,"_plat_pic.png")),alt:""}}),n("span",{staticClass:"pl-12 fs-12"},[t._v(t._s(s.title))])])]}},{key:"status",fn:function(a){var i=a.row;return[n("i-switch",{attrs:{"true-value":1,"false-value":0,size:"large"},on:{"on-change":function(n){return t.changeStatus(i)}},model:{value:i.status,callback:function(n){t.$set(i,"status",n)},expression:"row.status"}},[n("span",{attrs:{slot:"open"},slot:"open"},[t._v("开启")]),n("span",{attrs:{slot:"close"},slot:"close"},[t._v("关闭")])])]}},{key:"action",fn:function(a){var i=a.row;return[n("a",{staticClass:"config-link",class:{"is-disabled":!t.canGoConfig(i)},attrs:{"aria-disabled":!t.canGoConfig(i)},on:{click:function(n){return t.goConfig(i)}}},[t._v("去配置")])]}}])})],1)],1)}),[],!1,null,"0cd9a30b",null);n.default=o.exports},"6ae8":function(t,n,a){},f19f:function(t,n,a){"use strict";a("6ae8")}}]);