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,
DefinitionHistoryPageParams,
DefinitionReferencePageParams,
Environment,
EnvModule,
ImportApiDefinitionParams,
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>
</a-auto-complete>
</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'">
{{
typeof item.valueFormat === 'function'
@ -188,9 +198,23 @@
export interface FormTableColumn extends MsTableColumnData {
enable?: boolean; //
required?: boolean; //
inputType?: 'input' | 'select' | 'tags' | 'switch' | 'text' | 'checkbox' | 'autoComplete'; //
inputType?:
| 'input'
| 'select'
| 'tags'
| 'switch'
| 'text'
| 'checkbox'
| 'autoComplete'
| 'textarea'
| 'inputNumber'; //
autoCompleteParams?: SelectOptionData[]; //
needValidRepeat?: boolean; //
maxLength?: number;
//
min?: number;
max?: number;
step?: number;
valueFormat?: (record: Record<string, any>) => string; // inputTypetext
[key: string]: any; //
}

View File

@ -125,7 +125,7 @@ export const pathMap: PathMapItem[] = [
level: MENU_LEVEL[2],
},
{
key: 'API_TEST_SCENARIO_RECYCLE', // 接口测试-场景-回收站
key: 'API_TEST_SCENARIO_MANAGEMENT_RECYCLE', // 接口测试-场景-回收站
locale: 'menu.apiTest.scenario.recycle',
route: RouteEnum.API_TEST_SCENARIO_RECYCLE,
permission: [],

View File

@ -634,15 +634,7 @@
);
watch(
() => props.activeModule,
() => {
resetSelector();
loadApiList(true);
}
);
watch(
() => props.selectedProtocols,
() => [props.activeModule, props.selectedProtocols],
() => {
resetSelector();
loadApiList(true);
@ -664,7 +656,6 @@
onBeforeMount(() => {
initProtocolList();
loadApiList(true);
});
const tableSelected = ref<(string | number)[]>([]);

View File

@ -85,9 +85,11 @@
import { ModuleTreeNode } from '@/models/common';
import { ApiTestRouteEnum } from '@/enums/routeEnum';
const appStore = useAppStore();
const route = useRoute();
const { t } = useI18n();
const router = useRouter();
const activeModule = ref<string>('all');
const folderTree = ref<ModuleTreeNode[]>([]);
const folderTreePathMap = ref<Record<string, any>>({});
@ -98,12 +100,6 @@
const moduleTreeRef = ref<InstanceType<typeof moduleTree>>();
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() {
importDrawerVisible.value = false;
managementRef.value?.newTab();
@ -132,7 +128,6 @@
selectedProtocols.value = val;
}
const appStore = useAppStore();
const recycleModulesCount = ref(0);
async function selectRecycleCount() {
const res = await getTrashModuleCount({
@ -144,6 +139,13 @@
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() {
await moduleTreeRef.value?.refresh();
//
@ -179,7 +181,6 @@
// cId tab
managementRef.value?.newCaseTab(route.query.cId as string);
}
selectRecycleCount();
});
//

View File

@ -57,6 +57,25 @@
:status="record.lastReportStatus"
/>
</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>
</a-spin>
</div>
@ -510,15 +529,12 @@
:deep(.param-input:not(.arco-input-focus, .arco-select-view-focus)) {
&:not(:hover) {
border-color: transparent !important;
.arco-input::placeholder {
@apply invisible;
}
.arco-select-view-icon {
@apply invisible;
}
.arco-select-view-value {
color: var(--color-text-brand);
}

View File

@ -13,6 +13,7 @@
v-model:form-rule="innerFormRules"
class="w-full"
:option="options"
:disabled="!hasAnyPermission(['PROJECT_BUG:READ+UPDATE'])"
@change="handelFormCreateChange"
/>
<!-- 自定义字段结束 -->
@ -53,7 +54,6 @@
</template>
<script setup lang="ts">
import { ref } from 'vue';
import { Message } from '@arco-design/web-vue';
import { cloneDeep, debounce } from 'lodash-es';
@ -163,6 +163,7 @@
}
});
} catch (error) {
// eslint-disable-next-line no-console
console.log(error);
} finally {
loading.value = false;

View File

@ -82,7 +82,11 @@
<MsIcon type="icon-icon_copy_filled" class="font-[16px]" />
{{ t('common.copy') }}
</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))]" />
{{ t('common.delete') }}
</a-doption>