From e0d4e5327f2ee85c68d32b125cff746090a25306 Mon Sep 17 00:00:00 2001
From: Fanzink <460995166@qq.com>
Date: Thu, 23 Mar 2023 11:31:59 +0530
Subject: [PATCH] =?UTF-8?q?'=E6=94=B9=E6=95=B0=E6=8D=AE=E5=88=86=E6=9E=90b?=
=?UTF-8?q?ug'?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../monitoring/equProductTimesequence.vue | 52 +++++++++-------
.../modules/monitoring/productQuality.vue | 61 ++++++++++++++++++-
2 files changed, 88 insertions(+), 25 deletions(-)
diff --git a/src/views/modules/monitoring/equProductTimesequence.vue b/src/views/modules/monitoring/equProductTimesequence.vue
index e0ee851..54e7329 100644
--- a/src/views/modules/monitoring/equProductTimesequence.vue
+++ b/src/views/modules/monitoring/equProductTimesequence.vue
@@ -446,6 +446,7 @@ export default {
// 获取工序列表
getWorksetionList() {
// 分页列表才有根据产线过滤功能
+ // this.wsList = []
for (let i = 0; i < this.lineIds.length; i++) {
this.$http({
// url: this.$http.adornUrl('/monitoring/workshopSection/list'),
@@ -582,6 +583,8 @@ export default {
// this.renderChart()
// })
}
+ }).catch((err) => {
+ // console.error(err)
})
},
setOptions(opts) {
@@ -592,29 +595,29 @@ export default {
if (this.chart) this.chart.setOption(this.defaultOpts, true)
},
// 失效函数
- parseTableProps(nameData) {
- const subProps = []
- const labelNameMap = new Map()
+ // parseTableProps(nameData) {
+ // const subProps = []
+ // const labelNameMap = new Map()
- // if (nameData.length) {
- // /** 处理 nameData */
- // nameData.forEach((item) => {
- // if (!labelNameMap.get(item.name)) {
- // labelNameMap.set(item.name, 1)
- // subProps.push({ name: item.name, prop: item.name })
- // }
- // })
- // }
+ // // if (nameData.length) {
+ // // /** 处理 nameData */
+ // // nameData.forEach((item) => {
+ // // if (!labelNameMap.get(item.name)) {
+ // // labelNameMap.set(item.name, 1)
+ // // subProps.push({ name: item.name, prop: item.name })
+ // // }
+ // // })
+ // // }
- this.tableConfigDynamic = [
- { type: 'index', width: 100, name: i18n.t('index') },
- { name: i18n.t('pl.name'), prop: '0' },
- ...Array.from(new Set(res.data.data[0].records.map((item) => moment(item.recordTime).format('MM-DD')))).map((name) => ({ prop: String(++this.count), name }))
- ]
- /** echarts related */
- // this.echartCategories = subProps.map((item) => item.name)
- this.echartCategories = this.dataListDynamic.map((item) => item.name)
- },
+ // this.tableConfigDynamic = [
+ // { type: 'index', width: 100, name: i18n.t('index') },
+ // { name: i18n.t('pl.name'), prop: '0' },
+ // ...Array.from(new Set(res.data.data[0].records.map((item) => moment(item.recordTime).format('MM-DD')))).map((name) => ({ prop: String(++this.count), name }))
+ // ]
+ // /** echarts related */
+ // // this.echartCategories = subProps.map((item) => item.name)
+ // this.echartCategories = this.dataListDynamic.map((item) => item.name)
+ // },
// parseDynamicData(data) {
// this.echartCheckTypes.splice(0)
@@ -740,9 +743,11 @@ export default {
//遍历属性
this.keys = [...Object.keys(res.data),...this.keys]
// console.log('this.finalVal', this.finalVal)
- // console.log('keys', this.keys)
+ console.log('keys', this.keys)
this.values = Object.values(res.data)
// console.log('values', this.values)
+ // 初始化values2
+ this.values2 = []
for (let c = 0; c < this.values.length; c++) {
this.values2.push(
this.values[c].map((item) => {
@@ -750,8 +755,9 @@ export default {
})
)
}
+ console.log('values2', this.values2)
this.finalVal = [...this.values2,...this.finalVal]
- // console.log('this.finalVal', this.finalVal)
+ console.log('this.finalVal', this.finalVal)
this.$message.success(this.$t('pl.success'))
this.$nextTick(() => {
this.dialogVisible = false
diff --git a/src/views/modules/monitoring/productQuality.vue b/src/views/modules/monitoring/productQuality.vue
index e76e90d..9fd5b5d 100644
--- a/src/views/modules/monitoring/productQuality.vue
+++ b/src/views/modules/monitoring/productQuality.vue
@@ -165,7 +165,64 @@ const FakeChart = {
},
toolbox: {
feature: {
- dataView: { show: true, readOnly: false },
+ dataView: {
+ show: true,
+ readOnly: true,
+ optionToContent: function (opt) {
+ var axisData = opt.xAxis[0].data
+ var series = opt.series
+ //验证是否是中文
+ var pattern = new RegExp('[\u4E00-\u9FA5]+')
+ if (pattern.test(series[0].name)) {
+ var table =
+ '
' +
+ '设备名称 | ' +
+ '' +
+ series[0].name +
+ ' | ' +
+ '' +
+ series[1].name +
+ ' | ' +
+ '' +
+ series[2].name +
+ ' | ' +
+ '
'
+ } else {
+ var table =
+ '' +
+ 'Equipment Name | ' +
+ '' +
+ series[0].name +
+ ' | ' +
+ '' +
+ series[1].name +
+ ' | ' +
+ '' +
+ series[2].name +
+ ' | ' +
+ '
'
+ }
+ for (var i = 0, l = axisData.length; i < l; i++) {
+ table +=
+ '' +
+ '' +
+ axisData[i] +
+ ' | ' +
+ '' +
+ series[0].data[i] +
+ ' | ' +
+ '' +
+ series[1].data[i] +
+ ' | ' +
+ '' +
+ series[2].data[i] +
+ ' | ' +
+ '
'
+ }
+ table += '
'
+ return table
+ }
+ },
restore: { show: true },
saveAsImage: { show: true }
}
@@ -531,7 +588,7 @@ export default {
this.echartRealtime = this.echartCategories
// this.parseTableProps(res.data.nameData)
- // console.log('this.dataListDynamic', this.dataListDynamic)
+ console.log('this.dataListDynamic', this.dataListDynamic)
this.buildGraphData()
})