@freedom_sky/feige-lib 4.34.0 → 4.36.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.
@@ -1,3 +1,4 @@
1
+ import { LanguageItem } from '../interfaces/common/language.interface';
1
2
  declare class Const {
2
3
  ROLE: {
3
4
  MANAGER: string;
@@ -90,6 +91,18 @@ declare class Const {
90
91
  PEN: string;
91
92
  AED: string;
92
93
  FT: string;
94
+ CHF: string;
95
+ DKK: string;
96
+ INR: string;
97
+ KES: string;
98
+ KRW: string;
99
+ LAK: string;
100
+ MMK: string;
101
+ THB: string;
102
+ TRY: string;
103
+ PLN: string;
104
+ UAH: string;
105
+ BRL: string;
93
106
  };
94
107
  LARGE_CURRENCY: string[];
95
108
  CHINA_TYPE_DISCOUNT_LANGS: string[];
@@ -140,43 +153,7 @@ declare class Const {
140
153
  };
141
154
  };
142
155
  PROBATION: number;
143
- LANGUAGE: ({
144
- name: string;
145
- img: string;
146
- code: string;
147
- speechCode: string;
148
- printCode: string;
149
- dateFormat: string;
150
- defaultAreaCode: string;
151
- speechLang?: undefined;
152
- fontFamily?: undefined;
153
- rtl?: undefined;
154
- defaultEncodeType?: undefined;
155
- } | {
156
- name: string;
157
- img: string;
158
- code: string;
159
- speechCode: string;
160
- speechLang: string;
161
- printCode: string;
162
- fontFamily: string;
163
- dateFormat: string;
164
- defaultAreaCode: string;
165
- rtl: boolean;
166
- defaultEncodeType?: undefined;
167
- } | {
168
- name: string;
169
- img: string;
170
- code: string;
171
- speechCode: string;
172
- printCode: string;
173
- defaultEncodeType: string;
174
- dateFormat: string;
175
- defaultAreaCode: string;
176
- speechLang?: undefined;
177
- fontFamily?: undefined;
178
- rtl?: undefined;
179
- })[];
156
+ LANGUAGE: LanguageItem[];
180
157
  DATE_FORMAT: {
181
158
  YEAR_MONTH_DAY: {
182
159
  dateTime: string;
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ var common_enum_1 = require("../enum/common.enum");
4
+ var printer_enum_1 = require("../enum/printer.enum");
3
5
  var Const = /** @class */ (function () {
4
6
  function Const() {
5
7
  this.ROLE = {
@@ -94,6 +96,18 @@ var Const = /** @class */ (function () {
94
96
  PEN: 'S/. ',
95
97
  AED: 'AED',
96
98
  FT: 'Ft',
99
+ CHF: 'Fr',
100
+ DKK: 'kr',
101
+ INR: '₨',
102
+ KES: 'Sh',
103
+ KRW: '₩',
104
+ LAK: '₭',
105
+ MMK: 'K',
106
+ THB: '฿',
107
+ TRY: '₤',
108
+ PLN: 'zł',
109
+ UAH: '₴',
110
+ BRL: 'R$',
97
111
  };
98
112
  this.LARGE_CURRENCY = ['đ', '¥']; //币值比较大,不需要小数而且需要三位打逗号的货币
99
113
  this.CHINA_TYPE_DISCOUNT_LANGS = ['zh', 'zh-tw']; //以中文习惯打折的语言
@@ -150,27 +164,30 @@ var Const = /** @class */ (function () {
150
164
  img: '',
151
165
  code: 'zh',
152
166
  speechCode: 'zh-CN',
153
- printCode: 'cp936',
154
- dateFormat: 'YEAR_MONTH_DAY',
167
+ dateFormat: common_enum_1.DateFormat.YEAR_MONTH_DAY,
155
168
  defaultAreaCode: '86',
169
+ codepage: 'cp936',
170
+ defaultPrintEncodeType: printer_enum_1.EncodeTypeEnum.CODEPAGE,
156
171
  },
157
172
  {
158
173
  name: 'English',
159
174
  img: '',
160
175
  code: 'en',
161
176
  speechCode: 'en-US',
162
- printCode: 'cp936',
163
- dateFormat: 'DAY_MONTH_YEAR',
177
+ dateFormat: common_enum_1.DateFormat.DAY_MONTH_YEAR,
164
178
  defaultAreaCode: '61',
179
+ codepage: 'pc850',
180
+ defaultPrintEncodeType: printer_enum_1.EncodeTypeEnum.CODEPAGE,
165
181
  },
166
182
  {
167
183
  name: '漢語',
168
184
  img: '',
169
185
  code: 'zh-tw',
170
186
  speechCode: 'zh-tw',
171
- printCode: 'cp936',
172
- dateFormat: 'YEAR_MONTH_DAY',
187
+ dateFormat: common_enum_1.DateFormat.YEAR_MONTH_DAY,
173
188
  defaultAreaCode: '852',
189
+ codepage: 'cp936',
190
+ defaultPrintEncodeType: printer_enum_1.EncodeTypeEnum.CODEPAGE,
174
191
  },
175
192
  {
176
193
  name: 'ئۇيغۇرچە',
@@ -178,84 +195,92 @@ var Const = /** @class */ (function () {
178
195
  code: 'ug',
179
196
  speechCode: 'zh-CN',
180
197
  speechLang: 'zh',
181
- printCode: 'img',
182
198
  fontFamily: 'UG',
183
- dateFormat: 'YEAR_MONTH_DAY_REVERSE',
199
+ dateFormat: common_enum_1.DateFormat.YEAR_MONTH_DAY_REVERSE,
184
200
  defaultAreaCode: '86',
185
201
  rtl: true,
202
+ codepage: 'utf-8',
203
+ defaultPrintEncodeType: printer_enum_1.EncodeTypeEnum.IMG,
186
204
  },
187
205
  {
188
206
  name: 'Tiếng Việt',
189
207
  img: '',
190
208
  code: 'vi',
191
209
  speechCode: 'vi-VN',
192
- printCode: 'cp1258',
193
- defaultEncodeType: 'img',
194
- dateFormat: 'DAY_MONTH_YEAR',
210
+ dateFormat: common_enum_1.DateFormat.DAY_MONTH_YEAR,
195
211
  defaultAreaCode: '84',
212
+ codepage: 'cp1258',
213
+ defaultPrintEncodeType: printer_enum_1.EncodeTypeEnum.IMG,
196
214
  },
197
215
  {
198
216
  name: 'Deutsch',
199
217
  img: '',
200
218
  code: 'de',
201
219
  speechCode: 'de-DE',
202
- printCode: 'img',
203
- dateFormat: 'DAY_MONTH_YEAR',
220
+ dateFormat: common_enum_1.DateFormat.DAY_MONTH_YEAR,
204
221
  defaultAreaCode: '49',
222
+ codepage: 'cp850',
223
+ defaultPrintEncodeType: printer_enum_1.EncodeTypeEnum.IMG,
205
224
  },
206
225
  {
207
226
  name: '日本語',
208
227
  img: '',
209
228
  code: 'ja',
210
229
  speechCode: 'ja-JP',
211
- printCode: 'cp936',
212
- dateFormat: 'YEAR_MONTH_DAY',
230
+ dateFormat: common_enum_1.DateFormat.YEAR_MONTH_DAY,
213
231
  defaultAreaCode: '81',
232
+ codepage: 'cp936',
233
+ defaultPrintEncodeType: printer_enum_1.EncodeTypeEnum.CODEPAGE,
214
234
  },
215
235
  {
216
236
  name: '한국어',
217
237
  img: '',
218
238
  code: 'ko',
219
239
  speechCode: 'ko-KR',
220
- printCode: 'img',
221
- dateFormat: 'YEAR_MONTH_DAY',
240
+ dateFormat: common_enum_1.DateFormat.YEAR_MONTH_DAY,
222
241
  defaultAreaCode: '82',
242
+ codepage: 'cp949',
243
+ defaultPrintEncodeType: printer_enum_1.EncodeTypeEnum.IMG,
223
244
  },
224
245
  {
225
246
  name: 'Español',
226
247
  img: '',
227
248
  code: 'es',
228
249
  speechCode: 'es-ES',
229
- printCode: 'img',
230
- dateFormat: 'YEAR_MONTH_DAY',
250
+ dateFormat: common_enum_1.DateFormat.YEAR_MONTH_DAY,
231
251
  defaultAreaCode: '34',
252
+ codepage: 'cp850',
253
+ defaultPrintEncodeType: printer_enum_1.EncodeTypeEnum.IMG,
232
254
  },
233
255
  {
234
256
  name: 'Português',
235
257
  img: '',
236
258
  code: 'pt',
237
259
  speechCode: 'pt-PT',
238
- printCode: 'img',
239
- dateFormat: 'DAY_MONTH_YEAR',
260
+ dateFormat: common_enum_1.DateFormat.DAY_MONTH_YEAR,
240
261
  defaultAreaCode: '351',
262
+ codepage: 'cp850',
263
+ defaultPrintEncodeType: printer_enum_1.EncodeTypeEnum.IMG,
241
264
  },
242
265
  {
243
266
  name: 'Français',
244
267
  img: '',
245
268
  code: 'fr',
246
269
  speechCode: 'fr-FR',
247
- printCode: 'img',
248
- dateFormat: 'DAY_MONTH_YEAR',
270
+ dateFormat: common_enum_1.DateFormat.DAY_MONTH_YEAR,
249
271
  defaultAreaCode: '33',
272
+ codepage: 'cp850',
273
+ defaultPrintEncodeType: printer_enum_1.EncodeTypeEnum.IMG,
250
274
  },
251
275
  {
252
276
  name: 'Italiano',
253
277
  img: '',
254
278
  code: 'it',
255
279
  speechCode: 'it-IT',
256
- printCode: 'img',
257
- dateFormat: 'DAY_MONTH_YEAR',
280
+ dateFormat: common_enum_1.DateFormat.DAY_MONTH_YEAR,
258
281
  defaultAreaCode: '39',
282
+ codepage: 'cp850',
283
+ defaultPrintEncodeType: printer_enum_1.EncodeTypeEnum.IMG,
259
284
  },
260
285
  ];
261
286
  this.DATE_FORMAT = {
@@ -7,3 +7,8 @@ export declare enum WeekEnum {
7
7
  Sat = "Sat",
8
8
  Sun = "Sun"
9
9
  }
10
+ export declare enum DateFormat {
11
+ YEAR_MONTH_DAY_REVERSE = "YEAR_MONTH_DAY_REVERSE",
12
+ YEAR_MONTH_DAY = "YEAR_MONTH_DAY",
13
+ DAY_MONTH_YEAR = "DAY_MONTH_YEAR"
14
+ }
@@ -10,3 +10,9 @@ var WeekEnum;
10
10
  WeekEnum["Sat"] = "Sat";
11
11
  WeekEnum["Sun"] = "Sun";
12
12
  })(WeekEnum = exports.WeekEnum || (exports.WeekEnum = {}));
13
+ var DateFormat;
14
+ (function (DateFormat) {
15
+ DateFormat["YEAR_MONTH_DAY_REVERSE"] = "YEAR_MONTH_DAY_REVERSE";
16
+ DateFormat["YEAR_MONTH_DAY"] = "YEAR_MONTH_DAY";
17
+ DateFormat["DAY_MONTH_YEAR"] = "DAY_MONTH_YEAR";
18
+ })(DateFormat = exports.DateFormat || (exports.DateFormat = {}));
@@ -26,6 +26,7 @@ export declare enum PrintTypeEnum {
26
26
  Label = "label"
27
27
  }
28
28
  export declare enum EncodeTypeEnum {
29
+ DEFAULT = "default",
29
30
  IMG = "img",
30
31
  CODEPAGE = "codepage",
31
32
  UTF_8 = "utf-8"
@@ -34,6 +34,7 @@ var PrintTypeEnum;
34
34
  })(PrintTypeEnum = exports.PrintTypeEnum || (exports.PrintTypeEnum = {}));
35
35
  var EncodeTypeEnum;
36
36
  (function (EncodeTypeEnum) {
37
+ EncodeTypeEnum["DEFAULT"] = "default";
37
38
  EncodeTypeEnum["IMG"] = "img";
38
39
  EncodeTypeEnum["CODEPAGE"] = "codepage";
39
40
  EncodeTypeEnum["UTF_8"] = "utf-8";
package/dist/index.d.ts CHANGED
@@ -24,6 +24,7 @@ export * from './enum/role.enum';
24
24
  export * from './interfaces/member/member.interface';
25
25
  export * from './interfaces/member/member-transaction.interface';
26
26
  export * from './interfaces/store/store.interface';
27
+ export * from './interfaces/common/language.interface';
27
28
  export { PayCompanyEnum } from './enum/pay-company.enum';
28
29
  import * as moment from 'moment';
29
30
  import Big from 'big.js';
@@ -0,0 +1,15 @@
1
+ import { EncodeTypeEnum } from '../../enum/printer.enum';
2
+ import { DateFormat } from '../../enum/common.enum';
3
+ export interface LanguageItem {
4
+ readonly name: string;
5
+ readonly img: string;
6
+ readonly code: string;
7
+ readonly speechCode: string;
8
+ readonly speechLang?: string;
9
+ readonly fontFamily?: string;
10
+ readonly dateFormat: DateFormat;
11
+ readonly defaultAreaCode: string;
12
+ readonly rtl?: boolean;
13
+ readonly codepage: string;
14
+ readonly defaultPrintEncodeType: EncodeTypeEnum;
15
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@freedom_sky/feige-lib",
3
- "version": "4.34.0",
3
+ "version": "4.36.0",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -1,3 +1,6 @@
1
+ import { DateFormat } from '../enum/common.enum';
2
+ import { EncodeTypeEnum } from '../enum/printer.enum';
3
+ import { LanguageItem } from '../interfaces/common/language.interface';
1
4
  class Const {
2
5
  ROLE = {
3
6
  MANAGER: 'manager',
@@ -91,6 +94,18 @@ class Const {
91
94
  PEN: 'S/. ', //秘鲁新索尔
92
95
  AED: 'AED', //阿联酋迪拉姆
93
96
  FT: 'Ft', //匈牙利福林
97
+ CHF: 'Fr', //瑞士法郎
98
+ DKK: 'kr', //丹麦克朗
99
+ INR: '₨', //印度卢比
100
+ KES: 'Sh', //肯尼亚先令
101
+ KRW: '₩', //韩元
102
+ LAK: '₭', //老挝基普
103
+ MMK: 'K', //缅甸缅元
104
+ THB: '฿', //泰国泰铢
105
+ TRY: '₤', // 土耳其新里拉
106
+ PLN: 'zł', //波兰兹罗提
107
+ UAH: '₴', //乌克兰格里夫纳
108
+ BRL: 'R$', //巴西巴西雷亚尔
94
109
  };
95
110
  LARGE_CURRENCY = ['đ', '¥']; //币值比较大,不需要小数而且需要三位打逗号的货币
96
111
  CHINA_TYPE_DISCOUNT_LANGS = ['zh', 'zh-tw']; //以中文习惯打折的语言
@@ -141,33 +156,36 @@ class Const {
141
156
  },
142
157
  };
143
158
  PROBATION = 10; // 公共试用期,当具体模块下没有该字段时,取这里的数据,单位:日
144
- LANGUAGE = [
159
+ LANGUAGE: LanguageItem[] = [
145
160
  {
146
161
  name: '汉语',
147
162
  img: '',
148
163
  code: 'zh',
149
164
  speechCode: 'zh-CN',
150
- printCode: 'cp936',
151
- dateFormat: 'YEAR_MONTH_DAY',
165
+ dateFormat: DateFormat.YEAR_MONTH_DAY,
152
166
  defaultAreaCode: '86',
167
+ codepage: 'cp936',
168
+ defaultPrintEncodeType: EncodeTypeEnum.CODEPAGE,
153
169
  },
154
170
  {
155
171
  name: 'English',
156
172
  img: '',
157
173
  code: 'en',
158
174
  speechCode: 'en-US',
159
- printCode: 'cp936',
160
- dateFormat: 'DAY_MONTH_YEAR',
175
+ dateFormat: DateFormat.DAY_MONTH_YEAR,
161
176
  defaultAreaCode: '61',
177
+ codepage: 'pc850',
178
+ defaultPrintEncodeType: EncodeTypeEnum.CODEPAGE,
162
179
  },
163
180
  {
164
181
  name: '漢語',
165
182
  img: '',
166
183
  code: 'zh-tw',
167
184
  speechCode: 'zh-tw',
168
- printCode: 'cp936',
169
- dateFormat: 'YEAR_MONTH_DAY',
185
+ dateFormat: DateFormat.YEAR_MONTH_DAY,
170
186
  defaultAreaCode: '852',
187
+ codepage: 'cp936',
188
+ defaultPrintEncodeType: EncodeTypeEnum.CODEPAGE,
171
189
  },
172
190
  {
173
191
  name: 'ئۇيغۇرچە',
@@ -175,84 +193,92 @@ class Const {
175
193
  code: 'ug',
176
194
  speechCode: 'zh-CN',
177
195
  speechLang: 'zh',
178
- printCode: 'img',
179
196
  fontFamily: 'UG',
180
- dateFormat: 'YEAR_MONTH_DAY_REVERSE',
197
+ dateFormat: DateFormat.YEAR_MONTH_DAY_REVERSE,
181
198
  defaultAreaCode: '86',
182
199
  rtl: true,
200
+ codepage: 'utf-8',
201
+ defaultPrintEncodeType: EncodeTypeEnum.IMG,
183
202
  },
184
203
  {
185
204
  name: 'Tiếng Việt',
186
205
  img: '',
187
206
  code: 'vi',
188
207
  speechCode: 'vi-VN',
189
- printCode: 'cp1258',
190
- defaultEncodeType: 'img', // 如果有这个字段, 就以这个字段为准, 没有的话, 判断printCode是否为img, 是的话就img, 不是的话就是codepage, utf-8默认只能手动选
191
- dateFormat: 'DAY_MONTH_YEAR',
208
+ dateFormat: DateFormat.DAY_MONTH_YEAR,
192
209
  defaultAreaCode: '84',
210
+ codepage: 'cp1258',
211
+ defaultPrintEncodeType: EncodeTypeEnum.IMG,
193
212
  },
194
213
  {
195
214
  name: 'Deutsch',
196
215
  img: '',
197
216
  code: 'de',
198
217
  speechCode: 'de-DE',
199
- printCode: 'img',
200
- dateFormat: 'DAY_MONTH_YEAR',
218
+ dateFormat: DateFormat.DAY_MONTH_YEAR,
201
219
  defaultAreaCode: '49',
220
+ codepage: 'cp850',
221
+ defaultPrintEncodeType: EncodeTypeEnum.IMG,
202
222
  },
203
223
  {
204
224
  name: '日本語',
205
225
  img: '',
206
226
  code: 'ja',
207
227
  speechCode: 'ja-JP',
208
- printCode: 'cp936',
209
- dateFormat: 'YEAR_MONTH_DAY',
228
+ dateFormat: DateFormat.YEAR_MONTH_DAY,
210
229
  defaultAreaCode: '81',
230
+ codepage: 'cp936',
231
+ defaultPrintEncodeType: EncodeTypeEnum.CODEPAGE,
211
232
  },
212
233
  {
213
234
  name: '한국어',
214
235
  img: '',
215
236
  code: 'ko',
216
237
  speechCode: 'ko-KR',
217
- printCode: 'img',
218
- dateFormat: 'YEAR_MONTH_DAY',
238
+ dateFormat: DateFormat.YEAR_MONTH_DAY,
219
239
  defaultAreaCode: '82',
240
+ codepage: 'cp949',
241
+ defaultPrintEncodeType: EncodeTypeEnum.IMG,
220
242
  },
221
243
  {
222
244
  name: 'Español',
223
245
  img: '',
224
246
  code: 'es',
225
247
  speechCode: 'es-ES',
226
- printCode: 'img',
227
- dateFormat: 'YEAR_MONTH_DAY',
248
+ dateFormat: DateFormat.YEAR_MONTH_DAY,
228
249
  defaultAreaCode: '34',
250
+ codepage: 'cp850',
251
+ defaultPrintEncodeType: EncodeTypeEnum.IMG,
229
252
  },
230
253
  {
231
254
  name: 'Português',
232
255
  img: '',
233
256
  code: 'pt',
234
257
  speechCode: 'pt-PT',
235
- printCode: 'img',
236
- dateFormat: 'DAY_MONTH_YEAR',
258
+ dateFormat: DateFormat.DAY_MONTH_YEAR,
237
259
  defaultAreaCode: '351',
260
+ codepage: 'cp850',
261
+ defaultPrintEncodeType: EncodeTypeEnum.IMG,
238
262
  },
239
263
  {
240
264
  name: 'Français',
241
265
  img: '',
242
266
  code: 'fr',
243
267
  speechCode: 'fr-FR',
244
- printCode: 'img',
245
- dateFormat: 'DAY_MONTH_YEAR',
268
+ dateFormat: DateFormat.DAY_MONTH_YEAR,
246
269
  defaultAreaCode: '33',
270
+ codepage: 'cp850',
271
+ defaultPrintEncodeType: EncodeTypeEnum.IMG,
247
272
  },
248
273
  {
249
274
  name: 'Italiano',
250
275
  img: '',
251
276
  code: 'it',
252
277
  speechCode: 'it-IT',
253
- printCode: 'img',
254
- dateFormat: 'DAY_MONTH_YEAR',
278
+ dateFormat: DateFormat.DAY_MONTH_YEAR,
255
279
  defaultAreaCode: '39',
280
+ codepage: 'cp850',
281
+ defaultPrintEncodeType: EncodeTypeEnum.IMG,
256
282
  },
257
283
  ];
258
284
  DATE_FORMAT = {
@@ -7,3 +7,9 @@ export enum WeekEnum {
7
7
  Sat = 'Sat',
8
8
  Sun = 'Sun',
9
9
  }
10
+
11
+ export enum DateFormat {
12
+ YEAR_MONTH_DAY_REVERSE = 'YEAR_MONTH_DAY_REVERSE',
13
+ YEAR_MONTH_DAY = 'YEAR_MONTH_DAY',
14
+ DAY_MONTH_YEAR = 'DAY_MONTH_YEAR',
15
+ }
@@ -29,6 +29,7 @@ export enum PrintTypeEnum {
29
29
  }
30
30
 
31
31
  export enum EncodeTypeEnum {
32
+ DEFAULT = 'default',
32
33
  IMG = 'img',
33
34
  CODEPAGE = 'codepage',
34
35
  UTF_8 = 'utf-8',
package/src/index.ts CHANGED
@@ -25,6 +25,7 @@ export * from './enum/role.enum';
25
25
  export * from './interfaces/member/member.interface';
26
26
  export * from './interfaces/member/member-transaction.interface';
27
27
  export * from './interfaces/store/store.interface';
28
+ export * from './interfaces/common/language.interface';
28
29
  export { PayCompanyEnum } from './enum/pay-company.enum';
29
30
  import * as moment from 'moment';
30
31
  import Big from 'big.js';
@@ -0,0 +1,15 @@
1
+ import { EncodeTypeEnum } from '../../enum/printer.enum';
2
+ import { DateFormat } from '../../enum/common.enum';
3
+ export interface LanguageItem {
4
+ readonly name: string;
5
+ readonly img: string; // 语言对应图片的url
6
+ readonly code: string;
7
+ readonly speechCode: string;
8
+ readonly speechLang?: string;
9
+ readonly fontFamily?: string;
10
+ readonly dateFormat: DateFormat;
11
+ readonly defaultAreaCode: string;
12
+ readonly rtl?: boolean;
13
+ readonly codepage: string;
14
+ readonly defaultPrintEncodeType: EncodeTypeEnum;
15
+ }