驾驶舱对接
This commit is contained in:
@@ -1,3 +1,11 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2024-05-14 08:48:34
|
||||
* @LastEditTime: 2024-05-17 09:42:41
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
|
||||
<!--
|
||||
filename: NatGas.vue
|
||||
author: liubin
|
||||
@@ -30,81 +38,37 @@ export default {
|
||||
// 城市数组的顺序必须是固定的
|
||||
const cities = ["瑞昌", "邯郸", "株洲", "佳木斯", "成都", "凯盛", "蚌埠"];
|
||||
return {
|
||||
// series: [],
|
||||
xAxis: cities,
|
||||
};
|
||||
},
|
||||
// watch: {
|
||||
// period() {
|
||||
// this.series = this.$store.getters.copilot.energy.stockDOData;
|
||||
// }
|
||||
// },
|
||||
computed: {
|
||||
// legend() {
|
||||
// switch (this.period) {
|
||||
// case "日":
|
||||
// return [{ label: "昨日", color: "#12f7f1" }];
|
||||
// case "周":
|
||||
// return [{ label: "本周", color: "#12f7f1" }];
|
||||
// case "月": {
|
||||
// const year = new Date().getFullYear();
|
||||
// const month = new Date().getMonth() + 1;
|
||||
// return [
|
||||
// { label: `${year - 1}年${month}月`, color: "#12f7f1" },
|
||||
// { label: `${year}年${month}月`, color: "#58adfa" },
|
||||
// ];
|
||||
// }
|
||||
// case "年": {
|
||||
// const year = new Date().getFullYear();
|
||||
// return [
|
||||
// { label: `${year - 1}年`, color: "#12f7f1" },
|
||||
// { label: `${year}年`, color: "#58adfa" },
|
||||
// ];
|
||||
// }
|
||||
// default:
|
||||
// return [
|
||||
// { label: `${year - 1}年`, color: "#12f7f1" },
|
||||
// { label: `${year}年`, color: "#58adfa" },
|
||||
// ];
|
||||
// }
|
||||
// },
|
||||
series() {
|
||||
const { ftoInvest } = this.$store.getters.copilot.yield;
|
||||
let dataList = null;
|
||||
console.log('this.$store.getters.copilot.energy.gasList', this.$store.getters.copilot.energy.gasList);
|
||||
return this.$store.getters.copilot.energy.gasList;
|
||||
// let dataList = null;
|
||||
// let dataList = gasList
|
||||
// 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 gasList
|
||||
},
|
||||
},
|
||||
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">
|
||||
|
||||
Reference in New Issue
Block a user