aldehyde 0.2.408 → 0.2.409

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 (35) hide show
  1. package/lib/detail/view/act-dtmpl-view.d.ts.map +1 -1
  2. package/lib/detail/view/act-dtmpl-view.js +22 -22
  3. package/lib/detail/view/act-dtmpl-view.js.map +1 -1
  4. package/lib/detail/view/dtmpl-view.d.ts +3 -2
  5. package/lib/detail/view/dtmpl-view.d.ts.map +1 -1
  6. package/lib/detail/view/dtmpl-view.js +33 -31
  7. package/lib/detail/view/dtmpl-view.js.map +1 -1
  8. package/lib/form/criteria-form.d.ts +1 -0
  9. package/lib/form/criteria-form.d.ts.map +1 -1
  10. package/lib/form/criteria-form.js +11 -4
  11. package/lib/form/criteria-form.js.map +1 -1
  12. package/lib/routable/ltmpl-route.d.ts.map +1 -1
  13. package/lib/routable/ltmpl-route.js +0 -1
  14. package/lib/routable/ltmpl-route.js.map +1 -1
  15. package/lib/table/act-table.d.ts.map +1 -1
  16. package/lib/table/act-table.js +30 -17
  17. package/lib/table/act-table.js.map +1 -1
  18. package/lib/table/relation-table.d.ts +4 -1
  19. package/lib/table/relation-table.d.ts.map +1 -1
  20. package/lib/table/relation-table.js +19 -15
  21. package/lib/table/relation-table.js.map +1 -1
  22. package/lib/tmpl/interface.d.ts +1 -0
  23. package/lib/tmpl/interface.d.ts.map +1 -1
  24. package/lib/tmpl/interface.js.map +1 -1
  25. package/lib/welcome/HCWelcome.js +1 -1
  26. package/lib/welcome/HCWelcome.js.map +1 -1
  27. package/package.json +1 -1
  28. package/src/aldehyde/detail/view/act-dtmpl-view.tsx +59 -60
  29. package/src/aldehyde/detail/view/dtmpl-view.tsx +79 -82
  30. package/src/aldehyde/form/criteria-form.tsx +16 -4
  31. package/src/aldehyde/routable/ltmpl-route.tsx +0 -1
  32. package/src/aldehyde/table/act-table.tsx +30 -15
  33. package/src/aldehyde/table/relation-table.tsx +52 -55
  34. package/src/aldehyde/tmpl/interface.tsx +1 -0
  35. package/src/aldehyde/welcome/HCWelcome.js +1 -1
@@ -37,6 +37,8 @@ import DraggableModal from "../module/draggable-modal";
37
37
  const { Content, Sider } = Layout;
38
38
  type Level = "l1" | "l2";
39
39
 
40
+ const enumTypes = ["select", "multiselect", "texttags", "checkbox", "radio", "steps"];
41
+
40
42
 
41
43
  const defaultDisabledColIds: string[] = ["20000", "10000"];
42
44
 
@@ -156,16 +158,26 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
156
158
  const options = ltmplConfig.split2TabCriterias.map(fieldConfig => {
157
159
  const id = `c_${fieldConfig.id}`;
158
160
  allIds.push(id);
159
- const items = HCDataSource.getEnums(fieldConfig.mstrucId);
160
- const options = items.map((item) => ({
161
- label: <span style={{ padding: "0 10px" }}>{translate("${" + item.title + "}")}</span>,
162
- key: item.value,
163
- id
164
- }));
165
- if (fieldConfig.relDeduplication && fieldConfig.exceptCodes?.length) {
166
- return options.filter(item => !fieldConfig.exceptCodes.includes(item.key));
161
+ if (enumTypes.includes(fieldConfig.controlType || fieldConfig.extControlType)) {
162
+ const items = HCDataSource.getEnums(fieldConfig.mstrucId);
163
+ const options = items.map((item) => ({
164
+ label: <span style={{ padding: "0 10px" }}>{translate("${" + item.title + "}")}</span>,
165
+ key: item.value,
166
+ id
167
+ }));
168
+ if (fieldConfig.relDeduplication && fieldConfig.exceptCodes?.length) {
169
+ return options.filter(item => !fieldConfig.exceptCodes.includes(item.key));
170
+ }
171
+ return options;
167
172
  }
168
- return options;
173
+ if ([fieldConfig.controlType, fieldConfig.extControlType].includes("single-checkbox")) {
174
+ return [{
175
+ label: <span style={{ padding: "0 10px" }}>{translate("${" + fieldConfig.title + "}")}</span>,
176
+ key: "1",
177
+ id
178
+ }];
179
+ }
180
+ return [];
169
181
  })?.flat() || [];
170
182
  const defOption = {
171
183
  label: <span style={{ padding: "0 10px" }}>{translate("${全部}")}</span>,
@@ -1151,8 +1163,9 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
1151
1163
  }
1152
1164
 
1153
1165
  renderCriteriaForm = () => {
1154
- let { loading, selectedRows, selectedDatas, userCriteriaData, editings } = this.state;
1155
- let { ltmplConfig, criteriaData, serverKey, sourceId } = this.props;
1166
+ let { loading, selectedRows, selectedDatas, userCriteriaData, editings, tabActiveKey, tabsOptions } = this.state;
1167
+ let { ltmplConfig, serverKey, sourceId } = this.props;
1168
+ const tabCriteriaId = tabsOptions.find(r => r.key === tabActiveKey)?.id;
1156
1169
  return (
1157
1170
  <CriteriaForm
1158
1171
  key={sourceId}
@@ -1170,6 +1183,7 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
1170
1183
  doSearch={this.actTableDoSearch}
1171
1184
  doMultiRowEdit={this.doMultiRowEdit}
1172
1185
  multiRowEditDisabled={!editings.length}
1186
+ tabCriteriaId={tabCriteriaId}
1173
1187
  />
1174
1188
  );
1175
1189
  };
@@ -1295,11 +1309,12 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
1295
1309
  let new_serial_number = new Date().getTime();
1296
1310
  if (new_serial_number - serial_number < 2000) return;
1297
1311
  if (tabActiveKey === val) return;
1312
+ const ids = tabsOptions.find(r => r.key === "all").ids || [];
1298
1313
  const item = tabsOptions.find(r => r.key === val);
1299
- let params = { [item.id]: val };
1300
- if (val === "all") {
1301
- params = item.ids?.reduce((total, cur) => { total[cur] = undefined; return total; }, {});
1302
- }
1314
+ let params = ids?.reduce((total, cur) => {
1315
+ total[cur] = (val === "all" || cur !== item.id) ? undefined : val;
1316
+ return total;
1317
+ }, {});
1303
1318
  this.actTableDoSearch(params);
1304
1319
  this.setState({ tabActiveKey: val });
1305
1320
  }
