aldehyde 0.2.342 → 0.2.345
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/controls/entity-select/entity-select.d.ts.map +1 -1
- package/lib/controls/entity-select/entity-select.js +1 -1
- package/lib/controls/entity-select/entity-select.js.map +1 -1
- package/lib/controls/entity-select/popover-entity-select.d.ts.map +1 -1
- package/lib/controls/entity-select/popover-entity-select.js +2 -0
- package/lib/controls/entity-select/popover-entity-select.js.map +1 -1
- package/lib/controls/select/index.d.ts.map +1 -1
- package/lib/controls/select/index.js +5 -0
- package/lib/controls/select/index.js.map +1 -1
- package/lib/form/dtmpl-form.d.ts.map +1 -1
- package/lib/form/dtmpl-form.js +3 -3
- package/lib/form/dtmpl-form.js.map +1 -1
- package/lib/form/form-Item-group.d.ts +3 -0
- package/lib/form/form-Item-group.d.ts.map +1 -1
- package/lib/form/form-Item-group.js +44 -4
- package/lib/form/form-Item-group.js.map +1 -1
- package/lib/index.d.ts +3 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -3
- package/lib/index.js.map +1 -1
- package/lib/login3/index.less +36 -2
- package/lib/login3/login-page.d.ts +2 -0
- package/lib/login3/login-page.d.ts.map +1 -1
- package/lib/login3/login-page.js +7 -4
- package/lib/login3/login-page.js.map +1 -1
- package/lib/module/dtmpl-edit-page.d.ts +10 -1
- package/lib/module/dtmpl-edit-page.d.ts.map +1 -1
- package/lib/module/dtmpl-edit-page.js +40 -8
- package/lib/module/dtmpl-edit-page.js.map +1 -1
- package/lib/table/relation-table.d.ts +74 -0
- package/lib/table/relation-table.d.ts.map +1 -1
- package/lib/table/relation-table.js +20 -1
- package/lib/table/relation-table.js.map +1 -1
- package/lib/tmpl/interface.d.ts +6 -1
- package/lib/tmpl/interface.d.ts.map +1 -1
- package/lib/tmpl/interface.js.map +1 -1
- package/package.json +1 -1
- package/src/aldehyde/controls/entity-select/entity-select.tsx +97 -96
- package/src/aldehyde/controls/entity-select/popover-entity-select.tsx +2 -0
- package/src/aldehyde/controls/select/index.tsx +33 -29
- package/src/aldehyde/form/dtmpl-form.tsx +38 -36
- package/src/aldehyde/form/form-Item-group.tsx +70 -29
- package/src/aldehyde/index.tsx +7 -1
- package/src/aldehyde/login3/index.less +36 -2
- package/src/aldehyde/login3/login-page.tsx +10 -8
- package/src/aldehyde/module/dtmpl-edit-page.tsx +42 -5
- package/src/aldehyde/table/relation-table.tsx +22 -2
- package/src/aldehyde/tmpl/interface.tsx +4 -2
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import {Checkbox, Input, Radio, Select as AntdSelect} from "antd";
|
|
2
|
+
import { Checkbox, Input, Radio, Select as AntdSelect } from "antd";
|
|
3
3
|
import {
|
|
4
4
|
EControlProps,
|
|
5
5
|
} from "../../tmpl/interface";
|
|
6
|
-
import {LocaleContext} from "../../locale/LocaleProvider";
|
|
6
|
+
import { LocaleContext } from "../../locale/LocaleProvider";
|
|
7
7
|
import HCDataSource from "../../tmpl/hc-data-source";
|
|
8
8
|
import translate from "../../locale/translate";
|
|
9
9
|
import Steps from "../steps";
|
|
@@ -39,44 +39,44 @@ export default class Select extends React.PureComponent<
|
|
|
39
39
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
getValue=()=>{
|
|
43
|
-
const {value,fieldConfig}=this.props;
|
|
42
|
+
getValue = () => {
|
|
43
|
+
const { value, fieldConfig } = this.props;
|
|
44
44
|
let fieldValue = value && value != ""
|
|
45
45
|
? typeof value == "string"
|
|
46
|
-
? value.indexOf("@,@")>0 ?value.split("@,@"):value.split(",")
|
|
46
|
+
? value.indexOf("@,@") > 0 ? value.split("@,@") : value.split(",")
|
|
47
47
|
: value
|
|
48
48
|
: undefined;
|
|
49
|
-
let fieldValue2=[];
|
|
49
|
+
let fieldValue2 = [];
|
|
50
50
|
//再去掉 @E@
|
|
51
|
-
if(fieldValue && Array.isArray(fieldValue)){
|
|
52
|
-
for(let v of fieldValue){
|
|
53
|
-
if(v.includes('@E@')){
|
|
51
|
+
if (fieldValue && Array.isArray(fieldValue)) {
|
|
52
|
+
for (let v of fieldValue) {
|
|
53
|
+
if (v.includes('@E@')) {
|
|
54
54
|
fieldValue2.push(v[1]);
|
|
55
|
-
}else{
|
|
55
|
+
} else {
|
|
56
56
|
fieldValue2.push(v);
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
}else{
|
|
60
|
-
fieldValue2=fieldValue;
|
|
59
|
+
} else {
|
|
60
|
+
fieldValue2 = fieldValue;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
//把code替换为name
|
|
64
|
-
let fieldValue3=[];
|
|
65
|
-
if(fieldValue2){
|
|
66
|
-
let valueMap= HCDataSource.getEnumsValueMap(fieldConfig.mstrucId);
|
|
67
|
-
if(valueMap){
|
|
68
|
-
for(let v of fieldValue2){
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
64
|
+
let fieldValue3 = [];
|
|
65
|
+
if (fieldValue2) {
|
|
66
|
+
let valueMap = HCDataSource.getEnumsValueMap(fieldConfig.mstrucId);
|
|
67
|
+
if (valueMap) {
|
|
68
|
+
for (let v of fieldValue2) {
|
|
69
|
+
let t = valueMap.get(v);
|
|
70
|
+
if (t) {
|
|
71
|
+
fieldValue3.push(t);
|
|
72
|
+
} else {
|
|
73
|
+
fieldValue3.push(v);
|
|
74
|
+
}
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
|
-
}else{
|
|
78
|
-
|
|
79
|
-
|
|
77
|
+
} else {
|
|
78
|
+
fieldValue3 = fieldValue2;
|
|
79
|
+
}
|
|
80
80
|
// let fieldValue4=[];
|
|
81
81
|
// if(fieldValue3){
|
|
82
82
|
// for(let v of fieldValue3){
|
|
@@ -91,6 +91,7 @@ export default class Select extends React.PureComponent<
|
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
getOptions = (mstrucId, needOrder = false, valueIsId = false) => {
|
|
94
|
+
const { fieldConfig } = this.props;
|
|
94
95
|
const options = [];
|
|
95
96
|
const items = HCDataSource.getEnums(mstrucId);
|
|
96
97
|
if (items) {
|
|
@@ -106,6 +107,9 @@ export default class Select extends React.PureComponent<
|
|
|
106
107
|
});
|
|
107
108
|
});
|
|
108
109
|
}
|
|
110
|
+
if (fieldConfig.relDeduplication && fieldConfig.exceptCodes?.length) {
|
|
111
|
+
return options.filter(item => !fieldConfig.exceptCodes.includes(item.value));
|
|
112
|
+
}
|
|
109
113
|
return options;
|
|
110
114
|
}
|
|
111
115
|
|
|
@@ -147,7 +151,7 @@ export default class Select extends React.PureComponent<
|
|
|
147
151
|
showSearch={true}
|
|
148
152
|
optionFilterProp={"label"}
|
|
149
153
|
options={this.getOptions(fieldConfig.mstrucId, true)}
|
|
150
|
-
|
|
154
|
+
//optionRender={this.optionRender}
|
|
151
155
|
></AntdSelect>
|
|
152
156
|
);
|
|
153
157
|
break;
|
|
@@ -164,7 +168,7 @@ export default class Select extends React.PureComponent<
|
|
|
164
168
|
showSearch
|
|
165
169
|
optionFilterProp={"label"}
|
|
166
170
|
options={this.getOptions(fieldConfig.mstrucId, true)}
|
|
167
|
-
|
|
171
|
+
//optionRender={optionRender}
|
|
168
172
|
></AntdSelect>
|
|
169
173
|
);
|
|
170
174
|
break;
|
|
@@ -185,7 +189,7 @@ export default class Select extends React.PureComponent<
|
|
|
185
189
|
{...antdControlProps}
|
|
186
190
|
options={this.getOptions(fieldConfig.mstrucId, true)}
|
|
187
191
|
value={
|
|
188
|
-
this.getValue()?this.getValue()[0]:undefined
|
|
192
|
+
this.getValue() ? this.getValue()[0] : undefined
|
|
189
193
|
}
|
|
190
194
|
/>
|
|
191
195
|
);
|
|
@@ -34,7 +34,7 @@ interface DtmplFormStat {
|
|
|
34
34
|
appDtmplConfig?: DtmplConfig;
|
|
35
35
|
embedForm?: object;
|
|
36
36
|
embedRefValue?: object;
|
|
37
|
-
editingGroups?:string[];
|
|
37
|
+
editingGroups?: string[];
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
export default class DtmplForm extends React.PureComponent<
|
|
@@ -52,7 +52,7 @@ export default class DtmplForm extends React.PureComponent<
|
|
|
52
52
|
appDtmplConfig: undefined,
|
|
53
53
|
embedForm: {},
|
|
54
54
|
embedRefValue: {},
|
|
55
|
-
editingGroups:[],
|
|
55
|
+
editingGroups: [],
|
|
56
56
|
};
|
|
57
57
|
static defaultPorps = {
|
|
58
58
|
maxCols: 2,
|
|
@@ -125,16 +125,16 @@ export default class DtmplForm extends React.PureComponent<
|
|
|
125
125
|
const { translate } = this.context;
|
|
126
126
|
message.info(translate("${已刷新}!"));
|
|
127
127
|
};
|
|
128
|
-
onGroupEditing=(groupCode,editing:boolean)=>{
|
|
128
|
+
onGroupEditing = (groupCode, editing: boolean) => {
|
|
129
129
|
|
|
130
|
-
const {editingGroups}=this.state;
|
|
131
|
-
let arr=[...editingGroups];
|
|
130
|
+
const { editingGroups } = this.state;
|
|
131
|
+
let arr = [...editingGroups];
|
|
132
132
|
if (editing) {
|
|
133
133
|
arr.push(groupCode);
|
|
134
|
-
}else{
|
|
134
|
+
} else {
|
|
135
135
|
arr = editingGroups.filter(item => item !== groupCode);
|
|
136
136
|
}
|
|
137
|
-
this.setState({editingGroups:arr});
|
|
137
|
+
this.setState({ editingGroups: arr });
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
onGroupChange = (
|
|
@@ -176,18 +176,18 @@ export default class DtmplForm extends React.PureComponent<
|
|
|
176
176
|
});
|
|
177
177
|
if (res.status === "success") {
|
|
178
178
|
this.props.onFinish(res.code);
|
|
179
|
-
}else{
|
|
179
|
+
} else {
|
|
180
180
|
this.props.onFinish(false);
|
|
181
181
|
}
|
|
182
182
|
};
|
|
183
183
|
|
|
184
184
|
onSubmit = async (values: any) => {
|
|
185
|
-
const { dtmplConfig,dtmplData } = this.props;
|
|
185
|
+
const { dtmplConfig, dtmplData } = this.props;
|
|
186
186
|
const {
|
|
187
187
|
currentDtmplData,
|
|
188
188
|
appDtmplConfig,
|
|
189
189
|
embedForm,
|
|
190
|
-
embedRefValue,editingGroups
|
|
190
|
+
embedRefValue, editingGroups
|
|
191
191
|
} = this.state;
|
|
192
192
|
|
|
193
193
|
if (editingGroups.length > 0) {
|
|
@@ -196,8 +196,8 @@ export default class DtmplForm extends React.PureComponent<
|
|
|
196
196
|
return;
|
|
197
197
|
}
|
|
198
198
|
|
|
199
|
-
if(dtmplData){
|
|
200
|
-
dtmplData.fieldMap={...values}
|
|
199
|
+
if (dtmplData) {
|
|
200
|
+
dtmplData.fieldMap = { ...values }
|
|
201
201
|
}
|
|
202
202
|
|
|
203
203
|
let resultCode = undefined;
|
|
@@ -270,6 +270,7 @@ export default class DtmplForm extends React.PureComponent<
|
|
|
270
270
|
formRef,
|
|
271
271
|
serverKey,
|
|
272
272
|
showRightNav,
|
|
273
|
+
valueFieldMap
|
|
273
274
|
} = this.props;
|
|
274
275
|
const { loading, embedForm } = this.state;
|
|
275
276
|
let groups: FieldGroupConfig[] = [];
|
|
@@ -297,7 +298,7 @@ export default class DtmplForm extends React.PureComponent<
|
|
|
297
298
|
if (item.embedType == "列表") {
|
|
298
299
|
return (
|
|
299
300
|
<Card
|
|
300
|
-
styles={{body:{ padding: 0 }}}
|
|
301
|
+
styles={{ body: { padding: 0 } }}
|
|
301
302
|
variant={"borderless"}
|
|
302
303
|
style={{ width: showRightNav ? "90%" : "100%" }}
|
|
303
304
|
>
|
|
@@ -323,7 +324,7 @@ export default class DtmplForm extends React.PureComponent<
|
|
|
323
324
|
id={parentId + item.id}
|
|
324
325
|
className="hoverable"
|
|
325
326
|
loading={loading}
|
|
326
|
-
styles={{body:{ padding: "6px" },header:{ background: "#f2f4f5" }}}
|
|
327
|
+
styles={{ body: { padding: "6px" }, header: { background: "#f2f4f5" } }}
|
|
327
328
|
>
|
|
328
329
|
<DtmplViewCard
|
|
329
330
|
showHeader={false}
|
|
@@ -352,11 +353,11 @@ export default class DtmplForm extends React.PureComponent<
|
|
|
352
353
|
id={parentId + item.id}
|
|
353
354
|
className="hoverable"
|
|
354
355
|
loading={loading}
|
|
355
|
-
styles={{body:{ padding: "6px" },header:{ background: "#f2f4f5" }}}
|
|
356
|
+
styles={{ body: { padding: "6px" }, header: { background: "#f2f4f5" } }}
|
|
356
357
|
>
|
|
357
358
|
<EmbedDtmplEditPage
|
|
358
359
|
ref={embedForm[item.id]}
|
|
359
|
-
onFinish={(code:any) => {
|
|
360
|
+
onFinish={(code: any) => {
|
|
360
361
|
this.onEmbedPageFinish(item, code);
|
|
361
362
|
}}
|
|
362
363
|
codeSource={codeSource}
|
|
@@ -386,8 +387,8 @@ export default class DtmplForm extends React.PureComponent<
|
|
|
386
387
|
value={data}
|
|
387
388
|
parentFormInstance={formRef?.current}
|
|
388
389
|
viewOrEdit={item.readOnly ? "view" : "edit"}
|
|
389
|
-
onEditing={(editing)=>{
|
|
390
|
-
this.onGroupEditing(item.id,editing);
|
|
390
|
+
onEditing={(editing) => {
|
|
391
|
+
this.onGroupEditing(item.id, editing);
|
|
391
392
|
}}
|
|
392
393
|
onChange={this.onGroupChange}
|
|
393
394
|
/>
|
|
@@ -404,22 +405,23 @@ export default class DtmplForm extends React.PureComponent<
|
|
|
404
405
|
id={parentId + item.id}
|
|
405
406
|
className="hoverable"
|
|
406
407
|
loading={loading}
|
|
407
|
-
styles={{body:{ padding: "6px" },header:{ background: "#f2f4f5" }}}
|
|
408
|
+
styles={{ body: { padding: "6px" }, header: { background: "#f2f4f5" } }}
|
|
408
409
|
>
|
|
409
|
-
{item.readOnly
|
|
410
|
-
|
|
411
|
-
serverKey={serverKey}
|
|
412
|
-
valueMap={dtmplData ? dtmplData.fieldMap : undefined}
|
|
413
|
-
/>:
|
|
414
|
-
<FormItemGroup layout={HcserviceV3.isForeignLanguageMode()?"vertical":"horizontal"}
|
|
410
|
+
{item.readOnly ? <FieldViewGroup fields={item ? item.fields : undefined}
|
|
411
|
+
dataCode={dtmplData ? dtmplData.code : null}
|
|
415
412
|
serverKey={serverKey}
|
|
416
|
-
formRef={formRef}
|
|
417
|
-
mainCode={mainCode}
|
|
418
|
-
maxColsOnRow={maxColsOnRow}
|
|
419
|
-
fields={item ? item.fields : undefined}
|
|
420
|
-
dataCode={dtmplData ? dtmplData.code : undefined}
|
|
421
413
|
valueMap={dtmplData ? dtmplData.fieldMap : undefined}
|
|
422
|
-
|
|
414
|
+
/> :
|
|
415
|
+
<FormItemGroup layout={HcserviceV3.isForeignLanguageMode() ? "vertical" : "horizontal"}
|
|
416
|
+
serverKey={serverKey}
|
|
417
|
+
formRef={formRef}
|
|
418
|
+
mainCode={mainCode}
|
|
419
|
+
maxColsOnRow={maxColsOnRow}
|
|
420
|
+
fields={item ? item.fields : undefined}
|
|
421
|
+
dataCode={dtmplData ? dtmplData.code : undefined}
|
|
422
|
+
valueMap={dtmplData ? dtmplData.fieldMap : undefined}
|
|
423
|
+
valueFieldMap={valueFieldMap}
|
|
424
|
+
/>}
|
|
423
425
|
</CollapseCard>
|
|
424
426
|
);
|
|
425
427
|
}
|
|
@@ -447,7 +449,7 @@ export default class DtmplForm extends React.PureComponent<
|
|
|
447
449
|
);
|
|
448
450
|
}
|
|
449
451
|
if (onValuesChange) {
|
|
450
|
-
onValuesChange();
|
|
452
|
+
onValuesChange(changedValues, allValues);
|
|
451
453
|
}
|
|
452
454
|
};
|
|
453
455
|
|
|
@@ -459,7 +461,7 @@ export default class DtmplForm extends React.PureComponent<
|
|
|
459
461
|
code,
|
|
460
462
|
parentId,
|
|
461
463
|
showHeader,
|
|
462
|
-
serverKey,dtmplData,
|
|
464
|
+
serverKey, dtmplData,
|
|
463
465
|
} = this.props;
|
|
464
466
|
const { currentDtmplData, appDtmplConfig } = this.state;
|
|
465
467
|
const { translate } = this.context;
|
|
@@ -507,13 +509,13 @@ export default class DtmplForm extends React.PureComponent<
|
|
|
507
509
|
</Card>
|
|
508
510
|
) : null}
|
|
509
511
|
<AntdForm
|
|
510
|
-
|
|
512
|
+
layout={HcserviceV3.isForeignLanguageMode() ? "vertical" : "horizontal"}
|
|
511
513
|
scrollToFirstError={true}
|
|
512
514
|
labelWrap={true}
|
|
513
515
|
ref={formRef}
|
|
514
516
|
name="control-hooks"
|
|
515
517
|
onValuesChange={this.onValuesChange}
|
|
516
|
-
onFinishFailed={()=>this.props.onFinish(false)}
|
|
518
|
+
onFinishFailed={() => this.props.onFinish(false)}
|
|
517
519
|
onFinish={this.onSubmit}
|
|
518
520
|
>
|
|
519
521
|
<AntdForm.Item hidden={true} name={"actionId"}></AntdForm.Item>
|
|
@@ -527,7 +529,7 @@ export default class DtmplForm extends React.PureComponent<
|
|
|
527
529
|
key={this.premisestitle}
|
|
528
530
|
id={parentId + premises[0].id}
|
|
529
531
|
className="hoverable"
|
|
530
|
-
styles={{header:{background: "#f2f4f5"}}}
|
|
532
|
+
styles={{ header: { background: "#f2f4f5" } }}
|
|
531
533
|
>
|
|
532
534
|
<FieldViewGroup serverKey={serverKey} fields={premises} />
|
|
533
535
|
</CollapseCard>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React, { RefObject } from "react";
|
|
2
|
-
import { Col, Form, Row } from "antd";
|
|
1
|
+
import React, { RefObject, useState, useMemo } from "react";
|
|
2
|
+
import { Col, Form, Row, Popconfirm } from "antd";
|
|
3
3
|
import { FieldConfig } from "../tmpl/interface";
|
|
4
4
|
import EntryControl from "../controls/entry-control";
|
|
5
5
|
import Units from "../units";
|
|
@@ -10,6 +10,48 @@ import TmplConfigAnalysis from "../tmpl/tmpl-config-analysis";
|
|
|
10
10
|
|
|
11
11
|
const FormItem = Form.Item;
|
|
12
12
|
|
|
13
|
+
// 渲染表单项,如果有关联项,则在更改值时弹出确认框,否则直接更改值
|
|
14
|
+
const RenderEntryControl = ({ fieldValue, item, props, translate, getMainCode, ...otherProps }) => {
|
|
15
|
+
const { mainCode, serverKey, dataCode, valueFieldMap } = props;
|
|
16
|
+
const { onChange } = otherProps;
|
|
17
|
+
const [isUpdateItem, setIsUpdateItem] = useState<boolean>(false);
|
|
18
|
+
const [value, setValue] = useState<any>(fieldValue);
|
|
19
|
+
const controlProps = { dataCode, serverKey, mainCode: getMainCode(item, mainCode), value: fieldValue, fieldConfig: item, ...otherProps };
|
|
20
|
+
|
|
21
|
+
const popconfirm = useMemo(() => {
|
|
22
|
+
if (!valueFieldMap) {
|
|
23
|
+
return { isPopconfirm: false };
|
|
24
|
+
}
|
|
25
|
+
const isPopconfirm = !!valueFieldMap[item.id];
|
|
26
|
+
const fieldNames = valueFieldMap[item.id]?.map(item => ` [${item.title}] `)?.join("、");
|
|
27
|
+
const title = `修改数据会同步删除关联项${fieldNames}的数据,确认修改`;
|
|
28
|
+
return { title, isPopconfirm };
|
|
29
|
+
}, [valueFieldMap]);
|
|
30
|
+
// 当前项有值且存在关联项,则更改值时弹出确认框,否则直接更改值
|
|
31
|
+
return value && popconfirm.isPopconfirm ? <Popconfirm
|
|
32
|
+
key="back"
|
|
33
|
+
placement="top"
|
|
34
|
+
title={translate("${" + popconfirm.title + "}?")}
|
|
35
|
+
onConfirm={() => {
|
|
36
|
+
onChange(value);
|
|
37
|
+
setIsUpdateItem(false);
|
|
38
|
+
}}
|
|
39
|
+
onCancel={() => setIsUpdateItem(false)}
|
|
40
|
+
okText={translate("${确定}")}
|
|
41
|
+
cancelText={translate("${取消}")}
|
|
42
|
+
open={isUpdateItem}
|
|
43
|
+
>
|
|
44
|
+
<EntryControl
|
|
45
|
+
{...controlProps}
|
|
46
|
+
onChange={(val) => {
|
|
47
|
+
setValue(val);
|
|
48
|
+
setIsUpdateItem(true);
|
|
49
|
+
}}
|
|
50
|
+
/>
|
|
51
|
+
</Popconfirm> :
|
|
52
|
+
<EntryControl {...controlProps} />;
|
|
53
|
+
};
|
|
54
|
+
|
|
13
55
|
export interface FieldGroupProps {
|
|
14
56
|
serverKey?: string;
|
|
15
57
|
fields: FieldConfig[];
|
|
@@ -19,8 +61,9 @@ export interface FieldGroupProps {
|
|
|
19
61
|
maxColsOnRow?: number;
|
|
20
62
|
mainCode?: string;
|
|
21
63
|
formRef?: RefObject<FormInstance>;
|
|
22
|
-
dataCode?:string,
|
|
23
|
-
layout?: "horizontal" | "vertical"
|
|
64
|
+
dataCode?: string,
|
|
65
|
+
layout?: "horizontal" | "vertical";
|
|
66
|
+
valueFieldMap?: { [key: string]: any } // 表单关联项配置
|
|
24
67
|
}
|
|
25
68
|
|
|
26
69
|
interface FieldGroupState {
|
|
@@ -79,41 +122,39 @@ export default class FormItemGroup extends React.PureComponent<
|
|
|
79
122
|
return fieldConfig;
|
|
80
123
|
};
|
|
81
124
|
initFormItem = (fieldConfig: FieldConfig, fieldValue) => {
|
|
82
|
-
const { nameAttr, maxColsOnRow,
|
|
125
|
+
const { nameAttr, maxColsOnRow, layout } = this.props;
|
|
83
126
|
const { translate } = this.context;
|
|
84
127
|
let item = this.getFieldConfig(fieldConfig);
|
|
85
128
|
|
|
86
|
-
let labelColSpan=24;
|
|
87
|
-
let wrapperColSpan=24;
|
|
88
|
-
if(layout==="vertical"){
|
|
89
|
-
labelColSpan=24;
|
|
90
|
-
wrapperColSpan=24;
|
|
91
|
-
}else {
|
|
92
|
-
labelColSpan= maxColsOnRow == 1 ?
|
|
93
|
-
wrapperColSpan= maxColsOnRow == 1 ?
|
|
129
|
+
let labelColSpan = 24;
|
|
130
|
+
let wrapperColSpan = 24;
|
|
131
|
+
if (layout === "vertical") {
|
|
132
|
+
labelColSpan = 24;
|
|
133
|
+
wrapperColSpan = 24;
|
|
134
|
+
} else {
|
|
135
|
+
labelColSpan = maxColsOnRow == 1 ? 6 : item.colSpan == 1 ? 6 : 3;
|
|
136
|
+
wrapperColSpan = maxColsOnRow == 1 ? 18 : item.colSpan == 1 ? 15 : 19;
|
|
94
137
|
}
|
|
95
138
|
|
|
96
139
|
return (
|
|
97
140
|
<FormItem
|
|
98
141
|
label={translate("${" + item.title + "}")}
|
|
99
142
|
hidden={item.hidden}
|
|
100
|
-
name={fieldConfig.controlType=="field-history" ?undefined:item[nameAttr]}
|
|
143
|
+
name={fieldConfig.controlType == "field-history" ? undefined : item[nameAttr]}
|
|
101
144
|
key={item.id}
|
|
102
|
-
labelCol={{ span: labelColSpan }
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
{span:wrapperColSpan}
|
|
106
|
-
}
|
|
107
|
-
tooltip={(!item.tip || item.tip=="")?undefined:item.tip}
|
|
145
|
+
labelCol={{ span: labelColSpan }}
|
|
146
|
+
wrapperCol={{ span: wrapperColSpan }}
|
|
147
|
+
tooltip={(!item.tip || item.tip == "") ? undefined : item.tip}
|
|
108
148
|
initialValue={fieldValue}
|
|
109
149
|
style={{ margin: 4 }}
|
|
110
|
-
rules={TmplConfigAnalysis.getRules(item,translate)}
|
|
150
|
+
rules={TmplConfigAnalysis.getRules(item, translate)}
|
|
111
151
|
>
|
|
112
|
-
<
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
152
|
+
<RenderEntryControl
|
|
153
|
+
fieldValue={fieldValue}
|
|
154
|
+
item={item}
|
|
155
|
+
props={this.props}
|
|
156
|
+
translate={translate}
|
|
157
|
+
getMainCode={this.getMainCode}
|
|
117
158
|
/>
|
|
118
159
|
</FormItem>
|
|
119
160
|
);
|
|
@@ -137,8 +178,8 @@ export default class FormItemGroup extends React.PureComponent<
|
|
|
137
178
|
fieldValue || fieldValue == 0
|
|
138
179
|
? fieldValue
|
|
139
180
|
: item.defaultValue
|
|
140
|
-
|
|
141
|
-
|
|
181
|
+
? Units.configParamTrans(item.defaultValue, ControlTypeSupportor.getControlType(item, item.defaultValue))
|
|
182
|
+
: undefined;
|
|
142
183
|
let formItem = null;
|
|
143
184
|
if (item.extControlType == "hidden") {
|
|
144
185
|
formItem = (
|
|
@@ -181,7 +222,7 @@ export default class FormItemGroup extends React.PureComponent<
|
|
|
181
222
|
colSpan = 2;
|
|
182
223
|
}
|
|
183
224
|
let col = (
|
|
184
|
-
<Col key={i} span={12 * colSpan
|
|
225
|
+
<Col key={i} span={12 * colSpan} >
|
|
185
226
|
{formItemList[i]}
|
|
186
227
|
</Col>
|
|
187
228
|
);
|
package/src/aldehyde/index.tsx
CHANGED
|
@@ -112,6 +112,8 @@ import DatePicker from "./controls/date-picker";
|
|
|
112
112
|
// const DatePicker = loadable(() =>
|
|
113
113
|
// import("./controls/date-picker"), {fallback: Loading});
|
|
114
114
|
|
|
115
|
+
import ModalDtmplView from "./detail/view/modal-dtmpl-view"
|
|
116
|
+
|
|
115
117
|
import ModelStrucV3 from "./tmpl/model-struc-v3";
|
|
116
118
|
|
|
117
119
|
import TmplConfigAnalysis from "./tmpl/tmpl-config-analysis";
|
|
@@ -138,6 +140,8 @@ import ContextPage5 from "./layout5/page";
|
|
|
138
140
|
|
|
139
141
|
|
|
140
142
|
import LowcodeComponents from "./lowcode-components";
|
|
143
|
+
import DtmplViewModal from "./module/dtmpl-view-modal";
|
|
144
|
+
import DtmplViewDrawer from './module/dtmpl-view-drawer';
|
|
141
145
|
|
|
142
146
|
export {
|
|
143
147
|
ActTable,
|
|
@@ -193,5 +197,7 @@ export {
|
|
|
193
197
|
ContextPage3,
|
|
194
198
|
LoginPage3,
|
|
195
199
|
ContextPage4,
|
|
196
|
-
ContextPage5
|
|
200
|
+
ContextPage5,
|
|
201
|
+
DtmplViewModal,
|
|
202
|
+
DtmplViewDrawer,
|
|
197
203
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
.login-page {
|
|
2
|
-
width:
|
|
3
|
-
height:
|
|
2
|
+
width: 100vw;
|
|
3
|
+
height: 100vh;
|
|
4
4
|
min-height: 640px;
|
|
5
5
|
position: relative;
|
|
6
6
|
background-size: 100% 100%;
|
|
@@ -11,6 +11,40 @@
|
|
|
11
11
|
align-items: center;
|
|
12
12
|
overflow: hidden;
|
|
13
13
|
|
|
14
|
+
.head {
|
|
15
|
+
position: absolute;
|
|
16
|
+
top: 3%;
|
|
17
|
+
left: 1.5%;
|
|
18
|
+
display: flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
|
|
21
|
+
.head-text {
|
|
22
|
+
font-size: 42px;
|
|
23
|
+
font-family: YouSheBiaoTiHei;
|
|
24
|
+
text-align: justify;
|
|
25
|
+
font-style: normal;
|
|
26
|
+
text-transform: none;
|
|
27
|
+
background-image: linear-gradient(180deg, #FFFFFF 0%, #90DEFF 100%);
|
|
28
|
+
/* 可以调整方向和颜色 */
|
|
29
|
+
/* 2. 关键: 将背景裁剪到文字形状 */
|
|
30
|
+
-webkit-background-clip: text;
|
|
31
|
+
/* 对于 Webkit 内核浏览器 (如 Safari, 老版Chrome) */
|
|
32
|
+
background-clip: text;
|
|
33
|
+
/* 标准属性 */
|
|
34
|
+
/* 3. 关键: 将文字颜色设置为透明,以显示背景渐变 */
|
|
35
|
+
-webkit-text-fill-color: transparent;
|
|
36
|
+
/* 对于 Webkit 内核浏览器 */
|
|
37
|
+
color: transparent;
|
|
38
|
+
/* 标准属性,但注意某些环境下可能需 -webkit-text-fill-color 配合 */
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.head-logo {
|
|
42
|
+
width: 38px;
|
|
43
|
+
height: 38px;
|
|
44
|
+
margin-right: 16px;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
14
48
|
.login-logo-img {
|
|
15
49
|
position: absolute;
|
|
16
50
|
top: 20%;
|
|
@@ -11,11 +11,13 @@ import "./index.less";
|
|
|
11
11
|
|
|
12
12
|
type LoginPageProps = {
|
|
13
13
|
programName?: string;
|
|
14
|
+
programName_sub?: string;
|
|
14
15
|
copyright?: string;
|
|
16
|
+
logo?: string;
|
|
15
17
|
};
|
|
16
18
|
|
|
17
19
|
const LoginPage = (props: LoginPageProps) => {
|
|
18
|
-
|
|
20
|
+
const { programName, programName_sub, logo, copyright } = props;
|
|
19
21
|
const { translate } = useLocale();
|
|
20
22
|
|
|
21
23
|
return (
|
|
@@ -23,6 +25,10 @@ const LoginPage = (props: LoginPageProps) => {
|
|
|
23
25
|
className="login-page"
|
|
24
26
|
style={{ backgroundImage: `url(${LoginBgPng})` }}
|
|
25
27
|
>
|
|
28
|
+
<div className="head">
|
|
29
|
+
{logo ? <img className="head-logo" src={logo} alt="" /> : ""}
|
|
30
|
+
<span className="head-text">{programName || ProgramConfig.programName()}</span>
|
|
31
|
+
</div>
|
|
26
32
|
<img src={logoPng} alt="" className="login-logo-img" />
|
|
27
33
|
<div className="login-content" style={{ backgroundImage: `url(${LoginContentBgPng})` }} >
|
|
28
34
|
<div className="login-logo">
|
|
@@ -30,11 +36,7 @@ const LoginPage = (props: LoginPageProps) => {
|
|
|
30
36
|
{translate("${欢迎,登录}")}
|
|
31
37
|
</div>
|
|
32
38
|
<div className="login-logo-text-sub">
|
|
33
|
-
{
|
|
34
|
-
<>
|
|
35
|
-
{props.programName ? translate("${" + props.programName + "}") : translate("${" + ProgramConfig.programName() + "}")}
|
|
36
|
-
</>
|
|
37
|
-
}
|
|
39
|
+
{programName_sub ? translate("${" + programName_sub + "}") : translate("${" + ProgramConfig.programName_sub() + "}")}
|
|
38
40
|
</div>
|
|
39
41
|
</div>
|
|
40
42
|
<div className="login-form">
|
|
@@ -54,9 +56,9 @@ const LoginPage = (props: LoginPageProps) => {
|
|
|
54
56
|
<div className="reset-password">
|
|
55
57
|
<ResetPassword showUserName={true} />
|
|
56
58
|
</div>
|
|
57
|
-
{
|
|
59
|
+
{copyright ?
|
|
58
60
|
<div className="login-copyright">
|
|
59
|
-
{"Copyright ◎ 2025" + (
|
|
61
|
+
{"Copyright ◎ 2025" + (copyright || "")}
|
|
60
62
|
</div> : ""
|
|
61
63
|
}
|
|
62
64
|
</div>
|