页面调整

This commit is contained in:
ljx 2025-03-13 10:44:56 +08:00
parent 860a3132ff
commit 5ace5dab9d
6 changed files with 325 additions and 78 deletions

View File

@ -149,7 +149,7 @@ export default {
height: 90%; height: 90%;
.active-ring-name { .active-ring-name {
font-size: 20px !important; font-size: 30px !important;
} }
} }

View File

@ -15,28 +15,9 @@
</div> </div>
<div class="cc-main-container"> <div class="cc-main-container">
<div class="ccmc-left">
<div class="ccmc-title">
本月工单概况
</div>
<div class="ccmc-items">
<div class="station-info" v-for="(item, index) in leftData" :key="index">
<img :src="item.icon" alt="icon" class="station-icon">
<div class="station-value">{{ item.value }}</div>
<div class="station-name">{{ item.name }}</div>
</div>
</div>
</div>
<!-- <dv-active-ring-chart class="ccmc-middle" :config="config" /> -->
<div class="ccmc-middle">
<PieChart :dataType="dataType"></PieChart>
</div>
<div class="ccmc-right"> <div class="ccmc-right">
<div class="ccmc-title"> <div class="ccmc-title">
{{dataType=='3'?'未完成订单数量':'保养及备料信息'}} 本月工单概况
</div> </div>
<!-- <div class="ccmc-items"> <!-- <div class="ccmc-items">
<div class="station-info" v-for="(item, index) in rightData" :key="index"> <div class="station-info" v-for="(item, index) in rightData" :key="index">
@ -69,7 +50,7 @@
<div class="second-row"> <div class="second-row">
<div <div
class="item-card" class="item-card"
v-for="(item, index) in rightData" v-for="(item, index) in leftData"
:key="index" :key="index"
> >
<img :src="item.icon" class="sc-icon"> <img :src="item.icon" class="sc-icon">
@ -80,6 +61,29 @@
</div> </div>
</div> </div>
<!-- <dv-active-ring-chart class="ccmc-middle" :config="config" /> -->
<div class="ccmc-middle">
<PieChart :dataType="dataType"></PieChart>
</div>
<div class="ccmc-left">
<div class="ccmc-title">
{{dataType=='3'?'未完成订单数量':'保养及备料信息'}}
</div>
<div class="new-bar-chart" v-show="dataType !='3'">
<div id="echarts-new" style="height: 400px;width: 800px;"></div>
</div>
<div class="ccmc-items" v-show="dataType=='3'">
<div class="station-info" v-for="(item, index) in rightData" :key="index">
<img :src="item.icon" alt="icon" class="station-icon">
<div class="station-value">{{ item.value }}</div>
<div class="station-name">{{ item.name }}</div>
</div>
</div>
</div>
<!-- <LabelTag :config="labelConfig" /> --> <!-- <LabelTag :config="labelConfig" /> -->
</div> </div>
</div> </div>
@ -88,6 +92,7 @@
<script> <script>
import LabelTag from './LabelTag' import LabelTag from './LabelTag'
import PieChart from './pieChart.vue' import PieChart from './pieChart.vue'
import * as echarts from 'echarts';
export default { export default {
name: 'CenterCmp', name: 'CenterCmp',
components: { components: {
@ -103,10 +108,10 @@ export default {
// //
const originalLeftData = [ const originalLeftData = [
{ icon: require(`@/img/icons/1.png`), name: '本月订单数', value: '1120' }, { icon: require(`@/img/icons/12.png`), name: '本月订单数', value: '1120' },
{ icon: require(`@/img/icons/2.png`), name: '本月派工数', value: '600' }, { icon: require(`@/img/icons/12.png`), name: '本月派工数', value: '600' },
{ icon: require(`@/img/icons/3.png`), name: '本月派工未完成数', value: '60%' }, { icon: require(`@/img/icons/12.png`), name: '本月派工未完成数', value: '800' },
{ icon: require(`@/img/icons/3.png`), name: '本月派工完成率', value: '100%' } { icon: require(`@/img/icons/12.png`), name: '本月派工完成率', value: '100%' }
]; ];
const originalLeftData2 = [ const originalLeftData2 = [
{ icon: require(`@/img/icons/1.png`), name: '完成工单数', value: '1120' }, { icon: require(`@/img/icons/1.png`), name: '完成工单数', value: '1120' },
@ -115,10 +120,11 @@ export default {
]; ];
const originalRightData = [ const originalRightData = [
{ icon: require(`@/img/icons/12.png`), name: '保养台数', value: '20' }, { icon: require(`@/img/icons/12.png`), name: '保养率', value: 20 },
{ icon: require(`@/img/icons/12.png`), name: '直通率', value: '100%' }, { icon: require(`@/img/icons/12.png`), name: '直通率', value: 100 },
{ icon: require(`@/img/icons/12.png`), name: '机芯备料进度', value: '98%' }, { icon: require(`@/img/icons/12.png`), name: '整机备料率', value: 90 },
{ icon: require(`@/img/icons/12.png`), name: '盖板备料进度', value: '85%' } { icon: require(`@/img/icons/12.png`), name: '盖板备料率', value: 85 },
{ icon: require(`@/img/icons/12.png`), name: '机芯备料率', value: 90 },
]; ];
const originalRightData2 = [ const originalRightData2 = [
{ icon: require(`@/img/icons/12.png`), name: '水件', value: '12000' }, { icon: require(`@/img/icons/12.png`), name: '水件', value: '12000' },
@ -153,6 +159,15 @@ export default {
radius: '55%', radius: '55%',
activeRadius: '60%' activeRadius: '60%'
}, },
config1:{
showValue:true,
data:[
{ icon: require(`@/img/icons/12.png`), name: '保养率', value: 20 },
{ icon: require(`@/img/icons/12.png`), name: '直通率', value: 100 },
{ icon: require(`@/img/icons/12.png`), name: '机芯备料进度', value: 90 },
{ icon: require(`@/img/icons/12.png`), name: '盖板备料进度', value: 85 }
]
},
labelConfig: { labelConfig: {
@ -162,7 +177,127 @@ export default {
leftData: this.dataType == '3'?originalLeftData2:originalLeftData, leftData: this.dataType == '3'?originalLeftData2:originalLeftData,
rightData: this.dataType == '3'?originalRightData2:originalRightData rightData: this.dataType == '3'?originalRightData2:originalRightData
} }
} },
mounted(){
this.createData();
},
methods: {
createData() {
// %
const rawData = this.rightData.map(item=>{return item.value});
const categories = this.rightData.map(item=>{return item.name});
// 10%
const generateStackData = (value) => {
const segments = [];
let remaining = value;
for (let i = 0; i < 10; i++) { // 10 100%
const segmentValue = remaining >= 10 ? 10 : remaining;
if (segmentValue <= 0) break;
segments.push(segmentValue);
remaining -= segmentValue;
}
return segments;
};
//
const series = [];
for (let i = 0; i < 10; i++) { // 10
series.push({
type: 'bar',
stack: 'total', //
data: rawData.map(value => {
const segments = generateStackData(value);
return i < segments.length ? segments[i] : 0; // 0
}),
itemStyle: {
color: `rgba(135, 206, 235, ${i * 0.1+0.2})`, // ,
borderColor: 'transparent',
borderWidth: 3,
},
barGap: '0%', //
barCategoryGap: '20%' //
});
}
var myChart = echarts.init(document.getElementById('echarts-new'));
// this.option = {
// xAxis: {
// type: 'category',
// data: this.rightData.map(item=>{return item.name}),
// axisLabel: {
// fontSize: 18, // Y
// color: '#fff', //
// },
// },
// yAxis: {
// type: 'value',
// splitLine: {
// show: false, // y 线
// },
// axisLabel: {
// fontSize: 25, // Y
// color: '#fff', //
// // y
// },
// },
// series: [
// {
// data: this.rightData.map(item=>{return item.value}),
// type: 'bar',
// showBackground: true,
// backgroundStyle: {
// color: 'rgba(180, 180, 180, 0.2)'
// },
// barWidth: '60%',
// itemStyle: {
// borderRadius: [5, 5, 0, 0], //
// color: {
// type: 'linear', // 线
// x: 0, //
// y: 0,
// x2: 0, //
// y2: 1,
// colorStops: [
// { offset: 0, color: '#3399FF' }, //
// { offset: 0.5, color: '#08e5ff' }, //
// { offset: 1, color: '#F4f4f4' } //
// ]
// }
// }
// }
// ]
// };
this.option = {
xAxis: {
type: 'category',
data: categories,
axisLabel: {
fontSize: 19, // Y
color: '#fff', //
fontWight:'bold'
},
},
yAxis: {
type: 'value',
max: 100,
// axisLine: { show: false },
splitLine: {
show: false, // y 线
},
axisLabel: {
fontSize: 25, // Y
color: '#fff', //
// y
},
},
series: series
}
myChart.setOption(this.option);
},
},
} }
</script> </script>
@ -234,9 +369,16 @@ export default {
height: 90%; height: 90%;
.active-ring-name { .active-ring-name {
font-size: 25px !important; width: 150px;
font-size: 30px !important;
font-weight: bold;
height:100px;
}
.dv-digital-flop {
font-size: 100px;
// width: 100px;
// height: 30px;
font-weight: bold; font-weight: bold;
height:80px;
} }
} }
@ -389,7 +531,7 @@ export default {
font-weight: bold; font-weight: bold;
} }
.sc-name{ .sc-name{
font-size:25px; font-size:20px;
color: #ffffff; color: #ffffff;
font-weight: bold; font-weight: bold;
} }
@ -406,7 +548,11 @@ export default {
border-radius: 6px; border-radius: 6px;
} }
} }
.new-bar-chart{
position: absolute;
top: 110px;
left: 30px;
}
} }
</style> </style>

