|
@@ -3,28 +3,13 @@
|
|
|
<el-row :gutter="20">
|
|
|
<el-col :span="4" :xs="24">
|
|
|
<div class="head-container">
|
|
|
- <el-input
|
|
|
- v-model="areaName"
|
|
|
- placeholder="请输入区域名称"
|
|
|
- clearable
|
|
|
- size="small"
|
|
|
- prefix-icon="el-icon-search"
|
|
|
- style="margin-bottom: 20px"
|
|
|
- />
|
|
|
+ <el-input v-model="areaName" placeholder="请输入区域名称" clearable size="small" prefix-icon="el-icon-search"
|
|
|
+ style="margin-bottom: 20px" />
|
|
|
</div>
|
|
|
<div class="head-container" style="height: 100vh; overflow: hidden; position: relative;">
|
|
|
- <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;"
|
|
|
- />
|
|
|
+ <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>
|
|
|
</el-col>
|
|
|
<el-col :span="20" :xs="24">
|
|
@@ -35,27 +20,23 @@
|
|
|
<el-tab-pane label="用能设备" name="Z"></el-tab-pane>
|
|
|
</el-tabs>
|
|
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
|
|
|
- label-width="68px"
|
|
|
- >
|
|
|
+ label-width="68px">
|
|
|
<el-form-item label="设备分类" prop="deviceSubCategory">
|
|
|
<el-select v-model="queryParams.deviceSubCategory">
|
|
|
<el-option v-for="item in subCategoryOptions" placeholder="设备分类" :label="item.name" :value="item.code"
|
|
|
- :key="item.code"
|
|
|
- />
|
|
|
+ :key="item.code" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="归属设施" prop="refFacs">
|
|
|
<el-select v-model="queryParams.refFacs">
|
|
|
<el-option v-for="item in facsOptions" :label="item.facsName" :value="item.facsCode"
|
|
|
- :key="item.facsCode"
|
|
|
- />
|
|
|
+ :key="item.facsCode" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="子系统" prop="subsystemCode">
|
|
|
<el-select v-model="queryParams.subsystemCode">
|
|
|
<el-option v-for="item in subsystemOptions" :label="item.systemName" :value="item.systemCode"
|
|
|
- :key="item.systemCode"
|
|
|
- />
|
|
|
+ :key="item.systemCode" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
@@ -65,11 +46,11 @@
|
|
|
</el-form>
|
|
|
|
|
|
<el-table v-loading="loading" :data="deviceList">
|
|
|
- <el-table-column label="设备名称" align="left" prop="deviceName"/>
|
|
|
- <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="refFacsName"/>
|
|
|
- <el-table-column label="子系统" align="center" prop="subsystemName"/>
|
|
|
+ <el-table-column label="设备名称" align="left" prop="deviceName" />
|
|
|
+ <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="refFacsName" />
|
|
|
+ <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"/>-->
|
|
@@ -77,22 +58,20 @@
|
|
|
<!-- </el-table-column>-->
|
|
|
<el-table-column label="设备状态" align="center" prop="deviceStatus">
|
|
|
<template slot-scope="scope">
|
|
|
- <span
|
|
|
- :style="{
|
|
|
- padding: '6px 12px',
|
|
|
- borderRadius: '4px',
|
|
|
- display: 'inline-block',
|
|
|
- textAlign: 'center',
|
|
|
- cursor: 'pointer',
|
|
|
- color: getDeviceStatusTextColor(scope.row.deviceStatus),
|
|
|
- backgroundColor: getDeviceStatusBgColor(scope.row.deviceStatus),
|
|
|
- minWidth: '70px',
|
|
|
- height: '35px',
|
|
|
- textAlign: 'center'
|
|
|
- }"
|
|
|
- >
|
|
|
- {{ getDeviceStatusText(scope.row.deviceStatus) }}
|
|
|
- </span>
|
|
|
+ <span :style="{
|
|
|
+ padding: '6px 12px',
|
|
|
+ borderRadius: '4px',
|
|
|
+ display: 'inline-block',
|
|
|
+ textAlign: 'center',
|
|
|
+ cursor: 'pointer',
|
|
|
+ color: getDeviceStatusTextColor(scope.row.deviceStatus),
|
|
|
+ backgroundColor: getDeviceStatusBgColor(scope.row.deviceStatus),
|
|
|
+ minWidth: '70px',
|
|
|
+ height: '35px',
|
|
|
+ textAlign: 'center'
|
|
|
+ }">
|
|
|
+ {{ getDeviceStatusText(scope.row.deviceStatus) }}
|
|
|
+ </span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
@@ -102,13 +81,8 @@
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
|
|
|
- <pagination
|
|
|
- v-show="total>0"
|
|
|
- :total="total"
|
|
|
- :page.sync="queryParams.pageNum"
|
|
|
- :limit.sync="queryParams.pageSize"
|
|
|
- @pagination="getList"
|
|
|
- />
|
|
|
+ <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
|
|
|
+ :limit.sync="queryParams.pageSize" @pagination="getList" />
|
|
|
|
|
|
<!-- 设备基本信息 -->
|
|
|
<el-dialog :visible.sync="open" title="设备状态详情" custom-class="detail-dialog">
|
|
@@ -213,19 +187,19 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { listDevRecursionByArea } from '@/api/device/device'
|
|
|
-import { areaTreeSelect } from '@/api/basecfg/area'
|
|
|
-import { getFacsCategorygetByCode, listAllFacs } from '@/api/basecfg/emsfacs'
|
|
|
-import { listSubsystemAll } from '@/api/adapter/subsystem'
|
|
|
-import { getModelByCode } from '@/api/basecfg/objModel'
|
|
|
+import {listDevRecursionByArea} from '@/api/device/device'
|
|
|
+import {areaTreeSelect} from '@/api/basecfg/area'
|
|
|
+import {getFacsCategorygetByCode, listAllFacs} 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'
|
|
|
|
|
|
export default {
|
|
|
name: 'Device',
|
|
|
dicts: ['sys_device_stat'],
|
|
|
- components: { Treeselect },
|
|
|
- data() {
|
|
|
+ components: {Treeselect},
|
|
|
+ data () {
|
|
|
return {
|
|
|
// 遮罩层
|
|
|
loading: true,
|
|
@@ -276,7 +250,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- created() {
|
|
|
+ created () {
|
|
|
this.getList()
|
|
|
this.getAreaTree('Building')
|
|
|
this.getFacsOptions()
|
|
@@ -284,7 +258,7 @@ export default {
|
|
|
this.getSubCategorygetByCode()
|
|
|
},
|
|
|
methods: {
|
|
|
- getDeviceStatusText(status) {
|
|
|
+ getDeviceStatusText (status) {
|
|
|
const statusMap = {
|
|
|
0: '运行',
|
|
|
1: '故障',
|
|
@@ -292,20 +266,20 @@ export default {
|
|
|
}
|
|
|
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' // 默认黑色文字
|
|
|
},
|
|
|
- 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' // 默认无背景色
|
|
|
},
|
|
|
/** 查询能源设备列表 */
|
|
|
- getList() {
|
|
|
+ getList () {
|
|
|
this.loading = true
|
|
|
listDevRecursionByArea(this.queryParams).then(response => {
|
|
|
this.deviceList = response.rows
|
|
@@ -314,45 +288,45 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
/** 查询区域树结构 */
|
|
|
- getAreaTree(tier) {
|
|
|
+ getAreaTree (tier) {
|
|
|
areaTreeSelect(tier).then(response => {
|
|
|
this.treeAreaOptions = [{
|
|
|
id: '-1',
|
|
|
label: '全部',
|
|
|
- children: response.data
|
|
|
- }]
|
|
|
+ children: []
|
|
|
+ }].concat(response.data)
|
|
|
})
|
|
|
},
|
|
|
// 筛选节点
|
|
|
- filterNode(value, data) {
|
|
|
+ filterNode (value, data) {
|
|
|
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()
|
|
|
},
|
|
|
// 取消按钮
|
|
|
- cancel() {
|
|
|
+ cancel () {
|
|
|
this.open = false
|
|
|
this.reset()
|
|
|
},
|
|
|
/** 搜索按钮操作 */
|
|
|
- handleQuery() {
|
|
|
+ handleQuery () {
|
|
|
this.queryParams.pageNum = 1
|
|
|
this.getList()
|
|
|
},
|
|
|
/** 重置按钮操作 */
|
|
|
- resetQuery() {
|
|
|
+ resetQuery () {
|
|
|
this.queryParams.locationType = null
|
|
|
this.queryParams.locationRef = null
|
|
|
this.resetForm('queryForm')
|
|
|
this.handleQuery()
|
|
|
},
|
|
|
// 设备状态详情
|
|
|
- handleDetail(row) {
|
|
|
+ handleDetail (row) {
|
|
|
this.reset()
|
|
|
this.curRow = row
|
|
|
console.log('设备data', this.curRow)
|
|
@@ -365,7 +339,7 @@ export default {
|
|
|
this.abilityData = response.data.abilityList
|
|
|
})
|
|
|
},
|
|
|
- getFacsOptions() {
|
|
|
+ getFacsOptions () {
|
|
|
const getFacsParams = {
|
|
|
facsCategory: this.queryParams.deviceCategory,
|
|
|
subCategory: this.queryParams.deviceSubCategory
|
|
@@ -374,17 +348,17 @@ export default {
|
|
|
this.facsOptions = response.data
|
|
|
})
|
|
|
},
|
|
|
- getSubsystem() {
|
|
|
+ getSubsystem () {
|
|
|
listSubsystemAll().then(response => {
|
|
|
this.subsystemOptions = response.data
|
|
|
})
|
|
|
},
|
|
|
- getSubCategorygetByCode() {
|
|
|
+ getSubCategorygetByCode () {
|
|
|
getFacsCategorygetByCode(this.queryParams.deviceCategory).then(response => {
|
|
|
this.subCategoryOptions = response.data.subtypeList || []
|
|
|
})
|
|
|
},
|
|
|
- deviceCategoryChange() {
|
|
|
+ deviceCategoryChange () {
|
|
|
this.reset()
|
|
|
if (this.queryParams.deviceCategory === 'E' || this.queryParams.deviceCategory === 'W'
|
|
|
|| this.queryParams.deviceCategory === 'T' || this.queryParams.deviceCategory === 'C') {
|
|
@@ -396,7 +370,7 @@ export default {
|
|
|
this.getFacsOptions()
|
|
|
this.handleQuery()
|
|
|
},
|
|
|
- reset() {
|
|
|
+ reset () {
|
|
|
this.queryParams.pageNum = 1
|
|
|
this.queryParams.pageSize = 10
|
|
|
this.queryParams.deviceSubCategory = ''
|
|
@@ -409,15 +383,18 @@ export default {
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
.detail-dialog .el-dialog {
|
|
|
- width: 80%; /* 调整弹框宽度 */
|
|
|
+ width: 80%;
|
|
|
+ /* 调整弹框宽度 */
|
|
|
}
|
|
|
|
|
|
.section-title {
|
|
|
- font-size: 18px; /* 标题字体大小 */
|
|
|
- font-weight: bold; /* 字体加粗 */
|
|
|
- margin-top: 20px; /* 标题顶部间距 */
|
|
|
- margin-bottom: 10px; /* 标题底部间距 */
|
|
|
+ font-size: 18px;
|
|
|
+ /* 标题字体大小 */
|
|
|
+ font-weight: bold;
|
|
|
+ /* 字体加粗 */
|
|
|
+ margin-top: 20px;
|
|
|
+ /* 标题顶部间距 */
|
|
|
+ margin-bottom: 10px;
|
|
|
+ /* 标题底部间距 */
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
</style>
|