aldehyde 0.2.76 → 0.2.78
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/utils.js +1 -1
- package/lib/controls/action/utils.js.map +1 -1
- package/lib/controls/entity-select/popover-entity-select.d.ts +2 -0
- package/lib/controls/entity-select/popover-entity-select.d.ts.map +1 -1
- package/lib/controls/entity-select/popover-entity-select.js +31 -14
- package/lib/controls/entity-select/popover-entity-select.js.map +1 -1
- package/lib/controls/rfield/index.js +1 -1
- package/lib/detail/view/field-view-group.d.ts.map +1 -1
- package/lib/detail/view/field-view-group.js +0 -15
- package/lib/detail/view/field-view-group.js.map +1 -1
- package/lib/form/criteria-form.js +1 -1
- package/lib/form/criteria-form.js.map +1 -1
- package/lib/import/excel-import.d.ts +1 -0
- package/lib/import/excel-import.d.ts.map +1 -1
- package/lib/import/excel-import.js +66 -47
- package/lib/import/excel-import.js.map +1 -1
- package/lib/table/act-table.js +1 -1
- package/lib/table/act-table.js.map +1 -1
- package/lib/table/modal-select-table.d.ts.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 +2 -1
- package/lib/table/query-table.d.ts.map +1 -1
- package/lib/table/query-table.js +10 -8
- package/lib/table/query-table.js.map +1 -1
- package/lib/table/select-table.d.ts.map +1 -1
- package/lib/table/select-table.js +1 -1
- 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 -1
- package/lib/tmpl/hcservice-v3.js.map +1 -1
- package/lib/tmpl/interface.d.ts +2 -1
- package/lib/tmpl/interface.d.ts.map +1 -1
- package/lib/tmpl/interface.js.map +1 -1
- package/lib/tmpl/model-struc-v3.d.ts.map +1 -1
- package/lib/tmpl/model-struc-v3.js +6 -2
- package/lib/tmpl/model-struc-v3.js.map +1 -1
- package/lib/tmpl/superagent.d.ts.map +1 -1
- package/lib/tmpl/superagent.js +3 -1
- package/lib/tmpl/superagent.js.map +1 -1
- package/lib/tree/act-tree.js +2 -2
- package/lib/tree/tmpl-tree.d.ts.map +1 -1
- package/lib/tree/tmpl-tree.js +2 -5
- package/lib/tree/tmpl-tree.js.map +1 -1
- package/lib/welcome/HCWelcome.js +2 -1
- package/lib/welcome/HCWelcome.js.map +1 -1
- package/package.json +1 -1
- package/src/aldehyde/controls/action/utils.tsx +1 -1
- package/src/aldehyde/controls/entity-select/popover-entity-select.tsx +31 -11
- package/src/aldehyde/controls/rfield/index.tsx +1 -1
- package/src/aldehyde/detail/view/field-view-group.tsx +0 -15
- package/src/aldehyde/form/criteria-form.tsx +1 -1
- package/src/aldehyde/import/excel-import.tsx +204 -166
- package/src/aldehyde/table/act-table.tsx +1 -1
- package/src/aldehyde/table/modal-select-table.tsx +3 -1
- package/src/aldehyde/table/query-table.tsx +12 -9
- package/src/aldehyde/table/select-table.tsx +3 -1
- package/src/aldehyde/tmpl/hcservice-v3.tsx +3 -1
- package/src/aldehyde/tmpl/interface.tsx +2 -1
- package/src/aldehyde/tmpl/model-struc-v3.tsx +7 -2
- package/src/aldehyde/tmpl/superagent.js +3 -1
- package/src/aldehyde/tree/act-tree.tsx +2 -2
- package/src/aldehyde/tree/tmpl-tree.tsx +4 -5
- package/src/aldehyde/welcome/HCWelcome.js +1 -1
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import {
|
|
3
|
+
Button,
|
|
4
|
+
Card,
|
|
5
|
+
Checkbox,
|
|
6
|
+
Col,
|
|
7
|
+
InputNumber,
|
|
8
|
+
List,
|
|
9
|
+
message,
|
|
10
|
+
Popover,
|
|
11
|
+
Progress,
|
|
12
|
+
Row,
|
|
13
|
+
Space,
|
|
14
|
+
Typography,
|
|
15
|
+
Upload
|
|
16
|
+
} from 'antd'
|
|
17
|
+
import {DownloadOutlined, ReloadOutlined, SettingOutlined, UploadOutlined} from '@ant-design/icons';
|
|
4
18
|
import Super from "../tmpl/superagent"
|
|
5
19
|
import Units from "../units"
|
|
6
20
|
import './index.css'
|
|
@@ -8,168 +22,180 @@ import {LtmplConfig} from "../tmpl/interface";
|
|
|
8
22
|
import HCDataSource from "../tmpl/hc-data-source";
|
|
9
23
|
|
|
10
24
|
const CheckboxGroup = Checkbox.Group;
|
|
11
|
-
const logLevelList: LogLevel[]= ['INFO', 'SUC', 'ERROR', 'WARN'];
|
|
12
|
-
let totalMSG=[]
|
|
13
|
-
type LogLevel = 'INFO'| 'SUC'|'ERROR'|'WARN';
|
|
14
|
-
type ImportStatus = 'waitingFile'| 'fileSelected' |'importing' | 'success'|'fail' |'stop';
|
|
15
|
-
const {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
25
|
+
const logLevelList: LogLevel[] = ['INFO', 'SUC', 'ERROR', 'WARN'];
|
|
26
|
+
let totalMSG = []
|
|
27
|
+
type LogLevel = 'INFO' | 'SUC' | 'ERROR' | 'WARN';
|
|
28
|
+
type ImportStatus = 'waitingFile' | 'fileSelected' | 'importing' | 'success' | 'fail' | 'stop';
|
|
29
|
+
const {Text} = Typography;
|
|
30
|
+
|
|
31
|
+
interface ExcelImportProps {
|
|
32
|
+
serverKey?: string,
|
|
33
|
+
sourceId: string,
|
|
19
34
|
};
|
|
20
35
|
|
|
21
36
|
interface ExcelImportStat {
|
|
22
|
-
inputMaxMsgCount?:number;
|
|
23
|
-
maxMsgCount?:number;
|
|
24
|
-
percent?:number;
|
|
25
|
-
statusMsg?:string;
|
|
26
|
-
importStatus?:string,
|
|
37
|
+
inputMaxMsgCount?: number;
|
|
38
|
+
maxMsgCount?: number;
|
|
39
|
+
percent?: number;
|
|
40
|
+
statusMsg?: string;
|
|
41
|
+
importStatus?: string,
|
|
27
42
|
showLogLevelList?: LogLevel[],
|
|
28
|
-
logSetterOpen?:boolean,
|
|
29
|
-
logs?:any[];
|
|
30
|
-
importFile?:any,
|
|
31
|
-
logSerialId?:string,
|
|
32
|
-
ltmplConfig?:LtmplConfig;
|
|
43
|
+
logSetterOpen?: boolean,
|
|
44
|
+
logs?: any[];
|
|
45
|
+
importFile?: any,
|
|
46
|
+
logSerialId?: string,
|
|
47
|
+
ltmplConfig?: LtmplConfig;
|
|
33
48
|
};
|
|
34
49
|
|
|
35
|
-
export default class ExcelImport extends React.PureComponent<ExcelImportProps, ExcelImportStat>{
|
|
50
|
+
export default class ExcelImport extends React.PureComponent<ExcelImportProps, ExcelImportStat> {
|
|
36
51
|
|
|
37
52
|
state = {
|
|
38
|
-
maxMsgCount:100,
|
|
39
|
-
inputMaxMsgCount:100,
|
|
40
|
-
importStatus:'waitingFile',
|
|
41
|
-
importFile:undefined,
|
|
42
|
-
logs:[],
|
|
43
|
-
percent:0,
|
|
44
|
-
statusMsg:undefined,
|
|
45
|
-
logSetterOpen:false,
|
|
46
|
-
showLogLevelList:[...logLevelList],
|
|
47
|
-
logSerialId:undefined,
|
|
48
|
-
ltmplConfig:undefined,
|
|
53
|
+
maxMsgCount: 100,
|
|
54
|
+
inputMaxMsgCount: 100,
|
|
55
|
+
importStatus: 'waitingFile',
|
|
56
|
+
importFile: undefined,
|
|
57
|
+
logs: [],
|
|
58
|
+
percent: 0,
|
|
59
|
+
statusMsg: undefined,
|
|
60
|
+
logSetterOpen: false,
|
|
61
|
+
showLogLevelList: [...logLevelList],
|
|
62
|
+
logSerialId: undefined,
|
|
63
|
+
ltmplConfig: undefined,
|
|
49
64
|
}
|
|
50
65
|
|
|
51
|
-
timerId=undefined;
|
|
66
|
+
timerId = undefined;
|
|
52
67
|
|
|
53
|
-
|
|
54
|
-
|
|
68
|
+
async componentDidMount() {
|
|
69
|
+
const {sourceId, serverKey} = this.props;
|
|
55
70
|
|
|
56
|
-
let ltmplConfigRes = await HCDataSource.requestLtmplConfig(serverKey,sourceId);
|
|
71
|
+
let ltmplConfigRes = await HCDataSource.requestLtmplConfig(serverKey, sourceId);
|
|
57
72
|
|
|
58
73
|
this.setState({
|
|
59
|
-
ltmplConfig:ltmplConfigRes.ltmplConfig,
|
|
74
|
+
ltmplConfig: ltmplConfigRes.ltmplConfig,
|
|
60
75
|
})
|
|
61
76
|
|
|
62
77
|
}
|
|
63
|
-
|
|
64
|
-
|
|
78
|
+
|
|
79
|
+
componentWillUnmount() {
|
|
80
|
+
if (this.timerId) {
|
|
65
81
|
clearInterval(this.timerId);
|
|
66
82
|
}
|
|
67
83
|
}
|
|
68
84
|
|
|
69
85
|
|
|
70
|
-
|
|
71
86
|
handleUpload = () => {
|
|
72
|
-
const {sourceId,serverKey}=this.props;
|
|
73
|
-
const {
|
|
87
|
+
const {sourceId, serverKey} = this.props;
|
|
88
|
+
const {importFile} = this.state;
|
|
74
89
|
const formData = new FormData();
|
|
75
90
|
formData.append('file', importFile);
|
|
76
91
|
formData.append('sourceId', sourceId.toString());
|
|
77
92
|
|
|
78
93
|
Super.super({
|
|
79
|
-
url
|
|
94
|
+
url: `/v3/ltmpl/importer`,
|
|
80
95
|
serverKey,
|
|
81
|
-
method:'POST',
|
|
82
|
-
data:formData,
|
|
83
|
-
|
|
96
|
+
method: 'POST',
|
|
97
|
+
data: formData,
|
|
98
|
+
}, "formdata").then((res) => {
|
|
84
99
|
//console.log(res)
|
|
85
|
-
if(res.status==="success"){
|
|
100
|
+
if (res.status === "success") {
|
|
86
101
|
this.setState({
|
|
87
102
|
importStatus: 'importing',
|
|
88
103
|
});
|
|
89
|
-
|
|
90
|
-
}else{
|
|
104
|
+
this.timerId = setInterval(() => this.handleStatus(res.importId), 500);
|
|
105
|
+
} else {
|
|
91
106
|
message.error('失败!');
|
|
92
107
|
this.setState({
|
|
93
108
|
importStatus: 'fail',
|
|
94
|
-
});
|
|
109
|
+
});
|
|
95
110
|
}
|
|
96
|
-
|
|
97
|
-
|
|
111
|
+
})
|
|
112
|
+
}
|
|
98
113
|
|
|
99
|
-
handleStopImport=()=>{
|
|
114
|
+
handleStopImport = () => {
|
|
100
115
|
this.setState({
|
|
101
116
|
importStatus: 'stop',
|
|
102
117
|
});
|
|
103
118
|
}
|
|
104
119
|
|
|
105
|
-
handleStatus=(importId)=>{
|
|
106
|
-
|
|
107
|
-
const {maxMsgCount,importStatus}=this.state
|
|
120
|
+
handleStatus = (importId) => {
|
|
121
|
+
const {serverKey} = this.props;
|
|
122
|
+
const {maxMsgCount, importStatus, logs} = this.state
|
|
108
123
|
Super.super({
|
|
109
|
-
url
|
|
124
|
+
url: `/v3/importer/status`,
|
|
110
125
|
serverKey,
|
|
111
|
-
method:'GET',
|
|
112
|
-
query:{
|
|
113
|
-
importId:importId,
|
|
114
|
-
msgIndex:0,
|
|
126
|
+
method: 'GET',
|
|
127
|
+
query: {
|
|
128
|
+
importId: importId,
|
|
129
|
+
msgIndex: 0,
|
|
115
130
|
maxMsgCount,
|
|
116
|
-
interrupted: importStatus=='stop',
|
|
117
|
-
}
|
|
118
|
-
},"","none").then((res)=>{
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
131
|
+
interrupted: importStatus == 'stop',
|
|
132
|
+
}
|
|
133
|
+
}, "", "none").then((res) => {
|
|
134
|
+
const MSG = []
|
|
135
|
+
if (res.status === 'error') {
|
|
136
|
+
clearInterval(this.timerId);
|
|
137
|
+
} else {
|
|
138
|
+
if (res.messageSequence.messages) {
|
|
139
|
+
for (let item of res.messageSequence.messages) {
|
|
140
|
+
let color = "";
|
|
141
|
+
let logLevel = "";
|
|
142
|
+
let createTime = Units.formateDate(item.createTime);
|
|
143
|
+
if (item.type === "SUC") {
|
|
144
|
+
color = "green"
|
|
145
|
+
logLevel = '成功';
|
|
146
|
+
} else if (item.type === "INFO") {
|
|
147
|
+
color = "black"
|
|
148
|
+
logLevel = '常规';
|
|
149
|
+
} else if (item.type === "ERROR") {
|
|
150
|
+
color = "red"
|
|
151
|
+
logLevel = '错误';
|
|
152
|
+
} else if (item.type === "WARN") {
|
|
153
|
+
color = "rgb(250, 225, 4)"
|
|
154
|
+
logLevel = '警告';
|
|
155
|
+
}
|
|
156
|
+
const msg = <div><p>{createTime}</p><p style={{color: color}}>{`【${logLevel}】` + item.text}</p>
|
|
157
|
+
</div>
|
|
158
|
+
MSG.push({level: item.type, msg});
|
|
159
|
+
}
|
|
140
160
|
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
})
|
|
149
|
-
if (res.completed === true) {
|
|
150
|
-
if(this.timerId){
|
|
161
|
+
// if(){
|
|
162
|
+
//
|
|
163
|
+
// }
|
|
164
|
+
//
|
|
165
|
+
let percent = Math.floor((res.current / res.totalCount) * 100);
|
|
166
|
+
if (res.completed == true) {
|
|
167
|
+
if (this.timerId) {
|
|
151
168
|
clearInterval(this.timerId);
|
|
152
|
-
this.timerId=undefined;
|
|
169
|
+
this.timerId = undefined;
|
|
153
170
|
message.success('导入完成!');
|
|
154
171
|
this.setState({
|
|
155
|
-
|
|
172
|
+
|
|
156
173
|
});
|
|
157
174
|
}
|
|
175
|
+
percent = 100;
|
|
158
176
|
}
|
|
159
177
|
if (importStatus == 'stop') {
|
|
160
178
|
clearInterval(this.timerId);
|
|
161
179
|
}
|
|
180
|
+
let loggs=[...logs, ...MSG];
|
|
181
|
+
loggs=loggs.length>maxMsgCount?loggs.slice(logs.length-maxMsgCount):loggs;
|
|
182
|
+
this.setState({
|
|
183
|
+
statusMsg: res.message,
|
|
184
|
+
percent,
|
|
185
|
+
importStatus: percent==100?'success':'importing',
|
|
186
|
+
logs: loggs,
|
|
187
|
+
})
|
|
162
188
|
}
|
|
163
189
|
}
|
|
164
|
-
|
|
165
|
-
}
|
|
190
|
+
)
|
|
191
|
+
}
|
|
166
192
|
onChangeShowLogLevelList = (showLogLevelList) => { //日志checkbox选择
|
|
167
193
|
this.setState({
|
|
168
194
|
showLogLevelList,
|
|
169
195
|
});
|
|
170
196
|
}
|
|
171
197
|
|
|
172
|
-
fresh=()=>{
|
|
198
|
+
fresh = () => {
|
|
173
199
|
// this.setState({
|
|
174
200
|
// fileList:[],
|
|
175
201
|
// uploading: false,
|
|
@@ -183,140 +209,152 @@ export default class ExcelImport extends React.PureComponent<ExcelImportProps, E
|
|
|
183
209
|
// message.success("刷新成功!")
|
|
184
210
|
}
|
|
185
211
|
|
|
186
|
-
handleLogSetter=()=>{
|
|
187
|
-
const {inputMaxMsgCount}=this.state
|
|
212
|
+
handleLogSetter = () => {
|
|
213
|
+
const {inputMaxMsgCount} = this.state
|
|
188
214
|
this.setState({
|
|
189
|
-
maxMsgCount:inputMaxMsgCount,
|
|
190
|
-
logSetterOpen:false,
|
|
215
|
+
maxMsgCount: inputMaxMsgCount,
|
|
216
|
+
logSetterOpen: false,
|
|
191
217
|
})
|
|
192
218
|
message.success("设置成功!")
|
|
193
219
|
}
|
|
194
220
|
changeLogSetterOpen = open => {
|
|
195
|
-
this.setState({
|
|
196
|
-
|
|
197
|
-
|
|
221
|
+
this.setState({logSetterOpen: open});
|
|
222
|
+
};
|
|
223
|
+
download = () => {
|
|
224
|
+
const {sourceId, serverKey} = this.props;
|
|
225
|
+
const hydrocarbonToken = Units.hydrocarbonToken();
|
|
226
|
+
Units.downloadFile(Units.joinPath(Units.api(serverKey), `/v3/ltmpl/importer/template?sourceId=${sourceId}&@token=${hydrocarbonToken}&@programToken=${Units.programCode(serverKey)}`), "导入模板")
|
|
227
|
+
}
|
|
198
228
|
|
|
199
|
-
render(){
|
|
200
|
-
const {
|
|
229
|
+
render() {
|
|
230
|
+
const {ltmplConfig, importFile, maxMsgCount, percent, importStatus, showLogLevelList, logSetterOpen, logs} = this.state;
|
|
201
231
|
|
|
202
|
-
let showLogs=[];
|
|
232
|
+
let showLogs = [];
|
|
203
233
|
|
|
204
|
-
for(let log of logs){
|
|
205
|
-
if(showLogLevelList.includes(log.level)
|
|
234
|
+
for (let log of logs) {
|
|
235
|
+
if (showLogLevelList.includes(log.level)) {
|
|
206
236
|
showLogs.push(log.msg);
|
|
207
237
|
}
|
|
208
238
|
}
|
|
209
239
|
|
|
210
240
|
const props = {
|
|
211
|
-
accept:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel,application/vnd.ms-excel",
|
|
212
|
-
onChange
|
|
241
|
+
accept: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel,application/vnd.ms-excel",
|
|
242
|
+
onChange: () => {
|
|
213
243
|
|
|
214
244
|
},
|
|
215
|
-
onRemove
|
|
245
|
+
onRemove: (file) => {
|
|
216
246
|
this.setState({
|
|
217
|
-
|
|
218
|
-
importStatus:'waitingFile',
|
|
219
|
-
|
|
220
|
-
|
|
247
|
+
importFile: undefined,
|
|
248
|
+
importStatus: 'waitingFile',
|
|
249
|
+
percent: 0,
|
|
250
|
+
});
|
|
221
251
|
},
|
|
222
252
|
beforeUpload: (file) => {
|
|
223
253
|
this.setState({
|
|
224
|
-
percent:0,
|
|
254
|
+
percent: 0,
|
|
225
255
|
importFile: file,
|
|
226
|
-
importStatus:'fileSelected',
|
|
227
|
-
|
|
228
|
-
|
|
256
|
+
importStatus: 'fileSelected',
|
|
257
|
+
});
|
|
258
|
+
return false;
|
|
229
259
|
},
|
|
230
|
-
fileList:importFile?[importFile]:undefined,
|
|
260
|
+
fileList: importFile ? [importFile] : undefined,
|
|
231
261
|
}
|
|
232
|
-
const content=(
|
|
262
|
+
const content = (
|
|
233
263
|
<div>
|
|
234
264
|
<label>日志消息数上限:</label>
|
|
235
|
-
<InputNumber
|
|
236
|
-
defaultValue={maxMsgCount}
|
|
237
|
-
onChange={(value)=>this.setState({inputMaxMsgCount:value})}
|
|
238
|
-
|
|
239
|
-
<Button
|
|
240
|
-
type="primary"
|
|
241
|
-
style={{marginLeft:'10px'}}
|
|
265
|
+
<InputNumber
|
|
266
|
+
defaultValue={maxMsgCount}
|
|
267
|
+
onChange={(value) => this.setState({inputMaxMsgCount: value})}
|
|
268
|
+
/>
|
|
269
|
+
<Button
|
|
270
|
+
type="primary"
|
|
271
|
+
style={{marginLeft: '10px'}}
|
|
242
272
|
onClick={this.handleLogSetter}
|
|
243
|
-
|
|
273
|
+
>确定</Button>
|
|
244
274
|
</div>
|
|
245
275
|
)
|
|
246
|
-
return(
|
|
276
|
+
return (
|
|
247
277
|
<div className="importData">
|
|
248
278
|
<h3>
|
|
249
|
-
{'导入 -> '}{
|
|
250
|
-
<p className="fr">
|
|
251
|
-
<Button
|
|
279
|
+
{'导入 -> '}{ltmplConfig ? ltmplConfig.title : ""}
|
|
280
|
+
<p className="fr">
|
|
281
|
+
<Button
|
|
252
282
|
className="hoverbig"
|
|
253
283
|
title="刷新"
|
|
254
284
|
onClick={this.fresh}>
|
|
255
|
-
<ReloadOutlined
|
|
285
|
+
<ReloadOutlined/>
|
|
256
286
|
</Button>
|
|
257
287
|
</p>
|
|
258
|
-
</h3>
|
|
288
|
+
</h3>
|
|
259
289
|
<Row>
|
|
260
290
|
<Col span={14} offset={5}>
|
|
261
|
-
<Card size={'small'} style={{minWidth:600}}>
|
|
262
|
-
<
|
|
263
|
-
<
|
|
264
|
-
<
|
|
291
|
+
<Card size={'small'} style={{minWidth: 600}}>
|
|
292
|
+
<Space>
|
|
293
|
+
<Upload {...props}>
|
|
294
|
+
<Button type={'primary'}>
|
|
295
|
+
<UploadOutlined/>选择导入文件
|
|
296
|
+
</Button>
|
|
297
|
+
</Upload>
|
|
298
|
+
<Button onClick={this.download}>
|
|
299
|
+
<DownloadOutlined/>下载导入模板
|
|
265
300
|
</Button>
|
|
266
|
-
</
|
|
267
|
-
|
|
301
|
+
</Space>
|
|
302
|
+
|
|
303
|
+
<Progress percent={percent} size="small" status="active"/>
|
|
268
304
|
<div className="importBtns">
|
|
305
|
+
<Space>
|
|
269
306
|
<Button
|
|
270
307
|
type="primary"
|
|
271
308
|
onClick={this.handleUpload}
|
|
272
|
-
disabled={!(['fileSelected','stop'].includes(importStatus))}
|
|
273
|
-
loading={importStatus=='importing'}
|
|
274
|
-
|
|
275
|
-
{importStatus=='importing' ? '正在导入' : importStatus=='stop'?'重新导入':'开始导入'
|
|
309
|
+
disabled={!(['fileSelected', 'stop'].includes(importStatus))}
|
|
310
|
+
loading={importStatus == 'importing'}
|
|
311
|
+
>
|
|
312
|
+
{importStatus == 'importing' ? '正在导入' : importStatus == 'stop' ? '重新导入' : '开始导入'}
|
|
276
313
|
</Button>
|
|
277
314
|
<Button
|
|
278
315
|
onClick={this.handleStopImport}
|
|
279
|
-
disabled={importStatus!='importing'}
|
|
316
|
+
disabled={importStatus != 'importing'}
|
|
280
317
|
>
|
|
281
318
|
{'停止导入'}
|
|
282
|
-
</Button>
|
|
283
|
-
|
|
284
|
-
</div>
|
|
319
|
+
</Button></Space>
|
|
320
|
+
</div>
|
|
285
321
|
<List
|
|
286
322
|
header={
|
|
287
323
|
<div className="listHeader">
|
|
288
324
|
<h4>导入日志</h4>
|
|
289
|
-
<div className="checks">
|
|
290
|
-
<CheckboxGroup value={showLogLevelList}
|
|
325
|
+
<div className="checks">
|
|
326
|
+
<CheckboxGroup value={showLogLevelList}
|
|
327
|
+
onChange={this.onChangeShowLogLevelList}>
|
|
291
328
|
<Checkbox value="INFO" className="infoColor">常规</Checkbox>
|
|
292
329
|
<Checkbox value="SUC" className="sucColor">成功</Checkbox>
|
|
293
|
-
<Checkbox value="ERROR"
|
|
294
|
-
<Checkbox value="WARN"
|
|
330
|
+
<Checkbox value="ERROR" className="errorColor">错误</Checkbox>
|
|
331
|
+
<Checkbox value="WARN" className="warnColor">警告</Checkbox>
|
|
295
332
|
</CheckboxGroup>
|
|
296
333
|
<div className="btns">
|
|
297
|
-
<Popover
|
|
298
|
-
content={content}
|
|
334
|
+
<Popover
|
|
335
|
+
content={content}
|
|
299
336
|
title="日志设置"
|
|
300
|
-
trigger="click"
|
|
301
|
-
placement="top"
|
|
337
|
+
trigger="click"
|
|
338
|
+
placement="top"
|
|
302
339
|
open={logSetterOpen}
|
|
303
|
-
overlayStyle={{width:350}}
|
|
340
|
+
overlayStyle={{width: 350}}
|
|
304
341
|
onOpenChange={this.changeLogSetterOpen}
|
|
305
|
-
|
|
342
|
+
>
|
|
306
343
|
<Button title="日志设置" type="primary" size="small">
|
|
307
|
-
<SettingOutlined
|
|
344
|
+
<SettingOutlined/>
|
|
308
345
|
</Button>
|
|
309
346
|
</Popover>
|
|
310
347
|
</div>
|
|
311
348
|
</div>
|
|
312
349
|
</div>
|
|
313
350
|
}
|
|
314
|
-
footer={<Text
|
|
351
|
+
footer={<Text
|
|
352
|
+
type={importStatus == "fail" || importStatus == "stop" ? "danger" : "success"}>{importStatus}</Text>}
|
|
315
353
|
bordered
|
|
316
354
|
dataSource={showLogs}
|
|
317
355
|
renderItem={item => (<List.Item>{item}</List.Item>)}
|
|
318
356
|
className="importList"
|
|
319
|
-
|
|
357
|
+
/>
|
|
320
358
|
</Card>
|
|
321
359
|
</Col>
|
|
322
360
|
</Row>
|
|
@@ -767,7 +767,7 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
767
767
|
{displayCriteriaCard ?
|
|
768
768
|
this.renderCriteriaForm() : null
|
|
769
769
|
}
|
|
770
|
-
{loading?"":<QueryTable serverKey={serverKey} onChangePage={onChangePage} viewModels={viewModels} columnConfigs={columnConfigs}
|
|
770
|
+
{loading?"":<QueryTable serverKey={serverKey} onChangePage={onChangePage} viewModels={viewModels} primaryColumn={ltmplConfig.primaryColumn} columnConfigs={columnConfigs}
|
|
771
771
|
maxSelectedRows={this.checkBoxUseful() ? 10000 : -1}
|
|
772
772
|
selectedRows={selectedRows}
|
|
773
773
|
columns={tableColumns}
|
|
@@ -246,7 +246,9 @@ class ModelSelectTable extends React.PureComponent<ModelSelectTableProps, ModelS
|
|
|
246
246
|
<div className="actTable">
|
|
247
247
|
<CriteriaForm serverKey={serverKey} selectedRows={selectedRows} ltmplConfig={selectConfig} data={criteriaData}
|
|
248
248
|
doSearch={this.doSearch} loading={loading} />
|
|
249
|
-
<QueryTable serverKey={serverKey} pageInfo={{pageNo:pageNo?pageNo:1,pageSize:pageSize?pageSize:selectConfig.defaultPageSize}} onChangePage={this.onChangePage} maxSelectedRows={maxSelectedRows} selectedRows={selectedRows}
|
|
249
|
+
<QueryTable serverKey={serverKey} pageInfo={{pageNo:pageNo?pageNo:1,pageSize:pageSize?pageSize:selectConfig.defaultPageSize}} onChangePage={this.onChangePage} maxSelectedRows={maxSelectedRows} selectedRows={selectedRows}
|
|
250
|
+
primaryColumn={selectConfig.primaryColumn}
|
|
251
|
+
columns={columns}
|
|
250
252
|
queryKey={queryKey}
|
|
251
253
|
onChangeRowSelection={this.changeRowSelection}/>
|
|
252
254
|
</div> </Scrollbars>
|
|
@@ -2,7 +2,7 @@ import React from 'react'
|
|
|
2
2
|
import {Card, Collapse, Descriptions, List, Table} from 'antd';
|
|
3
3
|
import "./index.css"
|
|
4
4
|
import {
|
|
5
|
-
ActTableViewModel,
|
|
5
|
+
ActTableViewModel, ColumnConfig,
|
|
6
6
|
DtmplData,
|
|
7
7
|
FieldConfig,
|
|
8
8
|
PageInfo,
|
|
@@ -34,6 +34,7 @@ interface QueryTableProps {
|
|
|
34
34
|
pageNo: number,
|
|
35
35
|
pageSize: number
|
|
36
36
|
},
|
|
37
|
+
primaryColumn?:ColumnConfig,
|
|
37
38
|
columns: any[];
|
|
38
39
|
serverKey?:string,
|
|
39
40
|
queryKey: QueryKey;
|
|
@@ -209,7 +210,7 @@ class QueryTable extends React.PureComponent<QueryTableProps, QueryTableStat> {
|
|
|
209
210
|
|
|
210
211
|
getRowSelection = () => {
|
|
211
212
|
|
|
212
|
-
const {columns, onChangeRowSelection, selectedRows, maxSelectedRows} = this.props;
|
|
213
|
+
const {columns, onChangeRowSelection, selectedRows, maxSelectedRows,primaryColumn} = this.props;
|
|
213
214
|
let {dataSource} = this.state;
|
|
214
215
|
let selectedRowKeys = [];
|
|
215
216
|
|
|
@@ -234,13 +235,15 @@ class QueryTable extends React.PureComponent<QueryTableProps, QueryTableStat> {
|
|
|
234
235
|
// console.log('selectedRows:', selectedRows);
|
|
235
236
|
let selectedRows_: SelectedRow[] = [];
|
|
236
237
|
let selectedDatas: DtmplData[] = [];
|
|
237
|
-
let titleColId =
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
titleColId
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
238
|
+
let titleColId =primaryColumn?.id;
|
|
239
|
+
if(!titleColId){
|
|
240
|
+
columns.forEach((col) => {
|
|
241
|
+
if (col.title != '序号' && titleColId == null) {
|
|
242
|
+
titleColId = col.dataIndex;
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
245
|
+
})
|
|
246
|
+
}
|
|
244
247
|
selectedRows.forEach((item) => {
|
|
245
248
|
selectedRows_.push({code: item['code'], title: item[titleColId]});
|
|
246
249
|
selectedDatas.push(item);
|
|
@@ -243,7 +243,9 @@ class SelectTable extends React.PureComponent<SelectTableProps, SelectTableStat>
|
|
|
243
243
|
<CriteriaForm serverKey={serverKey} selectedRows={selectedRows} selectedDatas={selectedDatas} ltmplConfig={selectConfig}
|
|
244
244
|
data={criteriaData}
|
|
245
245
|
doSearch={this.doSearch} loading={loading}/>
|
|
246
|
-
<QueryTable serverKey={serverKey} maxSelectedRows={maxSelectedRows} selectedRows={selectedRows}
|
|
246
|
+
<QueryTable serverKey={serverKey} maxSelectedRows={maxSelectedRows} selectedRows={selectedRows}
|
|
247
|
+
primaryColumn={selectConfig.primaryColumn}
|
|
248
|
+
columns={columns}
|
|
247
249
|
pageInfo={{pageNo,
|
|
248
250
|
pageSize: pageSize?pageSize:selectConfig.defaultPageSize}}
|
|
249
251
|
onChangePage={this.onChangePage}
|
|
@@ -183,7 +183,7 @@ export interface SelectConfig extends TmplBase {
|
|
|
183
183
|
columns: ColumnConfig[];
|
|
184
184
|
criterias: CriteriaConfig[];
|
|
185
185
|
defaultCriteriaValue?:object;
|
|
186
|
-
primaryColumn
|
|
186
|
+
primaryColumn?:ColumnConfig;
|
|
187
187
|
primaryCriteria:CriteriaConfig;
|
|
188
188
|
orderColumn:ColumnConfig;
|
|
189
189
|
}
|
|
@@ -213,6 +213,7 @@ export interface TtmplConfig extends TmplBase {
|
|
|
213
213
|
rootGtmplId:string,
|
|
214
214
|
branchRatmplId:string,
|
|
215
215
|
leafRatmplId:string,
|
|
216
|
+
showLine:boolean,
|
|
216
217
|
}
|
|
217
218
|
|
|
218
219
|
// export interface StatViewConfig extends SelectConfig {
|