aldehyde 0.0.1
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/LICENSE +201 -0
- package/README.md +1 -0
- package/dist/163.js +2 -0
- package/dist/163.js.LICENSE.txt +43 -0
- package/dist/41.js +1 -0
- package/dist/aldehyde.js +2 -0
- package/dist/aldehyde.js.LICENSE.txt +122 -0
- package/dist/chemstruc-graph.js +1 -0
- package/dist/css/163-24392163d3c7b54ea806.css +11 -0
- package/dist/css/290-5e8e152675ab7d201c00.css +886 -0
- package/dist/css/chemstruc-graph-87868f791bf92fb80db9.css +29 -0
- package/dist/css/main-2e6725ec1b56da516cee.css +256 -0
- package/dist/html-editor-draft.js +2 -0
- package/dist/html-editor-draft.js.LICENSE.txt +5 -0
- package/dist/images/logo-06f6a5d8.png +0 -0
- package/dist/index.html +4 -0
- package/dist/signature.js +2 -0
- package/dist/signature.js.LICENSE.txt +17 -0
- package/package.json +180 -0
- package/src/components/chart/antd/Chart.js +32 -0
- package/src/components/chart/antd/Chart10000.js +90 -0
- package/src/components/chart/antd/Max2DimLineChart.js +128 -0
- package/src/components/chart/antd/PieChart1.js +54 -0
- package/src/components/chart/antd/PieChart2.js +56 -0
- package/src/components/chart/antd/chart-utils.tsx +50 -0
- package/src/components/chart/antd/column-chart-sub.tsx +67 -0
- package/src/components/chart/antd/line-chart-sub.tsx +65 -0
- package/src/components/chart/antd/pie-chart-sub.tsx +54 -0
- package/src/components/chart/antd/statview-d2-chart.tsx +125 -0
- package/src/components/chart/statview-l2-chart.tsx +69 -0
- package/src/components/controls/action/index.css +9 -0
- package/src/components/controls/action/index.tsx +228 -0
- package/src/components/controls/action/utils.tsx +122 -0
- package/src/components/controls/auto-complete/index.tsx +80 -0
- package/src/components/controls/cascader/index.js +97 -0
- package/src/components/controls/chemstruc/graph.tsx +150 -0
- package/src/components/controls/chemstruc/index.css +28 -0
- package/src/components/controls/collapse-card/index.css +9 -0
- package/src/components/controls/collapse-card/index.tsx +59 -0
- package/src/components/controls/color-picker/index.css +27 -0
- package/src/components/controls/color-picker/index.tsx +88 -0
- package/src/components/controls/cquery/cquick-button.tsx +117 -0
- package/src/components/controls/date-picker/index.tsx +141 -0
- package/src/components/controls/entity-select/entity-select.tsx +277 -0
- package/src/components/controls/entity-select/index.css +6 -0
- package/src/components/controls/entity-select/popover-entity-select.tsx +112 -0
- package/src/components/controls/entry-control.tsx +240 -0
- package/src/components/controls/enum-badge/index.tsx +28 -0
- package/src/components/controls/enum-tag/index.tsx +30 -0
- package/src/components/controls/file-view/drawer-file-view.tsx +69 -0
- package/src/components/controls/file-view/index.tsx +145 -0
- package/src/components/controls/html-editor/draft.tsx +161 -0
- package/src/components/controls/html-editor/tinymce.js +55 -0
- package/src/components/controls/input-number/index.tsx +101 -0
- package/src/components/controls/input-range/index.tsx +48 -0
- package/src/components/controls/password-setter/index.css +3 -0
- package/src/components/controls/password-setter/index.js +70 -0
- package/src/components/controls/progress/index.tsx +61 -0
- package/src/components/controls/relation-existion/index.css +4 -0
- package/src/components/controls/relation-existion/index.tsx +108 -0
- package/src/components/controls/rfield/index.css +4 -0
- package/src/components/controls/rfield/index.tsx +161 -0
- package/src/components/controls/signature/index.tsx +162 -0
- package/src/components/controls/steps/index.tsx +58 -0
- package/src/components/controls/text/ellipsis-text.tsx +70 -0
- package/src/components/controls/upload/index.tsx +122 -0
- package/src/components/controls/view-control.tsx +177 -0
- package/src/components/detail/button/cquery-button-bar.tsx +112 -0
- package/src/components/detail/button/index.css +43 -0
- package/src/components/detail/button/submit-button-bar.tsx +151 -0
- package/src/components/detail/dtmpl.css +53 -0
- package/src/components/detail/edit/dtmpl-edit.tsx +218 -0
- package/src/components/detail/edit/fields-edit-card.tsx +103 -0
- package/src/components/detail/edit/modal-dtmpl-edit.tsx +198 -0
- package/src/components/detail/edit/modal-row-edit.tsx +72 -0
- package/src/components/detail/edit/post-result/index.tsx +52 -0
- package/src/components/detail/edit/row-edit-card.tsx +125 -0
- package/src/components/detail/edit/row-editor.tsx +71 -0
- package/src/components/detail/rightbar/index.css +35 -0
- package/src/components/detail/rightbar/index.tsx +76 -0
- package/src/components/detail/view/act-dtmpl-view.tsx +155 -0
- package/src/components/detail/view/dtmpl-view.tsx +143 -0
- package/src/components/detail/view/field-view-group.tsx +73 -0
- package/src/components/detail/view/modal-dtmpl-view.tsx +56 -0
- package/src/components/detail/view/snapshot-timeline.tsx +130 -0
- package/src/components/exportor/export-frame.css +3 -0
- package/src/components/exportor/export-frame.tsx +194 -0
- package/src/components/exportor/index.tsx +60 -0
- package/src/components/form/criteria-form.tsx +241 -0
- package/src/components/form/dtmpl-form.css +4 -0
- package/src/components/form/dtmpl-form.tsx +272 -0
- package/src/components/form/field-group-form.tsx +75 -0
- package/src/components/form/fields-form.tsx +51 -0
- package/src/components/form/form-Item-group.tsx +99 -0
- package/src/components/form/index.css +13 -0
- package/src/components/import/excel-import.tsx +316 -0
- package/src/components/import/index.css +54 -0
- package/src/components/import/template-builder.js +474 -0
- package/src/components/import/template.css +51 -0
- package/src/components/layout/MainPage.tsx +230 -0
- package/src/components/layout/footer/index.css +6 -0
- package/src/components/layout/footer/index.js +17 -0
- package/src/components/layout/header/index.css +86 -0
- package/src/components/layout/header/index.tsx +58 -0
- package/src/components/layout/menu/block.tsx +88 -0
- package/src/components/layout/menu/l2menu-message-bar.tsx +118 -0
- package/src/components/layout/menu/l2menu-quick-bar.tsx +132 -0
- package/src/components/layout/menu/menu-2layers.tsx +92 -0
- package/src/components/layout/menu/menu-render.tsx +49 -0
- package/src/components/layout/menu/reset-password.tsx +185 -0
- package/src/components/layout/menu/user-bar.tsx +97 -0
- package/src/components/layout/menu/userinfo-bar.tsx +70 -0
- package/src/components/layout/sidebar/index.css +26 -0
- package/src/components/layout/sidebar/index.tsx +38 -0
- package/src/components/login.js +137 -0
- package/src/components/module/criteria-page.tsx +175 -0
- package/src/components/module/dtmpl-page.tsx +70 -0
- package/src/components/module/ltmpl-page.tsx +181 -0
- package/src/components/routable/dtmpl-route.tsx +96 -0
- package/src/components/routable/import-route.tsx +28 -0
- package/src/components/routable/ltmpl-route.tsx +158 -0
- package/src/components/table/act-table.tsx +635 -0
- package/src/components/table/column/column-selector.tsx +79 -0
- package/src/components/table/column/index.css +14 -0
- package/src/components/table/index.css +45 -0
- package/src/components/table/l2-act-table.tsx +85 -0
- package/src/components/table/modal-select-table.tsx +248 -0
- package/src/components/table/pagination.css +15 -0
- package/src/components/table/pagination.tsx +72 -0
- package/src/components/table/query-table.tsx +331 -0
- package/src/components/table/relation-table.tsx +600 -0
- package/src/components/table/select-table.tsx +247 -0
- package/src/components/table/selected-rows-card.tsx +62 -0
- package/src/components/table/stat/restat.tsx +79 -0
- package/src/components/table/table-util.tsx +33 -0
- package/src/components/tmpl/control-type-supportor.tsx +97 -0
- package/src/components/tmpl/hc-data-source.tsx +230 -0
- package/src/components/tmpl/hcservice-v3.tsx +624 -0
- package/src/components/tmpl/interface.tsx +308 -0
- package/src/components/tmpl/superagent.js +93 -0
- package/src/components/tmpl/tmpl-config-analysis.tsx +111 -0
- package/src/components/units/EncryptUtils.js +38 -0
- package/src/components/units/image.d.ts +8 -0
- package/src/components/units/index.tsx +536 -0
- package/src/components/units/logo.png +0 -0
- package/src/components/units/storage.js +3 -0
- package/src/components/welcome/HCWelcome.js +232 -0
- package/src/components/welcome/index.css +13 -0
- package/src/components/welcome/logo.png +0 -0
- package/src/components/welcome/quick-entrance.tsx +77 -0
- package/src/components/welcome/workbench.tsx +76 -0
- package/src/index.js +4 -0
- package/src/style/common.css +79 -0
- package/src/style/coverstyle.css +49 -0
- package/src/style/transstyle.css +24 -0
- package/tsconfig.json +106 -0
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import {Button,Radio,Divider,InputNumber,Checkbox,Progress} from 'antd';
|
|
3
|
+
import './export-frame.css'
|
|
4
|
+
import Super from "../tmpl/superagent"
|
|
5
|
+
import Units from "../units"
|
|
6
|
+
import {PageInfo, QueryKey, SourceName} from "../tmpl/interface";
|
|
7
|
+
const RadioGroup = Radio.Group;
|
|
8
|
+
type ExportStatus = 'ready'|'exporting' | 'success'|'fail' |'stop';
|
|
9
|
+
type ExportMode = 'current'|'all';
|
|
10
|
+
interface ExportFrameProps {
|
|
11
|
+
defaultExportMode?:string,
|
|
12
|
+
queryKey: QueryKey;
|
|
13
|
+
currentPage?:PageInfo;
|
|
14
|
+
title:string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
interface ExportFrameStat {
|
|
18
|
+
interrupted:boolean,
|
|
19
|
+
disabledPageNoInput:boolean,
|
|
20
|
+
disabledCurrentPageRadio:boolean,
|
|
21
|
+
disabledAllPageRadio:boolean,
|
|
22
|
+
exportId:string,
|
|
23
|
+
startPageNo:number,
|
|
24
|
+
endPageNo:number,
|
|
25
|
+
exportMode:string,
|
|
26
|
+
percent:number,
|
|
27
|
+
exportStatus:string,
|
|
28
|
+
exportingMsg:string,
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
export default class ExportFrame extends React.PureComponent<ExportFrameProps, ExportFrameStat>{
|
|
33
|
+
|
|
34
|
+
static defaultProps={
|
|
35
|
+
defaultExportMode:'all'
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
state={
|
|
39
|
+
interrupted:false,
|
|
40
|
+
disabledPageNoInput:false,
|
|
41
|
+
disabledCurrentPageRadio:false,
|
|
42
|
+
disabledAllPageRadio:false,
|
|
43
|
+
exportId:undefined,
|
|
44
|
+
startPageNo:1,
|
|
45
|
+
endPageNo:10,
|
|
46
|
+
exportMode:'all',
|
|
47
|
+
percent:0,
|
|
48
|
+
exportStatus:'ready',
|
|
49
|
+
exportingMsg:'',
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
componentWillUnmount(){
|
|
53
|
+
console.log("销毁")
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
onChangeRadio=(e)=>{
|
|
57
|
+
this.setState({
|
|
58
|
+
exportMode: e.target.value,
|
|
59
|
+
startPageNo:1,
|
|
60
|
+
endPageNo:10,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
timerID=undefined;
|
|
65
|
+
|
|
66
|
+
handleStart=()=>{
|
|
67
|
+
const {queryKey,currentPage,title }=this.props
|
|
68
|
+
const { startPageNo,endPageNo,exportMode }=this.state
|
|
69
|
+
Super.super({
|
|
70
|
+
url:`/v3/ltmp/data/exporter`,
|
|
71
|
+
method:'GET',
|
|
72
|
+
query:{
|
|
73
|
+
scope:exportMode,
|
|
74
|
+
withDetail:false,
|
|
75
|
+
queryKey:queryKey.key,
|
|
76
|
+
startPageNo:exportMode=='all'?startPageNo:currentPage.pageNo,
|
|
77
|
+
endPageNo:exportMode=='all'?endPageNo:currentPage.pageNo,
|
|
78
|
+
} ,
|
|
79
|
+
}).then((res)=>{
|
|
80
|
+
if(res.exportId){
|
|
81
|
+
this.setState({
|
|
82
|
+
exportId:res.exportId,
|
|
83
|
+
exportStatus:'exporting'
|
|
84
|
+
})
|
|
85
|
+
this.statusOut(res.exportId)
|
|
86
|
+
this.timerID=setInterval(
|
|
87
|
+
() =>this.statusOut(res.exportId),
|
|
88
|
+
1000
|
|
89
|
+
);
|
|
90
|
+
}else{
|
|
91
|
+
this.setState({
|
|
92
|
+
exportStatus:'fail'
|
|
93
|
+
})
|
|
94
|
+
}
|
|
95
|
+
})
|
|
96
|
+
}
|
|
97
|
+
statusOut=(exportId)=>{
|
|
98
|
+
const {exportStatus}=this.state;
|
|
99
|
+
Super.super({
|
|
100
|
+
url:`/v3/exporter/status`,
|
|
101
|
+
query:{
|
|
102
|
+
interrupted:exportStatus=='stop',
|
|
103
|
+
exportId
|
|
104
|
+
} ,
|
|
105
|
+
method:'GET',
|
|
106
|
+
},"","none").then((res)=>{
|
|
107
|
+
if(res.breaked){
|
|
108
|
+
this.setState({
|
|
109
|
+
exportingMsg:'已终止',
|
|
110
|
+
percent:0,
|
|
111
|
+
})
|
|
112
|
+
}else{
|
|
113
|
+
this.setState({
|
|
114
|
+
exportingMsg:res.statusMsg,
|
|
115
|
+
percent:Math.floor((res.current/res.totalCount)*100),
|
|
116
|
+
})
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
if(exportStatus=='stop'){
|
|
120
|
+
clearInterval(this.timerID);
|
|
121
|
+
}
|
|
122
|
+
if(res.completed===true){
|
|
123
|
+
clearInterval(this.timerID);
|
|
124
|
+
this.setState({
|
|
125
|
+
exportStatus:'success',
|
|
126
|
+
exportingMsg:res.statusMsg,
|
|
127
|
+
percent:Math.floor((res.current/res.totalCount)*100),
|
|
128
|
+
})
|
|
129
|
+
}
|
|
130
|
+
})
|
|
131
|
+
}
|
|
132
|
+
download=()=>{
|
|
133
|
+
const {title}=this.props;
|
|
134
|
+
const {exportId}=this.state;
|
|
135
|
+
const hydrocarbonToken=Units.getLocalStorge("hydrocarbonToken")
|
|
136
|
+
Units.downloadFile(Units.api()+`/v3/exporter/excel?exportId=${exportId}&@token=${hydrocarbonToken}`,title)
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
handleCancel=()=>{
|
|
140
|
+
this.setState({
|
|
141
|
+
percent:0,
|
|
142
|
+
exportStatus:'stop',
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
render(){
|
|
147
|
+
const {defaultExportMode,currentPage}=this.props
|
|
148
|
+
const { startPageNo,endPageNo,disabledPageNoInput,exportMode,exportStatus,percent,exportingMsg}=this.state
|
|
149
|
+
return (
|
|
150
|
+
<div style={{width:'400px'}} className="exportFrame">
|
|
151
|
+
{currentPage?<><RadioGroup onChange={this.onChangeRadio} value={exportMode} defaultValue={defaultExportMode}>
|
|
152
|
+
<Radio value={'current'} disabled={exportStatus=='exporting'} >导出当前页</Radio>
|
|
153
|
+
<Radio value={'all'} disabled={exportStatus=='exporting'}>导出所有</Radio>
|
|
154
|
+
</RadioGroup><Divider /></>:""}
|
|
155
|
+
{exportMode=='all'?
|
|
156
|
+
<div>
|
|
157
|
+
页号:
|
|
158
|
+
<InputNumber
|
|
159
|
+
min={1}
|
|
160
|
+
value={startPageNo}
|
|
161
|
+
placeholder="开始页号"
|
|
162
|
+
onChange={(v1)=>this.setState({startPageNo: v1})}
|
|
163
|
+
disabled={disabledPageNoInput}/>-
|
|
164
|
+
<InputNumber
|
|
165
|
+
min={1}
|
|
166
|
+
value={endPageNo}
|
|
167
|
+
placeholder="结束页号"
|
|
168
|
+
onChange={(v2)=>this.setState({endPageNo:v2})}
|
|
169
|
+
disabled={disabledPageNoInput}/>
|
|
170
|
+
<Divider />
|
|
171
|
+
</div>:"" }
|
|
172
|
+
<div >
|
|
173
|
+
{exportStatus=='ready'?
|
|
174
|
+
<Button type="primary" onClick={this.handleStart}>
|
|
175
|
+
开始导出
|
|
176
|
+
</Button>: exportStatus=='exporting'?<Button onClick={this.handleCancel}>取消导出</Button>:
|
|
177
|
+
<Button onClick={this.handleStart}>
|
|
178
|
+
重新导出
|
|
179
|
+
</Button>
|
|
180
|
+
}
|
|
181
|
+
{exportStatus=='success'?<Button type="primary" style={{marginLeft:10}}
|
|
182
|
+
disabled={exportStatus!='success'}
|
|
183
|
+
onClick={this.download}>下载文件
|
|
184
|
+
</Button>:''
|
|
185
|
+
}
|
|
186
|
+
{percent>0?
|
|
187
|
+
<Progress percent={percent} size="small" status="active" />:""
|
|
188
|
+
}
|
|
189
|
+
<p>{exportingMsg}</p>
|
|
190
|
+
</div>
|
|
191
|
+
</div>
|
|
192
|
+
)
|
|
193
|
+
}
|
|
194
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import {Card,Button,Upload,message,Progress,List,Checkbox,Row,Col,Modal,Popover,InputNumber } from 'antd'
|
|
3
|
+
import {SyncOutlined,ReloadOutlined ,SnippetsOutlined,UploadOutlined,CopyOutlined,SettingOutlined} from '@ant-design/icons';
|
|
4
|
+
import Super from "../tmpl/superagent"
|
|
5
|
+
import Units from "../units"
|
|
6
|
+
import './index.css'
|
|
7
|
+
import {LtmplConfig, QueryKey, SelectedRow, SourceName, TmplBaseProps} from "../tmpl/interface";
|
|
8
|
+
import moment from "moment";
|
|
9
|
+
import HCDataSource from "../tmpl/hc-data-source";
|
|
10
|
+
|
|
11
|
+
const CheckboxGroup = Checkbox.Group;
|
|
12
|
+
const logLevelList: LogLevel[]= ['INFO', 'SUC', 'ERROR', 'WARN'];
|
|
13
|
+
let totalMSG=[]
|
|
14
|
+
type LogLevel = 'INFO'| 'SUC'|'ERROR'|'WARN';
|
|
15
|
+
type ImportStatus = 'waitingFile'| 'fileSelected' |'importing' | 'success'|'fail' |'stop';
|
|
16
|
+
|
|
17
|
+
interface ExcelExportProps {
|
|
18
|
+
sourceId:string,
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
interface ExcelExportStat {
|
|
22
|
+
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export default class ExcelExport extends React.PureComponent<ExcelExportProps, ExcelExportStat>{
|
|
26
|
+
|
|
27
|
+
state = {
|
|
28
|
+
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
timerId=undefined;
|
|
32
|
+
|
|
33
|
+
async componentDidMount(){
|
|
34
|
+
const {sourceId}=this.props;
|
|
35
|
+
|
|
36
|
+
let ltmplConfigRes = await HCDataSource.requestLtmplConfig(sourceId);
|
|
37
|
+
|
|
38
|
+
this.setState({
|
|
39
|
+
ltmplConfig:ltmplConfigRes.ltmplConfig,
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
}
|
|
43
|
+
componentWillUnmount(){
|
|
44
|
+
if(this.timerId){
|
|
45
|
+
clearInterval(this.timerId);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
render(){
|
|
56
|
+
const { } = this.state;
|
|
57
|
+
|
|
58
|
+
return <></>
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
import React, {useEffect} from 'react';
|
|
2
|
+
import {Button, Card, Col, Collapse, Form as AntdForm, Popconfirm, Row, Select, Space} from 'antd';
|
|
3
|
+
import {CriteriaConfig, DtmplData, LtmplConfig, SelectConfig, SelectedRow} from "../tmpl/interface";
|
|
4
|
+
import EntryControl from "../controls/entry-control";
|
|
5
|
+
import Action from "../controls/action";
|
|
6
|
+
import CquickButton from '../controls/cquery/cquick-button'
|
|
7
|
+
|
|
8
|
+
const {Panel} = Collapse;
|
|
9
|
+
const FormItem = AntdForm.Item;
|
|
10
|
+
|
|
11
|
+
export interface CriteriaFormProps {
|
|
12
|
+
ltmplConfig: LtmplConfig | SelectConfig;
|
|
13
|
+
data: object;
|
|
14
|
+
selectedRows: SelectedRow[];
|
|
15
|
+
selectedDatas?:DtmplData[];
|
|
16
|
+
doSearch?: (data: object) => void;
|
|
17
|
+
doDelete?: () => void;
|
|
18
|
+
doAction?: (string, selectedRows: SelectedRow[], object) => void,
|
|
19
|
+
doJump?: (jumpId: string) => void;
|
|
20
|
+
doCQuery?:(cqueryId: string) => void;
|
|
21
|
+
hiddenCriteriaIds?: string[];
|
|
22
|
+
visible?: boolean;
|
|
23
|
+
loading: boolean;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const CriteriaForm: React.FC<CriteriaFormProps> = (props) => {
|
|
27
|
+
|
|
28
|
+
const {ltmplConfig, doSearch, doAction, doJump, doDelete, selectedRows, data, visible, loading,selectedDatas,doCQuery} = props;
|
|
29
|
+
let [form] = AntdForm.useForm();
|
|
30
|
+
// @ts-ignore
|
|
31
|
+
let {buttons, actions, jumps,cQuerys, criterias, drillingParams, columns} = ltmplConfig;
|
|
32
|
+
const initialValues = {};
|
|
33
|
+
const searchSubmit = (data) => {
|
|
34
|
+
if (doSearch) {
|
|
35
|
+
doSearch(data);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
form.resetFields();
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
let showQueryButton = buttons.includes("query") && doSearch;
|
|
44
|
+
|
|
45
|
+
let showDeleteButton = buttons.includes("delete") && doDelete;
|
|
46
|
+
let deleteButtonDisabled = !(selectedRows && selectedRows.length > 0);
|
|
47
|
+
|
|
48
|
+
const renderAction = () => {
|
|
49
|
+
if (doAction && actions && actions.length > 0) {
|
|
50
|
+
return actions.map((action) => {
|
|
51
|
+
let disabled = true;
|
|
52
|
+
if (selectedRows) {
|
|
53
|
+
if (selectedRows.length > 0 && action.multible) {
|
|
54
|
+
disabled = false;
|
|
55
|
+
} else if (selectedRows.length == 1) {
|
|
56
|
+
disabled = false;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
// return <Popconfirm key={action.id}
|
|
60
|
+
// placement="leftBottom"
|
|
61
|
+
// title={`确定要对选中数据执行【${action.title}】吗?`}
|
|
62
|
+
// onConfirm={() => {
|
|
63
|
+
// doAction(action.id)
|
|
64
|
+
// }}
|
|
65
|
+
// okText="确定"
|
|
66
|
+
// cancelText="取消"
|
|
67
|
+
// >
|
|
68
|
+
// <Button type="primary" key={action.id}
|
|
69
|
+
// disabled={disabled}>{action.title}</Button>
|
|
70
|
+
// </Popconfirm>;
|
|
71
|
+
return <Action hiddenType={"disabled"} key={action.id} disabled={disabled} data={selectedDatas} actionConfig={action} doAction={doAction} serial={1} ></Action>
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const renderJump = () => {
|
|
77
|
+
if (doJump && jumps && jumps.length > 0) {
|
|
78
|
+
return jumps.map((jump) => {
|
|
79
|
+
let disabled = true;
|
|
80
|
+
if (selectedRows) {
|
|
81
|
+
if (selectedRows.length > 0 && jump.multible) {
|
|
82
|
+
disabled = false;
|
|
83
|
+
} else if (selectedRows.length == 1) {
|
|
84
|
+
disabled = false;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return <Button key={jump.id}
|
|
88
|
+
onClick={() => doJump(jump.id)}
|
|
89
|
+
disabled={disabled}>{jump.title}</Button>;
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const renderCQuery = () => {
|
|
95
|
+
if (doCQuery && cQuerys && cQuerys.length > 0) {
|
|
96
|
+
return cQuerys.map((cquery) => {
|
|
97
|
+
let disabled = true;
|
|
98
|
+
if (selectedRows && selectedRows.length == 1) {
|
|
99
|
+
disabled = false;
|
|
100
|
+
}
|
|
101
|
+
return <CquickButton key={cquery.id}
|
|
102
|
+
// onClick={() => doCQuery(cquery.id)}
|
|
103
|
+
disabled={disabled} cQueryConfig={cquery} mainCode={!disabled ?selectedRows[0].code:undefined}/>;
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
const hasDimension=()=>{
|
|
109
|
+
columns.forEach((item) => {
|
|
110
|
+
if (item.statColType == 'dimension') {
|
|
111
|
+
return true;
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
const renderDrillDimension = () => {
|
|
119
|
+
let drillingColIdsName='drillingColIds'
|
|
120
|
+
let dimensionColIds = [];
|
|
121
|
+
const options = [];
|
|
122
|
+
columns.forEach((item) => {
|
|
123
|
+
if (item.statColType == 'dimension') {
|
|
124
|
+
options.push({label: item.title, value: item.id})
|
|
125
|
+
dimensionColIds.push(item.id);
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
options.push({label: '无', value: '5'});
|
|
129
|
+
|
|
130
|
+
initialValues[drillingColIdsName] = data ? data[drillingColIdsName]?data[drillingColIdsName]:dimensionColIds: dimensionColIds;
|
|
131
|
+
|
|
132
|
+
let fieldValue = data ? data[drillingColIdsName]:dimensionColIds;
|
|
133
|
+
let antdControlProps = {
|
|
134
|
+
placeholder: "请选择维度", disabled: false,value:fieldValue, style: {minWidth: 220, width: '100%'}
|
|
135
|
+
}
|
|
136
|
+
return <FormItem label={'维度'} name={drillingColIdsName} key={drillingColIdsName}
|
|
137
|
+
rules={[{
|
|
138
|
+
required: true, message: `请选择维度,上钻到顶层请只选【无】`,
|
|
139
|
+
}]} >
|
|
140
|
+
<Select
|
|
141
|
+
mode="multiple"
|
|
142
|
+
{...antdControlProps}
|
|
143
|
+
notFoundContent="暂无选项"
|
|
144
|
+
allowClear={true}
|
|
145
|
+
showSearch
|
|
146
|
+
showArrow={true}
|
|
147
|
+
options={options}
|
|
148
|
+
></Select>
|
|
149
|
+
</FormItem>
|
|
150
|
+
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
const renderCriteria = (criterias: CriteriaConfig[]) => {
|
|
154
|
+
if (!criterias) {
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
const {hiddenCriteriaIds} = props;
|
|
158
|
+
criterias.map((item) => {
|
|
159
|
+
let formItemName = 'c_' + item.id;
|
|
160
|
+
let fieldValue = data ? data[formItemName] : undefined;
|
|
161
|
+
initialValues[formItemName] = fieldValue;
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
if (doSearch) {
|
|
165
|
+
return criterias.map((item) => {
|
|
166
|
+
let formItemName = 'c_' + item.id;
|
|
167
|
+
let fieldValue = data ? data[formItemName] : undefined;
|
|
168
|
+
if (!hiddenCriteriaIds.includes(item.id)) {
|
|
169
|
+
return <FormItem label={item.title} name={formItemName} key={item.id}
|
|
170
|
+
tooltip={item.tip}
|
|
171
|
+
rules={item.required ? [{
|
|
172
|
+
required: true, message: `请选择${item.title}`,
|
|
173
|
+
}] : undefined}>
|
|
174
|
+
<EntryControl value={fieldValue} fieldConfig={item} />
|
|
175
|
+
</FormItem>
|
|
176
|
+
}
|
|
177
|
+
})
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
return (
|
|
182
|
+
<AntdForm form={form} name="control-hooks" initialValues={initialValues} layout="inline"
|
|
183
|
+
onFinish={searchSubmit} style={{width: '100%'}}>
|
|
184
|
+
{buttons.includes("drilling") && visible && (drillingParams.length>0 || hasDimension())?
|
|
185
|
+
<Collapse style={{width: '100%'}} defaultActiveKey={['1']}>
|
|
186
|
+
<Panel header="设置-数据上钻" key="1">
|
|
187
|
+
<Row>
|
|
188
|
+
<Col>
|
|
189
|
+
<Space size={'small'} wrap>
|
|
190
|
+
{renderCriteria(drillingParams)}
|
|
191
|
+
{renderDrillDimension()}
|
|
192
|
+
</Space>
|
|
193
|
+
</Col>
|
|
194
|
+
</Row>
|
|
195
|
+
</Panel>
|
|
196
|
+
</Collapse> : ""}
|
|
197
|
+
<Card
|
|
198
|
+
className="hoverable"
|
|
199
|
+
style={{display: visible ? "block" : "none", width: '100%'}}
|
|
200
|
+
headStyle={{background: "#f2f4f5"}}
|
|
201
|
+
loading={loading}>
|
|
202
|
+
<Row >
|
|
203
|
+
<Col>
|
|
204
|
+
<Space size={'small'} wrap>
|
|
205
|
+
{renderCriteria(criterias)}
|
|
206
|
+
<Space className="btns">
|
|
207
|
+
{showQueryButton ?
|
|
208
|
+
<Button type="primary" htmlType="submit">
|
|
209
|
+
查询
|
|
210
|
+
</Button> : ""}
|
|
211
|
+
{showDeleteButton ?
|
|
212
|
+
<Popconfirm
|
|
213
|
+
placement="rightBottom"
|
|
214
|
+
title={'确定要【删除】选中数据吗?'}
|
|
215
|
+
onConfirm={() => {
|
|
216
|
+
doDelete()
|
|
217
|
+
}}
|
|
218
|
+
okText="确定"
|
|
219
|
+
cancelText="取消"
|
|
220
|
+
okType={"danger"}
|
|
221
|
+
>
|
|
222
|
+
<Button danger disabled={deleteButtonDisabled}>删除选中</Button>
|
|
223
|
+
</Popconfirm>
|
|
224
|
+
: ""}
|
|
225
|
+
{renderAction()}
|
|
226
|
+
{renderJump()}
|
|
227
|
+
{renderCQuery()}
|
|
228
|
+
</Space>
|
|
229
|
+
</Space>
|
|
230
|
+
</Col>
|
|
231
|
+
</Row>
|
|
232
|
+
</Card>
|
|
233
|
+
</AntdForm>
|
|
234
|
+
);
|
|
235
|
+
}
|
|
236
|
+
CriteriaForm.defaultProps = {
|
|
237
|
+
hiddenCriteriaIds: [],
|
|
238
|
+
visible: true,
|
|
239
|
+
}
|
|
240
|
+
export default CriteriaForm;
|
|
241
|
+
|