@ningboyz/types 1.6.126 → 1.6.127
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,7 +1,9 @@
|
|
|
1
|
+
import _ from "lodash";
|
|
1
2
|
import { IFlowMainResponse } from "../flow";
|
|
2
3
|
import { IGamsCnfgResponse } from "../gams";
|
|
3
4
|
import type { IDictResponse } from "./IDictResponse";
|
|
4
5
|
import type { IPartResponse } from "./IPartResponse";
|
|
6
|
+
import { ISysMenuWithExpdResponseMenuPara, TSysMenuWithExpdResponseMenuPara } from "./ISysMenuWithExpdResponseMenuPara";
|
|
5
7
|
|
|
6
8
|
export interface ISysMenuWithExpdResponse {
|
|
7
9
|
DWLXP5PZ: any[];
|
|
@@ -317,4 +319,30 @@ export class TSysMenuWithExpdResponse implements ISysMenuWithExpdResponse {
|
|
|
317
319
|
flowType: IFlowMainResponse[] = [];
|
|
318
320
|
listGamsText: string = "";
|
|
319
321
|
listCnfgText: string = "";
|
|
322
|
+
|
|
323
|
+
menuParaConv: ISysMenuWithExpdResponseMenuPara = new TSysMenuWithExpdResponseMenuPara();
|
|
324
|
+
|
|
325
|
+
public parseJsonTest() {
|
|
326
|
+
const defaultMenuPara = new TSysMenuWithExpdResponseMenuPara();
|
|
327
|
+
if (_.isEmpty(this.menuPara)) {
|
|
328
|
+
return defaultMenuPara;
|
|
329
|
+
}
|
|
330
|
+
try {
|
|
331
|
+
const obj = JSON.parse(this.menuPara) as TSysMenuWithExpdResponseMenuPara;
|
|
332
|
+
return _.merge(defaultMenuPara, obj);
|
|
333
|
+
} catch (e) {}
|
|
334
|
+
return defaultMenuPara;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
public static parseJson(menuPara: string) {
|
|
338
|
+
const defaultMenuPara = new TSysMenuWithExpdResponseMenuPara();
|
|
339
|
+
if (_.isEmpty(menuPara)) {
|
|
340
|
+
return defaultMenuPara;
|
|
341
|
+
}
|
|
342
|
+
try {
|
|
343
|
+
const obj = JSON.parse(menuPara) as TSysMenuWithExpdResponseMenuPara;
|
|
344
|
+
return _.merge(defaultMenuPara, obj);
|
|
345
|
+
} catch (e) {}
|
|
346
|
+
return defaultMenuPara;
|
|
347
|
+
}
|
|
320
348
|
}
|