日期格式

main
许宏杰 1 month ago
parent e41cab4f24
commit fc5763a11f

@ -360,13 +360,13 @@ export default {
allDate: [], allDate: [],
date: [], date: [],
newDate: [ newDate: [
this.$moment(this.$moment().subtract(7, "d")).format("MM.DD"), this.$moment(this.$moment().subtract(7, "d")).format("M.DD"),
this.$moment(this.$moment().subtract(6, "d")).format("MM.DD"), this.$moment(this.$moment().subtract(6, "d")).format("M.DD"),
this.$moment(this.$moment().subtract(5, "d")).format("MM.DD"), this.$moment(this.$moment().subtract(5, "d")).format("M.DD"),
this.$moment(this.$moment().subtract(4, "d")).format("MM.DD"), this.$moment(this.$moment().subtract(4, "d")).format("M.DD"),
this.$moment(this.$moment().subtract(3, "d")).format("MM.DD"), this.$moment(this.$moment().subtract(3, "d")).format("M.DD"),
this.$moment(this.$moment().subtract(2, "d")).format("MM.DD"), this.$moment(this.$moment().subtract(2, "d")).format("M.DD"),
this.$moment(this.$moment().subtract(1, "d")).format("MM.DD"), this.$moment(this.$moment().subtract(1, "d")).format("M.DD"),
], ],
dtsx: {}, dtsx: {},
//======== //========
@ -464,7 +464,7 @@ export default {
// }); // });
this.allDate.forEach((value) => { this.allDate.forEach((value) => {
const index = this.newDate.indexOf( const index = this.newDate.indexOf(
this.$moment(value.dateTime).format("MM.DD") this.$moment(value.dateTime).format("M.DD")
); );
if (index !== -1) { if (index !== -1) {
this.positiveOpinion[index] = value.count1; // count1 this.positiveOpinion[index] = value.count1; // count1

@ -53,7 +53,6 @@ export default {
// name: "", // name: "",
// value: 0, // value: 0,
// }, // },
// { // {
// name: "", // name: "",
// value: 0, // value: 0,
@ -86,7 +85,7 @@ export default {
methods: { methods: {
getData() { getData() {
listMtlx().then((res) => { listMtlx().then((res) => {
let arr = [] let arr = [];
res.rows.forEach((value, index) => { res.rows.forEach((value, index) => {
let obj = {}; let obj = {};
obj.name = value.name; obj.name = value.name;
@ -99,7 +98,9 @@ export default {
// }); // });
}); });
// console.log(this.piedata); // console.log(this.piedata);
arr = arr.sort((a, b) => a.value < b.value ? 1 : a.value > b.value ? -1 : 0) arr = arr.sort((a, b) =>
a.value < b.value ? 1 : a.value > b.value ? -1 : 0
);
this.piedata = arr; this.piedata = arr;
this.pieBox(); this.pieBox();
}); });
@ -198,7 +199,7 @@ export default {
}; };
</script> </script>
<style lang='scss' scoped> <style lang="scss" scoped>
#info { #info {
position: relative; position: relative;
} }

Loading…
Cancel
Save