Commit 84362631b44562c0b41e8772850ea2b9b28f576a

Authored by loveumiko
1 parent 59b7d59f

fix: 隐藏规则链相关的节点和修改节点字段名

@@ -25,7 +25,7 @@ export default { @@ -25,7 +25,7 @@ export default {
25 CLIENT_ATTRIBUTE_NAMES: '客户端属性', 25 CLIENT_ATTRIBUTE_NAMES: '客户端属性',
26 SHARED_ATTRIBUTE_NAMES: '共享属性', 26 SHARED_ATTRIBUTE_NAMES: '共享属性',
27 SERVER_ATTRIBUTE_NAMES: '服务器属性', 27 SERVER_ATTRIBUTE_NAMES: '服务器属性',
28 - LATEST_TS_KEY_NAMES: '最新时间序列', 28 + LATEST_TS_KEY_NAMES: '最新时序数据-标识符',
29 GET_LATEST_VALUE_WITH_TS: '获取带有时间戳的最新遥测', 29 GET_LATEST_VALUE_WITH_TS: '获取带有时间戳的最新遥测',
30 }, 30 },
31 OriginatorFieldsNameEnum: { 31 OriginatorFieldsNameEnum: {
@@ -28,24 +28,24 @@ export enum RelationTypeNameEnum { @@ -28,24 +28,24 @@ export enum RelationTypeNameEnum {
28 */ 28 */
29 export enum EntityTypeEnum { 29 export enum EntityTypeEnum {
30 DEVICE = 'DEVICE', 30 DEVICE = 'DEVICE',
31 - ASSET = 'ASSET',  
32 - ENTITY_VIEW = 'ENTITY_VIEW', 31 + // ASSET = 'ASSET',
  32 + // ENTITY_VIEW = 'ENTITY_VIEW',
33 TENANT = 'TENANT', 33 TENANT = 'TENANT',
34 CUSTOMER = 'CUSTOMER', 34 CUSTOMER = 'CUSTOMER',
35 USER = 'USER', 35 USER = 'USER',
36 - DASHBOARD = 'DASHBOARD',  
37 - EDGE = 'EDGE', 36 + // DASHBOARD = 'DASHBOARD',
  37 + // EDGE = 'EDGE',
38 } 38 }
39 39
40 export enum EntityTypeNameEnum { 40 export enum EntityTypeNameEnum {
41 DEVICE = '设备', 41 DEVICE = '设备',
42 - ASSET = '资产',  
43 - ENTITY_VIEW = '实体视图', 42 + // ASSET = '资产',
  43 + // ENTITY_VIEW = '实体视图',
44 TENANT = '租户', 44 TENANT = '租户',
45 CUSTOMER = '客户', 45 CUSTOMER = '客户',
46 USER = '用户', 46 USER = '用户',
47 - DASHBOARD = '仪表板',  
48 - EDGE = '边缘', 47 + // DASHBOARD = '仪表板',
  48 + // EDGE = '边缘',
49 } 49 }
50 50
51 /** 51 /**
@@ -26,9 +26,9 @@ @@ -26,9 +26,9 @@
26 import { CreateRuleChainModal } from './src/components/CreateRuleChainModal'; 26 import { CreateRuleChainModal } from './src/components/CreateRuleChainModal';
27 import { useRouter } from 'vue-router'; 27 import { useRouter } from 'vue-router';
28 28
29 - import { getRuleChinsList } from '/@/api/ruleengine/ruleengineApi';  
30 - import { ApiSelect } from '/@/components/Form';  
31 - import DownImage from '/@/assets/svg/down-svg.svg'; 29 + // import { getRuleChinsList } from '/@/api/ruleengine/ruleengineApi';
  30 + // import { ApiSelect } from '/@/components/Form';
  31 + // import DownImage from '/@/assets/svg/down-svg.svg';
32 32
33 const getId = Number(Math.random().toString().substring(2)).toString(16); 33 const getId = Number(Math.random().toString().substring(2)).toString(16);
34 34
@@ -102,18 +102,18 @@ @@ -102,18 +102,18 @@
102 }; 102 };
103 103
104 const ROUTER = useRouter(); 104 const ROUTER = useRouter();
105 - const isShowSelect = ref<boolean>(false); 105 + // const isShowSelect = ref<boolean>(false);
106 const handleBack = () => { 106 const handleBack = () => {
107 ROUTER.go(-1); 107 ROUTER.go(-1);
108 }; 108 };
109 109
110 - const handleDown = () => {  
111 - isShowSelect.value = !unref(isShowSelect);  
112 - }; 110 + // const handleDown = () => {
  111 + // isShowSelect.value = !unref(isShowSelect);
  112 + // };
113 113
114 - const handleSelectChange = (e) => {  
115 - ROUTER.replace(`${e}`);  
116 - }; 114 + // const handleSelectChange = (e) => {
  115 + // ROUTER.replace(`${e}`);
  116 + // };
117 117
118 onMounted(() => { 118 onMounted(() => {
119 getCurrentPageMetaData(flowActionType); 119 getCurrentPageMetaData(flowActionType);
@@ -203,10 +203,10 @@ @@ -203,10 +203,10 @@
203 <Icon class="!text-2xl dark:text-light-50" :icon="getFullScreenIcon" /> 203 <Icon class="!text-2xl dark:text-light-50" :icon="getFullScreenIcon" />
204 </button> 204 </button>
205 </Panel> 205 </Panel>
206 - <Panel position="top-left"> 206 + <!-- <Panel position="top-left">
207 <h1 class="ml-10">{{ ruleChainDetail?.name }}</h1> 207 <h1 class="ml-10">{{ ruleChainDetail?.name }}</h1>
208 - </Panel>  
209 - <Panel position="top-center" class="flex flex-col items-center"> 208 + </Panel> -->
  209 + <!-- <Panel position="top-center" class="flex flex-col items-center">
210 <button 210 <button
211 class="w-10 h-10 bg-gray-300 mx-1 flex justify-center items-center rounded-full dark:bg-dark-50" 211 class="w-10 h-10 bg-gray-300 mx-1 flex justify-center items-center rounded-full dark:bg-dark-50"
212 @click="handleDown" 212 @click="handleDown"
@@ -237,7 +237,7 @@ @@ -237,7 +237,7 @@
237 @change="handleSelectChange" 237 @change="handleSelectChange"
238 /> 238 />
239 </div> 239 </div>
240 - </Panel> 240 + </Panel> -->
241 </VueFlow> 241 </VueFlow>
242 </Spin> 242 </Spin>
243 243
@@ -263,8 +263,8 @@ @@ -263,8 +263,8 @@
263 @apply w-full h-full; 263 @apply w-full h-full;
264 } 264 }
265 265
266 - :deep(.top .center) {  
267 - margin: 0 !important;  
268 - } 266 + // :deep(.top .center) {
  267 + // margin: 0 !important;
  268 + // }
269 } 269 }
270 </style> 270 </style>
@@ -8,54 +8,54 @@ import { useI18n } from '/@/hooks/web/useI18n'; @@ -8,54 +8,54 @@ import { useI18n } from '/@/hooks/web/useI18n';
8 const { t } = useI18n(); 8 const { t } = useI18n();
9 9
10 export const formSchemas: FormSchema[] = [ 10 export const formSchemas: FormSchema[] = [
11 - {  
12 - field: OriginatorAttributesEnum.TELL_FAILURE_IF_ABSENT,  
13 - component: 'Checkbox',  
14 - label: t(OriginatorAttributesNameEnum.TELL_FAILURE_IF_ABSENT),  
15 - renderComponentContent: () => ({  
16 - default: () =>  
17 - 'If at least one selected key doesn\'t exist the outbound message will report "Failure".',  
18 - }),  
19 - },  
20 - {  
21 - field: OriginatorAttributesEnum.CLIENT_ATTRIBUTE_NAMES,  
22 - component: 'Select',  
23 - label: t(OriginatorAttributesNameEnum.CLIENT_ATTRIBUTE_NAMES),  
24 - helpMessage: [  
25 - `Hint: use \${metadataKey} for value from metadata, $[messageKey] for value from message body`,  
26 - ],  
27 - componentProps: {  
28 - mode: 'tags',  
29 - open: false,  
30 - placeholder: `请输入${t(OriginatorAttributesNameEnum.CLIENT_ATTRIBUTE_NAMES)}`,  
31 - },  
32 - },  
33 - {  
34 - field: OriginatorAttributesEnum.SHARED_ATTRIBUTE_NAMES,  
35 - component: 'Select',  
36 - label: t(OriginatorAttributesNameEnum.SHARED_ATTRIBUTE_NAMES),  
37 - helpMessage: [  
38 - `Hint: use \${metadataKey} for value from metadata, $[messageKey] for value from message body`,  
39 - ],  
40 - componentProps: {  
41 - mode: 'tags',  
42 - open: false,  
43 - placeholder: `请输入${t(OriginatorAttributesNameEnum.SHARED_ATTRIBUTE_NAMES)}`,  
44 - },  
45 - },  
46 - {  
47 - field: OriginatorAttributesEnum.SERVER_ATTRIBUTE_NAMES,  
48 - component: 'Select',  
49 - label: t(OriginatorAttributesNameEnum.SERVER_ATTRIBUTE_NAMES),  
50 - helpMessage: [  
51 - `Hint: use \${metadataKey} for value from metadata, $[messageKey] for value from message body`,  
52 - ],  
53 - componentProps: {  
54 - mode: 'tags',  
55 - open: false,  
56 - placeholder: `请输入${t(OriginatorAttributesNameEnum.SERVER_ATTRIBUTE_NAMES)}`,  
57 - },  
58 - }, 11 + // {
  12 + // field: OriginatorAttributesEnum.TELL_FAILURE_IF_ABSENT,
  13 + // component: 'Checkbox',
  14 + // label: t(OriginatorAttributesNameEnum.TELL_FAILURE_IF_ABSENT),
  15 + // renderComponentContent: () => ({
  16 + // default: () =>
  17 + // 'If at least one selected key doesn\'t exist the outbound message will report "Failure".',
  18 + // }),
  19 + // },
  20 + // {
  21 + // field: OriginatorAttributesEnum.CLIENT_ATTRIBUTE_NAMES,
  22 + // component: 'Select',
  23 + // label: t(OriginatorAttributesNameEnum.CLIENT_ATTRIBUTE_NAMES),
  24 + // helpMessage: [
  25 + // `Hint: use \${metadataKey} for value from metadata, $[messageKey] for value from message body`,
  26 + // ],
  27 + // componentProps: {
  28 + // mode: 'tags',
  29 + // open: false,
  30 + // placeholder: `请输入${t(OriginatorAttributesNameEnum.CLIENT_ATTRIBUTE_NAMES)}`,
  31 + // },
  32 + // },
  33 + // {
  34 + // field: OriginatorAttributesEnum.SHARED_ATTRIBUTE_NAMES,
  35 + // component: 'Select',
  36 + // label: t(OriginatorAttributesNameEnum.SHARED_ATTRIBUTE_NAMES),
  37 + // helpMessage: [
  38 + // `Hint: use \${metadataKey} for value from metadata, $[messageKey] for value from message body`,
  39 + // ],
  40 + // componentProps: {
  41 + // mode: 'tags',
  42 + // open: false,
  43 + // placeholder: `请输入${t(OriginatorAttributesNameEnum.SHARED_ATTRIBUTE_NAMES)}`,
  44 + // },
  45 + // },
  46 + // {
  47 + // field: OriginatorAttributesEnum.SERVER_ATTRIBUTE_NAMES,
  48 + // component: 'Select',
  49 + // label: t(OriginatorAttributesNameEnum.SERVER_ATTRIBUTE_NAMES),
  50 + // helpMessage: [
  51 + // `Hint: use \${metadataKey} for value from metadata, $[messageKey] for value from message body`,
  52 + // ],
  53 + // componentProps: {
  54 + // mode: 'tags',
  55 + // open: false,
  56 + // placeholder: `请输入${t(OriginatorAttributesNameEnum.SERVER_ATTRIBUTE_NAMES)}`,
  57 + // },
  58 + // },
59 { 59 {
60 field: OriginatorAttributesEnum.LATEST_TS_KEY_NAMES, 60 field: OriginatorAttributesEnum.LATEST_TS_KEY_NAMES,
61 component: 'Select', 61 component: 'Select',
@@ -75,7 +75,7 @@ export const formSchemas: FormSchema[] = [ @@ -75,7 +75,7 @@ export const formSchemas: FormSchema[] = [
75 label: t(OriginatorAttributesNameEnum.GET_LATEST_VALUE_WITH_TS), 75 label: t(OriginatorAttributesNameEnum.GET_LATEST_VALUE_WITH_TS),
76 renderComponentContent: () => ({ 76 renderComponentContent: () => ({
77 default: () => 77 default: () =>
78 - 'If selected, latest telemetry values will be added to the outbound message metadata with timestamp, e.g: "temp": "{"ts":1574329385897, "value":42}"', 78 + '如果选中,最新的遥测值将添加到带有时间戳的出站消息元数据中, 例如: "temp": "{"ts":1574329385897, "value":42}"',
79 }), 79 }),
80 }, 80 },
81 ]; 81 ];
@@ -13,6 +13,7 @@ export const formSchemas: FormSchema[] = [ @@ -13,6 +13,7 @@ export const formSchemas: FormSchema[] = [
13 component: 'AttributeConfiguration', 13 component: 'AttributeConfiguration',
14 label: t(OriginatorFieldsNameEnum.FIELDS_MAPPING), 14 label: t(OriginatorFieldsNameEnum.FIELDS_MAPPING),
15 slot: OriginatorFieldsEnum.FIELDS_MAPPING, 15 slot: OriginatorFieldsEnum.FIELDS_MAPPING,
  16 + helpMessage: '允许发起者类型: 租户、客户、用户、设备、告警、规则链',
16 valueField: 'value', 17 valueField: 'value',
17 changeEvent: 'update:value', 18 changeEvent: 'update:value',
18 }, 19 },
@@ -45,8 +45,8 @@ @@ -45,8 +45,8 @@
45 <AttributeConfiguration 45 <AttributeConfiguration
46 v-model:value="model[field]" 46 v-model:value="model[field]"
47 ref="fieldControlElRef" 47 ref="fieldControlElRef"
48 - keyLabel="Source Field"  
49 - valueLabel="Target attribute" 48 + keyLabel="实体的字段"
  49 + valueLabel="目标属性"
50 /> 50 />
51 </template> 51 </template>
52 </BasicForm> 52 </BasicForm>
@@ -139,7 +139,7 @@ export const formSchemas: FormSchema[] = [ @@ -139,7 +139,7 @@ export const formSchemas: FormSchema[] = [
139 { 139 {
140 field: RelatedDeviceAttributeFieldsEnum.LATEST_TS_KEY_NAMES, 140 field: RelatedDeviceAttributeFieldsEnum.LATEST_TS_KEY_NAMES,
141 component: 'Select', 141 component: 'Select',
142 - label: t(RelatedDeviceAttributeFieldsNameEnum.LATEST_TS_KEY_NAMES), 142 + label: t(RelatedDeviceAttributeFieldsNameEnum.LATEST_TS_KEY_NAMES) + '123',
143 componentProps: { 143 componentProps: {
144 open: false, 144 open: false,
145 mode: 'tags', 145 mode: 'tags',
1 import type { CategoryConfigType, NodeItemConfigType } from '../../types/node'; 1 import type { CategoryConfigType, NodeItemConfigType } from '../../types/node';
2 import { RuleNodeTypeEnum } from '../index.type'; 2 import { RuleNodeTypeEnum } from '../index.type';
3 -import { CustomerAttributesConfig } from './CustomerAttributes'; 3 +// import { CustomerAttributesConfig } from './CustomerAttributes';
4 import { OriginatorTelemetryConfig } from './OriginatorTelemetry'; 4 import { OriginatorTelemetryConfig } from './OriginatorTelemetry';
5 import { OriginatorFieldsConfig } from './OriginatorFields'; 5 import { OriginatorFieldsConfig } from './OriginatorFields';
6 import { CalculateDeltaConfig } from './CalculateDelta'; 6 import { CalculateDeltaConfig } from './CalculateDelta';
7 -import { TenantAttributesConfig } from './TenantAttributes';  
8 -import { RelatedDeviceAttributesConfig } from './RelatedDeviceAttributes';  
9 -import { RelatedAttributesConfig } from './RelatedAttributes';  
10 -import { TenantDetailsConfig } from './TenantDetails'; 7 +// import { TenantAttributesConfig } from './TenantAttributes';
  8 +// import { RelatedDeviceAttributesConfig } from './RelatedDeviceAttributes';
  9 +// import { RelatedAttributesConfig } from './RelatedAttributes';
  10 +// import { TenantDetailsConfig } from './TenantDetails';
11 import { OriginatorAttributesConfig } from './OriginatorAttributes'; 11 import { OriginatorAttributesConfig } from './OriginatorAttributes';
12 -import { CustomerDetailsConfig } from './CustomerDetails'; 12 +// import { CustomerDetailsConfig } from './CustomerDetails';
13 import { useI18n } from '/@/hooks/web/useI18n'; 13 import { useI18n } from '/@/hooks/web/useI18n';
14 14
15 const { t } = useI18n(); // 加载国际化 15 const { t } = useI18n(); // 加载国际化
@@ -23,13 +23,13 @@ export const EnrichmentCategoryConfig: CategoryConfigType = { @@ -23,13 +23,13 @@ export const EnrichmentCategoryConfig: CategoryConfigType = {
23 23
24 export const EnrichmentComponents: NodeItemConfigType[] = [ 24 export const EnrichmentComponents: NodeItemConfigType[] = [
25 CalculateDeltaConfig, 25 CalculateDeltaConfig,
26 - CustomerAttributesConfig,  
27 - CustomerDetailsConfig, 26 + // CustomerAttributesConfig,
  27 + // CustomerDetailsConfig,
28 OriginatorAttributesConfig, 28 OriginatorAttributesConfig,
29 OriginatorFieldsConfig, 29 OriginatorFieldsConfig,
30 OriginatorTelemetryConfig, 30 OriginatorTelemetryConfig,
31 - RelatedAttributesConfig,  
32 - RelatedDeviceAttributesConfig,  
33 - TenantAttributesConfig,  
34 - TenantDetailsConfig, 31 + // RelatedAttributesConfig,
  32 + // RelatedDeviceAttributesConfig,
  33 + // TenantAttributesConfig,
  34 + // TenantDetailsConfig,
35 ]; 35 ];
@@ -9,6 +9,7 @@ @@ -9,6 +9,7 @@
9 import { useForm, BasicForm } from '/@/components/Form'; 9 import { useForm, BasicForm } from '/@/components/Form';
10 import { BottomFormSchemas, TopFormSchemas } from '../CreateNodeModal/config'; 10 import { BottomFormSchemas, TopFormSchemas } from '../CreateNodeModal/config';
11 import { toRaw, unref } from 'vue'; 11 import { toRaw, unref } from 'vue';
  12 +
12 import { BasicEvents } from './BasicEvents'; 13 import { BasicEvents } from './BasicEvents';
13 14
14 const [topFormRegister, topFormActionType] = useForm({ 15 const [topFormRegister, topFormActionType] = useForm({
@@ -79,7 +80,7 @@ @@ -79,7 +80,7 @@
79 <template> 80 <template>
80 <BasicDrawer 81 <BasicDrawer
81 v-model:visible="visible" 82 v-model:visible="visible"
82 - :width="nodeData?.created ? '50%' : '40%'" 83 + :width="!nodeData?.created ? '55%' : '40%'"
83 showFooter 84 showFooter
84 showCancelBtn 85 showCancelBtn
85 showOkBtn 86 showOkBtn