fix:生产检验统计右侧表格无数据以及左边环形图加lebel

This commit is contained in:
shijing 2024-03-22 13:50:01 +08:00
parent 6be565c499
commit cf0cc53df9
1 changed files with 22 additions and 6 deletions

View File

@ -163,6 +163,7 @@
</el-container> </el-container>
</template> </template>
<script> <script>
const colors = ['rgb(64,158,255)','#FAFAD2','#EEE9BF','#EEDC82','#EED5B7','#EEC591','#EEAD0E','#EE9A00','#EE9572','#F08080'];
import scEcharts from '@/components/scEcharts'; import scEcharts from '@/components/scEcharts';
export default { export default {
name: 'chart', name: 'chart',
@ -179,6 +180,7 @@ export default {
currentMonth: '', currentMonth: '',
typeOptions: ['月', '年'], typeOptions: ['月', '年'],
option1: { option1: {
color:colors,
title: { title: {
text: '7车间', text: '7车间',
// subtext: '', // subtext: '',
@ -191,7 +193,11 @@ export default {
type: 'pie', type: 'pie',
radius: ['40%', '70%'], radius: ['40%', '70%'],
center: ['50%', '60%'], center: ['50%', '60%'],
label: false, label: {
show: true,
position: 'outside',
formatter: '{b} : {c} ({d}%)',
},
data: [ data: [
{ value: 0, name: '合格数' }, { value: 0, name: '合格数' },
{ value: 0, name: '炸纹' }, { value: 0, name: '炸纹' },
@ -203,6 +209,7 @@ export default {
} }
}, },
option2: { option2: {
color:colors,
title: { title: {
text: '10车间', text: '10车间',
// subtext: '', // subtext: '',
@ -215,7 +222,11 @@ export default {
type: 'pie', type: 'pie',
radius: ['40%', '70%'], radius: ['40%', '70%'],
center: ['50%', '60%'], center: ['50%', '60%'],
label: false, label: {
show: true,
position: 'outside',
formatter: '{b} : {c} ({d}%)',
},
data: [ data: [
{ value: 0, name: '合格数' }, { value: 0, name: '合格数' },
{ value: 0, name: '条纹' }, { value: 0, name: '条纹' },
@ -228,6 +239,7 @@ export default {
} }
}, },
option3: { option3: {
color:colors,
title: { title: {
text: '退火', text: '退火',
// subtext: '', // subtext: '',
@ -240,7 +252,11 @@ export default {
type: 'pie', type: 'pie',
radius: ['40%', '70%'], radius: ['40%', '70%'],
center: ['50%', '60%'], center: ['50%', '60%'],
label: false, label: {
show: true,
position: 'outside',
formatter: '{b} : {c} ({d}%)',
},
data: [ data: [
{ value: 0, name: '合格数' }, { value: 0, name: '合格数' },
{ value: 0, name: '椭圆/弯曲' }, { value: 0, name: '椭圆/弯曲' },
@ -292,7 +308,7 @@ export default {
}; };
that.$API.bi.dataset.exec.req(exec, obj).then((res) => { that.$API.bi.dataset.exec.req(exec, obj).then((res) => {
console.log('退火车间统计:', res); console.log('退火车间统计:', res);
if (res2.data2.ds0) { if (res.data2.ds0) {
let data = res.data2.ds0; let data = res.data2.ds0;
that.tableData8 = data; that.tableData8 = data;
} else { } else {
@ -335,7 +351,7 @@ export default {
let exec = that.queryType == '月' ? 'lineMonth' : 'lineYear'; let exec = that.queryType == '月' ? 'lineMonth' : 'lineYear';
that.$API.bi.dataset.exec.req(exec, obj).then((res) => { that.$API.bi.dataset.exec.req(exec, obj).then((res) => {
console.log('7生产车间统计:', res); console.log('7生产车间统计:', res);
if (res2.data2.ds0) { if (res.data2.ds0) {
let data = res.data2.ds0; let data = res.data2.ds0;
that.tableData7 = data; that.tableData7 = data;
} else { } else {
@ -373,7 +389,7 @@ export default {
let exec = that.queryType == '月' ? 'lineMonth' : 'lineYear'; let exec = that.queryType == '月' ? 'lineMonth' : 'lineYear';
that.$API.bi.dataset.exec.req(exec, obj).then((res) => { that.$API.bi.dataset.exec.req(exec, obj).then((res) => {
console.log('10生产车间统计:', res); console.log('10生产车间统计:', res);
if (res2.data2.ds0) { if (res.data2.ds0) {
let data = res.data2.ds0; let data = res.data2.ds0;
that.tableData10 = data; that.tableData10 = data;
} else { } else {