|
@@ -31,25 +31,20 @@
|
|
<span style="color: #6d5dec">{{ x2Reverse[index] }}</span>
|
|
<span style="color: #6d5dec">{{ x2Reverse[index] }}</span>
|
|
<span style="color: #0060e3">{{ x3Reverse[index] }}</span>
|
|
<span style="color: #0060e3">{{ x3Reverse[index] }}</span>
|
|
</div>
|
|
</div>
|
|
- <!-- <div class="right-item" v-for="item in yData" :key="item">
|
|
|
|
- <span style="color: #008fcb">{{ xData.x1[getIndex(item)] }}</span>
|
|
|
|
- <span style="color: #6d5dec">{{ xData.x2[getIndex(item)] }}</span>
|
|
|
|
- <span style="color: #0060e3">{{ xData.x3[getIndex(item)] }}</span>
|
|
|
|
- </div> -->
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import { getCountySituation } from "./api";
|
|
|
|
-import colors from "./colors";
|
|
|
|
|
|
+import { getCountySituation } from './api';
|
|
|
|
+import colors from './colors';
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
analyseType: 0,
|
|
analyseType: 0,
|
|
year: 2024,
|
|
year: 2024,
|
|
- yData: ["恩阳区", "巴州区", "平昌县", "南江县", "通江县"],
|
|
|
|
|
|
+ yData: ['恩阳区', '巴州区', '平昌县', '南江县', '通江县'],
|
|
xData: {
|
|
xData: {
|
|
x1: [20, 30, 20, 30, 20],
|
|
x1: [20, 30, 20, 30, 20],
|
|
x2: [15, 35, 20, 15, 15],
|
|
x2: [15, 35, 20, 15, 15],
|
|
@@ -59,13 +54,13 @@ export default {
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
x1Reverse() {
|
|
x1Reverse() {
|
|
- return this.xData.x1.reverse();
|
|
|
|
|
|
+ return this.xData.x1.slice().reverse();
|
|
},
|
|
},
|
|
x2Reverse() {
|
|
x2Reverse() {
|
|
- return this.xData.x2.reverse();
|
|
|
|
|
|
+ return this.xData.x2.slice().reverse();
|
|
},
|
|
},
|
|
x3Reverse() {
|
|
x3Reverse() {
|
|
- return this.xData.x3.reverse();
|
|
|
|
|
|
+ return this.xData.x3.slice().reverse();
|
|
},
|
|
},
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
@@ -87,35 +82,35 @@ export default {
|
|
.then((res) => {
|
|
.then((res) => {
|
|
const { code, result } = res.data;
|
|
const { code, result } = res.data;
|
|
if (code === 200) {
|
|
if (code === 200) {
|
|
- console.log(res, "先付");
|
|
|
|
|
|
+ console.log(res, '先付');
|
|
this.yData = result.xaxisData;
|
|
this.yData = result.xaxisData;
|
|
- this.xData.x1 = result.yaxisData["已办"];
|
|
|
|
- this.xData.x2 = result.yaxisData["待办"];
|
|
|
|
- this.xData.x3 = result.yaxisData["超期"];
|
|
|
|
|
|
+ this.xData.x1 = result.yaxisData['已办'];
|
|
|
|
+ this.xData.x2 = result.yaxisData['待办'];
|
|
|
|
+ this.xData.x3 = result.yaxisData['超期'];
|
|
this.initChart();
|
|
this.initChart();
|
|
}
|
|
}
|
|
});
|
|
});
|
|
},
|
|
},
|
|
initChart() {
|
|
initChart() {
|
|
- console.log("执行init");
|
|
|
|
|
|
+ console.log('执行init');
|
|
this.myChart = this.$echarts.init(
|
|
this.myChart = this.$echarts.init(
|
|
- document.getElementById("countySituation")
|
|
|
|
|
|
+ document.getElementById('countySituation')
|
|
);
|
|
);
|
|
const option = {
|
|
const option = {
|
|
grid: {
|
|
grid: {
|
|
- top: "15%",
|
|
|
|
- bottom: "15%",
|
|
|
|
|
|
+ top: '15%',
|
|
|
|
+ bottom: '15%',
|
|
},
|
|
},
|
|
legend: {
|
|
legend: {
|
|
- data: ["已办", "待办", "超期"],
|
|
|
|
- top: "5%",
|
|
|
|
- right: "5%",
|
|
|
|
|
|
+ data: ['已办', '待办', '超期'],
|
|
|
|
+ top: '5%',
|
|
|
|
+ right: '5%',
|
|
textStyle: {
|
|
textStyle: {
|
|
- color: "#fff",
|
|
|
|
|
|
+ color: '#fff',
|
|
},
|
|
},
|
|
},
|
|
},
|
|
xAxis: {
|
|
xAxis: {
|
|
- type: "value",
|
|
|
|
|
|
+ type: 'value',
|
|
// 网格线
|
|
// 网格线
|
|
splitLine: {
|
|
splitLine: {
|
|
show: false,
|
|
show: false,
|
|
@@ -134,7 +129,7 @@ export default {
|
|
},
|
|
},
|
|
yAxis: [
|
|
yAxis: [
|
|
{
|
|
{
|
|
- type: "category",
|
|
|
|
|
|
+ type: 'category',
|
|
data: this.yData,
|
|
data: this.yData,
|
|
// 坐标轴线
|
|
// 坐标轴线
|
|
axisLine: {
|
|
axisLine: {
|
|
@@ -154,10 +149,10 @@ export default {
|
|
],
|
|
],
|
|
series: [
|
|
series: [
|
|
{
|
|
{
|
|
- name: "已办",
|
|
|
|
- type: "bar",
|
|
|
|
|
|
+ name: '已办',
|
|
|
|
+ type: 'bar',
|
|
data: this.xData.x1,
|
|
data: this.xData.x1,
|
|
- barWidth: "15%",
|
|
|
|
|
|
+ barWidth: '15%',
|
|
// label: {
|
|
// label: {
|
|
// show: true,
|
|
// show: true,
|
|
// position: "top",
|
|
// position: "top",
|
|
@@ -166,10 +161,10 @@ export default {
|
|
itemStyle: { color: colors.barColor1 },
|
|
itemStyle: { color: colors.barColor1 },
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- name: "待办",
|
|
|
|
- type: "bar",
|
|
|
|
|
|
+ name: '待办',
|
|
|
|
+ type: 'bar',
|
|
data: this.xData.x2,
|
|
data: this.xData.x2,
|
|
- barWidth: "15%",
|
|
|
|
|
|
+ barWidth: '15%',
|
|
// label: {
|
|
// label: {
|
|
// show: true,
|
|
// show: true,
|
|
// position: "top",
|
|
// position: "top",
|
|
@@ -178,18 +173,18 @@ export default {
|
|
itemStyle: { color: colors.barColor2 },
|
|
itemStyle: { color: colors.barColor2 },
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- name: "超期",
|
|
|
|
- type: "bar",
|
|
|
|
|
|
+ name: '超期',
|
|
|
|
+ type: 'bar',
|
|
data: this.xData.x3,
|
|
data: this.xData.x3,
|
|
- barWidth: "15%",
|
|
|
|
|
|
+ barWidth: '15%',
|
|
// label: {
|
|
// label: {
|
|
// show: true,
|
|
// show: true,
|
|
// position: "top",
|
|
// position: "top",
|
|
// color: colors.barTopTextColor,
|
|
// color: colors.barTopTextColor,
|
|
// },
|
|
// },
|
|
itemStyle: { color: colors.barColor3 },
|
|
itemStyle: { color: colors.barColor3 },
|
|
- barCategoryGap: "20%",
|
|
|
|
- barGap: "100%",
|
|
|
|
|
|
+ barCategoryGap: '20%',
|
|
|
|
+ barGap: '100%',
|
|
},
|
|
},
|
|
],
|
|
],
|
|
};
|
|
};
|