@manycore/custom-sdk 1.13.0-perf.0 → 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.
Files changed (3) hide show
  1. package/index.d.ts +29 -7
  2. package/index.js +9 -9
  3. 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({
@@ -915,7 +918,7 @@ export declare class FittingDesignService extends BaseService {
915
918
  export declare class FittingModelService extends BaseService {
916
919
  /**
917
920
  * 获取所有五金孔槽模型
918
- * @param modelId paramModel id,查找相关联孔槽五金
921
+ * @param modelId 模型id,查找相关联孔槽五金或模型下所有的板件关联孔槽五金
919
922
  * @returns Promise<IFittingModelLite[]>
920
923
  */
921
924
  getAllFittingModels(modelId?: string): Promise<IFittingModelLite[]>;
@@ -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
- > > 替代的 service 为`CustomDesignExportService`,将会在 9 月底最新的`@manycore/custom-miniapp-sdk`中提供。
2898
+ * > 以上 API 暂不建议在非对接 2.0 环境下使用,主要是与孔/槽方案数据存在关联关系
2899
+ > > 耗时API 建议后台异步请求并配合做好缓存
2900
+ > > >替代的 service 为`CustomDesignExportService`,将会在 9 月底最新的`@manycore/custom-miniapp-sdk`中提供。
2897
2901
  *
2898
- * @example
2902
+ * @example 最佳实践
2899
2903
  * ```typescript
2900
- * await modelService.getParamData();
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
- * await modelService.getParamIntersected();
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