运营数据概览折线图选择月日,及图例逻辑问题

This commit is contained in:
weixiaobo@boe.com.cn
2023-08-29 17:17:45 +08:00
parent df6abbd53d
commit d0d69d7376

View File

@@ -343,7 +343,7 @@ export default {
}, },
modalFlag: false, modalFlag: false,
checkedList: ['学习人数', '总学习时长'], checkedList: ['学习人数', '总学习时长'],
limitCheckedList: [], limitCheckedList: ['学习人数', '总学习时长'],
plainOptions: ['学习人数', '总学习时长', '人均学习时长'], plainOptions: ['学习人数', '总学习时长', '人均学习时长'],
chartLabel: { chartLabel: {
one: "学习人数", one: "学习人数",
@@ -370,7 +370,12 @@ export default {
state.checkedList = state.limitCheckedList; state.checkedList = state.limitCheckedList;
}else{ }else{
state.limitCheckedList = event; state.limitCheckedList = event;
modalChange(); // modalChange();
if (state.towParmasn.dateType == 2) {
twoMonthChange(state.towParmasn.time);
} else if (state.towParmasn.dateType == 1) {
twoDatChange(state.towParmasn.day);
}
} }
}; };
@@ -597,11 +602,6 @@ export default {
} }
}; };
const modalChange = async () => { const modalChange = async () => {
if (state.towParmasn.dateType == 2) {
twoMonthChange(state.towParmasn.time);
} else if (state.towParmasn.dateType == 1) {
twoDatChange(state.towParmasn.day);
}
console.log("modalChange type:",state.towParmasn.type); console.log("modalChange type:",state.towParmasn.type);
if(state.towParmasn.type==2 || state.towParmasn.type==3){ if(state.towParmasn.type==2 || state.towParmasn.type==3){
state.chartLabel.one = "总阅读人数"; state.chartLabel.one = "总阅读人数";
@@ -609,22 +609,30 @@ export default {
state.chartLabel.three = "人均阅读时长"; state.chartLabel.three = "人均阅读时长";
state.plainOptions = ["总阅读人数","总阅读时长","人均阅读时长"]; state.plainOptions = ["总阅读人数","总阅读时长","人均阅读时长"];
state.checkedList = ["总阅读人数","总阅读时长"]; state.checkedList = ["总阅读人数","总阅读时长"];
state.limitCheckedList = ["总阅读人数","总阅读时长"];
}else if(state.towParmasn.type==4){ }else if(state.towParmasn.type==4){
state.chartLabel.one = "总查看人数"; state.chartLabel.one = "总查看人数";
state.chartLabel.two = "总提问人数"; state.chartLabel.two = "总提问人数";
state.chartLabel.three = "总回答人数"; state.chartLabel.three = "总回答人数";
state.plainOptions = ["总查看人数","总提问人数","总回答人数"]; state.plainOptions = ["总查看人数","总提问人数","总回答人数"];
state.checkedList = ["总查看人数","总提问人数"]; state.checkedList = ["总查看人数","总提问人数"];
state.limitCheckedList = ["总查看人数","总提问人数"];
}else { }else {
state.chartLabel.one = "学习人数"; state.chartLabel.one = "学习人数";
state.chartLabel.two = "总学习时长"; state.chartLabel.two = "总学习时长";
state.chartLabel.three = "人均学习时长"; state.chartLabel.three = "人均学习时长";
state.plainOptions = ["学习人数","总学习时长","人均学习时长"]; state.plainOptions = ["学习人数","总学习时长","人均学习时长"];
state.checkedList = ["学习人数","总学习时长"]; state.checkedList = ["学习人数","总学习时长"];
state.limitCheckedList = ["学习人数","总学习时长"];
} }
option.value.series[0].name = state.chartLabel.one; option.value.series[0].name = state.chartLabel.one;
option.value.series[1].name = state.chartLabel.two; option.value.series[1].name = state.chartLabel.two;
option.value.series[2].name = state.chartLabel.two; option.value.series[2].name = state.chartLabel.two;
if (state.towParmasn.dateType == 2) {
twoMonthChange(state.towParmasn.time);
} else if (state.towParmasn.dateType == 1) {
twoDatChange(state.towParmasn.day);
}
}; };
const onCalendarChange = (val) => { const onCalendarChange = (val) => {
dates.value = val; dates.value = val;
@@ -669,20 +677,22 @@ export default {
return tooEarly || tooLate; return tooEarly || tooLate;
}; };
const twoSelectChange = async (e) => { const twoSelectChange = async (e) => {
if (e == 1) { if (e == 2) {
twoMonthChange(state.towParmasn.time); twoMonthChange(state.towParmasn.time);
} else if (e == 0) { } else if (e == 1) {
twoDatChange(state.towParmasn.day); twoDatChange(state.towParmasn.day);
} }
}; };
// 获取图表2月份数据 // 获取图表2月份数据
const twoMonthChange = async (e) => { const twoMonthChange = async (e) => {
if (e?.length > 0) { console.log("twoMonthChange e:",e);
const monthEnd = dayjs(e[1]) // if (e?.length > 0) {
if (true) {
const monthEnd = dayjs(state.towParmasn.time[1])
.endOf("month") .endOf("month")
.format("YYYY-MM-DD 23:59:59"); .format("YYYY-MM-DD 23:59:59");
const res = await api.boeuStudyDataGetStudyStaisticsList({ const res = await api.boeuStudyDataGetStudyStaisticsList({
beginTime: dayjs(e[0]).format("YYYY-MM-01 00:00:01"), beginTime: dayjs(state.towParmasn.time[0]).format("YYYY-MM-01 00:00:01"),
endTime: monthEnd, endTime: monthEnd,
dateType: state.towParmasn.dateType, dateType: state.towParmasn.dateType,
type: state.towParmasn.type, type: state.towParmasn.type,
@@ -775,7 +785,9 @@ export default {
} }
}; };
const twoDatChange = async (e) => { const twoDatChange = async (e) => {
if (e?.length > 0) { console.log("twoDatChange e:",e);
// if (e?.length > 0) {
if (true) {
const dayStart = dayjs(e[0]) const dayStart = dayjs(e[0])
.startOf("day") .startOf("day")
.format("YYYY-MM-DD 00:00:01"); .format("YYYY-MM-DD 00:00:01");