update 芯片投入

This commit is contained in:
DESKTOP-FUDKNA8\znjsz 2024-04-18 14:49:49 +08:00
parent cddd23855c
commit 691f63438a
2 changed files with 39 additions and 24 deletions

View File

@ -20,34 +20,50 @@ import LeftChartBase from "./LeftChartBase.vue";
export default { export default {
name: "chip-investChart", name: "chip-investChart",
components: { LeftChartBase }, components: { LeftChartBase },
props: { data() {
legend: { const year = new Date().getFullYear();
type: Array, //
default: () => [ const cities = ["瑞昌", "邯郸", "株洲", "佳木斯", "成都", "凯盛", "蚌埠"];
{ label: "2023年", color: "#12f7f1" }, return {
{ label: "2024年", color: "#58adfa" }, legend: [
{ label: `${year - 1}`, color: "#12f7f1" },
{ label: `${year}`, color: "#58adfa" },
], ],
}, xAxis: cities,
xAxis: { };
type: Array, },
default: () => ["成都", "邯郸", "株洲", "瑞昌", "heels", "socks"], computed: {
}, series() {
series: { const chipInvest = this.$store.getters.home.chipInvest;
type: Array, console.log("FTO ==> ", chipInvest);
default: () => [
if (!chipInvest || !chipInvest.current || !chipInvest.previous) {
return [
{
name: "样例数据--2023年",
data: Array.from({ length: 7 }, () =>
Math.floor(Math.random() * 1000)
),
},
{
name: "样例数据--2024年",
data: Array.from({ length: 7 }, () =>
Math.floor(Math.random() * 1000)
),
},
];
}
return [
{ {
name: "2023年", name: `${new Date().getFullYear() - 1}`,
data: Array.from({ length: 7 }, () => data: chipInvest.previous,
Math.floor(Math.random() * 1000)
),
}, },
{ {
name: "2024年", name: `${new Date().getFullYear()}`,
data: Array.from({ length: 7 }, () => data: chipInvest.current,
Math.floor(Math.random() * 1000)
),
}, },
], ];
}, },
}, },
}; };

View File

@ -35,7 +35,6 @@ export default {
computed: { computed: {
series() { series() {
const ftoInvest = this.$store.getters.home.ftoInvest; const ftoInvest = this.$store.getters.home.ftoInvest;
console.log("FTO ==> ", ftoInvest);
if (!ftoInvest || !ftoInvest.current || !ftoInvest.previous) { if (!ftoInvest || !ftoInvest.current || !ftoInvest.previous) {
return [ return [