Browse Source

Fixed some fucking bugs.

pull/6/head
t123yh 7 years ago
parent
commit
ab6532e0a7
  1. 6
      views/submission_content.ejs

6
views/submission_content.ejs

@ -212,21 +212,23 @@ if (token != null) {
vueApp.roughData.running = true; vueApp.roughData.running = true;
}); });
socket.on('update', (p) => { socket.on('update', (p) => {
// console.log("Delta: " + JSON.stringify(p)); console.log("Delta: " + JSON.stringify(p));
const current = JSON.parse(JSON.stringify(vueApp.detailResult)); const current = JSON.parse(JSON.stringify(vueApp.detailResult));
jsondiffpatch.patch(current, p.delta); jsondiffpatch.patch(current, p.delta);
vueApp.detailResult = current; vueApp.detailResult = current;
}); });
socket.on('finish', (p) => { socket.on('finish', (p) => {
console.log("Finish: " + JSON.stringify(p));
vueApp.roughData.running = false; vueApp.roughData.running = false;
vueApp.roughData.result = p.roughResult; vueApp.roughData.result = p.roughResult;
vueApp.detailResult = p.result; vueApp.detailResult = p.result;
}); });
socket.emit('join', token, (data) => { socket.emit('join', token, (data) => {
console.log("JOIN" + JSON.stringify(data));
if (data && data.ok) { if (data && data.ok) {
if (data.finished) { if (data.finished) {
vueApp.roughData.result = data.roughResult; vueApp.roughData.result = data.roughResult;
vueApp.detailData = data.result || { vueApp.detailResult = data.result || {
systemMessage: "系统出错,请刷新后重试。" systemMessage: "系统出错,请刷新后重试。"
}; };
} else { } else {

Loading…
Cancel
Save