@etsoo/appscript 1.2.21 → 1.2.25

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 (41) hide show
  1. package/__tests__/app/CoreApp.ts +15 -0
  2. package/lib/cjs/app/CoreApp.d.ts +27 -0
  3. package/lib/cjs/app/CoreApp.js +20 -0
  4. package/lib/cjs/business/BusinessUtils.d.ts +21 -2
  5. package/lib/cjs/business/BusinessUtils.js +32 -6
  6. package/lib/cjs/business/EntityStatus.d.ts +1 -0
  7. package/lib/cjs/business/EntityStatus.js +1 -0
  8. package/lib/cjs/business/ProductUnit.d.ts +47 -45
  9. package/lib/cjs/business/ProductUnit.js +36 -48
  10. package/lib/cjs/business/RepeatOption.d.ts +56 -0
  11. package/lib/cjs/business/RepeatOption.js +60 -0
  12. package/lib/cjs/i18n/en-US.json +24 -0
  13. package/lib/cjs/i18n/zh-CN.json +26 -1
  14. package/lib/cjs/i18n/zh-HK.json +25 -1
  15. package/lib/cjs/index.d.ts +1 -0
  16. package/lib/cjs/index.js +1 -0
  17. package/lib/mjs/app/CoreApp.d.ts +27 -0
  18. package/lib/mjs/app/CoreApp.js +20 -0
  19. package/lib/mjs/business/BusinessUtils.d.ts +21 -2
  20. package/lib/mjs/business/BusinessUtils.js +32 -6
  21. package/lib/mjs/business/EntityStatus.d.ts +1 -0
  22. package/lib/mjs/business/EntityStatus.js +1 -0
  23. package/lib/mjs/business/ProductUnit.d.ts +47 -45
  24. package/lib/mjs/business/ProductUnit.js +35 -47
  25. package/lib/mjs/business/RepeatOption.d.ts +56 -0
  26. package/lib/mjs/business/RepeatOption.js +57 -0
  27. package/lib/mjs/i18n/en-US.json +24 -0
  28. package/lib/mjs/i18n/zh-CN.json +26 -1
  29. package/lib/mjs/i18n/zh-HK.json +25 -1
  30. package/lib/mjs/index.d.ts +1 -0
  31. package/lib/mjs/index.js +1 -0
  32. package/package.json +10 -10
  33. package/src/app/CoreApp.ts +37 -0
  34. package/src/business/BusinessUtils.ts +66 -7
  35. package/src/business/EntityStatus.ts +1 -0
  36. package/src/business/ProductUnit.ts +35 -51
  37. package/src/business/RepeatOption.ts +65 -0
  38. package/src/i18n/en-US.json +24 -0
  39. package/src/i18n/zh-CN.json +26 -1
  40. package/src/i18n/zh-HK.json +25 -1
  41. package/src/index.ts +1 -0
@@ -12,12 +12,13 @@
12
12
  "creation": "登记时间",
13
13
  "currency": "币种",
14
14
  "delete": "删除",
15
+ "deleteConfirm": "确定要永久删除此{0}吗?",
15
16
  "description": "描述",
16
17
  "done": "完成",
17
18
  "edit": "修改",
18
19
  "email": "电子邮箱",
19
20
  "emailAddresses": "电子邮箱",
20
- "enabled": "启用",
21
+ "enabled": "已启用",
21
22
  "etsoo": "亿速思维",
22
23
  "expiry": "到期时间",
23
24
  "failed": "操作失败",
@@ -43,6 +44,7 @@
43
44
  "pageNotFound": "找不到页面",
44
45
  "prompt": "输入",
45
46
  "pullToRefresh": "下拉刷新",
47
+ "record": "记录",
46
48
  "refresh": "刷新",
47
49
  "refreshing": "正在刷新",
48
50
  "releaseToRefresh": "释放刷新",
@@ -63,13 +65,36 @@
63
65
  "showIt": "显示",
64
66
  "signout": "退出",
65
67
  "smartERP": "司友云ERP",
68
+ "sortTip": "拖拽项目进行排序",
66
69
  "status": "状态",
