aldehyde 0.2.214 → 0.2.215
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/action/index.d.ts.map +1 -1
- package/lib/controls/chemstruc/graph.d.ts.map +1 -1
- package/lib/controls/collapse-card/index.d.ts.map +1 -1
- package/lib/controls/color-picker/index.d.ts.map +1 -1
- package/lib/controls/cquery/cquick-button.d.ts.map +1 -1
- package/lib/controls/entity-select/entity-select.d.ts.map +1 -1
- package/lib/controls/entity-select/lab-tree-select.d.ts.map +1 -1
- package/lib/controls/entity-select/popover-entity-select.d.ts.map +1 -1
- package/lib/controls/file-view/index.js +2 -2
- package/lib/controls/file-view/index.js.map +1 -1
- package/lib/controls/password-setter/index.d.ts.map +1 -1
- package/lib/controls/relation-existion/index.d.ts.map +1 -1
- package/lib/controls/rfield/index.d.ts.map +1 -1
- package/lib/controls/select/index.d.ts.map +1 -1
- package/lib/controls/signature/index.d.ts.map +1 -1
- package/lib/controls/text/ellipsis-text.d.ts.map +1 -1
- package/lib/controls/text/ellipsis-text.js +4 -4
- package/lib/controls/text/ellipsis-text.js.map +1 -1
- package/lib/controls/upload/index.d.ts.map +1 -1
- package/lib/controls/view-control.d.ts.map +1 -1
- package/lib/controls/view-control.js +5 -5
- package/lib/controls/view-control.js.map +1 -1
- package/lib/custom-page/dtmpl-custom-edit-modal-page.d.ts.map +1 -1
- package/lib/detail/button/bottom-submit-button-bar.d.ts.map +1 -1
- package/lib/detail/button/cquery-button-bar.d.ts.map +1 -1
- package/lib/detail/button/fix-right-submit-button-bar.d.ts.map +1 -1
- package/lib/detail/edit/dtmpl-edit.d.ts.map +1 -1
- package/lib/detail/edit/dtmpl-edit.js +0 -2
- package/lib/detail/edit/dtmpl-edit.js.map +1 -1
- package/lib/detail/edit/fields-edit-card.d.ts.map +1 -1
- package/lib/detail/edit/modal-row-edit.d.ts.map +1 -1
- package/lib/detail/edit/row-edit-card.d.ts.map +1 -1
- package/lib/detail/rightbar/index.d.ts.map +1 -1
- package/lib/detail/view/act-dtmpl-view.d.ts.map +1 -1
- package/lib/detail/view/field-view-group.d.ts.map +1 -1
- package/lib/detail/view/field-view-group.js +1 -1
- package/lib/detail/view/field-view-group.js.map +1 -1
- package/lib/detail/view/modal-dtmpl-view.d.ts.map +1 -1
- package/lib/detail/view/snapshot-timeline.d.ts.map +1 -1
- package/lib/export/export-frame.d.ts.map +1 -1
- package/lib/export/select-code-export-frame.d.ts.map +1 -1
- package/lib/form/dtmpl-form.d.ts.map +1 -1
- package/lib/form/dtmpl-form.js +1 -1
- package/lib/form/dtmpl-form.js.map +1 -1
- package/lib/form/field-group-form.d.ts.map +1 -1
- package/lib/form/form-Item-group.d.ts.map +1 -1
- package/lib/form/form-Item-group.js +6 -6
- package/lib/form/form-Item-group.js.map +1 -1
- package/lib/import/excel-import.d.ts.map +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/layout/header/index.d.ts.map +1 -1
- package/lib/layout/header/index.js.map +1 -1
- package/lib/layout/menu/block.d.ts.map +1 -1
- package/lib/layout/menu/l2menu-quick-bar.d.ts.map +1 -1
- package/lib/layout/menu/menu-2layers.d.ts.map +1 -1
- package/lib/layout/menu/menu-render.d.ts.map +1 -1
- package/lib/layout/menu/menu-render.js +4 -1
- package/lib/layout/menu/menu-render.js.map +1 -1
- package/lib/layout/menu/reset-password.d.ts.map +1 -1
- package/lib/layout/menu/user-bar.d.ts.map +1 -1
- package/lib/layout/menu/userinfo-bar.d.ts.map +1 -1
- package/lib/layout2/css/header.css +1 -1
- package/lib/layout2/header.d.ts.map +1 -1
- package/lib/layout2/header.js +2 -1
- package/lib/layout2/header.js.map +1 -1
- package/lib/layout2/page.d.ts.map +1 -1
- package/lib/layout2/page.js +3 -0
- package/lib/layout2/page.js.map +1 -1
- package/lib/locale/useLocale.d.ts +1 -0
- package/lib/locale/useLocale.d.ts.map +1 -1
- package/lib/locale/useLocale.js +2 -2
- package/lib/locale/useLocale.js.map +1 -1
- package/lib/login/login.d.ts.map +1 -1
- package/lib/login2/login-page.d.ts +5 -1
- package/lib/login2/login-page.d.ts.map +1 -1
- package/lib/login2/login-page.js +24 -6
- package/lib/login2/login-page.js.map +1 -1
- package/lib/module/dtmpl-edit-card.d.ts.map +1 -1
- package/lib/module/dtmpl-edit-card.js +0 -1
- package/lib/module/dtmpl-edit-card.js.map +1 -1
- package/lib/module/dtmpl-edit-page.d.ts.map +1 -1
- package/lib/module/ltmpl-modal.d.ts.map +1 -1
- package/lib/module/ltmpl-table.d.ts.map +1 -1
- package/lib/routable/ltmpl-route.d.ts +1 -0
- package/lib/routable/ltmpl-route.d.ts.map +1 -1
- package/lib/routable/ltmpl-route.js +10 -5
- package/lib/routable/ltmpl-route.js.map +1 -1
- package/lib/table/act-table.d.ts +2 -2
- package/lib/table/act-table.d.ts.map +1 -1
- package/lib/table/act-table.js +45 -263
- package/lib/table/act-table.js.map +1 -1
- package/lib/table/column/column-builder.d.ts +35 -0
- package/lib/table/column/column-builder.d.ts.map +1 -0
- package/lib/table/column/column-builder.js +307 -0
- package/lib/table/column/column-builder.js.map +1 -0
- package/lib/table/column/theme-color-getter.d.ts +6 -0
- package/lib/table/column/theme-color-getter.d.ts.map +1 -0
- package/lib/table/column/theme-color-getter.js +19 -0
- package/lib/table/column/theme-color-getter.js.map +1 -0
- package/lib/table/modal-select-table.d.ts.map +1 -1
- package/lib/table/pagination.d.ts.map +1 -1
- package/lib/table/query-table.d.ts +1 -41
- package/lib/table/query-table.d.ts.map +1 -1
- package/lib/table/query-table.js +104 -117
- package/lib/table/query-table.js.map +1 -1
- package/lib/table/relation-table.d.ts.map +1 -1
- package/lib/table/report-table.d.ts +6 -0
- package/lib/table/report-table.d.ts.map +1 -0
- package/lib/table/report-table.js +86 -0
- package/lib/table/report-table.js.map +1 -0
- package/lib/table/select-table.d.ts.map +1 -1
- package/lib/table/selected-rows-card.d.ts.map +1 -1
- package/lib/table/stat/restat.d.ts.map +1 -1
- package/lib/tmpl/hc-data-source.d.ts.map +1 -1
- package/lib/tmpl/hc-data-source.js +15 -0
- package/lib/tmpl/hc-data-source.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 +12 -0
- package/lib/tmpl/hcservice-v3.js.map +1 -1
- package/lib/tmpl/interface.d.ts +61 -9
- package/lib/tmpl/interface.d.ts.map +1 -1
- package/lib/tmpl/interface.js.map +1 -1
- package/lib/tree/act-tree.d.ts.map +1 -1
- package/lib/tree/tmpl-tree.d.ts.map +1 -1
- package/lib/welcome/quick-entrance.d.ts.map +1 -1
- package/lib/welcome/workbench.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/aldehyde/controls/file-view/index.tsx +2 -2
- package/src/aldehyde/controls/text/ellipsis-text.tsx +5 -5
- package/src/aldehyde/controls/view-control.tsx +7 -5
- package/src/aldehyde/detail/edit/dtmpl-edit.tsx +1 -2
- package/src/aldehyde/detail/view/field-view-group.tsx +1 -1
- package/src/aldehyde/form/dtmpl-form.tsx +1 -1
- package/src/aldehyde/form/form-Item-group.tsx +6 -6
- package/src/aldehyde/index.tsx +2 -0
- package/src/aldehyde/layout/header/index.tsx +7 -0
- package/src/aldehyde/layout/menu/menu-render.tsx +4 -1
- package/src/aldehyde/layout2/css/header.css +1 -1
- package/src/aldehyde/layout2/header.tsx +3 -3
- package/src/aldehyde/layout2/page.tsx +3 -0
- package/src/aldehyde/locale/LocaleProvider.tsx +1 -1
- package/src/aldehyde/locale/useLocale.ts +2 -1
- package/src/aldehyde/login2/login-page.tsx +44 -14
- package/src/aldehyde/module/dtmpl-edit-card.tsx +0 -1
- package/src/aldehyde/routable/ltmpl-route.tsx +12 -5
- package/src/aldehyde/table/act-table.tsx +50 -485
- package/src/aldehyde/table/column/column-builder.tsx +566 -0
- package/src/aldehyde/table/column/theme-color-getter.tsx +25 -0
- package/src/aldehyde/table/query-table.tsx +187 -239
- package/src/aldehyde/table/report-table.tsx +116 -0
- package/src/aldehyde/tmpl/hc-data-source.tsx +16 -0
- package/src/aldehyde/tmpl/hcservice-v3.tsx +14 -0
- package/src/aldehyde/tmpl/interface.tsx +69 -9
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { ReactNode
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
2
|
import {
|
|
3
3
|
Button,
|
|
4
4
|
Card,
|
|
@@ -6,7 +6,6 @@ import {
|
|
|
6
6
|
Col,
|
|
7
7
|
Collapse,
|
|
8
8
|
Divider,
|
|
9
|
-
Popconfirm,
|
|
10
9
|
Popover,
|
|
11
10
|
Row,
|
|
12
11
|
Space,
|
|
@@ -15,24 +14,11 @@ import {
|
|
|
15
14
|
Tooltip,
|
|
16
15
|
message,
|
|
17
16
|
} from "antd";
|
|
18
|
-
import HCService from "../tmpl/hcservice-v3";
|
|
19
17
|
import Table from "./control-table-x-axis-wrapper";
|
|
20
18
|
import {
|
|
21
|
-
AlignCenterOutlined,
|
|
22
|
-
AlignLeftOutlined,
|
|
23
|
-
CaretDownOutlined,
|
|
24
|
-
CaretUpOutlined,
|
|
25
|
-
CopyOutlined,
|
|
26
|
-
DeleteOutlined,
|
|
27
19
|
DownloadOutlined,
|
|
28
|
-
EditOutlined,
|
|
29
|
-
EyeInvisibleOutlined,
|
|
30
|
-
EyeOutlined,
|
|
31
|
-
FormOutlined,
|
|
32
20
|
FundOutlined,
|
|
33
|
-
KeyOutlined,
|
|
34
21
|
LineChartOutlined,
|
|
35
|
-
MenuOutlined,
|
|
36
22
|
PlusCircleOutlined,
|
|
37
23
|
PlusOutlined,
|
|
38
24
|
ReloadOutlined,
|
|
@@ -45,8 +31,6 @@ import "./index.css";
|
|
|
45
31
|
import {
|
|
46
32
|
ActTableMode,
|
|
47
33
|
ActTableViewModel,
|
|
48
|
-
AddOrUpdate,
|
|
49
|
-
BuiltInButtonName,
|
|
50
34
|
ClassAddConfig,
|
|
51
35
|
ColumnConfig,
|
|
52
36
|
CustomButton,
|
|
@@ -59,36 +43,23 @@ import {
|
|
|
59
43
|
ShowViewParam,
|
|
60
44
|
TmplBaseProps,
|
|
61
45
|
} from "../tmpl/interface";
|
|
62
|
-
|
|
63
|
-
import SupportInputTypes from "../tmpl/control-type-supportor";
|
|
46
|
+
|
|
64
47
|
import HcserviceV3 from "../tmpl/hcservice-v3";
|
|
65
48
|
import QueryTable from "./query-table";
|
|
66
49
|
import CriteriaForm from "./../form/criteria-form";
|
|
67
|
-
import
|
|
68
|
-
import Units from "../units";
|
|
50
|
+
import ProgramConfig from "../units";
|
|
69
51
|
import ColumnSelector from "./column/column-selector";
|
|
70
52
|
import ExportFrame, { ExportType } from "../export/export-frame";
|
|
71
|
-
import { SortableHandle } from "react-sortable-hoc";
|
|
72
53
|
import L2ActTable from "./l2-act-table";
|
|
73
54
|
|
|
74
|
-
import Action from "../controls/action";
|
|
75
55
|
import Restat from "./stat/restat";
|
|
76
|
-
import ActionUtils from "../controls/action/utils";
|
|
77
|
-
import CquickButton from "../controls/cquery/cquick-button";
|
|
78
56
|
import CollapseCard from "../controls/collapse-card";
|
|
79
57
|
import ToolTipBar from "../detail/tooltipbar";
|
|
80
58
|
import { LocaleContext } from "../locale/LocaleProvider";
|
|
81
59
|
import BlockMenuTreeDrawer from "../module/block-menu-tree-drawer";
|
|
82
|
-
import EditButton from "../detail/button/edit-button";
|
|
83
|
-
import ViewButton from "../detail/button/view-button";
|
|
84
|
-
import ProgramConfig from "../units";
|
|
85
60
|
import ModelSelectTable from "./../table/modal-select-table";
|
|
86
|
-
import
|
|
87
|
-
|
|
88
|
-
const DragHandle = SortableHandle(() => (
|
|
89
|
-
<MenuOutlined style={{ cursor: "grab", color: "#999" }} />
|
|
90
|
-
));
|
|
91
|
-
const { Panel } = Collapse;
|
|
61
|
+
import ColumnBuilder from "./column/column-builder";
|
|
62
|
+
import ReportTable from "./report-table";
|
|
92
63
|
|
|
93
64
|
type Level = "l1" | "l2";
|
|
94
65
|
|
|
@@ -117,10 +88,10 @@ interface ActTableProps extends TmplBaseProps {
|
|
|
117
88
|
collapsible?: boolean;
|
|
118
89
|
initCollapse?: boolean;
|
|
119
90
|
readOnly?: boolean;
|
|
91
|
+
tableType?:"common"|"report";
|
|
120
92
|
}
|
|
121
93
|
|
|
122
94
|
interface ActTableStat {
|
|
123
|
-
//tableColumns?: object[];
|
|
124
95
|
sortedColConfigs?: ColumnConfig[];
|
|
125
96
|
queryKey?: QueryKey;
|
|
126
97
|
loading?: boolean;
|
|
@@ -230,7 +201,6 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
230
201
|
}
|
|
231
202
|
});
|
|
232
203
|
/** 构建column **/
|
|
233
|
-
// let tableColumns = this.buildTableColumns(ltmplConfig, hiddenColIds_, hiddenRowCodes, sortedColConfigs);
|
|
234
204
|
|
|
235
205
|
const { defaultPageSize } = ltmplConfig;
|
|
236
206
|
|
|
@@ -387,407 +357,6 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
387
357
|
}
|
|
388
358
|
};
|
|
389
359
|
|
|
390
|
-
buildTableColumns = (
|
|
391
|
-
ltmplConfig: LtmplConfig,
|
|
392
|
-
hiddenColIds: string[],
|
|
393
|
-
hiddenRowCodes: string[],
|
|
394
|
-
sortedColConfigs: ColumnConfig[]
|
|
395
|
-
) => {
|
|
396
|
-
const {
|
|
397
|
-
showView,
|
|
398
|
-
doEdit,
|
|
399
|
-
doRAction,
|
|
400
|
-
customEditable,
|
|
401
|
-
serverKey,
|
|
402
|
-
readOnly,
|
|
403
|
-
sourceId,
|
|
404
|
-
} = this.props;
|
|
405
|
-
const { translate } = this.context;
|
|
406
|
-
const { buttons, builtInButtons } = ltmplConfig;
|
|
407
|
-
let tableColumns = [];
|
|
408
|
-
let s = 0;
|
|
409
|
-
let colConfigs = sortedColConfigs ? sortedColConfigs : ltmplConfig.columns;
|
|
410
|
-
|
|
411
|
-
let currentDataColIndex = 0;
|
|
412
|
-
|
|
413
|
-
colConfigs.forEach((item) => {
|
|
414
|
-
let column = {};
|
|
415
|
-
if (!hiddenColIds || !hiddenColIds.includes(item.id)) {
|
|
416
|
-
tableColumns.push(column);
|
|
417
|
-
}
|
|
418
|
-
column["title"] = item.title;
|
|
419
|
-
column["dataIndex"] = item.id;
|
|
420
|
-
if (item["colWidth"]) column["width"] = item["colWidth"];
|
|
421
|
-
if (item["statColType"]) column["statColType"] = item["statColType"];
|
|
422
|
-
if (item["aggFunc"]) column["cal"] = item["aggFunc"];
|
|
423
|
-
if (item["order"]) column["order"] = Number(item["order"]);
|
|
424
|
-
// column['ellipsis']= true;
|
|
425
|
-
s++;
|
|
426
|
-
let itemType = SupportInputTypes.getSupportControlType(item);
|
|
427
|
-
if (s < 12 && item.title != "操作" && item.title != "序号") {
|
|
428
|
-
if (hiddenColIds.includes("10000")) {
|
|
429
|
-
const order = this.handleColumnOrder(column["dataIndex"]);
|
|
430
|
-
|
|
431
|
-
if(item.sortable) {
|
|
432
|
-
TableUnits.sort(column, itemType, order);
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
//特殊列处理
|
|
438
|
-
//序号
|
|
439
|
-
if (item.title === "序号") {
|
|
440
|
-
column["width"] = item.colWidth ? item.colWidth : 50;
|
|
441
|
-
column["title"] = translate("${序号}");
|
|
442
|
-
column["align"] = item.valueAlign ? item.valueAlign : "center";
|
|
443
|
-
//item.fixed='left';
|
|
444
|
-
column["render"] = (text, record, index) => <label>{index + 1}</label>;
|
|
445
|
-
item["sorter"] = undefined;
|
|
446
|
-
} else if (item.id == "10000") {
|
|
447
|
-
column["title"] = (
|
|
448
|
-
<Tooltip title={translate("${拖拽排序}")}>
|
|
449
|
-
{translate("${" + item.title + "}")}
|
|
450
|
-
</Tooltip>
|
|
451
|
-
);
|
|
452
|
-
column["width"] = 30;
|
|
453
|
-
column["dataIndex"] = item.id;
|
|
454
|
-
column["className"] = "drag-visible";
|
|
455
|
-
column["render"] = () => <DragHandle />;
|
|
456
|
-
} else if (item.id == "20000") {
|
|
457
|
-
//隐藏
|
|
458
|
-
column["align"] = "center";
|
|
459
|
-
column["width"] = 40;
|
|
460
|
-
column["title"] = (
|
|
461
|
-
<>
|
|
462
|
-
{hiddenRowCodes.length > 0 ? (
|
|
463
|
-
<Tooltip title={translate("${取消隐藏}")}>
|
|
464
|
-
<Button
|
|
465
|
-
style={{ marginRight: "0px" }}
|
|
466
|
-
size="small"
|
|
467
|
-
shape={"circle"}
|
|
468
|
-
icon={<EyeOutlined />}
|
|
469
|
-
type={"text"}
|
|
470
|
-
onClick={() => this.unHiden()}
|
|
471
|
-
></Button>
|
|
472
|
-
</Tooltip>
|
|
473
|
-
) : (
|
|
474
|
-
""
|
|
475
|
-
)}
|
|
476
|
-
</>
|
|
477
|
-
);
|
|
478
|
-
column["render"] = (text, record) => (
|
|
479
|
-
<Tooltip title={translate("${隐藏}")}>
|
|
480
|
-
{" "}
|
|
481
|
-
<Button
|
|
482
|
-
style={{ marginRight: "0px" }}
|
|
483
|
-
icon={<EyeInvisibleOutlined />}
|
|
484
|
-
type="dashed"
|
|
485
|
-
size="small"
|
|
486
|
-
onClick={() => this.onHide(record.code)}
|
|
487
|
-
></Button>
|
|
488
|
-
</Tooltip>
|
|
489
|
-
);
|
|
490
|
-
} else if (item.title === "操作") {
|
|
491
|
-
column["fixed"] = "right";
|
|
492
|
-
column["align"] = "center";
|
|
493
|
-
column["width"] = item.colWidth ? item.colWidth : 160;
|
|
494
|
-
column["className"] = "opsColumn";
|
|
495
|
-
column["title"] = <>{translate("${操作}")}</>;
|
|
496
|
-
column["render"] = (text, record) => (
|
|
497
|
-
<Space size={[0, 4]} wrap>
|
|
498
|
-
{buttons.includes("detail") &&
|
|
499
|
-
showView &&
|
|
500
|
-
ActionUtils.isShow(
|
|
501
|
-
ltmplConfig.buttonViewAction?.preposes,
|
|
502
|
-
[record],
|
|
503
|
-
undefined
|
|
504
|
-
) ? (
|
|
505
|
-
<ViewButton
|
|
506
|
-
showView={showView}
|
|
507
|
-
data={record}
|
|
508
|
-
ltmplConfig={ltmplConfig}
|
|
509
|
-
></ViewButton>
|
|
510
|
-
) : (
|
|
511
|
-
""
|
|
512
|
-
)}
|
|
513
|
-
{buttons.includes("customDetail") &&
|
|
514
|
-
showView &&
|
|
515
|
-
ActionUtils.isShow(
|
|
516
|
-
ltmplConfig.buttonViewAction?.preposes,
|
|
517
|
-
[record],
|
|
518
|
-
undefined
|
|
519
|
-
) ? (
|
|
520
|
-
<Button
|
|
521
|
-
size="small"
|
|
522
|
-
type="primary"
|
|
523
|
-
icon={<AlignLeftOutlined />}
|
|
524
|
-
onClick={() => showView({ code: record.code })}
|
|
525
|
-
></Button>
|
|
526
|
-
) : (
|
|
527
|
-
""
|
|
528
|
-
)}
|
|
529
|
-
{buttons.includes("dtmplEdit") && doEdit && !readOnly ? (
|
|
530
|
-
<EditButton
|
|
531
|
-
doEdit={doEdit}
|
|
532
|
-
data={record}
|
|
533
|
-
ltmplConfig={ltmplConfig}
|
|
534
|
-
></EditButton>
|
|
535
|
-
) : (
|
|
536
|
-
""
|
|
537
|
-
)}
|
|
538
|
-
{builtInButtons?.includes("blockAuthMenuTree") && !readOnly ? (
|
|
539
|
-
<Button
|
|
540
|
-
size="small"
|
|
541
|
-
type="dashed"
|
|
542
|
-
icon={
|
|
543
|
-
<KeyOutlined
|
|
544
|
-
rotate={180}
|
|
545
|
-
style={{ color: "#f5222d", marginRight: "4px" }}
|
|
546
|
-
/>
|
|
547
|
-
}
|
|
548
|
-
onClick={() =>
|
|
549
|
-
this.setState({
|
|
550
|
-
blockMenuTreeDrawerOpen: true,
|
|
551
|
-
recordCode: record.code,
|
|
552
|
-
})
|
|
553
|
-
}
|
|
554
|
-
></Button>
|
|
555
|
-
) : (
|
|
556
|
-
""
|
|
557
|
-
)}
|
|
558
|
-
{(buttons.includes("dtmplCustomEdit") || customEditable) &&
|
|
559
|
-
doEdit &&
|
|
560
|
-
!readOnly &&
|
|
561
|
-
ActionUtils.isShow(
|
|
562
|
-
ltmplConfig.buttonEditAction?.preposes,
|
|
563
|
-
[record],
|
|
564
|
-
undefined
|
|
565
|
-
) ? (
|
|
566
|
-
<Button
|
|
567
|
-
size="small"
|
|
568
|
-
type="dashed"
|
|
569
|
-
icon={<FormOutlined />}
|
|
570
|
-
onClick={() =>
|
|
571
|
-
doEdit({
|
|
572
|
-
code: record.code,
|
|
573
|
-
mode: "update",
|
|
574
|
-
toCustomPage: true,
|
|
575
|
-
})
|
|
576
|
-
}
|
|
577
|
-
></Button>
|
|
578
|
-
) : (
|
|
579
|
-
""
|
|
580
|
-
)}
|
|
581
|
-
{buttons.includes("copy") && doEdit && !readOnly ? (
|
|
582
|
-
<Tooltip title={translate("${复制}")}>
|
|
583
|
-
<Button
|
|
584
|
-
size="small"
|
|
585
|
-
type="dashed"
|
|
586
|
-
icon={<CopyOutlined />}
|
|
587
|
-
onClick={async () => {
|
|
588
|
-
//先复制
|
|
589
|
-
let toCustomPage = false;
|
|
590
|
-
if (buttons.includes("dtmplCustomEdit") || customEditable) {
|
|
591
|
-
toCustomPage = true;
|
|
592
|
-
}
|
|
593
|
-
let code = await HcserviceV3.doCopy(
|
|
594
|
-
serverKey,
|
|
595
|
-
sourceId,
|
|
596
|
-
record.code
|
|
597
|
-
);
|
|
598
|
-
if (code) {
|
|
599
|
-
doEdit({ code, mode: "update", toCustomPage });
|
|
600
|
-
}
|
|
601
|
-
}}
|
|
602
|
-
></Button>
|
|
603
|
-
</Tooltip>
|
|
604
|
-
) : (
|
|
605
|
-
""
|
|
606
|
-
)}
|
|
607
|
-
{ltmplConfig.rowCustomButtons
|
|
608
|
-
? ltmplConfig.rowCustomButtons.map((customButton) => {
|
|
609
|
-
return (
|
|
610
|
-
<Button
|
|
611
|
-
key={customButton.id}
|
|
612
|
-
size="small"
|
|
613
|
-
type={
|
|
614
|
-
customButton.buttonType
|
|
615
|
-
? customButton.buttonType
|
|
616
|
-
: "dashed"
|
|
617
|
-
}
|
|
618
|
-
onClick={() =>
|
|
619
|
-
this.doCustomButton(customButton, [record])
|
|
620
|
-
}
|
|
621
|
-
>
|
|
622
|
-
{translate("${" + customButton.title + "}")}
|
|
623
|
-
</Button>
|
|
624
|
-
);
|
|
625
|
-
})
|
|
626
|
-
: ""}
|
|
627
|
-
{ltmplConfig.ractions && !readOnly
|
|
628
|
-
? ltmplConfig.ractions.map((raction) => {
|
|
629
|
-
return (
|
|
630
|
-
ActionUtils.isShow(
|
|
631
|
-
raction?.preposes,
|
|
632
|
-
[record],
|
|
633
|
-
undefined
|
|
634
|
-
)?
|
|
635
|
-
<Button
|
|
636
|
-
key={raction.id}
|
|
637
|
-
size="small"
|
|
638
|
-
type="dashed"
|
|
639
|
-
onClick={() => doRAction(raction.id, record.code)}
|
|
640
|
-
>
|
|
641
|
-
{translate("${" + raction.title + "}")}
|
|
642
|
-
</Button>:""
|
|
643
|
-
);
|
|
644
|
-
})
|
|
645
|
-
: ""}
|
|
646
|
-
|
|
647
|
-
{ltmplConfig.rowActions &&
|
|
648
|
-
!readOnly &&
|
|
649
|
-
ltmplConfig.rowActions.length > 0
|
|
650
|
-
? ltmplConfig.rowActions.map((action) => {
|
|
651
|
-
return (
|
|
652
|
-
<Action
|
|
653
|
-
serverKey={serverKey}
|
|
654
|
-
iconType={"icon"}
|
|
655
|
-
key={action.id}
|
|
656
|
-
data={[record]}
|
|
657
|
-
actionConfig={action}
|
|
658
|
-
doAction={this.doRowAction}
|
|
659
|
-
buttonSize={"small"}
|
|
660
|
-
serial={1}
|
|
661
|
-
></Action>
|
|
662
|
-
);
|
|
663
|
-
})
|
|
664
|
-
: ""}
|
|
665
|
-
|
|
666
|
-
{ltmplConfig.rowJumps &&
|
|
667
|
-
ltmplConfig.rowJumps.length > 0 &&
|
|
668
|
-
!readOnly
|
|
669
|
-
? ltmplConfig.rowJumps.map((jump) => {
|
|
670
|
-
return (
|
|
671
|
-
<Button
|
|
672
|
-
key={jump.id}
|
|
673
|
-
size="small"
|
|
674
|
-
type="dashed"
|
|
675
|
-
onClick={() => this.doRowJump(jump, record)}
|
|
676
|
-
>
|
|
677
|
-
{translate("${" + jump.title + "}")}
|
|
678
|
-
</Button>
|
|
679
|
-
);
|
|
680
|
-
})
|
|
681
|
-
: ""}
|
|
682
|
-
{ltmplConfig.rowCQuerys &&
|
|
683
|
-
ltmplConfig.rowCQuerys.length > 0 &&
|
|
684
|
-
!readOnly
|
|
685
|
-
? ltmplConfig.rowCQuerys.map((cquery) => {
|
|
686
|
-
// console.log("record record", record);
|
|
687
|
-
return (
|
|
688
|
-
<CquickButton
|
|
689
|
-
serverKey={serverKey}
|
|
690
|
-
key={cquery.id}
|
|
691
|
-
size={"small"}
|
|
692
|
-
pageType={"drawer"}
|
|
693
|
-
// onClick={() => doCQuery(cquery.id)}
|
|
694
|
-
cQueryConfig={cquery}
|
|
695
|
-
mainCode={
|
|
696
|
-
cquery.mainCodeColId
|
|
697
|
-
? record[cquery.mainCodeColId]
|
|
698
|
-
: record.code
|
|
699
|
-
}
|
|
700
|
-
/>
|
|
701
|
-
);
|
|
702
|
-
})
|
|
703
|
-
: ""}
|
|
704
|
-
{ltmplConfig.rowFileButtons &&
|
|
705
|
-
ltmplConfig.rowFileButtons.length > 0
|
|
706
|
-
? ltmplConfig.rowFileButtons.map((openFileButton) => {
|
|
707
|
-
let v= record[openFileButton.fieldId];
|
|
708
|
-
if(v){
|
|
709
|
-
if(v instanceof Array){
|
|
710
|
-
v=v[0];
|
|
711
|
-
}
|
|
712
|
-
if(v.includes("@R@")>0){
|
|
713
|
-
v=v.split("@R@")[1];
|
|
714
|
-
}
|
|
715
|
-
return (
|
|
716
|
-
<NewinFileView
|
|
717
|
-
title={openFileButton.title}
|
|
718
|
-
filePath={HCService.toFilePath(v, serverKey)}
|
|
719
|
-
serverKey={serverKey}
|
|
720
|
-
key={openFileButton.id}
|
|
721
|
-
//size={"small"}
|
|
722
|
-
/>
|
|
723
|
-
);
|
|
724
|
-
}else{
|
|
725
|
-
return "";
|
|
726
|
-
}
|
|
727
|
-
})
|
|
728
|
-
: ""}
|
|
729
|
-
{buttons.includes("singleDelete") &&
|
|
730
|
-
!readOnly &&
|
|
731
|
-
ActionUtils.isShow(
|
|
732
|
-
ltmplConfig.buttonDeleteAction?.preposes,
|
|
733
|
-
[record],
|
|
734
|
-
undefined
|
|
735
|
-
) ? (
|
|
736
|
-
<Popconfirm
|
|
737
|
-
placement="rightBottom"
|
|
738
|
-
title={translate("${确定要[删除]此数据吗}?")}
|
|
739
|
-
onConfirm={() => {
|
|
740
|
-
this.doDeleteByCode(record.code);
|
|
741
|
-
}}
|
|
742
|
-
okText={translate("${确定}")}
|
|
743
|
-
cancelText={translate("${取消}")}
|
|
744
|
-
okType={"danger"}
|
|
745
|
-
>
|
|
746
|
-
<Button size="small" type="dashed" danger>
|
|
747
|
-
<DeleteOutlined />
|
|
748
|
-
</Button>
|
|
749
|
-
</Popconfirm>
|
|
750
|
-
) : (
|
|
751
|
-
""
|
|
752
|
-
)}
|
|
753
|
-
</Space>
|
|
754
|
-
);
|
|
755
|
-
} else {
|
|
756
|
-
currentDataColIndex++;
|
|
757
|
-
column["className"] = "opsColumn";
|
|
758
|
-
column["title"] = translate("${" + item.title + "}");
|
|
759
|
-
column["width"] = item.colWidth ? item.colWidth : 160;
|
|
760
|
-
column["ellipsis"] = { showTitle: true };
|
|
761
|
-
column["align"] = item.valueAlign ? item.valueAlign : "left";
|
|
762
|
-
if (
|
|
763
|
-
ltmplConfig.leftFixedCols &&
|
|
764
|
-
ltmplConfig.leftFixedCols >= currentDataColIndex
|
|
765
|
-
) {
|
|
766
|
-
column["fixed"] = "left";
|
|
767
|
-
} else {
|
|
768
|
-
column["fixed"] = item.colFixed
|
|
769
|
-
? item.colFixed == "right"
|
|
770
|
-
? "right"
|
|
771
|
-
: "left"
|
|
772
|
-
: false;
|
|
773
|
-
}
|
|
774
|
-
column["render"] = (text, record) => {
|
|
775
|
-
return (
|
|
776
|
-
<ViewControl
|
|
777
|
-
serverKey={serverKey}
|
|
778
|
-
fieldConfig={item}
|
|
779
|
-
value={record[item.id]}
|
|
780
|
-
holderType={"table"}
|
|
781
|
-
/>
|
|
782
|
-
);
|
|
783
|
-
};
|
|
784
|
-
}
|
|
785
|
-
});
|
|
786
|
-
|
|
787
|
-
console.log("columns", tableColumns);
|
|
788
|
-
|
|
789
|
-
return tableColumns;
|
|
790
|
-
};
|
|
791
360
|
|
|
792
361
|
async componentDidMount() {
|
|
793
362
|
const { ltmplConfig } = this.props;
|
|
@@ -818,11 +387,11 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
818
387
|
(sourceId && preSourceId != sourceId) ||
|
|
819
388
|
(ltmplConfig &&
|
|
820
389
|
(!preLtmplConfig || ltmplConfig.id != preLtmplConfig.id)) ||
|
|
821
|
-
|
|
390
|
+
ProgramConfig.transQueryParamsToStr(criteriaData, false, [
|
|
822
391
|
"pageSize",
|
|
823
392
|
"pageNo",
|
|
824
393
|
]) !=
|
|
825
|
-
|
|
394
|
+
ProgramConfig.transQueryParamsToStr(preCriteriaData, false, [
|
|
826
395
|
"pageSize",
|
|
827
396
|
"pageNo",
|
|
828
397
|
])
|
|
@@ -869,17 +438,15 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
869
438
|
const { hiddenColIds, sortedColConfigs } = this.state;
|
|
870
439
|
this.setState({
|
|
871
440
|
hiddenRowCodes: [],
|
|
872
|
-
// tableColumns: this.buildTableColumns(ltmplConfig, hiddenColIds, [], sortedColConfigs),
|
|
873
441
|
});
|
|
874
442
|
};
|
|
875
443
|
|
|
876
444
|
onHide = (code: string) => {
|
|
877
|
-
|
|
878
|
-
const { hiddenRowCodes
|
|
445
|
+
|
|
446
|
+
const { hiddenRowCodes } = this.state;
|
|
879
447
|
let hiddenCodes = [...hiddenRowCodes, code];
|
|
880
448
|
this.setState({
|
|
881
449
|
hiddenRowCodes: hiddenCodes,
|
|
882
|
-
// tableColumns: this.buildTableColumns(ltmplConfig, hiddenColIds, hiddenCodes, sortedColConfigs),
|
|
883
450
|
});
|
|
884
451
|
};
|
|
885
452
|
|
|
@@ -890,12 +457,9 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
890
457
|
};
|
|
891
458
|
|
|
892
459
|
changeHiddenColumns = (hiddenColIds: string[]) => {
|
|
893
|
-
const {} = this.props;
|
|
894
|
-
const {} = this.state;
|
|
895
460
|
this.setState({
|
|
896
461
|
showL2Chart: false,
|
|
897
462
|
hiddenColIds,
|
|
898
|
-
// tableColumns: this.buildTableColumns(ltmplConfig, hiddenColIds, hiddenRowCodes, sortedColConfigs),
|
|
899
463
|
});
|
|
900
464
|
};
|
|
901
465
|
|
|
@@ -1023,9 +587,9 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
1023
587
|
}
|
|
1024
588
|
}
|
|
1025
589
|
}
|
|
1026
|
-
url =
|
|
590
|
+
url = ProgramConfig.joinPath(url, paths.join("/"));
|
|
1027
591
|
} else {
|
|
1028
|
-
url =
|
|
592
|
+
url = ProgramConfig.joinPath(url, path);
|
|
1029
593
|
}
|
|
1030
594
|
|
|
1031
595
|
//处理search 参数
|
|
@@ -1033,7 +597,7 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
1033
597
|
let searchs = [];
|
|
1034
598
|
//放入token
|
|
1035
599
|
if (jump.tokenName) {
|
|
1036
|
-
searchs[0] = jump.tokenName + "=" +
|
|
600
|
+
searchs[0] = jump.tokenName + "=" + ProgramConfig.hydrocarbonToken();
|
|
1037
601
|
}
|
|
1038
602
|
|
|
1039
603
|
if (searchParamConfigs) {
|
|
@@ -1064,6 +628,13 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
1064
628
|
}
|
|
1065
629
|
};
|
|
1066
630
|
|
|
631
|
+
blockMenuTreeDrawerOpen=(record)=>{
|
|
632
|
+
this.setState({
|
|
633
|
+
blockMenuTreeDrawerOpen: true,
|
|
634
|
+
recordCode: record.code,
|
|
635
|
+
})
|
|
636
|
+
}
|
|
637
|
+
|
|
1067
638
|
doRowJump = async (jump: JumpConfig, record: DtmplData) => {
|
|
1068
639
|
this.doJump(jump, record);
|
|
1069
640
|
};
|
|
@@ -1099,10 +670,6 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
1099
670
|
<Tooltip title={translate("${" + title + "}")}>
|
|
1100
671
|
<Button
|
|
1101
672
|
style={{
|
|
1102
|
-
// display:
|
|
1103
|
-
// buttons.includes("exportLtmplExcel") && !readOnly
|
|
1104
|
-
// ? "inline"
|
|
1105
|
-
// : "none",
|
|
1106
673
|
marginLeft: "5px",
|
|
1107
674
|
}} //为了点击到没有导出模块,使组件不致销毁,丢失导出数据
|
|
1108
675
|
>
|
|
@@ -1147,11 +714,8 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
1147
714
|
};
|
|
1148
715
|
|
|
1149
716
|
onChangeColSort = (sortedColConfigs: ColumnConfig[]) => {
|
|
1150
|
-
const { ltmplConfig } = this.props;
|
|
1151
|
-
const { hiddenRowCodes, hiddenColIds } = this.state;
|
|
1152
717
|
this.setState({
|
|
1153
718
|
sortedColConfigs,
|
|
1154
|
-
// tableColumns: this.buildTableColumns(ltmplConfig, hiddenColIds, hiddenRowCodes, sortedColConfigs),
|
|
1155
719
|
});
|
|
1156
720
|
};
|
|
1157
721
|
|
|
@@ -1178,7 +742,6 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
1178
742
|
renderHeaderButtons = () => {
|
|
1179
743
|
let {
|
|
1180
744
|
hiddenColIds,
|
|
1181
|
-
queryKey,
|
|
1182
745
|
viewModels,
|
|
1183
746
|
sortedColConfigs,
|
|
1184
747
|
disabledColIds,
|
|
@@ -1195,8 +758,6 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
1195
758
|
customCreatable,
|
|
1196
759
|
serverKey,
|
|
1197
760
|
readOnly,
|
|
1198
|
-
pageNo,
|
|
1199
|
-
pageSize,
|
|
1200
761
|
} = this.props;
|
|
1201
762
|
const { translate } = this.context;
|
|
1202
763
|
let { buttons } = ltmplConfig;
|
|
@@ -1453,9 +1014,15 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
1453
1014
|
serverKey,
|
|
1454
1015
|
doSearch,
|
|
1455
1016
|
criteriaData,
|
|
1017
|
+
showView,
|
|
1018
|
+
doEdit,
|
|
1019
|
+
doRAction,
|
|
1020
|
+
customEditable,
|
|
1021
|
+
readOnly,tableType
|
|
1456
1022
|
} = this.props;
|
|
1457
1023
|
const { translate } = this.context;
|
|
1458
1024
|
|
|
1025
|
+
|
|
1459
1026
|
if (!ltmplConfig || !sourceId) {
|
|
1460
1027
|
return (
|
|
1461
1028
|
<>
|
|
@@ -1465,11 +1032,22 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
1465
1032
|
);
|
|
1466
1033
|
}
|
|
1467
1034
|
|
|
1468
|
-
|
|
1469
|
-
|
|
1035
|
+
|
|
1036
|
+
|
|
1037
|
+
let tableColumns = ColumnBuilder.buildTableColumns(
|
|
1038
|
+
{ltmplConfig,
|
|
1470
1039
|
hiddenColIds,
|
|
1471
1040
|
hiddenRowCodes,
|
|
1472
|
-
sortedColConfigs
|
|
1041
|
+
sortedColConfigs,showView,
|
|
1042
|
+
doEdit,
|
|
1043
|
+
doRAction,
|
|
1044
|
+
customEditable,
|
|
1045
|
+
serverKey,
|
|
1046
|
+
readOnly,
|
|
1047
|
+
sourceId, translate,unHiden:this.unHiden,
|
|
1048
|
+
onHide:this.onHide, doCustomButton:this.doCustomButton, doRowJump:this.doRowJump,
|
|
1049
|
+
blockMenuTreeDrawerOpen:this.blockMenuTreeDrawerOpen,
|
|
1050
|
+
doRowAction:this.doRowAction, doDeleteByCode:this.doDeleteByCode,sortColumns:criteriaData["sortColIds"]}
|
|
1473
1051
|
);
|
|
1474
1052
|
|
|
1475
1053
|
let { buttons } = ltmplConfig;
|
|
@@ -1544,7 +1122,15 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
1544
1122
|
{displayCriteriaCard ? this.renderCriteriaForm() : null}
|
|
1545
1123
|
{loading ? (
|
|
1546
1124
|
<Table loading={loading}></Table>
|
|
1547
|
-
) : (
|
|
1125
|
+
) : (tableType =="report"?<ReportTable
|
|
1126
|
+
tableProps={{scrollY:ltmplConfig.scrollY,clickDisplayTotal:!ltmplConfig.directShowTotal}}
|
|
1127
|
+
serverKey={serverKey}
|
|
1128
|
+
maxSelectedRows={this.checkBoxUseful() ? 1000 : -1}
|
|
1129
|
+
columns={tableColumns}
|
|
1130
|
+
selectedRows={selectedRows} queryKey={queryKey}
|
|
1131
|
+
onChangeRowSelection={this.changeRowSelection}
|
|
1132
|
+
leftFixedCols={ltmplConfig.leftFixedCols}
|
|
1133
|
+
/>:
|
|
1548
1134
|
<QueryTable
|
|
1549
1135
|
tableProps={{scrollY:ltmplConfig.scrollY,clickDisplayTotal:!ltmplConfig.directShowTotal}}
|
|
1550
1136
|
serverKey={serverKey}
|
|
@@ -1615,23 +1201,7 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
1615
1201
|
doSearch(null);
|
|
1616
1202
|
};
|
|
1617
1203
|
|
|
1618
|
-
handleColumnOrder(columnId) {
|
|
1619
|
-
const sortColumns = this.props.criteriaData["sortColIds"];
|
|
1620
|
-
|
|
1621
|
-
if (!Array.isArray(sortColumns)) return undefined;
|
|
1622
1204
|
|
|
1623
|
-
for (const column of sortColumns) {
|
|
1624
|
-
const [key, sort] = column.split("_");
|
|
1625
|
-
|
|
1626
|
-
if (key === columnId) {
|
|
1627
|
-
if (sort === "asc") return "ascend";
|
|
1628
|
-
if (sort === "desc") return "descend";
|
|
1629
|
-
continue;
|
|
1630
|
-
}
|
|
1631
|
-
}
|
|
1632
|
-
|
|
1633
|
-
return undefined;
|
|
1634
|
-
}
|
|
1635
1205
|
|
|
1636
1206
|
|
|
1637
1207
|
|
|
@@ -1641,9 +1211,6 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
1641
1211
|
loading,
|
|
1642
1212
|
blockMenuTreeDrawerOpen,
|
|
1643
1213
|
recordCode,
|
|
1644
|
-
showCustomCard,
|
|
1645
|
-
customButton,
|
|
1646
|
-
customButtonData,
|
|
1647
1214
|
showRatmplSelector,
|
|
1648
1215
|
} = this.state;
|
|
1649
1216
|
let {
|
|
@@ -1656,8 +1223,6 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
1656
1223
|
serverKey,
|
|
1657
1224
|
mainCode,
|
|
1658
1225
|
} = this.props;
|
|
1659
|
-
const { translate } = this.context;
|
|
1660
|
-
|
|
1661
1226
|
if (!ltmplConfig || !sourceId) {
|
|
1662
1227
|
return (
|
|
1663
1228
|
<>
|
|
@@ -1669,7 +1234,6 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
1669
1234
|
|
|
1670
1235
|
return (
|
|
1671
1236
|
<>
|
|
1672
|
-
{" "}
|
|
1673
1237
|
{this.renderAboveCustomPage()}
|
|
1674
1238
|
{collapsible ? (
|
|
1675
1239
|
<CollapseCard
|
|
@@ -1677,6 +1241,7 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
1677
1241
|
title={
|
|
1678
1242
|
<>
|
|
1679
1243
|
{!title ? ltmplConfig.title : title}
|
|
1244
|
+
|
|
1680
1245
|
<ToolTipBar
|
|
1681
1246
|
content={tip ? tip : ltmplConfig ? ltmplConfig.tip : null}
|
|
1682
1247
|
/>
|