From 70fe37ed8164b7f84c09da62458c151793ce7040 Mon Sep 17 00:00:00 2001 From: wangxinyao Date: Fri, 3 Feb 2023 13:42:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=A2=E6=88=B7=E9=9C=80=E6=B1=82=E8=AE=A1?= =?UTF-8?q?=E5=88=92=E7=AE=A1=E7=90=86-=E5=91=A8=E8=BD=AC=E6=97=A5?= =?UTF-8?q?=E6=98=A0=E5=B0=84=E5=85=B3=E7=B3=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/plan/workbench/homePage/beta/index.vue | 3 ++- .../workbench/homePage/beta/predict/index.vue | 2 +- .../homePage/beta/predict/predictEdit.vue | 9 ++++++++- .../homePage/formal/analysis/commonLineChart.vue | 16 ++++++++++++---- .../workbench/homePage/formal/analysis/index.vue | 6 +++--- .../homePage/formal/analysis/lineBarChart.vue | 16 ++++++++++++---- .../plan/workbench/homePage/formal/index.vue | 5 +++-- .../workbench/homePage/formal/versions/index.vue | 4 ++-- src/views/plan/workbench/homePage/index.vue | 15 ++++++++++++--- .../materialAnalysis/chart/commonLineChart.vue | 14 +++++++++++--- .../workbench/materialAnalysis/chart/index.vue | 6 +++--- .../materialAnalysis/chart/lineBarChart.vue | 14 +++++++++++--- .../plan/workbench/materialAnalysis/index.vue | 10 +++++++++- 13 files changed, 89 insertions(+), 31 deletions(-) diff --git a/src/views/plan/workbench/homePage/beta/index.vue b/src/views/plan/workbench/homePage/beta/index.vue index 25e999b..5a0b54b 100644 --- a/src/views/plan/workbench/homePage/beta/index.vue +++ b/src/views/plan/workbench/homePage/beta/index.vue @@ -7,6 +7,7 @@ :CreateModel="CreateModel" :isShowComponent="isShowComponent" :tableHeight="tableHeight" + :transLabelObj="transLabelObj" @calculateTableHeight="calculateTableHeight" />
- +
- +
@@ -22,6 +22,7 @@ import Customer from './customer' import Beta from './beta' import Formal from './formal' +import { get } from "@/server/api.js"; export default { components:{ Customer, @@ -35,6 +36,7 @@ export default { customerId: "", CreateModel: "", currentCustomId: '', + transLabelObj: {}, } }, methods: { @@ -47,10 +49,17 @@ export default { }, calculateFormalTableHeight(height){ this.formalTableHeight = height - } + }, + getTransLabel() { + get('/user/week_to_date').then(({data})=>{ + this.transLabelObj = data || {} + }) + }, }, created() { + this.getTransLabel() this.currentCustomId = this.$route.query.CustomerId + }, mounted () { this.dragChangeSize((topHeight,bottomHeight) => { diff --git a/src/views/plan/workbench/materialAnalysis/chart/commonLineChart.vue b/src/views/plan/workbench/materialAnalysis/chart/commonLineChart.vue index f463a1c..4a9b97e 100644 --- a/src/views/plan/workbench/materialAnalysis/chart/commonLineChart.vue +++ b/src/views/plan/workbench/materialAnalysis/chart/commonLineChart.vue @@ -15,6 +15,10 @@ export default { type: String, default: '' }, + transLabelObj: { + type: Object, + default: {} + } }, data() { return { @@ -23,6 +27,7 @@ export default { seriesArray: [], maxValue: '', minValue: '', + copyXDataArray: [], } }, watch: { @@ -41,11 +46,14 @@ export default { this.xDataArray = [] this.seriesArray = [] if (currentValue && currentValue.SortKeys) { - this.xDataArray = currentValue.SortKeys + this.copyXDataArray = JSON.parse(JSON.stringify(currentValue.SortKeys)) + this.xDataArray = currentValue.SortKeys.map(el => { + return this.transLabelObj[el] + }) } (newValue.PerCustomerDeviationDetailItem || []).forEach(el => { receivableArray = [] - this.xDataArray.forEach(elChild => { + this.copyXDataArray.forEach(elChild => { receivableArray.push(el.Item[elChild]) }) this.seriesArray.push({ @@ -116,7 +124,7 @@ export default { data: this.xDataArray, axisLabel: { //坐标轴刻度标签的相关设置 interval: 0, - rotate:'80',//旋转度数 + rotate:'10',//旋转度数 }, }, legend: { diff --git a/src/views/plan/workbench/materialAnalysis/chart/index.vue b/src/views/plan/workbench/materialAnalysis/chart/index.vue index 2a19352..f400db9 100644 --- a/src/views/plan/workbench/materialAnalysis/chart/index.vue +++ b/src/views/plan/workbench/materialAnalysis/chart/index.vue @@ -15,10 +15,10 @@
- +
- +
@@ -30,7 +30,7 @@ import CommonLineChart from './commonLineChart' import LineBarChart from './lineBarChart' export default { name: "analysis", - props: ["queryParams", 'versionId'], + props: ["queryParams", 'versionId', 'transLabelObj'], components: { QueryComponent, CommonLineChart, diff --git a/src/views/plan/workbench/materialAnalysis/chart/lineBarChart.vue b/src/views/plan/workbench/materialAnalysis/chart/lineBarChart.vue index 2f53cb1..afd06d2 100644 --- a/src/views/plan/workbench/materialAnalysis/chart/lineBarChart.vue +++ b/src/views/plan/workbench/materialAnalysis/chart/lineBarChart.vue @@ -15,6 +15,10 @@ export default { type: String, default: '' }, + transLabelObj: { + type: Object, + default: {} + } }, data() { return { @@ -23,6 +27,7 @@ export default { seriesArray: [], maxValue: '', minValue: '', + copyXDataArray: [], } }, watch: { @@ -41,11 +46,14 @@ export default { this.xDataArray = [] this.seriesArray = [] if (currentValue && currentValue.SortKeys) { - this.xDataArray = currentValue.SortKeys + this.copyXDataArray = JSON.parse(JSON.stringify(currentValue.SortKeys)) + this.xDataArray = currentValue.SortKeys.map(el => { + return this.transLabelObj[el] + }) } newValue.CustomerDeviationDetailItem.forEach(el => { receivableArray = [] - this.xDataArray.forEach(elChild => { + this.copyXDataArray.forEach(elChild => { receivableArray.push(el.Item[elChild]) }) this.seriesArray.push({ @@ -125,7 +133,7 @@ export default { data: this.xDataArray, axisLabel: { //坐标轴刻度标签的相关设置 interval: 0, - rotate:'80',//旋转度数 + rotate:'10',//旋转度数 }, }, yAxis: { diff --git a/src/views/plan/workbench/materialAnalysis/index.vue b/src/views/plan/workbench/materialAnalysis/index.vue index c76097c..149e3cd 100644 --- a/src/views/plan/workbench/materialAnalysis/index.vue +++ b/src/views/plan/workbench/materialAnalysis/index.vue @@ -13,7 +13,7 @@
- +
@@ -21,6 +21,7 @@ import Filter from './filter' import Version from './version' import Chart from './chart' +import { get } from "@/server/api.js"; export default { components:{ Filter, @@ -32,9 +33,11 @@ export default { withTheRingRadio: 'ring', versionId: '', queryParams: {}, + transLabelObj: {}, } }, mounted () { + this.getTransLabel() this.dragChangeSize(); }, methods: { @@ -45,6 +48,11 @@ export default { versionEmit(version) { this.versionId = version }, + getTransLabel() { + get('/user/week_to_date').then(({data})=>{ + this.transLabelObj = data || {} + }) + }, }, }