done home

This commit is contained in:
DESKTOP-FUDKNA8\znjsz 2024-04-18 17:00:05 +08:00
parent 53ec6dacd5
commit ceb411180f
4 changed files with 53 additions and 21 deletions

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;
if (!ftoInvest || !ftoInvest.current || !ftoInvest.previous) { if (!ftoInvest || !ftoInvest.current || !ftoInvest.previous) {
return [ return [
{ {

View File

@ -56,6 +56,7 @@ export default {
data() { data() {
return { return {
isFullscreen: false, isFullscreen: false,
actualOptions: null,
options: { options: {
grid: { grid: {
left: "3%", left: "3%",
@ -107,7 +108,7 @@ export default {
}, },
series: [ series: [
{ {
name: this.series[0].name, name: '', // this.series[0].name,
type: "bar", type: "bar",
barWidth: 12, barWidth: 12,
itemStyle: { itemStyle: {
@ -139,10 +140,10 @@ export default {
global: false, // false global: false, // false
}, },
}, },
data: this.series[0].data, data: [], // this.series[0].data,
}, },
{ {
name: this.series[1].name, name: '', // this.series[1].name,
type: "bar", type: "bar",
barWidth: 12, barWidth: 12,
// tooltip: { // tooltip: {
@ -171,7 +172,7 @@ export default {
global: false, // false global: false, // false
}, },
}, },
data: this.series[1].data, data: [], // this.series[1].data,
}, },
], ],
}, },
@ -180,16 +181,30 @@ export default {
watch: { watch: {
/** 全屏状态切换时,对柱子粗细和字体大小进行相应调整 */ /** 全屏状态切换时,对柱子粗细和字体大小进行相应调整 */
isFullscreen(val) { isFullscreen(val) {
this.options.series.map((item) => { this.actualOptions.series.map((item) => {
item.barWidth = val ? 18 : 12; item.barWidth = val ? 18 : 12;
}); });
this.options.xAxis.axisLabel.fontSize = val ? 18 : 12; this.actualOptions.xAxis.axisLabel.fontSize = val ? 18 : 12;
this.options.yAxis.axisLabel.fontSize = val ? 18 : 12; this.actualOptions.yAxis.axisLabel.fontSize = val ? 18 : 12;
this.options.yAxis.nameTextStyle.fontSize = val ? 18 : 12; this.actualOptions.yAxis.nameTextStyle.fontSize = val ? 18 : 12;
this.initOptions(this.options); this.initOptions(this.actualOptions);
},
series(val) {
if (!val) {
this.initOptions(this.options);
return;
}
const actualOptions = JSON.parse(JSON.stringify(this.options));
actualOptions.series[0].data = val[0].data;
actualOptions.series[0].name = val[0].name;
actualOptions.series[1].data = val[1].data;
actualOptions.series[1].name = val[1].name;
this.actualOptions = actualOptions;
this.initOptions(actualOptions);
}, },
}, },
mounted() { mounted() {
this.actualOptions = this.options;
this.initOptions(this.options); this.initOptions(this.options);
if (screenfull.isEnabled) { if (screenfull.isEnabled) {

View File

@ -107,7 +107,7 @@ export default {
}, },
series: [ series: [
{ {
name: "2024年目标值", name: "", // "2024",
type: "line", type: "line",
lineStyle: { lineStyle: {
color: "#f3c000", color: "#f3c000",
@ -139,10 +139,10 @@ export default {
global: false, // false global: false, // false
}, },
}, },
data: this.series[0].data, data: [], // this.series[0].data,
}, },
{ {
name: "2023年", name: "", // "2023",
type: "bar", type: "bar",
barWidth: 12, barWidth: 12,
itemStyle: { itemStyle: {
@ -174,10 +174,10 @@ export default {
global: false, // false global: false, // false
}, },
}, },
data: this.series[1].data, data: [], // this.series[1].data,
}, },
{ {
name: "2024年", name: "", // "2024",
type: "bar", type: "bar",
barWidth: 12, barWidth: 12,
// tooltip: { // tooltip: {
@ -206,25 +206,42 @@ export default {
global: false, // false global: false, // false
}, },
}, },
data: this.series[2].data, data: [], // this.series[2].data,
}, },
], ],
}, },
actualOptions: null,
}; };
}, },
watch: { watch: {
/** 全屏状态切换时,对柱子粗细和字体大小进行相应调整 */ /** 全屏状态切换时,对柱子粗细和字体大小进行相应调整 */
isFullscreen(val) { isFullscreen(val) {
this.options.series.map((item) => { this.actualOptions.series.map((item) => {
item.barWidth = val ? 18 : 12; item.barWidth = val ? 18 : 12;
}); });
this.options.xAxis.axisLabel.fontSize = val ? 18 : 12; this.actualOptions.xAxis.axisLabel.fontSize = val ? 18 : 12;
this.options.yAxis.axisLabel.fontSize = val ? 18 : 12; this.actualOptions.yAxis.axisLabel.fontSize = val ? 18 : 12;
this.options.yAxis.nameTextStyle.fontSize = val ? 18 : 12; this.actualOptions.yAxis.nameTextStyle.fontSize = val ? 18 : 12;
this.initOptions(this.options); this.initOptions(this.actualOptions);
},
series(val) {
if (!val) {
this.initOptions(this.options);
return;
}
const actualOptions = JSON.parse(JSON.stringify(this.options));
actualOptions.series[0].data = val[0].data;
actualOptions.series[0].name = val[0].name;
actualOptions.series[1].data = val[1].data;
actualOptions.series[1].name = val[1].name;
actualOptions.series[2].data = val[2].data;
actualOptions.series[2].name = val[2].name;
this.actualOptions = actualOptions;
this.initOptions(actualOptions);
}, },
}, },
mounted() { mounted() {
this.actualOptions = this.options;
this.initOptions(this.options); this.initOptions(this.options);
if (screenfull.isEnabled) { if (screenfull.isEnabled) {

View File

@ -9,6 +9,7 @@
<div class="dashboard-container"> <div class="dashboard-container">
<!-- refresh btn --> <!-- refresh btn -->
<button <button
v-if="0"
style="appearance: none; outline: none; border: none; background: none; color:#fff; cursor: pointer; position: absolute; top: 8px; right: 8px" style="appearance: none; outline: none; border: none; background: none; color:#fff; cursor: pointer; position: absolute; top: 8px; right: 8px"
@click="$emit('refresh')" @click="$emit('refresh')"
> >