style:采集设备-操作栏编辑按钮根据连接状态判断

main
黄伟杰 1 month ago
parent 468b563fc3
commit 67864e3c79

@ -159,7 +159,7 @@
<el-button
link
type="primary"
@click="openForm('update', scope.row.id)"
@click.stop="handleEdit(scope.row)"
v-hasPermi="['iot:device:update']"
>
编辑
@ -364,6 +364,14 @@ const isRowConnected = (row: any) => {
return String(getRowConnectValue(row)) === '1'
}
const handleEdit = async (row: DeviceVO) => {
if (isRowConnected(row)) {
await message.alertWarning('设备在线状态,无法编辑,请先断开连接')
return
}
openForm('update', row.id)
}
const handleToggleConnect = async (row: DeviceVO) => {
const id = row?.id
if (!id) {

Loading…
Cancel
Save