@jiangood/open-admin 3.0.11 → 3.0.13
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/package.json +3 -2
- package/src/framework/components/DownloadModal/index.tsx +1 -2
- package/src/framework/components/ProTable/index.tsx +3 -1
- package/src/framework/fields/FieldEditor/index.tsx +56 -10
- package/src/framework/fields/FieldUploadFile/index.tsx +7 -24
- package/src/framework/fields/FieldUploadImage/index.tsx +595 -0
- package/src/framework/fields/index.ts +1 -0
- package/src/framework/views/ViewImage/index.tsx +56 -46
- package/src/layouts/admin/index.less +1 -1
- package/src/layouts/index.tsx +1 -0
- package/src/pages/article/$code.jsx +20 -6
- package/src/pages/article/article.less +124 -0
- package/src/pages/system/article/index.jsx +14 -24
- package/src/pages/system/file/index.jsx +101 -55
- package/src/pages/system/job/index.jsx +16 -16
- package/src/pages/userCenter/index.jsx +1 -9
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
Tag
|
|
14
14
|
} from 'antd'
|
|
15
15
|
import {PlusOutlined} from "@ant-design/icons";
|
|
16
|
-
import {FormModal, HttpUtils, Page, PermActions, ProTable,
|
|
16
|
+
import {FormModal, HttpUtils, Page, PermActions, ProTable, UrlUtils, ValueType} from "../../../framework";
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
const cronOptions = [
|
|
@@ -61,7 +61,7 @@ export default class extends React.Component {
|
|
|
61
61
|
HttpUtils.get('admin/job/job-class-options').then(rs => {
|
|
62
62
|
this.setState({jobClassOptions: rs})
|
|
63
63
|
}).catch(e => {
|
|
64
|
-
console.error('[Job]
|
|
64
|
+
console.error('[Job] 加载任务类选项失败:', e);
|
|
65
65
|
})
|
|
66
66
|
}
|
|
67
67
|
|
|
@@ -79,7 +79,7 @@ export default class extends React.Component {
|
|
|
79
79
|
HttpUtils.post("admin/job/get-job-param-fields", jobData || {}, {className}).then(rs => {
|
|
80
80
|
this.setState({paramList: rs})
|
|
81
81
|
}).catch(e => {
|
|
82
|
-
console.error('[Job]
|
|
82
|
+
console.error('[Job] 加载任务参数字段失败:', e);
|
|
83
83
|
})
|
|
84
84
|
}
|
|
85
85
|
|
|
@@ -91,12 +91,12 @@ export default class extends React.Component {
|
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
handleDelete = row => {
|
|
94
|
-
const hide = message.loading("
|
|
94
|
+
const hide = message.loading("删除任务中...")
|
|
95
95
|
HttpUtils.post('admin/job/delete', {id: row.id}).then(rs => {
|
|
96
96
|
hide();
|
|
97
97
|
this.tableRef.current.reload();
|
|
98
98
|
}).catch(e => {
|
|
99
|
-
console.error('[Job]
|
|
99
|
+
console.error('[Job] 删除任务失败:', e);
|
|
100
100
|
hide();
|
|
101
101
|
})
|
|
102
102
|
}
|
|
@@ -105,7 +105,7 @@ export default class extends React.Component {
|
|
|
105
105
|
HttpUtils.post('admin/job/trigger-job', {id: row.id}).then(rs => {
|
|
106
106
|
this.tableRef.current.reload();
|
|
107
107
|
}).catch(e => {
|
|
108
|
-
console.error('[Job]
|
|
108
|
+
console.error('[Job] 触发任务失败:', e);
|
|
109
109
|
})
|
|
110
110
|
}
|
|
111
111
|
|
|
@@ -117,8 +117,7 @@ export default class extends React.Component {
|
|
|
117
117
|
},
|
|
118
118
|
{
|
|
119
119
|
title: '执行类',
|
|
120
|
-
dataIndex: '
|
|
121
|
-
|
|
120
|
+
dataIndex: 'jobClassName',
|
|
122
121
|
},
|
|
123
122
|
|
|
124
123
|
{
|
|
@@ -181,7 +180,7 @@ export default class extends React.Component {
|
|
|
181
180
|
|
|
182
181
|
|
|
183
182
|
render() {
|
|
184
|
-
return <Page
|
|
183
|
+
return <Page>
|
|
185
184
|
<ProTable
|
|
186
185
|
actionRef={this.tableRef}
|
|
187
186
|
toolBarRender={() => (
|
|
@@ -205,11 +204,11 @@ export default class extends React.Component {
|
|
|
205
204
|
/>
|
|
206
205
|
|
|
207
206
|
|
|
208
|
-
<FormModal ref={this.modalRef} title='
|
|
207
|
+
<FormModal ref={this.modalRef} title='定时任务' width={800}
|
|
209
208
|
onFinish={this.onFinish}
|
|
210
209
|
onValuesChange={this.onValuesChange}>
|
|
211
210
|
<Form.Item label='执行类' name='jobClass' rules={[{required: true}]}
|
|
212
|
-
tooltip='
|
|
211
|
+
tooltip='继承 BaseJob,参考 HelloWorldJob'>
|
|
213
212
|
<Select options={this.state.jobClassOptions}/>
|
|
214
213
|
</Form.Item>
|
|
215
214
|
<Form.Item label='名称' name='name' rules={[{required: true}]}>
|
|
@@ -227,7 +226,7 @@ export default class extends React.Component {
|
|
|
227
226
|
|
|
228
227
|
{this.state.paramList?.map(p => (
|
|
229
228
|
<div key={p.name}>
|
|
230
|
-
<Divider
|
|
229
|
+
<Divider>任务参数</Divider>
|
|
231
230
|
<Form.Item label={p.label}
|
|
232
231
|
name={['jobData', p.name]}
|
|
233
232
|
key={p.name}
|
|
@@ -242,7 +241,7 @@ export default class extends React.Component {
|
|
|
242
241
|
))}
|
|
243
242
|
</FormModal>
|
|
244
243
|
|
|
245
|
-
<Modal title='
|
|
244
|
+
<Modal title='定时任务状态'
|
|
246
245
|
open={this.state.statusOpen}
|
|
247
246
|
onCancel={() => this.setState({statusOpen: false})}
|
|
248
247
|
footer={null}
|
|
@@ -252,7 +251,7 @@ export default class extends React.Component {
|
|
|
252
251
|
|
|
253
252
|
</Modal>
|
|
254
253
|
|
|
255
|
-
<Modal title='
|
|
254
|
+
<Modal title='定时任务记录'
|
|
256
255
|
open={this.state.executeRecordOpen}
|
|
257
256
|
onCancel={() => this.setState({executeRecordOpen: false})}
|
|
258
257
|
footer={null}
|
|
@@ -311,8 +310,9 @@ export default class extends React.Component {
|
|
|
311
310
|
const option = this.state.jobClassOptions.find(o => o.value === changed.jobClass)
|
|
312
311
|
if (option) {
|
|
313
312
|
const {label} = option;
|
|
314
|
-
|
|
315
|
-
|
|
313
|
+
const match = label.match(/[((](.*?)[))]/);
|
|
314
|
+
if (match) { // 取括号内中文描述设置为name
|
|
315
|
+
this.modalRef.current.formInstance.setFieldValue("name", match[1])
|
|
316
316
|
}
|
|
317
317
|
}
|
|
318
318
|
}
|
|
@@ -26,15 +26,7 @@ export default class extends React.Component {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
pwdValidator = (rule, value) => {
|
|
29
|
-
return
|
|
30
|
-
HttpUtils.get("admin/sysUser/pwd-strength", {password: value}, {showError: false}).then(response => {
|
|
31
|
-
const rs = response.data
|
|
32
|
-
if (!rs.success) {
|
|
33
|
-
reject(rs.message)
|
|
34
|
-
}
|
|
35
|
-
resolve()
|
|
36
|
-
})
|
|
37
|
-
})
|
|
29
|
+
return HttpUtils.get("admin/sysUser/pwd-strength", {password: value}, {showError: false})
|
|
38
30
|
}
|
|
39
31
|
|
|
40
32
|
render() {
|