24.94a4fbe53937490711f2.js 18.1 KB
webpackJsonp([24],{CUAv:function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,a=o("CCn6"),n=o("kmJW"),s=o("5eDb"),l=o.n(s),r=(o("o5MN"),o("q47d"));o("NBEC"),o("gBhd"),o("Q/P+"),o("f85y"),o("q/hF"),o("yXOt"),o("c/6r"),o("Rv7z"),o("S0tB"),o("UWKq"),o("gvu3"),o("XUqK");function d(t,e,o){return e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}var c={name:"tinymce",props:["lookData"],data:function(){return{radio:[],imageType:!1,form:{imgList:[],big:!1,weight:"",center:!0},show:"",dialogVisible:!1,init:{toolbar:"bold italic underline strikethrough | fontselect | fontsizeselect | forecolor backcolor | alignleft aligncenter alignright alignjustify | bullist numlist | outdent indent blockquote | undo redo | link unlink image code | ",language_url:"/static/tinymce/zh_CN.js",language:"zh_CN",skin_url:"/static/tinymce/skins/lightgray",height:500,plugins:"preview textpattern colorpicker lists code colorpicker fullpage textcolor wordcount contextmenu media",branding:!1},dialogVisibleMp3:!1}},activated:function(){this.show=!0},deactivated:function(){},mounted:function(){},methods:(i={beforeAvatarUploadAudio:function(t){var e="audio/mp3"===t.type;return e||this.$message.error("上传音频只能选择MP3格式!"),e},uploadFileMp3:function(t){var e=this;Object(a._142)({file:t.file,type:"local"}).then(function(t){e.$message({type:"success",message:"上传成功!"}),e.radio=[{name:t.name,url:t.url}]})},removeFile:function(){},removeFileMp3:function(){},handleExceed:function(){},audioInter:function(){if(this.radio.length<1)return this.$message({type:"error",message:"请选择音频"}),!1;var t='<p style="text-align: center"><img class="mce-object mce-object-audio" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" width="280" height="55" data-mce-p-controls="controls" data-mce-html="%0A%3Csource%20src%3D%22https%3A//cdn.singsingenglish.com/'+this.radio[0].url+'%22%20type%3D%22audio/mpeg%22%20/%3E" data-mce-object="audio"></p>';l.a.activeEditor.insertContent(t),this.dialogVisibleMp3=!1},showDialogMP3:function(){this.dialogVisibleMp3=!0,this.radio=[]},beforeAvatarUploadImg:function(t){var e="image/jpeg"===t.type||"image/png"===t.type;return e||this.$message.error("上传头像图片只能是 JPG 或 PNG 格式!"),e},imgInter:function(){if(this.form.imgList.length<1)return this.$message({type:"error",message:"请选择图片"}),!1;var t="";this.form.big?t+="width:100%;":t+="width:70%",this.form.center&&(t="display:block;margin:auto");var e='<img src="'+this.form.imgList[0].url+'" style="'+t+'"/>';l.a.activeEditor.insertContent(e),this.dialogVisible=!1},uploadFile:function(t){var e=this;Object(a._142)({file:t.file,type:"local"}).then(function(t){e.$message({type:"success",message:"上传成功!"}),e.form.imgList=[{name:t.name,url:"https://cdn.singsingenglish.com/"+t.url}]})},showDialog:function(){this.dialogVisible=!0,this.form={imgList:[],big:!1,weight:"",center:!0}},insertContent:function(t){if(t){var e=null;if(document.selection)(e=document.selection).createRange().pasteHTML(t);else if((e=document.getElementById("tinymce_ifr").contentWindow.getSelection()).rangeCount>0){var o=e.getRangeAt(0);o.deleteContents();var i=document.createElement("div");i.innerHTML=t;var a=document.createDocumentFragment(),n=i.firstChild,s=a.appendChild(n);o.insertNode(a);var l=o.cloneRange();l.setStartAfter(s),l.collapse(!0),e.removeAllRanges(),e.addRange(l)}}}},d(i,"removeFile",function(){}),d(i,"handleExceed",function(){}),i),created:function(){l.a.init({})},components:{Editor:r.a}},u={render:function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"tinymce"},[o("editor",{attrs:{id:"tinymce",init:t.init},model:{value:t.lookData.content,callback:function(e){t.$set(t.lookData,"content",e)},expression:"lookData.content"}}),t._v(" "),o("div",[o("div",{staticClass:"imgInter",on:{click:function(e){t.showDialog()}}},[t._v("插入图片")]),t._v(" "),o("div",{staticClass:"MP3Inter",on:{click:function(e){t.showDialogMP3()}}},[t._v("插入音频")])]),t._v(" "),o("el-dialog",{attrs:{title:"插入图片",visible:t.dialogVisible,"modal-append-to-body":!1,"close-on-click-modal":!1,center:"","append-to-body":!0,width:"550px"},on:{"update:visible":function(e){t.dialogVisible=e}}},[o("el-form",{attrs:{"label-width":"80px"}},[o("el-form-item",{attrs:{label:"图片"}},[o("el-upload",{attrs:{action:"/api/public/upload","http-request":t.uploadFile,"on-remove":t.removeFile,"before-upload":t.beforeAvatarUploadImg,drag:"","on-exceed":t.handleExceed,multiple:"",limit:1,"file-list":t.form.imgList}},[o("i",{staticClass:"el-icon-upload"}),t._v(" "),o("div",{staticClass:"el-upload__text"},[t._v("将文件拖到此处,或"),o("em",[t._v("点击上传")])]),t._v(" "),o("div",{staticClass:"el-upload__tip",attrs:{slot:"tip"},slot:"tip"},[t._v("只能上传png或jpg文件")])])],1),t._v(" "),o("el-form-item",{attrs:{label:"铺满"}},[o("el-switch",{model:{value:t.form.big,callback:function(e){t.$set(t.form,"big",e)},expression:"form.big"}})],1),t._v(" "),o("el-form-item",{attrs:{label:"居中"}},[o("el-switch",{model:{value:t.form.center,callback:function(e){t.$set(t.form,"center",e)},expression:"form.center"}})],1)],1),t._v(" "),o("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[o("el-button",{on:{click:function(e){t.dialogVisible=!1}}},[t._v("取 消")]),t._v(" "),o("el-button",{attrs:{type:"primary"},on:{click:t.imgInter}},[t._v("确 定")])],1)],1),t._v(" "),o("el-dialog",{attrs:{title:"插入音频",visible:t.dialogVisibleMp3,"modal-append-to-body":!1,"close-on-click-modal":!1,center:"","append-to-body":!0,width:"550px"},on:{"update:visible":function(e){t.dialogVisibleMp3=e}}},[o("el-form",{attrs:{"label-width":"80px"}},[o("el-form-item",{attrs:{label:"音频"}},[o("el-upload",{attrs:{action:"/api/public/upload","http-request":t.uploadFileMp3,"before-upload":t.beforeAvatarUploadAudio,"on-remove":t.removeFileMp3,drag:"","on-exceed":t.handleExceed,multiple:"",limit:1,"file-list":t.radio}},[o("i",{staticClass:"el-icon-upload"}),t._v(" "),o("div",{staticClass:"el-upload__text"},[t._v("将文件拖到此处,或"),o("em",[t._v("点击上传")])]),t._v(" "),o("div",{staticClass:"el-upload__tip",attrs:{slot:"tip"},slot:"tip"},[t._v("只能上传MP3文件,且不超过10MB")])])],1)],1),t._v(" "),o("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[o("el-button",{on:{click:function(e){t.dialogVisibleMp3=!1}}},[t._v("取 消")]),t._v(" "),o("el-button",{attrs:{type:"primary"},on:{click:t.audioInter}},[t._v("确 定")])],1)],1)],1)},staticRenderFns:[]};var p={name:"index",data:function(){return{total:0,nowPage:1,limit:10,contentTotal:0,contentNowPage:1,contentLimit:10,activeName:"keywords_reply",modularList:[],modularContent:[],selectModular:[],questionListParams:{type:"1",pid:""},postModularParams:{type:"1",title:"",pid:"",keywords:"",content:""},postModularDialog:!1,modularTitle:"新建模块",postModularContentDialog:!1,modularContentTitle:"新建话术内容",typeArr:[{value:"1",label:"话术类型"},{value:"2",label:"流程类型"}],modularId:"",contentType:""}},components:{editorDetail:o("VU/8")(c,u,!1,function(t){o("Q1xo")},"data-v-36033905",null).exports,page:n.a},mounted:function(){this.getList()},filters:{type:function(t){return"text"===t?"文本":"voice"===t?"语音":"video"===t?"视频":"image"===t?"图片":"news"===t?"图文":"link"===t?"链接":"news-item"===t?"图文链接":t}},methods:{upcontent:function(t,e){var o=this;if(console.log(t,e),0!=e){var i={question_up_id:this.modularContent[e].id,question_down_id:this.modularContent[e-1].id};Object(a._117)(i).then(function(t){o.handleChange(o.modularId)})}},downcontent:function(t,e){var o=this;if(e<=this.modularContent.length-1){var i={question_up_id:this.modularContent[e+1].id,question_down_id:this.modularContent[e].id};Object(a._117)(i).then(function(t){o.handleChange(o.modularId)})}},upIndex:function(t,e){var o=this;if(0!=e){var i={question_up_id:this.modularList[e].id,question_down_id:this.modularList[e-1].id};Object(a._117)(i).then(function(t){o.getList()})}},downIndex:function(t,e){var o=this;if(e<=this.modularList.length-1){var i={question_up_id:this.modularList[e+1].id,question_down_id:this.modularList[e].id};Object(a._117)(i).then(function(t){o.getList()})}},delIndex:function(t){var e=this;console.log(t),this.$confirm("此操作将删除该记录?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){console.log(t),Object(a.V)(t.id).then(function(t){e.getList(),e.$message({type:"success",message:"删除成功!"})})})},handleChange:function(){var t=this;this.modularContent=[];var e={type:this.questionListParams.type,page:this.contentNowPage,limit:this.contentLimit};this.modularId&&(e.pid=this.modularId),this.postModularParams.pid=this.modularId,Object(a._67)(e.type,e).then(function(e){t.modularContent=e.list,console.log(e),t.contentTotal=e.total})},postModularContentInit:function(){this.contentType="new",this.postModularParams.title="",this.postModularParams.keywords="",this.postModularParams.content="",this.postModularParams.type=this.questionListParams.type,this.postModularContentDialog=!0},postModularContentFn:function(){var t=this;console.log(this.postModularParams);var e={};if("new"==this.contentType){if(this.modularContentTitle="新建话术内容",!this.postModularParams.type)return void this.$message({message:"请选择类型!"});if(!this.postModularParams.title)return void this.$message({message:"请输入标题!"});if(!this.postModularParams.pid)return void this.$message({message:"请选择模块!"});if(!this.postModularParams.keywords)return void this.$message({message:"请输入关键词!"});if(!this.postModularParams.content)return void this.$message({message:"请填写内容!"});e=Object.assign({},this.postModularParams),Object(a._105)(e).then(function(e){console.log(e),t.getList(),t.$message({type:"success",message:"提交成功!"});var o={type:t.questionListParams.type,pid:t.postModularParams.pid};Object(a._67)(o.type,o).then(function(e){t.modularContent=e.list,console.log(e)}),t.postModularContentDialog=!1})}else this.modularContentTitle="编辑话术内容",e=Object.assign({},this.postModularParams),console.log(e),Object(a._138)(e.id,e).then(function(e){console.log(e),t.$message({type:"success",message:"更新成功!"}),t.postModularContentDialog=!1})},editContent:function(t){var e=this;this.contentType="edit";Object(a._66)(t.id).then(function(t){e.postModularParams=Object.assign({},t),console.log(e.postModularParams),e.postModularContentDialog=!0})},editContentFn:function(){},editModular:function(t){this.postModularDialog=!0,this.modularTitle="编辑模块",this.postModularParams=Object.assign({},t)},postModularInit:function(){this.postModularDialog=!0,this.modularTitle="新建模块",this.postModularParams.title=""},postModularFn:function(){var t=this,e={};if("新建模块"==this.modularTitle){if(!this.postModularParams.type)return void this.$message({message:"请选择类型!"});if(!this.postModularParams.title)return void this.$message({message:"请填写标题!"});e.type=this.postModularParams.type,e.title=this.postModularParams.title,console.log(e),Object(a._105)(e).then(function(e){console.log(e),t.getList(),t.$message({type:"success",message:"提交成功!"}),t.postModularDialog=!1})}else this.postModularParams.pid="",e.type=this.postModularParams.type,e.title=this.postModularParams.title,e.id=this.postModularParams.id,console.log(e),Object(a._138)(e.id,e).then(function(e){t.getList(),t.$message({type:"success",message:"更新成功!"}),t.postModularDialog=!1})},onPageChange:function(t){this.nowPage=t,this.getList()},onSizeChange:function(t){this.nowPage=1,this.limit=t,this.getList()},onPageChangeC:function(t){this.contentNowPage=t,this.handleChange()},onSizeChangeC:function(t){this.contentNowPage=1,this.contentLimit=t,this.handleChange()},getList:function(){var t=this,e={type:this.questionListParams.type,page:this.nowPage,limit:this.limit};this.questionListParams.pid&&(e.pid=this.questionListParams.pid),Object(a._67)(e.type,e).then(function(e){t.modularList=e.list,console.log(t.modularList),t.total=e.total})},delContent:function(t){var e=this;console.log(t),this.$confirm("此操作将删除该记录?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){console.log(t),Object(a.V)(t.id).then(function(t){var o={type:e.questionListParams.type};o.pid=e.postModularParams.pid,Object(a._67)(o.type,o).then(function(t){e.modularContent=t.list,console.log(t)}),e.$message({type:"success",message:"删除成功!"})})})},handleClick:function(t){this.questionListParams.type=t.name,this.postModularParams.type=t.name,this.getList()},typeChange:function(){var t=this,e={type:this.postModularParams.type};Object(a._67)(e.type,e).then(function(e){t.selectModular=e.list})}}},m={render:function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"cssbox"},[o("el-tabs",{attrs:{type:"card"},on:{"tab-click":t.handleClick},model:{value:t.questionListParams.type,callback:function(e){t.$set(t.questionListParams,"type",e)},expression:"questionListParams.type"}},[o("el-tab-pane",{attrs:{label:"话术",name:"1"}}),t._v(" "),o("el-tab-pane",{attrs:{label:"流程",name:"2"}})],1),t._v(" "),o("div",{staticClass:"btnBox"},[t.$store.state.readonly?t._e():o("el-button",{attrs:{type:"success",plain:""},on:{click:t.postModularInit}},[t._v("新建模块")])],1),t._v(" "),o("el-collapse",{attrs:{accordion:""},on:{change:t.handleChange},model:{value:t.modularId,callback:function(e){t.modularId=e},expression:"modularId"}},t._l(t.modularList,function(e,i){return o("el-collapse-item",{key:i,attrs:{name:e.id}},[o("template",{slot:"title"},[t._v("\n        "+t._s(e.title)+"\n        "),o("div",{staticClass:"btn-block list2-btn"},[t.$store.state.readonly?t._e():o("el-button",{staticStyle:{"margin-left":"20px"},attrs:{size:"mini",plain:"",type:"warning"},on:{click:function(o){t.editModular(e)}}},[t._v("编辑")]),t._v(" "),t.$store.state.readonly?t._e():o("el-button",{attrs:{size:"mini",plain:"",type:"danger"},on:{click:function(o){t.delIndex(e)}}},[t._v("删除")]),t._v(" "),t.$store.state.readonly?t._e():o("el-button",{attrs:{size:"mini",plain:""},on:{click:function(o){t.upIndex(e,i)}}},[t._v("上移")]),t._v(" "),t.$store.state.readonly?t._e():o("el-button",{attrs:{size:"mini",plain:""},on:{click:function(o){t.downIndex(e,i)}}},[t._v("下移")])],1)]),t._v(" "),o("div",{staticClass:"btnBox"},[t.$store.state.readonly?t._e():o("el-button",{attrs:{type:"success",plain:""},on:{click:t.postModularContentInit}},[t._v("新建模块内容")])],1),t._v(" "),o("el-table",{staticStyle:{width:"100%"},attrs:{data:t.modularContent}},[o("el-table-column",{attrs:{prop:"title",label:"标题"}}),t._v(" "),o("el-table-column",{attrs:{prop:"keywords",label:"关键字"}}),t._v(" "),o("el-table-column",{attrs:{label:"创建时间",prop:"created_at"}}),t._v(" "),t.$store.state.readonly?t._e():o("el-table-column",{attrs:{width:"330",label:"操作"},scopedSlots:t._u([{key:"default",fn:function(e){return[t.$store.state.readonly?t._e():o("el-button",{attrs:{size:"mini",plain:"",type:"warning"},on:{click:function(o){t.editContent(e.row)}}},[t._v("编辑查看")]),t._v(" "),t.$store.state.readonly?t._e():o("el-button",{attrs:{size:"mini",plain:"",type:"danger"},on:{click:function(o){t.delContent(e.row)}}},[t._v("删除")]),t._v(" "),t.$store.state.readonly?t._e():o("el-button",{attrs:{size:"mini",plain:""},on:{click:function(o){t.upcontent(e.row,e.$index)}}},[t._v("上移")]),t._v(" "),t.$store.state.readonly?t._e():o("el-button",{attrs:{size:"mini",plain:""},on:{click:function(o){t.downcontent(e.row,e.$index)}}},[t._v("下移")])]}}])})],1),t._v(" "),o("page",{attrs:{total:t.contentTotal,limit:t.contentLimit},on:{pageChange:t.onPageChangeC,sizeChange:t.onSizeChangeC}})],2)})),t._v(" "),o("page",{attrs:{total:t.total,limit:t.limit},on:{pageChange:t.onPageChange,sizeChange:t.onSizeChange}}),t._v(" "),o("el-dialog",{attrs:{title:t.modularTitle,center:"",visible:t.postModularDialog,width:"800px"},on:{"update:visible":function(e){t.postModularDialog=e}}},[o("el-form",{ref:"form",attrs:{model:t.postModularParams}},[o("el-row",[o("el-col",{attrs:{span:8}},[o("el-form-item",{attrs:{label:"标题","label-width":"80px",required:""}},[o("el-input",{model:{value:t.postModularParams.title,callback:function(e){t.$set(t.postModularParams,"title",e)},expression:"postModularParams.title"}})],1)],1)],1)],1),t._v(" "),1!==t.type?o("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[o("el-button",{on:{click:function(e){t.postModularDialog=!1}}},[t._v("取 消")]),t._v(" "),o("el-button",{attrs:{type:"primary"},on:{click:t.postModularFn}},[t._v("确 定")])],1):t._e()],1),t._v(" "),o("el-dialog",{ref:"ruleForm",attrs:{title:t.modularContentTitle,center:"",visible:t.postModularContentDialog,width:"800px"},on:{"update:visible":function(e){t.postModularContentDialog=e}}},[o("el-form",{ref:"form",attrs:{model:t.postModularParams}},[o("el-row",[o("el-col",{attrs:{span:8}},[o("el-form-item",{attrs:{label:"标题","label-width":"80px",required:""}},[o("el-input",{model:{value:t.postModularParams.title,callback:function(e){t.$set(t.postModularParams,"title",e)},expression:"postModularParams.title"}})],1)],1)],1),t._v(" "),o("el-row",[o("el-col",{attrs:{span:8}},[o("el-form-item",{attrs:{label:"关键词","label-width":"80px",required:""}},[o("el-input",{model:{value:t.postModularParams.keywords,callback:function(e){t.$set(t.postModularParams,"keywords",e)},expression:"postModularParams.keywords"}})],1)],1)],1),t._v(" "),o("el-row",[o("el-col",{attrs:{span:24}},[o("el-form-item",{attrs:{label:"商品详情","label-width":"80px",required:""}},[o("editor-detail",{attrs:{lookData:t.postModularParams}})],1)],1)],1)],1),t._v(" "),1!==t.type?o("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[o("el-button",{on:{click:function(e){t.postModularContentDialog=!1}}},[t._v("取 消")]),t._v(" "),o("el-button",{attrs:{type:"primary"},on:{click:function(e){t.postModularContentFn("ruleForm")}}},[t._v("确 定")])],1):t._e()],1)],1)},staticRenderFns:[]};var g=o("VU/8")(p,m,!1,function(t){o("Cpxi"),o("G99E")},"data-v-e2fedbb6",null);e.default=g.exports},Cpxi:function(t,e){},G99E:function(t,e){},Q1xo:function(t,e){}});