aldehyde 0.2.181 → 0.2.183

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 (34) hide show
  1. package/lib/controls/action/utils.d.ts.map +1 -1
  2. package/lib/controls/action/utils.js +6 -0
  3. package/lib/controls/action/utils.js.map +1 -1
  4. package/lib/layout/menu/menu-render.d.ts.map +1 -1
  5. package/lib/layout/menu/menu-render.js +3 -0
  6. package/lib/layout/menu/menu-render.js.map +1 -1
  7. package/lib/layout2/page.d.ts.map +1 -1
  8. package/lib/layout2/page.js +3 -0
  9. package/lib/layout2/page.js.map +1 -1
  10. package/lib/routable/ltmpl-route.d.ts +4 -0
  11. package/lib/routable/ltmpl-route.d.ts.map +1 -1
  12. package/lib/routable/ltmpl-route.js +89 -33
  13. package/lib/routable/ltmpl-route.js.map +1 -1
  14. package/lib/table/query-table.d.ts.map +1 -1
  15. package/lib/table/query-table.js +23 -11
  16. package/lib/table/query-table.js.map +1 -1
  17. package/lib/tmpl/hcservice-v3.d.ts.map +1 -1
  18. package/lib/tmpl/hcservice-v3.js +3 -4
  19. package/lib/tmpl/hcservice-v3.js.map +1 -1
  20. package/lib/tmpl/interface.d.ts +13 -4
  21. package/lib/tmpl/interface.d.ts.map +1 -1
  22. package/lib/tmpl/interface.js.map +1 -1
  23. package/lib/units/index.d.ts.map +1 -1
  24. package/lib/units/index.js +0 -1
  25. package/lib/units/index.js.map +1 -1
  26. package/package.json +3 -3
  27. package/src/aldehyde/controls/action/utils.tsx +6 -0
  28. package/src/aldehyde/layout/menu/menu-render.tsx +3 -0
  29. package/src/aldehyde/layout2/page.tsx +3 -0
  30. package/src/aldehyde/routable/ltmpl-route.tsx +394 -282
  31. package/src/aldehyde/table/query-table.tsx +21 -13
  32. package/src/aldehyde/tmpl/hcservice-v3.tsx +36 -27
  33. package/src/aldehyde/tmpl/interface.tsx +17 -3
  34. package/src/aldehyde/units/index.tsx +1 -2
