aldehyde 0.2.73 → 0.2.75

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.
Files changed (87) hide show
  1. package/lib/custom-page/custom-page-router.d.ts.map +1 -1
  2. package/lib/custom-page/custom-page-router.js +0 -1
  3. package/lib/custom-page/custom-page-router.js.map +1 -1
  4. package/lib/detail/view/act-dtmpl-view.d.ts +1 -0
  5. package/lib/detail/view/act-dtmpl-view.d.ts.map +1 -1
  6. package/lib/detail/view/act-dtmpl-view.js +2 -2
  7. package/lib/detail/view/act-dtmpl-view.js.map +1 -1
  8. package/lib/detail/view/modal-dtmpl-view.d.ts +4 -3
  9. package/lib/detail/view/modal-dtmpl-view.d.ts.map +1 -1
  10. package/lib/detail/view/modal-dtmpl-view.js +2 -6
  11. package/lib/detail/view/modal-dtmpl-view.js.map +1 -1
  12. package/lib/form/dtmpl-form.d.ts.map +1 -1
  13. package/lib/form/dtmpl-form.js.map +1 -1
  14. package/lib/import/excel-import.d.ts.map +1 -1
  15. package/lib/import/excel-import.js +45 -37
  16. package/lib/import/excel-import.js.map +1 -1
  17. package/lib/index.d.ts +2 -1
  18. package/lib/index.d.ts.map +1 -1
  19. package/lib/index.js +2 -1
  20. package/lib/index.js.map +1 -1
  21. package/lib/layout/menu/menu-render.d.ts.map +1 -1
  22. package/lib/layout/menu/menu-render.js +3 -0
  23. package/lib/layout/menu/menu-render.js.map +1 -1
  24. package/lib/layout/menu/userinfo-bar.js +1 -1
  25. package/lib/layout/menu/userinfo-bar.js.map +1 -1
  26. package/lib/module/dtmpl-view-card.d.ts +1 -0
  27. package/lib/module/dtmpl-view-card.d.ts.map +1 -1
  28. package/lib/module/dtmpl-view-card.js +2 -2
  29. package/lib/module/dtmpl-view-card.js.map +1 -1
  30. package/lib/module/dtmpl-view-drawer.js +1 -1
  31. package/lib/module/dtmpl-view-drawer.js.map +1 -1
  32. package/lib/routable/ttmpl-route.d.ts +10 -0
  33. package/lib/routable/ttmpl-route.d.ts.map +1 -0
  34. package/lib/routable/ttmpl-route.js +79 -0
  35. package/lib/routable/ttmpl-route.js.map +1 -0
  36. package/lib/table/query-table.js +1 -1
  37. package/lib/table/query-table.js.map +1 -1
  38. package/lib/tmpl/hc-data-source.d.ts +2 -1
  39. package/lib/tmpl/hc-data-source.d.ts.map +1 -1
  40. package/lib/tmpl/hc-data-source.js +11 -0
  41. package/lib/tmpl/hc-data-source.js.map +1 -1
  42. package/lib/tmpl/hcservice-v3.d.ts +2 -0
  43. package/lib/tmpl/hcservice-v3.d.ts.map +1 -1
  44. package/lib/tmpl/hcservice-v3.js +30 -7
  45. package/lib/tmpl/hcservice-v3.js.map +1 -1
  46. package/lib/tmpl/interface.d.ts +14 -1
  47. package/lib/tmpl/interface.d.ts.map +1 -1
  48. package/lib/tmpl/interface.js.map +1 -1
  49. package/lib/tree/act-tree.d.ts +41 -0
  50. package/lib/tree/act-tree.d.ts.map +1 -0
  51. package/lib/tree/act-tree.js +120 -0
  52. package/lib/tree/act-tree.js.map +1 -0
  53. package/lib/tree/index.css +21 -0
  54. package/lib/tree/tmpl-tree.d.ts +62 -0
  55. package/lib/tree/tmpl-tree.d.ts.map +1 -0
  56. package/lib/tree/tmpl-tree.js +342 -0
  57. package/lib/tree/tmpl-tree.js.map +1 -0
  58. package/lib/tree/tree-node.d.ts +22 -0
  59. package/lib/tree/tree-node.d.ts.map +1 -0
  60. package/lib/tree/tree-node.js +62 -0
  61. package/lib/tree/tree-node.js.map +1 -0
  62. package/lib/tree/tree-utils.d.ts +55 -0
  63. package/lib/tree/tree-utils.d.ts.map +1 -0
  64. package/lib/tree/tree-utils.js +142 -0
  65. package/lib/tree/tree-utils.js.map +1 -0
  66. package/package.json +1 -1
  67. package/src/aldehyde/controls/entity-select/entity-select.tsx +1 -1
  68. package/src/aldehyde/custom-page/custom-page-router.tsx +0 -1
  69. package/src/aldehyde/detail/view/act-dtmpl-view.tsx +3 -2
  70. package/src/aldehyde/detail/view/modal-dtmpl-view.tsx +6 -6
  71. package/src/aldehyde/form/dtmpl-form.tsx +0 -1
  72. package/src/aldehyde/import/excel-import.tsx +42 -35
  73. package/src/aldehyde/index.tsx +2 -1
  74. package/src/aldehyde/layout/menu/menu-render.tsx +3 -0
  75. package/src/aldehyde/layout/menu/userinfo-bar.tsx +1 -1
  76. package/src/aldehyde/module/dtmpl-view-card.tsx +3 -2
  77. package/src/aldehyde/module/dtmpl-view-drawer.tsx +2 -2
  78. package/src/aldehyde/routable/ttmpl-route.tsx +77 -0
  79. package/src/aldehyde/table/query-table.tsx +1 -1
  80. package/src/aldehyde/tmpl/hc-data-source.tsx +11 -1
  81. package/src/aldehyde/tmpl/hcservice-v3.tsx +29 -7
  82. package/src/aldehyde/tmpl/interface.tsx +16 -1
  83. package/src/aldehyde/tree/act-tree.tsx +149 -0
  84. package/src/aldehyde/tree/index.css +21 -0
  85. package/src/aldehyde/tree/tmpl-tree.tsx +397 -0
  86. package/src/aldehyde/tree/tree-node.tsx +78 -0
  87. package/src/aldehyde/tree/tree-utils.tsx +166 -0
