1 |
- webpackJsonp([55],{"29Vt":function(e,t){},Also:function(e,t){},Od5F:function(e,t){},ran3:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=i("mvHQ"),l=i.n(a),s=i("//Fk"),r=i.n(s),n=i("Xxa5"),o=i.n(n),c=i("exGp"),m=i.n(c),_=i("fGUm"),d=i("2Uyi"),p={name:"fileType",props:["msg_data","file_rule_id","reset"],data:function(){return{wordsList:[{key_val:(new Date).getTime(),fileType_Val:1,text_val:"",msg_id:null,uploadErrFlag:!1,uploadErrInfo:"",mp4:{name:"",pic_url:"",mediaid:""},img:{name:"",pic_url:"",mediaid:""},link:{title:"",pic_url:"",desc:"",url:"",mediaid:""},miniprogram:{title:"",appid:"",page:"",pic_url:"",mediaid:""},wideFile:{name:"",pic_url:"",mediaid:""}}],wordsActive:"",big_see:"",big_url:"",dialogVisible:!1,extraData_img:{admin_id:this.$cookie.getCookie("admin_id"),ttl:this.$cookie.getCookie("ttl"),sign:this.$cookie.getCookie("sign"),corpid:this.$localSelfStore.getLocal("defaultCorp")&&"undefined"!=this.$localSelfStore.getLocal("defaultCorp")?JSON.parse(this.$localSelfStore.getLocal("defaultCorp")).corpid:"",type:1},extraData_pdf:{admin_id:this.$cookie.getCookie("admin_id"),ttl:this.$cookie.getCookie("ttl"),sign:this.$cookie.getCookie("sign"),corpid:this.$localSelfStore.getLocal("defaultCorp")&&"undefined"!=this.$localSelfStore.getLocal("defaultCorp")?JSON.parse(this.$localSelfStore.getLocal("defaultCorp")).corpid:"",type:4},extraData_mp4:{admin_id:this.$cookie.getCookie("admin_id"),ttl:this.$cookie.getCookie("ttl"),sign:this.$cookie.getCookie("sign"),corpid:this.$localSelfStore.getLocal("defaultCorp")&&"undefined"!=this.$localSelfStore.getLocal("defaultCorp")?JSON.parse(this.$localSelfStore.getLocal("defaultCorp")).corpid:"",type:3},returnFlag:!0,msg_data_list:[]}},watch:{reset:function(){this.chuanzhi_msg_data()}},mounted:function(){this.handleInitData()},methods:{chuanzhi_msg_data:function(){var e=this;this.file_rule_id&&(this.msg_data&&this.msg_data.length>0?(this.wordsList=[],this.msg_data.forEach(function(t,i){var a={key_val:"",fileType_Val:1,text_val:"",msg_id:null,uploadErrFlag:!1,uploadErrInfo:"",mp4:{name:"",pic_url:"",mediaid:""},img:{name:"",pic_url:"",mediaid:""},link:{title:"",pic_url:"",desc:"",url:"",mediaid:""},miniprogram:{title:"",appid:"",page:"",pic_url:"",mediaid:""},wideFile:{name:"",pic_url:"",mediaid:""}};a.fileType_Val=t.msg_type,a.key_val=t.content.key_val,a.msg_id=t.msg_id,1==t.msg_type&&(a.text_val=t.content.content),2==t.msg_type&&(a.img.name=t.content.name,a.img.pic_url=t.content.oss_url,a.img.mediaid=t.content.mediaid),3==t.msg_type&&(a.mp4.name=t.content.name,a.mp4.pic_url=t.content.oss_url,a.mp4.mediaid=t.content.mediaid),4==t.msg_type&&(a.wideFile.name=t.content.name,a.wideFile.pic_url=t.content.oss_url,a.wideFile.mediaid=t.content.mediaid),5==t.msg_type&&(a.link.title=t.content.title,a.link.pic_url=t.content.imgUrl,a.link.desc=t.content.desc,a.link.url=t.content.link,a.link.mediaid=t.msg_id),6==t.msg_type&&(a.miniprogram.title=t.content.title,a.miniprogram.pic_url=t.content.imgUrl,a.miniprogram.appid=t.content.app_id,a.miniprogram.page=t.content.page,a.miniprogram.mediaid=t.msg_id),e.wordsList.push(a)}),this.$nextTick(function(){e.wordsActive=e.wordsList[0].key_val})):this.$message({type:"warning",message:"msg_data不正确,请联系开发成员"}))},handleInitData:function(){var e=this;this.wordsList=[{key_val:(new Date).getTime(),fileType_Val:1,text_val:"",msg_id:null,uploadErrFlag:!1,uploadErrInfo:"",mp4:{name:"",pic_url:"",mediaid:""},img:{name:"",pic_url:"",mediaid:""},link:{title:"",pic_url:"",desc:"",url:"",mediaid:""},miniprogram:{title:"",appid:"",page:"",pic_url:"",mediaid:""},wideFile:{name:"",pic_url:"",mediaid:""}}],this.$nextTick(function(){e.wordsActive=e.wordsList[0].key_val})},new_words_list:function(){if(this.wordsList&&this.wordsList.length>=9)this.$message({type:"info",message:"最多可建9个消息"});else{var e={key_val:"",fileType_Val:1,text_val:"",msg_id:null,uploadErrFlag:!1,uploadErrInfo:"",mp4:{name:"",pic_url:"",mediaid:""},img:{name:"",pic_url:"",mediaid:""},link:{title:"",pic_url:"",desc:"",url:"",mediaid:""},miniprogram:{title:"",appid:"",page:"",pic_url:"",mediaid:""},wideFile:{name:"",pic_url:"",mediaid:""}};e.key_val=(new Date).getTime(),this.wordsList.push(e)}},deleWords:function(e){var t=this,i=null;this.wordsList.forEach(function(a,l){a.key_val==e&&(t.wordsList.splice(l,1),i=l)}),this.wordsActive=i?this.wordsList[i-1].key_val:this.wordsList[0].key_val},handleSee:function(e,t){this.dialogVisible=!0,this.big_see=e,this.big_url=t},handleDele:function(e,t){this.get_itemNow(t)&&(this.get_itemNow(t)[e].pic_url="")},get_itemNow:function(e){if(e){var t=null;return this.wordsList.forEach(function(i,a){i.key_val==e&&(t=a)}),this.wordsList[t]}this.$message({type:"error",message:"key_val不正确,请联系开发成员"})},uploadSuccess:function(e,t,i,a,l){if(this.$loading(this.$loadingConfig).close(),this.get_itemNow(l)){var s=this.get_itemNow(l);e&&0==e.errno?(s[a].pic_url=e.rst.url,s[a].mediaid=e.rst.material_id,s.uploadErrFlag=!1):(this.$message({type:"error",message:e.err}),s.uploadErrFlag=!0,s.uploadErrInfo=e.err)}},uploadFail:function(e,t,i){this.$message({message:e.err,type:"error"})},judgeIsComplete:function(){this.returnFlag=!0;for(var e=0;e<this.wordsList.length;e++){var t=this.wordsList[e];if(1==t.fileType_Val&&""==t.text_val)return this.$message({type:"warning",message:"消息"+Number(e+1)+"文字消息必填"}),void(this.returnFlag=!1);if(2==t.fileType_Val){if(""==t.img.name)return this.$message({type:"warning",message:"消息"+Number(e+1)+"图片名称必填"}),void(this.returnFlag=!1);if(""==t.img.pic_url)return this.$message({type:"warning",message:"消息"+Number(e+1)+"图片必填"}),void(this.returnFlag=!1)}if(5==t.fileType_Val){if(""==t.link.title)return this.$message({type:"warning",message:"消息"+Number(e+1)+"链接标题必填"}),void(this.returnFlag=!1);if(""==t.link.desc)return this.$message({type:"warning",message:"消息"+Number(e+1)+"链接描述必填"}),void(this.returnFlag=!1);if(""==t.link.pic_url)return this.$message({type:"warning",message:"消息"+Number(e+1)+"封面图片必填"}),void(this.returnFlag=!1);if(""==t.link.url)return this.$message({type:"warning",message:"消息"+Number(e+1)+"跳转链接必填"}),void(this.returnFlag=!1)}if(6==t.fileType_Val){if(""==t.miniprogram.title)return this.$message({type:"warning",message:"消息"+Number(e+1)+"小程序标题必填"}),void(this.returnFlag=!1);if(""==t.miniprogram.appid)return this.$message({type:"warning",message:"消息"+Number(e+1)+"小程序appID必填"}),void(this.returnFlag=!1);if(""==t.miniprogram.pic_url)return this.$message({type:"warning",message:"消息"+Number(e+1)+"小程序封面图片必填"}),void(this.returnFlag=!1);if(""==t.miniprogram.page)return this.$message({type:"warning",message:"消息"+Number(e+1)+"小程序路径必填"}),void(this.returnFlag=!1)}if(4==t.fileType_Val){if(""==t.wideFile.name)return this.$message({type:"warning",message:"消息"+Number(e+1)+"文件名称必填"}),void(this.returnFlag=!1);if(""==t.wideFile.pic_url)return this.$message({type:"warning",message:"消息"+Number(e+1)+"文件信息必填"}),void(this.returnFlag=!1)}if(3==t.fileType_Val){if(""==t.mp4.name)return this.$message({type:"warning",message:"消息"+Number(e+1)+"视频名称必填"}),void(this.returnFlag=!1);if(""==t.mp4.pic_url)return this.$message({type:"warning",message:"消息"+Number(e+1)+"视频文件必填"}),void(this.returnFlag=!1)}}if(this.returnFlag){this.msg_data_list=[];for(var i=0;i<this.wordsList.length;i++){var a=this.wordsList[i];1==a.fileType_Val&&this.msg_data_list.push({chat_type:a.fileType_Val,content:a.text_val,msg_id:a.msg_id,key_val:a.key_val}),2==a.fileType_Val&&this.msg_data_list.push({chat_type:a.fileType_Val,msg_id:a.msg_id,mediaid:a.img.mediaid,name:a.img.name,oss_url:a.img.pic_url,key_val:a.key_val}),5==a.fileType_Val&&this.msg_data_list.push({chat_type:a.fileType_Val,link:a.link.url,title:a.link.title,desc:a.link.desc,msg_id:a.msg_id,imgUrl:a.link.pic_url,key_val:a.key_val}),6==a.fileType_Val&&this.msg_data_list.push({chat_type:a.fileType_Val,app_id:a.miniprogram.appid,title:a.miniprogram.title,imgUrl:a.miniprogram.pic_url,page:a.miniprogram.page,msg_id:a.msg_id,mediaid:a.mediaid,key_val:a.key_val}),4==a.fileType_Val&&this.msg_data_list.push({chat_type:a.fileType_Val,mediaid:a.wideFile.mediaid,name:a.wideFile.name,oss_url:a.wideFile.pic_url,msg_id:a.msg_id,key_val:a.key_val}),3==a.fileType_Val&&this.msg_data_list.push({chat_type:a.fileType_Val,mediaid:a.mp4.mediaid,name:a.mp4.name,oss_url:a.mp4.pic_url,msg_id:a.msg_id,key_val:a.key_val})}}}}},u={render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"regulations"},[i("div",{staticClass:"wordsCon"},[i("div",{staticClass:"con_left"},[e._l(e.wordsList,function(t,a){return i("div",{key:t.key_val},[i("div",{staticClass:"groupBox",class:e.wordsActive==t.key_val?"wordsActive":"",on:{click:function(i){e.wordsActive=t.key_val}}},[e._v("\n 消息"+e._s(a+1)+"\n "),1==t.fileType_Val?i("span",[e._v("文字")]):e._e(),e._v(" "),2==t.fileType_Val?i("span",[e._v("图片")]):e._e(),e._v(" "),5==t.fileType_Val?i("span",[e._v("链接")]):e._e(),e._v(" "),6==t.fileType_Val?i("span",[e._v("小程序")]):e._e(),e._v(" "),4==t.fileType_Val?i("span",[e._v("文件")]):e._e(),e._v(" "),3==t.fileType_Val?i("span",[e._v("视频")]):e._e()])])}),e._v(" "),i("div",{staticClass:"newBox",on:{click:e.new_words_list}},[e._v("新建")])],2),e._v(" "),i("div",{staticClass:"con_right"},e._l(e.wordsList,function(t,a){return i("div",{key:t.key_val},[e.wordsActive==t.key_val?[i("div",{staticClass:"quickType"},[e._m(0,!0),e._v(" "),i("div",{staticClass:"self_input",staticStyle:{display:"flex"}},[i("el-radio",{attrs:{label:1},model:{value:t.fileType_Val,callback:function(i){e.$set(t,"fileType_Val",i)},expression:"item.fileType_Val"}},[e._v("文字")]),e._v(" "),i("el-radio",{attrs:{label:2},model:{value:t.fileType_Val,callback:function(i){e.$set(t,"fileType_Val",i)},expression:"item.fileType_Val"}},[e._v("图片")]),e._v(" "),i("el-radio",{attrs:{label:5},model:{value:t.fileType_Val,callback:function(i){e.$set(t,"fileType_Val",i)},expression:"item.fileType_Val"}},[e._v("链接")]),e._v(" "),i("el-radio",{attrs:{label:6},model:{value:t.fileType_Val,callback:function(i){e.$set(t,"fileType_Val",i)},expression:"item.fileType_Val"}},[e._v("小程序")]),e._v(" "),i("el-radio",{attrs:{label:4},model:{value:t.fileType_Val,callback:function(i){e.$set(t,"fileType_Val",i)},expression:"item.fileType_Val"}},[e._v("文件")]),e._v(" "),i("el-radio",{attrs:{label:3},model:{value:t.fileType_Val,callback:function(i){e.$set(t,"fileType_Val",i)},expression:"item.fileType_Val"}},[e._v("视频")])],1)]),e._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:1==t.fileType_Val,expression:"item.fileType_Val==1"}]},[i("div",{staticClass:"lineItem"},[e._m(1,!0),e._v(" "),i("el-input",{staticClass:"self_input",attrs:{type:"textarea",rows:5,placeholder:"请输入文本内容",maxlength:"2000","show-word-limit":"",clearable:"",size:"small"},model:{value:t.text_val,callback:function(i){e.$set(t,"text_val","string"==typeof i?i.trim():i)},expression:"item.text_val"}})],1)]),e._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:2==t.fileType_Val,expression:"item.fileType_Val==2"}]},[i("div",{staticClass:"lineItem"},[e._m(2,!0),e._v(" "),i("el-input",{staticClass:"self_input",attrs:{size:"small",placeholder:"请输入图片名称",maxlength:"32","show-word-limit":"",clearable:""},model:{value:t.img.name,callback:function(i){e.$set(t.img,"name",i)},expression:"item.img.name"}})],1),e._v(" "),i("div",{staticClass:"lineItem radar_cover_box"},[e._m(3,!0),e._v(" "),i("div",{staticClass:"self_input"},[i("el-upload",{key:"imgUpload"+t.key_val,staticClass:"avatar-uploader",attrs:{action:e.URL.BASEURL+e.URL.material_upload,name:"material_file",data:e.extraData_img,accept:".jpg,.png","show-file-list":!1,"before-upload":function(){e.$loading(e.$loadingConfig)},"on-success":function(i,a,l){return e.uploadSuccess(i,a,l,"img",t.key_val)},"on-error":e.uploadFail}},[i("div",{attrs:{slot:"trigger"},slot:"trigger"},[t.img.pic_url?i("img",{staticClass:"uploadImg",attrs:{src:t.img.pic_url}}):i("i",{staticClass:"el-icon-plus avatar-uploader-icon"})]),e._v(" "),t.img.pic_url?i("span",[i("i",{staticClass:"el-icon-zoom-in pointer f14 c-666",on:{click:function(i){return e.handleSee("img",t.img.pic_url)}}}),e._v(" "),i("i",{staticClass:"el-icon-delete pointer f14 c-666",on:{click:function(i){return e.handleDele("img",t.key_val)}}})]):e._e(),e._v(" "),i("div",{staticClass:"el-upload__tip",attrs:{slot:"tip"},slot:"tip"},[i("div",[e._v(" 图片大小不超过1MB,最多上传1张")]),e._v(" "),t.uploadErrFlag?i("div",{staticClass:"errCss"},[e._v("* 错误:"+e._s(t.uploadErrInfo))]):e._e()])])],1)])]),e._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:5==t.fileType_Val,expression:"item.fileType_Val==5"}]},[i("div",{staticClass:"lineItem"},[e._m(4,!0),e._v(" "),i("el-input",{staticClass:"self_input",attrs:{size:"small",maxlength:"32","show-word-limit":"",placeholder:"请输入链接标题",clearable:""},model:{value:t.link.title,callback:function(i){e.$set(t.link,"title",i)},expression:"item.link.title"}})],1),e._v(" "),i("div",{staticClass:"lineItem"},[e._m(5,!0),e._v(" "),i("el-input",{staticClass:"self_input",attrs:{type:"textarea",rows:5,size:"small",placeholder:"请输入链接描述",maxlength:"500","show-word-limit":"",clearable:""},model:{value:t.link.desc,callback:function(i){e.$set(t.link,"desc",i)},expression:"item.link.desc"}})],1),e._v(" "),i("div",{staticClass:"lineItem"},[e._m(6,!0),e._v(" "),i("div",{staticClass:"self_input"},[i("el-upload",{key:"linkCover"+t.key_val,staticClass:"avatar-uploader",attrs:{action:e.URL.BASEURL+e.URL.material_upload,name:"material_file","show-file-list":!1,data:e.extraData_img,"before-upload":function(){e.$loading(e.$loadingConfig)},"on-success":function(i,a,l){return e.uploadSuccess(i,a,l,"link",t.key_val)},"on-error":e.uploadFail,accept:".jpg,.jpeg,.png"}},[i("div",{attrs:{slot:"trigger"},slot:"trigger"},[t.link.pic_url?i("img",{staticClass:"uploadImg",attrs:{src:t.link.pic_url}}):i("i",{staticClass:"el-icon-plus avatar-uploader-icon"})]),e._v(" "),t.link.pic_url?i("span",[i("i",{staticClass:"el-icon-zoom-in pointer f14 c-666",on:{click:function(i){return e.handleSee("link",t.link.pic_url)}}}),e._v(" "),i("i",{staticClass:"el-icon-delete pointer f14 c-666",on:{click:function(i){return e.handleDele("link",t.key_val)}}})]):e._e(),e._v(" "),i("div",{staticClass:"el-upload__tip",attrs:{slot:"tip"},slot:"tip"},[i("div",[e._v(" 建议尺寸:200*200,大小不超过500kb.")]),e._v(" "),t.uploadErrFlag?i("div",{staticClass:"errCss"},[e._v("* 错误:"+e._s(t.uploadErrInfo))]):e._e()])])],1)]),e._v(" "),i("div",{staticClass:"lineItem"},[e._m(7,!0),e._v(" "),i("el-input",{staticClass:"self_input",attrs:{size:"small",placeholder:"请输入链接地址",clearable:""},model:{value:t.link.url,callback:function(i){e.$set(t.link,"url",i)},expression:"item.link.url"}})],1)]),e._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:6==t.fileType_Val,expression:"item.fileType_Val==6"}]},[e._m(8,!0),e._v(" "),i("div",{staticClass:"lineItem"},[e._m(9,!0),e._v(" "),i("el-input",{staticClass:"self_input",attrs:{size:"small",placeholder:"请输入小程序标题",maxlength:"20","show-word-limit":"",clearable:""},model:{value:t.miniprogram.title,callback:function(i){e.$set(t.miniprogram,"title",i)},expression:"item.miniprogram.title"}})],1),e._v(" "),i("div",{staticClass:"lineItem"},[e._m(10,!0),e._v(" "),i("el-input",{staticClass:"self_input",attrs:{size:"small",placeholder:"请输入小程序appID",maxlength:"32","show-word-limit":"",clearable:""},model:{value:t.miniprogram.appid,callback:function(i){e.$set(t.miniprogram,"appid",i)},expression:"item.miniprogram.appid"}})],1),e._v(" "),i("div",{staticClass:"lineItem"},[e._m(11,!0),e._v(" "),i("el-input",{staticClass:"self_input",attrs:{size:"small",placeholder:"请输入小程序路径",maxlength:"500","show-word-limit":"",clearable:""},model:{value:t.miniprogram.page,callback:function(i){e.$set(t.miniprogram,"page",i)},expression:"item.miniprogram.page"}})],1),e._v(" "),i("div",{staticClass:"lineItem"},[e._m(12,!0),e._v(" "),i("div",{staticClass:"self_input"},[i("el-upload",{key:"miniprogramCover"+t.key_val,staticClass:"avatar-uploader",attrs:{action:e.URL.BASEURL+e.URL.material_upload,name:"material_file",data:e.extraData_img,"show-file-list":!1,"before-upload":function(){e.$loading(e.$loadingConfig)},"on-success":function(i,a,l){return e.uploadSuccess(i,a,l,"miniprogram",t.key_val)},"on-error":e.uploadFail,accept:".jpg,.jpeg,.png"}},[i("div",{attrs:{slot:"trigger"},slot:"trigger"},[t.miniprogram.pic_url?i("img",{staticClass:"uploadImg",attrs:{src:t.miniprogram.pic_url}}):i("i",{staticClass:"el-icon-plus avatar-uploader-icon"})]),e._v(" "),t.miniprogram.pic_url?i("span",[i("i",{staticClass:"el-icon-zoom-in pointer f14 c-666",on:{click:function(i){return e.handleSee("miniprogram",t.miniprogram.pic_url)}}}),e._v(" "),i("i",{staticClass:"el-icon-delete pointer f14 c-666",on:{click:function(i){return e.handleDele("miniprogram",t.key_val)}}})]):e._e(),e._v(" "),i("div",{staticClass:"el-upload__tip",attrs:{slot:"tip"},slot:"tip"},[i("div",[e._v("建议尺寸:200*200,大小不超过5M.")]),e._v(" "),t.uploadErrFlag?i("div",{staticClass:"errCss"},[e._v("* 错误:"+e._s(t.uploadErrInfo))]):e._e()])])],1)])]),e._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:4==t.fileType_Val,expression:"item.fileType_Val==4"}]},[i("div",{staticClass:"lineItem"},[e._m(13,!0),e._v(" "),i("el-input",{staticClass:"self_input",attrs:{size:"small",placeholder:"请输入文件名称",maxlength:"32","show-word-limit":"",clearable:""},model:{value:t.wideFile.name,callback:function(i){e.$set(t.wideFile,"name",i)},expression:"item.wideFile.name"}})],1),e._v(" "),i("div",{staticClass:"lineItem"},[e._m(14,!0),e._v(" "),i("div",{staticClass:"self_input"},[i("el-upload",{key:"wideFile"+t.key_val,attrs:{action:e.URL.BASEURL+e.URL.material_upload,name:"material_file",data:e.extraData_pdf,"show-file-list":!1,"before-upload":function(){e.$loading(e.$loadingConfig)},"on-error":e.uploadFail,"on-success":function(i,a,l){return e.uploadSuccess(i,a,l,"wideFile",t.key_val)}}},[i("div",{attrs:{slot:"trigger"},slot:"trigger"},[t.wideFile.pic_url?i("div",{staticClass:"wideFileBox"},[e._v(e._s(t.wideFile.pic_url)+" ")]):i("el-button",{attrs:{size:"small",icon:"el-icon-upload"}},[e._v("上传文件")])],1),e._v(" "),t.wideFile.pic_url?i("div",{staticClass:"tMar10"},[i("i",{staticClass:"el-icon-zoom-in pointer f14 c-666",on:{click:function(i){return e.handleSee("wideFile",t.wideFile.pic_url)}}}),e._v(" "),i("i",{staticClass:"el-icon-delete pointer f14 c-666",on:{click:function(i){return e.handleDele("wideFile",t.key_val)}}})]):e._e(),e._v(" "),i("div",{staticClass:"el-upload__tip",attrs:{slot:"tip"},slot:"tip"},[i("div",[e._v("请上传文件,大小不超过10MB")]),e._v(" "),t.uploadErrFlag?i("div",{staticClass:"errCss"},[e._v("* 错误:"+e._s(t.uploadErrInfo))]):e._e()])])],1)])]),e._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:3==t.fileType_Val,expression:"item.fileType_Val==3"}]},[i("div",{staticClass:"lineItem"},[e._m(15,!0),e._v(" "),i("el-input",{staticClass:"self_input",attrs:{size:"small",placeholder:"请输入视频名称",maxlength:"32","show-word-limit":"",clearable:""},model:{value:t.mp4.name,callback:function(i){e.$set(t.mp4,"name",i)},expression:"item.mp4.name"}})],1),e._v(" "),i("div",{staticClass:"lineItem"},[e._m(16,!0),e._v(" "),i("div",{staticClass:"self_input"},[i("el-upload",{key:"mp4Upload"+t.key_val,attrs:{action:e.URL.BASEURL+e.URL.material_upload,name:"material_file",data:e.extraData_mp4,accept:".mp4,.MP4","show-file-list":!1,"before-upload":function(){e.$loading(e.$loadingConfig)},"on-success":function(i,a,l){return e.uploadSuccess(i,a,l,"mp4",t.key_val)},"on-error":e.uploadFail}},[i("div",{attrs:{slot:"trigger"},slot:"trigger"},[t.mp4.pic_url?i("video",{staticStyle:{width:"200px",height:"260px"},attrs:{controls:"controls",src:t.mp4.pic_url}}):i("el-button",{attrs:{size:"small",icon:"el-icon-upload"}},[e._v("上传视频")])],1),e._v(" "),t.mp4.pic_url?i("div",{staticClass:"tMar10"},[i("i",{staticClass:"el-icon-zoom-in pointer f14 c-666",on:{click:function(i){return e.handleSee("mp4",t.mp4.pic_url)}}}),e._v(" "),i("i",{staticClass:"el-icon-delete pointer f14 c-666",on:{click:function(i){return e.handleDele("mp4",t.key_val)}}})]):e._e(),e._v(" "),i("div",{staticClass:"el-upload__tip",attrs:{slot:"tip"},slot:"tip"},[i("div",[e._v("只能上传.mp4文件,且不超过10MB")]),e._v(" "),t.uploadErrFlag?i("div",{staticClass:"errCss"},[e._v("* 错误:"+e._s(t.uploadErrInfo))]):e._e()])])],1)])]),e._v(" "),e.wordsList&&e.wordsList.length>=2?i("el-popconfirm",{attrs:{placement:"bottom-start",title:"确定删除吗?"},on:{confirm:function(i){return e.deleWords(t.key_val)}}},[i("div",{staticClass:"deleBox",attrs:{slot:"reference"},slot:"reference"},[i("i",{staticClass:"el-icon-delete"}),e._v("删除此条消息")])]):e._e()]:e._e()],2)}),0)]),e._v(" "),i("el-dialog",{attrs:{width:"40%","append-to-body":"",visible:e.dialogVisible},on:{"update:visible":function(t){e.dialogVisible=t}}},["wideFile"==e.big_see?i("iframe",{staticStyle:{width:"100%",height:"500px"},attrs:{src:"http://view.xdocin.com/xdoc?_xdoc="+e.big_url,frameborder:"0",scrolling:"no"}}):e._e(),e._v(" "),"img"==e.big_see||"miniprogram"==e.big_see||"link"==e.big_see?i("img",{attrs:{width:"100%",src:e.big_url,alt:""}}):e._e(),e._v(" "),"mp4"==e.big_see?i("video",{staticStyle:{width:"100%",height:"500px"},attrs:{src:e.big_url,controls:"controls"}}):e._e()])],1)},staticRenderFns:[function(){var e=this.$createElement,t=this._self._c||e;return t("label",[t("em",[this._v("*")]),this._v("消息类型")])},function(){var e=this.$createElement,t=this._self._c||e;return t("label",[t("em",[this._v("*")]),this._v("文字消息")])},function(){var e=this.$createElement,t=this._self._c||e;return t("label",[t("em",[this._v("*")]),this._v("图片名称:")])},function(){var e=this.$createElement,t=this._self._c||e;return t("label",[t("em",[this._v("*")]),this._v("添加图片")])},function(){var e=this.$createElement,t=this._self._c||e;return t("label",[t("em",[this._v("*")]),this._v("链接标题:")])},function(){var e=this.$createElement,t=this._self._c||e;return t("label",[t("em",[this._v("*")]),this._v("链接描述:")])},function(){var e=this.$createElement,t=this._self._c||e;return t("label",[t("em",[this._v("*")]),this._v("封面图片:")])},function(){var e=this.$createElement,t=this._self._c||e;return t("label",[t("em",[this._v("*")]),this._v("跳转链接:")])},function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"self-hint",staticStyle:{"margin-bottom":"10px",border:"none"}},[t("i",{staticClass:"el-icon-message-solid"}),this._v(" "),t("span",[this._v("请填写企业微信后台绑定的小程序id和路径,否则会造成发送失败")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("label",[t("em",[this._v("*")]),this._v("标题:")])},function(){var e=this.$createElement,t=this._self._c||e;return t("label",[t("em",[this._v("*")]),this._v("appID:")])},function(){var e=this.$createElement,t=this._self._c||e;return t("label",[t("em",[this._v("*")]),this._v("路径:")])},function(){var e=this.$createElement,t=this._self._c||e;return t("label",[t("em",[this._v("*")]),this._v("封面:")])},function(){var e=this.$createElement,t=this._self._c||e;return t("label",[t("em",[this._v("*")]),this._v("文件名称:")])},function(){var e=this.$createElement,t=this._self._c||e;return t("label",[t("em",[this._v("*")]),this._v("添加文件:")])},function(){var e=this.$createElement,t=this._self._c||e;return t("label",[t("em",[this._v("*")]),this._v("视频名称:")])},function(){var e=this.$createElement,t=this._self._c||e;return t("label",[t("em",[this._v("*")]),this._v("上传视频:")])}]};var v=i("VU/8")(p,u,!1,function(e){i("29Vt"),i("Od5F")},"data-v-58c56133",null).exports,g=i("cHmb"),f=i("sazF"),h={name:"createSop",components:{selfCustomerservice:_.a,fileType:v,screenPay:g.a,enterpriseTag:f.a},data:function(){return{loading:!1,isShowUserOptions:!1,form:{title:"",is_all:0,user_ids:[],type:1,time:{hour:"",minute:"",days:"",timeNum:""},msg_data:[],isClientFilter:0,clientFilter:{gender:[],payInfo:{},tagData:{tag_id_list:[],tag:1},tagDataExclude:{tag_id_list:[],tag:1}}},rule_id:this.$route.query.id||""}},computed:{isEdit:function(){var e=this.$route.query,t=e.id,i=void 0===t?"":t,a=e.type;return i&&"edit"===(void 0===a?"":a)}},created:function(){this.isEdit?this.handleGetDetail():this.isShowUserOptions=!0},methods:{handleGetDetail:function(){var e=this;return m()(o.a.mark(function t(){var i,a,l,s,r,n,c;return o.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,e.loading=!0,i=""+e.URL.BASEURL+e.URL.sop_ruleDetail,a={rule_id:e.rule_id},t.next=6,e.$axios.get(i,{params:a});case 6:l=t.sent,s=l.data,(r=void 0===s?{}:s)&&0==r.errno?(n=r.rst,c=void 0===n?{}:n,e.setFormData(c)):4002!=r.errno&&(e.$message.warning(r.err),e.$router.go(-1)),t.next=15;break;case 12:t.prev=12,t.t0=t.catch(0),console.log("error => ",t.t0);case 15:return t.prev=15,e.loading=!1,t.finish(15);case 18:case"end":return t.stop()}},t,e,[[0,12,15,18]])}))()},setFormData:function(e){var t=this;return m()(o.a.mark(function i(){return o.a.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.prev=0,t.loading=!0,t.form.title=e.title,t.form.is_all=e.is_all,t.form.user_ids=e.user_ids.split(","),t.form.isClientFilter=e.customer_filter,1==t.form.isClientFilter&&(t.form.clientFilter.gender=e.gender?e.gender.split(","):"",t.form.clientFilter.payInfo={pay_status:e.pay_status,pay_num_min:e.pay_num_min,pay_num_max:e.pay_num_max},t.form.clientFilter.tagData.tag=e.tag_screen_type,t.form.clientFilter.tagData.tag_id_list=e.tag_list?e.tag_list.split(","):[],t.form.clientFilter.tagDataExclude.tag_id_list=e.exclude_tag_list?e.exclude_tag_list.split(","):[]),t.form.type=e.type,1==t.form.type?(t.form.time.hour=parseInt(Number(e.interval_time)/60)||0,t.form.time.minute=Number(e.interval_time)%60||0):(t.form.time.days=e.interval_time/60/24,t.form.time.timeNum=e.notice_time||""),t.form.msg_data=e.msg_data,t.isShowUserOptions=!0,i.next=13,t.$nextTick();case 13:t.$refs.fileTypeRef.chuanzhi_msg_data(),i.next=19;break;case 16:i.prev=16,i.t0=i.catch(0),console.log("error => ",i.t0);case 19:return i.prev=19,t.loading=!1,i.finish(19);case 22:case"end":return i.stop()}},i,t,[[0,16,19,22]])}))()},onClickSave:function(){var e=this;return m()(o.a.mark(function t(){var i,a,l,s,r;return o.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e.handleFormValidate();case 3:return i=e.handleGetParams(),a=i.url,l=i.params,e.loading=!0,t.next=7,e.$axios.post(a,l);case 7:s=t.sent,(r=s.data)&&0==r.errno?(e.$message.success("保存成功"),e.$router.go(-1)):4002!=r.errno&&e.$message.warning(r.err||"操作失败"),t.next=15;break;case 12:t.prev=12,t.t0=t.catch(0),console.log("error => ",t.t0);case 15:return t.prev=15,e.loading=!1,t.finish(15);case 18:case"end":return t.stop()}},t,e,[[0,12,15,18]])}))()},onInputTimeHour:function(e){this.form.time.hour=Object(d.k)(e)},onInputTimeMinute:function(e){this.form.time.minute=Object(d.k)(e)},onInputTimeDays:function(e){this.form.time.days=Object(d.k)(e)},handleFormValidate:function(){var e=this,t=this.form,i=t.title,a=t.user_ids,l=t.type,s=t.time,n=60*Number(s.hour)+Number(s.minute),o=24*Number(s.days)*60;return new r.a(function(t,r){if(i)if(a&&a.length)if(1==l&&Number(n)<1)e.$message.warning("请输入发送时间"),r("表单校验未通过");else if(2==l&&(Number(o)<1||!s.timeNum))e.$message.warning("请输入发送时间"),r("表单校验未通过");else{e.$refs.fileTypeRef.judgeIsComplete(),!e.$refs.fileTypeRef.returnFlag?r("表单校验未通过"):t("表单校验通过")}else e.$message.warning("请选择客服成员"),r("表单校验未通过");else e.$message.warning("请输入规则名称"),r("表单校验未通过")})},handleGetParams:function(){var e=""+this.URL.BASEURL+this.URL.sop_setRule,t=this.form,i=t.title,a=t.is_all,s=t.user_ids,r=t.type,n=t.time,o=t.isClientFilter,c=t.clientFilter,m=c.gender,_=c.tagData,d=c.tagDataExclude,p=c.payInfo,u=60*Number(n.hour)+Number(n.minute),v=24*Number(n.days)*60,g={title:i,is_all:a,user_ids:s.join(","),type:r,interval_time:1==r?u:v,notice_time:1==r?"":n.timeNum,msg_data:l()(this.$refs.fileTypeRef.msg_data_list),customer_filter:o,gender:"",tag_screen_type:0,tag_list:"",exclude_tag_list:"",pay_status:"",pay_num_min:"",pay_num_max:""};return 1==o&&(g.gender=m&&m.length?m.join(","):"",1==_.tag||2==_.tag?_.tag_id_list&&_.tag_id_list.length&&(g.tag_screen_type=_.tag,g.tag_list=_.tag_id_list.join(",")):3==_.tag&&(g.tag_screen_type=_.tag,g.tag_list=""),g.exclude_tag_list=d.tag_id_list&&d.tag_id_list.length?d.tag_id_list.join(","):"",g.pay_status=p.pay_status||0==p.pay_status?p.pay_status:"",g.pay_num_min=p.pay_num_min||0==p.pay_num_min?p.pay_num_min:"",g.pay_num_max=p.pay_num_max||0==p.pay_num_max?p.pay_num_max:""),this.isEdit&&(g.rule_id=this.rule_id),{url:e,params:g}},onChangeUserList:function(e){this.form.user_ids=Array.isArray(e)&&e.length?e:[]},onPayChange:function(e){this.form.clientFilter.payInfo={pay_status:e.radio,pay_num_min:e.minValue,pay_num_max:e.maxValue}},onChangeTagData:function(e){var t=e.tag,i=e.tag_id_list;this.form.clientFilter.tagData.tag=t,i&&i.length?this.form.clientFilter.tagData.tag_id_list=i:this.form.clientFilter.tagData.tag_id_list=[]},onChangeTagDataExclude:function(e){var t=e.tag,i=e.tag_id_list;this.form.clientFilter.tagDataExclude.tag=t,i&&i.length?this.form.clientFilter.tagDataExclude.tag_id_list=i:this.form.clientFilter.tagDataExclude.tag_id_list=[]}}},y={render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"create-wrap"},[i("div",{staticClass:"backBox",on:{click:function(t){return e.$router.go(-1)}}},[e._m(0)]),e._v(" "),i("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"bg-ffffff createMassMsg",staticStyle:{padding:"15px 30px"}},[i("h3",{staticClass:"bigTitle"},[e._v("基础信息")]),e._v(" "),i("div",{staticClass:"regulations"},[e._m(1),e._v(" "),i("el-input",{staticStyle:{width:"300px"},attrs:{placeholder:"请输入规则名称",maxlength:"20",size:"small","show-word-limit":"",clearable:""},model:{value:e.form.title,callback:function(t){e.$set(e.form,"title","string"==typeof t?t.trim():t)},expression:"form.title"}})],1),e._v(" "),i("div",{staticClass:"regulations",staticStyle:{"align-items":"center"}},[e._m(2),e._v(" "),e.isShowUserOptions?i("self-customerservice",{ref:"selfKefu",staticStyle:{margin:"0"},attrs:{title:"",width:"300px",source:"channelCode",afferent_users:e.form.user_ids},on:{customerDefine:e.onChangeUserList}}):e._e(),e._v(" "),i("div",{staticClass:"user-tips"},[e._v("以下成员添加新客户后会触发规则,将在侧边栏快捷话术回复提醒该规则内容。")])],1),e._v(" "),i("div",{staticClass:"regulations"},[e._m(3),e._v(" "),i("div",{staticStyle:{"padding-top":"4px"}},[i("el-switch",{attrs:{"active-value":1,"inactive-value":0},model:{value:e.form.isClientFilter,callback:function(t){e.$set(e.form,"isClientFilter",t)},expression:"form.isClientFilter"}}),e._v(" "),1===e.form.isClientFilter?i("div",{staticClass:"screeningCustomers"},[i("div",{staticClass:"screeningItem"},[i("label",[e._v("性别:")]),e._v(" "),i("el-checkbox-group",{staticClass:"checkboxGroup",model:{value:e.form.clientFilter.gender,callback:function(t){e.$set(e.form.clientFilter,"gender",t)},expression:"form.clientFilter.gender"}},[i("el-checkbox",{attrs:{label:"1"}},[e._v("男性")]),e._v(" "),i("el-checkbox",{attrs:{label:"2"}},[e._v("女性")]),e._v(" "),i("el-checkbox",{attrs:{label:"0"}},[e._v("未知性别")])],1)],1),e._v(" "),i("div",{staticClass:"screeningItem"},[i("label",[e._v("付费情况:")]),e._v(" "),i("screenPay",{staticStyle:{margin:"0"},attrs:{title:"",width:"355px",afferent_obj:e.form.clientFilter.payInfo},on:{payChange:e.onPayChange}})],1),e._v(" "),i("div",{staticClass:"screeningItem"},[i("label",[e._v("标签:")]),e._v(" "),i("enterpriseTag",{staticStyle:{margin:"0"},attrs:{title:"",width:"355px",afferent_obj:e.form.clientFilter.tagData},on:{tagDefine:e.onChangeTagData}})],1),e._v(" "),i("div",{staticClass:"screeningItem",staticStyle:{"align-items":"flex-start"}},[i("label",[e._v("排除客户:")]),e._v(" "),i("div",{staticStyle:{flex:"1"}},[i("enterpriseTag",{staticStyle:{margin:"0"},attrs:{title:"",width:"355px",excludeFlag:!0,afferent_obj:e.form.clientFilter.tagDataExclude},on:{tagDefine:e.onChangeTagDataExclude}}),e._v(" "),i("p",{staticClass:"screening-hint"},[e._v("可根据标签选择客户,群发时将不会发送给该标签内的客户。若选择了排除的客户,需要较长时间创建本条群发消息哦~")])],1)])]):e._e()],1)]),e._v(" "),i("div",{staticClass:"line",staticStyle:{"margin-top":"20px"}}),e._v(" "),i("h3",{staticClass:"bigTitle"},[e._v("设置推送规则及内容")]),e._v(" "),i("div",{staticClass:"regulations"},[e._m(4),e._v(" "),i("div",{staticClass:"send-time-wrap"},[i("div",{staticClass:"send-time-item"},[i("el-radio",{attrs:{label:1},model:{value:e.form.type,callback:function(t){e.$set(e.form,"type",t)},expression:"form.type"}},[i("span")]),e._v(" "),i("span",{staticClass:"text"},[e._v("客户添加客服后")]),e._v(" "),i("el-input",{attrs:{size:"mini",maxlength:"2",clearable:""},on:{input:e.onInputTimeHour},model:{value:e.form.time.hour,callback:function(t){e.$set(e.form.time,"hour",t)},expression:"form.time.hour"}}),i("span",{staticClass:"text"},[e._v("小时")]),e._v(" "),i("el-input",{attrs:{size:"mini",maxlength:"2",clearable:""},on:{input:e.onInputTimeMinute},model:{value:e.form.time.minute,callback:function(t){e.$set(e.form.time,"minute",t)},expression:"form.time.minute"}}),i("span",{staticClass:"text"},[e._v("分钟后提醒发送")])],1),e._v(" "),i("div",{staticClass:"send-time-item"},[i("el-radio",{attrs:{label:2},model:{value:e.form.type,callback:function(t){e.$set(e.form,"type",t)},expression:"form.type"}},[i("span")]),e._v(" "),i("span",{staticClass:"text"},[e._v("客户添加客服后")]),e._v(" "),i("el-input",{attrs:{size:"mini",clearable:""},on:{input:e.onInputTimeDays},model:{value:e.form.time.days,callback:function(t){e.$set(e.form.time,"days",t)},expression:"form.time.days"}}),i("span",{staticClass:"text"},[e._v("天后,当天")]),e._v(" "),i("el-time-picker",{attrs:{size:"mini",clearable:"",placeholder:"请选择","value-format":"HH:mm:ss"},model:{value:e.form.time.timeNum,callback:function(t){e.$set(e.form.time,"timeNum",t)},expression:"form.time.timeNum"}}),i("span",{staticClass:"text"},[e._v("提醒发送")])],1)])]),e._v(" "),i("div",{staticClass:"regulations"},[e._m(5),e._v(" "),i("fileType",{ref:"fileTypeRef",staticStyle:{"margin-top":"0"},attrs:{msg_data:e.form.msg_data,file_rule_id:e.rule_id}})],1),e._v(" "),i("div",{staticClass:"line",staticStyle:{"margin-top":"20px"}}),e._v(" "),i("div",{staticStyle:{margin:"20px 0 40px"}},[i("el-button",{attrs:{type:"primary"},on:{click:e.onClickSave}},[e._v("保存")])],1)])])},staticRenderFns:[function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"back"},[t("i",{staticClass:"el-icon-back"}),this._v(" "),t("span",[this._v("返回")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("label",[t("em",[this._v("*")]),this._v("规则名称")])},function(){var e=this.$createElement,t=this._self._c||e;return t("label",[t("em",[this._v("*")]),this._v("客服成员")])},function(){var e=this.$createElement,t=this._self._c||e;return t("label",[t("em",[this._v(" ")]),this._v("客户筛选")])},function(){var e=this.$createElement,t=this._self._c||e;return t("label",[t("em",[this._v("*")]),this._v("发送时间")])},function(){var e=this.$createElement,t=this._self._c||e;return t("label",[t("em",[this._v("*")]),this._v("发送内容")])}]};var k=i("VU/8")(h,y,!1,function(e){i("Also")},"data-v-1b311d38",null);t.default=k.exports}});
|