35.449990e5c889cca5b170.js 16.4 KB
webpackJsonp([35],{GVQD:function(e,t,i){(e.exports=i("FZ+f")(!0)).push([e.i,"\n.index[data-v-20c1791d] {\n  padding: 20px 0;\n}\n.top[data-v-20c1791d] {\n  margin-bottom: 30px;\n  margin-left: 20px;\n}\n.title[data-v-20c1791d] {\n  font-size: 16px;\n  font-weight: 400;\n  display: block;\n  line-height: 1.2;\n  color: #353535;\n}\n.inner-edit_area[data-v-20c1791d] {\n  width: 96%;\n  margin: 0 auto;\n}\n.upload-video[data-v-20c1791d] {\n  width: 50%;\n  margin-left:2%;\n}\n.b-title[data-v-20c1791d] {\n  padding: 20px;\n  color: #666;\n}\n.emotion_switch[data-v-20c1791d] {\n  float: left;\n  height: 28px;\n  line-height: 999em;\n  overflow: hidden;\n  background: transparent url(https://res.wx.qq.com/mpres/en_US/htmledition/pages/modules/reply/images/icon_emotion_switch.png) no-repeat 0 0;\n  width: 20px;\n  height: 20px;\n  vertical-align: middle;\n  display: inline-block;\n}\n","",{version:3,sources:["D:/myproject/changchang-admin-new/src/components/groupSend/index.vue"],names:[],mappings:";AACA;EACE,gBAAgB;CACjB;AACD;EACE,oBAAoB;EACpB,kBAAkB;CACnB;AACD;EACE,gBAAgB;EAChB,iBAAiB;EACjB,eAAe;EACf,iBAAiB;EACjB,eAAe;CAChB;AACD;EACE,WAAW;EACX,eAAe;CAChB;AACD;EACE,WAAW;EACX,eAAe;CAChB;AACD;EACE,cAAc;EACd,YAAY;CACb;AACD;EACE,YAAY;EACZ,aAAa;EACb,mBAAmB;EACnB,iBAAiB;EACjB,4IAA4I;EAC5I,YAAY;EACZ,aAAa;EACb,uBAAuB;EACvB,sBAAsB;CACvB",file:"index.vue",sourcesContent:["\n.index[data-v-20c1791d] {\n  padding: 20px 0;\n}\n.top[data-v-20c1791d] {\n  margin-bottom: 30px;\n  margin-left: 20px;\n}\n.title[data-v-20c1791d] {\n  font-size: 16px;\n  font-weight: 400;\n  display: block;\n  line-height: 1.2;\n  color: #353535;\n}\n.inner-edit_area[data-v-20c1791d] {\n  width: 96%;\n  margin: 0 auto;\n}\n.upload-video[data-v-20c1791d] {\n  width: 50%;\n  margin-left:2%;\n}\n.b-title[data-v-20c1791d] {\n  padding: 20px;\n  color: #666;\n}\n.emotion_switch[data-v-20c1791d] {\n  float: left;\n  height: 28px;\n  line-height: 999em;\n  overflow: hidden;\n  background: transparent url(https://res.wx.qq.com/mpres/en_US/htmledition/pages/modules/reply/images/icon_emotion_switch.png) no-repeat 0 0;\n  width: 20px;\n  height: 20px;\n  vertical-align: middle;\n  display: inline-block;\n}\n"],sourceRoot:""}])},HK0P:function(e,t,i){var s=i("GVQD");"string"==typeof s&&(s=[[e.i,s,""]]),s.locals&&(e.exports=s.locals);i("rjj0")("6dfa67e6",s,!1,{})},oerw:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=i("CCn6"),n=i("kmJW"),a=i("C+jy"),o=i("sf/l"),r={name:"index",components:{page:n.a,emotion:a.a},data:function(){return{nowPage:1,total:0,limit:10,show:!1,loading:!1,activeName:"text",list:[],content:"",uploadShow:!0,imageList:[],fileList:[],imageContent:"",videoContent:"",searchFrom:{},tableData:[],fileUid:null,userDialog:{total:0,limit:10,nowPage:1,show:!1},userList:[],searchUserFrom:{},multipleSelection:[],showEmotion:!1}},filters:{typeFilter:function(e){if(e)return"text"===e?"文本":"image"===e?"图片":"video"===e?"视频":void 0}},methods:{handleClick:function(e){this.activeName=e.name},handleRemove:function(){this.uploadShow=!0,this.imageList=[],this.imageContent=""},handleRemoveVideo:function(){this.videoContent="",this.fileList=[]},beforeAvatarUpload:function(){this.uploadShow=!1},handleAvatarSuccess:function(e){this.imageList=[{name:e.data.url,url:"http://cdn.singsingenglish.com/"+e.data.url}]},uploadFile:function(e){var t=this;this.$store.dispatch("setProgress",{type:"new",id:e.file.uid}),Object(s._55)({file:e.file,type:"wechat"}).then(function(e){t.imageContent={content:e.media_id,url:e.url},t.imageList=[{name:e.media_id,url:e.url}],t.$message({type:"success",message:"上传成功!"})}).catch(function(){t.$message({type:"error",message:"上传失败!"})})},uploadVideo:function(e){var t=this;Object(s._55)({file:e.file,type:"wechat"}).then(function(i){t.uploadVideoFile(e,i)}).catch(function(){t.$message({type:"error",message:"上传失败!"})})},uploadVideoFile:function(e,t){var i=this;this.fileUid=e.file.uid,this.loading=!0,this.$store.dispatch("setProgress",{type:"new",id:e.file.uid}),Object(s._55)({file:e.file,type:"local"}).then(function(s){i.videoContent={content:t.media_id,url:"http://cdn.singsingenglish.com/"+s.url},i.fileList=[{name:s.name,url:"http://cdn.singsingenglish.com/"+s.url}],i.loading=!1,i.$message({type:"success",message:"上传成功!"}),i.$store.dispatch("setProgress",{type:"delete",id:e.file.uid}),i.fileUid=null}).catch(function(){i.loading=!1,i.$message({type:"error",message:"上传失败!"})})},send:function(){var e=this,t={};if(this.searchFrom.is_test){if(!(this.searchFrom.time&&this.searchFrom.time.length>0))return void this.$message({type:"error",message:"请选择时间!"});t.start_at=o.a.dateFmt(this.searchFrom.time[0],"yyyy-MM-dd hh:mm:ss"),t.end_at=o.a.dateFmt(this.searchFrom.time[1],"yyyy-MM-dd hh:mm:ss")}this.searchFrom.user_ids?t.user_ids=this.searchFrom.user_ids:this.$message({type:"error",message:"请加入内部人员!"});var i={};if(i.type=this.activeName,"text"===this.activeName){if(!this.content)return void this.$message({type:"error",message:"请输入文本!"});i.content=this.content}else if("image"===this.activeName){if(!this.imageContent)return void this.$message({type:"error",message:"请上传图片!"});i.content=this.imageContent.content,i.url=this.imageContent.url}else if("video"===this.activeName){if(!this.videoContent)return void this.$message({type:"error",message:"请上传视频!"});i.content=this.videoContent.content,i.url=this.videoContent.url}t.content=JSON.stringify(i),t.is_test=this.searchFrom.is_test?2:1,Object(s._49)(t).then(function(t){e.$message({message:t,type:"success"}),e.show=!1,e.clearData(),e.getMsgList()})},clearData:function(){this.content="",this.videoContent=null,this.imageContent=null,this.activeName,this.searchFrom={},this.fileList=[],this.imageList=[]},getMsgList:function(){var e=this,t={limit:this.limit,page:this.nowPage};Object(s._21)(t).then(function(t){e.tableData=t.list,e.total=t.total})},onPageChange:function(e){this.nowPage=e,this.getMsgList()},getMsgResult:function(e){var t=this;if(e){var i={only_text:1,send_id:e};Object(s._21)(i).then(function(e){t.$message({message:e,type:"success"}),t.getMsgList()})}},getUser:function(){var e=this,t={page:this.userDialog.nowPage,limit:this.userDialog.limit};this.searchUserFrom.userId&&(t.user_id=this.searchUserFrom.userId),this.searchUserFrom.nickName&&(t.nickname=this.searchUserFrom.nickName),this.searchUserFrom.mobile&&(t.mobile=this.searchUserFrom.mobile),Object(s._36)(t).then(function(t){e.userList=t.list,e.userDialog.total=t.total})},onUserPageChange:function(e){this.userDialog.nowPage=e,this.getUser()},handleSelectionChange:function(e){this.multipleSelection=e},onSelectUser:function(){this.userDialog.show=!0,this.searchFrom.user_ids?this.multipleSelection=this.searchFrom.user_ids.split(","):this.multipleSelection=[],this.getUser()},onConfirm:function(){var e=this.multipleSelection;if(0===e.length)this.$message({type:"error",message:"请选择用户!"});else{var t=[];e.forEach(function(e){t.push(e.user_id)});var i=t;this.searchFrom.user_ids&&(i=t.concat(this.stringToInt(this.searchFrom.user_ids.split(","))));var s=this.dedupe(i);this.searchFrom.user_ids=s.join(","),this.userDialog.show=!1}},dedupe:function(e){return Array.from(new Set(e))},stringToInt:function(e){var t=e||[];return t=t.map(function(e){return parseInt(e,10)})},emotion:function(e){var t=e.replace(/\//gi,"");return'<img src="https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/'+["微笑","撇嘴","色","发呆","得意","流泪","害羞","闭嘴","睡","大哭","尴尬","发怒","调皮","呲牙","惊讶","难过","酷","冷汗","抓狂","吐","偷笑","可爱","白眼","傲慢","饥饿","困","惊恐","流汗","憨笑","大兵","奋斗","咒骂","疑问","嘘","晕","折磨","衰","骷髅","敲打","再见","擦汗","抠鼻","鼓掌","糗大了","坏笑","左哼哼","右哼哼","哈欠","鄙视","委屈","快哭了","阴险","亲亲","吓","可怜","菜刀","西瓜","啤酒","篮球","乒乓","咖啡","饭","猪头","玫瑰","凋谢","示爱","爱心","心碎","蛋糕","闪电","炸弹","刀","足球","瓢虫","便便","月亮","太阳","礼物","拥抱","强","弱","握手","胜利","抱拳","勾引","拳头","差劲","爱你","NO","OK","爱情","飞吻","跳跳","发抖","怄火","转圈","磕头","回头","跳绳","挥手","激动","街舞","献吻","左太极","右太极"].indexOf(t)+'.gif" align="middle">'},handleEmotion:function(e){this.content+=e}},mounted:function(){this.getMsgList()},computed:{progress:function(){var e=this;return this.$store.state.progressList.find(function(t){return t.id===e.fileUid}).num<100?this.$store.state.progressList.find(function(t){return t.id===e.fileUid}).num:100}}},l=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"index"},[i("div",{staticClass:"b-title"},[e._v("群发列表 "),i("el-button",{staticStyle:{float:"right","margin-bottom":"10px"},attrs:{type:"primary",plain:""},on:{click:function(t){e.show=!0}}},[e._v("新建群发消息")])],1),e._v(" "),i("el-table",{staticStyle:{width:"100%"},attrs:{data:e.tableData}},[i("el-table-column",{attrs:{type:"expand"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("el-table",{attrs:{border:!1,data:[JSON.parse(t.row.content)]}},[i("el-table-column",{attrs:{label:"类型"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\r\n              "+e._s(e._f("typeFilter")(t.row.type))+"\r\n            ")]}}])}),e._v(" "),"text"!==JSON.parse(t.row.content).type?i("el-table-column",{attrs:{prop:"media_id",label:"media_id"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\r\n              "+e._s(t.row.content)+"\r\n            ")]}}])}):e._e(),e._v(" "),i("el-table-column",{attrs:{prop:"url",label:"内容"},scopedSlots:e._u([{key:"default",fn:function(t){return["text"===t.row.type?i("div",[i("span",{domProps:{innerHTML:e._s(t.row.content.replace(/\/[\u4E00-\u9FA5]{1,3}/gi,e.emotion))}})]):"image"===t.row.type?i("div",[i("img",{staticStyle:{width:"80px"},attrs:{src:t.row.url}})]):"video"===t.row.type?i("div",[i("a",{attrs:{href:t.row.url,target:"_blank"}},[e._v("点击查看视频")])]):e._e()]}}])})],1)]}}])}),e._v(" "),i("el-table-column",{attrs:{prop:"send_id",label:"消息ID"}}),e._v(" "),i("el-table-column",{attrs:{prop:"send_num",label:"预计发送"}}),e._v(" "),i("el-table-column",{attrs:{prop:"arrive_num",label:"已发送"}}),e._v(" "),i("el-table-column",{attrs:{prop:"failed_num",label:"发送失败"}}),e._v(" "),i("el-table-column",{attrs:{prop:"start_at",label:"开始时间"}}),e._v(" "),i("el-table-column",{attrs:{prop:"end_at",label:"截止时间"}}),e._v(" "),i("el-table-column",{attrs:{prop:"created_at",label:"发送时间"}}),e._v(" "),i("el-table-column",{attrs:{label:"操作","min-width":"100"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("el-button",{attrs:{type:"text",plain:"",size:"mini"},on:{click:function(i){e.getMsgResult(t.row.send_id)}}},[e._v("\r\n          查询及时结果\r\n        ")])]}}])})],1),e._v(" "),i("page",{attrs:{total:e.total,limit:e.limit},on:{pageChange:e.onPageChange}}),e._v(" "),i("el-dialog",{attrs:{title:"新建群发消息",visible:e.show},on:{"update:visible":function(t){e.show=t}}},[i("el-form",{ref:"searchFrom",attrs:{model:e.searchFrom,"label-width":"150px"}},[i("el-form-item",{attrs:{label:"是否发送筛选用户"}},[i("el-switch",{attrs:{"active-color":"#13ce66","inactive-color":"#ff4949"},model:{value:e.searchFrom.is_test,callback:function(t){e.$set(e.searchFrom,"is_test",t)},expression:"searchFrom.is_test"}})],1),e._v(" "),e.searchFrom.is_test?i("el-form-item",{attrs:{label:"时间"}},[i("el-date-picker",{attrs:{type:"datetimerange","range-separator":"至","start-placeholder":"开始日期","end-placeholder":"结束日期","default-time":["00:00:00","23:59:59"]},model:{value:e.searchFrom.time,callback:function(t){e.$set(e.searchFrom,"time",t)},expression:"searchFrom.time"}})],1):e._e(),e._v(" "),i("el-row",[i("el-col",{attrs:{span:16}},[i("el-form-item",{attrs:{label:"用户ID"}},[i("el-input",{model:{value:e.searchFrom.user_ids,callback:function(t){e.$set(e.searchFrom,"user_ids",t)},expression:"searchFrom.user_ids"}})],1)],1),e._v(" "),i("el-col",{attrs:{span:8}},[i("el-button",{attrs:{type:"primary"},on:{click:e.onSelectUser}},[e._v("选择用户")])],1)],1),e._v(" "),i("el-tabs",{attrs:{type:"card"},on:{"tab-click":e.handleClick},model:{value:e.activeName,callback:function(t){e.activeName=t},expression:"activeName"}},[i("el-tab-pane",{attrs:{label:"文本",name:"text"}},[i("div",{staticClass:"inner-edit_area"},[i("el-input",{attrs:{type:"textarea",autosize:{minRows:4,maxRows:8},placeholder:"请输入内容"},model:{value:e.content,callback:function(t){e.content=t},expression:"content"}})],1),e._v(" "),i("div",{staticStyle:{float:"right"}},[i("el-popover",{attrs:{placement:"bottom-end",width:"400",offset:10,trigger:"manual"},model:{value:e.showEmotion,callback:function(t){e.showEmotion=t},expression:"showEmotion"}},[i("div",[i("emotion",{attrs:{height:200},on:{emotion:e.handleEmotion}})],1),e._v(" "),i("el-button",{attrs:{slot:"reference",type:"text"},on:{click:function(t){e.showEmotion=!e.showEmotion}},slot:"reference"},[i("span",{staticClass:"icon_emotion emotion_switch"})])],1)],1)]),e._v(" "),i("el-tab-pane",{attrs:{label:"图片",name:"image"}},[i("div",{staticClass:"inner-edit_area"},[i("el-upload",{attrs:{action:"/api/public/upload/zone","http-request":e.uploadFile,"before-upload":e.beforeAvatarUpload,"list-type":"picture-card","file-list":e.imageList,"on-success":e.handleAvatarSuccess,"on-remove":e.handleRemove,limit:1}},[i("i",{staticClass:"el-icon-plus"})])],1)]),e._v(" "),i("el-tab-pane",{attrs:{label:"视频",name:"video"}},[i("el-upload",{staticClass:"upload-video",attrs:{action:"/api/public/upload/zone","http-request":e.uploadVideo,"file-list":e.fileList,"on-remove":e.handleRemoveVideo,limit:1}},[i("el-button",{attrs:{size:"small",type:"primary",disabled:e.fileUid&&e.progress<99}},[e._v("点击上传")]),e._v(" "),i("div",{staticStyle:{width:"300px"}},[e.fileUid?i("el-progress",{attrs:{percentage:e.progress}}):e._e()],1)],1)],1)],1)],1),e._v(" "),i("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{attrs:{type:"primary"},on:{click:function(t){e.send()}}},[e._v("确 定")])],1),e._v(" "),i("el-dialog",{attrs:{visible:e.userDialog.show,"append-to-body":""},on:{"update:visible":function(t){e.$set(e.userDialog,"show",t)}}},[i("el-form",{attrs:{"label-width":"90px"}},[i("el-row",[i("el-col",{attrs:{span:8}},[i("el-form-item",{attrs:{label:"ID"}},[i("el-input",{model:{value:e.searchUserFrom.userId,callback:function(t){e.$set(e.searchUserFrom,"userId",t)},expression:"searchUserFrom.userId"}})],1)],1),e._v(" "),i("el-col",{attrs:{span:8}},[i("el-form-item",{attrs:{label:"昵称"}},[i("el-input",{model:{value:e.searchUserFrom.nickName,callback:function(t){e.$set(e.searchUserFrom,"nickName",t)},expression:"searchUserFrom.nickName"}})],1)],1),e._v(" "),i("el-col",{attrs:{span:8}},[i("el-form-item",{attrs:{label:"电话"}},[i("el-input",{model:{value:e.searchUserFrom.mobile,callback:function(t){e.$set(e.searchUserFrom,"mobile",t)},expression:"searchUserFrom.mobile"}})],1)],1)],1),e._v(" "),i("el-row",[i("el-col",{attrs:{span:8,offset:16}},[i("el-form-item",[i("el-button",{staticStyle:{float:"right"},attrs:{type:"primary",plain:""},on:{click:e.getUser}},[e._v("搜索")])],1)],1)],1)],1),e._v(" "),i("el-table",{ref:"multipleTable",staticStyle:{width:"100%"},attrs:{data:e.userList},on:{"selection-change":e.handleSelectionChange}},[i("el-table-column",{attrs:{type:"selection",width:"55"}}),e._v(" "),i("el-table-column",{attrs:{className:"f-c",label:"用户"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("img",{staticStyle:{"margin-right":"5px",width:"50px",height:"50px","border-radius":"50px"},attrs:{src:t.row.avatar}}),e._v(e._s(t.row.nickname)+"(ID:"+e._s(t.row.user_id)+")\r\n          ")]}}])}),e._v(" "),i("el-table-column",{attrs:{prop:"mobile",label:"手机号"}})],1),e._v(" "),i("page",{attrs:{total:e.userDialog.total,limit:e.userDialog.limit},on:{pageChange:e.onUserPageChange}}),e._v(" "),i("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{on:{click:function(t){e.userDialog.show=!1}}},[e._v("取 消")]),e._v(" "),i("el-button",{attrs:{type:"primary"},on:{click:e.onConfirm}},[e._v("确 定")])],1)],1)],1)],1)};l._withStripped=!0;var c={render:l,staticRenderFns:[]},d=c;var m=!1;var u=i("VU/8")(r,d,!1,function(e){m||i("HK0P")},"data-v-20c1791d",null);u.options.__file="src\\components\\groupSend\\index.vue";t.default=u.exports}});