Commit 7805b31cfaa422e6dc5fe084be550532bf97a570
Merge branch 'ft' into 'main_dev'
fix: DEFECT-1330 数据流转中,待选设备勾选了设备后,待选设备的按钮和已选设备的按钮都生效了 See merge request yunteng/thingskit-front!645
Showing
3 changed files
with
35 additions
and
28 deletions
| ... | ... | @@ -62,6 +62,8 @@ |
| 62 | 62 | |
| 63 | 63 | const pendingOptions = ref<Options[]>([]); |
| 64 | 64 | |
| 65 | + const selectedConfirmQueue = ref<Options[]>([]); | |
| 66 | + | |
| 65 | 67 | const pendingConfirmQueue = ref<Options[]>([]); |
| 66 | 68 | |
| 67 | 69 | const selectedTotal = ref(0); |
| ... | ... | @@ -115,10 +117,10 @@ |
| 115 | 117 | rowSelection: { |
| 116 | 118 | type: 'checkbox', |
| 117 | 119 | onSelect: (_record: Recordable, _selected: boolean, selectedRows: Object[]) => { |
| 118 | - pendingConfirmQueue.value = selectedRows; | |
| 120 | + selectedConfirmQueue.value = selectedRows; | |
| 119 | 121 | }, |
| 120 | 122 | onSelectAll: (_selected: boolean, selectedRows: Recordable[]) => { |
| 121 | - pendingConfirmQueue.value = selectedRows; | |
| 123 | + selectedConfirmQueue.value = selectedRows; | |
| 122 | 124 | }, |
| 123 | 125 | }, |
| 124 | 126 | }; |
| ... | ... | @@ -266,7 +268,7 @@ |
| 266 | 268 | selectedTotal.value = unref(selectedTotal) - removeRowKeys.length; |
| 267 | 269 | |
| 268 | 270 | clearSelectedRowKeys(); |
| 269 | - pendingConfirmQueue.value = []; | |
| 271 | + selectedConfirmQueue.value = []; | |
| 270 | 272 | setProps({ dataSource: unref(selectedRows) }); |
| 271 | 273 | handleTriggerEmit(unref(selectedRowKeys), unref(selectedRows)); |
| 272 | 274 | |
| ... | ... | @@ -380,7 +382,7 @@ |
| 380 | 382 | <!-- <Button type="primary">全选</Button> --> |
| 381 | 383 | <div class="text-blue-400"> |
| 382 | 384 | <span class="mr-2">选择设备:</span> |
| 383 | - <span>{{ pendingConfirmQueue.length }}</span> | |
| 385 | + <span>{{ selectedConfirmQueue.length }}</span> | |
| 384 | 386 | </div> |
| 385 | 387 | </section> |
| 386 | 388 | </template> |
| ... | ... | @@ -388,7 +390,7 @@ |
| 388 | 390 | <section class="flex justify-end px-4 pb-4"> |
| 389 | 391 | <Button |
| 390 | 392 | type="primary" |
| 391 | - :disabled="!pendingConfirmQueue.length" | |
| 393 | + :disabled="!selectedConfirmQueue.length" | |
| 392 | 394 | @click="handleRemoveSelected" |
| 393 | 395 | > |
| 394 | 396 | <span>移除已选</span> | ... | ... |
| ... | ... | @@ -8,7 +8,7 @@ class ApiFormPartialConfig { |
| 8 | 8 | static restEndpointUrlPattern = 'http://localhost/api'; //端点URL模式 |
| 9 | 9 | static requestMethod = 'POST'; //请求方式 |
| 10 | 10 | static proxyHost = true; //代理主机 |
| 11 | - static proxyPort = 0; //代理端口 | |
| 11 | + static proxyPort = 1; //代理端口 | |
| 12 | 12 | static maxParallelRequestsCount = 0; //最大并行请求数 |
| 13 | 13 | static readTimeoutMs = 0; //读取超时(毫秒) |
| 14 | 14 | static maxQueueSize = 0; //Redis队列最大数 |
| ... | ... | @@ -99,8 +99,10 @@ export const modeApiForm: FormSchema[] = [ |
| 99 | 99 | component: 'InputNumber', |
| 100 | 100 | defaultValue: ApiFormPartialConfig.proxyPort, |
| 101 | 101 | componentProps: { |
| 102 | + placeholder: '请输入代理端口', | |
| 102 | 103 | maxLength: 255, |
| 103 | - placeholder: 'http或者https开头', | |
| 104 | + min: 1, | |
| 105 | + max: 65535, | |
| 104 | 106 | }, |
| 105 | 107 | ifShow: ({ values }) => { |
| 106 | 108 | return !!values.enableProxy; | ... | ... |
| ... | ... | @@ -84,27 +84,30 @@ |
| 84 | 84 | |
| 85 | 85 | const handleSubmit = async (closeModalAfterSuccess = true) => { |
| 86 | 86 | try { |
| 87 | - closeModalAfterSuccess && setModalProps({ confirmLoading: true }); | |
| 88 | - const getDataFlowMethod = await dataFlowMethodRef.value?.getValue(); | |
| 89 | - const { name, description, ...getDataFlowParams } = await dataFlowParamsRef.value?.getValue(); | |
| 90 | - removeFieldByModeForm.forEach((item) => { | |
| 91 | - Reflect.deleteProperty(getDataFlowParams, item); | |
| 92 | - }); | |
| 93 | - validateOtherProperity( | |
| 94 | - getDataFlowParams?.headers, | |
| 95 | - getDataFlowParams?.otherProperties, | |
| 96 | - getDataFlowParams?.clientProperties | |
| 97 | - ); | |
| 98 | - const data = getValue(description, name, getDataFlowMethod, getDataFlowParams); | |
| 99 | - const rest = await postAddConvertApi({ ...restData.data, ...data }); | |
| 100 | - if (rest) { | |
| 101 | - closeModalAfterSuccess && createMessage.success(`${businessText.value}成功`); | |
| 102 | - closeModalAfterSuccess && closeModal(); | |
| 103 | - closeModalAfterSuccess && resetValue(); | |
| 104 | - //fix 弹窗关闭时闪动问题 | |
| 105 | - setTimeout(() => { | |
| 106 | - emit('success'); | |
| 107 | - }, 100); | |
| 87 | + if (closeModalAfterSuccess) { | |
| 88 | + closeModalAfterSuccess && setModalProps({ confirmLoading: true }); | |
| 89 | + const getDataFlowMethod = await dataFlowMethodRef.value?.getValue(); | |
| 90 | + const { name, description, ...getDataFlowParams } = | |
| 91 | + await dataFlowParamsRef.value?.getValue(); | |
| 92 | + removeFieldByModeForm.forEach((item) => { | |
| 93 | + Reflect.deleteProperty(getDataFlowParams, item); | |
| 94 | + }); | |
| 95 | + validateOtherProperity( | |
| 96 | + getDataFlowParams?.headers, | |
| 97 | + getDataFlowParams?.otherProperties, | |
| 98 | + getDataFlowParams?.clientProperties | |
| 99 | + ); | |
| 100 | + const data = getValue(description, name, getDataFlowMethod, getDataFlowParams); | |
| 101 | + const rest = await postAddConvertApi({ ...restData.data, ...data }); | |
| 102 | + if (rest) { | |
| 103 | + closeModalAfterSuccess && createMessage.success(`${businessText.value}成功`); | |
| 104 | + closeModalAfterSuccess && closeModal(); | |
| 105 | + closeModalAfterSuccess && resetValue(); | |
| 106 | + //fix 弹窗关闭时闪动问题 | |
| 107 | + setTimeout(() => { | |
| 108 | + emit('success'); | |
| 109 | + }, 100); | |
| 110 | + } | |
| 108 | 111 | } |
| 109 | 112 | } finally { |
| 110 | 113 | setModalProps({ confirmLoading: false }); | ... | ... |