FastBee/docker/data/nginx/vue/static/js/chunk-4c79dd32.7c972061.js
2025-07-07 09:21:15 +08:00

1 line
13 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-4c79dd32"],{5474:function(e,t,n){"use strict";n("63ea")},"63ea":function(e,t,n){},"8e63":function(e,t,n){"use strict";n.d(t,"f",(function(){return i})),n.d(t,"c",(function(){return l})),n.d(t,"d",(function(){return r})),n.d(t,"e",(function(){return o})),n.d(t,"a",(function(){return c})),n.d(t,"g",(function(){return s})),n.d(t,"b",(function(){return u}));var a=n("b775");function i(e){return Object(a["a"])({url:"/notify/channel/list",method:"get",params:e})}function l(e){return Object(a["a"])({url:"/notify/channel/"+e,method:"get"})}function r(e){return Object(a["a"])({url:"/notify/channel/listChannel",method:"get",params:e})}function o(e,t){return Object(a["a"])({url:"/notify/channel/getConfigContent?channelType="+t+"&provider="+e,method:"get"})}function c(e){return Object(a["a"])({url:"/notify/channel",method:"post",data:e})}function s(e){return Object(a["a"])({url:"/notify/channel",method:"put",data:e})}function u(e){return Object(a["a"])({url:"/notify/channel/"+e,method:"delete"})}},c1f9:function(e,t,n){var a=n("23e7"),i=n("2266"),l=n("8418");a({target:"Object",stat:!0},{fromEntries:function(e){var t={};return i(e,(function(e,n){l(t,e,n)}),{AS_ENTRIES:!0}),t}})},f9b7:function(e,t,n){"use strict";n.r(t);var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"notify-channel"},[n("el-card",{directives:[{name:"show",rawName:"v-show",value:e.showSearch,expression:"showSearch"}],staticClass:"top-card-wrap"},[n("el-form",{ref:"queryForm",staticStyle:{"margin-bottom":"-18px",padding:"3px 0 0 0"},attrs:{model:e.queryParams,inline:!0,"label-width":"78px"},nativeOn:{submit:function(e){e.preventDefault()}}},[n("el-form-item",{attrs:{prop:"name"}},[n("el-input",{attrs:{placeholder:e.$t("notify.channel.index.333541-1"),clearable:""},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleQuery(t)}},model:{value:e.queryParams.name,callback:function(t){e.$set(e.queryParams,"name",t)},expression:"queryParams.name"}})],1),n("el-form-item",{attrs:{prop:"channelType"}},[n("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:e.$t("notify.channel.index.333541-3"),clearable:""},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleQuery(t)}},model:{value:e.queryParams.channelType,callback:function(t){e.$set(e.queryParams,"channelType",t)},expression:"queryParams.channelType"}},e._l(e.channelTypeList,(function(e){return n("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),n("div",{staticStyle:{float:"right"}},[n("el-button",{attrs:{type:"primary",icon:"el-icon-search"},on:{click:e.handleQuery}},[e._v(e._s(e.$t("search")))]),n("el-button",{attrs:{icon:"el-icon-refresh"},on:{click:e.resetQuery}},[e._v(e._s(e.$t("reset")))])],1)],1)],1),n("el-card",[n("el-row",{staticStyle:{"margin-bottom":"15px"},attrs:{gutter:10}},[n("el-col",{attrs:{span:1.5}},[n("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["notify:channel:add"],expression:"['notify:channel:add']"}],attrs:{type:"primary",plain:"",icon:"el-icon-plus",size:"small"},on:{click:e.handleAdd}},[e._v(e._s(e.$t("add")))])],1),n("el-col",{attrs:{span:1.5}},[n("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["notify:channel:remove"],expression:"['notify:channel:remove']"}],attrs:{plain:"",icon:"el-icon-delete",size:"small",disabled:e.multiple},on:{click:e.handleDelete}},[e._v(e._s(e.$t("del")))])],1),n("right-toolbar",{attrs:{showSearch:e.showSearch},on:{"update:showSearch":function(t){e.showSearch=t},"update:show-search":function(t){e.showSearch=t},queryTable:e.getList}})],1),n("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],attrs:{data:e.channelList,border:!1},on:{"selection-change":e.handleSelectionChange}},[n("el-table-column",{attrs:{type:"selection",align:"center",width:"55"}}),n("el-table-column",{attrs:{label:e.$t("notify.channel.index.333541-18"),align:"center",prop:"id",width:"60"}}),n("el-table-column",{attrs:{label:e.$t("notify.channel.index.333541-0"),align:"left",prop:"name","min-width":"180"}}),n("el-table-column",{attrs:{label:e.$t("notify.channel.index.333541-6"),align:"center",prop:"channelType",width:"110"},scopedSlots:e._u([{key:"default",fn:function(t){return[n("dict-tag",{attrs:{options:e.dict.type.notify_channel_type,value:t.row.channelType}})]}}])}),n("el-table-column",{attrs:{label:e.$t("notify.channel.index.333541-7"),align:"center",prop:"provider",width:"160"}}),n("el-table-column",{attrs:{label:e.$t("notify.channel.index.333541-8"),align:"center",prop:"createTime",width:"190"},scopedSlots:e._u([{key:"default",fn:function(t){return[n("span",[e._v(e._s(e.parseTime(t.row.createTime,"{y}-{m}-{d} {h}:{m}:{s}")))])]}}])}),n("el-table-column",{attrs:{fixed:"right",label:e.$t("opation"),align:"center","class-name":"small-padding fixed-width",width:"120"},scopedSlots:e._u([{key:"default",fn:function(t){return[n("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["notify:channel:query"],expression:"['notify:channel:query']"}],attrs:{size:"small",type:"text",icon:"el-icon-view"},on:{click:function(n){return e.handleUpdate(t.row)}}},[e._v(e._s(e.$t("detail")))]),n("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["notify:channel:remove"],expression:"['notify:channel:remove']"}],attrs:{size:"small",type:"text",icon:"el-icon-delete"},on:{click:function(n){return e.handleDelete(t.row)}}},[e._v(e._s(e.$t("del")))])]}}])})],1),n("pagination",{directives:[{name:"show",rawName:"v-show",value:e.total>0,expression:"total > 0"}],staticStyle:{"margin-bottom":"20px"},attrs:{total:e.total,page:e.queryParams.pageNum,limit:e.queryParams.pageSize},on:{"update:page":function(t){return e.$set(e.queryParams,"pageNum",t)},"update:limit":function(t){return e.$set(e.queryParams,"pageSize",t)},pagination:e.getList}})],1),n("el-dialog",{attrs:{title:e.title,visible:e.open,width:"610px","append-to-body":""},on:{"update:visible":function(t){e.open=t}}},[n("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"130px"}},[n("el-form-item",{attrs:{label:e.$t("notify.channel.index.333541-0"),prop:"name"}},[n("el-input",{staticStyle:{width:"390px"},attrs:{placeholder:e.$t("notify.channel.index.333541-1")},model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}})],1),n("el-form-item",{attrs:{label:e.$t("notify.channel.index.333541-2"),prop:"channelType"}},[n("el-select",{staticStyle:{width:"390px"},attrs:{placeholder:e.$t("notify.channel.index.333541-3"),clearable:""},on:{change:e.changeChannel},model:{value:e.form.channelType,callback:function(t){e.$set(e.form,"channelType",t)},expression:"form.channelType"}},e._l(e.channelTypeList,(function(e){return n("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),n("el-form-item",{attrs:{label:e.$t("notify.channel.index.333541-7"),prop:"provider"}},[n("el-select",{staticStyle:{width:"390px"},attrs:{placeholder:e.$t("notify.channel.index.333541-10"),clearable:"",disabled:null==e.form.channelType},on:{change:e.changeService},model:{value:e.form.provider,callback:function(t){e.$set(e.form,"provider",t)},expression:"form.provider"}},e._l(e.list,(function(e){return n("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),e._l(e.configList,(function(t,a){return n("el-form-item",{key:a,attrs:{label:t.label}},["string"==t.type?n("el-input",{staticStyle:{width:"390px"},attrs:{placeholder:e.$t("notify.channel.index.333541-11"),autosize:{minRows:3,maxRows:5},type:"textarea"},model:{value:t.value,callback:function(n){e.$set(t,"value",n)},expression:"item.value"}}):e._e(),"int"==t.type?n("el-input",{staticStyle:{width:"390px"},attrs:{placeholder:e.$t("notify.channel.index.333541-11"),type:"number"},model:{value:t.value,callback:function(n){e.$set(t,"value",n)},expression:"item.value"}}):e._e(),"text"==t.type?n("editor",{attrs:{"min-height":192},model:{value:t.value,callback:function(n){e.$set(t,"value",n)},expression:"item.value"}}):e._e(),"boolean"==t.type?n("el-switch",{attrs:{"active-color":"#13ce66","inactive-color":"#c0c0c0"},model:{value:t.value,callback:function(n){e.$set(t,"value",n)},expression:"item.value"}}):e._e()],1)}))],2),n("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["notify:channel:edit"],expression:"['notify:channel:edit']"},{name:"show",rawName:"v-show",value:e.form.id,expression:"form.id"}],attrs:{type:"primary"},on:{click:e.submitForm}},[e._v(e._s(e.$t("update")))]),n("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["notify:channel:add"],expression:"['notify:channel:add']"},{name:"show",rawName:"v-show",value:!e.form.id,expression:"!form.id"}],attrs:{type:"primary"},on:{click:e.submitForm}},[e._v(e._s(e.$t("add")))]),n("el-button",{on:{click:e.cancel}},[e._v(e._s(e.$t("cancel")))])],1)],1)],1)},i=[],l=n("5530"),r=n("c7eb"),o=n("1da1"),c=(n("4de4"),n("caad"),n("d81d"),n("b0c0"),n("e9c4"),n("c1f9"),n("b64b"),n("d3b7"),n("2532"),n("8e63")),s={name:"Channel",dicts:["notify_channel_type","notify_message_type","iot_yes_no","notify_service_code"],data:function(){return{loading:!0,ids:[],single:!0,multiple:!0,modelList:[],showSearch:!0,total:0,channelList:[],channelTypeList:[],title:"",open:!1,configType:"",queryParams:{pageNum:1,pageSize:10,name:null,channelType:null,provider:null,configContent:null},configList:[],channelMsgList:[],channelChildren:[],list:[],configContent:[],form:{},rules:{name:[{required:!0,message:this.$t("notify.channel.index.333541-12"),trigger:"blur"}],channelType:[{required:!0,message:this.$t("notify.channel.index.333541-13"),trigger:"change"}],provider:[{required:!0,message:this.$t("notify.channel.index.333541-14"),trigger:"blur"}]}}},created:function(){this.getList(),this.getInfo()},methods:{getList:function(){var e=this;this.loading=!0,Object(c["f"])(this.queryParams).then((function(t){e.channelList=t.rows,e.total=t.total,e.loading=!1}))},cancel:function(){this.open=!1,this.reset()},reset:function(){this.form={id:null,name:null,channelType:null,provider:null,configContent:null,createBy:null,createTime:null,updateBy:null,updateTime:null,delFlag:null},this.resetForm("form")},handleQuery:function(){this.queryParams.pageNum=1,this.getList()},resetQuery:function(){this.resetForm("queryForm"),this.handleQuery()},handleSelectionChange:function(e){this.ids=e.map((function(e){return e.id})),this.single=1!==e.length,this.multiple=!e.length},handleAdd:function(){this.reset(),this.open=!0,this.title=this.$t("notify.channel.index.333541-15"),this.configList=[]},handleUpdate:function(e){var t=this;return Object(o["a"])(Object(r["a"])().mark((function n(){var a;return Object(r["a"])().wrap((function(n){while(1)switch(n.prev=n.next){case 0:t.reset(),a=e.id||t.ids,t.$nextTick((function(){t.form.channelType=e.channelType,t.form.provider=e.provider,t.getConfig()})),setTimeout((function(){Object(c["c"])(a).then((function(e){if(t.form=e.data,t.open=!0,t.title=t.$t("notify.channel.index.333541-16"),t.getServiceList(),""!=t.form.configContent)for(var n=JSON.parse(t.form.configContent),a=0;a<t.configList.length;a++)for(var i in n)t.configList[a].attribute==i&&(t.configList[a].value=n[i])}))}),500);case 4:case"end":return n.stop()}}),n)})))()},getInfo:function(){var e=this;this.loading=!0,Object(c["d"])().then((function(t){e.channelMsgList=t.data,e.channelTypeList=t.data.map((function(e){return{value:e.channelType,label:e.channelName}})),e.providerList=t.data.map((function(e){return e.providerList}))})),this.loading=!1},changeChannel:function(){this.getServiceList(),this.form.provider="",this.configList=[]},getServiceList:function(){var e=this.form.channelType;this.channelChildren=this.channelMsgList.filter((function(t){return e.includes(t.channelType)})).map((function(e){return e.providerList}));for(var t=0;t<this.channelChildren.length;t++)this.list=this.channelChildren[t].map((function(e){return{value:e.provider,label:e.providerName,config:e.configContent}}))},changeService:function(){this.getServiceList(),this.getConfig()},getConfig:function(){var e=this;Object(c["e"])(this.form.provider,this.form.channelType).then((function(t){e.configList=t.data.map((function(e){return{value:e.value,label:e.name,attribute:e.attribute,type:e.type}}));for(var n=0;n<e.configList.length;n++)"boolean"===e.configList[n].type&&(e.configList[n].value=Boolean(e.configList[n].value))}))},submitForm:function(){var e=this,t=this.configList.map((function(e){return[e.attribute,e.value]})),n=Object.fromEntries(t),a=JSON.stringify(n),i={id:this.form.id,name:this.form.name,channelType:this.form.channelType,provider:this.form.provider,configContent:a};this.$refs["form"].validate((function(t){t&&(null!=e.form.id?Object(c["g"])(i).then((function(t){e.$modal.msgSuccess(e.$t("updateSuccess")),e.open=!1,e.getList()})):Object(c["a"])(i).then((function(t){e.$modal.msgSuccess(e.$t("addSuccess")),e.open=!1,e.getList()})))}))},handleDelete:function(e){var t=this,n=e.id||this.ids;this.$modal.confirm(this.$t("notify.channel.index.333541-17",[n])).then((function(){return Object(c["b"])(n)})).then((function(){t.getList(),t.$modal.msgSuccess(t.$t("delSuccess"))})).catch((function(){}))},handleExport:function(){this.download("notify/channel/export",Object(l["a"])({},this.queryParams),"channel_".concat((new Date).getTime(),".xlsx"))}}},u=s,h=(n("5474"),n("2877")),d=Object(h["a"])(u,a,i,!1,null,"2fce8728",null);t["default"]=d.exports}}]);