|
@@ -1,18 +1,14 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div class="market-container">
|
|
<div class="market-container">
|
|
|
<div class="market-title">
|
|
<div class="market-title">
|
|
|
- <i class="iconfont icon-enterprise"></i>
|
|
|
|
|
|
|
+ <img src="@/assets/images/shb.png" class="title-icon" />
|
|
|
市场拓展
|
|
市场拓展
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="chart-content">
|
|
|
|
|
- <div class="legend">
|
|
|
|
|
- <div class="legend-item">上月</div>
|
|
|
|
|
- <div class="legend-item">本月</div>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="chart-container">
|
|
|
|
|
- <div id="marketChart" class="chart"></div>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <div class="legend">
|
|
|
|
|
+ <div class="legend-item">上月</div>
|
|
|
|
|
+ <div class="legend-item">本月</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <div id="marketChart" class="chart"></div>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -38,7 +34,6 @@
|
|
|
lastMonthData: [-9, -9, -9, -9, -3, -12], // 上月数据
|
|
lastMonthData: [-9, -9, -9, -9, -3, -12], // 上月数据
|
|
|
thisMonthData: [9, 9, 1, 1, 9, 10], // 本月数据
|
|
thisMonthData: [9, 9, 1, 1, 9, 10], // 本月数据
|
|
|
},
|
|
},
|
|
|
- timer: null,
|
|
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
computed: {
|
|
computed: {
|
|
@@ -47,20 +42,12 @@
|
|
|
mounted() {
|
|
mounted() {
|
|
|
this.init()
|
|
this.init()
|
|
|
window.addEventListener("resize", this.handleResize)
|
|
window.addEventListener("resize", this.handleResize)
|
|
|
-
|
|
|
|
|
- // 设置定时刷新
|
|
|
|
|
- this.timer = setInterval(() => {
|
|
|
|
|
- this.loadData()
|
|
|
|
|
- }, 30000) // 每30秒刷新一次
|
|
|
|
|
},
|
|
},
|
|
|
beforeDestroy() {
|
|
beforeDestroy() {
|
|
|
if (this.chartInstance) {
|
|
if (this.chartInstance) {
|
|
|
this.chartInstance.dispose()
|
|
this.chartInstance.dispose()
|
|
|
}
|
|
}
|
|
|
window.removeEventListener("resize", this.handleResize)
|
|
window.removeEventListener("resize", this.handleResize)
|
|
|
- if (this.timer) {
|
|
|
|
|
- clearInterval(this.timer)
|
|
|
|
|
- }
|
|
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
// 初始化组件
|
|
// 初始化组件
|
|
@@ -91,7 +78,11 @@
|
|
|
let result = params[0].name + "<br/>"
|
|
let result = params[0].name + "<br/>"
|
|
|
params.forEach((item) => {
|
|
params.forEach((item) => {
|
|
|
result +=
|
|
result +=
|
|
|
- item.marker + item.seriesName + ": " + item.value + "<br/>"
|
|
|
|
|
|
|
+ item.marker +
|
|
|
|
|
+ item.seriesName +
|
|
|
|
|
+ ": " +
|
|
|
|
|
+ Math.abs(item.value) +
|
|
|
|
|
+ "<br/>"
|
|
|
})
|
|
})
|
|
|
return result
|
|
return result
|
|
|
},
|
|
},
|
|
@@ -112,18 +103,6 @@
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
show: false, // 隐藏x轴
|
|
show: false, // 隐藏x轴
|
|
|
- // axisLine: {
|
|
|
|
|
- // show: false,
|
|
|
|
|
- // },
|
|
|
|
|
- // axisTick: {
|
|
|
|
|
- // show: false,
|
|
|
|
|
- // },
|
|
|
|
|
- // axisLabel: {
|
|
|
|
|
- // show: false,
|
|
|
|
|
- // },
|
|
|
|
|
- // splitLine: {
|
|
|
|
|
- // show: false,
|
|
|
|
|
- // },
|
|
|
|
|
},
|
|
},
|
|
|
yAxis: [
|
|
yAxis: [
|
|
|
{
|
|
{
|
|
@@ -217,6 +196,7 @@
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
this.chartInstance.setOption(option)
|
|
this.chartInstance.setOption(option)
|
|
|
|
|
+ this.chartInstance.resize()
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
// 加载数据
|
|
// 加载数据
|
|
@@ -277,53 +257,36 @@
|
|
|
.market-container {
|
|
.market-container {
|
|
|
background: #0d1629;
|
|
background: #0d1629;
|
|
|
border-radius: 4px;
|
|
border-radius: 4px;
|
|
|
- border: 1px solid rgba(64, 158, 255, 0.2);
|
|
|
|
|
height: 100%;
|
|
height: 100%;
|
|
|
display: flex;
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
flex-direction: column;
|
|
|
|
|
+ background: var(--content-bg);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.market-title {
|
|
.market-title {
|
|
|
border-radius: 4px;
|
|
border-radius: 4px;
|
|
|
background: var(--title-bg);
|
|
background: var(--title-bg);
|
|
|
- padding: 20px;
|
|
|
|
|
|
|
+ padding: 4px 10px;
|
|
|
font-size: 18px;
|
|
font-size: 18px;
|
|
|
font-weight: 500;
|
|
font-weight: 500;
|
|
|
color: var(--title-primary);
|
|
color: var(--title-primary);
|
|
|
display: flex;
|
|
display: flex;
|
|
|
align-items: center;
|
|
align-items: center;
|
|
|
-
|
|
|
|
|
- .iconfont {
|
|
|
|
|
- margin-right: 8px;
|
|
|
|
|
- font-size: 20px;
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- .chart-content {
|
|
|
|
|
- margin: 20px;
|
|
|
|
|
- background: var(--title-bg);
|
|
|
|
|
- .legend {
|
|
|
|
|
- display: flex;
|
|
|
|
|
- justify-content: space-around;
|
|
|
|
|
- align-items: center;
|
|
|
|
|
- padding: 20px;
|
|
|
|
|
- margin: 0px 10px;
|
|
|
|
|
- font-size: 14px;
|
|
|
|
|
- font-weight: 500;
|
|
|
|
|
- color: #fff;
|
|
|
|
|
- border-bottom: 1px solid rgba(64, 158, 255, 0.2);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .chart-container {
|
|
|
|
|
- flex: 1;
|
|
|
|
|
- min-height: 0;
|
|
|
|
|
- position: relative;
|
|
|
|
|
|
|
+ .legend {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ justify-content: space-around;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ padding: 10px 20px;
|
|
|
|
|
+ font-size: 14px;
|
|
|
|
|
+ font-weight: 500;
|
|
|
|
|
+ color: #fff;
|
|
|
|
|
+ border-bottom: 1px solid rgba(64, 158, 255, 0.2);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.chart {
|
|
.chart {
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
height: 100%;
|
|
height: 100%;
|
|
|
- min-height: 400px;
|
|
|
|
|
|
|
+ background: var(--content-bg);
|
|
|
}
|
|
}
|
|
|
</style>
|
|
</style>
|