驾驶舱对接

This commit is contained in:
‘937886381’
2024-05-17 10:31:47 +08:00
parent 6f0c8503c6
commit 208af7b565
24 changed files with 676 additions and 393 deletions

View File

@@ -85,48 +85,25 @@ export default {
// }
// },
series() {
const { ftoInvest } = this.$store.getters.copilot.yield;
let dataList = null;
return this.$store.getters.copilot.energy.elecList;
// let dataList = null;
switch (this.period) {
case "日":
case "周":
dataList = ftoInvest?.current;
break;
default:
dataList = [];
dataList[0] = ftoInvest?.pervious;
dataList[1] = ftoInvest?.current;
}
// switch (this.period) {
// case "日":
// case "周":
// dataList = ftoInvest?.current;
// break;
// default:
// dataList = [];
// dataList[0] = ftoInvest?.pervious;
// dataList[1] = ftoInvest?.current;
// }
return getTemplate(this.period, dataList);
// return getTemplate(this.period, dataList);
},
},
methods: {},
};
function getTemplate(period, dataList) {
const year = new Date().getFullYear();
const month = new Date().getMonth() + 1;
return period == "日" || period == "周"
? [
{
name: period == "日" ? "昨日" : "本周",
data: dataList ?? [],
},
]
: [
{
name: period == "年" ? `${year - 1}` : `${year - 1}${month}`,
data: dataList ? dataList[0] : [],
},
{
name: period == "年" ? `${year}` : `${year}${month}`,
data: dataList ? dataList[1] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
},
];
}
</script>
<style scoped lang="scss">