Showing
6 changed files
with
22 additions
and
13 deletions
@@ -47,7 +47,7 @@ export default { | @@ -47,7 +47,7 @@ export default { | ||
47 | sceneReact: { | 47 | sceneReact: { |
48 | name: '场景交互', | 48 | name: '场景交互', |
49 | details: `基于业务场景,实现设备的交互控制。`, | 49 | details: `基于业务场景,实现设备的交互控制。`, |
50 | - description: '基于业务场景,实现设备的交互控。', | 50 | + description: '基于业务场景,实现设备的交互控制。', |
51 | }, | 51 | }, |
52 | script: { | 52 | script: { |
53 | name: 'JS脚本', | 53 | name: 'JS脚本', |
@@ -5,7 +5,8 @@ | @@ -5,7 +5,8 @@ | ||
5 | import { NodeData } from '../../../types/node'; | 5 | import { NodeData } from '../../../types/node'; |
6 | import { AttributeConfiguration } from '/@/views/rule/designer/src/components/AttributeConfiguration'; | 6 | import { AttributeConfiguration } from '/@/views/rule/designer/src/components/AttributeConfiguration'; |
7 | import { ref, unref } from 'vue'; | 7 | import { ref, unref } from 'vue'; |
8 | - import { NodeBindDataFieldEnum } from '../../../enum/node'; | 8 | + // import { NodeBindDataFieldEnum } from '../../../enum/node';//之前导入的 |
9 | + import { CustomerAttributesFieldsEnum } from '../../../enum/formField/enrichment'; //ft修改属性集客户端属性点击切换Latest telemetry, Source telemetry未切换 | ||
9 | 10 | ||
10 | defineProps<{ | 11 | defineProps<{ |
11 | config: NodeData; | 12 | config: NodeData; |
@@ -23,13 +24,13 @@ | @@ -23,13 +24,13 @@ | ||
23 | await validate(); | 24 | await validate(); |
24 | const value = getFieldsValue() || {}; | 25 | const value = getFieldsValue() || {}; |
25 | const attrMapping = unref(attributeControlElRef)?.getFieldsValue(); | 26 | const attrMapping = unref(attributeControlElRef)?.getFieldsValue(); |
26 | - return { ...value, [NodeBindDataFieldEnum.ATTR_MAPING]: attrMapping }; | 27 | + return { ...value, [CustomerAttributesFieldsEnum.ATTR_MAPING]: attrMapping }; //ft修改枚举导入 |
27 | }; | 28 | }; |
28 | 29 | ||
29 | const setValue: CreateModalDefineExposeType['setFieldsValue'] = (value) => { | 30 | const setValue: CreateModalDefineExposeType['setFieldsValue'] = (value) => { |
30 | resetFields(); | 31 | resetFields(); |
31 | setFieldsValue(value); | 32 | setFieldsValue(value); |
32 | - unref(attributeControlElRef)?.setFieldsValue(value?.[NodeBindDataFieldEnum.ATTR_MAPING]); | 33 | + unref(attributeControlElRef)?.setFieldsValue(value?.[CustomerAttributesFieldsEnum.ATTR_MAPING]); //ft修改枚举导入 |
33 | }; | 34 | }; |
34 | 35 | ||
35 | defineExpose({ | 36 | defineExpose({ |
@@ -41,10 +42,13 @@ | @@ -41,10 +42,13 @@ | ||
41 | <template> | 42 | <template> |
42 | <BasicForm @register="register"> | 43 | <BasicForm @register="register"> |
43 | <template #attrMapping="{ field, model }"> | 44 | <template #attrMapping="{ field, model }"> |
45 | + <!-- ft修改枚举导入 --> | ||
44 | <AttributeConfiguration | 46 | <AttributeConfiguration |
45 | v-model:value="model[field]" | 47 | v-model:value="model[field]" |
46 | ref="attributeControlElRef" | 48 | ref="attributeControlElRef" |
47 | - :keyLabel="`Source ${model[NodeBindDataFieldEnum.TELEMETRY] ? 'telemetry' : 'attribute'}`" | 49 | + :keyLabel="`Source ${ |
50 | + model[CustomerAttributesFieldsEnum.TELEMETRY] ? 'telemetry' : 'attribute' | ||
51 | + }`" | ||
48 | valueLabel="Target attribute" | 52 | valueLabel="Target attribute" |
49 | > | 53 | > |
50 | <template #afterForm> | 54 | <template #afterForm> |
@@ -10,6 +10,7 @@ export const formSchemas: FormSchema[] = [ | @@ -10,6 +10,7 @@ export const formSchemas: FormSchema[] = [ | ||
10 | field: CustomerDetailsFieldsEnum.DETAILS_LIST, | 10 | field: CustomerDetailsFieldsEnum.DETAILS_LIST, |
11 | component: 'Select', | 11 | component: 'Select', |
12 | label: CustomerDetailsFieldsNameEnum.DETAILS_LIST, | 12 | label: CustomerDetailsFieldsNameEnum.DETAILS_LIST, |
13 | + required: true, //ft修改为必传 | ||
13 | componentProps: { | 14 | componentProps: { |
14 | mode: 'multiple', | 15 | mode: 'multiple', |
15 | options: Object.keys(DetailsListEnum).map((item) => ({ | 16 | options: Object.keys(DetailsListEnum).map((item) => ({ |
@@ -5,7 +5,8 @@ | @@ -5,7 +5,8 @@ | ||
5 | import { NodeData } from '../../../types/node'; | 5 | import { NodeData } from '../../../types/node'; |
6 | import { AttributeConfiguration } from '/@/views/rule/designer/src/components/AttributeConfiguration'; | 6 | import { AttributeConfiguration } from '/@/views/rule/designer/src/components/AttributeConfiguration'; |
7 | import { ref, unref } from 'vue'; | 7 | import { ref, unref } from 'vue'; |
8 | - import { NodeBindDataFieldEnum } from '../../../enum/node'; | 8 | + // import { NodeBindDataFieldEnum } from '../../../enum/node'; |
9 | + import { OriginatorFieldsEnum } from '../../../enum/formField/enrichment'; //ft修改枚举导入 | ||
9 | 10 | ||
10 | defineProps<{ | 11 | defineProps<{ |
11 | config: NodeData; | 12 | config: NodeData; |
@@ -23,13 +24,13 @@ | @@ -23,13 +24,13 @@ | ||
23 | await validate(); | 24 | await validate(); |
24 | const value = getFieldsValue() || {}; | 25 | const value = getFieldsValue() || {}; |
25 | const fieldsMapping = unref(fieldControlElRef)?.getFieldsValue(); | 26 | const fieldsMapping = unref(fieldControlElRef)?.getFieldsValue(); |
26 | - return { ...value, [NodeBindDataFieldEnum.FIELDS_MAPPING]: fieldsMapping }; | 27 | + return { ...value, [OriginatorFieldsEnum.FIELDS_MAPPING]: fieldsMapping }; //ft修改枚举导入 |
27 | }; | 28 | }; |
28 | 29 | ||
29 | const setValue: CreateModalDefineExposeType['setFieldsValue'] = (value) => { | 30 | const setValue: CreateModalDefineExposeType['setFieldsValue'] = (value) => { |
30 | resetFields(); | 31 | resetFields(); |
31 | setFieldsValue(value); | 32 | setFieldsValue(value); |
32 | - unref(fieldControlElRef)?.setFieldsValue(value?.[NodeBindDataFieldEnum.FIELDS_MAPPING]); | 33 | + unref(fieldControlElRef)?.setFieldsValue(value?.[OriginatorFieldsEnum.FIELDS_MAPPING]); //ft修改枚举导入 |
33 | }; | 34 | }; |
34 | 35 | ||
35 | defineExpose({ | 36 | defineExpose({ |
@@ -5,7 +5,8 @@ | @@ -5,7 +5,8 @@ | ||
5 | import { NodeData } from '../../../types/node'; | 5 | import { NodeData } from '../../../types/node'; |
6 | import { AttributeConfiguration } from '/@/views/rule/designer/src/components/AttributeConfiguration'; | 6 | import { AttributeConfiguration } from '/@/views/rule/designer/src/components/AttributeConfiguration'; |
7 | import { ref, unref } from 'vue'; | 7 | import { ref, unref } from 'vue'; |
8 | - import { NodeBindDataFieldEnum } from '../../../enum/node'; | 8 | + // import { NodeBindDataFieldEnum } from '../../../enum/node'; |
9 | + import { CustomerAttributesFieldsEnum } from '../../../enum/formField/enrichment'; //ft修改枚举导入 | ||
9 | 10 | ||
10 | defineProps<{ | 11 | defineProps<{ |
11 | config: NodeData; | 12 | config: NodeData; |
@@ -23,13 +24,13 @@ | @@ -23,13 +24,13 @@ | ||
23 | await validate(); | 24 | await validate(); |
24 | const value = getFieldsValue() || {}; | 25 | const value = getFieldsValue() || {}; |
25 | const attrMapping = unref(attributeControlElRef)?.getFieldsValue(); | 26 | const attrMapping = unref(attributeControlElRef)?.getFieldsValue(); |
26 | - return { ...value, [NodeBindDataFieldEnum.ATTR_MAPING]: attrMapping }; | 27 | + return { ...value, [CustomerAttributesFieldsEnum.ATTR_MAPING]: attrMapping }; //ft修改枚举导入 |
27 | }; | 28 | }; |
28 | 29 | ||
29 | const setValue: CreateModalDefineExposeType['setFieldsValue'] = (value) => { | 30 | const setValue: CreateModalDefineExposeType['setFieldsValue'] = (value) => { |
30 | resetFields(); | 31 | resetFields(); |
31 | setFieldsValue(value); | 32 | setFieldsValue(value); |
32 | - unref(attributeControlElRef)?.setFieldsValue(value?.[NodeBindDataFieldEnum.ATTR_MAPING]); | 33 | + unref(attributeControlElRef)?.setFieldsValue(value?.[CustomerAttributesFieldsEnum.ATTR_MAPING]); //ft修改枚举导入 |
33 | }; | 34 | }; |
34 | 35 | ||
35 | defineExpose({ | 36 | defineExpose({ |
@@ -44,7 +45,9 @@ | @@ -44,7 +45,9 @@ | ||
44 | <AttributeConfiguration | 45 | <AttributeConfiguration |
45 | v-model:value="model[field]" | 46 | v-model:value="model[field]" |
46 | ref="attributeControlElRef" | 47 | ref="attributeControlElRef" |
47 | - :keyLabel="`Source ${model[NodeBindDataFieldEnum.TELEMETRY] ? 'telemetry' : 'attribute'}`" | 48 | + :keyLabel="`Source ${ |
49 | + model[CustomerAttributesFieldsEnum.TELEMETRY] ? 'telemetry' : 'attribute' | ||
50 | + }`" | ||
48 | valueLabel="Target attribute" | 51 | valueLabel="Target attribute" |
49 | > | 52 | > |
50 | <template #afterForm> | 53 | <template #afterForm> |
@@ -16,7 +16,7 @@ export const formSchemas: FormSchema[] = [ | @@ -16,7 +16,7 @@ export const formSchemas: FormSchema[] = [ | ||
16 | javaScriptEditorProps: { | 16 | javaScriptEditorProps: { |
17 | height: 230, | 17 | height: 230, |
18 | functionName: 'Switch', | 18 | functionName: 'Switch', |
19 | - paramsName: ['msg', 'metadata', 'mstType'], | 19 | + paramsName: ['msg', 'metadata', 'msgType'], |
20 | }, | 20 | }, |
21 | }, | 21 | }, |
22 | renderComponentContent: () => { | 22 | renderComponentContent: () => { |