View File

@ -52,7 +52,7 @@ export default {
title: { title: {
text: '近一周产量趋势', text: '近一周产量趋势',
textStyle: { textStyle: {
fontSize:25, fontSize:30,
fontWight:'bold', fontWight:'bold',
color: '#fff' color: '#fff'
} }
@ -61,10 +61,14 @@ export default {
trigger: 'axis' trigger: 'axis'
}, },
legend: { legend: {
data: this.dataType == '整机' ? ['整机线'] : ['机芯1线', '机芯2线', '盖板线'], icon: 'rect',
itemWidth: 20, //
itemHeight: 20, //
itemGap: 40, //
data: this.dataType == '整机' ? ['整机线'] : ['整机', '机芯', '盖板'],
textStyle: { textStyle: {
color: '#fff', color: '#fff',
fontSize:25, fontSize:30,
fontWight:'bold' fontWight:'bold'
} }
}, },
@ -76,15 +80,21 @@ export default {
}, },
xAxis: { xAxis: {
type: 'category', type: 'category',
boundaryGap: false, boundaryGap: true,
axisLine: { axisLine: {
lineStyle: { lineStyle: {
color: '#fff' color: '#fff'
} }
}, },
axisLabel: { axisLabel: {
fontSize: 20, // Y fontSize: 35, // Y
color: '#fff' // color: '#fff', //
onZero: false ,// y
// x
// formatter: function (value, index) {
// return index % 2 === 1 ? value : ''; //
// }
}, },
data: getRecentWeekDates() data: getRecentWeekDates()
@ -96,9 +106,23 @@ export default {
color: '#fff' color: '#fff'
} }
}, },
splitLine: {
show: true, // y 线
lineStyle: {
type: 'dashed', // 线
color: '#999', // 线
width: 2, // 线
height:1,
dashArray: [15, 5]
}
},
axisLabel: { axisLabel: {
fontSize: 20, // Y fontSize: 35, // Y
color: '#fff' // color: '#fff', //
// y
formatter: function (value) {
return value % 200 === 0 ? value : ''; //
}
}, },
}, },
series: series:
@ -108,29 +132,48 @@ export default {
name: '整机线', name: '整机线',
type: 'line', type: 'line',
stack: 'Total', stack: 'Total',
data: [133, 162, 191, 134, 130, 230, 310] data: [133, 162, 191, 134, 130, 230, 310],
lineStyle: {
width: 4, // 线
}
} }
] : ] :
[ [
{ {
name: '芯1线', name: '机',
type: 'line', type: 'line',
stack: 'Total', stack: 'Total',
smooth: true,
data: [120, 132, 101, 134, 90, 230, 210], data: [120, 132, 101, 134, 90, 230, 210],
lineStyle: {
width: 4, // 线
},
symbolSize: 12, //
}, },
{ {
name: '机芯2线', name: '机芯',
type: 'line', type: 'line',
stack: 'Total', stack: 'Total',
data: [150, 142, 111, 114, 120, 120, 110] smooth: true,
data: [150, 142, 111, 114, 120, 120, 110],
lineStyle: {
width: 4, // 线
},
symbolSize: 12, //
}, },
{ {
name: '盖板线', name: '盖板',
type: 'line', type: 'line',
stack: 'Total', stack: 'Total',
data: [130, 232, 201, 154, 190, 330, 410] smooth: true,
} data: [130, 232, 201, 154, 190, 330, 410],
lineStyle: {
width: 4, // 线
},
symbolSize: 12, //
},
] ]
}; };
myChart.setOption(this.option); myChart.setOption(this.option);

