@manycore/custom-sdk 1.13.1 → 1.14.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +28 -6
- package/index.js +37 -18
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -854,6 +854,9 @@ export declare class FittingDesignService extends BaseService {
|
|
|
854
854
|
* 保存孔/槽数据至方案
|
|
855
855
|
* 如果design不传,即表示将分步保存数据存储至后端
|
|
856
856
|
*
|
|
857
|
+
* 之前的孔槽会被design直接替换
|
|
858
|
+
*
|
|
859
|
+
* 如果只想展示孔槽可使用 {@link FittingDesignService.appendFittingDesign}
|
|
857
860
|
* @example
|
|
858
861
|
* ```typescript
|
|
859
862
|
* await fittingDesignService.saveDesign({
|
|
@@ -2892,12 +2895,22 @@ export declare class FittingDesignService extends BaseService {
|
|
|
2892
2895
|
* const json = await service.getModelJsonDataByModelId('请输入模型ID');
|
|
2893
2896
|
* ```
|
|
2894
2897
|
*
|
|
2895
|
-
* > 以上 API 暂不建议在非对接 2.0
|
|
2896
|
-
> >
|
|
2898
|
+
* > 以上 API 暂不建议在非对接 2.0 环境下使用,主要是与孔/槽方案数据存在关联关系
|
|
2899
|
+
> > 耗时API 建议后台异步请求并配合做好缓存
|
|
2900
|
+
> > >替代的 service 为`CustomDesignExportService`,将会在 9 月底最新的`@manycore/custom-miniapp-sdk`中提供。
|
|
2897
2901
|
*
|
|
2898
|
-
* @example
|
|
2902
|
+
* @example 最佳实践
|
|
2899
2903
|
* ```typescript
|
|
2900
|
-
*
|
|
2904
|
+
* // 后台异步任务 串行执行不建议并发
|
|
2905
|
+
* const cache = new Map<string, any>();
|
|
2906
|
+
* for (const model of models) {
|
|
2907
|
+
* const { id } = model;
|
|
2908
|
+
* const data = await getParamData({ modelId: id });
|
|
2909
|
+
* cache.set(id, data)
|
|
2910
|
+
* }
|
|
2911
|
+
*
|
|
2912
|
+
* // 主线程获取
|
|
2913
|
+
* cache.get(id);
|
|
2901
2914
|
* ```
|
|
2902
2915
|
*
|
|
2903
2916
|
* @param options
|
|
@@ -2905,10 +2918,19 @@ export declare class FittingDesignService extends BaseService {
|
|
|
2905
2918
|
getParamData(options?: IGetParamModelJsonOption): Promise<any>;
|
|
2906
2919
|
/**
|
|
2907
2920
|
* 获取模型的交接数据
|
|
2908
|
-
*
|
|
2921
|
+
* > 耗时API 建议后台异步请求并配合做好缓存
|
|
2909
2922
|
* @example
|
|
2910
2923
|
* ```typescript
|
|
2911
|
-
*
|
|
2924
|
+
* // 后台异步任务 串行执行不建议并发
|
|
2925
|
+
* const cache = new Map<string, any>();
|
|
2926
|
+
* for (const model of models) {
|
|
2927
|
+
* const { id } = model;
|
|
2928
|
+
* const data = await getParamIntersected({ modelId: id });
|
|
2929
|
+
* cache.set(id, data)
|
|
2930
|
+
* }
|
|
2931
|
+
*
|
|
2932
|
+
* // 主线程获取
|
|
2933
|
+
* cache.get(id);
|
|
2912
2934
|
* ```
|
|
2913
2935
|
*
|
|
2914
2936
|
* @param options
|