|
@@ -335,6 +335,16 @@ export default {
|
|
// this.data = newItems;
|
|
// this.data = newItems;
|
|
this.data[this.dragging] = dst;
|
|
this.data[this.dragging] = dst;
|
|
this.data[this.draggingE] = src;
|
|
this.data[this.draggingE] = src;
|
|
|
|
+ let mindinfo = this.mindInfo(
|
|
|
|
+ this.dragging,
|
|
|
|
+ "move",
|
|
|
|
+ this.data[this.gIndex],
|
|
|
|
+ "us.mindNetwork",
|
|
|
|
+ this.userinfo ? this.userinfo.userid : this.userid,
|
|
|
|
+ this.RoomInfo.id,
|
|
|
|
+ this.draggingE
|
|
|
|
+ );
|
|
|
|
+ this.updateSocket(mindinfo);
|
|
this.updateRoomData();
|
|
this.updateRoomData();
|
|
this.dragging = null; //拖动结束后,清除数据
|
|
this.dragging = null; //拖动结束后,清除数据
|
|
this.draggingE = null;
|
|
this.draggingE = null;
|
|
@@ -424,6 +434,16 @@ export default {
|
|
})
|
|
})
|
|
.then(() => {
|
|
.then(() => {
|
|
this.data[index] = "";
|
|
this.data[index] = "";
|
|
|
|
+ let mindinfo = this.mindInfo(
|
|
|
|
+ this.index,
|
|
|
|
+ "delete",
|
|
|
|
+ this.data[this.index],
|
|
|
|
+ "us.mindNetwork",
|
|
|
|
+ this.userinfo ? this.userinfo.userid : this.userid,
|
|
|
|
+ this.RoomInfo.id,
|
|
|
|
+ ""
|
|
|
|
+ );
|
|
|
|
+ this.updateSocket(mindinfo);
|
|
this.updateRoomData();
|
|
this.updateRoomData();
|
|
this.$forceUpdate();
|
|
this.$forceUpdate();
|
|
})
|
|
})
|
|
@@ -554,13 +574,14 @@ export default {
|
|
|
|
|
|
let mindinfo = this.mindInfo(
|
|
let mindinfo = this.mindInfo(
|
|
this.gIndex,
|
|
this.gIndex,
|
|
- "us.mindNetwork",
|
|
|
|
|
|
+ "update",
|
|
this.data[this.gIndex],
|
|
this.data[this.gIndex],
|
|
- "",
|
|
|
|
|
|
+ "us.mindNetwork",
|
|
this.userinfo ? this.userinfo.userid : this.userid,
|
|
this.userinfo ? this.userinfo.userid : this.userid,
|
|
- this.RoomInfo.id
|
|
|
|
|
|
+ this.RoomInfo.id,
|
|
|
|
+ ""
|
|
);
|
|
);
|
|
- this.updateSocket(this.mindInfo);
|
|
|
|
|
|
+ this.updateSocket(mindinfo);
|
|
this.updateRoomData();
|
|
this.updateRoomData();
|
|
this.dialogVisible = false;
|
|
this.dialogVisible = false;
|
|
this.$forceUpdate();
|
|
this.$forceUpdate();
|
|
@@ -722,10 +743,11 @@ export default {
|
|
.get(this.$store.state.api + "selectRoom", params)
|
|
.get(this.$store.state.api + "selectRoom", params)
|
|
.then((res) => {
|
|
.then((res) => {
|
|
if (res.data[0].length) {
|
|
if (res.data[0].length) {
|
|
- this.RoomInfo = res.data[0][0];
|
|
|
|
- this.data = JSON.parse(res.data[0][0].data);
|
|
|
|
- this.dialogVisible3 = false;
|
|
|
|
- this.dialogVisible2 = true;
|
|
|
|
|
|
+ // this.RoomInfo = res.data[0][0];
|
|
|
|
+ // this.data = JSON.parse(res.data[0][0].data);
|
|
|
|
+ // this.dialogVisible3 = false;
|
|
|
|
+ // this.dialogVisible2 = true;
|
|
|
|
+ this.getMindNetwork(res.data[0][0].id, this.userinfo.userid);
|
|
// this.data.splice(0,1)
|
|
// this.data.splice(0,1)
|
|
// this.updateRoomData()
|
|
// this.updateRoomData()
|
|
// this.timer = setInterval(() => {
|
|
// this.timer = setInterval(() => {
|
|
@@ -748,10 +770,11 @@ export default {
|
|
.then((res) => {
|
|
.then((res) => {
|
|
if (res.data[0].length) {
|
|
if (res.data[0].length) {
|
|
this.$message.success("加入成功");
|
|
this.$message.success("加入成功");
|
|
- this.RoomInfo = res.data[0][0];
|
|
|
|
- this.data = JSON.parse(res.data[0][0].data);
|
|
|
|
|
|
+ // this.RoomInfo = res.data[0][0];
|
|
|
|
+ // this.data = JSON.parse(res.data[0][0].data);
|
|
this.dialogVisible3 = false;
|
|
this.dialogVisible3 = false;
|
|
this.dialogVisible2 = true;
|
|
this.dialogVisible2 = true;
|
|
|
|
+ this.getMindNetwork(res.data[0][0].id, this.userinfo.userid);
|
|
// this.timer = setInterval(() => {
|
|
// this.timer = setInterval(() => {
|
|
// this.selectRoom2(uid);
|
|
// this.selectRoom2(uid);
|
|
// }, 5000);
|
|
// }, 5000);
|
|
@@ -801,7 +824,6 @@ export default {
|
|
})
|
|
})
|
|
.catch(() => {});
|
|
.catch(() => {});
|
|
},
|
|
},
|
|
-
|
|
|
|
/*
|
|
/*
|
|
* mind 消息类
|
|
* mind 消息类
|
|
* 参数一 : 第几个网格
|
|
* 参数一 : 第几个网格
|
|
@@ -809,15 +831,16 @@ export default {
|
|
* 参数三 : content 行内容
|
|
* 参数三 : content 行内容
|
|
* 参数四 : next 下一行
|
|
* 参数四 : next 下一行
|
|
*/
|
|
*/
|
|
- mindInfo(id, type, content, next, navid, userid, roomid) {
|
|
|
|
|
|
+ mindInfo(id, type, content, navid, userid, roomid, moveIndex) {
|
|
var _data = {
|
|
var _data = {
|
|
sendId: userid, //发送人id
|
|
sendId: userid, //发送人id
|
|
receiveId: roomid, //文件id
|
|
receiveId: roomid, //文件id
|
|
- //type: navid ? 'us.nav' : 'us.word', //消息类型
|
|
|
|
|
|
+ type: navid, //消息类型
|
|
messageInfo: {
|
|
messageInfo: {
|
|
- id: id, //操作ID
|
|
|
|
|
|
+ moveIndex1: id, //第几个网格
|
|
|
|
+ moveIndex2: moveIndex, //移动到的网格
|
|
type: type, //类型
|
|
type: type, //类型
|
|
- content: content, //内容
|
|
|
|
|
|
+ data: content, //内容
|
|
docId: roomid, //文档id
|
|
docId: roomid, //文档id
|
|
// pageId: US.pageId, //当前页面id
|
|
// pageId: US.pageId, //当前页面id
|
|
},
|
|
},
|
|
@@ -829,10 +852,11 @@ export default {
|
|
{
|
|
{
|
|
type: "send",
|
|
type: "send",
|
|
mindinfo: JSON.stringify(mindinfo),
|
|
mindinfo: JSON.stringify(mindinfo),
|
|
|
|
+ post: 1,
|
|
},
|
|
},
|
|
];
|
|
];
|
|
this.ajax
|
|
this.ajax
|
|
- .post(this.$store.state.soket, params)
|
|
|
|
|
|
+ .post(this.$store.state.socket, params)
|
|
.then((res) => {
|
|
.then((res) => {
|
|
console.log(res);
|
|
console.log(res);
|
|
})
|
|
})
|
|
@@ -840,31 +864,57 @@ export default {
|
|
console.error(err);
|
|
console.error(err);
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+ getMindNetwork(id, uid) {
|
|
|
|
+ let params = [
|
|
|
|
+ {
|
|
|
|
+ type: "getMindNetwork",
|
|
|
|
+ docid: id,
|
|
|
|
+ pageid: window.parent.US.pageId,
|
|
|
|
+ userid: uid,
|
|
|
|
+ post: "1",
|
|
|
|
+ },
|
|
|
|
+ ];
|
|
|
|
+ this.ajax
|
|
|
|
+ .post(this.$store.state.socket, params)
|
|
|
|
+ .then((res) => {
|
|
|
|
+ if (res.data[0].length) {
|
|
|
|
+ this.RoomInfo = res.data[0][0];
|
|
|
|
+ this.data = JSON.parse(res.data[0][0].data);
|
|
|
|
+ this.dialogVisible3 = false;
|
|
|
|
+ this.dialogVisible2 = true;
|
|
|
|
+ }
|
|
|
|
+ console.log(res);
|
|
|
|
+ })
|
|
|
|
+ .catch((err) => {
|
|
|
|
+ console.error(err);
|
|
|
|
+ });
|
|
|
|
+ },
|
|
},
|
|
},
|
|
beforeDestroy() {
|
|
beforeDestroy() {
|
|
// clearInterval(this.timer);
|
|
// clearInterval(this.timer);
|
|
window.removeEventListener("message");
|
|
window.removeEventListener("message");
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
|
|
+ document.domain = "cocorobo.cn";
|
|
// window.parent.postMessage({ cid: cid, type: "U.MD.O.P.pollingAsyn" }, "*");
|
|
// window.parent.postMessage({ cid: cid, type: "U.MD.O.P.pollingAsyn" }, "*");
|
|
for (var i = 0; i < 16; i++) {
|
|
for (var i = 0; i < 16; i++) {
|
|
this.data.push("");
|
|
this.data.push("");
|
|
}
|
|
}
|
|
- this.data.push("");
|
|
|
|
this.getUser();
|
|
this.getUser();
|
|
window.addEventListener("message", function (e) {
|
|
window.addEventListener("message", function (e) {
|
|
// 监听 message 事件
|
|
// 监听 message 事件
|
|
if (e.data.type && e.data.type == "mindNetwork_update") {
|
|
if (e.data.type && e.data.type == "mindNetwork_update") {
|
|
- this.data[e.data.idnex] = e.data.data;
|
|
|
|
|
|
+ this.data[e.data.moveIndex1] = e.data.data;
|
|
|
|
+ this.$forceUpdate();
|
|
} else if (e.data.close && e.data.type == "mindNetwork_delete") {
|
|
} else if (e.data.close && e.data.type == "mindNetwork_delete") {
|
|
- // e.data.info
|
|
|
|
- this.data.splice(e.data.index, 1);
|
|
|
|
|
|
+ this.data.splice(e.data.moveIndex1, 1);
|
|
|
|
+ this.$forceUpdate();
|
|
} else if (e.data.close && e.data.type == "mindNetwork_move") {
|
|
} else if (e.data.close && e.data.type == "mindNetwork_move") {
|
|
var newItems = [...JSON.parse(JSON.stringify(this.data))]; //拷贝一份数据进行交换操作。
|
|
var newItems = [...JSON.parse(JSON.stringify(this.data))]; //拷贝一份数据进行交换操作。
|
|
this.data[e.data.moveIndex1] = newItems[e.data.moveIndex2];
|
|
this.data[e.data.moveIndex1] = newItems[e.data.moveIndex2];
|
|
this.data[e.data.moveIndex2] = newItems[e.data.moveIndex1];
|
|
this.data[e.data.moveIndex2] = newItems[e.data.moveIndex1];
|
|
|
|
+ this.$forceUpdate();
|
|
}
|
|
}
|
|
- this.$forceUpdate();
|
|
|
|
});
|
|
});
|
|
},
|
|
},
|
|
};
|
|
};
|