|
@@ -17,7 +17,6 @@
|
|
|
<template v-if="deviceType.length > 0">
|
|
|
<admMultiTable :currentHeader="currentHeader"
|
|
|
@handleCurrentEdit="handleCurrentEdit"
|
|
|
-
|
|
|
:tableData="tableData" :headersStage="headersStage"/>
|
|
|
<Pagination v-if="tableData.length > 0" :paginationList="paginationList"
|
|
|
@handleCurrentChange="handleCurrentChange"
|
|
@@ -95,18 +94,18 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script lang="ts">
|
|
|
-import { Component, Vue, Watch } from "vue-property-decorator";
|
|
|
-import { AdmMultiTable, AdmSearch, dataForm, Pagination, Statistics } from '../components/index'
|
|
|
-import { allDevice, BeatchQueryParam, dictInfo } from "@/api/equipComponent";
|
|
|
-import { createEquip, queryCount, queryEquip, updateEquip, deleteEquip } from "@/api/datacenter";
|
|
|
-import { UserModule } from "@/store/modules/user";
|
|
|
+import {Component, Vue, Watch} from "vue-property-decorator";
|
|
|
+import {AdmMultiTable, AdmSearch, dataForm, Pagination, Statistics} from '../components/index'
|
|
|
+import {allDevice, BeatchQueryParam, dictInfo} from "@/api/equipComponent";
|
|
|
+import {createEquip, queryCount, queryEquip, updateEquip, deleteEquip} from "@/api/datacenter";
|
|
|
+import {UserModule} from "@/store/modules/user";
|
|
|
import deviceGraph from "./components/deviceGraph.vue"
|
|
|
import tools from "@/utils/maintain"
|
|
|
|
|
|
|
|
|
@Component({
|
|
|
name: 'adm-device',
|
|
|
- components: { Statistics, AdmSearch, AdmMultiTable, Pagination, dataForm, deviceGraph }
|
|
|
+ components: {Statistics, AdmSearch, AdmMultiTable, Pagination, dataForm, deviceGraph}
|
|
|
})
|
|
|
export default class extends Vue {
|
|
|
|
|
@@ -205,14 +204,15 @@ export default class extends Vue {
|
|
|
category: this.deviceType[1]
|
|
|
}
|
|
|
let param2 = {
|
|
|
- filters: this.deviceType[1] ? `classCode='${ this.deviceType[1] }'` : undefined,
|
|
|
+ filters: this.deviceType[1] ? `classCode='${this.deviceType[1]}'` : undefined,
|
|
|
pageNumber: this.paginationList.page,
|
|
|
pageSize: this.paginationList.size,
|
|
|
orders: "createTime desc, id asc",
|
|
|
- projectId: this.projectId
|
|
|
+ projectId: this.projectId,
|
|
|
+ cascade: [{"name": "floor",}, {"name": "objectInfo"}]
|
|
|
}
|
|
|
if (this.inputSearch != '') {
|
|
|
- param2.filters += `;codeName contain '${ this.inputSearch }' or systemCategory contain '${ this.inputSearch }' or bimTypeId contain '${ this.inputSearch }' or localId contain '${ this.inputSearch }'`
|
|
|
+ param2.filters += `;codeName contain '${this.inputSearch}' or systemCategory contain '${this.inputSearch}' or bimTypeId contain '${this.inputSearch}' or localId contain '${this.inputSearch}'`
|
|
|
}
|
|
|
let promise = new Promise(resolve => {
|
|
|
dictInfo(param).then((res: []) => {
|
|
@@ -228,7 +228,18 @@ export default class extends Vue {
|
|
|
this.loading = false
|
|
|
// 类型下信息点,默认设计阶段
|
|
|
this.headerInformation = res[0] // 获取表头
|
|
|
- this.tableData = res[1].content // 主体数据
|
|
|
+ // this.tableData = res[1].content // 主体数据
|
|
|
+ this.tableData = res[1].content.map(i => {
|
|
|
+ i.readonlyFloor = ''
|
|
|
+ i.readonlySpace = ''
|
|
|
+ if (i.floor && i.floor.localName) {
|
|
|
+ i.readonlyFloor = i.floor.localName
|
|
|
+ }
|
|
|
+ if (i.objectInfo) {
|
|
|
+ i.readonlySpace = i.objectInfo.map(j => j.localName).join(',')
|
|
|
+ }
|
|
|
+ return i
|
|
|
+ })
|
|
|
this.paneMsg = res[0].dictStages.map(i => i.name)
|
|
|
this.currentHeader = this.paneMsg[this.activeName]
|
|
|
this.headerStage()
|
|
@@ -240,6 +251,7 @@ export default class extends Vue {
|
|
|
}
|
|
|
|
|
|
async handleNext() {
|
|
|
+
|
|
|
if (this.deviceVal[1]) {
|
|
|
this.next = false
|
|
|
this.isWidth = true
|
|
@@ -247,7 +259,14 @@ export default class extends Vue {
|
|
|
category: this.deviceVal[1]
|
|
|
}
|
|
|
await dictInfo(param).then(res => {
|
|
|
- this.deviceHeaders = res
|
|
|
+ const basicInfos = [{path: 'bimTypeName', aliasName: '构件分类名称', category: "STATIC", editable: true},
|
|
|
+ {path: 'localId', aliasName: '本地编码', category: "STATIC", editable: true},
|
|
|
+ {path: 'readonlyFloor', editable: false, aliasName: '所属楼层', category: "STATIC"},
|
|
|
+ {path: 'readonlySpace', editable: false, aliasName: '所在空间', category: "STATIC"}]
|
|
|
+ this.deviceHeaders = {
|
|
|
+ basicInfos,
|
|
|
+ dictStages: res.dictStages
|
|
|
+ }
|
|
|
})
|
|
|
} else {
|
|
|
console.log(5)
|
|
@@ -269,10 +288,26 @@ export default class extends Vue {
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
+ // this.headersStage = {
|
|
|
+ // basicInfos: {
|
|
|
+ // name: '基础信息台账',
|
|
|
+ // data: this.headerInformation.basicInfos
|
|
|
+ // },
|
|
|
+ // dictStages: {
|
|
|
+ // name: this.currentHeader,
|
|
|
+ // data: pic.length > 0 ? [...base, ...pic] : [...base]
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // todo 固定写死基础信息台账
|
|
|
this.headersStage = {
|
|
|
basicInfos: {
|
|
|
name: '基础信息台账',
|
|
|
- data: this.headerInformation.basicInfos
|
|
|
+ data: [
|
|
|
+ {path: 'bimTypeName', aliasName: '构件分类名称', category: "STATIC"},
|
|
|
+ {path: 'localId', aliasName: '本地编码', category: "STATIC"},
|
|
|
+ {path: 'readonlyFloor', editable: false, aliasName: '所属楼层', category: "STATIC"},
|
|
|
+ {path: 'readonlySpace', editable: false, aliasName: '所在空间', category: "STATIC"}
|
|
|
+ ],
|
|
|
},
|
|
|
dictStages: {
|
|
|
name: this.currentHeader,
|
|
@@ -407,7 +442,7 @@ export default class extends Vue {
|
|
|
|
|
|
// 删除设备
|
|
|
deleteDevice() {
|
|
|
- deleteEquip([{ id: this.currRowContent.id }]).then(res => {
|
|
|
+ deleteEquip([{id: this.currRowContent.id}]).then(res => {
|
|
|
if (res.result == 'success') {
|
|
|
this.$message.success('删除成功')
|
|
|
this.handleChangeDevice()
|
|
@@ -460,7 +495,7 @@ export default class extends Vue {
|
|
|
// @ts-ignore
|
|
|
const data = this.$refs.deviceGraph.getLocation()
|
|
|
if (data) {
|
|
|
- this.curEquip.bimLocation = `${ data.x },${ data.y },${ data.z }`;
|
|
|
+ this.curEquip.bimLocation = `${data.x},${data.y},${data.z}`;
|
|
|
this.curEquip.buildingId = data.buildingId;
|
|
|
this.curEquip.floorId = data.floorId;
|
|
|
}
|
|
@@ -478,9 +513,9 @@ export default class extends Vue {
|
|
|
handleUpdateEquip(obj) {
|
|
|
let pa;
|
|
|
if (Array.isArray(obj)) {
|
|
|
- pa = { content: obj }
|
|
|
+ pa = {content: obj}
|
|
|
} else {
|
|
|
- pa = { content: [obj] }
|
|
|
+ pa = {content: [obj]}
|
|
|
}
|
|
|
updateEquip(pa).then(res => {
|
|
|
if (res.result == 'success') {
|
|
@@ -495,9 +530,9 @@ export default class extends Vue {
|
|
|
handleCreateEquip(obj: any) {
|
|
|
let pa;
|
|
|
if (Array.isArray(obj)) {
|
|
|
- pa = { content: obj }
|
|
|
+ pa = {content: obj}
|
|
|
} else {
|
|
|
- pa = { content: [obj] }
|
|
|
+ pa = {content: [obj]}
|
|
|
}
|
|
|
createEquip(pa).then(res => {
|
|
|
if (res.result == 'success') {
|
|
@@ -521,7 +556,7 @@ export default class extends Vue {
|
|
|
this.currRowContent = this.currentRow
|
|
|
}
|
|
|
|
|
|
- @Watch("deviceType", { immediate: true, deep: true })
|
|
|
+ @Watch("deviceType", {immediate: true, deep: true})
|
|
|
handleDeviceMsg() {
|
|
|
this.deviceVal = this.deviceType
|
|
|
}
|