|
@@ -361,6 +361,7 @@ let showTextEdit = ref();
|
|
|
let lnglat = ref([]);
|
|
|
// 协同
|
|
|
let collaboration = ref(false);
|
|
|
+let webSock;
|
|
|
// 分享
|
|
|
let shareState = reactive({
|
|
|
type: '',
|
|
@@ -414,6 +415,7 @@ const clickTab3 = (item, index) => {
|
|
|
if (mouseToolState.value.graphicsType !== type || (mouseToolState.value.graphicsType === 'marker' && mouseToolState.value.title !== item.name)) {
|
|
|
if (type === 'text') {
|
|
|
mouseToolState.value.graphicsType = type;
|
|
|
+ mouseToolState.value.title = item.name;
|
|
|
handleTextEdit();
|
|
|
} else if (type === 'marker') {
|
|
|
const data = {
|
|
@@ -431,6 +433,7 @@ const clickTab3 = (item, index) => {
|
|
|
showTextEdit.value = false;
|
|
|
drawing.value = true;
|
|
|
mouseToolState.value.graphicsType = type;
|
|
|
+ mouseToolState.value.title = item.name;
|
|
|
}
|
|
|
const drawTool = getDrawTool();
|
|
|
const newOptions = drawTool.drawGraphics(mouseToolState.value);
|
|
@@ -461,8 +464,10 @@ const handleClickMap = (e) => {
|
|
|
const addText = (textEditState) => {
|
|
|
const data = {
|
|
|
graphicsType: 'text',
|
|
|
+ type: 'text',
|
|
|
lineWidth: mouseToolState.value.lineWidth,
|
|
|
color: mouseToolState.value.color,
|
|
|
+ title: '文本',
|
|
|
text: textEditState.text,
|
|
|
fontColor: textEditState.fontColor,
|
|
|
fontSize: textEditState.fontSize,
|
|
@@ -568,6 +573,17 @@ const initDrawMethod = (options) => {
|
|
|
}
|
|
|
// 右击进入编辑
|
|
|
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);
|
|
|
};
|
|
@@ -735,14 +751,19 @@ const handleShareConfirm = (data) => {
|
|
|
data.forEach((item) => {
|
|
|
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 = {
|
|
|
pattern_id: nanoid(),
|
|
|
user_id_list: userIdList,
|
|
|
- name: '',
|
|
|
pattern_name: '',
|
|
|
- visible: 'false',
|
|
|
- content: content
|
|
|
+ bz_list: list
|
|
|
};
|
|
|
showForm.value = true;
|
|
|
} else {
|
|
@@ -758,8 +779,8 @@ const handleSendForm = () => {
|
|
|
if (!form.value.pattern_name) {
|
|
|
return proxy?.$modal.msgWarning('请填写预案名称');
|
|
|
}
|
|
|
- createWebSocket('G8RpcIZ6MVdj_PA_a2SY3', getWebSocketData);
|
|
|
- patternId.value = 'G8RpcIZ6MVdj_PA_a2SY3';
|
|
|
+ createWebSocket('eZokH5XO6VC6xIXEHirTF', getWebSocketData);
|
|
|
+ patternId.value = 'eZokH5XO6VC6xIXEHirTF';
|
|
|
// createCollaboration(form.value).then(() => {
|
|
|
// patternId.value = form.value.pattern_id;
|
|
|
// createWebSocket(form.value.pattern_id, getWebSocketData);
|