|
@@ -383,6 +383,7 @@ let showTextEdit = ref();
|
|
let lnglat = ref([]);
|
|
let lnglat = ref([]);
|
|
// 协同
|
|
// 协同
|
|
let collaboration = ref(false);
|
|
let collaboration = ref(false);
|
|
|
|
+let webSock;
|
|
// 分享
|
|
// 分享
|
|
let shareState = reactive({
|
|
let shareState = reactive({
|
|
type: '',
|
|
type: '',
|
|
@@ -436,6 +437,7 @@ const clickTab3 = (item, index) => {
|
|
if (mouseToolState.value.graphicsType !== type || (mouseToolState.value.graphicsType === 'marker' && mouseToolState.value.title !== item.name)) {
|
|
if (mouseToolState.value.graphicsType !== type || (mouseToolState.value.graphicsType === 'marker' && mouseToolState.value.title !== item.name)) {
|
|
if (type === 'text') {
|
|
if (type === 'text') {
|
|
mouseToolState.value.graphicsType = type;
|
|
mouseToolState.value.graphicsType = type;
|
|
|
|
+ mouseToolState.value.title = item.name;
|
|
handleTextEdit();
|
|
handleTextEdit();
|
|
} else if (type === 'marker') {
|
|
} else if (type === 'marker') {
|
|
const data = {
|
|
const data = {
|
|
@@ -453,6 +455,7 @@ const clickTab3 = (item, index) => {
|
|
showTextEdit.value = false;
|
|
showTextEdit.value = false;
|
|
drawing.value = true;
|
|
drawing.value = true;
|
|
mouseToolState.value.graphicsType = type;
|
|
mouseToolState.value.graphicsType = type;
|
|
|
|
+ mouseToolState.value.title = item.name;
|
|
}
|
|
}
|
|
const drawTool = getDrawTool();
|
|
const drawTool = getDrawTool();
|
|
const newOptions = drawTool.drawGraphics(mouseToolState.value);
|
|
const newOptions = drawTool.drawGraphics(mouseToolState.value);
|
|
@@ -483,8 +486,10 @@ const handleClickMap = (e) => {
|
|
const addText = (textEditState) => {
|
|
const addText = (textEditState) => {
|
|
const data = {
|
|
const data = {
|
|
graphicsType: 'text',
|
|
graphicsType: 'text',
|
|
|
|
+ type: 'text',
|
|
lineWidth: mouseToolState.value.lineWidth,
|
|
lineWidth: mouseToolState.value.lineWidth,
|
|
color: mouseToolState.value.color,
|
|
color: mouseToolState.value.color,
|
|
|
|
+ title: '文本',
|
|
text: textEditState.text,
|
|
text: textEditState.text,
|
|
fontColor: textEditState.fontColor,
|
|
fontColor: textEditState.fontColor,
|
|
fontSize: textEditState.fontSize,
|
|
fontSize: textEditState.fontSize,
|
|
@@ -503,6 +508,14 @@ const addText = (textEditState) => {
|
|
const map = drawTool.getMap();
|
|
const map = drawTool.getMap();
|
|
// 监听地图点击事件
|
|
// 监听地图点击事件
|
|
map.off('click', handleClickMap);
|
|
map.off('click', handleClickMap);
|
|
|
|
+ webSock.send(
|
|
|
|
+ JSON.stringify({
|
|
|
|
+ operation: 'add', // 必填
|
|
|
|
+ name: data.title, // 必填
|
|
|
|
+ content: JSON.stringify(data), // 必填
|
|
|
|
+ visible: false
|
|
|
|
+ })
|
|
|
|
+ );
|
|
close();
|
|
close();
|
|
};
|
|
};
|
|
// watch(
|
|
// watch(
|
|
@@ -590,6 +603,17 @@ const initDrawMethod = (options) => {
|
|
}
|
|
}
|
|
// 右击进入编辑
|
|
// 右击进入编辑
|
|
obj.on('rightclick', handleRightClick);
|
|
obj.on('rightclick', handleRightClick);
|
|
|
|
+ // 发送
|
|
|
|
+ if (!!collaboration.value) {
|
|
|
|
+ webSock.send(
|
|
|
|
+ JSON.stringify({
|
|
|
|
+ operation: 'add', // 必填
|
|
|
|
+ name: data.title, // 必填
|
|
|
|
+ content: JSON.stringify(data), // 必填
|
|
|
|
+ visible: false
|
|
|
|
+ })
|
|
|
|
+ );
|
|
|
|
+ }
|
|
};
|
|
};
|
|
mouseTool.on('draw', onDraw);
|
|
mouseTool.on('draw', onDraw);
|
|
};
|
|
};
|
|
@@ -758,14 +782,19 @@ const handleShareConfirm = (data) => {
|
|
data.forEach((item) => {
|
|
data.forEach((item) => {
|
|
userIdList.push(item.userId);
|
|
userIdList.push(item.userId);
|
|
});
|
|
});
|
|
- let content = currentState.value.length > 0 ? JSON.stringify(currentState.value[currentState.value.length - 1]) : '';
|
|
|
|
|
|
+ let list = [];
|
|
|
|
+ currentState.value.forEach((item) => {
|
|
|
|
+ list.push({
|
|
|
|
+ name: item.title,
|
|
|
|
+ visible: 'true',
|
|
|
|
+ content: JSON.stringify(item)
|
|
|
|
+ });
|
|
|
|
+ });
|
|
form.value = {
|
|
form.value = {
|
|
pattern_id: nanoid(),
|
|
pattern_id: nanoid(),
|
|
user_id_list: userIdList,
|
|
user_id_list: userIdList,
|
|
- name: '',
|
|
|
|
pattern_name: '',
|
|
pattern_name: '',
|
|
- visible: 'false',
|
|
|
|
- content: content
|
|
|
|
|
|
+ bz_list: list
|
|
};
|
|
};
|
|
showForm.value = true;
|
|
showForm.value = true;
|
|
} else {
|
|
} else {
|
|
@@ -777,17 +806,18 @@ const handleShareConfirm = (data) => {
|
|
const getWebSocketData = (data) => {
|
|
const getWebSocketData = (data) => {
|
|
console.log('接收数据', data);
|
|
console.log('接收数据', data);
|
|
};
|
|
};
|
|
|
|
+
|
|
const handleSendForm = () => {
|
|
const handleSendForm = () => {
|
|
if (!form.value.pattern_name) {
|
|
if (!form.value.pattern_name) {
|
|
return proxy?.$modal.msgWarning('请填写预案名称');
|
|
return proxy?.$modal.msgWarning('请填写预案名称');
|
|
}
|
|
}
|
|
- createWebSocket('2-85yd6_ZmiYDoZTezv5S', getWebSocketData);
|
|
|
|
- patternId.value = '2-85yd6_ZmiYDoZTezv5S';
|
|
|
|
|
|
+ webSock = createWebSocket('eZokH5XO6VC6xIXEHirTF', getWebSocketData);
|
|
|
|
+ patternId.value = 'eZokH5XO6VC6xIXEHirTF';
|
|
// createCollaboration(form.value).then(() => {
|
|
// createCollaboration(form.value).then(() => {
|
|
// patternId.value = form.value.pattern_id;
|
|
// patternId.value = form.value.pattern_id;
|
|
- // createWebSocket(form.value.pattern_id, getWebSocketData);
|
|
|
|
- showForm.value = false;
|
|
|
|
- collaboration.value = true;
|
|
|
|
|
|
+ // webSock = createWebSocket(form.value.pattern_id, getWebSocketData);
|
|
|
|
+ showForm.value = false;
|
|
|
|
+ collaboration.value = true;
|
|
// });
|
|
// });
|
|
};
|
|
};
|
|
const handleShowDialog = () => {
|
|
const handleShowDialog = () => {
|