aldehyde 0.2.213 → 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 +3 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +4 -3
- 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/context-setter.d.ts.map +1 -1
- package/lib/login/context-setter.js.map +1 -1
- package/lib/login/login.d.ts.map +1 -1
- package/lib/login2/login-page.d.ts +8 -0
- package/lib/login2/login-page.d.ts.map +1 -0
- package/lib/login2/{LoginPage.js → login-page.js} +26 -8
- package/lib/login2/login-page.js.map +1 -0
- package/lib/login2/{Login.d.ts → login.d.ts} +1 -1
- package/lib/login2/{Login.d.ts.map → login.d.ts.map} +1 -1
- package/lib/login2/{Login.js → login.js} +1 -1
- package/lib/login2/{Login.js.map → login.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 +7 -4
- 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/login/context-setter.tsx +0 -1
- package/src/aldehyde/login2/login-page.tsx +94 -0
- 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
- package/lib/login2/LoginPage.d.ts +0 -4
- package/lib/login2/LoginPage.d.ts.map +0 -1
- package/lib/login2/LoginPage.js.map +0 -1
- package/lib/login2/index.d.ts +0 -4
- package/lib/login2/index.d.ts.map +0 -1
- package/lib/login2/index.js +0 -4
- package/lib/login2/index.js.map +0 -1
- package/src/aldehyde/login2/LoginPage.tsx +0 -64
- package/src/aldehyde/login2/index.tsx +0 -4
- /package/src/aldehyde/login2/{Login.tsx → login.tsx} +0 -0
|
@@ -0,0 +1,566 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {
|
|
3
|
+
ColumnConfig,
|
|
4
|
+
CustomButton,
|
|
5
|
+
DoEditParam,
|
|
6
|
+
DtmplData,
|
|
7
|
+
JumpConfig,
|
|
8
|
+
LtmplConfig,
|
|
9
|
+
ShowViewParam
|
|
10
|
+
} from "../../tmpl/interface";
|
|
11
|
+
import TableUnits from "../table-util";
|
|
12
|
+
import SupportInputTypes from "../../tmpl/control-type-supportor";
|
|
13
|
+
import {Button, Popconfirm, Space, theme, Tooltip} from "antd";
|
|
14
|
+
import {SortableHandle} from "react-sortable-hoc";
|
|
15
|
+
import {
|
|
16
|
+
AlignLeftOutlined, CopyOutlined, DeleteOutlined,
|
|
17
|
+
EyeInvisibleOutlined,
|
|
18
|
+
EyeOutlined,
|
|
19
|
+
FormOutlined,
|
|
20
|
+
KeyOutlined,
|
|
21
|
+
MenuOutlined
|
|
22
|
+
} from "@ant-design/icons";
|
|
23
|
+
import ActionUtils from "../../controls/action/utils";
|
|
24
|
+
import ViewButton from "../../detail/button/view-button";
|
|
25
|
+
import EditButton from "../../detail/button/edit-button";
|
|
26
|
+
import HcserviceV3 from "../../tmpl/hcservice-v3";
|
|
27
|
+
import Action from "../../controls/action";
|
|
28
|
+
import CquickButton from "../../controls/cquery/cquick-button";
|
|
29
|
+
import {ViewControl} from "../../index";
|
|
30
|
+
import NewinFileView from "../../controls/file-view/newin-file-view";
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
interface ColumnBuilderProps {
|
|
34
|
+
ltmplConfig: LtmplConfig,
|
|
35
|
+
hiddenColIds?: string[],
|
|
36
|
+
hiddenRowCodes?: string[],
|
|
37
|
+
sortedColConfigs?: ColumnConfig[],
|
|
38
|
+
showView?: (showVievParam: ShowViewParam) => void;
|
|
39
|
+
doEdit?: (doEditParam: DoEditParam) => void;
|
|
40
|
+
doRAction?: (ractionId: string, mainCode: string) => void;
|
|
41
|
+
customEditable?: boolean;
|
|
42
|
+
serverKey?:string,
|
|
43
|
+
readOnly?:boolean,
|
|
44
|
+
sourceId:string,
|
|
45
|
+
translate:(...strs: string[]) => string;
|
|
46
|
+
unHiden?:()=>any,
|
|
47
|
+
onHide?:(code: string)=>any,
|
|
48
|
+
doCustomButton?:(customButton: CustomButton, records: DtmplData[]) => any,
|
|
49
|
+
doRowJump?:(jump: JumpConfig, record: DtmplData)=>any,
|
|
50
|
+
blockMenuTreeDrawerOpen?:(record)=>any,
|
|
51
|
+
doRowAction?:(actionId: string, codes: string[], params: object) =>any,
|
|
52
|
+
doDeleteByCode?:(code: string)=>any,sortColumns:any
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
interface ReportColumnBuilderProps {
|
|
56
|
+
columnConfigs: ColumnConfig[],
|
|
57
|
+
translate:(...strs: string[]) => string;
|
|
58
|
+
leftFixedCols: number,
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
export default {
|
|
63
|
+
|
|
64
|
+
buildTableColumns(props: ColumnBuilderProps) {
|
|
65
|
+
const {
|
|
66
|
+
ltmplConfig,
|
|
67
|
+
hiddenColIds,
|
|
68
|
+
hiddenRowCodes,
|
|
69
|
+
sortedColConfigs,
|
|
70
|
+
showView,
|
|
71
|
+
doEdit,
|
|
72
|
+
doRAction,
|
|
73
|
+
customEditable,
|
|
74
|
+
serverKey,
|
|
75
|
+
readOnly,
|
|
76
|
+
sourceId, translate, unHiden,
|
|
77
|
+
onHide, doCustomButton, doRowJump, blockMenuTreeDrawerOpen,
|
|
78
|
+
doRowAction, doDeleteByCode,sortColumns
|
|
79
|
+
} = props;
|
|
80
|
+
|
|
81
|
+
const {buttons, builtInButtons} = ltmplConfig;
|
|
82
|
+
let tableColumns = [];
|
|
83
|
+
let s = 0;
|
|
84
|
+
let colConfigs = sortedColConfigs ? sortedColConfigs : ltmplConfig.columns;
|
|
85
|
+
|
|
86
|
+
let currentDataColIndex = 0;
|
|
87
|
+
|
|
88
|
+
colConfigs.forEach((item) => {
|
|
89
|
+
let column = {};
|
|
90
|
+
if (!hiddenColIds || !hiddenColIds.includes(item.id)) {
|
|
91
|
+
tableColumns.push(column);
|
|
92
|
+
}
|
|
93
|
+
column["title"] = item.title;
|
|
94
|
+
column["dataIndex"] = item.id;
|
|
95
|
+
if (item["colWidth"]) column["width"] = item["colWidth"];
|
|
96
|
+
if (item["statColType"]) column["statColType"] = item["statColType"];
|
|
97
|
+
if (item["aggFunc"]) column["cal"] = item["aggFunc"];
|
|
98
|
+
if (item["order"]) column["order"] = Number(item["order"]);
|
|
99
|
+
// column['ellipsis']= true;
|
|
100
|
+
s++;
|
|
101
|
+
let itemType = SupportInputTypes.getSupportControlType(item);
|
|
102
|
+
if (s < 12 && item.title != "操作" && item.title != "序号") {
|
|
103
|
+
if (hiddenColIds.includes("10000")) {
|
|
104
|
+
const order = this.handleColumnOrder(column["dataIndex"], sortColumns);
|
|
105
|
+
if (item.sortable) {
|
|
106
|
+
TableUnits.sort(column, itemType, order);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
//特殊列处理
|
|
112
|
+
//序号
|
|
113
|
+
if (item.title === "序号") {
|
|
114
|
+
column["width"] = item.colWidth ? item.colWidth : 50;
|
|
115
|
+
column["title"] = translate("${序号}");
|
|
116
|
+
column["align"] = item.valueAlign ? item.valueAlign : "center";
|
|
117
|
+
column["render"] = (text, record, index) => <label>{index + 1}</label>;
|
|
118
|
+
item["sorter"] = undefined;
|
|
119
|
+
} else if (item.id == "10000") {
|
|
120
|
+
column["title"] = (
|
|
121
|
+
<Tooltip title={translate("${拖拽排序}")}>
|
|
122
|
+
{translate("${" + item.title + "}")}
|
|
123
|
+
</Tooltip>
|
|
124
|
+
);
|
|
125
|
+
column["width"] = 30;
|
|
126
|
+
column["dataIndex"] = item.id;
|
|
127
|
+
column["className"] = "drag-visible";
|
|
128
|
+
column["render"] = () => <DragHandle/>;
|
|
129
|
+
} else if (item.id == "20000") {
|
|
130
|
+
//隐藏
|
|
131
|
+
column["align"] = "center";
|
|
132
|
+
column["width"] = 40;
|
|
133
|
+
column["title"] = (
|
|
134
|
+
<>
|
|
135
|
+
{hiddenRowCodes.length > 0 ? (
|
|
136
|
+
<Tooltip title={translate("${取消隐藏}")}>
|
|
137
|
+
<Button
|
|
138
|
+
style={{marginRight: "0px"}}
|
|
139
|
+
size="small"
|
|
140
|
+
shape={"circle"}
|
|
141
|
+
icon={<EyeOutlined/>}
|
|
142
|
+
type={"text"}
|
|
143
|
+
onClick={() => unHiden()}
|
|
144
|
+
></Button>
|
|
145
|
+
</Tooltip>
|
|
146
|
+
) : (
|
|
147
|
+
""
|
|
148
|
+
)}
|
|
149
|
+
</>
|
|
150
|
+
);
|
|
151
|
+
column["render"] = (text, record) => (
|
|
152
|
+
<Tooltip title={translate("${隐藏}")}>
|
|
153
|
+
{" "}
|
|
154
|
+
<Button
|
|
155
|
+
style={{marginRight: "0px"}}
|
|
156
|
+
icon={<EyeInvisibleOutlined/>}
|
|
157
|
+
type="dashed"
|
|
158
|
+
size="small"
|
|
159
|
+
onClick={() => onHide(record.code)}
|
|
160
|
+
></Button>
|
|
161
|
+
</Tooltip>
|
|
162
|
+
);
|
|
163
|
+
} else if (item.title === "操作") {
|
|
164
|
+
column["fixed"] = "right";
|
|
165
|
+
column["align"] = "center";
|
|
166
|
+
column["width"] = item.colWidth ? item.colWidth : 160;
|
|
167
|
+
column["className"] = "opsColumn";
|
|
168
|
+
column["title"] = <>{translate("${操作}")}</>;
|
|
169
|
+
column["render"] = (text, record) => (
|
|
170
|
+
<Space size={[0, 4]} wrap>
|
|
171
|
+
{buttons.includes("detail") &&
|
|
172
|
+
showView &&
|
|
173
|
+
ActionUtils.isShow(
|
|
174
|
+
ltmplConfig.buttonViewAction?.preposes,
|
|
175
|
+
[record],
|
|
176
|
+
undefined
|
|
177
|
+
) ? (
|
|
178
|
+
<ViewButton
|
|
179
|
+
showView={showView}
|
|
180
|
+
data={record}
|
|
181
|
+
ltmplConfig={ltmplConfig}
|
|
182
|
+
></ViewButton>
|
|
183
|
+
) : (
|
|
184
|
+
""
|
|
185
|
+
)}
|
|
186
|
+
{buttons.includes("customDetail") &&
|
|
187
|
+
showView &&
|
|
188
|
+
ActionUtils.isShow(
|
|
189
|
+
ltmplConfig.buttonViewAction?.preposes,
|
|
190
|
+
[record],
|
|
191
|
+
undefined
|
|
192
|
+
) ? (
|
|
193
|
+
<Button
|
|
194
|
+
size="small"
|
|
195
|
+
type="primary"
|
|
196
|
+
icon={<AlignLeftOutlined/>}
|
|
197
|
+
onClick={() => showView({code: record.code})}
|
|
198
|
+
></Button>
|
|
199
|
+
) : (
|
|
200
|
+
""
|
|
201
|
+
)}
|
|
202
|
+
{buttons.includes("dtmplEdit") && doEdit && !readOnly ? (
|
|
203
|
+
<EditButton
|
|
204
|
+
doEdit={doEdit}
|
|
205
|
+
data={record}
|
|
206
|
+
ltmplConfig={ltmplConfig}
|
|
207
|
+
></EditButton>
|
|
208
|
+
) : (
|
|
209
|
+
""
|
|
210
|
+
)}
|
|
211
|
+
{builtInButtons?.includes("blockAuthMenuTree") && !readOnly ? (
|
|
212
|
+
<Button
|
|
213
|
+
size="small"
|
|
214
|
+
type="dashed"
|
|
215
|
+
icon={
|
|
216
|
+
<KeyOutlined
|
|
217
|
+
rotate={180}
|
|
218
|
+
style={{color: "#f5222d", marginRight: "4px"}}
|
|
219
|
+
/>
|
|
220
|
+
}
|
|
221
|
+
onClick={() => blockMenuTreeDrawerOpen(record)
|
|
222
|
+
}
|
|
223
|
+
></Button>
|
|
224
|
+
) : (
|
|
225
|
+
""
|
|
226
|
+
)}
|
|
227
|
+
{(buttons.includes("dtmplCustomEdit") || customEditable) &&
|
|
228
|
+
doEdit &&
|
|
229
|
+
!readOnly &&
|
|
230
|
+
ActionUtils.isShow(
|
|
231
|
+
ltmplConfig.buttonEditAction?.preposes,
|
|
232
|
+
[record],
|
|
233
|
+
undefined
|
|
234
|
+
) ? (
|
|
235
|
+
<Button
|
|
236
|
+
size="small"
|
|
237
|
+
type="dashed"
|
|
238
|
+
icon={<FormOutlined/>}
|
|
239
|
+
onClick={() =>
|
|
240
|
+
doEdit({
|
|
241
|
+
code: record.code,
|
|
242
|
+
mode: "update",
|
|
243
|
+
toCustomPage: true,
|
|
244
|
+
})
|
|
245
|
+
}
|
|
246
|
+
></Button>
|
|
247
|
+
) : (
|
|
248
|
+
""
|
|
249
|
+
)}
|
|
250
|
+
{buttons.includes("copy") && doEdit && !readOnly ? (
|
|
251
|
+
<Tooltip title={translate("${复制}")}>
|
|
252
|
+
<Button
|
|
253
|
+
size="small"
|
|
254
|
+
type="dashed"
|
|
255
|
+
icon={<CopyOutlined/>}
|
|
256
|
+
onClick={async () => {
|
|
257
|
+
//先复制
|
|
258
|
+
let toCustomPage = false;
|
|
259
|
+
if (buttons.includes("dtmplCustomEdit") || customEditable) {
|
|
260
|
+
toCustomPage = true;
|
|
261
|
+
}
|
|
262
|
+
let code = await HcserviceV3.doCopy(
|
|
263
|
+
serverKey,
|
|
264
|
+
sourceId,
|
|
265
|
+
record.code
|
|
266
|
+
);
|
|
267
|
+
if (code) {
|
|
268
|
+
doEdit({code, mode: "update", toCustomPage});
|
|
269
|
+
}
|
|
270
|
+
}}
|
|
271
|
+
></Button>
|
|
272
|
+
</Tooltip>
|
|
273
|
+
) : (
|
|
274
|
+
""
|
|
275
|
+
)}
|
|
276
|
+
{ltmplConfig.rowCustomButtons
|
|
277
|
+
? ltmplConfig.rowCustomButtons.map((customButton) => {
|
|
278
|
+
return (
|
|
279
|
+
<Button
|
|
280
|
+
key={customButton.id}
|
|
281
|
+
size="small"
|
|
282
|
+
type={
|
|
283
|
+
customButton.buttonType
|
|
284
|
+
? customButton.buttonType
|
|
285
|
+
: "dashed"
|
|
286
|
+
}
|
|
287
|
+
onClick={() =>
|
|
288
|
+
doCustomButton(customButton, [record])
|
|
289
|
+
}
|
|
290
|
+
>
|
|
291
|
+
{translate("${" + customButton.title + "}")}
|
|
292
|
+
</Button>
|
|
293
|
+
);
|
|
294
|
+
})
|
|
295
|
+
: ""}
|
|
296
|
+
{ltmplConfig.ractions && !readOnly
|
|
297
|
+
? ltmplConfig.ractions.map((raction) => {
|
|
298
|
+
return (
|
|
299
|
+
ActionUtils.isShow(
|
|
300
|
+
raction?.preposes,
|
|
301
|
+
[record],
|
|
302
|
+
undefined
|
|
303
|
+
) ?
|
|
304
|
+
<Button
|
|
305
|
+
key={raction.id}
|
|
306
|
+
size="small"
|
|
307
|
+
type="dashed"
|
|
308
|
+
onClick={() => doRAction(raction.id, record.code)}
|
|
309
|
+
>
|
|
310
|
+
{translate("${" + raction.title + "}")}
|
|
311
|
+
</Button> : ""
|
|
312
|
+
);
|
|
313
|
+
})
|
|
314
|
+
: ""}
|
|
315
|
+
|
|
316
|
+
{ltmplConfig.rowActions &&
|
|
317
|
+
!readOnly &&
|
|
318
|
+
ltmplConfig.rowActions.length > 0
|
|
319
|
+
? ltmplConfig.rowActions.map((action) => {
|
|
320
|
+
return (
|
|
321
|
+
<Action
|
|
322
|
+
serverKey={serverKey}
|
|
323
|
+
iconType={"icon"}
|
|
324
|
+
key={action.id}
|
|
325
|
+
data={[record]}
|
|
326
|
+
actionConfig={action}
|
|
327
|
+
doAction={doRowAction}
|
|
328
|
+
buttonSize={"small"}
|
|
329
|
+
serial={1}
|
|
330
|
+
></Action>
|
|
331
|
+
);
|
|
332
|
+
})
|
|
333
|
+
: ""}
|
|
334
|
+
|
|
335
|
+
{ltmplConfig.rowJumps &&
|
|
336
|
+
ltmplConfig.rowJumps.length > 0 &&
|
|
337
|
+
!readOnly
|
|
338
|
+
? ltmplConfig.rowJumps.map((jump) => {
|
|
339
|
+
return (
|
|
340
|
+
<Button
|
|
341
|
+
key={jump.id}
|
|
342
|
+
size="small"
|
|
343
|
+
type="dashed"
|
|
344
|
+
onClick={() => doRowJump(jump, record)}
|
|
345
|
+
>
|
|
346
|
+
{translate("${" + jump.title + "}")}
|
|
347
|
+
</Button>
|
|
348
|
+
);
|
|
349
|
+
})
|
|
350
|
+
: ""}
|
|
351
|
+
{ltmplConfig.rowCQuerys &&
|
|
352
|
+
ltmplConfig.rowCQuerys.length > 0 &&
|
|
353
|
+
!readOnly
|
|
354
|
+
? ltmplConfig.rowCQuerys.map((cquery) => {
|
|
355
|
+
// console.log("record record", record);
|
|
356
|
+
return (
|
|
357
|
+
<CquickButton
|
|
358
|
+
serverKey={serverKey}
|
|
359
|
+
key={cquery.id}
|
|
360
|
+
size={"small"}
|
|
361
|
+
pageType={"drawer"}
|
|
362
|
+
// onClick={() => doCQuery(cquery.id)}
|
|
363
|
+
cQueryConfig={cquery}
|
|
364
|
+
mainCode={
|
|
365
|
+
cquery.mainCodeColId
|
|
366
|
+
? record[cquery.mainCodeColId]
|
|
367
|
+
: record.code
|
|
368
|
+
}
|
|
369
|
+
/>
|
|
370
|
+
);
|
|
371
|
+
})
|
|
372
|
+
: ""}
|
|
373
|
+
{ltmplConfig.rowFileButtons &&
|
|
374
|
+
ltmplConfig.rowFileButtons.length > 0
|
|
375
|
+
? ltmplConfig.rowFileButtons.map((openFileButton) => {
|
|
376
|
+
let v = record[openFileButton.fieldId];
|
|
377
|
+
if (v) {
|
|
378
|
+
if (v instanceof Array) {
|
|
379
|
+
v = v[0];
|
|
380
|
+
}
|
|
381
|
+
if (v.includes("@R@") > 0) {
|
|
382
|
+
v = v.split("@R@")[1];
|
|
383
|
+
}
|
|
384
|
+
let HCService;
|
|
385
|
+
return (
|
|
386
|
+
<NewinFileView
|
|
387
|
+
title={openFileButton.title}
|
|
388
|
+
filePath={HCService.toFilePath(v, serverKey)}
|
|
389
|
+
serverKey={serverKey}
|
|
390
|
+
key={openFileButton.id}
|
|
391
|
+
//size={"small"}
|
|
392
|
+
/>
|
|
393
|
+
);
|
|
394
|
+
} else {
|
|
395
|
+
return "";
|
|
396
|
+
}
|
|
397
|
+
})
|
|
398
|
+
: ""}
|
|
399
|
+
{buttons.includes("singleDelete") &&
|
|
400
|
+
!readOnly &&
|
|
401
|
+
ActionUtils.isShow(
|
|
402
|
+
ltmplConfig.buttonDeleteAction?.preposes,
|
|
403
|
+
[record],
|
|
404
|
+
undefined
|
|
405
|
+
) ? (
|
|
406
|
+
<Popconfirm
|
|
407
|
+
placement="rightBottom"
|
|
408
|
+
title={translate("${确定要[删除]此数据吗}?")}
|
|
409
|
+
onConfirm={() => {
|
|
410
|
+
doDeleteByCode(record.code);
|
|
411
|
+
}}
|
|
412
|
+
okText={translate("${确定}")}
|
|
413
|
+
cancelText={translate("${取消}")}
|
|
414
|
+
okType={"danger"}
|
|
415
|
+
>
|
|
416
|
+
<Button size="small" type="dashed" danger>
|
|
417
|
+
<DeleteOutlined/>
|
|
418
|
+
</Button>
|
|
419
|
+
</Popconfirm>
|
|
420
|
+
) : (
|
|
421
|
+
""
|
|
422
|
+
)}
|
|
423
|
+
</Space>
|
|
424
|
+
);
|
|
425
|
+
} else {
|
|
426
|
+
currentDataColIndex++;
|
|
427
|
+
column["className"] = "opsColumn";
|
|
428
|
+
column["title"] = translate("${" + item.title + "}");
|
|
429
|
+
column["width"] = item.colWidth ? item.colWidth : 160;
|
|
430
|
+
column["ellipsis"] = {showTitle: true};
|
|
431
|
+
column["align"] = item.valueAlign ? item.valueAlign : "left";
|
|
432
|
+
if (
|
|
433
|
+
ltmplConfig.leftFixedCols &&
|
|
434
|
+
ltmplConfig.leftFixedCols >= currentDataColIndex
|
|
435
|
+
) {
|
|
436
|
+
column["fixed"] = "left";
|
|
437
|
+
} else {
|
|
438
|
+
column["fixed"] = item.colFixed
|
|
439
|
+
? item.colFixed == "right"
|
|
440
|
+
? "right"
|
|
441
|
+
: "left"
|
|
442
|
+
: false;
|
|
443
|
+
}
|
|
444
|
+
column["render"] = (text, record) => {
|
|
445
|
+
return (
|
|
446
|
+
<div className={record['dataType']?record['dataType']=="小计"?"xiaoji":'zongji':""}>
|
|
447
|
+
<ViewControl
|
|
448
|
+
serverKey={serverKey}
|
|
449
|
+
fieldConfig={item}
|
|
450
|
+
value={record[item.id]}
|
|
451
|
+
holderType={"table"}
|
|
452
|
+
/></div>
|
|
453
|
+
);
|
|
454
|
+
};
|
|
455
|
+
}
|
|
456
|
+
});
|
|
457
|
+
|
|
458
|
+
console.log("columns", tableColumns);
|
|
459
|
+
|
|
460
|
+
return tableColumns;
|
|
461
|
+
},
|
|
462
|
+
|
|
463
|
+
buildReportTableColumns(props: ReportColumnBuilderProps) {
|
|
464
|
+
const {
|
|
465
|
+
columnConfigs,translate, leftFixedCols
|
|
466
|
+
} = props;
|
|
467
|
+
|
|
468
|
+
let tableColumns = [];
|
|
469
|
+
let s = 0;
|
|
470
|
+
let colConfigs = columnConfigs;
|
|
471
|
+
|
|
472
|
+
let currentDataColIndex = 0;
|
|
473
|
+
|
|
474
|
+
colConfigs.forEach((item) => {
|
|
475
|
+
let column = {};
|
|
476
|
+
if(item.upperColumnTitle){
|
|
477
|
+
let parent;
|
|
478
|
+
tableColumns.forEach(t=>{
|
|
479
|
+
if(t.title==item.upperColumnTitle && t.children){
|
|
480
|
+
parent=t;
|
|
481
|
+
return
|
|
482
|
+
}
|
|
483
|
+
})
|
|
484
|
+
if(parent){
|
|
485
|
+
parent.children.push(column);
|
|
486
|
+
}else{
|
|
487
|
+
tableColumns.push({title:item.upperColumnTitle,children:[column]})
|
|
488
|
+
}
|
|
489
|
+
}else{
|
|
490
|
+
tableColumns.push(column);
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
column["title"] = item.title;
|
|
494
|
+
column["dataIndex"] = item.id;
|
|
495
|
+
if (item["colWidth"]) column["width"] = item["colWidth"];
|
|
496
|
+
if (item["order"]) column["order"] = Number(item["order"]);
|
|
497
|
+
// column['ellipsis']= true;
|
|
498
|
+
s++;
|
|
499
|
+
//特殊列处理
|
|
500
|
+
//序号
|
|
501
|
+
if (item.title === "序号") {
|
|
502
|
+
column["width"] = item.colWidth ? item.colWidth : 50;
|
|
503
|
+
column["title"] = translate("${序号}");
|
|
504
|
+
column["align"] = item.valueAlign ? item.valueAlign : "center";
|
|
505
|
+
column["render"] = (text, record, index) => <label>{index + 1}</label>;
|
|
506
|
+
item["sorter"] = undefined;
|
|
507
|
+
} else {
|
|
508
|
+
currentDataColIndex++;
|
|
509
|
+
column["className"] = "opsColumn";
|
|
510
|
+
column["title"] = translate("${" + item.title + "}");
|
|
511
|
+
column["width"] = item.colWidth ? item.colWidth : 160;
|
|
512
|
+
column["ellipsis"] = {showTitle: true};
|
|
513
|
+
column["align"] = item.valueAlign ? item.valueAlign : "left";
|
|
514
|
+
if (
|
|
515
|
+
leftFixedCols &&
|
|
516
|
+
leftFixedCols >= currentDataColIndex
|
|
517
|
+
) {
|
|
518
|
+
column["fixed"] = "left";
|
|
519
|
+
} else {
|
|
520
|
+
column["fixed"] = item.colFixed
|
|
521
|
+
? item.colFixed == "right"
|
|
522
|
+
? "right"
|
|
523
|
+
: "left"
|
|
524
|
+
: false;
|
|
525
|
+
}
|
|
526
|
+
column["render"] = (text, record) => {
|
|
527
|
+
return (
|
|
528
|
+
<div className={record['dataType']?record['dataType']=="小计"?"xiaoji":'zongji':""}>
|
|
529
|
+
<ViewControl
|
|
530
|
+
// serverKey={serverKey}
|
|
531
|
+
fieldConfig={item}
|
|
532
|
+
value={record[item.id]}
|
|
533
|
+
holderType={"table"}
|
|
534
|
+
/></div>
|
|
535
|
+
);
|
|
536
|
+
};
|
|
537
|
+
}
|
|
538
|
+
});
|
|
539
|
+
|
|
540
|
+
console.log("columns", tableColumns);
|
|
541
|
+
|
|
542
|
+
return tableColumns;
|
|
543
|
+
},
|
|
544
|
+
|
|
545
|
+
handleColumnOrder (columnId, sortColumns) {
|
|
546
|
+
//const sortColumns = this.props.criteriaData["sortColIds"];
|
|
547
|
+
|
|
548
|
+
if (!Array.isArray(sortColumns)) return undefined;
|
|
549
|
+
|
|
550
|
+
for (const column of sortColumns) {
|
|
551
|
+
const [key, sort] = column.split("_");
|
|
552
|
+
|
|
553
|
+
if (key === columnId) {
|
|
554
|
+
if (sort === "asc") return "ascend";
|
|
555
|
+
if (sort === "desc") return "descend";
|
|
556
|
+
continue;
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
return undefined;
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
}
|
|
564
|
+
const DragHandle = SortableHandle(() => (
|
|
565
|
+
<MenuOutlined style={{cursor: "grab", color: "#999"}}/>
|
|
566
|
+
))
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {generate} from "@ant-design/colors";
|
|
3
|
+
import ReactDOMServer from "react-dom/server";
|
|
4
|
+
import {theme} from "antd";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
const { useToken } = theme;
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
ThemeColorGetter(props){
|
|
11
|
+
const {
|
|
12
|
+
token,
|
|
13
|
+
} = useToken();
|
|
14
|
+
const colors = generate(token.colorPrimary);
|
|
15
|
+
console.log("colorPrimary"+token.colorPrimary);
|
|
16
|
+
return colors[props.index]
|
|
17
|
+
},
|
|
18
|
+
getColor(index:number){
|
|
19
|
+
const c = ReactDOMServer.renderToString(<this.ThemeColorGetter index={index}/>);
|
|
20
|
+
console.log(c);
|
|
21
|
+
return c;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
|