index.html 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  6. <link rel="shortcut icon" href="/img/logo.png" />
  7. <link rel="bookmark" href="/img/logo.png" />
  8. <link href="/Plugins/animate/animate.min.css" rel="stylesheet" />
  9. <link rel="stylesheet" href="../DashBoard.css?v3" />
  10. <script src="/Plugins/jquery-3.4.1/jquery-3.4.1.min.js"></script>
  11. <script src="/Plugins/animate/xanimate.js"></script>
  12. <script src="/Plugins/xrequest/xrequest.min.js"></script>
  13. <title>东科软件</title>
  14. </head>
  15. <body style="background-color:black;">
  16. <div class="box_1920_1080">
  17. <div class="box_title" style="display:flex;flex-direction:row;">
  18. <div style="width:30%;text-align:left;"></div>
  19. <div style="width: 40%; text-align: center; font-size: 38px; font-weight: 700">成检包装看板</div>
  20. <div style="width:30%;text-align:right;"><span class="box_title_loading" style="font-size: 32px; display: none;" id="报表加载"></span></div>
  21. </div>
  22. <div>
  23. <div class="box_body" style="display: flex; flex-direction: column;">
  24. <!--包装产量日统计(小时)-->
  25. <div style="width:1840px;height:200px;display:flex;flex-direction:row;">
  26. <div style="width: 100%; height: 200px;">
  27. <div style="color:white;font-size:20px;font-weight:600; text-align:center">包装产量日统计(小时)</div>
  28. <canvas id="canvasDayCL" style="-moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; height: 175px; width: 100%"></canvas>
  29. </div>
  30. </div>
  31. <!--包装产量月统计(天)-->
  32. <div style="width: 1840px; height: 200px; display: flex; flex-direction: row; margin-top: 30px">
  33. <div style="width: 100%; height: 200px;">
  34. <div style="color:white;font-size:20px;font-weight:600; text-align:center">包装产量月统计(天)</div>
  35. <canvas id="canvasDayCL2" style="-moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; height: 175px; width: 100%"></canvas>
  36. </div>
  37. </div>
  38. <!--包装任务-->
  39. <div style="height: 100px; border:1px blue;">
  40. <div style="width: 100%; height: 530px; display: flex; flex-direction: row; margin-top: 0px;">
  41. <div style="width: 100%; height: 530px; padding-right: 20px; margin-left: -10px">
  42. <table id="table1" cellspacing="0" cellpadding="0" border="0" style="width:100%;">
  43. <tr><td colspan="12" style="color: white; font-size: 20px; border-style: none;">包装任务</td></tr>
  44. <tr class="tr_title_warning" id="test">
  45. <td style="font-size: 16px; width: 3%">序号</td>
  46. <td style="font-size: 16px; width: 3%">线号</td>
  47. <td style="font-size: 16px; width: 8%">产品型号</td>
  48. <td style="font-size: 16px; width: 10%">物料编码</td>
  49. <td style="font-size: 16px; width: 12%">商标</td>
  50. <td style="font-size: 16px; width: 12%">变更商标</td>
  51. <td style="font-size: 16px; width: 8%">水距</td>
  52. <td style="font-size: 16px; width: 5%">任务数量</td>
  53. <td style="font-size: 16px; width: 5% ">出库数量</td>
  54. <td style="font-size: 16px; width: 8%">状态</td>
  55. <td style="font-size: 16px; width: 25%">下单时间</td>
  56. </tr>
  57. </table>
  58. </div>
  59. </div>
  60. <div style="width: 120%; height: 120px; padding-right: 20px; margin-top: -440px; margin-left:-7px">
  61. <table id="mb" style="display: none; border: 1px solid #38dcff; ">
  62. <tr class="tr_title_warning">
  63. <td style="font-size: 16px; color: white; width: 31px ">序号</td>
  64. <td style="font-size: 16px; color: white; width: 35px ">线号</td>
  65. <td style="font-size: 16px; color: white; width: 126px ">产品型号</td>
  66. <td style="font-size: 16px; color: white; width: 163px ">物料编码</td>
  67. <td style="font-size: 16px; color: white; width: 201px ">商标</td>
  68. <td style="font-size: 16px; color: white; width: 200px ">变更商标</td>
  69. <td style="font-size: 16px; color: white; width: 127px ">水距</td>
  70. <td style="font-size: 16px; color: white; width: 70px ">任务数量</td>
  71. <td style="font-size: 16px; color: white; width: 71px ">出库数量</td>
  72. <td style="font-size: 16px; color: white; width: 127px ">状态</td>
  73. <td style="font-size: 16px; color: white; width: 441px ">下单时间</td>
  74. </tr>
  75. </table>
  76. <table id="mx" cellspacing="0" cellpadding="0" border="0" margin-top: 25px; width: 100%; font-size: 35px;height:100px">
  77. </table>
  78. </div>
  79. </div>
  80. <!--设备状态-->
  81. <div style="width: 1000px; height: 530px; display: flex; flex-direction: row; margin-top: 160px; margin-left:500px">
  82. <div style="width: 70%;height:530px;padding-right:20px;">
  83. <table cellspacing="0" cellpadding="0" border="0" style="width:100%;">
  84. <tr class="tr_title_warning">
  85. <td colspan="8" style="color: white; border-style: none; ">设备状态</td>
  86. </tr>
  87. <tr class="tr_title_warning">
  88. <td style="font-size: 16px; width: 8% ">序号</td>
  89. <td style="font-size: 16px; width: 10%">设备名称</td>
  90. <td style="font-size: 16px; width: 13% ">设备状态</td>
  91. </tr>
  92. <tr class="tr_bg_light_warning" style="height:30px;">
  93. <td style="font-size: 16px; width: 8% ">1</td>
  94. <td style="font-size: 16px; width: 10%">一线装箱机</td>
  95. <td style="font-size: 16px; width: 13%" id="bz01">故障</td>
  96. </tr>
  97. <tr class="tr_bg_light_warning" style="height:30px;">
  98. <td style="font-size: 16px; width: 8% ">2</td>
  99. <td style="font-size: 16px; width: 10%">一线码垛机器人</td>
  100. <td style="font-size: 16px; width: 13% " id="bz02">故障</td>
  101. </tr>
  102. <tr class="tr_bg_light_warning" style="height:30px;">
  103. <td style="font-size: 16px; width: 8% ">3</td>
  104. <td style="font-size: 16px; width: 10%">二线装箱机</td>
  105. <td style="font-size: 16px; width: 13% " id="bz03">故障</td>
  106. </tr>
  107. <tr class="tr_bg_light_warning" style="height:30px;">
  108. <td style="font-size: 16px; width: 8% ">3</td>
  109. <td style="font-size: 16px; width: 10%">二线码垛机器人</td>
  110. <td style="font-size: 16px; width: 13% " id="bz04">故障</td>
  111. </tr>
  112. </table>
  113. </div>
  114. </div>
  115. <!--包装线产量(旧)-->
  116. <div style="width: 20%; height: 310px; margin-top: -510px ">
  117. <div style="color:white;font-size:20px;font-weight:600; text-align:center">包装线产量(日)</div>
  118. <canvas id="canvasDayCL3" style="-moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; height: 280px; width: 100%;margin-top:-40px;"></canvas>
  119. </div>
  120. <!--品管抽查-->
  121. <div style="width: 25%; height: 340px; margin-top: -240px; margin-left: 1350px ">
  122. <div style="color:white;font-size:20px;font-weight:600; text-align:center">品管抽查</div>
  123. <canvas id="canvasDefectA" style="-moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; height: 200px; width: 100%"></canvas>
  124. </div>
  125. </div>
  126. </div>
  127. </div>
  128. <script>
  129. var showpage = 4; //显示条数
  130. var pages = 1; //当前页数
  131. var excesspage; //剩余条数
  132. var countpage; //总条数
  133. $(document).ready(function () {
  134. initData();
  135. //产量查询
  136. Numinfo();
  137. doGetTime = setInterval(function () { Numinfo(); }, 30000);
  138. //设备状态
  139. packStatu();
  140. doGetTime = setInterval(function () { packStatu(); }, 30000);
  141. DataPG()
  142. setInterval(function () { DataPG(); }, 60000);
  143. //包装任务翻页查询
  144. getPage();
  145. doGetTime = setInterval(function () { getPage(); }, 3000);
  146. packHour();
  147. doGetTime = setInterval(function () { packHour(); }, 60000);
  148. packDay();
  149. doGetTime = setInterval(function () { packDay(); }, 60000);
  150. //饼状图
  151. //bingData();
  152. //doGetTime = setInterval(function () { bingData(); }, 30000);
  153. });
  154. //品管
  155. function DataPG() {
  156. $.get("rpt.ashx?m=pg", function (data) {
  157. var json = JSON.parse(data);
  158. if (json["success"] == true) {
  159. var count1 = parseFloat(json["rows"][0]["合格"]);
  160. var count2 = parseFloat(json["rows"][1]["合格"]);
  161. var count3 = parseFloat(json["rows"][2]["合格"]);
  162. var count4 = parseFloat(json["rows"][3]["合格"]);
  163. var count5 = parseFloat(json["rows"][4]["合格"]);
  164. var count6 = parseFloat(json["rows"][5]["合格"]);
  165. var goodtype1 = json["rows"][0]["类型"];
  166. var goodtype2 = json["rows"][1]["类型"];
  167. var goodtype3 = json["rows"][2]["类型"];
  168. var goodtype4 = json["rows"][3]["类型"];
  169. var goodtype5 = json["rows"][4]["类型"];
  170. var goodtype6 = json["rows"][5]["类型"];
  171. window.DefectA.data.datasets[0].data = [count1, count2, count3, count4, count5, count6];
  172. window.DefectA.data.labels = [goodtype1, goodtype2, goodtype3, goodtype4, goodtype5, goodtype6]
  173. window.DefectA.update();
  174. }
  175. });
  176. }
  177. function initData() {
  178. window.chartColors = {
  179. red: 'rgb(255, 99, 132)',
  180. orange: 'rgb(255, 159, 64)',
  181. yellow: 'rgb(255, 250, 86)',
  182. green: 'rgb(75, 192, 192)',
  183. blue: 'rgb(54, 162, 250)',
  184. purple: 'rgb(153, 102, 255)',
  185. grey: 'rgb(231,233,237)'
  186. };
  187. var color = Chart.helpers.color;
  188. window.randomScalingFactor = function (num) {
  189. return Math.round(Math.random() * num);
  190. }
  191. Chart.defaults.global.defaultFontColor = 'white';
  192. Chart.defaults.global.defaultFontSize = 13;
  193. Chart.defaults.global.legend.display = false;
  194. //一号折线图=========================================
  195. window.configDayCL = {
  196. data: {
  197. labels: [07, 08, 09, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 01, 02, 03, 04, 05, 06],
  198. datasets: [{
  199. label: "一线",
  200. backgroundColor: color(window.chartColors.blue).alpha(0.6).rgbString(),
  201. borderColor: window.chartColors.blue,
  202. borderWidth: 1,
  203. pointRadius: 10,
  204. data: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
  205. fill: false,
  206. }, {
  207. label: "二线",
  208. fill: false,
  209. backgroundColor: color(window.chartColors.orange).alpha(0.6).rgbString(),
  210. borderColor: window.chartColors.orange,
  211. borderWidth: 1,
  212. pointRadius: 10,
  213. data: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
  214. }]
  215. },
  216. type: 'line',
  217. options: {
  218. responsive: true,
  219. legend: {
  220. display: true
  221. },
  222. title: {
  223. display: false,
  224. text: '每小时产量'
  225. },
  226. tooltips: {
  227. mode: 'index',
  228. intersect: false,
  229. },
  230. hover: {
  231. mode: 'nearest',
  232. intersect: true
  233. },
  234. scales: {
  235. xAxes: [{
  236. display: true,
  237. scaleLabel: {
  238. display: false,
  239. labelString: ''
  240. }
  241. }],
  242. yAxes: [{
  243. display: true,
  244. scaleLabel: {
  245. display: false,
  246. labelString: 'Value'
  247. }
  248. }]
  249. }
  250. }
  251. };
  252. var ctxDayCL = document.getElementById("canvasDayCL").getContext("2d");
  253. window.DayCL = new Chart(ctxDayCL, configDayCL);
  254. //二号折线图=========================================
  255. window.configDayCL2 = {
  256. data: {
  257. labels: [01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31],
  258. datasets: [{
  259. label: "一线",
  260. backgroundColor: color(window.chartColors.blue).alpha(0.6).rgbString(),
  261. borderColor: window.chartColors.blue,
  262. borderWidth: 1,
  263. pointRadius: 10,
  264. data: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
  265. fill: false,
  266. }, {
  267. label: "二线",
  268. fill: false,
  269. backgroundColor: color(window.chartColors.orange).alpha(0.6).rgbString(),
  270. borderColor: window.chartColors.orange,
  271. borderWidth: 1,
  272. pointRadius: 10,
  273. data: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
  274. }]
  275. },
  276. type: 'line',
  277. options: {
  278. responsive: true,
  279. legend: {
  280. display: true
  281. },
  282. title: {
  283. display: false,
  284. text: '每小时产量'
  285. },
  286. tooltips: {
  287. mode: 'index',
  288. intersect: false,
  289. },
  290. hover: {
  291. mode: 'nearest',
  292. intersect: true
  293. },
  294. scales: {
  295. xAxes: [{
  296. display: true,
  297. scaleLabel: {
  298. display: false,
  299. labelString: ''
  300. }
  301. }],
  302. yAxes: [{
  303. display: true,
  304. scaleLabel: {
  305. display: false,
  306. labelString: 'Value'
  307. }
  308. }]
  309. }
  310. }
  311. };
  312. var ctxDayCL2 = document.getElementById("canvasDayCL2").getContext("2d");
  313. window.DayCL2 = new Chart(ctxDayCL2, configDayCL2);
  314. //柱状图=====================================
  315. window.canvasDayCL3 = {
  316. data: {
  317. labels: ["一线", "二线"],
  318. datasets: [
  319. {
  320. label: "产量",
  321. fill: false,
  322. backgroundColor: color(window.chartColors.blue).alpha(0.6).rgbString(),
  323. borderColor: window.chartColors.blue,
  324. borderWidth: 2,
  325. pointRadius: 15,
  326. }
  327. ]
  328. },
  329. type: 'bar',
  330. options: {
  331. legend: {
  332. display: true
  333. },
  334. title: {
  335. display: true,
  336. text: ""
  337. },
  338. tooltips: {
  339. mode: 'point',
  340. intersect: false
  341. },
  342. responsive: true,
  343. scales: {
  344. xAxes: [{
  345. stacked: false
  346. }],
  347. yAxes: [{
  348. display: true,
  349. stacked: false,
  350. ticks: {
  351. min: 10,
  352. stepSize: 100,
  353. max: 1000
  354. }
  355. }]
  356. }
  357. }
  358. };
  359. var ctxDayCL3 = document.getElementById("canvasDayCL3").getContext("2d");
  360. window.DayCL3 = new Chart(ctxDayCL3, canvasDayCL3);
  361. //扇形图=====================================
  362. window.canvasDefectA = {
  363. data: {
  364. labels: ['1', '2'],
  365. datasets: [{
  366. label: '工序',
  367. backgroundColor: [
  368. color(window.chartColors.blue).alpha(0.35).rgbString(),
  369. color(window.chartColors.red).alpha(0.35).rgbString(),
  370. color(window.chartColors.green).alpha(0.35).rgbString(),
  371. color(window.chartColors.orange).alpha(0.35).rgbString(),
  372. color(window.chartColors.purple).alpha(0.35).rgbString()
  373. ],
  374. fill: false,
  375. borderColor: [
  376. window.chartColors.blue,
  377. window.chartColors.red,
  378. window.chartColors.green,
  379. window.chartColors.orange,
  380. window.chartColors.purple
  381. ],
  382. borderWidth: 1,
  383. pointRadius: 30,
  384. data: [0, 0, 0, 0, 0, 0]
  385. }]
  386. },
  387. type: 'pie',
  388. options: {
  389. legend: {
  390. display: true
  391. },
  392. title: {
  393. display: false,
  394. text: "甲班缺陷"
  395. },
  396. tooltips: {
  397. mode: 'point',
  398. intersect: false
  399. },
  400. responsive: true
  401. }
  402. };
  403. var ctxDefectA = document.getElementById("canvasDefectA").getContext("2d");
  404. window.DefectA = new Chart(ctxDefectA, canvasDefectA);
  405. }
  406. //饼状
  407. //function bingData() {
  408. // var num1 = 0; num2 = 0; num3 = 0; num4 = 0; num5 = 0; num6 = 0;
  409. // //饼
  410. // $.get("rpt.ashx?m=bingData", function (data) {
  411. // var json = JSON.parse(data);
  412. // window.Device.data.datasets[0].data = [num1, num2, num3, num4, num5, num6];
  413. // window.Device.update();
  414. // });
  415. //}
  416. //包装任务翻页查询
  417. function getPage() {
  418. $.get('rpt.ashx?m=packingDataNumber', function (data) {
  419. var json = JSON.parse(data);
  420. if (json["success"] == true) {
  421. countpage = parseInt(json["counts"]);
  422. }
  423. });
  424. excesspage = countpage - (showpage * pages)
  425. if (excesspage > 0) {
  426. pages++;
  427. }
  428. else {
  429. pages = 1;
  430. }
  431. $.get("rpt.ashx?m=packingData&&page=" + pages, function (data) {
  432. var json = JSON.parse(data);
  433. if (json["success"] == true) {
  434. $("#mx").html("");
  435. for (var i = 0; i < json.rows.length; i++) {
  436. var temp = $("#mb").html();
  437. temp.replace("<tbody>", "").replace("</tbody>", "");
  438. temp = temp.replace('序号', json["rows"][i]['序号']);
  439. temp = temp.replace('线号', json["rows"][i]['线号']);
  440. temp = temp.replace('产品型号', json["rows"][i]['产品型号']);
  441. temp = temp.replace('物料编码', json["rows"][i]['物料编码']);
  442. temp = temp.replace('商标', json["rows"][i]['商标']);
  443. temp = temp.replace('商标变更', json["rows"][i]['商标变更']);
  444. temp = temp.replace('出水距', json["rows"][i]['出水距']);
  445. temp = temp.replace('任务数量', json["rows"][i]['任务数量']);
  446. temp = temp.replace('出库数量', json["rows"][i]['出库数量']);
  447. temp = temp.replace('状态', json["rows"][i]['状态']);
  448. temp = temp.replace('下单时间', json["rows"][i]['下单时间']);
  449. $("#mx").append(temp);
  450. }
  451. }
  452. });
  453. }
  454. //产量查询
  455. function Numinfo() {
  456. $.get("rpt.ashx?m=canvasDayCL3", function (data) {
  457. var json = JSON.parse(data);
  458. if (json["success"] == true) {
  459. window.DayCL3.data.datasets[0].data[0] = (json["rows"][0]["SBZ001"]);
  460. window.DayCL3.data.datasets[0].data[1] = (json["rows"][0]["SBZ002"]);
  461. window.DayCL3.update();
  462. }
  463. });
  464. }
  465. //设备查询
  466. function packStatu() {
  467. $.get("rpt.ashx?m=pack", function (data) {
  468. var json = JSON.parse(data);
  469. for (var i = 0; i < json.length; i++) {
  470. changeState("#bz0" + (i + 1).toString(), json[i]["data"].toString());
  471. }
  472. });
  473. // var token;
  474. // $(function () {
  475. // $.ajax({
  476. // // 设置ajax的参数
  477. // // 请求数据的url地址:接口地址
  478. // url: 'https://api-iothub-iotsuite-ensaas.leando.cloud/v1/sso/token',
  479. // // 请求数据方式:get post
  480. // type: 'post',
  481. // // 返回的数据格式 json
  482. // dataType: 'json',
  483. // // data:发送给接口的数据
  484. // data: JSON.stringify({ userName: '18741029029', password: '18741029029Aa_' }),
  485. // // 请求成功之后要执行的回调函数
  486. // success: function (dat) {
  487. // //dat:服务端返回的数据
  488. // console.log('请求成功');
  489. // console.log(dat.accessToken);
  490. //token = dat.accessToken
  491. // $.ajax({
  492. // type: "get",
  493. // url: "https://api-iothub-iotsuite-ensaas.leando.cloud/v1/devices/{deviceID}/deviceshadow",
  494. // data: JSON.stringify({ deviceID: 'b3d314fd19584f59b7da1f4a898d8dff- 1号智能装箱机' }),
  495. // beforeSend: function (request) {
  496. // request.setRequestHeader("Token", token);
  497. // },
  498. // success: function (result) {
  499. // alert(result);
  500. // }
  501. // })
  502. // },
  503. // // 请求失败
  504. // error: function (e) {
  505. // console.log('请求失败')
  506. // }
  507. // })
  508. // })
  509. //$(function () {
  510. // $.ajax({
  511. // // 设置ajax的参数
  512. // // 请求数据的url地址:接口地址
  513. // url: 'https://api-iothub-iotsuite-ensaas.leando.cloud/v1/sso/token',
  514. // // 请求数据方式:get post
  515. // type: 'post',
  516. // // 返回的数据格式 json
  517. // dataType: 'json',
  518. // // data:发送给接口的数据
  519. // data: JSON.stringify({ userName: '18741029029', password: '18741029029Aa_' }),
  520. // // 请求成功之后要执行的回调函数
  521. // success: function (dat) {
  522. // //dat:服务端返回的数据
  523. // console.log(dat.accessToken)
  524. // $.ajax({
  525. // // 设置ajax的参数
  526. // // 请求数据的url地址:接口地址
  527. // url: 'http://api-iothub-iotsuite-ensaas.leando.cloud/v1/devices/b3d314fd19584f59b7da1f4a898d8dff/deviceshadow',
  528. // // 请求数据方式:get post
  529. // type: 'get',
  530. // // 返回的数据格式 json
  531. // dataType: 'json',
  532. // // headers:发送给接口的数据
  533. // headers: JSON.stringify({ Token: dat.accessToken }),
  534. // // 请求成功之后要执行的回调函数
  535. // success: function (dat1) {
  536. // //dat:服务端返回的数据
  537. // console.log(dat1)
  538. // },
  539. // // 请求失败
  540. // error: function (e) {
  541. // console.log(e);
  542. // alert('请求失败')
  543. // }
  544. // })
  545. // },
  546. // // 请求失败
  547. // error: function (e) {
  548. // console.log(e);
  549. // alert('请求失败')
  550. // }
  551. // })
  552. //})
  553. }
  554. //包装产量日统计(小时) 折线图数据源
  555. function packHour() {
  556. $.get("rpt.ashx?m=packHour", function (data) {
  557. var json = JSON.parse(data);
  558. if (json["success"] == true) {
  559. for (var n = 0; n < json.rows.length; n++) {
  560. window.DayCL.data.labels[n] = (json["rows"][n]["SJ"]);
  561. window.DayCL.data.datasets[0].data[n] = (json["rows"][n]["SBZ001"]);
  562. window.DayCL.data.datasets[1].data[n] = (json["rows"][n]["SBZ002"]);
  563. }
  564. window.DayCL.update();
  565. }
  566. });
  567. }
  568. //包装产量日统计(每日) 折线图数据源
  569. function packDay() {
  570. $.get("rpt.ashx?m=packDay", function (data) {
  571. var json = JSON.parse(data);
  572. if (json["success"] == true) {
  573. for (var n = 0; n < json.rows.length; n++) {
  574. for (var z = 0; z < 31; z++) {
  575. var m = z + 1;
  576. if (z < 9) {
  577. m = '0' + m.toString();
  578. }
  579. if (m.toString() == json["rows"][n]["SJ"]) {
  580. window.DayCL2.data.labels[z] = (json["rows"][n]["SJ"]);
  581. window.DayCL2.data.datasets[0].data[z] = (json["rows"][n]["SBZ001"]);
  582. window.DayCL2.data.datasets[1].data[z] = (json["rows"][n]["SBZ002"]);
  583. }
  584. }
  585. }
  586. window.DayCL2.update();
  587. }
  588. });
  589. }
  590. function changeState(id, value) {
  591. console.log(id);
  592. console.log(value);
  593. if (value == '1') { document.getElementById(id).innerHTML = " 运行"; }
  594. if (value == '2') { document.getElementById(id).innerHTML = " 就绪"; }
  595. if (value == '3') { document.getElementById(id).innerHTML = " 故障"; }
  596. if (value == '0') { document.getElementById(id).innerHTML = " 待机"; }
  597. if (value == '-1') { document.getElementById(id).innerHTML = " 中断"; }
  598. }
  599. </script>
  600. <script src="/Plugins/chartjs-2.8.0/chart-2.8.min.js"></script>
  601. <script src="/Plugins/chartjs-2.8.0/chartjs-plugin-datalabels.js"></script>
  602. <script src="/Plugins/chartjs-2.8.0/utils.js"></script>
  603. <script src="/Plugins/circleChart/circleChart.min.js"></script>
  604. </body>
  605. </html>