feat(工作台): 我创建的-页面

This commit is contained in:
baiqi 2024-11-07 10:16:03 +08:00 committed by Craftsman
parent 5054ccea61
commit a98e0983bc
11 changed files with 115 additions and 29 deletions

View File

@ -55,7 +55,7 @@ const TestPlan: AppRouteRecordRaw = {
{ {
path: 'created', path: 'created',
name: WorkbenchRouteEnum.WORKBENCH_INDEX_CREATED, name: WorkbenchRouteEnum.WORKBENCH_INDEX_CREATED,
component: () => import('@/views/workbench/homePage/index.vue'), component: () => import('@/views/workbench/myCreated/index.vue'),
meta: { meta: {
locale: 'menu.workbenchCreatedSort', locale: 'menu.workbenchCreatedSort',
roles: ['*'], roles: ['*'],

View File

@ -1732,6 +1732,7 @@
defineExpose({ defineExpose({
fetchData, fetchData,
emitTableParams, emitTableParams,
isAdvancedSearchMode,
}); });
await tableStore.initColumn(TableKeyEnum.TEST_PLAN_ALL_TABLE, columns, 'drawer'); await tableStore.initColumn(TableKeyEnum.TEST_PLAN_ALL_TABLE, columns, 'drawer');

View File

@ -292,9 +292,8 @@
} }
} }
const isAdvancedSearchMode = ref(false); const isAdvancedSearchMode = computed(() => planTableRef.value?.isAdvancedSearchMode);
function handleAdvSearch(isStartAdvance: boolean) { function handleAdvSearch() {
isAdvancedSearchMode.value = isStartAdvance;
setActiveFolder('all'); setActiveFolder('all');
} }
</script> </script>

View File

@ -83,6 +83,7 @@
const props = defineProps<{ const props = defineProps<{
project: string; project: string;
type: 'my_follow' | 'my_create';
}>(); }>();
const { t } = useI18n(); const { t } = useI18n();
@ -206,14 +207,14 @@
function goApiCase() { function goApiCase() {
openNewPage(ApiTestRouteEnum.API_TEST_MANAGEMENT, { openNewPage(ApiTestRouteEnum.API_TEST_MANAGEMENT, {
tab: 'case', tab: 'case',
view: 'my_follow', view: props.type,
}); });
} }
function init() { function init() {
setLoadListParams({ setLoadListParams({
projectId: props.project, projectId: props.project,
viewId: 'my_follow', viewId: props.type,
}); });
loadList(); loadList();
} }

View File

@ -56,6 +56,7 @@
const props = defineProps<{ const props = defineProps<{
project: string; project: string;
type: 'my_follow' | 'my_create';
}>(); }>();
const appStore = useAppStore(); const appStore = useAppStore();
@ -223,14 +224,14 @@
function goBugList() { function goBugList() {
openNewPage(BugManagementRouteEnum.BUG_MANAGEMENT_INDEX, { openNewPage(BugManagementRouteEnum.BUG_MANAGEMENT_INDEX, {
view: 'my_follow', view: props.type,
}); });
} }
function init() { function init() {
setLoadListParams({ setLoadListParams({
projectId: props.project, projectId: props.project,
viewId: 'my_follow', viewId: props.type,
}); });
loadList(); loadList();
} }

View File

@ -79,6 +79,7 @@
const props = defineProps<{ const props = defineProps<{
project: string; project: string;
type: 'my_follow' | 'my_create';
}>(); }>();
const { t } = useI18n(); const { t } = useI18n();
@ -168,14 +169,14 @@
function goCaseReview() { function goCaseReview() {
openNewPage(CaseManagementRouteEnum.CASE_MANAGEMENT_REVIEW, { openNewPage(CaseManagementRouteEnum.CASE_MANAGEMENT_REVIEW, {
view: 'my_follow', view: props.type,
}); });
} }
function init() { function init() {
setLoadListParams({ setLoadListParams({
projectId: props.project, projectId: props.project,
viewId: 'my_follow', viewId: props.type,
}); });
loadList(); loadList();
} }

View File

@ -90,6 +90,7 @@
const props = defineProps<{ const props = defineProps<{
project: string; project: string;
type: 'my_follow' | 'my_create';
}>(); }>();
const { t } = useI18n(); const { t } = useI18n();
@ -244,14 +245,14 @@
function goScenario() { function goScenario() {
openNewPage(ApiTestRouteEnum.API_TEST_SCENARIO, { openNewPage(ApiTestRouteEnum.API_TEST_SCENARIO, {
view: 'my_follow', view: props.type,
}); });
} }
function init() { function init() {
setLoadListParams({ setLoadListParams({
projectId: props.project, projectId: props.project,
viewId: 'my_follow', viewId: props.type,
}); });
loadList(); loadList();
} }

View File

@ -70,6 +70,7 @@
const props = defineProps<{ const props = defineProps<{
project: string; project: string;
type: 'my_follow' | 'my_create';
}>(); }>();
const { t } = useI18n(); const { t } = useI18n();
@ -196,7 +197,7 @@
function init() { function init() {
setLoadListParams({ setLoadListParams({
projectId: props.project, projectId: props.project,
viewId: 'my_follow', viewId: props.type,
}); });
loadList(); loadList();
} }
@ -208,7 +209,7 @@
function goTestCase() { function goTestCase() {
openNewPage(CaseManagementRouteEnum.CASE_MANAGEMENT_CASE, { openNewPage(CaseManagementRouteEnum.CASE_MANAGEMENT_CASE, {
showType: 'list', showType: 'list',
view: 'my_follow', view: props.type,
}); });
} }
</script> </script>

View File

@ -4,7 +4,7 @@
<div class="cursor-pointer font-medium text-[var(--color-text-1)]" @click="goTestPlan"> <div class="cursor-pointer font-medium text-[var(--color-text-1)]" @click="goTestPlan">
{{ t('ms.workbench.myFollowed.feature.TEST_PLAN') }} {{ t('ms.workbench.myFollowed.feature.TEST_PLAN') }}
</div> </div>
<a-radio-group v-model="showType" type="button" class="file-show-type mr-2" @change="fetchData"> <a-radio-group v-model="showType" type="button" class="file-show-type mr-2" size="small" @change="fetchData">
<a-radio :value="testPlanTypeEnum.ALL" class="show-type-icon p-[2px]"> <a-radio :value="testPlanTypeEnum.ALL" class="show-type-icon p-[2px]">
{{ t('testPlan.testPlanIndex.all') }} {{ t('testPlan.testPlanIndex.all') }}
</a-radio> </a-radio>
@ -135,6 +135,7 @@
const props = defineProps<{ const props = defineProps<{
project: string; project: string;
type: 'my_follow' | 'my_create';
}>(); }>();
const { t } = useI18n(); const { t } = useI18n();
@ -280,7 +281,7 @@
setLoadListParams({ setLoadListParams({
type: showType.value, type: showType.value,
projectId: props.project, projectId: props.project,
viewId: 'my_follow', viewId: props.type,
}); });
loadList(); loadList();
} }
@ -288,7 +289,7 @@
function goTestPlan() { function goTestPlan() {
openNewPage(TestPlanRouteEnum.TEST_PLAN_INDEX, { openNewPage(TestPlanRouteEnum.TEST_PLAN_INDEX, {
showType: showType.value, showType: showType.value,
view: 'my_follow', view: props.type,
}); });
} }

