| 1 |
- System.register(["./index-legacy.a130dba2.js","./img_sq_step_3-legacy.d686334c.js"],(function(e,t){"use strict";var a,i,s,n,l,r,o,c,d,u,p,v,g,m,f,h,x=document.createElement("style");return x.textContent='.el-drawer.rtl[data-v-398e4854]{border-radius:30px 0 0 30px}.content[data-v-398e4854]{padding:0 30px 0 20px}.content .empower[data-v-398e4854]{font-size:14px;padding:10px 15px;background-color:#f9fbff;display:flex;align-items:center;color:#265cf0}.content .setp[data-v-398e4854]{margin-top:40px;font-size:14px;display:flex}.content .setp .set-text[data-v-398e4854]{font-size:15px;font-weight:700}.content .set-detail[data-v-398e4854]{font-size:13px;margin-top:20px}.content .set-img[data-v-398e4854]{margin-top:15px}.inputStyleMargin .el-textarea__inner{padding-right:60px}.inputStyleMargin .el-textarea__inner::-webkit-scrollbar{display:none}.el-upload__tip{margin-top:0}.ai-customer-service-views{height:100%;background-color:#fff;border-radius:8px}.rightStyle[data-v-671c340c]{width:200px;height:90%;position:absolute;border:1px solid #f3f3f5;top:8%;left:15px;border-top:none}.rightStyle .customerPad[data-v-671c340c]{width:100%;height:98%;position:relative}.rightStyle .addAikefu[data-v-671c340c]{position:absolute;bottom:0px;left:50%;transform:translate(-50%,-50%)}.rightStyle .customerMk[data-v-671c340c]{width:90%;margin:0 auto;height:90%;overflow-y:auto}.rightStyle .customerMk .active[data-v-671c340c]{border:1px solid #5f8bff}.rightStyle .customerMargin[data-v-671c340c]{cursor:pointer;border:1px solid #F0F0F0;margin-top:20px;padding:10px;border-radius:8px}.rightStyle .customerMargin p label[data-v-671c340c]{font-size:14px;color:#000;margin-right:10px}.rightStyle .customerMargin p i[data-v-671c340c]{cursor:pointer}.rightStyle .customerMargin p[data-v-671c340c]:last-child{width:100%;text-align:right}.rightStyle .customerMargin p:last-child label[data-v-671c340c]{cursor:pointer;color:#4284f4;margin-right:0}.rightStyle .customerMargin .wechat[data-v-671c340c]{line-height:30px;font-size:12px;color:#666}.clearStyle[data-v-671c340c]{height:60px}.content[data-v-671c340c]{width:100%;height:209px;margin:-30px auto 0;background:#fff;border-radius:8px;display:flex;align-items:center;justify-content:center;flex-direction:column;border:1px dashed #DDE0EA}.content img[data-v-671c340c]{width:55px;height:38px}.content .fileType[data-v-671c340c]{margin-top:10px;font-weight:400;font-size:12px;color:#b1b1b1}.content .fileTypeSelect[data-v-671c340c]{color:#0a77f6;font-size:14px;margin-top:10px}.content .upLoad[data-v-671c340c]{cursor:pointer;width:215px;height:104px;display:flex;align-items:center;justify-content:center;position:relative;flex-direction:column}.content .upLoad .fileStyleEvent[data-v-671c340c]{position:absolute;width:100%;height:100%;opacity:0;top:0px;left:0px;cursor:pointer}.content .upLoad .upload-btn[data-v-671c340c]{cursor:pointer;border:1px solid #265CF0;color:#265cf0;padding:4px 27px;border-radius:4px;font-size:13px;margin-top:10px}.dialog-footer[data-v-671c340c]{display:flex;align-items:center;justify-content:space-between}.dialog-footer .fileStyle label[data-v-671c340c]{font-weight:400;font-size:14px;color:#000}.dialog-footer .fileStyle label[data-v-671c340c]:last-child{font-weight:400;font-size:14px;color:#1651ee}.messageMargin[data-v-671c340c]{width:60%;height:80%;padding:0 60px 0 0;overflow-y:auto;margin:0 auto;position:absolute;left:50%;top:50%;transform:translate(-50%,-50%)}.messageMargin[data-v-671c340c]::-webkit-scrollbar{display:none}.messageMargin .messList[data-v-671c340c]{margin-top:30px;display:flex}.messageMargin .messList .user[data-v-671c340c]{width:100%}.messageMargin .messList img[data-v-671c340c]{width:32px;height:32px;border-radius:32px;margin-right:12px}.messageMargin .messList .userName_Date[data-v-671c340c]{display:flex;align-items:center;justify-content:space-between}.messageMargin .messList .userName_Date label[data-v-671c340c]:first-child{font-weight:600;font-size:18px;color:#333}.messageMargin .messList .userName_Date label[data-v-671c340c]:last-child{font-weight:400;font-size:14px;color:#7f7f7f}.messageMargin .messList .userName_Date img[data-v-671c340c]{width:40px;height:40px}.messageMargin .messList .messInfoText[data-v-671c340c]{margin-top:10px;font-weight:400;font-size:14px;color:#7f7f7f}.messageMargin .messList .messInfoText .loadingAi[data-v-671c340c]{width:50px;height:8px;border-radius:0}.headerStyle[data-v-671c340c]{width:90%;margin:0 auto;position:absolute;top:0px;height:8%;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #f3f3f5}.headerStyle label[data-v-671c340c]:nth-child(1){font-weight:700;font-size:18px;color:#000;position:relative;display:flex;align-items:center}.headerStyle label[data-v-671c340c]:nth-child(1):before{content:"";display:block;width:4px;height:16px;background:#fff;border-radius:2px;margin-right:10px}.headerStyle label[data-v-671c340c]:nth-child(2){width:98px;height:39px;display:block;font-weight:400;font-size:14px;color:#fff;line-height:39px;border-radius:4px;text-align:center;cursor:pointer;background:linear-gradient(#5f8bff,#4678fd,#1651ee)}.inputStyleMargin[data-v-671c340c]{width:60%;height:50px;border-radius:8px;margin:30px auto 0;background:#ffffff;position:absolute;left:50%;bottom:0px;transform:translate(-50%,-50%);display:flex;align-items:center;justify-content:center}.inputStyleMargin img[data-v-671c340c]{cursor:pointer;width:40px;height:40px;position:absolute;right:10px;top:-2px}\n',document.head.appendChild(x),{setters:[function(e){a=e.n,i=e.r,s=e.f,n=e.$,l=e.o,r=e.e},function(e){o=e._,c=e.a,d=e.b,u=e.c,p=e.d,v=e.e,g=e.s,m=e.f,f=e.u,h=e.l}],execute:function(){var t={__name:"empower",setup:function(e,t){var a=t.expose,s=i(!1);function n(){s.value=!0}return a({init:n}),{__sfc:!0,drawer:s,init:n,destined:function(){wx.invoke("openAppManage",{page:"permission",suiteId:"ww802c56fa5b5a7fcb"},(function(e){"openAppManage:ok"==e.err_msg&&(s.value=!1),e.err_msg,e.err_msg,e.err_msg,e.err_msg}))}}}},x=function(){var e=this,t=e._self._c,a=e._self._setupProxy;return t("div",[t("el-drawer",{attrs:{title:"授权",size:"50%",visible:a.drawer,"modal-append-to-body":!1,direction:"rtl"},on:{"update:visible":function(e){a.drawer=e}}},[t("div",{staticClass:"content"},[t("div",{staticClass:"empower"},[e._v("前往企业微信管理后台,将微信客服授权给“九号同事” "),t("el-button",{staticStyle:{"font-size":"12px","margin-left":"auto"},attrs:{type:"primary",plain:"",size:"mini"},on:{click:a.destined}},[e._v("立即前往")])],1),t("div",{staticClass:"setp"},[t("div",{staticClass:"set-text"},[e._v("Step 1")])]),t("div",{staticStyle:{"border-left":"1px dashed #265CF0","padding-left":"20px"}},[t("div",{staticClass:"set-detail"},[e._v("进入到应用管理模块")]),t("img",{staticClass:"set-img",staticStyle:{width:"550px"},attrs:{src:o,alt:""}})]),t("div",{staticClass:"setp"},[t("div",{staticClass:"set-text"},[e._v("Step 2")])]),t("div",{staticStyle:{"border-left":"1px dashed #265CF0","padding-left":"20px"}},[t("div",{staticClass:"set-detail"},[e._v("进入企业微信管理后台的应用管理模块,点击应用-基础-“微信客服”")]),t("img",{staticClass:"set-img",attrs:{src:c,alt:""}})]),t("div",{staticClass:"setp"},[t("div",{staticClass:"set-text"},[e._v("Step 3")])]),t("div",{staticStyle:{"border-left":"1px dashed #265CF0","padding-left":"20px"}},[t("div",{staticClass:"set-detail"},[e._v("页面最下方的“通过API管理会话消息”模块,点击“授权给第三方应用”")]),t("img",{staticClass:"set-img",staticStyle:{width:"300px"},attrs:{src:d,alt:""}})]),t("div",{staticClass:"setp",staticStyle:{"margin-bottom":"10px"}},[t("div",{staticClass:"set-text"},[e._v("Step 4")])]),t("div",{staticStyle:{"border-left":"1px dashed #265CF0","padding-left":"20px"}},[t("div",{staticClass:"set-detail"},[e._v("“九号同事”列表最右侧操作,授权相应的客服账号")]),t("img",{staticClass:"set-img",staticStyle:{width:"100%",height:"110px"},attrs:{src:u,alt:""}})])])])],1)},b=[];x._withStripped=!0;var _=a(t,x,b,!1,null,"398e4854",null,null);_.options.__file="E:/十二科技/项目/九号同事/salary-management-web/src/views/trainingRoot/aiCustomerService/empower.vue";var y=_.exports,S={__name:"aiCustomerServiceViews",setup:function(e){var t=s({Authorization:"token "+n.getters.token}),a=i(""),o=i(),c=i(n.getters.member_avatar);c.value?a.value=c:a.value=p;var d=i(n.getters.member_id),u=i(""),x=i(!1),b=i(""),_=i([]),S=i(!1),w=i(""),C=i(!1),M=i({}),D=i(!1),k=i({}),A=i(null),z=i({}),T=i(""),E=s({name:[{required:!0,message:"请输入客服名称",trigger:"blur"}],media_id:[{required:!0,message:"请上传头像",trigger:"change"}]}),I=i(!1);l((function(){F(),H(),V()}));var N=function(e){return!e.replace(/\s/g,"").length},L=i(""),P=i(""),F=function(){var e={type:0,member:d.value,limit:999999};HTTP.get("train_ai_chat_record_readonly",e).then((function(e){0===e.code&&(_.value=e.data.results)}))},j=function(){var e=new Date,t=e.getFullYear(),a=(e.getMonth()+1).toString().padStart(2,"0"),i=e.getDate().toString().padStart(2,"0"),s=e.getHours().toString().padStart(2,"0"),n=e.getMinutes().toString().padStart(2,"0"),l=e.getSeconds().toString().padStart(2,"0");return"".concat(t,"-").concat(a,"-").concat(i," ").concat(s,":").concat(n,":").concat(l)},V=function(){var e={type:0,id:L.value};HTTP.get("train_ai_database_readonly",e).then((function(e){0===e.code&&(M.value=e.data.results)}))},H=function(){HTTP.get("train_ai_database_readonly",{type:0}).then((function(e){0===e.code&&($.value[0]=e.data.results[0].id,z.value=e.data.results)}))},U=i({name:"",media_id:""}),B=i(),R=i(!1),$=i([]);return{__sfc:!0,uploadUrl:"http://45.207.195.140:8520/wxthird/media_upload/",headers:t,defaultImg:a,empowerRef:o,avatar:c,member_id:d,inputMessage:u,sendStatus:x,selectFile:b,messData:_,centerDialogVisible:S,fileData:w,loading:C,trainAiDatabaseData:M,currentQueue:D,overStyle:k,scrollArea:A,trainAiCustomerData:z,fileName:T,rules:E,addAI:I,overStyleCheck:function(){setTimeout((function(){A.value&&A.value.scrollTo({top:A.value.scrollHeight,behavior:"smooth"})}),300)},checkSpace:N,uploadUserId:L,uploadDataBase:function(e){L.value=e,S.value=!0,b.value="",V()},configWechat:function(){o.value.init()},customerId:P,editDataBase:function(e){P.value=e.id,U.value.name=e.name,U.value.media_id=e.media_id,R.value=!0},messDataListCheck:F,sendSubmit:function(){if(M.value.length<=0)r.exports.Message.info("请先上传资料库..");else if(D.value)r.exports.Message.info("正在回答中..");else if(x.value&&u.value){D.value=!0,_.value.push({content:u.value,chat_type:0,create_date:j()}),_.value.push({content:"",chat_type:1,create_date:j()});var e={id:Number($.value),type:0,content:u.value};HTTP.post("send_issue",e).then((function(e){0==e.code&&(console.log(e,e.data.content),D.value=!1,console.log(_.value,_.value.length),_.value[_.value.length-1].content=e.data.content,_.value[_.value.length-1].type=e.data.type,_.value[_.value.length-1].create_date=e.data.create_date,_.value[_.value.length-1].chat_type=e.data.chat_type,console.log(_.value[_.value.length-1].content))})),u.value="",x.value=!1}},timeDateFormat:j,inputEvent:function(e){N(e)||!e||D.value?x.value=!1:x.value=!0},uploadEvent:function(e){if(e.target.files[0].name.indexOf(".docx")<0)r.exports.Message.error("只能上传.docx文件");else{C.value=!0;var t=e.target.files[0];b.value=t.name;var a={name:t.name,raw:t};HTTP.upload("upload",a).then((function(e){w.value=e.data,C.value=!1,V()})).catch((function(){C.value=!0}))}},typeWriter:function(){var e=0,t=_.value[_.value.length-1].content.length,a=setInterval((function(){e<t?(_.value[_.value.length-1].content+=_.value[_.value.length-1].content.charAt(e),e++):clearInterval(a)}),50)},trainAiDatabaseCehck:V,trainAiCustomer:H,centerDialogEvent:function(){if(w.value){C.value=!0;var e={url:w.value,type:0,file_name:b.value,id:L.value};HTTP.post("train_ai_database_save",e,{timeout:36e6}).then((function(e){S.value=!1,V(),C.value=!1,0==e.code?r.exports.Message.success("上传成功"):r.exports.Message.error(e.msg)})).catch((function(){C.value=!1}))}else r.exports.Message.error("请先上传文档!")},addCustomer:U,form:B,customerDialogVisible:R,customerEvent:function(){B.value.validate((function(e){if(!e)return!1;I.value=!0;var t={type:0,name:U.value.name,media_id:U.value.media_id};P.value&&(t.id=P.value),HTTP.post("train_ai_database_save",t,{}).then((function(e){0==e.code?(R.value=!1,T.value="",I.value=!1,H(),r.exports.Message.success("操作成功")):r.exports.Message.error(e.msg)}))}))},cancle:function(){R.value=!1,T.value="",B.value.resetFields()},beforeAvatarUpload:function(e){console.log(e);var t="image/png"===e.type||"image/jpg",a=e.size/1024/1024<10;return t||this.$message.error("上传头像图片只能是 JPG,PNG 格式!"),a||this.$message.error("上传头像图片大小不能超过 10M!"),t&&a},handleAvatarSuccess:function(e,t){console.log(e,t),0==e.code?(T.value=t.name,r.exports.Message.success("上传成功"),U.value.media_id=e.data.media_id):r.exports.Message.error(e.msg)},customerEventAdd:function(){R.value=!0,U.value.name="",P.value=""},customeSelect:$,suctomeEvent:function(e){$.value=[],$.value.push(e)},aiavatar:v,send:g,sendNo:m,upload:f,loadingAi:h,empower:y}}},w=function(){var e=this,t=e._self._c,a=e._self._setupProxy;return t("div",{staticClass:"ai-customer-service-views"},[e._m(0),t("div",{staticClass:"rightStyle"},[t("div",{staticClass:"customerPad"},[t("div",{staticClass:"customerMk"},e._l(a.trainAiCustomerData,(function(i,s){return t("div",{key:s,staticClass:"customerMargin",class:{active:a.customeSelect.includes(i.id)},on:{click:function(e){return a.suctomeEvent(i.id)}}},[t("p",{staticStyle:{"margin-bottom":"30px"}},[t("label",[e._v(e._s(i.name))]),t("i",{directives:[{name:"permission",rawName:"v-permission",value:41102,expression:"41102"}],staticClass:"el-icon-edit",on:{click:function(e){return a.editDataBase(i)}}})]),t("p",{staticStyle:{display:"flex"}},[t("label",{directives:[{name:"permission",rawName:"v-permission",value:41103,expression:"41103"}],staticStyle:{"margin-right":"auto","font-size":"12px"},on:{click:function(e){return a.configWechat(i)}}},[e._v("授权方法")]),t("label",{directives:[{name:"permission",rawName:"v-permission",value:41104,expression:"41104"}],staticStyle:{"font-size":"12px"},on:{click:function(e){return a.uploadDataBase(i.id)}}},[e._v("资料库")])])])})),0),t("el-button",{directives:[{name:"permission",rawName:"v-permission",value:41102,expression:"41102"}],staticClass:"addAikefu",attrs:{type:"primary"},on:{click:a.customerEventAdd}},[e._v("新增AI客服")])],1)]),t("div",{ref:"scrollArea",staticClass:"messageMargin"},[a.messData.length<=0?t("el-empty",{attrs:{description:"暂无聊天记录"}}):e._e(),e._l(a.messData,(function(i,s){return t("div",{key:s,staticClass:"messList"},[t("img",{attrs:{src:0===i.chat_type?a.defaultImg:a.aiavatar}}),t("div",{staticClass:"user"},[t("div",{staticClass:"userName_Date"},[t("label",[e._v(e._s(0===i.chat_type?"你":"AI客服"))]),t("label",[e._v(e._s(i.create_date))])]),i.content?t("div",{staticClass:"messInfoText"},[e._v(e._s(i.content))]):t("div",{staticClass:"messInfoText"},[t("img",{staticClass:"loadingAi",attrs:{src:a.loadingAi}})])])])})),t("div",{staticClass:"clearStyle",style:a.overStyle})],2),t("div",{staticClass:"inputStyleMargin"},[t("el-input",{staticClass:"inputMess",staticStyle:{"font-size":"14px",resize:"none",outline:"none","box-sizing":"border-box","min-height":"68px"},attrs:{resize:"none",type:"textarea",placeholder:"请输入问题",rows:"2"},on:{input:a.inputEvent},model:{value:a.inputMessage,callback:function(e){a.inputMessage=e},expression:"inputMessage"}}),t("img",{attrs:{src:a.sendStatus?a.send:a.sendNo},on:{click:a.sendSubmit}})],1),t("el-dialog",{attrs:{title:"上传","close-on-click-modal":!1,"append-to-body":!0,visible:a.centerDialogVisible,showClose:!a.loading,width:"30%"},on:{"update:visible":function(e){a.centerDialogVisible=e}}},[t("div",{directives:[{name:"loading",rawName:"v-loading",value:a.loading,expression:"loading"}],staticClass:"content",attrs:{"element-loading-text":"正在上传中"}},[t("div",{directives:[{name:"permission",rawName:"v-permission",value:41105,expression:"41105"}],staticClass:"upLoad"},[a.centerDialogVisible?t("input",{directives:[{name:"permission",rawName:"v-permission",value:41105,expression:"41105"}],staticClass:"fileStyleEvent",attrs:{type:"file"},on:{change:a.uploadEvent}}):e._e(),t("img",{staticStyle:{width:"100px",height:"70px"},attrs:{src:a.upload}}),t("div",{staticClass:"upload-btn"},[e._v("选择上传")])]),t("label",{staticClass:"fileType"},[e._v("只支持.docx类型文件,10000字以内")]),a.selectFile?t("label",{staticClass:"fileTypeSelect"},[e._v("已选中:"+e._s(a.selectFile))]):e._e()]),t("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("div",{staticClass:"fileStyle"},[a.trainAiDatabaseData.length>0?t("label",[e._v("当前资料:")]):e._e(),a.trainAiDatabaseData.length>0?t("label",[t("a",{attrs:{href:a.trainAiDatabaseData[0].url,target:"_blank"}},[e._v(e._s(a.trainAiDatabaseData[0].file_name))])]):e._e()]),t("div",[t("el-button",{attrs:{disabled:a.loading},on:{click:function(e){a.centerDialogVisible=!1}}},[e._v("取 消")]),t("el-button",{attrs:{type:"primary",disabled:a.loading},on:{click:a.centerDialogEvent}},[e._v("确 定")])],1)])]),t("el-dialog",{attrs:{title:"新增AI客服","close-on-click-modal":!1,"append-to-body":!0,visible:a.customerDialogVisible,showClose:!a.loading,width:"30%"},on:{"update:visible":function(e){a.customerDialogVisible=e}}},[t("el-form",{ref:"form",attrs:{model:a.addCustomer,"label-width":"80px",rules:a.rules}},[t("el-form-item",{attrs:{label:"客服名称",prop:"name"}},[t("el-input",{attrs:{placeholder:"请输入客服名称"},model:{value:a.addCustomer.name,callback:function(t){e.$set(a.addCustomer,"name",t)},expression:"addCustomer.name"}})],1),t("el-form-item",{attrs:{label:"上传头像",prop:"media_id"}},[t("el-upload",{attrs:{action:a.uploadUrl,headers:a.headers,"show-file-list":!1,"on-success":a.handleAvatarSuccess,data:{type:"image"},name:"media","before-upload":a.beforeAvatarUpload,limit:1}},[a.customerId?t("div",{staticStyle:{color:"#2e60ea","font-size":"13px"}},[e._v("已上传")]):t("div",{staticStyle:{display:"flex","flex-direction":"column","align-items":"flex-start"}},[t("div",{staticClass:"el-upload__tip",attrs:{slot:"tip"},slot:"tip"},[e._v("只能上传jpg/png文件,且不超过10M")]),a.fileName?t("div",{staticStyle:{"font-size":"14px"}},[e._v(e._s(a.fileName))]):t("el-button",{staticStyle:{"font-size":"12px"},attrs:{size:"mini"}},[e._v("上传头像")])],1)])],1)],1),t("span",{attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:a.cancle}},[e._v("取 消")]),t("el-button",{attrs:{type:"primary",loading:a.addAI},on:{click:a.customerEvent}},[e._v("确 定")])],1)],1),t(a.empower,{ref:"empowerRef"})],1)},C=[function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",{staticClass:"headerStyle"},[t("label",[e._v("AI问答")])])}];w._withStripped=!0;var M=a(S,w,C,!1,null,"671c340c",null,null);M.options.__file="E:/十二科技/项目/九号同事/salary-management-web/src/views/trainingRoot/aiCustomerService/aiCustomerServiceViews.vue",e("default",M.exports)}}}));
|