@@ -0,0 +1,62 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import React from 'react';
11
+ import { Avatar, Card, Col, Row, Space, Badge } from 'antd';
12
+ const treeCardTitleBody0 = {
13
+ padding: '4px 4px 4px 4px',
14
+ maxWidth: '300px',
15
+ };
16
+ const buttonIcon = { color: '#597ef7' };
17
+ class TreeNode extends React.PureComponent {
18
+ constructor() {
19
+ super(...arguments);
20
+ this.state = {
21
+ sorts: [],
22
+ };
23
+ this.onDelete = (nodeData) => __awaiter(this, void 0, void 0, function* () {
24
+ });
25
+ }
26
+ componentDidMount() {
27
+ return __awaiter(this, void 0, void 0, function* () {
28
+ });
29
+ }
30
+ componentDidUpdate(preProps) {
31
+ return __awaiter(this, void 0, void 0, function* () {
32
+ });
33
+ }
34
+ componentWillUnmount() {
35
+ return __awaiter(this, void 0, void 0, function* () {
36
+ });
37
+ }
38
+ render() {
39
+ const { nodeData, currentActiveKey } = this.props;
40
+ const { sorts } = this.state;
41
+ let backgroundColor = '#fff';
42
+ let avatarBackgroundColor = '#fff';
43
+ let bodyCss = treeCardTitleBody0;
44
+ if (nodeData.level == 0) {
45
+ avatarBackgroundColor = '#fff';
46
+ bodyCss = treeCardTitleBody0;
47
+ }
48
+ return React.createElement(Card, { bordered: nodeData.level == 2 ? false : false, bodyStyle: bodyCss, style: { marginBottom: 2, backgroundColor }, className: 'tree-node' },
49
+ React.createElement(Row, null,
50
+ React.createElement(Col, { span: 24 },
51
+ React.createElement(Space, null,
52
+ nodeData.avatar ? nodeData.avatar : React.createElement(Avatar, { shape: "square", size: 10, style: {
53
+ backgroundColor: avatarBackgroundColor,
54
+ height: 24,
55
+ width: 10
56
+ } }),
57
+ nodeData.title,
58
+ currentActiveKey && currentActiveKey.indexOf(nodeData.key) >= 0 ? React.createElement(Badge, { key: "red", color: 'red' }) : null))));
59
+ }
60
+ }
61
+ export default TreeNode;
62
+ //# sourceMappingURL=tree-node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tree-node.js","sourceRoot":"","sources":["../../../../src/aldehyde/tree/tree-node.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAC,MAAM,EAAE,IAAI,EAAE,GAAG,EAAW,GAAG,EAAE,KAAK,EAAC,KAAK,EAAC,MAAM,MAAM,CAAA;AAajE,MAAM,kBAAkB,GAAG;IACvB,OAAO,EAAE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,EAAC,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE;gCACzE,eAAe,EAAE,qBAAqB;gCACtC,MAAM,EAAE,EAAE;gCACV,KAAK,EAAE,EAAE;6BACZ,GAAW;wBAAE,QAAQ,CAAC,KAAK;wBAC5B,gBAAgB,IAAI,gBAAgB,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA,oBAAC,KAAK,IAAC,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,GAAK,CAAA,CAAC,CAAA,IAAI,CAEtG,CACN,CACJ,CAEF,CAAA;IACZ,CAAC;CAEJ;AAED,eAAe,QAAQ,CAAA"}
@@ -0,0 +1,55 @@
1
+ import React from "react";
2
+ import { DataNode } from "antd/es/tree";
3
+ import { DtmplData, LtmplConfig, TtmplConfig } from "../tmpl/interface";
4
+ export interface TtmplNodeConfig extends TtmplConfig {
5
+ leafTitleId?: string;
6
+ branchTitleId?: string;
7
+ rootTitleId?: string;
8
+ rootLTmplConfig?: LtmplConfig;
9
+ branchLTmplConfig?: LtmplConfig;
10
+ leafLTmplConfig?: LtmplConfig;
11
+ }
12
+ export interface TreeDataNode extends DataNode {
13
+ parent: TreeDataNode;
14
+ code: string;
15
+ name: string;
16
+ avatar: any;
17
+ level: number;
18
+ children: any;
19
+ }
20
+ export default class TreeUtils {
21
+ static initTtmplNodeConfig: (config: TtmplConfig) => Promise<TtmplNodeConfig>;
22
+ static loadRootNodeData: (config: TtmplNodeConfig) => Promise<any[]>;
23
+ static pushNodeData: (parentNode: TreeDataNode, config: TtmplNodeConfig, brancEntities: any[], leafEntities: any[]) => void;
24
+ static pushSameCodeNodeData: (parentNodes: TreeDataNode[], config: TtmplNodeConfig) => Promise<void>;
25
+ static toLeafTreeNodeData: (item: DtmplData, config: TtmplNodeConfig, parent: TreeDataNode) => {
26
+ code: string;
27
+ key: string;
28
+ name: any;
29
+ title: React.JSX.Element;
30
+ children: any[];
31
+ isLeaf: boolean;
32
+ parent: TreeDataNode;
33
+ };
34
+ static toBanchTreeNodeData: (item: DtmplData, config: TtmplNodeConfig, parent: TreeDataNode) => {
35
+ code: string;
36
+ key: string;
37
+ name: any;
38
+ title: React.JSX.Element;
39
+ children: any[];
40
+ isLeaf: boolean;
41
+ parent: TreeDataNode;
42
+ };
43
+ static toTreeNodeData: (item: DtmplData, titleId: string, parent: TreeDataNode, isLeaf: boolean) => {
44
+ code: string;
45
+ key: string;
46
+ name: any;
47
+ title: React.JSX.Element;
48
+ children: any[];
49
+ isLeaf: boolean;
50
+ parent: TreeDataNode;
51
+ };
52
+ static filterNode: (node: any, searchValue: string) => TreeDataNode[];
53
+ static filterTree: (nodes: any[], searchValue: string) => any[];
54
+ }
55
+ //# sourceMappingURL=tree-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tree-utils.d.ts","sourceRoot":"","sources":["../../../../src/aldehyde/tree/tree-utils.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,QAAQ,EAAC,MAAM,cAAc,CAAC;AAEtC,OAAO,EAAC,SAAS,EAAE,WAAW,EAAkB,WAAW,EAAC,MAAM,mBAAmB,CAAC;AAGtF,MAAM,WAAW,eAAgB,SAAQ,WAAW;IAChD,WAAW,CAAC,EAAC,MAAM,CAAC;IACpB,aAAa,CAAC,EAAC,MAAM,CAAC;IACtB,WAAW,CAAC,EAAC,MAAM,CAAC;IACpB,eAAe,CAAC,EAAC,WAAW,CAAC;IAC7B,iBAAiB,CAAC,EAAC,WAAW,CAAC;IAC/B,eAAe,CAAC,EAAC,WAAW,CAAC;CAEhC;AAED,MAAM,WAAW,YAAa,SAAQ,QAAQ;IAC1C,MAAM,EAAC,YAAY,CAAC;IACpB,IAAI,EAAC,MAAM,CAAC;IACZ,IAAI,EAAC,MAAM,CAAC;IACZ,MAAM,EAAC,GAAG,CAAC;IACX,KAAK,EAAC,MAAM,CAAC;IACb,QAAQ,EAAC,GAAG,CAAC;CAChB;AAED,MAAM,CAAC,OAAO,OAAO,SAAS;IAE1B,MAAM,CAAC,mBAAmB,WAAkB,WAAW,8BA0BtD;IAED,MAAM,CAAC,gBAAgB,WAAkB,eAAe,oBAUvD;IAED,MAAM,CAAC,YAAY,eAAiB,YAAY,UAAU,eAAe,iBAAe,GAAG,EAAE,gBAAc,GAAG,EAAE,UAgB/G;IAED,MAAM,CAAC,oBAAoB,gBAAuB,YAAY,EAAE,UAAU,eAAe,mBAexF;IAGD,MAAM,CAAC,kBAAkB,SAAU,SAAS,UAAQ,eAAe,UAAU,YAAY;;;;;;;;MAGxF;IAED,MAAM,CAAC,mBAAmB,SAAU,SAAS,UAAQ,eAAe,UAAU,YAAY;;;;;;;;MAGzF;IAED,MAAM,CAAC,cAAc,SAAU,SAAS,WAAS,MAAM,UAAU,YAAY,UAAQ,OAAO;;;;;;;;MAa3F;IAED,MAAM,CAAC,UAAU,2BAAuB,MAAM,oBA6B7C;IAED,MAAM,CAAC,UAAU,UAAW,GAAG,EAAE,eAAe,MAAM,WAIrD;CAEJ"}
@@ -0,0 +1,142 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ var _a;
11
+ import React from "react";
12
+ import { HydrocarbonService } from "../index";
13
+ import HCDataSource from "../tmpl/hc-data-source";
14
+ class TreeUtils {
15
+ }
16
+ _a = TreeUtils;
17
+ TreeUtils.initTtmplNodeConfig = (config) => __awaiter(void 0, void 0, void 0, function* () {
18
+ if (!config) {
19
+ return null;
20
+ }
21
+ let ttmplNodeConfig = Object.assign({}, config);
22
+ if (ttmplNodeConfig.rootGtmplId) {
23
+ let res = yield HCDataSource.requestLtmplConfig(null, ttmplNodeConfig.rootGtmplId);
24
+ let rootLTmplConfig = res.ltmplConfig;
25
+ ttmplNodeConfig.rootLTmplConfig = rootLTmplConfig;
26
+ ttmplNodeConfig.rootTitleId = rootLTmplConfig.primaryColumn.id;
27
+ }
28
+ if (ttmplNodeConfig.branchRatmplId) {
29
+ let res = yield HCDataSource.requestLtmplConfig(null, ttmplNodeConfig.branchRatmplId);
30
+ let branchLTmplConfig = res.ltmplConfig;
31
+ ttmplNodeConfig.branchLTmplConfig = branchLTmplConfig;
32
+ ttmplNodeConfig.branchTitleId = branchLTmplConfig.primaryColumn.id;
33
+ }
34
+ if (ttmplNodeConfig.leafRatmplId) {
35
+ let res = yield HCDataSource.requestLtmplConfig(null, ttmplNodeConfig.leafRatmplId);
36
+ let leafLTmplConfig = res.ltmplConfig;
37
+ ttmplNodeConfig.leafLTmplConfig = leafLTmplConfig;
38
+ ttmplNodeConfig.leafTitleId = leafLTmplConfig.primaryColumn.id;
39
+ }
40
+ return ttmplNodeConfig;
41
+ });
42
+ TreeUtils.loadRootNodeData = (config) => __awaiter(void 0, void 0, void 0, function* () {
43
+ let res = yield HydrocarbonService.requestTtmplRootData(null, config.id, {});
44
+ let data = [];
45
+ //组织data
46
+ if (res.entities) {
47
+ res.entities.forEach((item, index) => {
48
+ data.push(_a.toTreeNodeData(item, config.rootTitleId, null, false));
49
+ });
50
+ }
51
+ return data;
52
+ });
53
+ TreeUtils.pushNodeData = (parentNode, config, brancEntities, leafEntities) => {
54
+ //先查询branch
55
+ parentNode.children.splice(0, parentNode.children.length);
56
+ if (brancEntities) {
57
+ brancEntities.forEach((item, index) => {
58
+ parentNode.children.push(_a.toBanchTreeNodeData(item, config, parentNode));
59
+ });
60
+ }
61
+ //debugger
62
+ //再查询leaf
63
+ if (leafEntities) {
64
+ leafEntities.forEach((item, index) => {
65
+ parentNode.children.push(_a.toLeafTreeNodeData(item, config, parentNode));
66
+ });
67
+ }
68
+ };
69
+ TreeUtils.pushSameCodeNodeData = (parentNodes, config) => __awaiter(void 0, void 0, void 0, function* () {
70
+ if (parentNodes.length > 0) {
71
+ //先查询branch
72
+ let brancEntities;
73
+ if (config.branchRatmplId) {
74
+ let res = yield HydrocarbonService.requestLtmplQueryTop(null, config.branchRatmplId, { mainCode: parentNodes[0].code });
75
+ brancEntities = res.entities;
76
+ }
77
+ let res1 = yield HydrocarbonService.requestLtmplQueryTop(null, config.leafRatmplId, { mainCode: parentNodes[0].code });
78
+ let leafEntities = res1.entities;
79
+ for (let parentNode of parentNodes) {
80
+ _a.pushNodeData(parentNode, config, brancEntities, leafEntities);
81
+ }
82
+ }
83
+ });
84
+ TreeUtils.toLeafTreeNodeData = (item, config, parent) => {
85
+ let d = _a.toTreeNodeData(item, config.leafTitleId, parent, true);
86
+ return d;
87
+ };
88
+ TreeUtils.toBanchTreeNodeData = (item, config, parent) => {
89
+ let d = _a.toTreeNodeData(item, config.branchTitleId, parent, false);
90
+ return d;
91
+ };
92
+ TreeUtils.toTreeNodeData = (item, titleId, parent, isLeaf) => {
93
+ let name = item.fieldMap[titleId];
94
+ let d = {
95
+ code: item.code,
96
+ key: (parent === null || parent === void 0 ? void 0 : parent.code) + item.code,
97
+ name,
98
+ title: React.createElement(React.Fragment, null,
99
+ React.createElement("span", null, name ? name : item.code)),
100
+ children: [],
101
+ isLeaf,
102
+ parent,
103
+ };
104
+ return d;
105
+ };
106
+ TreeUtils.filterNode = (node, searchValue) => {
107
+ let children = [...node.children];
108
+ let newNodes = [];
109
+ let tagNodes = [];
110
+ children.forEach((no) => {
111
+ let n = Object.assign({}, no);
112
+ let v = n.searchValue ? n.searchValue : n.name;
113
+ if (v.indexOf(searchValue) >= 0) {
114
+ newNodes.push(n);
115
+ }
116
+ if (n.children && n.children.length > 0) {
117
+ let retNodes = _a.filterNode(n, searchValue);
118
+ if (retNodes.length > 0) {
119
+ n.children = retNodes;
120
+ //补充父没有的
121
+ if ((n.searchValue ? n.searchValue : n.name).indexOf(searchValue) < 0) {
122
+ newNodes.push(n);
123
+ }
124
+ }
125
+ else {
126
+ // 没有子节点情况
127
+ n.children = [];
128
+ // 标记,循环结束后删除
129
+ tagNodes.push(n);
130
+ }
131
+ }
132
+ });
133
+ node.children = newNodes;
134
+ return newNodes;
135
+ };
136
+ TreeUtils.filterTree = (nodes, searchValue) => {
137
+ let root = { code: "", config: undefined, key: undefined, children: [...nodes] };
138
+ _a.filterNode(root, searchValue);
139
+ return root.children;
140
+ };
141
+ export default TreeUtils;
142
+ //# sourceMappingURL=tree-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tree-utils.js","sourceRoot":"","sources":["../../../../src/aldehyde/tree/tree-utils.tsx"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,kBAAkB,EAAC,MAAM,UAAU,CAAC;AAE5C,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAqBlD,MAAqB,SAAS;;;AAEnB,6BAAmB,GAAG,CAAO,MAAmB,EAAE,EAAE;IAEvD,IAAG,CAAC,MAAM,EAAC;QACP,OAAO,IAAI,CAAC;KACf;IACD,IAAI,eAAe,qBAAqB,MAAM,CAAC,CAAA;IAC/C,IAAG,eAAe,CAAC,WAAW,EAAC;QAC3B,IAAI,GAAG,GAAiB,MAAM,YAAY,CAAC,kBAAkB,CAAC,IAAI,EAAC,eAAe,CAAC,WAAW,CAAC,CAAC;QAChG,IAAI,eAAe,GAAc,GAAG,CAAC,WAAW,CAAC;QACjD,eAAe,CAAC,eAAe,GAAC,eAAe,CAAC;QAChD,eAAe,CAAC,WAAW,GAAC,eAAe,CAAC,aAAa,CAAC,EAAE,CAAC;KAChE;IACD,IAAG,eAAe,CAAC,cAAc,EAAC;QAC9B,IAAI,GAAG,GAAiB,MAAM,YAAY,CAAC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AAEM,oBAAU,GAAG,CAAC,KAAY,EAAE,WAAmB,EAAE,EAAE;IACtD,IAAI,IAAI,GAAG,EAAC,IAAI,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,GAAG,KAAK,CAAC,EAAC,CAAC;IAC/E,EAAI,CAAC,UAAU,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IACnC,OAAO,IAAI,CAAC,QAAQ,CAAC;AACzB,CAAC,AAJgB,CAIhB;eA1IgB,SAAS"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aldehyde",
3
- "version": "0.2.73",
3
+ "version": "0.2.75",
4
4
  "author": "cosmicparticle",
