Commit 0d80f2e0acb9e1a015897074df2ee77394cd9c29

Authored by fengwotao
1 parent 1734df99

feat: 公共接口管理新增一个字段filter

@@ -27,15 +27,6 @@ @@ -27,15 +27,6 @@
27 :interfaceType="model['interfaceType']" 27 :interfaceType="model['interfaceType']"
28 /> 28 />
29 </template> 29 </template>
30 - <template #testSql="{ model }">  
31 - <div style="margin: auto 7.5rem">  
32 - <TestSql  
33 - ref="testSqlRef"  
34 - v-if="[RequestMethodTypeEnum.SQL].includes(model['requestContentType'])"  
35 - :method="model['requestContentType']"  
36 - />  
37 - </div>  
38 - </template>  
39 <template #slotFillAddress="{ model }"> 30 <template #slotFillAddress="{ model }">
40 <div> 31 <div>
41 <template v-if="[RequestOriginTypeEnum.CUSTOM_URL].includes(model['originUrlType'])"> 32 <template v-if="[RequestOriginTypeEnum.CUSTOM_URL].includes(model['originUrlType'])">
@@ -71,7 +62,6 @@ @@ -71,7 +62,6 @@
71 import { BasicForm, useForm } from '/@/components/Form'; 62 import { BasicForm, useForm } from '/@/components/Form';
72 import { schemas } from './config/config'; 63 import { schemas } from './config/config';
73 import SimpleRequest from './components/SimpleRequest/index.vue'; 64 import SimpleRequest from './components/SimpleRequest/index.vue';
74 - import { TestSql } from './components/TestSql/index';  
75 import { 65 import {
76 saveDataViewInterface, 66 saveDataViewInterface,
77 updateDataViewInterface, 67 updateDataViewInterface,
@@ -93,8 +83,6 @@ @@ -93,8 +83,6 @@
93 83
94 const simpleRequestRef = ref<InstanceType<typeof SimpleRequest>>(); 84 const simpleRequestRef = ref<InstanceType<typeof SimpleRequest>>();
95 85
96 - const testSqlRef = ref<InstanceType<typeof TestSql>>();  
97 -  
98 const templateFillAddress = (method, type) => { 86 const templateFillAddress = (method, type) => {
99 return isServerUrl(method, type); 87 return isServerUrl(method, type);
100 }; 88 };
@@ -139,7 +127,7 @@ @@ -139,7 +127,7 @@
139 updateSchema(resetUpdateSchema); 127 updateSchema(resetUpdateSchema);
140 isUpdate.value = data.isUpdate; 128 isUpdate.value = data.isUpdate;
141 !isUpdate.value ? (putId.value = '') : (putId.value = data.record.id); 129 !isUpdate.value ? (putId.value = '') : (putId.value = data.record.id);
142 - simpleRequestRef.value?.resetValue() && testSqlRef.value?.resetValue(); 130 + simpleRequestRef.value?.resetValue();
143 if (isUpdate.value) { 131 if (isUpdate.value) {
144 await setFieldsValue({ 132 await setFieldsValue({
145 ...data.record, 133 ...data.record,
@@ -184,6 +172,7 @@ @@ -184,6 +172,7 @@
184 } 172 }
185 } 173 }
186 const Objects = simpleRequestRef.value?.getValue(true); 174 const Objects = simpleRequestRef.value?.getValue(true);
  175 + const filter = simpleRequestRef.value?.getFilterValue();
187 const requestOriginUrl = 176 const requestOriginUrl =
188 values['originUrlType'] === RequestOriginTypeEnum.SERVER_URL 177 values['originUrlType'] === RequestOriginTypeEnum.SERVER_URL
189 ? 'localhost' 178 ? 'localhost'
@@ -197,6 +186,7 @@ @@ -197,6 +186,7 @@
197 }, 186 },
198 ...Objects, 187 ...Objects,
199 }), 188 }),
  189 + filter: !filter ? null : filter,
200 requestOriginUrl, 190 requestOriginUrl,
201 requestHttpType: values['requestHttpTypeAndUrl']?.requestHttpType, 191 requestHttpType: values['requestHttpTypeAndUrl']?.requestHttpType,
202 requestUrl: values['requestHttpTypeAndUrl']?.requestUrl, 192 requestUrl: values['requestHttpTypeAndUrl']?.requestUrl,