@manycore/custom-sdk 1.0.1-rc.4 → 1.0.1-rc.5

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 (4) hide show
  1. package/1.index.js +1 -1
  2. package/index.d.ts +363 -13
  3. package/index.js +76 -55
  4. package/package.json +8 -5
package/1.index.js CHANGED
@@ -1,4 +1,4 @@
1
- (window.webpackJsonpapp=window.webpackJsonpapp||[]).push([[1],{3143:function(t,e,s){var i,a;function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}a=window||{},void 0===(i=function(){return function(t){var e,s,i="http://www.w3.org/2000/svg",a="",n=!0,h=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),o=(Math.round,Math.pow),l=Math.sqrt,p=(Math.abs,Math.floor),f=(Math.max,Math.min),m={};(function(){var t,e=Object.getOwnPropertyNames(Math),s=e.length;for(t=0;t<s;t+=1)m[e[t]]=Math[e[t]]})(),m.random=Math.random,m.abs=function(t){if("object"===r(t)&&t.length){var e,s=Array.apply(null,{length:t.length}),i=t.length;for(e=0;e<i;e+=1)s[e]=Math.abs(t[e]);return s}return Math.abs(t)};var d=150,c=Math.PI/180;function u(t){s=t?Math.round:function(t){return t}}function g(t){return Math.round(1e4*t)/1e4}function y(t,e,s,i){this.type=t,this.currentTime=e,this.totalTime=s,this.direction=i<0?-1:1}function v(t,e){this.type=t,this.direction=e<0?-1:1}function b(t,e,s,i){this.type=t,this.currentLoop=e,this.totalLoops=s,this.direction=i<0?-1:1}function k(t,e,s){this.type=t,this.firstFrame=e,this.totalFrames=s}function A(t,e){this.type=t,this.target=e}function P(t,e){var s;void 0===e&&(e="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890");var i="";for(s=t;s>0;--s)i+=e[Math.round(Math.random()*(e.length-1))];return i}function E(t,e,s){var i,a,r,n,h,o,l,p;switch(1===arguments.length&&(e=t.s,s=t.v,t=t.h),o=s*(1-e),l=s*(1-(h=6*t-(n=Math.floor(6*t)))*e),p=s*(1-(1-h)*e),n%6){case 0:i=s,a=p,r=o;break;case 1:i=l,a=s,r=o;break;case 2:i=o,a=s,r=p;break;case 3:i=o,a=l,r=s;break;case 4:i=p,a=o,r=s;break;case 5:i=s,a=o,r=l}return[i,a,r]}function M(t,e,s){1===arguments.length&&(e=t.g,s=t.b,t=t.r);var i,a=Math.max(t,e,s),r=Math.min(t,e,s),n=a-r,h=0===a?0:n/a,o=a/255;switch(a){case r:i=0;break;case t:i=e-s+n*(e<s?6:0),i/=6*n;break;case e:i=s-t+2*n,i/=6*n;break;case s:i=t-e+4*n,i/=6*n}return[i,h,o]}function _(t,e){var s=M(255*t[0],255*t[1],255*t[2]);return s[1]+=e,s[1]>1?s[1]=1:s[1]<=0&&(s[1]=0),E(s[0],s[1],s[2])}function S(t,e){var s=M(255*t[0],255*t[1],255*t[2]);return s[2]+=e,s[2]>1?s[2]=1:s[2]<0&&(s[2]=0),E(s[0],s[1],s[2])}function F(t,e){var s=M(255*t[0],255*t[1],255*t[2]);return s[0]+=e/360,s[0]>1?s[0]-=1:s[0]<0&&(s[0]+=1),E(s[0],s[1],s[2])}u(!1);var w=function(){var t,e,s=[];for(t=0;t<256;t+=1)e=t.toString(16),s[t]=1==e.length?"0"+e:e;return function(t,e,i){return t<0&&(t=0),e<0&&(e=0),i<0&&(i=0),"#"+s[t]+s[e]+s[i]}}();
1
+ (window.webpackJsonpapp=window.webpackJsonpapp||[]).push([[1],{3108:function(t,e,s){var i,a;function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}a=window||{},void 0===(i=function(){return function(t){var e,s,i="http://www.w3.org/2000/svg",a="",n=!0,h=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),o=(Math.round,Math.pow),l=Math.sqrt,p=(Math.abs,Math.floor),f=(Math.max,Math.min),m={};(function(){var t,e=Object.getOwnPropertyNames(Math),s=e.length;for(t=0;t<s;t+=1)m[e[t]]=Math[e[t]]})(),m.random=Math.random,m.abs=function(t){if("object"===r(t)&&t.length){var e,s=Array.apply(null,{length:t.length}),i=t.length;for(e=0;e<i;e+=1)s[e]=Math.abs(t[e]);return s}return Math.abs(t)};var d=150,c=Math.PI/180;function u(t){s=t?Math.round:function(t){return t}}function g(t){return Math.round(1e4*t)/1e4}function y(t,e,s,i){this.type=t,this.currentTime=e,this.totalTime=s,this.direction=i<0?-1:1}function v(t,e){this.type=t,this.direction=e<0?-1:1}function b(t,e,s,i){this.type=t,this.currentLoop=e,this.totalLoops=s,this.direction=i<0?-1:1}function k(t,e,s){this.type=t,this.firstFrame=e,this.totalFrames=s}function A(t,e){this.type=t,this.target=e}function P(t,e){var s;void 0===e&&(e="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890");var i="";for(s=t;s>0;--s)i+=e[Math.round(Math.random()*(e.length-1))];return i}function E(t,e,s){var i,a,r,n,h,o,l,p;switch(1===arguments.length&&(e=t.s,s=t.v,t=t.h),o=s*(1-e),l=s*(1-(h=6*t-(n=Math.floor(6*t)))*e),p=s*(1-(1-h)*e),n%6){case 0:i=s,a=p,r=o;break;case 1:i=l,a=s,r=o;break;case 2:i=o,a=s,r=p;break;case 3:i=o,a=l,r=s;break;case 4:i=p,a=o,r=s;break;case 5:i=s,a=o,r=l}return[i,a,r]}function M(t,e,s){1===arguments.length&&(e=t.g,s=t.b,t=t.r);var i,a=Math.max(t,e,s),r=Math.min(t,e,s),n=a-r,h=0===a?0:n/a,o=a/255;switch(a){case r:i=0;break;case t:i=e-s+n*(e<s?6:0),i/=6*n;break;case e:i=s-t+2*n,i/=6*n;break;case s:i=t-e+4*n,i/=6*n}return[i,h,o]}function _(t,e){var s=M(255*t[0],255*t[1],255*t[2]);return s[1]+=e,s[1]>1?s[1]=1:s[1]<=0&&(s[1]=0),E(s[0],s[1],s[2])}function S(t,e){var s=M(255*t[0],255*t[1],255*t[2]);return s[2]+=e,s[2]>1?s[2]=1:s[2]<0&&(s[2]=0),E(s[0],s[1],s[2])}function F(t,e){var s=M(255*t[0],255*t[1],255*t[2]);return s[0]+=e/360,s[0]>1?s[0]-=1:s[0]<0&&(s[0]+=1),E(s[0],s[1],s[2])}u(!1);var w=function(){var t,e,s=[];for(t=0;t<256;t+=1)e=t.toString(16),s[t]=1==e.length?"0"+e:e;return function(t,e,i){return t<0&&(t=0),e<0&&(e=0),i<0&&(i=0),"#"+s[t]+s[e]+s[i]}}();
2
2
  /*!
3
3
  Transformation Matrix v2.0
4
4
  (c) Epistemex 2014-2015
package/index.d.ts CHANGED
@@ -1,8 +1,5 @@
1
- import { EToolType } from '@qunhe/custom-miniapp-sdk';
1
+ import { ELineType as ELineType_2 } from '@manycore/custom-miniapp-sdk';
2
2
  import { IExportModelData } from '@manycore/custom-miniapp-sdk';
3
- import { ITopParamModelDataResponse } from '@qunhe/custom-miniapp-sdk';
4
- import { ITopParamModelList } from '@qunhe/custom-miniapp-sdk';
5
- import { ITopParamModelListOption } from '@qunhe/custom-miniapp-sdk';
6
3
  import { Number3 } from '@manycore/custom-miniapp-sdk';
7
4
 
8
5
  export declare class Application {
@@ -57,10 +54,28 @@ export declare enum EFittingType {
57
54
  * 五金
58
55
  */
59
56
  HARDWARE = 3,
57
+ /**
58
+ * 五金槽
59
+ */
60
+ HARDWARE_GROOVE = 4,
60
61
  /**
61
62
  * 交接面信息
62
63
  */
63
- INTERSECTED = 4
64
+ INTERSECTED = "intersected"
65
+ }
66
+
67
+ /**
68
+ * 交接信息的产生方式
69
+ */
70
+ export declare enum EIntersectedCreatedType {
71
+ /**
72
+ * 板与板之间产生的交界
73
+ */
74
+ BOTH_PLANK = 0,
75
+ /**
76
+ * 板与五金之间产生的交界信息
77
+ */
78
+ PLANK_FURNITURE = 1
64
79
  }
65
80
 
66
81
  /**
@@ -92,6 +107,46 @@ export declare enum ELanguage {
92
107
  VI = "vi"
93
108
  }
94
109
 
110
+ /**
111
+ * 线的类型
112
+ */
113
+ export declare enum ELineType {
114
+ /**
115
+ * 直线
116
+ */
117
+ SEGMENT = 0,
118
+ /**
119
+ * 圆弧
120
+ */
121
+ CIRCLE_ARC = 1,
122
+ /**
123
+ * 椭圆
124
+ */
125
+ ELLIPSE_ARC = 3
126
+ }
127
+
128
+ /**
129
+ * 点的类型
130
+ */
131
+ export declare enum EPointType {
132
+ /**
133
+ * 普通点
134
+ */
135
+ NONE = 0,
136
+ /**
137
+ * 倒圆
138
+ */
139
+ CIRCLE = 1,
140
+ /**
141
+ * 倒角
142
+ */
143
+ LINE = 2,
144
+ /**
145
+ * 切圆,就是内挖一个倒圆的形状
146
+ */
147
+ CUT_CIRCLE = 3
148
+ }
149
+
95
150
  export declare enum ESelectedType {
96
151
  /**
97
152
  * 未选中模型
@@ -107,7 +162,35 @@ export declare enum ESelectedType {
107
162
  CASBIN = 2
108
163
  }
109
164
 
110
- export { EToolType }
165
+ /**
166
+ * 定制行业工具线
167
+ */
168
+ export declare enum EToolType {
169
+ /**
170
+ * 定制厨卫
171
+ */
172
+ CABINET = "CABINET",
173
+ /**
174
+ * 定制家居
175
+ */
176
+ WARDROBE = "WARDROBE",
177
+ /**
178
+ * 定制门窗
179
+ */
180
+ DOOR_WINDOW = "DW",
181
+ /**
182
+ * 定制厨卫副本工具线
183
+ */
184
+ CABINET_COPY = "CABINET_COPY",
185
+ /**
186
+ * 定制家居副本工具线
187
+ */
188
+ WARDROBE_COPY = "WARDROBE_COPY",
189
+ /**
190
+ * 定制门窗副本工具线
191
+ */
192
+ DOOR_WINDOW_COPY = "DW_COPY"
193
+ }
111
194
 
112
195
  export declare class FittingDesignService extends BaseService {
113
196
  /**
@@ -120,14 +203,26 @@ export declare class FittingDesignService extends BaseService {
120
203
  * 是否开启了自动保存功能
121
204
  */
122
205
  isAutoSave(): boolean;
206
+ /**
207
+ * 获取孔/槽方案数据
208
+ * @param modelId
209
+ */
210
+ getFittingDesignDesign(modelId?: string): Promise<IFittingDesignData | null>;
123
211
  /**
124
212
  *
125
- * 槽方案数据
213
+ * 孔槽方案数据
126
214
  *
127
215
  * @param modelid 模型ID,如果为空时,则表示传递的为查询当前模型的数据
128
216
  * @param casbin 是否为五金,当modelid为五金的id时,需要为true
129
217
  */
130
218
  getConnectedFittingDesign(modelid?: string, casbin?: boolean): Promise<IFittingDesignData | null>;
219
+ /**
220
+ * 简单的路径验证
221
+ *
222
+ * @param path
223
+ * @param linkModelId
224
+ */
225
+ validateFittingDesign(path: IHardwareGrooveData, linkModelId: string): IFittingDesignValidateResult;
131
226
  /**
132
227
  * 往当前方案中,新增孔/槽数据
133
228
  *
@@ -173,15 +268,24 @@ export declare class FittingDesignService extends BaseService {
173
268
  /**
174
269
  * 附加通用参数
175
270
  */
176
- params?: EFittingParametersType[];
271
+ params?: IBaseFittingParameters[];
177
272
  }
178
273
 
179
274
  /**
180
275
  * 附加通用参数存储
181
276
  */
182
277
  export declare interface IBaseFittingParameters {
278
+ /**
279
+ * 通用参数的key
280
+ */
183
281
  key: string;
282
+ /**
283
+ * 通用参数的value
284
+ */
184
285
  value: string;
286
+ /**
287
+ * 当前value值的数据类型
288
+ */
185
289
  type: string;
186
290
  }
187
291
 
@@ -233,7 +337,7 @@ export declare class FittingDesignService extends BaseService {
233
337
  */
234
338
  shell?: string;
235
339
  /**
236
- * 交接体版面是否需要开槽
340
+ * 交接体板面是否需要开槽
237
341
  */
238
342
  needGroove?: boolean;
239
343
  }
@@ -272,6 +376,17 @@ export declare class FittingDesignService extends BaseService {
272
376
  * 五金数据
273
377
  */
274
378
  hardwares: IFittingHardwareCollect;
379
+ /**
380
+ * 五金槽数据
381
+ */
382
+ hardwareGrooves: IFittingHardwareGrooves;
383
+ }
384
+
385
+ export declare interface IFittingDesignValidateResult {
386
+ /**
387
+ * 是否验证通过
388
+ */
389
+ validated: boolean;
275
390
  }
276
391
 
277
392
  /**
@@ -284,6 +399,11 @@ export declare class FittingDesignService extends BaseService {
284
399
  */
285
400
  export declare type IFittingHardwareCollect = Record<string, IHardwareData[]>;
286
401
 
402
+ /**
403
+ * 五金槽数据
404
+ */
405
+ export declare type IFittingHardwareGrooves = Record<string, IHardwareGrooveData[]>;
406
+
287
407
  /**
288
408
  * 方案中,所有孔的数据
289
409
  */
@@ -319,6 +439,28 @@ export declare class FittingDesignService extends BaseService {
319
439
  linkedIds: string[];
320
440
  }
321
441
 
442
+ /**
443
+ * 闭合路径中的点,需要按逆时针顺序上传,否则会导致异常
444
+ */
445
+ export declare interface IHardwareGrooveData extends IBaseFittingData {
446
+ /**
447
+ * 槽的深度
448
+ */
449
+ depth: number;
450
+ /**
451
+ * 所处的板面
452
+ */
453
+ plankFaceId: number;
454
+ /**
455
+ * 闭合路径的所有点
456
+ */
457
+ points: IPointData[];
458
+ /**
459
+ * 闭合路径的所有线
460
+ */
461
+ lines: ILineData[];
462
+ }
463
+
322
464
  export declare interface IHoleData extends IBaseHoleGrooveData {
323
465
  /**
324
466
  * 孔直径
@@ -331,6 +473,10 @@ export declare class FittingDesignService extends BaseService {
331
473
  * 交接面ID
332
474
  */
333
475
  id: string;
476
+ /**
477
+ * 交接信息产生的方式
478
+ */
479
+ intersectType: EIntersectedCreatedType;
334
480
  /**
335
481
  * 交接面信息
336
482
  */
@@ -344,6 +490,34 @@ export declare class FittingDesignService extends BaseService {
344
490
  intersectedGroups: IIntersectedGroup[];
345
491
  }
346
492
 
493
+ export declare type ILineData = ILineDataBase | ILineDataCircle;
494
+
495
+ export declare interface ILineDataBase {
496
+ /**
497
+ * 线条类型
498
+ */
499
+ type: ELineType_2.SEGMENT;
500
+ }
501
+
502
+ export declare interface ILineDataCircle {
503
+ /**
504
+ * 线条类型
505
+ */
506
+ type: ELineType_2.CIRCLE_ARC;
507
+ /**
508
+ * 是否顺时针
509
+ */
510
+ clockwise: boolean;
511
+ /**
512
+ * 优弧劣弧 (只有弧线有)
513
+ */
514
+ minorArc: boolean;
515
+ /**
516
+ * 半径 (只有弧线有)
517
+ */
518
+ radius: number;
519
+ }
520
+
347
521
  export declare class IntersectedService extends BaseService {
348
522
  /**
349
523
  * 是否显示交接面信息
@@ -365,6 +539,99 @@ export declare class FittingDesignService extends BaseService {
365
539
  z: number;
366
540
  }
367
541
 
542
+ /**
543
+ * 点的基本类型
544
+ */
545
+ export declare interface IPointBase {
546
+ type: EPointType;
547
+ /**
548
+ * 点的位置
549
+ *
550
+ * @example
551
+ * "123,-345"
552
+ */
553
+ position: Number3;
554
+ }
555
+
556
+ /**
557
+ * 点的类型参数
558
+ */
559
+ export declare type IPointData = IPointWithNone | IPointWithLine | IPointWithCircle | IPointWithCutCircle;
560
+
561
+ /**
562
+ * 倒圆
563
+ */
564
+ export declare interface IPointWithCircle extends IPointBase {
565
+ /**
566
+ * 切角类型
567
+ */
568
+ type: EPointType.CIRCLE;
569
+ /**
570
+ * 切角边边距
571
+ */
572
+ /**
573
+ * 半径 (倒圆切圆专用)
574
+ * @example
575
+ * "345.12"
576
+ */
577
+ radius: number;
578
+ }
579
+
580
+ /**
581
+ * 切圆(就是内挖一个倒圆的形状)
582
+ */
583
+ export declare interface IPointWithCutCircle extends Omit<IPointWithCircle, 'type'> {
584
+ type: EPointType.CUT_CIRCLE;
585
+ /**
586
+ * 是否顺时针
587
+ * 未设置时,则为false
588
+ */
589
+ clockwise: boolean;
590
+ }
591
+
592
+ /**
593
+ * 切角
594
+ */
595
+ export declare interface IPointWithLine extends IPointBase {
596
+ /**
597
+ * 切角类型
598
+ */
599
+ type: EPointType.LINE;
600
+ /**
601
+ * 切角边边距
602
+ */
603
+ cornerCutDistance: [number, number];
604
+ }
605
+
606
+ /**
607
+ * 普通点类型
608
+ */
609
+ export declare interface IPointWithNone extends IPointBase {
610
+ /**
611
+ * 普通点
612
+ */
613
+ type: EPointType.NONE;
614
+ /**
615
+ * 是否顺时针
616
+ * 未设置时,则为false
617
+ */
618
+ clockwise?: boolean;
619
+ }
620
+
621
+ /**
622
+ * 房间信息
623
+ */
624
+ declare interface IRoomInfo {
625
+ /**
626
+ * 所属房间ID
627
+ */
628
+ roomId?: string;
629
+ /**
630
+ * 所属房间名
631
+ */
632
+ roomName?: string;
633
+ }
634
+
368
635
  export declare interface ISelected {
369
636
  data: IExportModelData[] | IHardwareData[];
370
637
  type: ESelectedType;
@@ -382,6 +649,14 @@ export declare class FittingDesignService extends BaseService {
382
649
  * 交接体展示时,使用的颜色
383
650
  */
384
651
  intersectedBodyColor: number;
652
+ /**
653
+ * 五金与柜体之间,交接面产生的颜色
654
+ */
655
+ grooveIntersectedColor: number;
656
+ /**
657
+ * 五金与柜体之间,交接体产生的颜色
658
+ */
659
+ grooveIntersectedBodyColor: number;
385
660
  /**
386
661
  * 孔展示
387
662
  */
@@ -398,14 +673,89 @@ export declare class FittingDesignService extends BaseService {
398
673
  * 默认为false
399
674
  */
400
675
  references?: boolean;
401
- plankFaceIds?: number[];
676
+ plankFaceIds?: Array<number | null>;
402
677
  }
403
678
 
404
- export { ITopParamModelDataResponse }
679
+ /**
680
+ * 获取顶层模型返回值
681
+ */
682
+ export declare interface ITopParamModelDataResponse {
683
+ /**
684
+ * 当前查询总数
685
+ */
686
+ count: number;
687
+ /**
688
+ * 当前页码
689
+ */
690
+ currPage: number;
691
+ /**
692
+ * 是否还有可查询的结果
693
+ */
694
+ hasMore: boolean;
695
+ /**
696
+ * 查询的顶层模型结果
697
+ */
698
+ result: ITopParamModelList[];
699
+ /**
700
+ * 总的页数
701
+ */
702
+ totalPage: number;
703
+ }
405
704
 
406
- export { ITopParamModelList }
705
+ /**
706
+ * 顶层模型信息
707
+ */
708
+ export declare interface ITopParamModelList {
709
+ /**
710
+ * 模型ID
711
+ */
712
+ id: string;
713
+ /**
714
+ * 所属工具线
715
+ */
716
+ toolType: EToolType;
717
+ /**
718
+ * 模型名称
719
+ */
720
+ name: string;
721
+ /**
722
+ * 户型信息
723
+ */
724
+ roomInfo: IRoomInfo;
725
+ /**
726
+ * 模型是否已拆单
727
+ */
728
+ isSplit: boolean;
729
+ /**
730
+ * 模型是否锁定
731
+ */
732
+ isLocked: boolean;
733
+ /**
734
+ * 模型是否隐藏
735
+ */
736
+ isHidden: boolean;
737
+ /**
738
+ * 模型是否提审
739
+ */
740
+ isAudited: boolean;
741
+ }
407
742
 
408
- export { ITopParamModelListOption }
743
+ /**
744
+ * 获取顶层模型参数
745
+ */
746
+ export declare interface ITopParamModelListOption {
747
+ /**
748
+ * 第几页
749
+ * page 默认为 1
750
+ */
751
+ pageSize?: number;
752
+ /**
753
+ * 每页模型数量
754
+ * size 默认为 20
755
+ * 最大值为 500
756
+ */
757
+ pageNum?: number;
758
+ }
409
759
 
410
760
  export declare class ModelService extends BaseService {
411
761
  /**