|
@@ -37,13 +37,13 @@
|
|
|
|
|
|
|
|
<!-- 对话样式消息 -->
|
|
<!-- 对话样式消息 -->
|
|
|
<div v-if="msg.messageType === 'report'" class="dialog-message" @click="handleReportClick(msg)">
|
|
<div v-if="msg.messageType === 'report'" class="dialog-message" @click="handleReportClick(msg)">
|
|
|
- <template v-if="(msg.reportType || msg.content.type) === 'farm_report'">
|
|
|
|
|
|
|
+ <template v-if="(msg.reportType || msg.content.reportType) === 'farm_report'">
|
|
|
<div class="report-title">{{ msg.title ||msg.content.title }}</div>
|
|
<div class="report-title">{{ msg.title ||msg.content.title }}</div>
|
|
|
<div class="dialog-title">这是我的果园情况,请查看~</div>
|
|
<div class="dialog-title">这是我的果园情况,请查看~</div>
|
|
|
<img src="https://birdseye-img.sysuimars.com/birdseye-look-mini/share-report-bg.png" alt="" class="monitor-image" />
|
|
<img src="https://birdseye-img.sysuimars.com/birdseye-look-mini/share-report-bg.png" alt="" class="monitor-image" />
|
|
|
</template>
|
|
</template>
|
|
|
<template v-else>
|
|
<template v-else>
|
|
|
- <div class="dialog-title">{{ msg.content.title }}</div>
|
|
|
|
|
|
|
+ <div class="dialog-title">{{ msg.title || msg.content.title}}</div>
|
|
|
<img src="@/assets/img/monitor/image.png" alt="" class="monitor-image" />
|
|
<img src="@/assets/img/monitor/image.png" alt="" class="monitor-image" />
|
|
|
</template>
|
|
</template>
|
|
|
</div>
|
|
</div>
|
|
@@ -88,13 +88,13 @@
|
|
|
|
|
|
|
|
<!-- 对话样式消息 -->
|
|
<!-- 对话样式消息 -->
|
|
|
<div v-if="msg.messageType === 'report'" class="dialog-message" @click="handleReportClick(msg)">
|
|
<div v-if="msg.messageType === 'report'" class="dialog-message" @click="handleReportClick(msg)">
|
|
|
- <template v-if="(msg.reportType || msg.content.type) === 'farm_report'">
|
|
|
|
|
|
|
+ <template v-if="(msg.reportType || msg.content.reportType) === 'farm_report'">
|
|
|
<div class="report-title">{{ msg.title ||msg.content.title }}</div>
|
|
<div class="report-title">{{ msg.title ||msg.content.title }}</div>
|
|
|
<div class="dialog-title">这是我的果园情况,请查看~</div>
|
|
<div class="dialog-title">这是我的果园情况,请查看~</div>
|
|
|
<img src="https://birdseye-img.sysuimars.com/birdseye-look-mini/share-report-bg.png" alt="" class="monitor-image" />
|
|
<img src="https://birdseye-img.sysuimars.com/birdseye-look-mini/share-report-bg.png" alt="" class="monitor-image" />
|
|
|
</template>
|
|
</template>
|
|
|
<template v-else>
|
|
<template v-else>
|
|
|
- <div class="dialog-title">{{ msg.content.title }}</div>
|
|
|
|
|
|
|
+ <div class="dialog-title">{{ msg.title || msg.content.title}}</div>
|
|
|
<img src="@/assets/img/monitor/image.png" alt="" class="monitor-image" />
|
|
<img src="@/assets/img/monitor/image.png" alt="" class="monitor-image" />
|
|
|
</template>
|
|
</template>
|
|
|
</div>
|
|
</div>
|
|
@@ -267,7 +267,7 @@ const createSession = (targetUserId, callback) => {
|
|
|
console.error(e, "e");
|
|
console.error(e, "e");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- }else if(item.messageType === 'card'){
|
|
|
|
|
|
|
+ }else if(item.messageType !== 'text'){
|
|
|
content = JSON.parse(item.content);
|
|
content = JSON.parse(item.content);
|
|
|
}
|
|
}
|
|
|
return {
|
|
return {
|
|
@@ -424,7 +424,9 @@ watch(
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
onDeactivated(() => {
|
|
onDeactivated(() => {
|
|
|
- sessionStorage.removeItem('selectedFarmId');
|
|
|
|
|
|
|
+ if(clearSession.value){
|
|
|
|
|
+ sessionStorage.removeItem('selectedFarmId');
|
|
|
|
|
+ }
|
|
|
mqttClient.value && mqttClient.value.client.end(true);
|
|
mqttClient.value && mqttClient.value.client.end(true);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
@@ -510,10 +512,11 @@ const sendMessage = (message) => {
|
|
|
if(message.reportType === 'farm_report'){
|
|
if(message.reportType === 'farm_report'){
|
|
|
sendMsg('report','',{
|
|
sendMsg('report','',{
|
|
|
title: message.title,
|
|
title: message.title,
|
|
|
|
|
+ reportId: message.reportId,
|
|
|
reportType: message.reportType,
|
|
reportType: message.reportType,
|
|
|
});
|
|
});
|
|
|
}else{
|
|
}else{
|
|
|
- console.log('其他文件');
|
|
|
|
|
|
|
+ console.log('其他文件1');
|
|
|
}
|
|
}
|
|
|
}else{
|
|
}else{
|
|
|
sendMsg('card','',{
|
|
sendMsg('card','',{
|
|
@@ -777,11 +780,14 @@ const sendDialogMessage = (dialogData) => {
|
|
|
sendMessage(message);
|
|
sendMessage(message);
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+const clearSession = ref(true);
|
|
|
// 点击农场报告对话框
|
|
// 点击农场报告对话框
|
|
|
const handleReportClick = (msg) => {
|
|
const handleReportClick = (msg) => {
|
|
|
- if(msg.reportType === 'farm_report'){
|
|
|
|
|
|
|
+ console.log(msg);
|
|
|
|
|
+ if(msg.reportType === 'farm_report' || msg.messageType === 'report'){
|
|
|
|
|
+ clearSession.value = false;
|
|
|
const params = {
|
|
const params = {
|
|
|
- farmId: msg.reportId,
|
|
|
|
|
|
|
+ farmId: msg.reportId || msg.content?.reportId,
|
|
|
showFilter: true,
|
|
showFilter: true,
|
|
|
}
|
|
}
|
|
|
router.push(`/farm_report?miniJson=${JSON.stringify(params)}`);
|
|
router.push(`/farm_report?miniJson=${JSON.stringify(params)}`);
|