|
@@ -1,13 +1,28 @@
|
|
|
<template>
|
|
|
- <div class="page-table-template" style='display: flex;flex-direction: column;flex-grow: 1;flex-shrink: 1;'>
|
|
|
- <el-table :data='tableData' style='width: 100%' border class='data-table' v-loading='loading'>
|
|
|
- <el-table-column header-align='center' align='center' prop='BuildName' label='建筑'></el-table-column>、
|
|
|
- <el-table-column header-align='center' align='center' prop='floorName' label='楼层'></el-table-column>
|
|
|
+ <div class='page-table-template' style='display: flex;flex-direction: column;flex-grow: 1;flex-shrink: 1;'>
|
|
|
+ <div class="btn-box">
|
|
|
+ <el-button type='danger' @click='someDel'>批量删除</el-button>
|
|
|
+ </div>
|
|
|
+ <el-table
|
|
|
+ :data='tableData'
|
|
|
+ style='width: 100%'
|
|
|
+ border
|
|
|
+ class='data-table'
|
|
|
+ v-loading='loading'
|
|
|
+ @selection-change='handleSelectionChange'
|
|
|
+ >
|
|
|
+ <el-table-column type='selection' width='55' align='center'></el-table-column>
|
|
|
+ <el-table-column header-align='center' align='center' prop='BuildName' label='建筑' width='150'></el-table-column>、
|
|
|
+ <el-table-column header-align='center' align='center' prop='floorName' label='楼层' width='80'></el-table-column>
|
|
|
<el-table-column header-align='center' align='center' prop='FamilyName' label='设备族'></el-table-column>
|
|
|
- <el-table-column header-align='center' align='center' prop='FmId' label='本地编码' width='250'></el-table-column>
|
|
|
+ <el-table-column header-align='center' align='center' label='本地编码' width='250'>
|
|
|
+ <template slot-scope='scope'>
|
|
|
+ <span>{{scope.row.Infos.EquipLocalID || scope.row.Infos.EquipID || '--'}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column header-align='center' align='center' prop='FmName' label='本地名称'></el-table-column>
|
|
|
- <el-table-column header-align='center' align='center' prop='FmName' label='所在元空间'></el-table-column>
|
|
|
- <el-table-column header-align='center' align='center' prop='FmName' label='对应设备类'></el-table-column>
|
|
|
+ <el-table-column header-align='center' align='center' prop='spaceName' label='所在元空间'></el-table-column>
|
|
|
+ <el-table-column header-align='center' align='center' prop='eq' label='对应设备类'></el-table-column>
|
|
|
<el-table-column header-align='center' align='center' prop='bimXY' label='BIM模型中坐标'></el-table-column>
|
|
|
<el-table-column header-align='center' align='center' prop='PointName' label='操作' width='220'>
|
|
|
<template slot-scope='scope'>
|
|
@@ -17,7 +32,12 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
- <base-pagination class='data-table-pagination' :currentPages='pageNum' :total='total' @pageChanged='pageChanged'></base-pagination>
|
|
|
+ <base-pagination
|
|
|
+ class='data-table-pagination'
|
|
|
+ :currentPages='pageNum'
|
|
|
+ :total='total'
|
|
|
+ @pageChanged='pageChanged'
|
|
|
+ ></base-pagination>
|
|
|
<saga-dialog ref='dialog' :iframeSrc='iframeSrc'></saga-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -29,7 +49,8 @@ import SagaDialog from './Frame'
|
|
|
import {
|
|
|
getErrAssets, //获取异常资产type不同不同tab
|
|
|
delErrAssets,
|
|
|
- getSpaceId
|
|
|
+ getSpaceId,
|
|
|
+ getSpaceName
|
|
|
} from '@/api/scan/request'
|
|
|
export default {
|
|
|
name: 'noverify',
|
|
@@ -40,7 +61,10 @@ export default {
|
|
|
total: 0,
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
- iframeSrc: ''
|
|
|
+ iframeSrc: '',
|
|
|
+ allChecked: [],
|
|
|
+ //dict
|
|
|
+ EquipmentObj: {}
|
|
|
}
|
|
|
},
|
|
|
props: {
|
|
@@ -49,6 +73,10 @@ export default {
|
|
|
},
|
|
|
floorsObj: {
|
|
|
default: {}
|
|
|
+ },
|
|
|
+ allFamilyObj: {},
|
|
|
+ allEquipObj: {
|
|
|
+ default: {}
|
|
|
}
|
|
|
},
|
|
|
components: {
|
|
@@ -81,10 +109,27 @@ export default {
|
|
|
'&FmId=' +
|
|
|
row.FmId +
|
|
|
'&type=1&code=' +
|
|
|
- row.Family
|
|
|
+ row.eqCode
|
|
|
this.$refs['dialog'].show()
|
|
|
},
|
|
|
+ handleSelectionChange(arr) {
|
|
|
+ this.allChecked = arr.map(ele => ele.FmId)
|
|
|
+ },
|
|
|
+ someDel() {
|
|
|
+ if (this.allChecked.length) {
|
|
|
+ this.delOp(this.allChecked)
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: '请至少选择一条',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
del(row) {
|
|
|
+ let paramList = [row.FmId]
|
|
|
+ this.delOp(paramList)
|
|
|
+ },
|
|
|
+ delOp(paramList) {
|
|
|
this.$confirm('此操作将永久删除, 是否继续?', '提示', {
|
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
@@ -95,7 +140,6 @@ export default {
|
|
|
ProjId: this.projectId,
|
|
|
UserId: this.userId
|
|
|
}
|
|
|
- let paramList = [row.FmId]
|
|
|
delErrAssets(param, paramList).then(result => {
|
|
|
if (result.data.Result == 'success') {
|
|
|
this.getAsset()
|
|
@@ -129,26 +173,69 @@ export default {
|
|
|
UserId: this.userId,
|
|
|
CodeType: 1
|
|
|
}
|
|
|
- getErrAssets(param).then(res => {
|
|
|
- // this.tableData = list
|
|
|
- if (res.data.Result == 'success') {
|
|
|
- this.loading = false
|
|
|
+ getErrAssets(param).then( async res => {
|
|
|
+ // this.tableData = list
|
|
|
+ if (res.data.Result == 'success') {
|
|
|
let list = res.data.FmList
|
|
|
list.forEach((ele, index) => {
|
|
|
ele.floorName = this.floorsObj[ele.FloorId] || '--'
|
|
|
- ele.bimXY = (ele.X || '空') + ',' + (ele.Y || '空')
|
|
|
+ let x = ''
|
|
|
+ let y = ''
|
|
|
+ if (ele.X == 0) {
|
|
|
+ x = '空'
|
|
|
+ } else {
|
|
|
+ x = ele.X || ''
|
|
|
+ }
|
|
|
+ if (ele.Y == 0) {
|
|
|
+ y = '空'
|
|
|
+ } else {
|
|
|
+ y = ele.Y || ''
|
|
|
+ }
|
|
|
+ ele.bimXY = x + (x || y ? ',' : '-') + y
|
|
|
})
|
|
|
this.total = res.data.Count
|
|
|
this.tableData = list
|
|
|
- // this.getSpaceId()
|
|
|
+ await this.getEq(list)
|
|
|
+ await this.getSp(list)
|
|
|
+ this.loading = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ async getEq(list) {
|
|
|
+ let param = {},
|
|
|
+ idArr = [],
|
|
|
+ i = 0,
|
|
|
+ dataArr = list
|
|
|
+ for (; i < dataArr.length; i++) {
|
|
|
+ if (dataArr[i].EquipmentId) {
|
|
|
+ idArr.push({
|
|
|
+ id: dataArr[i].EquipmentId
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ param = {
|
|
|
+ perjectId: this.projectId,
|
|
|
+ secret: this.secret,
|
|
|
+ list: idArr
|
|
|
+ }
|
|
|
+ let ret = await this.batchQuery(param)
|
|
|
+ ret.forEach(ele => {
|
|
|
+ this.EquipmentObj[ele.id] = ele.category.slice(2)
|
|
|
+ })
|
|
|
+ list.forEach(ele => {
|
|
|
+ if (ele.EquipmentId) {
|
|
|
+ ele.eq = this.allEquipObj[this.EquipmentObj[ele.EquipmentId]]
|
|
|
+ ele.eqCode = this.EquipmentObj[ele.EquipmentId]
|
|
|
+ } else {
|
|
|
+ ele.eq = null
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- getSpaceId() {
|
|
|
+ async getSp(list) {
|
|
|
let param = {},
|
|
|
idArr = [],
|
|
|
i = 0,
|
|
|
- dataArr = this.tableData
|
|
|
+ dataArr = list
|
|
|
for (; i < dataArr.length; i++) {
|
|
|
if (dataArr[i].EquipmentId) {
|
|
|
idArr.push({
|
|
@@ -163,31 +250,55 @@ export default {
|
|
|
secret: this.secret,
|
|
|
list: idArr
|
|
|
}
|
|
|
- getSpaceId(param).then(res => {
|
|
|
- let data = res.data,
|
|
|
- spaceArr = [],
|
|
|
- j = 0
|
|
|
- if (data.Result == 'success') {
|
|
|
- for (; j < data.Content.length; j++) {
|
|
|
- console.log('space**********')
|
|
|
- console.log(data.Content)
|
|
|
- // if (data.Content[j].Count != 0) {
|
|
|
- // spaceArr.push({
|
|
|
- // id: data.Content[j].Content[0].to_id
|
|
|
- // })
|
|
|
- // dataArr.map(item => {
|
|
|
- // if (item.EquipmentId == data.Content[j].Content[0].from_id) {
|
|
|
- // item.spaceId = data.Content[j].Content[0].to_id
|
|
|
- // }
|
|
|
- // return item
|
|
|
- // })
|
|
|
- // }
|
|
|
- }
|
|
|
- console.log(dataArr, 'dataArr')
|
|
|
- // this.getSpaceName(spaceArr)
|
|
|
+ let ret = await this.getSpId(param)
|
|
|
+ let arr = []
|
|
|
+ let eqObj = {}
|
|
|
+ ret.forEach(ele => {
|
|
|
+ if (ele.Content.length > 0) {
|
|
|
+ arr.push({ id: ele.Content[0].to_id })
|
|
|
+ eqObj[ele.Content[0].from_id] = ele.Content[0].to_id
|
|
|
+ }
|
|
|
+ })
|
|
|
+ list.forEach(list1 => {
|
|
|
+ if (eqObj[list1.EquipmentId]) {
|
|
|
+ list1.toSpace = eqObj[list1.EquipmentId]
|
|
|
} else {
|
|
|
+ list1.toSpace = null
|
|
|
}
|
|
|
})
|
|
|
+ let params = {
|
|
|
+ perjectId: this.projectId,
|
|
|
+ secret: this.secret,
|
|
|
+ list: arr
|
|
|
+ }
|
|
|
+ let retu = await this.batchQuery(params)
|
|
|
+ let spObj = {}
|
|
|
+ retu.forEach(retu1 => {
|
|
|
+ spObj[retu1.id] = retu1.infos
|
|
|
+ })
|
|
|
+ list.forEach(list2 => {
|
|
|
+ if (spObj[list2.toSpace]) {
|
|
|
+ list2.spaceName = spObj[list2.toSpace].RoomLocalName
|
|
|
+ } else {
|
|
|
+ list2.spaceName = null
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ async batchQuery(param) {
|
|
|
+ let res = await getSpaceName(param)
|
|
|
+ let ret = res.data.Content
|
|
|
+ if (res.data.Count > 0) {
|
|
|
+ return ret
|
|
|
+ }
|
|
|
+ return []
|
|
|
+ },
|
|
|
+ async getSpId(param) {
|
|
|
+ let res = await getSpaceId(param)
|
|
|
+ let ret = res.data.Content
|
|
|
+ if (res.data.Count > 0) {
|
|
|
+ return ret
|
|
|
+ }
|
|
|
+ return []
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
@@ -199,4 +310,8 @@ export default {
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang='less'>
|
|
|
+.btn-box {
|
|
|
+ border: 1px solid #dfe6ec;
|
|
|
+ padding: 10px;
|
|
|
+}
|
|
|
</style>
|