|
@@ -2,23 +2,8 @@
|
|
|
<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-cascader :options="options" clearable v-model="linshi" @change="changeLinshi" class="adm-select" ></el-cascader>
|
|
|
+ <el-cascader :options="list" clearable v-model="deviceType" :props="optionProps" @change="changeLinshi"
|
|
|
+ class="adm-select"></el-cascader>
|
|
|
<admSearch @SearchValue="SearchValue"/>
|
|
|
<el-button type="default" @click="addDevice" class="adm-btn">添加设备</el-button>
|
|
|
</div>
|
|
@@ -29,7 +14,7 @@
|
|
|
</el-tabs>
|
|
|
<div class="table" v-loading="loading">
|
|
|
<!-- <template v-if="deviceType">-->
|
|
|
- <template v-if="linshi.length > 0">
|
|
|
+ <template v-if="deviceType.length > 0">
|
|
|
<admMultiTable :currentHeader="currentHeader" :tableData="tableData" :headersStage="headersStage"/>
|
|
|
<Pagination v-if="tableData.length > 0" :paginationList="paginationList"
|
|
|
@handleCurrentChange="handleCurrentChange"
|
|
@@ -51,7 +36,8 @@
|
|
|
<template v-if="next">
|
|
|
<div class="align" style="height: 400px">
|
|
|
<span class="text ">设备类别</span>
|
|
|
- <el-cascader :options="options" clearable v-model="deviceVal" @change="changeLinshi"
|
|
|
+ <el-cascader :options="list" clearable v-model="deviceVal" @change="changeLinshi"
|
|
|
+ :props="optionProps"
|
|
|
class="adm-select"></el-cascader>
|
|
|
|
|
|
</div>
|
|
@@ -73,7 +59,7 @@
|
|
|
<script lang="ts">
|
|
|
import { Component, Vue } from "vue-property-decorator";
|
|
|
import { AdmMultiTable, AdmSearch, dataForm, Pagination, Statistics } from '../components/index'
|
|
|
-import { BeatchQueryParam, dictInfo } from "@/api/equipComponent";
|
|
|
+import { allDevice, BeatchQueryParam, dictInfo } from "@/api/equipComponent";
|
|
|
import { queryCount, queryEquip } from "@/api/datacenter";
|
|
|
import { UserModule } from "@/store/modules/user";
|
|
|
import tools from "@/utils/maintain"
|
|
@@ -84,42 +70,11 @@ 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: 'ACATFU',
|
|
|
- label: '新风机组',
|
|
|
- }, {
|
|
|
- value: 'ACATIO',
|
|
|
- label: '空调风口',
|
|
|
- }]
|
|
|
- }, {
|
|
|
- value: 'fangpaiyan',
|
|
|
- label: '防排烟系统',
|
|
|
- children: [{
|
|
|
- value: 'FFSCIO',
|
|
|
- label: '排烟风机',
|
|
|
- }]
|
|
|
- }, {
|
|
|
- value: 'fangfeng',
|
|
|
- label: '通风系统',
|
|
|
- children: [{
|
|
|
- value: 'ACVTSF',
|
|
|
- label: '通风风机',
|
|
|
- }, {
|
|
|
- value: 'ACVTIO',
|
|
|
- label: '通风风口',
|
|
|
- }]
|
|
|
- }]
|
|
|
+ optionProps = {
|
|
|
+ value: 'code',
|
|
|
+ label: 'name',
|
|
|
+ children: 'children'
|
|
|
+ }
|
|
|
|
|
|
// loading
|
|
|
loading = false
|
|
@@ -174,7 +129,7 @@ export default class extends Vue {
|
|
|
}
|
|
|
|
|
|
created() {
|
|
|
- // this.deviceList();
|
|
|
+ this.deviceList();
|
|
|
this.dataCount()
|
|
|
}
|
|
|
|
|
@@ -186,43 +141,24 @@ 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)
|
|
|
-// })
|
|
|
-// })
|
|
|
-// 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
|
|
|
-// })
|
|
|
-// }
|
|
|
+ deviceList() {
|
|
|
+ allDevice({}).then(res => {
|
|
|
+ this.list = res.content
|
|
|
+ console.log(res)
|
|
|
+ })
|
|
|
+ }
|
|
|
|
|
|
|
|
|
// todo 临时假数据函数
|
|
|
private changeLinshi(val) {
|
|
|
- console.log(this.linshi,this.linshi[1])
|
|
|
- if (this.linshi[1]) {
|
|
|
+ console.log(this.deviceType, this.deviceType[1])
|
|
|
+ if (this.deviceType[1]) {
|
|
|
this.loading = true
|
|
|
let param = {
|
|
|
- category: this.linshi[1]
|
|
|
+ category: this.deviceType[1]
|
|
|
}
|
|
|
let param2 = {
|
|
|
- filters: this.linshi[1] ? `classCode='${ this.linshi[1] }'` : undefined,
|
|
|
+ filters: this.deviceType[1] ? `classCode='${ this.deviceType[1] }'` : undefined,
|
|
|
pageNumber: this.paginationList.page,
|
|
|
pageSize: this.paginationList.size,
|
|
|
orders: "createTime desc, id asc",
|
|
@@ -298,11 +234,11 @@ export default class extends Vue {
|
|
|
if (Object.keys(this.headerInformation).length > 0) {
|
|
|
this.headerInformation.dictStages.forEach(item => {
|
|
|
if (this.currentHeader == item.name) {
|
|
|
- // item.infos && item.infos.forEach(val => header.push(val))
|
|
|
- item.infos && item.infos.forEach(val => {
|
|
|
- val.name = val.unit ? `${ val.name }(${ val.unit })` : val.name
|
|
|
- header.push(val)
|
|
|
- })
|
|
|
+ item.infos && item.infos.forEach(val => header.push(val))
|
|
|
+ // item.infos && item.infos.forEach(val => {
|
|
|
+ // val.name = val.unit ? `${ val.name }(${ val.unit })` : val.name
|
|
|
+ // header.push(val)
|
|
|
+ // })
|
|
|
}
|
|
|
})
|
|
|
}
|
|
@@ -408,7 +344,7 @@ export default class extends Vue {
|
|
|
SearchValue(val: string) {
|
|
|
this.inputSearch = val
|
|
|
// this.handleFilter(this.deviceType)
|
|
|
- this.changeLinshi(this.linshi[1])
|
|
|
+ this.changeLinshi(this.deviceType[1])
|
|
|
}
|
|
|
|
|
|
// 当前分页
|
|
@@ -416,13 +352,13 @@ export default class extends Vue {
|
|
|
console.log(val)
|
|
|
this.paginationList.page = val
|
|
|
// this.handleFilter(this.deviceType)
|
|
|
- this.changeLinshi(this.linshi[1])
|
|
|
+ this.changeLinshi(this.deviceType[1])
|
|
|
}
|
|
|
|
|
|
handleSizeChange(val: number) {
|
|
|
this.paginationList.size = val
|
|
|
// this.handleFilter(this.deviceType)
|
|
|
- this.changeLinshi(this.linshi[1])
|
|
|
+ this.changeLinshi(this.deviceType[1])
|
|
|
}
|
|
|
|
|
|
// 添加设备
|