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