调整代码
This commit is contained in:
@@ -652,7 +652,7 @@ const initRadioCharts = () => {
|
||||
echartsData1.value.options.series[i].center = ['50%', '50%']
|
||||
}
|
||||
}
|
||||
const initEcharts = (color: string, key: number) => {
|
||||
const initEcharts = (color: string, key: number, name: string) => {
|
||||
return {
|
||||
options: {
|
||||
tooltip: {},
|
||||
@@ -731,7 +731,7 @@ const initEcharts = (color: string, key: number) => {
|
||||
data: [
|
||||
{
|
||||
value: 0,
|
||||
name: 'A相',
|
||||
name: name,
|
||||
itemStyle: {
|
||||
color: color
|
||||
}
|
||||
@@ -744,14 +744,14 @@ const initEcharts = (color: string, key: number) => {
|
||||
}
|
||||
//渲染echarts
|
||||
const init = () => {
|
||||
const url = (localStorage.getItem('WebSocketUrl') || 'ws://192.168.1.68:10407/api/pushMessage/')
|
||||
echartsDataV1.value = initEcharts('#DAA520', 0)
|
||||
echartsDataV2.value = initEcharts('#2E8B57', 0)
|
||||
echartsDataV3.value = initEcharts('#A52a2a', 0)
|
||||
const url = localStorage.getItem('WebSocketUrl') || 'ws://192.168.1.68:10407/api/pushMessage/'
|
||||
echartsDataV1.value = initEcharts('#DAA520', 0, 'A相')
|
||||
echartsDataV2.value = initEcharts('#2E8B57', 0, 'B相')
|
||||
echartsDataV3.value = initEcharts('#A52a2a', 0, 'C相')
|
||||
|
||||
echartsDataA1.value = initEcharts('#DAA520', 1)
|
||||
echartsDataA2.value = initEcharts('#2E8B57', 1)
|
||||
echartsDataA3.value = initEcharts('#A52a2a', 1)
|
||||
echartsDataA1.value = initEcharts('#DAA520', 1, 'A相')
|
||||
echartsDataA2.value = initEcharts('#2E8B57', 1, 'B相')
|
||||
echartsDataA3.value = initEcharts('#A52a2a', 1, 'C相')
|
||||
|
||||
if (!dataSocket.socketServe) {
|
||||
console.error('WebSocket 客户端实例不存在')
|
||||
@@ -764,9 +764,7 @@ const url = (localStorage.getItem('WebSocketUrl') || 'ws://192.168.1.68:10407/ap
|
||||
})
|
||||
}
|
||||
let pids = monitoringPoint.state.pid.split(',')
|
||||
dataSocket.socketServe.connect(
|
||||
`${url}${adminInfo.id},${monitoringPoint.state.lineId},${pids[pids.length - 2]}`
|
||||
)
|
||||
dataSocket.socketServe.connect(`${url}${adminInfo.id},${monitoringPoint.state.lineId},${pids[pids.length - 2]}`)
|
||||
dataSocket.socketServe.registerCallBack('message', (res: any) => {
|
||||
txtContent.value = res.value
|
||||
let data = JSON.parse(res.value)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user