Commit a9669159 by huangqy

11

parent 68ed092e
...@@ -201,7 +201,6 @@ export default { ...@@ -201,7 +201,6 @@ export default {
if (res.code !== 99200) return this.$message(res.message) if (res.code !== 99200) return this.$message(res.message)
this.total = res.data.totalRows - 0 this.total = res.data.totalRows - 0
this.data = res.data.records this.data = res.data.records
this.initWbSocket()
}, },
resClick () { resClick () {
this.searchData = { this.searchData = {
...@@ -283,7 +282,8 @@ export default { ...@@ -283,7 +282,8 @@ export default {
}, },
makeCard(row) { makeCard(row) {
this.selectRow = row this.selectRow = row
this.websock.send(JSON.stringify( {CmdType: 4,Content: JSON.stringify( { epc: row.studentNo, len: 4, offset: 1, password: '00000000' }) })) console.log(JSON.stringify( {CmdType: 4,Content: JSON.stringify( { epc: row.studentNo, len: 4, offset: 1, password: '00000000' }) }))
this.initWbSocket()
}, },
async saveCard() { async saveCard() {
this.selectRow.epc = this.selectRow.studentNo this.selectRow.epc = this.selectRow.studentNo
...@@ -300,6 +300,7 @@ export default { ...@@ -300,6 +300,7 @@ export default {
}, },
websocketOnopen(e) { websocketOnopen(e) {
console.log('WebSocket连接建立'); console.log('WebSocket连接建立');
this.websock.send(JSON.stringify( {CmdType: 4,Content: JSON.stringify( { epc: row.studentNo, len: 4, offset: 1, password: '00000000' }) }))
}, },
websocketOnerror: function (e) { websocketOnerror: function (e) {
console.log("WebSocket连接发生错误"); console.log("WebSocket连接发生错误");
...@@ -316,6 +317,9 @@ export default { ...@@ -316,6 +317,9 @@ export default {
} else if(![2,3,5].includes(backMessObj.CmdType)) { } else if(![2,3,5].includes(backMessObj.CmdType)) {
this.$message.error(backMessObj.Content) this.$message.error(backMessObj.Content)
} }
setTimeout(() => {
this.websock.close()
}, 1000)
}, },
websocketOnclose: function (e) { websocketOnclose: function (e) {
console.log("connection closed (" + e + ")"); console.log("connection closed (" + e + ")");
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论