diff --git a/apps/web-antd/src/api/iot/alert/config/index.ts b/apps/web-antd/src/api/iot/alert/config/index.ts index ac41c67c2..d419a5563 100644 --- a/apps/web-antd/src/api/iot/alert/config/index.ts +++ b/apps/web-antd/src/api/iot/alert/config/index.ts @@ -15,7 +15,6 @@ export namespace AlertConfigApi { receiveUserNames?: string[]; receiveTypes?: number[]; createTime?: Date; - updateTime?: Date; } } diff --git a/apps/web-antd/src/api/iot/alert/record/index.ts b/apps/web-antd/src/api/iot/alert/record/index.ts index d0292d4d4..fea6e17a4 100644 --- a/apps/web-antd/src/api/iot/alert/record/index.ts +++ b/apps/web-antd/src/api/iot/alert/record/index.ts @@ -10,13 +10,10 @@ export namespace AlertRecordApi { configName?: string; configLevel?: number; deviceId?: number; - deviceName?: string; productId?: number; - productName?: string; deviceMessage?: any; processStatus?: boolean; processRemark?: string; - processTime?: Date; createTime?: Date; } } diff --git a/apps/web-antd/src/api/iot/product/product/index.ts b/apps/web-antd/src/api/iot/product/product/index.ts index 9d0bb3515..9b4a88ed6 100644 --- a/apps/web-antd/src/api/iot/product/product/index.ts +++ b/apps/web-antd/src/api/iot/product/product/index.ts @@ -102,7 +102,6 @@ export function getProductByKey(productKey: string) { }); } -// TODO @AI:这个是不是 vue3 + ep 也没做?感觉对齐就好,不用额外做。 /** 同步产品物模型 TDengine 超级表结构 */ export function syncProductPropertyTable(productId: number) { return requestClient.post( diff --git a/apps/web-antd/src/views/iot/alert/config/data.ts b/apps/web-antd/src/views/iot/alert/config/data.ts index 0189db9b8..063de59b8 100644 --- a/apps/web-antd/src/views/iot/alert/config/data.ts +++ b/apps/web-antd/src/views/iot/alert/config/data.ts @@ -140,7 +140,6 @@ export function useGridFormSchema(): VbenFormSchema[] { /** 列表的字段 */ export function useGridColumns(): VxeTableGridOptions['columns'] { return [ - { type: 'checkbox', width: 40 }, { field: 'id', title: '配置编号', diff --git a/apps/web-antd/src/views/iot/alert/record/data.ts b/apps/web-antd/src/views/iot/alert/record/data.ts index 2b0643832..6bc3d4950 100644 --- a/apps/web-antd/src/views/iot/alert/record/data.ts +++ b/apps/web-antd/src/views/iot/alert/record/data.ts @@ -35,7 +35,7 @@ export function useGridFormSchema(): VbenFormSchema[] { }, }, { - fieldName: 'configLevel', + fieldName: 'level', label: '告警级别', component: 'Select', componentProps: { @@ -95,7 +95,6 @@ export function useGridFormSchema(): VbenFormSchema[] { /** 列表的字段 */ export function useGridColumns(): VxeTableGridOptions['columns'] { return [ - { type: 'checkbox', width: 40 }, { field: 'id', title: '记录编号', diff --git a/apps/web-antd/src/views/iot/device/device/detail/modules/config.vue b/apps/web-antd/src/views/iot/device/device/detail/modules/config.vue index 4b1706841..abde01f96 100644 --- a/apps/web-antd/src/views/iot/device/device/detail/modules/config.vue +++ b/apps/web-antd/src/views/iot/device/device/detail/modules/config.vue @@ -135,8 +135,15 @@ async function updateDeviceConfig() { /> -
-
{{ formattedConfig }}
+
+
+        {{ formattedConfig }}
+      
@@ -144,7 +151,7 @@ async function updateDeviceConfig() { v-else v-model:value="configString" :rows="20" - class="json-editor" + class="font-mono text-[13px]" placeholder="请输入 JSON 格式的配置信息" /> @@ -170,29 +177,3 @@ async function updateDeviceConfig() {
- - diff --git a/apps/web-antd/src/views/iot/home/modules/device-map-card.vue b/apps/web-antd/src/views/iot/home/modules/device-map-card.vue index 15265a93d..6f82c94da 100644 --- a/apps/web-antd/src/views/iot/home/modules/device-map-card.vue +++ b/apps/web-antd/src/views/iot/home/modules/device-map-card.vue @@ -15,10 +15,10 @@ import { loadBaiduMapSdk } from '#/components/map'; defineOptions({ name: 'DeviceMapCard' }); const router = useRouter(); -const mapContainerRef = ref(); -let mapInstance: any = null; -const loading = ref(true); -const deviceList = ref([]); +const mapContainerRef = ref(); // 地图容器节点 +let mapInstance: any = null; // 百度地图实例 +const loading = ref(true); // 加载状态 +const deviceList = ref([]); // 设备分布列表 /** 是否有数据 */ const hasData = computed(() => deviceList.value.length > 0); diff --git a/apps/web-antd/src/views/iot/home/modules/message-trend-card.vue b/apps/web-antd/src/views/iot/home/modules/message-trend-card.vue index bde4b7ba5..0a8a30e3c 100644 --- a/apps/web-antd/src/views/iot/home/modules/message-trend-card.vue +++ b/apps/web-antd/src/views/iot/home/modules/message-trend-card.vue @@ -22,10 +22,10 @@ defineOptions({ name: 'MessageTrendCard' }); const messageChartRef = ref(); const { renderEcharts } = useEcharts(messageChartRef); -const loading = ref(false); +const loading = ref(false); // 加载状态 const messageData = ref( [], -); +); // 消息趋势数据 /** 时间范围(仅日期,不包含时分秒) */ const dateRange = ref<[string, string]>([ diff --git a/apps/web-antd/src/views/iot/ota/task/modules/list.vue b/apps/web-antd/src/views/iot/ota/task/modules/list.vue index 7500fb20c..b46a4a57f 100644 --- a/apps/web-antd/src/views/iot/ota/task/modules/list.vue +++ b/apps/web-antd/src/views/iot/ota/task/modules/list.vue @@ -42,7 +42,7 @@ async function handleRefresh() { emit('success'); } -/** 按任务名搜索(嵌入页面里,单字段搜索做成 toolbar 内联输入框,回车 / 清空触发查询) */ +/** 按任务名称搜索 */ async function handleSearch() { await gridApi.query(); } diff --git a/apps/web-antd/src/views/iot/rule/data/index.vue b/apps/web-antd/src/views/iot/rule/data/index.vue index 34f902df9..307072e9d 100644 --- a/apps/web-antd/src/views/iot/rule/data/index.vue +++ b/apps/web-antd/src/views/iot/rule/data/index.vue @@ -8,7 +8,6 @@ import { Tabs } from 'ant-design-vue'; import DataRuleList from './rule/index.vue'; import DataSinkList from './sink/index.vue'; -// TODO DONE @AI:下面的"/** IoT 数据流转:规则 / 目的 */"需要注释么?基线无文件级注释,已删除 const activeTabName = ref('rule'); diff --git a/apps/web-antd/src/views/iot/rule/scene/data.ts b/apps/web-antd/src/views/iot/rule/scene/data.ts index 5ef8da984..cb3a4b61e 100644 --- a/apps/web-antd/src/views/iot/rule/scene/data.ts +++ b/apps/web-antd/src/views/iot/rule/scene/data.ts @@ -1,56 +1,11 @@ import type { VbenFormSchema } from '#/adapter/form'; import type { VxeTableGridOptions } from '#/adapter/vxe-table'; -import { CommonStatusEnum, DICT_TYPE } from '@vben/constants'; +import { DICT_TYPE } from '@vben/constants'; import { getDictOptions } from '@vben/hooks'; -import { z } from '#/adapter/form'; import { getRangePickerDefaultProps } from '#/utils'; -/** 新增/修改的表单 */ -export function useFormSchema(): VbenFormSchema[] { - return [ - { - component: 'Input', - fieldName: 'id', - dependencies: { - triggerFields: [''], - show: () => false, - }, - }, - { - component: 'Input', - fieldName: 'name', - label: '规则名称', - rules: 'required', - componentProps: { - placeholder: '请输入规则名称', - }, - }, - { - fieldName: 'status', - label: '规则状态', - component: 'RadioGroup', - componentProps: { - options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), - buttonStyle: 'solid', - optionType: 'button', - }, - rules: z.number().default(CommonStatusEnum.ENABLE), - }, - { - fieldName: 'description', - label: '规则描述', - component: 'Textarea', - componentProps: { - placeholder: '请输入规则描述', - rows: 3, - }, - formItemClass: 'col-span-2', - }, - ]; -} - /** 列表的搜索表单 */ export function useGridFormSchema(): VbenFormSchema[] { return [ diff --git a/apps/web-antd/src/views/iot/rule/scene/form/configs/alert-config.vue b/apps/web-antd/src/views/iot/rule/scene/form/configs/alert-config.vue index 37ccf54d3..1cb57b0c8 100644 --- a/apps/web-antd/src/views/iot/rule/scene/form/configs/alert-config.vue +++ b/apps/web-antd/src/views/iot/rule/scene/form/configs/alert-config.vue @@ -3,9 +3,9 @@ import { onMounted, ref } from 'vue'; import { useVModel } from '@vueuse/core'; -import { Form, Select, Tag } from 'ant-design-vue'; +import { Form, Select } from 'ant-design-vue'; -import { getAlertConfigPage } from '#/api/iot/alert/config'; +import { getSimpleAlertConfigList } from '#/api/iot/alert/config'; /** 告警配置组件 */ defineOptions({ name: 'AlertConfig' }); @@ -28,18 +28,11 @@ function handleChange(value?: any) { emit('update:modelValue', value); } -// TODO DONE @AI:当前 antd + vue3+ep 都用同一个接口,无需 simple-list -// TODO @AI:那就修复这个。后端增加接口,antd 和 vue3 + ep 都改; /** 加载告警配置列表 */ async function loadAlertConfigs() { loading.value = true; try { - const data = await getAlertConfigPage({ - pageNo: 1, - pageSize: 100, - enabled: true, // 只加载启用的配置 - }); - alertConfigs.value = data.list || []; + alertConfigs.value = (await getSimpleAlertConfigList()) || []; } finally { loading.value = false; } @@ -68,14 +61,7 @@ onMounted(() => { :key="config.id" :label="config.name" :value="config.id" - > -
- {{ config.name }} - - {{ config.enabled ? '启用' : '禁用' }} - -
- + /> diff --git a/apps/web-antd/src/views/iot/rule/scene/form/configs/current-time-condition-config.vue b/apps/web-antd/src/views/iot/rule/scene/form/configs/current-time-condition-config.vue index 6bdc0e6f9..bbe7913c5 100644 --- a/apps/web-antd/src/views/iot/rule/scene/form/configs/current-time-condition-config.vue +++ b/apps/web-antd/src/views/iot/rule/scene/form/configs/current-time-condition-config.vue @@ -86,9 +86,9 @@ const needsTimeInput = computed(() => { return timeOnlyOperators.includes(condition.value.operator as any); }); -// 计算属性:是否需要日期输入 +/** 是否需要日期输入:当前只支持时间维度的判断 */ const needsDateInput = computed(() => { - return false; // 暂时不支持日期输入,只支持时间 + return false; }); // 计算属性:是否需要第二个时间输入 diff --git a/apps/web-antd/src/views/iot/rule/scene/form/configs/device-control-config.vue b/apps/web-antd/src/views/iot/rule/scene/form/configs/device-control-config.vue index 6598ce70b..f40298246 100644 --- a/apps/web-antd/src/views/iot/rule/scene/form/configs/device-control-config.vue +++ b/apps/web-antd/src/views/iot/rule/scene/form/configs/device-control-config.vue @@ -75,7 +75,6 @@ function handleProductChange(productId?: number) { if (action.value.productId !== productId) { action.value.deviceId = undefined; action.value.identifier = undefined; // 清空服务标识符 - // TODO DONE @AI:这里有 linter 报错 action.value.params = '' as any; // 清空参数,保存为空字符串 selectedService.value = null; // 清空选中的服务 serviceList.value = []; // 清空服务列表 @@ -98,7 +97,6 @@ function handleProductChange(productId?: number) { function handleDeviceChange(deviceId?: number) { // 当设备变化时,清空参数配置 if (action.value.deviceId !== deviceId) { - // TODO DONE @AI:这里有 linter 报错 action.value.params = '' as any; // 清空参数,保存为空字符串 } } @@ -152,7 +150,6 @@ async function loadThingModelProperties(productId: number) { loadingThingModel.value = true; const tslData = await fetchThingModelTSL(productId); - // TODO DONE @AI:这里有 linter 报错 if (!tslData?.properties) { thingModelProperties.value = []; return; @@ -187,13 +184,11 @@ async function loadServiceList(productId: number) { loadingServices.value = true; const tslData = await fetchThingModelTSL(productId); - // TODO DONE @AI:这里有 linter 报错 if (!tslData?.services) { serviceList.value = []; return; } - // TODO DONE @AI:这里有 linter 报错 serviceList.value = tslData.services; } catch (error) { console.error('加载服务列表失败:', error); diff --git a/apps/web-antd/src/views/iot/rule/scene/form/selectors/device-selector.vue b/apps/web-antd/src/views/iot/rule/scene/form/selectors/device-selector.vue index 7678dace0..4d461601f 100644 --- a/apps/web-antd/src/views/iot/rule/scene/form/selectors/device-selector.vue +++ b/apps/web-antd/src/views/iot/rule/scene/form/selectors/device-selector.vue @@ -26,7 +26,6 @@ const deviceLoading = ref(false); // 设备加载状态 const deviceList = ref([]); // 设备列表 /** 处理选择变化事件 */ -// TODO @AI:是不是应该 value 加个设备编号?方法名是不是也要优化下?方法名是不是要优化? function handleChange(value: any) { emit('update:modelValue', value as number | undefined); emit('change', value as number | undefined); diff --git a/apps/web-ele/src/api/iot/alert/config/index.ts b/apps/web-ele/src/api/iot/alert/config/index.ts index ac41c67c2..d419a5563 100644 --- a/apps/web-ele/src/api/iot/alert/config/index.ts +++ b/apps/web-ele/src/api/iot/alert/config/index.ts @@ -15,7 +15,6 @@ export namespace AlertConfigApi { receiveUserNames?: string[]; receiveTypes?: number[]; createTime?: Date; - updateTime?: Date; } } diff --git a/apps/web-ele/src/api/iot/alert/record/index.ts b/apps/web-ele/src/api/iot/alert/record/index.ts index d0292d4d4..fea6e17a4 100644 --- a/apps/web-ele/src/api/iot/alert/record/index.ts +++ b/apps/web-ele/src/api/iot/alert/record/index.ts @@ -10,13 +10,10 @@ export namespace AlertRecordApi { configName?: string; configLevel?: number; deviceId?: number; - deviceName?: string; productId?: number; - productName?: string; deviceMessage?: any; processStatus?: boolean; processRemark?: string; - processTime?: Date; createTime?: Date; } } diff --git a/apps/web-ele/src/api/iot/product/product/index.ts b/apps/web-ele/src/api/iot/product/product/index.ts index 9d0bb3515..9b4a88ed6 100644 --- a/apps/web-ele/src/api/iot/product/product/index.ts +++ b/apps/web-ele/src/api/iot/product/product/index.ts @@ -102,7 +102,6 @@ export function getProductByKey(productKey: string) { }); } -// TODO @AI:这个是不是 vue3 + ep 也没做?感觉对齐就好,不用额外做。 /** 同步产品物模型 TDengine 超级表结构 */ export function syncProductPropertyTable(productId: number) { return requestClient.post( diff --git a/apps/web-ele/src/views/iot/alert/config/data.ts b/apps/web-ele/src/views/iot/alert/config/data.ts index 421b16aa5..7508f4471 100644 --- a/apps/web-ele/src/views/iot/alert/config/data.ts +++ b/apps/web-ele/src/views/iot/alert/config/data.ts @@ -138,7 +138,6 @@ export function useGridFormSchema(): VbenFormSchema[] { /** 列表的字段 */ export function useGridColumns(): VxeTableGridOptions['columns'] { return [ - { type: 'checkbox', width: 40 }, { field: 'id', title: '配置编号', diff --git a/apps/web-ele/src/views/iot/alert/record/data.ts b/apps/web-ele/src/views/iot/alert/record/data.ts index 800e64630..5b5c326d8 100644 --- a/apps/web-ele/src/views/iot/alert/record/data.ts +++ b/apps/web-ele/src/views/iot/alert/record/data.ts @@ -35,7 +35,7 @@ export function useGridFormSchema(): VbenFormSchema[] { }, }, { - fieldName: 'configLevel', + fieldName: 'level', label: '告警级别', component: 'Select', componentProps: { @@ -95,7 +95,6 @@ export function useGridFormSchema(): VbenFormSchema[] { /** 列表的字段 */ export function useGridColumns(): VxeTableGridOptions['columns'] { return [ - { type: 'checkbox', width: 40 }, { field: 'id', title: '记录编号', diff --git a/apps/web-ele/src/views/iot/device/device/data.ts b/apps/web-ele/src/views/iot/device/device/data.ts index 40683d391..a2ee12b7c 100644 --- a/apps/web-ele/src/views/iot/device/device/data.ts +++ b/apps/web-ele/src/views/iot/device/device/data.ts @@ -191,8 +191,8 @@ export function useImportFormSchema(): VbenFormSchema[] { label: '是否覆盖', component: 'Switch', componentProps: { - checkedChildren: '是', - unCheckedChildren: '否', + activeText: '是', + inactiveText: '否', }, rules: z.boolean().default(false), help: '是否更新已经存在的设备数据', diff --git a/apps/web-ele/src/views/iot/device/device/detail/modules/config.vue b/apps/web-ele/src/views/iot/device/device/detail/modules/config.vue index e29070aa0..8a5c346b8 100644 --- a/apps/web-ele/src/views/iot/device/device/detail/modules/config.vue +++ b/apps/web-ele/src/views/iot/device/device/detail/modules/config.vue @@ -142,8 +142,15 @@ async function updateDeviceConfig() { /> -
-
{{ formattedConfig }}
+
+
+        {{ formattedConfig }}
+      
@@ -152,7 +159,7 @@ async function updateDeviceConfig() { v-model="configString" type="textarea" :rows="20" - class="json-editor" + class="font-mono text-[13px]" placeholder="请输入 JSON 格式的配置信息" /> @@ -182,30 +189,3 @@ async function updateDeviceConfig() {
- - diff --git a/apps/web-ele/src/views/iot/home/modules/device-map-card.vue b/apps/web-ele/src/views/iot/home/modules/device-map-card.vue index 0d52a6949..5e8cec8ae 100644 --- a/apps/web-ele/src/views/iot/home/modules/device-map-card.vue +++ b/apps/web-ele/src/views/iot/home/modules/device-map-card.vue @@ -15,10 +15,10 @@ import { loadBaiduMapSdk } from '#/components/map'; defineOptions({ name: 'DeviceMapCard' }); const router = useRouter(); -const mapContainerRef = ref(); -let mapInstance: any = null; -const loading = ref(true); -const deviceList = ref([]); +const mapContainerRef = ref(); // 地图容器节点 +let mapInstance: any = null; // 百度地图实例 +const loading = ref(true); // 加载状态 +const deviceList = ref([]); // 设备分布列表 /** 是否有数据 */ const hasData = computed(() => deviceList.value.length > 0); diff --git a/apps/web-ele/src/views/iot/home/modules/message-trend-card.vue b/apps/web-ele/src/views/iot/home/modules/message-trend-card.vue index e9fef4caf..352429057 100644 --- a/apps/web-ele/src/views/iot/home/modules/message-trend-card.vue +++ b/apps/web-ele/src/views/iot/home/modules/message-trend-card.vue @@ -22,10 +22,10 @@ defineOptions({ name: 'MessageTrendCard' }); const messageChartRef = ref(); const { renderEcharts } = useEcharts(messageChartRef); -const loading = ref(false); +const loading = ref(false); // 加载状态 const messageData = ref( [], -); +); // 消息趋势数据 /** 时间范围(仅日期,不包含时分秒) */ const dateRange = ref<[string, string]>([ diff --git a/apps/web-ele/src/views/iot/ota/task/modules/list.vue b/apps/web-ele/src/views/iot/ota/task/modules/list.vue index 40d355ca1..9c13079f9 100644 --- a/apps/web-ele/src/views/iot/ota/task/modules/list.vue +++ b/apps/web-ele/src/views/iot/ota/task/modules/list.vue @@ -42,7 +42,7 @@ async function handleRefresh() { emit('success'); } -/** 按任务名搜索(嵌入页面里,单字段搜索做成 toolbar 内联输入框,回车 / 清空触发查询) */ +/** 按任务名称搜索 */ async function handleSearch() { await gridApi.query(); } diff --git a/apps/web-ele/src/views/iot/product/product/data.ts b/apps/web-ele/src/views/iot/product/product/data.ts index 2d07b11b1..52f8b75d2 100644 --- a/apps/web-ele/src/views/iot/product/product/data.ts +++ b/apps/web-ele/src/views/iot/product/product/data.ts @@ -128,7 +128,6 @@ export function useBasicFormSchema( // 网关子设备走网关联网,不需要联网方式 dependencies: { triggerFields: ['deviceType'], - // TODO DONE @AI:枚举值。或者这里不要枚举值?(也看看 vben 里,其它是不是也漏了枚举值。) show: (values) => values.deviceType !== DeviceTypeEnum.GATEWAY, }, rules: 'required', @@ -167,8 +166,8 @@ export function useAdvancedFormSchema(): VbenFormSchema[] { label: '动态注册', component: 'Switch', componentProps: { - checkedChildren: '开', - unCheckedChildren: '关', + activeText: '开', + inactiveText: '关', }, defaultValue: false, help: '设备动态注册无需一一烧录设备证书(DeviceSecret),每台设备烧录相同的产品证书,即 ProductKey 和 ProductSecret ,云端鉴权通过后下发设备证书,您可以根据需要开启或关闭动态注册,保障安全性。', diff --git a/apps/web-ele/src/views/iot/product/product/modules/card-view.vue b/apps/web-ele/src/views/iot/product/product/modules/card-view.vue index 528613f8d..a9eece169 100644 --- a/apps/web-ele/src/views/iot/product/product/modules/card-view.vue +++ b/apps/web-ele/src/views/iot/product/product/modules/card-view.vue @@ -131,7 +131,7 @@ onMounted(() => { 产品分类 - + {{ getCategoryName(item.categoryId) }} @@ -210,7 +210,6 @@ onMounted(() => { 物模型