aldehyde 0.2.527 → 0.2.529

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 (71) hide show
  1. package/lib/controls/direct-file-view/index.d.ts.map +1 -1
  2. package/lib/controls/direct-file-view/index.js +16 -4
  3. package/lib/controls/direct-file-view/index.js.map +1 -1
  4. package/lib/controls/entity-select/entity-select.d.ts.map +1 -1
  5. package/lib/controls/entity-select/entity-select.js +3 -3
  6. package/lib/controls/entity-select/entity-select.js.map +1 -1
  7. package/lib/controls/entity-select/index.css +6 -0
  8. package/lib/icon/local-aliIcon/iconfont.js +1 -1
  9. package/lib/icon/local-aliIcon/iconfont.js.map +1 -1
  10. package/lib/lowcode-components/heatmap-chart/index.d.ts +42 -0
  11. package/lib/lowcode-components/heatmap-chart/index.d.ts.map +1 -0
  12. package/lib/lowcode-components/heatmap-chart/index.js +326 -0
  13. package/lib/lowcode-components/heatmap-chart/index.js.map +1 -0
  14. package/lib/lowcode-components/index.d.ts +2 -0
  15. package/lib/lowcode-components/index.d.ts.map +1 -1
  16. package/lib/lowcode-components/index.js +2 -1
  17. package/lib/lowcode-components/index.js.map +1 -1
  18. package/lib/lowcode-components/lowcode-view/component/assets.d.ts.map +1 -1
  19. package/lib/lowcode-components/lowcode-view/component/assets.js +8 -0
  20. package/lib/lowcode-components/lowcode-view/component/assets.js.map +1 -1
  21. package/lib/module/dtmpl-edit-card.d.ts.map +1 -1
  22. package/lib/module/dtmpl-edit-card.js +2 -6
  23. package/lib/module/dtmpl-edit-card.js.map +1 -1
  24. package/lib/module/dtmpl-edit-page.d.ts.map +1 -1
  25. package/lib/module/dtmpl-edit-page.js +2 -6
  26. package/lib/module/dtmpl-edit-page.js.map +1 -1
  27. package/lib/module/ttmpl-table.d.ts +3 -0
  28. package/lib/module/ttmpl-table.d.ts.map +1 -1
  29. package/lib/module/ttmpl-table.js +15 -8
  30. package/lib/module/ttmpl-table.js.map +1 -1
  31. package/lib/routable/ttmpl-table-route.d.ts.map +1 -1
  32. package/lib/routable/ttmpl-table-route.js +32 -7
  33. package/lib/routable/ttmpl-table-route.js.map +1 -1
  34. package/lib/table/act-table.d.ts +1 -0
  35. package/lib/table/act-table.d.ts.map +1 -1
  36. package/lib/table/act-table.js +2 -2
  37. package/lib/table/act-table.js.map +1 -1
  38. package/lib/table/column/column-builder.d.ts.map +1 -1
  39. package/lib/table/column/column-builder.js +21 -4
  40. package/lib/table/column/column-builder.js.map +1 -1
  41. package/lib/table/relation-table.js +1 -1
  42. package/lib/table/relation-table.js.map +1 -1
  43. package/lib/tmpl/hc-data-source.d.ts +1 -0
  44. package/lib/tmpl/hc-data-source.d.ts.map +1 -1
  45. package/lib/tmpl/hc-data-source.js +11 -0
  46. package/lib/tmpl/hc-data-source.js.map +1 -1
  47. package/lib/tmpl/hcservice-v3.d.ts +1 -0
  48. package/lib/tmpl/hcservice-v3.d.ts.map +1 -1
  49. package/lib/tmpl/hcservice-v3.js +12 -0
  50. package/lib/tmpl/hcservice-v3.js.map +1 -1
  51. package/lib/tmpl/interface.d.ts +8 -0
  52. package/lib/tmpl/interface.d.ts.map +1 -1
  53. package/lib/tmpl/interface.js.map +1 -1
  54. package/package.json +1 -1
  55. package/src/aldehyde/controls/direct-file-view/index.tsx +14 -4
  56. package/src/aldehyde/controls/entity-select/entity-select.tsx +4 -5
  57. package/src/aldehyde/controls/entity-select/index.css +6 -0
  58. package/src/aldehyde/icon/local-aliIcon/iconfont.js +1 -1
  59. package/src/aldehyde/lowcode-components/heatmap-chart/index.tsx +362 -0
  60. package/src/aldehyde/lowcode-components/index.ts +4 -2
  61. package/src/aldehyde/lowcode-components/lowcode-view/component/assets.ts +8 -0
  62. package/src/aldehyde/module/dtmpl-edit-card.tsx +2 -6
  63. package/src/aldehyde/module/dtmpl-edit-page.tsx +2 -6
  64. package/src/aldehyde/module/ttmpl-table.tsx +25 -7
  65. package/src/aldehyde/routable/ttmpl-table-route.tsx +36 -7
  66. package/src/aldehyde/table/act-table.tsx +4 -2
  67. package/src/aldehyde/table/column/column-builder.tsx +31 -5
  68. package/src/aldehyde/table/relation-table.tsx +1 -1
  69. package/src/aldehyde/tmpl/hc-data-source.tsx +11 -0
  70. package/src/aldehyde/tmpl/hcservice-v3.tsx +11 -0
  71. package/src/aldehyde/tmpl/interface.tsx +3 -1