70
+ "statusArchived": "已归档",
71
+ "statusDeleted": "已删除",
72
+ "statusFlaged": "已标记",
73
+ "statusNormal": "正常",
74
+ "statusInactivated": "已停用",
67
75
  "submit": "提交",
68
76
  "success": "成功",
69
77
  "timeDifferenceInvalid": "设备时间和服务器时间差为{0},超过{1}秒的限制,请调整设备时间,如果异常请告知管理员",
70
78
  "tokenExpiry": "您的会话即将过期。点击 取消 按钮继续使用",
71
79
  "yes": "是",
72
80
  "unknownError": "未知错误",
81
+ "unitJoin": "每{0}",
82
+ "unitPC": "件",
83
+ "unitSET": "套",
84
+ "unitHOUR": "小时",
85
+ "unitDAY": "天",
86
+ "unitYEAR": "年",
87
+ "unitWEEK": "周",
88
+ "unitFORTNIGHT": "两周",
89
+ "unitFOURWEEK": "四周",
90
+ "unitMONTH": "月",
91
+ "unitBIMONTH": "两月",
92
+ "unitQUATER": "季度",
93
+ "unitHALFYEAR": "半年",
94
+ "unitGRAM": "克",
95
+ "unitJIN": "斤",
96
+ "unitKILOGRAM": "公斤",
97
+ "unitTON": "吨",
73
98
  "warning": "警告",
74
99
  "welcome": "{0}, 欢迎光临!"
75
100
  }
@@ -12,12 +12,13 @@
12
12
  "creation": "登記時間",
13
13
  "currency": "幣種",
14
14
  "delete": "刪除",
15
+ "deleteConfirm": "確定要永久刪除此{0}嗎?",
15
16
  "description": "描述",
16
17
  "done": "完成",
17
18
  "edit": "修改",
18
19
  "email": "電子郵箱",
19
20
  "emailAddresses": "電子郵箱",
20
- "enabled": "啟用",
21
+ "enabled": "已啟用",
21
22
  "etsoo": "億速思維",
22
23
  "expiry": "到期時間",
23
24
  "failed": "操作失敗",
@@ -43,6 +44,7 @@
43
44
  "pageNotFound": "找不到頁面",
44
45
  "prompt": "輸入",
45
46
  "pullToRefresh": "下拉刷新",
47
+ "record": "記錄",
46
48
  "refresh": "刷新",
47
49
  "refreshing": "正在刷新",
48
50
  "releaseToRefresh": "釋放刷新",
@@ -63,13 +65,35 @@
63
65
  "showIt": "顯示",
64
66
  "signout": "退出",
65
67
  "smartERP": "司友雲ERP",
68
+ "sortTip": "拖拽項目進行排序",
66
69
  "status": "狀態",
70
+ "statusArchived": "已歸檔",
71
+ "statusDeleted": "已刪除",
72
+ "statusFlaged": "已標記",
73
+ "statusNormal": "正常",
74
+ "statusInactivated": "已停用",
67
75
  "submit": "提交",
68
76
  "success": "成功",
69
77
  "timeDifferenceInvalid": "設備時間和服務器時間差為{0},超過{1}秒的限制,請調整設備時間,如果異常請告知管理員",
70
78
  "tokenExpiry": "您的會話即將過期。點擊 取消 按鈕繼續使用",
71
79
  "yes": "是",
72
80
  "unknownError": "未知錯誤",
81
+ "unitJoin": "每{0}",
82
+ "unitPC": "件",
83
+ "unitSET": "套",
84
+ "unitHOUR": "小時",
85
+ "unitDAY": "天",
86
+ "unitYEAR": "年",
87
+ "unitWEEK": "週",
88
+ "unitFORTNIGHT": "兩週",
89
+ "unitFOURWEEK": "四周",
90
+ "unitMONTH": "月",
91
+ "unitBIMONTH": "兩月",
92
+ "unitQUATER": "季度",
93
+ "unitHALFYEAR": "半年",
94
+ "unitGRAM": "克",
95
+ "unitJIN": "斤",
96
+ "unitKILOGRAM": "公斤",
73
97
  "warning": "警告",
74
98
  "welcome": "{0}, 歡迎光臨!"
75
99
  }
