diff --git a/src/views/QualityManager/HomePage.vue b/src/views/QualityManager/HomePage.vue index 47eaea9..c14f912 100644 --- a/src/views/QualityManager/HomePage.vue +++ b/src/views/QualityManager/HomePage.vue @@ -137,7 +137,7 @@ :class="{ 'pl-select__active': plMode === 'a' }" @click=" plMode = 'a' - chosenDatalist = quexianDatalist[0] + chosenDatalist = getFaultDataList() " > A @@ -146,7 +146,7 @@ :class="{ 'pl-select__active': plMode === 'b' }" @click=" plMode = 'b' - chosenDatalist = quexianDatalist[1] + chosenDatalist = getFaultDataList() " > B @@ -157,7 +157,7 @@ :class="{ 'date-select__active': dateMode === 'day' }" @click=" dateMode = 'day' - chosenDatalist = quexianDatalist[2] + chosenDatalist = getFaultDataList() " > 日 @@ -166,7 +166,7 @@ :class="{ 'date-select__active': dateMode === 'month' }" @click=" dateMode = 'month' - chosenDatalist = quexianDatalist[3] + chosenDatalist = getFaultDataList() " > 月 @@ -178,15 +178,26 @@ - 单位: 千片 + + {{ unit }} - + +
- 产品成品率 + + 产品成品率 +
@@ -289,37 +300,37 @@ export default { }, data() { const quexianDatalist = [ - [ + [ // 月a + { value: 5.21, name: '破片' }, + { value: 3.2, name: '崩边' }, + { value: 4.12, name: '脏污' }, + { value: 2.61, name: '划擦伤' }, + { value: 0.96, name: '崩孔' }, + { value: 2.2, name: '其他' } + ], + [ // 月b { value: 4.34, name: '破片' }, { value: 3.4, name: '崩边' }, { value: 4.1, name: '脏污' }, { value: 2.4, name: '划擦伤' }, - { value: 0.23, name: '崩孔' }, + { value: 0.32, name: '崩孔' }, { value: 2.14, name: '其他' } ], - [ - { value: 4.17, name: '破片' }, - { value: 3.6, name: '崩边' }, - { value: 4, name: '脏污' }, - { value: 2.2, name: '划擦伤' }, - { value: 0.2, name: '崩孔' }, - { value: 1.9, name: '其他' } + [ // 日a + { value: 184, name: '破片' }, + { value: 110, name: '崩边' }, + { value: 163, name: '脏污' }, + { value: 96, name: '划擦伤' }, + { value: 22, name: '崩孔' }, + { value: 74, name: '其他' } ], - [ - { value: 3.33, name: '破片' }, - { value: 3, name: '崩边' }, - { value: 4.3, name: '脏污' }, - { value: 2.1, name: '划擦伤' }, - { value: 1, name: '崩孔' }, - { value: 1.8, name: '其他' } - ], - [ - { value: 2.7, name: '破片' }, - { value: 1.56, name: '崩边' }, - { value: 2.3, name: '脏污' }, - { value: 1.2, name: '划擦伤' }, - { value: 0.23, name: '崩孔' }, - { value: 2, name: '其他' } + [ // 日b + { value: 172, name: '破片' }, + { value: 122, name: '崩边' }, + { value: 162, name: '脏污' }, + { value: 82, name: '划擦伤' }, + { value: 15, name: '崩孔' }, + { value: 74, name: '其他' } ] ] @@ -385,7 +396,10 @@ export default { } }, computed: { - ...mapGetters(['sidebar']) + ...mapGetters(['sidebar']), + unit() { + return this.dateMode === 'month' ? '单位: 千片' : '单位: 片' + } }, methods: { changeFullScreen() { @@ -397,6 +411,13 @@ export default { return false } screenfull.toggle(this.$refs['cockpit-container-quality']) + }, + getFaultDataList() { + const { dateMode, plMode, quexianDatalist } = this + if (dateMode === 'month' && plMode === 'a') return quexianDatalist[0] + else if (dateMode === 'month' && plMode === 'b') return quexianDatalist[1] + else if (dateMode === 'day' && plMode === 'a') return quexianDatalist[2] + else if (dateMode === 'day' && plMode === 'b') return quexianDatalist[3] } } } diff --git a/src/views/QualityManager/components/charts/PlFaultAnalysisPieChart.vue b/src/views/QualityManager/components/charts/PlFaultAnalysisPieChart.vue index 04e401f..52304ef 100644 --- a/src/views/QualityManager/components/charts/PlFaultAnalysisPieChart.vue +++ b/src/views/QualityManager/components/charts/PlFaultAnalysisPieChart.vue @@ -17,6 +17,10 @@ export default { dataList: { type: Array, required: true + }, + dataPeriod: { + type: String, + default: 'month' } }, data() { @@ -309,7 +313,12 @@ export default { const legnedTop = this.calcFontsize(64 /** px*/) const legendTopRate = this.calcFontsize(30 /** % */) - this.configs.title.text = this.dataList.reduce((prev, curr) => prev + curr.value * 1000, 0) + this.configs.title.text = + this.dataPeriod === 'month' + ? // 如果是月数据,单位为 千片 + this.dataList.reduce((prev, curr) => prev + curr.value * 1000, 0) + : // 如果是日数据,单位为 片 + this.dataList.reduce((prev, curr) => prev + curr.value, 0) this.configs.title.textStyle.fontSize = fs20 this.configs.title.subtextStyle.fontSize = fs13 diff --git a/src/views/QualityManager/components/charts/newLineStack.vue b/src/views/QualityManager/components/charts/newLineStack.vue index 6b3e80d..567b187 100644 --- a/src/views/QualityManager/components/charts/newLineStack.vue +++ b/src/views/QualityManager/components/charts/newLineStack.vue @@ -5,6 +5,7 @@