diff --git a/src/api/iot/rule/data/rule/index.ts b/src/api/iot/rule/data/rule/index.ts
new file mode 100644
index 000000000..ebd050132
--- /dev/null
+++ b/src/api/iot/rule/data/rule/index.ts
@@ -0,0 +1,39 @@
+import request from '@/config/axios'
+
+/** IoT 数据流转规则信息 */
+export interface DataRule {
+ id: number // 场景编号
+ name?: string // 场景名称
+ description: string // 场景描述
+ status?: number // 场景状态
+ sourceConfigs?: string // 数据源配置数组
+ sinkIds?: string // 数据目的编号数组
+}
+
+// IoT 数据流转规则 API
+export const DataRuleApi = {
+ // 查询数据流转规则分页
+ getDataRulePage: async (params: any) => {
+ return await request.get({ url: `/iot/data-rule/page`, params })
+ },
+
+ // 查询数据流转规则详情
+ getDataRule: async (id: number) => {
+ return await request.get({ url: `/iot/data-rule/get?id=` + id })
+ },
+
+ // 新增数据流转规则
+ createDataRule: async (data: DataRule) => {
+ return await request.post({ url: `/iot/data-rule/create`, data })
+ },
+
+ // 修改数据流转规则
+ updateDataRule: async (data: DataRule) => {
+ return await request.put({ url: `/iot/data-rule/update`, data })
+ },
+
+ // 删除数据流转规则
+ deleteDataRule: async (id: number) => {
+ return await request.delete({ url: `/iot/data-rule/delete?id=` + id })
+ }
+}
diff --git a/src/api/iot/rule/databridge/index.ts b/src/api/iot/rule/data/sink/index.ts
similarity index 57%
rename from src/api/iot/rule/databridge/index.ts
rename to src/api/iot/rule/data/sink/index.ts
index 7c3808947..3e2755e0d 100644
--- a/src/api/iot/rule/databridge/index.ts
+++ b/src/api/iot/rule/data/sink/index.ts
@@ -1,7 +1,7 @@
import request from '@/config/axios'
-// IoT 数据桥梁 VO
-export interface DataBridgeVO {
+// IoT 数据流转目的 VO
+export interface DataSinkVO {
id?: number // 桥梁编号
name?: string // 桥梁名称
description?: string // 桥梁描述
@@ -79,8 +79,8 @@ export interface RedisStreamMQConfig extends Config {
topic: string
}
-/** 数据桥梁类型 */
-export const IoTDataBridgeConfigType = {
+/** 数据流转目的类型 */
+export const IotDataSinkTypeEnum = {
HTTP: 1,
TCP: 2,
WEBSOCKET: 3,
@@ -92,41 +92,35 @@ export const IoTDataBridgeConfigType = {
KAFKA: 32
} as const
-export const IotDataBridgeDirectionEnum = {
- INPUT: 1, // 输入
- OUTPUT: 2 // 输出
-} as const
-
-// 数据桥梁 API
-export const DataBridgeApi = {
- // 查询数据桥梁分页
- getDataBridgePage: async (params: any) => {
- return await request.get({ url: `/iot/data-bridge/page`, params })
+// 数据流转目的 API
+export const DataSinkApi = {
+ // 查询数据流转目的分页
+ getDataSinkPage: async (params: any) => {
+ return await request.get({ url: `/iot/data-sink/page`, params })
},
- // 查询数据桥梁详情
- getDataBridge: async (id: number) => {
- return await request.get({ url: `/iot/data-bridge/get?id=` + id })
+ // 查询数据流转目的详情
+ getDataSink: async (id: number) => {
+ return await request.get({ url: `/iot/data-sink/get?id=` + id })
},
- // 新增数据桥梁
- createDataBridge: async (data: DataBridgeVO) => {
- return await request.post({ url: `/iot/data-bridge/create`, data })
+ // 新增数据流转目的
+ createDataSink: async (data: DataSinkVO) => {
+ return await request.post({ url: `/iot/data-sink/create`, data })
},
- // 修改数据桥梁
- updateDataBridge: async (data: DataBridgeVO) => {
- return await request.put({ url: `/iot/data-bridge/update`, data })
+ // 修改数据流转目的
+ updateDataSink: async (data: DataSinkVO) => {
+ return await request.put({ url: `/iot/data-sink/update`, data })
},
- // 删除数据桥梁
- deleteDataBridge: async (id: number) => {
- return await request.delete({ url: `/iot/data-bridge/delete?id=` + id })
+ // 删除数据流转目的
+ deleteDataSink: async (id: number) => {
+ return await request.delete({ url: `/iot/data-sink/delete?id=` + id })
},
- // 查询数据桥梁(精简)列表
- // TODO @puhui999:getDataBridgeSimpleList 哈。项目的风格统一~ 之前有几个,我写错了。。。
- getSimpleDataBridgeList() {
- return request.get({ url: '/iot/data-bridge/simple-list' })
+ // 查询数据流转目的(精简)列表
+ getDataSinkSimpleList() {
+ return request.get({ url: '/iot/data-sink/simple-list' })
}
}
diff --git a/src/api/iot/rule/scene/scene.types.ts b/src/api/iot/rule/scene/scene.types.ts
index 29cac328f..c8f4a05da 100644
--- a/src/api/iot/rule/scene/scene.types.ts
+++ b/src/api/iot/rule/scene/scene.types.ts
@@ -104,7 +104,7 @@ interface ActionConfig {
type: number // 执行类型
deviceControl?: ActionDeviceControl // 设备控制
alert?: ActionAlert // 告警执行
- dataBridgeId?: number // 数据桥接编号
+ dataBridgeId?: number // 数据流转目的编号
}
// 主接口
diff --git a/src/utils/dict.ts b/src/utils/dict.ts
index 4c1d793e6..a5f8de1b3 100644
--- a/src/utils/dict.ts
+++ b/src/utils/dict.ts
@@ -237,8 +237,7 @@ export enum DICT_TYPE {
IOT_THING_MODEL_TYPE = 'iot_thing_model_type', // IOT 产品功能类型
IOT_THING_MODEL_UNIT = 'iot_thing_model_unit', // IOT 物模型单位
IOT_RW_TYPE = 'iot_rw_type', // IOT 读写类型
- IOT_DATA_BRIDGE_DIRECTION_ENUM = 'iot_data_bridge_direction_enum', // 桥梁方向
- IOT_DATA_BRIDGE_TYPE_ENUM = 'iot_data_bridge_type_enum', // 桥梁类型
+ IOT_DATA_SINK_TYPE_ENUM = 'iot_data_sink_type_enum', // IoT 数据流转目的类型
IOT_RULE_SCENE_TRIGGER_TYPE_ENUM = 'iot_rule_scene_trigger_type_enum', // IoT 场景流转的触发类型枚举
IOT_RULE_SCENE_ACTION_TYPE_ENUM = 'iot_rule_scene_action_type_enum' // IoT 规则场景的触发类型枚举
}
diff --git a/src/views/iot/rule/data/index.vue b/src/views/iot/rule/data/index.vue
new file mode 100644
index 000000000..123397eee
--- /dev/null
+++ b/src/views/iot/rule/data/index.vue
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/iot/rule/data/rule/DataRuleForm.vue b/src/views/iot/rule/data/rule/DataRuleForm.vue
new file mode 100644
index 000000000..3ebb7aec8
--- /dev/null
+++ b/src/views/iot/rule/data/rule/DataRuleForm.vue
@@ -0,0 +1,124 @@
+
+
+
+
diff --git a/src/views/iot/rule/data/rule/index.vue b/src/views/iot/rule/data/rule/index.vue
new file mode 100644
index 000000000..b8121fc09
--- /dev/null
+++ b/src/views/iot/rule/data/rule/index.vue
@@ -0,0 +1,194 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 搜索
+ 重置
+
+ 新增
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 编辑
+
+
+ 删除
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/iot/rule/databridge/IoTDataBridgeForm.vue b/src/views/iot/rule/data/sink/DataSinkForm.vue
similarity index 69%
rename from src/views/iot/rule/databridge/IoTDataBridgeForm.vue
rename to src/views/iot/rule/data/sink/DataSinkForm.vue
index ccf5d5a9c..ff87aab7b 100644
--- a/src/views/iot/rule/databridge/IoTDataBridgeForm.vue
+++ b/src/views/iot/rule/data/sink/DataSinkForm.vue
@@ -7,50 +7,38 @@
:rules="formRules"
label-width="120px"
>
-
-
+
+
-
-
-
- {{ dict.label }}
-
-
+
+
+
+
-
-
-
- {{ dict.label }}
-
-
-
-
-
+
+
-
+
-
+
@@ -74,12 +62,7 @@