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 { .ms-select {
.arco-select-view-prefix {
margin-top: 1px;
}
.arco-select-view-inner { .arco-select-view-inner {
@apply relative; @apply relative;
} }

View File

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

View File

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

View File

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