Commit 38549d76e2747730d335a2251ad010cc742a2e08
Merge branch 'fix/rule-chain-field' into 'main_dev'
fix: 规则链文字修改 See merge request yunteng/thingskit-front!1044
Showing
20 changed files
with
82 additions
and
64 deletions
| @@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
| 3 | 目前共有10个,分类按名称进行配置 | 3 | 目前共有10个,分类按名称进行配置 |
| 4 | */ | 4 | */ |
| 5 | export default { | 5 | export default { |
| 6 | - title: '属性集', | 6 | + title: '属性', |
| 7 | description: '向消息元数据中添加附加信息', | 7 | description: '向消息元数据中添加附加信息', |
| 8 | calculateDelta: { | 8 | calculateDelta: { |
| 9 | name: '计算增量', | 9 | name: '计算增量', |
| @@ -11,9 +11,9 @@ export default { | @@ -11,9 +11,9 @@ export default { | ||
| 11 | description: `根据传入值和上一个值计算增量值并将其添加到消息中。`, | 11 | description: `根据传入值和上一个值计算增量值并将其添加到消息中。`, |
| 12 | }, | 12 | }, |
| 13 | customerAttributes: { | 13 | customerAttributes: { |
| 14 | - name: '客户端属性', | 14 | + name: '客户属性', |
| 15 | details: `如果已配置属性,则会将服务器范围属性添加到消息元数据中。如果配置了'最新遥测',则将最新遥测添加到元数据中。要访问其他节点中的这些属性,可以使用metadata.temperature访问。`, | 15 | details: `如果已配置属性,则会将服务器范围属性添加到消息元数据中。如果配置了'最新遥测',则将最新遥测添加到元数据中。要访问其他节点中的这些属性,可以使用metadata.temperature访问。`, |
| 16 | - description: `将发起者客户端属性或最新遥测添加到消息元数据中。`, | 16 | + description: `将发起者客户属性或最新遥测添加到消息元数据中。`, |
| 17 | }, | 17 | }, |
| 18 | customerDetails: { | 18 | customerDetails: { |
| 19 | name: '客户详情', | 19 | name: '客户详情', |
| @@ -51,8 +51,8 @@ export default { | @@ -51,8 +51,8 @@ export default { | ||
| 51 | description: '将发起者租户属性或最新遥测添加到消息元数据中。', | 51 | description: '将发起者租户属性或最新遥测添加到消息元数据中。', |
| 52 | }, | 52 | }, |
| 53 | tenantDetails: { | 53 | tenantDetails: { |
| 54 | - name: '租户详细信息', | 54 | + name: '租户详情', |
| 55 | details: `如果选中:【将选定的详细信息添加到消息元数据】,则现有字段将添加到消息元数据而不是消息数据;注意:只允许设备、资产和实体视图类型;如果原始的消息发件人未分配给Tenant或者不支持原始发件人类型,消息将转发到失败链,否则将使用成功链路。`, | 55 | details: `如果选中:【将选定的详细信息添加到消息元数据】,则现有字段将添加到消息元数据而不是消息数据;注意:只允许设备、资产和实体视图类型;如果原始的消息发件人未分配给Tenant或者不支持原始发件人类型,消息将转发到失败链,否则将使用成功链路。`, |
| 56 | - description: '将租户详细信息中的字段添加到消息正文或元数据中。', | 56 | + description: '将租户详情中的字段添加到消息正文或元数据中。', |
| 57 | }, | 57 | }, |
| 58 | }; | 58 | }; |
| @@ -3,15 +3,15 @@ | @@ -3,15 +3,15 @@ | ||
| 3 | 目前共有11个,分类按名称进行配置 | 3 | 目前共有11个,分类按名称进行配置 |
| 4 | */ | 4 | */ |
| 5 | export default { | 5 | export default { |
| 6 | - title: '筛选器', | 6 | + title: '过滤', |
| 7 | description: '使用配置条件筛选传入消息', | 7 | description: '使用配置条件筛选传入消息', |
| 8 | checkAlarmStatus: { | 8 | checkAlarmStatus: { |
| 9 | - name: '检测报警状态', | 9 | + name: '检查告警状态', |
| 10 | details: '如果警报状态与指定的状态匹配,则消息成功;如果不匹配,则消息失败。', | 10 | details: '如果警报状态与指定的状态匹配,则消息成功;如果不匹配,则消息失败。', |
| 11 | - description: '检测报警状态', | 11 | + description: '检查告警状态', |
| 12 | }, | 12 | }, |
| 13 | checkExistenceFields: { | 13 | checkExistenceFields: { |
| 14 | - name: '检测字段是否存在', | 14 | + name: '检查字段是否存在', |
| 15 | details: `如果选中【检查所有选择的键是否存在】 ,就必选满足Message data中配置的字段和Message metadata中配置的字段,都必须存在才会返回true发送消息,否则返回false。 | 15 | details: `如果选中【检查所有选择的键是否存在】 ,就必选满足Message data中配置的字段和Message metadata中配置的字段,都必须存在才会返回true发送消息,否则返回false。 |
| 16 | 如果未选中,Message data中配置的字段或者Message metadata中配置的字段至少有一个键存在返回true,否则返回false。`, | 16 | 如果未选中,Message data中配置的字段或者Message metadata中配置的字段至少有一个键存在返回true,否则返回false。`, |
| 17 | description: '检查消息中的字段数据和消息元数据中所选择的键是否都存在。', | 17 | description: '检查消息中的字段数据和消息元数据中所选择的键是否都存在。', |
| @@ -22,27 +22,27 @@ export default { | @@ -22,27 +22,27 @@ export default { | ||
| 22 | description: `检查关系是按类型和方向将所选实体发送给消息的发起者;如果“检查单个实体”设置为true,否则规则节点将按类型和方向检查是否存在与消息发起者的任何关系。`, | 22 | description: `检查关系是按类型和方向将所选实体发送给消息的发起者;如果“检查单个实体”设置为true,否则规则节点将按类型和方向检查是否存在与消息发起者的任何关系。`, |
| 23 | }, | 23 | }, |
| 24 | gpsGeofencingFilter: { | 24 | gpsGeofencingFilter: { |
| 25 | - name: 'GPS地理围栏过滤器', | 25 | + name: 'GPS地理围栏过滤', |
| 26 | details: `从传入消息中提取纬度和经度参数,如果它们位于配置的周界内,则返回'True',否则返回'False'。`, | 26 | details: `从传入消息中提取纬度和经度参数,如果它们位于配置的周界内,则返回'True',否则返回'False'。`, |
| 27 | description: '通过基于GPS的地理围栏过滤传入消息。', | 27 | description: '通过基于GPS的地理围栏过滤传入消息。', |
| 28 | }, | 28 | }, |
| 29 | messageType: { | 29 | messageType: { |
| 30 | - name: '消息类型', | 30 | + name: '消息类型过滤', |
| 31 | details: `如果需要传入消息类型通过,则'True'链发送消息,否则使用'False'链路。`, | 31 | details: `如果需要传入消息类型通过,则'True'链发送消息,否则使用'False'链路。`, |
| 32 | - description: '按消息类型筛选传入消息。', | 32 | + description: '按消息类型传入消息。', |
| 33 | }, | 33 | }, |
| 34 | messageTypeSwitch: { | 34 | messageTypeSwitch: { |
| 35 | - name: '消息类型转换', | 35 | + name: '消息类型切换', |
| 36 | details: `通过相应链发送消息类型为'属性上报','遥测上报','RPC请求'等的消息,否则使用其他链。`, | 36 | details: `通过相应链发送消息类型为'属性上报','遥测上报','RPC请求'等的消息,否则使用其他链。`, |
| 37 | description: '按消息类型路由传入消息。', | 37 | description: '按消息类型路由传入消息。', |
| 38 | }, | 38 | }, |
| 39 | originatorType: { | 39 | originatorType: { |
| 40 | - name: '发起者类型', | 40 | + name: '实体类型过滤', |
| 41 | details: `如果预期传入消息的发起者类型,通过则True链发送消息,否则使用False链路。`, | 41 | details: `如果预期传入消息的发起者类型,通过则True链发送消息,否则使用False链路。`, |
| 42 | description: '按消息发起者类型过滤传入消息。', | 42 | description: '按消息发起者类型过滤传入消息。', |
| 43 | }, | 43 | }, |
| 44 | originatorTypeSwitch: { | 44 | originatorTypeSwitch: { |
| 45 | - name: '发起者类型转换', | 45 | + name: '实体类型转换', |
| 46 | details: `根据发起方类型(设备、资产等)将消息路由到链。`, | 46 | details: `根据发起方类型(设备、资产等)将消息路由到链。`, |
| 47 | description: '按消息发起者类型路由传入消息。', | 47 | description: '按消息发起者类型路由传入消息。', |
| 48 | }, | 48 | }, |
| @@ -52,9 +52,9 @@ export default { | @@ -52,9 +52,9 @@ export default { | ||
| 52 | description: '基于业务场景,实现设备的交互控制。', | 52 | description: '基于业务场景,实现设备的交互控制。', |
| 53 | }, | 53 | }, |
| 54 | script: { | 54 | script: { |
| 55 | - name: 'JS脚本', | 55 | + name: '脚本', |
| 56 | details: `使用配置的JS匹配条件传入消息。如果为True,则通过True链发送消息,否则使用False链。可以通过msg属性访问消息负载。 例如 msg.temperature < 10 ;可以通过metadata属性访问消息元数据。例如metadata.customerName === 'John';可以通过msgType属性访问消息类型。`, | 56 | details: `使用配置的JS匹配条件传入消息。如果为True,则通过True链发送消息,否则使用False链。可以通过msg属性访问消息负载。 例如 msg.temperature < 10 ;可以通过metadata属性访问消息元数据。例如metadata.customerName === 'John';可以通过msgType属性访问消息类型。`, |
| 57 | - description: '使用JS脚本过滤传入消息。', | 57 | + description: '使用脚本过滤传入消息。', |
| 58 | }, | 58 | }, |
| 59 | switch: { | 59 | switch: { |
| 60 | name: '转换器', | 60 | name: '转换器', |
| @@ -8,8 +8,8 @@ export default { | @@ -8,8 +8,8 @@ export default { | ||
| 8 | OUTPUT_VALUE_KEY: '输出值键', | 8 | OUTPUT_VALUE_KEY: '输出值键', |
| 9 | ROUND: '小数', | 9 | ROUND: '小数', |
| 10 | USE_CACHE: '使用缓存获取最新值', | 10 | USE_CACHE: '使用缓存获取最新值', |
| 11 | - TELL_FAILURE_IF_DELTA_IS_NEGATIVE: '如果delta为负数,则告知Failure', | ||
| 12 | - ADD_PERIOD_BETWEEN_MSGS: '在消息之间添加句点', | 11 | + TELL_FAILURE_IF_DELTA_IS_NEGATIVE: '如果delta为负数,则告知Failure【失败】', |
| 12 | + ADD_PERIOD_BETWEEN_MSGS: '在消息之间添加时间差值{单位:毫秒}', | ||
| 13 | PERIOD_VALUE_KEY: '期间值键', | 13 | PERIOD_VALUE_KEY: '期间值键', |
| 14 | }, | 14 | }, |
| 15 | CustomerAttributesFieldsNameEnum: { | 15 | CustomerAttributesFieldsNameEnum: { |
| @@ -18,15 +18,15 @@ export default { | @@ -18,15 +18,15 @@ export default { | ||
| 18 | RELEATION_TYPE: '关联类型', | 18 | RELEATION_TYPE: '关联类型', |
| 19 | }, | 19 | }, |
| 20 | GpsGeofencingFilterFieldsNameEnum: { | 20 | GpsGeofencingFilterFieldsNameEnum: { |
| 21 | - LATITUDE_KEY_NAME: '纬度键名称', | ||
| 22 | - LONGITUDE_KEY_NAME: '经度键名称', | ||
| 23 | - PERIMETER_TYPE: '周长类型', | ||
| 24 | - FETCH_PERIMETER_INFO_FROM_MESSAGE_METADATA: '从消息元数据中获取周边信息', | 21 | + LATITUDE_KEY_NAME: '纬度标识符', |
| 22 | + LONGITUDE_KEY_NAME: '经度标识符', | ||
| 23 | + PERIMETER_TYPE: '周界类型', | ||
| 24 | + FETCH_PERIMETER_INFO_FROM_MESSAGE_METADATA: '从消息元数据中获取周界信息', | ||
| 25 | CENTER_LATITUDE: '中心纬度', | 25 | CENTER_LATITUDE: '中心纬度', |
| 26 | CENTER_LONGITUDE: '中心经度', | 26 | CENTER_LONGITUDE: '中心经度', |
| 27 | - RANGE: '范围', | 27 | + RANGE: '圆半径范围', |
| 28 | RANGE_UNIT: '范围的单位', | 28 | RANGE_UNIT: '范围的单位', |
| 29 | - PERIMETER_KEY_NAME: '周界密钥名称', | 29 | + PERIMETER_KEY_NAME: '周界标识符名称', |
| 30 | POLYGONS_DEFINITION: '多边形定义', | 30 | POLYGONS_DEFINITION: '多边形定义', |
| 31 | }, | 31 | }, |
| 32 | MessageTypeFieldsNameEnum: { | 32 | MessageTypeFieldsNameEnum: { |
| @@ -297,7 +297,6 @@ export const formSchema: FormSchema[] = [ | @@ -297,7 +297,6 @@ export const formSchema: FormSchema[] = [ | ||
| 297 | ifShow: ({ values }) => isDingtalk(Reflect.get(values, 'messageType')), | 297 | ifShow: ({ values }) => isDingtalk(Reflect.get(values, 'messageType')), |
| 298 | required: true, | 298 | required: true, |
| 299 | componentProps: { | 299 | componentProps: { |
| 300 | - maxLength: 36, | ||
| 301 | placeholder: '请输入clientSecret', | 300 | placeholder: '请输入clientSecret', |
| 302 | }, | 301 | }, |
| 303 | }, | 302 | }, |
| @@ -4,6 +4,12 @@ import { CreateModalDefineExposeType, AwaitPopupWindowReturnDataType } from '../ | @@ -4,6 +4,12 @@ import { CreateModalDefineExposeType, AwaitPopupWindowReturnDataType } from '../ | ||
| 4 | import { EdgeData, NodeData } from '../types/node'; | 4 | import { EdgeData, NodeData } from '../types/node'; |
| 5 | import { DataActionModeEnum } from '/@/enums/toolEnum'; | 5 | import { DataActionModeEnum } from '/@/enums/toolEnum'; |
| 6 | import { ElementsTypeEnum } from '../enum'; | 6 | import { ElementsTypeEnum } from '../enum'; |
| 7 | +import { FilterCategoryComponentEnum } from '../enum/category'; | ||
| 8 | +import { useMessage } from '/@/hooks/web/useMessage'; | ||
| 9 | +import { CheckExistenceFieldsNameEnum } from '../enum/formField/filter'; | ||
| 10 | +import { useI18n } from '/@/hooks/web/useI18n'; | ||
| 11 | + | ||
| 12 | +const { t } = useI18n(); | ||
| 7 | 13 | ||
| 8 | interface OptionsType { | 14 | interface OptionsType { |
| 9 | mode: DataActionModeEnum; | 15 | mode: DataActionModeEnum; |
| @@ -102,10 +108,25 @@ export function useAwaitPopupWindowBindData( | @@ -102,10 +108,25 @@ export function useAwaitPopupWindowBindData( | ||
| 102 | ); | 108 | ); |
| 103 | }; | 109 | }; |
| 104 | 110 | ||
| 111 | + const { createMessage } = useMessage(); | ||
| 112 | + | ||
| 105 | const handleSubmit = async (extraData: Recordable = {}) => { | 113 | const handleSubmit = async (extraData: Recordable = {}) => { |
| 106 | const { flag } = await validate(); | 114 | const { flag } = await validate(); |
| 107 | if (!flag) return; | 115 | if (!flag) return; |
| 108 | const value = await unref(createComponentEl)?.getFieldsValue?.(); | 116 | const value = await unref(createComponentEl)?.getFieldsValue?.(); |
| 117 | + const { config } = nodeData.value || {}; | ||
| 118 | + if ( | ||
| 119 | + config?.key === FilterCategoryComponentEnum.CHECK_EXISTENCE_FIELDS && | ||
| 120 | + !value?.messageNames && | ||
| 121 | + !value?.messageNames | ||
| 122 | + ) { | ||
| 123 | + createMessage.warning( | ||
| 124 | + `${t(CheckExistenceFieldsNameEnum.MESSAGE_NAMES)}和${t( | ||
| 125 | + CheckExistenceFieldsNameEnum.METADATA_NAMES | ||
| 126 | + )}最少选填一个` | ||
| 127 | + ); | ||
| 128 | + return false; | ||
| 129 | + } | ||
| 109 | unref(resolveFn)?.({ | 130 | unref(resolveFn)?.({ |
| 110 | flag: true, | 131 | flag: true, |
| 111 | data: handleSubmitData(extraData, value), | 132 | data: handleSubmitData(extraData, value), |
| @@ -229,7 +229,6 @@ export function useBasicDataTransform() { | @@ -229,7 +229,6 @@ export function useBasicDataTransform() { | ||
| 229 | 229 | ||
| 230 | if (resultNode.additionalInfo.layoutX < offsetX) offsetX = resultNode.additionalInfo.layoutX; | 230 | if (resultNode.additionalInfo.layoutX < offsetX) offsetX = resultNode.additionalInfo.layoutX; |
| 231 | if (resultNode.additionalInfo.layoutY < offsetY) offsetY = resultNode.additionalInfo.layoutY; | 231 | if (resultNode.additionalInfo.layoutY < offsetY) offsetY = resultNode.additionalInfo.layoutY; |
| 232 | - | ||
| 233 | nodes.push(resultNode); | 232 | nodes.push(resultNode); |
| 234 | } | 233 | } |
| 235 | 234 |
| @@ -317,7 +317,6 @@ export function useContextMenuAction() { | @@ -317,7 +317,6 @@ export function useContextMenuAction() { | ||
| 317 | const selectedEdges = unref(flowActionType?.getSelectedEdges); | 317 | const selectedEdges = unref(flowActionType?.getSelectedEdges); |
| 318 | const { firstNodeIndex, connections, nodes, outputEdgesId, inputEdgesId } = | 318 | const { firstNodeIndex, connections, nodes, outputEdgesId, inputEdgesId } = |
| 319 | transformToRuleChain(selectedNodes, selectedEdges); | 319 | transformToRuleChain(selectedNodes, selectedEdges); |
| 320 | - | ||
| 321 | await saveRuleChainData({ | 320 | await saveRuleChainData({ |
| 322 | firstNodeIndex, | 321 | firstNodeIndex, |
| 323 | connections: connections.filter( | 322 | connections: connections.filter( |
| @@ -84,7 +84,6 @@ export function useSaveAndRedo() { | @@ -84,7 +84,6 @@ export function useSaveAndRedo() { | ||
| 84 | ruleChainDetail.value = detail; | 84 | ruleChainDetail.value = detail; |
| 85 | ruleChainId = detail.id.id; | 85 | ruleChainId = detail.id.id; |
| 86 | } | 86 | } |
| 87 | - | ||
| 88 | const data = await saveRuleChainData({ | 87 | const data = await saveRuleChainData({ |
| 89 | connections, | 88 | connections, |
| 90 | nodes, | 89 | nodes, |
| @@ -46,26 +46,24 @@ | @@ -46,26 +46,24 @@ | ||
| 46 | <AttributeConfiguration | 46 | <AttributeConfiguration |
| 47 | v-model:value="model[field]" | 47 | v-model:value="model[field]" |
| 48 | ref="attributeControlElRef" | 48 | ref="attributeControlElRef" |
| 49 | - :keyLabel="`Source ${ | ||
| 50 | - model[CustomerAttributesFieldsEnum.TELEMETRY] ? 'telemetry' : 'attribute' | ||
| 51 | - }`" | ||
| 52 | - valueLabel="Target attribute" | 49 | + :keyLabel="`原始${model[CustomerAttributesFieldsEnum.TELEMETRY] ? '遥测' : '属性'}`" |
| 50 | + valueLabel="目标属性" | ||
| 53 | > | 51 | > |
| 54 | <template #afterForm> | 52 | <template #afterForm> |
| 55 | <div class="text-xs text-gray-500"> | 53 | <div class="text-xs text-gray-500"> |
| 56 | - Hint: use | 54 | + ” 备注: 使用 |
| 57 | <code> | 55 | <code> |
| 58 | <span class="text-dark-500">${</span> | 56 | <span class="text-dark-500">${</span> |
| 59 | metadataKey | 57 | metadataKey |
| 60 | <span class="text-dark-500">}</span> | 58 | <span class="text-dark-500">}</span> |
| 61 | </code> | 59 | </code> |
| 62 | - for value from metadata, | 60 | + 表示元数据中的值, |
| 63 | <code> | 61 | <code> |
| 64 | <span class="text-dark-500"> $[</span> | 62 | <span class="text-dark-500"> $[</span> |
| 65 | messageKey | 63 | messageKey |
| 66 | <span class="text-dark-500">] </span> | 64 | <span class="text-dark-500">] </span> |
| 67 | </code> | 65 | </code> |
| 68 | - for value from message body to substitute "Source" and "Target" key names | 66 | + 表示消息正文中的值。用“Source”和“Target'键名代替。“ |
| 69 | </div> | 67 | </div> |
| 70 | </template> | 68 | </template> |
| 71 | </AttributeConfiguration> | 69 | </AttributeConfiguration> |
| @@ -45,26 +45,24 @@ | @@ -45,26 +45,24 @@ | ||
| 45 | <AttributeConfiguration | 45 | <AttributeConfiguration |
| 46 | v-model:value="model[field]" | 46 | v-model:value="model[field]" |
| 47 | ref="attributeControlElRef" | 47 | ref="attributeControlElRef" |
| 48 | - :keyLabel="`Source ${ | ||
| 49 | - model[CustomerAttributesFieldsEnum.TELEMETRY] ? 'telemetry' : 'attribute' | ||
| 50 | - }`" | ||
| 51 | - valueLabel="Target attribute" | 48 | + :keyLabel="`原始${model[CustomerAttributesFieldsEnum.TELEMETRY] ? '遥测' : '属性'}`" |
| 49 | + valueLabel="目标属性" | ||
| 52 | > | 50 | > |
| 53 | <template #afterForm> | 51 | <template #afterForm> |
| 54 | <div class="text-xs text-gray-500"> | 52 | <div class="text-xs text-gray-500"> |
| 55 | - Hint: use | 53 | + ” 备注: 使用 |
| 56 | <code> | 54 | <code> |
| 57 | <span class="text-dark-500">${</span> | 55 | <span class="text-dark-500">${</span> |
| 58 | metadataKey | 56 | metadataKey |
| 59 | <span class="text-dark-500">}</span> | 57 | <span class="text-dark-500">}</span> |
| 60 | </code> | 58 | </code> |
| 61 | - for value from metadata, | 59 | + 表示元数据中的值, |
| 62 | <code> | 60 | <code> |
| 63 | <span class="text-dark-500"> $[</span> | 61 | <span class="text-dark-500"> $[</span> |
| 64 | messageKey | 62 | messageKey |
| 65 | <span class="text-dark-500">] </span> | 63 | <span class="text-dark-500">] </span> |
| 66 | </code> | 64 | </code> |
| 67 | - for value from message body to substitute "Source" and "Target" key names | 65 | + 表示消息正文中的值。用“Source”和“Target'键名代替。“ |
| 68 | </div> | 66 | </div> |
| 69 | </template> | 67 | </template> |
| 70 | </AttributeConfiguration> | 68 | </AttributeConfiguration> |
| @@ -12,13 +12,9 @@ export const formSchemas: FormSchema[] = [ | @@ -12,13 +12,9 @@ export const formSchemas: FormSchema[] = [ | ||
| 12 | field: CheckExistenceFieldsEnum.MESSAGE_NAMES, | 12 | field: CheckExistenceFieldsEnum.MESSAGE_NAMES, |
| 13 | component: 'Select', | 13 | component: 'Select', |
| 14 | label: t(CheckExistenceFieldsNameEnum.MESSAGE_NAMES), | 14 | label: t(CheckExistenceFieldsNameEnum.MESSAGE_NAMES), |
| 15 | - rules: [ | ||
| 16 | - { | ||
| 17 | - required: true, | ||
| 18 | - type: 'array', | ||
| 19 | - message: `请选择${t(CheckExistenceFieldsNameEnum.MESSAGE_NAMES)}`, | ||
| 20 | - }, | ||
| 21 | - ], | 15 | + helpMessage: `${t(CheckExistenceFieldsNameEnum.MESSAGE_NAMES)}和${t( |
| 16 | + CheckExistenceFieldsNameEnum.METADATA_NAMES | ||
| 17 | + )}最少选填一个`, | ||
| 22 | componentProps: { | 18 | componentProps: { |
| 23 | mode: 'tags', | 19 | mode: 'tags', |
| 24 | open: false, | 20 | open: false, |
| @@ -30,13 +26,9 @@ export const formSchemas: FormSchema[] = [ | @@ -30,13 +26,9 @@ export const formSchemas: FormSchema[] = [ | ||
| 30 | field: CheckExistenceFieldsEnum.METADATA_NAMES, | 26 | field: CheckExistenceFieldsEnum.METADATA_NAMES, |
| 31 | component: 'Select', | 27 | component: 'Select', |
| 32 | label: t(CheckExistenceFieldsNameEnum.METADATA_NAMES), | 28 | label: t(CheckExistenceFieldsNameEnum.METADATA_NAMES), |
| 33 | - rules: [ | ||
| 34 | - { | ||
| 35 | - required: true, | ||
| 36 | - type: 'array', | ||
| 37 | - message: `请选择${t(CheckExistenceFieldsNameEnum.METADATA_NAMES)}`, | ||
| 38 | - }, | ||
| 39 | - ], | 29 | + helpMessage: `${t(CheckExistenceFieldsNameEnum.MESSAGE_NAMES)}和${t( |
| 30 | + CheckExistenceFieldsNameEnum.METADATA_NAMES | ||
| 31 | + )}最少选填一个`, | ||
| 40 | componentProps: { | 32 | componentProps: { |
| 41 | mode: 'tags', | 33 | mode: 'tags', |
| 42 | open: false, | 34 | open: false, |
| @@ -118,7 +118,7 @@ export const formSchemas: FormSchema[] = [ | @@ -118,7 +118,7 @@ export const formSchemas: FormSchema[] = [ | ||
| 118 | }, | 118 | }, |
| 119 | { | 119 | { |
| 120 | field: CheckRelationFieldsEnum.RELEATION_TYPE, | 120 | field: CheckRelationFieldsEnum.RELEATION_TYPE, |
| 121 | - component: 'Select', | 121 | + component: 'AutoComplete', |
| 122 | label: t(CheckRelationFieldsNameEnum.RELEATION_TYPE), | 122 | label: t(CheckRelationFieldsNameEnum.RELEATION_TYPE), |
| 123 | defaultValue: RelationTypeEnum.CONTAINS, | 123 | defaultValue: RelationTypeEnum.CONTAINS, |
| 124 | componentProps: { | 124 | componentProps: { |
| @@ -16,11 +16,23 @@ export const formSchemas: FormSchema[] = [ | @@ -16,11 +16,23 @@ export const formSchemas: FormSchema[] = [ | ||
| 16 | componentProps: { | 16 | componentProps: { |
| 17 | placeholder: `请输入${t(GpsGeofencingFilterFieldsNameEnum.LATITUDE_KEY_NAME)}`, | 17 | placeholder: `请输入${t(GpsGeofencingFilterFieldsNameEnum.LATITUDE_KEY_NAME)}`, |
| 18 | }, | 18 | }, |
| 19 | + rules: [ | ||
| 20 | + { | ||
| 21 | + required: true, | ||
| 22 | + message: `请输入${t(GpsGeofencingFilterFieldsNameEnum.LATITUDE_KEY_NAME)}`, | ||
| 23 | + }, | ||
| 24 | + ], | ||
| 19 | }, | 25 | }, |
| 20 | { | 26 | { |
| 21 | field: GpsGeofencingFilterFieldsEnum.LONGITUDE_KEY_NAME, | 27 | field: GpsGeofencingFilterFieldsEnum.LONGITUDE_KEY_NAME, |
| 22 | component: 'Input', | 28 | component: 'Input', |
| 23 | label: t(GpsGeofencingFilterFieldsNameEnum.LONGITUDE_KEY_NAME), | 29 | label: t(GpsGeofencingFilterFieldsNameEnum.LONGITUDE_KEY_NAME), |
| 30 | + rules: [ | ||
| 31 | + { | ||
| 32 | + required: true, | ||
| 33 | + message: `请输入${t(GpsGeofencingFilterFieldsNameEnum.LONGITUDE_KEY_NAME)}`, | ||
| 34 | + }, | ||
| 35 | + ], | ||
| 24 | componentProps: { | 36 | componentProps: { |
| 25 | placeholder: `请输入${t(GpsGeofencingFilterFieldsNameEnum.LONGITUDE_KEY_NAME)}`, | 37 | placeholder: `请输入${t(GpsGeofencingFilterFieldsNameEnum.LONGITUDE_KEY_NAME)}`, |
| 26 | }, | 38 | }, |
| @@ -47,6 +59,7 @@ export const formSchemas: FormSchema[] = [ | @@ -47,6 +59,7 @@ export const formSchemas: FormSchema[] = [ | ||
| 47 | field: GpsGeofencingFilterFieldsEnum.PERIMETER_KEY_NAME, | 59 | field: GpsGeofencingFilterFieldsEnum.PERIMETER_KEY_NAME, |
| 48 | component: 'Input', | 60 | component: 'Input', |
| 49 | label: t(GpsGeofencingFilterFieldsNameEnum.PERIMETER_KEY_NAME), | 61 | label: t(GpsGeofencingFilterFieldsNameEnum.PERIMETER_KEY_NAME), |
| 62 | + helpMessage: '根据周界类型', | ||
| 50 | show: ({ model }) => | 63 | show: ({ model }) => |
| 51 | model[GpsGeofencingFilterFieldsEnum.FETCH_PERIMETER_INFO_FROM_MESSAGE_METADATA], | 64 | model[GpsGeofencingFilterFieldsEnum.FETCH_PERIMETER_INFO_FROM_MESSAGE_METADATA], |
| 52 | componentProps: { | 65 | componentProps: { |
| @@ -15,7 +15,7 @@ export const formSchemas: FormSchema[] = [ | @@ -15,7 +15,7 @@ export const formSchemas: FormSchema[] = [ | ||
| 15 | label: MessageTypesNameEnum[value], | 15 | label: MessageTypesNameEnum[value], |
| 16 | value, | 16 | value, |
| 17 | })), | 17 | })), |
| 18 | - mode: 'multiple', | 18 | + mode: 'tags', |
| 19 | placeholder: `请选择${t(MessageTypeFieldsNameEnum.MESSAGE_TYPES)}`, | 19 | placeholder: `请选择${t(MessageTypeFieldsNameEnum.MESSAGE_TYPES)}`, |
| 20 | getPopupContainer: () => document.body, | 20 | getPopupContainer: () => document.body, |
| 21 | }, | 21 | }, |
| @@ -15,7 +15,7 @@ export const formSchemas: FormSchema[] = [ | @@ -15,7 +15,7 @@ export const formSchemas: FormSchema[] = [ | ||
| 15 | changeEvent: 'update:value', | 15 | changeEvent: 'update:value', |
| 16 | valueField: 'value', | 16 | valueField: 'value', |
| 17 | componentProps: { | 17 | componentProps: { |
| 18 | - buttonName: 'Test Switch Function', | 18 | + buttonName: '测试过滤函数', |
| 19 | javaScriptEditorProps: { | 19 | javaScriptEditorProps: { |
| 20 | height: 230, | 20 | height: 230, |
| 21 | functionName: 'Switch', | 21 | functionName: 'Switch', |
| @@ -14,7 +14,7 @@ | @@ -14,7 +14,7 @@ | ||
| 14 | scriptType?: string; | 14 | scriptType?: string; |
| 15 | }>(), | 15 | }>(), |
| 16 | { | 16 | { |
| 17 | - buttonName: 'Test Filter Function', | 17 | + buttonName: '测试过滤函数', |
| 18 | javaScriptEditorProps: () => ({ | 18 | javaScriptEditorProps: () => ({ |
| 19 | functionName: 'Filter', | 19 | functionName: 'Filter', |
| 20 | scriptType: 'filter', | 20 | scriptType: 'filter', |
| @@ -79,7 +79,7 @@ | @@ -79,7 +79,7 @@ | ||
| 79 | <template> | 79 | <template> |
| 80 | <BasicDrawer | 80 | <BasicDrawer |
| 81 | v-model:visible="visible" | 81 | v-model:visible="visible" |
| 82 | - width="40%" | 82 | + :width="nodeData?.created ? '50%' : '40%'" |
| 83 | showFooter | 83 | showFooter |
| 84 | showCancelBtn | 84 | showCancelBtn |
| 85 | showOkBtn | 85 | showOkBtn |