From 345c73cf09695a5ab70ab3f29187b4525623cacd Mon Sep 17 00:00:00 2001 From: caoqianming Date: Thu, 5 Dec 2024 15:26:20 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=AE=A1=E7=AE=97=E7=BB=93=E6=9E=9C?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/fac_cal/mpointstat.vue | 47 +++++++++++++------------------- 1 file changed, 19 insertions(+), 28 deletions(-) diff --git a/src/views/fac_cal/mpointstat.vue b/src/views/fac_cal/mpointstat.vue index f6440030..a3210527 100644 --- a/src/views/fac_cal/mpointstat.vue +++ b/src/views/fac_cal/mpointstat.vue @@ -2,21 +2,18 @@
- - - + + + + - + - + - + @@ -161,6 +158,8 @@ export default { name: "sflog", data() { return { + apiObjM: this.$API.enm.mpoint.list, + paramsM: {material__isnull: 0}, apiObj: this.$API.enm.mpoint.stat, params: { type: "day_s", @@ -226,16 +225,17 @@ export default { val_correct: "", }, visible: false, - mpoints: [], timeRange: [] }; }, mounted() { - this.getMpoints(); }, methods: { dataChange(req, tableData) { let that = this; + if(that.query.mpoint == null) { + return + } let option = { ...that.chartOption }; // 获取 x 轴的数据,如果query.type为小时,则显示小时,如果为天则显示天,如果为月则显示月 if (that.query.type == "hour") { @@ -249,10 +249,10 @@ export default { option.xAxis.data = tableData.reverse().map((item, index) => item.year + "-" + item.month); }else if (that.query.type == "day_s") { option.title.text = "班天统计"; - option.xAxis.data = tableData.length > 0 ? tableData.reverse().map((item, index) => item.day_s) : []; + option.xAxis.data = tableData.reverse().map((item, index) => item.year_s + "-" + item.month_s + "-" + item.day_s); }else if (that.query.type == "month_s") { option.title.text = "班月统计"; - option.xAxis.data = tableData.length > 0 ? tableData.reverse().map((item, index) => item.month_s) : []; + option.xAxis.data = tableData.reverse().map((item, index) => item.year_s + "-" + item.month_s); } // 获取 y 轴的数据 option.series = [ @@ -267,15 +267,6 @@ export default { // 更新图表选项 that.chartOption = option; }, - - getMpoints() { - let that = this; - this.$API.enm.mpoint.list - .req({ page: 0}) - .then((res) => { - that.mpoints = res; - }); - }, handle_add() {}, handleQuery() { if (this.timeRange) {