(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-680637a4"],{3497:function(t,e,a){"use strict";a.r(e);var s=function(){var t=this,e=t._self._c;return e("div",{staticClass:"box-content"},[e("div",{staticClass:"big-box",class:{shrink:t.dialogVisible}},[e("div",{staticClass:"center-top-box"},[e("div",{staticClass:"center-top-list"},[t._l(t.dataTopList,(function(s,i){return e("div",{key:i,staticClass:"center-items",class:t.centerActive===i?"acitem":"",on:{click:function(e){return t.centerClick(s,i)}}},[e("div",{staticClass:"items-box"},[t._v(t._s(s.dataBoardName))]),e("el-dropdown",{staticClass:"ml15",attrs:{trigger:"click"},nativeOn:{click:function(t){t.stopPropagation()}}},[t.centerActive===i?e("img",{staticClass:"icons pointer",attrs:{src:a("38d8"),alt:""}}):e("img",{staticClass:"icons pointer",attrs:{src:a("67a0"),alt:""}}),e("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[e("el-dropdown-item",{nativeOn:{click:function(e){return t.editTelemeterClick(s,i)}}},[t._v("重命名")]),e("el-dropdown-item",{nativeOn:{click:function(e){return t.deleteTelemeterClick(s)}}},[t._v("删除")])],1)],1)],1)})),e("div",{staticClass:"add-center",on:{click:function(e){return e.stopPropagation(),t.telemeterAdd()}}},[e("img",{staticStyle:{width:"20px",height:"20px"},attrs:{src:a("9b8d")}})])],2)]),e("div",{staticClass:"telemeter-box"},[e("div",{staticClass:"telemeter-left"},[e("el-tree",{ref:"leftTree",staticClass:"mt10",attrs:{"node-key":"webKey",data:t.leftTDList,"expand-on-click-node":!1,props:t.defaultLeftProps,"show-checkbox":"","empty-text":"暂无协议参数","default-checked-keys":t.checkedList,"default-expanded-keys":t.firstLevelKeys},on:{check:t.changeCheck,"check-change":t.leftHandleChange},scopedSlots:t._u([{key:"default",fn:function({node:a,data:s}){return e("span",{staticClass:"custom-tree-node"},[e("span",{staticClass:"mr10"},[a.level>2&&t.dataBoardType?e("el-color-picker",{attrs:{size:"mini"},on:{change:function(e){return t.changeColorOrLeftRight(s)}},model:{value:s.legendColor,callback:function(e){t.$set(s,"legendColor",e)},expression:"data.legendColor"}}):t._e()],1),e("span",{staticClass:"mr10"},[t._v(t._s(1==a.level?s.channelName:2==a.level?s.protocolName:s.parameter))]),a.level>2&&t.dataBoardType?e("span",{staticClass:"leftOrRight"},[e("el-tooltip",{staticClass:"item",attrs:{effect:"dark",content:"曲线图左y轴",placement:"top-start"}},[e("i",{staticClass:"el-icon-caret-left",style:{color:1==s.isLeftYaxis?s.legendColor:"#909399",fontSize:"24px",marginRight:"-9px"},on:{click:function(e){return t.changeLeftRight(1,s)}}})]),e("span",{staticClass:"line",style:{backgroundColor:s.legendColor}}),e("el-tooltip",{staticClass:"item",attrs:{effect:"dark",content:"曲线图右y轴",placement:"top-start"}},[e("i",{staticClass:"el-icon-caret-right",style:{color:0==s.isLeftYaxis?s.legendColor:"#909399",fontSize:"24px",marginLeft:"-14px"},on:{click:function(e){return t.changeLeftRight(0,s)}}})])],1):t._e()])}}])})],1),e("div",{staticClass:"telemeter-right"},[e("div",{staticClass:"fw-btn"},[e("el-button",{attrs:{type:"success"},on:{click:t.dataStatisticsClick}},[t._v("解析统计")]),2==t.dataBoardType||1==t.dataBoardType?e("el-button",{attrs:{type:"primary"},on:{click:t.updateFWClick}},[t._v("设置Y轴 ")]):t._e()],1),2==t.dataBoardType||1==t.dataBoardType?e("div",{class:2==t.dataBoardType?"line-box1":"line-box"},[e("div",{ref:"chartContainer",staticClass:"chart-container"})]):t._e(),2==t.dataBoardType||0==t.dataBoardType?e("el-table",{staticClass:"mt10",staticStyle:{width:"99%","border-radius":"10px"},attrs:{height:t.tableHeight,"header-cell-style":{fontWeight:400,background:"#F0F5FC",color:"#333333"},data:t.tableData,border:"",size:"mini"}},[e("el-table-column",{attrs:{prop:"name",label:"指标名称",width:"200","show-overflow-tooltip":""}}),e("el-table-column",{attrs:{prop:"sourceValue",label:"源数据",width:""},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(" "+t._s(e.row.sourceValue)+" ")]}}],null,!1,3586988395)}),e("el-table-column",{attrs:{prop:"phyValue",label:"物理解析值",width:""},scopedSlots:t._u([{key:"default",fn:function(a){return[a.row.phyValue&&t.numberPhyTypeList.includes(a.row.phyType)?e("span",[t._v(t._s(Number(a.row.phyValue).toFixed(3)))]):e("span",[t._v(t._s(a.row.phyValue?a.row.phyValue:""))])]}}],null,!1,1729430923)}),e("el-table-column",{attrs:{prop:"phyUnit",label:"物理单位",width:"100"}}),e("el-table-column",{attrs:{prop:"timePart",label:"时间",width:"200"}})],1):t._e()],1)])]),t.dialogVisible?e("div",{staticClass:"content-right2 mt10"},[e("div",{staticClass:"channel-box"},[e("div",{staticClass:"form-title dialog"},[e("p",{},[t._v(t._s(1==t.leftRight?"添加数据看板":2==t.leftRight?"设置Y轴范围":"重命名"))]),e("p",{staticClass:"pointer",on:{click:t.cancelClick}},[t._v("×")])]),1==t.leftRight?e("div",{},[e("div",{staticClass:"mt20"},[e("p",{staticClass:"right-form-name mb10"},[t._v("看板名称 ")]),e("el-input",{staticStyle:{width:"230px"},attrs:{placeholder:"请输入"},model:{value:t.kbForm.dataBoardName,callback:function(e){t.$set(t.kbForm,"dataBoardName",e)},expression:"kbForm.dataBoardName"}})],1),e("div",{staticClass:"mt15"},[e("p",{staticClass:"right-form-name"},[t._v("显示形式 ")]),e("el-radio-group",{model:{value:t.kbForm.dataBoardType,callback:function(e){t.$set(t.kbForm,"dataBoardType",e)},expression:"kbForm.dataBoardType"}},[e("el-radio",{attrs:{label:0}},[t._v("表格")]),e("el-radio",{attrs:{label:1}},[t._v("曲线")]),e("el-radio",{attrs:{label:2}},[t._v("表格和曲线")])],1)],1),e("div",{staticClass:"mt15"},[e("p",{staticClass:"right-form-name"},[t._v("数据通道 ")]),e("el-tree",{ref:"tree",attrs:{data:t.channelList,props:t.defaultProps,"show-checkbox":""},on:{check:t.handleCheck},scopedSlots:t._u([{key:"default",fn:function({node:a}){return[3==a.level?e("span",{staticClass:"tree-node-label"},[e("span",{staticClass:"label-text"},[t._v(t._s(a.label))])]):e("span",{},[t._v(t._s(a.label))])]}}],null,!1,719713948)})],1),e("div",{staticClass:"sure-btn"},[e("el-button",{on:{click:t.kbCancelClick}},[t._v("取 消")]),e("el-button",{attrs:{type:"primary"},on:{click:t.kbSure}},[t._v("确 定")])],1)]):t._e(),2==t.leftRight?e("div",{},[e("div",{staticClass:"mt15"},[e("p",{staticClass:"right-form-name"},[t._v("Y轴 ")]),e("el-radio-group",{model:{value:t.fwForm.leftOrRight,callback:function(e){t.$set(t.fwForm,"leftOrRight",e)},expression:"fwForm.leftOrRight"}},[e("el-radio",{attrs:{label:1}},[t._v("左侧Y轴")]),e("el-radio",{attrs:{label:2}},[t._v("右侧Y轴")])],1)],1),e("div",{staticClass:"mt20"},[e("p",{staticClass:"right-form-name mb10"},[t._v("最小值 ")]),e("el-input",{staticStyle:{width:"230px"},attrs:{placeholder:"请输入",type:"number"},model:{value:t.fwForm.min,callback:function(e){t.$set(t.fwForm,"min",t._n(e))},expression:"fwForm.min"}})],1),e("div",{staticClass:"mt20"},[e("p",{staticClass:"right-form-name mb10"},[t._v("最大值 ")]),e("el-input",{staticStyle:{width:"230px"},attrs:{placeholder:"请输入",type:"number"},model:{value:t.fwForm.max,callback:function(e){t.$set(t.fwForm,"max",t._n(e))},expression:"fwForm.max"}})],1),e("div",{staticClass:"sure-btn"},[e("el-button",{on:{click:t.cancelClick}},[t._v("取 消")]),e("el-button",{attrs:{type:"primary"},on:{click:t.fwSure}},[t._v("确 定")])],1)]):t._e(),3==t.leftRight?e("div",{},[e("div",{staticClass:"mt20"},[e("p",{staticClass:"right-form-name mb10"},[t._v("看板名称 ")]),e("el-input",{staticStyle:{width:"230px"},attrs:{placeholder:"请输入"},model:{value:t.kbForm.dataBoardName,callback:function(e){t.$set(t.kbForm,"dataBoardName",e)},expression:"kbForm.dataBoardName"}})],1),e("div",{staticClass:"sure-btn"},[e("el-button",{on:{click:t.kbCancelClick}},[t._v("取 消")]),e("el-button",{attrs:{type:"primary"},on:{click:t.kbEidtSure}},[t._v("确 定")])],1)]):t._e()])]):t._e(),e("el-dialog",{attrs:{title:"数据解析统计",visible:t.showChannelDataStatisticsDialog,width:"60%","before-close":t.channelDataStatisticsDialogClose},on:{"update:visible":function(e){t.showChannelDataStatisticsDialog=e}}},[e("div",[e("div",{staticClass:"center-top-box"},[e("div",{staticClass:"center-top-list"},t._l(t.channelDataStatisticsList,(function(a,s){return e("div",{key:a.channelId,staticClass:"center-items",class:t.channelDataStatisticsIndex===s?"acitem":"",on:{click:function(e){return t.channelDataStatisticsItemClick(a,s)}}},[e("div",{staticClass:"items-box"},[t._v(t._s(a.channelName))])])})),0)]),e("div",{staticStyle:{"margin-top":"15px",display:"flex","align-items":"center","justify-content":"space-between"}},[t.channelDataStatisticsList.length>0?e("div",{staticStyle:{color:"white"}},[t._v(" 累计已接收字节数:"+t._s(t.channelDataStatisticsList[t.channelDataStatisticsIndex].dataByteCount)+" ")]):t._e(),e("div",[e("el-button",{attrs:{type:"danger"},on:{click:t.dataStatisticsClearClick}},[t._v("清除统计")])],1)]),e("el-table",{staticStyle:{width:"100%","margin-top":"15px"},attrs:{data:t.protocolStatisticsList,height:"450"}},[e("el-table-column",{attrs:{type:"index",label:"序号",width:"60"}}),e("el-table-column",{attrs:{prop:"protocolName",label:"协议名称"}}),e("el-table-column",{attrs:{prop:"parseCount",label:"解析命中次数",width:"180"}})],1)],1)])],1)},i=[],n=(a("14d9"),a("e9f5"),a("910d"),a("7d54"),a("ab43"),a("1e70"),a("79a4"),a("c1a1"),a("8b00"),a("a4e7"),a("1e5a"),a("72c3"),a("f58c")),o=a("365c"),l=a("02c7"),c=a("e550"),r=a("0428"),h={components:{linechartEcharts:n["a"]},data(){return{connectionSymbol:r["a"],tableHeight:200,checkedList:[],dialogVisible:!1,leftRight:1,centerActive:0,defaultProps:{label:"label",children:"boardListVos"},defaultLeftProps:{label:"label",children:"children"},kbForm:{dataBoardName:"",dataBoardType:0,dataType:0},kbList:[],fwForm:{resource:1,leftOrRight:1},channelList:[],dataTopList:[],leftTDList:[],tableData:[],chart:null,leftData:[],dataBoardId:"",leftArr:[],timeArr:[],seriesData:[],websocket:null,reconnectTimer:null,reconnectInterval:3e3,maxReconnectAttempts:10,reconnectAttempts:0,message:"",connectionStatus:"未连接",dataBoardType:-1,tabsMap:new Map,channelMap:new Map,numberPhyTypeList:["int","float","double"],firstLevelKeys:[],channelDataStatisticsList:[],showChannelDataStatisticsDialog:!1,channelDataStatisticsIndex:0,protocolStatisticsList:[]}},mounted(){this.getTreeChannel(),this.getAllData(),window.addEventListener("resize",this.handleResize),c["a"].$on("protocolChanged",this.handleRefreshBoard)},beforeDestroy(){window.removeEventListener("resize",this.handleResize),c["a"].$off("protocolChanged"),this.chart&&this.chart.dispose(),this.clearReconnectTimer(),this.disconnect(!0)},watch:{dialogVisible(t){this.$nextTick(()=>{setTimeout(()=>{this.chart&&this.chart.resize()},300)})}},methods:{calcTableHeight(){0===this.dataBoardType?this.tableHeight=200:2===this.dataBoardType&&(this.tableHeight=window.innerHeight-160)},handleRefreshBoard(){this.getAllData()},changeColorOrLeftRight(t){Object(l["k"])({...t}).then(t=>{1==t.code&&this.getAllData(1)})},changeLeftRight(t,e){e.isLeftYaxis=t-0,Object(l["k"])({...e}).then(t=>{1==t.code&&this.getAllData(1)})},timestampToTime(t){10===t.toString().length&&(t*=1e3);const e=new Date(t),a=String(e.getHours()).padStart(2,"0"),s=String(e.getMinutes()).padStart(2,"0"),i=String(e.getSeconds()).padStart(2,"0"),n=String(e.getMilliseconds()).padStart(3,"0");return`${a}:${s}:${i}.${n}`},formatTimestamp(t){if(!t||t<0)return"";const e=10===String(t).length?1e3*t:t,a=new Date(e),s=a.getFullYear(),i=String(a.getMonth()+1).padStart(2,"0"),n=String(a.getDate()).padStart(2,"0"),o=String(a.getHours()).padStart(2,"0"),l=String(a.getMinutes()).padStart(2,"0"),c=String(a.getSeconds()).padStart(2,"0");String(a.getMilliseconds()).padStart(3,"0");return`${s}-${i}-${n} ${o}:${l}:${c}`},initChart(){this.chart=this.$echarts.init(this.$refs.chartContainer),this.chart.on("legendselectchanged",t=>{this.handleLegendClick(t)}),2!=this.dataBoardType&&1!=this.dataBoardType||this.$nextTick(()=>{this.updataCharts(!0)})},handleLegendClick(t){console.log(t,"params");let e=t.selected,a=[];for(const i in e)e.hasOwnProperty(i)&&!0===e[i]&&a.push(i);let s=this.tabsMap.get(this.dataTopList[this.centerActive].dataBoardId);s.checkedLeftList=a,this.tabsMap.set(this.dataTopList[this.centerActive].dataBoardId,s),this.$nextTick(()=>{this.$refs.leftTree.setCheckedKeys(a)})},updataCharts(t){if(!this.dataTopList||this.dataTopList.length<1)return;let e=this.tabsMap.get(this.dataTopList[this.centerActive].dataBoardId),a=e.minYAxisRight||null,s=e.maxYAxisRight||null,i=e.maxYAxisLeft||null,n=e.minYAxisLeft||null,o=e.perTabLeftTree,l=e.iconsList,c={};l.forEach(t=>{e.checkedLeftList.includes(t)?c[t]=!0:c[t]=!1});let r=e.colorsList,h=[],d=[],p=[];o.forEach(t=>{t.children&&t.children.length>0&&t.children.forEach(t=>{p=[...p,t.children];let e=this.channelMap.get(t.channelId+"#"+t.protocolId);e?(h=h.concat(e.timeArr),h=Array.from(new Set(h)),d=d.concat(e.seriesData)):(h=[],d=[])})});const m={color:r,tooltip:{trigger:"axis",axisPointer:{type:"cross",label:{backgroundColor:"#6a7985"}},formatter:function(t){let e=`