This commit is contained in:
shijingjing
2022-07-18 10:55:29 +08:00
parent 74466bf775
commit 1f729bf860
3 changed files with 243 additions and 139 deletions

View File

@@ -198,20 +198,38 @@
<div class="customPop">
<div class="startTime">
<div>开始时间:</div>
<div style="display: flex; justify-content: space-between;">
<u-input v-model="startTime" placeholder="请选择开始时间" disabled @click="showStart = true"/>
<div style="display: flex; justify-content: space-between">
<u-input
v-model="startTime"
placeholder="请选择开始时间"
disabled
@click="showStart = true"
/>
<u-icon name="arrow-right"></u-icon>
</div>
</div>
<div class="endTime">
<div>结束时间:</div>
<div style="display: flex; justify-content: space-between;">
<u-input v-model="endTime" placeholder="请选择结束时间" disabled @click="showEnd = true" />
<div style="display: flex; justify-content: space-between">
<u-input
v-model="endTime"
placeholder="请选择结束时间"
disabled
@click="showEnd = true"
/>
<u-icon name="arrow-right"></u-icon>
</div>
</div>
<u-picker mode="time" v-model="showStart" @confirm="confirmStart"></u-picker>
<u-picker mode="time" v-model="showEnd" @confirm="confirmEnd"></u-picker>
<u-picker
mode="time"
v-model="showStart"
@confirm="confirmStart"
></u-picker>
<u-picker
mode="time"
v-model="showEnd"
@confirm="confirmEnd"
></u-picker>
<div class="timeBtn" @click="handleTime">确定</div>
</div>
</u-popup>
@@ -271,7 +289,6 @@ export default {
this.getNowDate();
},
mounted() {
// this.getBrokenDate();
this.getBrokenEcharts1();
this.getBrokenEcharts2();
this.getBrokenEcharts3();
@@ -283,8 +300,8 @@ export default {
checkTime(index) {
if (index == 3) {
this.timeSelect = index;
this.customShow = true;
this.customShow = true;
this.showStart = false;
this.showEnd = false;
} else {
@@ -298,34 +315,35 @@ export default {
// 重置
reset() {
this.timeType = 0;
this.startTime = "";
this.endTime = "";
this.timeSelect = 0;
this.start = "";
this.end = "";
this.departId = "";
},
selectConfirm() {
if (this.timeSelect == 3) {
this.timeType = this.timeSelect;
this.detailType = this.timeSelect;
this.start = this.startTime;
this.end = this.endTime;
this.getBrokenDate();
} else {
this.timeType = this.timeSelect;
this.detailType = this.timeSelect;
this.getBrokenDate();
}
this.filterShow = false;
},
confirmStart(val) {
this.startTime = val.year + '-' + val.month + '-' + val.day
this.startTime = val.year + "-" + val.month + "-" + val.day;
},
confirmEnd(val) {
this.endTime = val.year + '-' + val.month + '-' + val.day
this.endTime = val.year + "-" + val.month + "-" + val.day;
},
handleTime() {
this.start = this.startTime
this.end = this.endTime
this.start = this.startTime;
this.end = this.endTime;
this.customShow = false;
},
@@ -341,10 +359,8 @@ export default {
params: {},
})
.then((res) => {
{
if (res?.data) {
this.calendarList = res.data;
}
if (res?.data) {
this.calendarList = res.data;
}
});
},
@@ -363,18 +379,37 @@ export default {
.then((res) => {
if (res?.data) {
if (this.timeType == 0) {
this.resX = res.data.trend.map((e) =>e.ymd.substring(5, 7) + "月" + e.ymd.substring(8, 10) + "日");
this.resX = res.data.trend.map(
(e) =>
e.ymd.substring(5, 7) + "月" + e.ymd.substring(8, 10) + "日"
);
} else if (this.timeType == 1) {
this.resX = res.data.trend.map((e) =>e.ymd.substring(5, 7) + "月" + e.ymd.substring(8, 10) + "日");
this.resX = res.data.trend.map(
(e) =>
e.ymd.substring(5, 7) + "月" + e.ymd.substring(8, 10) + "日"
);
} else if (this.timeType == 2) {
this.resX = res.data.trend.map((e) =>e.ymd.substring(0, 4) + "年" + e.ymd.substring(5, 7) + "月");
this.resX = res.data.trend.map(
(e) =>
e.ymd.substring(0, 4) + "年" + e.ymd.substring(5, 7) + "月"
);
}
this.resY = res.data.trend.map((e) => e.receiveCount);
this.peopleNum = this.resY.reduce((accumulator, currentValue)=>{ return accumulator + currentValue})
this.peopleNum = this.resY.reduce((accumulator, currentValue) => {
return accumulator + currentValue;
});
this.res2Y = res.data.trend.map((e) => e.executeCount);
this.sendNum = this.res2Y.reduce((accumulator, currentValue)=>{ return accumulator + currentValue})
this.sendNum = this.res2Y.reduce((accumulator, currentValue) => {
return accumulator + currentValue;
});
this.res3Y = res.data.trend.map((e) => e.createCount);
this.predictNum = this.res3Y.reduce((accumulator, currentValue)=>{ return accumulator + currentValue})
this.predictNum = this.res3Y.reduce((accumulator, currentValue) => {
return accumulator + currentValue;
});
this.getBrokenEcharts1();
this.getBrokenEcharts2();
this.getBrokenEcharts3();
this.getColumnarEcharts();
}
});
},
@@ -382,8 +417,6 @@ export default {
getBrokenEcharts1() {
let dataX = this.resX;
let dataY1 = this.resY;
console.log(dataX);
console.log(dataY1);
this.brokenEcharts1 = echarts.init(
document.getElementById("brokenEcharts1")
);
@@ -414,7 +447,7 @@ export default {
axisLine: {
show: false,
},
data: dataX,
data: this.resX,
},
yAxis: {
type: "value",