|
@@ -6,12 +6,16 @@ export default{
|
|
|
addNewFile
|
|
|
},
|
|
|
computed:{
|
|
|
- ...mapGetters(['webSocket']),
|
|
|
+ // ...mapGetters(['webSocket']),
|
|
|
+ userinfo(){
|
|
|
+ return this.$s.getObj('userinfo')
|
|
|
+ },
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
fun:null,
|
|
|
- isOtherComponent:null
|
|
|
+ isOtherComponent:null,
|
|
|
+ waitLoading:false
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
@@ -19,10 +23,12 @@ export default{
|
|
|
},
|
|
|
methods: {
|
|
|
initWebSocket() {
|
|
|
- this.webSocket.onmessage = (e) => {
|
|
|
+ let webSocket = new WebSocket(`${this.$c.WebSocketPathFMS}/api/fms/ws/` + this.userinfo.id)
|
|
|
+ webSocket.onmessage = (e) => {
|
|
|
const { code, data, message } = JSON.parse(e.data)
|
|
|
- if (code == 1) {//文件保存成功
|
|
|
- this.$message.success('文件保存成功')
|
|
|
+ if (code == 702) {//文件保存成功
|
|
|
+ // this.$message.success('文件保存成功')
|
|
|
+ this.waitLoading = false
|
|
|
if(this.fun){
|
|
|
if(this.isOtherComponent){
|
|
|
this.$emit(this.fun)
|
|
@@ -33,6 +39,9 @@ export default{
|
|
|
this.fun = null
|
|
|
}
|
|
|
}
|
|
|
+ if(code == 703){//恢复版本
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
//调用强制保存
|
|
@@ -63,6 +72,7 @@ export default{
|
|
|
}
|
|
|
|
|
|
}else if(data == 2){
|
|
|
+ this.waitLoading = true
|
|
|
this.isOtherComponent = type
|
|
|
this.fun = fun
|
|
|
}
|