|
@@ -65,6 +65,7 @@ const list = ref({
|
|
|
});
|
|
|
const fmtId = ref(0);
|
|
|
const pmtId = ref(0);
|
|
|
+const ognFilesUrl = ref('')
|
|
|
const dom = ref<HTMLCanvasElement>();
|
|
|
const props = computed(() => {
|
|
|
const route = router.currentRoute.value;
|
|
@@ -113,7 +114,10 @@ const trackImage = async () => {
|
|
|
props.value!.type === BoardType.scene
|
|
|
? await selectFuseImage(props.value!)
|
|
|
: await selectMapImage({});
|
|
|
-
|
|
|
+ console.log('户型图', data);
|
|
|
+ if (data?.ognFilesUrl) {
|
|
|
+ ognFilesUrl.value = data.ognFilesUrl;
|
|
|
+ }
|
|
|
if (data?.blob) {
|
|
|
setBackImage(data.blob);
|
|
|
if ("taggings" in data) {
|
|
@@ -128,22 +132,24 @@ const trackImage = async () => {
|
|
|
};
|
|
|
|
|
|
const { board, state } = useBoard(props);
|
|
|
-
|
|
|
+console.log('board', board, state, props);
|
|
|
// 获取通用数据
|
|
|
const getStore = async () => {
|
|
|
const store = await board.value!.getStore();
|
|
|
+ console.log('getStore', store, board.value, state.value);
|
|
|
const titleShape = store.shapes.find(
|
|
|
(shape: any) => shape.type === title
|
|
|
) as TitleShapeData;
|
|
|
- return { store, titleShape };
|
|
|
+ return { store, titleShape, ognFilesUrl: store.ognFilesUrl };
|
|
|
};
|
|
|
|
|
|
//裁剪
|
|
|
const handleCropping = async (data) => {
|
|
|
const appStore = await getStore();
|
|
|
- console.log('titleShape', appStore, board.value, state.value);
|
|
|
+ const args = props.value!;
|
|
|
+ console.log('titleShape', appStore, board.value, args);
|
|
|
const {width, height } = appStore.store.floors?.[0].bgImage;
|
|
|
- const blob = await fetch(state.value.selectShape.data.url).then(res => res.blob());
|
|
|
+ const blob = await fetch(appStore.store.ognFilesUrl || state.value.selectShape.data.url).then(res => res.blob());
|
|
|
const cropBlob = await imageCropper({
|
|
|
img: blob,
|
|
|
fixed: [width, height]
|
|
@@ -168,6 +174,7 @@ const saveHandler = async () => {
|
|
|
file: new File([blob], `${filesTitle}.jpg`),
|
|
|
filesTitle: filesTitle,
|
|
|
content: store && JSON.stringify(store),
|
|
|
+ ognFileUrl: ognFilesUrl.value || store.ognFilesUrl,
|
|
|
};
|
|
|
args.inAdd || (body.filesId = props.value!.fileId);
|
|
|
const { data } = await uploadNewFile(body);
|