@@ -12,6 +12,7 @@ export * from './business/BusinessTax';
12
12
  export * from './business/BusinessUtils';
13
13
  export * from './business/EntityStatus';
14
14
  export * from './business/ProductUnit';
15
+ export * from './business/RepeatOption';
15
16
  export * from './def/ListItem';
16
17
  export * from './dto/IdDto';
17
18
  export * from './dto/IdLabelDto';
package/lib/cjs/index.js CHANGED
@@ -29,6 +29,7 @@ __exportStar(require("./business/BusinessTax"), exports);
29
29
  __exportStar(require("./business/BusinessUtils"), exports);
30
30
  __exportStar(require("./business/EntityStatus"), exports);
31
31
  __exportStar(require("./business/ProductUnit"), exports);
32
+ __exportStar(require("./business/RepeatOption"), exports);
32
33
  // def
33
34
  __exportStar(require("./def/ListItem"), exports);
34
35
  // dto
@@ -2,6 +2,7 @@ import { INotifier, NotificationAlign, NotificationCallProps, NotificationConten
2
2
  import { ApiDataError, IApi, IPData } from '@etsoo/restclient';
3
3
  import { DataTypes, DateUtils, IStorage } from '@etsoo/shared';
4
4
  import { AddressRegion } from '../address/AddressRegion';
5
+ import { ProductUnit } from '../business/ProductUnit';
5
6
  import { IdLabelDto } from '../dto/IdLabelDto';
6
7
  import { InitCallDto } from '../dto/InitCallDto';
7
8
  import { IActionResult } from '../result/IActionResult';
@@ -232,6 +233,13 @@ export interface ICoreApp<S extends IAppSettings, N, C extends NotificationCallP
232
233
  * @returns Cached token
233
234
  */
234
235
  getCacheToken(): string | undefined;
236
+ /**
237
+ * Get entity status label
238
+ * @param data Input data
239
+ */
240
+ getEntityStatusLabel<D extends {
241
+ entityStatus?: number;
242
+ }>(data: D): string;
235
243
  /**
236
244
  * Get all regions
237
245
  * @returns Regions
@@ -248,6 +256,12 @@ export interface ICoreApp<S extends IAppSettings, N, C extends NotificationCallP
248
256
  * @returns Time zone
249
257
  */
250
258
  getTimeZone(): string | undefined;
259
+ /**
260
+ * Get product unit and repeat option label
261
+ * @param unit Product unit or repeat option
262
+ * @param isJoined Add the join label like 'per Kg' for Kg
263
+ */
264
+ getUnitLabel(unit?: ProductUnit, isJoined?: boolean): string;
251
265
  /**
252
266
  * Hash message, SHA3 or HmacSHA512, 512 as Base64
253
267
  * https://cryptojs.gitbook.io/docs/
@@ -621,6 +635,13 @@ export declare abstract class CoreApp<S extends IAppSettings, N, C extends Notif
621
635
  * @returns Regions
622
636
  */
623
637
  getRegions(): AddressRegion[];
638
+ /**
639
+ * Get entity status label
640
+ * @param data Input data
641
+ */
642
+ getEntityStatusLabel<D extends {
643
+ entityStatus?: number;
644
+ }>(data: D): string;
624
645
  /**
625
646
  * Get refresh token from response headers
626
647
  * @param rawResponse Raw response from API call
@@ -632,6 +653,12 @@ export declare abstract class CoreApp<S extends IAppSettings, N, C extends Notif
632
653
  * @returns Time zone
633
654
  */
634
655
  getTimeZone(): string | undefined;
656
+ /**
657
+ * Get product unit and repeat option label
658
+ * @param unit Product unit or repeat option
659
+ * @param isJoined Add the join label like 'per Kg' for Kg
660
+ */
661
+ getUnitLabel(unit?: ProductUnit, isJoined?: boolean): string;
635
662
  /**
636
663
  * Hash message, SHA3 or HmacSHA512, 512 as Base64
637
664
  * https://cryptojs.gitbook.io/docs/
@@ -4,6 +4,7 @@ import { DateUtils, DomUtils, NumberUtils, Utils } from '@etsoo/shared';
4
4
  import { AES, algo, enc, HmacSHA512, lib, mode, pad, PBKDF2, SHA3 } from 'crypto-js';
5
5
  import { AddressRegion } from '../address/AddressRegion';
6
6
  import { AddressUtils } from '../address/AddressUtils';
7
+ import { BusinessUtils } from '../business/BusinessUtils';
7
8
  import { ActionResultError } from '../result/ActionResultError';
8
9
  /**
9
10
  * Core application
@@ -712,6 +713,15 @@ export class CoreApp {
712
713
  return AddressRegion.getById(id);
713
714
  });
714
715
  }
716
+ /**
717
+ * Get entity status label
718
+ * @param data Input data
719
+ */
720
+ getEntityStatusLabel(data) {
721
+ if (data == null || data.entityStatus == null)
722
+ return '';
723
+ return BusinessUtils.getEntityStatusLabel(data.entityStatus, this.labelDelegate);
724
+ }
715
725
  /**
716
726
  * Get refresh token from response headers
717
727
  * @param rawResponse Raw response from API call
@@ -730,6 +740,16 @@ export class CoreApp {
730
740
  // settings.timeZone = Utils.getTimeZone()
731
741
  return (_a = this.settings.timeZone) !== null && _a !== void 0 ? _a : (_b = this.ipData) === null || _b === void 0 ? void 0 : _b.timezone;
732
742
  }
743
+ /**
744
+ * Get product unit and repeat option label
745
+ * @param unit Product unit or repeat option
746
+ * @param isJoined Add the join label like 'per Kg' for Kg
747
+ */
748
+ getUnitLabel(unit, isJoined) {
749
+ if (unit == null)
750
+ return '';
751
+ return BusinessUtils.getUnitLabel(unit, this.labelDelegate, isJoined);
752
+ }
733
753
  /**
734
754
  * Hash message, SHA3 or HmacSHA512, 512 as Base64
735
755
  * https://cryptojs.gitbook.io/docs/
@@ -16,7 +16,7 @@ export declare namespace BusinessUtils {
16
16
  function addIdLabelBlankItem<T extends DataTypes.IdType = number>(input: IdLabelDto<T>[], copy?: boolean): IdLabelDto<T>[];
17
17
  /**
18
18
  * Get product unit's label
19
- * Please define the label in culture with key 'unitPC' for ProductUnit.PC like that
19
+ * Please define the label in culture with key 'statusNormal' for Normal status
20
20
  * @param unit Unit
21
21
  * @param func Label delegate
22
22
  * @returns Label
@@ -38,13 +38,32 @@ export declare namespace BusinessUtils {
38
38
  * Please define the label in culture with key 'unitPC' for ProductUnit.PC like that
39
39
  * @param unit Unit
40
40
  * @param func Label delegate
41
+ * @param isJoined Add the join label like 'per Kg' for Kg
41
42
  * @returns Label
42
43
  */
43
- function getUnitLabel(unit: ProductUnit, func: ICultureGet): string;
44
+ function getUnitLabel(unit: ProductUnit, func: ICultureGet, isJoined?: boolean): string;
44
45
  /**
45
46
  * Get all product units
46
47
  * @param func Label delegate
47
48
  * @returns Units
48
49
  */
49
50
  function getUnits(func: ICultureGet): IdLabelDto[];
51
+ /**
52
+ *
53
+ * Get all product units
54
+ * @param func Label delegate
55
+ * @param options Define the order and limit the items
56
+ * @param isJoined Add the join label like 'per Kg' for Kg
57
+ * @returns Units
58
+ */
59
+ function getUnits(func: ICultureGet, options?: string[], isJoined?: boolean): IdLabelDto[];
60
+ /**
61
+ *
62
+ * Get all repeat options
63
+ * @param func Label delegate
64
+ * @param options Define the order and limit the items
65
+ * @param isJoined Add the join label like 'per Kg' for Kg
66
+ * @returns Units
67
+ */
68
+ function getRepeatOptions(func: ICultureGet, options?: string[], isJoined?: boolean): IdLabelDto[];
50
69
  }
