fix(接口调试): 问题解决
This commit is contained in:
parent
2b9de095d9
commit
f71b4b4b49
|
@ -9,6 +9,7 @@ export default mergeConfig(
|
|||
mode: 'production',
|
||||
plugins: [configCompressPlugin('gzip'), configVisualizerPlugin(), configImageminPlugin()],
|
||||
build: {
|
||||
minify: false, // TODO:临时关闭,排查问题
|
||||
rollupOptions: {
|
||||
output: {
|
||||
manualChunks: {
|
||||
|
|
|
@ -21,8 +21,8 @@ export default {
|
|||
'ms.paramsInput.float': 'Float',
|
||||
'ms.paramsInput.floatDesc':
|
||||
'Returns a random floating point number, integer 1-10, minimum value 2, maximum value 5 in the decimal part.',
|
||||
'ms.paramsInput.floatMin': 'Minimum decimal part',
|
||||
'ms.paramsInput.floatMax': 'Maximum decimal part',
|
||||
'ms.paramsInput.floatMin': 'Minimum number of decimal places',
|
||||
'ms.paramsInput.floatMax': 'Maximum number of decimal places',
|
||||
'ms.paramsInput.floatIntegerMin': 'Minimum value of integer part',
|
||||
'ms.paramsInput.floatIntegerMax': 'Maximum value of integer part',
|
||||
'ms.paramsInput.commonPlaceholder': 'Please input',
|
||||
|
|
|
@ -19,8 +19,8 @@ export default {
|
|||
'ms.paramsInput.minIntegerPlaceholder': '输入整数,如 1',
|
||||
'ms.paramsInput.float': '浮点数',
|
||||
'ms.paramsInput.floatDesc': '返回一个随机的浮点数,整数1-10,小数部分位数的最小值2,最大值5',
|
||||
'ms.paramsInput.floatMin': '小数部分最小值',
|
||||
'ms.paramsInput.floatMax': '小数部分最大值',
|
||||
'ms.paramsInput.floatMin': '小数位数最小值',
|
||||
'ms.paramsInput.floatMax': '小数位数最大值',
|
||||
'ms.paramsInput.floatIntegerMin': '整数部分最小值',
|
||||
'ms.paramsInput.floatIntegerMax': '整数部分最大值',
|
||||
'ms.paramsInput.commonPlaceholder': '请输入',
|
||||
|
|
|
@ -122,7 +122,7 @@
|
|||
Object.keys(res).forEach((key) => {
|
||||
dynamicForm.value[key] = {
|
||||
key,
|
||||
name: res[key].name,
|
||||
pluginName: res[key].pluginName,
|
||||
status: 0,
|
||||
formModel: {},
|
||||
formRules: res[key].formItems,
|
||||
|
@ -143,16 +143,18 @@
|
|||
try {
|
||||
loading.value = true;
|
||||
const res = await getPlatform(currentOrg.value);
|
||||
// 遍历插件表单
|
||||
Object.keys(dynamicForm.value).forEach((configKey: any) => {
|
||||
const config = dynamicForm.value[configKey].formModel.form;
|
||||
// 遍历插件表单的表单项并赋值
|
||||
Object.keys(config).forEach((key) => {
|
||||
const value = res[configKey][key];
|
||||
config[key] = value || config[key];
|
||||
dynamicForm.value[configKey].status = value !== undefined ? 1 : 0;
|
||||
if (res) {
|
||||
// 遍历插件表单
|
||||
Object.keys(dynamicForm.value).forEach((configKey: any) => {
|
||||
const config = dynamicForm.value[configKey].formModel.form;
|
||||
// 遍历插件表单的表单项并赋值
|
||||
Object.keys(config).forEach((key) => {
|
||||
const value = res[configKey][key];
|
||||
config[key] = value || config[key];
|
||||
dynamicForm.value[configKey].status = value !== undefined ? 1 : 0;
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(error);
|
||||
|
|
|
@ -130,21 +130,18 @@
|
|||
/>
|
||||
</div>
|
||||
<div class="tab-pane-container">
|
||||
<template v-if="requestVModel.activeTab === RequestComposition.PLUGIN || isInitPluginForm">
|
||||
<a-spin
|
||||
v-show="requestVModel.activeTab === RequestComposition.PLUGIN"
|
||||
:loading="pluginLoading"
|
||||
class="min-h-[100px] w-full"
|
||||
>
|
||||
<MsFormCreate
|
||||
v-model:api="fApi"
|
||||
:rule="currentPluginScript"
|
||||
:option="currentPluginOptions"
|
||||
@mounted="() => (isInitPluginForm = true)"
|
||||
@change="handlePluginFormChange"
|
||||
/>
|
||||
</a-spin>
|
||||
</template>
|
||||
<a-spin
|
||||
v-if="requestVModel.activeTab === RequestComposition.PLUGIN"
|
||||
:loading="pluginLoading"
|
||||
class="min-h-[100px] w-full"
|
||||
>
|
||||
<MsFormCreate
|
||||
v-model:api="fApi"
|
||||
:rule="currentPluginScript"
|
||||
:option="currentPluginOptions"
|
||||
@change="handlePluginFormChange"
|
||||
/>
|
||||
</a-spin>
|
||||
<debugHeader
|
||||
v-if="requestVModel.activeTab === RequestComposition.HEADER"
|
||||
v-model:params="requestVModel.headers"
|
||||
|
@ -487,7 +484,6 @@
|
|||
const pluginScriptMap = ref<Record<string, PluginConfig>>({}); // 存储初始化过后的插件配置
|
||||
const temporaryPluginFormMap: Record<string, any> = {}; // 缓存插件表单,避免切换tab导致动态表单数据丢失
|
||||
const pluginLoading = ref(false);
|
||||
const isInitPluginForm = ref(false);
|
||||
const fApi = ref<Api>();
|
||||
const currentPluginOptions = computed<Record<string, any>>(
|
||||
() => pluginScriptMap.value[requestVModel.value.protocol]?.options || {}
|
||||
|
|
|
@ -137,7 +137,13 @@
|
|||
}}
|
||||
</div>
|
||||
<a-divider v-if="!isCopy" margin="8px" direction="vertical" />
|
||||
<MsButton v-if="!isCopy" type="text" class="font-medium" @click="caseAssociateVisible = true">
|
||||
<MsButton
|
||||
v-if="!isCopy"
|
||||
v-permission="['CASE_REVIEW:READ+RELEVANCE']"
|
||||
type="text"
|
||||
class="font-medium"
|
||||
@click="caseAssociateVisible = true"
|
||||
>
|
||||
{{ t('ms.case.associate.title') }}
|
||||
</MsButton>
|
||||
</div>
|
||||
|
@ -147,14 +153,32 @@
|
|||
<template #footerRight>
|
||||
<div class="flex items-center">
|
||||
<a-button type="secondary" :disabled="saveLoading" @click="cancelCreate">{{ t('common.cancel') }}</a-button>
|
||||
<a-button v-if="isEdit" type="primary" class="ml-[16px]" :loading="saveLoading" @click="updateReview">
|
||||
<a-button
|
||||
v-if="isEdit"
|
||||
v-permission="['CASE_REVIEW:READ+UPDATE']"
|
||||
type="primary"
|
||||
class="ml-[16px]"
|
||||
:loading="saveLoading"
|
||||
@click="updateReview"
|
||||
>
|
||||
{{ t('common.update') }}
|
||||
</a-button>
|
||||
<template v-else>
|
||||
<a-button type="secondary" class="mx-[16px]" :loading="saveLoading" @click="() => saveReview()">
|
||||
<a-button
|
||||
v-permission="['CASE_REVIEW:READ+ADD']"
|
||||
type="secondary"
|
||||
class="mx-[16px]"
|
||||
:loading="saveLoading"
|
||||
@click="() => saveReview()"
|
||||
>
|
||||
{{ t('common.save') }}
|
||||
</a-button>
|
||||
<a-button type="primary" :disabled="saveLoading" @click="() => saveReview(true)">
|
||||
<a-button
|
||||
v-permission.all="['CASE_REVIEW:READ+ADD', 'CASE_REVIEW:READ+REVIEW']"
|
||||
type="primary"
|
||||
:disabled="saveLoading"
|
||||
@click="() => saveReview(true)"
|
||||
>
|
||||
{{ t('caseManagement.caseReview.review') }}
|
||||
</a-button>
|
||||
</template>
|
||||
|
|
Loading…
Reference in New Issue