@@ -61,6 +61,7 @@ interface RelationTableProps {
61
61
  onChange?: (fieldGroupConfig: FieldGroupConfig, value: DtmplData[]) => void;
62
62
  onEditing?: (editing: boolean) => void;
63
63
  initCollapse?: boolean;
64
+ showCollapseCard?: boolean; // 是否显示折叠卡片,默认显示
64
65
  }
65
66
 
66
67
  interface RelationTableStat {
@@ -98,7 +99,9 @@ class RelationTable extends React.PureComponent<
98
99
  };
99
100
  static contextType = LocaleContext;
100
101
  context: React.ContextType<typeof LocaleContext>;
101
- static defaultProps = {};
102
+ static defaultProps = {
103
+ showCollapseCard: true,
104
+ };
102
105
  formRef = React.createRef<FormInstance>();
103
106
 
104
107
  async componentDidMount() {
@@ -959,7 +962,7 @@ class RelationTable extends React.PureComponent<
959
962
  initCollapse,
960
963
  mainCode,
961
964
  serverKey,
962
- showRightNav, parentFormInstance
965
+ showRightNav, parentFormInstance, showCollapseCard
963
966
  } = this.props;
964
967
  const {
965
968
  pageSize,
@@ -994,52 +997,52 @@ class RelationTable extends React.PureComponent<
994
997
  }
995
998
  }
996
999
 
1000
+ const renderEditTableList = <div className="editTableList">
1001
+ {this.buildButtons()}
1002
+ {viewModel && viewModel === "verticalList" ? <VerticalList
1003
+ dataSource={this.buildDataSource()}
1004
+ columnConfigs={fieldGroupConfig?.fields}
1005
+ serverKey={serverKey}
1006
+ columns={this.buildColumns()} /> :
1007
+ <AntdForm ref={this.formRef} component={false}>
1008
+ <Table
1009
+ size={"small"}
1010
+ locale={{
1011
+ emptyText: (
1012
+ <div style={{ textAlign: "center", width: "100%" }}>
1013
+ <Text disabled>{translate("${暂无数据}...")}</Text>
1014
+ </div>
1015
+ ),
1016
+ }}
1017
+ bordered
1018
+ loading={tableLoading}
1019
+ dataSource={this.buildDataSource()}
1020
+ columns={this.buildColumns()}
1021
+ pagination={page}
1022
+ onChange={this.tabChange}
1023
+ /></AntdForm>}
1024
+ </div>;
1025
+
1026
+ console.log("showCollapseCard", showCollapseCard);
1027
+
997
1028
  return fieldGroupConfig.displayConfig.includes("nonDataNonDisplayed") &&