@@ -47,6 +47,8 @@ const Index = (props: Props) => {
47
47
  const [drawerSize, setDrawerSize] = useState<number | string>("92vw");
48
48
  const [isCopy, setIsCopy] = useState<boolean>(false); // 是否复制
49
49
  const [ettmplConfig, setEttmplConfig] = useState<EttmplConfig>(); // 展开树配置
50
+ const [ettmplRootSourceId, setEttmplRootSourceId] = useState<string>(); // 展开树配置根 sourceId
51
+ const [treeAddData, setTreeAddData] = useState<{ [key: string]: any }>(); // 展开树添加递归及关联关系配置
50
52
  const { sourceId } = useParams();
51
53
  const { search } = useLocation();
52
54
  const { translate } = useLocale();
@@ -63,11 +65,13 @@ const Index = (props: Props) => {
63
65
  }, [search])
64
66
 
65
67
  const getLtmplConfig = async () => {
66
- const ltmplConfigRes: LtmplConfigRes = await HCDataSource.requestLtmplConfig(serverKey, sourceId);
67
68
  const ettmplConfig: EttmplConfig = await HCDataSource.requestEttmplConfig(serverKey, sourceId);
68
- const ltmplConfig = ltmplConfigRes?.ltmplConfig;
69
+ const ettmplSourceId_ = ettmplConfig?.sourceId || "";
70
+ const ettmplLtmplConfig: LtmplConfigRes = await HCDataSource.requestEttmplLtmplConfig(serverKey, ettmplSourceId_, ettmplSourceId_);
71
+ const ltmplConfig = ettmplLtmplConfig?.ltmplConfig;
69
72
  setLtmplConfig(ltmplConfig);
70
73
  setEttmplConfig(ettmplConfig);
74
+ setEttmplRootSourceId(ettmplSourceId_);
71
75
  setPageLayout(ltmplConfig?.pageLayout || "none");
72
76
  };
73
77
 
@@ -216,6 +220,25 @@ const Index = (props: Props) => {
216
220
  }
217
221
  };
218
222
 
