企微助手 ,仓库名 短剧

25.6f2305cdf967d4285f31.js 29KB

1
  1. webpackJsonp([25],{"5wuF":function(t,e,a){"use strict";var i=a("mvHQ"),n=a.n(i),s=a("Dd8w"),r=a.n(s),o=a("Xxa5"),l=a.n(o),c=a("exGp"),u=a.n(c),d=a("u2KI"),p=a.n(d),h=a("gzej"),g=a("UOPL"),m=a("M4fF"),_=a.n(m),f=a("2Uyi"),v=a("CZ54"),C={components:{datePicker:h.a,editCon:g.a,templateGroupDialog:v.a},props:["drawer_title","template_id"],data:function(){return{loading:!0,resetFlag:!1,send_conf:[{natural_day:"",send_time:"",add_time:null,add_start_time:"",add_end_time:""}],title:"",content:"",attachments:[],detailFromApi:p()({}),group_id:"",groupOptions:[],tempGroupVisible:!1}},created:function(){this.handleGetGroupOptions(),this.template_id?this.detail():this.loading=!1},methods:{handleGetGroupOptions:function(){var t=this;return u()(l.a.mark(function e(){var a,i,n,s;return l.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a={status:1,page:1,page_size:1e3},e.next=3,t.$axios.post(t.URL.BASEURL+t.URL.smartPushV3_tempGroupList,a);case 3:i=e.sent,n=i.data,(s=void 0===n?{}:n)&&0==s.errno&&Array.isArray(s.rst.data)?t.groupOptions=s.rst.data:4002!=s.errno&&(t.$message.warning(s.err),t.groupOptions=[]);case 7:case"end":return e.stop()}},e,t)}))()},onChangeGroupId:function(t){this.group_id=t||""},onClickCreateGroup:function(){this.tempGroupVisible=!0},onConfirmGroup:function(){this.handleGetGroupOptions(),this.tempGroupVisible=!1},onCancelGroup:function(){this.tempGroupVisible=!1},detail:function(){var t=this;this.loading=!0,this.$axios.get(this.URL.BASEURL+this.URL.smartPushV3_templateDetail,{params:{template_id:this.template_id}}).then(function(e){e=e.data;t.loading=!1,e&&0==e.errno?(t.detailFromApi=p()(_.a.cloneDeep(e.rst)),e.rst.send_conf?t.send_conf=JSON.parse(e.rst.send_conf).map(function(t){return r()({},t,{add_start_time:t.add_start_time||"",add_end_time:t.add_end_time||"",add_time:t.add_start_time&&t.add_end_time?[t.add_start_time,t.add_end_time]:null})}):t.send_conf=[{natural_day:"",send_time:"",add_start_time:"",add_end_time:"",add_time:null}],t.title=e.rst.title,t.content=e.rst.content,t.attachments=e.rst.attachments&&""!=e.rst.attachments&&"null"!=e.rst.attachments?JSON.parse(e.rst.attachments):[],t.group_id=e.rst.group_id&&0!=e.rst.group_id?e.rst.group_id:""):4002!=e.errno&&t.$message({message:e.err,type:"warning"})}).catch(function(e){t.loading=!1})},getAttachment:function(t){this.attachments=t},massMsg_set:function(){var t=this;if(this.send_conf.some(function(t){return!t.natural_day||!t.send_time}))this.$message.warning('请完善"添加客服时间"');else if(this.send_conf.some(function(t){return!(1!=t.natural_day||t.add_time&&t.add_time.length)}))this.$message.warning("请选择客户添加起止时间");else if(""!=this.title)if(""!=this.content||this.attachments&&""!=this.attachments&&0!=this.attachments.length)if(""!=this.content&&this.$getStrBytes(this.content)>4e3)this.$message.error("请检查消息文本内容,最多4000个字节,已超出!");else{var e={title:this.title,content:this.content,attachments:""==this.attachments||0==this.attachments.length?"":n()(this.attachments),send_conf:n()(this.send_conf),group_id:this.group_id?this.group_id:0};this.template_id?e.template_id=this.template_id:e.template_id="",this.$loading(this.$loadingConfig),this.$axios.post(this.URL.BASEURL+this.URL.smartPushV3_setTemplate,e).then(function(e){e=e.data;t.$loading(t.$loadingConfig).close(),e&&0==e.errno?t.template_id?t.$emit("close","update"):t.$emit("close","update_new"):4002!=e.errno&&t.$message({message:e.err,type:"warning"})}).catch(function(e){t.$loading(t.$loadingConfig).close()})}else this.$message.warning("请输入内容!");else this.$message.warning("请输入标题!")},onInputDays:function(t,e){this.send_conf[e].natural_day=Object(f.k)(t),1!=this.send_conf[e].natural_day||this.send_conf[e].add_time&&this.send_conf[e].add_time.length||(this.send_conf[e].add_time=["00:00:00","23:59:59"],this.send_conf[e].add_start_time=this.send_conf[e].add_time[0],this.send_conf[e].add_end_time=this.send_conf[e].add_time[1])},onChangeDays:function(t,e){""!==t&&0===Number(t)&&(this.send_conf[e].natural_day="",this.$message.warning("天数不能为0"))},onChangeAddTime:function(t,e){t&&t.length?(this.send_conf[e].add_start_time=t[0],this.send_conf[e].add_end_time=t[1]):(this.send_conf[e].add_start_time="",this.send_conf[e].add_end_time="")},onClickDelConf:function(t){this.send_conf.splice(t,1)},onClickAddConf:function(){this.send_conf.push({natural_day:"",send_time:"",add_start_time:"",add_end_time:"",add_time:null})}}},b={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"createMassMsg"},[a("div",{staticClass:"self_drawer_title"},[a("div",{staticClass:"flex"},[t._v("\n "+t._s(t.drawer_title)+"\n ")]),t._v(" "),a("div",{staticClass:"flex-align-center"},[a("i",{staticClass:"el-icon-close pointer",on:{click:function(e){return t.$emit("close")}}})])]),t._v(" "),t.loading?t._e():a("div",{staticClass:"bg-ffffff",staticStyle:{padding:"15px 30px"}},[a("h3",{staticClass:"bigTitle"},[t._v("基础信息")]),t._v(" "),a("div",{staticClass:"regulations"},[a("div",{staticClass:"screeningCustomers",staticStyle:{"margin-top":"10px"}},[a("div",{staticClass:"screeningItem",staticStyle:{"align-items":"flex-start"}},[t._m(0),t._v(" "),a("div",{staticClass:"send-time-wrap"},t._l(t.send_conf,function(e,i){return a("div",{key:i,staticClass:"send-time-item"},[a("el-input",{attrs:{size:"mini",maxlength:"3",clearable:""},on:{input:function(e){return t.onInputDays(e,i)},change:function(e){return t.onChangeDays(e,i)}},model:{value:e.natural_day,callback:function(a){t.$set(e,"natural_day","string"==typeof a?a.trim():a)},expression:"conf.natural_day"}}),t._v(" "),a("span",{staticClass:"text"},[t._v("天  ")]),t._v(" "),1==e.natural_day?a("el-time-picker",{staticClass:"add-time",attrs:{"is-range":"",size:"mini",placeholder:"客户添加起止时间","start-placeholder":"起始时间","end-placeholder":"截止时间","value-format":"HH:mm:ss",clearable:!1},on:{change:function(e){return t.onChangeAddTime(e,i)}},model:{value:e.add_time,callback:function(a){t.$set(e,"add_time",a)},expression:"conf.add_time"}}):t._e(),t._v(" "),a("span",{staticClass:"text"},[t._v("当天")]),t._v(" "),a("div",{staticClass:"timeNums-wrap"},[a("div",{staticClass:"timeNums"},[a("el-time-picker",{attrs:{size:"mini",placeholder:"请选择","value-format":"HH:mm:ss",clearable:!1},model:{value:e.send_time,callback:function(a){t.$set(e,"send_time",a)},expression:"conf.send_time"}})],1)]),t._v(" "),a("span",{staticClass:"text"},[t._v("提醒发送")]),t._v(" "),i>0?a("i",{staticClass:"el-icon-error",on:{click:function(e){return t.onClickDelConf(i)}}}):t._e(),t._v(" "),i===t.send_conf.length-1?a("i",{staticClass:"el-icon-circle-plus-outline",on:{click:t.onClickAddConf}}):t._e()],1)}),0)])])]),t._v(" "),a("div",{staticClass:"regulations",staticStyle:{"margin-bottom":"20px","align-items":"center"}},[a("label",[t._v("选择分组")]),t._v(" "),a("div",[a("el-select",{staticClass:"select-cls",staticStyle:{width:"300px"},attrs:{size:"small",placeholder:"请选择",filterable:"",clearable:""},on:{change:t.onChangeGroupId},model:{value:t.group_id,callback:function(e){t.group_id=e},expression:"group_id"}},t._l(t.groupOptions,function(t){return a("el-option",{key:t.group_id,attrs:{label:t.title,value:t.group_id}})}),1)],1),t._v(" "),a("div",{staticClass:"newGroupCss",on:{click:t.onClickCreateGroup}},[t._v("新建模板分组")])]),t._v(" "),a("div",{staticClass:"line"}),t._v(" "),a("h3",{staticClass:"bigTitle"},[t._v("编辑群发消息")]),t._v(" "),a("div",{staticClass:"regulations regulations2"},[t._m(1),t._v(" "),a("el-input",{staticStyle:{width:"300px"},attrs:{placeholder:"例:活动推送/拉新等",clearable:"",size:"small"},model:{value:t.title,callback:function(e){t.title="string"==typeof e?e.trim():e},expression:"title"}}),t._v(" "),a("p",{staticStyle:{"font-size":"13px","line-height":"30px",color:"#f9a527","margin-left":"10px"}},[t._v("*仅作为企业内部人员记录群发摘要,不会推送给客户")])],1),t._v(" "),a("div",{staticClass:"regulations regulations2"},[t._m(2),t._v(" "),a("edit-con",{ref:"editCon",attrs:{isShowTips:!1,afferent_content:t.content,afferent_attachments:t.attachments},on:{editContent:function(e){t.content=e},changeAttachment:t.getAttachment}})],1),t._v(" "),a("div",{staticClass:"button_box"},[a("button",{staticClass:"button",on:{click:t.massMsg_set}},[t._v("保存模板")])])]),t._v(" "),a("templateGroupDialog",{attrs:{dialogVisible:t.tempGroupVisible},on:{confirm:t.onConfirmGroup,cancel:t.onCancelGroup}})],1)},staticRenderFns:[function(){var t=this.$createElement,e=this._self._c||t;return e("label",[e("em",[this._v("*")]),this._v("添加客服时间:")])},function(){var t=this.$createElement,e=this._self._c||t;return e("label",[e("em",[this._v("*")]),this._v("标题")])},function(){var t=this.$createElement,e=this._self._c||t;return e("label",{staticStyle:{"margin-top":"4px"}},[e("em",[this._v("*")]),this._v("内容")])}]};var w=a("VU/8")(C,b,!1,function(t){a("J6Ba")},"data-v-282633ca",null);e.a=w.exports},CZ54:function(t,e,a){"use strict";var i=a("//Fk"),n=a.n(i),s=a("Xxa5"),r=a.n(s),o=a("exGp"),l=a.n(o),c={name:"templateGroupDialog",props:{dialogVisible:{type:Boolean,default:function(){return!1}},groupInfo:{type:Object,default:function(){return{group_id:"",title:""}}}},data:function(){return{loading:!1,form:{title:""}}},computed:{dialogTitle:function(){return this.groupInfo.group_id?"编辑模板分组":"新建模板分组"}},watch:{dialogVisible:function(t){t&&this.handleGetFormData()}},methods:{handleConfirm:function(){var t=this;return l()(r.a.mark(function e(){var a,i,n,s,o;return r.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t.handleFormValidate();case 3:return a=""+t.URL.BASEURL+t.URL.smartPushV3_editTempGroup,i={group_id:t.groupInfo&&t.groupInfo.group_id?t.groupInfo.group_id:"",title:t.form.title},t.loading=!0,e.next=8,t.$axios.post(a,i);case 8:n=e.sent,s=n.data,(o=void 0===s?{}:s)&&0==o.errno?(t.$message.success("操作成功"),t.handleClearFormData(),t.$emit("confirm")):4002!=o.errno&&t.$message.warning(o.err||"操作失败"),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(0),console.log("error => ",e.t0);case 17:return e.prev=17,t.loading=!1,e.finish(17);case 20:case"end":return e.stop()}},e,t,[[0,14,17,20]])}))()},handleCancel:function(){this.handleClearFormData(),this.$emit("cancel")},handleFormValidate:function(){var t=this;return new n.a(function(e,a){t.form.title?e("表单校验通过"):(t.$message.warning("请输入模板分组名称"),a("表单校验未通过"))})},handleGetFormData:function(){var t=this.groupInfo.title,e=void 0===t?"":t;this.form.title=e||""},handleClearFormData:function(){this.form.title=""}}},u={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("el-dialog",{staticClass:"bind-dialog",attrs:{visible:t.dialogVisible,"before-close":t.handleCancel,title:t.dialogTitle,width:"450px","close-on-click-modal":!1,"append-to-body":!0},on:{"update:visible":function(e){t.dialogVisible=e}}},[a("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"form-wrap"},[a("div",{staticClass:"form-item"},[a("span",{staticClass:"lable required"},[t._v("模板分组名称")]),t._v(" "),a("el-input",{model:{value:t.form.title,callback:function(e){t.$set(t.form,"title",e)},expression:"form.title"}})],1)]),t._v(" "),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{size:"mini"},on:{click:t.handleCancel}},[t._v("取 消")]),t._v(" "),a("el-button",{attrs:{size:"mini",type:"primary"},on:{click:t.handleConfirm}},[t._v("确 定")])],1)])},staticRenderFns:[]};var d=a("VU/8")(c,u,!1,function(t){a("mUNO")},"data-v-2d85e51c",null);e.a=d.exports},GOch:function(t,e){},J6Ba:function(t,e){},RrYV:function(t,e){},TPYW:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=a("Gu7T"),n=a.n(i),s=a("Xxa5"),r=a.n(s),o=a("exGp"),l=a.n(o),c=a("gzej"),u=a("erru"),d=a("pdUL"),p=a("9UJH"),h=a("v/uv"),g={components:{datePicker:c.a,selfChannel:u.a,selfInputV2:d.a,pushGroupDialog:p.a,createMassMsg:h.a},data:function(){return{massMsgFlag:!1,loading:!1,page:1,pages:0,total:0,page_size:20,tableData:[],create_time_start:"",create_time_end:"",resetFlag:!1,height:"",creator_id:"",isCopy:!1,keyword:"",pushGroupVisible:!1,currentGroupInfo:{}}},created:function(){this.height=document.documentElement.clientHeight-260>400?document.documentElement.clientHeight-260:400,this.init(1)},methods:{detailClose:function(t){"update"==t?this.init(this.page):"update_new"==t&&(this.init(1),this.$refs.multipleTable.bodyWrapper.scrollTop=0),this.massMsgFlag=!1},onClickCreatedRule:function(){this.massMsgFlag=!0},onClickGroupDetail:function(t){this.$router.push({path:"/pushDetailV3",query:{group_id:t.group_id}})},onClickDelGroup:function(t){var e=this;return l()(r.a.mark(function a(){return r.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,a.next=3,e.$confirm("确定删除【"+t.title+"】分组吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"});case 3:e.handleDelGroup(t),a.next=9;break;case 6:a.prev=6,a.t0=a.catch(0),console.log("error => ",a.t0);case 9:case"end":return a.stop()}},a,e,[[0,6]])}))()},handleDelGroup:function(t){var e=this;return l()(r.a.mark(function a(){var i,n,s,o,l;return r.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,i=""+e.URL.BASEURL+e.URL.smartPushV3_delGroup,n={group_id:t.group_id},e.$loading(e.$loadingConfig),a.next=6,e.$axios.get(i,{params:n});case 6:s=a.sent,o=s.data,(l=void 0===o?{}:o)&&0==l.errno?(e.$message.success("操作成功"),e.init()):4002!=l.errno&&e.$message.warning(l.err),a.next=15;break;case 12:a.prev=12,a.t0=a.catch(0),console.log("error => ",a.t0);case 15:return a.prev=15,e.$loading(e.$loadingConfig).close(),a.finish(15);case 18:case"end":return a.stop()}},a,e,[[0,12,15,18]])}))()},onClickStatus:function(t){var e=this;this.$confirm("确定"+(0==t.status?"启用":"禁用")+"【"+t.title+"】?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){e.$loading(e.$loadingConfig),e.$axios.get(e.URL.BASEURL+e.URL.smartPushV3_changeGroupStatus,{params:{group_id:t.group_id,status:0==t.status?1:0}}).then(function(t){t=t.data;e.$loading(e.$loadingConfig).close(),t&&0==t.errno?(e.$message({message:"操作成功!",type:"success"}),e.init()):e.$message({message:t.err,type:"warning"})}).catch(function(){e.$loading(e.$loadingConfig).close()})}).catch(function(){})},onChangeCreatorId:function(t){this.creator_id=t,this.init(1)},onChangeKeyword:function(t){this.keyword=t,this.init(1)},onChangeTime:function(t){!t||t&&0==t.length?(this.create_time_start="",this.create_time_end=""):(this.create_time_start=t[0],this.create_time_end=t[1]),this.init(1)},init:function(t,e){var a=this;if("export"!=e)this.page=t||this.page;else if(0==this.total)return void this.$message({message:"暂无数据可导出",type:"warning"});this.loading=!0;var i={keyword:this.keyword,creator_id:this.creator_id,create_time_start:this.create_time_start?this.create_time_start+" 00:00:00":"",create_time_end:this.create_time_end?this.$day_format(this.$date_compatible(this.create_time_end+" 24:00:00")):"",page:"export"==e?1:this.page,page_size:"export"==e?this.$store.state.exportNumber:this.page_size};this.$axios.post(this.URL.BASEURL+this.URL.smartPushV3_groupList,i).then(function(t){t=t.data;a.loading=!1,t&&0==t.errno?"export"==e?a.exportEvent(t.rst.data):(1==t.rst.pageInfo.page&&(t.rst.data=[{group_id:0,created_at:"-",creator:"",status:"",title:"未分组"}].concat(n()(t.rst.data))),a.tableData=t.rst.data,a.total=t.rst.pageInfo.total,a.pages=t.rst.pageInfo.pages):4002!=t.errno&&a.$message({message:t.err,type:"warning"})}).catch(function(t){a.loading=!1})},handleCurrentChange:function(t){this.init(t)},exportEvent:function(t){var e=t;e.forEach(function(t){t.status=1==t.status?"启用":"禁用"});var a=[{tHeader:["分组","创建人","创建时间","状态"],filterVal:["title","creator","created_at","status"],tableDatas:e,sheetName:""}];this.$exportOrder({excelDatas:a,name:"智能推送-分组列表(导出时间:"+this.$getDay(0)+")"})},onClickCreateGroup:function(){this.currentGroupInfo={},this.pushGroupVisible=!0},onClickEditGroup:function(t){var e=t.group_id,a=t.title;this.currentGroupInfo={group_id:e,title:a},this.pushGroupVisible=!0},onConfirmGroup:function(t){t.isEdit?this.init():this.init(1),this.currentGroupInfo={},this.pushGroupVisible=!1},onCancelGroup:function(){this.currentGroupInfo={},this.pushGroupVisible=!1}}},m={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}]},[a("div",{staticClass:"screenBox",staticStyle:{"align-items":"center","padding-right":"16px","min-width":"1120px"}},[a("div",{staticClass:"flex-align-center",staticStyle:{flex:"1"}},[a("datePicker",{attrs:{title:"创建时间",reset:t.resetFlag},on:{changeTime:t.onChangeTime}}),t._v(" "),a("selfChannel",{attrs:{title:"创建人",reset:t.resetFlag,type:"circleCreate",labelWidth:!0},on:{channelDefine:t.onChangeCreatorId}}),t._v(" "),a("selfInputV2",{attrs:{label_name:"搜索",placeholder:"请输入",labelWidth:!0},on:{change:t.onChangeKeyword},model:{value:t.keyword,callback:function(e){t.keyword=e},expression:"keyword"}})],1),t._v(" "),a("el-button",{attrs:{type:"primary",size:"mini"},on:{click:t.onClickCreateGroup}},[t._v("新建分组")]),t._v(" "),a("el-button",{attrs:{type:"primary",size:"mini"},on:{click:t.onClickCreatedRule}},[t._v("新建智能推送")])],1),t._v(" "),a("el-table",{ref:"multipleTable",staticStyle:{width:"100%","margin-top":"10px"},attrs:{height:t.height,data:t.tableData,"tooltip-effect":"dark"}},[a("el-table-column",{attrs:{prop:"title",label:"分组","show-overflow-tooltip":"",align:"center","min-width":"120"}}),t._v(" "),a("el-table-column",{attrs:{label:"创建人",align:"center","min-width":"120"},scopedSlots:t._u([{key:"default",fn:function(e){return[e.row.creator?a("div",{staticClass:"customerServiceTagBox"},[a("div",{staticClass:"customerServiceTag"},[a("i",{staticClass:"el-icon-user-solid"}),t._v(" "+t._s(e.row.creator))])]):a("div",[t._v(" - ")])]}}])}),t._v(" "),a("el-table-column",{attrs:{label:"创建时间",prop:"created_at","min-width":"120","show-overflow-tooltip":"",align:"center"}}),t._v(" "),a("el-table-column",{attrs:{label:"状态","show-overflow-tooltip":"",align:"center","min-width":"120"},scopedSlots:t._u([{key:"default",fn:function(e){var i=e.row;return[""!==i.status?a("el-switch",{attrs:{"active-value":1,"inactive-value":0,disabled:""},nativeOn:{click:function(e){return t.onClickStatus(i)}},model:{value:i.status,callback:function(e){t.$set(i,"status",e)},expression:"row.status"}}):a("div",[t._v(" - ")])]}}])}),t._v(" "),a("el-table-column",{attrs:{label:"操作",align:"center",fixed:"right",width:"190"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("div",{staticClass:"flex",staticStyle:{"justify-content":"center"}},[0!=e.row.group_id?a("div",{staticClass:"c-00B38A pointer table_button",on:{click:function(a){return t.onClickEditGroup(e.row)}}},[t._v("编辑")]):t._e(),t._v(" "),a("div",{staticClass:"c-00B38A pointer table_button",on:{click:function(a){return t.onClickGroupDetail(e.row)}}},[t._v("详情")]),t._v(" "),0!=e.row.group_id?a("div",{staticClass:"c-FF604D pointer table_button",on:{click:function(a){return t.onClickDelGroup(e.row)}}},[t._v("删除")]):t._e()])]}}])})],1),t._v(" "),a("div",{directives:[{name:"show",rawName:"v-show",value:t.total>0,expression:"total>0"}],staticClass:"pagination"},[a("el-pagination",{attrs:{background:"","current-page":t.page,layout:"prev, pager, next","page-count":Number(t.pages)},on:{"current-change":t.handleCurrentChange}})],1),t._v(" "),a("pushGroupDialog",{attrs:{dialogVisible:t.pushGroupVisible,groupInfo:t.currentGroupInfo},on:{confirm:t.onConfirmGroup,cancel:t.onCancelGroup}}),t._v(" "),a("el-drawer",{attrs:{size:"1200px",visible:t.massMsgFlag,"with-header":!1},on:{"update:visible":function(e){t.massMsgFlag=e}}},[t.massMsgFlag?a("createMassMsg",{ref:"createMassMsg",attrs:{title:"新建智能推送"},on:{close:t.detailClose}}):t._e()],1)],1)},staticRenderFns:[]};var _=a("VU/8")(g,m,!1,function(t){a("RrYV")},"data-v-b6f7b4c8",null).exports,f=a("CZ54"),v=a("5wuF"),C={components:{datePicker:c.a,selfChannel:u.a,selfInputV2:d.a,templateGroupDialog:f.a,createTemplate:v.a},data:function(){return{massMsgFlag:!1,loading:!1,page:1,pages:0,total:0,page_size:20,tableData:[],create_time_start:"",create_time_end:"",resetFlag:!1,height:"",creator_id:"",isCopy:!1,keyword:"",tempGroupVisible:!1,currentGroupInfo:{}}},created:function(){this.height=document.documentElement.clientHeight-260>400?document.documentElement.clientHeight-260:400,this.init(1)},methods:{onClickCreateTemp:function(){this.massMsgFlag=!0},detailClose:function(t){"update"==t?this.init(this.page):"update_new"==t&&(this.init(1),this.$refs.multipleTable.bodyWrapper.scrollTop=0),this.massMsgFlag=!1},onClickGroupDetail:function(t){this.$router.push({path:"/templateListV3",query:{group_id:t.group_id}})},onClickDelGroup:function(t){var e=this;return l()(r.a.mark(function a(){return r.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,a.next=3,e.$confirm("确定删除【"+t.title+"】模板分组吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"});case 3:e.handleDelGroup(t),a.next=9;break;case 6:a.prev=6,a.t0=a.catch(0),console.log("error => ",a.t0);case 9:case"end":return a.stop()}},a,e,[[0,6]])}))()},handleDelGroup:function(t){var e=this;return l()(r.a.mark(function a(){var i,n,s,o,l;return r.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,i=""+e.URL.BASEURL+e.URL.smartPushV3_delTempGroup,n={group_id:t.group_id},e.$loading(e.$loadingConfig),a.next=6,e.$axios.get(i,{params:n});case 6:s=a.sent,o=s.data,(l=void 0===o?{}:o)&&0==l.errno?(e.$message.success("操作成功"),e.init()):4002!=l.errno&&e.$message.warning(l.err),a.next=15;break;case 12:a.prev=12,a.t0=a.catch(0),console.log("error => ",a.t0);case 15:return a.prev=15,e.$loading(e.$loadingConfig).close(),a.finish(15);case 18:case"end":return a.stop()}},a,e,[[0,12,15,18]])}))()},onClickStatus:function(t){var e=this;this.$confirm("确定"+(0==t.status?"启用":"禁用")+"【"+t.title+"】?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){e.$loading(e.$loadingConfig),e.$axios.get(e.URL.BASEURL+e.URL.smartPushV3_changeTempGroupStatus,{params:{group_id:t.group_id,status:0==t.status?1:0}}).then(function(t){t=t.data;e.$loading(e.$loadingConfig).close(),t&&0==t.errno?(e.$message({message:"操作成功!",type:"success"}),e.init()):e.$message({message:t.err,type:"warning"})}).catch(function(){e.$loading(e.$loadingConfig).close()})}).catch(function(){})},onChangeCreatorId:function(t){this.creator_id=t,this.init(1)},onChangeKeyword:function(t){this.keyword=t,this.init(1)},onChangeTime:function(t){!t||t&&0==t.length?(this.create_time_start="",this.create_time_end=""):(this.create_time_start=t[0],this.create_time_end=t[1]),this.init(1)},init:function(t,e){var a=this;if("export"!=e)this.page=t||this.page;else if(0==this.total)return void this.$message({message:"暂无数据可导出",type:"warning"});this.loading=!0;var i={keyword:this.keyword,creator_id:this.creator_id,create_time_start:this.create_time_start?this.create_time_start+" 00:00:00":"",create_time_end:this.create_time_end?this.$day_format(this.$date_compatible(this.create_time_end+" 24:00:00")):"",page:"export"==e?1:this.page,page_size:"export"==e?this.$store.state.exportNumber:this.page_size};this.$axios.post(this.URL.BASEURL+this.URL.smartPushV3_tempGroupList,i).then(function(t){t=t.data;a.loading=!1,t&&0==t.errno?"export"==e?a.exportEvent(t.rst.data):(1==t.rst.pageInfo.page&&(t.rst.data=[{group_id:0,created_at:"-",creator:"",status:"",title:"未分组"}].concat(n()(t.rst.data))),a.tableData=t.rst.data,a.total=t.rst.pageInfo.total,a.pages=t.rst.pageInfo.pages):4002!=t.errno&&a.$message({message:t.err,type:"warning"})}).catch(function(t){a.loading=!1})},handleCurrentChange:function(t){this.init(t)},exportEvent:function(t){var e=t;e.forEach(function(t){t.status=1==t.status?"启用":"禁用"});var a=[{tHeader:["模板分组","创建人","创建时间","状态"],filterVal:["title","creator","created_at","status"],tableDatas:e,sheetName:""}];this.$exportOrder({excelDatas:a,name:"智能推送-模板分组列表(导出时间:"+this.$getDay(0)+")"})},onClickEditGroup:function(t){var e=t.group_id,a=t.title;this.currentGroupInfo={group_id:e,title:a},this.tempGroupVisible=!0},onConfirmGroup:function(){this.init(),this.currentGroupInfo={},this.tempGroupVisible=!1},onCancelGroup:function(){this.currentGroupInfo={},this.tempGroupVisible=!1}}},b={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}]},[a("div",{staticClass:"screenBox",staticStyle:{"align-items":"center","padding-right":"16px"}},[a("div",{staticClass:"flex-align-center",staticStyle:{flex:"1"}},[a("datePicker",{attrs:{title:"创建时间",reset:t.resetFlag},on:{changeTime:t.onChangeTime}}),t._v(" "),a("selfChannel",{attrs:{title:"创建人",reset:t.resetFlag,type:"circleCreate",labelWidth:!0},on:{channelDefine:t.onChangeCreatorId}}),t._v(" "),a("selfInputV2",{attrs:{label_name:"搜索",placeholder:"请输入"},on:{change:t.onChangeKeyword},model:{value:t.keyword,callback:function(e){t.keyword=e},expression:"keyword"}})],1),t._v(" "),a("el-button",{attrs:{type:"primary",size:"mini"},on:{click:t.onClickCreateTemp}},[t._v("新建模板")])],1),t._v(" "),a("el-table",{ref:"multipleTable",staticStyle:{width:"100%","margin-top":"10px"},attrs:{height:t.height,data:t.tableData,"tooltip-effect":"dark"}},[a("el-table-column",{attrs:{prop:"title",label:"模板分组","show-overflow-tooltip":"",align:"center","min-width":"120"}}),t._v(" "),a("el-table-column",{attrs:{label:"创建人",align:"center","min-width":"120"},scopedSlots:t._u([{key:"default",fn:function(e){return[e.row.creator?a("div",{staticClass:"customerServiceTagBox"},[a("div",{staticClass:"customerServiceTag"},[a("i",{staticClass:"el-icon-user-solid"}),t._v(" "+t._s(e.row.creator))])]):a("div",[t._v(" - ")])]}}])}),t._v(" "),a("el-table-column",{attrs:{label:"创建时间",prop:"created_at","min-width":"120","show-overflow-tooltip":"",align:"center"}}),t._v(" "),a("el-table-column",{attrs:{label:"状态","show-overflow-tooltip":"",align:"center","min-width":"120"},scopedSlots:t._u([{key:"default",fn:function(e){var i=e.row;return[""!==i.status?a("el-switch",{attrs:{"active-value":1,"inactive-value":0,disabled:""},nativeOn:{click:function(e){return t.onClickStatus(i)}},model:{value:i.status,callback:function(e){t.$set(i,"status",e)},expression:"row.status"}}):a("div",[t._v(" - ")])]}}])}),t._v(" "),a("el-table-column",{attrs:{label:"操作",align:"center",fixed:"right",width:"190"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("div",{staticClass:"flex",staticStyle:{"justify-content":"center"}},[0!=e.row.group_id?a("div",{staticClass:"c-00B38A pointer table_button",on:{click:function(a){return t.onClickEditGroup(e.row)}}},[t._v("编辑")]):t._e(),t._v(" "),a("div",{staticClass:"c-00B38A pointer table_button",on:{click:function(a){return t.onClickGroupDetail(e.row)}}},[t._v("详情")]),t._v(" "),0!=e.row.group_id?a("div",{staticClass:"c-FF604D pointer table_button",on:{click:function(a){return t.onClickDelGroup(e.row)}}},[t._v("删除")]):t._e()])]}}])})],1),t._v(" "),a("div",{directives:[{name:"show",rawName:"v-show",value:t.total>0,expression:"total>0"}],staticClass:"pagination"},[a("el-pagination",{attrs:{background:"","current-page":t.page,layout:"prev, pager, next","page-count":Number(t.pages)},on:{"current-change":t.handleCurrentChange}})],1),t._v(" "),a("templateGroupDialog",{attrs:{dialogVisible:t.tempGroupVisible,groupInfo:t.currentGroupInfo},on:{confirm:t.onConfirmGroup,cancel:t.onCancelGroup}}),t._v(" "),a("el-drawer",{attrs:{size:"1200px",visible:t.massMsgFlag,"with-header":!1},on:{"update:visible":function(e){t.massMsgFlag=e}}},[t.massMsgFlag?a("createTemplate",{ref:"createTemplate",attrs:{drawer_title:"新建模板"},on:{close:t.detailClose}}):t._e()],1)],1)},staticRenderFns:[]};var w={name:"smartPushV3",components:{pushGroupList:_,templateGroupList:a("VU/8")(C,b,!1,function(t){a("GOch")},"data-v-7a399911",null).exports},data:function(){return{tagType:this.$route.query.tag||1}},methods:{changeType:function(t){this.tagType=t}}},x={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("div",{staticClass:"topTagBox flex",staticStyle:{"min-width":"1200px"},attrs:{id:"customerAnalysis"}},[a("div",{staticClass:"left flex-align-center"},[a("div",{class:["tagItem",1==t.tagType?"tagItem_active":""],on:{click:function(e){return t.changeType(1)}}},[t._v("智能推送")]),t._v(" "),a("div",{class:["tagItem",2==t.tagType?"tagItem_active":""],on:{click:function(e){return t.changeType(2)}}},[t._v("推送模板")])])]),t._v(" "),1==t.tagType?a("pushGroupList"):t._e(),t._v(" "),2==t.tagType?a("templateGroupList"):t._e()],1)},staticRenderFns:[]},y=a("VU/8")(w,x,!1,null,null,null);e.default=y.exports},mUNO:function(t,e){}});