fix(工作台): 修复工作台卡片项目切换人员偶发性bug
This commit is contained in:
parent
82fc924888
commit
dd0c8e2295
|
@ -22,7 +22,6 @@
|
||||||
<MsSelect
|
<MsSelect
|
||||||
v-model:model-value="innerHandleUsers"
|
v-model:model-value="innerHandleUsers"
|
||||||
:options="memberOptions"
|
:options="memberOptions"
|
||||||
allow-clear
|
|
||||||
allow-search
|
allow-search
|
||||||
:search-keys="['label']"
|
:search-keys="['label']"
|
||||||
class="!w-[220px]"
|
class="!w-[220px]"
|
||||||
|
@ -176,19 +175,26 @@
|
||||||
label: e.text,
|
label: e.text,
|
||||||
value: e.value,
|
value: e.value,
|
||||||
}));
|
}));
|
||||||
innerHandleUsers.value = memberOptions.value.map((e) => e.value);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function handleProjectChange(isRefreshKey: boolean = false) {
|
async function handleProjectChange(isRefreshKey: boolean = false, setAll = false) {
|
||||||
await nextTick();
|
await nextTick();
|
||||||
if (!isRefreshKey) {
|
if (!isRefreshKey) {
|
||||||
await getMemberOptions();
|
await getMemberOptions();
|
||||||
|
if (setAll) {
|
||||||
|
innerHandleUsers.value = [...memberOptions.value.map((e) => e.value)];
|
||||||
|
} else {
|
||||||
|
innerHandleUsers.value = innerHandleUsers.value.filter((id: string) =>
|
||||||
|
memberOptions.value.some((member) => member.value === id)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
await getDefectMemberDetail();
|
}
|
||||||
|
await nextTick();
|
||||||
|
getDefectMemberDetail();
|
||||||
}
|
}
|
||||||
|
|
||||||
async function changeProject() {
|
async function changeProject() {
|
||||||
await handleProjectChange(false);
|
await handleProjectChange(false, true);
|
||||||
emit('change');
|
emit('change');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -234,9 +240,12 @@
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
watch([() => props.refreshKey, () => projectId.value], ([refreshKey]) => {
|
watch(
|
||||||
|
() => props.refreshKey,
|
||||||
|
(refreshKey) => {
|
||||||
handleProjectChange(!!refreshKey);
|
handleProjectChange(!!refreshKey);
|
||||||
});
|
}
|
||||||
|
);
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
handleProjectChange(false);
|
handleProjectChange(false);
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
<MsSelect
|
<MsSelect
|
||||||
v-model:model-value="innerProjectIds"
|
v-model:model-value="innerProjectIds"
|
||||||
:options="appStore.projectList"
|
:options="appStore.projectList"
|
||||||
allow-clear
|
|
||||||
allow-search
|
allow-search
|
||||||
value-key="id"
|
value-key="id"
|
||||||
label-key="name"
|
label-key="name"
|
||||||
|
@ -172,7 +171,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleProjectChange(shouldEmit = false) {
|
function handleProjectChange(shouldEmit = false) {
|
||||||
// 项目切换逻辑
|
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
innerSelectAll.value = selectAll.value;
|
innerSelectAll.value = selectAll.value;
|
||||||
initOverViewDetail();
|
initOverViewDetail();
|
||||||
|
|
|
@ -19,13 +19,10 @@
|
||||||
@change="changeProject"
|
@change="changeProject"
|
||||||
>
|
>
|
||||||
</MsSelect>
|
</MsSelect>
|
||||||
|
|
||||||
<MsSelect
|
<MsSelect
|
||||||
v-model:model-value="innerHandleUsers"
|
v-model:model-value="innerHandleUsers"
|
||||||
:options="memberOptions"
|
:options="memberOptions"
|
||||||
allow-search
|
allow-search
|
||||||
allow-clear
|
|
||||||
:placeholder="t('ms.case.associate.allData')"
|
|
||||||
value-key="value"
|
value-key="value"
|
||||||
label-key="label"
|
label-key="label"
|
||||||
:search-keys="['label']"
|
:search-keys="['label']"
|
||||||
|
@ -146,19 +143,26 @@
|
||||||
label: e.name,
|
label: e.name,
|
||||||
value: e.id,
|
value: e.id,
|
||||||
}));
|
}));
|
||||||
innerHandleUsers.value = memberOptions.value.map((e) => e.value);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function handleProjectChange(isRefreshKey: boolean = false) {
|
async function handleProjectChange(isRefreshKey: boolean = false, setAll = false) {
|
||||||
await nextTick();
|
await nextTick();
|
||||||
if (!isRefreshKey) {
|
if (!isRefreshKey) {
|
||||||
await getMemberOptions();
|
await getMemberOptions();
|
||||||
|
if (setAll) {
|
||||||
|
innerHandleUsers.value = [...memberOptions.value.map((e) => e.value)];
|
||||||
|
} else {
|
||||||
|
innerHandleUsers.value = innerHandleUsers.value.filter((id: string) =>
|
||||||
|
memberOptions.value.some((member) => member.value === id)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
await initOverViewMemberDetail();
|
}
|
||||||
|
await nextTick();
|
||||||
|
initOverViewMemberDetail();
|
||||||
}
|
}
|
||||||
|
|
||||||
async function changeProject() {
|
async function changeProject() {
|
||||||
await handleProjectChange(false);
|
await handleProjectChange(false, true);
|
||||||
emit('change');
|
emit('change');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -204,9 +208,12 @@
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
watch([() => props.refreshKey, () => projectId.value], ([refreshKey]) => {
|
watch(
|
||||||
|
() => props.refreshKey,
|
||||||
|
(refreshKey) => {
|
||||||
handleProjectChange(!!refreshKey);
|
handleProjectChange(!!refreshKey);
|
||||||
});
|
}
|
||||||
|
);
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
handleProjectChange(false);
|
handleProjectChange(false);
|
||||||
|
|
Loading…
Reference in New Issue