(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-8a5550be"],{"0aa2":function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAYAAAA71pVKAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAADmSURBVCiRpc69SgNBFIbhd8borARBUEkEWzsREW/IRkxhHY0SDotCthK2kFh4Q1YpxELBgDaCFv5Es4nsjI0IppqDX3eKl+fAP2YARCTB1erR1Sh5FNkujIhUbFK/B5bjzfDki4UVOxhUnS4EMEvOPVcNQNo5b0FYVdT99v5uqgMnfYDjrLvlfViLjazl+qjZuDR5nruXz5l3YFqBlr4o5+3tz6F8uPx9W07O1q01m7Gp91M9Odzp6cBJHyDtdE+BjegqhKv2QWPPZNnF3Ch8vWnVip9dtMPhwwdwo2zvxuP+qxb8s283uEdmKy96OQAAAABJRU5ErkJggg=="},"2e76":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("p",{staticClass:"items-box"},[t._v(t._s(s.dataBoardName))]),e("el-dropdown",{staticClass:"ml15",attrs:{trigger:"click"},nativeOn:{click:function(t){t.stopPropagation()}}},[e("img",{staticClass:"icons pointer",attrs:{src:a("0aa2"),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:{"default-expanded-keys":t.firstLevelKeys,"node-key":"webKey",data:t.leftTDList,"expand-on-click-node":!1,props:t.defaultLeftProps,"show-checkbox":"","default-checked-keys":t.checkedList},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",[e("el-form",{staticClass:"form-top",attrs:{model:t.modelForm,size:"small",inline:!0}},[e("el-form-item",{attrs:{label:"时间范围"}},[e("el-date-picker",{staticStyle:{width:"350px"},attrs:{clearable:"",type:"datetimerange","value-format":"yyyy-MM-dd HH:mm:ss","range-separator":"至","start-placeholder":"开始日期","end-placeholder":"结束日期"},on:{change:t.timeChange},model:{value:t.modelForm.value,callback:function(e){t.$set(t.modelForm,"value",e)},expression:"modelForm.value"}})],1),e("el-form-item",{attrs:{label:"每秒数据量"}},[e("el-select",{staticStyle:{width:"80px"},attrs:{placeholder:"请选择"},on:{change:t.changedataNum},model:{value:t.modelForm.dataNum,callback:function(e){t.$set(t.modelForm,"dataNum",e)},expression:"modelForm.dataNum"}},t._l(t.dataSize,(function(t){return e("el-option",{key:t.label,attrs:{label:t.label,value:t.value}})})),1)],1),e("el-form-item",{attrs:{label:"回放速度"}},[e("el-select",{staticStyle:{width:"80px"},attrs:{placeholder:"请选择"},on:{change:t.changeUpdateDataForm},model:{value:t.modelForm.speed,callback:function(e){t.$set(t.modelForm,"speed",e)},expression:"modelForm.speed"}},t._l(t.playbackSpeed,(function(t){return e("el-option",{key:t.label,attrs:{label:t.label,value:t.value}})})),1)],1),e("el-form-item",[t.isStartPayBack?e("el-button",{attrs:{type:"danger",size:"small"},on:{click:t.isEnd}},[t._v("停止回放 ")]):e("el-button",{attrs:{type:"success",size:"small"},on:{click:t.isStart}},[t._v("开始回放")]),e("el-button",{attrs:{type:"primary",size:"small"},on:{click:t.updateFWClick}},[t._v("设置Y轴")]),e("el-dropdown",{staticClass:"ml10",attrs:{trigger:"click"},nativeOn:{click:function(t){t.stopPropagation()}}},[e("el-button",{attrs:{type:"warning",size:"small"}},[t._v("导出数据")]),e("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[e("el-dropdown-item",{nativeOn:{click:function(e){return t.exportDataReplay(1)}}},[t._v("解析数据")]),e("el-dropdown-item",{nativeOn:{click:function(e){return t.exportDataReplay(2)}}},[t._v("原数据")]),e("el-dropdown-item",{nativeOn:{click:function(e){return t.exportHistory()}}},[t._v("导出历史")])],1)],1),e("el-button",{staticClass:"ml10",attrs:{type:"danger",size:"small"},on:{click:t.deleteDataReplay}},[t._v("清除数据 ")])],1)],1)],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:""}}),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&&!isNaN(a.row.phyValue)&&"number"===typeof Number(a.row.phyValue)?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,2557657020)}),e("el-table-column",{attrs:{prop:"phyUnit",label:"物理单位",width:""}}),e("el-table-column",{attrs:{prop:"timePart",label:"时间",width:""}})],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(),4==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.dataNum,callback:function(e){t.dataNum=t._n(e)},expression:"dataNum"}})],1),e("div",{staticClass:"sure-btn"},[e("el-button",{on:{click:t.dataNumCancelClick}},[t._v("取 消")]),e("el-button",{attrs:{type:"primary"},on:{click:t.dataNumEidtSure}},[t._v("确 定")])],1)]):t._e()])]):t._e(),e("el-dialog",{attrs:{title:"导出历史",visible:t.showHistory,width:"70%"},on:{"update:visible":function(e){t.showHistory=e}}},[e("el-table",{staticStyle:{"border-radius":"10px"},attrs:{data:t.historyData}},[e("el-table-column",{attrs:{property:"createTime",label:"操作时间",width:"170px"},scopedSlots:t._u([{key:"default",fn:function(a){return[e("p",[t._v(t._s(t.dateFormat(a.row.createTime,"yyyy-MM-dd HH:mm:ss")))])]}}])}),e("el-table-column",{attrs:{property:"startTime",label:"查询起始时间",width:"170px"},scopedSlots:t._u([{key:"default",fn:function(a){return[e("p",[t._v(t._s(t.dateFormat(a.row.startTime,"yyyy-MM-dd HH:mm:ss")))])]}}])}),e("el-table-column",{attrs:{property:"endTime",label:"查询起始时间",width:"170px"},scopedSlots:t._u([{key:"default",fn:function(a){return[e("p",[t._v(t._s(t.dateFormat(a.row.endTime,"yyyy-MM-dd HH:mm:ss")))])]}}])}),e("el-table-column",{attrs:{property:"channelName",label:"通道"}}),e("el-table-column",{attrs:{property:"protocolName",label:"协议"}}),e("el-table-column",{attrs:{property:"type",label:"数据类型"},scopedSlots:t._u([{key:"default",fn:function(a){return[e("p",[t._v(t._s(1===a.row.type?"解析数据":"原始数据"))])]}}])}),e("el-table-column",{attrs:{label:"文件路径",width:"90px"},scopedSlots:t._u([{key:"default",fn:function(a){return[e("a",{directives:[{name:"show",rawName:"v-show",value:2===a.row.state,expression:"scope.row.state === 2"}],staticClass:"cp",attrs:{href:"/universaltestsoftware_client_api/api/dataBoard/fileDownLoad?filePath="+encodeURIComponent(a.row.downloadUrl),download:a.row.downloadUrl}},[t._v("点击下载")])]}}])}),e("el-table-column",{attrs:{property:"address",label:"状态",width:"90px"},scopedSlots:t._u([{key:"default",fn:function(a){return[e("span",{class:2===a.row.state?"green":-1===a.row.state?"red":"warning"},[t._v(t._s(2===a.row.state?"生成成功":-1===a.row.state?"生成失败":"生成中"))])]}}])})],1)],1)],1)},i=[],l=(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"),r=a("02c7"),n=a("e550"),c=a("0428"),d={components:{linechartEcharts:l["a"]},data(){return{connectionSymbol:c["a"],tableHeight:200,checkedList:[],dialogVisible:!1,leftRight:1,centerActive:0,defaultProps:{label:"label",children:"boardListVos"},defaultLeftProps:{label:"label",children:"children"},kbForm:{dataBoardName:"",dataBoardType:1,dataType:1},kbList:[],modelForm:{startTime:"",endTime:"",value:[],dataNum:1,speed:1},isStartPayBack:!1,dataSize:[{label:"1条",value:1},{label:"2条",value:2},{label:"3条",value:3},{label:"4条",value:4},{label:"5条",value:5},{label:"6条",value:6},{label:"7条",value:7},{label:"8条",value:8},{label:"9条",value:9},{label:"10条",value:10}],dataNum:null,playbackSpeed:[{label:"1×",value:1},{label:"2x",value:2},{label:"4x",value:4},{label:"8x",value:8},{label:"16x",value:16},{label:"32x",value:32}],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,firstLevelKeys:[],showHistory:!1,historyData:[]}},mounted(){this.getTreeChannel(),this.getAllData(),window.addEventListener("resize",this.handleResize),n["a"].$on("protocolChanged",this.handleRefreshBoard)},beforeDestroy(){window.removeEventListener("resize",this.handleResize),n["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:{exportHistory(){Object(r["d"])({current:1}).then(t=>{if(1===t.code){let e=t.data||{};this.historyData=e.records||[]}}),this.showHistory=!0},dateFormat(t,e){let a=new Date(t);if(!t)return"";e||(e="yyyy-MM-dd HH:mm:ss");let s=function(t){return(t<10?"0":"")+t};return e.replace(/yyyy|MM|dd|HH|mm|ss/g,(function(t){switch(t){case"yyyy":return s(a.getFullYear());case"MM":return s(a.getMonth()+1);case"mm":return s(a.getMinutes());case"dd":return s(a.getDate());case"HH":return s(a.getHours());case"ss":return s(a.getSeconds())}}))},handleRefreshBoard(){this.getAllData()},deleteDataReplay(){this.modelForm.startTime?this.modelForm.endTime?Object(r["a"])({...this.modelForm,dataBoardId:this.dataTopList[this.centerActive].dataBoardId}).then(t=>{1==t.code&&this.$message.success("删除成功")}):this.$message.error("请选择结束时间"):this.$message.error("请选择开始时间")},exportDataReplay(t){if(!this.modelForm.startTime)return void this.$message.error("请选择开始时间");if(!this.modelForm.endTime)return void this.$message.error("请选择结束时间");if(this.checkedList.length<1)return void this.$message.error(1===t?"请选择字段":"请选择通道");let e=[];e=this.getProtocolIds(),e=e.filter(t=>t);let a=[];a=this.checkedList.map(t=>{let e="";return t.includes(this.connectionSymbol)&&(e=t.split(this.connectionSymbol)[t.split(this.connectionSymbol).length-1]),e}),a=a.filter(t=>t),Object(r["c"])({...this.modelForm,dataBoardId:this.dataTopList[this.centerActive].dataBoardId,param:[...a],exportType:t,protocolIds:[...e]}).then(t=>{1==t.code&&this.$message.info("后台下载中,可在“导出历史”中查看及下载")})},getProtocolIds(){let t=[],e=this.tabsMap.get(this.dataTopList[this.centerActive].dataBoardId),a=e.perTabLeftTree;return this.checkedList.forEach(e=>{if(e.includes(this.connectionSymbol)){let s=e.split(this.connectionSymbol)[0],i=this.getProtocolId(s,a);t.push(i)}}),[...t]},getProtocolId(t,e){let a="";return e.forEach(e=>{e.children.forEach(e=>{e.protocolName==t&&(a=e.protocolId)})}),a},calcTableHeight(){0===this.dataBoardType?this.tableHeight=200:2===this.dataBoardType&&(this.tableHeight=window.innerHeight-160)},changeColorOrLeftRight(t){Object(r["k"])({...t}).then(t=>{1==t.code&&this.getAllData(1)})},changeLeftRight(t,e){e.isLeftYaxis=t-0,Object(r["k"])({...e}).then(t=>{1==t.code&&this.getAllData(1)})},timestampToTime(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"),l=String(a.getDate()).padStart(2,"0"),o=String(a.getHours()).padStart(2,"0"),r=String(a.getMinutes()).padStart(2,"0"),n=String(a.getSeconds()).padStart(2,"0");return`${s}-${i}-${l} ${o}:${r}:${n}`},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,l=e.minYAxisLeft||null,o=e.perTabLeftTree,r=e.iconsList,n=e.colorsList,c=[],d=[],h=[];o.forEach(t=>{t.children&&t.children.length>0&&t.children.forEach(t=>{h=[...h,t.children];let e=this.channelMap.get(t.channelId+"#"+this.dataTopList[this.centerActive].dataBoardId+"#"+t.protocolId);e?(c=c.concat(e.timeArr),c=Array.from(new Set(c)),d=d.concat(e.seriesData)):(c=[],d=[])})});const m={color:n,tooltip:{trigger:"axis",axisPointer:{type:"cross",label:{backgroundColor:"#6a7985"}},formatter:function(t){let e=`