fzq #31
@ -10,23 +10,7 @@
|
|||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<!-- <small-title :size="'md'">{{ $t('module.factory.realtime.equipment.name') }}</small-title> -->
|
<!-- <small-title :size="'md'">{{ $t('module.factory.realtime.equipment.name') }}</small-title> -->
|
||||||
<small-title :size="'md'">设备生产实时数据</small-title>
|
<small-title :size="'md'">设备生产实时数据</small-title>
|
||||||
<!-- <base-table v-if="loadTable" :table-head-configs="tableProps" :data="tableData.length ? tableData : []" :span-method="spanMethod" /> -->
|
<base-table v-if="loadTable" :table-head-configs="tableProps" :data="tableData.length ? tableData : []" :span-method="spanMethod" />
|
||||||
<base-table
|
|
||||||
v-if="loadTable"
|
|
||||||
:table-head-configs="[
|
|
||||||
{ type: 'index', label: '序号' },
|
|
||||||
{ prop: 'name', label: '名称' },
|
|
||||||
{ prop: 'code', label: '编码' },
|
|
||||||
{ prop: 'brand', label: '品牌' }
|
|
||||||
]"
|
|
||||||
:data="[
|
|
||||||
{ name: '汽车', code: 'Car', brand: 'Benz' },
|
|
||||||
{ name: '汽车', code: 'Car2', brand: 'Audi' },
|
|
||||||
{ name: '汽车', code: 'Car3', brand: 'Maclaren' },
|
|
||||||
{ name: '火车', code: 'Train', brand: 'Harmony' }
|
|
||||||
]"
|
|
||||||
:span-method="testSpan"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -58,11 +42,11 @@ export default {
|
|||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.clearData()
|
this.clearData()
|
||||||
// fetchList('equipment').then(res => {
|
this.fetchList('equipment').then(({data: res}) => {
|
||||||
// this.testData = res
|
this.testData = res.data.filter(item => !!item.equDet)
|
||||||
// this.handleData()
|
this.handleData()
|
||||||
// })
|
})
|
||||||
this.loadTable = true
|
// this.loadTable = true
|
||||||
// this.intervalId = setInterval(() => {
|
// this.intervalId = setInterval(() => {
|
||||||
// this.$message({
|
// this.$message({
|
||||||
// // message: this.$t('module.factory.realtime.equipment.refresh'),
|
// // message: this.$t('module.factory.realtime.equipment.refresh'),
|
||||||
@ -103,10 +87,13 @@ export default {
|
|||||||
|
|
||||||
fetchList() {
|
fetchList() {
|
||||||
// 获取设备实时数据
|
// 获取设备实时数据
|
||||||
|
return this.$http({
|
||||||
|
url: this.$http.adornUrl('/monitoring/productionMonitoring/equipmentProductionRealTimeData'),
|
||||||
|
method: 'post'
|
||||||
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
testSpan({ row, column, rowIndex, columnIndex }) {
|
testSpan({ row, column, rowIndex, columnIndex }) {
|
||||||
console.log('rowIndex', rowIndex)
|
|
||||||
if (columnIndex === 1 && rowIndex % 2 === 0) {
|
if (columnIndex === 1 && rowIndex % 2 === 0) {
|
||||||
return [2, 1]
|
return [2, 1]
|
||||||
}
|
}
|
||||||
@ -116,14 +103,17 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
expandDataStepOne() {
|
expandDataStepOne() {
|
||||||
this.stepOneArray = this.testData.data.map(item => {
|
console.log('testdata: ', this.testData)
|
||||||
if (item.equDet) {
|
// this.stepOneArray = this.testData.data
|
||||||
item.equDet.forEach((equipment, index) => {
|
// .filter(item => item.equDet)
|
||||||
equipment.lineName = item.lineName
|
// .map(item => {
|
||||||
})
|
// if (item.equDet) {
|
||||||
}
|
// item.equDet.forEach((equipment, index) => {
|
||||||
return item.equDet
|
// equipment.lineName = item.lineName
|
||||||
})
|
// })
|
||||||
|
// }
|
||||||
|
// return item.equDet
|
||||||
|
// })
|
||||||
},
|
},
|
||||||
|
|
||||||
expandDataStepTwo() {
|
expandDataStepTwo() {
|
||||||
|
Loading…
Reference in New Issue
Block a user