|
@@ -25,8 +25,13 @@
|
|
|
<el-button @click="handleMark">标注方向</el-button>
|
|
|
<el-button @click="handleLine">标注连线</el-button>
|
|
|
<el-button @click="handleSave" type="success">保存</el-button>
|
|
|
+ <!--
|
|
|
+ <el-button @click="handleClear" v-if="hasDrawData" type="warning"
|
|
|
+ >清空</el-button
|
|
|
+ > -->
|
|
|
+
|
|
|
<el-button @click="handleFree" v-if="isShowExitEdit" type="warning"
|
|
|
- >退出</el-button
|
|
|
+ >退出编辑</el-button
|
|
|
>
|
|
|
</div>
|
|
|
<swiper
|
|
@@ -85,7 +90,7 @@ const sortType = ref(false);
|
|
|
const drawMode = ref(0);
|
|
|
const isShowExitEdit = computed(() => drawMode.value > 0);
|
|
|
import { ElMessage } from "element-plus";
|
|
|
-
|
|
|
+const hasDrawData = ref(false);
|
|
|
let scene = null;
|
|
|
|
|
|
const addCaseFileHandler = async () => {
|
|
@@ -140,6 +145,14 @@ const renderCanvas = () => {
|
|
|
scene.on("markerExist", () => {
|
|
|
ElMessage.error("该案件已有方向标注!");
|
|
|
});
|
|
|
+ scene.on("data", (data) => {
|
|
|
+ console.log("sync", data);
|
|
|
+ Object.keys(data).forEach((key) => {
|
|
|
+ if (Array.isArray(data[key]) && data[key].length > 0) {
|
|
|
+ hasDrawData.value = true;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
};
|
|
|
const onSwiper = (swiper) => {
|
|
|
console.log("onSwiper");
|
|
@@ -189,6 +202,12 @@ const handleFree = () => {
|
|
|
window.scene.player.setMode(0);
|
|
|
}
|
|
|
};
|
|
|
+const handleClear = () => {
|
|
|
+ if (window.scene) {
|
|
|
+ window.scene.player.reset();
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
onMounted(() => {
|
|
|
renderCanvas();
|
|
|
});
|