diff --git a/src/views/visualization/components/BasicChart.vue b/src/views/visualization/components/BasicChart.vue index 2f37696d..e8113c3e 100644 --- a/src/views/visualization/components/BasicChart.vue +++ b/src/views/visualization/components/BasicChart.vue @@ -13,6 +13,7 @@ import Box from './Box.vue' import { computed } from '@vue/reactivity' import { chartBarColors, chartLineColors } from './colors' + import { useVisualizationStore } from '/@/store/modules/visualization' export default defineComponent({ components: { Box, @@ -26,6 +27,7 @@ }, }, setup(props) { + const visualizationStore = useVisualizationStore() const propsData: any = computed(() => props.data) const chartRef = ref(null) @@ -41,6 +43,7 @@ if (!id) return const resData = await getCropYieldQuarterStatics({ crop_id: id, + year: visualizationStore.getYear, }) const list: any[] = [] for (const key in resData) { diff --git a/src/views/visualization/components/CModal.vue b/src/views/visualization/components/CModal.vue index 1e963421..ddec8d33 100644 --- a/src/views/visualization/components/CModal.vue +++ b/src/views/visualization/components/CModal.vue @@ -137,7 +137,6 @@ const tabChange = () => { const { is_end, id } = currentTab.value - console.log(id) if (is_end == 0) { childParentId.value = id @@ -193,7 +192,7 @@ setOptions({ grid: { left: '2%', right: '2%', top: '10%', bottom: '2%', containLabel: true }, legend: { - show: false, + show: true, data: obj.legendData, top: '0%', right: '0', @@ -249,7 +248,7 @@ // const const resData = await getCates({ parent_id: props.parentId, - crop_type: 1, + crop_type: 2, category_id: cropsId.value, type: 'top', }) diff --git a/src/views/visualization/components/DZWZ.vue b/src/views/visualization/components/DZWZ.vue index 3053930f..9b49ea63 100644 --- a/src/views/visualization/components/DZWZ.vue +++ b/src/views/visualization/components/DZWZ.vue @@ -105,8 +105,16 @@ data: diffs, }) }) + setOptions({ - grid: { left: '2%', right: '2%', top: '3%', bottom: '2%', containLabel: true }, + grid: { left: '2%', right: '2%', top: '50px', bottom: '2%', containLabel: true }, + legend: { + show: true, + data: obj.legendData, + textStyle: { + color: '#ffffff', + }, + }, tooltip: { trigger: 'axis', axisPointer: { @@ -116,13 +124,16 @@ }, }, formatter: function (params) { - const arr = [] + let str = params[0]?.name + '
' params.forEach((e, index) => { - if (index % 2) arr.push(e) - }) - let str = '' - arr.forEach((e: any) => { - str += e.name + '
' + e.seriesName + ' : ' + (e?.value ?? 0) + if (index % 2) + str += + e.seriesName + + ' : ' + + (params[index - 1]?.value ?? 0) + + '-' + + (Number(e?.value ?? 0) + Number(params[index - 1]?.value ?? 0)) + + '
' }) return str }, diff --git a/src/views/visualization/components/NCZQS.vue b/src/views/visualization/components/NCZQS.vue index da00324a..4713885a 100644 --- a/src/views/visualization/components/NCZQS.vue +++ b/src/views/visualization/components/NCZQS.vue @@ -5,7 +5,7 @@ > 历年产值趋势 -
1
+
@@ -101,7 +101,7 @@ for (const key in list) { if (Object.prototype.hasOwnProperty.call(list, key)) { arr.push({ - y: Number(list[key]) / 10000, + y: Number((Number(list[key]) / 10000).toFixed(2)), x: key, }) } diff --git a/src/views/visualization/index.vue b/src/views/visualization/index.vue index 91987836..841527c0 100644 --- a/src/views/visualization/index.vue +++ b/src/views/visualization/index.vue @@ -36,9 +36,9 @@
- - - + + +