|
@@ -52,7 +52,7 @@ const components = [
|
|
'waterTank',
|
|
'waterTank',
|
|
];
|
|
];
|
|
|
|
|
|
-export const getDownloadList = async (meta2dData: any, path: string = 'v', jsPens?:string[]) => {
|
|
|
|
|
|
+export const getDownloadList = (meta2dData: any, path: string = 'v') => {
|
|
const lists = new Set();
|
|
const lists = new Set();
|
|
//TODO 加一个type区分是数据/还是接口
|
|
//TODO 加一个type区分是数据/还是接口
|
|
//背景图片
|
|
//背景图片
|
|
@@ -133,36 +133,6 @@ export const getDownloadList = async (meta2dData: any, path: string = 'v', jsPen
|
|
path: file,
|
|
path: file,
|
|
});
|
|
});
|
|
});
|
|
});
|
|
-
|
|
|
|
- const res: any = await axios.post('/api/paid/2d/component?pageSize=1000', {
|
|
|
|
- type: 'JS线性图元',
|
|
|
|
- });
|
|
|
|
- let purchased = res.list.map((item) => item.name);
|
|
|
|
- let arr = [];
|
|
|
|
- jsPens.forEach((item) => {
|
|
|
|
- if(purchased.includes(item)){
|
|
|
|
- arr.push(item);
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- // if (arr.length) {
|
|
|
|
- const res_list: Blob = await axios.post(
|
|
|
|
- '/api/2d/tools',
|
|
|
|
- {
|
|
|
|
- list: arr.map((item) => {
|
|
|
|
- return {
|
|
|
|
- type: 'JS线性图元',
|
|
|
|
- name: item,
|
|
|
|
- };
|
|
|
|
- }),
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- responseType: 'blob',
|
|
|
|
- }
|
|
|
|
- );
|
|
|
|
- lists.add({
|
|
|
|
- data: res_list,
|
|
|
|
- path: `/view/js/1.js`,
|
|
|
|
- });
|
|
|
|
}
|
|
}
|
|
//数据
|
|
//数据
|
|
// const data: any = meta2d.data();
|
|
// const data: any = meta2d.data();
|
|
@@ -346,7 +316,6 @@ export enum Frame {
|
|
html,
|
|
html,
|
|
}
|
|
}
|
|
|
|
|
|
-let frameFlag = -1;
|
|
|
|
|
|
|
|
// export const _preFrameDownload = async (type: Frame) => {
|
|
// export const _preFrameDownload = async (type: Frame) => {
|
|
// frameFlag = type;
|
|
// frameFlag = type;
|
|
@@ -504,15 +473,7 @@ async function zipImage(zip: JSZip, image: string, temImage?: string) {
|
|
// },
|
|
// },
|
|
});
|
|
});
|
|
zip.file(
|
|
zip.file(
|
|
- (frameFlag === -1
|
|
|
|
- ? ''
|
|
|
|
- : `${
|
|
|
|
- frameFlag === Frame.vue3
|
|
|
|
- ? 'meta2d-vue3'
|
|
|
|
- : frameFlag === Frame.vue2
|
|
|
|
- ? 'meta2d-vue2'
|
|
|
|
- : 'meta2d-react'
|
|
|
|
- }/public`) + (cdn ? image.replace(cdn, '').replace(upCdn, '') : image),
|
|
|
|
|
|
+ (cdn ? image.replace(cdn, '').replace(upCdn, '') : image),
|
|
res,
|
|
res,
|
|
{
|
|
{
|
|
createFolders: true,
|
|
createFolders: true,
|
|
@@ -676,7 +637,7 @@ export async function zipImages(zip: JSZip, pens: Pen[]) {
|
|
// zip.file(filePath.replace('/view', ''), res, { createFolders: true });
|
|
// zip.file(filePath.replace('/view', ''), res, { createFolders: true });
|
|
// }
|
|
// }
|
|
|
|
|
|
-export const getFrameDownloadList = async (meta2dData: any, path: string = 'v',type:Frame,jsPens?:string[],flag_3d=false) => {
|
|
|
|
|
|
+export const getFrameDownloadList =(meta2dData: any, path: string = 'v',type:Frame, flag_3d=false) => {
|
|
const lists = new Set();
|
|
const lists = new Set();
|
|
let img = meta2dData.bkImage;
|
|
let img = meta2dData.bkImage;
|
|
if (img) {
|
|
if (img) {
|
|
@@ -851,46 +812,6 @@ export const getFrameDownloadList = async (meta2dData: any, path: string = 'v',t
|
|
path:`/${folderName}/public${file.replace('/view', '')}`,
|
|
path:`/${folderName}/public${file.replace('/view', '')}`,
|
|
});
|
|
});
|
|
});
|
|
});
|
|
-
|
|
|
|
- const res: any = await axios.post('/api/paid/2d/component?pageSize=1000', {
|
|
|
|
- type: 'JS线性图元',
|
|
|
|
- });
|
|
|
|
- let purchased = res.list.map((item) => item.name);
|
|
|
|
- let arr = [];
|
|
|
|
- // for (const pen of meta2dData.pens) {
|
|
|
|
- // if (pen.subClassName && purchased.includes(pen.name)) {
|
|
|
|
- // if(!['箭头','拓扑图未分类'].includes(pen.subClassName)){
|
|
|
|
- // if (!arr.includes(pen.name)) {
|
|
|
|
- // arr.push(pen.name);
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
- jsPens.forEach((item) => {
|
|
|
|
- if(purchased.includes(item)){
|
|
|
|
- arr.push(item);
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- // if (arr.length) {
|
|
|
|
- const res_list: Blob = await axios.post(
|
|
|
|
- '/api/2d/tools',
|
|
|
|
- {
|
|
|
|
- list: arr.map((item) => {
|
|
|
|
- return {
|
|
|
|
- type: 'JS线性图元',
|
|
|
|
- name: item,
|
|
|
|
- };
|
|
|
|
- }),
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- responseType: 'blob',
|
|
|
|
- }
|
|
|
|
- );
|
|
|
|
- lists.add({
|
|
|
|
- data: res_list,
|
|
|
|
- path:`/${folderName}/public/js/1.js`,
|
|
|
|
- });
|
|
|
|
- // }
|
|
|
|
}
|
|
}
|
|
//图纸数据
|
|
//图纸数据
|
|
if (meta2dData._id) delete meta2dData._id;
|
|
if (meta2dData._id) delete meta2dData._id;
|