Merge branch 'main' of http://carsafe.uicp.cn/Front_Team/SPDM
This commit is contained in:
@@ -541,7 +541,7 @@ const getUserGroupTaskCompleteStatistics = async () => {
|
||||
res.data?.allExeStatus?.map((item: any) => {
|
||||
return TASK_PROCESS_STATUS_OBJ[item];
|
||||
}) || [];
|
||||
|
||||
console.log(legendData, 'legendData');
|
||||
seriesData = legendData?.map((item: any) => {
|
||||
return {
|
||||
name: item,
|
||||
@@ -556,16 +556,28 @@ const getUserGroupTaskCompleteStatistics = async () => {
|
||||
},
|
||||
};
|
||||
});
|
||||
res.data?.result?.forEach((item: any) => {
|
||||
xData.push(item.userName);
|
||||
for (const key in item.statusCount) {
|
||||
seriesData?.forEach((seriesItem: any) => {
|
||||
if (seriesItem.name === TASK_PROCESS_STATUS_OBJ[key]) {
|
||||
seriesItem.data.push(item.statusCount[key]);
|
||||
if (res.data?.result) {
|
||||
res.data.result.forEach((item: any) => {
|
||||
if (item.userName) {
|
||||
xData.push(item.userName);
|
||||
}
|
||||
// 遍历所有状态
|
||||
legendData.forEach((statusName: string) => {
|
||||
// 找到对应的 seriesItem
|
||||
const seriesItem = seriesData.find((item: any) => item.name === statusName);
|
||||
if (seriesItem) {
|
||||
// 获取状态对应的 key
|
||||
const statusKey = Object.keys(TASK_PROCESS_STATUS_OBJ).find(
|
||||
(key) => TASK_PROCESS_STATUS_OBJ[key] === statusName
|
||||
);
|
||||
if (statusKey) {
|
||||
// 如果 statusCount 中有这个状态,使用其值,否则使用 0
|
||||
seriesItem.data.push(item.statusCount?.[statusKey] || '');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
return {
|
||||
xData,
|
||||
@@ -620,9 +632,8 @@ const userDifficultyCoefficientFormData = reactive<any>({
|
||||
const userDifficultyCoefficientChartRef = ref();
|
||||
const getDifficultyLevel = (difficulty: number) => {
|
||||
const str = DIFFICULTY_COEFFICIENT.value.O[difficulty];
|
||||
return str ? str + ', 系数' : '难度系数';
|
||||
return str ? str : '难度系数';
|
||||
};
|
||||
// console.log(getDifficultyLevel(5), '000000');
|
||||
const initUserDifficultyCoefficientStatistics = async () => {
|
||||
let xData: any = [];
|
||||
// const yData:any = [1, 2, 3, 4];
|
||||
@@ -1276,16 +1287,28 @@ const getProjectGroupTaskCompleteStatistics = async () => {
|
||||
},
|
||||
};
|
||||
});
|
||||
res.data?.result?.forEach((item: any) => {
|
||||
xData.push(item.userName);
|
||||
for (const key in item.statusCount) {
|
||||
seriesData?.forEach((seriesItem: any) => {
|
||||
if (seriesItem.name === TASK_PROCESS_STATUS_OBJ[key]) {
|
||||
seriesItem.data.push(item.statusCount[key]);
|
||||
if (res.data?.result) {
|
||||
res.data.result.forEach((item: any) => {
|
||||
if (item.userName) {
|
||||
xData.push(item.userName);
|
||||
}
|
||||
// 遍历所有状态
|
||||
legendData.forEach((statusName: string) => {
|
||||
// 找到对应的 seriesItem
|
||||
const seriesItem = seriesData.find((item: any) => item.name === statusName);
|
||||
if (seriesItem) {
|
||||
// 获取状态对应的 key
|
||||
const statusKey = Object.keys(TASK_PROCESS_STATUS_OBJ).find(
|
||||
(key) => TASK_PROCESS_STATUS_OBJ[key] === statusName
|
||||
);
|
||||
if (statusKey) {
|
||||
// 如果 statusCount 中有这个状态,使用其值,否则使用 0
|
||||
seriesItem.data.push(item.statusCount?.[statusKey] || '');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
return {
|
||||
xData,
|
||||
|
||||
@@ -497,7 +497,7 @@ const queryUserTaskCompletion = async () => {
|
||||
// });
|
||||
const getDifficultyLevel = (difficulty: number) => {
|
||||
const str = DIFFICULTY_COEFFICIENT.value.O[difficulty];
|
||||
return str ? str + ', 系数' : '难度系数';
|
||||
return str ? str : '难度系数';
|
||||
};
|
||||
const userDifficultyCoefficientChartRef = ref();
|
||||
const queryUserDifficultStatistics = async () => {
|
||||
|
||||
@@ -35,7 +35,6 @@
|
||||
<template #progress="{ row }"> {{ row.progress || 0 }}% </template>
|
||||
<template #approvalStatus="{ row }">
|
||||
<StatusDot
|
||||
class="clcik-approval"
|
||||
:status="
|
||||
getApproveStyleClass(row.approvalStatus || TASK_APPROVE_STATUS_ENUM.NOT_APPROVED)
|
||||
"
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
v-model="filterFprmData.userGroupId"
|
||||
class="mw200"
|
||||
clearable
|
||||
@clear="filterFprmData.userGroupId = ''"
|
||||
@change="filterWorkLoadFun('group')"
|
||||
>
|
||||
<el-option
|
||||
@@ -26,7 +27,7 @@
|
||||
multiple
|
||||
clearable
|
||||
class="mw200"
|
||||
@change="filterWorkLoadFun"
|
||||
@change="userChangeFun"
|
||||
@focus="focusUserFun"
|
||||
>
|
||||
<el-option
|
||||
@@ -105,6 +106,7 @@ import { getListUserWorkloadsApi } from '@/api/project/task';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import type { ChineseWorkday } from 'chinese-workday';
|
||||
import DetailDia from '@/views/task/workLoad/detailDia.vue';
|
||||
import { debounce } from 'lodash-es';
|
||||
|
||||
const props = defineProps({
|
||||
// 维度:工作负载以人person为维度, 人力负载以项目project为维度
|
||||
@@ -124,6 +126,7 @@ const props = defineProps({
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
// 是否需要展示汇总行
|
||||
showTotal: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
@@ -227,13 +230,6 @@ const getWorkLoadDataFun = async () => {
|
||||
...filterFprmData,
|
||||
...props.filterData,
|
||||
};
|
||||
|
||||
if (!filterFprmData.userGroupId) {
|
||||
param.userGroupId = '';
|
||||
}
|
||||
if (!filterFprmData.userIds.length) {
|
||||
param.userIds = [];
|
||||
}
|
||||
// 根据页面类型去掉没用的参数
|
||||
if (props.dimension === 'project') {
|
||||
delete param.userGroupId;
|
||||
@@ -737,7 +733,11 @@ const refreshGanttFun = async () => {
|
||||
initGantt();
|
||||
await getWorkLoadDataFun();
|
||||
};
|
||||
|
||||
// 切换用户
|
||||
const userChangeFun = debounce(async () => {
|
||||
await filterWorkLoadFun();
|
||||
}, 500);
|
||||
// 用户下拉框获取焦点
|
||||
const focusUserFun = () => {
|
||||
if (!filterFprmData.userGroupId) {
|
||||
ElMessage.warning('请选择用户组后再选择用户进行筛选!');
|
||||
|
||||
@@ -52,7 +52,7 @@ const columns = [
|
||||
const fieldMapFun = (data: any) => {
|
||||
const list = data.map((item: any) => {
|
||||
return {
|
||||
userName: item.projectName, // 显示项目名称
|
||||
userName: item.projectName, // 显示项目名称--姓名
|
||||
userId: item.projectId, // 项目ID
|
||||
taskNum: item.taskNum, // 任务数量
|
||||
workNum: item.personNum, // 人员数量
|
||||
|
||||
Reference in New Issue
Block a user