| 1 |
- (window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-5c4c7757"],{"6d6d":function(t,e,i){"use strict";var n=i("d457");i.n(n).a},b90a:function(t,e,i){"use strict";i.r(e),i("a4d3"),i("e01a"),i("d28b"),i("3ca3"),i("ddb0"),i("b636"),i("944a"),i("0c47"),i("23dc"),i("3410"),i("d9e2"),i("159b"),i("b0c0"),i("131a"),i("fb6a");var n=i("0122"),r=i("c964"),a=i("f3f3"),o=(i("d3b7"),i("d81d"),i("a15b"),i("a434"),i("2f62")),s=i("c276"),c=i("90e7");function l(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */l=function(){return t};var t={},e=Object.prototype,i=e.hasOwnProperty,r=Object.defineProperty||function(t,e,i){t[e]=i.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function u(t,e,i){return Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(e){u=function(t,e,i){return t[e]=i}}function h(t,e,i,n){var a,o,s,c;e=e&&e.prototype instanceof m?e:m,e=Object.create(e.prototype),n=new L(n||[]);return r(e,"_invoke",{value:(a=t,o=i,s=n,c="suspendedStart",function(t,e){if("executing"===c)throw new Error("Generator is already running");if("completed"===c){if("throw"===t)throw e;return j()}for(s.method=t,s.arg=e;;){var i=s.delegate;if(i&&(i=function t(e,i){var n=i.method,r=e.iterator[n];return void 0===r?(i.delegate=null,"throw"===n&&e.iterator.return&&(i.method="return",i.arg=void 0,t(e,i),"throw"===i.method)||"return"!==n&&(i.method="throw",i.arg=new TypeError("The iterator does not provide a '"+n+"' method")),f):(n=d(r,e.iterator,i.arg),"throw"===n.type?(i.method="throw",i.arg=n.arg,i.delegate=null,f):(r=n.arg,r?r.done?(i[e.resultName]=r.value,i.next=e.nextLoc,"return"!==i.method&&(i.method="next",i.arg=void 0),i.delegate=null,f):r:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,f)))}(i,s),i)){if(i===f)continue;return i}if("next"===s.method)s.sent=s._sent=s.arg;else if("throw"===s.method){if("suspendedStart"===c)throw c="completed",s.arg;s.dispatchException(s.arg)}else"return"===s.method&&s.abrupt("return",s.arg);if(c="executing",i=d(a,o,s),"normal"===i.type){if(c=s.done?"completed":"suspendedYield",i.arg===f)continue;return{value:i.arg,done:s.done}}"throw"===i.type&&(c="completed",s.method="throw",s.arg=i.arg)}})}),e}function d(t,e,i){try{return{type:"normal",arg:t.call(e,i)}}catch(t){return{type:"throw",arg:t}}}t.wrap=h;var f={};function m(){}function p(){}function g(){}a={};var v=(u(a,o,(function(){return this})),Object.getPrototypeOf),w=(v=v&&v(v(_([]))),v&&v!==e&&i.call(v,o)&&(a=v),g.prototype=m.prototype=Object.create(a));function y(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){var a;r(this,"_invoke",{value:function(r,o){function s(){return new e((function(a,s){!function r(a,o,s,c){var l;a=d(t[a],t,o);if("throw"!==a.type)return(o=(l=a.arg).value)&&"object"==Object(n.a)(o)&&i.call(o,"__await")?e.resolve(o.__await).then((function(t){r("next",t,s,c)}),(function(t){r("throw",t,s,c)})):e.resolve(o).then((function(t){l.value=t,s(l)}),(function(t){return r("throw",t,s,c)}));c(a.arg)}(r,o,a,s)}))}return a=a?a.then(s,s):s()}})}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function _(t){if(t){var e,n=t[o];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return e=-1,(n=function n(){for(;++e<t.length;)if(i.call(t,e))return n.value=t[e],n.done=!1,n;return n.value=void 0,n.done=!0,n}).next=n}return{next:j}}function j(){return{value:void 0,done:!0}}return r(w,"constructor",{value:p.prototype=g,configurable:!0}),r(g,"constructor",{value:p,configurable:!0}),p.displayName=u(g,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){return t="function"==typeof t&&t.constructor,!!t&&(t===p||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,u(t,c,"GeneratorFunction")),t.prototype=Object.create(w),t},t.awrap=function(t){return{__await:t}},y(b.prototype),u(b.prototype,s,(function(){return this})),t.AsyncIterator=b,t.async=function(e,i,n,r,a){void 0===a&&(a=Promise);var o=new b(h(e,i,n,r),a);return t.isGeneratorFunction(i)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},y(w),u(w,c,"Generator"),u(w,o,(function(){return this})),u(w,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e,i=Object(t),n=[];for(e in i)n.push(e);return n.reverse(),function t(){for(;n.length;){var e=n.pop();if(e in i)return t.value=e,t.done=!1,t}return t.done=!0,t}},t.values=_,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(k),!t)for(var e in this)"t"===e.charAt(0)&&i.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(i,n){return o.type="throw",o.arg=t,e.next=i,n&&(e.method="next",e.arg=void 0),!!n}for(var r=this.tryEntries.length-1;0<=r;--r){var a=this.tryEntries[r],o=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var s=i.call(a,"catchLoc"),c=i.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;0<=n;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var a=r;break}}var o=(a=a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc?null:a)?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,f):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var i=this.tryEntries[e];if(i.finallyLoc===t)return this.complete(i.completion,i.afterLoc),k(i),f}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var i,n,r=this.tryEntries[e];if(r.tryLoc===t)return"throw"===(i=r.completion).type&&(n=i.arg,k(r)),n}throw new Error("illegal catch attempt")},delegateYield:function(t,e,i){return this.delegate={iterator:_(t),resultName:e,nextLoc:i},"next"===this.method&&(this.arg=void 0),f}},t}a={name:"index",filters:{typeFilter:function(t){return{wechat:"微信用户",routine:"小程序用户"}[t]}},computed:Object(a.a)(Object(a.a)(Object(a.a)({},Object(o.d)("media",["isMobile"])),Object(o.d)("userLevel",["categoryId"])),{},{labelWidth:function(){return this.isMobile?void 0:80},labelPosition:function(){return this.isMobile?"top":"left"}}),data:function(){return{isChat:!0,formValidate3:{page:1,limit:15},total3:0,loading3:!1,modals3:!1,tableList3:[],columns3:[{title:"用户名称",key:"nickname",width:200},{title:"客服头像",slot:"headimgurl"},{title:"操作",slot:"action"}],formValidate5:{page:1,limit:15,uid:0,to_uid:0,id:0},total5:0,loading5:!1,tableList5:[],columns5:[{title:"用户名称",key:"nickname",width:200},{title:"用户头像",slot:"avatar"},{title:"发送消息",key:"msn",width:250},{title:"发送时间",key:"add_time"}],FromData:null,formValidate:{page:1,limit:15,data:"",type:"",nickname:""},tableList2:[],modals:!1,total:0,tableFrom:{page:1,limit:15},timeVal:[],fromList:{title:"选择时间",custom:!0,fromTxt:[{text:"全部",val:""},{text:"今天",val:"today"},{text:"昨天",val:"yesterday"},{text:"最近7天",val:"lately7"},{text:"最近30天",val:"lately30"},{text:"本月",val:"month"},{text:"本年",val:"year"}]},loading:!1,tableList:[],columns1:[{title:"ID",key:"id",width:80},{title:"微信用户名称",key:"nickname",minWidth:120},{title:"客服头像",slot:"avatar",minWidth:60},{title:"客服名称",key:"wx_name",minWidth:120},{title:"客服状态",slot:"status",minWidth:120},{title:"添加时间",key:"add_time",minWidth:120},{title:"操作",slot:"action",fixed:"right",minWidth:150}],columns4:[{type:"selection",width:60,align:"center"},{title:"ID",key:"uid",width:80},{title:"微信用户名称",key:"nickname",minWidth:160},{title:"客服头像",slot:"headimgurl",minWidth:60},{title:"用户类型",slot:"user_type",width:100},{title:"性别",slot:"sex",minWidth:60},{title:"地区",slot:"country",minWidth:120},{title:"是否关注公众号",slot:"subscribe",minWidth:120}],loading2:!1,total2:0,addFrom:{uids:[]},selections:[],rows:{},rowRecord:{}}},created:function(){this.getList()},methods:{goChat:function(t){var e=this;Object(c.D)(t.id).then((function(t){var i,n="";t.data.token&&(i=e.getExpiresTime(t.data.exp_time),Object(s.o)("kefu_token",t.data.token,i),Object(s.o)("kefu_uuid",t.data.kefuInfo.uid,i),Object(s.o)("kefu_expires_time",t.data.exp_time,i),Object(s.o)("kefuInfo",t.data.kefuInfo,i),n=e.$store.state.media.isMobile?window.location.protocol+"//"+window.location.host+"/kefu/mobile_list":window.location.protocol+"//"+window.location.host+"/kefu/pc_list",window.open(n,"_blank"))})).catch((function(t){e.$Message.error(t.msg)}))},getExpiresTime:function(t){var e=Math.round(new Date/1e3);return parseFloat(parseFloat(parseFloat((t-e)/60)/60)/24)},cancel:function(){this.formValidate={page:1,limit:10,data:"",type:"",nickname:""}},handleReachBottom:function(){var t=this;return new Promise((function(e){t.formValidate.page=t.formValidate.page+1,setTimeout((function(){Object(c.G)(t.formValidate).then(function(){var e=Object(r.a)(l().mark((function e(i){var n,r;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0<(n=i.data).list.length)for(r=0;r<n.list.length;r++)t.tableList2.push(n.list[r]);t.total2=n.count,t.loading2=!1;case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){t.loading2=!1,t.$Message.error(e.msg)})),e()}),2e3)}))},look:function(t){this.isChat=!1,this.rowRecord=t,this.getChatlist()},getChatlist:function(){var t=this;this.loading5=!0,this.formValidate5.uid=this.rows.uid,this.formValidate5.to_uid=this.rowRecord.uid,this.formValidate5.id=this.rows.id,Object(c.y)(this.formValidate5).then(function(){var e=Object(r.a)(l().mark((function e(i){var n;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=i.data,t.tableList5=n.list,t.total5=n.count,t.loading5=!1;case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){t.loading5=!1,t.$Message.error(e.msg)}))},pageChange5:function(t){this.formValidate5.page=t,this.getChatlist()},submitFail:function(){this.getList()},record:function(t){this.rows=t,this.modals3=!0,this.isChat=!0,this.getListRecord()},getListRecord:function(){var t=this;this.loading3=!0,Object(c.E)(this.formValidate3,this.rows.id).then(function(){var e=Object(r.a)(l().mark((function e(i){var n;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=i.data,t.tableList3=n.list||[],t.total3=n.count,t.loading3=!1;case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){t.loading3=!1,t.$Message.error(e.msg)}))},pageChange3:function(t){this.formValidate3.page=t,this.getListRecord()},edit:function(t){var e=this;this.$modalForm(Object(c.z)(t.id)).then((function(){return e.getList()}))},add:function(){var t=this;this.$modalForm(Object(c.F)()).then((function(){return t.getList()}))},onSelectTab:function(t){this.selections=t;var e=[];this.selections.map((function(t){e.push(t.uid)})),this.addFrom.uids=e},onchangeTime:function(t){this.timeVal=t,this.formValidate.data=this.timeVal.join("-"),this.formValidate.page=1,this.getListService()},selectChange:function(t){this.formValidate.data=t,this.timeVal=[],this.formValidate.page=1,this.getListService()},getListService:function(){var t=this;this.loading2=(!0)(this.formValidate).then(function(){var e=Object(r.a)(l().mark((function e(i){var n;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=i.data,t.tableList2=n.list,t.total2=n.count,t.tableList2.map((function(t){t._isChecked=!1})),t.loading2=!1;case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){tkefucreateApihis.loading2=!1,t.$Message.error(e.msg)}))},pageChange2:function(t){this.formValidate.page=t,this.getListService(),this.addFrom.uids=[]},userSearchs:function(){this.formValidate.page=1,this.getListService()},del:function(t,e,i){var n=this;e={title:e,num:i,url:"app/wechat/kefu/".concat(t.id),method:"DELETE",ids:""};this.$modalSure(e).then((function(t){n.$Message.success(t.msg),n.tableList.splice(i,1)})).catch((function(t){n.$Message.error(t.msg)}))},getList:function(){var t=this;this.loading=!0,Object(c.C)(this.tableFrom).then(function(){var e=Object(r.a)(l().mark((function e(i){var n;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=i.data,t.tableList=n.list,t.total=i.data.count,t.loading=!1;case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){t.loading=!1,t.$Message.error(e.msg)}))},pageChange:function(t){this.tableFrom.page=t,this.getList()},onchangeIsShow:function(t){var e=this;t={id:t.id,status:t.status};Object(c.H)(t).then(function(){var t=Object(r.a)(l().mark((function t(i){return l().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.$Message.success(i.msg),e.getList();case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).catch((function(t){e.$Message.error(t.msg)}))},putRemark:function(){var t=this;if(0===this.addFrom.uids.length)return this.$Message.warning("请选择要添加的客服");Object(c.x)(this.addFrom).then(function(){var e=Object(r.a)(l().mark((function e(i){return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.$Message.success(i.msg),t.modals=!1,t.getList();case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){t.loading=!1,t.$Message.error(e.msg)}))}}},i("6d6d"),o=i("2877"),i=Object(o.a)(a,(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",[i("Card",{staticClass:"ivu-mt",attrs:{bordered:!1,"dis-hover":""}},[i("Row",{staticClass:"mb20",attrs:{type:"flex"}},[i("Col",{attrs:{span:"24"}},[i("Button",{directives:[{name:"auth",rawName:"v-auth",value:["setting-store_service-add"],expression:"['setting-store_service-add']"}],staticClass:"mr10",attrs:{type:"primary",icon:"md-add"},on:{click:t.add}},[t._v("添加客服")])],1)],1),i("Table",{attrs:{columns:t.columns1,data:t.tableList,loading:t.loading,"highlight-row":"","no-userFrom-text":"暂无数据","no-filtered-userFrom-text":"暂无筛选结果"},scopedSlots:t._u([{key:"avatar",fn:function(t){var e=t.row;return t.index,[i("div",{directives:[{name:"viewer",rawName:"v-viewer"}],staticClass:"tabBox_img"},[i("img",{directives:[{name:"lazy",rawName:"v-lazy",value:e.avatar,expression:"row.avatar"}]})])]}},{key:"status",fn:function(e){var n=e.row;return e.index,[i("i-switch",{attrs:{value:n.status,"true-value":1,"false-value":0,size:"large"},on:{"on-change":function(e){return t.onchangeIsShow(n)}},model:{value:n.status,callback:function(e){t.$set(n,"status",e)},expression:"row.status"}},[i("span",{attrs:{slot:"open"},slot:"open"},[t._v("开启")]),i("span",{attrs:{slot:"close"},slot:"close"},[t._v("关闭")])])]}},{key:"stop_time",fn:function(e){var n=e.row;return e.index,[i("span",[t._v(" "+t._s(t._f("formatDate")(n.stop_time)))])]}},{key:"action",fn:function(e){var n=e.row,r=e.index;return[i("a",{on:{click:function(e){return t.edit(n)}}},[t._v("编辑")]),i("Divider",{attrs:{type:"vertical"}}),i("a",{on:{click:function(e){return t.del(n,"删除客服",r)}}},[t._v("删除")]),n.status?i("Divider",{attrs:{type:"vertical"}}):t._e(),n.status?i("a",{on:{click:function(e){return t.goChat(n)}}},[t._v("进入工作台")]):t._e()]}}])}),i("div",{staticClass:"acea-row row-right page"},[i("Page",{attrs:{total:t.total,"show-elevator":"","show-total":"","page-size":t.tableFrom.limit},on:{"on-change":t.pageChange}})],1)],1),i("Modal",{attrs:{"footer-hide":"",scrollable:"",closable:"",title:"聊天记录",width:"700"},model:{value:t.modals3,callback:function(e){t.modals3=e},expression:"modals3"}},[t.isChat?i("div",{staticClass:"modelBox"},[i("Table",{attrs:{loading:t.loading3,"highlight-row":"","no-userFrom-text":"暂无数据","no-filtered-userFrom-text":"暂无筛选结果",columns:t.columns3,data:t.tableList3},scopedSlots:t._u([{key:"headimgurl",fn:function(t){var e=t.row;return t.index,[i("div",{directives:[{name:"viewer",rawName:"v-viewer"}],staticClass:"tabBox_img"},[i("img",{directives:[{name:"lazy",rawName:"v-lazy",value:e.headimgurl,expression:"row.headimgurl"}]})])]}},{key:"action",fn:function(e){var n=e.row;return e.index,[i("a",{on:{click:function(e){return t.look(n)}}},[t._v("查看对话")])]}}],null,!1,3903412383)}),i("div",{staticClass:"acea-row row-right page"},[i("Page",{attrs:{total:t.total3,"show-elevator":"","show-total":"","page-size":t.formValidate3.limit},on:{"on-change":t.pageChange3}})],1)],1):t._e(),t.isChat?t._e():i("div",[i("Button",{attrs:{type:"primary"},on:{click:function(e){t.isChat=!0}}},[t._v("返回聊天记录")]),i("Table",{staticClass:"mt20",attrs:{loading:t.loading5,"highlight-row":"","no-userFrom-text":"暂无数据","no-filtered-userFrom-text":"暂无筛选结果",columns:t.columns5,data:t.tableList5},scopedSlots:t._u([{key:"avatar",fn:function(t){var e=t.row;return t.index,[i("div",{directives:[{name:"viewer",rawName:"v-viewer"}],staticClass:"tabBox_img"},[i("img",{directives:[{name:"lazy",rawName:"v-lazy",value:e.avatar,expression:"row.avatar"}]})])]}},{key:"action",fn:function(e){var n=e.row;return e.index,[i("a",{on:{click:function(e){return t.look(n)}}},[t._v("查看对话")])]}}],null,!1,3441659566)}),i("div",{staticClass:"acea-row row-right page"},[i("Page",{attrs:{total:t.total5,"show-elevator":"","show-total":"","page-size":t.formValidate5.limit},on:{"on-change":t.pageChange5}})],1)],1)])],1)}),[],!1,null,"5b26d69e",null),e.default=i.exports},d457:function(t,e,i){}}]);
|