This commit is contained in:
xiaozhiyong
2026-06-16 14:19:57 +08:00
parent d2a60a547d
commit b9a0f5b936

View File

@@ -25,33 +25,22 @@
</div> --> </div> -->
</div> </div>
<div class="device-info"> <div class="device-info">
<div class="card-menu"> <!-- <div class="card-menu">
<el-dropdown trigger="click" @command="(cmd) => handleDeviceAction(cmd, item)"> <el-dropdown trigger="click" @command="(cmd) => handleDeviceAction(cmd, item)">
<span class="menu-icon"> <span class="menu-icon">
<el-icon><MoreFilled /></el-icon> <el-icon><MoreFilled /></el-icon>
</span> </span>
<template #dropdown> <template #dropdown>
<el-dropdown-menu> <el-dropdown-menu>
<!-- <el-dropdown-item v-if="item.deviceStatus == 1" command="changeStatus">分闸</el-dropdown-item> <el-dropdown-item command="edit">编辑</el-dropdown-item>
<el-dropdown-item v-else command="changeStatus">分闸</el-dropdown-item>
<el-dropdown-item v-if="[1].includes(item.lockStatus)" command="unlock">解锁</el-dropdown-item> -->
</el-dropdown-menu> </el-dropdown-menu>
</template> </template>
</el-dropdown> </el-dropdown>
</div> </div> -->
<div class="status-tags"> <div class="status-tags">
<el-tag :type="item.netStatus == 1 ? 'primary' : 'info'"> <el-tag :type="item.netStatus == 1 ? 'primary' : 'info'">
{{ item.netStatus == 1 ? '在线' : '离线' }} {{ item.netStatus == 1 ? '在线' : '离线' }}
</el-tag> </el-tag>
<!-- <el-tag
v-if="item.cbTypeName !== 'T30' && item.deviceStatus != 1"
:type="item.deviceStatus == 1 ? 'success' : 'danger'"
>
{{ item.deviceStatus == 1 ? '合闸' : '分闸' }}
</el-tag> -->
<!-- <el-tag v-if="item.lockStatus != 0" :type="['success', 'info', 'danger'][item.lockStatus]">
{{ ['正常', '远程合闸禁止', '锁定'][item.lockStatus] }}
</el-tag> -->
</div> </div>
<div class="device-name">{{ item.gatewayMac }}</div> <div class="device-name">{{ item.gatewayMac }}</div>
<div class="device-id-row"> <div class="device-id-row">
@@ -99,7 +88,6 @@
import * as serve from '@/api/masterStation/equipment.js' import * as serve from '@/api/masterStation/equipment.js'
import { ref, onMounted } from 'vue' import { ref, onMounted } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus' import { ElMessage, ElMessageBox } from 'element-plus'
import { MoreFilled } from '@element-plus/icons-vue'
import { useProjectStore } from '@/pinia/modules/project' import { useProjectStore } from '@/pinia/modules/project'
defineProps({ defineProps({
@@ -139,44 +127,6 @@
emit('select-device', device) emit('select-device', device)
} }
// 解锁
const unlock = async (row) => {
ElMessageBox.confirm('确认解锁吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
const res = await serve.deviceOperation({
id: row.ID,
gatewayId: row.gatewayId,
para: '0xAD'
})
if (res.code === 0) {
ElMessage.success('操作成功')
getDeviceGatewayListByPage()
}
})
}
// 合分闸
const changeStatus = (row) => {
ElMessageBox.confirm(row.deviceStatus == 1 ? '确认分闸吗?' : '确认合闸吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
const res = await serve.deviceOperation({
id: row.ID,
gatewayId: row.gatewayId,
para: row.deviceStatus == 1 ? '0xA2' : '0xA1'
})
if (res.code === 0) {
ElMessage.success('操作成功')
getDeviceGatewayListByPage()
}
})
}
// 分页 // 分页
const handleSizeChange = (val) => { const handleSizeChange = (val) => {
pageSize.value = val pageSize.value = val
@@ -229,10 +179,8 @@
const handleDeviceAction = (command, item) => { const handleDeviceAction = (command, item) => {
switch (command) { switch (command) {
case 'changeStatus': case 'changeStatus':
changeStatus(item)
break break
case 'unlock': case 'unlock':
unlock(item)
break break
} }
} }