|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div ref="echartsRef" style="width: 100%; height: 80vh;"></div>
|
|
<div ref="echartsRef" style="width: 100%; height: 80vh;"></div>
|
|
|
</template>
|
|
</template>
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
<script setup>
|
|
<script setup>
|
|
|
import { onMounted, ref } from 'vue';
|
|
import { onMounted, ref } from 'vue';
|
|
|
import * as echarts from 'echarts';
|
|
import * as echarts from 'echarts';
|
|
@@ -82,12 +82,18 @@ const fetchData = async () => {
|
|
|
/** 查询社保 */
|
|
/** 查询社保 */
|
|
|
function getEchartsData() {
|
|
function getEchartsData() {
|
|
|
getOutputValueData(queryParams.value).then((res) => {
|
|
getOutputValueData(queryParams.value).then((res) => {
|
|
|
- console.log(res)
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if(res.data){
|
|
|
|
|
+ res.data.forEach(item=>{
|
|
|
|
|
+ item.industrialOutputValueLastYear = Number(item.industrialOutputValueLastYear);
|
|
|
|
|
+ return item;
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
const response = res.data
|
|
const response = res.data
|
|
|
|
|
|
|
|
const namesArray = response.map(obj => obj.detailedUnitName);
|
|
const namesArray = response.map(obj => obj.detailedUnitName);
|
|
|
const valuesArray = response.map(obj => obj.industrialOutputValue);
|
|
const valuesArray = response.map(obj => obj.industrialOutputValue);
|
|
|
- const valuesLastArray = response.map(obj => obj.industrialOutputValueLastYear);
|
|
|
|
|
|
|
+ const valuesLastArray = response.map(obj => obj.industrialOutputValueLastYear).sort((a, b) => a-b);
|
|
|
|
|
|
|
|
console.log(namesArray, valuesArray, valuesLastArray)
|
|
console.log(namesArray, valuesArray, valuesLastArray)
|
|
|
|
|
|
|
@@ -119,12 +125,12 @@ function getEchartsData() {
|
|
|
},
|
|
},
|
|
|
series: [
|
|
series: [
|
|
|
{
|
|
{
|
|
|
- name: '2023',
|
|
|
|
|
|
|
+ name: '2024',
|
|
|
type: 'bar',
|
|
type: 'bar',
|
|
|
data: valuesArray
|
|
data: valuesArray
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- name: '2024',
|
|
|
|
|
|
|
+ name: '2023',
|
|
|
type: 'bar',
|
|
type: 'bar',
|
|
|
data: valuesLastArray
|
|
data: valuesLastArray
|
|
|
}
|
|
}
|
|
@@ -144,7 +150,7 @@ onMounted(() => {
|
|
|
getEchartsData();
|
|
getEchartsData();
|
|
|
});
|
|
});
|
|
|
</script>
|
|
</script>
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
<style>
|
|
<style>
|
|
|
/* 样式内容 */
|
|
/* 样式内容 */
|
|
|
</style>
|
|
</style>
|