|
@@ -16,10 +16,12 @@
|
|
|
<el-table-column prop="EquipLocalID" label="设备本地编码" show-overflow-tooltip max-width="150">
|
|
|
<!-- <template slot-scope="scope">{{ scope.row.EquipLocalID?scope.row.EquipLocalID:scope.row.EquipID }}</template> -->
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="Category" label="设备类" show-overflow-tooltip width="100"></el-table-column>
|
|
|
+ <el-table-column prop="EquipCategory.EquipName" label="设备类" show-overflow-tooltip width="100"></el-table-column>
|
|
|
<el-table-column prop="CADID" label="设计图纸中编码" show-overflow-tooltip max-width="150"></el-table-column>
|
|
|
<el-table-column label="所属建筑楼层">
|
|
|
- <template slot-scope="scope">{{ scope.row.BuildingId }}-{{ scope.row.FloorId }}</template>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.Building?scope.row.Building.BuildLocalName:'' }}-{{ scope.row.Floor?scope.row.Floor.FloorLocalName:'' }}
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="PropertyItem.EquipLocalName" label="资产本地名称" show-overflow-tooltip max-width="150">
|
|
|
<!-- <template slot-scope="scope">{{ scope.row.AssetsLocalName }}</template> -->
|
|
@@ -27,10 +29,12 @@
|
|
|
<el-table-column prop="PropertyItem.EquipLocalID" label="资产本地编码" show-overflow-tooltip max-width="150">
|
|
|
<!-- <template slot-scope="scope">{{ scope.row.AssetsLocalId }}</template> -->
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="PropertyItem.Family" label="设备族" show-overflow-tooltip width="100"></el-table-column>
|
|
|
+ <el-table-column prop="PropertyItem.FamilyName.Name" label="设备族" show-overflow-tooltip width="100"></el-table-column>
|
|
|
<el-table-column prop="PropertyItem.CADID" label="设计图纸中编码" show-overflow-tooltip max-width="150"></el-table-column>
|
|
|
<el-table-column label="所属建筑楼层" show-overflow-tooltip width="200">
|
|
|
- <template slot-scope="scope">{{ scope.row.PropertyItem.BuildingId }}-{{ scope.row.PropertyItem.FloorId }}</template>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.PropertyItem.Building?scope.row.PropertyItem.Building.BuildLocalName:'' }}-{{ scope.row.PropertyItem.Floor?scope.row.PropertyItem.Floor.FloorLocalName:'' }}
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="address" label="操作" width="100">
|
|
|
<template slot-scope="scope">
|
|
@@ -85,6 +89,7 @@ export default {
|
|
|
// total: 0
|
|
|
// },
|
|
|
radio: {},
|
|
|
+ contentData: [],
|
|
|
tableData: [],
|
|
|
mergeCol: [],
|
|
|
headerStyle: {
|
|
@@ -96,33 +101,38 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
//获取表格数据
|
|
|
- getTableData() {
|
|
|
+ getTableData(pageNum) {
|
|
|
this.loading = true
|
|
|
- this.tableData = []
|
|
|
- let param = this.formatFilter()
|
|
|
+ let param = this.formatFilter(pageNum)
|
|
|
equipCategoryProperty(param, res => {
|
|
|
this.unlinkNumber = res.Total
|
|
|
- this.linkNumber = res.Content.length
|
|
|
+ this.linkNumber += res.Content.length
|
|
|
// this.page.total = res.Total
|
|
|
- res.Content.forEach(item =>{
|
|
|
- if(item.PropertyList && item.PropertyList.length){
|
|
|
- item.PropertyList.forEach((Assets, index) => {
|
|
|
- let obj = JSON.parse(JSON.stringify(Object.assign(item, {PropertyItem: Assets, disabled: false})))
|
|
|
- delete obj.PropertyList
|
|
|
- this.tableData.push(obj)
|
|
|
- if(index == 0){
|
|
|
- this.mergeCol.push(item.PropertyList.length)
|
|
|
- } else {
|
|
|
- this.mergeCol.push(false)
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- this.loading = false
|
|
|
+ this.contentData = this.contentData.concat(res.Content)
|
|
|
+ if (res.Total / (res.PageSize * res.PageNumber) > 1) {
|
|
|
+ this.getTableData(res.PageNumber + 1)
|
|
|
+ } else {
|
|
|
+ this.contentData.forEach(item =>{
|
|
|
+ if(item.PropertyList && item.PropertyList.length){
|
|
|
+ item.PropertyList.forEach((Assets, index) => {
|
|
|
+ let obj = JSON.parse(JSON.stringify(Object.assign(item, {PropertyItem: Assets, disabled: false})))
|
|
|
+ delete obj.PropertyList
|
|
|
+ this.tableData.push(obj)
|
|
|
+ if(index == 0){
|
|
|
+ this.mergeCol.push(item.PropertyList.length)
|
|
|
+ } else {
|
|
|
+ this.mergeCol.push(false)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.loading = false
|
|
|
+ }
|
|
|
})
|
|
|
},
|
|
|
//格式化条件
|
|
|
- formatFilter() {
|
|
|
+ formatFilter(pageNum) {
|
|
|
+ pageNum = pageNum ? pageNum : 1
|
|
|
let param = {
|
|
|
data: {
|
|
|
// Cascade: [
|
|
@@ -140,7 +150,7 @@ export default {
|
|
|
// }
|
|
|
// ],
|
|
|
Orders: "createTime desc, EquipID asc",
|
|
|
- PageNumber: 1,
|
|
|
+ PageNumber: pageNum,
|
|
|
PageSize: 1000
|
|
|
},
|
|
|
category: this.params.deviceType
|
|
@@ -218,6 +228,9 @@ export default {
|
|
|
}
|
|
|
equipRproperty(params, res => {
|
|
|
this.radio = {}
|
|
|
+ this.linkNumber = 0
|
|
|
+ this.contentData = []
|
|
|
+ this.tableData = []
|
|
|
this.getTableData()
|
|
|
this.$message.success('关联成功!')
|
|
|
})
|