aldehyde 0.1.61 → 0.1.63
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/entry-control.d.ts.map +1 -1
- package/lib/controls/entry-control.js +1 -4
- 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 +7 -2
- package/lib/table/act-table.d.ts.map +1 -1
- package/lib/table/act-table.js +59 -28
- 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 +1 -4
- package/lib/table/query-table.js.map +1 -1
- package/lib/table/relation-table.js +1 -1
- 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/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/tmpl/superagent.d.ts.map +1 -1
- package/lib/tmpl/superagent.js +4 -2
- package/lib/tmpl/superagent.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/entry-control.tsx +1 -4
- 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 +157 -114
- package/src/aldehyde/table/modal-select-table.tsx +1 -1
- package/src/aldehyde/table/query-table.tsx +1 -4
- package/src/aldehyde/table/relation-table.tsx +1 -1
- package/src/aldehyde/table/select-table.tsx +1 -4
- package/src/aldehyde/tmpl/hcservice-v3.tsx +3 -19
- package/src/aldehyde/tmpl/interface.tsx +1 -3
- package/src/aldehyde/tmpl/superagent.js +4 -2
- package/src/aldehyde/welcome/HCWelcome.js +10 -1
|
@@ -1,35 +1,35 @@
|
|
|
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
|
-
PlusCircleOutlined,
|
|
20
|
-
FormOutlined,
|
|
21
|
-
AlignCenterOutlined
|
|
21
|
+
SearchOutlined
|
|
22
22
|
} from '@ant-design/icons';
|
|
23
23
|
import "./index.css"
|
|
24
24
|
import {
|
|
25
25
|
ActTableViewModel,
|
|
26
|
+
AddOrUpdate,
|
|
26
27
|
ColumnConfig,
|
|
27
|
-
|
|
28
|
+
DtmplData,
|
|
28
29
|
LtmplConfig,
|
|
29
30
|
QueryKey,
|
|
30
31
|
SelectedRow,
|
|
31
|
-
TmplBaseProps
|
|
32
|
-
AddOrUpdate
|
|
32
|
+
TmplBaseProps
|
|
33
33
|
} from "../tmpl/interface";
|
|
34
34
|
import TableUnits from "./table-util";
|
|
35
35
|
import SupportInputTypes from '../tmpl/control-type-supportor';
|
|
@@ -47,25 +47,28 @@ import Action from '../controls/action'
|
|
|
47
47
|
import Restat from "./stat/restat"
|
|
48
48
|
import ActionUtils from '../controls/action/utils'
|
|
49
49
|
import CquickButton from "../controls/cquery/cquick-button";
|
|
50
|
+
|
|
50
51
|
const DragHandle = SortableHandle(() => <MenuOutlined style={{cursor: 'grab', color: '#999'}}/>);
|
|
51
52
|
const {Panel} = Collapse;
|
|
52
53
|
|
|
53
54
|
type Level = 'l1' | 'l2';
|
|
54
|
-
export type Mode='simple' | 'common' | 'complete'
|
|
55
|
+
export type Mode = 'simple' | 'common' | 'complete'
|
|
55
56
|
|
|
56
|
-
const
|
|
57
|
+
const defaultDisabledColIds: string[] = ['20000', '10000']
|
|
57
58
|
|
|
58
59
|
interface ActTableProps extends TmplBaseProps {
|
|
59
60
|
criteriaData: object,
|
|
60
61
|
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,
|
|
62
|
+
menuId?: string,
|
|
63
|
+
showView?: (code: string, toCustomPage?: boolean) => void,
|
|
64
|
+
doCreate?: (toCustomPage?: boolean) => void,
|
|
65
|
+
doEdit?: (code: string, mode: AddOrUpdate, toCustomPage?: boolean) => void,
|
|
66
|
+
doDelete?: (code: string) => void,
|
|
65
67
|
doSearch?: (params: object) => void,
|
|
66
|
-
doRAction?:(ractionId:string,mainCode:string)=>void,
|
|
68
|
+
doRAction?: (ractionId: string, mainCode: string) => void,
|
|
67
69
|
level?: Level,
|
|
68
|
-
funcMode?:Mode
|
|
70
|
+
funcMode?: Mode,
|
|
71
|
+
title?: ReactNode,
|
|
69
72
|
};
|
|
70
73
|
|
|
71
74
|
interface ActTableStat {
|
|
@@ -75,7 +78,7 @@ interface ActTableStat {
|
|
|
75
78
|
loading: boolean;
|
|
76
79
|
criteriaData: object;
|
|
77
80
|
selectedRows: SelectedRow[];
|
|
78
|
-
selectedDatas:DtmplData[];
|
|
81
|
+
selectedDatas: DtmplData[];
|
|
79
82
|
hiddenColIds?: string[];
|
|
80
83
|
drillingColIds?: string[];
|
|
81
84
|
disabledColIds: string[];
|
|
@@ -86,9 +89,6 @@ interface ActTableStat {
|
|
|
86
89
|
// drillingPopoverVisible:boolean;
|
|
87
90
|
};
|
|
88
91
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
92
|
class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
93
93
|
state = {
|
|
94
94
|
tableColumns: undefined,
|
|
@@ -97,9 +97,9 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
97
97
|
loading: true,
|
|
98
98
|
criteriaData: undefined,
|
|
99
99
|
disableCols: undefined,
|
|
100
|
-
hiddenColIds:
|
|
100
|
+
hiddenColIds: defaultDisabledColIds,
|
|
101
101
|
selectedRows: [],
|
|
102
|
-
selectedDatas:[],
|
|
102
|
+
selectedDatas: [],
|
|
103
103
|
hiddenRowCodes: [],
|
|
104
104
|
viewModels: [],
|
|
105
105
|
drillingColIds: undefined,
|
|
@@ -109,9 +109,9 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
109
109
|
//drillingPopoverVisible:false,
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
-
static defaultProps={
|
|
113
|
-
criteriaData:{},
|
|
114
|
-
funcMode:'complete'
|
|
112
|
+
static defaultProps = {
|
|
113
|
+
criteriaData: {},
|
|
114
|
+
funcMode: 'complete'
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
loadData = async (hiddenColIds: string[], hiddenRowCodes: string[], sortedColConfigs: ColumnConfig[]) => {
|
|
@@ -156,12 +156,12 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
156
156
|
//构建过滤条件
|
|
157
157
|
let queryKey: QueryKey
|
|
158
158
|
if (level && level == 'l2') {
|
|
159
|
-
queryKey = await HcserviceV3.requestL2LtmplQueryKey(
|
|
159
|
+
queryKey = await HcserviceV3.requestL2LtmplQueryKey(sourceId, {
|
|
160
160
|
...criteriaData, ...pageInfo,
|
|
161
161
|
mainCode
|
|
162
162
|
});
|
|
163
163
|
} else {
|
|
164
|
-
queryKey = await HcserviceV3.requestLtmplQueryKey(
|
|
164
|
+
queryKey = await HcserviceV3.requestLtmplQueryKey(sourceId, {
|
|
165
165
|
...criteriaData, ...pageInfo,
|
|
166
166
|
mainCode
|
|
167
167
|
});
|
|
@@ -177,15 +177,15 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
177
177
|
queryKey,
|
|
178
178
|
criteriaData,
|
|
179
179
|
loading: false,
|
|
180
|
-
showL2Chart:false,
|
|
180
|
+
showL2Chart: false,
|
|
181
181
|
selectedRows: [],
|
|
182
|
-
selectedDatas:[],
|
|
182
|
+
selectedDatas: [],
|
|
183
183
|
viewModels: (this.state.viewModels.length > 0 ? this.state.viewModels : ['table']),
|
|
184
184
|
})
|
|
185
185
|
}
|
|
186
186
|
|
|
187
187
|
buildTableColumns = (ltmplConfig: LtmplConfig, hiddenColIds: string[], hiddenRowCodes: string[], sortedColConfigs: ColumnConfig[]) => {
|
|
188
|
-
const {mainCode, showView, doEdit,menuId,doRAction} = this.props
|
|
188
|
+
const {mainCode, showView, doEdit, menuId, doRAction, doDelete} = this.props
|
|
189
189
|
const {buttons} = ltmplConfig;
|
|
190
190
|
let tableColumns = [];
|
|
191
191
|
let s = 0;
|
|
@@ -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,19 +307,31 @@ 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>删除</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
|
}
|
|
@@ -333,18 +346,18 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
333
346
|
if (ltmplConfig) {
|
|
334
347
|
sortedColConfigs = [{id: '10000', title: '排序'}, ...ltmplConfig.columns, {id: '20000', title: '隐藏'}]
|
|
335
348
|
}
|
|
336
|
-
this.loadData(
|
|
349
|
+
this.loadData(defaultDisabledColIds, [], sortedColConfigs);
|
|
337
350
|
}
|
|
338
351
|
|
|
339
352
|
async componentDidUpdate(prevProps) {
|
|
340
|
-
const {
|
|
353
|
+
const {sourceId, criteriaData, ltmplConfig} = this.props;
|
|
341
354
|
let {ltmplConfig: preLtmplConfig, criteriaData: preCriteriaData} = prevProps;
|
|
342
355
|
|
|
343
356
|
let {hiddenColIds, sortedColConfigs} = this.state;
|
|
344
357
|
|
|
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));
|
|
358
|
+
console.log("UnitscriteriaData)", Units.transQueryParamsToStr(criteriaData));
|
|
359
|
+
console.log("preCriteriaData)", Units.transQueryParamsToStr(preCriteriaData));
|
|
360
|
+
console.log("preCriteriaData) bool", Units.transQueryParamsToStr(preCriteriaData) == Units.transQueryParamsToStr(criteriaData));
|
|
348
361
|
if (ltmplConfig && (!preLtmplConfig || ltmplConfig.id != preLtmplConfig.id) || (Units.transQueryParamsToStr(criteriaData) != Units.transQueryParamsToStr(preCriteriaData))) {
|
|
349
362
|
|
|
350
363
|
if (ltmplConfig.id == preLtmplConfig.id) {
|
|
@@ -357,7 +370,7 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
357
370
|
this.setState({
|
|
358
371
|
viewModels: ['table'],
|
|
359
372
|
})
|
|
360
|
-
this.loadData(
|
|
373
|
+
this.loadData(defaultDisabledColIds, [], sColConfigs);
|
|
361
374
|
}
|
|
362
375
|
}
|
|
363
376
|
}
|
|
@@ -405,24 +418,24 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
405
418
|
const {ltmplConfig} = this.props
|
|
406
419
|
const {hiddenRowCodes, sortedColConfigs} = this.state;
|
|
407
420
|
this.setState({
|
|
408
|
-
showL2Chart:false,
|
|
421
|
+
showL2Chart: false,
|
|
409
422
|
hiddenColIds,
|
|
410
423
|
tableColumns: this.buildTableColumns(ltmplConfig, hiddenColIds, hiddenRowCodes, sortedColConfigs),
|
|
411
424
|
})
|
|
412
425
|
}
|
|
413
426
|
|
|
414
|
-
doSelectedAction = async (actionId: string,codes,params:object) => {
|
|
427
|
+
doSelectedAction = async (actionId: string, codes, params: object) => {
|
|
415
428
|
const {selectedRows} = this.state;
|
|
416
|
-
this.doAction(actionId, selectedRows,params);
|
|
429
|
+
this.doAction(actionId, selectedRows, params);
|
|
417
430
|
}
|
|
418
431
|
|
|
419
|
-
doAction = async (actionId: string, selectedRows: SelectedRow[],params) => {
|
|
420
|
-
const {
|
|
432
|
+
doAction = async (actionId: string, selectedRows: SelectedRow[], params) => {
|
|
433
|
+
const {sourceId} = this.props;
|
|
421
434
|
const {hiddenColIds, hiddenRowCodes, sortedColConfigs} = this.state;
|
|
422
435
|
this.setState({
|
|
423
436
|
loading: true,
|
|
424
437
|
})
|
|
425
|
-
let result: boolean = await HcserviceV3.postActions(
|
|
438
|
+
let result: boolean = await HcserviceV3.postActions(actionId, selectedRows, params);
|
|
426
439
|
if (result) {//重新加载数据
|
|
427
440
|
this.loadData(hiddenColIds, hiddenRowCodes, sortedColConfigs);
|
|
428
441
|
} else {
|
|
@@ -432,12 +445,12 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
432
445
|
}
|
|
433
446
|
}
|
|
434
447
|
|
|
435
|
-
doRowAction = async (actionId: string, codes: string[],params:object) => {
|
|
436
|
-
this.doAction(actionId, [{title: undefined, code:codes[0]}],params);
|
|
448
|
+
doRowAction = async (actionId: string, codes: string[], params: object) => {
|
|
449
|
+
this.doAction(actionId, [{title: undefined, code: codes[0]}], params);
|
|
437
450
|
}
|
|
438
451
|
|
|
439
452
|
doDelete = async () => {
|
|
440
|
-
const {
|
|
453
|
+
const {sourceId} = this.props;
|
|
441
454
|
const {selectedRows, hiddenColIds, hiddenRowCodes, sortedColConfigs} = this.state;
|
|
442
455
|
this.setState({
|
|
443
456
|
loading: true,
|
|
@@ -452,17 +465,23 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
452
465
|
}
|
|
453
466
|
}
|
|
454
467
|
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
468
|
+
doDeleteByCode = async (code: string) => {
|
|
469
|
+
const {sourceId} = this.props;
|
|
470
|
+
const {hiddenColIds, hiddenRowCodes, sortedColConfigs} = this.state;
|
|
471
|
+
this.setState({
|
|
472
|
+
loading: true,
|
|
473
|
+
})
|
|
474
|
+
let result: boolean = await HcserviceV3.deleteByCode(sourceId, [code]);
|
|
475
|
+
if (result) {//重新加载数据
|
|
476
|
+
this.loadData(hiddenColIds, hiddenRowCodes, sortedColConfigs);
|
|
477
|
+
} else {
|
|
478
|
+
this.setState({
|
|
479
|
+
loading: false,
|
|
480
|
+
})
|
|
481
|
+
}
|
|
482
|
+
}
|
|
462
483
|
|
|
463
484
|
doSelectedCQuery = async (cqueryId: string) => {
|
|
464
|
-
// const {selectedRows} = this.state;
|
|
465
|
-
// this.doCQuery(cqueryId, selectedRows[0])
|
|
466
485
|
}
|
|
467
486
|
|
|
468
487
|
doJump = async (jumpId: string, code: string) => {
|
|
@@ -484,13 +503,13 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
484
503
|
|
|
485
504
|
doSelectedJump = async (jumpId: string) => {
|
|
486
505
|
const {selectedRows} = this.state;
|
|
487
|
-
if(selectedRows.length==1){
|
|
506
|
+
if (selectedRows.length == 1) {
|
|
488
507
|
this.doJump(jumpId, selectedRows[0].code)
|
|
489
508
|
}
|
|
490
509
|
|
|
491
510
|
}
|
|
492
511
|
|
|
493
|
-
changeRowSelection = (selectedRows: SelectedRow[],selectedDatas:DtmplData[]) => {
|
|
512
|
+
changeRowSelection = (selectedRows: SelectedRow[], selectedDatas: DtmplData[]) => {
|
|
494
513
|
this.setState({
|
|
495
514
|
selectedRows,
|
|
496
515
|
selectedDatas,
|
|
@@ -507,24 +526,29 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
507
526
|
}
|
|
508
527
|
|
|
509
528
|
|
|
510
|
-
|
|
511
529
|
renderHeaderButtons = () => {
|
|
512
530
|
let {hiddenColIds, queryKey, viewModels, sortedColConfigs, disabledColIds, showL2Chart, showL2ActTable} = this.state;
|
|
513
|
-
const {ltmplConfig,
|
|
531
|
+
const {ltmplConfig, sourceId, doCreate, doSearch, menuId, funcMode} = this.props;
|
|
514
532
|
let {buttons} = ltmplConfig;
|
|
515
533
|
|
|
516
534
|
return <>
|
|
535
|
+
{funcMode == "common" && this.criteriaFormUseful() ?
|
|
536
|
+
<Popover trigger="click" content={this.renderCriteriaForm()} >
|
|
537
|
+
<Button ><SearchOutlined /></Button>
|
|
538
|
+
</Popover>
|
|
539
|
+
: null
|
|
540
|
+
}
|
|
517
541
|
{buttons.includes("dtmplAdd") && doCreate ?
|
|
518
542
|
<Tooltip title={'创建'}>
|
|
519
543
|
<Button
|
|
520
|
-
onClick={()=>doCreate()}>
|
|
544
|
+
onClick={() => doCreate()}>
|
|
521
545
|
<PlusOutlined/>
|
|
522
546
|
</Button> </Tooltip> : ''}
|
|
523
547
|
{buttons.includes("dtmplCustomAdd") && doCreate ?
|
|
524
548
|
<Tooltip title={'创建'}>
|
|
525
549
|
<Button
|
|
526
|
-
onClick={()=>doCreate(true)}>
|
|
527
|
-
<PlusCircleOutlined
|
|
550
|
+
onClick={() => doCreate(true)}>
|
|
551
|
+
<PlusCircleOutlined/>
|
|
528
552
|
</Button> </Tooltip> : ''}
|
|
529
553
|
{buttons.includes("importLtmplExcel") ? <Tooltip title={'导入'}> <Button
|
|
530
554
|
href={`#/${sourceId}/importer?menuId=${menuId}`} target={'_blank'}>
|
|
@@ -557,7 +581,8 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
557
581
|
onClick={this.handleDataAnalysis}>
|
|
558
582
|
<FundOutlined/>
|
|
559
583
|
</Button></Tooltip> : ""}
|
|
560
|
-
{buttons.includes("reStat") ? <Restat fields={ltmplConfig.reStatParams} sourceId={sourceId}
|
|
584
|
+
{buttons.includes("reStat") ? <Restat fields={ltmplConfig.reStatParams} sourceId={sourceId}
|
|
585
|
+
onfinish={() => doSearch(null)}></Restat> : ""}
|
|
561
586
|
<Popover content={<Checkbox.Group value={viewModels} onChange={this.changeViewModel}>
|
|
562
587
|
<Row style={{width: '120px'}}>
|
|
563
588
|
<Col span={24}><Checkbox value={'table'}>表格</Checkbox></Col>
|
|
@@ -595,9 +620,32 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
595
620
|
</>
|
|
596
621
|
}
|
|
597
622
|
|
|
623
|
+
criteriaFormUseful = () => {
|
|
624
|
+
const {ltmplConfig} = this.props;
|
|
625
|
+
let {buttons, criterias, jumps, actions} = ltmplConfig;
|
|
626
|
+
if(buttons.includes('batchDelete') || (buttons.includes('query') && ((criterias && criterias.length > 0) || buttons.includes('drilling'))) ||
|
|
627
|
+
(actions && actions.length > 0) || (jumps && jumps.length > 0)){
|
|
628
|
+
return true;
|
|
629
|
+
}else{
|
|
630
|
+
return false;
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
renderCriteriaForm=()=>{
|
|
635
|
+
let { criteriaData, loading, selectedRows, selectedDatas} = this.state;
|
|
636
|
+
let {ltmplConfig, doSearch} = this.props;
|
|
637
|
+
return <CriteriaForm loading={loading} selectedDatas={selectedDatas} selectedRows={selectedRows}
|
|
638
|
+
ltmplConfig={ltmplConfig} data={criteriaData}
|
|
639
|
+
doCQuery={this.doSelectedCQuery}
|
|
640
|
+
doAction={this.doSelectedAction}
|
|
641
|
+
doDelete={this.doDelete}
|
|
642
|
+
doJump={this.doSelectedJump}
|
|
643
|
+
doSearch={doSearch}/>
|
|
644
|
+
}
|
|
645
|
+
|
|
598
646
|
render() {
|
|
599
|
-
let {queryKey, tableColumns, criteriaData, loading, selectedRows,selectedDatas, hiddenRowCodes, viewModels, sortedColConfigs, hiddenColIds, showL2ActTable, showL2Chart} = this.state;
|
|
600
|
-
let {
|
|
647
|
+
let {queryKey, tableColumns, criteriaData, loading, selectedRows, selectedDatas, hiddenRowCodes, viewModels, sortedColConfigs, hiddenColIds, showL2ActTable, showL2Chart} = this.state;
|
|
648
|
+
let {sourceId, ltmplConfig, doSearch, funcMode, title} = this.props;
|
|
601
649
|
|
|
602
650
|
if (!ltmplConfig || !sourceId) {
|
|
603
651
|
return <>
|
|
@@ -609,10 +657,9 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
609
657
|
}
|
|
610
658
|
let {buttons, criterias, jumps, actions} = ltmplConfig
|
|
611
659
|
let displayCriteriaCard: boolean = false;
|
|
612
|
-
if(funcMode=='simple'){
|
|
613
|
-
displayCriteriaCard=false;
|
|
614
|
-
}else if (
|
|
615
|
-
(actions && actions.length > 0) || (jumps && jumps.length > 0) ) {
|
|
660
|
+
if (funcMode == 'simple' || funcMode == 'common') {
|
|
661
|
+
displayCriteriaCard = false;
|
|
662
|
+
} else if (this.criteriaFormUseful()) {
|
|
616
663
|
displayCriteriaCard = true;
|
|
617
664
|
}
|
|
618
665
|
|
|
@@ -633,26 +680,22 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
633
680
|
</div> : ""
|
|
634
681
|
}
|
|
635
682
|
{buttons.includes("analysis") && showL2ActTable ? <div>
|
|
636
|
-
<L2ActTable innerQueryKey={queryKey.key}
|
|
683
|
+
<L2ActTable innerQueryKey={queryKey.key} sourceId={sourceId}/>
|
|
637
684
|
<Divider dashed style={{borderTopColor: "#40a9ff",}} plain></Divider>
|
|
638
685
|
</div> : ""
|
|
639
686
|
}
|
|
640
687
|
<div className="actTable">
|
|
641
|
-
{funcMode=='complete'?
|
|
688
|
+
{funcMode == 'complete' || funcMode == 'common' ?
|
|
642
689
|
<h3>
|
|
643
|
-
{ltmplConfig.title}
|
|
690
|
+
{title ? title : ltmplConfig.title}
|
|
644
691
|
<p className="fr">
|
|
645
692
|
{this.renderHeaderButtons()}
|
|
646
693
|
</p>
|
|
647
|
-
</h3
|
|
694
|
+
</h3> : null
|
|
695
|
+
}
|
|
696
|
+
{displayCriteriaCard ?
|
|
697
|
+
this.renderCriteriaForm() : null
|
|
648
698
|
}
|
|
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
699
|
{
|
|
657
700
|
loading ? "" :
|
|
658
701
|
<QueryTable viewModels={viewModels} columnConfigs={columnConfigs}
|
|
@@ -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 {
|
|
@@ -314,7 +311,7 @@ class QueryTable extends React.PureComponent<QueryTableProps, QueryTableStat> {
|
|
|
314
311
|
dataSource={this.getUnHidenDataSource()}
|
|
315
312
|
renderItem={item => (
|
|
316
313
|
<List.Item key={item['id']}>
|
|
317
|
-
<Card><Descriptions column={4}>
|
|
314
|
+
<Card bodyStyle={{padding:'4px'}}><Descriptions column={4}>
|
|
318
315
|
{this.initViewList(item)}
|
|
319
316
|
</Descriptions></Card>
|
|
320
317
|
</List.Item>
|
|
@@ -165,7 +165,7 @@ class RelationTable extends React.PureComponent<RelationTableProps, RelationTabl
|
|
|
165
165
|
const viewable = buttons.includes('detail');
|
|
166
166
|
const rowEdit = buttons.includes('rowEdit');
|
|
167
167
|
const dtmplEdit = buttons.includes('dtmplEdit');
|
|
168
|
-
const deletable =
|
|
168
|
+
const deletable = buttons.includes('singleDelete');
|
|
169
169
|
|
|
170
170
|
|
|
171
171
|
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
|
}
|
|
@@ -97,28 +97,14 @@ export default class HcserviceV3 {
|
|
|
97
97
|
|
|
98
98
|
|
|
99
99
|
static async requestSelectConfig(sourceId) {
|
|
100
|
-
//let url = `/v3/${sourceName}/select/config`
|
|
101
100
|
let url = `/v3/select/config`
|
|
102
101
|
let res = await Super.super({
|
|
103
102
|
url,
|
|
104
103
|
method: "GET",
|
|
105
104
|
query:{sourceId}
|
|
106
105
|
});
|
|
107
|
-
|
|
108
106
|
return res.selectConfig;
|
|
109
107
|
}
|
|
110
|
-
// static async requestSelectConfig(sourceName:SourceName,sourceId) {
|
|
111
|
-
// //let url = `/v3/${sourceName}/select/config`
|
|
112
|
-
// let url = `/v3/relation-select/config`
|
|
113
|
-
// let res = await Super.super({
|
|
114
|
-
// url,
|
|
115
|
-
// method: "GET",
|
|
116
|
-
// query:{sourceId}
|
|
117
|
-
// });
|
|
118
|
-
//
|
|
119
|
-
// return res.selectConfig;
|
|
120
|
-
// }
|
|
121
|
-
|
|
122
108
|
|
|
123
109
|
static async requestLtmplConfig(sourceId) {
|
|
124
110
|
let url = `/v3/ltmpl/config`
|
|
@@ -281,19 +267,17 @@ export default class HcserviceV3 {
|
|
|
281
267
|
msg = res.message;
|
|
282
268
|
}
|
|
283
269
|
if(message){
|
|
284
|
-
message.success("
|
|
270
|
+
message.success("注册成功! " + msg)
|
|
285
271
|
}
|
|
286
|
-
|
|
287
272
|
code = res.entityCode ? res.entityCode : res.code;
|
|
288
273
|
} else {
|
|
289
274
|
if(message){
|
|
290
|
-
message.error("
|
|
275
|
+
message.error("注册失败");
|
|
291
276
|
}
|
|
292
|
-
|
|
293
277
|
}
|
|
294
278
|
} else {
|
|
295
279
|
if(message){
|
|
296
|
-
message.error("
|
|
280
|
+
message.error("注册成功");
|
|
297
281
|
}
|
|
298
282
|
}
|
|
299
283
|
return {code,status:res.status};
|