Commit 359f29392a332c568ce4f4377dcd5fb94753e505

Authored by fengwotao
1 parent 0d80f2e0

pref: 优化公共接口管理部分代码

@@ -56,6 +56,7 @@ @@ -56,6 +56,7 @@
56 @emitExcute="handleEmitExcute" 56 @emitExcute="handleEmitExcute"
57 :data="excuteData" 57 :data="excuteData"
58 :method="method" 58 :method="method"
  59 + :httpType="requestTypeAndUrl?.requestHttpType"
59 /> 60 />
60 </div> 61 </div>
61 </div> 62 </div>
@@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
4 <a-row> 4 <a-row>
5 <Button @click="handleExcute" type="primary"> 执行测试请求 </Button> 5 <Button @click="handleExcute" type="primary"> 执行测试请求 </Button>
6 </a-row> 6 </a-row>
7 - <div v-if="isShowTestResult" style="display: flex; justify-content: space-between"> 7 + <div v-if="isShowTestResult" class="flex justify-between">
8 <a-row class="mt-8" type="flex" justify="center" align="middle"> 8 <a-row class="mt-8" type="flex" justify="center" align="middle">
9 <a-col :span="3"> 测试地址 </a-col> 9 <a-col :span="3"> 测试地址 </a-col>
10 <a-col :span="21"> 10 <a-col :span="21">
@@ -17,10 +17,17 @@ @@ -17,10 +17,17 @@
17 </div> 17 </div>
18 <div class="mt-8"> 18 <div class="mt-8">
19 <a-row type="flex" align="top"> 19 <a-row type="flex" align="top">
20 - <a-col :span="method === '2' ? 11 : 6"> 20 + <a-col
  21 + :span="
  22 + method === RequestMethodTypeEnum.WEBSOCKET
  23 + ? 11
  24 + : httpType === RequestHttpTypeEnum.POST
  25 + ? 4
  26 + : 6
  27 + "
  28 + >
21 <p>过滤器函数编写:</p> 29 <p>过滤器函数编写:</p>
22 <AceTypeIsJsEditor 30 <AceTypeIsJsEditor
23 - style=""  
24 :restData="getRestData" 31 :restData="getRestData"
25 @changeAceContent="onHandleAceContent" 32 @changeAceContent="onHandleAceContent"
26 ref="aceTypeIsJsEditorRef" 33 ref="aceTypeIsJsEditorRef"
@@ -30,9 +37,22 @@ @@ -30,9 +37,22 @@
30 <a-divider type="vertical" class="divider-color" /> 37 <a-divider type="vertical" class="divider-color" />
31 </a-col> 38 </a-col>
32 <a-col 39 <a-col
33 - :span="method === '2' ? 12 : 17" 40 + :span="
  41 + method === RequestMethodTypeEnum.WEBSOCKET
  42 + ? 12
  43 + : httpType === RequestHttpTypeEnum.POST
  44 + ? 19
  45 + : 17
  46 + "
34 style="position: relative" 47 style="position: relative"
35 - :style="{ left: (method === '2' ? 1.5 : 0) + 'vw' }" 48 + :style="{
  49 + left:
  50 + (method === RequestMethodTypeEnum.WEBSOCKET
  51 + ? 1.5
  52 + : httpType === RequestHttpTypeEnum.POST
  53 + ? -1.5
  54 + : 0) + 'vw',
  55 + }"
36 > 56 >
37 <a-col> 57 <a-col>
38 <p>接口返回数据(res):</p> 58 <p>接口返回数据(res):</p>
@@ -58,7 +78,7 @@ @@ -58,7 +78,7 @@
58 import AceTypeIsJsEditor from '../../SimpleRequest/components/aceEditor.vue'; 78 import AceTypeIsJsEditor from '../../SimpleRequest/components/aceEditor.vue';
59 import { Tag } from 'ant-design-vue'; 79 import { Tag } from 'ant-design-vue';
60 import { useThrottleFn } from '@vueuse/shared'; 80 import { useThrottleFn } from '@vueuse/shared';
61 - import { RequestMethodTypeEnum } from '../../../config/enum'; 81 + import { RequestMethodTypeEnum, RequestHttpTypeEnum } from '../../../config/enum';
62 82
63 const emits = defineEmits(['emitExcute']); 83 const emits = defineEmits(['emitExcute']);
64 84
@@ -69,6 +89,9 @@ @@ -69,6 +89,9 @@
69 method: { 89 method: {
70 type: String, 90 type: String,
71 }, 91 },
  92 + httpType: {
  93 + type: String,
  94 + },
72 }); 95 });
73 96
74 const showTestFlag = ref(false); 97 const showTestFlag = ref(false);