Merge remote-tracking branch 'gitee/master'

master
wangh 4 years ago
commit d6ffb61c16

@ -1,63 +1,68 @@
$(() => {
moduleTitle()
safe('#safe')
importData('#importData')
// 公共请求地址
let url = '/broad/mtk'
card({
top: 60,
left: 30.5,
title: '内胆检漏',
name1: '问题1',
value1: '值1',
name2: '问题2',
value2: '值2',
name3: '问题3',
value3: '值3'
name1: '',
value1: '',
name2: '',
value2: '',
name3: '',
value3: '',
}, '#cardOne')
card({
top: 60,
left: 38.5,
title: '安全检测',
name1: '问题1',
value1: '值1',
name2: '问题2',
value2: '值2',
name3: '问题3',
value3: '值3'
name1: '',
value1: '',
name2: '',
value2: '',
name3: '',
value3: '',
}, '#cardTwo')
card({
top: 60,
left: 46.5,
title: '成品检漏',
name1: '问题1',
value1: '值1',
name2: '问题2',
value2: '值2',
name3: '问题3',
value3: '值3'
name1: '',
value1: '',
name2: '',
value2: '',
name3: '',
value3: '',
}, '#cardThree')
card({
top: 60,
left: 54.5,
title: '测温性能',
name1: '问题1',
value1: '值1',
name2: '问题2',
value2: '值2',
name3: '问题3',
value3: '值3'
name1: '',
value1: '',
name2: '',
value2: '',
name3: '',
value3: '',
}, '#cardFour')
card({
top: 60,
left: 62.5,
title: '成品外观',
name1: '问题1',
value1: '值1',
name2: '问题2',
value2: '值2',
name3: '问题3',
value3: '值3'
name1: '',
value1: '',
name2: '',
value2: '',
name3: '',
value3: '',
}, '#cardFive')
// 公共请求地址
let url = '/broad/mtk'
// 轮询间隔时间
const INTERVAL = 30000
@ -145,22 +150,116 @@ $(() => {
total(data.find(val => val.name === '入库订单统计').qty, '#total')
Tips(data.find(val => val.name === '订单数量').qty, data.find(val => val.name === '完成数量').qty, data.find(val => val.name === '清单率').qty, '#Tips')
})
// 设备功率
// autoUpdate(url + "/inStore3d", INTERVAL, data => {
singleVerticalBarChart({
xName: ["1月", "2月", "3月", "4月", "5月", "6月", "7月"],
yData: [12, 20, 11, 30, 14, 80, 50],
}, document.getElementById("equipmentPower"))
// })
// 生产效率
// 质量分析(TOP3)
autoUpdate(url + "/selectQATop3", INTERVAL, data => {
console.log(data)
let arr = []
data.forEach(val => {
switch (val.code) {
case '内胆检漏':
arr = data.find(val => val.code === '内胆检漏').list.sort(function (a,b) {
return b.qty - a.qty
})
card({
top: 60,
left: 30.5,
title: '内胆检漏',
name1: arr[0]?.name || '',
value1: arr[0]?.qty || '',
name2: arr[1]?.name || '',
value2: arr[1]?.qty || '',
name3: arr[2]?.name || '',
value3: arr[2]?.qty || '',
}, '#cardOne')
break
case '安全检测':
debugger
arr = data.find(val => val.code === '安全检测').list.sort(function (a,b) {
return b.qty - a.qty
})
card({
top: 60,
left: 38.5,
title: '安全检测',
name1: arr[0]?.name || '',
value1: arr[0]?.qty || '',
name2: arr[1]?.name || '',
value2: arr[1]?.qty || '',
name3: arr[2]?.name || '',
value3: arr[2]?.qty || '',
}, '#cardTwo')
break
case '成品检漏':
arr = data.find(val => val.code === '成品检漏').list.sort(function (a,b) {
return b.qty - a.qty
})
card({
top: 60,
left: 46.5,
title: '成品检漏',
name1: arr[0]?.name || '',
value1: arr[0]?.qty || '',
name2: arr[1]?.name || '',
value2: arr[1]?.qty || '',
name3: arr[2]?.name || '',
value3: arr[2]?.qty || '',
}, '#cardThree')
break
case '测温性能':
arr = data.find(val => val.code === '测温性能').list.sort(function (a,b) {
return b.qty - a.qty
})
card({
top: 60,
left: 54.5,
title: '测温性能',
name1: arr[0]?.name || '',
value1: arr[0]?.qty || '',
name2: arr[1]?.name || '',
value2: arr[1]?.qty || '',
name3: arr[2]?.name || '',
value3: arr[2]?.qty || '',
}, '#cardFour')
break
case '成品外观':
arr = data.find(val => val.code === '成品外观').list.sort(function (a,b) {
return b.qty - a.qty
})
card({
top: 60,
left: 62.5,
title: '成品外观',
name1: arr[0]?.name || '',
value1: arr[0]?.qty || '',
name2: arr[1]?.name || '',
value2: arr[1]?.qty || '',
name3: arr[2]?.name || '',
value3: arr[2]?.qty || '',
}, '#cardFive')
break
case '柱状图':
arr = data.find(val => val.code === '柱状图').list.sort(function (a,b) {
return b.qty - a.qty
})
singleVerticalBarChart({
xName: arr.map(val => val.name),
yData: arr.map(val => val.qty),
}, document.getElementById("equipmentPower"),-20,'20%')
break
}
})
})
// 当日订单入库统计
autoUpdate(url + "/selectInstoreNumByday", INTERVAL, data => {
singleVerticalBarChart({
xName: data.map(val => val.name),
yData: data.map(val => val.qty),
}, document.getElementById("productionEfficiency"),-20)
})
// 成品入库统计
// 重点工序质量监控
// autoUpdate(url + "/inStore3d", INTERVAL, data => {
percentageRingDiagram([
{
@ -204,7 +303,7 @@ const curWeek = () => {
}
firstDayOfYear = new Date(today.getFullYear(), 0, spendDay);
let d = Math.ceil((today.valueOf() - firstDayOfYear.valueOf()) / 86400000);
return Math.ceil(d / 7);
return Math.ceil((d / 7) +1);
}
const moduleTitle = () => {
@ -222,8 +321,9 @@ const moduleTitle = () => {
const safe = (el) => {
const html = `
<span style="position: absolute;top: 66%;left: 16%;color: #CBE6F7;font-size: 1.3vw;font-weight:600;transform: translateX(-50%);letter-spacing: 0.3vw">${new Date().getFullYear().toString()}年连续安全生产天数</span>
<span style="position: absolute;top: 74%;left: 16%;color: #08F580;font-size: 2.5vw;transform: translateX(-50%);letter-spacing: 0.3vw">${today()}<span style="font-size: 0.5vw"></span> </span>
<span style="position: absolute;top: 81%;left: 16%;color: #CBE6F7;font-size: 1vw;transform: translateX(-50%);letter-spacing: 0.3vw">QSR连续安全生产天数</span>
<span style="position: absolute;top: 89%;left: 16%;color: #CBE6F7;font-size: 1vw;transform: translateX(-50%);letter-spacing: 0.3vw">智能冷柜互联工厂</span>
`
$(el).html(html)
}
@ -245,27 +345,27 @@ const card = (val = {
${val.title}
</div>
<div style="position: absolute;top: 25%;left: 5%;width:100%;height:15%;text-align: left;font-size: 0.5vw;">
<span style="position: absolute;width:60%;font-size: 0.6vw;">
<span style="position: absolute;width:73%;font-size: 0.6vw;">
${val.name1}
</span>
<span style="position: absolute;left: 60%;width:40%;font-size: 0.4vw;line-height: 1vw">
<span style="position: absolute;left: 75%;width:40%;font-size: 0.4vw;line-height: 1vw">
${val.value1}
</span>
</div>
<div style="position: absolute;top: 50%;left: 5%;width:100%;height:15%;text-align: left;font-size: 0.5vw;">
<span style="position: absolute;width:60%;font-size: 0.6vw;">
<span style="position: absolute;width:73%;font-size: 0.6vw;">
${val.name2}
</span>
<span style="position: absolute;left: 60%;width:40%;font-size: 0.4vw;line-height: 1vw">
<span style="position: absolute;left: 75%;width:40%;font-size: 0.4vw;line-height: 1vw">
${val.value2}
</span>
</div>
<div style="position: absolute;top: 75%;left: 5%;width:100%;height:15%;text-align: left;font-size: 0.5vw;">
<span style="position: absolute;width:60%;font-size: 0.6vw;">
<span style="position: absolute;width:73%;font-size: 0.6vw;">
${val.name3}
</span>
<span style="position: absolute;left: 60%;width:40%;font-size: 0.4vw;line-height: 1vw">
${val.value2}
<span style="position: absolute;left: 75%;width:40%;font-size: 0.4vw;line-height: 1vw">
${val.value3}
</span>
</div>
</div>
@ -286,3 +386,9 @@ const total = (val1 = 0, el) => {
`
$(el).html(html)
}
const importData = ( el) => {
const html = `
<span style="position: absolute;top: 54.3%;left: 85.7%;color: #fff;font-size: 1vw;">一次合格率</span>
`
$(el).html(html)
}

@ -138,6 +138,8 @@ const horizontalRoundedBarChartWithBackground = function (data, id) {
$(window).resize(charts.resize);
}
const horizontalRoundedBarChartWithBackgroundTwo = function (data, id) {
let time = () => {
}
let charts = echarts.init(id);
if (!data) {
data = {
@ -153,6 +155,7 @@ const horizontalRoundedBarChartWithBackgroundTwo = function (data, id) {
})
let option = {
grid: {
// left: "-10%",
left: "0%",
right: "8%",
bottom: "0%",
@ -179,6 +182,11 @@ const horizontalRoundedBarChartWithBackgroundTwo = function (data, id) {
},
axisLabel: {
color: "#fff",
// margin:150,
fontSize:0.75 * vw,
textStyle: {
textAlign:'center'
},
},
},
],
@ -245,6 +253,7 @@ const horizontalRoundedBarChartWithBackgroundTwo = function (data, id) {
})
let step = 1 / (data.yNameOne.length / 9) * 100
time = () => {
setInterval(() => {
option.dataZoom[0].end += step
option.dataZoom[0].start += step
@ -257,7 +266,9 @@ const horizontalRoundedBarChartWithBackgroundTwo = function (data, id) {
option.dataZoom[0].start = option.dataZoom[0].end - step
}
charts.setOption(option);
}, 3000)
}, 6000)
}
time()
}
charts.setOption(option);
$(window).resize(charts.resize);
@ -1503,7 +1514,7 @@ const multipleVerticalBarChartTwo = function (data, id) {
}
// 单个垂直柱状图
const singleVerticalBarChart = function (data, id,rotate=0) {
const singleVerticalBarChart = function (data, id, rotate = 0,bottom='15%') {
let charts = echarts.init(id);
if (!data) {
data = {
@ -1520,7 +1531,7 @@ const singleVerticalBarChart = function (data, id,rotate=0) {
top: "10%",
left: left(),
right: "5%",
bottom: "15%",
bottom: bottom,
// containLabel: true
},
dataZoom: [],
@ -1534,6 +1545,7 @@ const singleVerticalBarChart = function (data, id,rotate=0) {
axisLabel: {
color: "#fff",
fontSize: 14,
interval:0,
rotate: rotate,
},
},
@ -1583,6 +1595,14 @@ const singleVerticalBarChart = function (data, id,rotate=0) {
),
},
},
label: {
show: true,
position: "top",
textStyle: {
color: "#fff",
fontSize: 0.75 * vw
},
},
data: data.yData,
},
],
@ -1593,6 +1613,8 @@ const singleVerticalBarChart = function (data, id,rotate=0) {
$(window).resize(charts.resize);
}
const singleVerticalBarChartTwo = function (data, id) {
let time = () => {
}
let charts = echarts.init(id);
if (!data) {
data = {
@ -1611,6 +1633,7 @@ const singleVerticalBarChartTwo = function (data, id) {
},
dataZoom: [],
xAxis: {
margin:10,
nameTextStyle: {
color: '#c0c3cd',
padding: [0, 0, -10, 0],
@ -1620,7 +1643,8 @@ const singleVerticalBarChartTwo = function (data, id) {
color: '#c0c3cd', //X轴文字
fontSize: 14,
interval: 0,
rotate:20,
margin:20,
rotate: -20,
},
axisTick: {
lineStyle: {
@ -1740,7 +1764,7 @@ const singleVerticalBarChartTwo = function (data, id) {
})
let step = 1 / (data.xName.length / 11) * 100
setInterval(() => {
time = setInterval(() => {
option.dataZoom[0].end += step
option.dataZoom[0].start += step
if (option.dataZoom[0].start >= 100) {
@ -1753,6 +1777,7 @@ const singleVerticalBarChartTwo = function (data, id) {
}
charts.setOption(option);
}, 3000)
time()
}

@ -34,6 +34,7 @@
<div id="cardThree"></div>
<div id="cardFour"></div>
<div id="cardFive"></div>
<div id="importData"></div>
<!--每日人力出勤-->
<div class="manpowerAttendance" id="manpowerAttendance"></div>

Loading…
Cancel
Save