|
@@ -49,7 +49,7 @@
|
|
<template v-if="next">
|
|
<template v-if="next">
|
|
<div class="align " :style="{ 'height': isWidth ? '400px':'200px' }">
|
|
<div class="align " :style="{ 'height': isWidth ? '400px':'200px' }">
|
|
<span class="text ">设备类别</span>
|
|
<span class="text ">设备类别</span>
|
|
- <el-cascader :options="list" clearable v-model="deviceVal"
|
|
|
|
|
|
+ <el-cascader :options="addlist" clearable v-model="deviceVal"
|
|
:props="optionProps"
|
|
:props="optionProps"
|
|
class="adm-select"></el-cascader>
|
|
class="adm-select"></el-cascader>
|
|
</div>
|
|
</div>
|
|
@@ -97,7 +97,7 @@
|
|
import {Component, Vue, Watch} from "vue-property-decorator";
|
|
import {Component, Vue, Watch} from "vue-property-decorator";
|
|
import {AdmMultiTable, AdmSearch, dataForm, Pagination, Statistics} from '../components/index'
|
|
import {AdmMultiTable, AdmSearch, dataForm, Pagination, Statistics} from '../components/index'
|
|
import {allDevice, BeatchQueryParam, dictInfo} from "@/api/equipComponent";
|
|
import {allDevice, BeatchQueryParam, dictInfo} from "@/api/equipComponent";
|
|
-import {createEquip, queryCount, queryEquip, updateEquip, deleteEquip} from "@/api/datacenter";
|
|
|
|
|
|
+import {createEquip, queryCount, queryEquip, updateEquip, deleteEquip, allDevices} from "@/api/datacenter";
|
|
import {UserModule} from "@/store/modules/user";
|
|
import {UserModule} from "@/store/modules/user";
|
|
import deviceGraph from "./components/deviceGraph.vue"
|
|
import deviceGraph from "./components/deviceGraph.vue"
|
|
import tools from "@/utils/maintain"
|
|
import tools from "@/utils/maintain"
|
|
@@ -141,6 +141,8 @@ export default class extends Vue {
|
|
inputSearch = ''
|
|
inputSearch = ''
|
|
// 下拉数据
|
|
// 下拉数据
|
|
list = []
|
|
list = []
|
|
|
|
+ // 添加设备下拉数据
|
|
|
|
+ addlist = []
|
|
// 弹窗开关
|
|
// 弹窗开关
|
|
dialogVisible = false
|
|
dialogVisible = false
|
|
// tabs数据
|
|
// tabs数据
|
|
@@ -177,6 +179,11 @@ export default class extends Vue {
|
|
return UserModule.projectId
|
|
return UserModule.projectId
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // 获取级联的最后一项
|
|
|
|
+ get deviceTypeEnd() {
|
|
|
|
+ return this.deviceType[this.deviceType.length - 1]
|
|
|
|
+ }
|
|
|
|
+
|
|
created() {
|
|
created() {
|
|
this.deviceList();
|
|
this.deviceList();
|
|
this.dataCount()
|
|
this.dataCount()
|
|
@@ -198,13 +205,13 @@ export default class extends Vue {
|
|
}
|
|
}
|
|
|
|
|
|
handleChangeDevice() {
|
|
handleChangeDevice() {
|
|
- if (this.deviceType[2]) {
|
|
|
|
|
|
+ if (this.deviceTypeEnd) {
|
|
this.loading = true
|
|
this.loading = true
|
|
let param = {
|
|
let param = {
|
|
- category: this.deviceType[2]
|
|
|
|
|
|
+ category: this.deviceTypeEnd
|
|
}
|
|
}
|
|
let param2 = {
|
|
let param2 = {
|
|
- filters: this.deviceType[2] ? `classCode='${this.deviceType[2]}'` : undefined,
|
|
|
|
|
|
+ filters: this.deviceTypeEnd ? `classCode='${this.deviceTypeEnd}'` : undefined,
|
|
pageNumber: this.paginationList.page,
|
|
pageNumber: this.paginationList.page,
|
|
pageSize: this.paginationList.size,
|
|
pageSize: this.paginationList.size,
|
|
orders: "createTime desc, id asc",
|
|
orders: "createTime desc, id asc",
|
|
@@ -408,19 +415,19 @@ export default class extends Vue {
|
|
// 搜索
|
|
// 搜索
|
|
SearchValue(val: string) {
|
|
SearchValue(val: string) {
|
|
this.inputSearch = val
|
|
this.inputSearch = val
|
|
- this.handleChangeDevice(this.deviceType[2])
|
|
|
|
|
|
+ this.handleChangeDevice(this.deviceTypeEnd)
|
|
}
|
|
}
|
|
|
|
|
|
// 当前分页
|
|
// 当前分页
|
|
handleCurrentChange(val: number) {
|
|
handleCurrentChange(val: number) {
|
|
console.log(val)
|
|
console.log(val)
|
|
this.paginationList.page = val
|
|
this.paginationList.page = val
|
|
- this.handleChangeDevice(this.deviceType[2])
|
|
|
|
|
|
+ this.handleChangeDevice(this.deviceTypeEnd)
|
|
}
|
|
}
|
|
|
|
|
|
handleSizeChange(val: number) {
|
|
handleSizeChange(val: number) {
|
|
this.paginationList.size = val
|
|
this.paginationList.size = val
|
|
- this.handleChangeDevice(this.deviceType[2])
|
|
|
|
|
|
+ this.handleChangeDevice(this.deviceTypeEnd)
|
|
}
|
|
}
|
|
|
|
|
|
// 添加设备
|
|
// 添加设备
|
|
@@ -428,6 +435,9 @@ export default class extends Vue {
|
|
this.deviceMsg = '添加设备'
|
|
this.deviceMsg = '添加设备'
|
|
this.dialogVisible = true
|
|
this.dialogVisible = true
|
|
this.currRowContent = {}
|
|
this.currRowContent = {}
|
|
|
|
+ allDevices({"type": "systemEquipment"}).then(res => {
|
|
|
|
+ this.addlist = res.content
|
|
|
|
+ })
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|