aldehyde 0.2.126 → 0.2.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.
Files changed (43) hide show
  1. package/lib/controls/rfield/index.d.ts +1 -1
  2. package/lib/controls/rfield/index.d.ts.map +1 -1
  3. package/lib/controls/rfield/index.js +5 -2
  4. package/lib/controls/rfield/index.js.map +1 -1
  5. package/lib/controls/text/ellipsis-text.d.ts +1 -3
  6. package/lib/controls/text/ellipsis-text.d.ts.map +1 -1
  7. package/lib/controls/text/ellipsis-text.js +10 -12
  8. package/lib/controls/text/ellipsis-text.js.map +1 -1
  9. package/lib/controls/view-control.d.ts.map +1 -1
  10. package/lib/controls/view-control.js +126 -121
  11. package/lib/controls/view-control.js.map +1 -1
  12. package/lib/form/criteria-form.d.ts.map +1 -1
  13. package/lib/form/criteria-form.js +4 -4
  14. package/lib/form/criteria-form.js.map +1 -1
  15. package/lib/form/form-Item-group.js +1 -1
  16. package/lib/form/form-Item-group.js.map +1 -1
  17. package/lib/layout/MainPage.js.map +1 -1
  18. package/lib/layout/header/index.d.ts.map +1 -1
  19. package/lib/layout/header/index.js +5 -1
  20. package/lib/layout/header/index.js.map +1 -1
  21. package/lib/table/act-table.d.ts.map +1 -1
  22. package/lib/table/act-table.js +13 -1
  23. package/lib/table/act-table.js.map +1 -1
  24. package/lib/table/query-table.d.ts +10 -0
  25. package/lib/table/query-table.d.ts.map +1 -1
  26. package/lib/table/query-table.js +38 -14
  27. package/lib/table/query-table.js.map +1 -1
  28. package/lib/tmpl/interface.d.ts +3 -0
  29. package/lib/tmpl/interface.d.ts.map +1 -1
  30. package/lib/units/index.d.ts.map +1 -1
  31. package/lib/units/index.js.map +1 -1
  32. package/package.json +1 -1
  33. package/src/aldehyde/controls/rfield/index.tsx +9 -2
  34. package/src/aldehyde/controls/text/ellipsis-text.tsx +13 -13
  35. package/src/aldehyde/controls/view-control.tsx +144 -142
  36. package/src/aldehyde/form/criteria-form.tsx +5 -4
  37. package/src/aldehyde/form/form-Item-group.tsx +1 -1
  38. package/src/aldehyde/layout/MainPage.tsx +2 -2
  39. package/src/aldehyde/layout/header/index.tsx +5 -1
  40. package/src/aldehyde/table/act-table.tsx +13 -1
  41. package/src/aldehyde/table/query-table.tsx +47 -16
  42. package/src/aldehyde/tmpl/interface.tsx +3 -0
  43. package/src/aldehyde/units/index.tsx +1 -0
@@ -163,7 +163,7 @@ export default class FormItemGroup extends React.PureComponent<
163
163
  </FormItem>
164
164
  );
