|
@@ -8,7 +8,7 @@ import { useUser } from '@/services/user';
|
|
|
import { showNotification, Meta2dBackData, checkData } from '@/services/utils';
|
|
|
import { noLoginTip, localStorageName } from '@/services/utils';
|
|
|
import { upload, dataURLtoBlob } from '@/services/file';
|
|
|
-import { delImage, addCollection, updateCollection } from '@/services/api';
|
|
|
+import { delImage, addCollection, updateCollection, getLe5leV } from '@/services/api';
|
|
|
import { baseVer } from '@/services/upgrade';
|
|
|
import { debounce } from './debouce';
|
|
|
import { deepClone, isDomShapes } from '@meta2d/core';
|
|
@@ -590,7 +590,7 @@ export const save = async (
|
|
|
image:data.image,
|
|
|
name:data.name,
|
|
|
folder:data.folder,
|
|
|
- shared:true,
|
|
|
+ // shared:true,
|
|
|
userFlag
|
|
|
}
|
|
|
delete data.name;
|
|
@@ -650,6 +650,32 @@ export const save = async (
|
|
|
return true;
|
|
|
};
|
|
|
|
|
|
+
|
|
|
+export const autoSaveAS = async(id:string)=>{
|
|
|
+ //先请求打开图纸
|
|
|
+ const ret: any = await getLe5leV(id);
|
|
|
+ if(!ret.data && ret.price>0){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ sessionStorage.setItem('opening', '1');
|
|
|
+ router.push({
|
|
|
+ path: '/',
|
|
|
+ query: {
|
|
|
+ r: Date.now() + '',
|
|
|
+ },
|
|
|
+ });
|
|
|
+ //去除图纸一些信息
|
|
|
+ for (const k of delAttrs) {
|
|
|
+ delete ret[k];
|
|
|
+ }
|
|
|
+ meta2d.open(ret.data);
|
|
|
+ meta2d.fitView();
|
|
|
+ //另存为付费用户图纸
|
|
|
+ setTimeout(()=>{
|
|
|
+ save(SaveType.SaveAs, '', undefined, 1);
|
|
|
+ },500)
|
|
|
+}
|
|
|
+
|
|
|
const pen = ref(false);
|
|
|
export const drawPen = () => {
|
|
|
meta2d.inactive();
|