diff --git a/src/views/privateOrder/ecosphere/components/componentRight.vue b/src/views/privateOrder/ecosphere/components/componentRight.vue index 2b40eac..a6bbfad 100644 --- a/src/views/privateOrder/ecosphere/components/componentRight.vue +++ b/src/views/privateOrder/ecosphere/components/componentRight.vue @@ -181,14 +181,15 @@ import { download } from "@/utils/safesoft"; import vueSeamlessScroll from "vue-seamless-scroll"; import image from "../../../../assets/ecosphere/饼图标注.png"; import ModuleTitle from "../../common/ModuleTitle.vue"; +const moment = require("moment"); export default { components: { vueSeamlessScroll, ModuleTitle, }, data() { - var ndate = new Date(); - var nmonth = ndate.getMonth(); + var nmonth = moment().month() + 1; + console.log(nmonth, "sssss"); return { imgList: [ { url: require("@/assets/ecosphere/清朗专项行动图/1-1.png") }, @@ -209,107 +210,107 @@ export default { { title: "处理有害信息数量(条)", data: [ - { - name: nmonth + "月", - num: 0, - }, - { - name: nmonth - 1 + "月", - num: 0, - }, - { - name: nmonth - 2 + "月", - num: 0, - }, - { - name: nmonth - 3 + "月", - num: 0, - }, - { - name: nmonth - 4 + "月", - num: 0, - }, - { - name: nmonth - 5 + "月", - num: 0, - }, // { - // name: '8月', - // num: 0 + // name: nmonth + "月", + // num: 0, // }, // { - // name: '7月', - // num: 0 + // name: nmonth - 1 + "月", + // num: 0, // }, // { - // name: '6月', - // num: 0 + // name: nmonth - 2 + "月", + // num: 0, // }, // { - // name: '5月', - // num: 0 + // name: nmonth - 3 + "月", + // num: 0, // }, // { - // name: '4月', - // num: 0 + // name: nmonth - 4 + "月", + // num: 0, // }, // { - // name: '3月', - // num: 0 - // } + // name: nmonth - 5 + "月", + // num: 0, + // }, + // // { + // // name: '8月', + // // num: 0 + // // }, + // // { + // // name: '7月', + // // num: 0 + // // }, + // // { + // // name: '6月', + // // num: 0 + // // }, + // // { + // // name: '5月', + // // num: 0 + // // }, + // // { + // // name: '4月', + // // num: 0 + // // }, + // // { + // // name: '3月', + // // num: 0 + // // } ], }, { title: "关闭直播平台违规账号(个)", data: [ - { - name: nmonth + "月", - num: 0, - }, - { - name: nmonth - 1 + "月", - num: 0, - }, - { - name: nmonth - 2 + "月", - num: 0, - }, - { - name: nmonth - 3 + "月", - num: 0, - }, - { - name: nmonth - 4 + "月", - num: 0, - }, - { - name: nmonth - 5 + "月", - num: 0, - }, // { - // name: '8月', - // num: 0 + // name: nmonth + "月", + // num: 0, // }, // { - // name: '7月', - // num: 0 + // name: nmonth - 1 + "月", + // num: 0, // }, // { - // name: '6月', - // num: 0 + // name: nmonth - 2 + "月", + // num: 0, // }, // { - // name: '5月', - // num: 0 + // name: nmonth - 3 + "月", + // num: 0, // }, // { - // name: '4月', - // num: 0 + // name: nmonth - 4 + "月", + // num: 0, // }, // { - // name: '3月', - // num: 0 - // } + // name: nmonth - 5 + "月", + // num: 0, + // }, + // // { + // // name: '8月', + // // num: 0 + // // }, + // // { + // // name: '7月', + // // num: 0 + // // }, + // // { + // // name: '6月', + // // num: 0 + // // }, + // // { + // // name: '5月', + // // num: 0 + // // }, + // // { + // // name: '4月', + // // num: 0 + // // }, + // // { + // // name: '3月', + // // num: 0 + // // } ], }, ], @@ -402,21 +403,24 @@ export default { return { arr1, arr2 }; }) .then((res) => { - // console.log(res,'res') - this.qlzfDataStatistics[1].data.map((item) => { - res.arr2.map((arr) => { - if (item.name == arr.name) { - item.num = arr.num; - } - }); - }); - this.qlzfDataStatistics[0].data.map((item) => { - res.arr1.map((arr) => { - if (item.name == arr.name) { - item.num = arr.num; - } - }); - }); + this.qlzfDataStatistics[1].data = res.arr2; + this.qlzfDataStatistics[0].data = res.arr1; + + // this.qlzfDataStatistics[1].data.map((item) => { + // res.arr2.map((arr) => { + // if (item.name == arr.name) { + // item.num = arr.num; + // } + // }); + // }); + // this.qlzfDataStatistics[0].data.map((item) => { + // res.arr1.map((arr) => { + // if (item.name == arr.name) { + // item.num = arr.num; + // } + // }); + // }); + console.log("res", res); }); // listQlzxxdsjtj({isStatus:1}).then(res=>{ // let data = res.rows || [] @@ -881,7 +885,7 @@ export default { margin-left: 15px; display: flex; flex-direction: column; - justify-content: space-between; + // justify-content: space-between; .left-item { position: relative; left: 70px; @@ -924,7 +928,7 @@ export default { margin-top: 20px; display: flex; flex-direction: column; - justify-content: space-between; + // justify-content: space-between; .right-item { position: relative; left: 75px; diff --git a/src/views/privateOrder/sentiment/components/componentLeft.vue b/src/views/privateOrder/sentiment/components/componentLeft.vue index 3710466..9a2873a 100644 --- a/src/views/privateOrder/sentiment/components/componentLeft.vue +++ b/src/views/privateOrder/sentiment/components/componentLeft.vue @@ -360,13 +360,13 @@ export default { allDate: [], date: [], 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"), + 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: {}, //======== @@ -463,14 +463,13 @@ export default { // 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.newDate[index] = value.dateTime; - this.positiveOpinion[index] = value.count1; // 将 count1 赋值给对应的下标 - this.negativeOpinion[index] = value.count2; // 将 count2 赋值给对应的下标 - // } + 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) => { // //把日期存储起来