(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-07e9a2df"],{"0391":function(e,t,n){"use strict";n.d(t,"b",(function(){return l})),n.d(t,"a",(function(){return r}));n("99af"),n("fb6a"),n("d3b7"),n("25f0");var a="chat-record:",i=6e5;function l(e){var t="".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2));try{return localStorage.setItem("".concat(a).concat(t),JSON.stringify({url:e,expiresAt:Date.now()+i})),t}catch(n){return""}}function r(e){if(!e)return"";try{var t=localStorage.getItem("".concat(a).concat(e));if(!t)return"";var n=JSON.parse(t);return!n.expiresAt||n.expiresAt<Date.now()?(localStorage.removeItem("".concat(a).concat(e)),""):(localStorage.removeItem("".concat(a).concat(e)),n.url||"")}catch(i){return""}}},"0ed9":function(e,t,n){},1:function(e,t){},"1fed":function(e,t,n){"use strict";n.r(t);var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"table-inline-edit"},[n("Hints",[n("template",{slot:"hintName"},[e._v("我的广告数据")]),n("template",{slot:"hintInfo"},[e.noticeList.length?n("el-carousel",{attrs:{height:"50px",arrow:"never",direction:"vertical"}},e._l(e.noticeList,(function(t){return n("el-carousel-item",{key:t.id},[n("div",{staticClass:"overflow2",domProps:{innerHTML:e._s(t.content)}})])})),1):e._e()],1)],2),n("el-dialog",{attrs:{title:"导出数据",visible:e.exportVisible,width:"30%"},on:{"update:visible":function(t){e.exportVisible=t}}},[n("div",{staticClass:"export-data"},[n("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.exportTable("xlsx")}}},[e._v("EXCEL格式")]),n("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.exportTable("csv")}}},[e._v("CSV格式")]),n("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.exportTable("txt")}}},[e._v("TXT格式")])],1),n("div",{staticClass:"hints"},[e._v("TIP：请选择要导出数据的格式。")])]),n("el-dialog",{attrs:{title:"列设置",visible:e.columnSettingsVisible,width:"460px","close-on-click-modal":!1},on:{"update:visible":function(t){e.columnSettingsVisible=t}}},[n("p",{staticClass:"my-ad-column-settings__hint"},[e._v(" 拖动调整列顺序，勾选控制显示。用户意向、数据类型（管理员）和操作列固定在最右侧；设置只保存在当前浏览器。 ")]),n("draggable",{staticClass:"my-ad-column-settings__list",attrs:{handle:".my-ad-column-settings__handle","ghost-class":"my-ad-column-settings__ghost",animation:150},model:{value:e.columnSettingsDraft,callback:function(t){e.columnSettingsDraft=t},expression:"columnSettingsDraft"}},e._l(e.columnSettingsDraft,(function(t){return n("div",{key:t.key,staticClass:"my-ad-column-settings__item"},[n("i",{staticClass:"el-icon-rank my-ad-column-settings__handle",attrs:{"aria-hidden":"true"}}),n("el-checkbox",{model:{value:t.visible,callback:function(n){e.$set(t,"visible",n)},expression:"column.visible"}},[e._v(e._s(t.label))])],1)})),0),n("div",{attrs:{slot:"footer"},slot:"footer"},[n("el-button",{attrs:{type:"text"},on:{click:e.resetColumnSettings}},[e._v("恢复默认")]),n("el-button",{on:{click:function(t){e.columnSettingsVisible=!1}}},[e._v("取消")]),n("el-button",{attrs:{type:"primary"},on:{click:e.saveColumnSettings}},[e._v("应用")])],1)],1),n("el-card",{attrs:{shadow:"always"}},[n("el-form",{ref:"searchForm",staticClass:"search-form",attrs:{inline:!0,model:e.listQuery,"label-width":"90px"}},[e.$store.state.all.userInfo.role>=9?n("el-form-item",{attrs:{label:"用户id"}},[n("el-input",{attrs:{placeholder:"用户id"},model:{value:e.listQuery.userId,callback:function(t){e.$set(e.listQuery,"userId",e._n(t))},expression:"listQuery.userId"}})],1):e._e(),n("el-form-item",{attrs:{label:"手机号"}},[n("el-input",{attrs:{clearable:"",maxlength:"11",placeholder:"手机号"},model:{value:e.listQuery.telphone,callback:function(t){e.$set(e.listQuery,"telphone",e._n(t))},expression:"listQuery.telphone"}})],1),n("el-form-item",{attrs:{label:"微信号"}},[n("el-input",{attrs:{clearable:"",maxlength:"255",placeholder:"微信号前缀"},model:{value:e.listQuery.weixin,callback:function(t){e.$set(e.listQuery,"weixin",t)},expression:"listQuery.weixin"}})],1),n("el-form-item",{attrs:{label:"用户意向"}},[n("el-select",{attrs:{placeholder:"全部"},model:{value:e.listQuery.adVlabel,callback:function(t){e.$set(e.listQuery,"adVlabel",t)},expression:"listQuery.adVlabel"}},[n("el-option",{attrs:{value:"",label:"全部"}}),n("el-option-group",{attrs:{label:"原意向"}},e._l(e.internalIntentOptions,(function(e){return n("el-option",{key:e.value,attrs:{value:e.value,label:e.label}})})),1),n("el-option-group",{attrs:{label:"更多平台状态"}},e._l(e.localPushIntentOptions,(function(e){return n("el-option",{key:e.value,attrs:{value:e.value,label:e.label}})})),1)],1)],1),e.$store.state.all.userInfo.role>=9?n("el-form-item",{attrs:{label:"数据类型"}},[n("el-select",{attrs:{placeholder:"所有数据"},model:{value:e.listQuery.ad_type,callback:function(t){e.$set(e.listQuery,"ad_type",t)},expression:"listQuery.ad_type"}},[n("el-option",{attrs:{value:"",label:"所有类型"}}),n("el-option",{attrs:{value:0,label:"正常广告数据"}}),n("el-option",{attrs:{value:1,label:"管理员添加的数据"}})],1)],1):e._e(),n("el-date-picker",{attrs:{"value-format":"yyyy-MM-dd HH:mm:ss",type:"daterange","range-separator":"至","start-placeholder":"开始日期","end-placeholder":"结束日期","picker-options":e.pickerOptions},model:{value:e.listQuery.time,callback:function(t){e.$set(e.listQuery,"time",t)},expression:"listQuery.time"}}),n("el-form-item",{attrs:{label:"科室"}},[n("el-input",{attrs:{clearable:"",maxlength:"150",placeholder:"科室"},model:{value:e.listQuery.department,callback:function(t){e.$set(e.listQuery,"department",t)},expression:"listQuery.department"}})],1),n("el-form-item",{attrs:{label:"备注"}},[n("el-input",{attrs:{clearable:"",maxlength:"150",placeholder:"备注模糊查询"},model:{value:e.listQuery.userRemark,callback:function(t){e.$set(e.listQuery,"userRemark",e._n(t))},expression:"listQuery.userRemark"}})],1),e.$store.state.all.userInfo.role>=9?n("el-form-item",{attrs:{label:"广告主名称"}},[n("el-input",{attrs:{clearable:"",maxlength:"150",placeholder:"广告主名称"},model:{value:e.listQuery.advName,callback:function(t){e.$set(e.listQuery,"advName",e._n(t))},expression:"listQuery.advName"}})],1):e._e(),n("el-form-item",[n("el-button",{attrs:{type:"primary"},on:{click:e.onSubmit}},[e._v("查询")]),n("el-button",{attrs:{type:"primary"},on:{click:function(t){e.exportVisible=!0}}},[e._v("导出数据")]),n("el-button",{attrs:{icon:"el-icon-setting",disabled:!e.$store.state.all.userInfo.id},on:{click:e.openColumnSettings}},[e._v("列设置")])],1)],1),n("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.listLoading,expression:"listLoading"}],key:e.columnLayoutVersion,ref:"multipleTable",staticStyle:{width:"100%"},attrs:{data:e.tableList,"tooltip-effect":"dark",size:"small"}},[e._l(e.visibleColumns,(function(t){return n("el-table-column",{key:t.key,attrs:{prop:t.prop,label:t.label,align:t.align||"center",width:t.width,"min-width":t.minWidth,sortable:t.sortable,fixed:t.fixed},scopedSlots:e._u([{key:"default",fn:function(a){var i=a.row;return["telphone"===t.renderer?[e._v(" "+e._s(i.telphone)+" "),i.is_blacklisted?n("el-tag",{attrs:{type:"danger",size:"mini"}},[e._v("黑名单")]):e._e()]:"chatRecord"===t.renderer?[i.chat_link_sc?n("el-button",{attrs:{type:"text"},on:{click:function(t){return e.openChatRecord(i)}}},[e._v("查看记录")]):e._e(),i.chat_record_text?n("el-button",{attrs:{type:"text"},on:{click:function(t){return e.openChatText(i)}}},[e._v("查看私信")]):e._e(),i.chat_link_sc||i.chat_record_text?e._e():n("span",[e._v("-")])]:"weixin"===t.renderer?[e._v(" "+e._s(i.weixin)+" "),i.is_weixin_blacklisted?n("el-tag",{attrs:{type:"danger",size:"mini"}},[e._v("黑名单")]):e._e()]:"department"===t.renderer?[n("span",[e._v(e._s(i.department||e.$store.state.all.userInfo.label))])]:"remark"===t.renderer?[i.editable?[n("textarea",{directives:[{name:"model",rawName:"v-model",value:i.adVremark,expression:"row.adVremark"}],staticStyle:{resize:"none",width:"100%",height:"100px"},domProps:{value:i.adVremark},on:{input:function(t){t.target.composing||e.$set(i,"adVremark",t.target.value)}}})]:n("span",[i.adVremark?n("el-popover",{attrs:{placement:"right",width:"400",trigger:"hover"}},[n("el-table",{attrs:{data:i.remarkList}},[n("el-table-column",{attrs:{width:"120",property:"date",label:"日期"}}),n("el-table-column",{attrs:{width:"300",property:"remark",label:"备注"}})],1),n("div",{attrs:{slot:"reference"},slot:"reference"},[e._v(e._s(i.adVremark))])],1):e._e()],1)]:"supplement"===t.renderer?[n("div",[e._v(e._s(i.remark_dict||""))])]:"intention"===t.renderer?[n("div",{staticClass:"_adv_label"},[n("el-select",{staticClass:"select",attrs:{disabled:e.intentSaving||e.isSubAdminReadonly},on:{change:function(t){return e.selectChange(i)}},model:{value:i.adVlabel,callback:function(t){e.$set(i,"adVlabel",t)},expression:"row.adVlabel"}},[n("el-option-group",{attrs:{label:"原意向"}},e._l(e.internalIntentOptions,(function(e){return n("el-option",{key:e.value,attrs:{value:e.value,label:e.label}})})),1),e.isLocalPushLead(i)?n("el-option-group",{attrs:{label:"更多平台状态（选择后回传）"}},e._l(e.localPushIntentOptions,(function(e){return n("el-option",{key:e.value,attrs:{value:e.value,label:e.label}})})),1):e._e()],1),n("el-tag",{attrs:{size:"medium",effect:"dark",type:e.intentionOption(i.adVlabel).type}},[e._v(" "+e._s(e.intentionOption(i.adVlabel).label)+" ")])],1)]:"dataType"===t.renderer?[n("div",{attrs:{slot:"reference"},slot:"reference"},[0==i.ad_type?n("el-tag",{attrs:{size:"medium"}},[e._v("正常投放")]):n("el-tag",{attrs:{type:"info"}},[e._v("管理员数据")])],1)]:[e._v(" "+e._s(i[t.prop])+" ")]]}}],null,!0)})})),n("el-table-column",{attrs:{align:"center",label:"操作",width:"150",fixed:"right"},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.row;return[a.editable?n("el-button",{attrs:{type:"success",size:"small"},on:{click:function(t){return e.confirmEdit(a)}}},[e._v("保存")]):e.isSubAdminReadonly?e._e():n("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(e){a.editable=!a.editable}}},[e._v("编辑")]),a.editable?n("el-button",{staticClass:"cancel-btn",attrs:{type:"warning"},on:{click:function(t){return e.cancelEdit(a)}}},[e._v("取消")]):e._e()]}}])}),n("el-table-column",{attrs:{align:"center",label:"操作",width:"70",fixed:"right"},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.row;return[n("el-button",{attrs:{id:"copy-button",type:"info",size:"small"},on:{click:function(t){return e.copy(a)}}},[e._v("复制")])]}}])})],2),n("Pagination",{attrs:{total:e.total,page:e.listQuery.currentPage,limit:e.listQuery.pageSize},on:{"update:page":function(t){return e.$set(e.listQuery,"currentPage",t)},"update:limit":function(t){return e.$set(e.listQuery,"pageSize",t)},pagination:e.fetchData}})],1),n("el-dialog",{attrs:{title:"私信沟通信息",visible:e.chatTextVisible,width:"640px"},on:{"update:visible":function(t){e.chatTextVisible=t}}},[n("ChatText",{attrs:{text:e.chatText}})],1),n("el-dialog",{attrs:{title:"标记无效线索并回传",visible:e.invalidIntentDialogVisible,width:"min(520px, 94vw)","before-close":e.cancelInvalidIntent,"show-close":!e.intentSaving,"close-on-click-modal":!1,"close-on-press-escape":!e.intentSaving},on:{"update:visible":function(t){e.invalidIntentDialogVisible=t}}},[n("el-alert",{attrs:{title:"确认后保存用户意向，并同步回传巨量本地推。请选择符合实际情况的原因。",type:"warning",closable:!1,"show-icon":""}}),n("el-form",{staticClass:"my-ad-invalid-intent",attrs:{"label-position":"top"}},[n("el-form-item",{attrs:{label:"无效原因",required:""}},[n("el-select",{staticStyle:{width:"100%"},attrs:{disabled:e.intentSaving,placeholder:"请选择平台支持的原因"},model:{value:e.invalidIntentReasonCode,callback:function(t){e.invalidIntentReasonCode=t},expression:"invalidIntentReasonCode"}},e._l(e.invalidIntentReasonGroups,(function(t){return n("el-option-group",{key:t.label,attrs:{label:t.label}},e._l(t.options,(function(e){return n("el-option",{key:e.value,attrs:{value:e.value,label:e.label}})})),1)})),1)],1),"OTHER"===e.invalidIntentReasonCode?n("el-form-item",{attrs:{label:"原因说明（选填，建议填写）"}},[n("el-input",{attrs:{type:"textarea",disabled:e.intentSaving,placeholder:"请简要说明实际无效原因，勿填写手机号等个人信息"},model:{value:e.invalidIntentReasonMessage,callback:function(t){e.invalidIntentReasonMessage=t},expression:"invalidIntentReasonMessage"}})],1):e._e()],1),n("div",{attrs:{slot:"footer"},slot:"footer"},[n("el-button",{attrs:{disabled:e.intentSaving},on:{click:e.cancelInvalidIntent}},[e._v("取消")]),n("el-button",{attrs:{type:"primary",loading:e.intentSaving,disabled:!e.invalidIntentReasonCode},on:{click:e.submitInvalidIntent}},[e._v("保存并回传")])],1)],1),n("el-dialog",{attrs:{title:"重要提醒",visible:e.noticePopupVisible,width:"640px","show-close":!1,"close-on-click-modal":!1,"close-on-press-escape":!1},on:{"update:visible":function(t){e.noticePopupVisible=t}}},[e._l(e.noticePopups,(function(t){return n("div",{key:t.id,staticClass:"notice-popup-item",domProps:{innerHTML:e._s(t.content)}})})),n("div",{attrs:{slot:"footer"},slot:"footer"},[n("el-button",{attrs:{type:"primary"},on:{click:e.confirmNoticePopup}},[e._v(" 我知道了 ")])],1)],2)],1)},i=[],l=(n("99af"),n("4de4"),n("7db0"),n("4160"),n("caad"),n("c975"),n("d81d"),n("45fc"),n("b0c0"),n("a9e3"),n("4d63"),n("ac1f"),n("25f0"),n("2532"),n("5319"),n("498a"),n("159b"),n("96cf"),n("1da1")),r=n("5530"),s=n("310e"),o=n.n(s),c=n("b522"),u=n("333d"),d=n("776c"),p=n("cd77"),m=n("b311"),f=n.n(m),v=n("0391"),h=[{value:0,label:"未标记",type:""},{value:1,label:"有意向",type:"success",state:"CLUE_CONFIRM"},{value:2,label:"意向一般",type:"info",state:"CLUE_CONFIRM"},{value:3,label:"没意向",type:"danger",state:"INVALID_EVENT"},{value:4,label:"已加微信",type:"success",state:"CLUE_CONFIRM"},{value:5,label:"待再次沟通",type:"warning"}],b=[{value:6,label:"确认意向",type:"success",state:"CLUE_CONFIRM"},{value:7,label:"定金/钩子品支付",type:"success",state:"CLUE_HIGH_INTENTION"},{value:8,label:"到店/成功上门",type:"",state:"ARRIVAL"},{value:9,label:"正价支付",type:"success",state:"CONVERSION_CLASS"},{value:10,label:"无效线索",type:"danger",state:"INVALID_EVENT"}],_=[{label:"行业通用",options:[{value:"CALL_THREE_TIMES_NO_RESPONSE",label:"拨打3次以上未接通"},{value:"CONNECTED_NO_INTENTION",label:"接通但无意向"},{value:"NO_AD_RESPONSE",label:"反馈未在营销留资"},{value:"OFFENSIVE_LANGUAGE",label:"黑脏词"},{value:"INVALID_NUMBER",label:"空号/停机/关机"},{value:"OTHER",label:"其它（建议优先选择具体原因）"}]},{label:"家居行业",options:[{value:"HOME_COLLABORATION_WITH_PEERS",label:"同行合作"},{value:"HOME_NO_SHOW_FOR_MEASUREMENT_VISIT",label:"爽约上门量房"},{value:"HOME_RENOVATION_TYPE_NOT_ACCEPTABLE",label:"装修类型不可承接"},{value:"HOME_MISMATCH_DIFFERENT_LOCATIONS",label:"需求与供给异地"},{value:"HOME_MISMATCH_LOW_BUDGET",label:"消费力差，预算少/面积小"}]},{label:"教育行业",options:[{value:"EDU_MISMATCH_CLASS_TIME",label:"上课时间不匹配"},{value:"EDU_MISMATCH_COURSE",label:"课程不匹配"},{value:"EDU_MISMATCH_DIFFERENT_LOCATIONS",label:"需求不匹配：需求与供给异地"},{value:"EDU_UNABLE_TO_ATTEND_IN_PERSON",label:"无法线下参加"}]},{label:"房产行业",options:[{value:"HOUSE_NO_INTENTION",label:"无意向"}]}],g=1,y=[{key:"name",prop:"name",label:"姓名",width:120},{key:"telphone",prop:"telphone",label:"电话",width:170,renderer:"telphone"},{key:"location",prop:"location",label:"所在地",width:150},{key:"app_name",prop:"app_name",label:"来源",width:100},{key:"chat_record",label:"聊天记录",width:150,permission:"chatRecord",renderer:"chatRecord"},{key:"weixin",prop:"weixin",label:"微信",width:150,renderer:"weixin"},{key:"department",prop:"department",label:"项目",width:100,renderer:"department"},{key:"remark",label:"备注",align:"left",minWidth:300,renderer:"remark"},{key:"supplement",prop:"remark",label:"补充信息",align:"left",width:400,renderer:"supplement"},{key:"create_time",prop:"create_time",label:"创建时间",width:160,sortable:!0},{key:"video_id",prop:"video_id",label:"视频ID",width:180,permission:"localPush"},{key:"ad_name",prop:"ad_name",label:"计划名称",width:150,permission:"localPush"},{key:"module_name",prop:"module_name",label:"单元名称",width:150,permission:"admin"},{key:"ad_account_id",prop:"ad_account_id",label:"快手号ID",width:150,permission:"admin"},{key:"flow_type_display",prop:"flow_type_display",label:"流量类型",width:200,permission:"admin"},{key:"adv_name",prop:"adv_name",label:"账户名称",width:150,permission:"localPush"},{key:"adVlabel",label:"用户意向",width:160,fixed:"right",renderer:"intention"},{key:"ad_type",prop:"ad_type",label:"数据类型",width:100,fixed:"right",permission:"admin",renderer:"dataType"}],k={name:"TableInlineEdit",components:{Hints:c["a"],Pagination:u["a"],ChatText:d["a"],draggable:o.a},data:function(){return{listLoading:!0,tableList:[],total:0,listQuery:{currentPage:1,pageSize:10,adVlabel:void 0,time:void 0,userId:void 0,telphone:void 0,weixin:void 0,ad_type:void 0,department:void 0,advName:void 0,userRemark:void 0},exportVisible:!1,columnSettingsVisible:!1,columnSettingsDraft:[],columnOrder:y.map((function(e){return e.key})),visibleColumnKeys:y.map((function(e){return e.key})),columnLayoutVersion:0,columnPreferencesUserId:"",chatTextVisible:!1,chatText:"",noticePopupVisible:!1,noticePopups:[],noticeList:[],internalIntentOptions:h,localPushIntentOptions:b,invalidIntentReasonGroups:_,intentSaving:!1,invalidIntentDialogVisible:!1,pendingInvalidIntentRow:null,pendingInvalidIntentValue:null,invalidIntentReasonCode:"",invalidIntentReasonMessage:"",pickerOptions:{shortcuts:[{text:"最近一周",onClick:function(e){var t=new Date,n=new Date,a=t.getFullYear(),i=t.getMonth(),l=t.getDate(),r=new Date(a,i,l+1);n.setTime(n.getTime()-6048e5),e.$emit("pick",[n,r])}},{text:"最近一个月",onClick:function(e){var t=new Date,n=new Date,a=t.getFullYear(),i=t.getMonth(),l=t.getDate(),r=new Date(a,i,l+1);n.setTime(n.getTime()-2592e6),e.$emit("pick",[n,r])}},{text:"最近三个月",onClick:function(e){var t=new Date,n=new Date,a=t.getFullYear(),i=t.getMonth(),l=t.getDate(),r=new Date(a,i,l+1);n.setTime(n.getTime()-7776e6),e.$emit("pick",[n,r])}}]}}},computed:{isSubAdminReadonly:function(){return 6===Number((this.$store.state.all.userInfo||{}).role)},availableColumns:function(){var e=this.$store.state.all.userInfo||{},t=Number(e.role)>=9,n=t||!0===e.can_view_chat_record||1===Number(e.can_view_chat_record),a=t||!0===e.can_view_local_push_info||1===Number(e.can_view_local_push_info);return y.filter((function(e){return"admin"===e.permission?t:"chatRecord"===e.permission?n:"localPush"!==e.permission||a}))},visibleColumns:function(){var e=this;return this.availableColumns.filter((function(t){return e.visibleColumnKeys.includes(t.key)})).sort((function(t,n){return e.columnOrder.indexOf(t.key)-e.columnOrder.indexOf(n.key)}))}},watch:{"$store.state.all.userInfo.id":{immediate:!0,handler:function(e){if(void 0!==e&&null!==e&&""!==e){var t=String(e);this.columnPreferencesUserId!==t&&(this.columnPreferencesUserId=t,this.loadColumnPreferences())}}}},created:function(){var e=this.getLast3Month(Date.now());this.listQuery.time=[e.last+" 00:00:00",e.now+" 00:00:00"],console.log(this.listQuery),this.fetchData(),this.noticeShowList(),this.noticePopupList()},methods:{getColumnPreferenceStorageKey:function(){var e=this.$store.state.all.userInfo||{},t=this.columnPreferencesUserId||e.id||e.name||"anonymous";return"my-ad:column-preferences:v1:".concat(t)},loadColumnPreferences:function(){var e=this.availableColumns.map((function(e){return e.key})),t=null;try{var n=window.localStorage.getItem(this.getColumnPreferenceStorageKey());t=n?JSON.parse(n):null}catch(s){t=null}var a=t&&t.version===g&&Array.isArray(t.order)?t.order.filter((function(t,n,a){return e.includes(t)&&a.indexOf(t)===n})):[],i=e.filter((function(e){return!a.includes(e)})),l=a.concat(i),r=t&&t.version===g&&Array.isArray(t.visible)?t.visible.filter((function(t){return e.includes(t)})).concat(i):e;this.columnOrder=l,this.visibleColumnKeys=l.filter((function(e){return r.includes(e)})),this.columnLayoutVersion+=1},openColumnSettings:function(){var e=this,t=this.availableColumns.map((function(e){return e.key})),n=this.columnOrder.filter((function(e){return t.includes(e)})),a=n.concat(t.filter((function(e){return!n.includes(e)})));this.columnSettingsDraft=a.map((function(t){var n=e.availableColumns.find((function(e){return e.key===t}));return{key:n.key,label:n.label,visible:e.visibleColumnKeys.includes(n.key)}})),this.columnSettingsVisible=!0},resetColumnSettings:function(){this.columnSettingsDraft=this.availableColumns.map((function(e){return{key:e.key,label:e.label,visible:!0}}))},saveColumnSettings:function(){var e=this.columnSettingsDraft.map((function(e){return e.key})),t=this.columnSettingsDraft.filter((function(e){return e.visible})).map((function(e){return e.key}));if(t.length){this.columnOrder=e,this.visibleColumnKeys=t,this.columnLayoutVersion+=1;try{window.localStorage.setItem(this.getColumnPreferenceStorageKey(),JSON.stringify({version:g,order:e,visible:t})),this.$message.success("列设置已保存到当前浏览器")}catch(n){this.$message.warning("浏览器无法保存设置，本次页面仍会应用")}this.columnSettingsVisible=!1}else this.$message.warning("请至少保留一列业务字段")},getLast3Month:function(){var e=new Date;e.setTime(e.getTime()+864e5);var t=e.getFullYear()+"-"+(e.getMonth()+1)+"-"+e.getDate(),n=new Date(t),a=n.getFullYear(),i=n.getMonth()+1,l=n.getDate(),r={};if(parseInt(i)<10&&(i="0"+i),parseInt(l)<10&&(l="0"+l),r.now=a+"-"+i+"-"+l,1===parseInt(i))return r.last=parseInt(a)-1+"-10-"+l,r;if(2===parseInt(i))return r.last=parseInt(a)-1+"-11-"+l,r;if(3===parseInt(i))return r.last=parseInt(a)-1+"-12-"+l,r;var s=new Date(a,parseInt(i)-3,0).getDate();if(s<parseInt(l)){var o=parseInt(i)-2<10?"0"+parseInt(i)-2:parseInt(i)-2;return r.last=a+"-"+o+"-01",r}return parseInt(i)<=10?(r.last=a+"-0"+(parseInt(i)-3)+"-"+l,r):(r.last=a+"-"+(parseInt(i)-3)+"-"+l,r)},noticeShowList:function(){var e=this;this.api.noticeShowList().then((function(t){console.log(t),e.noticeList=t}))},noticePopupList:function(){var e=this;this.api.noticePopupList().then((function(t){var n=t||[];n.length&&(e.noticePopups=n,e.noticePopupVisible=!0)})).catch((function(){}))},confirmNoticePopup:function(){var e=this.noticePopups.map((function(e){return e.id}));this.noticePopupVisible=!1,this.noticePopups=[],e.length&&this.api.noticePopupRead({ids:e}).catch((function(){}))},openChatRecord:function(e){if(e.chat_link_sc){var t=Object(v["b"])(e.chat_link_sc);if(t){var n=this.$router.resolve({name:"ChatRecord",query:{key:t}});window.open(n.href,"_blank","noopener,noreferrer")}else this.$message.error("聊天记录打开失败，请检查浏览器存储权限")}},openChatText:function(e){this.chatText=e.chat_record_text||"",this.chatTextVisible=!0},copy:function(e){var t=this,n=new f.a("#copy-button",{text:function(){return"".concat(e.name," ").concat(e.telphone," ").concat(e.location," ").concat(e.app_name," ").concat(e.remark_dict," ").concat(e.department||t.$store.state.all.userInfo.label," ").concat(e.remarkBefor," ").concat(e.create_time," ")}});n.on("success",(function(e){n.off("error"),n.off("success"),n.destroy(),t.$message({message:"复制成功",type:"success"})}))},fetchData:function(){var e=this;function t(e){for(var t=["您的姓名（已加密，放心填）","您的姓名（已加密，请放心填写）","您的姓名（如：王先生）","您的姓名（已加密）","您的姓名(已加密)","您的姓名",'"":""'],n=0;n<t.length;n++)e=e.replace(new RegExp(t[n],"g"),"");return e}this.listLoading=!0,this.api.getAdvList(this.listQuery).then((function(n){for(var a=0;a<n.list.length;a++)if(n.list[a].label=e.$store.state.all.userInfo.label||"",n.list[a].create_time=new Date(n.list[a].createdAt||1e3*n.list[a].create_time).format("yyyy-MM-dd h:m:s"),n.list[a].remark_dict=t(n.list[a].remark_dict),n.list[a].editable=!1,n.list[a].intentValueBefore=n.list[a].adVlabel,n.list[a].remarkBefor=n.list[a].adVremark,null!=n.list[a].remarkList&&""!==n.list[a].remarkList&&n.list[a].remarkList.length){n.list[a].remarkList=JSON.parse(n.list[a].remarkList);for(var i=0;i<n.list[a].remarkList.length;i++)n.list[a].remarkList[i].date=new Date(n.list[a].remarkList[i].date).format("yyyy-MM-dd h:m");n.list[a]._remarkList=JSON.stringify(n.list[a].remarkList)}else n.list[a].remarkList=[],n.list[a]._remarkList=n.list[a].adVremark||"";e.tableList=n.list,e.total=n.total,e.listQuery.pageSize=n.pageSize,e.listLoading=!1,e.fillProjectDetail()})).catch((function(t){console.log(t),e.listLoading=!1}))},fillProjectDetail:function(){var e=this;if(this.tableList.forEach((function(t){return e.refreshFlowTypeDisplay(t)})),!(this.$store.state.all.userInfo.role<9)){var t=this.tableList.filter((function(e){return!e.external_action&&e.project_id})).map((function(e){return e.id}));t.length&&this.api.projectDetail({ids:t}).then((function(t){t&&e.tableList.forEach((function(n){var a=t[n.id];a&&(a.external_action&&e.$set(n,"external_action",a.external_action),a.delivery_package&&e.$set(n,"delivery_package",a.delivery_package),e.refreshFlowTypeDisplay(n))}))})).catch((function(){}))}},refreshFlowTypeDisplay:function(e){var t=e.flow_type||"",n=e.external_action||"";if(t||n){var a=e.delivery_package||"标准投放";this.$set(e,"flow_type_display","".concat(t?t+"/":"").concat(a).concat(n?"-"+n:""))}else this.$set(e,"flow_type_display","")},cancelEdit:function(e){e.adVremark=e.remarkBefor,e.editable=!1},updateAdVremark:function(e,t){var n=this;this.listLoading=!0,this.api.updateAdVremark(Object(r["a"])({},e)).then((function(e){n.listLoading=!1,t&&t()})).catch((function(){n.listLoading=!1}))},confirmEdit:function(e){var t=this;this.updateAdVremark({userId:e.userId,advId:e.id,adVremark:e.adVremark,id:e.user_ad_adv_id},(function(){e.editable=!1,e.remarkBefor=e.adVremark,t.fetchData()}))},exportTable:function(e){var t=this;return Object(l["a"])(regeneratorRuntime.mark((function n(){var a,i,l,r,s,o,c,u,d,m;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(!t.tableList.length){n.next=18;break}return n.next=3,t.api.adExport(t.listQuery);case 3:for(a=n.sent,console.log(a),i=0;i<a.list.length;i++)a.list[i].create_time=new Date(a.list[i].createdAt||1e3*a.list[i].create_time).format("yyyy-MM-dd h:m:s"),a.list[i].adVlabelName=t.intentionOption(a.list[i].adVlabel).label;l=t.$store.state.all.userInfo,r=Number(l.role)>=9,s=r||Boolean(l.can_view_local_push_info),o=s?["视频ID","计划名称","账户名称"]:[],c=s?["video_id","ad_name","adv_name"]:[],u=r?["单元名称","快手号ID","流量类型","优化目标"]:[],d=r?["module_name","ad_account_id","flow_type_display","external_action"]:[],m={header:["姓名","电话","所在地","来源","用户意向","科室","备注","补充信息"].concat(o,u,["创建时间"]),key:["name","telphone","location","app_name","adVlabelName","department","adVremark","remark_dict"].concat(c,d,["create_time"]),data:a.list,autoWidth:!0,fileName:"广告数据",bookType:e},p["a"].exportDataToExcel(m),t.exportVisible=!1,n.next=19;break;case 18:t.exportVisible=!1;case 19:case"end":return n.stop()}}),n)})))()},intentionOption:function(e){return this.internalIntentOptions.concat(this.localPushIntentOptions).find((function(t){return t.value===Number(e)}))||{label:"",type:""}},isLocalPushLead:function(e){return Boolean(e&&e.adv&&"本地推"===e.adv.app_name)},selectChange:function(e){var t=Number(e.adVlabel);if(e.adVlabel=e.intentValueBefore,!this.intentSaving){var n=this.isLocalPushLead(e);if(!(t>=6)||n)return n&&"INVALID_EVENT"===this.intentionOption(t).state?(this.pendingInvalidIntentRow=e,this.pendingInvalidIntentValue=t,this.invalidIntentReasonCode=3===t?"CONNECTED_NO_INTENTION":"",this.invalidIntentReasonMessage="",void(this.invalidIntentDialogVisible=!0)):this.saveIntention(e,t);this.$message.warning("平台回传状态仅支持本地推线索")}},saveIntention:function(e,t){var n=arguments,a=this;return Object(l["a"])(regeneratorRuntime.mark((function i(){var l,s;return regeneratorRuntime.wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(l=n.length>2&&void 0!==n[2]?n[2]:{},!a.intentSaving){i.next=3;break}return i.abrupt("return",!1);case 3:return a.intentSaving=!0,i.prev=4,i.next=7,a.api.updateAdVremark(Object(r["a"])({userId:e.userId,advId:e.id,id:e.user_ad_adv_id,adVlabel:t},l));case 7:if(s=i.sent,s&&Number(s.affected)>0){i.next=11;break}return a.$message.warning("用户意向未保存，记录可能已发生变化，请刷新后重试"),i.abrupt("return",!1);case 11:return e.adVlabel=t,e.intentValueBefore=t,a.isLocalPushLead(e)&&a.intentionOption(t).state&&(s.callback&&"success"===s.callback.status?a.$message.success("用户意向已保存，本地推回传成功"):a.$message.warning("用户意向已保存，但本地推回传未成功；已记录日志，请联系管理员查看")),i.abrupt("return",!0);case 17:return i.prev=17,i.t0=i["catch"](4),e.adVlabel=e.intentValueBefore,i.abrupt("return",!1);case 21:return i.prev=21,a.intentSaving=!1,i.finish(21);case 24:case"end":return i.stop()}}),i,null,[[4,17,21,24]])})))()},submitInvalidIntent:function(){var e=this;return Object(l["a"])(regeneratorRuntime.mark((function t(){var n,a,i,l,s;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(n=e.pendingInvalidIntentRow,a=e.pendingInvalidIntentValue,n&&(3===a||10===a)&&!e.intentSaving){t.next=4;break}return t.abrupt("return");case 4:if(i=e.invalidIntentReasonCode,e.invalidIntentReasonGroups.some((function(e){return e.options.some((function(e){return e.value===i}))}))){t.next=8;break}return e.$message.warning("请选择平台支持的无效原因"),t.abrupt("return");case 8:return l=e.invalidIntentReasonMessage.trim(),t.next=11,e.saveIntention(n,a,Object(r["a"])({callbackReasonCode:i},"OTHER"===i&&l?{callbackReasonMessage:l}:{}));case 11:s=t.sent,s&&e.resetInvalidIntentDialog();case 13:case"end":return t.stop()}}),t)})))()},resetInvalidIntentDialog:function(){this.invalidIntentDialogVisible=!1,this.pendingInvalidIntentRow=null,this.pendingInvalidIntentValue=null,this.invalidIntentReasonCode="",this.invalidIntentReasonMessage=""},cancelInvalidIntent:function(e){this.intentSaving||(this.resetInvalidIntentDialog(),"function"===typeof e&&e())},onSubmit:function(){for(var e in this.listQuery.currentPage=1,this.listQuery)""!==this.listQuery[e]&&null!==this.listQuery[e]||(this.listQuery[e]=void 0);this.fetchData()}}},I=k,w=(n("2242"),n("2877")),x=Object(w["a"])(I,a,i,!1,null,null,null);t["default"]=x.exports},2:function(e,t){},2242:function(e,t,n){"use strict";var a=n("0ed9"),i=n.n(a);i.a},3:function(e,t){},"597d":function(e,t,n){},"776c":function(e,t,n){"use strict";var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"chat-text"},[e.messages.length?[n("div",{staticClass:"chat-text-summary"},[e._v("共 "+e._s(e.messages.length)+" 条对话")]),n("div",{staticClass:"chat-text-list"},e._l(e.messages,(function(t,a){return n("div",{key:a,staticClass:"chat-text-row",class:{"is-customer":t.isCustomer,"is-plain":!t.role}},[t.role?n("div",{staticClass:"chat-text-avatar"},[e._v(" "+e._s(t.avatar)+" ")]):e._e(),n("div",{staticClass:"chat-text-main"},[t.role?n("div",{staticClass:"chat-text-role"},[e._v(e._s(t.role))]):e._e(),t.time?n("div",{staticClass:"chat-text-time"},[e._v(e._s(t.time))]):e._e(),n("div",{staticClass:"chat-text-bubble"},[e._v(e._s(t.content))])])])})),0)]:n("pre",{staticClass:"chat-text-raw"},[e._v(e._s(e.plainText||"暂无内容"))])],2)},i=[],l=(n("4de4"),n("caad"),n("d81d"),n("fb6a"),n("a9e3"),n("f00c"),n("4d63"),n("ac1f"),n("25f0"),n("466d"),n("5319"),n("1276"),n("2ca0"),n("498a"),n("53ca")),r="客服|用户|客户|顾客|访客|系统|助手|医生|商家|平台|机器人|患者",s=["用户","客户","顾客","访客","患者"],o={name:"ChatText",props:{text:{type:[String,Number],default:""}},computed:{plainText:function(){var e=this.text;if(null===e||void 0===e)return"";if("string"===typeof e)return e;if("number"===typeof e||"boolean"===typeof e)return String(e);try{return JSON.stringify(e)}catch(t){return""}},messages:function(){var e=this.plainText.trim();if(!e)return[];if(e.startsWith("["))try{var t=JSON.parse(e);if(Array.isArray(t))return t.filter((function(e){return!(!e||"object"!==Object(l["a"])(e)||Array.isArray(e))&&("string"===typeof e.message&&e.message.trim()||"number"===typeof e.message&&Number.isFinite(e.message))})).map((function(e){var t="string"===typeof e.sayFrom?e.sayFrom.trim():"",n="string"===typeof e.msgTime||"number"===typeof e.msgTime?String(e.msgTime):"";return{role:t,content:String(e.message),time:n,isCustomer:s.includes(t),avatar:t?t.slice(0,1):""}}))}catch(c){}try{var n="(?:".concat(r,")"),a=e.replace(new RegExp("^[^,，:：]{0,10}[:：]\\s*(?=".concat(n,"\\s*[:：])")),"").trim();if(!a)return[];var i=new RegExp("(?:[,，]\\s*|\\s*\\n+\\s*)(?=".concat(n,"\\s*[:：])")),o=new RegExp("^(".concat(n,")\\s*[:：]\\s*([\\s\\S]*)$"));return a.split(i).map((function(e){return e.trim().replace(/^[,，\s]+|[,，\s]+$/g,"")})).filter(Boolean).map((function(e){var t=e.match(o),n=t?t[1]:"",a=(t?t[2]:e).trim();return{role:n,content:a.replace(/[;；]\s*/g,"\n"),isCustomer:s.includes(n),avatar:n?n.slice(0,1):""}})).filter((function(e){return e.content}))}catch(c){return[]}}}},c=o,u=(n("c71d"),n("2877")),d=Object(u["a"])(c,a,i,!1,null,null,null);t["a"]=d.exports},c71d:function(e,t,n){"use strict";var a=n("597d"),i=n.n(a);i.a},cd77:function(e,t,n){"use strict";n("99af"),n("d81d"),n("c19f"),n("d3b7"),n("25f0"),n("5cc6"),n("9a8c"),n("a975"),n("735e"),n("c1ac"),n("d139"),n("3a7b"),n("d5d6"),n("82f8"),n("e91f"),n("60bd"),n("5f96"),n("3280"),n("3fcc"),n("ca91"),n("25a1"),n("cd26"),n("3c5d"),n("2954"),n("649e"),n("219c"),n("170b"),n("b39a"),n("72f7");var a=n("1146"),i=n.n(a),l=n("21a6");function r(e,t){for(var n=t.map((function(e){return e.map((function(e){return null==e?{wch:10}:e.toString().charCodeAt(0)>255?{wch:2*e.toString().length}:{wch:e.toString().length}}))})),a=n[0],i=1;i<n.length;i++)for(var l=0;l<n[i].length;l++)a[l].wch<n[i][l].wch&&(a[l].wch=n[i][l].wch);e["!cols"]=a}function s(e,t){return t.map((function(t){return e.map((function(e){return t[e]}))}))}function o(e){for(var t=new ArrayBuffer(e.length),n=new Uint8Array(t),a=0;a!==e.length;++a)n[a]=255&e.charCodeAt(a);return t}function c(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.header,n=e.key,a=e.data,c=e.fileName,u=e.autoWidth,d=void 0===u||u,p=e.bookType,m=void 0===p?"xlsx":p,f=i.a.utils.book_new(),v=s(n,a);c=c||"excel-list",v.unshift(t);var h=i.a.utils.aoa_to_sheet(v);d&&r(h,v),i.a.utils.book_append_sheet(f,h,c);var b=i.a.write(f,{bookType:m,bookSST:!1,type:"binary"});Object(l["saveAs"])(new Blob([o(b)],{type:"application/octet-stream"}),"".concat(c,".").concat(m))}function u(e){var t,n=[],a=i.a.utils.decode_range(e["!ref"]),l=a.s.r;for(t=a.s.c;t<=a.e.c;++t){var r=e[i.a.utils.encode_cell({c:t,r:l})],s="UNKNOWN "+t;r&&r.t&&(s=i.a.utils.format_cell(r)),n.push(s)}return n}function d(e,t){var n=i.a.read(e,{type:t}),a=n.SheetNames[0],l=n.Sheets[a],r=u(l),s=i.a.utils.sheet_to_json(l);return{header:r,results:s}}t["a"]={exportDataToExcel:c,readDataFromExcel:d}}}]);