update fto data
This commit is contained in:
parent
d9bfbf0d9a
commit
cddd23855c
@ -18,6 +18,9 @@ const getters = {
|
|||||||
defaultRoutes:state => state.permission.defaultRoutes,
|
defaultRoutes:state => state.permission.defaultRoutes,
|
||||||
sidebarRouters:state => state.permission.sidebarRouters,
|
sidebarRouters:state => state.permission.sidebarRouters,
|
||||||
// 数据字典
|
// 数据字典
|
||||||
dict_datas: state => state.dict.dictDatas
|
dict_datas: state => state.dict.dictDatas,
|
||||||
|
// 驾驶舱和首页
|
||||||
|
home: state => state.copilot.home,
|
||||||
|
copilot: state => state.copilot.copilot,
|
||||||
}
|
}
|
||||||
export default getters
|
export default getters
|
||||||
|
@ -20,38 +20,51 @@ import LeftChartBase from "./LeftChartBase.vue";
|
|||||||
export default {
|
export default {
|
||||||
name: "FtoChart",
|
name: "FtoChart",
|
||||||
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: {
|
computed: {
|
||||||
type: Array,
|
series() {
|
||||||
default: () => ["成都", "邯郸", "株洲", "瑞昌", "heels", "socks"],
|
const ftoInvest = this.$store.getters.home.ftoInvest;
|
||||||
},
|
console.log("FTO ==> ", ftoInvest);
|
||||||
series: {
|
|
||||||
type: Array,
|
if (!ftoInvest || !ftoInvest.current || !ftoInvest.previous) {
|
||||||
default: () => [
|
return [
|
||||||
{
|
{
|
||||||
name: "2023年",
|
name: "样例数据--2023年",
|
||||||
data: Array.from({ length: 7 }, () =>
|
data: Array.from({ length: 7 }, () =>
|
||||||
Math.floor(Math.random() * 1000)
|
Math.floor(Math.random() * 1000)
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "2024年",
|
name: "样例数据--2024年",
|
||||||
data: Array.from({ length: 7 }, () =>
|
data: Array.from({ length: 7 }, () =>
|
||||||
Math.floor(Math.random() * 1000)
|
Math.floor(Math.random() * 1000)
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
],
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
name: `${new Date().getFullYear() - 1}年`,
|
||||||
|
data: ftoInvest.previous,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: `${new Date().getFullYear()}年`,
|
||||||
|
data: ftoInvest.current,
|
||||||
|
},
|
||||||
|
];
|
||||||
},
|
},
|
||||||
mounted() {
|
|
||||||
console.log("FTO created...");
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
Reference in New Issue
Block a user