mirror of
https://gitee.com/fit2cloud-feizhiyun/MeterSphere.git
synced 2024-12-01 19:49:10 +08:00
fix(工作台): 修复工作台项目概览默认选中全部bug
This commit is contained in:
parent
d4f300266a
commit
36f6a41288
@ -349,6 +349,15 @@ export default defineComponent(
|
||||
}
|
||||
});
|
||||
|
||||
watch(
|
||||
() => props.defaultAllSelect,
|
||||
(val) => {
|
||||
if (val) {
|
||||
handleSelectAllChange(true);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
// 检测全选状态变化,全选时需要覆盖选择器的输入框内容,展示文本 ‘全部’;非全选时则移除文本 ‘全部’
|
||||
watchEffect(() => {
|
||||
const innerDom = selectRef.value?.$el.nextElementSibling.querySelector('.arco-select-view-inner') as HTMLElement;
|
||||
|
@ -19,7 +19,7 @@
|
||||
:prefix="t('workbench.homePage.project')"
|
||||
:multiple="true"
|
||||
:has-all-select="true"
|
||||
:default-all-select="innerSelectAll"
|
||||
:default-all-select="props.item.selectAll"
|
||||
:at-least-one="true"
|
||||
@change="changeProject"
|
||||
>
|
||||
@ -195,6 +195,7 @@
|
||||
options.value.yAxis[0].max = maxAxis < 100 ? 100 : maxAxis + 50;
|
||||
}
|
||||
const showSkeleton = ref(false);
|
||||
const selectAll = computed(() => appStore.projectList.length === innerProjectIds.value.length);
|
||||
|
||||
async function initOverViewDetail() {
|
||||
try {
|
||||
@ -210,7 +211,7 @@
|
||||
projectIds: innerProjectIds.value,
|
||||
organizationId: appStore.currentOrgId,
|
||||
handleUsers: [],
|
||||
selectAll: innerSelectAll.value,
|
||||
selectAll: selectAll.value,
|
||||
};
|
||||
let detail;
|
||||
if (props.item.key === WorkCardEnum.PROJECT_VIEW) {
|
||||
@ -232,6 +233,7 @@
|
||||
function changeProject() {
|
||||
if (isInit.value) return;
|
||||
nextTick(() => {
|
||||
innerSelectAll.value = selectAll.value;
|
||||
emit('change');
|
||||
});
|
||||
}
|
||||
@ -241,13 +243,6 @@
|
||||
initOverViewDetail();
|
||||
});
|
||||
|
||||
watch(
|
||||
() => innerProjectIds.value,
|
||||
(val) => {
|
||||
innerSelectAll.value = val.length === appStore.projectList.length;
|
||||
}
|
||||
);
|
||||
|
||||
watch(
|
||||
() => timeForm.value,
|
||||
(val) => {
|
||||
@ -260,15 +255,6 @@
|
||||
}
|
||||
);
|
||||
|
||||
watch(
|
||||
() => props.refreshKey,
|
||||
(val) => {
|
||||
if (val) {
|
||||
initOverViewDetail();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
watch([() => props.refreshKey, () => innerProjectIds.value], async () => {
|
||||
await nextTick();
|
||||
initOverViewDetail();
|
||||
|
Loading…
Reference in New Issue
Block a user