aldehyde 0.1.62 → 0.1.64
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 +0 -3
- package/lib/controls/entity-select/entity-select.js.map +1 -1
- package/lib/controls/entry-control.d.ts.map +1 -1
- package/lib/controls/entry-control.js +0 -3
- package/lib/controls/entry-control.js.map +1 -1
- package/lib/controls/relation-existion/index.d.ts.map +1 -1
- package/lib/controls/relation-existion/index.js.map +1 -1
- package/lib/detail/view/act-dtmpl-view.d.ts.map +1 -1
- package/lib/detail/view/act-dtmpl-view.js +0 -12
- package/lib/detail/view/act-dtmpl-view.js.map +1 -1
- package/lib/form/criteria-form.d.ts.map +1 -1
- package/lib/form/criteria-form.js +2 -20
- package/lib/form/criteria-form.js.map +1 -1
- package/lib/form/dtmpl-form.d.ts.map +1 -1
- package/lib/form/dtmpl-form.js +0 -6
- package/lib/form/dtmpl-form.js.map +1 -1
- package/lib/module/ltmpl-page.d.ts +6 -5
- package/lib/module/ltmpl-page.d.ts.map +1 -1
- package/lib/module/ltmpl-page.js +28 -32
- package/lib/module/ltmpl-page.js.map +1 -1
- package/lib/table/act-table.d.ts +8 -2
- package/lib/table/act-table.d.ts.map +1 -1
- package/lib/table/act-table.js +73 -30
- package/lib/table/act-table.js.map +1 -1
- package/lib/table/modal-select-table.js +1 -1
- package/lib/table/modal-select-table.js.map +1 -1
- package/lib/table/query-table.d.ts.map +1 -1
- package/lib/table/query-table.js +5 -4
- package/lib/table/query-table.js.map +1 -1
- package/lib/table/relation-table.d.ts.map +1 -1
- package/lib/table/relation-table.js +5 -2
- package/lib/table/relation-table.js.map +1 -1
- package/lib/table/select-table.d.ts.map +1 -1
- package/lib/table/select-table.js +1 -4
- package/lib/table/select-table.js.map +1 -1
- package/lib/table/table-util.d.ts +1 -1
- package/lib/table/table-util.d.ts.map +1 -1
- package/lib/table/table-util.js +4 -8
- package/lib/table/table-util.js.map +1 -1
- package/lib/tmpl/hcservice-v3.d.ts.map +1 -1
- package/lib/tmpl/hcservice-v3.js +3 -15
- package/lib/tmpl/hcservice-v3.js.map +1 -1
- package/lib/tmpl/interface.d.ts +1 -2
- package/lib/tmpl/interface.d.ts.map +1 -1
- package/lib/tmpl/interface.js.map +1 -1
- package/lib/welcome/HCWelcome.d.ts.map +1 -1
- package/lib/welcome/HCWelcome.js.map +1 -1
- package/package.json +1 -1
- package/src/aldehyde/controls/entity-select/entity-select.tsx +1 -3
- package/src/aldehyde/controls/entry-control.tsx +0 -3
- package/src/aldehyde/controls/relation-existion/index.tsx +1 -7
- package/src/aldehyde/detail/view/act-dtmpl-view.tsx +0 -15
- package/src/aldehyde/form/criteria-form.tsx +25 -39
- package/src/aldehyde/form/dtmpl-form.tsx +0 -7
- package/src/aldehyde/module/ltmpl-page.tsx +32 -42
- package/src/aldehyde/table/act-table.tsx +170 -114
- package/src/aldehyde/table/modal-select-table.tsx +1 -1
- package/src/aldehyde/table/query-table.tsx +5 -6
- package/src/aldehyde/table/relation-table.tsx +4 -2
- package/src/aldehyde/table/select-table.tsx +1 -4
- package/src/aldehyde/table/table-util.tsx +6 -13
- package/src/aldehyde/tmpl/hcservice-v3.tsx +0 -14
- package/src/aldehyde/tmpl/interface.tsx +1 -3
- package/src/aldehyde/welcome/HCWelcome.js +10 -1
|
@@ -1,35 +1,36 @@
|
|
|
1
|
-
import React from 'react'
|
|
1
|
+
import React, {ReactNode} from 'react'
|
|
2
2
|
import {Button, Card, Checkbox, Col, Collapse, Divider, Popconfirm, Popover, Row, Space, Table, Tooltip} from 'antd';
|
|
3
3
|
import {
|
|
4
|
+
AlignCenterOutlined,
|
|
4
5
|
AlignLeftOutlined,
|
|
5
|
-
|
|
6
|
+
CopyOutlined,
|
|
6
7
|
DownloadOutlined,
|
|
7
8
|
EditOutlined,
|
|
8
9
|
EyeInvisibleOutlined,
|
|
9
10
|
EyeOutlined,
|
|
11
|
+
FormOutlined,
|
|
10
12
|
FundOutlined,
|
|
11
13
|
LineChartOutlined,
|
|
12
14
|
MenuOutlined,
|
|
15
|
+
PlusCircleOutlined,
|
|
13
16
|
PlusOutlined,
|
|
14
17
|
ReloadOutlined,
|
|
15
18
|
RetweetOutlined,
|
|
16
19
|
TableOutlined,
|
|
17
20
|
UploadOutlined,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
FormOutlined,
|
|
21
|
-
AlignCenterOutlined
|
|
21
|
+
DeleteOutlined,
|
|
22
|
+
SearchOutlined
|
|
22
23
|
} from '@ant-design/icons';
|
|
23
24
|
import "./index.css"
|
|
24
25
|
import {
|
|
25
26
|
ActTableViewModel,
|
|
27
|
+
AddOrUpdate,
|
|
26
28
|
ColumnConfig,
|
|
27
|
-
|
|
29
|
+
DtmplData,
|
|
28
30
|
LtmplConfig,
|
|
29
31
|
QueryKey,
|
|
30
32
|
SelectedRow,
|
|
31
33
|
TmplBaseProps,
|
|
32
|
-
AddOrUpdate
|
|
33
34
|
} from "../tmpl/interface";
|
|
34
35
|
import TableUnits from "./table-util";
|
|
35
36
|
import SupportInputTypes from '../tmpl/control-type-supportor';
|
|
@@ -47,25 +48,28 @@ import Action from '../controls/action'
|
|
|
47
48
|
import Restat from "./stat/restat"
|
|
48
49
|
import ActionUtils from '../controls/action/utils'
|
|
49
50
|
import CquickButton from "../controls/cquery/cquick-button";
|
|
51
|
+
|
|
50
52
|
const DragHandle = SortableHandle(() => <MenuOutlined style={{cursor: 'grab', color: '#999'}}/>);
|
|
51
53
|
const {Panel} = Collapse;
|
|
52
54
|
|
|
53
55
|
type Level = 'l1' | 'l2';
|
|
54
|
-
export type Mode='simple' | 'common' | 'complete'
|
|
56
|
+
export type Mode = 'simple' | 'common' | 'complete'
|
|
55
57
|
|
|
56
|
-
const
|
|
58
|
+
const defaultDisabledColIds: string[] = ['20000', '10000']
|
|
57
59
|
|
|
58
60
|
interface ActTableProps extends TmplBaseProps {
|
|
59
61
|
criteriaData: object,
|
|
60
62
|
ltmplConfig: LtmplConfig,
|
|
61
|
-
menuId?:string,
|
|
62
|
-
showView?: (code: string,toCustomPage?:boolean) => void,
|
|
63
|
-
doCreate?: (toCustomPage?:boolean) => void,
|
|
64
|
-
doEdit?: (code: string,mode:AddOrUpdate,toCustomPage?:boolean) => void,
|
|
63
|
+
menuId?: string,
|
|
64
|
+
showView?: (code: string, toCustomPage?: boolean) => void,
|
|
65
|
+
doCreate?: (toCustomPage?: boolean) => void,
|
|
66
|
+
doEdit?: (code: string, mode: AddOrUpdate, toCustomPage?: boolean) => void,
|
|
67
|
+
doDelete?: (code: string) => void,
|
|
65
68
|
doSearch?: (params: object) => void,
|
|
66
|
-
doRAction?:(ractionId:string,mainCode:string)=>void,
|
|
69
|
+
doRAction?: (ractionId: string, mainCode: string) => void,
|
|
67
70
|
level?: Level,
|
|
68
|
-
funcMode?:Mode
|
|
71
|
+
funcMode?: Mode,
|
|
72
|
+
title?: ReactNode,
|
|
69
73
|
};
|
|
70
74
|
|
|
71
75
|
interface ActTableStat {
|
|
@@ -75,7 +79,7 @@ interface ActTableStat {
|
|
|
75
79
|
loading: boolean;
|
|
76
80
|
criteriaData: object;
|
|
77
81
|
selectedRows: SelectedRow[];
|
|
78
|
-
selectedDatas:DtmplData[];
|
|
82
|
+
selectedDatas: DtmplData[];
|
|
79
83
|
hiddenColIds?: string[];
|
|
80
84
|
drillingColIds?: string[];
|
|
81
85
|
disabledColIds: string[];
|
|
@@ -86,9 +90,6 @@ interface ActTableStat {
|
|
|
86
90
|
// drillingPopoverVisible:boolean;
|
|
87
91
|
};
|
|
88
92
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
93
|
class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
93
94
|
state = {
|
|
94
95
|
tableColumns: undefined,
|
|
@@ -97,9 +98,9 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
97
98
|
loading: true,
|
|
98
99
|
criteriaData: undefined,
|
|
99
100
|
disableCols: undefined,
|
|
100
|
-
hiddenColIds:
|
|
101
|
+
hiddenColIds: defaultDisabledColIds,
|
|
101
102
|
selectedRows: [],
|
|
102
|
-
selectedDatas:[],
|
|
103
|
+
selectedDatas: [],
|
|
103
104
|
hiddenRowCodes: [],
|
|
104
105
|
viewModels: [],
|
|
105
106
|
drillingColIds: undefined,
|
|
@@ -109,9 +110,9 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
109
110
|
//drillingPopoverVisible:false,
|
|
110
111
|
}
|
|
111
112
|
|
|
112
|
-
static defaultProps={
|
|
113
|
-
criteriaData:{},
|
|
114
|
-
funcMode:'complete'
|
|
113
|
+
static defaultProps = {
|
|
114
|
+
criteriaData: {},
|
|
115
|
+
funcMode: 'complete'
|
|
115
116
|
}
|
|
116
117
|
|
|
117
118
|
loadData = async (hiddenColIds: string[], hiddenRowCodes: string[], sortedColConfigs: ColumnConfig[]) => {
|
|
@@ -156,12 +157,12 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
156
157
|
//构建过滤条件
|
|
157
158
|
let queryKey: QueryKey
|
|
158
159
|
if (level && level == 'l2') {
|
|
159
|
-
queryKey = await HcserviceV3.requestL2LtmplQueryKey(
|
|
160
|
+
queryKey = await HcserviceV3.requestL2LtmplQueryKey(sourceId, {
|
|
160
161
|
...criteriaData, ...pageInfo,
|
|
161
162
|
mainCode
|
|
162
163
|
});
|
|
163
164
|
} else {
|
|
164
|
-
queryKey = await HcserviceV3.requestLtmplQueryKey(
|
|
165
|
+
queryKey = await HcserviceV3.requestLtmplQueryKey(sourceId, {
|
|
165
166
|
...criteriaData, ...pageInfo,
|
|
166
167
|
mainCode
|
|
167
168
|
});
|
|
@@ -177,15 +178,15 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
177
178
|
queryKey,
|
|
178
179
|
criteriaData,
|
|
179
180
|
loading: false,
|
|
180
|
-
showL2Chart:false,
|
|
181
|
+
showL2Chart: false,
|
|
181
182
|
selectedRows: [],
|
|
182
|
-
selectedDatas:[],
|
|
183
|
+
selectedDatas: [],
|
|
183
184
|
viewModels: (this.state.viewModels.length > 0 ? this.state.viewModels : ['table']),
|
|
184
185
|
})
|
|
185
186
|
}
|
|
186
187
|
|
|
187
188
|
buildTableColumns = (ltmplConfig: LtmplConfig, hiddenColIds: string[], hiddenRowCodes: string[], sortedColConfigs: ColumnConfig[]) => {
|
|
188
|
-
const {mainCode, showView, doEdit,menuId,doRAction} = this.props
|
|
189
|
+
const {mainCode, showView, doEdit, menuId, doRAction, doDelete} = this.props
|
|
189
190
|
const {buttons} = ltmplConfig;
|
|
190
191
|
let tableColumns = [];
|
|
191
192
|
let s = 0;
|
|
@@ -207,7 +208,6 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
207
208
|
TableUnits.sort(column, itemType);
|
|
208
209
|
}
|
|
209
210
|
}
|
|
210
|
-
//TableUnits.render(column, item);
|
|
211
211
|
//特殊列处理
|
|
212
212
|
//序号
|
|
213
213
|
if (item.title === "序号") {
|
|
@@ -239,64 +239,65 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
239
239
|
</Button></Tooltip>);
|
|
240
240
|
} else if (item.title === "操作") {
|
|
241
241
|
column['fixed'] = 'right';
|
|
242
|
-
column['align']='center';
|
|
243
|
-
column['className']='opsColumn';
|
|
242
|
+
column['align'] = 'center';
|
|
243
|
+
column['className'] = 'opsColumn';
|
|
244
244
|
column['title'] = <>操 作</>
|
|
245
245
|
column['render'] = (text, record) => (
|
|
246
|
-
<Space
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
246
|
+
<Space size={[0, 4]} wrap>
|
|
247
|
+
{buttons.includes('detail') && showView ?
|
|
248
|
+
<Button
|
|
249
|
+
size="small"
|
|
250
|
+
type="primary"
|
|
251
|
+
icon={<AlignLeftOutlined/>}
|
|
252
|
+
onClick={() => showView(record.code)}>
|
|
253
|
+
</Button>
|
|
254
|
+
: ""}
|
|
255
255
|
{buttons.includes('customDetail') && showView ?
|
|
256
256
|
<Button
|
|
257
257
|
size="small"
|
|
258
258
|
type="primary"
|
|
259
|
-
icon={<AlignCenterOutlined
|
|
260
|
-
onClick={() => showView(record.code,true)}>
|
|
259
|
+
icon={<AlignCenterOutlined/>}
|
|
260
|
+
onClick={() => showView(record.code, true)}>
|
|
261
261
|
</Button>
|
|
262
262
|
: ""}
|
|
263
263
|
{buttons.includes('dtmplEdit') && doEdit
|
|
264
|
-
&& (!ltmplConfig.editAction || ActionUtils.isShow(ltmplConfig.editAction,[record],undefined))?
|
|
264
|
+
&& (!ltmplConfig.editAction || ActionUtils.isShow(ltmplConfig.editAction, [record], undefined)) ?
|
|
265
265
|
< Button
|
|
266
266
|
size="small"
|
|
267
267
|
type="dashed"
|
|
268
268
|
icon={<EditOutlined/>}
|
|
269
|
-
onClick={() => doEdit(record.code,'update')}>
|
|
270
|
-
</Button
|
|
269
|
+
onClick={() => doEdit(record.code, 'update')}>
|
|
270
|
+
</Button> : ""}
|
|
271
271
|
{buttons.includes('dtmplCustomEdit') && doEdit
|
|
272
|
-
&& (!ltmplConfig.editAction || ActionUtils.isShow(ltmplConfig.editAction,[record],undefined))?
|
|
272
|
+
&& (!ltmplConfig.editAction || ActionUtils.isShow(ltmplConfig.editAction, [record], undefined)) ?
|
|
273
273
|
< Button
|
|
274
274
|
size="small"
|
|
275
275
|
type="dashed"
|
|
276
|
-
icon={<FormOutlined
|
|
277
|
-
onClick={() => doEdit(record.code,'update',true)}>
|
|
278
|
-
</Button
|
|
276
|
+
icon={<FormOutlined/>}
|
|
277
|
+
onClick={() => doEdit(record.code, 'update', true)}>
|
|
278
|
+
</Button> : ""}
|
|
279
279
|
{buttons.includes('copy') && doEdit
|
|
280
280
|
?
|
|
281
281
|
<Tooltip title={'复制'}>< Button
|
|
282
282
|
size="small"
|
|
283
283
|
type="dashed"
|
|
284
|
-
icon={<CopyOutlined
|
|
285
|
-
onClick={() => doEdit(record.code,'copy')}>
|
|
284
|
+
icon={<CopyOutlined/>}
|
|
285
|
+
onClick={() => doEdit(record.code, 'copy')}>
|
|
286
286
|
</Button></Tooltip> : ""}
|
|
287
287
|
{ltmplConfig.ractions ? ltmplConfig.ractions.map((raction) => {
|
|
288
288
|
return <Button
|
|
289
289
|
key={raction.id}
|
|
290
290
|
size="small"
|
|
291
291
|
type="dashed"
|
|
292
|
-
onClick={() => doRAction(raction.id,record.code)}
|
|
293
|
-
|
|
292
|
+
onClick={() => doRAction(raction.id, record.code)}
|
|
293
|
+
>
|
|
294
294
|
{raction.title}
|
|
295
295
|
</Button>
|
|
296
296
|
}) : ""}
|
|
297
297
|
{ltmplConfig.rowActions && ltmplConfig.rowActions.length > 0 ?
|
|
298
298
|
ltmplConfig.rowActions.map((action) => {
|
|
299
|
-
return <Action iconType={'icon'} key={action.id} data={[record]} actionConfig={action}
|
|
299
|
+
return <Action iconType={'icon'} key={action.id} data={[record]} actionConfig={action}
|
|
300
|
+
doAction={this.doRowAction} buttonSize={'small'} serial={1}></Action>
|
|
300
301
|
}) : ""}
|
|
301
302
|
{ltmplConfig.jumps && ltmplConfig.jumps.length > 0 ?
|
|
302
303
|
ltmplConfig.jumps.map((jump) => {
|
|
@@ -306,23 +307,36 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
306
307
|
}) : ""}
|
|
307
308
|
{ltmplConfig.rowCQuerys && ltmplConfig.rowCQuerys.length > 0 ?
|
|
308
309
|
ltmplConfig.rowCQuerys.map((cquery) => {
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
// >{cQuery.title}</Button>;
|
|
312
|
-
console.log("record record",record);
|
|
313
|
-
return <CquickButton key={cquery.id} size={"small"} pageType={'drawer'}
|
|
310
|
+
console.log("record record", record);
|
|
311
|
+
return <CquickButton key={cquery.id} size={"small"} pageType={'drawer'}
|
|
314
312
|
// onClick={() => doCQuery(cquery.id)}
|
|
315
|
-
cQueryConfig={cquery}
|
|
313
|
+
cQueryConfig={cquery}
|
|
314
|
+
mainCode={cquery.mainCodeColId ? record[cquery.mainCodeColId] : record.code}/>
|
|
316
315
|
}) : ""}
|
|
317
|
-
|
|
316
|
+
{buttons.includes('singleDelete') ?
|
|
317
|
+
<Popconfirm
|
|
318
|
+
placement="rightBottom"
|
|
319
|
+
title={'确定要【删除】此数据吗?'}
|
|
320
|
+
onConfirm={() => {
|
|
321
|
+
this.doDeleteByCode(record.code)
|
|
322
|
+
}}
|
|
323
|
+
okText="确定"
|
|
324
|
+
cancelText="取消"
|
|
325
|
+
okType={"danger"}
|
|
326
|
+
>
|
|
327
|
+
<Button size="small" type="dashed" danger><DeleteOutlined /></Button>
|
|
328
|
+
</Popconfirm>
|
|
329
|
+
: ""}
|
|
330
|
+
</Space>);
|
|
318
331
|
} else {
|
|
319
|
-
column['className']='opsColumn';
|
|
332
|
+
column['className'] = 'opsColumn';
|
|
320
333
|
column['render'] = (text, record) => {
|
|
321
|
-
return <ViewControl
|
|
334
|
+
return <ViewControl fieldConfig={item} value={record[item.id]} holderType={'table'}/>
|
|
322
335
|
|
|
323
336
|
}
|
|
324
337
|
}
|
|
325
338
|
});
|
|
339
|
+
debugger
|
|
326
340
|
return tableColumns
|
|
327
341
|
}
|
|
328
342
|
|
|
@@ -333,18 +347,18 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
333
347
|
if (ltmplConfig) {
|
|
334
348
|
sortedColConfigs = [{id: '10000', title: '排序'}, ...ltmplConfig.columns, {id: '20000', title: '隐藏'}]
|
|
335
349
|
}
|
|
336
|
-
this.loadData(
|
|
350
|
+
this.loadData(defaultDisabledColIds, [], sortedColConfigs);
|
|
337
351
|
}
|
|
338
352
|
|
|
339
353
|
async componentDidUpdate(prevProps) {
|
|
340
|
-
const {
|
|
354
|
+
const {sourceId, criteriaData, ltmplConfig} = this.props;
|
|
341
355
|
let {ltmplConfig: preLtmplConfig, criteriaData: preCriteriaData} = prevProps;
|
|
342
356
|
|
|
343
357
|
let {hiddenColIds, sortedColConfigs} = this.state;
|
|
344
358
|
|
|
345
|
-
console.log("UnitscriteriaData)",Units.transQueryParamsToStr(criteriaData));
|
|
346
|
-
console.log("preCriteriaData)",Units.transQueryParamsToStr(preCriteriaData));
|
|
347
|
-
console.log("preCriteriaData) bool",Units.transQueryParamsToStr(preCriteriaData)==Units.transQueryParamsToStr(criteriaData));
|
|
359
|
+
console.log("UnitscriteriaData)", Units.transQueryParamsToStr(criteriaData));
|
|
360
|
+
console.log("preCriteriaData)", Units.transQueryParamsToStr(preCriteriaData));
|
|
361
|
+
console.log("preCriteriaData) bool", Units.transQueryParamsToStr(preCriteriaData) == Units.transQueryParamsToStr(criteriaData));
|
|
348
362
|
if (ltmplConfig && (!preLtmplConfig || ltmplConfig.id != preLtmplConfig.id) || (Units.transQueryParamsToStr(criteriaData) != Units.transQueryParamsToStr(preCriteriaData))) {
|
|
349
363
|
|
|
350
364
|
if (ltmplConfig.id == preLtmplConfig.id) {
|
|
@@ -357,7 +371,7 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
357
371
|
this.setState({
|
|
358
372
|
viewModels: ['table'],
|
|
359
373
|
})
|
|
360
|
-
this.loadData(
|
|
374
|
+
this.loadData(defaultDisabledColIds, [], sColConfigs);
|
|
361
375
|
}
|
|
362
376
|
}
|
|
363
377
|
}
|
|
@@ -405,24 +419,24 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
405
419
|
const {ltmplConfig} = this.props
|
|
406
420
|
const {hiddenRowCodes, sortedColConfigs} = this.state;
|
|
407
421
|
this.setState({
|
|
408
|
-
showL2Chart:false,
|
|
422
|
+
showL2Chart: false,
|
|
409
423
|
hiddenColIds,
|
|
410
424
|
tableColumns: this.buildTableColumns(ltmplConfig, hiddenColIds, hiddenRowCodes, sortedColConfigs),
|
|
411
425
|
})
|
|
412
426
|
}
|
|
413
427
|
|
|
414
|
-
doSelectedAction = async (actionId: string,codes,params:object) => {
|
|
428
|
+
doSelectedAction = async (actionId: string, codes, params: object) => {
|
|
415
429
|
const {selectedRows} = this.state;
|
|
416
|
-
this.doAction(actionId, selectedRows,params);
|
|
430
|
+
this.doAction(actionId, selectedRows, params);
|
|
417
431
|
}
|
|
418
432
|
|
|
419
|
-
doAction = async (actionId: string, selectedRows: SelectedRow[],params) => {
|
|
420
|
-
const {
|
|
433
|
+
doAction = async (actionId: string, selectedRows: SelectedRow[], params) => {
|
|
434
|
+
const {sourceId} = this.props;
|
|
421
435
|
const {hiddenColIds, hiddenRowCodes, sortedColConfigs} = this.state;
|
|
422
436
|
this.setState({
|
|
423
437
|
loading: true,
|
|
424
438
|
})
|
|
425
|
-
let result: boolean = await HcserviceV3.postActions(
|
|
439
|
+
let result: boolean = await HcserviceV3.postActions(actionId, selectedRows, params);
|
|
426
440
|
if (result) {//重新加载数据
|
|
427
441
|
this.loadData(hiddenColIds, hiddenRowCodes, sortedColConfigs);
|
|
428
442
|
} else {
|
|
@@ -432,12 +446,12 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
432
446
|
}
|
|
433
447
|
}
|
|
434
448
|
|
|
435
|
-
doRowAction = async (actionId: string, codes: string[],params:object) => {
|
|
436
|
-
this.doAction(actionId, [{title: undefined, code:codes[0]}],params);
|
|
449
|
+
doRowAction = async (actionId: string, codes: string[], params: object) => {
|
|
450
|
+
this.doAction(actionId, [{title: undefined, code: codes[0]}], params);
|
|
437
451
|
}
|
|
438
452
|
|
|
439
453
|
doDelete = async () => {
|
|
440
|
-
const {
|
|
454
|
+
const {sourceId} = this.props;
|
|
441
455
|
const {selectedRows, hiddenColIds, hiddenRowCodes, sortedColConfigs} = this.state;
|
|
442
456
|
this.setState({
|
|
443
457
|
loading: true,
|
|
@@ -452,17 +466,23 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
452
466
|
}
|
|
453
467
|
}
|
|
454
468
|
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
469
|
+
doDeleteByCode = async (code: string) => {
|
|
470
|
+
const {sourceId} = this.props;
|
|
471
|
+
const {hiddenColIds, hiddenRowCodes, sortedColConfigs} = this.state;
|
|
472
|
+
this.setState({
|
|
473
|
+
loading: true,
|
|
474
|
+
})
|
|
475
|
+
let result: boolean = await HcserviceV3.deleteByCode(sourceId, [code]);
|
|
476
|
+
if (result) {//重新加载数据
|
|
477
|
+
this.loadData(hiddenColIds, hiddenRowCodes, sortedColConfigs);
|
|
478
|
+
} else {
|
|
479
|
+
this.setState({
|
|
480
|
+
loading: false,
|
|
481
|
+
})
|
|
482
|
+
}
|
|
483
|
+
}
|
|
462
484
|
|
|
463
485
|
doSelectedCQuery = async (cqueryId: string) => {
|
|
464
|
-
// const {selectedRows} = this.state;
|
|
465
|
-
// this.doCQuery(cqueryId, selectedRows[0])
|
|
466
486
|
}
|
|
467
487
|
|
|
468
488
|
doJump = async (jumpId: string, code: string) => {
|
|
@@ -484,13 +504,13 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
484
504
|
|
|
485
505
|
doSelectedJump = async (jumpId: string) => {
|
|
486
506
|
const {selectedRows} = this.state;
|
|
487
|
-
if(selectedRows.length==1){
|
|
507
|
+
if (selectedRows.length == 1) {
|
|
488
508
|
this.doJump(jumpId, selectedRows[0].code)
|
|
489
509
|
}
|
|
490
510
|
|
|
491
511
|
}
|
|
492
512
|
|
|
493
|
-
changeRowSelection = (selectedRows: SelectedRow[],selectedDatas:DtmplData[]) => {
|
|
513
|
+
changeRowSelection = (selectedRows: SelectedRow[], selectedDatas: DtmplData[]) => {
|
|
494
514
|
this.setState({
|
|
495
515
|
selectedRows,
|
|
496
516
|
selectedDatas,
|
|
@@ -507,24 +527,29 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
507
527
|
}
|
|
508
528
|
|
|
509
529
|
|
|
510
|
-
|
|
511
530
|
renderHeaderButtons = () => {
|
|
512
531
|
let {hiddenColIds, queryKey, viewModels, sortedColConfigs, disabledColIds, showL2Chart, showL2ActTable} = this.state;
|
|
513
|
-
const {ltmplConfig,
|
|
532
|
+
const {ltmplConfig, sourceId, doCreate, doSearch, menuId, funcMode} = this.props;
|
|
514
533
|
let {buttons} = ltmplConfig;
|
|
515
534
|
|
|
516
535
|
return <>
|
|
536
|
+
{funcMode == "common" && this.criteriaFormUseful() ?
|
|
537
|
+
<Popover trigger="click" content={this.renderCriteriaForm()} >
|
|
538
|
+
<Button ><SearchOutlined /></Button>
|
|
539
|
+
</Popover>
|
|
540
|
+
: null
|
|
541
|
+
}
|
|
517
542
|
{buttons.includes("dtmplAdd") && doCreate ?
|
|
518
543
|
<Tooltip title={'创建'}>
|
|
519
544
|
<Button
|
|
520
|
-
onClick={()=>doCreate()}>
|
|
545
|
+
onClick={() => doCreate()}>
|
|
521
546
|
<PlusOutlined/>
|
|
522
547
|
</Button> </Tooltip> : ''}
|
|
523
548
|
{buttons.includes("dtmplCustomAdd") && doCreate ?
|
|
524
549
|
<Tooltip title={'创建'}>
|
|
525
550
|
<Button
|
|
526
|
-
onClick={()=>doCreate(true)}>
|
|
527
|
-
<PlusCircleOutlined
|
|
551
|
+
onClick={() => doCreate(true)}>
|
|
552
|
+
<PlusCircleOutlined/>
|
|
528
553
|
</Button> </Tooltip> : ''}
|
|
529
554
|
{buttons.includes("importLtmplExcel") ? <Tooltip title={'导入'}> <Button
|
|
530
555
|
href={`#/${sourceId}/importer?menuId=${menuId}`} target={'_blank'}>
|
|
@@ -557,7 +582,8 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
557
582
|
onClick={this.handleDataAnalysis}>
|
|
558
583
|
<FundOutlined/>
|
|
559
584
|
</Button></Tooltip> : ""}
|
|
560
|
-
{buttons.includes("reStat") ? <Restat fields={ltmplConfig.reStatParams} sourceId={sourceId}
|
|
585
|
+
{buttons.includes("reStat") ? <Restat fields={ltmplConfig.reStatParams} sourceId={sourceId}
|
|
586
|
+
onfinish={() => doSearch(null)}></Restat> : ""}
|
|
561
587
|
<Popover content={<Checkbox.Group value={viewModels} onChange={this.changeViewModel}>
|
|
562
588
|
<Row style={{width: '120px'}}>
|
|
563
589
|
<Col span={24}><Checkbox value={'table'}>表格</Checkbox></Col>
|
|
@@ -595,9 +621,43 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
595
621
|
</>
|
|
596
622
|
}
|
|
597
623
|
|
|
624
|
+
criteriaFormUseful = () => {
|
|
625
|
+
const {ltmplConfig} = this.props;
|
|
626
|
+
let {buttons, criterias, jumps, actions} = ltmplConfig;
|
|
627
|
+
if( (buttons.includes('query') && ((criterias && criterias.length > 0) || buttons.includes('drilling'))) ||
|
|
628
|
+
this.checkBoxUseful()){
|
|
629
|
+
return true;
|
|
630
|
+
}else{
|
|
631
|
+
return false;
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
checkBoxUseful=()=>{
|
|
636
|
+
const {ltmplConfig} = this.props;
|
|
637
|
+
let {buttons, jumps, actions} = ltmplConfig;
|
|
638
|
+
if(buttons.includes('batchDelete') ||
|
|
639
|
+
(actions && actions.length > 0) || (jumps && jumps.length > 0)){
|
|
640
|
+
return true;
|
|
641
|
+
}else{
|
|
642
|
+
return false;
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
renderCriteriaForm=()=>{
|
|
647
|
+
let { criteriaData, loading, selectedRows, selectedDatas} = this.state;
|
|
648
|
+
let {ltmplConfig, doSearch} = this.props;
|
|
649
|
+
return <CriteriaForm loading={loading} selectedDatas={selectedDatas} selectedRows={selectedRows}
|
|
650
|
+
ltmplConfig={ltmplConfig} data={criteriaData}
|
|
651
|
+
doCQuery={this.doSelectedCQuery}
|
|
652
|
+
doAction={this.doSelectedAction}
|
|
653
|
+
doDelete={this.doDelete}
|
|
654
|
+
doJump={this.doSelectedJump}
|
|
655
|
+
doSearch={doSearch}/>
|
|
656
|
+
}
|
|
657
|
+
|
|
598
658
|
render() {
|
|
599
|
-
let {queryKey, tableColumns, criteriaData, loading, selectedRows,selectedDatas, hiddenRowCodes, viewModels, sortedColConfigs, hiddenColIds, showL2ActTable, showL2Chart} = this.state;
|
|
600
|
-
let {
|
|
659
|
+
let {queryKey, tableColumns, criteriaData, loading, selectedRows, selectedDatas, hiddenRowCodes, viewModels, sortedColConfigs, hiddenColIds, showL2ActTable, showL2Chart} = this.state;
|
|
660
|
+
let {sourceId, ltmplConfig, doSearch, funcMode, title} = this.props;
|
|
601
661
|
|
|
602
662
|
if (!ltmplConfig || !sourceId) {
|
|
603
663
|
return <>
|
|
@@ -609,10 +669,9 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
609
669
|
}
|
|
610
670
|
let {buttons, criterias, jumps, actions} = ltmplConfig
|
|
611
671
|
let displayCriteriaCard: boolean = false;
|
|
612
|
-
if(funcMode=='simple'){
|
|
613
|
-
displayCriteriaCard=false;
|
|
614
|
-
}else if (
|
|
615
|
-
(actions && actions.length > 0) || (jumps && jumps.length > 0) ) {
|
|
672
|
+
if (funcMode == 'simple' || funcMode == 'common') {
|
|
673
|
+
displayCriteriaCard = false;
|
|
674
|
+
} else if (this.criteriaFormUseful()) {
|
|
616
675
|
displayCriteriaCard = true;
|
|
617
676
|
}
|
|
618
677
|
|
|
@@ -633,29 +692,26 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
633
692
|
</div> : ""
|
|
634
693
|
}
|
|
635
694
|
{buttons.includes("analysis") && showL2ActTable ? <div>
|
|
636
|
-
<L2ActTable innerQueryKey={queryKey.key}
|
|
695
|
+
<L2ActTable innerQueryKey={queryKey.key} sourceId={sourceId}/>
|
|
637
696
|
<Divider dashed style={{borderTopColor: "#40a9ff",}} plain></Divider>
|
|
638
697
|
</div> : ""
|
|
639
698
|
}
|
|
640
699
|
<div className="actTable">
|
|
641
|
-
{funcMode=='complete'?
|
|
700
|
+
{funcMode == 'complete' || funcMode == 'common' ?
|
|
642
701
|
<h3>
|
|
643
|
-
{ltmplConfig.title}
|
|
702
|
+
{title ? title : ltmplConfig.title}
|
|
644
703
|
<p className="fr">
|
|
645
704
|
{this.renderHeaderButtons()}
|
|
646
705
|
</p>
|
|
647
|
-
</h3
|
|
706
|
+
</h3> : null
|
|
707
|
+
}
|
|
708
|
+
{displayCriteriaCard ?
|
|
709
|
+
this.renderCriteriaForm() : null
|
|
648
710
|
}
|
|
649
|
-
<CriteriaForm loading={loading} visible={displayCriteriaCard} selectedDatas={selectedDatas} selectedRows={selectedRows}
|
|
650
|
-
ltmplConfig={ltmplConfig} data={criteriaData}
|
|
651
|
-
doCQuery={this.doSelectedCQuery}
|
|
652
|
-
doAction={this.doSelectedAction}
|
|
653
|
-
doDelete={this.doDelete}
|
|
654
|
-
doJump={this.doSelectedJump}
|
|
655
|
-
doSearch={doSearch} />
|
|
656
711
|
{
|
|
657
712
|
loading ? "" :
|
|
658
713
|
<QueryTable viewModels={viewModels} columnConfigs={columnConfigs}
|
|
714
|
+
maxSelectedRows={this.checkBoxUseful()?10000:-1}
|
|
659
715
|
selectedRows={selectedRows}
|
|
660
716
|
columns={tableColumns}
|
|
661
717
|
hiddenRowCodes={hiddenRowCodes}
|
|
@@ -214,7 +214,7 @@ class ModelSelectTable extends React.PureComponent<ModelSelectTableProps, ModelS
|
|
|
214
214
|
}
|
|
215
215
|
let {buttons, criterias, jumps, actions} = selectConfig
|
|
216
216
|
let displayCriteriaCard: boolean = false;
|
|
217
|
-
if (buttons.includes('
|
|
217
|
+
if (buttons.includes('batchDelete') || (buttons.includes('query') && criterias && criterias.length > 0) ||
|
|
218
218
|
(actions && actions.length > 0) || (jumps && jumps.length > 0)) {
|
|
219
219
|
displayCriteriaCard = true;
|
|
220
220
|
}
|
|
@@ -109,9 +109,6 @@ class QueryTable extends React.PureComponent<QueryTableProps, QueryTableStat> {
|
|
|
109
109
|
DraggableBodyRow = ({className, style, ...restProps}) => {
|
|
110
110
|
const {dataSource} = this.state;
|
|
111
111
|
if (dataSource) {
|
|
112
|
-
//let ds= this.getUnHidenDataSource();
|
|
113
|
-
// function findIndex base on Table rowKey props and should always be a right array index
|
|
114
|
-
// @ts-ignore
|
|
115
112
|
const index = dataSource.findIndex(x => x.key === restProps['data-row-key']);
|
|
116
113
|
return <SortableItem key={index} index={index} {...restProps} />;
|
|
117
114
|
} else {
|
|
@@ -210,7 +207,9 @@ class QueryTable extends React.PureComponent<QueryTableProps, QueryTableStat> {
|
|
|
210
207
|
allRowKeys.push(d.code);
|
|
211
208
|
}
|
|
212
209
|
}
|
|
213
|
-
|
|
210
|
+
if(maxSelectedRows==-1){
|
|
211
|
+
return null;
|
|
212
|
+
}
|
|
214
213
|
const rowSelection: TableRowSelection<any> = {
|
|
215
214
|
fixed: true,
|
|
216
215
|
type: maxSelectedRows == 1 ? 'radio' : 'checkbox',
|
|
@@ -251,7 +250,7 @@ class QueryTable extends React.PureComponent<QueryTableProps, QueryTableStat> {
|
|
|
251
250
|
}
|
|
252
251
|
}
|
|
253
252
|
}
|
|
254
|
-
|
|
253
|
+
// debugger
|
|
255
254
|
return ds;
|
|
256
255
|
}
|
|
257
256
|
|
|
@@ -314,7 +313,7 @@ class QueryTable extends React.PureComponent<QueryTableProps, QueryTableStat> {
|
|
|
314
313
|
dataSource={this.getUnHidenDataSource()}
|
|
315
314
|
renderItem={item => (
|
|
316
315
|
<List.Item key={item['id']}>
|
|
317
|
-
<Card><Descriptions column={4}>
|
|
316
|
+
<Card bodyStyle={{padding:'4px'}}><Descriptions column={4}>
|
|
318
317
|
{this.initViewList(item)}
|
|
319
318
|
</Descriptions></Card>
|
|
320
319
|
</List.Item>
|
|
@@ -139,7 +139,9 @@ class RelationTable extends React.PureComponent<RelationTableProps, RelationTabl
|
|
|
139
139
|
column['dataIndex'] = item.id;
|
|
140
140
|
s++;
|
|
141
141
|
let itemType = SupportInputTypes.getControlType(item, null);
|
|
142
|
-
if (s
|
|
142
|
+
if (s==1) {
|
|
143
|
+
TableUnits.sort(column, itemType,'ascend');
|
|
144
|
+
}else if (s < 10) {
|
|
143
145
|
TableUnits.sort(column, itemType);
|
|
144
146
|
}
|
|
145
147
|
column['render'] = (text, record) => {
|
|
@@ -165,7 +167,7 @@ class RelationTable extends React.PureComponent<RelationTableProps, RelationTabl
|
|
|
165
167
|
const viewable = buttons.includes('detail');
|
|
166
168
|
const rowEdit = buttons.includes('rowEdit');
|
|
167
169
|
const dtmplEdit = buttons.includes('dtmplEdit');
|
|
168
|
-
const deletable =
|
|
170
|
+
const deletable = buttons.includes('singleDelete');
|
|
169
171
|
|
|
170
172
|
|
|
171
173
|
if (viewOrEdit == 'edit' && (viewable || rowEdit || dtmplEdit || deletable)) {
|
|
@@ -66,10 +66,7 @@ class SelectTable extends React.PureComponent<SelectTableProps, SelectTableStat>
|
|
|
66
66
|
|
|
67
67
|
async componentDidMount() {
|
|
68
68
|
const {sourceId} = this.props;
|
|
69
|
-
// if (sourceName && visible) {
|
|
70
|
-
// if (sourceName) {
|
|
71
69
|
await this.loadData(await this.loadConfig(), {});
|
|
72
|
-
// }
|
|
73
70
|
}
|
|
74
71
|
|
|
75
72
|
loadConfig = async () => {
|
|
@@ -220,7 +217,7 @@ class SelectTable extends React.PureComponent<SelectTableProps, SelectTableStat>
|
|
|
220
217
|
}
|
|
221
218
|
let {buttons, criterias, jumps, actions} = selectConfig
|
|
222
219
|
let displayCriteriaCard: boolean = false;
|
|
223
|
-
if (buttons.includes('
|
|
220
|
+
if (buttons.includes('batchDelete') || (buttons.includes('query') && criterias && criterias.length > 0) ||
|
|
224
221
|
(actions && actions.length > 0) || (jumps && jumps.length > 0)) {
|
|
225
222
|
displayCriteriaCard = true;
|
|
226
223
|
}
|