165
165
  } else {
166
- debugger;
166
+ // debugger;
167
167
  // console.log("getFieldValue ---", Form.useFormInstance());
168
168
  formItem = item.shouldUpdate ? (
169
169
  <FormItem noStyle shouldUpdate={item.shouldUpdate}>
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { Layout } from "antd";
2
+ import { Layout ,Affix} from "antd";
3
3
  import Footer from "./footer/index";
4
4
  import { BlockMenu } from "../tmpl/interface";
5
5
  import Header from "./header";
@@ -296,7 +296,7 @@ class MainPage extends React.PureComponent<MainPageProps, MainPageState> {
296
296
  }
297
297
  }
298
298
  >
299
- <Header toggle={this.toggle} {...this.state} />
299
+ <Header toggle={this.toggle} {...this.state} />
300
300
  <Content
301
301
  style={{
302
302
  margin: "24px 16px 0",
@@ -25,7 +25,11 @@ const Header: React.FC<HeaderProps> = (props) => {
25
25
  "--antd-color-primary": token.colorPrimary,
26
26
  } as CSSProperties;
27
27
  return (
28
- <AntdHeader style={{ padding: 0, height: "auto", minWidth: "760px" }}>
28
+ <AntdHeader style={{position: 'sticky',
29
+ top: 0,
30
+ zIndex: 100,
31
+ width: '100%',
32
+ padding: 0, height: "auto", minWidth: "760px" }}>
29
33
  {/*<Row justify="space-around" align="middle" style={{'background':'#0f4da1',height:'100px'}}>*/}
30
34
  {/* <Col span={12}>*/}
31
35
  {/* <img style={{height:'80px'}} src={Logo}></img>*/}
@@ -262,6 +262,8 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
262
262
  let s = 0;
263
263
  let colConfigs = sortedColConfigs ? sortedColConfigs : ltmplConfig.columns;
264
264
 
265
+ let currentDataColIndex=0;
266
+
265
267
  colConfigs.forEach((item) => {
266
268
  let column = {};
267
269
  if (!hiddenColIds || !hiddenColIds.includes(item.id)) {
@@ -283,6 +285,7 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
283
285
  //特殊列处理
284
286
  //序号
285
287
  if (item.title === "序号") {
288
+ column["width"] = item.colWidth?item.colWidth:40;
286
289
  //item.fixed='left';
287
290
  column["render"] = (text, record, index) => <label>{index + 1}</label>;
288
291
  item["sorter"] = undefined;
@@ -299,7 +302,7 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
299
302
  } else if (item.id == "20000") {
300
303
  //隐藏
301
304
  column["align"] = "center";
302
- column["width"] = 14;
305
+ column["width"] = 40;
303
306
  column["title"] = (
304
307
  <>
305
308
  {hiddenRowCodes.length > 0 ? (
@@ -333,6 +336,7 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
333
336
  } else if (item.title === "操作") {
334
337
  column["fixed"] = "right";
335
338
  column["align"] = "center";
339
+ column["width"] = item.colWidth?item.colWidth:160;
336
340
  column["className"] = "opsColumn";
337
341
  column["title"] = <>{translate("${操作}")}</>;
338
342
  column["render"] = (text, record) => (
@@ -517,8 +521,16 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
517
521
  </Space>
518
522
  );
519
523
  } else {
524
+ currentDataColIndex++;
520
525
  column["className"] = "opsColumn";
521
526
  column["title"] = translate("${" + item.title + "}");
527
+ column["width"]=item.colWidth?item.colWidth:160;
528
+ column["ellipsis"]={showTitle:true}
529
+ if(ltmplConfig.leftFixedCols && ltmplConfig.leftFixedCols>=currentDataColIndex){
530
+ column["fixed"]="left";
531
+ }else{
532
+ column["fixed"]= item.fixed ? item.fixed =='right'?"right":"left":false;
533
+ }
522
534
  column["render"] = (text, record) => {
523
535
  return (
524
536
  <ViewControl
@@ -37,6 +37,11 @@ interface QueryTableProps {
37
37
  pageNo: number;
38
38
  pageSize: number;
39
39
  };
40
+ tableProps?:{
41
+ size?:"small"|"middle"|"large",
42
+ clickDisplayTotal?:boolean,
43
+ scrollY?:number,
44
+ };
40
45
  primaryColumn?: ColumnConfig;
41
46
  columns: any[];
42
47
  serverKey?: string;
@@ -73,6 +78,11 @@ class QueryTable extends React.PureComponent<QueryTableProps, QueryTableStat> {
73
78
  pageSize: 10,
74
79
  virtualEndPageNo: undefined,
75
80
  },
81
+ tableProps:{
82
+ size:"small",
83
+ clickDisplayTotal:false,
84
+ scrollY:500,
85
+ },
76
86
  hiddenRowCodes: [],
77
87
  selectedRows: [],
78
88
  viewModels: ["table"],
@@ -100,6 +110,7 @@ class QueryTable extends React.PureComponent<QueryTableProps, QueryTableStat> {
100
110
  // }
101
111
  if (queryKey) {
102
112
  await this.loadData(queryKey.key, pageInfo);
113
+
103
114
  }
104
115
  }
105
116
 
@@ -168,7 +179,7 @@ class QueryTable extends React.PureComponent<QueryTableProps, QueryTableStat> {
168
179
  });
169
180
  let { queryDataCache } = this.state;
170
181
 
171
- let { serverKey } = this.props;
182
+ let { serverKey,tableProps } = this.props;
172
183
  let queryCache: Map<string, CacheData>;
173
184
  if (cleanCache || !queryDataCache) {
174
185
  queryCache = new Map<string, CacheData>();
@@ -213,6 +224,11 @@ class QueryTable extends React.PureComponent<QueryTableProps, QueryTableStat> {
213
224
  touchEnd,
214
225
  loading: false,
215
226
  });
227
+
228
+ if(!tableProps.clickDisplayTotal){
229
+ await this.queryTotal();
230
+ }
231
+ // }
216
232
  }
217
233
  };
218
234
 
@@ -347,9 +363,8 @@ class QueryTable extends React.PureComponent<QueryTableProps, QueryTableStat> {
347
363
  };
348
364
 
349
365
  getTableSummaryNumberValue(value: "" | string[]) {
350
- if (value === undefined || value === null) return 0;
366
+ if (value === undefined || value === null ) return 0;
351
367
  if (typeof value === "string") return Number(value);
352
-
353
368
  return Number(value[0].split("@R@")[1]);
354
369
  }
355
370
 
@@ -442,8 +457,12 @@ class QueryTable extends React.PureComponent<QueryTableProps, QueryTableStat> {
442
457
  const columns = _columns;
443
458
  for (const d of data) {
444
459
  for (const [k, v] of Object.entries(d)) {
445
- if (typeof v === "string" && (v as string)?.includes("@R@"))
460
+ if(v==null || v=='null'){
461
+ d[k] = "" ;
462
+ }else
463
+ if (typeof v === "string" && (v as string)?.includes("@R@")){
446
464
  d[k] = (v as string).split("@R@")[1];
465
+ }
447
466
  }
448
467
  }
449
468
 
@@ -700,7 +719,9 @@ class QueryTable extends React.PureComponent<QueryTableProps, QueryTableStat> {
700
719
  }
701
720
  }
702
721
 
703
- if (data[key] === undefined) data[key] = BigNumber(0);
722
+ if (data[key] === undefined || data[key]=="") {
723
+ data[key] = BigNumber(0);
724
+ }
704
725
  if (cal === "sum")
705
726
  data[key] = colTarget.reduce(
706
727
  (last, d) => last.plus(BigNumber(d[targetKey])),
@@ -712,14 +733,14 @@ class QueryTable extends React.PureComponent<QueryTableProps, QueryTableStat> {
712
733
  last.plus(BigNumber(d[targetKey]).div(colTarget.length)),
713
734
  BigNumber(0)
714
735
  );
715
- data[key] = data[key]?.toString();
736
+ data[key] = data[key]?.toString()=="NaN"?"0":data[key]?.toString();
716
737
  }
717
738
 
718
739
  for (const calCol of flatSummaryCalTitle) {
719
740
  const key = this.buildKeys(calCol);
720
741
  const sumDataIndex = calCol[calCol.length - 1].sumDataIndex;
721
742
 
722
- if (data[key] === undefined) data[key] = BigNumber(0);
743
+ if (data[key] === undefined || data[key]=="" ) data[key] = BigNumber(0);
723
744
  if (cal === "sum")
724
745
  data[key] = sumDataIndex.reduce(
725
746
  (last, dataKey) => last.plus(BigNumber(data[dataKey])),
@@ -733,6 +754,7 @@ class QueryTable extends React.PureComponent<QueryTableProps, QueryTableStat> {
733
754
  );
734
755
  data[key] = data[key]?.toString();
735
756
  }
757
+ // debugger
736
758
  list.push(data);
737
759
  } else {
738
760
  for (const [k, v] of Object.entries(rowMp)) {
@@ -827,6 +849,7 @@ class QueryTable extends React.PureComponent<QueryTableProps, QueryTableStat> {
827
849
  summaryConfigs,
828
850
  subtotalXColumn,
829
851
  subtotalYColumn,
852
+ tableProps,
830
853
  } = this.props;
831
854
  const { touchEnd, total, loading, virtualEndPageNo } = this.state;
832
855
  const { translate } = this.context;
@@ -838,24 +861,32 @@ class QueryTable extends React.PureComponent<QueryTableProps, QueryTableStat> {
838
861
  proSummaryTableData,
839
862
  } = this.handleProSummaryTable(this.getUnHidenDataSource());
840
863
 
841
- return (
864
+ let current_cols = isProSumarryTable
865
+ ? proSummaryTableColumns
866
+ : columns
867
+ ? columns
868
+ : [];
869
+ console.log(current_cols);
870
+ let table_x=200;
871
+ current_cols.forEach((c)=>{
872
+ table_x=table_x+c.width?c.width:140;
873
+ });
874
+
875
+ return (
842
876
  <>
843
877
  {viewModels.includes("table") ? (
844
878
  <Table
845
- size={"middle"}
879
+ size={tableProps.size?tableProps.size:"middle"}
846
880
  rowSelection={this.getRowSelection()}
847
- columns={
848
- isProSumarryTable
849
- ? proSummaryTableColumns
850
- : columns
851
- ? columns
852
- : []
853
- }
881
+ columns={current_cols}
854
882
  dataSource={
855
883
  isProSumarryTable
856
884
  ? proSummaryTableData
857
885
  : this.getUnHidenDataSource()
858
886
  }
887
+ //tableLayout={'fixed'}
888
+ //sticky
889
+ scroll={ tableProps.scrollY ==-1?null:{y: tableProps.scrollY ==0 ? 500:tableProps.scrollY, x:table_x}}
859
890
  bordered
860
891
  pagination={false}
861
892
  style={{ display: columns ? "block" : "none" }}
@@ -117,6 +117,7 @@ export interface CriteriaConfig extends FieldConfig {}
117
117
  export interface ColumnConfig extends FieldConfig {
118
118
  statColType?: StatColType;
119
119
  colWidth?: number;
120
+ fixed?:"left"|'right'|boolean,
120
121
  id: string;
121
122
  }
122
123
 
@@ -268,6 +269,8 @@ export interface SelectConfig extends TmplBase {
268
269
  orderColumn: ColumnConfig;
269
270
  totalColummConfigs?: ColumnConfig[];
270
271
  showDim?: boolean;
272
+ clickDisplayTotal?:boolean;
273
+ leftFixedCols?:number;
271
274
  }
272
275
 
273
276
  export interface TtmplConfigRes {
@@ -528,6 +528,7 @@ export default {
528
528
  return defaultValue.startsWith("$$current");
529
529
  },
530
530
  configParamTrans(value: string) {
531
+
531
532
  if (value && value.startsWith && value.startsWith("$$current")) {
532
533
  return TmplConfigAnalysis.current(value);
533
534
  }