bi/views/dist/static/js/chunk-317d8536.e264b276.js
2025-05-22 16:27:39 +08:00

1 line
12 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-317d8536"],{"1ff1":function(t,e,i){"use strict";i("34bd")},"34bd":function(t,e,i){},a73f:function(t,e,i){"use strict";i.r(e);var n=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",[i("el-card",{staticClass:"box-card"},[i("div",{staticStyle:{height:"50px","line-height":"50px",display:"flex","align-items":"center","justify-content":"left"}},[i("a-tooltip",{staticStyle:{cursor:"pointer"},attrs:{placement:"right"}},[i("template",{slot:"title"},[i("span",[t._v("添加distinctId为白名单仅适用于客户端SDK并开启Debug模式。设备ID可通过查看客户端日志获取。该模式的作用及使用过程请参考官网文档对应SDK页面中的Debug模式说明部分。")])]),t._v(" "),i("span",{staticClass:"title_xwl",staticStyle:{color:"#202d3f"}},[t._v("Debug模式 "),i("a-icon",{attrs:{type:"question-circle"}})],1)],2)],1),t._v(" "),i("div",{staticStyle:{height:"60px","line-height":"50px",display:"flex","align-items":"center","justify-content":"space-between","border-bottom":"1px solid #f0f2f5"}},[i("div",[i("a-button",{on:{click:t.openDeviceDialog}},[t._v("查看distinctId列表")]),t._v(" "),""!=t.linkedID?[i("el-tag",[t._v(t._s(t.linkedID))]),t._v(" "),i("el-button",{attrs:{type:"warning",size:"mini"},on:{click:t.closeWs}},[t._v("关闭连接")])]:t._e()],2),t._v(" "),i("div",[i("a-input-search",{staticStyle:{width:"200px"},attrs:{"allow-clear":"",placeholder:"请输入搜索如distinctId,事件名..."},on:{change:t.search},model:{value:t.input,callback:function(e){t.input=e},expression:"input"}})],1)]),t._v(" "),t.showList?i("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.connectLoading,expression:"connectLoading"}],staticStyle:{width:"100%"},attrs:{border:"",data:t.filterList,stripe:""}},[i("el-table-column",{attrs:{prop:"report_time",label:"上报时间",align:"center",width:"150"}}),t._v(" "),i("el-table-column",{attrs:{prop:"data_name",label:"\t数据名称",align:"center",width:"100"}}),t._v(" "),i("el-table-column",{attrs:{label:"数据判断",width:"200",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[i("el-tag",{attrs:{type:void 0==e.row.error_reason?"success":"danger"}},[t._v("\n "+t._s(e.row.data_judge)+"\n ")])]}}],null,!1,3386529306)}),t._v(" "),i("el-table-column",{attrs:{prop:"error_reason",label:"错误原因",align:"center",width:"200"}}),t._v(" "),i("el-table-column",{attrs:{label:"数据明细",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[e.row.isFormatData?i("div",[i("json-editor",{staticClass:"req-body",attrs:{"font-size":"15",height:"400",styles:"width: 100%",read:!0,title:"上报数据"},model:{value:e.row.dataFormat,callback:function(i){t.$set(e.row,"dataFormat",i)},expression:"scope.row.dataFormat"}}),t._v(" "),i("a-tooltip",{staticStyle:{cursor:"pointer"},attrs:{placement:"right"}},[i("template",{slot:"title"},[i("span",[t._v("还原数据")])]),t._v(" "),i("a-button",{staticStyle:{color:"red"},attrs:{type:"link",icon:"eye-invisible"},on:{click:function(i){return t.lookData(e.row.index,!1)}}})],2)],1):i("div",[t._v("\n "+t._s(e.row.report_data)+"\n "),i("a-tooltip",{staticStyle:{cursor:"pointer"},attrs:{placement:"right"}},[i("template",{slot:"title"},[i("span",[t._v("格式化数据")])]),t._v(" "),i("a-button",{attrs:{type:"link",icon:"eye"},on:{click:function(i){return t.lookData(e.row.index,!0)}}})],2)],1)]}}],null,!1,893218954)})],1):t._e(),t._v(" "),t.pageshow?i("el-pagination",{staticClass:"pagination-container",attrs:{"current-page":t.page,"page-sizes":[5,10,20,30,50,100,150,200,500,1e3],"page-size":t.limit,layout:"total, sizes, prev, pager, next, jumper",total:t.total},on:{"size-change":t.handleSizeChange,"current-change":t.handlePageChange}}):t._e(),t._v(" "),t.dialogVisible?i("el-dialog",{attrs:{width:"80%",visible:t.dialogVisible,title:"测试distinctId管理"},on:{"update:visible":function(e){t.dialogVisible=e},close:function(e){t.dialogVisible=!1}}},[i("el-card",{staticClass:"app-container"},[i("div",{staticClass:"filter-container"},[i("el-tag",{staticClass:"filter-item"},[t._v("distinctId:")]),t._v(" "),i("el-input",{staticClass:"filter-item",staticStyle:{width:"300px"},attrs:{placeholder:"请输入distinctId"},model:{value:t.deviceId,callback:function(e){t.deviceId=e},expression:"deviceId"}}),t._v(" "),i("el-tag",{staticClass:"filter-item"},[t._v("备注:")]),t._v(" "),i("el-input",{staticClass:"filter-item",staticStyle:{width:"200px"},attrs:{placeholder:"请输入备注"},model:{value:t.remark,callback:function(e){t.remark=e},expression:"remark"}}),t._v(" "),i("el-button",{staticClass:"filter-item",attrs:{type:"primary"},on:{click:t.addDeviceId}},[t._v("添加")])],1),t._v(" "),t.showDebugDeviceList?i("el-table",{staticStyle:{width:"100%"},attrs:{border:"",data:t.debugDeviceList,stripe:""}},[i("el-table-column",{attrs:{label:"测试distinctId",align:"center",width:"300"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.device_id)+"\n ")]}}],null,!1,2635645463)}),t._v(" "),i("el-table-column",{attrs:{label:"备注",align:"center",width:"200"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.remark)+"\n ")]}}],null,!1,1361841247)}),t._v(" "),i("el-table-column",{attrs:{label:"创建时间",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.create_time)+"\n ")]}}],null,!1,3071027507)}),t._v(" "),i("el-table-column",{attrs:{fixed:"right",label:"操作",width:"450",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[e.row.device_id!=t.linkedID?i("el-button",{attrs:{size:"mini",type:"success",icon:"el-icon-link"},on:{click:function(i){return t.initWs(e.row.device_id)}}},[t._v("连接设备\n ")]):i("el-button",{attrs:{size:"mini",type:"warning",icon:"el-icon-link"},on:{click:function(e){return t.closeWs()}}},[t._v("断开连接")]),t._v(" "),i("el-button",{attrs:{size:"mini",type:"danger",icon:"el-icon-close"},on:{click:function(i){return t.delteDeviceId(e.row.device_id)}}},[t._v("\n 删除\n ")])]}}],null,!1,243830904)})],1):t._e()],1)],1):t._e()],1)],1)},s=[],a=i("c80c"),r=(i("96cf"),i("3b8d")),o=(i("386d"),i("a481"),i("e817")),c=i("cc06"),l=i("5f87"),u={name:"Track",components:{JsonEditor:function(){return Promise.all([i.e("chunk-16372f25"),i.e("chunk-1303a6c7")]).then(i.bind(null,"fa7e"))}},data:function(){return{showList:!0,showDebugDeviceList:!0,dialogVisible:!1,input:"",connectLoading:!1,time:null,total:0,limit:10,page:1,pageshow:!0,list:[],trueList:[],debugDeviceList:[],deviceId:"",remark:"",linkedID:"",socket:null}},computed:{filterList:function(){var t=this.list.slice((this.page-1)*this.limit,this.page*this.limit);return this.refreshPage(),t},path:function(){var t="";return""==t?"ws://"+window.location.host+"/ws":t.replace("http","ws")+"/ws"}},mounted:function(){this.search()},destroyed:function(){this.closeWs()},methods:{lookData:function(t,e){for(var i in this.list)this.list[i].index==t&&(this.list[i].isFormatData=e)},delteDeviceId:function(){var t=Object(r["a"])(Object(a["a"])().mark((function t(e){var i;return Object(a["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(o["c"])({appid:this.$store.state.baseData.EsConnectID,deviceID:e});case 2:if(i=t.sent,0==i.code){t.next=8;break}return this.$message({showClose:!0,offset:60,type:"error",message:i.msg}),t.abrupt("return");case 8:return this.$message({showClose:!0,offset:60,type:"success",message:i.msg}),t.next=11,this.deviceList();case 11:""!=linkedID&&e==linkedID&&this.closeWs();case 12:case"end":return t.stop()}}),t,this)})));function e(e){return t.apply(this,arguments)}return e}(),addDeviceId:function(){var t=Object(r["a"])(Object(a["a"])().mark((function t(){var e;return Object(a["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(o["a"])({appid:this.$store.state.baseData.EsConnectID,deviceID:this.deviceId,remark:this.remark});case 2:if(e=t.sent,0==e.code){t.next=8;break}return this.$message({showClose:!0,offset:60,type:"error",message:e.msg}),t.abrupt("return");case 8:return this.$message({showClose:!0,offset:60,type:"success",message:e.msg}),t.next=11,this.deviceList();case 11:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}(),openDeviceDialog:function(){var t=Object(r["a"])(Object(a["a"])().mark((function t(){return Object(a["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,this.deviceList();case 2:this.deviceId="",this.remark="",this.dialogVisible=!0;case 5:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}(),deviceList:function(){var t=Object(r["a"])(Object(a["a"])().mark((function t(){var e,i;return Object(a["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return this.connectLoading=!0,t.next=3,Object(o["b"])({appid:this.$store.state.baseData.EsConnectID});case 3:if(e=t.sent,this.connectLoading=!1,0==e.code){t.next=8;break}return this.$message({showClose:!0,offset:60,type:"error",message:e.msg}),t.abrupt("return");case 8:i=e.data.list,this.debugDeviceList=[],null!=i&&(this.debugDeviceList=i);case 11:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}(),handleSizeChange:function(t){this.limit=t,this.refreshPage()},handlePageChange:function(t){this.page=t,this.refreshPage()},refreshPage:function(){var t=this;this.pageshow=!1,this.total=this.list.length,this.$nextTick((function(){t.pageshow=!0}))},closeWs:function(){var t=this;null!=this.socket&&(this.socket.close(),this.socket=null),this.linkedID="",this.list=[],this.showDebugDeviceList=!1,this.showList=!1,this.$nextTick((function(){t.showDebugDeviceList=!0,t.showList=!0}))},initWs:function(t){var e=this;this.closeWs(),""!=this.linkedID&&t!=this.linkedID&&(this.list=[]),"undefined"===typeof WebSocket?this.$message({showClose:!0,offset:60,type:"error",message:"您的浏览器不支持socket"}):(this.socket=new WebSocket(this.path),this.socket.onopen=function(){e.send(JSON.stringify({uuid:t,token:Object(l["a"])()})),e.$message({showClose:!0,offset:60,type:"success",message:"socket连接成功"})},this.socket.onerror=function(t){console.log("onerror",t),e.$message({showClose:!0,offset:60,type:"error",message:"socket连接失败"})},this.socket.onmessage=function(t){var i=JSON.parse(t.data);if(1==i.code){var n=JSON.parse(i.data);n["isFormatData"]=!1,n["index"]=e.list.length,n["dataFormat"]=JSON.stringify(JSON.parse(n["report_data"]),null,"\t"),e.list.unshift(n),e.search()}},this.socket.onclose=function(i){1006==i.code&&setTimeout((function(){console.log("进行重连"),e.initWs(t)}),2e3),console.log("socket已经关闭")},this.linkedID=t)},send:function(t){this.socket.send(t)},search:function(){var t=Object(r["a"])(Object(a["a"])().mark((function t(){var e;return Object(a["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:e=Object(c["a"])(this.list,this.input.trim()),this.list=e;case 2:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}()}},d=u,h=(i("1ff1"),i("2877")),p=Object(h["a"])(d,n,s,!1,null,"df1345e4",null);e["default"]=p.exports},cc06:function(t,e,i){"use strict";i.d(e,"a",(function(){return n}));i("4917"),i("ac6a"),i("456d");function n(t,e){var i,n=e.toLowerCase(),s=t;return i=n?s.filter((function(t){return Object.keys(t).some((function(e){return String(t[e]).toLowerCase().match(n)}))})):s,i}},e817:function(t,e,i){"use strict";i.d(e,"g",(function(){return a})),i.d(e,"f",(function(){return r})),i.d(e,"e",(function(){return o})),i.d(e,"h",(function(){return c})),i.d(e,"d",(function(){return l})),i.d(e,"c",(function(){return u})),i.d(e,"b",(function(){return d})),i.d(e,"a",(function(){return h}));var n=i("b775"),s="/api/realdata/";function a(t){return Object(n["a"])({url:s+"List",method:"post",data:t})}function r(t){return Object(n["a"])({url:s+"FailDataList",method:"post",data:t})}function o(t){return Object(n["a"])({url:s+"FailDataDesc",method:"post",data:t})}function c(t){return Object(n["a"])({url:s+"ReportCount",method:"post",data:t})}function l(t){return Object(n["a"])({url:s+"EventFailDesc",method:"post",data:t})}function u(t){return Object(n["a"])({url:s+"DelDebugDeviceID",method:"post",data:t})}function d(t){return Object(n["a"])({url:s+"DebugDeviceIDList",method:"post",data:t})}function h(t){return Object(n["a"])({url:s+"AddDebugDeviceID",method:"post",data:t})}}}]);