|
|
|
@ -355,11 +355,11 @@ export default {
|
|
|
|
|
areaId: 1,
|
|
|
|
|
},
|
|
|
|
|
//将敏感和非敏感区分开来
|
|
|
|
|
positiveOpinion: [],
|
|
|
|
|
negativeOpinion: [],
|
|
|
|
|
positiveOpinion: [0,0,0,0,0,0,0],
|
|
|
|
|
negativeOpinion: [0,0,0,0,0,0,0],
|
|
|
|
|
allDate: [],
|
|
|
|
|
date: [],
|
|
|
|
|
newDate: [],
|
|
|
|
|
newDate: [this.$moment(this.$moment().subtract(7, "d")).format("MM-DD"),this.$moment(this.$moment().subtract(6, "d")).format("MM-DD"),this.$moment(this.$moment().subtract(5, "d")).format("MM-DD"),this.$moment(this.$moment().subtract(4, "d")).format("MM-DD"),this.$moment(this.$moment().subtract(3, "d")).format("MM-DD"),this.$moment(this.$moment().subtract(2, "d")).format("MM-DD"),this.$moment(this.$moment().subtract(1, "d")).format("MM-DD"),],
|
|
|
|
|
dtsx: {},
|
|
|
|
|
//========
|
|
|
|
|
listTotal: 0,
|
|
|
|
@ -444,20 +444,28 @@ export default {
|
|
|
|
|
params: {},
|
|
|
|
|
};
|
|
|
|
|
let date = this.$moment().subtract(7, "d");
|
|
|
|
|
let datetwo = this.$moment().subtract(1, "d");
|
|
|
|
|
from.params.beginDateTime = this.$moment(date).format("YYYY-MM-DD");
|
|
|
|
|
from.params.endDateTime = this.$moment().format("YYYY-MM-DD");
|
|
|
|
|
from.params.endDateTime = this.$moment(datetwo).format("YYYY-MM-DD");
|
|
|
|
|
listYqzs(from).then((res) => {
|
|
|
|
|
this.allDate = res.rows;
|
|
|
|
|
//已经排序过的数组
|
|
|
|
|
this.allDate.sort(function (a, b) {
|
|
|
|
|
return new Date(a.dateTime) - new Date(b.dateTime);
|
|
|
|
|
});
|
|
|
|
|
this.allDate.forEach((value) => {
|
|
|
|
|
//把日期存储起来
|
|
|
|
|
this.newDate.push(this.$moment(value.dateTime).format("MM-DD"));
|
|
|
|
|
this.positiveOpinion.push(value.count1);
|
|
|
|
|
this.negativeOpinion.push(value.count2);
|
|
|
|
|
});
|
|
|
|
|
// this.allDate.sort(function (a, b) {
|
|
|
|
|
// return new Date(a.dateTime) - new Date(b.dateTime);
|
|
|
|
|
// });
|
|
|
|
|
this.allDate.forEach((value)=>{
|
|
|
|
|
const index = this.newDate.indexOf(this.$moment(value.dateTime).format("MM-DD"));
|
|
|
|
|
if (index !== -1) {
|
|
|
|
|
this.positiveOpinion[index] = value.count1; // 将 count1 赋值给对应的下标
|
|
|
|
|
this.negativeOpinion[index] = value.count2; // 将 count2 赋值给对应的下标
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
// this.allDate.forEach((value) => {
|
|
|
|
|
// //把日期存储起来
|
|
|
|
|
// this.newDate.push(this.$moment(value.dateTime).format("MM-DD"));
|
|
|
|
|
// this.positiveOpinion.push(value.count1);
|
|
|
|
|
// this.negativeOpinion.push(value.count2);
|
|
|
|
|
// });
|
|
|
|
|
this.lineBox();
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|