|
@@ -1,8 +1,8 @@
|
|
<template>
|
|
<template>
|
|
- <div class="app-container" >
|
|
|
|
|
|
+ <div class="app-container">
|
|
<el-row :gutter="20">
|
|
<el-row :gutter="20">
|
|
- <el-col :span="4" :xs="24" >
|
|
|
|
- <div class="head-container" >
|
|
|
|
|
|
+ <el-col :span="4" :xs="24">
|
|
|
|
+ <div class="head-container">
|
|
<el-input
|
|
<el-input
|
|
v-model="areaName"
|
|
v-model="areaName"
|
|
placeholder="请输入区域名称"
|
|
placeholder="请输入区域名称"
|
|
@@ -34,23 +34,28 @@
|
|
<el-tab-pane label="输能设备" name="W"></el-tab-pane>
|
|
<el-tab-pane label="输能设备" name="W"></el-tab-pane>
|
|
<el-tab-pane label="用能设备" name="Z"></el-tab-pane>
|
|
<el-tab-pane label="用能设备" name="Z"></el-tab-pane>
|
|
</el-tabs>
|
|
</el-tabs>
|
|
- <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
|
|
|
|
|
+ <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
|
|
|
|
+ label-width="68px"
|
|
|
|
+ >
|
|
<el-form-item label="设备分类" prop="deviceSubCategory">
|
|
<el-form-item label="设备分类" prop="deviceSubCategory">
|
|
- <el-select v-model="queryParams.deviceSubCategory" >
|
|
|
|
|
|
+ <el-select v-model="queryParams.deviceSubCategory">
|
|
<el-option v-for="item in subCategoryOptions" placeholder="设备分类" :label="item.name" :value="item.code"
|
|
<el-option v-for="item in subCategoryOptions" placeholder="设备分类" :label="item.name" :value="item.code"
|
|
- :key="item.code" />
|
|
|
|
|
|
+ :key="item.code"
|
|
|
|
+ />
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="归属设施" prop="refFacs">
|
|
<el-form-item label="归属设施" prop="refFacs">
|
|
<el-select v-model="queryParams.refFacs">
|
|
<el-select v-model="queryParams.refFacs">
|
|
<el-option v-for="item in facsOptions" :label="item.facsName" :value="item.facsCode"
|
|
<el-option v-for="item in facsOptions" :label="item.facsName" :value="item.facsCode"
|
|
- :key="item.facsCode" />
|
|
|
|
|
|
+ :key="item.facsCode"
|
|
|
|
+ />
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="子系统" prop="subsystemCode">
|
|
<el-form-item label="子系统" prop="subsystemCode">
|
|
<el-select v-model="queryParams.subsystemCode">
|
|
<el-select v-model="queryParams.subsystemCode">
|
|
<el-option v-for="item in subsystemOptions" :label="item.systemName" :value="item.systemCode"
|
|
<el-option v-for="item in subsystemOptions" :label="item.systemName" :value="item.systemCode"
|
|
- :key="item.systemCode" />
|
|
|
|
|
|
+ :key="item.systemCode"
|
|
|
|
+ />
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item>
|
|
<el-form-item>
|
|
@@ -59,17 +64,17 @@
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
|
|
|
|
- <el-table v-loading="loading" :data="deviceList" >
|
|
|
|
|
|
+ <el-table v-loading="loading" :data="deviceList">
|
|
<el-table-column label="设备名称" align="left" prop="deviceName"/>
|
|
<el-table-column label="设备名称" align="left" prop="deviceName"/>
|
|
<el-table-column label="归属区域" align="left" prop="areaPath" width="280px"/>
|
|
<el-table-column label="归属区域" align="left" prop="areaPath" width="280px"/>
|
|
<el-table-column label="设备分类" align="center" prop="deviceCategoryName"/>
|
|
<el-table-column label="设备分类" align="center" prop="deviceCategoryName"/>
|
|
<el-table-column label="归属设施" align="center" prop="refFacsName"/>
|
|
<el-table-column label="归属设施" align="center" prop="refFacsName"/>
|
|
<el-table-column label="子系统" align="center" prop="subsystemName"/>
|
|
<el-table-column label="子系统" align="center" prop="subsystemName"/>
|
|
-<!-- <el-table-column label="设备状态" align="center" prop="deviceStatus">-->
|
|
|
|
-<!-- <template slot-scope="scope">-->
|
|
|
|
-<!-- <dict-tag :options="dict.type.sys_device_stat" :value="scope.row.deviceStatus"/>-->
|
|
|
|
-<!-- </template>-->
|
|
|
|
-<!-- </el-table-column>-->
|
|
|
|
|
|
+ <!-- <el-table-column label="设备状态" align="center" prop="deviceStatus">-->
|
|
|
|
+ <!-- <template slot-scope="scope">-->
|
|
|
|
+ <!-- <dict-tag :options="dict.type.sys_device_stat" :value="scope.row.deviceStatus"/>-->
|
|
|
|
+ <!-- </template>-->
|
|
|
|
+ <!-- </el-table-column>-->
|
|
<el-table-column label="设备状态" align="center" prop="deviceStatus">
|
|
<el-table-column label="设备状态" align="center" prop="deviceStatus">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<span
|
|
<span
|
|
@@ -92,7 +97,7 @@
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- <el-button size="mini" type="text" @click="handleDetail(scope.row)">详情</el-button>
|
|
|
|
|
|
+ <el-button size="mini" type="text" @click="handleDetail(scope.row)">详情</el-button>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
@@ -209,12 +214,12 @@
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import { listDevRecursionByArea } from '@/api/device/device'
|
|
import { listDevRecursionByArea } from '@/api/device/device'
|
|
-import { areaTreeSelect } from "@/api/basecfg/area"
|
|
|
|
|
|
+import { areaTreeSelect } from '@/api/basecfg/area'
|
|
import { getFacsCategorygetByCode, listAllFacs } from '@/api/basecfg/emsfacs'
|
|
import { getFacsCategorygetByCode, listAllFacs } from '@/api/basecfg/emsfacs'
|
|
import { listSubsystemAll } from '@/api/adapter/subsystem'
|
|
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'
|
|
|
|
+import Treeselect from '@riophae/vue-treeselect'
|
|
|
|
+import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: 'Device',
|
|
name: 'Device',
|
|
@@ -251,8 +256,8 @@ export default {
|
|
subsystemOptions: undefined,
|
|
subsystemOptions: undefined,
|
|
subCategoryOptions: undefined,
|
|
subCategoryOptions: undefined,
|
|
defaultProps: {
|
|
defaultProps: {
|
|
- children: "children",
|
|
|
|
- label: "label"
|
|
|
|
|
|
+ children: 'children',
|
|
|
|
+ label: 'label'
|
|
},
|
|
},
|
|
curRow: {},
|
|
curRow: {},
|
|
attrData: [],
|
|
attrData: [],
|
|
@@ -262,26 +267,21 @@ export default {
|
|
queryParams: {
|
|
queryParams: {
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
pageSize: 10,
|
|
pageSize: 10,
|
|
- deviceCode: null,
|
|
|
|
- deviceName: null,
|
|
|
|
deviceSubCategory: '',
|
|
deviceSubCategory: '',
|
|
deviceCategory: 'E',
|
|
deviceCategory: 'E',
|
|
- deviceStatus: null,
|
|
|
|
locationType: null,
|
|
locationType: null,
|
|
locationRef: null,
|
|
locationRef: null,
|
|
refFacs: null,
|
|
refFacs: null,
|
|
subsystemCode: null
|
|
subsystemCode: null
|
|
- },
|
|
|
|
- // 表单参数
|
|
|
|
- form: {}
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
- this.getList();
|
|
|
|
- this.getAreaTree('Building');
|
|
|
|
- this.getFacsOptions();
|
|
|
|
- this.getSubsystem();
|
|
|
|
- this.getSubCategorygetByCode();
|
|
|
|
|
|
+ this.getList()
|
|
|
|
+ this.getAreaTree('Building')
|
|
|
|
+ this.getFacsOptions()
|
|
|
|
+ this.getSubsystem()
|
|
|
|
+ this.getSubCategorygetByCode()
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
getDeviceStatusText(status) {
|
|
getDeviceStatusText(status) {
|
|
@@ -289,20 +289,20 @@ export default {
|
|
0: '运行',
|
|
0: '运行',
|
|
1: '故障',
|
|
1: '故障',
|
|
2: '未运行'
|
|
2: '未运行'
|
|
- };
|
|
|
|
- return statusMap[status] || '';
|
|
|
|
|
|
+ }
|
|
|
|
+ return statusMap[status] || ''
|
|
},
|
|
},
|
|
getDeviceStatusTextColor(status) {
|
|
getDeviceStatusTextColor(status) {
|
|
- if (status === 0) return 'rgb(232,244,255)';
|
|
|
|
- if (status === 1) return '#FFFFFF';
|
|
|
|
- if (status === 2) return 'rgb(255,235,235)';
|
|
|
|
- return '#000000'; // 默认黑色文字
|
|
|
|
|
|
+ if (status === 0) return 'rgb(232,244,255)'
|
|
|
|
+ if (status === 1) return '#FFFFFF'
|
|
|
|
+ if (status === 2) return 'rgb(255,235,235)'
|
|
|
|
+ return '#000000' // 默认黑色文字
|
|
},
|
|
},
|
|
getDeviceStatusBgColor(status) {
|
|
getDeviceStatusBgColor(status) {
|
|
- if (status === 0) return 'rgb(117,186,255)';
|
|
|
|
- if (status === 1) return 'rgb(242,197,92)';
|
|
|
|
- if (status === 2) return 'rgb(255,159,159)';
|
|
|
|
- return 'transparent'; // 默认无背景色
|
|
|
|
|
|
+ if (status === 0) return 'rgb(117,186,255)'
|
|
|
|
+ if (status === 1) return 'rgb(242,197,92)'
|
|
|
|
+ if (status === 2) return 'rgb(255,159,159)'
|
|
|
|
+ return 'transparent' // 默认无背景色
|
|
},
|
|
},
|
|
/** 查询能源设备列表 */
|
|
/** 查询能源设备列表 */
|
|
getList() {
|
|
getList() {
|
|
@@ -316,45 +316,29 @@ export default {
|
|
/** 查询区域树结构 */
|
|
/** 查询区域树结构 */
|
|
getAreaTree(tier) {
|
|
getAreaTree(tier) {
|
|
areaTreeSelect(tier).then(response => {
|
|
areaTreeSelect(tier).then(response => {
|
|
- this.treeAreaOptions = [{
|
|
|
|
|
|
+ this.treeAreaOptions = [{
|
|
id: '-1',
|
|
id: '-1',
|
|
label: '全部',
|
|
label: '全部',
|
|
children: response.data
|
|
children: response.data
|
|
}]
|
|
}]
|
|
- });
|
|
|
|
|
|
+ })
|
|
},
|
|
},
|
|
// 筛选节点
|
|
// 筛选节点
|
|
filterNode(value, data) {
|
|
filterNode(value, data) {
|
|
- if (!value) return true;
|
|
|
|
- return data.label.indexOf(value) !== -1;
|
|
|
|
|
|
+ if (!value) return true
|
|
|
|
+ return data.label.indexOf(value) !== -1
|
|
},
|
|
},
|
|
// 节点单击事件
|
|
// 节点单击事件
|
|
handleNodeClick(data) {
|
|
handleNodeClick(data) {
|
|
- this.queryParams.locationType = data.tier;
|
|
|
|
- this.queryParams.locationRef = data.id;
|
|
|
|
- this.handleQuery();
|
|
|
|
|
|
+ this.queryParams.locationType = data.tier
|
|
|
|
+ this.queryParams.locationRef = data.id
|
|
|
|
+ this.handleQuery()
|
|
},
|
|
},
|
|
// 取消按钮
|
|
// 取消按钮
|
|
cancel() {
|
|
cancel() {
|
|
this.open = false
|
|
this.open = false
|
|
this.reset()
|
|
this.reset()
|
|
},
|
|
},
|
|
- // 表单重置
|
|
|
|
- reset() {
|
|
|
|
- this.form = {
|
|
|
|
- id: null,
|
|
|
|
- deviceCode: null,
|
|
|
|
- deviceName: null,
|
|
|
|
- deviceSubCategory: null,
|
|
|
|
- deviceCategory: null,
|
|
|
|
- deviceStatus: null,
|
|
|
|
- locationRef: null,
|
|
|
|
- refFacs: null,
|
|
|
|
- createTime: null,
|
|
|
|
- updateTime: null
|
|
|
|
- }
|
|
|
|
- this.resetForm('form')
|
|
|
|
- },
|
|
|
|
/** 搜索按钮操作 */
|
|
/** 搜索按钮操作 */
|
|
handleQuery() {
|
|
handleQuery() {
|
|
this.queryParams.pageNum = 1
|
|
this.queryParams.pageNum = 1
|
|
@@ -362,23 +346,23 @@ export default {
|
|
},
|
|
},
|
|
/** 重置按钮操作 */
|
|
/** 重置按钮操作 */
|
|
resetQuery() {
|
|
resetQuery() {
|
|
- this.queryParams.locationType = null;
|
|
|
|
- this.queryParams.locationRef = null;
|
|
|
|
|
|
+ this.queryParams.locationType = null
|
|
|
|
+ this.queryParams.locationRef = null
|
|
this.resetForm('queryForm')
|
|
this.resetForm('queryForm')
|
|
this.handleQuery()
|
|
this.handleQuery()
|
|
},
|
|
},
|
|
// 设备状态详情
|
|
// 设备状态详情
|
|
handleDetail(row) {
|
|
handleDetail(row) {
|
|
this.reset()
|
|
this.reset()
|
|
- this.curRow= row
|
|
|
|
- console.log("设备data",this.curRow)
|
|
|
|
|
|
+ this.curRow = row
|
|
|
|
+ console.log('设备data', this.curRow)
|
|
getModelByCode(this.curRow.deviceModel).then(response => {
|
|
getModelByCode(this.curRow.deviceModel).then(response => {
|
|
this.open = true
|
|
this.open = true
|
|
- const code=response.data
|
|
|
|
- console.log("code",code)
|
|
|
|
- this.attrData=response.data.attrList
|
|
|
|
- this.eventData=response.data.eventList
|
|
|
|
- this.abilityData=response.data.abilityList
|
|
|
|
|
|
+ const code = response.data
|
|
|
|
+ console.log('code', code)
|
|
|
|
+ this.attrData = response.data.attrList
|
|
|
|
+ this.eventData = response.data.eventList
|
|
|
|
+ this.abilityData = response.data.abilityList
|
|
})
|
|
})
|
|
},
|
|
},
|
|
getFacsOptions() {
|
|
getFacsOptions() {
|
|
@@ -387,30 +371,37 @@ export default {
|
|
subCategory: this.queryParams.deviceSubCategory
|
|
subCategory: this.queryParams.deviceSubCategory
|
|
}
|
|
}
|
|
listAllFacs(getFacsParams).then(response => {
|
|
listAllFacs(getFacsParams).then(response => {
|
|
- this.facsOptions = response.data;
|
|
|
|
|
|
+ this.facsOptions = response.data
|
|
})
|
|
})
|
|
},
|
|
},
|
|
getSubsystem() {
|
|
getSubsystem() {
|
|
- listSubsystemAll().then(response =>{
|
|
|
|
- this.subsystemOptions = response.data;
|
|
|
|
|
|
+ listSubsystemAll().then(response => {
|
|
|
|
+ this.subsystemOptions = response.data
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- getSubCategorygetByCode () {
|
|
|
|
|
|
+ getSubCategorygetByCode() {
|
|
getFacsCategorygetByCode(this.queryParams.deviceCategory).then(response => {
|
|
getFacsCategorygetByCode(this.queryParams.deviceCategory).then(response => {
|
|
- this.subCategoryOptions = response.data.subtypeList||[];
|
|
|
|
|
|
+ this.subCategoryOptions = response.data.subtypeList || []
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- deviceCategoryChange () {
|
|
|
|
- this.queryParams.deviceSubCategory = ''
|
|
|
|
|
|
+ deviceCategoryChange() {
|
|
|
|
+ this.reset()
|
|
if (this.queryParams.deviceCategory === 'E' || this.queryParams.deviceCategory === 'W'
|
|
if (this.queryParams.deviceCategory === 'E' || this.queryParams.deviceCategory === 'W'
|
|
- || this.queryParams.deviceCategory === 'T'|| this.queryParams.deviceCategory === 'C') {
|
|
|
|
- this.getAreaTree("Building")
|
|
|
|
|
|
+ || this.queryParams.deviceCategory === 'T' || this.queryParams.deviceCategory === 'C') {
|
|
|
|
+ this.getAreaTree('Building')
|
|
} else if (this.queryParams.deviceCategory === 'Z') {
|
|
} else if (this.queryParams.deviceCategory === 'Z') {
|
|
- this.getAreaTree("Zoning")
|
|
|
|
|
|
+ this.getAreaTree('Zoning')
|
|
}
|
|
}
|
|
this.getSubCategorygetByCode()
|
|
this.getSubCategorygetByCode()
|
|
this.getFacsOptions()
|
|
this.getFacsOptions()
|
|
this.handleQuery()
|
|
this.handleQuery()
|
|
|
|
+ },
|
|
|
|
+ reset() {
|
|
|
|
+ this.queryParams.pageNum = 1
|
|
|
|
+ this.queryParams.pageSize = 10
|
|
|
|
+ this.queryParams.deviceSubCategory = ''
|
|
|
|
+ this.queryParams.refFacs = null
|
|
|
|
+ this.queryParams.subsystemCode = null
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -429,5 +420,4 @@ export default {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
</style>
|
|
</style>
|