|
@@ -7,7 +7,7 @@
|
|
|
style="margin-bottom: 20px" />
|
|
|
</div>
|
|
|
<div class="head-container" style="height: 100vh; overflow: hidden; position: relative;">
|
|
|
- <el-tree :data="areaOptions" :props="defaultProps" :expand-on-click-node="false"
|
|
|
+ <el-tree :data="treeAreaOptions" :props="defaultProps" :expand-on-click-node="false"
|
|
|
:filter-node-method="filterNode" ref="tree" node-key="id" default-expand-all highlight-current
|
|
|
@node-click="handleNodeClick" style="height: calc(100vh - 50px); overflow-y: auto;" />
|
|
|
</div>
|
|
@@ -72,11 +72,10 @@
|
|
|
<el-table v-loading="loading" :data="deviceList" @selection-change="handleSelectionChange">
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
<el-table-column label="设备名称" align="left" prop="deviceName" />
|
|
|
- <el-table-column label="设备代码" align="left" prop="deviceCode" width="180px" />
|
|
|
- <el-table-column label="归属区域" align="left" prop="areaPath" width="280px" />
|
|
|
+ <el-table-column label="安装位置" align="left" prop="areaPath" width="220px" />
|
|
|
<el-table-column label="归属设施" align="center" prop="refFacsName" />
|
|
|
<el-table-column label="设备分类" align="center" prop="deviceCategoryName" />
|
|
|
- <el-table-column label="所属子系统" align="center" prop="subsystemName" />
|
|
|
+ <el-table-column label="子系统" align="center" prop="subsystemName" />
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
<template slot-scope="scope">
|
|
|
<el-button size="mini" type="text" icon="el-icon-info" @click="handleDetail(scope.row)" v-hasPermi="['basecfg:emsfacs:edit']">
|
|
@@ -104,8 +103,8 @@
|
|
|
:key="item.facsCode" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="归属区域" prop="refArea">
|
|
|
- <treeselect v-model="form.refArea" :options="areaOptions" :show-count="true" placeholder="请选择所属建筑"
|
|
|
+ <el-form-item label="安装位置" prop="refArea">
|
|
|
+ <treeselect v-model="form.refArea" :options="totalAreaOptions" :show-count="true" placeholder="请选择所属建筑"
|
|
|
@select="handleAreaType" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="设备代码" prop="deviceCode">
|
|
@@ -204,13 +203,14 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import {listDevRecursionByArea, getDevice, delDevice, addDevice, updateDevice} from '@/api/device/device'
|
|
|
-import {areaTreeSelect} from "@/api/basecfg/area"
|
|
|
-import {listAllFacs,getFacsCategorygetByCode} from "@/api/basecfg/emsfacs"
|
|
|
-import {listSubsystemAll} from '@/api/adapter/subsystem'
|
|
|
+import { listDevRecursionByArea, getDevice, delDevice, addDevice, updateDevice} from '@/api/device/device'
|
|
|
+import { areaTreeSelect } from "@/api/basecfg/area"
|
|
|
+import { listAllFacs, getFacsCategorygetByCode, listFacsByCategory } from "@/api/basecfg/emsfacs"
|
|
|
+import { listSubsystemAll } from '@/api/adapter/subsystem'
|
|
|
+import { getModelByCode } from "@/api/basecfg/objModel";
|
|
|
import Treeselect from "@riophae/vue-treeselect";
|
|
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
|
-import {getModelByCode} from "@/api/basecfg/objModel";
|
|
|
+
|
|
|
|
|
|
export default {
|
|
|
name: 'Device',
|
|
@@ -239,7 +239,8 @@ export default {
|
|
|
// 区域名称
|
|
|
areaName: undefined,
|
|
|
// 区域树选项
|
|
|
- areaOptions: undefined,
|
|
|
+ treeAreaOptions: undefined,
|
|
|
+ totalAreaOptions: undefined,
|
|
|
// 设施选项
|
|
|
facsOptions: undefined,
|
|
|
// 设备分类
|
|
@@ -254,7 +255,7 @@ export default {
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
deviceCode: null,
|
|
|
- deviceSubCategory: null,
|
|
|
+ deviceSubCategory: '',
|
|
|
deviceCategory: 'E',
|
|
|
areaType: null,
|
|
|
refArea: null,
|
|
@@ -272,7 +273,7 @@ export default {
|
|
|
{required: true, message: '归属设施', trigger: 'blur'}
|
|
|
],
|
|
|
refArea: [
|
|
|
- {required: true, message: '归属区域', trigger: 'blur'}
|
|
|
+ {required: true, message: '安装位置', trigger: 'blur'}
|
|
|
],
|
|
|
deviceCode: [
|
|
|
{required: true, message: '设备代码不能为空', trigger: 'blur'}
|
|
@@ -291,8 +292,8 @@ export default {
|
|
|
},
|
|
|
created () {
|
|
|
this.getList();
|
|
|
- this.getAreaTree('Area');
|
|
|
- this.getFacsOptions("");
|
|
|
+ this.getAreaTree('Building');
|
|
|
+ this.getFacsOptions();
|
|
|
this.getSubsystem();
|
|
|
this.getSubCategorygetByCode();
|
|
|
},
|
|
@@ -309,7 +310,7 @@ export default {
|
|
|
/** 查询区域树结构 */
|
|
|
getAreaTree (tier) {
|
|
|
areaTreeSelect(tier).then(response => {
|
|
|
- this.areaOptions = response.data;
|
|
|
+ this.treeAreaOptions = response.data;
|
|
|
});
|
|
|
},
|
|
|
// 筛选节点
|
|
@@ -392,6 +393,10 @@ export default {
|
|
|
this.open = true
|
|
|
this.title = '修改能源设备'
|
|
|
})
|
|
|
+ const tier = 'Zoning';
|
|
|
+ areaTreeSelect(tier).then(response => {
|
|
|
+ this.totalAreaOptions = response.data;
|
|
|
+ });
|
|
|
},
|
|
|
/** 提交按钮 */
|
|
|
submitForm () {
|
|
@@ -434,7 +439,7 @@ export default {
|
|
|
this.form.areaType = data.tier;
|
|
|
},
|
|
|
getFacsOptions (areaCode) {
|
|
|
- listAllFacs(areaCode).then(response => {
|
|
|
+ listFacsByCategory(this.queryParams.deviceCategory, this.queryParams.deviceSubCategory).then(response => {
|
|
|
this.facsOptions = response.data;
|
|
|
})
|
|
|
},
|
|
@@ -452,11 +457,12 @@ export default {
|
|
|
this.queryParams.deviceSubCategory = ''
|
|
|
if (this.queryParams.deviceCategory === 'E' || this.queryParams.deviceCategory === 'W'
|
|
|
|| this.queryParams.deviceCategory === 'T'|| this.queryParams.deviceCategory === 'C') {
|
|
|
- this.getAreaTree("Area")
|
|
|
+ this.getAreaTree("Building")
|
|
|
} else if (this.queryParams.deviceCategory === 'Z') {
|
|
|
this.getAreaTree("Zoning")
|
|
|
}
|
|
|
this.getSubCategorygetByCode()
|
|
|
+ this.getFacsOptions()
|
|
|
this.handleQuery()
|
|
|
}
|
|
|
}
|