mirror of
https://gitee.com/fit2cloud-feizhiyun/MeterSphere.git
synced 2024-12-02 03:58:33 +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(() => {
|
watchEffect(() => {
|
||||||
const innerDom = selectRef.value?.$el.nextElementSibling.querySelector('.arco-select-view-inner') as HTMLElement;
|
const innerDom = selectRef.value?.$el.nextElementSibling.querySelector('.arco-select-view-inner') as HTMLElement;
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
:prefix="t('workbench.homePage.project')"
|
:prefix="t('workbench.homePage.project')"
|
||||||
:multiple="true"
|
:multiple="true"
|
||||||
:has-all-select="true"
|
:has-all-select="true"
|
||||||
:default-all-select="innerSelectAll"
|
:default-all-select="props.item.selectAll"
|
||||||
:at-least-one="true"
|
:at-least-one="true"
|
||||||
@change="changeProject"
|
@change="changeProject"
|
||||||
>
|
>
|
||||||
@ -195,6 +195,7 @@
|
|||||||
options.value.yAxis[0].max = maxAxis < 100 ? 100 : maxAxis + 50;
|
options.value.yAxis[0].max = maxAxis < 100 ? 100 : maxAxis + 50;
|
||||||
}
|
}
|
||||||
const showSkeleton = ref(false);
|
const showSkeleton = ref(false);
|
||||||
|
const selectAll = computed(() => appStore.projectList.length === innerProjectIds.value.length);
|
||||||
|
|
||||||
async function initOverViewDetail() {
|
async function initOverViewDetail() {
|
||||||
try {
|
try {
|
||||||
@ -210,7 +211,7 @@
|
|||||||
projectIds: innerProjectIds.value,
|
projectIds: innerProjectIds.value,
|
||||||
organizationId: appStore.currentOrgId,
|
organizationId: appStore.currentOrgId,
|
||||||
handleUsers: [],
|
handleUsers: [],
|
||||||
selectAll: innerSelectAll.value,
|
selectAll: selectAll.value,
|
||||||
};
|
};
|
||||||
let detail;
|
let detail;
|
||||||
if (props.item.key === WorkCardEnum.PROJECT_VIEW) {
|
if (props.item.key === WorkCardEnum.PROJECT_VIEW) {
|
||||||
@ -232,6 +233,7 @@
|
|||||||
function changeProject() {
|
function changeProject() {
|
||||||
if (isInit.value) return;
|
if (isInit.value) return;
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
|
innerSelectAll.value = selectAll.value;
|
||||||
emit('change');
|
emit('change');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -241,13 +243,6 @@
|
|||||||
initOverViewDetail();
|
initOverViewDetail();
|
||||||
});
|
});
|
||||||
|
|
||||||
watch(
|
|
||||||
() => innerProjectIds.value,
|
|
||||||
(val) => {
|
|
||||||
innerSelectAll.value = val.length === appStore.projectList.length;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => timeForm.value,
|
() => timeForm.value,
|
||||||
(val) => {
|
(val) => {
|
||||||
@ -260,15 +255,6 @@
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
watch(
|
|
||||||
() => props.refreshKey,
|
|
||||||
(val) => {
|
|
||||||
if (val) {
|
|
||||||
initOverViewDetail();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
watch([() => props.refreshKey, () => innerProjectIds.value], async () => {
|
watch([() => props.refreshKey, () => innerProjectIds.value], async () => {
|
||||||
await nextTick();
|
await nextTick();
|
||||||
initOverViewDetail();
|
initOverViewDetail();
|
||||||
|
Loading…
Reference in New Issue
Block a user