|
@@ -1,22 +1,22 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <el-dialog
|
|
|
- title="查看消息"
|
|
|
- width="70%"
|
|
|
- :close-on-click-modal="false"
|
|
|
- :visible.sync="visible">
|
|
|
- <el-form :model="dataForm" ref="dataForm" label-width="auto">
|
|
|
- <el-form-item label="消息类型" prop="type">
|
|
|
- <el-input v-model="dataForm.type"/>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="标题" prop="title">
|
|
|
- <el-input v-model="dataForm.title"/>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="内容" prop="content">
|
|
|
- <el-input v-model="dataForm.content"/>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- </el-dialog>
|
|
|
+<!-- <el-dialog-->
|
|
|
+<!-- title="查看消息"-->
|
|
|
+<!-- width="70%"-->
|
|
|
+<!-- :close-on-click-modal="false"-->
|
|
|
+<!-- :visible.sync="visible">-->
|
|
|
+<!-- <el-form :model="dataForm" ref="dataForm" label-width="auto">-->
|
|
|
+<!-- <el-form-item label="消息类型" prop="type">-->
|
|
|
+<!-- <el-input v-model="dataForm.type"/>-->
|
|
|
+<!-- </el-form-item>-->
|
|
|
+<!-- <el-form-item label="标题" prop="title">-->
|
|
|
+<!-- <el-input v-model="dataForm.title"/>-->
|
|
|
+<!-- </el-form-item>-->
|
|
|
+<!-- <el-form-item label="内容" prop="content">-->
|
|
|
+<!-- <el-input v-model="dataForm.content"/>-->
|
|
|
+<!-- </el-form-item>-->
|
|
|
+<!-- </el-form>-->
|
|
|
+<!-- </el-dialog>-->
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -31,16 +31,19 @@
|
|
|
}
|
|
|
},
|
|
|
mounted () {
|
|
|
- const that = this
|
|
|
+ // const that = this
|
|
|
this.$nextTick(() => {
|
|
|
this.$store.state.websocket.webSocket.onmessage = async function (event) {
|
|
|
if (!event || !event.data) {
|
|
|
return
|
|
|
}
|
|
|
- that.dataForm = JSON.parse(event.data)
|
|
|
- // if (!that.visible) {
|
|
|
- // that.visible = true
|
|
|
- // }
|
|
|
+ let json = JSON.stringify(event.data)
|
|
|
+ console.log('json = ' + json)
|
|
|
+ this.$notify({
|
|
|
+ title: event.data.title,
|
|
|
+ message: event.data.content,
|
|
|
+ duration: 0
|
|
|
+ })
|
|
|
}
|
|
|
})
|
|
|
},
|