Commit 034c2a08 by huangqy

11

parent 80c60c58
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
name="file" name="file"
:multiple="false" :multiple="false"
:showUploadList="false" :showUploadList="false"
action="http://192.168.3.123:10026/JX/student/readExcel" :action="actionUrl"
@change="handleUpload" @change="handleUpload"
> >
<a-button type="primary" icon="upload" ghost round> 导入 </a-button> <a-button type="primary" icon="upload" ghost round> 导入 </a-button>
...@@ -150,6 +150,7 @@ export default { ...@@ -150,6 +150,7 @@ export default {
data () { data () {
return { return {
height: document.documentElement.clientHeight - 176, height: document.documentElement.clientHeight - 176,
actionUrl: window._CONFIG['domianURL'] + '/student/readExcel',
data: [], data: [],
dialogVisible: false, dialogVisible: false,
title: '', title: '',
......
...@@ -163,7 +163,6 @@ export default { ...@@ -163,7 +163,6 @@ export default {
created () { created () {
this.initData() this.initData()
this.initClass() this.initClass()
this.initWbSocket()
}, },
mounted() { mounted() {
...@@ -187,6 +186,7 @@ export default { ...@@ -187,6 +186,7 @@ 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 = {
...@@ -272,7 +272,7 @@ export default { ...@@ -272,7 +272,7 @@ export default {
this.selectRow.epc = this.selectRow.studentNo this.selectRow.epc = this.selectRow.studentNo
const { data: res } = await this.$axios.post('/jxStudentCard/makeCard', this.selectRow) const { data: res } = await this.$axios.post('/jxStudentCard/makeCard', this.selectRow)
if (!res.data) return this.$message.error(res.message) if (!res.data) return this.$message.error(res.message)
this.$message.success('写入成功') this.$message.success(res.message)
}, },
initWbSocket() { initWbSocket() {
this.websock = new WebSocket('ws://127.0.0.1:8081'); this.websock = new WebSocket('ws://127.0.0.1:8081');
...@@ -285,15 +285,18 @@ export default { ...@@ -285,15 +285,18 @@ export default {
console.log('WebSocket连接建立'); console.log('WebSocket连接建立');
}, },
websocketOnerror: function (e) { websocketOnerror: function (e) {
this.$message.warning('写入服务连接发生错误')
console.log("WebSocket连接发生错误"); console.log("WebSocket连接发生错误");
}, },
websocketOnmessage: function (e) { websocketOnmessage: function (e) {
var backMessObj = JSON.parse(e.data); var backMessObj = JSON.parse(e.data);
console.log(backMessObj) console.log(backMessObj)
if(backMessObj.CmdType == 4) { if(backMessObj.CmdType == 4) {
this.saveCard() if (backMessObj.Content !== '操作失败,设备未连接') {
} else if(![0,1,2,5].includes(backMessObj.CmdType)) { this.saveCard()
} else {
this.$message.error(backMessObj.Content)
}
} else if(![2,3,5].includes(backMessObj.CmdType)) {
this.$message.error(backMessObj.Content) this.$message.error(backMessObj.Content)
} }
}, },
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论