feat:就餐人数统计-本月
This commit is contained in:
1 parent
4c74946e73
commit
dec386a4b3
3 files changed
+12
-13
No files matched your search
@@ -47,12 +47,18 @@ const props = defineProps({
|
||||
const displayData = computed(() => {
|
||||
const days = getMonthDays();
|
||||
const data = props.data;
|
||||
console.log("data", props.data);
|
||||
|
||||
if (!Array.isArray(props.data)) return days.map((day) => ({ day, type: -1 }));
|
||||
if (props.data.length !== days.length) {
|
||||
for (let i = data.length; i < days.length; i++) {
|
||||
const day = data[i - 1];
|
||||
data.push({
|
||||
day: days[i],
|
||||
day: day,
|
||||
type: -1,
|
||||
morningCount: element.morningCount ?? 0,
|
||||
noonCount: element.noonCount ?? 0,
|
||||
eveningCount: element.eveningCount ?? 0,
|
||||
});
|
||||
}
|
||||
return data.slice(0, days.length);
|
||||
@@ -66,13 +72,6 @@ const getBarColor = (type) => {
|
||||
return "#7f7f7f77";
|
||||
};
|
||||
|
||||
// 新增:类型文案
|
||||
const getTypeText = (type) => {
|
||||
if (type === 0) return "正常";
|
||||
if (type === 1) return "休息";
|
||||
return "未知";
|
||||
};
|
||||
|
||||
const doCar = (item) => {
|
||||
if (!item.day) return;
|
||||
if (item.type == "-1") {
|
||||
|
||||
@@ -106,11 +106,11 @@ const options = {
|
||||
borderRadius: [0, 10, 10, 0],
|
||||
color: (params) => {
|
||||
const palette = [
|
||||
["#1F4F68", "#2FC6DC"],
|
||||
["#1F4F68", "#2FC6DC"],
|
||||
["#F47E3D", "#F4C93D"],
|
||||
["#1F4F68", "#2FC6DC"],
|
||||
["#1F4F68", "#2FC6DC"],
|
||||
["#1F4F68", "#2FC6DC"],
|
||||
["#1F4F68", "#2FC6DC"],
|
||||
];
|
||||
const [c1, c2] = palette[params.dataIndex % palette.length];
|
||||
return new echarts.graphic.LinearGradient(1, 0, 0, 0, [
|
||||
|
||||
@@ -230,9 +230,9 @@ const getAttendanceStatisticData = () => {
|
||||
if (dateRangeType === "THIS_MONTH") {
|
||||
timerObj.byHourType.data.data = {
|
||||
THIS_MONTH: data.morning?.list?.map((v) => {
|
||||
const morningCount = data.morning?.list.find((item) => item.time === item.time)?.personCount ?? 0
|
||||
const noonCount = data.noon?.list.find((item) => item.time === item.time)?.personCount ?? 0
|
||||
const eveningCount = data.evening?.list.find((item) => item.time === item.time)?.personCount ?? 0
|
||||
const morningCount = data.morning?.list.find((item) => item.time === v.time)?.personCount ?? 0
|
||||
const noonCount = data.noon?.list.find((item) => item.time === v.time)?.personCount ?? 0
|
||||
const eveningCount = data.evening?.list.find((item) => item.time === v.time)?.personCount ?? 0
|
||||
let type = -1;
|
||||
// 如果time大于等于当天
|
||||
const targetDate = new Date(v.time);
|
||||
|
||||
Reference in new issue
Block a user