|
@@ -2,22 +2,23 @@
|
|
|
<div class="adm-device">
|
|
|
<statistics :statistics-msg="statisticsMsg"/>
|
|
|
<div class="operation">
|
|
|
- <el-select
|
|
|
- v-model="deviceType"
|
|
|
- placeholder="请选择"
|
|
|
- @change="handleFilter"
|
|
|
- clearable
|
|
|
- filterable
|
|
|
- class="adm-select"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="item in list"
|
|
|
- :key="item.code"
|
|
|
- :label="item.name"
|
|
|
- :value="item.code"
|
|
|
-
|
|
|
- />
|
|
|
- </el-select>
|
|
|
+<!-- <el-select-->
|
|
|
+<!-- v-model="deviceType"-->
|
|
|
+<!-- placeholder="请选择"-->
|
|
|
+<!-- @change="handleFilter"-->
|
|
|
+<!-- clearable-->
|
|
|
+<!-- filterable-->
|
|
|
+<!-- class="adm-select"-->
|
|
|
+<!-- >-->
|
|
|
+<!-- <el-option-->
|
|
|
+<!-- v-for="item in list"-->
|
|
|
+<!-- :key="item.code"-->
|
|
|
+<!-- :label="item.name"-->
|
|
|
+<!-- :value="item.code"-->
|
|
|
+
|
|
|
+<!-- />-->
|
|
|
+<!-- </el-select>-->
|
|
|
+ <el-cascader :options="options" clearable v-model="linshi" @change="changeLinshi" class="adm-select" ></el-cascader>
|
|
|
<admSearch @SearchValue="SearchValue"/>
|
|
|
<el-button type="default" @click="addDevice" class="adm-btn">添加设备</el-button>
|
|
|
</div>
|
|
@@ -27,7 +28,8 @@
|
|
|
<el-tab-pane v-for="(item,index) in paneMsg" :key="index" :label="item" :name="index.toString()"/>
|
|
|
</el-tabs>
|
|
|
<div class="table" v-loading="loading">
|
|
|
- <template v-if="deviceType">
|
|
|
+<!-- <template v-if="deviceType">-->
|
|
|
+ <template v-if="linshi.length >0">
|
|
|
<admMultiTable :currentHeader="currentHeader" :tableData="tableData" :headersStage="headersStage"/>
|
|
|
<Pagination v-if="tableData.length > 0" :paginationList="paginationList"
|
|
|
@handleCurrentChange="handleCurrentChange"
|
|
@@ -93,6 +95,30 @@ import tools from "@/utils/maintain"
|
|
|
components: { Statistics, AdmSearch, AdmMultiTable, Pagination, dataForm }
|
|
|
})
|
|
|
export default class extends Vue {
|
|
|
+ // 临时假数据
|
|
|
+ linshi=''
|
|
|
+ options= [{
|
|
|
+ value: 'zhinan',
|
|
|
+ label: '水景系统',
|
|
|
+ children: [{
|
|
|
+ value: 'ACATAH',
|
|
|
+ label: '空调机组',
|
|
|
+ }, {
|
|
|
+ value: 'ACATFC',
|
|
|
+ label: '风机盘管',
|
|
|
+ }]
|
|
|
+ },{
|
|
|
+ value: 'zzzz',
|
|
|
+ label: '室外动力系统',
|
|
|
+ children: [{
|
|
|
+ value: 'ACATFU',
|
|
|
+ label: '新风机组',
|
|
|
+ }, {
|
|
|
+ value: 'ACATIO',
|
|
|
+ label: '空调风口',
|
|
|
+ }]
|
|
|
+ }]
|
|
|
+
|
|
|
// loading
|
|
|
loading = false
|
|
|
// 统计信息对象
|
|
@@ -146,7 +172,7 @@ export default class extends Vue {
|
|
|
}
|
|
|
|
|
|
created() {
|
|
|
- this.deviceList();
|
|
|
+ // this.deviceList();
|
|
|
this.dataCount()
|
|
|
}
|
|
|
|
|
@@ -158,32 +184,73 @@ export default class extends Vue {
|
|
|
}
|
|
|
|
|
|
// 设备类数据
|
|
|
- deviceList() {
|
|
|
- let param2 = {
|
|
|
- distinct: true,
|
|
|
- pageNumber: 1,
|
|
|
- pageSize: 1000,
|
|
|
- projection: ["classCode"],
|
|
|
- projectId: this.projectId
|
|
|
- }
|
|
|
- let promise = new Promise(resolve => {
|
|
|
- dictType({}).then(res => {
|
|
|
- resolve(res)
|
|
|
+// deviceList() {
|
|
|
+// let param2 = {
|
|
|
+// distinct: true,
|
|
|
+// pageNumber: 1,
|
|
|
+// pageSize: 1000,
|
|
|
+// projection: ["classCode"],
|
|
|
+// projectId: this.projectId
|
|
|
+// }
|
|
|
+// let promise = new Promise(resolve => {
|
|
|
+// dictType({}).then(res => {
|
|
|
+// resolve(res)
|
|
|
+// })
|
|
|
+// })
|
|
|
+// let promise2 = new Promise(resolve => {
|
|
|
+// queryEquip(param2).then(res => {
|
|
|
+// resolve(res)
|
|
|
+// })
|
|
|
+// })
|
|
|
+// Promise.all([promise, promise2]).then((res) => {
|
|
|
+// let allData = res[0].content;
|
|
|
+// let deviceInformation = res[1].content
|
|
|
+// allData.filter(item => (deviceInformation.indexOf(item.code) > -1))
|
|
|
+// this.list = allData
|
|
|
+// })
|
|
|
+// }
|
|
|
+
|
|
|
+
|
|
|
+ // todo 临时假数据函数
|
|
|
+ private changeLinshi(val) {
|
|
|
+ console.log(this.linshi,this.linshi[1])
|
|
|
+ if (this.linshi[1]) {
|
|
|
+ this.loading = true
|
|
|
+ let param = {
|
|
|
+ category: this.linshi[1]
|
|
|
+ }
|
|
|
+ let param2 = {
|
|
|
+ filters: this.linshi[1] ? `classCode='${ this.linshi[1] }'` : undefined,
|
|
|
+ pageNumber: this.paginationList.page,
|
|
|
+ pageSize: this.paginationList.size,
|
|
|
+ orders: "createTime desc, id asc",
|
|
|
+ projectId: this.projectId
|
|
|
+ }
|
|
|
+ if (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 => {
|
|
|
+ resolve(res)
|
|
|
+ })
|
|
|
})
|
|
|
- })
|
|
|
- let promise2 = new Promise(resolve => {
|
|
|
- queryEquip(param2).then(res => {
|
|
|
- resolve(res)
|
|
|
+ let promise2 = new Promise(resolve => {
|
|
|
+ queryEquip(param2).then(res => {
|
|
|
+ resolve(res)
|
|
|
+ })
|
|
|
})
|
|
|
- })
|
|
|
- Promise.all([promise, promise2]).then((res) => {
|
|
|
- let allData = res[0].content;
|
|
|
- let deviceInformation = res[1].content
|
|
|
- allData.filter(item => (deviceInformation.indexOf(item.code) > -1))
|
|
|
- this.list = allData
|
|
|
- })
|
|
|
+ Promise.all([promise, promise2]).then(res => {
|
|
|
+ this.loading = false
|
|
|
+ // 类型下信息点,默认设计阶段
|
|
|
+ this.headerInformation = res[0] // 获取表头
|
|
|
+ this.tableData = res[1].content // 主体数据
|
|
|
+ this.headerStage()
|
|
|
+ this.paginationList.total = res[1].total
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.headerInformation = {}
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
private handleFilter(val) {
|
|
|
console.log(this.deviceType)
|
|
|
if (this.deviceType) {
|
|
@@ -336,19 +403,22 @@ export default class extends Vue {
|
|
|
// 搜索
|
|
|
SearchValue(val: string) {
|
|
|
this.inputSearch = val
|
|
|
- this.handleFilter(this.deviceType)
|
|
|
+ // this.handleFilter(this.deviceType)
|
|
|
+ this.changeLinshi(this.linshi[1])
|
|
|
}
|
|
|
|
|
|
// 当前分页
|
|
|
handleCurrentChange(val: number) {
|
|
|
console.log(val)
|
|
|
this.paginationList.page = val
|
|
|
- this.handleFilter(this.deviceType)
|
|
|
+ // this.handleFilter(this.deviceType)
|
|
|
+ this.changeLinshi(this.linshi[1])
|
|
|
}
|
|
|
|
|
|
handleSizeChange(val: number) {
|
|
|
this.paginationList.size = val
|
|
|
- this.handleFilter(this.deviceType)
|
|
|
+ // this.handleFilter(this.deviceType)
|
|
|
+ this.changeLinshi(this.linshi[1])
|
|
|
}
|
|
|
|
|
|
// 添加设备
|