[]) => {
+ optionData.forEach((itemValue: any, index: number) => {
+ if (itemValue.value === 0) optionData[index].value = null;
+ });
+ let hasZero = false;
+ for (let i = 0; i < optionData.length; i++) {
+ if (optionData[i].value === 0) {
+ hasZero = true;
+ break;
+ }
+ }
+ return hasZero ? 0 : 5;
+ })(countData),
};
});
+ options.value.yAxis[0].max = maxAxis < 100 ? 50 : maxAxis + 50;
}
async function getDefectMemberDetail() {
@@ -128,6 +156,8 @@
organizationId: appStore.currentOrgId,
handleUsers: innerHandleUsers.value,
});
+ hasPermission.value = detail.errorCode !== 109001;
+
handleData(detail);
} catch (error) {
console.log(error);
@@ -145,8 +175,8 @@
function changeProject() {
memberIds.value = [];
- getMemberOptions();
nextTick(() => {
+ getMemberOptions();
getDefectMemberDetail();
emit('change');
});
diff --git a/frontend/src/views/workbench/homePage/components/overview.vue b/frontend/src/views/workbench/homePage/components/overview.vue
index 1f71176dea..00a52d4507 100644
--- a/frontend/src/views/workbench/homePage/components/overview.vue
+++ b/frontend/src/views/workbench/homePage/components/overview.vue
@@ -23,7 +23,10 @@
-
+
@@ -98,6 +101,8 @@
const options = ref>({});
+ const hasPermission = ref(false);
+
const cardModuleList = ref([]);
function handleData(detail: OverViewOfProject) {
@@ -113,7 +118,7 @@
cardModuleList.value = tempAxisData as ModuleCardItem[];
options.value = getCommonBarOptions(hasRoom.value, getColorScheme(detail.projectCountList.length));
- const { invisible, text } = handleNoDataDisplay(detail.xaxis, detail.projectCountList);
+ const { invisible, text } = handleNoDataDisplay(detail.xaxis, hasPermission.value);
options.value.graphic.invisible = invisible;
options.value.graphic.style.text = text;
// x轴
@@ -202,6 +207,7 @@
} else {
detail = await workMyCreatedDetail(params);
}
+ hasPermission.value = detail.errorCode !== 109001;
handleData(detail);
} catch (error) {
diff --git a/frontend/src/views/workbench/homePage/components/overviewMember.vue b/frontend/src/views/workbench/homePage/components/overviewMember.vue
index d3d6fa6dac..4d3f116ab2 100644
--- a/frontend/src/views/workbench/homePage/components/overviewMember.vue
+++ b/frontend/src/views/workbench/homePage/components/overviewMember.vue
@@ -89,13 +89,15 @@
endTime: 0,
})
);
+ const hasPermission = ref(false);
const memberOptions = ref<{ label: string; value: string }[]>([]);
const options = ref>({});
const color = ['#811FA3', '#FFCA59', '#00C261', '#FFA1FF', '#F9F871', '#3370FF', '#F24F4F'];
+
function handleData(detail: OverViewOfProject) {
options.value = getCommonBarOptions(detail.xaxis.length >= 7, color);
- const { invisible, text } = handleNoDataDisplay(detail.xaxis, detail.projectCountList);
+ const { invisible, text } = handleNoDataDisplay(detail.xaxis, hasPermission.value);
options.value.graphic.invisible = invisible;
options.value.graphic.style.text = text;
options.value.xAxis.data = detail.xaxis.map((e) => characterLimit(e, 10));
@@ -158,6 +160,7 @@
handleUsers: innerHandleUsers.value,
};
const detail = await workMemberViewDetail(params);
+ hasPermission.value = detail.errorCode !== 109001;
handleData(detail);
} catch (error) {
// eslint-disable-next-line no-console
diff --git a/frontend/src/views/workbench/homePage/components/tabCard.vue b/frontend/src/views/workbench/homePage/components/tabCard.vue
index 0efde35486..b14dd955df 100644
--- a/frontend/src/views/workbench/homePage/components/tabCard.vue
+++ b/frontend/src/views/workbench/homePage/components/tabCard.vue
@@ -17,7 +17,7 @@
-
+
@@ -41,6 +41,7 @@
minWidth?: string;
notHasPadding?: boolean;
hiddenBorder?: boolean;
+ noPermissionText?: string;
}>();
const width = ref();
diff --git a/frontend/src/views/workbench/homePage/utils.ts b/frontend/src/views/workbench/homePage/utils.ts
index 1dd8dcbc75..4693fba650 100644
--- a/frontend/src/views/workbench/homePage/utils.ts
+++ b/frontend/src/views/workbench/homePage/utils.ts
@@ -170,7 +170,7 @@ export function getCommonBarOptions(hasRoom: boolean, color: string[]): Record
- item.count.every((e) => e === 0 || e === null || e === undefined)
- );
-
- if (isEmptyData) {
+ if (!xAxis.length) {
return {
invisible: false,
text: t('workbench.homePage.notHasData'),