|
|
@@ -147,7 +147,7 @@
|
|
|
|
|
|
/* Grid 布局 */
|
|
|
display: grid;
|
|
|
- grid-template-columns: repeat(5, 1fr);
|
|
|
+ grid-template-columns: repeat(2, 1fr);
|
|
|
align-items: center;
|
|
|
padding: 0 10px;
|
|
|
}
|
|
|
@@ -321,7 +321,7 @@
|
|
|
/*background-color: #0000FF;*/
|
|
|
|
|
|
left: 60px;
|
|
|
- right: 1267px;
|
|
|
+ right: 990px;
|
|
|
|
|
|
background-image: url("${ctxStatic}/screen/imgs/srcrow3.png");
|
|
|
background-size: 100% 100%;
|
|
|
@@ -367,8 +367,8 @@
|
|
|
bottom: 90px;
|
|
|
/*background-color: #0000FF;*/
|
|
|
|
|
|
- left: 663px;
|
|
|
- right: 663px;
|
|
|
+ left: 940px;
|
|
|
+ right: 60px;
|
|
|
|
|
|
background-image: url("${ctxStatic}/screen/imgs/srcrow3.png");
|
|
|
background-size: 100% 100%;
|
|
|
@@ -477,29 +477,7 @@
|
|
|
<div class="screenmain">
|
|
|
<div class="screen-title-new">X13产线MES系统综合数据大屏</div>
|
|
|
<div class="row1">
|
|
|
- <div class="grid-item">
|
|
|
- <img class="main-icon" src="${ctxStatic}/screen/imgs/srcrow11.png" alt="icon">
|
|
|
- <div class="text-box">
|
|
|
- <div class="label">生产人数</div>
|
|
|
- <div class="value-row">
|
|
|
- <span class="num" id="workers"></span>
|
|
|
- <span class="unit">人</span>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
-
|
|
|
- <div class="grid-item">
|
|
|
- <img class="main-icon" src="${ctxStatic}/screen/imgs/srcrow12.png" alt="icon">
|
|
|
- <div class="text-box">
|
|
|
- <div class="label">设备数量</div>
|
|
|
- <div class="value-row">
|
|
|
- <span class="num" id="devices"></span>
|
|
|
- <span class="unit">个</span>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
-
|
|
|
- <div class="grid-item">
|
|
|
+ <div class="grid-item" id="planItem" style="display:none;">
|
|
|
<img class="main-icon" src="${ctxStatic}/screen/imgs/srcrow13.png" alt="icon">
|
|
|
<div class="text-box">
|
|
|
<div class="label">计划产量</div>
|
|
|
@@ -531,17 +509,6 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
-<!-- <div class="grid-item">-->
|
|
|
-<!-- <img class="main-icon" src="${ctxStatic}/screen/imgs/srcrow16.png" alt="icon">-->
|
|
|
-<!-- <div class="text-box">-->
|
|
|
-<!-- <div class="label">报废数量</div>-->
|
|
|
-<!-- <div class="value-row">-->
|
|
|
-<!-- <span class="num" id="scrap"></span>-->
|
|
|
-<!-- <span class="unit">个</span>-->
|
|
|
-<!-- </div>-->
|
|
|
-<!-- </div>-->
|
|
|
-<!-- </div>-->
|
|
|
</div>
|
|
|
|
|
|
<!--第二行-->
|
|
|
@@ -587,10 +554,6 @@
|
|
|
</table>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="row3-three">
|
|
|
- <div class="row3-item1">近7日产品质检信息</div>
|
|
|
- <div class="row3-item2" id="qualityChart"></div>
|
|
|
- </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
@@ -684,20 +647,32 @@
|
|
|
}
|
|
|
|
|
|
function formatData(){
|
|
|
- $("#workers").html(tjdata.workers);
|
|
|
- $("#devices").html(tjdata.devices);
|
|
|
- $("#plan").html(tjdata.plan);
|
|
|
- $("#actual").html(tjdata.actual);
|
|
|
- $("#repair").html(tjdata.repair);
|
|
|
- $("#scrap").html(tjdata.scrap);
|
|
|
-
|
|
|
-
|
|
|
- initAlarmList(tjdata.alarms);
|
|
|
- initDeviceFaultTop(tjdata.faulty1,tjdata.faultx);
|
|
|
- initDeviceFaultBottom(tjdata.faultx,tjdata.faulty1);
|
|
|
- initProductionChart(tjdata.date,tjdata.output); //近七日产量折线图
|
|
|
- initPerHourChart(tjdata.hourTimes,tjdata.perHourData);
|
|
|
- initQualityChart(tjdata.date,tjdata.quality1,tjdata.quality2);
|
|
|
+ if (!tjdata) return;
|
|
|
+ if (tjdata.plan != null) {
|
|
|
+ $("#plan").html(tjdata.plan);
|
|
|
+ $("#planItem").show();
|
|
|
+ $(".row1").css("grid-template-columns", "repeat(3, 1fr)");
|
|
|
+ } else {
|
|
|
+ $("#planItem").hide();
|
|
|
+ $(".row1").css("grid-template-columns", "repeat(2, 1fr)");
|
|
|
+ }
|
|
|
+ $("#actual").html(tjdata.actual != null ? tjdata.actual : '');
|
|
|
+ $("#repair").html(tjdata.repair != null ? tjdata.repair : '');
|
|
|
+
|
|
|
+ initAlarmList(tjdata.alarms || []);
|
|
|
+ if (tjdata.faultx && tjdata.faultx.length) {
|
|
|
+ $('.row2-three').show();
|
|
|
+ initDeviceFaultTop(tjdata.faulty1, tjdata.faultx);
|
|
|
+ initDeviceFaultBottom(tjdata.faultx, tjdata.faulty1);
|
|
|
+ } else {
|
|
|
+ $('.row2-three').hide();
|
|
|
+ }
|
|
|
+ if (tjdata.date && tjdata.output) {
|
|
|
+ initProductionChart(tjdata.date, tjdata.output);
|
|
|
+ }
|
|
|
+ if (tjdata.hourTimes && tjdata.perHourData) {
|
|
|
+ initPerHourChart(tjdata.hourTimes, tjdata.perHourData);
|
|
|
+ }
|
|
|
initOprnoList(tjdata.oprnoData);
|
|
|
}
|
|
|
//
|
|
|
@@ -1019,143 +994,12 @@
|
|
|
}
|
|
|
|
|
|
|
|
|
- function initQualityChart(xData,quality1,quality2) {
|
|
|
- let chartDom = document.getElementById('qualityChart');
|
|
|
- let myChart = echarts.init(chartDom);
|
|
|
-
|
|
|
- // 模拟图片中的数据
|
|
|
- let option = {
|
|
|
- // 图例组件
|
|
|
- legend: {
|
|
|
- data: ['良品', '不良'],
|
|
|
- top: 10,
|
|
|
- textStyle: {
|
|
|
- color: '#ffffff'
|
|
|
- },
|
|
|
- icon: 'roundRect', // 图例形状
|
|
|
- itemGap: 40,
|
|
|
- itemWidth: 15,
|
|
|
- itemHeight: 10
|
|
|
- },
|
|
|
- tooltip: {
|
|
|
- trigger: 'axis', // 多柱对比通常用 axis 触发
|
|
|
- axisPointer: {
|
|
|
- type: 'shadow'
|
|
|
- },
|
|
|
- backgroundColor: 'rgba(20, 55, 120, 0.8)',
|
|
|
- borderColor: '#008FFD',
|
|
|
- textStyle: { color: '#fff' }
|
|
|
- },
|
|
|
- grid: {
|
|
|
- top: '20%', // 留出空间给图例和数值标签
|
|
|
- left: '3%',
|
|
|
- right: '4%',
|
|
|
- bottom: '5%',
|
|
|
- containLabel: true
|
|
|
- },
|
|
|
- xAxis: {
|
|
|
- type: 'category',
|
|
|
- data: xData,
|
|
|
- axisLine: {
|
|
|
- show: true,
|
|
|
- lineStyle: { color: '#2A4E77' }
|
|
|
- },
|
|
|
- axisTick: { show: false },
|
|
|
- axisLabel: {
|
|
|
- color: '#FFFFFF',
|
|
|
- fontSize: 12,
|
|
|
- margin: 15
|
|
|
- }
|
|
|
- },
|
|
|
- yAxis: {
|
|
|
- type: 'value',
|
|
|
- // max: 500, // 根据图片刻度
|
|
|
- // splitNumber: 5,
|
|
|
- axisLine: {
|
|
|
- show: true,
|
|
|
- lineStyle: { color: '#2A4E77' }
|
|
|
- },
|
|
|
- axisTick: { show: false },
|
|
|
- axisLabel: {
|
|
|
- color: '#FFFFFF',
|
|
|
- fontSize: 12
|
|
|
- },
|
|
|
- splitLine: {
|
|
|
- show: true,
|
|
|
- lineStyle: {
|
|
|
- color: 'rgba(255, 255, 255, 0.05)',
|
|
|
- type: 'solid'
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- series: [
|
|
|
- {
|
|
|
- name: '良品',
|
|
|
- type: 'bar',
|
|
|
- data: quality1,
|
|
|
- barWidth: 12, // 柱子稍微细一点,因为有三根
|
|
|
- itemStyle: {
|
|
|
- color: '#1E90FF', // 亮蓝色
|
|
|
- barBorderRadius: [5, 5, 0, 0] // 圆角
|
|
|
- },
|
|
|
- label: {
|
|
|
- show: true,
|
|
|
- position: 'top',
|
|
|
- color: '#FFFFFF',
|
|
|
- fontSize: 10,
|
|
|
- distance: 2
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- name: '不良',
|
|
|
- type: 'bar',
|
|
|
- data: quality2,
|
|
|
- barWidth: 12,
|
|
|
- itemStyle: {
|
|
|
- color: '#FFD700', // 金黄色
|
|
|
- barBorderRadius: [5, 5, 0, 0]
|
|
|
- },
|
|
|
- label: {
|
|
|
- show: true,
|
|
|
- position: 'top',
|
|
|
- color: '#FFFFFF',
|
|
|
- fontSize: 10,
|
|
|
- distance: 2
|
|
|
- }
|
|
|
- },
|
|
|
- // {
|
|
|
- // name: '报废',
|
|
|
- // type: 'bar',
|
|
|
- // data: dataScrap,
|
|
|
- // barWidth: 12,
|
|
|
- // itemStyle: {
|
|
|
- // color: '#FF0000', // 红色
|
|
|
- // barBorderRadius: [5, 5, 0, 0]
|
|
|
- // },
|
|
|
- // label: {
|
|
|
- // show: true,
|
|
|
- // position: 'top',
|
|
|
- // color: '#FFFFFF',
|
|
|
- // fontSize: 10,
|
|
|
- // distance: 2
|
|
|
- // }
|
|
|
- // }
|
|
|
- ]
|
|
|
- };
|
|
|
-
|
|
|
- myChart.setOption(option);
|
|
|
-
|
|
|
- window.addEventListener("resize", function () {
|
|
|
- myChart.resize();
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- // 2. 新增初始化函数
|
|
|
function initAlarmList(tableData) {
|
|
|
- // 虚拟数据
|
|
|
let html = '';
|
|
|
+ if (!tableData || !tableData.length) {
|
|
|
+ $('#alarmList').html('');
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
// 遍历数据拼接 HTML
|
|
|
for (let i = 0; i < tableData.length; i++) {
|
|
|
@@ -1342,8 +1186,6 @@
|
|
|
type: 'value',
|
|
|
name: '',
|
|
|
min: 0,
|
|
|
- max: 1200,
|
|
|
- interval: 200,
|
|
|
axisLabel: { color: '#fff' },
|
|
|
axisLine: { show: true, lineStyle: { color: '#2A4E77' } },
|
|
|
splitLine: { show: false }
|