This commit is contained in:
aqu415
2022-02-24 21:44:55 +08:00
parent b21f3cec38
commit 07651ad084
3 changed files with 8 additions and 4 deletions
+1 -1
View File
@@ -19,7 +19,7 @@ class CooperationMind(AbstractModel):
creator = models.BigIntegerField(verbose_name='创建人ID', null=False, blank=False)
client_id = models.CharField(verbose_name='客户端ID', max_length=64, null=False, blank=False)
snapshot_data = models.TextField(verbose_name='脑图数据', null=True, )
snapshot_log_id = models.BigIntegerField(verbose_name='data对应的操作日志(cooperation_mind_log)ID', null=True, )
log_id = models.BigIntegerField(verbose_name='data对应的操作日志(cooperation_mind_log)ID', null=True, )
class Meta:
db_table = 'cooperation_mind'
+1 -1
View File
@@ -45,7 +45,7 @@
// show
let data = resp.data.snapshot_data
me.coop_mind_id = id
me.coop_mind_log_id = resp.data.snapshot_log_id
me.coop_mind_log_id = resp.data.log_id
me.show_mind(resp.data.coop_mind_name, JSON.parse(data))
})
},
+6 -2
View File
@@ -65,8 +65,6 @@
this.coop_mind_id = _jm.options.coop_mind_id
this.coop_mind_log_id = _jm.options.coop_mind_log_id
this.coop_mind_log_last_id = _jm.options.coop_mind_log_id
console.log(this.coop_mind_log_id)
},
// 初始化websocket
_init_ws: function () {
@@ -131,6 +129,12 @@
_handle_jsmind_with_ws_message: function (message) {
const msg_json = JSON.parse(message)
const client_id = msg_json.client_id
const log_id = msg_json.log_id
if (log_id > this.coop_mind_log_id) {
this.coop_mind_log_id = log_id
}
// 回放
if (client_id === this.client_id) {
console.log('self msg')
} else {