<!DOCTYPE html>
|
<html lang="zh-cn">
|
|
<head>
|
<meta charset="UTF-8">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
<title>DaLian14</title>
|
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
|
<link rel="stylesheet" type="text/css" href="css/bootstrap-table.min.css">
|
<link rel="stylesheet" type="text/css" href="css/index.css">
|
<script src="js/jquery.min.js"></script>
|
<script src='js/echarts.min.js'></script>
|
<script src="js/bootstrap.min.js"></script>
|
<script src='js/bootstrap-table.min.js'></script>
|
<script src='js/bootstrap-table-zh-CN.min.js'></script>
|
<script src="js/jquery.SuperSlide.2.1.3.js"></script>
|
<script src='js/template.js'></script>
|
<script src="js/jquery.qrcode.min.js"></script>
|
<style>
|
.clock #Date {
|
font-family: 'BebasNeueRegular', Arial, Helvetica, sans-serif;
|
font-size: 20px;
|
text-align: center;
|
text-shadow: 0 0 0px #00c6ff;
|
float: left;
|
margin-right: 20px
|
}
|
|
.clock ul {
|
width: 450px;
|
margin: 0 auto;
|
padding: 0px;
|
list-style: none;
|
text-align: left;
|
margin-left: 0px;
|
}
|
|
.clock ul li {
|
display: inline;
|
font-size: 20px;
|
text-align: left;
|
font-family: 'BebasNeueRegular', Arial, Helvetica, sans-serif;
|
text-shadow: 0 0 0px #00c6ff;
|
}
|
|
body {
|
padding-left: 50px;
|
padding-right: 50px;
|
}
|
|
.title {
|
|
font-size: 44px;
|
font-family: PingFangSC;
|
font-weight: 500;
|
color: rgba(9, 209, 234, 1);
|
text-align: center;
|
background: url(img/img_little_new.png) center no-repeat;
|
margin-bottom: 10px;
|
}
|
|
.flex {
|
display: flex;
|
display: -webkit-flex;
|
justify-content: space-between;
|
flex-direction: row;
|
flex-wrap: wrap;
|
}
|
|
.flex .flex_item {
|
width: 16%;
|
height: 180px;
|
border: 3px solid #080c1c;
|
border-radius: 5px;
|
margin-bottom: 10px;
|
background: url(img/3-3.png) #02040d no-repeat center top;
|
position: relative;
|
|
|
}
|
|
.flex span {
|
position: absolute;
|
top: 50%;
|
|
margin-top: 0;
|
font-size: 23px;
|
font-family: PingFangSC;
|
font-weight: 400;
|
color: rgba(255, 255, 255, 1);
|
width: 100%;
|
text-align: center;
|
}
|
|
.flex p {
|
|
margin-bottom: 5px;
|
color: #a5a5a7;
|
position: absolute;
|
bottom: 0;
|
font-size: 16px;
|
font-family: PingFangSC;
|
font-weight: 400;
|
width: 100%
|
}
|
|
.title_o {
|
margin-top: 15px;
|
margin-bottom: 10px;
|
font-size: 18px;
|
font-family: PingFangSC;
|
font-weight: 400;
|
color: rgba(9, 209, 234, 1);
|
}
|
|
.title_p {
|
font-size: 18px;
|
color: rgba(9, 209, 234, 1);
|
font-family: PingFangSC;
|
font-weight: 400;
|
text-align: left;
|
}
|
|
.p_icon {
|
text-align: right;
|
font-size: 12px;
|
font-family: PingFangSC;
|
font-weight: 400;
|
color: #ffffff;
|
}
|
|
.div_two {
|
display: flex;
|
display: -webkit-flex;
|
justify-content: space-between;
|
flex-direction: row;
|
flex-wrap: wrap;
|
}
|
|
.div_1 {
|
width: 49.6%;
|
|
}
|
|
.p_icon i {
|
display: inline-block;
|
width: 30px;
|
height: 10px;
|
margin-right: 6px;
|
border-radius: 5px;
|
|
}
|
|
.pt {
|
padding-top: 20px;
|
}
|
|
.p_icon span {
|
margin-right: 10px;
|
}
|
|
.color1 {
|
background: rgba(56, 153, 161, 1);
|
}
|
|
.color2 {
|
background: rgba(51, 56, 91, 1);
|
}
|
|
.color3 {
|
background: rgba(204, 57, 94, 1);
|
}
|
|
.div_style1 {
|
background: rgba(4, 4, 5, 0) rgba(8, 14, 45, 0.28);
|
border-radius: 8px;
|
border: 2px solid rgba(39, 51, 91, 0.5);
|
}
|
|
.div_two_style {
|
height: 440px;
|
width: 100%;
|
padding: 20px 30px;
|
background: rgba(8, 14, 45, 0.28);
|
border: 2px solid rgba(39, 51, 91, 0.5);
|
border-radius: 5px;
|
margin-bottom: 30px;
|
}
|
|
.title_text {
|
color: #09D1EA;
|
font-size: 16px;
|
font-family: PingFangSC-Regular, PingFang SC;
|
font-weight: 400;
|
}
|
|
.title_list {
|
float: right;
|
color: #fff;
|
font-size: 14px;
|
overflow: hidden;
|
}
|
|
.title_list li {
|
float: left;
|
margin-left: 30px;
|
|
}
|
|
.title_list li img {
|
margin-right: 10px;
|
;
|
}
|
|
.div_two_style:nth-child(1) {
|
margin-top: 48px
|
}
|
</style>
|
</head>
|
|
<body>
|
<div class='title'>GP12工序管理看板</div>
|
<div class="col-sm-12">
|
<div class="header">
|
<div class="clock">
|
<ul>
|
<li id="Date"></li>
|
<li id="hours"> </li>
|
<li id="point">:</li>
|
<li id="min"> </li>
|
<li id="point">:</li>
|
<li id="sec"> </li>
|
</ul>
|
</div>
|
</div>
|
</div>
|
|
<div id='box'></div>
|
<script>
|
$(document).ready(function () {
|
var dateV = [];
|
var interval;//计时器
|
var num = 0;
|
var a;
|
// 创建两个变量,一个数组中的月和日的名称
|
// 创建两个变量,一个数组中的月和日的名称
|
var monthNames = ["1 月", "2 月", "3 月", "4 月", "5 月", "6 月", "7 月", "8 月", "9 月", "10 月", "11 月", "12 月"];
|
setInterval(function () {
|
$.ajax({
|
url: 'http://172.16.72.3:86/DaLian/DateTime',
|
dataType: "JSON",
|
type: "POST",
|
success: function (data) {
|
$('#Date').html(data[0].FULLYEAR + " 年" + " " + monthNames[data[0].FULLMONTH - 1] + ' ' + data[0].FULLDATE + " 日 " + ' ' + data[0].FULLXQ);
|
$("#sec").html(data[0].FULLSECONDS);
|
$("#min").html(data[0].FULLMINUTES);
|
$("#hours").html(data[0].FULLHOURS);
|
year = data[0].FULLSECONDS;
|
},
|
error: function (data) {
|
|
}
|
})
|
}, 1000);
|
getData();
|
a = setInterval(function () {
|
getData();
|
}, 60000);
|
function getData() {
|
num += 1;
|
let dataJson = {
|
limit: 2,
|
offset: num
|
}
|
$.ajax({
|
url: "http://47.96.171.127:93/InteAI/GPData",
|
data: dataJson,
|
dataType: "JSON",
|
type: "POST",
|
success: function (data) {
|
var num_total = (data.total) / 2
|
if (num >= num_total) {
|
num = 0
|
}
|
//重组数据
|
var arr = [] //数组
|
var color_arr = ['#09D1EA', '#425DF5', '#7338F9']
|
var img_arr = ['img/GP_1.png', 'img/GP_2.png', 'img/GP_3.png']
|
var options = []
|
for (var i = 0; i < data.rows.length; i++) {
|
var one = {
|
name: data.rows[i].PartName,
|
code: data.rows[i].PartNumber,
|
time_arr: [],
|
children: []
|
}
|
for (var j = 0; j < data.rows[i].children.length; j++) {
|
var two = {
|
DefectName: data.rows[i].children[j].DefectName,
|
Qty_arr: []
|
}
|
|
for (var y = 0; y < data.rows[i].children[j].children.length; y++) {
|
two.Qty_arr.push(data.rows[i].children[j].children[y].Qty)
|
|
}
|
one.children.push(two)
|
}
|
arr.push(one)
|
for (var k = 0; k < 1; k++) {
|
for (var g = 0; g < data.rows[i].children[0].children.length; g++) {
|
one.time_arr.push(data.rows[i].children[0].children[g].DataTime)
|
}
|
|
}
|
}
|
var Html = ''
|
for (var i = 0; i < arr.length; i++) {
|
var obj = []
|
Html += "<div class='div_two_style'>";
|
Html += "<span class='title_text'>" + arr[i].name + "</span> ";
|
Html += "<ul class='title_list'>";
|
for (var j = 0; j < arr[i].children.length; j++) {
|
Html += "<li><img src='" + img_arr[j] + "'/>" + arr[i].children[j].DefectName + "</li>";
|
var obj_len = {
|
name: arr[i].children[j].DefectName,
|
type: 'line',
|
data: arr[i].children[j].Qty_arr,
|
axisLabel: {
|
show: true,
|
color: '#fff',
|
|
},
|
|
lineStyle: {
|
normal: {
|
width: 4,
|
color: color_arr[j],//颜色
|
|
}
|
},
|
label: {
|
show: true,
|
position: 'top',
|
textStyle: {
|
color: '#fff',
|
}
|
},
|
symbolSize: 8,
|
type: "line",
|
symbol: "circle",
|
itemStyle: {
|
normal: {
|
color: '#000',
|
borderWidth: 3,
|
borderColor: color_arr[j]//颜色
|
}
|
},
|
|
tooltip: { show: false },
|
smooth: true
|
};
|
obj.push(obj_len)
|
}
|
console.log(obj)
|
options.push(view(arr[i].time_arr, obj))
|
Html += "</ul>";
|
Html += "<div id='main" + i + "' style='width: 100%;height:385px;' '></div>";
|
Html += "</div>";
|
}
|
$("#box").html('');
|
|
$("#box").append(Html);
|
var myChart = echarts.init(document.getElementById('main0'));
|
var myChart1 = echarts.init(document.getElementById('main1'));
|
myChart.setOption(options[0]);
|
myChart1.setOption(options[1]);
|
},
|
error: function (data) {
|
|
}
|
})
|
}
|
function view(time, series_data) {
|
var option = {
|
backgroundColor: '#040405',
|
tooltip: {
|
trigger: ''
|
},
|
grid: {
|
top: 'middle',
|
left: '3%',
|
right: '4%',
|
bottom: '3%',
|
height: '83%',
|
},
|
xAxis: {
|
type: 'category',
|
data: time, //统一日期
|
axisLine: {
|
lineStyle: {
|
color: "#848586"
|
}
|
},
|
axisTick: { show: false },
|
splitLine: {
|
show: false,
|
lineStyle: {
|
width: 1,
|
type: "dashed",
|
color: "#848586"
|
}
|
},
|
},
|
yAxis: {
|
type: 'value',
|
splitLine: {
|
show: false,
|
},
|
axisTick: { show: false },
|
axisLine: {
|
show: true,
|
lineStyle: {
|
color: "#848586",
|
},
|
},
|
nameTextStyle: {
|
color: "#848586"
|
},
|
splitArea: {
|
show: false
|
}
|
},
|
series: series_data,
|
};
|
return option
|
}
|
});
|
|
|
</script>
|
</body>
|
|
</html>
|