@ningboyz/types 1.1.166 → 1.1.167

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/index.ts CHANGED
@@ -39,6 +39,7 @@ import * as TZbhd from "./src/zbhd";
39
39
  import * as TZbzd from "./src/zbzd";
40
40
  import * as TZfht from "./src/zfht";
41
41
  import * as TZfsq from "./src/zfsq";
42
+ import * as Decorators from "./src/decorators"
42
43
 
43
44
  export {
44
45
  Const,
@@ -66,11 +67,13 @@ export {
66
67
  TWtui, TWzpz, TYzcb,
67
68
  TYzcg,
68
69
  TYzht, TYzpz, TZbhd, TZbzd, TZfht,
69
- TZfsq, type IAboutConfig,
70
+ TZfsq,
71
+ type IAboutConfig,
70
72
  type IBaseConfig,
71
73
  type IBaseResponse,
72
74
  type IConfig,
73
75
  type IPathConfig,
74
- type IResponse
76
+ type IResponse,
77
+ Decorators
75
78
  };
76
79
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ningboyz/types",
3
- "version": "1.1.166",
3
+ "version": "1.1.167",
4
4
  "private": false,
5
5
  "description": "宁波甬政类型库",
6
6
  "author": "nbyt-syq",
@@ -0,0 +1,14 @@
1
+ import _ from "lodash";
2
+ import { IConfigProperty } from "./IConfigProperty";
3
+
4
+ export function DConfigProperty(cnfg: IConfigProperty) {
5
+ return function (target: any, _propertyKey: string) {
6
+ const listCnfg = Reflect.get(target, "listCnfg") as IConfigProperty[];
7
+ if (_.isNil(listCnfg)) {
8
+ Reflect.set(target, "listCnfg", [cnfg]);
9
+ } else {
10
+ listCnfg.push(cnfg);
11
+ Reflect.set(target, "listCnfg", listCnfg);
12
+ }
13
+ };
14
+ }
@@ -0,0 +1,24 @@
1
+ export enum DFormType {
2
+ select = "select",
3
+ input = "input"
4
+ }
5
+
6
+ export interface IConfigDataSource {
7
+ id: number;
8
+ label: string;
9
+ pid?: number;
10
+ children?: IConfigDataSource[];
11
+ }
12
+
13
+ export interface IConfigProperty {
14
+ //配置名称
15
+ cnfgName: string;
16
+ //配置字段
17
+ cnfgField: string;
18
+ //配置字段类型
19
+ formType: DFormType;
20
+ //是否多选, 默认单选
21
+ multiple?: boolean;
22
+ //本地数据源
23
+ dataSource: IConfigDataSource[];
24
+ }
@@ -0,0 +1,3 @@
1
+ import { DConfigProperty } from "./DConfigProperty";
2
+ import { IConfigProperty, DFormType, IConfigDataSource } from "./IConfigProperty";
3
+ export { DConfigProperty, type IConfigProperty, DFormType, type IConfigDataSource };
@@ -0,0 +1,28 @@
1
+ import _ from "lodash";
2
+ import { DConfigProperty, DFormType } from "../decorators";
3
+
4
+ export interface IYzpzTypeResponseConf {
5
+ usesManualMode: number;
6
+ }
7
+
8
+ export class TYzpzTypeResponseConf implements IYzpzTypeResponseConf {
9
+ constructor(typePara?: string) {
10
+ if (!_.isNil(typePara) && !_.isEmpty(typePara)) {
11
+ try {
12
+ const obj = JSON.parse(typePara) as TYzpzTypeResponseConf;
13
+ Object.assign(this, obj);
14
+ } catch (e) {}
15
+ }
16
+ }
17
+
18
+ @DConfigProperty({
19
+ cnfgName: "开启手动模式",
20
+ cnfgField: "usesManualMode",
21
+ formType: DFormType.select,
22
+ dataSource: [
23
+ { id: 0, label: "关闭" },
24
+ { id: 1, label: "开启" }
25
+ ]
26
+ })
27
+ usesManualMode: number = 0;
28
+ }
package/src/yzpz/index.ts CHANGED
@@ -4,6 +4,7 @@ import { IYzpzK0kmResponse, TYzpzK0kmResponse } from "./IYzpzK0kmResponse";
4
4
  import { IYzpzK8kmResponse, TYzpzK8kmResponse } from "./IYzpzK8kmResponse";
5
5
  import { IYzpzKbkmResponse, TYzpzKbkmResponse } from "./IYzpzKbkmResponse";
6
6
  import { IYzpzTypeResponse, TYzpzTypeResponse } from "./IYzpzTypeResponse";
7
+ import { IYzpzTypeResponseConf, TYzpzTypeResponseConf } from "./IYzpzTypeResponseConf";
7
8
 
8
9
  export {
9
10
  TYzpzCnfgResponse,
@@ -12,11 +13,13 @@ export {
12
13
  TYzpzK8kmResponse,
13
14
  TYzpzKbkmResponse,
14
15
  TYzpzTypeResponse,
16
+ TYzpzTypeResponseConf,
15
17
  type IYzpzCnfgResponse,
16
18
  type IYzpzItemResponse,
17
19
  type IYzpzK0kmResponse,
18
20
  type IYzpzK8kmResponse,
19
21
  type IYzpzKbkmResponse,
20
- type IYzpzTypeResponse
22
+ type IYzpzTypeResponse,
23
+ type IYzpzTypeResponseConf
21
24
  };
22
25