feat(工作台): 工作台-我的创建&我的关注&待办功能选择器

This commit is contained in:
baiqi 2024-11-08 17:02:56 +08:00 committed by Craftsman
parent 17d5ccf124
commit 2a899a52da
4 changed files with 36 additions and 85 deletions

View File

@ -1,7 +1,4 @@
.ms-select {
.arco-select-view-prefix {
margin-top: 1px;
}
.arco-select-view-inner {
@apply relative;
}

View File

@ -11,23 +11,17 @@
{{ t('menu.projectManagementShort') }}
</template>
</MsProjectSelect>
<a-select
<MsSelect
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>
:allow-search="false"
allow-clear
class="!w-[240px]"
:prefix="t('project.messageManagement.function')"
:multiple="true"
:has-all-select="true"
:default-all-select="true"
/>
<a-button type="outline" class="arco-btn-outline--secondary p-[10px]" @click="handleRefresh">
<MsIcon type="icon-icon_reset_outlined" size="14" />
</a-button>
@ -75,6 +69,7 @@
<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 MsSelect from '@/components/business/ms-select';
import apiCaseTable from '../components/apiCaseTable.vue';
import bugTable from '../components/bugTable.vue';
import caseReviewTable from '../components/caseReviewTable.vue';
@ -97,19 +92,8 @@
label: t(`ms.workbench.myFollowed.feature.${key}`),
value: key as FeatureEnum,
}));
const featureAll = ref(true);
const refreshId = ref('');
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() {
refreshId.value = getGenerateId();
}

View File

@ -11,23 +11,17 @@
{{ t('menu.projectManagementShort') }}
</template>
</MsProjectSelect>
<a-select
<MsSelect
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>
:allow-search="false"
allow-clear
class="!w-[240px]"
:prefix="t('project.messageManagement.function')"
:multiple="true"
:has-all-select="true"
:default-all-select="true"
/>
<a-button type="outline" class="arco-btn-outline--secondary p-[10px]" @click="handleRefresh">
<MsIcon type="icon-icon_reset_outlined" size="14" />
</a-button>
@ -74,6 +68,7 @@
<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 MsSelect from '@/components/business/ms-select';
import apiCaseTable from '../components/apiCaseTable.vue';
import bugTable from '../components/bugTable.vue';
import caseReviewTable from '../components/caseReviewTable.vue';
@ -96,19 +91,8 @@
label: t(`ms.workbench.myFollowed.feature.${key}`),
value: key as FeatureEnum,
}));
const featureAll = ref(true);
const refreshId = ref('');
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() {
refreshId.value = getGenerateId();
}

View File

@ -6,23 +6,17 @@
{{ t('menu.projectManagementShort') }}
</template>
</MsProjectSelect>
<a-select
<MsSelect
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>
:allow-search="false"
allow-clear
class="!w-[240px]"
:prefix="t('project.messageManagement.function')"
:multiple="true"
:has-all-select="true"
:default-all-select="true"
/>
<a-button type="outline" class="arco-btn-outline--secondary p-[10px]" @click="handleRefresh">
<MsIcon type="icon-icon_reset_outlined" size="14" />
</a-button>
@ -51,6 +45,7 @@
<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 MsSelect from '@/components/business/ms-select';
import bugTable from '../components/bugTable.vue';
import caseReviewTable from '../components/caseReviewTable.vue';
import testPlanTable from '../components/testPlanTable.vue';
@ -66,23 +61,14 @@
const currentProject = ref(appStore.currentProjectId);
const features = ref<FeatureEnum[]>(Object.values(FeatureEnum));
const featureOptions = Object.keys(FeatureEnum).map((key) => ({
const featureOptions = Object.keys(FeatureEnum)
.filter((e) => [FeatureEnum.TEST_PLAN, FeatureEnum.CASE_REVIEW, FeatureEnum.BUG].includes(e as FeatureEnum))
.map((key) => ({
label: t(`ms.workbench.myFollowed.feature.${key}`),
value: key as FeatureEnum,
}));
const featureAll = ref(true);
const refreshId = ref('');
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() {
refreshId.value = getGenerateId();
}