@jiangood/springboot-admin-starter 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/config/config.js +10 -0
- package/config/config.local.js +10 -0
- package/config/defaultConfig.js +35 -0
- package/config/plugins/forms.js +44 -0
- package/config/plugins/routes.js +82 -0
- package/package.json +41 -0
- package/src/.npmignore +6 -0
- package/src/app.js +0 -0
- package/src/asserts/login_bg.jpg +0 -0
- package/src/asserts/welcome.png +0 -0
- package/src/components/InstanceInfo.jsx +138 -0
- package/src/components/InstanceStatusInfo.jsx +79 -0
- package/src/components/StreamLog.jsx +27 -0
- package/src/components/flow/BpmnUtils.js +85 -0
- package/src/components/flow/customTranslate/customTranslate.js +19 -0
- package/src/components/flow/customTranslate/translations.js +79 -0
- package/src/components/flow/design/contextPad.js +50 -0
- package/src/components/flow/design/form/ConditionForm.jsx +316 -0
- package/src/components/flow/design/form/ServiceTaskForm.jsx +55 -0
- package/src/components/flow/design/form/TimerEventDefinitionForm.jsx +62 -0
- package/src/components/flow/design/form/UserTaskForm.jsx +211 -0
- package/src/components/flow/design/palette.js +39 -0
- package/src/components/monitor/AllDefinition.jsx +46 -0
- package/src/components/monitor/AllInstance.jsx +76 -0
- package/src/forms/demoForm.jsx +16 -0
- package/src/framework/components/ButtonList.d.ts +9 -0
- package/src/framework/components/ButtonList.jsx +91 -0
- package/src/framework/components/DownloadFileButton.d.ts +11 -0
- package/src/framework/components/DownloadFileButton.jsx +33 -0
- package/src/framework/components/Echarts/index.d.ts +10 -0
- package/src/framework/components/Echarts/index.jsx +49 -0
- package/src/framework/components/EditTable/index.d.ts +11 -0
- package/src/framework/components/EditTable/index.jsx +85 -0
- package/src/framework/components/EditTable/index.less +29 -0
- package/src/framework/components/Ellipsis.jsx +39 -0
- package/src/framework/components/Ellipsis.less +8 -0
- package/src/framework/components/FieldRemoteTree.jsx +20 -0
- package/src/framework/components/Gap/index.d.ts +10 -0
- package/src/framework/components/Gap/index.jsx +15 -0
- package/src/framework/components/Gap/index.less +3 -0
- package/src/framework/components/HasPerm.jsx +18 -0
- package/src/framework/components/ImageView.d.ts +12 -0
- package/src/framework/components/ImageView.jsx +64 -0
- package/src/framework/components/LinkButton.d.ts +14 -0
- package/src/framework/components/LinkButton.jsx +13 -0
- package/src/framework/components/MsgBox.jsx +180 -0
- package/src/framework/components/NamedIcon.tsx +15 -0
- package/src/framework/components/OrgTree.jsx +60 -0
- package/src/framework/components/Page/index.d.ts +10 -0
- package/src/framework/components/Page/index.jsx +30 -0
- package/src/framework/components/Page/index.less +10 -0
- package/src/framework/components/PageLoading.jsx +31 -0
- package/src/framework/components/Panel/index.d.ts +11 -0
- package/src/framework/components/Panel/index.jsx +24 -0
- package/src/framework/components/Panel/index.less +0 -0
- package/src/framework/components/ProModal/index.tsx +66 -0
- package/src/framework/components/ProTable/components/ToolBar/index.jsx +124 -0
- package/src/framework/components/ProTable/components/ToolBar/index.less +53 -0
- package/src/framework/components/ProTable/index.d.ts +38 -0
- package/src/framework/components/ProTable/index.jsx +258 -0
- package/src/framework/components/ProTable/index.less +3 -0
- package/src/framework/components/ProTable/utils/index.js +43 -0
- package/src/framework/components/RoleTree.jsx +53 -0
- package/src/framework/components/ValueType/index.jsx +34 -0
- package/src/framework/components/ValueType/registry.jsx +38 -0
- package/src/framework/components/field/FieldAutoTime/index.tsx +46 -0
- package/src/framework/components/field/FieldBoolean/index.tsx +92 -0
- package/src/framework/components/field/FieldEditTable/index.d.ts +13 -0
- package/src/framework/components/field/FieldEditTable/index.jsx +103 -0
- package/src/framework/components/field/FieldEditTable/index.less +29 -0
- package/src/framework/components/field/FieldEditor.jsx +48 -0
- package/src/framework/components/field/FieldFileBase64/index.d.ts +15 -0
- package/src/framework/components/field/FieldFileBase64/index.jsx +23 -0
- package/src/framework/components/field/FieldImageBase64/index.d.ts +15 -0
- package/src/framework/components/field/FieldImageBase64/index.jsx +22 -0
- package/src/framework/components/field/FieldInput.jsx +13 -0
- package/src/framework/components/field/FieldOrgTree/index.tsx +45 -0
- package/src/framework/components/field/FieldPassword.jsx +11 -0
- package/src/framework/components/field/FieldProps.ts +19 -0
- package/src/framework/components/field/FieldRemoteTreeCascader.jsx +75 -0
- package/src/framework/components/field/FieldRemoteTreeCheckable.jsx +81 -0
- package/src/framework/components/field/FieldRemoteTreeMultipleSelect.jsx +100 -0
- package/src/framework/components/field/FieldRemoteTreeSelect.jsx +82 -0
- package/src/framework/components/field/FieldSelectPosition/index.tsx +85 -0
- package/src/framework/components/field/FieldTree.jsx +45 -0
- package/src/framework/components/field/dict/index.tsx +110 -0
- package/src/framework/components/field/flat-multiple-select/index.d.ts +4 -0
- package/src/framework/components/field/flat-multiple-select/index.jsx +116 -0
- package/src/framework/components/field/flat-multiple-select/index.less +12 -0
- package/src/framework/components/field/flat-select/index.d.ts +4 -0
- package/src/framework/components/field/flat-select/index.jsx +107 -0
- package/src/framework/components/field/flat-select/index.less +12 -0
- package/src/framework/components/field/index.js +33 -0
- package/src/framework/components/field/input-number-percent/index.d.ts +11 -0
- package/src/framework/components/field/input-number-percent/index.jsx +28 -0
- package/src/framework/components/field/select/FieldSelect/index.d.ts +39 -0
- package/src/framework/components/field/select/FieldSelect/index.jsx +156 -0
- package/src/framework/components/field/select/FieldTableSelect/index.d.ts +29 -0
- package/src/framework/components/field/select/FieldTableSelect/index.jsx +155 -0
- package/src/framework/components/field/select/index.jsx +2 -0
- package/src/framework/components/field/switch-y-n/index.d.ts +11 -0
- package/src/framework/components/field/switch-y-n/index.jsx +31 -0
- package/src/framework/components/field/text/index.tsx +7 -0
- package/src/framework/components/field/time/DatePickerString.tsx +37 -0
- package/src/framework/components/field/time/DateTimePickerString.tsx +42 -0
- package/src/framework/components/field/time/FieldDateRange.d.ts +9 -0
- package/src/framework/components/field/time/FieldDateRange.jsx +49 -0
- package/src/framework/components/field/time/HHmmPickerString.tsx +42 -0
- package/src/framework/components/field/time/MonthPickerString.tsx +45 -0
- package/src/framework/components/field/time/TimePickerTool.ts +14 -0
- package/src/framework/components/field/time/YearPickerString.tsx +41 -0
- package/src/framework/components/field/time/YearQuarterString.tsx +38 -0
- package/src/framework/components/field/time/index.tsx +7 -0
- package/src/framework/components/field/upload/FieldUploadCropImage/index.d.ts +22 -0
- package/src/framework/components/field/upload/FieldUploadCropImage/index.jsx +11 -0
- package/src/framework/components/field/upload/FieldUploadFile.d.ts +35 -0
- package/src/framework/components/field/upload/FieldUploadFile.jsx +145 -0
- package/src/framework/components/field/upload/FieldUploadImage.d.ts +7 -0
- package/src/framework/components/field/upload/FieldUploadImage.jsx +16 -0
- package/src/framework/components/field/upload/index.jsx +3 -0
- package/src/framework/components/index.js +25 -0
- package/src/framework/components/system.jsx +29 -0
- package/src/framework/components/view/ViewBoolean.jsx +15 -0
- package/src/framework/components/view/ViewBooleanEnableDisable.jsx +16 -0
- package/src/framework/components/view/ViewEllipsis.d.ts +11 -0
- package/src/framework/components/view/ViewEllipsis.jsx +30 -0
- package/src/framework/components/view/ViewFile.d.ts +10 -0
- package/src/framework/components/view/ViewFile.jsx +50 -0
- package/src/framework/components/view/ViewFileButton.d.ts +10 -0
- package/src/framework/components/view/ViewFileButton.jsx +0 -0
- package/src/framework/components/view/ViewImage.d.ts +9 -0
- package/src/framework/components/view/ViewImage.jsx +61 -0
- package/src/framework/components/view/ViewPassword.jsx +24 -0
- package/src/framework/components/view/ViewRange/index.d.ts +16 -0
- package/src/framework/components/view/ViewRange/index.jsx +20 -0
- package/src/framework/components/view/ViewText.jsx +9 -0
- package/src/framework/components/view/index.js +12 -0
- package/src/framework/index.js +3 -0
- package/src/framework/system/FormRegistry.js +58 -0
- package/src/framework/system/dict.js +88 -0
- package/src/framework/system/http.jsx +290 -0
- package/src/framework/system/index.js +13 -0
- package/src/framework/system/page.js +109 -0
- package/src/framework/system/permission.js +44 -0
- package/src/framework/system/sys.js +60 -0
- package/src/framework/system/theme.js +17 -0
- package/src/framework/utils/arr.js +118 -0
- package/src/framework/utils/browser.js +24 -0
- package/src/framework/utils/color.js +269 -0
- package/src/framework/utils/date.js +173 -0
- package/src/framework/utils/debounce.js +33 -0
- package/src/framework/utils/dom.js +16 -0
- package/src/framework/utils/eventBus.js +70 -0
- package/src/framework/utils/html.js +13 -0
- package/src/framework/utils/index.js +17 -0
- package/src/framework/utils/obj.js +72 -0
- package/src/framework/utils/storage.js +37 -0
- package/src/framework/utils/str.js +297 -0
- package/src/framework/utils/tree.js +175 -0
- package/src/framework/utils/uid.js +76 -0
- package/src/framework/utils/url.js +84 -0
- package/src/framework/utils/validate.js +9 -0
- package/src/index.js +2 -0
- package/src/layouts/PageRender.d.ts +22 -0
- package/src/layouts/PageRender.jsx +90 -0
- package/src/layouts/admin/HeaderRight.jsx +104 -0
- package/src/layouts/admin/TabPageRender.jsx +158 -0
- package/src/layouts/admin/index.jsx +174 -0
- package/src/layouts/admin/index.less +64 -0
- package/src/layouts/index.jsx +163 -0
- package/src/layouts/index.less +45 -0
- package/src/loading.jsx +18 -0
- package/src/pages/404.jsx +13 -0
- package/src/pages/about.jsx +14 -0
- package/src/pages/api/accessLog/index.jsx +108 -0
- package/src/pages/api/accountResource/index.jsx +149 -0
- package/src/pages/api/doc.jsx +135 -0
- package/src/pages/api/index.jsx +163 -0
- package/src/pages/api/resource.jsx +18 -0
- package/src/pages/flowable/design/index.css +7 -0
- package/src/pages/flowable/design/index.jsx +297 -0
- package/src/pages/flowable/index.jsx +128 -0
- package/src/pages/flowable/instance/view.jsx +13 -0
- package/src/pages/flowable/monitor.jsx +106 -0
- package/src/pages/flowable/task/form.jsx +99 -0
- package/src/pages/flowable/task/index.jsx +200 -0
- package/src/pages/flowable/test/form.jsx +31 -0
- package/src/pages/flowable/test/index.jsx +54 -0
- package/src/pages/index.jsx +25 -0
- package/src/pages/job/index.jsx +239 -0
- package/src/pages/job/logList.jsx +100 -0
- package/src/pages/job/status.jsx +84 -0
- package/src/pages/login.jsx +144 -0
- package/src/pages/login.less +53 -0
- package/src/pages/system/config/index.jsx +136 -0
- package/src/pages/system/dict/Dict.jsx +73 -0
- package/src/pages/system/dict/DictItem.jsx +177 -0
- package/src/pages/system/dict/index.jsx +25 -0
- package/src/pages/system/file/index.jsx +152 -0
- package/src/pages/system/log/index.jsx +78 -0
- package/src/pages/system/org/index.jsx +263 -0
- package/src/pages/system/role/index.jsx +314 -0
- package/src/pages/system/role/perm.jsx +111 -0
- package/src/pages/system/sysManual/index.jsx +127 -0
- package/src/pages/system/user/UserPerm.jsx +132 -0
- package/src/pages/system/user/index.jsx +261 -0
- package/src/pages/test.jsx +16 -0
- package/src/pages/ureport/index.jsx +43 -0
- package/src/pages/userCenter/ChangePassword.jsx +64 -0
- package/src/pages/userCenter/index.jsx +90 -0
- package/src/pages/userCenter/manual.jsx +63 -0
- package/src/pages/userCenter/message.jsx +105 -0
- package/src/style/global.less +51 -0
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {Alert, Table} from "antd";
|
|
3
|
+
import {HttpUtil, Page} from "../../framework";
|
|
4
|
+
import * as echarts from 'echarts';
|
|
5
|
+
|
|
6
|
+
export default class extends React.Component {
|
|
7
|
+
|
|
8
|
+
state = {
|
|
9
|
+
dataSource: [],
|
|
10
|
+
summary: null
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
componentDidMount() {
|
|
14
|
+
HttpUtil.get('admin/jobStatus/info').then(rs => {
|
|
15
|
+
this.setState({dataSource: rs.list, summary: rs.summary})
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
HttpUtil.get("admin/jobStatus/statsTotal").then(list => {
|
|
19
|
+
|
|
20
|
+
const dates = list.map(item => item.date);
|
|
21
|
+
const success = list.map(item => item.success);
|
|
22
|
+
const error = list.map(item => item.error)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
var myChart = echarts.init(document.getElementById('main'));
|
|
26
|
+
myChart.setOption({
|
|
27
|
+
title: {
|
|
28
|
+
text: '作业执行趋势图'
|
|
29
|
+
},
|
|
30
|
+
tooltip: {},
|
|
31
|
+
xAxis: {
|
|
32
|
+
data: dates
|
|
33
|
+
},
|
|
34
|
+
yAxis: {},
|
|
35
|
+
series: [
|
|
36
|
+
{
|
|
37
|
+
name: '成功',
|
|
38
|
+
type: 'bar',
|
|
39
|
+
data: success,
|
|
40
|
+
itemStyle: {
|
|
41
|
+
color: 'green'
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: '失败',
|
|
46
|
+
type: 'bar',
|
|
47
|
+
data: error,
|
|
48
|
+
itemStyle: {
|
|
49
|
+
color: 'red'
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
});
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
render() {
|
|
60
|
+
return <Page padding>
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
<Alert message={<pre>{this.state.summary}</pre>} style={{marginBottom: 12}}></Alert>
|
|
64
|
+
<div id='main' style={{height: 300}}></div>
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
<Table
|
|
68
|
+
title={() => <div>正在执行的Job</div>}
|
|
69
|
+
bordered
|
|
70
|
+
rowKey='id'
|
|
71
|
+
pagination={false}
|
|
72
|
+
dataSource={this.state.dataSource}
|
|
73
|
+
columns={[
|
|
74
|
+
{title: '实例ID', dataIndex: 'id'},
|
|
75
|
+
{title: 'JobKey', dataIndex: 'jobKey'},
|
|
76
|
+
{title: 'TriggerKey', dataIndex: 'triggerKey'},
|
|
77
|
+
{title: '执行类', dataIndex: 'className'},
|
|
78
|
+
{title: '触发时间', dataIndex: 'fireTime'},
|
|
79
|
+
{title: '下次触发', dataIndex: 'nextFireTime'},
|
|
80
|
+
|
|
81
|
+
]}></Table>
|
|
82
|
+
</Page>
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {Button, Form, Input, message, Space} from 'antd';
|
|
3
|
+
import {LockOutlined, SafetyCertificateOutlined, UserOutlined, WarningOutlined} from '@ant-design/icons';
|
|
4
|
+
import "./login.less"
|
|
5
|
+
import {history} from 'umi';
|
|
6
|
+
import {HttpUtil, MsgBox, PageUtil, SysUtil} from "../framework";
|
|
7
|
+
import {JSEncrypt} from "jsencrypt";
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
export default class login extends React.Component {
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
state = {
|
|
14
|
+
logging: false,
|
|
15
|
+
|
|
16
|
+
siteInfo: {},
|
|
17
|
+
random:Math.random()
|
|
18
|
+
}
|
|
19
|
+
redirect ='/';
|
|
20
|
+
|
|
21
|
+
async componentDidMount() {
|
|
22
|
+
console.log('渲染登录页面')
|
|
23
|
+
const redirect = PageUtil.currentParams()['redirect']
|
|
24
|
+
if(redirect){
|
|
25
|
+
console.log('重定向参数',redirect)
|
|
26
|
+
this.redirect = decodeURIComponent(redirect)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
{
|
|
31
|
+
// 内部系统登录
|
|
32
|
+
let token = PageUtil.currentParams().token
|
|
33
|
+
if (token) {
|
|
34
|
+
token = window.location.search
|
|
35
|
+
this.submit({token})
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (localStorage.length === 0) {
|
|
40
|
+
MsgBox.toast('站点数据缺失,刷新当前页面...')
|
|
41
|
+
window.location.reload()
|
|
42
|
+
return
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const siteInfo = SysUtil.getSiteInfo()
|
|
46
|
+
this.setState({siteInfo})
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
submit = values => {
|
|
51
|
+
this.setState({logging: true})
|
|
52
|
+
|
|
53
|
+
const pubkey = this.state.siteInfo.rsaPublicKey;
|
|
54
|
+
if(!pubkey){
|
|
55
|
+
message.error("未获取密钥,请刷新浏览器再试")
|
|
56
|
+
return
|
|
57
|
+
}
|
|
58
|
+
// 对密码加密
|
|
59
|
+
const crypt = new JSEncrypt();
|
|
60
|
+
crypt.setPublicKey(pubkey);
|
|
61
|
+
values.password = crypt.encrypt(values.password)
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
HttpUtil.postForm('admin/auth/login', values).then(rs => {
|
|
65
|
+
console.log('登录结果', rs)
|
|
66
|
+
history.push(this.redirect)
|
|
67
|
+
}).catch(e=>{
|
|
68
|
+
console.log('登录错误', e)
|
|
69
|
+
})
|
|
70
|
+
.finally(() => {
|
|
71
|
+
this.setState({logging: false})
|
|
72
|
+
})
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
render() {
|
|
77
|
+
const {siteInfo} = this.state
|
|
78
|
+
|
|
79
|
+
const pageStyle = {}
|
|
80
|
+
if(siteInfo.loginBackground){
|
|
81
|
+
let url = SysUtil.wrapServerUrl('admin/sysFile/preview/' + siteInfo.loginBackground);
|
|
82
|
+
pageStyle.backgroundImage = 'url("'+url+'")'
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
return (
|
|
86
|
+
<section className='login-page' style={pageStyle}>
|
|
87
|
+
<div className="login-content">
|
|
88
|
+
<h1>{siteInfo.title}</h1>
|
|
89
|
+
<Form
|
|
90
|
+
name="normal_login"
|
|
91
|
+
className="login-form"
|
|
92
|
+
initialValues={{remember: true}}
|
|
93
|
+
onFinish={this.submit}
|
|
94
|
+
requiredMark={false}
|
|
95
|
+
colon={false}
|
|
96
|
+
>
|
|
97
|
+
|
|
98
|
+
<Form.Item name="username" rules={[{required: true, message: '请输入用户名!'}]}>
|
|
99
|
+
<Input size='large' prefix={<UserOutlined/>} placeholder="用户名" autoComplete="off"/>
|
|
100
|
+
</Form.Item>
|
|
101
|
+
<Form.Item name="password" rules={[{required: true, message: '请输入密码!'}]}>
|
|
102
|
+
<Input autoComplete="off" prefix={<LockOutlined/>} type="password" placeholder="密码"
|
|
103
|
+
size='large'
|
|
104
|
+
/>
|
|
105
|
+
</Form.Item>
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
{siteInfo.captcha && <Form.Item name='captchaCode' rules={[{required: true}]}>
|
|
109
|
+
<Space style={{alignItems: 'center'}}>
|
|
110
|
+
<Input size='large' placeholder='验证码' prefix={<SafetyCertificateOutlined/>}/>
|
|
111
|
+
<img height={36} width={100}
|
|
112
|
+
src={SysUtil.wrapServerUrl( "admin/auth/captchaImage?_random=" + this.state.random)} onClick={() => {
|
|
113
|
+
this.setState({random: Math.random()})
|
|
114
|
+
}}></img>
|
|
115
|
+
</Space>
|
|
116
|
+
</Form.Item>}
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
<Form.Item style={{marginTop: 10}}>
|
|
120
|
+
<Button loading={this.state.logging} type="primary" htmlType="submit"
|
|
121
|
+
block size='large'>
|
|
122
|
+
登录
|
|
123
|
+
</Button>
|
|
124
|
+
</Form.Item>
|
|
125
|
+
</Form>
|
|
126
|
+
|
|
127
|
+
{this.renderFormBottom()}
|
|
128
|
+
|
|
129
|
+
</div>
|
|
130
|
+
</section>
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
renderFormBottom() {
|
|
136
|
+
let siteInfo = this.state.siteInfo;
|
|
137
|
+
if (siteInfo.loginBoxBottomTip) {
|
|
138
|
+
return <div style={{color: 'white', marginTop: 50, fontSize: '14px', textAlign: 'center'}}>
|
|
139
|
+
<WarningOutlined/> {siteInfo.loginBoxBottomTip}
|
|
140
|
+
</div>
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
.login-page {
|
|
2
|
+
background-size: cover;
|
|
3
|
+
background-image: url("../asserts/login_bg.jpg");
|
|
4
|
+
background-repeat: no-repeat;
|
|
5
|
+
background-position: bottom;
|
|
6
|
+
|
|
7
|
+
width: 100vw;
|
|
8
|
+
height: 100vh;
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
.login-content {
|
|
12
|
+
padding: 40px;
|
|
13
|
+
background: #15184b44;
|
|
14
|
+
width: 350px;
|
|
15
|
+
position: fixed;
|
|
16
|
+
right: 15%;
|
|
17
|
+
top: 20%;
|
|
18
|
+
|
|
19
|
+
.ant-form-item-label > label{
|
|
20
|
+
color: white !important;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@media screen and (max-width: 768px) {
|
|
26
|
+
.login-page {
|
|
27
|
+
padding-top: 30%;
|
|
28
|
+
|
|
29
|
+
.login-content {
|
|
30
|
+
width: calc(100% - 100px);
|
|
31
|
+
padding: 24px;
|
|
32
|
+
position: static;
|
|
33
|
+
margin: 0 auto;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
.login-form {
|
|
40
|
+
max-width: 300px;
|
|
41
|
+
margin: 0 auto;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
.login-page h1 {
|
|
48
|
+
margin-bottom: 50px;
|
|
49
|
+
text-align: center;
|
|
50
|
+
color: white !important;
|
|
51
|
+
font-size: x-large;
|
|
52
|
+
}
|
|
53
|
+
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import {Button, Card, Form, Modal, Table} from 'antd'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
|
|
4
|
+
import {ButtonList, HttpUtil, ValueType} from '../../../framework'
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
export default class extends React.Component {
|
|
8
|
+
|
|
9
|
+
state = {
|
|
10
|
+
data: [],
|
|
11
|
+
formValues: {},
|
|
12
|
+
formOpen: false
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
formRef = React.createRef()
|
|
16
|
+
tableRef = React.createRef()
|
|
17
|
+
|
|
18
|
+
columns = [
|
|
19
|
+
{
|
|
20
|
+
title: '参数名称',
|
|
21
|
+
dataIndex: 'name',
|
|
22
|
+
width: 300,
|
|
23
|
+
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
title: '编码',
|
|
27
|
+
dataIndex: 'code',
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
{
|
|
32
|
+
title: '值',
|
|
33
|
+
dataIndex: 'value',
|
|
34
|
+
render(v, record) {
|
|
35
|
+
if (v != null) {
|
|
36
|
+
return ValueType.renderView(record.valueType, {value: v})
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
{
|
|
43
|
+
title: '说明',
|
|
44
|
+
dataIndex: 'description',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
title: '更新时间',
|
|
48
|
+
dataIndex: 'updateTime',
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
{
|
|
52
|
+
title: '操作',
|
|
53
|
+
dataIndex: 'option',
|
|
54
|
+
fixed: 'right',
|
|
55
|
+
render: (_, record) => (
|
|
56
|
+
<ButtonList>
|
|
57
|
+
<Button size='small' perm='sysConfig:save' onClick={() => this.handleEdit(record)}> 修改 </Button>
|
|
58
|
+
</ButtonList>
|
|
59
|
+
),
|
|
60
|
+
},
|
|
61
|
+
]
|
|
62
|
+
|
|
63
|
+
componentDidMount() {
|
|
64
|
+
this.loadData();
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
loadData() {
|
|
68
|
+
HttpUtil.get('admin/sysConfig/page').then(rs => {
|
|
69
|
+
this.setState({data: rs})
|
|
70
|
+
})
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
handleEdit = record => {
|
|
74
|
+
this.setState({formOpen: true, formValues: record})
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
onFinish = values => {
|
|
79
|
+
HttpUtil.post('admin/sysConfig/save', values).then(rs => {
|
|
80
|
+
this.setState({formOpen: false})
|
|
81
|
+
this.loadData()
|
|
82
|
+
})
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
render() {
|
|
87
|
+
return <>
|
|
88
|
+
<Card loading={this.state.data.length === 0}>
|
|
89
|
+
<Table
|
|
90
|
+
dataSource={this.state.data}
|
|
91
|
+
actionRef={this.tableRef}
|
|
92
|
+
pagination={false}
|
|
93
|
+
expandable={
|
|
94
|
+
{
|
|
95
|
+
defaultExpandAllRows: true
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
columns={this.columns}
|
|
99
|
+
rowKey='id'
|
|
100
|
+
bordered
|
|
101
|
+
size='small'
|
|
102
|
+
/>
|
|
103
|
+
</Card>
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
<Modal title={'编辑系统参数'}
|
|
107
|
+
open={this.state.formOpen}
|
|
108
|
+
onOk={() => this.formRef.current.submit()}
|
|
109
|
+
onCancel={() => this.setState({formOpen: false})}
|
|
110
|
+
destroyOnHidden
|
|
111
|
+
maskClosable={false}
|
|
112
|
+
width={400}
|
|
113
|
+
>
|
|
114
|
+
|
|
115
|
+
<Form ref={this.formRef}
|
|
116
|
+
initialValues={this.state.formValues}
|
|
117
|
+
onFinish={this.onFinish}
|
|
118
|
+
layout='vertical'
|
|
119
|
+
>
|
|
120
|
+
|
|
121
|
+
<Form.Item name='id' noStyle/>
|
|
122
|
+
|
|
123
|
+
<Form.Item name='value' label={this.state.formValues.label}>
|
|
124
|
+
{ValueType.renderField(this.state.formValues.valueType)}
|
|
125
|
+
</Form.Item>
|
|
126
|
+
|
|
127
|
+
</Form>
|
|
128
|
+
</Modal>
|
|
129
|
+
</>
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import {HttpUtil, ProTable} from "../../../framework";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
export default class extends React.Component {
|
|
7
|
+
|
|
8
|
+
state = {
|
|
9
|
+
formValues: {},
|
|
10
|
+
formOpen: false,
|
|
11
|
+
selectedRowKeys: []
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
formRef = React.createRef()
|
|
15
|
+
tableRef = React.createRef()
|
|
16
|
+
|
|
17
|
+
columns = [
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
{
|
|
22
|
+
title: '编码',
|
|
23
|
+
dataIndex: 'code',
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
title: '文本',
|
|
29
|
+
dataIndex: 'text',
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
]
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
render() {
|
|
39
|
+
return <>
|
|
40
|
+
<ProTable
|
|
41
|
+
actionRef={this.tableRef}
|
|
42
|
+
|
|
43
|
+
request={(params) => HttpUtil.pageData('admin/sysDict/page', params)}
|
|
44
|
+
columns={this.columns}
|
|
45
|
+
rowKey='id'
|
|
46
|
+
|
|
47
|
+
rowSelection={{
|
|
48
|
+
type: 'radio',
|
|
49
|
+
selectedRowKeys: this.state.selectedRowKeys,
|
|
50
|
+
onChange: (selectedRowKeys, selectedRows) => {
|
|
51
|
+
this.setState({selectedRowKeys: selectedRowKeys})
|
|
52
|
+
this.props.onChange(selectedRowKeys[0])
|
|
53
|
+
}
|
|
54
|
+
}}
|
|
55
|
+
onRow={(record) => ({
|
|
56
|
+
onClick: () => {
|
|
57
|
+
this.setState({selectedRowKeys: [record.id]})
|
|
58
|
+
this.props.onChange(record.id)
|
|
59
|
+
}
|
|
60
|
+
})}
|
|
61
|
+
/>
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
</>
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import {PlusOutlined} from '@ant-design/icons'
|
|
2
|
+
import {Button, Col, Form, Input, InputNumber, Modal, Popconfirm, Row, Tag} from 'antd'
|
|
3
|
+
import React from 'react'
|
|
4
|
+
|
|
5
|
+
import {ButtonList, FieldRadioBoolean, HttpUtil, ProTable} from '../../../framework'
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
export default class extends React.Component {
|
|
9
|
+
|
|
10
|
+
state = {
|
|
11
|
+
formValues: {},
|
|
12
|
+
formOpen: false
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
formRef = React.createRef()
|
|
16
|
+
tableRef = React.createRef()
|
|
17
|
+
|
|
18
|
+
componentDidUpdate(prevProps, prevState, snapshot) {
|
|
19
|
+
if (prevProps.sysDictId !== this.props.sysDictId) {
|
|
20
|
+
this.tableRef.current.reload()
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
columns = [
|
|
25
|
+
{
|
|
26
|
+
title: '文本',
|
|
27
|
+
dataIndex: 'text',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
title: '编码',
|
|
31
|
+
dataIndex: 'code',
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
{
|
|
35
|
+
title: '启用',
|
|
36
|
+
dataIndex: 'enabled',
|
|
37
|
+
render(v) {
|
|
38
|
+
return v ? '是' : '否'
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
title: '显示颜色',
|
|
44
|
+
dataIndex: 'color',
|
|
45
|
+
render(v) {
|
|
46
|
+
return <Tag color={v}>COLOR</Tag>
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
title: '系统内置',
|
|
51
|
+
dataIndex: 'builtin',
|
|
52
|
+
render(v) {
|
|
53
|
+
return v ? '是' : '否'
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
title: '序号',
|
|
59
|
+
dataIndex: 'seq',
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
title: '操作',
|
|
63
|
+
dataIndex: 'option',
|
|
64
|
+
render: (_, record) => {
|
|
65
|
+
|
|
66
|
+
return (
|
|
67
|
+
<ButtonList>
|
|
68
|
+
<Button size='small' perm='sysDict:save'
|
|
69
|
+
onClick={() => this.handleEdit(record)}> 编辑 </Button>
|
|
70
|
+
<Popconfirm perm='sysDict:delete' title='是否确定删除字典项'
|
|
71
|
+
onConfirm={() => this.handleDelete(record)}>
|
|
72
|
+
<Button size='small'>删除</Button>
|
|
73
|
+
</Popconfirm>
|
|
74
|
+
</ButtonList>
|
|
75
|
+
);
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
]
|
|
79
|
+
|
|
80
|
+
handleAdd = () => {
|
|
81
|
+
this.setState({formOpen: true, formValues: {}})
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
handleEdit = record => {
|
|
85
|
+
this.setState({formOpen: true, formValues: record})
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
onFinish = values => {
|
|
90
|
+
values.sysDict = {id: this.props.sysDictId}
|
|
91
|
+
HttpUtil.post('admin/sysDictItem/save', values).then(rs => {
|
|
92
|
+
this.setState({formOpen: false})
|
|
93
|
+
this.tableRef.current.reload()
|
|
94
|
+
})
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
handleDelete = row => {
|
|
99
|
+
HttpUtil.get('admin/sysDictItem/delete', row).then(rs => {
|
|
100
|
+
this.tableRef.current.reload()
|
|
101
|
+
})
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
render() {
|
|
105
|
+
return <>
|
|
106
|
+
<ProTable
|
|
107
|
+
headerTitle='字典项列表'
|
|
108
|
+
actionRef={this.tableRef}
|
|
109
|
+
toolBarRender={() => {
|
|
110
|
+
return <ButtonList>
|
|
111
|
+
<Button perm='sysDictItem:save' type='primary' onClick={this.handleAdd}>
|
|
112
|
+
<PlusOutlined/> 新增
|
|
113
|
+
</Button>
|
|
114
|
+
</ButtonList>
|
|
115
|
+
}}
|
|
116
|
+
request={(params) => {
|
|
117
|
+
params.sysDictId = this.props.sysDictId
|
|
118
|
+
return HttpUtil.pageData('admin/sysDictItem/page', params);
|
|
119
|
+
}}
|
|
120
|
+
columns={this.columns}
|
|
121
|
+
rowKey='id'
|
|
122
|
+
search={false}
|
|
123
|
+
/>
|
|
124
|
+
|
|
125
|
+
<Modal
|
|
126
|
+
title='编辑数据字典项'
|
|
127
|
+
open={this.state.formOpen}
|
|
128
|
+
onOk={() => this.formRef.current.submit()}
|
|
129
|
+
onCancel={() => this.setState({formOpen: false})}
|
|
130
|
+
destroyOnHidden
|
|
131
|
+
>
|
|
132
|
+
|
|
133
|
+
<Form ref={this.formRef} labelCol={{flex: '100px'}}
|
|
134
|
+
initialValues={this.state.formValues}
|
|
135
|
+
onFinish={this.onFinish}>
|
|
136
|
+
<Form.Item name='id' noStyle></Form.Item>
|
|
137
|
+
|
|
138
|
+
<Row>
|
|
139
|
+
<Col span={12}>
|
|
140
|
+
<Form.Item label='编码' name='code' rules={[{required: true}]}>
|
|
141
|
+
<Input/>
|
|
142
|
+
</Form.Item>
|
|
143
|
+
</Col>
|
|
144
|
+
<Col span={12}>
|
|
145
|
+
<Form.Item label='文本' name='text' rules={[{required: true}]}>
|
|
146
|
+
<Input/>
|
|
147
|
+
</Form.Item>
|
|
148
|
+
</Col>
|
|
149
|
+
</Row>
|
|
150
|
+
|
|
151
|
+
<Row>
|
|
152
|
+
<Col span={12}>
|
|
153
|
+
<Form.Item label='颜色' name='color' rules={[{required: true}]}>
|
|
154
|
+
<Input/>
|
|
155
|
+
</Form.Item>
|
|
156
|
+
</Col>
|
|
157
|
+
<Col span={12}>
|
|
158
|
+
<Form.Item label='序号' name='seq' rules={[{required: true}]}>
|
|
159
|
+
<InputNumber/>
|
|
160
|
+
</Form.Item>
|
|
161
|
+
</Col>
|
|
162
|
+
</Row>
|
|
163
|
+
|
|
164
|
+
<Form.Item label='启用' name='enabled' rules={[{required: true}]}>
|
|
165
|
+
<FieldRadioBoolean/>
|
|
166
|
+
</Form.Item>
|
|
167
|
+
|
|
168
|
+
</Form>
|
|
169
|
+
</Modal>
|
|
170
|
+
</>
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Dict from "./Dict";
|
|
3
|
+
import DictItem from "./DictItem";
|
|
4
|
+
import {Splitter} from "antd";
|
|
5
|
+
|
|
6
|
+
export default class extends React.Component {
|
|
7
|
+
|
|
8
|
+
state = {
|
|
9
|
+
selectedKey: null
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
render() {
|
|
14
|
+
return <Splitter>
|
|
15
|
+
<Splitter.Panel defaultSize={600} style={{paddingRight:16}}>
|
|
16
|
+
<Dict onChange={selectedKey => this.setState({selectedKey})}/>
|
|
17
|
+
</Splitter.Panel>
|
|
18
|
+
<Splitter.Panel style={{paddingLeft:16}}>
|
|
19
|
+
<DictItem sysDictId={this.state.selectedKey}/>
|
|
20
|
+
</Splitter.Panel>
|
|
21
|
+
</Splitter>
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
}
|
|
25
|
+
}
|