fix(工作台): 修复工作台待办&关注&创建移除项目成员上来请求报错
Some checks are pending
MeterSphere 覆盖率统计 / 覆盖率统计 (push) Waiting to run
MeterSphere 前端代码校验 / 前端代码校验 (push) Waiting to run
SonarCloud / Build and analyze (push) Waiting to run
Mirror GitHub Auto Queried Repos to Gitee / Sync-GitHub-to-Gitee (push) Waiting to run

This commit is contained in:
xinxin.wu 2024-11-19 19:27:21 +08:00 committed by Craftsman
parent 4b9fc810c7
commit c47d0cd198
2 changed files with 24 additions and 4 deletions

View File

@ -1,5 +1,11 @@
<template>
<a-select :class="props.class || 'w-[260px]'" :default-value="project" allow-search @change="selectProject">
<a-select
v-model="project"
:class="props.class || 'w-[260px]'"
allow-search
:allow-create="false"
@change="selectProject"
>
<template v-if="!props.useDefaultArrowIcon" #arrow-icon>
<icon-caret-down />
</template>
@ -37,9 +43,19 @@
function selectProject(
value: string | number | boolean | Record<string, any> | (string | number | boolean | Record<string, any>)[]
) {
project.value = value as string;
const _project = projectList.value.find((item) => item.id === value);
emit('change', value as string, _project);
let _project = projectList.value.find((item) => item.id === value);
//
if (!_project) {
const [_pro] = projectList.value;
_project = _pro;
project.value = projectList.value[0].id;
} else {
project.value = value as string;
}
//
nextTick(() => {
emit('change', project.value, _project);
});
}
onBeforeMount(async () => {

View File

@ -159,6 +159,10 @@
{
title: 'common.createTime',
dataIndex: 'createTime',
sortable: {
sortDirections: ['ascend', 'descend'],
sorter: true,
},
width: 180,
},
];