998
- (!value || value.length <= 0) ? (
999
- ""
1000
- ) : (
1029
+ (!value || value.length <= 0) ? "" : (
1001
1030
  <>
1002
- <CollapseCard
1003
- showRightNav={showRightNav}
1004
- initCollapse={
1005
- initCollapse || fieldGroupConfig.displayConfig.includes("folded")
1006
- }
1007
- title={fieldGroupConfig.title}
1008
- tip={fieldGroupConfig.tip}
1009
- id={parentId + fieldGroupConfig.id}
1010
- className={`hoverable`}
1011
- styles={{ header: { background: "#f2f4f5" }, body: { padding: "6px" } }}
1012
- loading={loading}
1013
- //暂时注释掉,后续要支持配置。
1014
- //extra={<Input.Search onSearch={this.searchValue} allowClear placeholder=""/>}
1015
- >
1016
- <div className="editTableList">
1017
- {this.buildButtons()}
1018
- {viewModel && viewModel == "verticalList" ? <VerticalList
1019
- dataSource={this.buildDataSource()}
1020
- columnConfigs={fieldGroupConfig?.fields}
1021
- serverKey={serverKey}
1022
- columns={this.buildColumns()} /> :
1023
- <AntdForm
1024
- ref={this.formRef} component={false}>
1025
- <Table
1026
- size={"small"}
1027
- locale={{
1028
- emptyText: (
1029
- <div style={{ textAlign: "center", width: "100%" }}>
1030
- <Text disabled>{translate("${暂无数据}...")}</Text>
1031
- </div>
1032
- ),
1033
- }}
1034
- bordered
1035
- loading={tableLoading}
1036
- dataSource={this.buildDataSource()}
1037
- columns={this.buildColumns()}
1038
- pagination={page}
1039
- onChange={this.tabChange}
1040
- /></AntdForm>}
1041
- </div>
1042
- </CollapseCard>
1031
+ {showCollapseCard ?
1032
+ <CollapseCard
1033
+ showRightNav={showRightNav}
1034
+ initCollapse={initCollapse || fieldGroupConfig.displayConfig.includes("folded")}
1035
+ title={fieldGroupConfig.title}
1036
+ tip={fieldGroupConfig.tip}
1037
+ id={parentId + fieldGroupConfig.id}
1038
+ className="hoverable"
1039
+ styles={{ header: { background: "#f2f4f5" }, body: { padding: "6px" } }}
1040
+ loading={loading}
1041
+ //暂时注释掉,后续要支持配置。
1042
+ //extra={<Input.Search onSearch={this.searchValue} allowClear placeholder=""/>}
1043
+ >
1044
+ {renderEditTableList}
1045
+ </CollapseCard> : renderEditTableList}
1043
1046
  {buttons.includes("detail") ? (
1044
1047
  <ModalDtmplView
1045
1048
  serverKey={serverKey}
@@ -1051,9 +1054,7 @@ class RelationTable extends React.PureComponent<
1051
1054
  >
1052
1055
  {" "}
1053
1056
  </ModalDtmplView>
1054
- ) : (
1055
- ""
1056
- )}
1057
+ ) : ""}
1057
1058
  {buttons.includes("dtmplEdit") || buttons.includes("dtmplAdd") ? (
1058
1059
  <DtmplEditPage
1059
1060
  addTmplId={addTmplId}
@@ -1066,9 +1067,7 @@ class RelationTable extends React.PureComponent<
1066
1067
  parentFormInstance={parentFormInstance}
1067
1068
  onOk={selectedCode ? this.handleDtmplEdit : this.handleDtmplAdd}
1068
1069
  />
1069
- ) : (
1070
- ""
1071
- )}
1070
+ ) : ""}
1072
1071
  {buttons.includes("selectAdd") ? (
1073
1072
  <ModelSelectTable
1074
1073
  serverKey={serverKey}
@@ -1083,9 +1082,7 @@ class RelationTable extends React.PureComponent<
1083
1082
  mainCode={mainCode1}
1084
1083
  sourceId={fieldGroupConfig.id}
1085
1084
  ></ModelSelectTable>
1086
- ) : (
1087
- ""
1088
- )}
1085
+ ) : ""}
1089
1086
  </>
1090
1087
  );
1091
1088
  }
@@ -394,6 +394,7 @@ export interface DtmplConfig extends TmplBase {
394
394
  hiddenFields?: FieldConfig[];
395
395
  continueSaveBtnTitle?: string;
396
396
  saveBtnTitle?: string;
397
+ pageLayout?: "horizontalTabs" | "verticalScrolling";
397
398
  }
398
399
 
399
400
  export type Comparator =
@@ -343,7 +343,7 @@ const HCWelcome = (props) => {
343
343
  <QuickEntrance></QuickEntrance>
344
344
  </div>
345
345
  </div>
346
- <img src={orgHomeImg || homeImg || (["v2", "v5"].includes(layoutRootPath) ? WelcomeBg : welcomeBg2)} alt="" width="100%" height="100%" style={{ borderRadius: "8px", margin: "0 10px", width: "calc(100% - 20px)" }} />
346
+ <img src={orgHomeImg || homeImg || (!layoutRootPath || (["v2", "v5"].includes(layoutRootPath)) ? WelcomeBg : welcomeBg2)} alt="" width="100%" height="100%" style={{ borderRadius: "8px", margin: "0 10px", width: "calc(100% - 20px)" }} />
347
347
  </>
348
348
  );
349
349
  };