|
@@ -23,13 +23,6 @@ import {findYMax} from '@/api/DashboardLayout'
|
|
import moment from 'moment'
|
|
import moment from 'moment'
|
|
import {mapState} from 'vuex'
|
|
import {mapState} from 'vuex'
|
|
|
|
|
|
-const codeMap = {
|
|
|
|
- ELECTRIC: '电流',
|
|
|
|
- VIBRATION: '振动',
|
|
|
|
- NOISE: '噪声',
|
|
|
|
- FEEDBACK: '反馈'
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
export default {
|
|
export default {
|
|
name: 'RealtimeLine',
|
|
name: 'RealtimeLine',
|
|
data() {
|
|
data() {
|
|
@@ -84,9 +77,13 @@ export default {
|
|
this.chartList[key] = this.$echarts.init(document.getElementById(key))
|
|
this.chartList[key] = this.$echarts.init(document.getElementById(key))
|
|
|
|
|
|
const tagList = this.workshopList[key].tagList
|
|
const tagList = this.workshopList[key].tagList
|
|
-
|
|
|
|
- const legendData = tagList.map(e => this.getLegendName(e.name))
|
|
|
|
- const startType = codeMap[this.workshopList[key].collectEntityList[0].startType]
|
|
|
|
|
|
+ const legendData = tagList.map(e => this.getLegendName(this.workshopList[key].workshopName, e.name))
|
|
|
|
+ let startType = 'UNKNOWN'
|
|
|
|
+ tagList.forEach(e => {
|
|
|
|
+ if (e.tableColumn === this.workshopList[key].collectEntityList[0].startType) {
|
|
|
|
+ startType = e.desc
|
|
|
|
+ }
|
|
|
|
+ })
|
|
const collectEntityId = this.workshopList[key].collectEntityList[0].id
|
|
const collectEntityId = this.workshopList[key].collectEntityList[0].id
|
|
const legendSelected = {}
|
|
const legendSelected = {}
|
|
legendData.forEach(e => {
|
|
legendData.forEach(e => {
|
|
@@ -95,6 +92,7 @@ export default {
|
|
const options = {
|
|
const options = {
|
|
legend: {
|
|
legend: {
|
|
right: '4%',
|
|
right: '4%',
|
|
|
|
+ left: '20%',
|
|
icon: 'roundRect',
|
|
icon: 'roundRect',
|
|
textStyle: {
|
|
textStyle: {
|
|
fontSize: 12,
|
|
fontSize: 12,
|
|
@@ -181,7 +179,7 @@ export default {
|
|
series: []
|
|
series: []
|
|
}
|
|
}
|
|
for (const e of tagList) {
|
|
for (const e of tagList) {
|
|
- const name = this.getLegendName(e.name)
|
|
|
|
|
|
+ const name = this.getLegendName(this.workshopList[key].workshopName, e.name)
|
|
options.series.push(
|
|
options.series.push(
|
|
{
|
|
{
|
|
name,
|
|
name,
|
|
@@ -234,6 +232,8 @@ export default {
|
|
const arrNotTags = []
|
|
const arrNotTags = []
|
|
res.data.forEach((val, index) => {
|
|
res.data.forEach((val, index) => {
|
|
if (val.tagList && val.tagList.length > 0) {
|
|
if (val.tagList && val.tagList.length > 0) {
|
|
|
|
+ // 过滤运行反馈
|
|
|
|
+ val.tagList = val.tagList.filter(e => !e.code.endsWith('FEEDBACK'))
|
|
obj[val.workshopCode] = val
|
|
obj[val.workshopCode] = val
|
|
} else {
|
|
} else {
|
|
arrNotTags.push(val)
|
|
arrNotTags.push(val)
|
|
@@ -290,17 +290,11 @@ export default {
|
|
return colors[4]
|
|
return colors[4]
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- getLegendName(name) {
|
|
|
|
- if (name.endsWith('电流')) {
|
|
|
|
- return '电流'
|
|
|
|
- } else if (name.endsWith('振动')) {
|
|
|
|
- return '振动'
|
|
|
|
- } else if (name.endsWith('噪声')) {
|
|
|
|
- return '噪声'
|
|
|
|
- } else if (name.endsWith('反馈')) {
|
|
|
|
- return '反馈'
|
|
|
|
|
|
+ getLegendName(prefix, name) {
|
|
|
|
+ if (name.lastIndexOf(prefix) !== -1) {
|
|
|
|
+ return name.split(prefix)[1]
|
|
} else {
|
|
} else {
|
|
- return '未知'
|
|
|
|
|
|
+ return name
|
|
}
|
|
}
|
|
},
|
|
},
|
|
updateChart() {
|
|
updateChart() {
|