Commit f3c7a8cc authored by 李苏's avatar 李苏 💬

改url

parent 68c26e11
...@@ -172,7 +172,7 @@ ...@@ -172,7 +172,7 @@
}); });
} }
/* 日排除合格率 */ /* 日排除合格率 */
function apisetRpcHglEchart(chartHgl){ function apisetRpcHglEchart(chartHgl,isRcl){
function gethgl(){ function gethgl(){
return new Promise(function(y,n){ return new Promise(function(y,n){
HTTP.post("queryGpfkHgl", {}, function(result) { HTTP.post("queryGpfkHgl", {}, function(result) {
...@@ -202,7 +202,11 @@ ...@@ -202,7 +202,11 @@
data.forEach(function(e,index){ data.forEach(function(e,index){
data[index].jhrq=new Date(e.pcrq).toLocaleDateString().split('/').join('-') data[index].jhrq=new Date(e.pcrq).toLocaleDateString().split('/').join('-')
}) })
if(isRcl=='rcl'){
setRclHglEchart(chartHgl,ye,data)
}else{
setRpcHglEchart(chartHgl,ye,data) setRpcHglEchart(chartHgl,ye,data)
}
} else { } else {
console.log("请求失败") console.log("请求失败")
} }
......
$(function () { $(function() {
/*ceshis();*/ /*ceshis();*/
// ceshis1(); // ceshis1();
...@@ -46,7 +46,9 @@ $(function () { ...@@ -46,7 +46,9 @@ $(function () {
value: 6 value: 6
} }
]; ];
var color = ["#8d7fec", "#5085f2", "#e75fc3", "#f87be2", "#f2719a", "#fca4bb", "#f59a8f", "#fdb301", "#57e7ec", "#cf9ef1"] var color = ["#8d7fec", "#5085f2", "#e75fc3", "#f87be2", "#f2719a", "#fca4bb", "#f59a8f", "#fdb301",
"#57e7ec", "#cf9ef1"
]
var xdata = ['天猫', "京东", "苏宁易购", "拼多多", '国美', '亚马逊', '唯品会', '唯品会']; var xdata = ['天猫', "京东", "苏宁易购", "拼多多", '国美', '亚马逊', '唯品会', '唯品会'];
...@@ -159,7 +161,7 @@ $(function () { ...@@ -159,7 +161,7 @@ $(function () {
myChart.currentIndex = -1; myChart.currentIndex = -1;
setInterval(function () { setInterval(function() {
var dataLen = option.series[0].data.length; var dataLen = option.series[0].data.length;
// 取消之前高亮的图形 // 取消之前高亮的图形
myChart.dispatchAction({ myChart.dispatchAction({
...@@ -178,10 +180,11 @@ $(function () { ...@@ -178,10 +180,11 @@ $(function () {
// 使用刚指定的配置项和数据显示图表。 // 使用刚指定的配置项和数据显示图表。
/*myChart.setOption(option);*/ /*myChart.setOption(option);*/
window.addEventListener("resize",function(){ window.addEventListener("resize", function() {
myChart.resize(); myChart.resize();
}); });
} }
function ceshis2() { function ceshis2() {
var myChart = echarts.init(document.getElementById('chart3')); var myChart = echarts.init(document.getElementById('chart3'));
...@@ -225,7 +228,9 @@ $(function () { ...@@ -225,7 +228,9 @@ $(function () {
"type": "pie", "type": "pie",
"center": ["50%", "40%"], "center": ["50%", "40%"],
"radius": ["20%", "43%"], "radius": ["20%", "43%"],
"color": ["#FEE449", "#00FFFF", "#00FFA8", "#9F17FF", "#FFE400", "#F76F01", "#01A4F7", "#FE2C8A"], "color": ["#FEE449", "#00FFFF", "#00FFA8", "#9F17FF", "#FFE400", "#F76F01",
"#01A4F7", "#FE2C8A"
],
"startAngle": 135, "startAngle": 135,
"labelLine": { "labelLine": {
"normal": { "normal": {
...@@ -381,7 +386,7 @@ $(function () { ...@@ -381,7 +386,7 @@ $(function () {
myChart.currentIndex = -1; myChart.currentIndex = -1;
//myChart.setOption(option); //myChart.setOption(option);
//console.log(option.series[0].data[0]); //console.log(option.series[0].data[0]);
setInterval(function () { setInterval(function() {
var dataLen = option.series[0].data.length; var dataLen = option.series[0].data.length;
// 取消之前高亮的图形 // 取消之前高亮的图形
myChart.dispatchAction({ myChart.dispatchAction({
...@@ -398,10 +403,11 @@ $(function () { ...@@ -398,10 +403,11 @@ $(function () {
}); });
}, 1000); }, 1000);
window.addEventListener("resize",function(){ window.addEventListener("resize", function() {
myChart.resize(); myChart.resize();
}); });
} }
function ceshis3() { function ceshis3() {
var myChart = echarts.init(document.getElementById('chart4')); var myChart = echarts.init(document.getElementById('chart4'));
...@@ -422,7 +428,9 @@ $(function () { ...@@ -422,7 +428,9 @@ $(function () {
for (var i = 0; i < params.length; i++) { for (var i = 0; i < params.length; i++) {
// 获取每个系列对应的颜色值 // 获取每个系列对应的颜色值
html += '<span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:' + params[i].color + ';"></span>'; html +=
'<span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:' +
params[i].color + ';"></span>';
// 通过判断指定系列增加 % 符号 // 通过判断指定系列增加 % 符号
if (option.series[params[i].seriesIndex].type == "line") { if (option.series[params[i].seriesIndex].type == "line") {
...@@ -553,10 +561,11 @@ $(function () { ...@@ -553,10 +561,11 @@ $(function () {
}; };
// 使用刚指定的配置项和数据显示图表。 // 使用刚指定的配置项和数据显示图表。
myChart.setOption(option); myChart.setOption(option);
window.addEventListener("resize",function(){ window.addEventListener("resize", function() {
myChart.resize(); myChart.resize();
}); });
} }
function ceshis4() { function ceshis4() {
var myChart = echarts.init(document.getElementById('chart5')); var myChart = echarts.init(document.getElementById('chart5'));
...@@ -750,7 +759,8 @@ $(function () { ...@@ -750,7 +759,8 @@ $(function () {
"position": "top", "position": "top",
formatter: function(params) { formatter: function(params) {
var index = params.dataIndex; var index = params.dataIndex;
var str = "{a|" + params.value + "}\n{c|" + params.value + "个}"; var str = "{a|" + params.value + "}\n{c|" + params.value +
"个}";
return str; return str;
}, },
"rich": { "rich": {
...@@ -810,7 +820,8 @@ $(function () { ...@@ -810,7 +820,8 @@ $(function () {
"position": "top", "position": "top",
formatter: function(params) { formatter: function(params) {
var index = params.dataIndex; var index = params.dataIndex;
var str = "{a|" + params.value + "}\n{c|" + params.value + "个}"; var str = "{a|" + params.value + "}\n{c|" + params.value +
"个}";
return str; return str;
}, },
"rich": { "rich": {
...@@ -870,7 +881,8 @@ $(function () { ...@@ -870,7 +881,8 @@ $(function () {
"position": "top", "position": "top",
formatter: function(params) { formatter: function(params) {
var index = params.dataIndex; var index = params.dataIndex;
var str = "{a|" + params.value + "}\n{c|" + params.value + "个}"; var str = "{a|" + params.value + "}\n{c|" + params.value +
"个}";
return str; return str;
}, },
"rich": { "rich": {
...@@ -929,7 +941,8 @@ $(function () { ...@@ -929,7 +941,8 @@ $(function () {
"show": true, "show": true,
formatter: function(params) { formatter: function(params) {
var index = params.dataIndex; var index = params.dataIndex;
var str = "{a|" + params.value + "}\n{c|" + params.value + "个}"; var str = "{a|" + params.value + "}\n{c|" + params.value +
"个}";
return str; return str;
}, },
"position": "top", "position": "top",
...@@ -990,7 +1003,8 @@ $(function () { ...@@ -990,7 +1003,8 @@ $(function () {
"position": "top", "position": "top",
formatter: function(params) { formatter: function(params) {
var index = params.dataIndex; var index = params.dataIndex;
var str = "{a|" + params.value + "}\n{c|" + params.value + "个}"; var str = "{a|" + params.value + "}\n{c|" + params.value +
"个}";
return str; return str;
}, },
"rich": { "rich": {
...@@ -1050,7 +1064,8 @@ $(function () { ...@@ -1050,7 +1064,8 @@ $(function () {
"position": "top", "position": "top",
formatter: function(params) { formatter: function(params) {
var index = params.dataIndex; var index = params.dataIndex;
var str = "{a|" + params.value + "}\n{c|" + params.value + "个}"; var str = "{a|" + params.value + "}\n{c|" + params.value +
"个}";
return str; return str;
}, },
"rich": { "rich": {
...@@ -1110,7 +1125,8 @@ $(function () { ...@@ -1110,7 +1125,8 @@ $(function () {
"position": "top", "position": "top",
formatter: function(params) { formatter: function(params) {
var index = params.dataIndex; var index = params.dataIndex;
var str = "{a|" + params.value + "}\n{c|" + params.value + "个}"; var str = "{a|" + params.value + "}\n{c|" + params.value +
"个}";
return str; return str;
}, },
"rich": { "rich": {
...@@ -1170,7 +1186,7 @@ $(function () { ...@@ -1170,7 +1186,7 @@ $(function () {
} }
// 使用刚指定的配置项和数据显示图表。 // 使用刚指定的配置项和数据显示图表。
myChart.setOption(option); myChart.setOption(option);
window.addEventListener("resize",function(){ window.addEventListener("resize", function() {
myChart.resize(); myChart.resize();
}); });
} }
...@@ -1181,31 +1197,31 @@ $(function () { ...@@ -1181,31 +1197,31 @@ $(function () {
var uploadedDataURL = "./js/data-1528971808162-BkOXf61WX.json"; var uploadedDataURL = "./js/data-1528971808162-BkOXf61WX.json";
//console.log(uploadedDataURL); //console.log(uploadedDataURL);
// echarts.extendsMap = function(id, opt) { // echarts.extendsMap = function(id, opt) {
// // 实例 // // 实例
// var cityMap = { // var cityMap = {
// "郑州市": zhengzhou, // "郑州市": zhengzhou,
// "开封市": kaifeng, // "开封市": kaifeng,
// "洛阳市": luoyang, // "洛阳市": luoyang,
// "平顶山市": pingdingshan, // "平顶山市": pingdingshan,
// "安阳市": anyang, // "安阳市": anyang,
// "鹤壁市": hebi, // "鹤壁市": hebi,
// "新乡市": xinxiang, // "新乡市": xinxiang,
// "焦作市": jiaozuo, // "焦作市": jiaozuo,
// "濮阳市": puyang, // "濮阳市": puyang,
// "漯河市": luohe, // "漯河市": luohe,
// "三门峡市": sanmenxia, // "三门峡市": sanmenxia,
// "南阳市": nanyang, // "南阳市": nanyang,
// "商丘市": shangqiu, // "商丘市": shangqiu,
// "信阳市": xinyang, // "信阳市": xinyang,
// "周口市": zhoukou, // "周口市": zhoukou,
// "许昌市": xuchang, // "许昌市": xuchang,
// "驻马店市": zhumadian // "驻马店市": zhumadian
// }; // };
// } // }
var geoGpsMap = { var geoGpsMap = {
'1': [116.4071, 39.9046], '1': [116.4071, 39.9046],
'2': [125.8154, 44.2584], '2': [125.8154, 44.2584],
...@@ -1456,9 +1472,15 @@ $(function () { ...@@ -1456,9 +1472,15 @@ $(function () {
var colors = [ var colors = [
["#1DE9B6", "#1DE9B6", "#FFDB5C", "#FFDB5C", "#04B9FF", "#04B9FF"], ["#1DE9B6", "#1DE9B6", "#FFDB5C", "#FFDB5C", "#04B9FF", "#04B9FF"],
["#1DE9B6", "#F46E36", "#04B9FF", "#5DBD32", "#FFC809", "#FB95D5", "#BDA29A", "#6E7074", "#546570", "#C4CCD3"], ["#1DE9B6", "#F46E36", "#04B9FF", "#5DBD32", "#FFC809", "#FB95D5", "#BDA29A", "#6E7074",
["#37A2DA", "#67E0E3", "#32C5E9", "#9FE6B8", "#FFDB5C", "#FF9F7F", "#FB7293", "#E062AE", "#E690D1", "#E7BCF3", "#9D96F5", "#8378EA", "#8378EA"], "#546570", "#C4CCD3"
["#DD6B66", "#759AA0", "#E69D87", "#8DC1A9", "#EA7E53", "#EEDD78", "#73A373", "#73B9BC", "#7289AB", "#91CA8C", "#F49F42"], ],
["#37A2DA", "#67E0E3", "#32C5E9", "#9FE6B8", "#FFDB5C", "#FF9F7F", "#FB7293", "#E062AE",
"#E690D1", "#E7BCF3", "#9D96F5", "#8378EA", "#8378EA"
],
["#DD6B66", "#759AA0", "#E69D87", "#8DC1A9", "#EA7E53", "#EEDD78", "#73A373", "#73B9BC",
"#7289AB", "#91CA8C", "#F49F42"
],
]; ];
var colorIndex = 0; var colorIndex = 0;
$(function() { $(function() {
...@@ -1920,7 +1942,7 @@ $(function () { ...@@ -1920,7 +1942,7 @@ $(function () {
// 使用刚指定的配置项和数据显示图表。 // 使用刚指定的配置项和数据显示图表。
//myChart.setOption(option); //myChart.setOption(option);
window.addEventListener("resize",function(){ window.addEventListener("resize", function() {
myChart.resize(); myChart.resize();
}); });
...@@ -1930,7 +1952,7 @@ $(function () { ...@@ -1930,7 +1952,7 @@ $(function () {
var myChart = echarts.init(document.getElementById('chart_1')); var myChart = echarts.init(document.getElementById('chart_1'));
// 使用刚指定的配置项和数据显示图表。 // 使用刚指定的配置项和数据显示图表。
myChart.setOption(option); myChart.setOption(option);
window.addEventListener("resize",function(){ window.addEventListener("resize", function() {
myChart.resize(); myChart.resize();
}); });
} }
...@@ -1938,17 +1960,85 @@ $(function () { ...@@ -1938,17 +1960,85 @@ $(function () {
}); });
/* oa考勤图标 */
function oaechart(chart) {
option = {
color: ['#7FFF00', 'red', '#666'],
title: {
text: '',
left: 'center'
},
tooltip: {
trigger: 'item'
},
grid: {
top: "10%",
left: "5%",
bottom: "0%",
right: "10%",
containLabel: true,
},
// legend: {
// data: ['出勤', '缺勤', '休假'],
// orient: 'vertical', //垂直显示
// y: 'top', //延Y轴居中
// x: 'left', //居右显示
// textStyle: { //图例文字的样式
// color: '#fff',
// fontSize: 12
// }
// },
series: [{
name: '考勤',
type: 'pie',
radius: '60%',
data: [{
value: 30,
name: '出勤'
},
{
value: 10,
name: '缺勤'
},
{
value: 12,
name: '休假'
},
],
itemStyle: {
normal: {
label: {
show: true,
// formatter: '{b} : {c} ({d}%)'
formatter: '{b}:({d}%)'
},
labelLine: {
show: true
}
}
},
}
]
};
chart.setOption(option, true);
}
/*时段产量图表*/ /*时段产量图表*/
function setTimeProductionEchart(chart,apidata) { function setTimeProductionEchart(chart, apidata) {
if(apidata){ if (apidata) {
var list=[] var list = []
apidata.xseriesList.forEach(function(e,index){ apidata.xseriesList.forEach(function(e, index) {
list[index]={date:e,value:apidata.timeperiodMount[index]} list[index] = {
date: e,
value: apidata.timeperiodMount[index]
}
}) })
var data=[{name: "产量",list:list}] var data = [{
}else{ name: "产量",
var data = [ list: list
{ }]
} else {
var data = [{
name: "产量", name: "产量",
list: [{ list: [{
date: "周一", date: "周一",
...@@ -1979,16 +2069,15 @@ function setTimeProductionEchart(chart,apidata) { ...@@ -1979,16 +2069,15 @@ function setTimeProductionEchart(chart,apidata) {
value: 14 value: 14
} }
] ]
}];
} }
]; var dateList = [];
}
var dateList=[];
var yData1 = []; var yData1 = [];
data[0].list.forEach(function(item,index){ data[0].list.forEach(function(item, index) {
dateList.push(data[0].list[index].date); dateList.push(data[0].list[index].date);
yData1.push(data[0].list[index].value); yData1.push(data[0].list[index].value);
}); });
var opsChart={ var opsChart = {
color: ['#e08f68'], color: ['#e08f68'],
tooltip: { tooltip: {
...@@ -1998,7 +2087,8 @@ function setTimeProductionEchart(chart,apidata) { ...@@ -1998,7 +2087,8 @@ function setTimeProductionEchart(chart,apidata) {
}, },
formatter: function(params) { formatter: function(params) {
var tiplabel = params[0].name + '<br/>' + var tiplabel = params[0].name + '<br/>' +
'<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:' + params[0].color.colorStops[0].color + '"></span>' + '<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:' +
params[0].color.colorStops[0].color + '"></span>' +
params[0].seriesName + ':' + params[0].value; params[0].seriesName + ':' + params[0].value;
return tiplabel; return tiplabel;
} }
...@@ -2012,7 +2102,7 @@ function setTimeProductionEchart(chart,apidata) { ...@@ -2012,7 +2102,7 @@ function setTimeProductionEchart(chart,apidata) {
} }
}, },
grid: { grid: {
top:"10%", top: "10%",
left: "5%", left: "5%",
bottom: "0%", bottom: "0%",
right: "5%", right: "5%",
...@@ -2031,14 +2121,14 @@ function setTimeProductionEchart(chart,apidata) { ...@@ -2031,14 +2121,14 @@ function setTimeProductionEchart(chart,apidata) {
fontSize: 12 fontSize: 12
}, },
color: 'rgba(255,255,255,0.6)', color: 'rgba(255,255,255,0.6)',
formatter:function(value){ formatter: function(value) {
var str = ""; var str = "";
var num = 6; //每行显示字数 var num = 6; //每行显示字数
var valLength = value.length; //该项x轴字数 var valLength = value.length; //该项x轴字数
var rowNum = Math.ceil(valLength / num); // 行数 var rowNum = Math.ceil(valLength / num); // 行数
if(rowNum > 1) { if (rowNum > 1) {
for(var i = 0; i < rowNum; i++) { for (var i = 0; i < rowNum; i++) {
var temp = ""; var temp = "";
var start = i * num; var start = i * num;
var end = start + num; var end = start + num;
...@@ -2064,8 +2154,8 @@ function setTimeProductionEchart(chart,apidata) { ...@@ -2064,8 +2154,8 @@ function setTimeProductionEchart(chart,apidata) {
}, },
yAxis: [{ yAxis: [{
type: 'value', type: 'value',
min:0.0, min: 0.0,
max:50.0, max: 50.0,
splitLine: { splitLine: {
show: false, show: false,
lineStyle: { lineStyle: {
...@@ -2090,8 +2180,7 @@ function setTimeProductionEchart(chart,apidata) { ...@@ -2090,8 +2180,7 @@ function setTimeProductionEchart(chart,apidata) {
color: 'rgba(255,255,255,0.6)' color: 'rgba(255,255,255,0.6)'
} }
}], }],
series: [ series: [{
{
name: data[0].name, name: data[0].name,
yAxisIndex: 0, yAxisIndex: 0,
//barMinHeight:5, //barMinHeight:5,
...@@ -2117,34 +2206,33 @@ function setTimeProductionEchart(chart,apidata) { ...@@ -2117,34 +2206,33 @@ function setTimeProductionEchart(chart,apidata) {
}, },
type: 'bar', type: 'bar',
data: yData1 data: yData1
}]
} }
] chart.setOption(opsChart, true);
}
chart.setOption(opsChart,true);
} }
/*日排产达成数据*/ /*日排产达成数据*/
function setDailyDataEchart(chart,apidata) { function setDailyDataEchart(chart, apidata) {
let datelist=[] let datelist = []
let jslist=[] let jslist = []
let wglist=[] let wglist = []
if(apidata){ if (apidata) {
apidata.forEach(function(e,index){ apidata.forEach(function(e, index) {
datelist[index]=e.jhrq datelist[index] = e.jhrq
}) })
} }
if(apidata){ if (apidata) {
apidata.forEach(function(e,index){ apidata.forEach(function(e, index) {
jslist[index]=e.jhsl jslist[index] = e.jhsl
}) })
} }
if(apidata){ if (apidata) {
apidata.forEach(function(e,index){ apidata.forEach(function(e, index) {
wglist[index]=e.wgsl wglist[index] = e.wgsl
}) })
} }
var ops= { var ops = {
color:["#67c23a","#409eff"], color: ["#67c23a", "#409eff"],
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',
axisPointer: { axisPointer: {
...@@ -2153,70 +2241,66 @@ function setDailyDataEchart(chart,apidata) { ...@@ -2153,70 +2241,66 @@ function setDailyDataEchart(chart,apidata) {
}, },
legend: { legend: {
align: 'left', align: 'left',
right:0, right: 0,
// orient:"vertical", // orient:"vertical",
x : 'right', //居左显示 x: 'right', //居左显示
y: 'left', //延Y轴 y: 'left', //延Y轴
textStyle:{ textStyle: {
color:'white' color: 'white'
} }
}, },
grid: { grid: {
top:'20%', top: '20%',
left: '3%', left: '3%',
right: '4%', right: '4%',
bottom: '3%', bottom: '3%',
containLabel: true containLabel: true
}, },
xAxis: [ xAxis: [{
{
type: 'category', type: 'category',
data: datelist||['1/01', '1/02', '1/03', '1/04', '1/05', '1/06', '1/07'], data: datelist || ['1/01', '1/02', '1/03', '1/04', '1/05', '1/06', '1/07'],
axisTick:{ axisTick: {
show:true, show: true,
lineStyle:{ lineStyle: {
color:"white" color: "white"
} }
}, },
axisLine:{ axisLine: {
show:true, show: true,
lineStyle:{ lineStyle: {
color:"white" color: "white"
} }
}, },
axisLabel:{ axisLabel: {
show:true, show: true,
color:'white' color: 'white'
}
} }
], }],
yAxis: yAxis: {
{
type: 'value', type: 'value',
splitLine: { splitLine: {
show: false show: false
}, },
axisTick:{ axisTick: {
show:false show: false
}, },
axisLine:{ axisLine: {
show:false show: false
}, },
axisLabel:{ axisLabel: {
show:true, show: true,
color:'white' color: 'white'
} }
}, },
series: [ series: [{
{
name: '计划', name: '计划',
type: 'bar', type: 'bar',
stack: 'Ad', stack: 'Ad',
emphasis: { emphasis: {
focus: 'series' focus: 'series'
}, },
data: jslist||[120, 132, 101, 134, 90, 230, 210] data: jslist || [120, 132, 101, 134, 90, 230, 210]
}, },
{ {
name: '完工', name: '完工',
...@@ -2225,17 +2309,17 @@ function setDailyDataEchart(chart,apidata) { ...@@ -2225,17 +2309,17 @@ function setDailyDataEchart(chart,apidata) {
emphasis: { emphasis: {
focus: 'series' focus: 'series'
}, },
data: wglist||[220, 182, 191, 234, 290, 330, 310] data: wglist || [220, 182, 191, 234, 290, 330, 310]
} }
] ]
}; };
chart.setOption(ops,true); chart.setOption(ops, true);
} }
/* 手环展示 */ /* 手环展示 */
function setchartJdshCirle(chartJdshCirle,apidata){ function setchartJdshCirle(chartJdshCirle, apidata) {
var option = { var option = {
color:['greenyellow','red','skyblue'], color: ['greenyellow', 'red', 'skyblue'],
tooltip: { tooltip: {
trigger: 'item' trigger: 'item'
}, },
...@@ -2243,8 +2327,7 @@ function setDailyDataEchart(chart,apidata) { ...@@ -2243,8 +2327,7 @@ function setDailyDataEchart(chart,apidata) {
top: '5%', top: '5%',
left: 'center' left: 'center'
}, },
series: [ series: [{
{
type: 'pie', type: 'pie',
radius: ['40%', '70%'], radius: ['40%', '70%'],
avoidLabelOverlap: false, avoidLabelOverlap: false,
...@@ -2267,31 +2350,35 @@ function setDailyDataEchart(chart,apidata) { ...@@ -2267,31 +2350,35 @@ function setDailyDataEchart(chart,apidata) {
labelLine: { labelLine: {
show: false show: false
}, },
data: [ data: [{
{ value: apidata.g||0}, value: apidata.g || 0
{ value: apidata.r||0}, },
{ value: apidata.s||0}, {
] value: apidata.r || 0
} },
{
value: apidata.s || 0
},
] ]
}]
}; };
chartJdshCirle.setOption(option); chartJdshCirle.setOption(option);
} }
/*合格率*/ /*合格率*/
function setHglEchart(chart,apidata) { function setHglEchart(chart, apidata) {
let datelist=[] let datelist = []
let hgllist=[] let hgllist = []
if(apidata){ if (apidata) {
apidata.forEach(function(e){ apidata.forEach(function(e) {
datelist.push(e.fkrq) datelist.push(e.fkrq)
hgllist.push(e.hgl) hgllist.push(e.hgl)
}) })
} }
var ops= { var ops = {
color:["#409eff"], color: ["#409eff"],
grid: { grid: {
top:"10%", top: "10%",
left: "5%", left: "5%",
bottom: "5%", bottom: "5%",
right: "5%", right: "5%",
...@@ -2299,22 +2386,22 @@ function setHglEchart(chart,apidata) { ...@@ -2299,22 +2386,22 @@ function setHglEchart(chart,apidata) {
}, },
xAxis: { xAxis: {
type: 'category', type: 'category',
data:datelist|| ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'], data: datelist || ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
axisTick:{ axisTick: {
show:true, show: true,
lineStyle:{ lineStyle: {
color:"white" color: "white"
} }
}, },
axisLine:{ axisLine: {
show:true, show: true,
lineStyle:{ lineStyle: {
color:"white" color: "white"
} }
}, },
axisLabel:{ axisLabel: {
show:true, show: true,
color:'white' color: 'white'
} }
}, },
yAxis: { yAxis: {
...@@ -2322,67 +2409,70 @@ function setHglEchart(chart,apidata) { ...@@ -2322,67 +2409,70 @@ function setHglEchart(chart,apidata) {
splitLine: { splitLine: {
show: false show: false
}, },
axisTick:{ axisTick: {
show:false show: false
}, },
axisLine:{ axisLine: {
show:false show: false
}, },
axisLabel:{ axisLabel: {
show:true, show: true,
color:'white' color: 'white'
} }
}, },
series: [ series: [{
{ data: hgllist || [150, 230, 224, 218, 135, 147, 260],
data:hgllist|| [150, 230, 224, 218, 135, 147, 260],
type: 'line', type: 'line',
itemStyle : { normal: {label : {show: true}}} itemStyle: {
normal: {
label: {
show: true
} }
] }
}
}]
}; };
chart.setOption(ops,true); chart.setOption(ops, true);
} }
function setPieDailyChart(chart,cerpent,pdata) { function setPieDailyChart(chart, cerpent, pdata) {
let apidata={} let apidata = {}
apidata.jhsl=0 apidata.jhsl = 0
apidata.wgsl=0 apidata.wgsl = 0
if(pdata){ if (pdata) {
apidata=pdata apidata = pdata
} }
var ops= { var ops = {
color:["#A2E9FF","#409eff"], color: ["#A2E9FF", "#409eff"],
tooltip: { tooltip: {
trigger: 'item' trigger: 'item'
}, },
legend: { legend: {
top: '5%', top: '5%',
left: 'center', left: 'center',
show:false show: false
}, },
series: [ series: [{
{
name: '完成率', name: '完成率',
type: 'pie', type: 'pie',
radius: ['40%', '70%'], radius: ['40%', '70%'],
avoidLabelOverlap: false, avoidLabelOverlap: false,
hoverAnimation:false, hoverAnimation: false,
silent:true, silent: true,
label: { label: {
normal: { normal: {
show: true, show: true,
position: 'center', position: 'center',
formatter: function(data){ // 设置圆饼图中间文字排版 formatter: function(data) { // 设置圆饼图中间文字排版
return "完工率\n"+(cerpent?(cerpent+"%"):"") return "完工率\n" + (cerpent ? (cerpent + "%") : "")
}, },
}, },
emphasis: { emphasis: {
disabled:true, disabled: true,
show: false, //文字至于中间时,这里需为true show: false, //文字至于中间时,这里需为true
textStyle: { //设置文字样式 textStyle: { //设置文字样式
fontSize: '12', fontSize: '12',
color:"#333" color: "#333"
} }
} }
}, },
...@@ -2391,27 +2481,31 @@ function setPieDailyChart(chart,cerpent,pdata) { ...@@ -2391,27 +2481,31 @@ function setPieDailyChart(chart,cerpent,pdata) {
show: false show: false
} }
}, },
data: [ data: [{
{ value: (apidata.jhsl-apidata.wgsl)||0, name: '未完工'}, value: (apidata.jhsl - apidata.wgsl) || 0,
{ value: apidata.wgsl||0, name: '完工' }, name: '未完工'
] },
} {
value: apidata.wgsl || 0,
name: '完工'
},
] ]
}]
}; };
chart.setOption(ops,true); chart.setOption(ops, true);
} }
function setRpcHglEchart(chart,apidata1,apidata2) { function setRpcHglEchart(chart, apidata1, apidata2) {
let datelist=[] let datelist = []
let hgllist=[] let hgllist = []
let jslist=[] let jslist = []
let wglist=[] let wglist = []
if(apidata1&&apidata2){ if (apidata1 && apidata2) {
apidata1.forEach(function(e){ apidata1.forEach(function(e) {
hgllist.push(e.hgl) hgllist.push(e.hgl)
}) })
apidata2.forEach(function(e){ apidata2.forEach(function(e) {
console.log(e.jhrq) console.log(e.jhrq)
datelist.push(e.jhrq.slice(5)) datelist.push(e.jhrq.slice(5))
jslist.push(e.jhsl) jslist.push(e.jhsl)
...@@ -2419,7 +2513,7 @@ function setRpcHglEchart(chart,apidata1,apidata2) { ...@@ -2419,7 +2513,7 @@ function setRpcHglEchart(chart,apidata1,apidata2) {
}) })
} }
var ops = { var ops = {
color:["#409eff","#55ff7f","#ffd03e"], color: ["#409eff", "#55ff7f", "#ffd03e"],
// tooltip: { // tooltip: {
// trigger: 'axis', // trigger: 'axis',
// axisPointer: { // axisPointer: {
...@@ -2430,9 +2524,9 @@ function setRpcHglEchart(chart,apidata1,apidata2) { ...@@ -2430,9 +2524,9 @@ function setRpcHglEchart(chart,apidata1,apidata2) {
// } // }
// }, // },
legend: { legend: {
data: ['计划', '完工','合格率'], data: ['计划', '完工', '合格率'],
textStyle:{ textStyle: {
color:'white' color: 'white'
} }
}, },
grid: { grid: {
...@@ -2441,58 +2535,55 @@ function setRpcHglEchart(chart,apidata1,apidata2) { ...@@ -2441,58 +2535,55 @@ function setRpcHglEchart(chart,apidata1,apidata2) {
bottom: '3%', bottom: '3%',
containLabel: true containLabel: true
}, },
xAxis: [ xAxis: [{
{
type: 'category', type: 'category',
data: datelist||['Mon', 'Tue', 'Wed', 'Thu', 'Fri'], data: datelist || ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'],
axisPointer: { axisPointer: {
type: 'shadow' type: 'shadow'
}, },
axisTick:{ axisTick: {
show:true, show: true,
lineStyle:{ lineStyle: {
color:"white" color: "white"
} }
}, },
axisLine:{ axisLine: {
show:true, show: true,
lineStyle:{ lineStyle: {
color:"white" color: "white"
} }
}, },
axisLabel:{ axisLabel: {
show:true, show: true,
color:'white' color: 'white'
}
} }
], }],
yAxis: [ yAxis: [{
{
type: 'value', type: 'value',
name: '计划', name: '计划',
nameTextStyle:{ nameTextStyle: {
color:"white" color: "white"
}, },
splitLine: { splitLine: {
show: false, show: false,
}, },
axisTick:{ axisTick: {
show:true, show: true,
lineStyle:{ lineStyle: {
color:'white', color: 'white',
} }
}, },
axisLine:{ axisLine: {
show:true, show: true,
lineStyle:{ lineStyle: {
color:'white', color: 'white',
} }
}, },
axisLabel:{ axisLabel: {
show:true, show: true,
color:'white', color: 'white',
formatter: '{value}' formatter: '{value}'
} }
}, },
...@@ -2502,48 +2593,47 @@ function setRpcHglEchart(chart,apidata1,apidata2) { ...@@ -2502,48 +2593,47 @@ function setRpcHglEchart(chart,apidata1,apidata2) {
min: 0, min: 0,
max: 100, max: 100,
interval: 20, interval: 20,
nameTextStyle:{ nameTextStyle: {
color:"white" color: "white"
}, },
splitLine: { splitLine: {
show: false, show: false,
}, },
axisTick:{ axisTick: {
show:true, show: true,
lineStyle:{ lineStyle: {
color:'white', color: 'white',
} }
}, },
axisLine:{ axisLine: {
show:true, show: true,
lineStyle:{ lineStyle: {
color:'white', color: 'white',
} }
}, },
axisLabel:{ axisLabel: {
show:true, show: true,
color:'white', color: 'white',
formatter: '{value} %' formatter: '{value} %'
} }
} }
], ],
series: [ series: [{
{
name: '计划', name: '计划',
type: 'bar', type: 'bar',
data: jslist||[ data: jslist || [
2.6, 5.9, 9.0, 26.4, 28.7, 2.6, 5.9, 9.0, 26.4, 28.7,
], ],
barWidth : 15, barWidth: 15,
itemStyle:{ itemStyle: {
normal:{ normal: {
label:{ label: {
show:true, show: true,
position:"top", position: "top",
textStyle:{ textStyle: {
color:"white", color: "white",
} }
} }
...@@ -2554,17 +2644,17 @@ function setRpcHglEchart(chart,apidata1,apidata2) { ...@@ -2554,17 +2644,17 @@ function setRpcHglEchart(chart,apidata1,apidata2) {
{ {
name: '完工', name: '完工',
type: 'bar', type: 'bar',
data: wglist||[ data: wglist || [
2.6, 5.9, 9.0, 26.4, 28.7, 2.6, 5.9, 9.0, 26.4, 28.7,
], ],
barWidth : 15, barWidth: 15,
itemStyle:{ itemStyle: {
normal:{ normal: {
label:{ label: {
show:true, show: true,
position:"top", position: "top",
textStyle:{ textStyle: {
color:"white", color: "white",
} }
} }
...@@ -2576,14 +2666,14 @@ function setRpcHglEchart(chart,apidata1,apidata2) { ...@@ -2576,14 +2666,14 @@ function setRpcHglEchart(chart,apidata1,apidata2) {
name: '合格率', name: '合格率',
type: 'line', type: 'line',
yAxisIndex: 0, yAxisIndex: 0,
data: hgllist||[20,30,90,30,29], data: hgllist || [20, 30, 90, 30, 29],
itemStyle:{ itemStyle: {
normal:{ normal: {
label:{ label: {
show:true, show: true,
position:"top", position: "top",
textStyle:{ textStyle: {
color:"orange", color: "orange",
} }
} }
...@@ -2593,10 +2683,150 @@ function setRpcHglEchart(chart,apidata1,apidata2) { ...@@ -2593,10 +2683,150 @@ function setRpcHglEchart(chart,apidata1,apidata2) {
} }
] ]
}; };
chart.setOption(ops,true); chart.setOption(ops, true);
} }
function setRclHglEchart(chart, apidata1, apidata2) {
let datelist = []
let hgllist = []
let jslist = []
let wglist = []
if (apidata1 && apidata2) {
apidata1.forEach(function(e) {
hgllist.push(e.hgl)
})
apidata2.forEach(function(e) {
console.log(e.jhrq)
datelist.push(e.jhrq.slice(5))
jslist.push(e.jhsl)
wglist.push(e.wgsl)
})
}
var ops = {
color: ["#409eff", "#55ff7f", "#ffd03e"],
// tooltip: {
// trigger: 'axis',
// axisPointer: {
// type: 'cross',
// crossStyle: {
// color: '#999'
// }
// }
// },
legend: {
data: ['日产量', '合格率'],
textStyle: {
color: 'white'
}
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis: [{
type: 'category',
data: datelist || ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'],
axisPointer: {
type: 'shadow'
},
axisTick: {
show: true,
lineStyle: {
color: "white"
}
},
axisLine: {
show: true,
lineStyle: {
color: "white"
}
},
axisLabel: {
show: true,
color: 'white'
}
}],
yAxis: [{
type: 'value',
name: '合格率',
min: 0,
max: 100,
interval: 20,
nameTextStyle: {
color: "white"
},
splitLine: {
show: false,
},
axisTick: {
show: true,
lineStyle: {
color: 'white',
}
},
axisLine: {
show: true,
lineStyle: {
color: 'white',
}
},
axisLabel: {
show: true,
color: 'white',
formatter: '{value} %'
}
}],
series: [{
name: '日产量',
type: 'bar',
data: wglist || [
2.6, 5.9, 9.0, 26.4, 28.7,
],
barWidth: 30,
itemStyle: {
normal: {
label: {
show: true,
position: "top",
textStyle: {
color: "white",
}
}
}
}
},
{
name: '合格率',
type: 'line',
yAxisIndex: 0,
data: hgllist || [20, 30, 90, 30, 29],
itemStyle: {
normal: {
label: {
show: true,
position: "top",
textStyle: {
color: "orange",
}
}
}
}
}
]
};
chart.setOption(ops, true);
}
// function setPieYChart(chart) { // function setPieYChart(chart) {
// var ops= { // var ops= {
// tooltip: { // tooltip: {
......
...@@ -43,13 +43,13 @@ ...@@ -43,13 +43,13 @@
<div class="center-left fl"> <div class="center-left fl">
<div class="left-top rightTop border"> <div class="left-top rightTop border">
<!--<h1 id="ceshi">数据可视化</h1>--> <!--<h1 id="ceshi">数据可视化</h1>-->
<div class="title">日产量</div> <div class="title">OA考勤</div>
<div class="bottom-b"> <div class="bottom-b">
<div id="chartSdcl" class="allnav"></div> <div id="chartSdcl" class="allnav"></div>
</div> </div>
</div> </div>
<div class="left-cen rightTop border"> <div class="left-cen rightTop border">
<div class="title">排产&合格率</div> <div class="title">产量&合格率</div>
<div class="bottom-b"> <div class="bottom-b">
<div id="chartRpcdcsj" class="allnav"></div> <div id="chartRpcdcsj" class="allnav"></div>
</div> </div>
...@@ -104,7 +104,7 @@ ...@@ -104,7 +104,7 @@
</div> </div>
<div class="center-cen fl"> <div class="center-cen fl">
<div class="cen-top rightTop border"> <div class="cen-top rightTop border">
<video width="100%" height="100%" controls id="firstVideo" autoplay="autoplay" muted loop="loop"> <video width="100%" height="100%" controls id="firstVideo" muted autoplay="autoplay" loop="loop">
</video> </video>
</div> </div>
<div class="cen-bottom rightTop border"> <div class="cen-bottom rightTop border">
...@@ -293,7 +293,13 @@ ...@@ -293,7 +293,13 @@
</div> </div>
</div> </div>
<div class="right-bottom rightTop border" style="height: 6.8rem;"> <div class="right-bottom rightTop border" style="height: 3.2rem;margin-bottom: 0.2rem;">
<div class="title">工艺流程图</div>
<div class="chat" style="height: calc(100% - 0.4rem);">
<!-- <canvas id="gylct" style="width: 100%;height: 100%"></canvas> -->
</div>
</div>
<div class="right-bottom rightTop border" style="height: 3.2rem;margin-top: 0.4rem;">
<div class="title">工艺流程图</div> <div class="title">工艺流程图</div>
<div class="chat" style="height: calc(100% - 0.4rem);"> <div class="chat" style="height: calc(100% - 0.4rem);">
<canvas id="gylct" style="width: 100%;height: 100%"></canvas> <canvas id="gylct" style="width: 100%;height: 100%"></canvas>
...@@ -336,7 +342,8 @@ ...@@ -336,7 +342,8 @@
var chartRjh=echarts.init(document.getElementById("chartRjh")); var chartRjh=echarts.init(document.getElementById("chartRjh"));
var chartYjh=echarts.init(document.getElementById("chartYjh")); var chartYjh=echarts.init(document.getElementById("chartYjh"));
var chartJdshCirle=echarts.init(document.getElementById("chartJdshCirle")); var chartJdshCirle=echarts.init(document.getElementById("chartJdshCirle"));
setTimeProductionEchart(myChartSdcl); /*时段产量*/
oaechart(myChartSdcl); /*时段产量*/
setDailyDataEchart(chartRpcdcsj); /*日排产达成数据*/ setDailyDataEchart(chartRpcdcsj); /*日排产达成数据*/
// setHglEchart(chartHgl);/*合格率*/ // setHglEchart(chartHgl);/*合格率*/
setPieDailyChart(chartRjh,80);/*日计划*/ setPieDailyChart(chartRjh,80);/*日计划*/
...@@ -355,8 +362,8 @@ ...@@ -355,8 +362,8 @@
} }
/* 调用 */ /* 调用 */
function getAlldata(){ function getAlldata(){
apisetRpcHglEchart(chartRpcdcsj) apisetRpcHglEchart(chartRpcdcsj,'rcl')
apisetTimeProductionEchart(myChartSdcl) // apisetTimeProductionEchart(myChartSdcl)
// apisetDailyDataEchart(chartRpcdcsj) // apisetDailyDataEchart(chartRpcdcsj)
apisetPieDailyChart(chartRjh) apisetPieDailyChart(chartRjh)
apisetPieDailyCharty(chartYjh) apisetPieDailyCharty(chartYjh)
......
...@@ -3,6 +3,9 @@ ...@@ -3,6 +3,9 @@
<script src="js/gethash.js" type="text/javascript" charset="utf-8"></script> <script src="js/gethash.js" type="text/javascript" charset="utf-8"></script>
<link rel="stylesheet" type="text/css" href="css/zpfk.css"/> <link rel="stylesheet" type="text/css" href="css/zpfk.css"/>
<style type="text/css"> <style type="text/css">
video{
object-fit:cover!important;
}
.errdialog{ .errdialog{
min-width:35%; min-width:35%;
/* width: 35%; */ /* width: 35%; */
...@@ -47,6 +50,9 @@ ...@@ -47,6 +50,9 @@
/* 通用代码 */ /* 通用代码 */
/* 通用pdf参数 */ /* 通用pdf参数 */
const pdfUr="kmes/gpfk/queryPdfByWoidAndZpgx" const pdfUr="kmes/gpfk/queryPdfByWoidAndZpgx"
var urlo="kmes/gpfkfj/queryFjBybzgx/"+window.bzlx+"/O"
var urlt="kmes/gpfkfj/queryFjBybzgx/"+window.bzlx+"/T"
var urlm="kmes/gpfkfj/queryFjBybzgx/"+window.bzlx+"/M"
/* 大屏内部弹框 */ /* 大屏内部弹框 */
function screenAlert(dom,msg,timeNum){ function screenAlert(dom,msg,timeNum){
let getdom=$(dom) let getdom=$(dom)
...@@ -205,9 +211,11 @@ ...@@ -205,9 +211,11 @@
if(that.sivpdf){ if(that.sivpdf){
clearInterval(that.sivpdf) clearInterval(that.sivpdf)
} }
/*
老pdf禁用
pdfshow(that.pdfurl, that.pdfdom, 10000).then(e => { pdfshow(that.pdfurl, that.pdfdom, 10000).then(e => {
that.sivpdf = e that.sivpdf = e
}) }) */
} }
} }
/* 初始化表格 */ /* 初始化表格 */
...@@ -271,7 +279,7 @@ ...@@ -271,7 +279,7 @@
</ul> </ul>
</div> </div>
<!-- 左侧信息条 --> <!-- 左侧信息条 -->
<div class="left"> <div class="left" style="width: 30%;">
<!-- 左上信息表 --> <!-- 左上信息表 -->
<div class="cbinfor"> <div class="cbinfor">
<div class="cpif"> <div class="cpif">
...@@ -320,9 +328,20 @@ ...@@ -320,9 +328,20 @@
</div> </div>
</div> </div>
<!-- 右侧信息pdf --> <!-- 右侧信息pdf -->
<div class="right"> <div class="right" style="width: 45%;">
<canvas id="kwrkb01pdf" class="rightPdf"></canvas> <canvas id="kwrkb01pdf" class="rightPdf"></canvas>
</div> </div>
<!-- new右侧 -->
<div class="right" style="width: 25%;">
<div style="height: 50%;overflow: hidden;">
<video width="100%" height="100%" :src="urlm" controls muted autoplay="autoplay" loop="loop">
</video>
</div>
<div ref="scrollmain" style="height: 50%;overflow: auto;border-bottom: 1px solid #EEEEEE;">
<canvas id="kwrkb01rpdf" ref="scroll" style="width: 100%;height: 160%;" ></canvas>
</div>
</div>
</div> </div>
<!-- div2 --> <!-- div2 -->
<div id="kwrkb02" style="display: none;"> <div id="kwrkb02" style="display: none;">
...@@ -471,6 +490,7 @@ ...@@ -471,6 +490,7 @@
this.initpage() this.initpage()
dbenlarge('kwrkb01', 1, this.initpage) dbenlarge('kwrkb01', 1, this.initpage)
$(this.el).dblclick() $(this.el).dblclick()
this.scroll()
this.gettime() this.gettime()
this.isFocus() this.isFocus()
this.appdestory() this.appdestory()
...@@ -478,10 +498,13 @@ ...@@ -478,10 +498,13 @@
destroyed() { destroyed() {
clearInterval(this.sivdestory) clearInterval(this.sivdestory)
clearInterval(this.sivpdf) clearInterval(this.sivpdf)
clearInterval(this.sivrpdf)
clearInterval(this.sivtimer) clearInterval(this.sivtimer)
clearInterval(this.sivscroll)
}, },
data: function() { data: function() {
return { return {
urlm:urlm,
fksl:0, fksl:0,
username:localStorage.getItem("username"), username:localStorage.getItem("username"),
okOrng:"", okOrng:"",
...@@ -500,9 +523,30 @@ ...@@ -500,9 +523,30 @@
sivtimer: null, //时间计数器 sivtimer: null, //时间计数器
sivpdf: null, sivpdf: null,
sivdestory: null, sivdestory: null,
sivscroll:null,
sivrpdf:null
} }
}, },
methods: { methods: {
scroll(){
console.log(urlo)
/* test */
pdfshow(urlo,'kwrkb01pdf', 10000).then(e => {
that.sivpdf = e
})
/* test */
pdfshow(urlt,'kwrkb01rpdf', 10000).then(e => {
that.sivrpdf = e
})
const mainData=this.$refs.scrollmain
const divData =this.$refs.scroll
this.sivscroll=setInterval(() => {
mainData.scrollTop += 1
if (mainData.clientHeight + mainData.scrollTop+10 > mainData.scrollHeight) {
mainData.scrollTop = 0
}
}, 100)
},
// 扫码接口 // 扫码接口
apiscanxlh(){ apiscanxlh(){
let that=this let that=this
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment