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) {