View File

@ -22,6 +22,7 @@ function getRecentSixMonths() {
return months; return months;
} }
import { color } from 'chart.js/helpers';
import * as echarts from 'echarts'; import * as echarts from 'echarts';
export default { export default {
name: 'RoseChart', name: 'RoseChart',
@ -47,15 +48,15 @@ export default {
console.log(myChart) console.log(myChart)
this.option = { this.option = {
title: { title: {
text: '月生产情况', text: '近半年产量情况',
subtext: '完成率', // subtext: '',
subtextStyle:{ // subtextStyle:{
fontSize:20, // fontSize:20,
fontWight:'bold', // fontWight:'bold',
color:'#fff' // color:'#fff'
}, // },
textStyle:{ textStyle:{
fontSize:25, fontSize:30,
fontWight:'bold', fontWight:'bold',
color:'#fff' color:'#fff'
} }
@ -64,12 +65,24 @@ export default {
trigger: 'axis', trigger: 'axis',
}, },
legend: { legend: {
data: this.dataType == '整机' ?['机芯1线', '机芯2线', '盖板线'] : ['整机线'], icon: 'rect',
textStyle:{ itemWidth: 20, //
fontSize:25, itemHeight: 20, //
color:'#fff' itemGap: 40, //
data: this.dataType == '整机' ?['整机线']:['整机', '机芯', '盖板'],
textStyle: {
color: '#fff',
fontSize:30,
fontWight:'bold'
} }
}, },
grid: {
left: '3%',
right: '7%',
bottom: '3%',
containLabel: true
},
toolbox: { toolbox: {
}, },
calculable: true, calculable: true,
@ -82,7 +95,7 @@ export default {
} }
}, },
axisLabel: { axisLabel: {
fontSize: 20, // Y fontSize: 35, // Y
color: '#fff' // color: '#fff' //
}, },
// prettier-ignore // prettier-ignore
@ -98,9 +111,19 @@ export default {
} }
}, },
axisLabel: { axisLabel: {
fontSize: 20, // Y fontSize: 35, // Y
color: '#fff' // color: '#fff' //
}, },
splitLine: {
show: false, // y 线
lineStyle: {
type: 'dashed', // 线
color: '#999', // 线
width: 2, // 线
height:1,
dashArray: [15, 5]
}
},
} }
], ],
series: series:
@ -119,17 +142,25 @@ export default {
] ]
}, },
markLine: { markLine: {
data: [{ type: 'average', name: 'Avg' }] data: [{ type: 'average', name: 'Avg' }],
lineStyle:{
width: 2, // 线
},
label:{
fontSize:'20',
// color:'red'
}
} }
} }
]: ]:
[ [
{ {
name: '机芯1线', name: '机',
type: 'bar', type: 'bar',
data: [ data: [
75, 65, 68, 69, 40, 82 75, 65, 68, 69, 40, 82
], ],
barWidth: 30, // 20px
markPoint: { markPoint: {
data: [ data: [
{ type: 'max', name: 'Max' }, { type: 'max', name: 'Max' },
@ -137,15 +168,23 @@ export default {
] ]
}, },
markLine: { markLine: {
data: [{ type: 'average', name: 'Avg' }] data: [{ type: 'average', name: 'Avg' }],
lineStyle:{
width: 2, // 线
},
label:{
fontSize:'20',
color:'#ffffff'
}
} }
}, },
{ {
name: '机芯2线', name: '机芯',
type: 'bar', type: 'bar',
data: [ data: [
70, 75, 88, 85, 97, 85, 75, 78, 59, 80, 82, 63 70, 75, 88, 85, 97, 85, 75, 78, 59, 80, 82, 63
], ],
barWidth: 30, // 20px
markPoint: { markPoint: {
data: [ data: [
{ name: 'Max', value: 182.2, xAxis: 7, yAxis: 183 }, { name: 'Max', value: 182.2, xAxis: 7, yAxis: 183 },
@ -153,15 +192,23 @@ export default {
] ]
}, },
markLine: { markLine: {
data: [{ type: 'average', name: 'Avg' }] data: [{ type: 'average', name: 'Avg' }],
lineStyle:{
width: 2, // 线
},
label:{
fontSize:'20',
color:'#ffffff'
}
} }
}, },
{ {
name: '盖板线', name: '盖板',
type: 'bar', type: 'bar',
data: [ data: [
80, 85, 78, 75, 67, 45, 55, 68, 49, 50, 72, 93 80, 85, 78, 75, 67, 45, 55, 68, 49, 50, 72, 93
], ],
barWidth: 30, // 20px
markPoint: { markPoint: {
data: [ data: [
{ name: 'Max', value: 182.2, xAxis: 7, yAxis: 183 }, { name: 'Max', value: 182.2, xAxis: 7, yAxis: 183 },
@ -169,7 +216,14 @@ export default {
] ]
}, },
markLine: { markLine: {
data: [{ type: 'average', name: 'Avg' }] data: [{ type: 'average', name: 'Avg' }],
lineStyle:{
width: 2, // 线
},
label:{
fontSize:'20',
color:'#ffffff'
}
} }
} }
] ]

View File

@ -72,9 +72,9 @@ export default {
this.dataType = ''; // '1' this.dataType = ''; // '1'
} }
setInterval(() => { // setInterval(() => {
this.switchType = this.switchType == 1 ? 2 : 1 // this.switchType = this.switchType == 1 ? 2 : 1
}, 15000); // 10000 = 10 // }, 15000); // 10000 = 10
}, },
data() { data() {
return { return {

View File

@ -73,8 +73,8 @@
], ],
color: ['#3de7c9','#88a8f4','#ffdc9d','#eb7e41'], color: ['#3de7c9','#88a8f4','#ffdc9d','#eb7e41'],
lineWidth: 40, lineWidth: 40,
radius: '55%', radius: '75%',
activeRadius: '60%' activeRadius: '80%'
}, },
testchartData:[ testchartData:[
{ {
@ -94,6 +94,10 @@
name: "组件产量", name: "组件产量",
}, },
], ],
digitalFlopStyle: {
fontSize: 45,
fill: '#fff'
},
option: {} option: {}
} }
}, },