|
@@ -642,7 +642,7 @@ async function zipFile(zip: JSZip, filePath: string) {
|
|
|
zip.file(filePath.replace('/view', ''), res, { createFolders: true });
|
|
|
}
|
|
|
|
|
|
-export const getFrameDownloadList = (meta2dData: any, path: string = 'v',type:Frame,flag_3d=false) => {
|
|
|
+export const getFrameDownloadList = async (meta2dData: any, path: string = 'v',type:Frame,flag_3d=false) => {
|
|
|
const lists = new Set();
|
|
|
let img = meta2dData.bkImage;
|
|
|
if (img) {
|
|
@@ -817,6 +817,39 @@ export const getFrameDownloadList = (meta2dData: any, path: string = 'v',type:Fr
|
|
|
path:`/${folderName}/public${file.replace('/view', '')}`,
|
|
|
});
|
|
|
});
|
|
|
+
|
|
|
+ const res: any = await axios.post('/api/paid/2d/component', {
|
|
|
+ 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 (!arr.includes(pen.name)) {
|
|
|
+ arr.push(pen.name);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ 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;
|