@lm_fe/utils 0.1.201 → 0.2.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.
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # yargs-parser
1
+ # yargs-parser +4+
2
2
 
3
3
 
4
4
 
@@ -1,5 +1,4 @@
1
1
  export declare const TOKEN_KEY = "\u03A3(\u3063 \u00B0\u0414 \u00B0;)\u3063";
2
- export declare const EMPTY_PLACEHOLDER = "-";
3
2
  export declare const ARG_URS1_KEY = "usr1";
4
3
  export declare const ARG_URS2_KEY = "usr2";
5
4
  export declare const ROMAN_NUMERALS: {
@@ -1,6 +1,7 @@
1
1
  import { AnyObject, MyLog } from "@noah-libjs/utils";
2
2
  export declare class AppEnv<T = string> {
3
3
  static get singleton(): AppEnv;
4
+ static get client_mode(): boolean;
4
5
  _appName?: T;
5
6
  _globalCache: {
6
7
  [x: string]: any;
@@ -13,8 +14,11 @@ export declare class AppEnv<T = string> {
13
14
  pop_global_cache(k: string): AnyObject | undefined;
14
15
  _isDev?: boolean;
15
16
  is(type: T): boolean;
17
+ not(type: T): boolean;
16
18
  in(types: T[]): boolean;
17
19
  get isSp(): boolean;
20
+ get is_single(): boolean;
21
+ get is_new(): (string | boolean)[];
18
22
  get isDev(): boolean;
19
23
  set isDev(value: boolean);
20
24
  get appName(): T | undefined;
@@ -24,15 +28,15 @@ export declare class AppEnv<T = string> {
24
28
  get tokenKey(): string;
25
29
  get loginRememberKey(): string;
26
30
  constructor(appName?: T);
27
- get loginRemember(): AnyObject | undefined | null;
28
- set loginRemember(value: AnyObject | undefined | null);
31
+ get loginRemember(): AnyObject<any> | null;
32
+ set loginRemember(value: AnyObject<any> | null);
29
33
  get token(): string | null;
30
34
  set token(value: string | null);
31
35
  get rawToken(): string | string[];
32
- reload(path?: string): void;
36
+ reload(path?: string | URL): void;
33
37
  open(url?: string | URL, target?: string, features?: string): Window | null;
34
- logout(path?: string): void;
35
- logout_clean(path?: string): void;
38
+ logout(path?: string | URL): void;
39
+ logout_clean(path?: string | URL): void;
36
40
  getToken(): string | null;
37
41
  getTokenFromSearchParam(): string | null;
38
42
  setTokenToSearchParam(url: URL): URL;
@@ -26,7 +26,7 @@ export declare class Request extends EventEmitter<{
26
26
  }>): any;
27
27
  static getRemoteMessage(res?: AxiosResponse<any>): any;
28
28
  static getHeaderMessage(res?: AxiosResponse<any>): string | undefined;
29
- displayMsg(res: AxiosResponse<{
29
+ displayMsg(res?: AxiosResponse<{
30
30
  data?: any;
31
31
  code?: number;
32
32
  msg?: string;
@@ -1,9 +1,5 @@
1
- import { AxiosInstance } from 'axios';
2
- import { Request } from './Request';
3
- export * from './types';
4
- export { codeMessage } from './constant';
5
- export { Request };
6
- export declare const request: Request;
7
- export declare const rawRequest: AxiosInstance;
1
+ import { Request } from '@noah-libjs/request';
2
+ export * from '@noah-libjs/request';
3
+ export declare const rawRequest: import("axios").AxiosInstance;
8
4
  export declare const asRequest: Request;
9
5
  export declare const fubaoRequest: Request;
@@ -0,0 +1,38 @@
1
+ import { DayjsConfigType } from "@noah-libjs/utils";
2
+ import dayjs, { Dayjs } from "dayjs";
3
+ /**
4
+ * 计算孕周
5
+ * gesDate:预产期-B超
6
+ * date:产检/报告日期
7
+ */
8
+ export declare function getGesWeek(gesDate: string, date: string): string;
9
+ /**
10
+ * 计算停经孕周
11
+ * @param checkData 当前日期
12
+ * @param lmp 末次月经
13
+ * @returns
14
+ */
15
+ export declare const menopauseWeek: (checkData: string, lmp: string) => string;
16
+ /**
17
+ * 计算孕周对应的天数
18
+ */
19
+ export declare function getGestationalDays(gestationalWeek: string): number;
20
+ /**
21
+ * 根据末次月经计算预产期B超
22
+ */
23
+ export declare function getExpected(date: string): string;
24
+ /**
25
+ * 根据 预产期B超 日期获取孕周
26
+ * 得出 ${孕周周数}+${孕周天数}
27
+ * 预产期B超
28
+ */
29
+ export declare const getGestationalWeekBySureEdd: (sureEdd: string) => string;
30
+ /**
31
+ * 根据末次月经计算预产期B超
32
+ */
33
+ export declare function calEddByLmp(lmp: Dayjs): dayjs.Dayjs;
34
+ export declare function cal_edd_by_lmp(lmp: any): string;
35
+ export declare function calc_edd_by_IVF(移植时间: string, 天数: number): string | null;
36
+ export declare function calc_edd_by_ntExam(checkdate: DayjsConfigType, gestationalWeek: string): string | null;
37
+ export declare const calGestationalWeekByLmp: (lmp: Dayjs, defaultDate?: dayjs.Dayjs) => string;
38
+ export declare const calGestationalWeekBySureEdd: (sureEdd: any, defaultDate?: dayjs.Dayjs) => string | number;
@@ -11,3 +11,4 @@ export * from './Browser';
11
11
  export * from './happyParse';
12
12
  export * from './protocolCheck';
13
13
  export * from './temp_reander';
14
+ export * from './date_calculator';
@@ -9,3 +9,7 @@ export declare function formatRangeDateTime(data: {
9
9
  }, cKeys?: string[]): {
10
10
  [x: string]: string | null;
11
11
  };
12
+ export declare function diff_hour_minute(inputA: any, inputB: any): {
13
+ h: number;
14
+ m: number;
15
+ };
@@ -1,52 +1,17 @@
1
- import dayjs, { Dayjs } from "dayjs";
1
+ import dayjs from "dayjs";
2
2
  /**
3
3
  * 计算BMI
4
4
  */
5
- export declare function getBMI(weight: number, height: number): string | 0;
6
- /**
7
- * 计算孕周
8
- * gesDate:预产期-B超
9
- * date:产检/报告日期
10
- */
11
- export declare function getGesWeek(gesDate: string, date: string): string;
12
- /**
13
- * 计算停经孕周
14
- * @param checkData 当前日期
15
- * @param lmp 末次月经
16
- * @returns
17
- */
18
- export declare const menopauseWeek: (checkData: string, lmp: string) => string;
19
- /**
20
- * 计算孕周对应的天数
21
- */
22
- export declare function getGestationalDays(gestationalWeek: string): number;
5
+ export declare function getBMI(weight: number, height: number): number;
6
+ export declare const calc_bmi: typeof getBMI;
23
7
  /**
24
8
  * 获取本周五、下周五、下下周五时间
25
9
  */
26
10
  export declare function getOrderTime(orderDate: '本周五' | '下周五' | '下下周五'): dayjs.Dayjs;
27
- /**
28
- * 根据末次月经计算预产期B超
29
- */
30
- export declare function getExpected(date: string): string;
31
11
  /**
32
12
  * 计算两个日期相隔的年数
33
13
  */
34
- export declare function getDiffYears(date: string, preDate: string): number;
35
- /**
36
- * 获取两个字符串日期 YYYY-MM-dd 间隔的天数
37
- * 始终返回一个正数
38
- */
39
- export declare const getDays: (str1: string, str2: string) => number;
40
- /**
41
- * 根据 预产期B超 日期获取孕周
42
- * 得出 ${孕周周数}+${孕周天数}
43
- * 预产期B超
44
- */
45
- export declare const getGestationalWeekBySureEdd: (sureEdd: string) => string;
46
- /**
47
- * 根据末次月经计算预产期B超
48
- */
49
- export declare function calEddByLmp(lmp: Dayjs): dayjs.Dayjs;
14
+ export declare function getDiffYears(a: string, b: string): number;
50
15
  /**根据出生日期计算年龄 */
51
16
  export declare function GetAgeByBirthDay(strBirthday: string): number | null;
52
17
  export declare const getDataSource: (url: string, params: object, processFromApi?: (v: any) => any) => Promise<{
@@ -57,15 +22,15 @@ export declare function gen_id_form_item_config(name?: string): {
57
22
  inputType: "id";
58
23
  dataIndex: string;
59
24
  name: string;
25
+ form_hidden: boolean;
60
26
  };
61
- export declare const calGestationalWeekByLmp: (lmp: Dayjs, defaultDate?: dayjs.Dayjs) => string;
62
- export declare const calGestationalWeekBySureEdd: (sureEdd: any, defaultDate?: dayjs.Dayjs) => string | number;
63
27
  export declare function format_gp(data: {
64
28
  gravidity?: any;
65
29
  parity?: any;
66
30
  }): string;
67
- export declare function unmarshalGestationWeek(weekStr?: string): {
68
- week: number;
31
+ export declare function unmarshal_gestationWeek(weekStr?: string): {
69
32
  day: number;
70
- };
71
- export declare function marshalGestationWeek(week?: string | number, day?: string | number): string;
33
+ days: number;
34
+ week: number;
35
+ } | null;
36
+ export declare function marshal_gestationWeek(week?: string | number, day?: string | number): string;
@@ -1 +1,4 @@
1
1
  export declare function getTimeSlice(hour?: number, isShowSecond?: boolean): string[];
2
+ export declare function is_fuck_abnormal(conf?: {
3
+ isNormal?: 'true' | 'false' | null;
4
+ }): boolean;