aldehyde 0.2.319 → 0.2.320
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.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 +5 -3
- package/lib/controls/entity-select/popover-entity-select.js.map +1 -1
- package/lib/controls/relation-existion/index.d.ts.map +1 -1
- package/lib/controls/relation-existion/index.js +1 -1
- package/lib/controls/relation-existion/index.js.map +1 -1
- package/lib/form/criteria-form.d.ts.map +1 -1
- package/lib/form/criteria-form.js +3 -2
- package/lib/form/criteria-form.js.map +1 -1
- package/lib/table/select-table.d.ts +16 -2
- package/lib/table/select-table.d.ts.map +1 -1
- package/lib/table/select-table.js +102 -29
- package/lib/table/select-table.js.map +1 -1
- package/lib/tmpl/interface.d.ts +1 -0
- package/lib/tmpl/interface.d.ts.map +1 -1
- package/lib/tmpl/interface.js.map +1 -1
- package/lib/units/index.js +1 -1
- package/lib/units/index.js.map +1 -1
- package/package.json +1 -1
- package/src/aldehyde/controls/entity-select/entity-select.tsx +1 -1
- package/src/aldehyde/controls/entity-select/popover-entity-select.tsx +15 -11
- package/src/aldehyde/controls/relation-existion/index.tsx +4 -2
- package/src/aldehyde/form/criteria-form.tsx +110 -109
- package/src/aldehyde/table/select-table.tsx +221 -79
- package/src/aldehyde/tmpl/interface.tsx +3 -2
- package/src/aldehyde/units/index.tsx +1 -1
|
@@ -22,7 +22,7 @@ import EntryControl from "../controls/entry-control";
|
|
|
22
22
|
import Action from "../controls/action";
|
|
23
23
|
import CquickButton from "../controls/cquery/cquick-button";
|
|
24
24
|
import { useLocale } from "../locale/useLocale";
|
|
25
|
-
import {DownOutlined, LeftOutlined, RightOutlined, SearchOutlined, UpOutlined} from "@ant-design/icons";
|
|
25
|
+
import { DownOutlined, LeftOutlined, RightOutlined, SearchOutlined, UpOutlined } from "@ant-design/icons";
|
|
26
26
|
import { ProgramConfig } from "../index";
|
|
27
27
|
import SelectCodeExport from "../controls/file-export/select-code-export";
|
|
28
28
|
|
|
@@ -38,7 +38,7 @@ export interface CriteriaFormProps {
|
|
|
38
38
|
doSearch?: (data: object) => void;
|
|
39
39
|
doDelete?: () => void;
|
|
40
40
|
doAction?: (string, selectedRows: SelectedRow[], object) => void;
|
|
41
|
-
doCustomButton?:(customButton:CustomButton, datas:DtmplData[])=> void;
|
|
41
|
+
doCustomButton?: (customButton: CustomButton, datas: DtmplData[]) => void;
|
|
42
42
|
doJump?: (jump: JumpConfig) => void;
|
|
43
43
|
doCQuery?: (cqueryId: string) => void;
|
|
44
44
|
hiddenCriteriaIds?: string[];
|
|
@@ -72,15 +72,15 @@ const CriteriaForm: React.FC<CriteriaFormProps> = (props) => {
|
|
|
72
72
|
buttons,
|
|
73
73
|
actions,
|
|
74
74
|
customButtons,
|
|
75
|
-
|
|
75
|
+
fileExports,
|
|
76
76
|
jumps,
|
|
77
77
|
cQuerys,
|
|
78
78
|
criterias,
|
|
79
79
|
drillingParams,
|
|
80
80
|
columns,
|
|
81
81
|
updrillButtonConfigs,
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
innerParams,
|
|
83
|
+
defShowCriteriaCount,
|
|
84
84
|
} = ltmplConfig;
|
|
85
85
|
const initialValues = {};
|
|
86
86
|
const searchSubmit = (data) => {
|
|
@@ -99,13 +99,13 @@ const CriteriaForm: React.FC<CriteriaFormProps> = (props) => {
|
|
|
99
99
|
const [collapsible, setCollapsible] = useState<boolean>(false);
|
|
100
100
|
const [expanded, setExpanded] = useState<boolean>(false);
|
|
101
101
|
|
|
102
|
-
let collapseCriteria:CriteriaConfig[] =defShowCriteriaCount<=0?criterias:criterias.slice(0,defShowCriteriaCount);
|
|
102
|
+
let collapseCriteria: CriteriaConfig[] = defShowCriteriaCount <= 0 ? criterias : criterias.slice(0, defShowCriteriaCount);
|
|
103
103
|
|
|
104
104
|
|
|
105
105
|
|
|
106
106
|
useEffect(() => {
|
|
107
107
|
form.resetFields();
|
|
108
|
-
if(collapseCriteria && criterias && collapseCriteria.length<criterias.length){
|
|
108
|
+
if (collapseCriteria && criterias && collapseCriteria.length < criterias.length) {
|
|
109
109
|
setCollapsible(true);
|
|
110
110
|
}
|
|
111
111
|
});
|
|
@@ -144,9 +144,10 @@ const CriteriaForm: React.FC<CriteriaFormProps> = (props) => {
|
|
|
144
144
|
};
|
|
145
145
|
|
|
146
146
|
const renderCustomButton = () => {
|
|
147
|
-
if (
|
|
147
|
+
if (doCustomButton && customButtons?.length > 0) {
|
|
148
148
|
return customButtons.map((customButton) => {
|
|
149
|
-
|
|
149
|
+
// defDisabled设置默认是否禁用
|
|
150
|
+
let disabled = customButton.defDisabled !== false;
|
|
150
151
|
if (selectedRows) {
|
|
151
152
|
if (selectedRows.length > 0 && customButton.multible) {
|
|
152
153
|
disabled = false;
|
|
@@ -156,13 +157,13 @@ const CriteriaForm: React.FC<CriteriaFormProps> = (props) => {
|
|
|
156
157
|
}
|
|
157
158
|
|
|
158
159
|
return (
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
160
|
+
<Button disabled={disabled}
|
|
161
|
+
key={customButton.id}
|
|
162
|
+
type={customButton.buttonType ? customButton.buttonType : 'dashed'}
|
|
163
|
+
onClick={() => doCustomButton(customButton, selectedDatas)}
|
|
164
|
+
>
|
|
165
|
+
{translate("${" + customButton.title + "}")}
|
|
166
|
+
</Button>
|
|
166
167
|
);
|
|
167
168
|
});
|
|
168
169
|
}
|
|
@@ -179,22 +180,22 @@ const CriteriaForm: React.FC<CriteriaFormProps> = (props) => {
|
|
|
179
180
|
disabled = false;
|
|
180
181
|
}
|
|
181
182
|
}
|
|
182
|
-
let codes=[];
|
|
183
|
-
if(selectedDatas){
|
|
184
|
-
selectedDatas.forEach(s=>{
|
|
183
|
+
let codes = [];
|
|
184
|
+
if (selectedDatas) {
|
|
185
|
+
selectedDatas.forEach(s => {
|
|
185
186
|
codes.push(s.code);
|
|
186
187
|
})
|
|
187
188
|
}
|
|
188
189
|
|
|
189
190
|
return (
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
191
|
+
<SelectCodeExport
|
|
192
|
+
serverKey={serverKey}
|
|
193
|
+
hiddenType={"disabled"}
|
|
194
|
+
codes={codes}
|
|
195
|
+
key={fileExport.id}
|
|
196
|
+
fileExport={fileExport}
|
|
197
|
+
disabled={disabled}
|
|
198
|
+
></SelectCodeExport>
|
|
198
199
|
);
|
|
199
200
|
});
|
|
200
201
|
}
|
|
@@ -234,7 +235,7 @@ const CriteriaForm: React.FC<CriteriaFormProps> = (props) => {
|
|
|
234
235
|
"drillingColIds",
|
|
235
236
|
updrillButtonConfig.dimensions
|
|
236
237
|
);
|
|
237
|
-
|
|
238
|
+
form.submit();
|
|
238
239
|
}}
|
|
239
240
|
>
|
|
240
241
|
{translate("${" + updrillButtonConfig.title + "}")}
|
|
@@ -348,17 +349,17 @@ const CriteriaForm: React.FC<CriteriaFormProps> = (props) => {
|
|
|
348
349
|
};
|
|
349
350
|
|
|
350
351
|
const onValuesChange = (changedValues, allValues) => {
|
|
351
|
-
let appCtmplConfig= ProgramConfig.getAppCtmplConfig(
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
352
|
+
let appCtmplConfig = ProgramConfig.getAppCtmplConfig(
|
|
353
|
+
ltmplConfig,
|
|
354
|
+
data,
|
|
355
|
+
props
|
|
355
356
|
)
|
|
356
357
|
if (appCtmplConfig.onCriteriaValuesChange) {
|
|
357
358
|
//自定义值修改逻辑
|
|
358
359
|
appCtmplConfig.onCriteriaValuesChange(
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
360
|
+
changedValues,
|
|
361
|
+
data,
|
|
362
|
+
form
|
|
362
363
|
);
|
|
363
364
|
}
|
|
364
365
|
// if (onValuesChange) {
|
|
@@ -381,11 +382,11 @@ const CriteriaForm: React.FC<CriteriaFormProps> = (props) => {
|
|
|
381
382
|
return criterias.map((item) => {
|
|
382
383
|
let formItemName = "c_" + item.id;
|
|
383
384
|
let fieldValue = data ? data[formItemName] : undefined;
|
|
384
|
-
if(item?.extControlType=="ltree-entity-select" || item?.extControlType=="ltree-entity-select-value"){
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
385
|
+
if (item?.extControlType == "ltree-entity-select" || item?.extControlType == "ltree-entity-select-value") {
|
|
386
|
+
// return <FormItem>
|
|
387
|
+
// <Input type={"hidden"} name={formItemName} value={fieldValue} />
|
|
388
|
+
// </FormItem>
|
|
389
|
+
// return null;
|
|
389
390
|
} else if (!hiddenCriteriaIds.includes(item.id)) {
|
|
390
391
|
return (
|
|
391
392
|
<FormItem
|
|
@@ -396,11 +397,11 @@ const CriteriaForm: React.FC<CriteriaFormProps> = (props) => {
|
|
|
396
397
|
rules={
|
|
397
398
|
item.required
|
|
398
399
|
? [
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
400
|
+
{
|
|
401
|
+
required: true,
|
|
402
|
+
message: translate("${请选择}" + item.title),
|
|
403
|
+
},
|
|
404
|
+
]
|
|
404
405
|
: undefined
|
|
405
406
|
}
|
|
406
407
|
>
|
|
@@ -428,74 +429,74 @@ const CriteriaForm: React.FC<CriteriaFormProps> = (props) => {
|
|
|
428
429
|
style={{ width: "100%" }}
|
|
429
430
|
>
|
|
430
431
|
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
432
|
+
{/*// <Collapse style={{ width: "100%" }} defaultActiveKey={["1"]}>*/}
|
|
433
|
+
{/*// <Panel header={""} key="1">*/}
|
|
434
|
+
<Card size={'small'} style={{ display: open ? "block" : "none", width: "100%" }}>
|
|
435
|
+
<Row>
|
|
436
|
+
<Col>
|
|
437
|
+
<Space size={"small"} wrap>
|
|
438
|
+
{showQueryButton ||
|
|
438
439
|
(updrillButtonConfigs && updrillButtonConfigs.length > 0)
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
440
|
+
? renderCriteria(innerParams)
|
|
441
|
+
: null}
|
|
442
|
+
{buttons.includes("drilling") &&
|
|
442
443
|
open &&
|
|
443
444
|
(drillingParams.length > 0 || hasDimension() || ltmplConfig.showDim) ?
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
</Space>
|
|
445
|
+
<>{renderCriteria(drillingParams)}
|
|
446
|
+
{renderDrillDimension()}</>
|
|
447
|
+
: null}
|
|
448
|
+
{showQueryButton || (updrillButtonConfigs && updrillButtonConfigs.length > 0)
|
|
449
|
+
? renderCriteria(expanded ? criterias : collapseCriteria)
|
|
450
|
+
: null}
|
|
451
|
+
|
|
452
|
+
<Space className="btns">
|
|
453
|
+
{collapsible ? (
|
|
454
|
+
expanded ? <Button icon={<LeftOutlined />} type={"link"} onClick={() => setExpanded(false)}>
|
|
455
|
+
{translate("${收起}")}
|
|
456
|
+
</Button> :
|
|
457
|
+
<Button icon={<RightOutlined />} type={"link"} onClick={() => setExpanded(true)}>
|
|
458
|
+
{translate("${更多条件}")}
|
|
459
|
+
</Button>
|
|
460
|
+
) : (
|
|
461
|
+
""
|
|
462
|
+
)}
|
|
463
|
+
{showQueryButton ? (
|
|
464
|
+
<Button type="primary" htmlType="submit">
|
|
465
|
+
{translate("${查询}")}
|
|
466
|
+
</Button>
|
|
467
|
+
) : (
|
|
468
|
+
""
|
|
469
|
+
)}
|
|
470
|
+
{showDeleteButton ? (
|
|
471
|
+
<Popconfirm
|
|
472
|
+
placement="rightBottom"
|
|
473
|
+
title={translate("${确定要[删除]选中数据吗}?")}
|
|
474
|
+
onConfirm={() => {
|
|
475
|
+
doDelete();
|
|
476
|
+
}}
|
|
477
|
+
okText={translate("${确定}")}
|
|
478
|
+
cancelText={translate("${取消}")}
|
|
479
|
+
okType={"danger"}
|
|
480
|
+
>
|
|
481
|
+
<Button danger disabled={deleteButtonDisabled}>
|
|
482
|
+
{translate("${删除选中}")}
|
|
483
|
+
</Button>
|
|
484
|
+
</Popconfirm>
|
|
485
|
+
) : (
|
|
486
|
+
""
|
|
487
|
+
)}
|
|
488
|
+
{/* 特别注意 目前 查询条件和 头部的 按钮 前置条件 均未支持,需要设置前置条件的情况请使用 行按钮*/}
|
|
489
|
+
{renderCustomButton()}
|
|
490
|
+
{renderAction()}
|
|
491
|
+
{renderJump()}
|
|
492
|
+
{renderCQuery()}
|
|
493
|
+
{renderUpdrill()}
|
|
494
|
+
{renderFileExport()}
|
|
495
495
|
</Space>
|
|
496
|
-
</
|
|
497
|
-
</
|
|
498
|
-
</
|
|
496
|
+
</Space>
|
|
497
|
+
</Col>
|
|
498
|
+
</Row>
|
|
499
|
+
</Card>
|
|
499
500
|
{/*<Card size={'small'}*/}
|
|
500
501
|
{/* className="hoverable"*/}
|
|
501
502
|
{/* style={{ display: open ? "block" : "none", width: "100%" }}*/}
|