From 4730889c00196b275f68b1b5638961b7e342ada6 Mon Sep 17 00:00:00 2001 From: danshihao Date: Wed, 24 Jan 2024 17:02:33 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E5=85=A8=E9=99=A2=E7=BB=8F=E8=90=A5?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=BB=9F=E8=AE=A1(=E5=8D=95=E6=9C=88)-?= =?UTF-8?q?=E6=AF=94=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/dashboard/SingleMonthEcharts.vue | 9 + .../dashboard/SingleMonthTotalEcharts.vue | 8 +- .../modules/SingleMonthComparisonModal.vue | 686 ++++++++++++++++++ .../SingleMonthTotalComparisonModal.vue | 24 +- 4 files changed, 716 insertions(+), 11 deletions(-) create mode 100644 src/views/dashboard/modules/SingleMonthComparisonModal.vue diff --git a/src/views/dashboard/SingleMonthEcharts.vue b/src/views/dashboard/SingleMonthEcharts.vue index 998cb7c..624ac64 100644 --- a/src/views/dashboard/SingleMonthEcharts.vue +++ b/src/views/dashboard/SingleMonthEcharts.vue @@ -4,6 +4,7 @@
全院经营数据统计(单月) + 比对
@@ -39,6 +40,8 @@ + + @@ -72,6 +75,7 @@ import {MonthData} from '@views/statisticalReport/statisticData' import {getAction} from '@api/manage' import {formatMoney} from '@/utils/formatMoney' import JYearDate from '@comp/jero/JYearDate' +import SingleMonthComparisonModal from '@views/dashboard/modules/SingleMonthComparisonModal' const columns = [ { @@ -104,6 +108,7 @@ columns.push({ export default { name: 'SingleMonthEcharts', components:{ + SingleMonthComparisonModal, JYearDate }, mixins: [JeroListMixin], @@ -129,6 +134,10 @@ export default { }, methods: { formatMoney, + // 比对 + handleComparison () { + this.$refs.singleMonthComparisonModal.open() + }, loadData(arg) { if (!this.url.list) { this.$message.error('请设置url.list属性!') diff --git a/src/views/dashboard/SingleMonthTotalEcharts.vue b/src/views/dashboard/SingleMonthTotalEcharts.vue index 140425c..568bf89 100644 --- a/src/views/dashboard/SingleMonthTotalEcharts.vue +++ b/src/views/dashboard/SingleMonthTotalEcharts.vue @@ -71,7 +71,7 @@ echarts.use([ ToolboxComponent ]) import {JeroListMixin} from '@/mixins/JeroListMixin' -import {MonthDataTotal} from '@views/statisticalReport/statisticData' +import {MonthData} from '@views/statisticalReport/statisticData' import {getAction} from '@api/manage' import {formatMoney} from '@/utils/formatMoney' import JYearDate from '@comp/jero/JYearDate' @@ -86,7 +86,7 @@ const columns = [ scopedSlots: {customRender: 'text'} }, ] -MonthDataTotal.map(tt => { +MonthData.map(tt => { columns.push({ title: tt.name, align: 'center', @@ -155,7 +155,7 @@ export default { ] dataSource.map((item, index) => { - let keyItem = MonthDataTotal.find(ele => Number(ele.value) === (index + 1)) + let keyItem = MonthData.find(ele => Number(ele.value) === (index + 1)) if (keyItem) { let key = keyItem.key tableData[0][key] = item.estimatedArrivalMoney // 预估收入金额--也可能放在第一条 @@ -195,7 +195,7 @@ export default { }, initEcharts() { // 处理x轴数据 - let xData = MonthDataTotal.reduce((pre, val) => { + let xData = MonthData.reduce((pre, val) => { return pre.concat(val.name) }, []) diff --git a/src/views/dashboard/modules/SingleMonthComparisonModal.vue b/src/views/dashboard/modules/SingleMonthComparisonModal.vue new file mode 100644 index 0000000..6f5f2ba --- /dev/null +++ b/src/views/dashboard/modules/SingleMonthComparisonModal.vue @@ -0,0 +1,686 @@ + + + + + \ No newline at end of file diff --git a/src/views/dashboard/modules/SingleMonthTotalComparisonModal.vue b/src/views/dashboard/modules/SingleMonthTotalComparisonModal.vue index 7792c4a..7fd24be 100644 --- a/src/views/dashboard/modules/SingleMonthTotalComparisonModal.vue +++ b/src/views/dashboard/modules/SingleMonthTotalComparisonModal.vue @@ -5,7 +5,7 @@ :visible="visible" :confirmLoading="confirmLoading" switchFullscreen - fullscreen + :fullscreen.sync="fullscreen" :footer="null" @cancel="handleCancel" cancelText="关闭"> @@ -15,12 +15,12 @@
- + - + @@ -34,7 +34,7 @@ -
+
@@ -124,10 +124,12 @@ export default { data () { return { columns, - title: '比对', - width: 800, + title: '全院经营数据统计 (累计) 比对', + width: 1000, visible: false, confirmLoading: false, + // 是否全屏 + fullscreen: true, labelCol: { xs: { span: 24 }, sm: { span: 5 } @@ -149,6 +151,14 @@ export default { dataSource: [], } }, + watch: { + // 弹框大小改变时重置统计图大小 + fullscreen () { + this.$nextTick(() => { + this.myChart && this.myChart.resize() + }) + } + }, methods: { formatMoney, // 查询 @@ -292,6 +302,7 @@ export default { } }, legend: { + type: 'scroll', data: legend, right: '2%' }, @@ -605,7 +616,6 @@ export default { option && myChart.setOption(option) window.addEventListener('resize', () => { - console.log('resize') myChart.resize() }) },