View File

@ -0,0 +1,80 @@
<template>
<div class="flex flex-col gap-[16px]">
<div class="flex items-center justify-end gap-[12px]">
<MsProjectSelect v-model:project="currentProject" class="w-[240px]" use-default-arrow-icon>
<template #prefix>
{{ t('menu.projectManagementShort') }}
</template>
</MsProjectSelect>
<a-select
v-model:model-value="features"
:options="featureOptions"
:max-tag-count="1"
multiple
class="w-[240px]"
@change="handleFeatureChange"
>
<template #prefix>
{{ t('project.messageManagement.function') }}
</template>
<template #header>
<a-checkbox v-model:model-value="featureAll" class="ml-[8px]" @change="handleFeatureAllChange">
{{ t('common.all') }}
</a-checkbox>
</template>
</a-select>
<a-button type="outline" class="arco-btn-outline--secondary p-[10px]" @click="handleRefresh">
<MsIcon type="icon-icon_reset_outlined" size="14" />
</a-button>
</div>
<testPlanTable v-if="features.includes(FeatureEnum.TEST_PLAN)" :project="currentProject" type="my_create" />
<testCaseTable v-if="features.includes(FeatureEnum.TEST_CASE)" :project="currentProject" type="my_create" />
<caseReviewTable v-if="features.includes(FeatureEnum.CASE_REVIEW)" :project="currentProject" type="my_create" />
<apiCaseTable v-if="features.includes(FeatureEnum.API_CASE)" :project="currentProject" type="my_create" />
<scenarioCaseTable v-if="features.includes(FeatureEnum.API_SCENARIO)" :project="currentProject" type="my_create" />
<bugTable v-if="features.includes(FeatureEnum.BUG)" :project="currentProject" type="my_create" />
</div>
</template>
<script setup lang="ts">
import MsIcon from '@/components/pure/ms-icon-font/index.vue';
import MsProjectSelect from '@/components/business/ms-project-select/index.vue';
import apiCaseTable from '../components/apiCaseTable.vue';
import bugTable from '../components/bugTable.vue';
import caseReviewTable from '../components/caseReviewTable.vue';
import scenarioCaseTable from '../components/scenarioCaseTable.vue';
import testCaseTable from '../components/testCaseTable.vue';
import testPlanTable from '../components/testPlanTable.vue';
import { useI18n } from '@/hooks/useI18n';
import useAppStore from '@/store/modules/app';
import { FeatureEnum } from '@/enums/workbenchEnum';
const { t } = useI18n();
const appStore = useAppStore();
const currentProject = ref(appStore.currentProjectId);
const features = ref<FeatureEnum[]>(Object.values(FeatureEnum));
const featureOptions = Object.keys(FeatureEnum).map((key) => ({
label: t(`ms.workbench.myFollowed.feature.${key}`),
value: key as FeatureEnum,
}));
const featureAll = ref(true);
function handleFeatureAllChange(val: boolean | (string | number | boolean)[]) {
features.value = val ? featureOptions.map((item) => item.value) : [];
}
function handleFeatureChange(
val: string | number | boolean | Record<string, any> | (string | number | boolean | Record<string, any>)[]
) {
featureAll.value = (val as []).length === featureOptions.length;
}
function handleRefresh() {
console.log('refresh');
}
</script>
<style lang="less" scoped></style>

