1 line
5.5 KiB
JSON
1 line
5.5 KiB
JSON
{"remainingRequest":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\babel-loader\\lib\\index.js!D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\src\\views\\acs\\monitor\\device\\XJDeviceMonitor.vue?vue&type=script&lang=js","dependencies":[{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\src\\views\\acs\\monitor\\device\\XJDeviceMonitor.vue","mtime":1732871026613},{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\babel.config.js","mtime":1732871025888},{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\cache-loader\\dist\\cjs.js","mtime":1732872824662},{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\babel-loader\\lib\\index.js","mtime":1732872825017},{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\cache-loader\\dist\\cjs.js","mtime":1732872824662},{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\vue-loader\\lib\\index.js","mtime":1732872825835}],"contextDependencies":[],"result":["\"use strict\";\n\nvar _interopRequireDefault = require(\"D:/data/hanguodoushan/acs2/nladmin-ui/node_modules/@babel/runtime/helpers/interopRequireDefault.js\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _createForOfIteratorHelper2 = _interopRequireDefault(require(\"D:/data/hanguodoushan/acs2/nladmin-ui/node_modules/@babel/runtime/helpers/createForOfIteratorHelper.js\"));\nrequire(\"core-js/modules/es6.regexp.replace\");\nvar _crud = require(\"@crud/crud\");\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\nvar _default = exports.default = {\n name: 'XJDeviceMonitor',\n components: {},\n mixins: [(0, _crud.crud)()],\n props: {\n dialogShow: {\n type: Boolean,\n default: false\n },\n openParam: {\n type: Object\n }\n },\n dicts: [],\n data: function data() {\n return {\n dialogVisible: false,\n form: {\n heartbeat: '',\n mode: '',\n error: '',\n error_num: '',\n ready_time: '',\n running_time: '',\n error_time: '',\n temperature: '',\n material: '',\n lack_material: '',\n feeding_qty: '',\n blanking_qty: '',\n qualified_qty: '',\n unqualified_qty: '',\n finish: '',\n task: '',\n pause: ''\n },\n device_code: '',\n device_name: '',\n rules: {}\n };\n },\n watch: {\n dialogShow: {\n handler: function handler(newValue) {\n this.dialogVisible = newValue;\n }\n }\n },\n methods: {\n open: function open() {\n this.webSocket();\n },\n close: function close() {\n this.$emit('AddChanged');\n },\n setForm: function setForm(data) {\n this.dialogVisible = true;\n this.form = data.data;\n this.device_code = data.device_code;\n this.device_name = data.device_name;\n // this.form = row\n },\n webSocket: function webSocket() {\n var that = this;\n if (typeof WebSocket === 'undefined') {\n this.$notify({\n title: '提示',\n message: '当前浏览器无法接收实时报警信息,请使用谷歌浏览器!',\n type: 'warning',\n duration: 0\n });\n } else {\n var id = 'xj_device_monitor';\n // 获取token保存到vuex中的用户信息,此处仅适用于本项目,注意删除或修改\n // 实例化socket,这里我把用户名传给了后台,使后台能判断要把消息发给哪个用户,其实也可以后台直接获取用户IP来判断并推送\n\n // const wsUri = process.env.VUE_APP_WS_API + '/webSocket/' + id\n var wsUri = window.g.prod.VUE_APP_BASE_API.replace('http', 'ws') + '/webSocket/' + id;\n this.socket = new WebSocket(wsUri);\n // 监听socket打开\n this.socket.onopen = function () {\n console.log('浏览器WebSocket已打开');\n // that.socket.send('测试客户端发送消息')\n };\n\n // 监听socket消息接收\n this.socket.onmessage = function (msg) {\n var list = JSON.parse(msg.data).msg.detail;\n // console.log(list)\n var _iterator = (0, _createForOfIteratorHelper2.default)(list),\n _step;\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var item = _step.value;\n var obj = JSON.parse(JSON.stringify(item));\n if (obj.device_code === that.device_code) {\n that.form = obj.data;\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n };\n\n // 监听socket错误\n this.socket.onerror = function () {\n that.$notify({\n title: '错误',\n message: '服务器错误,无法接收实时报警信息',\n type: 'error',\n duration: 0\n });\n };\n // 监听socket关闭\n this.socket.onclose = function () {\n console.log('WebSocket已关闭');\n };\n }\n }\n }\n};",null]} |