@@ -683,7 +683,12 @@ class QueryTable extends React.PureComponent<QueryTableProps, QueryTableStat> {
683
683
 
684
684
  // 序号
685
685
  if (columns[0].title === "序号") {
686
- const col: any = { dataIndex: "序号", title: "序号", width: 160 };
686
+ const col: any = {
687
+ dataIndex: "序号",
688
+ title: "序号",
689
+ width: 160,
690
+ order: -1,
691
+ };
687
692
  if (columns[0].colWidth) {
688
693
  col.width = columns[0].colWidth;
689
694
  }
@@ -773,11 +778,6 @@ class QueryTable extends React.PureComponent<QueryTableProps, QueryTableStat> {
773
778
  // 给小计和总计染色
774
779
  this.stain(proSummaryTableColumns);
775
780
 
776
- // 排序
777
- proSummaryTableColumns = proSummaryTableColumns.sort((a, b) => {
778
- return a.order < b.order ? -1 : 1;
779
- });
780
-
781
781
  // 删除默认数据在组内顺序字段
782
782
  proSummaryTableColumns.splice(
783
783
  proSummaryTableColumns.findIndex(
@@ -788,6 +788,14 @@ class QueryTable extends React.PureComponent<QueryTableProps, QueryTableStat> {
788
788
 
789
789
  proSummaryTableData.forEach((item) => delete item.orderInGroup);
790
790
 
791
+ // 排序
792
+ proSummaryTableColumns = proSummaryTableColumns.sort((a, b) => {
793
+ if (a.order === undefined && b.order === undefined) return 0;
794
+ if (a.order === undefined) return 1;
795
+ if (b.order === undefined) return -1;
796
+ return a.order < b.order ? -1 : 1;
797
+ });
798
+
791
799
  console.log("proSummaryTableColumns", proSummaryTableColumns);
792
800
  console.log("proSummaryTableData", proSummaryTableData);
793
801
 
@@ -864,7 +872,6 @@ class QueryTable extends React.PureComponent<QueryTableProps, QueryTableStat> {
864
872
  );
865
873
  data[key] = data[key]?.toString();
866
874
  }
867
- // debugger
868
875
  list.push(data);
869
876
  } else {
870
877
  for (const [k, v] of Object.entries(rowMp)) {
@@ -1033,17 +1040,18 @@ class QueryTable extends React.PureComponent<QueryTableProps, QueryTableStat> {
1033
1040
  sortColumnData.splice(tgt, 1);
1034
1041
  }
1035
1042
 
1036
- if (sorter.order) {
1043
+ if (sorter.order === "ascend") {
1037
1044
  Object.assign(extParams, {
1038
- sortColIds: [
1039
- ...sortColumnData,
1040
- sorter.field + "_" + (sorter.order === "ascend" ? "asc" : "desc"),
1041
- ],
1045
+ sortColIds: [...sortColumnData, sorter.field + "_" + "desc"],
1042
1046
  });
1043
- } else {
1047
+ } else if (sorter.order === "descend") {
1044
1048
  Object.assign(extParams, {
1045
1049
  sortColIds: [...sortColumnData],
1046
1050
  });
1051
+ } else {
1052
+ Object.assign(extParams, {
1053
+ sortColIds: [...sortColumnData, sorter.field + "_" + "asc"],
1054
+ });
1047
1055
  }
1048
1056
  this.props.doSearch(extParams);
1049
1057
  }
@@ -261,7 +261,11 @@ export default class HcserviceV3 {
261
261
  return res.versions;
262
262
  }
263
263
 
264
- static async requestFieldVersionList(serverKey: string, sourceId: string, code) {
264
+ static async requestFieldVersionList(
265
+ serverKey: string,
266
+ sourceId: string,
267
+ code
268
+ ) {
265
269
  let res = await Super.super({
266
270
  url: `/v3/dtmpl/field-data/versions`,
267
271
  serverKey,
@@ -575,24 +579,29 @@ export default class HcserviceV3 {
575
579
  static async deleteData(
576
580
  serverKey: string,
577
581
  sourceId,
578
- selectedRows: SelectedRow[],mainCode?
582
+ selectedRows: SelectedRow[],
583
+ mainCode?
579
584
  ) {
580
585
  const codes = this.getCodesOfSelectedRows(selectedRows);
581
- debugger
582
- return await this.deleteByCode(serverKey, sourceId, codes,mainCode);
586
+ return await this.deleteByCode(serverKey, sourceId, codes, mainCode);
583
587
  }
584
588
 
585
- static async deleteByCode(serverKey: string, sourceId, codes: string[],mainCode?) {
589
+ static async deleteByCode(
590
+ serverKey: string,
591
+ sourceId,
592
+ codes: string[],
593
+ mainCode?
594
+ ) {
586
595
  let res = await Super.super({
587
596
  url: `/v3/ltmpl/data`,
588
597
  serverKey,
589
598
  data: {
590
599
  codes,
591
- sourceId,mainCode
600
+ sourceId,
601
+ mainCode,
592
602
  },
593
603
  method: "DELETE",
594
604
  });
595
- debugger
596
605
  if (res && res.status == "success") {
597
606
  message.success(translate("${删除成功}"), 1);
598
607
  return true;
@@ -674,15 +683,20 @@ export default class HcserviceV3 {
674
683
  return res;
675
684
  }
676
685
 
677
- static async saveRatmplSelectCodes(serverKey: string, sourceId: string,mainCode, codes:string[] ) {
686
+ static async saveRatmplSelectCodes(
687
+ serverKey: string,
688
+ sourceId: string,
689
+ mainCode,
690
+ codes: string[]
691
+ ) {
678
692
  let res = await Super.super({
679
693
  url: `/v3/ratmpl-select/data`,
680
694
  serverKey,
681
695
  method: "POST",
682
- data: { codes,mainCode, sourceId },
696
+ data: { codes, mainCode, sourceId },
683
697
  });
684
698
  if (res && res.status != "success") {
685
- message.error(translate("${"+res.message+"}"));
699
+ message.error(translate("${" + res.message + "}"));
686
700
  }
687
701
  return res;
688
702
  }
@@ -747,7 +761,7 @@ export default class HcserviceV3 {
747
761
  static download(serverKey: string, path) {
748
762
  let vars = path.split("/");
749
763
  let fileName = vars[vars.length - 1];
750
- this.downloadDir(this.getFileUrl(serverKey, path),fileName);
764
+ this.downloadDir(this.getFileUrl(serverKey, path), fileName);
751
765
  // let vars = path.split("/");
752
766
  // let fileName = vars[vars.length - 1];
753
767
  // Units.downloadFile(
@@ -756,45 +770,40 @@ export default class HcserviceV3 {
756
770
  // );
757
771
  }
758
772
 
759
- static downloadDir(path,fileName) {
760
-
761
- // let fileName = this.getFileNameFrom(path);
762
- Units.downloadFile(
763
- path + `&disposition=attachment`,
764
- fileName
765
- );
773
+ static downloadDir(path, fileName) {
774
+ // let fileName = this.getFileNameFrom(path);
775
+ Units.downloadFile(path + `&disposition=attachment`, fileName);
766
776
  }
767
777
 
768
778
  static openfile(serverKey: string, path, toolbar) {
769
779
  let vars = path.split("/");
770
780
  let fileName = vars[vars.length - 1];
771
- this.openfileDir(fileName,this.getFileUrl(serverKey, path),toolbar)
781
+ this.openfileDir(fileName, this.getFileUrl(serverKey, path), toolbar);
772
782
  // Units.openFile(this.getFileUrl(serverKey, path), fileName, toolbar);
773
783
  }
774
784
 
775
785
  static getFileNameFrom(path) {
776
- if(!path){
786
+ if (!path) {
777
787
  return undefined;
778
788
  }
779
789
  let vars = path.split("/");
780
790
  let fileName = vars[vars.length - 1];
781
- return fileName;
791
+ return fileName;
782
792
  }
783
793
 
784
794
  static getFileSuffixFrom(fileName) {
785
- if(!fileName){
795
+ if (!fileName) {
786
796
  return undefined;
787
797
  }
788
- let ss=fileName.split('.');
789
- if(ss.length>1){
798
+ let ss = fileName.split(".");
799
+ if (ss.length > 1) {
790
800
  return ss.pop();
791
- }else{
801
+ } else {
792
802
  return undefined;
793
803
  }
794
804
  }
795
805
 
796
-
797
- static openfileDir(path,fileName, toolbar) {
806
+ static openfileDir(path, fileName, toolbar) {
798
807
  //let fileName = this.getFileNameFrom(path);
799
808
  Units.openFile(path, fileName, toolbar);
800
809
  }
@@ -16,7 +16,7 @@ export type StatColType = "fact" | "dimension";
16
16
  export type ActTableViewModel = "table" | "verticalList" | "horizontalList";
17
17
 
18
18
  export type ControlHolderType = "table" | "descriptions";
19
- export type PageType = "modal" | "drawer" | "card";
19
+ export type PageType = "modal" | "drawer" |"card"| "routing" |"blank";
20
20
  export interface TmplBase {
21
21
  id?: string;
22
22
  title?: string;
@@ -64,6 +64,13 @@ export interface ActionConfig extends ButtonConfig {
64
64
  writes: FieldConfig[];
65
65
  }
66
66
 
67
+ export interface BuinButtonConfig extends ButtonConfig {
68
+ showType: "routing"|"modal"|"drawer"|"blank";
69
+ windowPosition:"left"|"right"|"bottom"|"top";
70
+ windowHeight:number;
71
+ windowWidth:number;
72
+ }
73
+
67
74
  export interface CustomButton extends ButtonConfig {
68
75
  path:string;
69
76
  params:string;
@@ -131,7 +138,7 @@ export interface Level2Menu extends MenuBase {
131
138
  disabled?: boolean;
132
139
  hiddenOnDisabled?: boolean;
133
140
  defaultCriteriaValue?: object;
134
- pageType: "列表" | "详情" | "编辑" | "添加" | "编辑或添加" | "树";
141
+ pageType: "列表" | "详情" | "编辑" | "添加" | "编辑或添加" | "树"|"导入";
135
142
  programAuths?: ProgramAuth[];
136
143
  linkTarget?: HTMLAttributeAnchorTarget;
137
144
  }
@@ -272,9 +279,13 @@ export type Comparator =
272
279
  | "include_all"
273
280
  | "noless"
274
281
  | "nogreater"
282
+ | "less"
283
+ | "greater"
275
284
  | "exclude"
276
285
  | "noLess"
277
286
  | "noGreater"
287
+ | "Less"
288
+ | "Greater"
278
289
  |"none1" |"none1n";
279
290
 
280
291
  export type FieldAction = "add" | "delete" | "edit" | "detail" | "table";
@@ -384,6 +395,9 @@ export interface LtmplConfig extends SelectConfig {
384
395
  classAddConfigs?: ClassAddConfig[];
385
396
  classEditConfigs?: ClassEditConfig[];
386
397
  classViewConfigs?: ClassViewConfig[];
398
+ buttonAddConfig?:BuinButtonConfig;
399
+ buttonEditConfig?:BuinButtonConfig;
400
+ buttonViewConfig?:BuinButtonConfig;
387
401
  drillingParams?: CriteriaConfig[];
388
402
  footer?: string;
389
403
  header?: string;
@@ -582,7 +596,7 @@ export interface BlockType {
582
596
  disabled?: boolean; // 是否禁用
583
597
  hiddenOnDisabled?: boolean; // 是否隐藏
584
598
  customPath?: string; // 自定义页面路径
585
- pageType?: "列表" | "详情" | "编辑" | "添加" | "编辑或添加" | "树"; // 页面类型
599
+ pageType?: "列表" | "详情" | "编辑" | "添加" | "编辑或添加" | "树"|"导入"; // 页面类型
586
600
  defaultCriteriaValue?: { [key: string]: string }; // 一些组件参数
587
601
  linkTarget?: HTMLAttributeAnchorTarget; // 页面跳转方式
588
602
  items?: BlockType[];
@@ -600,7 +600,6 @@ export default {
600
600
  }
601
601
  //排序
602
602
  paramKeys.sort();
603
- debugger
604
603
  for (let key of paramKeys) {
605
604
  let value = data[key];
606
605
  let str = encodeURIComponent(key);
@@ -663,7 +662,7 @@ debugger
663
662
  obj[name] = [];
664
663
  }
665
664
  obj[name].push(
666
- decodeURIComponent(
665
+ decodeURIComponent(
667
666
  this.configParamTrans(
668
667
  res[1],
669
668
  this.getItemType(name, res[1], ltmplConfig)