1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201 |
- $(window).load(function () {
- $(".loading").fadeOut();
- })
- $(function () {
- var prefix = 'http://localhost:18531/eap/api/Dashboard/';
- load();
- setInterval(() => {
- load();
- }, 1000 * 60 * 30);
- function load() {
- var dateNow = new Date();
- var lastYear = dateNow.getFullYear() - 1;
- var thisYear = dateNow.getFullYear();
- var yearSpan = lastYear + '、' + thisYear;
- $('.yearSpan').text(yearSpan);
- loadCurrentOutput();
- loadCompletedLots();
- loadMachineToPms();
- loadPmRate();
- loadAlarmCodePie();
- loadGoodRate("中测");
- loadGoodRate('成测');
- loadOutputs('封装');
- loadOutputs('中测');
- loadOutputs('成测');
- loadOS();
- $('#owl').owlCarousel({
- items: 1,
- autoPlay: 5000,
- pagination: false
- });
- }
- function echarts_1(legends, data) {
- // 基于准备好的dom,初始化echarts实例
- var myChart = echarts.init(document.getElementById('echart1'));
- option = {
- tooltip: {
- trigger: 'item',
- formatter: "{b} : {c} ({d}%)"
- },
- legend: {
- right: 0,
- top: 30,
- height: 160,
- itemWidth: 10,
- itemHeight: 10,
- itemGap: 10,
- textStyle: {
- color: 'rgba(255,255,255,.6)',
- fontSize: 12
- },
- orient: 'vertical',
- data: legends
- },
- calculable: true,
- series: [
- {
- name: ' ',
- color: ['#62c98d', '#2f89cf', '#4cb9cf', '#53b666', '#62c98d', '#205acf', '#c9c862', '#c98b62', '#c962b9', '#7562c9', '#c96262', '#c25775', '#00b7be'],
- type: 'pie',
- radius: [30, 70],
- center: ['35%', '50%'],
- roseType: 'radius',
- label: {
- normal: {
- show: true
- },
- emphasis: {
- show: true
- }
- },
- lableLine: {
- normal: {
- show: true
- },
- emphasis: {
- show: true
- }
- },
- data: data
- },
- ]
- };
- // 使用刚指定的配置项和数据显示图表。
- myChart.setOption(option);
- window.addEventListener("resize", function () {
- myChart.resize();
- });
- }
- function echarts_2(legends, data) {
- // 基于准备好的dom,初始化echarts实例
- var myChart = echarts.init(document.getElementById('echart2'));
- option = {
- tooltip: {
- trigger: 'item',
- formatter: "{b} : {d}%"
- },
- legend: {
- right: 0,
- top: 30,
- data: legends,
- icon: 'circle',
- textStyle: {
- color: 'rgba(255,255,255,.6)',
- }
- },
- calculable: true,
- series: [{
- name: '',
- color: ['#62c98d', '#2f89cf', '#4cb9cf', '#53b666', '#62c98d', '#205acf', '#c9c862', '#c98b62', '#c962b9', '#c96262'],
- type: 'pie',
- //起始角度,支持范围[0, 360]
- startAngle: 0,
- //饼图的半径,数组的第一项是内半径,第二项是外半径
- radius: [51, 100],
- //支持设置成百分比,设置成百分比时第一项是相对于容器宽度,第二项是相对于容器高度
- center: ['50%', '45%'],
- //是否展示成南丁格尔图,通过半径区分数据大小。可选择两种模式:
- // 'radius' 面积展现数据的百分比,半径展现数据的大小。
- // 'area' 所有扇区面积相同,仅通过半径展现数据大小
- roseType: 'area',
- //是否启用防止标签重叠策略,默认开启,圆环图这个例子中需要强制所有标签放在中心位置,可以将该值设为 false。
- avoidLabelOverlap: false,
- label: {
- normal: {
- show: true,
- // formatter: '{c}辆'
- },
- emphasis: {
- show: true
- }
- },
- labelLine: {
- normal: {
- show: true,
- length2: 1,
- },
- emphasis: {
- show: true
- }
- },
- data: data
- }]
- };
- // 使用刚指定的配置项和数据显示图表。
- myChart.setOption(option);
- window.addEventListener("resize", function () {
- myChart.resize();
- });
- }
- function echarts_ZC(legends, dates, dbData, wbData) {
- // 基于准备好的dom,初始化echarts实例
- var myChart = echarts.init(document.getElementById('echart3'));
- option = {
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- lineStyle: {
- color: '#57617B'
- }
- },
- // formatter:'{a}-{b}:{c}%'
- },
- legend: {
- data: legends,
- top: '0',
- textStyle: {
- color: "#fff"
- },
- itemGap: 20,
- },
- grid: {
- left: '0',
- right: '20',
- top: '10',
- bottom: '20',
- containLabel: true
- },
- xAxis: [{
- type: 'category',
- boundaryGap: false,
- axisLabel: {
- show: true,
- textStyle: {
- color: 'rgba(255,255,255,.6)'
- }
- },
- axisLine: {
- lineStyle: {
- color: 'rgba(255,255,255,.1)'
- }
- },
- data: dates
- }, {
- }],
- yAxis: [{
- // min: 50,
- axisLabel: {
- show: true,
- textStyle: {
- color: 'rgba(255,255,255,.6)'
- }
- },
- axisLine: {
- lineStyle: {
- color: 'rgba(255,255,255,.1)'
- }
- },
- splitLine: {
- lineStyle: {
- color: 'rgba(255,255,255,.1)'
- }
- }
- }],
- series: [{
- name: legends[0],
- type: 'line',
- smooth: false,
- lineStyle: {
- normal: {
- width: 2
- }
- },
- label: {
- normal: {
- show: false,
- position: 'bottom',
- color: '#fff',
- formatter: function (parmas) {
- if (parseFloat(parmas.data) <= 0)
- return '';
- return parmas.data + '%';
- }
- }
- },
- areaStyle: {
- normal: {
- color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
- offset: 0,
- color: 'rgba(24, 163, 64, 0.3)'
- }, {
- offset: 0.8,
- color: 'rgba(24, 163, 64, 0)'
- }], false),
- shadowColor: 'rgba(0, 0, 0, 0.1)',
- shadowBlur: 10
- }
- },
- itemStyle: {
- normal: {
- color: '#cdba00',
- borderColor: 'rgba(137,189,2,0.27)',
- borderWidth: 12
- }
- },
- symbolSize: 2,
- data: dbData
- }, {
- name: legends[1],
- type: 'line',
- smooth: false,
- lineStyle: {
- normal: {
- width: 2
- }
- },
- label: {
- normal: {
- show: false,
- position: 'bottom',
- color: '#fff',
- formatter: function (parmas) {
- if (parseFloat(parmas.value) <= 0)
- return '';
- return parmas.data + '%';
- }
- }
- },
- areaStyle: {
- normal: {
- color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
- offset: 0,
- color: 'rgba(39, 122,206, 0.3)'
- }, {
- offset: 0.8,
- color: 'rgba(39, 122,206, 0)'
- }], false),
- shadowColor: 'rgba(0, 0, 0, 0.1)',
- shadowBlur: 10
- }
- },
- itemStyle: {
- normal: {
- color: '#277ace',
- borderColor: 'rgba(0,136,212,0.2)',
- borderWidth: 12
- }
- }, symbolSize: 2,
- data: wbData
- }]
- };
- // 使用刚指定的配置项和数据显示图表。
- myChart.setOption(option);
- window.addEventListener("resize", function () {
- myChart.resize();
- });
- }
- function echarts_CC(legends, dates, dbData, wbData) {
- // 基于准备好的dom,初始化echarts实例
- var myChart = echarts.init(document.getElementById('echart4'));
- option = {
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- lineStyle: {
- color: '#57617B'
- }
- },
- // formatter:'{a}-{b}:{c}%'
- },
- legend: {
- data: legends,
- top: '0',
- textStyle: {
- color: "#fff"
- },
- itemGap: 20,
- },
- grid: {
- left: '0',
- right: '20',
- top: '10',
- bottom: '20',
- containLabel: true
- },
- xAxis: [{
- type: 'category',
- boundaryGap: false,
- axisLabel: {
- show: true,
- textStyle: {
- color: 'rgba(255,255,255,.6)'
- }
- },
- axisLine: {
- lineStyle: {
- color: 'rgba(255,255,255,.1)'
- }
- },
- data: dates
- }, {
- }],
- yAxis: [{
- axisLabel: {
- show: true,
- textStyle: {
- color: 'rgba(255,255,255,.6)'
- }
- },
- axisLine: {
- lineStyle: {
- color: 'rgba(255,255,255,.1)'
- }
- },
- splitLine: {
- lineStyle: {
- color: 'rgba(255,255,255,.1)'
- }
- }
- }],
- series: [{
- name: legends[0],
- type: 'line',
- smooth: false,
- lineStyle: {
- normal: {
- width: 2
- }
- },
- label: {
- normal: {
- show: false,
- position: 'bottom',
- color: '#fff',
- formatter: function (parmas) {
- if (parmas.data == 0)
- return '';
- return parmas.data + '%';
- }
- }
- },
- areaStyle: {
- normal: {
- color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
- offset: 0,
- color: 'rgba(24, 163, 64, 0.3)'
- }, {
- offset: 0.8,
- color: 'rgba(24, 163, 64, 0)'
- }], false),
- shadowColor: 'rgba(0, 0, 0, 0.1)',
- shadowBlur: 10
- }
- },
- itemStyle: {
- normal: {
- color: '#cdba00',
- borderColor: 'rgba(137,189,2,0.27)',
- borderWidth: 12
- }
- },
- symbolSize: 2,
- data: dbData
- }, {
- name: legends[1],
- type: 'line',
- label: {
- normal: {
- show: false,
- position: 'bottom',
- color: '#fff',
- formatter: function (parmas) {
- if (parmas.data == 0)
- return '';
- return parmas.data + '%';
- }
- }
- },
- smooth: false,
- symbolSize: 2,
- lineStyle: {
- normal: {
- width: 2
- }
- },
- areaStyle: {
- normal: {
- color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
- offset: 0,
- color: 'rgba(39, 122,206, 0.3)'
- }, {
- offset: 0.8,
- color: 'rgba(39, 122,206, 0)'
- }], false),
- shadowColor: 'rgba(0, 0, 0, 0.1)',
- shadowBlur: 10
- }
- },
- itemStyle: {
- normal: {
- color: '#277ace',
- borderColor: 'rgba(0,136,212,0.2)',
- borderWidth: 12
- }
- },
- data: wbData
- }]
- };
- // 使用刚指定的配置项和数据显示图表。
- myChart.setOption(option);
- console.log(option);
- window.addEventListener("resize", function () {
- myChart.resize();
- });
- }
- function outputZc(legends, xData, dbData, wbData) {
- // 基于准备好的dom,初始化echarts实例
- var myChart = echarts.init(document.getElementById('echart10'));
- option = {
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- lineStyle: {
- color: '#57617B'
- }
- }
- },
- "legend": {
- "data": legends,
- "top": "0%",
- "textStyle": {
- "color": "rgba(255,255,255,0.9)"//图例文字
- }
- },
- "xAxis": [
- {
- "type": "category",
- data: xData,
- axisLine: { lineStyle: { color: "rgba(255,255,255,.1)" } },
- axisLabel: {
- textStyle: { color: "rgba(255,255,255,.6)", fontSize: '14', },
- },
- },
- ],
- "yAxis": [
- {
- "type": "value",
- "name": "",
- // "interval": 10,
- "axisLabel": {
- "show": true,
- },
- axisLine: { lineStyle: { color: 'rgba(255,255,255,.4)' } },//左线色
- }
- ],
- "grid": {
- "top": "10%",
- "right": "30",
- "bottom": "30",
- "left": "70",
- show: true
- },
- "series": [
- {
- "name": legends[0],
- "type": "bar",
- "data": dbData,
- "barWidth": "auto",
- "itemStyle": {
- "normal": {
- "color": {
- "type": "linear",
- "x": 0,
- "y": 0,
- "x2": 0,
- "y2": 1,
- "colorStops": [
- {
- "offset": 0,
- "color": "#609db8"
- },
- {
- "offset": 1,
- "color": "#609db8"
- }
- ],
- "globalCoord": false
- }
- }
- },
- label: {
- show: false,
- color: '#fff',
- position: 'top',
- formatter: function (params) {
- if (params.data == 0) {
- return '';
- }
- return params.data;
- }
- }
- },
- {
- "name": legends[1],
- "type": "bar",
- "data": wbData,
- "barWidth": "auto",
- "itemStyle": {
- "normal": {
- "color": {
- "type": "linear",
- "x": 0,
- "y": 0,
- "x2": 0,
- "y2": 1,
- "colorStops": [
- {
- "offset": 0,
- "color": "#66b8a7"
- },
- {
- "offset": 1,
- "color": "#66b8a7"
- }
- ],
- "globalCoord": false
- }
- }
- },
- label: {
- show: false,
- color: '#fff',
- position: 'top',
- formatter: function (params) {
- if (params.data == 0) {
- return '';
- }
- return params.data;
- }
- },
- "barGap": "0"
- }
- ]
- };
- // 使用刚指定的配置项和数据显示图表。
- myChart.setOption(option);
- window.addEventListener("resize", function () {
- myChart.resize();
- });
- }
- function outputCc(legends, xData, dbData, wbData) {
- // 基于准备好的dom,初始化echarts实例
- var myChart = echarts.init(document.getElementById('echart11'));
- option = {
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- lineStyle: {
- color: '#57617B'
- }
- }
- },
- "legend": {
- "data": legends,
- "top": "0%",
- "textStyle": {
- "color": "rgba(255,255,255,0.9)"//图例文字
- }
- },
- "xAxis": [
- {
- "type": "category",
- data: xData,
- axisLine: { lineStyle: { color: "rgba(255,255,255,.1)" } },
- axisLabel: {
- textStyle: { color: "rgba(255,255,255,.6)", fontSize: '14', },
- },
- },
- ],
- "yAxis": [
- {
- "type": "value",
- "name": "",
- // "interval": 10,
- "axisLabel": {
- "show": true,
- },
- axisLine: { lineStyle: { color: 'rgba(255,255,255,.4)' } },//左线色
- }
- ],
- "grid": {
- "top": "10%",
- "right": "30",
- "bottom": "30",
- "left": "70",
- show: true
- },
- "series": [
- {
- "name": legends[0],
- "type": "bar",
- "data": dbData,
- "barWidth": "auto",
- "itemStyle": {
- "normal": {
- "color": {
- "type": "linear",
- "x": 0,
- "y": 0,
- "x2": 0,
- "y2": 1,
- "colorStops": [
- {
- "offset": 0,
- "color": "#609db8"
- },
- {
- "offset": 1,
- "color": "#609db8"
- }
- ],
- "globalCoord": false
- }
- }
- },
- label: {
- show: false,
- color: '#fff',
- position: 'top',
- }
- },
- {
- "name": legends[1],
- "type": "bar",
- "data": wbData,
- "barWidth": "auto",
- "itemStyle": {
- "normal": {
- "color": {
- "type": "linear",
- "x": 0,
- "y": 0,
- "x2": 0,
- "y2": 1,
- "colorStops": [
- {
- "offset": 0,
- "color": "#66b8a7"
- },
- {
- "offset": 1,
- "color": "#66b8a7"
- }
- ],
- "globalCoord": false
- }
- }
- },
- label: {
- show: false,
- color: '#fff',
- position: 'top',
- },
- "barGap": "0"
- }
- ]
- };
- // 使用刚指定的配置项和数据显示图表。
- myChart.setOption(option);
- window.addEventListener("resize", function () {
- myChart.resize();
- });
- }
- function outputFz(legends, xData, dbData, wbData) {
- // 基于准备好的dom,初始化echarts实例
- var myChart = echarts.init(document.getElementById('echart12'));
- option = {
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- lineStyle: {
- color: '#57617B'
- }
- }
- },
- "legend": {
- "data": legends,
- "top": "0%",
- "textStyle": {
- "color": "rgba(255,255,255,0.9)"//图例文字
- }
- },
- "xAxis": [
- {
- "type": "category",
- data: xData,
- axisLine: { lineStyle: { color: "rgba(255,255,255,.1)" } },
- axisLabel: {
- textStyle: { color: "rgba(255,255,255,.6)", fontSize: '14', },
- },
- },
- ],
- "yAxis": [
- {
- "type": "value",
- "name": "",
- // "interval": 10,
- "axisLabel": {
- "show": true,
- },
- axisLine: { lineStyle: { color: 'rgba(255,255,255,.4)' } },//左线色
- }
- ],
- "grid": {
- "top": "10%",
- "right": "30",
- "bottom": "30",
- "left": "70",
- show: true
- },
- "series": [
- {
- "name": legends[0],
- "type": "bar",
- "data": dbData,
- "barWidth": "auto",
- "itemStyle": {
- "normal": {
- "color": {
- "type": "linear",
- "x": 0,
- "y": 0,
- "x2": 0,
- "y2": 1,
- "colorStops": [
- {
- "offset": 0,
- "color": "#609db8"
- },
- {
- "offset": 1,
- "color": "#609db8"
- }
- ],
- "globalCoord": false
- }
- }
- },
- label: {
- show: false,
- color: '#fff',
- position: 'top',
- }
- },
- {
- "name": legends[1],
- "type": "bar",
- "data": wbData,
- "barWidth": "auto",
- "itemStyle": {
- "normal": {
- "color": {
- "type": "linear",
- "x": 0,
- "y": 0,
- "x2": 0,
- "y2": 1,
- "colorStops": [
- {
- "offset": 0,
- "color": "#66b8a7"
- },
- {
- "offset": 1,
- "color": "#66b8a7"
- }
- ],
- "globalCoord": false
- }
- }
- },
- label: {
- show: false,
- color: '#fff',
- position: 'top',
- },
- "barGap": "0"
- }
- ]
- };
- // 使用刚指定的配置项和数据显示图表。
- myChart.setOption(option);
- window.addEventListener("resize", function () {
- myChart.resize();
- });
- }
- function echarts_5(legends, completedData, totalData) {
- // 基于准备好的dom,初始化echarts实例
- var myChart = echarts.init(document.getElementById('echart5'));
- // 颜色
- var lightBlue = {
- type: 'linear',
- x: 0,
- y: 0,
- x2: 0,
- y2: 1,
- colorStops: [{
- offset: 0,
- color: 'rgba(41, 121, 255, 1)'
- }, {
- offset: 1,
- color: 'rgba(0, 192, 255, 1)'
- }],
- globalCoord: false
- }
- var option = {
- tooltip: {
- show: false
- },
- grid: {
- top: '0%',
- left: '78',
- right: '14%',
- bottom: '0%',
- },
- xAxis: {
- min: 0,
- max: totalData[0],
- splitLine: {
- show: false
- },
- axisTick: {
- show: false
- },
- axisLine: {
- show: false
- },
- axisLabel: {
- show: false
- }
- },
- yAxis: {
- data: legends,
- //offset: 15,
- axisTick: {
- show: false
- },
- axisLine: {
- show: false
- },
- axisLabel: {
- color: 'rgba(255,255,255,.6)',
- fontSize: 14
- }
- },
- series: [{
- type: 'bar',
- label: {
- show: true,
- zlevel: 10000,
- position: 'right',
- padding: 10,
- color: '#49bcf7',
- fontSize: 14,
- formatter: '{c}'
- },
- itemStyle: {
- color: '#49bcf7'
- },
- barWidth: '15',
- data: completedData,
- z: 10
- }, {
- type: 'bar',
- barGap: '-100%',
- itemStyle: {
- color: '#fff',
- opacity: 0.1
- },
- barWidth: '15',
- data: totalData,
- z: 5
- }],
- };
- // 使用刚指定的配置项和数据显示图表。
- myChart.setOption(option);
- window.addEventListener("resize", function () {
- myChart.resize();
- });
- }
- function loadCurrentOutput() {
- $.get(prefix + 'GetCurrentOutputs', {}, function (res) {
- var html = '';
- if (res && res.length > 0) {
- res.forEach(element => {
- html += '<li><span class="col15">' + element.index + '-' + element.pName + '</span><span class="col50"><div class="skillbar clearfix dayOutputBar" data-percent="'
- + (element.useRatio * 100).toFixed(2) + '%">'
- + '<div class="skillbar-bar output-bar" style="background: #49bcf7;"></div>'
- + '<div class="skill-bar-percent output-bar-percent">' + element.output + '</div>'
- + '</div></span><span class="col20">' + element.capacity + '</span>'
- + '<span class="col15">' + (element.useRatio * 100).toFixed(2) + '%</span></li>';
- });
- }
- $('.dayOutputs').html(html);
- $('.dayOutputBar').each(function () {
- $(this).find('.output-bar').animate({
- width: $(this).attr('data-percent')
- }, 2000);
- });
- }, 'json');
- }
- // 加载保养率
- function loadPmRate() {
- $.get(prefix + 'GetPmRate', {}, function (res) {
- console.log(res);
- var html = '';
- res.forEach(element => {
- html += '<li><span class="col25">' + element.pName + '</span><span class="col50"><div class="skillbar clearfix pmBar" data-percent="' + (element.pmRate * 100).toFixed(2) + '%">'
- + '<div class="skillbar-bar pmBar-bar" style="background: #49bcf7;"></div>'
- + '<div class="skill-bar-percent pmbar-bar-percent">' + (element.pmRate * 100).toFixed(2) + '%</div>'
- + '</div></span><span class="col25">' + element.machineCount + '</span></li>';
- });
- $('.machinePmRate').html(html);
- $('.pmBar').each(function () {
- $(this).find('.pmBar-bar').animate({
- width: $(this).attr('data-percent')
- }, 2000);
- });
- // if (res.length > 5) {
- $('#machinePmRate').liMarquee({
- direction: 'up',/*身上滚动*/
- runshort: false,/*内容不足时不滚动*/
- scrollamount: 20/*速度*/,
- behavior: 'alternate'
- });
- //}
- }, 'json');
- }
- function loadAlarmCodePie() {
- var take = 5;
- $.get(prefix + 'GetAlarmCodePie', { take: take }, function (res) {
- console.log(res);
- var legends = [];
- var data = [];
- var total = 0;
- res.forEach(element => {
- total += element.count;
- });
- res.forEach(element => {
- legends.push(element.alarmCode);
- data.push({
- value: Math.round(element.count / total * 100),
- name: element.alarmCode
- });
- });
- echarts_1(legends, data);
- }, 'json');
- }
- // 加载未完成订单当前生产的工序
- function loadCompletedLots() {
- $.get(prefix + 'GetUnCompletedOrders', {}, function (res) {
- console.log(res);
- var html = '';
- res.forEach(element => {
- html += '<li><p><span>' + element.orderCode + '</span><span>' + element.productCode + '</span><span>' + element.proName + '</span></p></li>';
- });
- $('.lastestLots').html(html);
- $('#lastestLots').liMarquee({
- direction: 'up',/*身上滚动*/
- runshort: false,/*内容不足时不滚动*/
- scrollamount: 20/*速度*/,
- behavior: 'alternate'
- });
- }, 'json');
- }
- // 加载保养过期机台
- function loadMachineToPms() {
- $.get(prefix + 'GetMachineToPMs', {}, function (res) {
- console.log(res);
- var html = '';
- var index = 1;
- res.forEach(element => {
- html += '<li><p><span class="li-num">' + index++ + '</span><span class="li-pname">' + element.pName + '</span><span class="li-mac">'
- + element.macCode + '</span><span class="li-duty">' + element.dutyName + '</span></p></li>'
- });
- $('#machineToPm').html(html);
- $('.machineToPm').liMarquee({
- direction: 'up',/*身上滚动*/
- runshort: false,/*内容不足时不滚动*/
- scrollamount: 20/*速度*/,
- behavior: 'alternate'
- });
- }, 'json');
- }
- function loadGoodRate(pCode) {
- $.get(prefix + 'GetProductGoodRate', { pCode: pCode }, function (res) {
- console.log(res);
- var legends = [];
- var lastData = [];
- var thisData = [];
- var dates = [];
- res.forEach(element => {
- if (legends.indexOf(element.year.toString()) <= -1) {
- legends.push(element.year.toString());
- }
- });
- for (var i = 0; i < 12; i++) {
- var currnetMonth = i + 1;
- dates.push(currnetMonth);
- res.forEach(element => {
- if (element.year == legends[0] && element.month == currnetMonth) {
- lastData.push((element.rate * 100).toFixed(2));
- }
- });
- }
- for (var j = 0; j < new Date().getMonth() + 1; j++) {
- res.forEach(element => {
- if (element.year == legends[1] && element.month == j + 1) {
- thisData.push((element.rate * 100).toFixed(2));
- }
- });
- }
- if (pCode === '中测') {
- echarts_ZC(legends, dates, lastData, thisData);
- } else {
- echarts_CC(legends, dates, lastData, thisData);
- }
- }, 'json');
- }
- function loadOutputs(pCode) {
- $.get(prefix + 'GetOutputBar', { pCode: pCode }, function (res) {
- var legends = [];
- var xData = [];
- var dbData = [];
- var wbData = [];
- xData = ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'];
- res.legend.forEach(element => {
- legends.push(element);
- });
- res.sources.forEach(element => {
- element.data.forEach(item => {
- if (element.title == legends[0]) {
- dbData.push(parseInt(item.value));
- } else if (element.title == legends[1]) {
- wbData.push(parseInt(item.value));
- }
- });
- });
- if (pCode === '中测') {
- outputZc(legends, xData, dbData, wbData);
- } else if (pCode === '成测') {
- outputCc(legends, xData, dbData, wbData);
- } else if (pCode === '封装') {
- outputFz(legends, xData, dbData, wbData);
- }
- }, 'json');
- }
- function loadOS() {
- var take = 5;
- $.get(prefix + 'GetOS', { take: take }, function (res) {
- console.log(res);
- var legends = [];
- var data = [];
- var total = 0;
- res.forEach(element => {
- total += element.count;
- });
- var total = 0;
- res.forEach(element => {
- legends.push(element.alarmCode);
- data.push({
- value: Math.round(element.radio),
- name: element.alarmCode
- });
- total += Math.round(element.radio);
- });
- if (total < 100 && total > 0) {
- data.push({
- value: 100 - total,
- name: '其它'
- });
- legends.push('其它');
- }
- echarts_2(legends, data);
- }, 'json');
- }
- })
|