aldehyde 0.2.456 → 0.2.457
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.
- package/lib/icon/aliIcon.d.ts +1 -1
- package/lib/icon/aliIcon.d.ts.map +1 -1
- package/lib/icon/aliIcon.js +4 -3
- package/lib/icon/aliIcon.js.map +1 -1
- package/lib/icon/local-aliIcon/iconfont.d.ts +1 -0
- package/lib/icon/local-aliIcon/iconfont.d.ts.map +1 -0
- package/lib/icon/local-aliIcon/iconfont.js +20 -0
- package/lib/icon/local-aliIcon/iconfont.js.map +1 -0
- package/lib/layout2/components/system-messages.d.ts +8 -0
- package/lib/layout2/components/system-messages.d.ts.map +1 -0
- package/lib/layout2/components/system-messages.js +70 -0
- package/lib/layout2/components/system-messages.js.map +1 -0
- package/lib/layout2/components/user-button.d.ts.map +1 -1
- package/lib/layout2/components/user-button.js +3 -7
- package/lib/layout2/components/user-button.js.map +1 -1
- package/lib/layout2/components/user-notification.d.ts +8 -0
- package/lib/layout2/components/user-notification.d.ts.map +1 -0
- package/lib/layout2/components/user-notification.js +69 -0
- package/lib/layout2/components/user-notification.js.map +1 -0
- package/lib/layout2/header.d.ts.map +1 -1
- package/lib/layout2/header.js +5 -0
- package/lib/layout2/header.js.map +1 -1
- package/lib/layout3/header.d.ts.map +1 -1
- package/lib/layout3/header.js +5 -0
- package/lib/layout3/header.js.map +1 -1
- package/lib/layout4/header.d.ts.map +1 -1
- package/lib/layout4/header.js +5 -0
- package/lib/layout4/header.js.map +1 -1
- package/lib/layout5/header.d.ts.map +1 -1
- package/lib/layout5/header.js +5 -0
- package/lib/layout5/header.js.map +1 -1
- package/lib/routable/ltmpl-route.js +1 -1
- package/lib/routable/ltmpl-route.js.map +1 -1
- package/lib/table/modal-select-table.d.ts +8 -1
- package/lib/table/modal-select-table.d.ts.map +1 -1
- package/lib/table/modal-select-table.js +25 -1
- package/lib/table/modal-select-table.js.map +1 -1
- package/lib/table/relation-table.d.ts +3 -0
- package/lib/table/relation-table.d.ts.map +1 -1
- package/lib/table/relation-table.js +1 -1
- package/lib/table/relation-table.js.map +1 -1
- package/lib/tmpl/hcservice-v3.d.ts +1 -0
- package/lib/tmpl/hcservice-v3.d.ts.map +1 -1
- package/lib/tmpl/hcservice-v3.js +15 -0
- package/lib/tmpl/hcservice-v3.js.map +1 -1
- package/lib/tmpl/interface.d.ts +4 -0
- package/lib/tmpl/interface.d.ts.map +1 -1
- package/lib/tmpl/interface.js.map +1 -1
- package/lib/tmpl/tmpl-config-analysis.d.ts.map +1 -1
- package/lib/tmpl/tmpl-config-analysis.js +14 -5
- package/lib/tmpl/tmpl-config-analysis.js.map +1 -1
- package/package.json +1 -1
- package/src/aldehyde/icon/aliIcon.tsx +5 -3
- package/src/aldehyde/icon/local-aliIcon/iconfont.js +1 -0
- package/src/aldehyde/layout2/components/system-messages.tsx +75 -0
- package/src/aldehyde/layout2/components/user-button.tsx +3 -7
- package/src/aldehyde/layout2/components/user-notification.tsx +74 -0
- package/src/aldehyde/layout2/header.tsx +4 -0
- package/src/aldehyde/layout3/header.tsx +4 -0
- package/src/aldehyde/layout4/header.tsx +4 -0
- package/src/aldehyde/layout5/header.tsx +4 -0
- package/src/aldehyde/routable/ltmpl-route.tsx +1 -1
- package/src/aldehyde/table/modal-select-table.tsx +33 -5
- package/src/aldehyde/table/relation-table.tsx +3 -1
- package/src/aldehyde/tmpl/hcservice-v3.tsx +13 -0
- package/src/aldehyde/tmpl/interface.tsx +4 -0
- package/src/aldehyde/tmpl/tmpl-config-analysis.tsx +14 -5
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import "
|
|
3
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { FormInstance } from "antd";
|
|
3
|
+
import "./index.css";
|
|
4
|
+
import { DtmplData, QueryKey, SelectConfig, SelectedRow, FieldConfig } from "../tmpl/interface";
|
|
4
5
|
import TableUnits from "./table-util";
|
|
5
6
|
import SupportInputTypes from '../tmpl/control-type-supportor';
|
|
6
7
|
import HCDataSource from '../tmpl/hc-data-source';
|
|
@@ -23,6 +24,8 @@ interface ModelSelectTableProps {
|
|
|
23
24
|
onCancel: () => void,
|
|
24
25
|
defaultCriteriaValue?: object,
|
|
25
26
|
onOK: (selectedRows: SelectedRow[]) => void,
|
|
27
|
+
parentFormInstance?: FormInstance,
|
|
28
|
+
selectRelValueField?: FieldConfig,
|
|
26
29
|
};
|
|
27
30
|
|
|
28
31
|
interface ModelSelectTableStat {
|
|
@@ -54,8 +57,33 @@ class ModelSelectTable extends React.PureComponent<ModelSelectTableProps, ModelS
|
|
|
54
57
|
selectedRows: [],
|
|
55
58
|
}
|
|
56
59
|
|
|
57
|
-
|
|
60
|
+
// 表单关系字段组查询取值start
|
|
61
|
+
getSubDtmplData = async (valueField, code) => {
|
|
62
|
+
const { serverKey } = this.props;
|
|
63
|
+
const dtmplData = await HcserviceV3.requestDtmplData(serverKey, valueField.id, code.split("@R@")[0], null);
|
|
64
|
+
const subField = valueField.subRelValueField;
|
|
65
|
+
const subData = dtmplData.fieldMap[subField.id];
|
|
66
|
+
if (subField.subRelValueField && subData) { // 存在下级关联项
|
|
67
|
+
return this.getSubDtmplData(subField, subData);
|
|
68
|
+
}
|
|
69
|
+
return subData;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
getSecondCriteria = async () => {
|
|
73
|
+
const { parentFormInstance, selectRelValueField } = this.props;
|
|
74
|
+
let secondCriteria;
|
|
75
|
+
if (selectRelValueField && parentFormInstance) {
|
|
76
|
+
secondCriteria = parentFormInstance.getFieldValue(selectRelValueField.id);
|
|
77
|
+
if (selectRelValueField.subRelValueField && secondCriteria) {
|
|
78
|
+
secondCriteria = await this.getSubDtmplData(selectRelValueField, secondCriteria);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return { secondCriteria };
|
|
82
|
+
}
|
|
83
|
+
// 表单关系字段组查询点选取值end
|
|
58
84
|
|
|
85
|
+
loadData = async (selectConfig: SelectConfig, criteriaData: object) => {
|
|
86
|
+
const secondCriteria = await this.getSecondCriteria();
|
|
59
87
|
this.setState({
|
|
60
88
|
loading: true,
|
|
61
89
|
})
|
|
@@ -70,7 +98,7 @@ class ModelSelectTable extends React.PureComponent<ModelSelectTableProps, ModelS
|
|
|
70
98
|
const { sourceId, exceptCodes, serverKey, mainCode, existRelation } = this.props;
|
|
71
99
|
/** 构建 dataSource **/
|
|
72
100
|
//构建过滤条件
|
|
73
|
-
let queryKey: QueryKey = await HcserviceV3.requestLtmplQueryKey(serverKey, sourceId, { exceptCodes, ...criteriaData, ...pageInfo, mainCode, existRelation });
|
|
101
|
+
let queryKey: QueryKey = await HcserviceV3.requestLtmplQueryKey(serverKey, sourceId, { exceptCodes, ...criteriaData, ...pageInfo, ...secondCriteria, mainCode, existRelation });
|
|
74
102
|
this.setState({
|
|
75
103
|
queryKey,
|
|
76
104
|
criteriaData,
|
|
@@ -1081,7 +1081,9 @@ class RelationTable extends React.PureComponent<
|
|
|
1081
1081
|
exceptCodes={exceptCodes}
|
|
1082
1082
|
mainCode={mainCode1}
|
|
1083
1083
|
sourceId={fieldGroupConfig.id}
|
|
1084
|
-
|
|
1084
|
+
selectRelValueField={fieldGroupConfig.selectRelValueField}
|
|
1085
|
+
parentFormInstance={parentFormInstance}
|
|
1086
|
+
/>
|
|
1085
1087
|
) : ""}
|
|
1086
1088
|
</>
|
|
1087
1089
|
);
|
|
@@ -1523,4 +1523,17 @@ export default class HcserviceV3 {
|
|
|
1523
1523
|
message.error(translate("${发送失败}"), 3);
|
|
1524
1524
|
}
|
|
1525
1525
|
}
|
|
1526
|
+
|
|
1527
|
+
static async wsPushTopic(hydrocarbonToken, data) {
|
|
1528
|
+
const res = await Super.super({
|
|
1529
|
+
url: `/v3/ws-push-topic/${hydrocarbonToken}`,
|
|
1530
|
+
data,
|
|
1531
|
+
method: "POST",
|
|
1532
|
+
});
|
|
1533
|
+
if (res.code === 200) {
|
|
1534
|
+
message.success(translate("${已发送}"));
|
|
1535
|
+
} else {
|
|
1536
|
+
message.error(translate("${发送失败}"), 3);
|
|
1537
|
+
}
|
|
1538
|
+
}
|
|
1526
1539
|
}
|
|
@@ -373,6 +373,7 @@ export interface FieldGroupConfig extends OrderableTmplBase {
|
|
|
373
373
|
batchAddFileField?: FieldConfig;
|
|
374
374
|
addRowPosition?: "begin" | "end";
|
|
375
375
|
submitType?: "separate" | "follow";
|
|
376
|
+
selectRelValueField?: FieldConfig; // 关联关系组点选查询取值字段
|
|
376
377
|
}
|
|
377
378
|
|
|
378
379
|
export type SaveJumpType = "list" | "add" | "edit";
|
|
@@ -446,6 +447,7 @@ export interface FieldConfig extends FieldBase {
|
|
|
446
447
|
requiredRuleCriterias?: FieldConfig[];
|
|
447
448
|
usableRuleCriterias?: FieldConfig[];
|
|
448
449
|
relValueField?: FieldConfig;
|
|
450
|
+
subRelValueField?: FieldConfig;
|
|
449
451
|
hidden?: boolean;
|
|
450
452
|
serverKey?: string;
|
|
451
453
|
sourceId?: string;
|
|
@@ -471,6 +473,7 @@ export interface FieldConfig extends FieldBase {
|
|
|
471
473
|
defShowIcon?: boolean; // 图片组件,是否默认显示缩略图,默认显示
|
|
472
474
|
showUploadList?: boolean; // 上传组件是否显示文件列表
|
|
473
475
|
uploadText?: string; // 上传组件文本配置
|
|
476
|
+
fieldSwitchRequiredClearType?: "doNotClear" | "toOptionalClear" | "toRequiredClear" | "switchClear"; // 必填条件-是否清除关联项
|
|
474
477
|
}
|
|
475
478
|
|
|
476
479
|
export interface ActionRenderProps {
|
|
@@ -891,4 +894,5 @@ export interface ThemeConfig {
|
|
|
891
894
|
homeSourceId?: string; // 首页菜单
|
|
892
895
|
supportedLanguages?: string[]; // 支持语言
|
|
893
896
|
defaultLanguage?: string; // 默认语言
|
|
897
|
+
wsTypes?: ("sys-messages" | "user-notification")[];
|
|
894
898
|
}
|
|
@@ -402,7 +402,7 @@ TmplConfigAnalysis.buildInDtmplConfig = (
|
|
|
402
402
|
if (!changedValues) {
|
|
403
403
|
continue;
|
|
404
404
|
}
|
|
405
|
-
const requireValue = field.requiredRuleCriterias?.
|
|
405
|
+
const requireValue = field.requiredRuleCriterias?.find(r => {
|
|
406
406
|
const id = TmplConfigAnalysis.getFieldId(dtmplConfig, r.mstrucId);
|
|
407
407
|
return changedValues.hasOwnProperty(id);
|
|
408
408
|
});
|
|
@@ -419,11 +419,20 @@ TmplConfigAnalysis.buildInDtmplConfig = (
|
|
|
419
419
|
// "secondCriteria": changedValues[field.relValueField.id]
|
|
420
420
|
};
|
|
421
421
|
field.configChanged = true;
|
|
422
|
-
|
|
423
|
-
|
|
422
|
+
// 必填条件配置是否清除/可用条件默认清除
|
|
423
|
+
let isClear = false;
|
|
424
|
+
if (requireValue) {
|
|
425
|
+
const clearType = requireValue?.fieldSwitchRequiredClearType;
|
|
426
|
+
const isRequired = field?.required;
|
|
427
|
+
isClear = (clearType === "switchClear" || (clearType === "toRequiredClear" && isRequired) || (clearType === "toOptionalClear" && !isRequired)) ? true : false;
|
|
424
428
|
}
|
|
425
|
-
if (
|
|
426
|
-
formInstance.
|
|
429
|
+
if (isClear || usableValue) { // 清除关联项值
|
|
430
|
+
if (formInstance.getFieldValue(field.id)) {
|
|
431
|
+
formInstance.setFieldValue(field.id, null);
|
|
432
|
+
}
|
|
433
|
+
if (formInstance.getFieldValue("c_" + field.id)) {
|
|
434
|
+
formInstance.setFieldValue("c_" + field.id, null);
|
|
435
|
+
}
|
|
427
436
|
}
|
|
428
437
|
}
|
|
429
438
|
}
|