-
-
- {{ $route.params.id }}
+
+
+
+
+ {{ equipmentName }}
+
+
+ {{ equipmentCode }}
+
-
+
@@ -21,11 +32,14 @@ import AddOrUpdate from '@/components/base-dialog/addOrUpdate'
import i18n from '@/i18n'
import BaseTable from '@/components/base-table'
import { pick } from 'lodash/object'
+import equipmentVue from './equipment.vue'
export default {
data() {
return {
calcMaxHeight,
+ equipmentName: null,
+ equipmentCode: null,
tableConfigs: [],
dataList: [],
dataListLoading: false,
@@ -42,12 +56,15 @@ export default {
mouted() {
this.getDataList()
},
+ created(){
+ // console.log('params',this.$route.params)
+ },
methods: {
// destroy dialog
handleDestroyDialog() {
setTimeout(() => {
- this.addOrUpdateVisible= false
- }, /** after dialog animated */ 200);
+ this.addOrUpdateVisible = false
+ }, /** after dialog animated */ 200)
},
// 获取数据列表
getDataList() {
@@ -56,6 +73,7 @@ export default {
url: this.$http.adornUrl(`/monitoring/equipmentValueMonitor/runLog/${this.$route.params.id}`),
method: 'get'
}).then(({ data: res }) => {
+ console.log('res',res)
if (
res &&
res.code === 0 &&
@@ -66,6 +84,9 @@ export default {
res.data[0].data &&
res.data[0].data.length > 0
) {
+ this.equipmentName = res.data[0].data[0].equName
+ this.equipmentCode = res.data[0].data[0].equCode
+ console.log(this.equipmentName)
this.setTableProps(res.data[0].nameData)
this.setTableData(res.data[0].data)
} else {
@@ -82,19 +103,19 @@ export default {
},
{ prop: 'time', name: this.$t('ti'), filter: timeFilter },
{ prop: 'plcCode', name: this.$t('plcCode') },
- { prop: 'equName', name: this.$t('equName') },
- { prop: 'equCode', name: this.$t('equCode') },
+ // { prop: 'equName', name: this.$t('equName') },
+ // { prop: 'equCode', name: this.$t('equCode') },
// ...['数值1', '数值2', '数值3'].map(name => {
// return { prop: name, name }
// })
- ...Array.from(new Set(nameData.map(item => item.name))).map(name => ({ prop: name, name }))
+ ...Array.from(new Set(nameData.map((item) => item.name))).map((name) => ({ prop: name, name }))
]
},
setTableData(data) {
- this.dataList = data.map(item => {
+ this.dataList = data.map((item) => {
const rowItem = pick(item, ['time', 'plcCode', 'equName', 'equCode'])
if (item.data && item.data.length > 0) {
- item.data.forEach(param => {
+ item.data.forEach((param) => {
rowItem[param.dynamicName] = param.dynamicValue
})
}
diff --git a/src/views/modules/monitoring/equipmentTimesequence.vue b/src/views/modules/monitoring/equipmentTimesequence.vue
index f258597..ed44d5b 100644
--- a/src/views/modules/monitoring/equipmentTimesequence.vue
+++ b/src/views/modules/monitoring/equipmentTimesequence.vue
@@ -35,7 +35,7 @@