feat:【IoT 物联网】移除 DataBridgeAction.vue
This commit is contained in:
@ -10,8 +10,7 @@ const IotRuleSceneTriggerTypeEnum = {
|
|||||||
|
|
||||||
const IotRuleSceneActionTypeEnum = {
|
const IotRuleSceneActionTypeEnum = {
|
||||||
DEVICE_CONTROL: 1, // 设备执行
|
DEVICE_CONTROL: 1, // 设备执行
|
||||||
ALERT: 2, // 告警执行
|
ALERT: 2 // 告警执行
|
||||||
DATA_BRIDGE: 3 // 桥接执行
|
|
||||||
} as const
|
} as const
|
||||||
|
|
||||||
const IotDeviceMessageTypeEnum = {
|
const IotDeviceMessageTypeEnum = {
|
||||||
@ -104,7 +103,6 @@ interface ActionConfig {
|
|||||||
type: number // 执行类型
|
type: number // 执行类型
|
||||||
deviceControl?: ActionDeviceControl // 设备控制
|
deviceControl?: ActionDeviceControl // 设备控制
|
||||||
alert?: ActionAlert // 告警执行
|
alert?: ActionAlert // 告警执行
|
||||||
dataBridgeId?: number // 数据流转目的编号
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 主接口
|
// 主接口
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
<el-input v-model="urlPath" placeholder="请输入请求地址">
|
<el-input v-model="urlPath" placeholder="请输入请求地址">
|
||||||
<template #prepend>
|
<template #prepend>
|
||||||
<el-select v-model="urlPrefix" placeholder="Select" style="width: 115px">
|
<el-select v-model="urlPrefix" placeholder="Select" style="width: 115px">
|
||||||
|
<!--suppress HttpUrlsUsage -->
|
||||||
<el-option label="http://" value="http://" />
|
<el-option label="http://" value="http://" />
|
||||||
<el-option label="https://" value="https://" />
|
<el-option label="https://" value="https://" />
|
||||||
</el-select>
|
</el-select>
|
||||||
@ -42,6 +43,7 @@ const props = defineProps<{
|
|||||||
const emit = defineEmits(['update:modelValue'])
|
const emit = defineEmits(['update:modelValue'])
|
||||||
const config = useVModel(props, 'modelValue', emit) as Ref<HttpConfig>
|
const config = useVModel(props, 'modelValue', emit) as Ref<HttpConfig>
|
||||||
|
|
||||||
|
// noinspection HttpUrlsUsage
|
||||||
/** URL处理 */
|
/** URL处理 */
|
||||||
const urlPrefix = ref('http://')
|
const urlPrefix = ref('http://')
|
||||||
const urlPath = ref('')
|
const urlPath = ref('')
|
||||||
|
|||||||
@ -60,13 +60,6 @@
|
|||||||
:model-value="actionConfig.alert"
|
:model-value="actionConfig.alert"
|
||||||
@update:model-value="(val) => (actionConfig.alert = val)"
|
@update:model-value="(val) => (actionConfig.alert = val)"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- 数据流转目的执行器 -->
|
|
||||||
<DataBridgeAction
|
|
||||||
v-else-if="actionConfig.type === IotRuleSceneActionTypeEnum.DATA_BRIDGE"
|
|
||||||
:model-value="actionConfig.dataBridgeId"
|
|
||||||
@update:model-value="(val) => (actionConfig.dataBridgeId = val)"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 产品、设备的选择 -->
|
<!-- 产品、设备的选择 -->
|
||||||
@ -88,7 +81,6 @@ import ProductTableSelect from '@/views/iot/product/product/components/ProductTa
|
|||||||
import DeviceTableSelect from '@/views/iot/device/device/components/DeviceTableSelect.vue'
|
import DeviceTableSelect from '@/views/iot/device/device/components/DeviceTableSelect.vue'
|
||||||
import DeviceControlAction from './DeviceControlAction.vue'
|
import DeviceControlAction from './DeviceControlAction.vue'
|
||||||
import AlertAction from './AlertAction.vue'
|
import AlertAction from './AlertAction.vue'
|
||||||
import DataBridgeAction from './DataBridgeAction.vue'
|
|
||||||
import { ProductApi, ProductVO } from '@/api/iot/product/product'
|
import { ProductApi, ProductVO } from '@/api/iot/product/product'
|
||||||
import { DeviceApi, DeviceVO } from '@/api/iot/device/device'
|
import { DeviceApi, DeviceVO } from '@/api/iot/device/device'
|
||||||
import {
|
import {
|
||||||
@ -133,14 +125,6 @@ const initActionConfig = () => {
|
|||||||
if (actionConfig.value.type === IotRuleSceneActionTypeEnum.ALERT && !actionConfig.value.alert) {
|
if (actionConfig.value.type === IotRuleSceneActionTypeEnum.ALERT && !actionConfig.value.alert) {
|
||||||
actionConfig.value.alert = {} as ActionAlert
|
actionConfig.value.alert = {} as ActionAlert
|
||||||
}
|
}
|
||||||
|
|
||||||
// 数据流转目的执行器初始化
|
|
||||||
if (
|
|
||||||
actionConfig.value.type === IotRuleSceneActionTypeEnum.DATA_BRIDGE &&
|
|
||||||
!actionConfig.value.dataBridgeId
|
|
||||||
) {
|
|
||||||
actionConfig.value.dataBridgeId = undefined
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 产品和设备选择 */
|
/** 产品和设备选择 */
|
||||||
|
|||||||
@ -1,34 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="bg-[#dbe5f6] p-10px">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<span class="mr-10px w-80px">数据流转目的</span>
|
|
||||||
<el-select v-model="dataBridgeId" class="!w-240px" clearable placeholder="选择数据流转目的">
|
|
||||||
<el-option
|
|
||||||
v-for="bridge in dataSinkList"
|
|
||||||
:key="bridge.id"
|
|
||||||
:label="bridge.name"
|
|
||||||
:value="bridge.id"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup lang="ts">
|
|
||||||
import { useVModel } from '@vueuse/core'
|
|
||||||
import { DataSinkApi } from '@/api/iot/rule/data/sink'
|
|
||||||
|
|
||||||
/** 数据流转目的执行器组件 */
|
|
||||||
defineOptions({ name: 'DataBridgeAction' })
|
|
||||||
|
|
||||||
const props = defineProps<{ modelValue: any }>()
|
|
||||||
const emits = defineEmits(['update:modelValue'])
|
|
||||||
const dataBridgeId = useVModel(props, 'modelValue', emits)
|
|
||||||
|
|
||||||
const dataSinkList = ref<any[]>([]) // 数据流转目的列表
|
|
||||||
|
|
||||||
onMounted(async () => {
|
|
||||||
// 获取数据流转目的列表
|
|
||||||
dataSinkList.value = await DataSinkApi.getDataSinkSimpleList()
|
|
||||||
})
|
|
||||||
</script>
|
|
||||||
Reference in New Issue
Block a user