223
+ // 展开树行操作添加按钮
224
+ const doAddRaction = (ractionId: string, mainCode: string) => {
225
+ doClose();
226
+ let showType: PageType = !ltmplConfig.buttonAddConfig ? "default" : ltmplConfig.buttonAddConfig.showType;
227
+ let path = `${basePath}${computedLayoutPath}/${sourceId}/detail-edit?menuId=${menuId}&addTmplId=${ractionId ? ractionId : ""}`;
228
+ if (mainCode) {
229
+ path = path + `&mainCode=${mainCode}`;
230
+ }
231
+ if (showType === "routing") {
232
+ navigate(path);
233
+ } else if (showType === "blank") {
234
+ window.open("#" + path, '_blank');
235
+ } else {
236
+ setShowEdit(true);
237
+ setShowWindowType(pageLayout === "none" ? "drawer" : showType);
238
+ setTreeAddData({ ractionId, mainCode });
239
+ }
240
+ }
241
+
219
242
  const doRAction = (ractionId: string, mainCode: string) => {
220
243
  setSelectedCode(mainCode);
221
244
  setRactionId(ractionId);
@@ -224,11 +247,14 @@ const Index = (props: Props) => {
224
247
 
225
248
  // 嵌套表格配置
226
249
  const expandedRowRender = (val: { [key: string]: any }) => {
227
- const { subNodes, recursiveRatmplId } = ettmplConfig;
250
+ const { subNodes, recursiveRatmplId, sourceId: ettmplSourceId } = ettmplConfig;
228
251
  return <div style={{ marginLeft: "24px", background: token.colorBgContainer }}>
229
252
  {recursiveRatmplId ?
230
253
  <TtmplTable
254
+ isRecursion={true}
255
+ recursionSourceId={ettmplSourceId}
231
256
  ettmplConfig={ettmplConfig}
257
+ ettmplRootSourceId={ettmplRootSourceId}
232
258
  hideOnSinglePage={true}
233
259
  funcMode="simple"
234
260
  serverKey={serverKey}
@@ -239,6 +265,7 @@ const Index = (props: Props) => {
239
265
  {subNodes.length > 1 ? <h4 style={{ padding: "12px 0 0 12px" }}>{item.title}</h4> : ""}
240
266
  <TtmplTable
241
267
  ettmplConfig={item}
268
+ ettmplRootSourceId={ettmplRootSourceId}
242
269
  hideOnSinglePage={true}
243
270
  funcMode="simple"
244
271
  serverKey={serverKey}
@@ -275,6 +302,7 @@ const Index = (props: Props) => {
275
302
  showHeader={false}
276
303
  requestQueryKey={HcserviceV3.requestEttmplQueryKey}
277
304
  showEmpty={false}
305
+ doAddRaction={doAddRaction}
278
306
  />;
279
307
  };
280
308
 
@@ -294,6 +322,7 @@ const Index = (props: Props) => {
294
322
  setShowWindowType(undefined);
295
323
  setSelectedCode(undefined);
296
324
  setToCustomPage(false);
325
+ setTreeAddData(undefined);
297
326
  };
298
327
 
299
328
  // 关联查询close
@@ -364,8 +393,8 @@ const Index = (props: Props) => {
364
393
  open={showEdit}
365
394
  onOk={doSubmited}
366
395
  customPath={ltmplConfig?.customEditPagePath}
367
- sourceId={sourceId}
368
- mainCode={mainCode}
396
+ sourceId={treeAddData?.ractionId || sourceId}
397
+ mainCode={treeAddData?.mainCode || mainCode}
369
398
  code={selectedCode}
370
399
  isCopy={isCopy}
371
400
  />
@@ -379,8 +408,8 @@ const Index = (props: Props) => {
379
408
  width={windowSize.editWidth}
380
409
  height={windowSize.editHeight}
381
410
  onCancel={doClose}
382
- mainCode={mainCode}
383
- sourceId={editSourceId}
411
+ mainCode={treeAddData?.mainCode || mainCode}
412
+ sourceId={treeAddData?.ractionId || sourceId}
384
413
  code={selectedCode}
385
414
  onOk={doSubmited}
386
415
  isCopy={isCopy}
@@ -96,6 +96,7 @@ interface ActTableProps extends TmplBaseProps {
96
96
  bordered?: boolean; // 表格是否显示边框
97
97
  showHeader?: boolean; // 表格是否显示表头
98
98
  requestQueryKey?: Function; // queryKey 查询
99
+ doAddRaction?: (ractionId: string, mainCode: string) => void; // 展开树行操作添加按钮
99
100
  }
100
101
 
101
102
  interface ActTableStat {
@@ -1574,7 +1575,8 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
1574
1575
  title, collapsible,
1575
1576
  onChangePage, serverKey, criteriaData, showEmpty, loadDataCallback,
1576
1577
  showView, doEdit, doRAction, customEditable, readOnly, tableType, showPagination, showAggregates, userPageConfig,
1577
- doEdit2D, doView2D, showTableAdd, setUserPageConfig, expandable, hideOnSinglePage, bordered, showHeader, doAuditView, doAuditEdit
1578
+ doEdit2D, doView2D, showTableAdd, setUserPageConfig, expandable, hideOnSinglePage, bordered, showHeader, doAuditView, doAuditEdit,
1579
+ doAddRaction
1578
1580
  } = this.props;
1579
1581
  const { translate } = this.context;
1580
1582
 
@@ -1600,7 +1602,7 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
1600
1602
  doRowAction: this.doRowAction, doDeleteByCode: this.doDeleteByCode, sortColumns: criteriaData["sortColIds"],
1601
1603
  editings, editRowEdit: this.editRowEdit, cancelRowEdit: this.cancelRowEdit, saveRowData: this.saveRowData,
1602
1604
  doDelModalOpen: this.doDelModalOpen, mainCode, criteriaData: userCriteriaData, actTableDoSearch: this.actTableDoSearch,
1603
- columnResize: userPageConfig?.colResize, doEdit2D, doView2D, doAuditView, doAuditEdit
1605
+ columnResize: userPageConfig?.colResize, doEdit2D, doView2D, doAuditView, doAuditEdit, doAddRaction
1604
1606
  }
1605
1607
  );
1606
1608
 
@@ -1,8 +1,8 @@
1
1
  import React from "react";
2
- import { ActionRenderProps, ColumnConfig, DtmplData, LtmplConfig, FieldConfig, CustomButton, CQueryConfig } from "../../tmpl/interface";
2
+ import { ActionRenderProps, ColumnConfig, DtmplData, LtmplConfig, CustomButton, CQueryConfig } from "../../tmpl/interface";
3
3
  import TableUnits from "../table-util";
4
4
  import SupportInputTypes from "../../tmpl/control-type-supportor";
5
- import { Button, Popconfirm, Popover, Space, Tooltip, Form as AntdForm, theme, message } from "antd";
5
+ import { Button, Popconfirm, Popover, Space, Tooltip, Form as AntdForm, theme, message, Dropdown } from "antd";
6
6
  import { SortableHandle } from "react-sortable-hoc";
7
7
  import {
8
8
  AlignLeftOutlined, CopyOutlined, DeleteOutlined,
@@ -13,7 +13,7 @@ import {
13
13
  KeyOutlined,
14
14
  MenuOutlined, QuestionCircleOutlined, PlaySquareOutlined,
15
15
  SettingOutlined, UpSquareFilled, DownSquareFilled, AlignCenterOutlined,
16
- EditOutlined
16
+ EditOutlined, PlusOutlined
17
17
  } from "@ant-design/icons";
18
18
  import ActionUtils from "../../controls/action/utils";
19
19
  import ViewButton from "../../detail/button/view-button";
@@ -554,9 +554,9 @@ export default {
554
554
  readOnly,
555
555
  sourceId, translate, doCustomButton, doRowJump, blockMenuTreeDrawerOpen,
556
556
  doRowAction, doDeleteByCode, editRowEdit, editings, cancelRowEdit, saveRowData, doDelModalOpen,
557
- doView2D, doEdit2D, actTableDoSearch, doAuditView, doAuditEdit
557
+ doView2D, doEdit2D, actTableDoSearch, doAuditView, doAuditEdit, doAddRaction
558
558
  } = props;
559
- const { buttons, builtInButtons, defShowRowActionCount, strongDeleteConfirmText, edit2DBtnTitle, view2DBtnTitle, deleteBtnTitle, copyMode } = ltmplConfig;
559
+ const { buttons, builtInButtons, defShowRowActionCount, strongDeleteConfirmText, edit2DBtnTitle, view2DBtnTitle, deleteBtnTitle, copyMode, rowRactionAddConfigs } = ltmplConfig;
560
560
  let actionButtons: any[] = [];
561
561
 
562
562
  const isShowDetail = buttons.includes("detail") && showView && ActionUtils.isShow(ltmplConfig.buttonViewAction?.preposes, [record], undefined);
@@ -579,6 +579,32 @@ export default {
579
579
  buttonType={isShowCustomDetail ? "default" : "primary"} />);
580
580
  }
581
581
 
582
+ // 展开树行操作添加按钮
583
+ if (rowRactionAddConfigs?.length && doAddRaction && !readOnly) {
584
+ const temConfigs = rowRactionAddConfigs.filter(item => ActionUtils.isShow(item.addableActionConfig?.preposes, [record], undefined)); // 过滤前置条件
585
+ if (temConfigs?.length > 1) {
586
+ const temItems = temConfigs.map(item => ({ key: item.id, label: <Tooltip title={`${translate("${添加}")}${translate("${" + item.title + "}")}`}><div onClick={() => doAddRaction(item.id, record.code)}><PlusOutlined style={{ marginRight: "6px" }} /><span>{item.title}</span></div></Tooltip> }));
587
+ actionButtons.push(<Dropdown menu={{ items: temItems }}>
588
+ <Button
589
+ size="small"
590
+ type="dashed"
591
+ icon={<PlusOutlined />}
592
+ />
593
+ </Dropdown>);
594
+ } else if (temConfigs[0]) {
595
+ const tItem = temConfigs[0];
596
+ actionButtons.push(
597
+ <Tooltip title={`${translate("${添加}")}${translate("${" + tItem.title + "}")}`}>
598
+ <Button
599
+ onClick={() => doAddRaction(tItem.id, record.code)}
600
+ size="small"
601
+ type="dashed"
602
+ icon={<PlusOutlined />}
603
+ />
604
+ </Tooltip>);
605
+ }
606
+ }
607
+
582
608
  if (buttons.includes("dtmplEdit") && doEdit && !readOnly) {
583
609
  (
584
610
  actionButtons.push(<EditButton
@@ -790,7 +790,7 @@ class RelationTable extends React.PureComponent<
790
790
  if (res.status === "success") {
791
791
  this.cancelRowEdit(editStatus !== "new" ? res.code : code);
792
792
  if (editStatus === "new") {
793
- onChange(fieldGroupConfig, value.filter(item => item.code !== code)); // 单独提交添加成功后,删除原未保存的数据
793
+ onChange(fieldGroupConfig, value?.filter(item => item.code !== code)); // 单独提交添加成功后,删除原未保存的数据
794
794
  setTimeout(() => this.handleDtmplAdd(res.code), 100);
795
795
  } else {
796
796
  this.handleDtmplEdit(res.code);
@@ -48,6 +48,7 @@ const l2LtmplConfigMap: Map<string, LtmplConfigRes> = new Map<
48
48
  const dtmplConfigMap: Map<string, DtmplConfig> = new Map<string, DtmplConfig>();
49
49
  const ttmplConfigMap: Map<string, TtmplConfig> = new Map<string, TtmplConfig>();
50
50
  const ettmplConfigMap: Map<string, EttmplConfig> = new Map<string, EttmplConfig>();
51
+ const ettmplLtmplConfigMap: Map<string, LtmplConfigRes> = new Map<string, LtmplConfigRes>();
51
52
  const viewDtmplConfigMap: Map<string, DtmplConfig> = new Map<
52
53
  string,
53
54
  DtmplConfig
@@ -327,6 +328,16 @@ HCDataSource.requestEttmplConfig = async function (serverKey: string, sourceId:
327
328
  return ettmplConfigMap.get(sourceId);
328
329
  };
329
330
 
331
+ // 展开树页面Config请求,用于页面配置信息,设置操作列添加等
332
+ HCDataSource.requestEttmplLtmplConfig = async function (serverKey: string, ettmplId: string, sourceId: string) {
333
+ if (!ettmplLtmplConfigMap.has(sourceId)) {
334
+ let res = await HcserviceV3.requestEttmplLtmplConfig(serverKey, ettmplId, sourceId);
335
+ ettmplLtmplConfigMap.set(sourceId, res);
336
+ }
337
+ return ettmplLtmplConfigMap.get(sourceId);
338
+ };
339
+
340
+
330
341
  HCDataSource.requestViewDtmplConfig = async function (
331
342
  serverKey: string,
332
343
  sourceId: string
@@ -1621,4 +1621,15 @@ export default class HcserviceV3 {
1621
1621
  });
1622
1622
  return res;
1623
1623
  }
1624
+
1625
+ static async requestEttmplLtmplConfig(serverKey: string, ettmplId: string, sourceId: string) {
1626
+ let url = `v3/ettmpl/ltmpl/config`;
1627
+ let res = await Super.super({
1628
+ url,
1629
+ serverKey,
1630
+ method: "GET",
1631
+ query: { ettmplId, sourceId },
1632
+ });
1633
+ return res;
1634
+ }
1624
1635
  }
@@ -528,6 +528,7 @@ export interface ActionRenderProps {
528
528
  actTableDoSearch?: (data: object) => void,
529
529
  doAuditView?: (recordCode: string) => any, // 审计查看
530
530
  doAuditEdit?: (recordCode: string) => any, // 审计编辑
531
+ doAddRaction?: (ractionId: string, mainCode: string) => void, // 展开树行操作添加按钮
531
532
  }
532
533
 
533
534
  export interface FileRule {
@@ -722,6 +723,7 @@ export interface LtmplConfig extends SelectConfig {
722
723
  tableLayout?: "auto" | "fixed"; // 表格布局(自适应列宽/固定列宽)
723
724
  buttonAuditViewAction?: ActionConfig; // 审计查看按钮
724
725
  buttonAuditEditAction?: ActionConfig; // 审计编辑按钮
726
+ rowRactionAddConfigs?: { id: string, order: number, tip: string, title: string, addableActionConfig: ActionConfig }[]; // 展开树行操作添加按钮配置
725
727
  }
726
728
 
727
729
  export interface EnumItem {
@@ -778,7 +780,7 @@ export interface UserInfo {
778
780
  viewPersonalInfoable?: boolean;
779
781
  orgName?: string; // 组织名称
780
782
  extInfo?: DtmplData; // 用户信息
781
- devops?:boolean;
783
+ devops?: boolean;
782
784
  }
783
785
 
784
786
  export interface QueryKey {