@ningboyz/types 1.1.167 → 1.1.168

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ningboyz/types",
3
- "version": "1.1.167",
3
+ "version": "1.1.168",
4
4
  "private": false,
5
5
  "description": "宁波甬政类型库",
6
6
  "author": "nbyt-syq",
@@ -2,13 +2,8 @@ import _ from "lodash";
2
2
  import { IConfigProperty } from "./IConfigProperty";
3
3
 
4
4
  export function DConfigProperty(cnfg: IConfigProperty) {
5
+
5
6
  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
- }
7
+
13
8
  };
14
9
  }
@@ -1,12 +1,17 @@
1
1
  import _ from "lodash";
2
- import { DConfigProperty, DFormType } from "../decorators";
2
+ import { DConfigProperty, DFormType, IConfigProperty } from "../decorators";
3
3
 
4
4
  export interface IYzpzTypeResponseConf {
5
5
  usesManualMode: number;
6
6
  }
7
7
 
8
8
  export class TYzpzTypeResponseConf implements IYzpzTypeResponseConf {
9
- constructor(typePara?: string) {
9
+ private static map: WeakMap<String, IConfigProperty[]> = new WeakMap<String, IConfigProperty[]>();
10
+ constructor(id: string, typePara?: string) {
11
+ const instance = TYzpzTypeResponseConf.map.get(id);
12
+ if (_.isNil(instance)) {
13
+ TYzpzTypeResponseConf.map.set(id, []);
14
+ }
10
15
  if (!_.isNil(typePara) && !_.isEmpty(typePara)) {
11
16
  try {
12
17
  const obj = JSON.parse(typePara) as TYzpzTypeResponseConf;