|
@@ -1,5 +1,6 @@
|
|
<template>
|
|
<template>
|
|
<div class="df-layout">
|
|
<div class="df-layout">
|
|
|
|
+ <login />
|
|
<Header
|
|
<Header
|
|
class="df-header"
|
|
class="df-header"
|
|
:type="props.type"
|
|
:type="props.type"
|
|
@@ -42,14 +43,15 @@
|
|
import Header from "./header.vue";
|
|
import Header from "./header.vue";
|
|
import Slider from "./slider.vue";
|
|
import Slider from "./slider.vue";
|
|
import Eshape from "./eshape.vue";
|
|
import Eshape from "./eshape.vue";
|
|
-import { computed, nextTick, ref } from "vue";
|
|
|
|
|
|
+import login from "./login.vue";
|
|
|
|
+import { computed, nextTick, ref, watch, onMounted } from "vue";
|
|
import { RouteName, router } from "@/router";
|
|
import { RouteName, router } from "@/router";
|
|
import { useBoard, title } from "./board/useBoard";
|
|
import { useBoard, title } from "./board/useBoard";
|
|
import { selectFuseImage, selectMapImage } from "@/view/case/quisk";
|
|
import { selectFuseImage, selectMapImage } from "@/view/case/quisk";
|
|
import { CaseTagging } from "@/store/caseTagging";
|
|
import { CaseTagging } from "@/store/caseTagging";
|
|
import saveAs from "@/util/file-serve";
|
|
import saveAs from "@/util/file-serve";
|
|
import { BoardTypeDesc } from "@/constant/caseFile";
|
|
import { BoardTypeDesc } from "@/constant/caseFile";
|
|
-import { addByMediaLiBrary, updateByTreeFileLists, uploadNewFile } from "@/store/case";
|
|
|
|
|
|
+import { addByMediaLiBrary, updateByTreeFileLists, uploadNewFile, getUrlSrc } from "@/store/case";
|
|
import { imageCropper } from "@/view/system/quisk";
|
|
import { imageCropper } from "@/view/system/quisk";
|
|
import {
|
|
import {
|
|
BoardType,
|
|
BoardType,
|
|
@@ -65,6 +67,8 @@ const list = ref({
|
|
});
|
|
});
|
|
const fmtId = ref(0);
|
|
const fmtId = ref(0);
|
|
const pmtId = ref(0);
|
|
const pmtId = ref(0);
|
|
|
|
+const board = ref(null);
|
|
|
|
+const state = ref({});
|
|
const ognFilesUrl = ref('')
|
|
const ognFilesUrl = ref('')
|
|
const dom = ref<HTMLCanvasElement>();
|
|
const dom = ref<HTMLCanvasElement>();
|
|
const props = computed(() => {
|
|
const props = computed(() => {
|
|
@@ -83,7 +87,7 @@ const props = computed(() => {
|
|
};
|
|
};
|
|
}
|
|
}
|
|
});
|
|
});
|
|
-function getList() {
|
|
|
|
|
|
+async function getList() {
|
|
updateByTreeFileLists(props.caseId).then(res => {
|
|
updateByTreeFileLists(props.caseId).then(res => {
|
|
let newlist = res.find(ele => ele.filesTypeName == '三录材料')?.childrenList || [];
|
|
let newlist = res.find(ele => ele.filesTypeName == '三录材料')?.childrenList || [];
|
|
list.value.xct = newlist.find(ele => ele.filesTypeName == '现场图')?.childrenList || [];
|
|
list.value.xct = newlist.find(ele => ele.filesTypeName == '现场图')?.childrenList || [];
|
|
@@ -92,19 +96,26 @@ function getList() {
|
|
console.log('list.value', list.value)
|
|
console.log('list.value', list.value)
|
|
})
|
|
})
|
|
}
|
|
}
|
|
-getList()
|
|
|
|
|
|
+if(pmtId.value || fmtId.value) {
|
|
|
|
+ const boardData = useBoard(props);
|
|
|
|
+ board.value = boardData.board;
|
|
|
|
+ state.value = boardData.state;
|
|
|
|
+}
|
|
const backPageHandler = () => {
|
|
const backPageHandler = () => {
|
|
board.value && board.value.clear();
|
|
board.value && board.value.clear();
|
|
- router.back();
|
|
|
|
|
|
+ router.replace({ name: RouteName.material, params: { caseId: props.caseId } });
|
|
|
|
+ // router.back();
|
|
};
|
|
};
|
|
|
|
|
|
const setBackImage = (blob: Blob) => {
|
|
const setBackImage = (blob: Blob) => {
|
|
|
|
+ console.log('setBackImage', blob, board.value);
|
|
board.value!.setImage(URL.createObjectURL(blob));
|
|
board.value!.setImage(URL.createObjectURL(blob));
|
|
};
|
|
};
|
|
|
|
|
|
const updateAddShape = async (s, d) => {
|
|
const updateAddShape = async (s, d) => {
|
|
if (d) {
|
|
if (d) {
|
|
- state.value.addData = await uploadFile(d);
|
|
|
|
|
|
+ state.value.addData = getUrlSrc({type: 102}) + '/' + await uploadFile(d);
|
|
|
|
+ console.log('state.value', state.value.addData);
|
|
}
|
|
}
|
|
state.value.addShape = s;
|
|
state.value.addShape = s;
|
|
};
|
|
};
|
|
@@ -130,9 +141,17 @@ const trackImage = async () => {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
+// watch(props, (newValue) => {
|
|
|
|
+// if(!newValue) return;
|
|
|
|
+// const BoardData = useBoard(props)
|
|
|
|
+// board.value = BoardData.board;
|
|
|
|
+// state.value = BoardData.state;
|
|
|
|
+// console.log('watchEffect111', newValue, props, board.value)
|
|
|
|
+// // const board = ref(null);
|
|
|
|
+// // const state = ref(null);
|
|
|
|
+// })
|
|
|
|
+console.log('useBoard', board, state)
|
|
|
|
|
|
-const { board, state } = useBoard(props);
|
|
|
|
-console.log('board', board, state, props);
|
|
|
|
// 获取通用数据
|
|
// 获取通用数据
|
|
const getStore = async () => {
|
|
const getStore = async () => {
|
|
const store = await board.value!.getStore();
|
|
const store = await board.value!.getStore();
|
|
@@ -142,7 +161,14 @@ const getStore = async () => {
|
|
) as TitleShapeData;
|
|
) as TitleShapeData;
|
|
return { store, titleShape, ognFilesUrl: store.ognFilesUrl };
|
|
return { store, titleShape, ognFilesUrl: store.ognFilesUrl };
|
|
};
|
|
};
|
|
-
|
|
|
|
|
|
+const isUrl = (string) => {
|
|
|
|
+ try {
|
|
|
|
+ new URL(string);
|
|
|
|
+ return true;
|
|
|
|
+ } catch (err) {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
//裁剪
|
|
//裁剪
|
|
const handleCropping = async (data) => {
|
|
const handleCropping = async (data) => {
|
|
const appStore = await getStore();
|
|
const appStore = await getStore();
|
|
@@ -197,6 +223,9 @@ const exportHandler = async () => {
|
|
const blob = await board.value!.export();
|
|
const blob = await board.value!.export();
|
|
saveAs(blob, `${titleShape.text}.jpg`);
|
|
saveAs(blob, `${titleShape.text}.jpg`);
|
|
};
|
|
};
|
|
|
|
+onMounted(() => {
|
|
|
|
+ getList()
|
|
|
|
+})
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
@@ -253,4 +282,4 @@ const exportHandler = async () => {
|
|
height: 100%;
|
|
height: 100%;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-</style>
|
|
|
|
|
|
+</style>
|