View File

@ -27,24 +27,24 @@
<MsIcon type="icon-icon_reset_outlined" size="14" /> <MsIcon type="icon-icon_reset_outlined" size="14" />
</a-button> </a-button>
</div> </div>
<testPlanTable v-if="features.includes(FeatureEnum.TEST_PLAN)" :project="currentProject" /> <testPlanTable v-if="features.includes(FeatureEnum.TEST_PLAN)" :project="currentProject" type="my_follow" />
<testCaseTable v-if="features.includes(FeatureEnum.TEST_CASE)" :project="currentProject" /> <testCaseTable v-if="features.includes(FeatureEnum.TEST_CASE)" :project="currentProject" type="my_follow" />
<caseReviewTable v-if="features.includes(FeatureEnum.CASE_REVIEW)" :project="currentProject" /> <caseReviewTable v-if="features.includes(FeatureEnum.CASE_REVIEW)" :project="currentProject" type="my_follow" />
<apiCaseTable v-if="features.includes(FeatureEnum.API_CASE)" :project="currentProject" /> <apiCaseTable v-if="features.includes(FeatureEnum.API_CASE)" :project="currentProject" type="my_follow" />
<scenarioCaseTable v-if="features.includes(FeatureEnum.API_SCENARIO)" :project="currentProject" /> <scenarioCaseTable v-if="features.includes(FeatureEnum.API_SCENARIO)" :project="currentProject" type="my_follow" />
<bugTable v-if="features.includes(FeatureEnum.BUG)" :project="currentProject" /> <bugTable v-if="features.includes(FeatureEnum.BUG)" :project="currentProject" type="my_follow" />
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import MsIcon from '@/components/pure/ms-icon-font/index.vue'; import MsIcon from '@/components/pure/ms-icon-font/index.vue';
import MsProjectSelect from '@/components/business/ms-project-select/index.vue'; import MsProjectSelect from '@/components/business/ms-project-select/index.vue';
import apiCaseTable from './components/apiCaseTable.vue'; import apiCaseTable from '../components/apiCaseTable.vue';
import bugTable from './components/bugTable.vue'; import bugTable from '../components/bugTable.vue';
import caseReviewTable from './components/caseReviewTable.vue'; import caseReviewTable from '../components/caseReviewTable.vue';
import scenarioCaseTable from './components/scenarioCaseTable.vue'; import scenarioCaseTable from '../components/scenarioCaseTable.vue';
import testCaseTable from './components/testCaseTable.vue'; import testCaseTable from '../components/testCaseTable.vue';
import testPlanTable from './components/testPlanTable.vue'; import testPlanTable from '../components/testPlanTable.vue';
import { useI18n } from '@/hooks/useI18n'; import { useI18n } from '@/hooks/useI18n';
import useAppStore from '@/store/modules/app'; import useAppStore from '@/store/modules/app';