feat(iot):优化 alert 的代码实现(继续)

pull/345/head
YunaiV 2026-05-18 20:56:13 +08:00
parent e9e534018f
commit 76bed17ed9
2 changed files with 6 additions and 9 deletions

View File

@ -4,12 +4,12 @@ import type { AlertConfigApi } from '#/api/iot/alert/config';
import { Page, useVbenModal } from '@vben/common-ui'; import { Page, useVbenModal } from '@vben/common-ui';
import { DICT_TYPE } from '@vben/constants'; import { DICT_TYPE } from '@vben/constants';
import { getDictLabel } from '@vben/hooks';
import { message, Tag } from 'ant-design-vue'; import { message } from 'ant-design-vue';
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
import { deleteAlertConfig, getAlertConfigPage } from '#/api/iot/alert/config'; import { deleteAlertConfig, getAlertConfigPage } from '#/api/iot/alert/config';
import { DictTag } from '#/components/dict-tag';
import { $t } from '#/locales'; import { $t } from '#/locales';
import AlertConfigForm from './modules/form.vue'; import AlertConfigForm from './modules/form.vue';
@ -102,17 +102,15 @@ const [Grid, gridApi] = useVbenVxeGrid({
]" ]"
/> />
</template> </template>
<!-- TODO DONE @AI接收类型是 number[] TagCellDict 只能渲染单值保留 slot -->
<template #receiveTypes="{ row }"> <template #receiveTypes="{ row }">
<Tag <DictTag
v-for="(type, index) in row.receiveTypes" v-for="(type, index) in row.receiveTypes"
:key="index" :key="index"
:type="DICT_TYPE.IOT_ALERT_RECEIVE_TYPE"
:value="type"
class="mr-1" class="mr-1"
> />
{{ getDictLabel(DICT_TYPE.IOT_ALERT_RECEIVE_TYPE, type) }}
</Tag>
</template> </template>
<!-- 操作列 -->
<template #actions="{ row }"> <template #actions="{ row }">
<TableAction <TableAction
:actions="[ :actions="[

View File

@ -117,7 +117,6 @@ function stringifyDeviceMessage(deviceMessage: any) {
</Popover> </Popover>
<span v-else class="text-gray-400">-</span> <span v-else class="text-gray-400">-</span>
</template> </template>
<!-- 操作列 -->
<template #actions="{ row }"> <template #actions="{ row }">
<TableAction <TableAction
:actions="[ :actions="[