|
|
@ -87,15 +87,40 @@ export default {
|
|
|
|
get_day(day) {
|
|
|
|
get_day(day) {
|
|
|
|
let myDate = new Date(); //获取今天日期
|
|
|
|
let myDate = new Date(); //获取今天日期
|
|
|
|
myDate.setDate(myDate.getDate() - (day - 1)); //setDate() 方法用于设置一个月的某一天。
|
|
|
|
myDate.setDate(myDate.getDate() - (day - 1)); //setDate() 方法用于设置一个月的某一天。
|
|
|
|
|
|
|
|
let year = myDate.getFullYear(); // 年
|
|
|
|
|
|
|
|
let month = myDate.getMonth() + 1; // 月
|
|
|
|
|
|
|
|
if (month >= 1 && month <= 9) {
|
|
|
|
|
|
|
|
month = "0" + month;
|
|
|
|
|
|
|
|
}
|
|
|
|
let dateArray = [];
|
|
|
|
let dateArray = [];
|
|
|
|
let dateTemp;
|
|
|
|
let dateTemp;
|
|
|
|
let flag = 1;
|
|
|
|
let flag = 1;
|
|
|
|
for (let i = 1; i < day; i++) {
|
|
|
|
for (let i = 1; i < day; i++) {
|
|
|
|
dateTemp = myDate.getDate() + "日";
|
|
|
|
dateTemp = year + "-" + month + myDate.getDate();
|
|
|
|
dateArray.push(dateTemp);
|
|
|
|
dateArray.push(dateTemp);
|
|
|
|
myDate.setDate(myDate.getDate() + flag);
|
|
|
|
myDate.setDate(myDate.getDate() + flag);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
dateArray.push(myDate.getDate() + "日");
|
|
|
|
dateArray.push(year + "-" + month + myDate.getDate());
|
|
|
|
|
|
|
|
return dateArray;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
// 获取上月前7天数组
|
|
|
|
|
|
|
|
get_old_day(day) {
|
|
|
|
|
|
|
|
let myDate = new Date(); //获取今天日期
|
|
|
|
|
|
|
|
myDate.setDate(myDate.getDate() - (day - 1)); //setDate() 方法用于设置一个月的某一天。
|
|
|
|
|
|
|
|
let year = myDate.getFullYear(); // 年
|
|
|
|
|
|
|
|
let month = myDate.getMonth(); // 月
|
|
|
|
|
|
|
|
if (month >= 1 && month <= 9) {
|
|
|
|
|
|
|
|
month = "0" + month;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
let dateArray = [];
|
|
|
|
|
|
|
|
let dateTemp;
|
|
|
|
|
|
|
|
let flag = 1;
|
|
|
|
|
|
|
|
for (let i = 1; i < day; i++) {
|
|
|
|
|
|
|
|
dateTemp = year + "-" + month + myDate.getDate();
|
|
|
|
|
|
|
|
dateArray.push(dateTemp);
|
|
|
|
|
|
|
|
myDate.setDate(myDate.getDate() + flag);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
dateArray.push(year + "-" + month + myDate.getDate());
|
|
|
|
return dateArray;
|
|
|
|
return dateArray;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
init_chart() {
|
|
|
|
init_chart() {
|
|
|
@ -200,7 +225,7 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// prettier-ignore
|
|
|
|
// prettier-ignore
|
|
|
|
data: ['2015-1', '2015-2', '2015-3', '2015-4', '2015-5', '2015-6', '2015-7', '2015-8', '2015-9', '2015-10', '2015-11', '2015-12'],
|
|
|
|
data: this.get_old_day(7),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
],
|
|
|
|
yAxis: [
|
|
|
|
yAxis: [
|
|
|
@ -224,9 +249,7 @@ export default {
|
|
|
|
emphasis: {
|
|
|
|
emphasis: {
|
|
|
|
focus: "series",
|
|
|
|
focus: "series",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
data: [
|
|
|
|
data: [2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6],
|
|
|
|
2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6,
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
name: "今日出园区",
|
|
|
|
name: "今日出园区",
|
|
|
@ -236,7 +259,7 @@ export default {
|
|
|
|
emphasis: {
|
|
|
|
emphasis: {
|
|
|
|
focus: "series",
|
|
|
|
focus: "series",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
data: [2.6, 5.9, 9.0, 26, 27, 70.7, 175.6, ],
|
|
|
|
data: [2.6, 5.9, 9.0, 26, 27, 70.7, 175.6],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
name: "上月进园区",
|
|
|
|
name: "上月进园区",
|
|
|
@ -245,9 +268,7 @@ export default {
|
|
|
|
emphasis: {
|
|
|
|
emphasis: {
|
|
|
|
focus: "series",
|
|
|
|
focus: "series",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
data: [
|
|
|
|
data: [3.9, 5.9, 11.1, 18.7, 48.3, 69.2, 231.6],
|
|
|
|
3.9, 5.9, 11.1, 18.7, 48.3, 69.2, 231.6,
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
name: "上月出园区",
|
|
|
|
name: "上月出园区",
|
|
|
@ -256,7 +277,7 @@ export default {
|
|
|
|
emphasis: {
|
|
|
|
emphasis: {
|
|
|
|
focus: "series",
|
|
|
|
focus: "series",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
data: [3.9, 5.9, 22, 34, 48.3, 69.2, 123, ],
|
|
|
|
data: [3.9, 5.9, 22, 34, 48.3, 69.2, 123],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
],
|
|
|
|
};
|
|
|
|
};
|
|
|
|