5
5
  "main": "lib/index.js",
6
6
  "module": "src/aldehyde/index.txs",
@@ -356,7 +356,7 @@ export default class EntitySelect extends React.PureComponent<InnerEntitySelectP
356
356
  criteriaData[formItemName] = searchText;
357
357
  let queryKey: QueryKey = await HcserviceV3.requestLtmplQueryKey(serverKey,fieldConfig.id, {
358
358
  ...criteriaData, ...pageInfo,
359
- mainCode:currentMainCode,
359
+ mainCode:currentMainCode
360
360
  });
361
361
  let sourceData = await this.loadData(queryKey.key, pageInfo, titleId);
362
362
 
@@ -62,7 +62,6 @@ export interface CustomPageRouterStat {
62
62
  }
63
63
 
64
64
  render() {
65
- debugger
66
65
  // console.log("CustomPageRouter",this.props);
67
66
  let pageName = this.props.params.pageName;
68
67
  let search = this.props.location.search;
@@ -11,6 +11,7 @@ import ToolTipBar from "../tooltipbar";
11
11
 
12
12
  export interface ActDtmplViewProps extends DtmplBaseProps {
13
13
  versionId?: number;
14
+ title?:any,
14
15
  };
15
16
 
16
17
  export interface ActDtmplViewStat {
@@ -81,7 +82,7 @@ class ActDtmplView extends React.PureComponent<ActDtmplViewProps, ActDtmplViewSt
81
82
  }
82
83
 
83
84
  render() {
84
- const {showRightNav, rightBarPositionRight, code, sourceId,goDtmpl,serverKey,codeSource} = this.props;
85
+ const {showRightNav, rightBarPositionRight, code, sourceId,goDtmpl,serverKey,codeSource,title} = this.props;
85
86
  const {dtmplConfig, premisesTitle, loading, layout, snapshotOpen,refreshCode} = this.state;
86
87
  const buttons = dtmplConfig ? dtmplConfig.buttons : undefined;
87
88
  const premises = dtmplConfig ? dtmplConfig.premises : undefined;
@@ -96,7 +97,7 @@ class ActDtmplView extends React.PureComponent<ActDtmplViewProps, ActDtmplViewSt
96
97
  className="hoverable pageHeader"
97
98
  >
98
99
  <h3>
99
- {'详情'}{dtmplConfig?<ToolTipBar content={dtmplConfig.tip} />:null}
100
+ {title?title:'详情'}{dtmplConfig?<ToolTipBar content={dtmplConfig.tip} />:null}
100
101
  <div className="fr">
101
102
  {buttons && buttons.includes("dtmplEdit") && goDtmpl && !dtmplConfig.editAction ?
102
103
  <Button
@@ -2,9 +2,11 @@ import React from 'react';
2
2
  import {Modal, ModalProps as AntdModalProps,Form,Button} from 'antd'
3
3
  import ActDtmplView, {ActDtmplViewProps} from "./act-dtmpl-view";
4
4
  import Scrollbars from 'react-custom-scrollbars';
5
- interface ModalDtmplViewProps extends AntdModalProps, ActDtmplViewProps{
6
- height:any,
5
+ interface ModalDtmplViewProps extends ActDtmplViewProps{
6
+ height?:any,
7
7
  onCancel:()=>any,
8
+ open?:boolean,
9
+ children?:any,
8
10
  }
9
11
 
10
12
  interface ModalDtmplViewState {
@@ -33,13 +35,11 @@ export default class ModalDtmplView extends React.PureComponent<ModalDtmplViewPr
33
35
 
34
36
  render() {
35
37
  // console.log('antdModalProps:',this.antdModalProps);
36
- const {height,onOk,onCancel,code,style,sourceId,open,serverKey} = this.props
37
- //console.log('antdModalProps code :',code);
38
- //const {code} = this.state;o
38
+ const {code,sourceId,serverKey,open,onCancel,height} = this.props
39
+
39
40
  return <Modal
40
41
  open={open}
41
42
  title={"查看"}
42
- // style={style}
43
43
  width={"82vw"}
44
44
  centered
45
45
  wrapClassName={'aaa'}
@@ -207,7 +207,6 @@ export default class DtmplForm extends React.PureComponent<DtmplFormProps, Dtmpl
207
207
  { showHeader? <Card bordered={false}
208
208
  key={"detailTitle"}
209
209
  className="hoverable pageHeader"
210
- // loading={loading}
211
210
  >
212
211
  <h3>
213
212
  {code || (currentDtmplData && currentDtmplData.code)?"[编辑]":"[新增]"}
@@ -116,44 +116,51 @@ export default class ExcelImport extends React.PureComponent<ExcelImportProps, E
116
116
  interrupted: importStatus=='stop',
117
117
  }
118
118
  },"","none").then((res)=>{
119
- const MSG=[]
120
- for(let item of res.messageSequence.messages){
121
- let color="";
122
- let logLevel="";
123
- let createTime=Units.formateDate(item.createTime);
124
- if(item.type==="SUC"){
125
- color="green"
126
- logLevel='成功';
127
- }else if(item.type==="INFO"){
128
- color="black"
129
- logLevel='常规';
130
- }else if(item.type==="ERROR"){
131
- color="red"
132
- logLevel='错误';
133
- }else if(item.type==="WARN"){
134
- color="rgb(250, 225, 4)"
135
- logLevel='警告';
136
- }
137
- const msg=<div ><p>{createTime}</p><p style={{color:color}}>{`【${logLevel}】`+item.text}</p></div>
138
- MSG.push({level:item.type,msg})
139
- }
140
119
 
141
- this.setState({
142
- statusMsg:res.message,
143
- percent:Math.floor((res.current/res.totalCount)*100),
144
- logs:MSG,
145
- })
146
- if(res.completed===true){
147
- clearInterval(this.timerId);
148
- message.success('导入完成!');
149
- this.setState({
150
- importStatus:'success'
151
- });
152
- }
153
- if(importStatus=='stop'){
120
+ const MSG=[]
121
+ if(res.status === 'error'){
154
122
  clearInterval(this.timerId);
123
+ }else {
124
+ for (let item of res.messageSequence.messages) {
125
+ let color = "";
126
+ let logLevel = "";
127
+ let createTime = Units.formateDate(item.createTime);
128
+ if (item.type === "SUC") {
129
+ color = "green"
130
+ logLevel = '成功';
131
+ } else if (item.type === "INFO") {
132
+ color = "black"
133
+ logLevel = '常规';
134
+ } else if (item.type === "ERROR") {
135
+ color = "red"
136
+ logLevel = '错误';
137
+ } else if (item.type === "WARN") {
138
+ color = "rgb(250, 225, 4)"
139
+ logLevel = '警告';
140
+ }
141
+ const msg = <div><p>{createTime}</p><p style={{color: color}}>{`【${logLevel}】` + item.text}</p>
142
+ </div>
143
+ MSG.push({level: item.type, msg});
144
+ this.setState({
145
+ statusMsg: res.message,
146
+ percent: Math.floor((res.current / res.totalCount) * 100),
147
+ logs: MSG,
148
+ })
149
+ if (res.completed === true) {
150
+ if(this.timerId){
151
+ clearInterval(this.timerId);
152
+ this.timerId=undefined;
153
+ message.success('导入完成!');
154
+ this.setState({
155
+ importStatus: 'success'
156
+ });
157
+ }
158
+ }
159
+ if (importStatus == 'stop') {
160
+ clearInterval(this.timerId);
161
+ }
162
+ }
155
163
  }
156
-
157
164
  })
158
165
  }
159
166
  onChangeShowLogLevelList = (showLogLevelList) => { //日志checkbox选择
@@ -52,6 +52,7 @@ import ImportRoute from './routable/import-route';
52
52
  // const ImportRoute = loadable(() =>
53
53
  // import("./routable/import-route"), {fallback: Loading});
54
54
  import LtmplRoute from "./routable/ltmpl-route";
55
+ import TtmplRoute from "./routable/ttmpl-route";
55
56
  // const LtmplRoute = loadable(() =>
56
57
  // import("./routable/ltmpl-route"), {fallback: Loading});
57
58
  import DtmplViewCard from './module/dtmpl-view-card';
@@ -115,7 +116,7 @@ import DatePicker from './controls/date-picker';
115
116
 
116
117
  import ModelStrucV3 from './tmpl/model-struc-v3';
117
118
 
118
- export {ActTable,SelectTable,Login,DtmplRoute,ImportRoute,LtmplRoute,DtmplViewCard,DtmplEditDrawer,DtmplEditModal,LtmplModal,LtmplDrawer,LtmplTable,Menu2layers,Block,UserBar,
119
+ export {ActTable,SelectTable,Login,DtmplRoute,ImportRoute,LtmplRoute,TtmplRoute,DtmplViewCard,DtmplEditDrawer,DtmplEditModal,LtmplModal,LtmplDrawer,LtmplTable,Menu2layers,Block,UserBar,
119
120
  ResetPassword,Footer,EntryControl,ViewControl,ProgramConfig,HydrocarbonService,QuickEntrance,Workbench,PopoverEntitySelect,DtmplEditCard,RouterLogin
120
121
  ,DatePicker,DtmplEditPage,TmplInterface,TmplDataSource,Superagent,DtmplEdit,HCWelcome,MainPage,ExcelImportRoute,CustomPageRouter,HCCustomPageRouter,L2MenuMessageBar,L2MenuQuickBar,ContextSetter,withRouter,ModelStrucV3}
121
122
 
@@ -64,6 +64,9 @@ export default {
64
64
  case "列表":
65
65
  routePath = 'act-table';
66
66
  break;
67
+ case "树":
68
+ routePath = 'act-tree';
69
+ break;
67
70
  case "添加":
68
71
  routePath = 'detail-edit';
69
72
  codeSource = '&codeSource=new';
@@ -43,7 +43,7 @@ class UserInfoBar extends React.PureComponent<UserInfoBarProps, UserInfoBarState
43
43
  <>{userCode?
44
44
  <>
45
45
  <span onClick={this.showDraw}>个人信息</span>
46
- {showDraw ?<DtmplViewDrawer serverKey={null} editable={editable} title={'个人信息'} width={'calc(100% - 280px)'} sourceId={gtmplSourceId} open={showDraw} code={userCode} onClose={this.closeDrawer}></DtmplViewDrawer>:null}
46
+ {showDraw ?<DtmplViewDrawer serverKey={null} editable={editable} title={'个人信息'} sourceId={gtmplSourceId} open={showDraw} code={userCode} onClose={this.closeDrawer}></DtmplViewDrawer>:null}
47
47
  </>:null } </>
48
48
  );
49
49
  }
@@ -6,6 +6,7 @@ import {CodeSource} from "../tmpl/interface";
6
6
  //以列表为入口的,页面内列表,基本原则是所有交互在页面内完成,不会触发路由。
7
7
 
8
8
  export interface DtmplViewCardProps {
9
+ title?:any,
9
10
  serverKey?:string,
10
11
  sourceId?:string,
11
12
  code?:string;
@@ -51,9 +52,9 @@ class DtmplViewCard extends React.PureComponent<DtmplViewCardProps, DtmplViewCar
51
52
 
52
53
  render() {
53
54
  const {showDtmplEdit} = this.state;
54
- const { sourceId,code,mainCode,editable,serverKey,codeSource} = this.props;
55
+ const { sourceId,code,mainCode,editable,serverKey,codeSource,title} = this.props;
55
56
  return <>
56
- <ActDtmplView codeSource={codeSource} serverKey={serverKey} goDtmpl={editable?this.goDtmpl:null} sourceId={sourceId} code={code} mainCode={mainCode}></ActDtmplView>
57
+ <ActDtmplView title={title} codeSource={codeSource} serverKey={serverKey} goDtmpl={editable?this.goDtmpl:null} sourceId={sourceId} code={code} mainCode={mainCode}></ActDtmplView>
57
58
  {showDtmplEdit? <DtmplEditModal codeSource={codeSource} serverKey={serverKey} open={showDtmplEdit} onCancel={()=>{
58
59
  this.setState({
59
60
  showDtmplEdit:false,
@@ -49,7 +49,7 @@ class DtmplViewDrawer extends React.PureComponent<DtmplViewDrawerProps, DtmplVie
49
49
  open={open}
50
50
  width={width}
51
51
  style={{
52
- maxWidth: "92vh",
52
+ maxWidth: "92vw",
53
53
  }}
54
54
  extra={
55
55
  <Space>
@@ -57,7 +57,7 @@ class DtmplViewDrawer extends React.PureComponent<DtmplViewDrawerProps, DtmplVie
57
57
  </Space>
58
58
  }
59
59
  >
60
- <DtmplViewCard codeSource={codeSource} serverKey={serverKey} editable={editable} sourceId={sourceId} code={code}></DtmplViewCard>
60
+ <DtmplViewCard codeSource={codeSource} serverKey={serverKey} editable={editable} sourceId={sourceId} code={code}></DtmplViewCard>
61
61
  </Drawer>)
62
62
  }
63
63
  }
@@ -0,0 +1,77 @@
1
+ import React from 'react'
2
+ import {AddOrUpdate, LtmplConfigRes, RouterCompProps, TtmplConfig} from '../tmpl/interface';
3
+
4
+ import HCDataSource from "../tmpl/hc-data-source";
5
+ import withRouter from "../routable/withroute";
6
+ import ActTree from "../tree/act-tree";
7
+ import {Card} from "antd";
8
+ export interface TtmplRouteProps extends RouterCompProps {
9
+
10
+ };
11
+
12
+ export interface TtmplRouteState {
13
+ ttmplConfig?: TtmplConfig,
14
+ };
15
+
16
+ class TtmplRoute extends React.PureComponent<TtmplRouteProps, TtmplRouteState> {
17
+ static defaultProps = {
18
+ basePath: "",
19
+ }
20
+ state = {
21
+ ttmplConfig: undefined,
22
+ }
23
+
24
+ async componentDidMount() {
25
+ this.loadData();
26
+ }
27
+
28
+ onRoute = (path) => {
29
+ this.props.navigate(path);
30
+ }
31
+
32
+ getMenuId = () => {
33
+ const {searchParams} = this.props;
34
+ let menuId = searchParams.get('menuId');
35
+ return menuId;
36
+ }
37
+
38
+ loadData = async () => {
39
+ const {params} = this.props;
40
+ const {sourceId} = params;
41
+ let ttmplConfig:TtmplConfig = await HCDataSource.requestTtmplConfig(null,sourceId);
42
+ //debugger
43
+ if(ttmplConfig.type=='1M'){
44
+ this.props.navigate(`/${ttmplConfig.id}/act-table`);
45
+ }else{
46
+ this.setState({
47
+ ttmplConfig:{...ttmplConfig},
48
+ })
49
+ }
50
+ }
51
+
52
+ async componentDidUpdate(prevProps) {
53
+ const {location,params} = this.props;
54
+ const {sourceId} = params;
55
+ let {sourceId: preSourceId} = prevProps.params;
56
+ let {location: preLocation} = prevProps;
57
+
58
+ if (sourceId && preSourceId && sourceId==preSourceId) {
59
+ return;
60
+ }
61
+ await this.loadData();
62
+ }
63
+
64
+ render() {
65
+ const { } = this.props;
66
+ const {ttmplConfig}=this.state;
67
+ if(!ttmplConfig){
68
+ return <Card loading={true}></Card>
69
+ }else{
70
+ return <><ActTree ttmplConfig={ttmplConfig}></ActTree></>;
71
+ }
72
+
73
+ }
74
+ }
75
+
76
+ export default withRouter(TtmplRoute);
77
+
@@ -242,7 +242,7 @@ class QueryTable extends React.PureComponent<QueryTableProps, QueryTableStat> {
242
242
  }
243
243
  })
244
244
  selectedRows.forEach((item) => {
245
- selectedRows_.push({code: item.code, title: item[titleColId]});
245
+ selectedRows_.push({code: item['code'], title: item[titleColId]});
246
246
  selectedDatas.push(item);
247
247
  })
248
248
  if (onChangeRowSelection) {