aldehyde 0.2.229 → 0.2.231

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 (52) hide show
  1. package/lib/controls/entity-select/popover-entity-select.d.ts.map +1 -1
  2. package/lib/controls/entity-select/popover-entity-select.js +12 -11
  3. package/lib/controls/entity-select/popover-entity-select.js.map +1 -1
  4. package/lib/controls/entry-control.d.ts.map +1 -1
  5. package/lib/controls/entry-control.js +8 -0
  6. package/lib/controls/entry-control.js.map +1 -1
  7. package/lib/controls/tree-select/tree-entity-select.d.ts +12 -0
  8. package/lib/controls/tree-select/tree-entity-select.d.ts.map +1 -0
  9. package/lib/controls/tree-select/tree-entity-select.js +86 -0
  10. package/lib/controls/tree-select/tree-entity-select.js.map +1 -0
  11. package/lib/module/dtmpl-edit-page.d.ts +1 -0
  12. package/lib/module/dtmpl-edit-page.d.ts.map +1 -1
  13. package/lib/module/dtmpl-edit-page.js.map +1 -1
  14. package/lib/table/act-table.d.ts.map +1 -1
  15. package/lib/table/act-table.js +37 -24
  16. package/lib/table/act-table.js.map +1 -1
  17. package/lib/table/column/summary-builder.d.ts +39 -0
  18. package/lib/table/column/summary-builder.d.ts.map +1 -0
  19. package/lib/table/column/summary-builder.js +508 -0
  20. package/lib/table/column/summary-builder.js.map +1 -0
  21. package/lib/table/query-table.d.ts +0 -20
  22. package/lib/table/query-table.d.ts.map +1 -1
  23. package/lib/table/query-table.js +14 -598
  24. package/lib/table/query-table.js.map +1 -1
  25. package/lib/tmpl/control-type-supportor.d.ts.map +1 -1
  26. package/lib/tmpl/control-type-supportor.js +6 -1
  27. package/lib/tmpl/control-type-supportor.js.map +1 -1
  28. package/lib/tmpl/interface.d.ts +0 -6
  29. package/lib/tmpl/interface.d.ts.map +1 -1
  30. package/lib/tmpl/interface.js.map +1 -1
  31. package/lib/tree/tmpl-tree.d.ts +9 -4
  32. package/lib/tree/tmpl-tree.d.ts.map +1 -1
  33. package/lib/tree/tmpl-tree.js +70 -94
  34. package/lib/tree/tmpl-tree.js.map +1 -1
  35. package/lib/tree/tree-node.js +1 -1
  36. package/lib/tree/tree-utils.d.ts +19 -0
  37. package/lib/tree/tree-utils.d.ts.map +1 -1
  38. package/lib/tree/tree-utils.js +128 -0
  39. package/lib/tree/tree-utils.js.map +1 -1
  40. package/package.json +1 -1
  41. package/src/aldehyde/controls/entity-select/popover-entity-select.tsx +9 -12
  42. package/src/aldehyde/controls/entry-control.tsx +20 -0
  43. package/src/aldehyde/controls/tree-select/tree-entity-select.tsx +113 -0
  44. package/src/aldehyde/module/dtmpl-edit-page.tsx +1 -0
  45. package/src/aldehyde/table/act-table.tsx +102 -84
  46. package/src/aldehyde/table/column/summary-builder.tsx +713 -0
  47. package/src/aldehyde/table/query-table.tsx +15 -835
  48. package/src/aldehyde/tmpl/control-type-supportor.tsx +8 -1
  49. package/src/aldehyde/tmpl/interface.tsx +0 -2
  50. package/src/aldehyde/tree/tmpl-tree.tsx +72 -89
  51. package/src/aldehyde/tree/tree-node.tsx +1 -1
  52. package/src/aldehyde/tree/tree-utils.tsx +138 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aldehyde",
3
- "version": "0.2.229",
3
+ "version": "0.2.231",
4
4
  "author": "cosmicparticle",
5
5
  "main": "lib/index.js",
6
6
  "module": "src/aldehyde/index.txs",
