|
@@ -51,11 +51,6 @@
|
|
|
<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"/>-->
|
|
|
- <!-- </template>-->
|
|
|
- <!-- </el-table-column>-->
|
|
|
<el-table-column label="设备状态" align="center" prop="deviceStatus">
|
|
|
<template slot-scope="scope">
|
|
|
<span :style="{
|
|
@@ -84,101 +79,82 @@
|
|
|
<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">
|
|
|
<div v-if="curRow">
|
|
|
- <!-- 设施基本信息 -->
|
|
|
- <el-card class="box-card">
|
|
|
- <div slot="header" class="clearfix">
|
|
|
- <span class="section-title">设备状态基本信息</span>
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- <p><span class="bold">设备名称:</span>{{ curRow.deviceName }}</p>
|
|
|
- <p><span class="bold">设备代码:</span>{{ curRow.deviceCode }}</p>
|
|
|
- <p><span class="bold">归属设施:</span>{{ curRow.refFacs }}</p>
|
|
|
- <p><span class="bold">归属区域:</span>{{ curRow.areaPath }}</p>
|
|
|
- <p><span class="bold">子系统:</span>{{ curRow.subsystemName }}</p>
|
|
|
- <p><span class="bold">设备状态:</span>{{ curRow.deviceStatus }}</p>
|
|
|
- </div>
|
|
|
- </el-card>
|
|
|
+ <!--分页导航 @tab-click="handleTabClick"-->
|
|
|
+ <el-tabs v-model="activeTab" >
|
|
|
+ <el-tab-pane label="设备基本信息" name="basic"></el-tab-pane>
|
|
|
+ <el-tab-pane label="属性定义" name="attr"></el-tab-pane>
|
|
|
+ <el-tab-pane label="能力定义" name="ability"></el-tab-pane>
|
|
|
+ <el-tab-pane label="事件定义" name="event"></el-tab-pane>
|
|
|
+ </el-tabs>
|
|
|
|
|
|
+ <!-- 设备基本信息 -->
|
|
|
+ <div v-if="activeTab === 'basic'">
|
|
|
+ <el-card class="box-card">
|
|
|
+ <div slot="header" class="clearfix">
|
|
|
+ <span class="section-title">设备状态基本信息</span>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <p><span class="bold">设备名称:</span>{{ curRow.deviceName }}</p>
|
|
|
+ <p><span class="bold">设备代码:</span>{{ curRow.deviceCode }}</p>
|
|
|
+ <p><span class="bold">归属设施:</span>{{ curRow.refFacs }}</p>
|
|
|
+ <p><span class="bold">归属区域:</span>{{ curRow.areaPath }}</p>
|
|
|
+ <p><span class="bold">子系统:</span>{{ curRow.subsystemName }}</p>
|
|
|
+ <p>
|
|
|
+ <span class="bold">设备状态:</span>
|
|
|
+ <span :class="getDeviceStatusClass(curRow.deviceStatus)">
|
|
|
+ {{ getDeviceStatus(curRow.deviceStatus) }}
|
|
|
+ </span>
|
|
|
+ </p>
|
|
|
+ </div>
|
|
|
+ </el-card>
|
|
|
+ </div>
|
|
|
<!-- 属性信息 -->
|
|
|
- <el-card class="box-card" v-if="attrData.length > 0">
|
|
|
- <div slot="header" class="clearfix">
|
|
|
- <span class="section-title">属性定义</span>
|
|
|
- </div>
|
|
|
- <div v-for="(item, index) in attrData" :key="index">
|
|
|
- <p><span class="bold">属性名称:</span>{{ item.attrName }}</p>
|
|
|
- <p><span class="bold">属性标识:</span>{{ item.attrKey }}</p>
|
|
|
- <p><span class="bold">属性值:</span>{{ item.attrValue }}</p>
|
|
|
- <p><span class="bold">属性单位:</span>{{ item.attrUnit }}</p>
|
|
|
- <!-- 在每个条目之后添加横线,除了最后一个条目 -->
|
|
|
- <div v-if="index < attrData.length - 1" class="divider"></div>
|
|
|
- </div>
|
|
|
- </el-card>
|
|
|
- <el-card class="box-card" v-else>
|
|
|
- <div slot="header" class="clearfix">
|
|
|
- <span class="section-title">属性定义</span>
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- <p><span class="bold">属性名称:</span>暂无数据</p>
|
|
|
- <p><span class="bold">属性标识:</span>暂无数据</p>
|
|
|
- <p><span class="bold">属性值:</span>暂无数据</p>
|
|
|
- <p><span class="bold">属性单位:</span>暂无数据</p>
|
|
|
- </div>
|
|
|
- </el-card>
|
|
|
-
|
|
|
- <!-- 能力信息 -->
|
|
|
- <el-card class="box-card" v-if="abilityData.length > 0">
|
|
|
- <div slot="header" class="clearfix">
|
|
|
- <span class="section-title">能力定义</span>
|
|
|
- </div>
|
|
|
- <div v-for="(item, index) in abilityData" :key="index">
|
|
|
- <p><span class="bold">能力名称:</span>{{ item.abilityName }}</p>
|
|
|
- <p><span class="bold">能力键:</span>{{ item.abilityKey }}</p>
|
|
|
- <p><span class="bold">能力参数:</span>{{ item.abilityParam }}</p>
|
|
|
- <p><span class="bold">能力描述:</span>{{ item.abilityDesc }}</p>
|
|
|
- <!-- 在每个条目之后添加横线,除了最后一个条目 -->
|
|
|
- <div v-if="index < abilityData.length - 1" class="divider"></div>
|
|
|
- </div>
|
|
|
- </el-card>
|
|
|
- <el-card class="box-card" v-else>
|
|
|
- <div slot="header" class="clearfix">
|
|
|
- <span class="section-title">能力定义</span>
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- <p><span class="bold">能力名称:</span>暂无数据</p>
|
|
|
- <p><span class="bold">能力键:</span>暂无数据</p>
|
|
|
- <p><span class="bold">能力参数:</span>暂无数据</p>
|
|
|
- <p><span class="bold">能力描述:</span>暂无数据</p>
|
|
|
- </div>
|
|
|
- </el-card>
|
|
|
-
|
|
|
- <!-- 事件信息 -->
|
|
|
- <el-card class="box-card" v-if="eventData.length > 0">
|
|
|
- <div slot="header" class="clearfix">
|
|
|
- <span class="section-title">事件定义</span>
|
|
|
- </div>
|
|
|
- <div v-for="(item, index) in eventData" :key="index">
|
|
|
- <p><span class="bold">事件名称:</span>{{ item.eventKey }}</p>
|
|
|
- <p><span class="bold">事件类型:</span>{{ item.eventType === 1 ? '消息上报' : '异常告警' }}</p>
|
|
|
- <p><span class="bold">事件代码:</span>{{ item.eventCode }}</p>
|
|
|
- <p><span class="bold">外部事件代码:</span>{{ item.extEventCode }}</p>
|
|
|
- <!-- 在每个条目之后添加横线,除了最后一个条目 -->
|
|
|
- <div v-if="index < eventData.length - 1" class="divider"></div>
|
|
|
- </div>
|
|
|
- </el-card>
|
|
|
- <el-card class="box-card" v-else>
|
|
|
- <div slot="header" class="clearfix">
|
|
|
- <span class="section-title">事件定义</span>
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- <p><span class="bold">事件名称:</span>暂无数据</p>
|
|
|
- <p><span class="bold">事件类型:</span>暂无数据</p>
|
|
|
- <p><span class="bold">事件代码:</span>暂无数据</p>
|
|
|
- <p><span class="bold">外部事件代码:</span>暂无数据</p>
|
|
|
- </div>
|
|
|
- </el-card>
|
|
|
+ <div v-if="activeTab === 'attr'">
|
|
|
+ <el-card class="box-card">
|
|
|
+ <div slot="header" class="clearfix">
|
|
|
+ <span class="section-title">属性定义</span>
|
|
|
+ </div>
|
|
|
+ <el-table :data="attrData" style="width: 100%" :show-header="true" :empty-text="'暂无数据'">
|
|
|
+ <el-table-column type="index" label="序号" width="50" align="center"></el-table-column>
|
|
|
+ <el-table-column label="属性名称" prop="attrName"></el-table-column>
|
|
|
+ <el-table-column label="属性标识" prop="attrKey"></el-table-column>
|
|
|
+ <el-table-column label="属性值" prop="attrValue"></el-table-column>
|
|
|
+ <el-table-column label="属性单位" prop="attrUnit"></el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </el-card>
|
|
|
+ </div>
|
|
|
+ <!--能力定义-->
|
|
|
+ <div v-if="activeTab === 'ability'">
|
|
|
+ <el-card class="box-card">
|
|
|
+ <div slot="header" class="clearfix">
|
|
|
+ <span class="section-title">能力定义</span>
|
|
|
+ </div>
|
|
|
+ <el-table :data="abilityData" style="width: 100%" :show-header="true" :empty-text="'暂无数据'">
|
|
|
+ <el-table-column type="index" label="序号" width="50" align="center"></el-table-column>
|
|
|
+ <el-table-column label="能力名称" prop="abilityName"></el-table-column>
|
|
|
+ <el-table-column label="能力键" prop="abilityKey"></el-table-column>
|
|
|
+ <el-table-column label="能力参数" prop="abilityParam"></el-table-column>
|
|
|
+ <el-table-column label="能力描述" prop="abilityDesc"></el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </el-card>
|
|
|
+ </div>
|
|
|
+ <!--事件定义-->
|
|
|
+ <div v-if="activeTab === 'event'">
|
|
|
+ <el-card class="box-card">
|
|
|
+ <div slot="header" class="clearfix">
|
|
|
+ <span class="section-title">事件定义</span>
|
|
|
+ </div>
|
|
|
+ <el-table :data="eventData" style="width: 100%" :show-header="true" :empty-text="'暂无数据'">
|
|
|
+ <el-table-column type="index" label="序号" width="50" align="center"></el-table-column>
|
|
|
+ <el-table-column label="事件名称" prop="eventKey"></el-table-column>
|
|
|
+ <el-table-column label="事件类型" prop="eventType" :formatter="formatEventType"></el-table-column>
|
|
|
+ <el-table-column label="事件代码" prop="eventCode"></el-table-column>
|
|
|
+ <el-table-column label="外部事件代码" prop="extEventCode"></el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </el-card>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
</el-col>
|
|
@@ -201,6 +177,7 @@ export default {
|
|
|
components: {Treeselect},
|
|
|
data () {
|
|
|
return {
|
|
|
+ activeTab: 'basic', // 默认显示设备基本信息
|
|
|
// 遮罩层
|
|
|
loading: true,
|
|
|
// 选中数组
|
|
@@ -257,6 +234,16 @@ export default {
|
|
|
this.getSubCategorygetByCode()
|
|
|
},
|
|
|
methods: {
|
|
|
+ getDeviceStatus(status) {
|
|
|
+ return status === 1 ? "在线" : "离线";
|
|
|
+ },
|
|
|
+ getDeviceStatusClass(status) {
|
|
|
+ return status === 1 ? "status-online" : "status-offline";
|
|
|
+ },
|
|
|
+
|
|
|
+ formatEventType(row, column, cellValue) {
|
|
|
+ return cellValue === 1 ? '消息上报' : '异常告警';
|
|
|
+ },
|
|
|
getDeviceStatusText (status) {
|
|
|
const statusMap = {
|
|
|
0: '运行',
|
|
@@ -306,7 +293,6 @@ export default {
|
|
|
this.queryParams.locationRef = data.id
|
|
|
this.handleQuery()
|
|
|
},
|
|
|
- // 取消按钮
|
|
|
cancel () {
|
|
|
this.open = false
|
|
|
this.reset()
|
|
@@ -335,6 +321,7 @@ export default {
|
|
|
this.eventData = response.data.eventList
|
|
|
this.abilityData = response.data.abilityList
|
|
|
})
|
|
|
+ this.activeTab = 'basic';
|
|
|
},
|
|
|
getFacsOptions () {
|
|
|
const getFacsParams = {
|
|
@@ -381,17 +368,35 @@ export default {
|
|
|
<style lang="scss" scoped>
|
|
|
.detail-dialog .el-dialog {
|
|
|
width: 80%;
|
|
|
- /* 调整弹框宽度 */
|
|
|
}
|
|
|
|
|
|
.section-title {
|
|
|
font-size: 18px;
|
|
|
- /* 标题字体大小 */
|
|
|
font-weight: bold;
|
|
|
- /* 字体加粗 */
|
|
|
margin-top: 20px;
|
|
|
- /* 标题顶部间距 */
|
|
|
margin-bottom: 10px;
|
|
|
- /* 标题底部间距 */
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+.status-highlight {
|
|
|
+ font-size: 16px;
|
|
|
+ font-weight: bold;
|
|
|
+ margin-top: 10px;
|
|
|
+ margin-bottom: 10px;
|
|
|
+}
|
|
|
+
|
|
|
+.status-online {
|
|
|
+ color: #00FF00; /* 在线状态颜色 */
|
|
|
+ background-color: #DDFFDD;
|
|
|
+ padding: 2px 6px;
|
|
|
+ border-radius: 4px;
|
|
|
+}
|
|
|
+
|
|
|
+.status-offline {
|
|
|
+ color: #FF0000; /* 离线状态颜色 */
|
|
|
+ background-color: #FFDDDD;
|
|
|
+ padding: 2px 6px;
|
|
|
+ border-radius: 4px;
|
|
|
}
|
|
|
+
|
|
|
</style>
|