From 81b46909989588648565ac4f2db52cfbfd9f0250 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Mon, 18 May 2026 12:28:21 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=88iot=EF=BC=89=EF=BC=9A=E4=BC=98?= =?UTF-8?q?=E5=8C=96=20device=20=E7=9A=84=E6=9D=83=E9=99=90=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web-antd/src/views/iot/device/device/index.vue | 6 ++++-- .../src/views/iot/device/device/modules/card-view.vue | 7 +++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/apps/web-antd/src/views/iot/device/device/index.vue b/apps/web-antd/src/views/iot/device/device/index.vue index 4e480a243..5fecdfac2 100644 --- a/apps/web-antd/src/views/iot/device/device/index.vue +++ b/apps/web-antd/src/views/iot/device/device/index.vue @@ -400,7 +400,6 @@ onMounted(async () => { type: 'primary', icon: 'ant-design:folder-add-outlined', auth: ['iot:device:update'], - ifShow: isListView, disabled: isEmpty(checkedIds), onClick: handleAddToGroup, }, @@ -410,7 +409,6 @@ onMounted(async () => { danger: true, icon: ACTION_ICON.DELETE, auth: ['iot:device:delete'], - ifShow: isListView, disabled: isEmpty(checkedIds), onClick: handleDeleteBatch, }, @@ -463,17 +461,20 @@ onMounted(async () => { { label: $t('common.detail'), type: 'link', + auth: ['iot:device:query'], onClick: openDetail.bind(null, row.id!), }, { label: '日志', type: 'link', + auth: ['iot:device:message-query'], onClick: openModel.bind(null, row.id!), }, { label: $t('common.edit'), type: 'link', icon: ACTION_ICON.EDIT, + auth: ['iot:device:update'], onClick: handleEdit.bind(null, row), }, { @@ -481,6 +482,7 @@ onMounted(async () => { type: 'link', danger: true, icon: ACTION_ICON.DELETE, + auth: ['iot:device:delete'], popConfirm: { title: $t('ui.actionMessage.deleteConfirm', [row.deviceName]), confirm: handleDelete.bind(null, row), diff --git a/apps/web-antd/src/views/iot/device/device/modules/card-view.vue b/apps/web-antd/src/views/iot/device/device/modules/card-view.vue index dca9b5968..a4caca4bf 100644 --- a/apps/web-antd/src/views/iot/device/device/modules/card-view.vue +++ b/apps/web-antd/src/views/iot/device/device/modules/card-view.vue @@ -5,6 +5,7 @@ import type { IotDeviceApi } from '#/api/iot/device/device'; import { onMounted, ref } from 'vue'; +import { useAccess } from '@vben/access'; import { DICT_TYPE } from '@vben/constants'; import { IconifyIcon } from '@vben/icons'; @@ -47,6 +48,8 @@ const emit = defineEmits<{ productDetail: [productId: number]; }>(); +const { hasAccessByCodes } = useAccess(); + const loading = ref(false); const list = ref([]); const total = ref(0); @@ -184,6 +187,7 @@ onMounted(() => {