@@ -132,26 +132,24 @@ export default class PopoverEntitySelect extends React.PureComponent<
132
132
  return (
133
133
  <>
134
134
  <Popover
135
- overlayClassName={"-popover"}
135
+ //classNames={{ root: "-popover" }}
136
136
  placement="bottom"
137
- color={"#f0f0f0"}
138
- overlayStyle={{
139
- maxWidth: "calc(100vw - 60px)",
137
+ color={"#f0f0f0"}
138
+ styles={{root:{
139
+ maxWidth: "calc(100vw - 20vw)",
140
140
  maxHeight: "calc(100vh - 50px)",
141
- }}
142
- overlayInnerStyle={{ padding: "0px" }}
143
- // getPopupContainer={(triggerNode) => {
144
- // return triggerNode.parentNode;}}
141
+ },body:{ padding: "1px"}}}
142
+
145
143
  content={
146
144
  <div
147
145
  style={{
148
- height: 300,
146
+ height: 350,
149
147
  backgroundColor: "#fafafa",
150
148
  overflow: "auto",
151
149
  borderStyle: "solid",
152
150
  borderRadius: "6px",
153
- borderWidth: "0px",
154
- borderColor: "#8c8c8c",
151
+ borderWidth: "2px",
152
+ borderColor: "#d9d9d9",
155
153
  }}
156
154
  >
157
155
  <SelectTable
@@ -174,7 +172,6 @@ export default class PopoverEntitySelect extends React.PureComponent<
174
172
  placeholder={translate("${请选择}${" + fieldConfig.title + "}")}
175
173
  notFoundContent={translate("${请选择}")}
176
174
  allowClear={true}
177
- showArrow={true}
178
175
  suffixIcon={<SearchOutlined />}
179
176
  dropdownStyle={{ display: "none" }}
180
177
  onChange={(value) => {
@@ -18,6 +18,7 @@ import { LockOutlined } from "@ant-design/icons";
18
18
  import DatePicker from "./date-picker";
19
19
  import Select from "./select";
20
20
  import FieldHistory from "./field-history";
21
+ import TreeEntitySelect from "./tree-select/tree-entity-select";
21
22
 
22
23
  // const CheckboxGroup = Checkbox.Group;
23
24
  const RadioGroup = Radio.Group;
@@ -304,6 +305,7 @@ function renderControl(
304
305
  );
305
306
  break;
306
307
  case "relselectvalue":
308
+ case "entity-select-value":
307
309
  entryControl = (
308
310
  <EntitySelect valueOnly={true}
309
311
  baseCriteria={fieldConfig.baseCriteria}
@@ -328,6 +330,24 @@ function renderControl(
328
330
  />
329
331
  );
330
332
  break;
333
+ case "tree-entity-select":
334
+ entryControl = (
335
+ <TreeEntitySelect
336
+ baseCriteria={fieldConfig.baseCriteria}
337
+ maxSelected={max ? parseInt(max) : undefined}
338
+ {...controlProps}
339
+ />
340
+ );
341
+ break;
342
+ case "tree-entity-select-value":
343
+ entryControl = (
344
+ <TreeEntitySelect valueOnly={true}
345
+ baseCriteria={fieldConfig.baseCriteria}
346
+ maxSelected={max ? parseInt(max) : undefined}
347
+ {...controlProps}
348
+ />
349
+ );
350
+ break;
331
351
  case "progress":
332
352
  entryControl = <Progress {...controlProps}></Progress>;
333
353
  break;
@@ -0,0 +1,113 @@
1
+ import React, {useEffect, useState} from "react";
2
+ import {Card, Layout, TreeSelect, Typography} from "antd";
3
+ import TmplTree from "../../tree/tmpl-tree";
4
+ import TreeUtils, { TtmplNodeConfig } from "../../tree/tree-utils";
5
+ import {EControlProps, TtmplConfig} from "../../tmpl/interface";
6
+ import {DtmplEditCard, DtmplViewCard, HydrocarbonService} from "../../index";
7
+ import HcserviceV3 from "../../tmpl/hcservice-v3";
8
+ import { LocaleContext } from "../../locale/LocaleProvider";
9
+ import HCDataSource from "../../tmpl/hc-data-source";
10
+ import ActTree from "../../tree/act-tree";
11
+
12
+
13
+ interface TreeEntitySelectProps extends EControlProps {
14
+ maxSelected?: number;
15
+ onEntityClick?: (code: string) => void;
16
+ baseCriteria: object;
17
+ valueOnly?:boolean;
18
+ treeOpen?:boolean
19
+ }
20
+
21
+ // interface SelectTreeState {
22
+ // ttmplNodeConfig?: TtmplNodeConfig;
23
+ // showEdit?: boolean;
24
+ // showView?: boolean;
25
+ // recordCode?: string;
26
+ // mainCode?: string;
27
+ // sourceId?: string;
28
+ // cardtitle?: string;
29
+ // addTmplId?: string;
30
+ // }
31
+
32
+ const TreeEntitySelect=(props:TreeEntitySelectProps)=> {
33
+
34
+ const {fieldConfig,serverKey,value,treeOpen,valueOnly}=props
35
+ //const [ttmplNodeConfig, setTtmplNodeConfig] = useState<TtmplConfig>(undefined);
36
+ const [ttmplNodeConfig, setTtmplNodeConfig] = useState<TtmplNodeConfig>(undefined);
37
+ const [expandedKeys,setExpandedKeys]=useState(undefined);
38
+ const [treeData,setTreeData] =useState([]);
39
+ const [treeLoadedKeys,setTreeLoadedKeys] =useState([]);
40
+
41
+ useEffect( () => {
42
+ const getttmplConfig= async () =>{
43
+ let ttmplConfig= await HCDataSource.requestTtmplConfig(
44
+ serverKey,
45
+ fieldConfig.id);
46
+ let ttmplNodeConfig = await TreeUtils.initTtmplNodeConfig(ttmplConfig);
47
+ setTtmplNodeConfig(ttmplNodeConfig);
48
+ loadRootNodeData(ttmplNodeConfig);
49
+ }
50
+ getttmplConfig();
51
+ const loadRootNodeData = async (ttmplNodeConfig) => {
52
+ const data=await TreeUtils.loadRootNodeData(ttmplNodeConfig);
53
+ setTreeData(data);
54
+ }
55
+
56
+ }, [fieldConfig]);
57
+
58
+ const loadData=async (node)=>{
59
+ let v = await TreeUtils.reloadData(node.code,ttmplNodeConfig,treeData,expandedKeys);
60
+ setTreeData(v.data);
61
+ setExpandedKeys(v.expandedKeys);
62
+ }
63
+
64
+ const onTreeExpand=async (expandedKeys)=>{
65
+
66
+ setExpandedKeys(expandedKeys);
67
+ }
68
+
69
+ const onChange=async (value, label, extra)=>{
70
+
71
+ // let nodes= TreeUtils.getNodesOfArrayNode(treeData,[value]);
72
+ let nodes= TreeUtils.getNodesOfKey({children:treeData},[value]);
73
+ let values:string[]=[];
74
+ if(nodes){
75
+ debugger
76
+ nodes.forEach(n=>{
77
+ if(valueOnly){
78
+ values.push(n.name)
79
+ }else{
80
+ values.push(n.code+"@R@"+n.name)
81
+ }
82
+
83
+ })
84
+ }
85
+ if(props.onChange){
86
+ props.onChange(values);
87
+ }
88
+ console.log(nodes)
89
+ }
90
+
91
+ function getValue() {
92
+ if(value){
93
+ //获取checkkey
94
+ let codes:string[]=[];
95
+ value.forEach(c=>{
96
+ codes.push(c.split("@R@")[0]) ;
97
+ })
98
+ return TreeUtils.getNodeKeys(treeData,codes);
99
+ }
100
+ return undefined;
101
+ }
102
+
103
+ return <TreeSelect open ={treeOpen} allowClear value={getValue()}
104
+ onChange={onChange}
105
+ style={{width:'180px'}}
106
+ treeExpandedKeys={expandedKeys}
107
+ treeData={treeData}
108
+ loadData={loadData}
109
+ onTreeExpand={onTreeExpand}/>
110
+
111
+ }
112
+
113
+ export default TreeEntitySelect;
@@ -32,6 +32,7 @@ interface ModalEditorProps extends DtmplBaseProps {
32
32
  pageType: PageType;
33
33
  placement?: "top" | "right" | "bottom" | "left";
34
34
  title?: ReactNode;
35
+ extendButtons?:ReactNode[];
35
36
  }
36
37
 
37
38
  interface ModalEditorState {
@@ -11,7 +11,7 @@ import {
11
11
  Drawer,
12
12
  Modal,
13
13
  Tooltip,
14
- message,Statistic,
14
+ message, Statistic, Layout,
15
15
  } from "antd";
16
16
  import Table from "./control-table-x-axis-wrapper";
17
17
  import {
@@ -59,7 +59,9 @@ import BlockMenuTreeDrawer from "../module/block-menu-tree-drawer";
59
59
  import ModelSelectTable from "./../table/modal-select-table";
60
60
  import ColumnBuilder from "./column/column-builder";
61
61
  import ReportTable from "./report-table";
62
+ import EntryControl from "../controls/entry-control";
62
63
 
64
+ const { Content, Sider } = Layout;
63
65
  type Level = "l1" | "l2";
64
66
 
65
67
  const defaultDisabledColIds: string[] = ["20000", "10000"];
@@ -1113,91 +1115,110 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
1113
1115
  ""
1114
1116
  )}
1115
1117
  <div className="actTable">
1116
- {funcMode == "complete" || funcMode == "common" ? (
1117
- collapsible ? null : (
1118
- <span>
1118
+ <Row>
1119
+ <Col span={24}>
1120
+ {funcMode == "complete" || funcMode == "common" ? (
1121
+ collapsible ? null : (
1122
+ <span>
1119
1123
  {ltmplConfig.header ? (
1120
- <div
1121
- style={{ padding: "6px" }}
1122
- dangerouslySetInnerHTML={{ __html: ltmplConfig.header }}
1123
- ></div>
1124
+ <div
1125
+ style={{ padding: "6px" }}
1126
+ dangerouslySetInnerHTML={{ __html: ltmplConfig.header }}
1127
+ ></div>
1124
1128
  ) : null}
1125
- <h3 >
1129
+ <h3 >
1126
1130
  {" "}
1127
- <p style={{position:"relative",float: "left",marginBottom:"4px"}}> {!title
1128
- ? translate("${" + ltmplConfig.title + "}")
1129
- : typeof title == "string"
1130
- ? translate("${" + title + "}")
1131
- : title}</p>
1132
- {/*{translate("${" + (title ? title : ltmplConfig.title) + "}")}*/}
1133
- {/*<div style={{maxWidth:"600px",position:"relative",overflow:"auto",float: "left",marginTop:"-18px",marginLeft:"20px"}}>*/}
1134
- {/*<Space size={"large"} style={{}}>*/}
1135
- {/* <Statistic title="Active Users" value={112893} />*/}
1136
- {/*<Statistic title="Active Users" value={112893} /><Statistic title="Active Users" value={112893} />*/}
1137
- {/*<Statistic title="Active Users" value={112893} />*/}
1138
- {/*<Statistic title="Active Users" value={112893} />*/}
1139
- {/*<Statistic title="Active Users" value={112893} />*/}
1140
- {/*<Statistic title="Active Users" value={112893} />*/}
1141
- {/*<Statistic title="Active Users" value={112893} /><Statistic title="Active Users" value={112893} />*/}
1142
- {/* <Statistic title="Active Users" value={112893} />*/}
1143
- {/* <Statistic title="Active Users" value={112893} />*/}
1144
- {/* <Statistic title="Active Users" value={112893} />*/}
1145
- {/* <Statistic title="Active Users" value={112893} />*/}
1146
- {/* <Statistic title="Active Users" value={112893} />*/}
1147
- {/* <Statistic title="Active Users" value={112893} />*/}
1148
- {/*</Space></div>*/}
1149
- <p className="fr" style={{marginBottom:"4px"}}>{this.renderHeaderButtons()}</p>
1131
+ <p style={{position:"relative",float: "left",marginBottom:"4px"}}> {!title
1132
+ ? translate("${" + ltmplConfig.title + "}")
1133
+ : typeof title == "string"
1134
+ ? translate("${" + title + "}")
1135
+ : title}</p>
1136
+ {/*{translate("${" + (title ? title : ltmplConfig.title) + "}")}*/}
1137
+ {/*<div style={{maxWidth:"600px",position:"relative",overflow:"auto",float: "left",marginTop:"-18px",marginLeft:"20px"}}>*/}
1138
+ {/*<Space size={"large"} style={{}}>*/}
1139
+ {/* <Statistic title="Active Users" value={112893} />*/}
1140
+ {/*<Statistic title="Active Users" value={112893} /><Statistic title="Active Users" value={112893} />*/}
1141
+ {/*<Statistic title="Active Users" value={112893} />*/}
1142
+ {/*<Statistic title="Active Users" value={112893} />*/}
1143
+ {/*<Statistic title="Active Users" value={112893} />*/}
1144
+ {/*<Statistic title="Active Users" value={112893} />*/}
1145
+ {/*<Statistic title="Active Users" value={112893} /><Statistic title="Active Users" value={112893} />*/}
1146
+ {/* <Statistic title="Active Users" value={112893} />*/}
1147
+ {/* <Statistic title="Active Users" value={112893} />*/}
1148
+ {/* <Statistic title="Active Users" value={112893} />*/}
1149
+ {/* <Statistic title="Active Users" value={112893} />*/}
1150
+ {/* <Statistic title="Active Users" value={112893} />*/}
1151
+ {/* <Statistic title="Active Users" value={112893} />*/}
1152
+ {/*</Space></div>*/}
1153
+ <p className="fr" style={{marginBottom:"4px"}}>{this.renderHeaderButtons()}</p>
1150
1154
  </h3>
1151
1155
  </span>
1152
- )
1153
- ) : null}
1154
- {displayCriteriaCard ? this.renderCriteriaForm() : null}
1155
- {loading ? (
1156
- <Table loading={loading}></Table>
1157
- ) : (tableType =="report"?<ReportTable
1158
- tableProps={{scrollY:ltmplConfig.scrollY,clickDisplayTotal:!ltmplConfig.directShowTotal}}
1159
- serverKey={serverKey} hiddenColIds={hiddenColIds}
1160
- maxSelectedRows={this.checkBoxUseful() ? 1000 : -1}
1161
- columns={tableColumns}
1162
- selectedRows={selectedRows} queryKey={queryKey}
1163
- onChangeRowSelection={this.changeRowSelection}
1164
- leftFixedCols={ltmplConfig.leftFixedCols}
1165
- />:
1166
- <QueryTable
1167
- tableProps={{scrollY:ltmplConfig.scrollY,clickDisplayTotal:!ltmplConfig.directShowTotal}}
1168
- serverKey={serverKey}
1169
- onChangePage={onChangePage}
1170
- viewModels={viewModels}
1171
- primaryColumn={ltmplConfig.primaryColumn}
1172
- columnConfigs={columnConfigs}
1173
- summaryConfigs={ltmplConfig.totalColumnConfigs}
1174
- maxSelectedRows={this.checkBoxUseful() ? 10000 : -1}
1175
- selectedRows={selectedRows}
1176
- columns={tableColumns}
1177
- hiddenRowCodes={hiddenRowCodes}
1178
- pageInfo={{
1179
- pageNo: pageNo ? pageNo : 1,
1180
- pageSize: pageSize ? pageSize : ltmplConfig.defaultPageSize,
1181
- }}
1182
- queryKey={queryKey}
1183
- onChangeRowSelection={this.changeRowSelection}
1184
- subtotalXColumn={
1185
- ltmplConfig.subtotalXColumn == null ||
1186
- ltmplConfig.subtotalXColumn.length <= 0
1187
- ? null
1188
- : ltmplConfig.subtotalXColumn
1189
- }
1190
- subtotalYColumn={
1191
- ltmplConfig.subtotalYColumn == null ||
1192
- ltmplConfig.subtotalYColumn.length <= 0
1193
- ? null
1194
- : ltmplConfig.subtotalYColumn
1195
- }
1196
- groupIColumns={ltmplConfig.groupIColumns}
1197
- doSearch={doSearch}
1198
- sortColumnData={sortColumnData}
1199
- />
1200
- )}
1156
+ )
1157
+ ) : null}
1158
+ </Col>
1159
+ </Row>
1160
+ {(<Row><Col span={24}><Layout hasSider style={{ backgroundColor: "#fff" }}>
1161
+ <Sider
1162
+ width={0}
1163
+ theme={"light"}
1164
+ style={{
1165
+ paddingRight:'0px'
1166
+ // height: "90vh",
1167
+ // position: "fixed",
1168
+ // left: 0,
1169
+ // top: 126,
1170
+ // bottom: 0,
1171
+ // marginLeft: 210,
1172
+ }}
1173
+ >
1174
+ {/*<EntryControl fieldConfig={{id:"366429642427244544",controlType:"tree-entity-select"}}></EntryControl>*/}
1175
+ </Sider>
1176
+ <Layout style={{ backgroundColor: "#fff" }}>
1177
+ <Content style={{ overflow: "initial" }}>
1178
+ {displayCriteriaCard ? this.renderCriteriaForm() : null}
1179
+ { loading ? (
1180
+ <Table loading={loading}></Table>
1181
+ ) : (tableType =="report"?<ReportTable
1182
+ tableProps={{scrollY:ltmplConfig.scrollY,clickDisplayTotal:!ltmplConfig.directShowTotal}}
1183
+ serverKey={serverKey} hiddenColIds={hiddenColIds}
1184
+ maxSelectedRows={this.checkBoxUseful() ? 1000 : -1}
1185
+ columns={tableColumns}
1186
+ selectedRows={selectedRows} queryKey={queryKey}
1187
+ onChangeRowSelection={this.changeRowSelection}
1188
+ leftFixedCols={ltmplConfig.leftFixedCols}
1189
+ />:
1190
+ <QueryTable
1191
+ tableProps={{scrollY:ltmplConfig.scrollY,clickDisplayTotal:!ltmplConfig.directShowTotal}}
1192
+ serverKey={serverKey}
1193
+ onChangePage={onChangePage}
1194
+ viewModels={viewModels}
1195
+ primaryColumn={ltmplConfig.primaryColumn}
1196
+ columnConfigs={columnConfigs}
1197
+ summaryConfigs={ltmplConfig.totalColumnConfigs}
1198
+ maxSelectedRows={this.checkBoxUseful() ? 10000 : -1}
1199
+ selectedRows={selectedRows}
1200
+ columns={tableColumns}
1201
+ hiddenRowCodes={hiddenRowCodes}
1202
+ pageInfo={{
1203
+ pageNo: pageNo ? pageNo : 1,
1204
+ pageSize: pageSize ? pageSize : ltmplConfig.defaultPageSize,
1205
+ }}
1206
+ queryKey={queryKey}
1207
+ onChangeRowSelection={this.changeRowSelection}
1208
+ subtotalXColumn={
1209
+ ltmplConfig.subtotalXColumn == null ||
1210
+ ltmplConfig.subtotalXColumn.length <= 0
1211
+ ? null
1212
+ : ltmplConfig.subtotalXColumn
1213
+ }
1214
+ groupIColumns={ltmplConfig.groupIColumns}
1215
+ doSearch={doSearch}
1216
+ sortColumnData={sortColumnData}
1217
+ />) }
1218
+ </Content>
1219
+ </Layout>
1220
+ </Layout></Col></Row>
1221
+ )}
1201
1222
  {/*此处放页脚*/}
1202
1223
  {ltmplConfig.footer ? (
1203
1224
  <div
@@ -1234,9 +1255,6 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
1234
1255
  };
1235
1256
 
1236
1257
 
1237
-
1238
-
1239
-
1240
1258
  render() {
1241
1259
  let {
1242
1260
  queryKey,