1 |
- webpackJsonp([29],{Gnqa:function(t,e){},V0PT:function(t,e){},nI2n:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i={data:function(){return{targetObj:{},index:1,link:"",itemList:[],loadingSave:!1,addFlag:!1,enableList:[{label:"全部",value:""},{label:"待发送",value:1},{label:"处理中",value:2},{label:"发送失败",value:-1},{label:"已完成",value:3},{label:"已删除",value:-2}],loadingNews:!1,tagList:[],enable:"",page:1,page_size:20,total:1,type:"全部",keyword:"",list:[],itemInfo:{}}},created:function(){this.getTag()},methods:{copy:function(t){if(t){var e=document.getElementById("cpoyText");e.value=t,e.select(),document.execCommand("Copy"),this.saveToast=!1,this.$message({message:"链接已复制成功",type:"success"})}else this.$message({message:"链接不存在",type:"error"})},edit:function(t,e){var n=e;this.index=t+1,n.isEdit=!0,this.$set(this.itemList,t,n)},getDetail:function(){var t=this;this.loadingSave=!0,this.$axios.get(this.URL.BASEURL+this.URL.newsDetailT,{params:{rule_id:this.targetObj.id}}).then(function(e){if(t.loadingSave=!1,(e=e.data)&&0==e.errno){var n=e.rst;t.itemList=n.content.length>0?n.content:[]}else t.$message({message:e.err,type:"warning"})}).catch(function(e){console.log(e),t.loadingSave=!1})},saveAs:function(){var t=this;this.loadingSave=!0,this.$axios.post(this.URL.BASEURL+this.URL.saveLink,{rule_id:this.targetObj.id,article_idx:this.index,link:this.link}).then(function(e){if(t.loadingSave=!1,(e=e.data)&&0==e.errno){e.rst;t.$message.success("图文链接上传成功"),t.getDetail()}else t.$message({message:e.err,type:"warning"})}).catch(function(e){console.log(e),t.loadingNews=!1})},getTag:function(){var t=this;this.loadingNews=!0,this.$axios.get(this.URL.BASEURL+this.URL.tagList).then(function(e){t.loadingNews=!1,(e=e.data)&&0==e.errno&&(t.tagList=e.rst.data.tags,t.init(1))}).catch(function(e){t.loadingNews=!1})},toUrl:function(t){var e=t.id?"?rule_id="+t.id:"";this.$router.push("/addTeam"+e)},toSee:function(t){var e=t.id?"?rule_id="+t.id:"";this.$router.push("/checkTeam"+e)},sendStatus:function(t,e){var n=this,i=this.$refs.table;if(t.hasOwnProperty("info"))return delete t.info,i.toggleRowExpansion(t,!1),!1;this.loadingNews=!0,this.$axios.get(this.URL.BASEURL+this.URL.newsDetailT,{params:{rule_id:t.id}}).then(function(i){if((i=i.data)&&0==i.errno){var a=i.rst;1==a.log[0].status?n.getInfo(a.log[0],t,e):n.$message({message:a.log.err_msg,type:"error"})}else n.$message({message:i.err,type:"warning"})}).catch(function(t){console.log(t),n.loadingNews=!1})},getInfo:function(t,e,n){var i=this,a=this.$refs.table;this.list.forEach(function(t,e){n!=e&&t.info&&delete t.info}),this.$axios.get(this.URL.BASEURL+this.URL.sendRecordT,{params:{rule_id:e.id}}).then(function(t){t=t.data;if(i.loadingNews=!1,t&&0==t.errno){var n=t.rst;i.$set(e,"info",n),setTimeout(function(){a.toggleRowExpansion(e)},500)}else i.$message({message:t.err,type:"warning"})}).catch(function(t){console.log(t),i.loadingNews=!1})},init:function(t){var e=this;this.page=t,this.loadingNews=!0,this.$axios.post(this.URL.BASEURL+this.URL.ruleListT,{keyword:this.keyword,enable:this.enable,page:this.page,page_size:this.page_size}).then(function(t){if(e.loadingNews=!1,(t=t.data)&&0==t.errno){var n=t.rst.data;e.list=n,e.total=t.rst.pageInfo.total,e.page_size=t.rst.pageInfo.size}else e.$message({message:t.err,type:"warning"})}).catch(function(t){console.log(t),e.loadingNews=!1})},handleCurrentChange:function(t){this.init(t)},isDel:function(t){var e=this;this.$confirm("此操作将永久删除该条群发任务, 是否继续?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){e.toDel(t)}).catch(function(){e.$message({type:"info",message:"已取消删除"})})},toDel:function(t){var e=this;this.loadingNews=!0,this.$axios.get(this.URL.BASEURL+this.URL.delRuleT,{params:{rule_id:Number(t.id)}}).then(function(t){e.loadingNews=!1,(t=t.data)&&0==t.errno?(e.$message({message:"删除成功",type:"success"}),e.init(1)):e.$message({message:t.err,type:"warning"})}).catch(function(t){console.log(t),e.loadingNews=!1})}}},a={render:function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"templateM"},[i("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loadingNews,expression:"loadingNews"}],staticClass:"mainCon",attrs:{"element-loading-text":"拼命加载中","element-loading-spinner":"el-icon-loading"}},[i("wx-item",{staticStyle:{"margin-top":"28px"}}),t._v(" "),i("div",{staticClass:"searchCon"},[i("el-button",{staticStyle:{float:"left"},attrs:{type:"primary"},on:{click:t.toUrl}},[t._v("新建群发消息")]),t._v(" "),i("el-select",{staticStyle:{width:"110px"},on:{change:function(e){return t.init(1)}},model:{value:t.enable,callback:function(e){t.enable=e},expression:"enable"}},t._l(t.enableList,function(t){return i("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})}),1),t._v(" "),i("el-input",{staticClass:"input",staticStyle:{width:"300px"},attrs:{placeholder:"请输入群发消息名称","prefix-icon":"el-icon-search"},model:{value:t.keyword,callback:function(e){t.keyword=e},expression:"keyword"}}),i("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.init(1)}}},[t._v("搜索")])],1),t._v(" "),i("div",{staticClass:"taskList mainBorder"},[i("div",{staticClass:"taskItem"},[i("el-table",{ref:"table",staticStyle:{width:"100%"},attrs:{data:t.list,border:"",stripe:"","highlight-current-row":""}},[i("template",{slot:"empty"},[i("img",{staticClass:"pic",attrs:{src:n("z3Om"),alt:""}}),t._v(" "),i("span",[t._v("暂无数据")])]),t._v(" "),i("el-table-column",{attrs:{type:"expand",width:"1"},scopedSlots:t._u([{key:"default",fn:function(e){return[e.row.info?i("el-form",{staticClass:"demo-table-expand",attrs:{"label-position":"left",inline:""}},[i("el-form-item",{attrs:{label:"群发状态:"}},[e.row.info.status?i("span",[t._v(t._s(-1!=e.row.info.status.indexOf("success")?"发送成功":-1!=e.row.info.status.indexOf("fail")?"发送失败":-1!=e.row.info.status.indexOf("10001")?"涉嫌广告":-1!=e.row.info.status.indexOf("20001")?"涉嫌政治":-1!=e.row.info.status.indexOf("20002")?"涉嫌色情":-1!=e.row.info.status.indexOf("20006")?"涉嫌违法犯罪":-1!=e.row.info.status.indexOf("20008")?"涉嫌欺诈":-1!=e.row.info.status.indexOf("20013")?"涉嫌版权":-1!=e.row.info.status.indexOf("22000")?"涉嫌互相宣传":-1!=e.row.info.status.indexOf("21000")?"涉嫌其他":-1!=e.row.info.status.indexOf("30001")?"原创校验出现系统错误且用户选择了被判为转载就不群发":-1!=e.row.info.status.indexOf("30002")?"原创校验被判定不能转发":-1!=e.row.info.status.indexOf("30003")?"原创校验被判定为转载文且用户选择了被判为转载就不群发":-1!=e.row.info.status.indexOf("40001")?"管理员拒绝":"管理员30分钟内无响应,超时"))]):t._e()]),t._v(" "),i("el-form-item",{attrs:{label:"发送成功的粉丝数:"}},[i("span",[t._v(t._s(e.row.info.send_count?e.row.info.send_count:"-"))])]),t._v(" "),i("el-form-item",{attrs:{label:"发送失败的粉丝数:"}},[i("span",[t._v(t._s(e.row.info.error_count?e.row.info.error_count:"-"))])]),t._v(" "),i("el-form-item",{attrs:{label:"图文总数:"}},[i("span",[t._v(t._s(e.row.info.count?e.row.info.count:"-"))])])],1):t._e()]}}])}),t._v(" "),i("el-table-column",{attrs:{"show-overflow-tooltip":"",prop:"name",label:"规则名称"}}),t._v(" "),i("el-table-column",{attrs:{label:"创建人"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.real_name?e.row.real_name:e.row.phone)+"\n ")]}}])}),t._v(" "),i("el-table-column",{attrs:{prop:"tag_id",label:"发送标签"},scopedSlots:t._u([{key:"default",fn:function(e){return[i("span",[t._v(t._s(t.tagList&&t.tagList.length>0?t.tagList.filter(function(t){return t.id==e.row.tag_id}).length>0?t.tagList.filter(function(t){return t.id==e.row.tag_id})[0].name:"全部":""))])]}}])}),t._v(" "),i("el-table-column",{attrs:{prop:"name",label:"消息类型"},scopedSlots:t._u([{key:"default",fn:function(e){return[i("span",[t._v(t._s("text"==e.row.response_type?"文字":"image"==e.row.response_type?"图片":"voice"==e.row.response_type?"音频":"video"==e.row.response_type?"视频":"miniprogram"==e.row.response_type?"小程序":"图文链接"))])]}}])}),t._v(" "),i("el-table-column",{attrs:{prop:"name",label:"用户所在地"},scopedSlots:t._u([{key:"default",fn:function(e){return[e.row.country?i("span",[t._v(t._s(e.row.country?e.row.country:"")+t._s(e.row.province?"/"+e.row.province:"")+t._s(e.row.city?"/"+e.row.city:""))]):i("span",[t._v("全部")])]}}])}),t._v(" "),i("el-table-column",{attrs:{"show-overflow-tooltip":"",prop:"name",label:"发送时间"},scopedSlots:t._u([{key:"default",fn:function(e){return[i("span",[t._v(t._s(e.row.send_time?e.row.send_time:"-"))])]}}])}),t._v(" "),i("el-table-column",{attrs:{fixed:"right",label:"状态",width:"100"},scopedSlots:t._u([{key:"default",fn:function(e){return[i("span",[t._v(t._s(-1==e.row.enable?"发送失败":0==e.row.enable?"禁用":1==e.row.enable?"待发送":2==e.row.enable?"处理中":"已完成"))])]}}])}),t._v(" "),i("el-table-column",{attrs:{fixed:"right",align:"center",label:"操作"},scopedSlots:t._u([{key:"default",fn:function(e){return[i("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(n){return t.toSee(e.row)}}},[t._v("查看")]),t._v(" "),2!=e.row.enable?i("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(n){return t.sendStatus(e.row,e.row.$index)}}},[t._v("发送情况")]):t._e(),t._v(" "),2==e.row.enable?i("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(n){t.targetObj=e.row,t.getDetail(),t.addFlag=!0}}},[t._v("上传链接")]):t._e(),t._v(" "),i("el-button",{attrs:{type:"text",disabled:1!=e.row.enable||-1==e.row.enable,size:"mini"},on:{click:function(n){return t.isDel(e.row)}}},[t._v("删除")])]}}])})],2),t._v(" "),t.list.length>0?i("div",{staticClass:"bottom"},[i("div"),t._v(" "),i("el-pagination",{attrs:{background:"","current-page":t.page,"page-size":t.page_size,layout:"prev, pager, next",total:t.total},on:{"current-change":t.handleCurrentChange}}),t._v(" "),i("div")],1):t._e()],1)]),t._v(" "),i("my-dialog",{attrs:{visible:t.addFlag,width:"860px"},on:{"update:visible":function(e){t.addFlag=e},close:function(e){t.addFlag=!1}}},[i("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loadingSave,expression:"loadingSave"}],staticClass:"toast"},[i("h3",[t._v("编辑上传链接")]),t._v(" "),i("div",{staticClass:"toastMain"},[i("el-table",{ref:"table",staticStyle:{margin:"0 auto","text-align":"center"},attrs:{data:t.itemList,border:""}},[i("el-table-column",{attrs:{label:"图文标题",prop:"title","show-overflow-tooltip":""}}),t._v(" "),i("el-table-column",{attrs:{label:"图文链接",prop:"link","show-overflow-tooltip":""},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.link?e.row.link:"暂无")+"\n ")]}}])}),t._v(" "),i("el-table-column",{attrs:{label:"操作",width:"250"},scopedSlots:t._u([{key:"default",fn:function(e){return[e.row.isEdit?i("input",{directives:[{name:"model",rawName:"v-model",value:t.link,expression:"link"}],attrs:{type:"text",placeholder:"请输入图文链接"},domProps:{value:t.link},on:{input:function(e){e.target.composing||(t.link=e.target.value)}}}):t._e(),t._v(" "),e.row.isEdit?i("el-button",{attrs:{type:"text"},on:{click:t.saveAs}},[t._v("保存")]):t._e(),t._v(" "),e.row.isEdit||e.row.link?t._e():i("el-button",{attrs:{type:"text"},on:{click:function(n){return t.edit(e.$index,e.row)}}},[t._v("编辑")]),t._v(" "),e.row.link?i("el-button",{attrs:{type:"text"},on:{click:function(n){return t.copy(e.row.link)}}},[t._v("复制")]):t._e()]}}])})],1)],1),t._v(" "),i("div",{staticClass:"toastBtn"},[i("el-button",{attrs:{size:"mini"},on:{click:function(e){t.addFlag=!1}}},[t._v("关闭")])],1)])]),t._v(" "),i("input",{staticStyle:{position:"absolute",left:"-9999px",top:"-9999px"},attrs:{id:"cpoyText",type:"text"}})],1)])},staticRenderFns:[]};var s=n("VU/8")(i,a,!1,function(t){n("V0PT"),n("Gnqa")},"data-v-051ed2c6",null);e.default=s.exports}});
|