fix(全局): bugFix
This commit is contained in:
parent
6ee5557ce8
commit
90d20de060
|
@ -115,7 +115,6 @@ import {
|
||||||
DefinitionHistoryItem,
|
DefinitionHistoryItem,
|
||||||
DefinitionHistoryPageParams,
|
DefinitionHistoryPageParams,
|
||||||
DefinitionReferencePageParams,
|
DefinitionReferencePageParams,
|
||||||
Environment,
|
|
||||||
EnvModule,
|
EnvModule,
|
||||||
ImportApiDefinitionParams,
|
ImportApiDefinitionParams,
|
||||||
mockParams,
|
mockParams,
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
export const GetApiTestListUrl = `/mock/list/menu`;
|
|
||||||
export const GetApiTestList = `/api/definition/page`;
|
|
|
@ -117,6 +117,16 @@
|
||||||
</template>
|
</template>
|
||||||
</a-auto-complete>
|
</a-auto-complete>
|
||||||
</template>
|
</template>
|
||||||
|
<a-input-number
|
||||||
|
v-else-if="item.inputType === 'inputNumber'"
|
||||||
|
v-model:model-value="record[item.dataIndex as string]"
|
||||||
|
:min="item.min"
|
||||||
|
:max="item.max"
|
||||||
|
></a-input-number>
|
||||||
|
<a-textarea
|
||||||
|
v-else-if="item.inputType === 'textarea'"
|
||||||
|
v-model:model-value="record[item.dataIndex as string]"
|
||||||
|
></a-textarea>
|
||||||
<template v-else-if="item.inputType === 'text'">
|
<template v-else-if="item.inputType === 'text'">
|
||||||
{{
|
{{
|
||||||
typeof item.valueFormat === 'function'
|
typeof item.valueFormat === 'function'
|
||||||
|
@ -188,9 +198,23 @@
|
||||||
export interface FormTableColumn extends MsTableColumnData {
|
export interface FormTableColumn extends MsTableColumnData {
|
||||||
enable?: boolean; // 是否启用
|
enable?: boolean; // 是否启用
|
||||||
required?: boolean; // 是否必填
|
required?: boolean; // 是否必填
|
||||||
inputType?: 'input' | 'select' | 'tags' | 'switch' | 'text' | 'checkbox' | 'autoComplete'; // 输入组件类型
|
inputType?:
|
||||||
|
| 'input'
|
||||||
|
| 'select'
|
||||||
|
| 'tags'
|
||||||
|
| 'switch'
|
||||||
|
| 'text'
|
||||||
|
| 'checkbox'
|
||||||
|
| 'autoComplete'
|
||||||
|
| 'textarea'
|
||||||
|
| 'inputNumber'; // 输入组件类型
|
||||||
autoCompleteParams?: SelectOptionData[]; // 自动补全参数
|
autoCompleteParams?: SelectOptionData[]; // 自动补全参数
|
||||||
needValidRepeat?: boolean; // 是否需要判断重复
|
needValidRepeat?: boolean; // 是否需要判断重复
|
||||||
|
maxLength?: number;
|
||||||
|
// 数字输入框属性
|
||||||
|
min?: number;
|
||||||
|
max?: number;
|
||||||
|
step?: number;
|
||||||
valueFormat?: (record: Record<string, any>) => string; // 展示值格式化,仅在inputType为text时生效
|
valueFormat?: (record: Record<string, any>) => string; // 展示值格式化,仅在inputType为text时生效
|
||||||
[key: string]: any; // 扩展属性
|
[key: string]: any; // 扩展属性
|
||||||
}
|
}
|
||||||
|
|
|
@ -125,7 +125,7 @@ export const pathMap: PathMapItem[] = [
|
||||||
level: MENU_LEVEL[2],
|
level: MENU_LEVEL[2],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'API_TEST_SCENARIO_RECYCLE', // 接口测试-场景-回收站
|
key: 'API_TEST_SCENARIO_MANAGEMENT_RECYCLE', // 接口测试-场景-回收站
|
||||||
locale: 'menu.apiTest.scenario.recycle',
|
locale: 'menu.apiTest.scenario.recycle',
|
||||||
route: RouteEnum.API_TEST_SCENARIO_RECYCLE,
|
route: RouteEnum.API_TEST_SCENARIO_RECYCLE,
|
||||||
permission: [],
|
permission: [],
|
||||||
|
|
|
@ -634,15 +634,7 @@
|
||||||
);
|
);
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => props.activeModule,
|
() => [props.activeModule, props.selectedProtocols],
|
||||||
() => {
|
|
||||||
resetSelector();
|
|
||||||
loadApiList(true);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
watch(
|
|
||||||
() => props.selectedProtocols,
|
|
||||||
() => {
|
() => {
|
||||||
resetSelector();
|
resetSelector();
|
||||||
loadApiList(true);
|
loadApiList(true);
|
||||||
|
@ -664,7 +656,6 @@
|
||||||
|
|
||||||
onBeforeMount(() => {
|
onBeforeMount(() => {
|
||||||
initProtocolList();
|
initProtocolList();
|
||||||
loadApiList(true);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const tableSelected = ref<(string | number)[]>([]);
|
const tableSelected = ref<(string | number)[]>([]);
|
||||||
|
|
|
@ -85,9 +85,11 @@
|
||||||
import { ModuleTreeNode } from '@/models/common';
|
import { ModuleTreeNode } from '@/models/common';
|
||||||
import { ApiTestRouteEnum } from '@/enums/routeEnum';
|
import { ApiTestRouteEnum } from '@/enums/routeEnum';
|
||||||
|
|
||||||
|
const appStore = useAppStore();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
const activeModule = ref<string>('all');
|
const activeModule = ref<string>('all');
|
||||||
const folderTree = ref<ModuleTreeNode[]>([]);
|
const folderTree = ref<ModuleTreeNode[]>([]);
|
||||||
const folderTreePathMap = ref<Record<string, any>>({});
|
const folderTreePathMap = ref<Record<string, any>>({});
|
||||||
|
@ -98,12 +100,6 @@
|
||||||
const moduleTreeRef = ref<InstanceType<typeof moduleTree>>();
|
const moduleTreeRef = ref<InstanceType<typeof moduleTree>>();
|
||||||
const managementRef = ref<InstanceType<typeof management>>();
|
const managementRef = ref<InstanceType<typeof management>>();
|
||||||
|
|
||||||
function handleModuleInit(tree: ModuleTreeNode[], _protocols: string[], pathMap: Record<string, any>) {
|
|
||||||
folderTree.value = tree;
|
|
||||||
selectedProtocols.value = _protocols;
|
|
||||||
folderTreePathMap.value = pathMap;
|
|
||||||
}
|
|
||||||
|
|
||||||
function newApi() {
|
function newApi() {
|
||||||
importDrawerVisible.value = false;
|
importDrawerVisible.value = false;
|
||||||
managementRef.value?.newTab();
|
managementRef.value?.newTab();
|
||||||
|
@ -132,7 +128,6 @@
|
||||||
selectedProtocols.value = val;
|
selectedProtocols.value = val;
|
||||||
}
|
}
|
||||||
|
|
||||||
const appStore = useAppStore();
|
|
||||||
const recycleModulesCount = ref(0);
|
const recycleModulesCount = ref(0);
|
||||||
async function selectRecycleCount() {
|
async function selectRecycleCount() {
|
||||||
const res = await getTrashModuleCount({
|
const res = await getTrashModuleCount({
|
||||||
|
@ -144,6 +139,13 @@
|
||||||
recycleModulesCount.value = res.all;
|
recycleModulesCount.value = res.all;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function handleModuleInit(tree: ModuleTreeNode[], _protocols: string[], pathMap: Record<string, any>) {
|
||||||
|
folderTree.value = tree;
|
||||||
|
selectedProtocols.value = _protocols;
|
||||||
|
folderTreePathMap.value = pathMap;
|
||||||
|
selectRecycleCount();
|
||||||
|
}
|
||||||
|
|
||||||
async function refreshModuleTree() {
|
async function refreshModuleTree() {
|
||||||
await moduleTreeRef.value?.refresh();
|
await moduleTreeRef.value?.refresh();
|
||||||
// 涉及到模块树的刷新操作(比如删除),也会刷新回收站的数量
|
// 涉及到模块树的刷新操作(比如删除),也会刷新回收站的数量
|
||||||
|
@ -179,7 +181,6 @@
|
||||||
// 携带 cId 参数,自动打开接口用例详情 tab
|
// 携带 cId 参数,自动打开接口用例详情 tab
|
||||||
managementRef.value?.newCaseTab(route.query.cId as string);
|
managementRef.value?.newCaseTab(route.query.cId as string);
|
||||||
}
|
}
|
||||||
selectRecycleCount();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// 获取激活用例类型样式
|
// 获取激活用例类型样式
|
||||||
|
|
|
@ -57,6 +57,25 @@
|
||||||
:status="record.lastReportStatus"
|
:status="record.lastReportStatus"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
<template #operation="{ record }">
|
||||||
|
<MsButton
|
||||||
|
v-permission="['PROJECT_API_SCENARIO:READ+DELETE']"
|
||||||
|
type="text"
|
||||||
|
class="!mr-0"
|
||||||
|
@click="recover(record)"
|
||||||
|
>
|
||||||
|
{{ t('api_scenario.recycle.recover') }}
|
||||||
|
</MsButton>
|
||||||
|
<a-divider v-permission="['PROJECT_API_SCENARIO:READ+DELETE']" direction="vertical" :margin="8"></a-divider>
|
||||||
|
<MsButton
|
||||||
|
v-permission="['PROJECT_API_SCENARIO:READ+DELETE']"
|
||||||
|
type="text"
|
||||||
|
class="!mr-0"
|
||||||
|
@click="deleteOperation(record)"
|
||||||
|
>
|
||||||
|
{{ t('api_scenario.recycle.batchCleanOut') }}
|
||||||
|
</MsButton>
|
||||||
|
</template>
|
||||||
</ms-base-table>
|
</ms-base-table>
|
||||||
</a-spin>
|
</a-spin>
|
||||||
</div>
|
</div>
|
||||||
|
@ -510,15 +529,12 @@
|
||||||
:deep(.param-input:not(.arco-input-focus, .arco-select-view-focus)) {
|
:deep(.param-input:not(.arco-input-focus, .arco-select-view-focus)) {
|
||||||
&:not(:hover) {
|
&:not(:hover) {
|
||||||
border-color: transparent !important;
|
border-color: transparent !important;
|
||||||
|
|
||||||
.arco-input::placeholder {
|
.arco-input::placeholder {
|
||||||
@apply invisible;
|
@apply invisible;
|
||||||
}
|
}
|
||||||
|
|
||||||
.arco-select-view-icon {
|
.arco-select-view-icon {
|
||||||
@apply invisible;
|
@apply invisible;
|
||||||
}
|
}
|
||||||
|
|
||||||
.arco-select-view-value {
|
.arco-select-view-value {
|
||||||
color: var(--color-text-brand);
|
color: var(--color-text-brand);
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
v-model:form-rule="innerFormRules"
|
v-model:form-rule="innerFormRules"
|
||||||
class="w-full"
|
class="w-full"
|
||||||
:option="options"
|
:option="options"
|
||||||
|
:disabled="!hasAnyPermission(['PROJECT_BUG:READ+UPDATE'])"
|
||||||
@change="handelFormCreateChange"
|
@change="handelFormCreateChange"
|
||||||
/>
|
/>
|
||||||
<!-- 自定义字段结束 -->
|
<!-- 自定义字段结束 -->
|
||||||
|
@ -53,7 +54,6 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from 'vue';
|
|
||||||
import { Message } from '@arco-design/web-vue';
|
import { Message } from '@arco-design/web-vue';
|
||||||
import { cloneDeep, debounce } from 'lodash-es';
|
import { cloneDeep, debounce } from 'lodash-es';
|
||||||
|
|
||||||
|
@ -163,6 +163,7 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
console.log(error);
|
console.log(error);
|
||||||
} finally {
|
} finally {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
|
|
|
@ -82,7 +82,11 @@
|
||||||
<MsIcon type="icon-icon_copy_filled" class="font-[16px]" />
|
<MsIcon type="icon-icon_copy_filled" class="font-[16px]" />
|
||||||
{{ t('common.copy') }}
|
{{ t('common.copy') }}
|
||||||
</a-doption>
|
</a-doption>
|
||||||
<a-doption class="error-6 text-[rgb(var(--danger-6))]" @click="deleteHandler">
|
<a-doption
|
||||||
|
v-permission="['PROJECT_BUG:READ+DELETE']"
|
||||||
|
class="error-6 text-[rgb(var(--danger-6))]"
|
||||||
|
@click="deleteHandler"
|
||||||
|
>
|
||||||
<MsIcon type="icon-icon_delete-trash_outlined" class="font-[16px] text-[rgb(var(--danger-6))]" />
|
<MsIcon type="icon-icon_delete-trash_outlined" class="font-[16px] text-[rgb(var(--danger-6))]" />
|
||||||
{{ t('common.delete') }}
|
{{ t('common.delete') }}
|
||||||
</a-doption>
|
</a-doption>
|
||||||
|
|
Loading…
Reference in New Issue