fix(全局): bugFix

This commit is contained in:
baiqi 2024-06-25 18:25:21 +08:00 committed by Craftsman
parent 6ee5557ce8
commit 90d20de060
9 changed files with 62 additions and 28 deletions

View File

@ -115,7 +115,6 @@ import {
DefinitionHistoryItem, DefinitionHistoryItem,
DefinitionHistoryPageParams, DefinitionHistoryPageParams,
DefinitionReferencePageParams, DefinitionReferencePageParams,
Environment,
EnvModule, EnvModule,
ImportApiDefinitionParams, ImportApiDefinitionParams,
mockParams, mockParams,

View File

@ -1,2 +0,0 @@
export const GetApiTestListUrl = `/mock/list/menu`;
export const GetApiTestList = `/api/definition/page`;

View File

@ -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; // inputTypetext valueFormat?: (record: Record<string, any>) => string; // inputTypetext
[key: string]: any; // [key: string]: any; //
} }

View File

@ -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: [],

View File

@ -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)[]>([]);

View File

@ -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();
}); });
// //

View File

@ -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);
} }

View File

@ -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;

View File

@ -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>