diff --git a/apps/web-antd/src/api/iot/rule/scene/index.ts b/apps/web-antd/src/api/iot/rule/scene/index.ts index 11ff09308..d77b82d10 100644 --- a/apps/web-antd/src/api/iot/rule/scene/index.ts +++ b/apps/web-antd/src/api/iot/rule/scene/index.ts @@ -46,7 +46,7 @@ export namespace RuleSceneApi { identifier?: string; value?: any; alertConfigId?: number; - params?: Record; + params?: string; } } diff --git a/apps/web-ele/src/api/iot/rule/scene/index.ts b/apps/web-ele/src/api/iot/rule/scene/index.ts index a449af69c..e2b7d0faf 100644 --- a/apps/web-ele/src/api/iot/rule/scene/index.ts +++ b/apps/web-ele/src/api/iot/rule/scene/index.ts @@ -11,6 +11,7 @@ export namespace RuleSceneApi { status?: number; triggers?: Trigger[]; actions?: Action[]; + lastTriggeredTime?: Date; createTime?: Date; } @@ -46,7 +47,7 @@ export namespace RuleSceneApi { identifier?: string; value?: any; alertConfigId?: number; - params?: Record; + params?: string; } } diff --git a/apps/web-ele/src/api/iot/thingmodel/index.ts b/apps/web-ele/src/api/iot/thingmodel/index.ts index e5152c742..5a3e4e499 100644 --- a/apps/web-ele/src/api/iot/thingmodel/index.ts +++ b/apps/web-ele/src/api/iot/thingmodel/index.ts @@ -68,6 +68,15 @@ export namespace ThingModelApi { dataSpecsList?: any[]; } + /** IoT 物模型 TSL 响应 */ + export interface ThingModelTSL { + productId?: number; + productKey?: string; + properties?: Property[]; + events?: Event[]; + services?: Service[]; + } + /** IoT 数据定义(数值型) */ export interface DataSpecsNumberData { min?: number | string; @@ -236,7 +245,10 @@ export function deleteThingModel(id: number) { /** 获取物模型 TSL */ export function getThingModelTSLByProductId(productId: number) { - return requestClient.get('/iot/thing-model/get-tsl', { - params: { productId }, - }); + return requestClient.get( + '/iot/thing-model/get-tsl', + { + params: { productId }, + }, + ); } 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 9e66e2523..ccfcb5faa 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 @@ -10,7 +10,7 @@ import { getDictOptions } from '@vben/hooks'; import { EchartsUI, useEcharts } from '@vben/plugins/echarts'; import dayjs from 'dayjs'; -import { ElCard, ElEmpty, ElSelect } from 'element-plus'; +import { ElCard, ElEmpty, ElOption, ElSelect } from 'element-plus'; import { getDeviceMessageSummaryByDate } from '#/api/iot/statistics'; import ShortcutDateRangePicker from '#/components/shortcut-date-range-picker/shortcut-date-range-picker.vue'; @@ -145,11 +145,17 @@ onMounted(() => { 时间间隔 + > + + diff --git a/apps/web-ele/src/views/iot/rule/scene/data.ts b/apps/web-ele/src/views/iot/rule/scene/data.ts index fd948f9bf..5ef8da984 100644 --- a/apps/web-ele/src/views/iot/rule/scene/data.ts +++ b/apps/web-ele/src/views/iot/rule/scene/data.ts @@ -89,49 +89,45 @@ export function useGridFormSchema(): VbenFormSchema[] { export function useGridColumns(): VxeTableGridOptions['columns'] { return [ { type: 'checkbox', width: 40 }, - { - field: 'id', - title: '规则编号', - minWidth: 80, - }, { field: 'name', title: '规则名称', - minWidth: 150, - }, - { - field: 'description', - title: '规则描述', minWidth: 200, + align: 'left', + showOverflow: false, + slots: { default: 'name' }, }, { - field: 'status', - title: '规则状态', - minWidth: 100, - cellRender: { - name: 'CellDict', - props: { type: DICT_TYPE.COMMON_STATUS }, - }, + field: 'triggers', + title: '触发条件', + minWidth: 280, + align: 'left', + showOverflow: false, + slots: { default: 'triggers' }, }, { - field: 'actionCount', - title: '执行动作数', - minWidth: 100, + field: 'actions', + title: '执行动作', + minWidth: 250, + align: 'left', + showOverflow: false, + slots: { default: 'actionsCol' }, }, { - field: 'executeCount', - title: '执行次数', - minWidth: 100, + field: 'lastTriggeredTime', + title: '最近触发', + width: 180, + slots: { default: 'lastTriggeredTime' }, }, { field: 'createTime', title: '创建时间', - minWidth: 180, + width: 180, formatter: 'formatDateTime', }, { title: '操作', - width: 240, + width: 210, fixed: 'right', slots: { default: 'actions' }, }, diff --git a/apps/web-ele/src/views/iot/rule/scene/form/configs/device-control-config.vue b/apps/web-ele/src/views/iot/rule/scene/form/configs/device-control-config.vue index afb78bb9f..ac535e91f 100644 --- a/apps/web-ele/src/views/iot/rule/scene/form/configs/device-control-config.vue +++ b/apps/web-ele/src/views/iot/rule/scene/form/configs/device-control-config.vue @@ -1,10 +1,7 @@