From f05c1208698f36ef699875eeaf1f80211ca9b056 Mon Sep 17 00:00:00 2001 From: JINGYJ <1458671527@qq.com> Date: Fri, 5 Jul 2024 11:24:31 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E5=9B=BE=E8=A1=A8=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../compontents/ColumnarChat.vue | 50 ++++---- .../compontents/LineChat.vue | 50 ++++---- .../compontents/PieChart.vue | 50 ++++---- .../statisticAnalysis/index.vue | 117 +++++++++++------- 4 files changed, 145 insertions(+), 122 deletions(-) diff --git a/src/views/businessManagement/statisticAnalysis/compontents/ColumnarChat.vue b/src/views/businessManagement/statisticAnalysis/compontents/ColumnarChat.vue index 4ee6623..c0772f7 100644 --- a/src/views/businessManagement/statisticAnalysis/compontents/ColumnarChat.vue +++ b/src/views/businessManagement/statisticAnalysis/compontents/ColumnarChat.vue @@ -11,30 +11,30 @@ import VueChart from "./VueChart.vue"; import { computed } from "vue"; -const props = defineProps({ - month_data: { - type: Array, - default: () => [] - }, - day_data: { - type: Array, - default: () => [] - }, - data: { - type: Array, - default: () => [] - } -}); +// const props = defineProps({ +// month_data: { +// type: Array, +// default: () => [] +// }, +// day_data: { +// type: Array, +// default: () => [] +// }, +// data: { +// type: Array, +// default: () => [] +// } +// }); -const total_data = computed(() => { - if (!props.data || props.data.length === 0) { - return 0; - } else { - return props.data.reduce(function (sum, item: any) { - return sum + item.value; - }, 0); - } -}); +// const total_data = computed(() => { +// if (!props.data || props.data.length === 0) { +// return 0; +// } else { +// return props.data.reduce(function (sum, item: any) { +// return sum + item.value; +// }, 0); +// } +// }); // function customLabelFormatter(params) { // const text = params.value.toString(); // const coloredText = text.replace( @@ -48,14 +48,14 @@ const chartOption = computed(() => { return { xAxis: { type: "category", - data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"] + data: ["Mon", "Tue", "Wed", "Thu", "Fri"] }, yAxis: { type: "value" }, series: [ { - data: [120, 200, 150, 80, 70, 110, 130], + data: [170, 160, 210, 120, 120], type: "bar" } ] diff --git a/src/views/businessManagement/statisticAnalysis/compontents/LineChat.vue b/src/views/businessManagement/statisticAnalysis/compontents/LineChat.vue index e37c2ff..8c579a8 100644 --- a/src/views/businessManagement/statisticAnalysis/compontents/LineChat.vue +++ b/src/views/businessManagement/statisticAnalysis/compontents/LineChat.vue @@ -9,32 +9,32 @@ import VueChart from "./VueChart.vue"; import { computed } from "vue"; -const props = defineProps({ - month_data: { - type: Array, - default: () => [] - }, - day_data: { - type: Array, - default: () => [] - }, - data: { - type: Array, - default: () => [] - } -}); +// const props = defineProps({ +// month_data: { +// type: Array, +// default: () => [] +// }, +// day_data: { +// type: Array, +// default: () => [] +// }, +// data: { +// type: Array, +// default: () => [] +// } +// }); -const name_list = computed(() => { - return props.data.map((item: any) => { - return item.name; - }); -}); +// const name_list = computed(() => { +// return props.data.map((item: any) => { +// return item.name; +// }); +// }); -const value_list = computed(() => { - return props.data.map((item: any) => { - return item.value; - }); -}); +// const value_list = computed(() => { +// return props.data.map((item: any) => { +// return item.value; +// }); +// }); const chartOption = computed(() => { return { @@ -47,7 +47,7 @@ const chartOption = computed(() => { }, series: [ { - data: [820, 932, 901, 934, 1290, 1330, 1320], + data: [22, 45, 23, 80, 24, 100, 22], type: "line", smooth: true } diff --git a/src/views/businessManagement/statisticAnalysis/compontents/PieChart.vue b/src/views/businessManagement/statisticAnalysis/compontents/PieChart.vue index e247890..de56d4b 100644 --- a/src/views/businessManagement/statisticAnalysis/compontents/PieChart.vue +++ b/src/views/businessManagement/statisticAnalysis/compontents/PieChart.vue @@ -11,30 +11,30 @@ import VueChart from "./VueChart.vue"; import { computed } from "vue"; -const props = defineProps({ - month_data: { - type: Array, - default: () => [] - }, - day_data: { - type: Array, - default: () => [] - }, - data: { - type: Array, - default: () => [] - } -}); +// const props = defineProps({ +// month_data: { +// type: Array, +// default: () => [] +// }, +// day_data: { +// type: Array, +// default: () => [] +// }, +// data: { +// type: Array, +// default: () => [] +// } +// }); -const total_data = computed(() => { - if (!props.data || props.data.length === 0) { - return 0; - } else { - return props.data.reduce(function (sum, item: any) { - return sum + item.value; - }, 0); - } -}); +// const total_data = computed(() => { +// if (!props.data || props.data.length === 0) { +// return 0; +// } else { +// return props.data.reduce(function (sum, item: any) { +// return sum + item.value; +// }, 0); +// } +// }); // function customLabelFormatter(params) { // const text = params.value.toString(); // const coloredText = text.replace( @@ -75,8 +75,8 @@ const chartOption = computed(() => { show: false }, data: [ - { value: 1048, name: "待审批" }, - { value: 735, name: "已审批" } + { value: 735, name: "已审批" }, + { value: 2532, name: "待审批" } ] } ] diff --git a/src/views/businessManagement/statisticAnalysis/index.vue b/src/views/businessManagement/statisticAnalysis/index.vue index 12aff35..6d5ded0 100644 --- a/src/views/businessManagement/statisticAnalysis/index.vue +++ b/src/views/businessManagement/statisticAnalysis/index.vue @@ -35,7 +35,7 @@ const dataList = ref([]);