Browse Source

加?.,??

master
z_yu 3 years ago
parent
commit
8093e5d729
  1. 2
      babel.config.js
  2. 2
      package.json
  3. 5
      src/views/components/SecurityDoor.vue
  4. 67
      src/views/components/WarehouseWarning.vue
  5. 1
      src/views/storeManage/warehouse3D/index.vue

2
babel.config.js

@ -1,4 +1,4 @@
const plugins = ['@vue/babel-plugin-transform-vue-jsx']
const plugins = ['@vue/babel-plugin-transform-vue-jsx', '@babel/plugin-proposal-optional-chaining', '@babel/plugin-proposal-nullish-coalescing-operator']
// 生产环境移除console // 生产环境移除console
if (process.env.NODE_ENV === 'production') { if (process.env.NODE_ENV === 'production') {
plugins.push('transform-remove-console') plugins.push('transform-remove-console')

2
package.json

@ -26,6 +26,8 @@
] ]
}, },
"dependencies": { "dependencies": {
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6",
"@babel/plugin-proposal-optional-chaining": "^7.18.9",
"@riophae/vue-treeselect": "^0.4.0", "@riophae/vue-treeselect": "^0.4.0",
"axios": "^0.21.1", "axios": "^0.21.1",
"clipboard": "2.0.4", "clipboard": "2.0.4",

5
src/views/components/SecurityDoor.vue

@ -44,7 +44,9 @@ export default {
}, },
created() { created() {
securitydoor().then((data) => { securitydoor().then((data) => {
this.tableData.push(...data)
if (data && data.length > 0) {
this.tableData.push(...data)
}
}) })
this.openSocket() this.openSocket()
}, },
@ -82,6 +84,7 @@ export default {
// //
this.socket.onmessage = (msg) => { this.socket.onmessage = (msg) => {
console.log(msg) console.log(msg)
// this.tableData.push(JSON.parse(msg.data.slice(7, msg.data.length - 2)).Data)
this.tableData.push(JSON.parse(msg.data.slice(7, msg.data.length - 2)).Data) this.tableData.push(JSON.parse(msg.data.slice(7, msg.data.length - 2)).Data)
} }
// //

67
src/views/components/WarehouseWarning.vue

@ -35,28 +35,7 @@ export default {
}, },
data() { data() {
return { return {
tableData: [], //
// receivedData: [], //
// displayNum: 0,
// lockReconnect: false, //
// heartCheck: {
// timeout: 3000,
// timeoutobj: null,
// // serverTimeoutObj: null,
// start: () => {
// // const that = this
// clearTimeout(this.timeoutObj)
// // clearTimeout(this.serverTimeoutObj)
// this.timeoutobj = setTimeout(() => {
// // ping-pong
// this.socket.send('ping')
// // that.serverTimeoutObj = setTimeout(() => {
// // this.socket.close()
// // }, that.timeout)
// }, this.timeout)
// }
// }
socket: null
tableData: [] //
} }
}, },
watch: { watch: {
@ -66,11 +45,6 @@ export default {
} }
}, },
created() { created() {
// securitydoor().then((data) => {
// this.tableData.push(...data)
// })
// this.openSocket()
console.log(111111)
alarmApi.info({ storeroomId: this.storeroomId }).then((data) => { alarmApi.info({ storeroomId: this.storeroomId }).then((data) => {
if (data && data.length > 0) { if (data && data.length > 0) {
this.tableData.push(...data) this.tableData.push(...data)
@ -79,9 +53,6 @@ export default {
}, },
destroyed() { destroyed() {
clearInterval(this.timer) clearInterval(this.timer)
if (this.socket) {
this.socket.close()
}
}, },
methods: { methods: {
// //
@ -136,42 +107,6 @@ export default {
}, 1000 * 3 * this.displayNum) }, 1000 * 3 * this.displayNum)
} }
} }
// ,
// openSocket() {
// if (!('WebSocket' in window)) {
// console.log('WebSocket')
// } else {
// console.log('WebSocket')
// const socketUrl = process.env.VUE_APP_WS_API + '/webSocket'
// if (this.socket != null) {
// this.socket.close()
// this.socket = null
// }
// this.socket = new WebSocket(socketUrl)
// //
// this.socket.onopen = () => {
// console.log('websocket')
// //
// // this.heartCheck.start()
// }
// //
// this.socket.onmessage = (msg) => {
// console.log(msg)
// this.tableData.splice(0, this.tableData.length, ...JSON.parse(msg.data.slice(7, msg.data.length - 2)).Data)
// //
// // this.heartCheck.start()
// }
// //
// this.socket.onclose = function() {
// console.log('websocket')
// }
// //
// this.socket.onerror = function(e) {
// console.log('websocket')
// console.log(e)
// }
// }
// }
} }
} }
</script> </script>

1
src/views/storeManage/warehouse3D/index.vue

@ -28,6 +28,7 @@
<script> <script>
import fullView from './fullView/index.vue' import fullView from './fullView/index.vue'
// import JSMpeg from '@/views/components/jsmpeg'
import archivesStorage from './archivesStorage/index.vue' import archivesStorage from './archivesStorage/index.vue'
import collateRoom from './collateRoom/index.vue' import collateRoom from './collateRoom/index.vue'
import readRoom from './readRoom/index.vue' import readRoom from './readRoom/index.vue'

Loading…
Cancel
Save