@@ -1,4 +1,5 @@
1
1
  import { DataTypes } from '@etsoo/shared';
2
+ import { RepeatOption } from '..';
2
3
  import { EntityStatus } from './EntityStatus';
3
4
  import { ProductUnit } from './ProductUnit';
4
5
  /**
@@ -22,7 +23,7 @@ export var BusinessUtils;
22
23
  BusinessUtils.addIdLabelBlankItem = addIdLabelBlankItem;
23
24
  /**
24
25
  * Get product unit's label
25
- * Please define the label in culture with key 'unitPC' for ProductUnit.PC like that
26
+ * Please define the label in culture with key 'statusNormal' for Normal status
26
27
  * @param unit Unit
27
28
  * @param func Label delegate
28
29
  * @returns Label
@@ -55,27 +56,52 @@ export var BusinessUtils;
55
56
  * Please define the label in culture with key 'unitPC' for ProductUnit.PC like that
56
57
  * @param unit Unit
57
58
  * @param func Label delegate
59
+ * @param isJoined Add the join label like 'per Kg' for Kg
58
60
  * @returns Label
59
61
  */
60
- function getUnitLabel(unit, func) {
62
+ function getUnitLabel(unit, func, isJoined) {
61
63
  var _a;
62
64
  const key = ProductUnit[unit];
63
- return (_a = func('unit' + key)) !== null && _a !== void 0 ? _a : key;
65
+ const label = (_a = func('unit' + key)) !== null && _a !== void 0 ? _a : key;
66
+ if (isJoined) {
67
+ const jLabel = func('unitJoin');
68
+ if (jLabel)
69
+ return jLabel.format(label);
70
+ }
71
+ return label;
64
72
  }
65
73
  BusinessUtils.getUnitLabel = getUnitLabel;
66
74
  /**
75
+ *
67
76
  * Get all product units
68
77
  * @param func Label delegate
78
+ * @param options Define the order and limit the items
79
+ * @param isJoined Add the join label like 'per Kg' for Kg
69
80
  * @returns Units
70
81
  */
71
- function getUnits(func) {
72
- return DataTypes.getEnumKeys(ProductUnit).map((key) => {
82
+ function getUnits(func, options, isJoined) {
83
+ options !== null && options !== void 0 ? options : (options = DataTypes.getEnumKeys(ProductUnit));
84
+ return options.map((key) => {
73
85
  const id = DataTypes.getEnumByKey(ProductUnit, key);
74
86
  return {
75
87
  id,
76
- label: getUnitLabel(id, func)
88
+ label: getUnitLabel(id, func, isJoined).formatInitial(true)
77
89
  };
78
90
  });
79
91
  }
80
92
  BusinessUtils.getUnits = getUnits;
93
+ /**
94
+ *
95
+ * Get all repeat options
96
+ * @param func Label delegate
97
+ * @param options Define the order and limit the items
98
+ * @param isJoined Add the join label like 'per Kg' for Kg
99
+ * @returns Units
100
+ */
101
+ function getRepeatOptions(func, options, isJoined = true) {
102
+ options !== null && options !== void 0 ? options : (options = DataTypes.getEnumKeys(RepeatOption));
103
+ isJoined !== null && isJoined !== void 0 ? isJoined : (isJoined = true);
104
+ return getUnits(func, options, isJoined);
105
+ }
106
+ BusinessUtils.getRepeatOptions = getRepeatOptions;
81
107
  })(BusinessUtils || (BusinessUtils = {}));
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * Standard entity status enum
3
3
  * com.etsoo.SmartERP.Dto.EntityStatus
4
+ * Labels also included within i18n
4
5
  */
5
6
  export declare enum EntityStatus {
6
7
  /**
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * Standard entity status enum
3
3
  * com.etsoo.SmartERP.Dto.EntityStatus
4
+ * Labels also included within i18n
4
5
  */
5
6
  export var EntityStatus;
6
7
  (function (EntityStatus) {
@@ -1,66 +1,68 @@
1
+ import { RepeatOption } from './RepeatOption';
1
2
  /**
2
- * Product units enum
3
- * See com.etsoo.CoreFramework.Business.ProductUnit
3
+ * Product base units
4
+ * 1 - 9
4
5
  */
5
- export declare enum ProductUnit {
6
+ export declare enum ProductBaseUnit {
6
7
  /**
7
8
  * Picese
8
9
  * 件
9
10
  */
10
- PC = 0,
11
+ PC = 1,
11
12
  /**
12
13
  * Set
13
14
  * 套
14
15
  */
15
- SET = 1,
16
- /**
17
- * Year
18
- *
19
- */
20
- YEAR = 10,
21
- /**
22
- * Quater
23
- * 季
24
- */
25
- QUATER = 11,
26
- /**
27
- * Month
28
- * 月
29
- */
30
- MONTH = 12,
31
- /**
32
- * Fortnight
33
- * 两周
34
- */
35
- FORNIGHT = 13,
36
- /**
37
- * Week
38
- * 周
39
- */
40
- WEEK = 14,
41
- /**
42
- * Day
43
- * 天
44
- */
45
- DAY = 15,
16
+ SET = 2
17
+ }
18
+ /**
19
+ * Product weight units
20
+ * Range 40 - 49
21
+ */
22
+ export declare enum ProductWeightUnit {
46
23
  /**
47
- * Hour
48
- * 小时
24
+ * Gram
25
+ *
49
26
  */
50
- HOUR = 16,
27
+ GRAM = 40,
51
28
  /**
52
- * Ton
53
- *
29
+ * Half Kg
30
+ *
54
31
  */
55
- TON = 31,
32
+ JIN = 41,
56
33
  /**
57
34
  * Kilogram
58
35
  * 千克
59
36
  */
60
- KILOGRAM = 32,
37
+ KILOGRAM = 42,
61
38
  /**
62
- * Gram
63
- *
39
+ * Ton
40
+ *
64
41
  */
65
- GRAM = 33
42
+ TON = 49
66
43
  }
44
+ /**
45
+ * Product units enum
46
+ * Repeat options take range 10 - 39
47
+ * See com.etsoo.CoreFramework.Business.ProductUnit
48
+ */
49
+ export declare const ProductUnit: {
50
+ [x: number]: string;
51
+ GRAM: ProductWeightUnit.GRAM;
52
+ JIN: ProductWeightUnit.JIN;
53
+ KILOGRAM: ProductWeightUnit.KILOGRAM;
54
+ TON: ProductWeightUnit.TON;
55
+ HOUR: RepeatOption.HOUR;
56
+ DAY: RepeatOption.DAY;
57
+ YEAR: RepeatOption.YEAR;
58
+ WEEK: RepeatOption.WEEK;
59
+ FORTNIGHT: RepeatOption.FORTNIGHT;
60
+ FOURWEEK: RepeatOption.FOURWEEK;
61
+ MONTH: RepeatOption.MONTH;
62
+ BIMONTH: RepeatOption.BIMONTH;
63
+ QUATER: RepeatOption.QUATER;
64
+ HALFYEAR: RepeatOption.HALFYEAR;
65
+ PC: ProductBaseUnit.PC;
66
+ SET: ProductBaseUnit.SET;
67
+ };
68
+ export declare type ProductUnit = ProductBaseUnit | RepeatOption | ProductWeightUnit;
@@ -1,67 +1,55 @@
1
+ import { RepeatOption } from './RepeatOption';
1
2
  /**
2
- * Product units enum
3
- * See com.etsoo.CoreFramework.Business.ProductUnit
3
+ * Product base units
4
+ * 1 - 9
4
5
  */
5
- export var ProductUnit;
6
- (function (ProductUnit) {
6
+ export var ProductBaseUnit;
7
+ (function (ProductBaseUnit) {
7
8
  /**
8
9
  * Picese
9
10
  * 件
10
11
  */
11
- ProductUnit[ProductUnit["PC"] = 0] = "PC";
12
+ ProductBaseUnit[ProductBaseUnit["PC"] = 1] = "PC";
12
13
  /**
13
14
  * Set
14
15
  * 套
15
16
  */
16
- ProductUnit[ProductUnit["SET"] = 1] = "SET";
17
- /**
18
- * Year
19
- *
20
- */
21
- ProductUnit[ProductUnit["YEAR"] = 10] = "YEAR";
22
- /**
23
- * Quater
24
- * 季
25
- */
26
- ProductUnit[ProductUnit["QUATER"] = 11] = "QUATER";
27
- /**
28
- * Month
29
- * 月
30
- */
31
- ProductUnit[ProductUnit["MONTH"] = 12] = "MONTH";
32
- /**
33
- * Fortnight
34
- * 两周
35
- */
36
- ProductUnit[ProductUnit["FORNIGHT"] = 13] = "FORNIGHT";
37
- /**
38
- * Week
39
- * 周
40
- */
41
- ProductUnit[ProductUnit["WEEK"] = 14] = "WEEK";
42
- /**
43
- * Day
44
- * 天
45
- */
46
- ProductUnit[ProductUnit["DAY"] = 15] = "DAY";
17
+ ProductBaseUnit[ProductBaseUnit["SET"] = 2] = "SET";
18
+ })(ProductBaseUnit || (ProductBaseUnit = {}));
19
+ /**
20
+ * Product weight units
21
+ * Range 40 - 49
22
+ */
23
+ export var ProductWeightUnit;
24
+ (function (ProductWeightUnit) {
47
25
  /**
48
- * Hour
49
- * 小时
26
+ * Gram
27
+ *
50
28
  */
51
- ProductUnit[ProductUnit["HOUR"] = 16] = "HOUR";
29
+ ProductWeightUnit[ProductWeightUnit["GRAM"] = 40] = "GRAM";
52
30
  /**
53
- * Ton
54
- *
31
+ * Half Kg
32
+ *
55
33
  */
56
- ProductUnit[ProductUnit["TON"] = 31] = "TON";
34
+ ProductWeightUnit[ProductWeightUnit["JIN"] = 41] = "JIN";
57
35
  /**
58
36
  * Kilogram
59
37
  * 千克
60
38
  */
61
- ProductUnit[ProductUnit["KILOGRAM"] = 32] = "KILOGRAM";
39
+ ProductWeightUnit[ProductWeightUnit["KILOGRAM"] = 42] = "KILOGRAM";
62
40
  /**
63
- * Gram
64
- *
41
+ * Ton
42
+ *
65
43
  */
66
- ProductUnit[ProductUnit["GRAM"] = 33] = "GRAM";
67
- })(ProductUnit || (ProductUnit = {}));
44
+ ProductWeightUnit[ProductWeightUnit["TON"] = 49] = "TON";
45
+ })(ProductWeightUnit || (ProductWeightUnit = {}));
46
+ /**
47
+ * Product units enum
48
+ * Repeat options take range 10 - 39
49
+ * See com.etsoo.CoreFramework.Business.ProductUnit
50
+ */
51
+ export const ProductUnit = {
52
+ ...ProductBaseUnit,
53
+ ...RepeatOption,
54
+ ...ProductWeightUnit
55
+ };
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Repeat options
3
+ * Part of ProductUnit, range 10 - 39
4
+ */
5
+ export declare enum RepeatOption {
6
+ /**
7
+ * Hour
8
+ * 小时
9
+ */
10
+ HOUR = 10,
11
+ /**
12
+ * Day
13
+ * 天
14
+ */
15
+ DAY = 11,
16
+ /**
17
+ * Year
18
+ * 年
19
+ */
20
+ YEAR = 12,
21
+ /**
22
+ * Week
23
+ * 周
24
+ */
25
+ WEEK = 21,
26
+ /**
27
+ * Two weeks
28
+ * 两周
29
+ */
30
+ FORTNIGHT = 22,
31
+ /**
32
+ * Four weeks
33
+ * 四周
34
+ */
35
+ FOURWEEK = 24,
36
+ /**
37
+ * Month
38
+ * 月
39
+ */
40
+ MONTH = 31,
41
+ /**
42
+ * Two months
43
+ * 两月
44
+ */
45
+ BIMONTH = 32,
46
+ /**
47
+ * Quater(3 months)
48
+ * 季(三个月)
49
+ */
50
+ QUATER = 33,
51
+ /**
52
+ * Half a year
53
+ * 半年
54
+ */
55
+ HALFYEAR = 36
56
+ }