fix(接口调试): 组件显隐切换问题解决

This commit is contained in:
baiqi 2024-02-27 14:05:02 +08:00 committed by 刘瑞斌
parent 53226e689e
commit 856285c082
3 changed files with 66 additions and 65 deletions

View File

@ -9,7 +9,6 @@ export default mergeConfig(
mode: 'production', mode: 'production',
plugins: [configCompressPlugin('gzip'), configVisualizerPlugin(), configImageminPlugin()], plugins: [configCompressPlugin('gzip'), configVisualizerPlugin(), configImageminPlugin()],
build: { build: {
minify: false, // TODO:临时关闭,排查问题
rollupOptions: { rollupOptions: {
output: { output: {
manualChunks: { manualChunks: {

View File

@ -9,6 +9,7 @@
"dev": "vite --config ./config/vite.config.dev.ts", "dev": "vite --config ./config/vite.config.dev.ts",
"build": "vue-tsc --noEmit && vite build --config ./config/vite.config.prod.ts", "build": "vue-tsc --noEmit && vite build --config ./config/vite.config.prod.ts",
"build:local": "vue-tsc --noEmit && vite build --config ./config/vite.config.prod.ts --mode development", "build:local": "vue-tsc --noEmit && vite build --config ./config/vite.config.prod.ts --mode development",
"build:localProd": "vue-tsc --noEmit && vite build --config ./config/vite.config.prod.ts --mode prod",
"report": "cross-env REPORT=true npm run build", "report": "cross-env REPORT=true npm run build",
"preview": "npm run build && vite preview --host", "preview": "npm run build && vite preview --host",
"type:check": "vue-tsc --noEmit --skipLibCheck", "type:check": "vue-tsc --noEmit --skipLibCheck",
@ -71,7 +72,7 @@
"resize-observer-polyfill": "^1.5.1", "resize-observer-polyfill": "^1.5.1",
"sortablejs": "^1.15.0", "sortablejs": "^1.15.0",
"tippy.js": "^6.3.7", "tippy.js": "^6.3.7",
"vue": "^3.4.15", "vue": "^3.4.20",
"vue-dompurify-html": "^4.1.4", "vue-dompurify-html": "^4.1.4",
"vue-draggable-plus": "^0.3.5", "vue-draggable-plus": "^0.3.5",
"vue-echarts": "^6.6.1", "vue-echarts": "^6.6.1",

View File

@ -130,70 +130,71 @@
/> />
</div> </div>
<div class="tab-pane-container"> <div class="tab-pane-container">
<a-spin <div v-show="requestVModel.activeTab === RequestComposition.PLUGIN">
v-if="requestVModel.activeTab === RequestComposition.PLUGIN" <a-spin :loading="pluginLoading" class="min-h-[100px] w-full">
:loading="pluginLoading" <MsFormCreate
class="min-h-[100px] w-full" v-model:api="fApi"
> :rule="currentPluginScript"
<MsFormCreate :option="currentPluginOptions"
v-model:api="fApi" @change="handlePluginFormChange"
:rule="currentPluginScript" />
:option="currentPluginOptions" </a-spin>
@change="handlePluginFormChange" </div>
<div v-show="requestVModel.activeTab === RequestComposition.HEADER">
<debugHeader
v-show="requestVModel.activeTab === RequestComposition.HEADER"
v-model:params="requestVModel.headers"
:layout="activeLayout"
:second-box-height="secondBoxHeight"
@change="handleActiveDebugChange"
/> />
</a-spin> </div>
<debugHeader <div v-show="requestVModel.activeTab === RequestComposition.BODY">
v-if="requestVModel.activeTab === RequestComposition.HEADER" <debugBody
v-model:params="requestVModel.headers" v-model:params="requestVModel.body"
:layout="activeLayout" :layout="activeLayout"
:second-box-height="secondBoxHeight" :second-box-height="secondBoxHeight"
@change="handleActiveDebugChange" :upload-temp-file-api="props.uploadTempFileApi"
/> @change="handleActiveDebugChange"
<debugBody />
v-else-if="requestVModel.activeTab === RequestComposition.BODY" </div>
v-model:params="requestVModel.body" <div v-show="requestVModel.activeTab === RequestComposition.QUERY">
:layout="activeLayout" <debugQuery
:second-box-height="secondBoxHeight" v-model:params="requestVModel.query"
:upload-temp-file-api="props.uploadTempFileApi" :layout="activeLayout"
@change="handleActiveDebugChange" :second-box-height="secondBoxHeight"
/> @change="handleActiveDebugChange"
<debugQuery />
v-else-if="requestVModel.activeTab === RequestComposition.QUERY" </div>
v-model:params="requestVModel.query" <div v-show="requestVModel.activeTab === RequestComposition.REST">
:layout="activeLayout" <debugRest
:second-box-height="secondBoxHeight" v-model:params="requestVModel.rest"
@change="handleActiveDebugChange" :layout="activeLayout"
/> :second-box-height="secondBoxHeight"
<debugRest @change="handleActiveDebugChange"
v-else-if="requestVModel.activeTab === RequestComposition.REST" />
v-model:params="requestVModel.rest" </div>
:layout="activeLayout" <div v-show="requestVModel.activeTab === RequestComposition.PRECONDITION">
:second-box-height="secondBoxHeight" <precondition
@change="handleActiveDebugChange" v-model:config="requestVModel.children[0].preProcessorConfig"
/> @change="handleActiveDebugChange"
<precondition />
v-else-if="requestVModel.activeTab === RequestComposition.PRECONDITION" </div>
v-model:config="requestVModel.children[0].preProcessorConfig" <div v-show="requestVModel.activeTab === RequestComposition.POST_CONDITION">
@change="handleActiveDebugChange" <postcondition
/> v-model:config="requestVModel.children[0].postProcessorConfig"
<postcondition :response="requestVModel.response.requestResults[0]?.responseResult.body"
v-else-if="requestVModel.activeTab === RequestComposition.POST_CONDITION" :layout="activeLayout"
v-model:config="requestVModel.children[0].postProcessorConfig" :second-box-height="secondBoxHeight"
:response="requestVModel.response.requestResults[0]?.responseResult.body" @change="handleActiveDebugChange"
:layout="activeLayout" />
:second-box-height="secondBoxHeight" </div>
@change="handleActiveDebugChange" <div v-show="requestVModel.activeTab === RequestComposition.AUTH">
/> <debugAuth v-model:params="requestVModel.authConfig" @change="handleActiveDebugChange" />
<debugAuth </div>
v-else-if="requestVModel.activeTab === RequestComposition.AUTH" <div v-show="requestVModel.activeTab === RequestComposition.SETTING">
v-model:params="requestVModel.authConfig" <debugSetting v-model:params="requestVModel.otherConfig" @change="handleActiveDebugChange" />
@change="handleActiveDebugChange" </div>
/>
<debugSetting
v-else-if="requestVModel.activeTab === RequestComposition.SETTING"
v-model:params="requestVModel.otherConfig"
@change="handleActiveDebugChange"
/>
</div> </div>
</div> </div>
</template> </template>