Commit 7805b31cfaa422e6dc5fe084be550532bf97a570

Authored by xp.Huang
2 parents 9feb676f d241ae0f

Merge branch 'ft' into 'main_dev'

fix: DEFECT-1330 数据流转中,待选设备勾选了设备后,待选设备的按钮和已选设备的按钮都生效了

See merge request yunteng/thingskit-front!645
@@ -62,6 +62,8 @@ @@ -62,6 +62,8 @@
62 62
63 const pendingOptions = ref<Options[]>([]); 63 const pendingOptions = ref<Options[]>([]);
64 64
  65 + const selectedConfirmQueue = ref<Options[]>([]);
  66 +
65 const pendingConfirmQueue = ref<Options[]>([]); 67 const pendingConfirmQueue = ref<Options[]>([]);
66 68
67 const selectedTotal = ref(0); 69 const selectedTotal = ref(0);
@@ -115,10 +117,10 @@ @@ -115,10 +117,10 @@
115 rowSelection: { 117 rowSelection: {
116 type: 'checkbox', 118 type: 'checkbox',
117 onSelect: (_record: Recordable, _selected: boolean, selectedRows: Object[]) => { 119 onSelect: (_record: Recordable, _selected: boolean, selectedRows: Object[]) => {
118 - pendingConfirmQueue.value = selectedRows; 120 + selectedConfirmQueue.value = selectedRows;
119 }, 121 },
120 onSelectAll: (_selected: boolean, selectedRows: Recordable[]) => { 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,7 +268,7 @@
266 selectedTotal.value = unref(selectedTotal) - removeRowKeys.length; 268 selectedTotal.value = unref(selectedTotal) - removeRowKeys.length;
267 269
268 clearSelectedRowKeys(); 270 clearSelectedRowKeys();
269 - pendingConfirmQueue.value = []; 271 + selectedConfirmQueue.value = [];
270 setProps({ dataSource: unref(selectedRows) }); 272 setProps({ dataSource: unref(selectedRows) });
271 handleTriggerEmit(unref(selectedRowKeys), unref(selectedRows)); 273 handleTriggerEmit(unref(selectedRowKeys), unref(selectedRows));
272 274
@@ -380,7 +382,7 @@ @@ -380,7 +382,7 @@
380 <!-- <Button type="primary">全选</Button> --> 382 <!-- <Button type="primary">全选</Button> -->
381 <div class="text-blue-400"> 383 <div class="text-blue-400">
382 <span class="mr-2">选择设备:</span> 384 <span class="mr-2">选择设备:</span>
383 - <span>{{ pendingConfirmQueue.length }}</span> 385 + <span>{{ selectedConfirmQueue.length }}</span>
384 </div> 386 </div>
385 </section> 387 </section>
386 </template> 388 </template>
@@ -388,7 +390,7 @@ @@ -388,7 +390,7 @@
388 <section class="flex justify-end px-4 pb-4"> 390 <section class="flex justify-end px-4 pb-4">
389 <Button 391 <Button
390 type="primary" 392 type="primary"
391 - :disabled="!pendingConfirmQueue.length" 393 + :disabled="!selectedConfirmQueue.length"
392 @click="handleRemoveSelected" 394 @click="handleRemoveSelected"
393 > 395 >
394 <span>移除已选</span> 396 <span>移除已选</span>
@@ -8,7 +8,7 @@ class ApiFormPartialConfig { @@ -8,7 +8,7 @@ class ApiFormPartialConfig {
8 static restEndpointUrlPattern = 'http://localhost/api'; //端点URL模式 8 static restEndpointUrlPattern = 'http://localhost/api'; //端点URL模式
9 static requestMethod = 'POST'; //请求方式 9 static requestMethod = 'POST'; //请求方式
10 static proxyHost = true; //代理主机 10 static proxyHost = true; //代理主机
11 - static proxyPort = 0; //代理端口 11 + static proxyPort = 1; //代理端口
12 static maxParallelRequestsCount = 0; //最大并行请求数 12 static maxParallelRequestsCount = 0; //最大并行请求数
13 static readTimeoutMs = 0; //读取超时(毫秒) 13 static readTimeoutMs = 0; //读取超时(毫秒)
14 static maxQueueSize = 0; //Redis队列最大数 14 static maxQueueSize = 0; //Redis队列最大数
@@ -99,8 +99,10 @@ export const modeApiForm: FormSchema[] = [ @@ -99,8 +99,10 @@ export const modeApiForm: FormSchema[] = [
99 component: 'InputNumber', 99 component: 'InputNumber',
100 defaultValue: ApiFormPartialConfig.proxyPort, 100 defaultValue: ApiFormPartialConfig.proxyPort,
101 componentProps: { 101 componentProps: {
  102 + placeholder: '请输入代理端口',
102 maxLength: 255, 103 maxLength: 255,
103 - placeholder: 'http或者https开头', 104 + min: 1,
  105 + max: 65535,
104 }, 106 },
105 ifShow: ({ values }) => { 107 ifShow: ({ values }) => {
106 return !!values.enableProxy; 108 return !!values.enableProxy;
@@ -84,27 +84,30 @@ @@ -84,27 +84,30 @@
84 84
85 const handleSubmit = async (closeModalAfterSuccess = true) => { 85 const handleSubmit = async (closeModalAfterSuccess = true) => {
86 try { 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 } finally { 112 } finally {
110 setModalProps({ confirmLoading: false }); 113 setModalProps({ confirmLoading: false });