(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-7e03d6e6"],{"129f":function(e,t){e.exports=Object.is||function(e,t){return e===t?0!==e||1/e===1/t:e!=e&&t!=t}},"498a":function(e,t,a){"use strict";var l=a("23e7"),r=a("58a8").trim,s=a("c8d2");l({target:"String",proto:!0,forced:s("trim")},{trim:function(){return r(this)}})},5899:function(e,t){e.exports="\t\n\v\f\r                　\u2028\u2029\ufeff"},"58a8":function(e,t,a){var l=a("1d80"),r=a("5899"),s="["+r+"]",i=RegExp("^"+s+s+"*"),n=RegExp(s+s+"*$"),o=function(e){return function(t){var a=String(l(t));return 1&e&&(a=a.replace(i,"")),2&e&&(a=a.replace(n,"")),a}};e.exports={start:o(1),end:o(2),trim:o(3)}},"7db0":function(e,t,a){"use strict";var l=a("23e7"),r=a("b727").find,s=a("44d2"),i=a("ae40"),n="find",o=!0,u=i(n);n in[]&&Array(1)[n]((function(){o=!1})),l({target:"Array",proto:!0,forced:o||!u},{find:function(e){return r(this,e,arguments.length>1?arguments[1]:void 0)}}),s(n)},"7fe9":function(e,t,a){"use strict";a.r(t);var l=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"table-classic-wrapper system-log-page"},[a("Hints",[a("template",{slot:"hintName"},[e._v("系统日志")]),a("template",{slot:"hintInfo"},[e._v("结构化日志默认保留最近30天。")])],2),a("el-card",{attrs:{shadow:"always"}},[a("el-tabs",{on:{"tab-click":e.handleTabClick},model:{value:e.activeTab,callback:function(t){e.activeTab=t},expression:"activeTab"}},[a("el-tab-pane",{attrs:{label:"结构化日志",name:"structured"}},[a("el-form",{staticClass:"log-filter-form",attrs:{inline:!0,model:e.listQuery}},[a("el-form-item",{attrs:{label:"分类"}},[a("el-select",{attrs:{clearable:"",placeholder:"全部分类"},model:{value:e.listQuery.category,callback:function(t){e.$set(e.listQuery,"category",t)},expression:"listQuery.category"}},e._l(e.categories,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),a("el-form-item",{attrs:{label:"级别"}},[a("el-select",{attrs:{clearable:"",placeholder:"全部级别"},model:{value:e.listQuery.level,callback:function(t){e.$set(e.listQuery,"level",t)},expression:"listQuery.level"}},[a("el-option",{attrs:{label:"信息",value:"info"}}),a("el-option",{attrs:{label:"警告",value:"warn"}}),a("el-option",{attrs:{label:"错误",value:"error"}})],1)],1),a("el-form-item",{attrs:{label:"状态"}},[a("el-select",{attrs:{clearable:"",placeholder:"全部状态"},model:{value:e.listQuery.status,callback:function(t){e.$set(e.listQuery,"status",t)},expression:"listQuery.status"}},[a("el-option",{attrs:{label:"已接收",value:"received"}}),a("el-option",{attrs:{label:"成功",value:"success"}}),a("el-option",{attrs:{label:"失败",value:"failed"}})],1)],1),a("el-form-item",{attrs:{label:"时间"}},[a("el-date-picker",{staticClass:"log-datetime-range",attrs:{type:"datetimerange",format:"yyyy-MM-dd HH:mm:ss","value-format":"yyyy-MM-dd HH:mm:ss","default-time":["00:00:00","23:59:59"],"range-separator":"至","start-placeholder":"开始时间","end-placeholder":"结束时间"},model:{value:e.listQuery.time,callback:function(t){e.$set(e.listQuery,"time",t)},expression:"listQuery.time"}})],1),a("el-form-item",{attrs:{label:"来源"}},[a("el-select",{staticClass:"log-source-select",attrs:{clearable:"",filterable:"",placeholder:"全部来源"},model:{value:e.listQuery.source,callback:function(t){e.$set(e.listQuery,"source",t)},expression:"listQuery.source"}},e._l(e.sources,(function(t){return a("el-option",{key:t.value,attrs:{label:e.sourceLabel(t.value)+(t.count?" ("+t.count+")":""),value:t.value}})})),1)],1),a("el-form-item",[a("el-input",{attrs:{clearable:"",placeholder:"说明/事件/来源/广告主ID"},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.search(t)}},model:{value:e.listQuery.keyword,callback:function(t){e.$set(e.listQuery,"keyword",t)},expression:"listQuery.keyword"}})],1),a("el-form-item",{attrs:{label:"手机号精确查询"}},[a("el-input",{attrs:{type:"tel",clearable:"",maxlength:"20",placeholder:"11位大陆手机号，可带+86"},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.search(t)}},model:{value:e.listQuery.phone,callback:function(t){e.$set(e.listQuery,"phone",t)},expression:"listQuery.phone"}})],1),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:e.search}},[e._v("查询")]),a("el-button",{on:{click:e.reset}},[e._v("重置")])],1)],1),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],attrs:{data:e.logs,stripe:""}},[a("el-table-column",{attrs:{prop:"createdAt",label:"时间",width:"180"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(e.formatTime(t.row.createdAt)))]}}])}),a("el-table-column",{attrs:{prop:"category",label:"分类",width:"110"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(e.categoryLabel(t.row.category)))]}}])}),a("el-table-column",{attrs:{prop:"event",label:"事件",width:"150"}}),a("el-table-column",{attrs:{prop:"module",label:"来源",width:"140"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(e.sourceLabel(t.row.module)))]}}])}),a("el-table-column",{attrs:{prop:"status",label:"状态",width:"90"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-tag",{attrs:{size:"small",type:e.statusType(t.row.status)}},[e._v(e._s(e.statusLabel(t.row.status)))])]}}])}),a("el-table-column",{attrs:{prop:"advertiserId",label:"广告主ID","min-width":"140"}}),a("el-table-column",{attrs:{prop:"phone",label:"手机号",width:"120"}}),a("el-table-column",{attrs:{prop:"message",label:"说明","min-width":"260","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{label:"详情",width:"80",fixed:"right"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-button",{attrs:{type:"text"},on:{click:function(a){return e.showDetails(t.row)}}},[e._v("查看")])]}}])})],1),e.loading||e.logs.length?e._e():a("el-empty",{attrs:{description:"暂无日志"}}),a("el-pagination",{staticClass:"log-pagination",attrs:{"current-page":e.listQuery.page,"page-size":e.listQuery.pageSize,total:e.total,layout:"total, prev, pager, next"},on:{"current-change":e.handlePageChange}})],1),a("el-tab-pane",{attrs:{label:"系统错误日志",name:"system"}},[a("div",{staticClass:"raw-log-toolbar"},[a("div",[a("span",[e._v("查看 error 日志文件")]),a("el-date-picker",{staticClass:"raw-log-date",attrs:{type:"date","value-format":"yyyy-MM-dd",placeholder:"选择日期",clearable:"",size:"small"},model:{value:e.rawDate,callback:function(t){e.rawDate=t},expression:"rawDate"}})],1),a("el-button",{attrs:{size:"small",type:"primary",loading:e.rawLoading},on:{click:e.fetchRawLogs}},[e._v("刷新")])],1),a("pre",{directives:[{name:"loading",rawName:"v-loading",value:e.rawLoading,expression:"rawLoading"}],staticClass:"raw-log-content"},[e._v(e._s(e.rawLogs||"暂无系统错误日志"))])])],1)],1),a("el-dialog",{attrs:{title:"日志详情",visible:e.detailVisible,width:"620px"},on:{"update:visible":function(t){e.detailVisible=t}}},[e.currentLog?a("el-descriptions",{directives:[{name:"loading",rawName:"v-loading",value:e.detailLoading,expression:"detailLoading"}],attrs:{column:1,border:"",size:"small"}},[a("el-descriptions-item",{attrs:{label:"请求ID"}},[e._v(e._s(e.currentLog.requestId||"-"))]),a("el-descriptions-item",{attrs:{label:"来源/模块"}},[e._v(e._s(e.sourceLabel(e.currentLog.module)))]),a("el-descriptions-item",{attrs:{label:"错误码"}},[e._v(e._s(e.currentLog.errorCode||"-"))]),a("el-descriptions-item",{attrs:{label:"上下文"}},[a("pre",{staticClass:"log-context"},[e._v(e._s(e.detailLoading?"加载中...":e.formatContext(e.currentLog.context)))])])],1):e._e()],1)],1)},r=[],s=(a("7db0"),a("b0c0"),a("d3b7"),a("ac1f"),a("5319"),a("841c"),a("498a"),a("b522")),i={name:"SystemLogs",components:{Hints:s["a"]},data:function(){return{activeTab:"structured",loading:!1,rawLoading:!1,rawLogs:"",rawDate:"",logs:[],sources:[],total:0,detailVisible:!1,detailLoading:!1,currentLog:null,categories:[{value:"kuaishou",label:"快手"},{value:"youju",label:"营客AI"},{value:"wechat",label:"公众号"},{value:"ad-pull",label:"线索接入/拉取"},{value:"clue-pull",label:"地推授权管理"},{value:"auth",label:"认证"},{value:"upload",label:"上传"}],listQuery:{category:"",level:"",status:"",source:"",keyword:"",phone:"",time:[],page:1,pageSize:20}}},created:function(){this.fetchData(),this.fetchSources()},methods:{handleTabClick:function(e){"system"===e.name?this.fetchRawLogs():this.fetchData()},fetchRawLogs:function(){var e=this;this.rawLoading=!0,this.api.appLogs({date:this.rawDate}).then((function(t){e.rawLogs=t||""})).catch((function(){e.rawLogs=""})).finally((function(){e.rawLoading=!1}))},fetchData:function(){var e=this,t=(this.listQuery.phone||"").trim(),a=t.replace(/[\s-]/g,"").replace(/^\+86/,"");if(!t||/^1[3-9]\d{9}$/.test(a)){var l=(this.listQuery.keyword||"").replace(/[\s-]/g,"");if(a||!/^(?:\+86)?1[3-9]\d{9}$/.test(l)){this.listQuery.phone=a,this.loading=!0;var r={category:this.listQuery.category,level:this.listQuery.level,status:this.listQuery.status,source:this.listQuery.source,keyword:this.listQuery.keyword,startTime:this.listQuery.time&&this.listQuery.time[0],endTime:this.listQuery.time&&this.listQuery.time[1],page:this.listQuery.page,pageSize:this.listQuery.pageSize},s=a?this.api.systemLogsByPhone(Object.assign({},r,{phone:a})):this.api.systemLogs(r);s.then((function(t){e.logs=t.list||[],e.total=t.total||0})).catch((function(){e.logs=[],e.total=0})).finally((function(){e.loading=!1}))}else this.$message.warning("手机号请填写在“手机号精确查询”字段中")}else this.$message.warning("请输入有效的11位大陆手机号，可带+86前缀")},search:function(){this.listQuery.page=1,this.fetchData()},fetchSources:function(){var e=this;this.api.systemLogSources().then((function(t){e.sources=t||[]})).catch((function(){e.sources=[]}))},sourceLabel:function(e){var t={add:"通用推送(/ad/add)",addall:"通用推送(/ad/addall)",add2:"H5表单(/ad/add2)",easybc:"easybc推送",jy91:"JY91",youju:"营客AI",localPush:"本地推推送","clue-callback":"线索回调(/ad/clue)","oceanengine-scheduled-pull":"巨量本地推(定时)","oceanengine-scheduled-pull-http-error":"巨量本地推(定时)","oceanengine-scheduled-pull-parse-error":"巨量本地推(定时)","external-lead":"旧记录(未标注来源)"};return t[e]||e||"-"},reset:function(){this.listQuery.category="",this.listQuery.level="",this.listQuery.status="",this.listQuery.source="",this.listQuery.keyword="",this.listQuery.phone="",this.listQuery.time=[],this.search()},handlePageChange:function(e){this.listQuery.page=e,this.fetchData()},showDetails:function(e){var t=this;this.currentLog=e,this.detailVisible=!0,this.detailLoading=!0,this.api.systemLogDetail(e.id).then((function(a){if(!a)throw new Error("日志不存在");t.currentLog&&t.currentLog.id===e.id&&(t.currentLog=a)})).catch((function(){t.currentLog&&t.currentLog.id===e.id&&(t.detailVisible=!1,t.$message.error("日志详情加载失败"))})).finally((function(){t.currentLog&&t.currentLog.id===e.id&&(t.detailLoading=!1)}))},categoryLabel:function(e){var t=this.categories.find((function(t){return t.value===e}));return t?t.label:e},statusLabel:function(e){return{received:"已接收",processing:"已接收",success:"成功",failed:"失败"}[e]||e},statusType:function(e){return{received:"info",processing:"info",success:"success",failed:"danger"}[e]||"info"},formatTime:function(e){return e?new Date(e).toLocaleString():"-"},formatContext:function(e){return e?JSON.stringify(e,null,2):"-"}}},n=i,o=(a("8b50"),a("2877")),u=Object(o["a"])(n,l,r,!1,null,"25af813b",null);t["default"]=u.exports},"841c":function(e,t,a){"use strict";var l=a("d784"),r=a("825a"),s=a("1d80"),i=a("129f"),n=a("14c3");l("search",1,(function(e,t,a){return[function(t){var a=s(this),l=void 0==t?void 0:t[e];return void 0!==l?l.call(t,a):new RegExp(t)[e](String(a))},function(e){var l=a(t,e,this);if(l.done)return l.value;var s=r(e),o=String(this),u=s.lastIndex;i(u,0)||(s.lastIndex=0);var c=n(s,o);return i(s.lastIndex,u)||(s.lastIndex=u),null===c?-1:c.index}]}))},"8b50":function(e,t,a){"use strict";var l=a("8ece"),r=a.n(l);r.a},"8ece":function(e,t,a){},c8d2:function(e,t,a){var l=a("d039"),r=a("5899"),s="​᠎";e.exports=function(e){return l((function(){return!!r[e]()||s[e]()!=s||r[e].name!==e}))}}}]);