diff --git a/ruoyi-admin/src/main/java/com/ruoyi/dynamicMonitoring/controller/DynamicMonitoringController.java b/ruoyi-admin/src/main/java/com/ruoyi/dynamicMonitoring/controller/DynamicMonitoringController.java new file mode 100644 index 00000000..89e7f407 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/dynamicMonitoring/controller/DynamicMonitoringController.java @@ -0,0 +1,53 @@ +package com.ruoyi.dynamicMonitoring.controller; + +import java.util.List; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.dynamicMonitoring.service.IDynamicMonitoringService; + +/** + * 大屏堆垛机数据Controller + * + * @author ruoyi + */ +@RestController +@RequestMapping("/dynamicMonitoring/list") +public class DynamicMonitoringController { + @Autowired + private IDynamicMonitoringService largeScreenDdjService; + + /** + * 查询堆垛机数据列表 + */ + @GetMapping("/ddjList") + public AjaxResult ddjList() { + List> list = largeScreenDdjService.queryDdjList(); + return AjaxResult.success(list); + } + + /** + * 查询输送机数据列表 + */ + @GetMapping("/ssjList") + public AjaxResult ssjList() { + List> list = largeScreenDdjService.querySsjList(); + return AjaxResult.success(list); + } + + /** + * 查询异常设备列表 + */ + @GetMapping("/alarmList") + public AjaxResult alarmList() { + Map alarmData = largeScreenDdjService.queryAlarmList(); + AjaxResult result = new AjaxResult(200, "操作成功"); + result.put("alarm", alarmData.get("alarm")); + return result; + } +} \ No newline at end of file diff --git a/ruoyi-admin/src/main/java/com/ruoyi/dynamicMonitoring/service/IDynamicMonitoringService.java b/ruoyi-admin/src/main/java/com/ruoyi/dynamicMonitoring/service/IDynamicMonitoringService.java new file mode 100644 index 00000000..4e087387 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/dynamicMonitoring/service/IDynamicMonitoringService.java @@ -0,0 +1,32 @@ +package com.ruoyi.dynamicMonitoring.service; + +import java.util.List; +import java.util.Map; + +/** + * 大屏堆垛机数据Service接口 + * + * @author ruoyi + */ +public interface IDynamicMonitoringService { + /** + * 查询堆垛机数据列表 + * + * @return 堆垛机数据列表 + */ + public List> queryDdjList(); + + /** + * 查询输送机数据列表 + * + * @return 输送机数据列表 + */ + public List> querySsjList(); + + /** + * 查询异常设备列表 + * + * @return 异常设备列表 + */ + public Map queryAlarmList(); +} \ No newline at end of file diff --git a/ruoyi-admin/src/main/java/com/ruoyi/dynamicMonitoring/service/impl/DynamicMonitoringServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/dynamicMonitoring/service/impl/DynamicMonitoringServiceImpl.java new file mode 100644 index 00000000..959632e4 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/dynamicMonitoring/service/impl/DynamicMonitoringServiceImpl.java @@ -0,0 +1,121 @@ +package com.ruoyi.dynamicMonitoring.service.impl; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.device.ddj.domain.MsgDdj; +import com.ruoyi.device.ddj.mapper.MsgDdjMapper; +import com.ruoyi.device.ssj.domain.DeviceSsj; +import com.ruoyi.device.ssj.mapper.DeviceSsjMapper; +import com.ruoyi.dynamicMonitoring.service.IDynamicMonitoringService; + +/** + * 大屏堆垛机数据Service业务层处理 + * + * @author ruoyi + */ +@Service +public class DynamicMonitoringServiceImpl implements IDynamicMonitoringService { + @Autowired + private MsgDdjMapper msgDdjMapper; + + @Autowired + private DeviceSsjMapper deviceSsjMapper; + + /** + * 查询堆垛机数据列表 + * + * @return 堆垛机数据列表 + */ + @Override + public List> queryDdjList() { + List ddjList = msgDdjMapper.selectMsgDdjList(null); + List> resultList = new ArrayList<>(); + + for (MsgDdj ddj : ddjList) { + Map map = new HashMap<>(); + map.put("id", ddj.getId().toString()); + map.put("name", ddj.getName()); + map.put("zxjd", ddj.getJdbz().toString()); + map.put("sbzt", ddj.getSbzt().toString()); + map.put("rwh", ddj.getRwh().toString()); + map.put("yp", ddj.getYph().toString()); + map.put("ywz", ddj.getYlh().toString()); + map.put("yc", ddj.getYch().toString()); + map.put("mbp", ddj.getMbph().toString()); + map.put("mbwz", ddj.getMblh().toString()); + map.put("mbc", ddj.getMbch().toString()); + resultList.add(map); + } + + return resultList; + } + + /** + * 查询输送机数据列表 + * + * @return 输送机数据列表 + */ + @Override + public List> querySsjList() { + List ssjList = deviceSsjMapper.selectDeviceSsjList(null); + List> resultList = new ArrayList<>(); + + for (DeviceSsj ssj : ssjList) { + Map map = new HashMap<>(); + map.put("id", ssj.getDeviceCode()); + map.put("name", ssj.getName()); + map.put("kx", String.valueOf(ssj.getKx())); + map.put("dw", String.valueOf(ssj.getDw())); + map.put("rwh", String.valueOf(ssj.getTaskNo())); + map.put("sbzt", ssj.getException()); + map.put("trayCode", ssj.getTrayCode()); + resultList.add(map); + } + + return resultList; + } + + /** + * 查询异常设备列表 + * + * @return 异常设备列表 + */ + @Override + public Map queryAlarmList() { + List> alarmList = new ArrayList<>(); + + // 查询堆垛机状态异常的设备(状态码>1000) + List ddjList = msgDdjMapper.selectMsgDdjList(null); + for (MsgDdj ddj : ddjList) { + if (ddj.getSbzt() != null && ddj.getSbzt() > 1000) { + Map map = new HashMap<>(); + map.put("id", ddj.getId().toString()); + map.put("name", "堆垛机"); + map.put("code", ddj.getSbzt().toString()); + map.put("content", null); + alarmList.add(map); + } + } + + // 查询输送机状态异常的设备(状态码>3) + List ssjList = deviceSsjMapper.selectDeviceSsjList(null); + for (DeviceSsj ssj : ssjList) { + if (ssj.getException() > 3) { + Map map = new HashMap<>(); + map.put("id", ssj.getDeviceCode()); + map.put("name", "输送机"); + map.put("code", String.valueOf(ssj.getException())); + map.put("content", null); + alarmList.add(map); + } + } + + Map result = new HashMap<>(); + result.put("alarm", alarmList); + return result; + } +} \ No newline at end of file diff --git a/ruoyi-admin/src/main/java/com/ruoyi/largeScreen/controller/LargeScreenDdjController.java b/ruoyi-admin/src/main/java/com/ruoyi/largeScreen/controller/LargeScreenDdjController.java deleted file mode 100644 index 4e90d354..00000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/largeScreen/controller/LargeScreenDdjController.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.ruoyi.largeScreen.controller; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import com.ruoyi.common.annotation.Anonymous; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.largeScreen.service.ILargeScreenDdjService; - -/** - * 大屏堆垛机数据Controller - * - * @author ruoyi - */ -@RestController -@RequestMapping("/largeScreen/ddj") -public class LargeScreenDdjController { - @Autowired - private ILargeScreenDdjService largeScreenDdjService; - - /** - * 查询堆垛机数据列表 - */ - @GetMapping("/list") - public AjaxResult list() { - Map result = new HashMap<>(); - result.put("msg", "操作成功"); - result.put("code", 0); - result.put("data", largeScreenDdjService.queryDdjList()); - return AjaxResult.success(result); - } -} \ No newline at end of file diff --git a/ruoyi-admin/src/main/java/com/ruoyi/largeScreen/service/ILargeScreenDdjService.java b/ruoyi-admin/src/main/java/com/ruoyi/largeScreen/service/ILargeScreenDdjService.java deleted file mode 100644 index c5091ea3..00000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/largeScreen/service/ILargeScreenDdjService.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.ruoyi.largeScreen.service; - -import java.util.List; -import java.util.Map; - -/** - * 大屏堆垛机数据Service接口 - * - * @author ruoyi - */ -public interface ILargeScreenDdjService { - /** - * 查询堆垛机数据列表 - * - * @return 堆垛机数据列表 - */ - public List> queryDdjList(); -} \ No newline at end of file diff --git a/ruoyi-admin/src/main/java/com/ruoyi/largeScreen/service/impl/LargeScreenDdjServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/largeScreen/service/impl/LargeScreenDdjServiceImpl.java deleted file mode 100644 index 1914ab6e..00000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/largeScreen/service/impl/LargeScreenDdjServiceImpl.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.ruoyi.largeScreen.service.impl; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import com.ruoyi.device.ddj.domain.MsgDdj; -import com.ruoyi.device.ddj.mapper.MsgDdjMapper; -import com.ruoyi.largeScreen.service.ILargeScreenDdjService; - -/** - * 大屏堆垛机数据Service业务层处理 - * - * @author ruoyi - */ -@Service -public class LargeScreenDdjServiceImpl implements ILargeScreenDdjService { - @Autowired - private MsgDdjMapper msgDdjMapper; - - /** - * 查询堆垛机数据列表 - * - * @return 堆垛机数据列表 - */ - @Override - public List> queryDdjList() { - List ddjList = msgDdjMapper.selectMsgDdjList(null); - List> resultList = new ArrayList<>(); - - for (MsgDdj ddj : ddjList) { - Map map = new HashMap<>(); - map.put("id", ddj.getId().toString()); - map.put("name", ddj.getName()); - map.put("zxjd", ddj.getJdbz().toString()); - map.put("sbzt", ddj.getSbzt().toString()); - map.put("rwh", ddj.getRwh().toString()); - map.put("yp", ddj.getYph().toString()); - map.put("ywz", ddj.getYlh().toString()); - map.put("yc", ddj.getYch().toString()); - map.put("mbp", ddj.getMbph().toString()); - map.put("mbwz", ddj.getMblh().toString()); - map.put("mbc", ddj.getMbch().toString()); - resultList.add(map); - } - - return resultList; - } -} \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/mapper/bas/BasFluentFrameMapper.xml b/ruoyi-admin/src/main/resources/mapper/bas/IDynamicMonitoringService.xml similarity index 100% rename from ruoyi-admin/src/main/resources/mapper/bas/BasFluentFrameMapper.xml rename to ruoyi-admin/src/main/resources/mapper/bas/IDynamicMonitoringService.xml diff --git a/ruoyi-admin/src/main/resources/mapper/device/DeviceSsjMapper.xml b/ruoyi-admin/src/main/resources/mapper/device/DeviceSsjMapper.xml index 5b793232..385d8ea9 100644 --- a/ruoyi-admin/src/main/resources/mapper/device/DeviceSsjMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/device/DeviceSsjMapper.xml @@ -19,10 +19,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + - select id, device_code , name , type, ip_address, plc_db_read_address, is_active, create_time, plc_db_write_address, rkqq, kx, dw, tray_code, task_no from device_ssj + select id, device_code , name , type, ip_address, plc_db_read_address, is_active, create_time, plc_db_write_address, rkqq, kx, dw, tray_code, task_no,exception,tray_size,allow_put from device_ssj diff --git a/ruoyi-admin/src/main/resources/mapper/job/MydoJobMapper.xml b/ruoyi-admin/src/main/resources/mapper/job/IDynamicMonitoringService.xml similarity index 100% rename from ruoyi-admin/src/main/resources/mapper/job/MydoJobMapper.xml rename to ruoyi-admin/src/main/resources/mapper/job/IDynamicMonitoringService.xml diff --git a/ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml b/ruoyi-generator/src/main/resources/mapper/generator/IDynamicMonitoringService.xml similarity index 100% rename from ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml rename to ruoyi-generator/src/main/resources/mapper/generator/IDynamicMonitoringService.xml diff --git a/ruoyi-ui/public/monitor/css/style.css b/ruoyi-ui/public/monitor/css/style.css index 4f6a70d6..9a208cfc 100644 --- a/ruoyi-ui/public/monitor/css/style.css +++ b/ruoyi-ui/public/monitor/css/style.css @@ -12,9 +12,9 @@ body { margin-top: 0; margin-left: 0; z-index: -99; /* 确保在最底层 */ - height: 500px; - width: 500px; - transform: scale(0.9); + height: 870px; + width: 1700px; + transform: scale(1); transform-origin: center center; cursor: default; } diff --git a/ruoyi-ui/public/monitor/index.html b/ruoyi-ui/public/monitor/index.html index d8465496..048e407c 100644 --- a/ruoyi-ui/public/monitor/index.html +++ b/ruoyi-ui/public/monitor/index.html @@ -12,7 +12,7 @@

2D可视化监控系统

-
+
🚨 0条报警 @@ -35,7 +35,7 @@
×
- + diff --git a/ruoyi-ui/public/monitor/js/axios.min.js b/ruoyi-ui/public/monitor/js/axios.min.js new file mode 100644 index 00000000..b58abf2e --- /dev/null +++ b/ruoyi-ui/public/monitor/js/axios.min.js @@ -0,0 +1,2 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).axios=t()}(this,(function(){"use strict";function e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function t(t){for(var r=1;r=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(s&&u){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),S(r),l}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:A(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},e}function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r2&&void 0!==arguments[2]?arguments[2]:{},a=i.allOwnKeys,s=void 0!==a&&a;if(null!=e)if("object"!==n(e)&&(e=[e]),S(e))for(r=0,o=e.length;r0;)if(t===(r=n[o]).toLowerCase())return r;return null}var B="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,I=function(e){return!R(e)&&e!==B};var q,z=(q="undefined"!=typeof Uint8Array&&b(Uint8Array),function(e){return q&&e instanceof q}),M=E("HTMLFormElement"),H=function(e){var t=Object.prototype.hasOwnProperty;return function(e,r){return t.call(e,r)}}(),J=E("RegExp"),G=function(e,t){var r=Object.getOwnPropertyDescriptors(e),n={};U(r,(function(r,o){var i;!1!==(i=t(r,o,e))&&(n[o]=i||r)})),Object.defineProperties(e,n)},W="abcdefghijklmnopqrstuvwxyz",K="0123456789",V={DIGIT:K,ALPHA:W,ALPHA_DIGIT:W+W.toUpperCase()+K};var X=E("AsyncFunction"),$={isArray:S,isArrayBuffer:A,isBuffer:function(e){return null!==e&&!R(e)&&null!==e.constructor&&!R(e.constructor)&&x(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:function(e){var t;return e&&("function"==typeof FormData&&e instanceof FormData||x(e.append)&&("formdata"===(t=w(e))||"object"===t&&x(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&A(e.buffer)},isString:j,isNumber:T,isBoolean:function(e){return!0===e||!1===e},isObject:P,isPlainObject:N,isUndefined:R,isDate:k,isFile:_,isBlob:L,isRegExp:J,isFunction:x,isStream:function(e){return P(e)&&x(e.pipe)},isURLSearchParams:F,isTypedArray:z,isFileList:C,forEach:U,merge:function e(){for(var t=I(this)&&this||{},r=t.caseless,n={},o=function(t,o){var i=r&&D(n,o)||o;N(n[i])&&N(t)?n[i]=e(n[i],t):N(t)?n[i]=e({},t):S(t)?n[i]=t.slice():n[i]=t},i=0,a=arguments.length;i3&&void 0!==arguments[3]?arguments[3]:{},o=n.allOwnKeys;return U(t,(function(t,n){r&&x(t)?e[n]=y(t,r):e[n]=t}),{allOwnKeys:o}),e},trim:function(e){return e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e},inherits:function(e,t,r,n){e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:function(e,t,r,n){var o,i,a,s={};if(t=t||{},null==e)return t;do{for(i=(o=Object.getOwnPropertyNames(e)).length;i-- >0;)a=o[i],n&&!n(a,e,t)||s[a]||(t[a]=e[a],s[a]=!0);e=!1!==r&&b(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:w,kindOfTest:E,endsWith:function(e,t,r){e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;var n=e.indexOf(t,r);return-1!==n&&n===r},toArray:function(e){if(!e)return null;if(S(e))return e;var t=e.length;if(!T(t))return null;for(var r=new Array(t);t-- >0;)r[t]=e[t];return r},forEachEntry:function(e,t){for(var r,n=(e&&e[Symbol.iterator]).call(e);(r=n.next())&&!r.done;){var o=r.value;t.call(e,o[0],o[1])}},matchAll:function(e,t){for(var r,n=[];null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:M,hasOwnProperty:H,hasOwnProp:H,reduceDescriptors:G,freezeMethods:function(e){G(e,(function(t,r){if(x(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;var n=e[r];x(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=function(){throw Error("Can not rewrite read-only method '"+r+"'")}))}))},toObjectSet:function(e,t){var r={},n=function(e){e.forEach((function(e){r[e]=!0}))};return S(e)?n(e):n(String(e).split(t)),r},toCamelCase:function(e){return e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,r){return t.toUpperCase()+r}))},noop:function(){},toFiniteNumber:function(e,t){return e=+e,Number.isFinite(e)?e:t},findKey:D,global:B,isContextDefined:I,ALPHABET:V,generateString:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:V.ALPHA_DIGIT,r="",n=t.length;e--;)r+=t[Math.random()*n|0];return r},isSpecCompliantForm:function(e){return!!(e&&x(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:function(e){var t=new Array(10);return function e(r,n){if(P(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[n]=r;var o=S(r)?[]:{};return U(r,(function(t,r){var i=e(t,n+1);!R(i)&&(o[r]=i)})),t[n]=void 0,o}}return r}(e,0)},isAsyncFn:X,isThenable:function(e){return e&&(P(e)||x(e))&&x(e.then)&&x(e.catch)}};function Q(e,t,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o)}$.inherits(Q,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:$.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var Y=Q.prototype,Z={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((function(e){Z[e]={value:e}})),Object.defineProperties(Q,Z),Object.defineProperty(Y,"isAxiosError",{value:!0}),Q.from=function(e,t,r,n,o,i){var a=Object.create(Y);return $.toFlatObject(e,a,(function(e){return e!==Error.prototype}),(function(e){return"isAxiosError"!==e})),Q.call(a,e.message,t,r,n,o),a.cause=e,a.name=e.name,i&&Object.assign(a,i),a};function ee(e){return $.isPlainObject(e)||$.isArray(e)}function te(e){return $.endsWith(e,"[]")?e.slice(0,-2):e}function re(e,t,r){return e?e.concat(t).map((function(e,t){return e=te(e),!r&&t?"["+e+"]":e})).join(r?".":""):t}var ne=$.toFlatObject($,{},null,(function(e){return/^is[A-Z]/.test(e)}));function oe(e,t,r){if(!$.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;var o=(r=$.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!$.isUndefined(t[e])}))).metaTokens,i=r.visitor||f,a=r.dots,s=r.indexes,u=(r.Blob||"undefined"!=typeof Blob&&Blob)&&$.isSpecCompliantForm(t);if(!$.isFunction(i))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if($.isDate(e))return e.toISOString();if(!u&&$.isBlob(e))throw new Q("Blob is not supported. Use a Buffer instead.");return $.isArrayBuffer(e)||$.isTypedArray(e)?u&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function f(e,r,i){var u=e;if(e&&!i&&"object"===n(e))if($.endsWith(r,"{}"))r=o?r:r.slice(0,-2),e=JSON.stringify(e);else if($.isArray(e)&&function(e){return $.isArray(e)&&!e.some(ee)}(e)||($.isFileList(e)||$.endsWith(r,"[]"))&&(u=$.toArray(e)))return r=te(r),u.forEach((function(e,n){!$.isUndefined(e)&&null!==e&&t.append(!0===s?re([r],n,a):null===s?r:r+"[]",c(e))})),!1;return!!ee(e)||(t.append(re(i,r,a),c(e)),!1)}var l=[],h=Object.assign(ne,{defaultVisitor:f,convertValue:c,isVisitable:ee});if(!$.isObject(e))throw new TypeError("data must be an object");return function e(r,n){if(!$.isUndefined(r)){if(-1!==l.indexOf(r))throw Error("Circular reference detected in "+n.join("."));l.push(r),$.forEach(r,(function(r,o){!0===(!($.isUndefined(r)||null===r)&&i.call(t,r,$.isString(o)?o.trim():o,n,h))&&e(r,n?n.concat(o):[o])})),l.pop()}}(e),t}function ie(e){var t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function ae(e,t){this._pairs=[],e&&oe(e,this,t)}var se=ae.prototype;function ue(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function ce(e,t,r){if(!t)return e;var n,o=r&&r.encode||ue,i=r&&r.serialize;if(n=i?i(t,r):$.isURLSearchParams(t)?t.toString():new ae(t,r).toString(o)){var a=e.indexOf("#");-1!==a&&(e=e.slice(0,a)),e+=(-1===e.indexOf("?")?"?":"&")+n}return e}se.append=function(e,t){this._pairs.push([e,t])},se.toString=function(e){var t=e?function(t){return e.call(this,t,ie)}:ie;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var fe,le=function(){function e(){i(this,e),this.handlers=[]}return s(e,[{key:"use",value:function(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}},{key:"eject",value:function(e){this.handlers[e]&&(this.handlers[e]=null)}},{key:"clear",value:function(){this.handlers&&(this.handlers=[])}},{key:"forEach",value:function(e){$.forEach(this.handlers,(function(t){null!==t&&e(t)}))}}]),e}(),he={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},de={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:ae,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},pe="undefined"!=typeof window&&"undefined"!=typeof document,ve=(fe="undefined"!=typeof navigator&&navigator.product,pe&&["ReactNative","NativeScript","NS"].indexOf(fe)<0),ye="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,me=t(t({},Object.freeze({__proto__:null,hasBrowserEnv:pe,hasStandardBrowserWebWorkerEnv:ye,hasStandardBrowserEnv:ve})),de);function ge(e){function t(e,r,n,o){var i=e[o++];if("__proto__"===i)return!0;var a=Number.isFinite(+i),s=o>=e.length;return i=!i&&$.isArray(n)?n.length:i,s?($.hasOwnProp(n,i)?n[i]=[n[i],r]:n[i]=r,!a):(n[i]&&$.isObject(n[i])||(n[i]=[]),t(e,r,n[i],o)&&$.isArray(n[i])&&(n[i]=function(e){var t,r,n={},o=Object.keys(e),i=o.length;for(t=0;t-1,i=$.isObject(e);if(i&&$.isHTMLForm(e)&&(e=new FormData(e)),$.isFormData(e))return o?JSON.stringify(ge(e)):e;if($.isArrayBuffer(e)||$.isBuffer(e)||$.isStream(e)||$.isFile(e)||$.isBlob(e))return e;if($.isArrayBufferView(e))return e.buffer;if($.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return oe(e,new me.classes.URLSearchParams,Object.assign({visitor:function(e,t,r,n){return me.isNode&&$.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((r=$.isFileList(e))||n.indexOf("multipart/form-data")>-1){var a=this.env&&this.env.FormData;return oe(r?{"files[]":e}:e,a&&new a,this.formSerializer)}}return i||o?(t.setContentType("application/json",!1),function(e,t,r){if($.isString(e))try{return(t||JSON.parse)(e),$.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||be.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(e&&$.isString(e)&&(r&&!this.responseType||n)){var o=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e)}catch(e){if(o){if("SyntaxError"===e.name)throw Q.from(e,Q.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:me.classes.FormData,Blob:me.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};$.forEach(["delete","get","head","post","put","patch"],(function(e){be.headers[e]={}}));var we=be,Ee=$.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Oe=Symbol("internals");function Se(e){return e&&String(e).trim().toLowerCase()}function Re(e){return!1===e||null==e?e:$.isArray(e)?e.map(Re):String(e)}function Ae(e,t,r,n,o){return $.isFunction(n)?n.call(this,t,r):(o&&(t=r),$.isString(t)?$.isString(n)?-1!==t.indexOf(n):$.isRegExp(n)?n.test(t):void 0:void 0)}var je=function(e,t){function r(e){i(this,r),e&&this.set(e)}return s(r,[{key:"set",value:function(e,t,r){var n=this;function o(e,t,r){var o=Se(t);if(!o)throw new Error("header name must be a non-empty string");var i=$.findKey(n,o);(!i||void 0===n[i]||!0===r||void 0===r&&!1!==n[i])&&(n[i||t]=Re(e))}var i,a,s,u,c,f=function(e,t){return $.forEach(e,(function(e,r){return o(e,r,t)}))};return $.isPlainObject(e)||e instanceof this.constructor?f(e,t):$.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?f((c={},(i=e)&&i.split("\n").forEach((function(e){u=e.indexOf(":"),a=e.substring(0,u).trim().toLowerCase(),s=e.substring(u+1).trim(),!a||c[a]&&Ee[a]||("set-cookie"===a?c[a]?c[a].push(s):c[a]=[s]:c[a]=c[a]?c[a]+", "+s:s)})),c),t):null!=e&&o(t,e,r),this}},{key:"get",value:function(e,t){if(e=Se(e)){var r=$.findKey(this,e);if(r){var n=this[r];if(!t)return n;if(!0===t)return function(e){for(var t,r=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;t=n.exec(e);)r[t[1]]=t[2];return r}(n);if($.isFunction(t))return t.call(this,n,r);if($.isRegExp(t))return t.exec(n);throw new TypeError("parser must be boolean|regexp|function")}}}},{key:"has",value:function(e,t){if(e=Se(e)){var r=$.findKey(this,e);return!(!r||void 0===this[r]||t&&!Ae(0,this[r],r,t))}return!1}},{key:"delete",value:function(e,t){var r=this,n=!1;function o(e){if(e=Se(e)){var o=$.findKey(r,e);!o||t&&!Ae(0,r[o],o,t)||(delete r[o],n=!0)}}return $.isArray(e)?e.forEach(o):o(e),n}},{key:"clear",value:function(e){for(var t=Object.keys(this),r=t.length,n=!1;r--;){var o=t[r];e&&!Ae(0,this[o],o,e,!0)||(delete this[o],n=!0)}return n}},{key:"normalize",value:function(e){var t=this,r={};return $.forEach(this,(function(n,o){var i=$.findKey(r,o);if(i)return t[i]=Re(n),void delete t[o];var a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(function(e,t,r){return t.toUpperCase()+r}))}(o):String(o).trim();a!==o&&delete t[o],t[a]=Re(n),r[a]=!0})),this}},{key:"concat",value:function(){for(var e,t=arguments.length,r=new Array(t),n=0;n1?r-1:0),o=1;o1?"since :\n"+s.map(Ue).join("\n"):" "+Ue(s[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return r};function Ie(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ne(null,e)}function qe(e){return Ie(e),e.headers=xe.from(e.headers),e.data=Te.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Be(e.adapter||we.adapter)(e).then((function(t){return Ie(e),t.data=Te.call(e,e.transformResponse,t),t.headers=xe.from(t.headers),t}),(function(t){return Pe(t)||(Ie(e),t&&t.response&&(t.response.data=Te.call(e,e.transformResponse,t.response),t.response.headers=xe.from(t.response.headers))),Promise.reject(t)}))}var ze=function(e){return e instanceof xe?e.toJSON():e};function Me(e,t){t=t||{};var r={};function n(e,t,r){return $.isPlainObject(e)&&$.isPlainObject(t)?$.merge.call({caseless:r},e,t):$.isPlainObject(t)?$.merge({},t):$.isArray(t)?t.slice():t}function o(e,t,r){return $.isUndefined(t)?$.isUndefined(e)?void 0:n(void 0,e,r):n(e,t,r)}function i(e,t){if(!$.isUndefined(t))return n(void 0,t)}function a(e,t){return $.isUndefined(t)?$.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function s(r,o,i){return i in t?n(r,o):i in e?n(void 0,r):void 0}var u={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:function(e,t){return o(ze(e),ze(t),!0)}};return $.forEach(Object.keys(Object.assign({},e,t)),(function(n){var i=u[n]||o,a=i(e[n],t[n],n);$.isUndefined(a)&&i!==s||(r[n]=a)})),r}var He="1.6.7",Je={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){Je[e]=function(r){return n(r)===e||"a"+(t<1?"n ":" ")+e}}));var Ge={};Je.transitional=function(e,t,r){function n(e,t){return"[Axios v1.6.7] Transitional option '"+e+"'"+t+(r?". "+r:"")}return function(r,o,i){if(!1===e)throw new Q(n(o," has been removed"+(t?" in "+t:"")),Q.ERR_DEPRECATED);return t&&!Ge[o]&&(Ge[o]=!0,console.warn(n(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,o,i)}};var We={assertOptions:function(e,t,r){if("object"!==n(e))throw new Q("options must be an object",Q.ERR_BAD_OPTION_VALUE);for(var o=Object.keys(e),i=o.length;i-- >0;){var a=o[i],s=t[a];if(s){var u=e[a],c=void 0===u||s(u,a,e);if(!0!==c)throw new Q("option "+a+" must be "+c,Q.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new Q("Unknown option "+a,Q.ERR_BAD_OPTION)}},validators:Je},Ke=We.validators,Ve=function(){function e(t){i(this,e),this.defaults=t,this.interceptors={request:new le,response:new le}}var t,n;return s(e,[{key:"request",value:(t=r().mark((function e(t,n){var o,i;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._request(t,n);case 3:return e.abrupt("return",e.sent);case 6:throw e.prev=6,e.t0=e.catch(0),e.t0 instanceof Error&&(Error.captureStackTrace?Error.captureStackTrace(o={}):o=new Error,i=o.stack?o.stack.replace(/^.+\n/,""):"",e.t0.stack?i&&!String(e.t0.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(e.t0.stack+="\n"+i):e.t0.stack=i),e.t0;case 10:case"end":return e.stop()}}),e,this,[[0,6]])})),n=function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function s(e){o(a,n,i,s,u,"next",e)}function u(e){o(a,n,i,s,u,"throw",e)}s(void 0)}))},function(e,t){return n.apply(this,arguments)})},{key:"_request",value:function(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{};var r=t=Me(this.defaults,t),n=r.transitional,o=r.paramsSerializer,i=r.headers;void 0!==n&&We.assertOptions(n,{silentJSONParsing:Ke.transitional(Ke.boolean),forcedJSONParsing:Ke.transitional(Ke.boolean),clarifyTimeoutError:Ke.transitional(Ke.boolean)},!1),null!=o&&($.isFunction(o)?t.paramsSerializer={serialize:o}:We.assertOptions(o,{encode:Ke.function,serialize:Ke.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();var a=i&&$.merge(i.common,i[t.method]);i&&$.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete i[e]})),t.headers=xe.concat(a,i);var s=[],u=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(u=u&&e.synchronous,s.unshift(e.fulfilled,e.rejected))}));var c,f=[];this.interceptors.response.forEach((function(e){f.push(e.fulfilled,e.rejected)}));var l,h=0;if(!u){var d=[qe.bind(this),void 0];for(d.unshift.apply(d,s),d.push.apply(d,f),l=d.length,c=Promise.resolve(t);h0;)n._listeners[t](e);n._listeners=null}})),this.promise.then=function(e){var t,r=new Promise((function(e){n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},t((function(e,t,o){n.reason||(n.reason=new Ne(e,t,o),r(n.reason))}))}return s(e,[{key:"throwIfRequested",value:function(){if(this.reason)throw this.reason}},{key:"subscribe",value:function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}},{key:"unsubscribe",value:function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}}}],[{key:"source",value:function(){var t;return{token:new e((function(e){t=e})),cancel:t}}}]),e}();var Qe={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Qe).forEach((function(e){var t=c(e,2),r=t[0],n=t[1];Qe[n]=r}));var Ye=Qe;var Ze=function e(t){var r=new Xe(t),n=y(Xe.prototype.request,r);return $.extend(n,Xe.prototype,r,{allOwnKeys:!0}),$.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return e(Me(t,r))},n}(we);return Ze.Axios=Xe,Ze.CanceledError=Ne,Ze.CancelToken=$e,Ze.isCancel=Pe,Ze.VERSION=He,Ze.toFormData=oe,Ze.AxiosError=Q,Ze.Cancel=Ze.CanceledError,Ze.all=function(e){return Promise.all(e)},Ze.spread=function(e){return function(t){return e.apply(null,t)}},Ze.isAxiosError=function(e){return $.isObject(e)&&!0===e.isAxiosError},Ze.mergeConfig=Me,Ze.AxiosHeaders=xe,Ze.formToJSON=function(e){return ge($.isHTMLForm(e)?new FormData(e):e)},Ze.getAdapter=Be,Ze.HttpStatusCode=Ye,Ze.default=Ze,Ze})); +//# sourceMappingURL=axios.min.js.map diff --git a/ruoyi-ui/public/monitor/js/index.js b/ruoyi-ui/public/monitor/js/index.js index a8cb1ab9..82da3e78 100644 --- a/ruoyi-ui/public/monitor/js/index.js +++ b/ruoyi-ui/public/monitor/js/index.js @@ -2,22 +2,39 @@ // 查询堆垛机数据列表 function listDdj() { request({ - url: '/largeScreen/ddj/list', + url: '/dev-api/dynamicMonitoring/list/ddjList', method: 'get' }).then(response => { - console.log('接口返回数据:', response); handleStackerDataSuccess(response) }).catch(error => { console.error('堆垛机数据获取失败:', error); }); } -// $.ajax({ -// url: API_URLS.stacker, -// type: 'GET', -// dataType: 'json', -// success: handleStackerDataSuccess, -// error: (xhr, status, error) => console.error('堆垛机数据获取失败:', error) -// }); + + +// 查询输送机数据列表 +function listSsj() { + request({ + url: '/dev-api/dynamicMonitoring/list/ssjList', + method: 'get' + }).then(response => { + handleConveyorDataSuccess(response) + }).catch(error => { + console.error('输送机数据获取失败:', error) + }); +} +// 查询报警信息数据列表 +function listAlarm() { + request({ + url: '/dev-api/dynamicMonitoring/list/alarmList', + method: 'get' + }).then(response => { + console.log("报警信息:",response) + handleAlarmDataSuccess(response) + }).catch(error => { + handleAlarmDataError(response) + }); +} /** * 2D可视化监控系统 - 数据同步和状态管理 * 负责配置同步、设备状态更新、实时数据获取等功能 @@ -218,7 +235,7 @@ function startTimers() { setInterval(updateRgvStatus, 5000); // 配置同步定时器 - setInterval(getConfig, 1000); + // setInterval(getConfig, 1000); // 启动智能报警更新定时器 startSmartAlarmTimer(); @@ -262,13 +279,7 @@ function updateConveyorStatus() { return; } - $.ajax({ - url: API_URLS.conveyor, - type: 'GET', - dataType: 'json', - success: handleConveyorDataSuccess, - error: (xhr, status, error) => console.error('输送机数据获取失败:', error) - }); + listSsj() } /** @@ -276,7 +287,7 @@ function updateConveyorStatus() { * @param {Object} response 服务器响应数据 */ function handleConveyorDataSuccess(response) { - if (!isValidResponse(response) || configEditMode !== 2) { + if (configEditMode !== 2) { return; } @@ -298,14 +309,16 @@ function handleConveyorDataSuccess(response) { * @param {Object} data 设备数据 */ function updateConveyorDisplay(conveyor, data) { + // 更新中心方块显示状态 const centerBlock = conveyor.querySelector('.conveyor-center, .roller-conveyor-center'); if (centerBlock) { + centerBlock.style.display = data.dw === '1' ? 'block' : 'none'; } // 更新设备状态指示(故障闪烁) - const hasError = parseInt(data.sbzt) > 100; + const hasError = parseInt(data.sbzt) > 3; conveyor.classList.toggle('breathing-border', hasError); } @@ -349,9 +362,9 @@ function updateConveyorDisplay(conveyor, data) { * @param {Object} response 服务器响应数据 */ function handleStackerDataSuccess(response) { - if (!isValidResponse(response) || configEditMode !== 2) { - console.log(11111,response) - return; + + if (response.data.length==0 || configEditMode != 2) { + return; } const stackers = document.querySelectorAll('.stacker'); @@ -712,41 +725,35 @@ function getDeviceRealTimeData(deviceType, deviceId) { if (deviceType === 'stacker') { // 获取堆垛机实时数据 - 使用配置的URL - $.ajax({ - url: API_URLS.stacker, - type: 'GET', - dataType: 'json', - success: function(response) { - if (response && response.data) { - const deviceData = response.data.find(item => item.id === deviceId); - resolve(deviceData || null); - } else { - resolve(null); - } - }, - error: function(xhr, status, error) { - console.error('获取堆垛机数据失败:', error); - reject('获取堆垛机数据失败'); - } - }); + request({ + url: '/dev-api/dynamicMonitoring/list/ddjList', + method: 'get' + }).then(response => { + if (response && response.data) { + const deviceData = response.data.find(item => item.id === deviceId); + resolve(deviceData || null); + } else { + resolve(null); + } + }).catch(error => { + console.error('获取堆垛机数据失败:', error); + reject('获取堆垛机数据失败'); + }); } else if (deviceType === 'conveyor' || deviceType === 'rollerConveyor') { // 获取输送机实时数据 - 使用配置的URL - $.ajax({ - url: API_URLS.conveyor, - type: 'GET', - dataType: 'json', - success: function(response) { - if (response && response.data) { - const deviceData = response.data.find(item => item.id === deviceId); - resolve(deviceData || null); - } else { - resolve(null); - } - }, - error: function(xhr, status, error) { - console.error('获取输送机数据失败:', error); - reject('获取输送机数据失败'); - } + request({ + url: '/dev-api/dynamicMonitoring/list/ssjList', + method: 'get' + }).then(response => { + if (response && response.data) { + const deviceData = response.data.find(item => item.id === deviceId); + resolve(deviceData || null); + } else { + resolve(null); + } + }).catch(error => { + console.error('获取输送机数据失败:', error); + reject('获取输送机数据失败'); }); } else if (deviceType === 'rgv') { // 获取RGV实时数据 - 使用配置的URL @@ -774,6 +781,108 @@ function getDeviceRealTimeData(deviceType, deviceId) { }); } + + +function ssjSbzt(a){ + if (a==0){ + return"未知" + }else if(a==1){ + return "手动" + }else if(a==2){ + return "自动" + }else if (a==3){ + return "运行" + }else if (a==4){ + return "输送超时" + }else if(a==5){ + return "断路器跳闸" + }else if (a==6){ + return "变频器报警" + }else if (a==7){ + return "开关任务异常" + }else if (a==8){ + return "急停" + }else if (a==9){ + return "超界" + }else if(a==10){ + return "外型异常" + }else if(a==11){ + return "称重异常" + }else if(a==12){ + return "扫码异常" + }else { + return a; + } +} +function ddjSbzt(a){ + if (a<1000){ + return "正常" + }else if(a==1031){ +return "急停按下" + }else if (a==1032){ + return "货叉不在中位" + }else if (a==1033){ + return "运行变频器报警" + }else if (a==1034){ + return "升降变频器报警" + }else if (a==1035){ + return "货叉变频器报警" + }else if (a==1037){ + return "运行限位故障" + }else if(a==1038){ + return "升降限位故障" + }else if (a==1039){ + return "运行不能纠偏" + }else if (a==1040){ + return "升降不能纠偏" + }else if (a==1041){ + return "水平测距出错" + }else if (a==1042){ + return "垂直BPS出错" + }else if (a==1043){ + return "超速保护" + }else if (a==1044){ + return "前边超宽" + }else if (a==1045){ + return "后边超宽" + }else if (a==1046){ + return "左边歪斜" + }else if (a==1047){ + return "右边歪斜" + }else if (a==1048){ + return "超高1" + }else if (a==1049){ + return "超高2" + }else if (a==1050){ + return "放货完毕货叉有货" + }else if (a==1051){ + return "取货时货叉有货" + }else if (a==1052){ + return "放货目标有货" + }else if (a==1053){ + return "取货完毕无货" + }else if (a==1054){ + return "放货时货叉无货" + }else if (a==1055){ + return "货叉动作超时" + }else if (a==1056){ + return "货叉不能纠偏" + }else if (a==1057){ + return "微升降超时" + }else if (a==1058){ + return "松绳过载" + }else if (a==1059){ + return "设定超限" + }else if (a==1062){ + return "入库输送机任务号不符" + }else if (a==1063){ + return "安全门打开" + }else if (a==1064){ + return "与安全门通讯中断" + }else { + return a + } +} /** * 构建设备信息HTML * @param {string} deviceType 设备类型 @@ -859,7 +968,7 @@ function buildDeviceInfoHTML(deviceType, deviceId, deviceConfig, realTimeData) { // 堆垛机字段:基于ddj.json const statusValue = parseInt(realTimeData.sbzt); const statusColor = statusValue > 1000 ? '#ff4444' : '#00aa00'; - const statusText = statusValue > 1000 ? '报警' : '正常'; + const statusText = ddjSbzt(statusValue); const statusBgColor = statusValue > 1000 ? 'rgba(255,68,68,0.1)' : 'rgba(0,170,0,0.1)'; // 执行阶段文字描述 @@ -933,9 +1042,9 @@ function buildDeviceInfoHTML(deviceType, deviceId, deviceConfig, realTimeData) { } else if (deviceType === 'conveyor' || deviceType === 'rollerConveyor') { // 输送机字段:基于Lssj.json const statusValue = parseInt(realTimeData.sbzt); - const statusColor = statusValue > 100 ? '#ff4444' : '#00aa00'; - const statusText = statusValue > 100 ? '故障' : '正常'; - const statusBgColor = statusValue > 100 ? 'rgba(255,68,68,0.1)' : 'rgba(0,170,0,0.1)'; + const statusColor = statusValue > 3 ? '#ff4444' : '#00aa00'; + const statusText = ssjSbzt(statusValue) + const statusBgColor = statusValue > 3 ? 'rgba(255,68,68,0.1)' : 'rgba(0,170,0,0.1)'; const hasCargoText = realTimeData.dw === '1' ? '有货物' : '无货物'; const kxText = realTimeData.kx === '1' ? '空闲' : '不空闲'; const cargoColor = realTimeData.dw === '1' ? '#FF9800' : '#9E9E9E'; @@ -1336,13 +1445,7 @@ function updateAlarmStatus() { return; } - $.ajax({ - url: API_URLS.alarm, - type: 'GET', - dataType: 'json', - success: handleAlarmDataSuccess, - error: handleAlarmDataError - }); + listAlarm() } /** @@ -1574,7 +1677,7 @@ function applyContainerStyle(container, style) { function buildAlarmText(alarms) { const alarmTexts = alarms.map(alarm => { const errorCode = alarm.code || alarm.type || '未知'; - return `【${alarm.id}${alarm.name}】错误代码: ${errorCode},报警信息:${alarm.content}`; + return `【${alarm.id}${alarm.name}】错误代码: ${errorCode},报警信息:${ddjSbzt(errorCode)}`; }); return alarmTexts.join(ALARM_CONFIG.TEXT.SEPARATOR); } diff --git a/ruoyi-ui/public/monitor/js/main.js b/ruoyi-ui/public/monitor/js/main.js index 98d9ca4b..242f9a2e 100644 --- a/ruoyi-ui/public/monitor/js/main.js +++ b/ruoyi-ui/public/monitor/js/main.js @@ -1308,30 +1308,30 @@ $(document).ready(function () { // **********************定期检查配置文件更新********************** - setInterval(function () { - $.ajax({ - url: 'json/config.json', - type: 'GET', - dataType: 'json', - cache: false, // 禁用缓存,确保每次都获取最新的配置 - success: function (data) { - // 如果配置有变化,更新显示(不论editMode状态) - if (JSON.stringify(data) !== JSON.stringify(config)) { - config = data; - // 确保deviceDraggable默认为false - if (typeof config.deviceDraggable === 'undefined') { - config.deviceDraggable = false; - } - // 更新全局config引用 - window.config = config; - createBoxes(); - // 更新设备拖动状态 - updateDevicesDraggableState(); - } - }, - error: function (xhr, status, error) { - console.error('检查配置更新失败:', error); - } - }); - }, 1000); // 每秒检查一次 + // setInterval(function () { + // $.ajax({ + // url: 'json/config.json', + // type: 'GET', + // dataType: 'json', + // cache: false, // 禁用缓存,确保每次都获取最新的配置 + // success: function (data) { + // // 如果配置有变化,更新显示(不论editMode状态) + // if (JSON.stringify(data) !== JSON.stringify(config)) { + // config = data; + // // 确保deviceDraggable默认为false + // if (typeof config.deviceDraggable === 'undefined') { + // config.deviceDraggable = false; + // } + // // 更新全局config引用 + // window.config = config; + // createBoxes(); + // // 更新设备拖动状态 + // updateDevicesDraggableState(); + // } + // }, + // error: function (xhr, status, error) { + // console.error('检查配置更新失败:', error); + // } + // }); + // }, 1000); // 每秒检查一次 }); diff --git a/ruoyi-ui/public/monitor/js/request.js b/ruoyi-ui/public/monitor/js/request.js index 55584a0b..aef3b567 100644 --- a/ruoyi-ui/public/monitor/js/request.js +++ b/ruoyi-ui/public/monitor/js/request.js @@ -4,7 +4,7 @@ const axios = window.axios; // 2. 基础配置(无 export 语句) axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'; const service = axios.create({ - baseURL: '/', // 匹配若依代理,无需改 + baseURL: '', // 不使用baseURL前缀,直接使用完整路径 timeout: 10000 }); diff --git a/ruoyi-ui/public/monitor/json/config.json b/ruoyi-ui/public/monitor/json/config.json index 419cd041..bda4808d 100644 --- a/ruoyi-ui/public/monitor/json/config.json +++ b/ruoyi-ui/public/monitor/json/config.json @@ -264,7 +264,7 @@ "labels": [ { "id": "bq", - "content": "一 层", + "content": "二 层", "fontSize": 24, "fontColor": "#000000", "bgColor": "#ffffff", @@ -274,7 +274,7 @@ }, { "id": "bq2", - "content": "二 层", + "content": "一 层", "fontSize": 24, "fontColor": "#000000", "bgColor": "#ffffff", diff --git a/ruoyi-ui/src/assets/styles/index.scss b/ruoyi-ui/src/assets/styles/index.scss index 5aa81bac..2be1ca7a 100644 --- a/ruoyi-ui/src/assets/styles/index.scss +++ b/ruoyi-ui/src/assets/styles/index.scss @@ -192,5 +192,5 @@ aside { .app-main { padding-top: 78px; // 根据导航栏实际高度调整 min-height: calc(100vh - 78px); // 保持高度正确 - height: 930px; + height: auto; } diff --git a/ruoyi-ui/src/views/2D/index.vue b/ruoyi-ui/src/views/2D/index.vue deleted file mode 100644 index 5e2a54a0..00000000 --- a/ruoyi-ui/src/views/2D/index.vue +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - diff --git a/ruoyi-ui/src/views/largeScreen/monitor/index.vue b/ruoyi-ui/src/views/dynamicMonitoring/index.vue similarity index 56% rename from ruoyi-ui/src/views/largeScreen/monitor/index.vue rename to ruoyi-ui/src/views/dynamicMonitoring/index.vue index 6f77a111..7a236990 100644 --- a/ruoyi-ui/src/views/largeScreen/monitor/index.vue +++ b/ruoyi-ui/src/views/dynamicMonitoring/index.vue @@ -1,23 +1,24 @@