@jiangood/open-admin 2.4.7 → 2.5.0

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.
Files changed (33) hide show
  1. package/package.json +1 -1
  2. package/src/.umi-production/appData.json +58 -78
  3. package/src/.umi-production/core/route.tsx +1 -3
  4. package/src/framework/components/ContextMenu/index.tsx +91 -0
  5. package/src/framework/components/Page/index.less +19 -6
  6. package/src/framework/components/Page/index.tsx +23 -3
  7. package/src/framework/components/ProTable/index.less +60 -9
  8. package/src/framework/components/ProTable/index.tsx +31 -48
  9. package/src/framework/components/index.ts +1 -0
  10. package/src/framework/fields/FieldTableSelect/index.tsx +0 -1
  11. package/src/layouts/admin/HeaderRight.jsx +1 -6
  12. package/src/layouts/admin/TabPageRender.jsx +80 -23
  13. package/src/layouts/admin/index.jsx +16 -22
  14. package/src/layouts/admin/index.less +31 -20
  15. package/src/layouts/index.jsx +0 -9
  16. package/src/pages/about.jsx +1 -1
  17. package/src/pages/index.jsx +1 -1
  18. package/src/pages/login.jsx +1 -5
  19. package/src/pages/system/dict/index.jsx +56 -53
  20. package/src/pages/system/file/index.jsx +1 -7
  21. package/src/pages/system/job/index.jsx +9 -14
  22. package/src/pages/system/log/index.jsx +1 -1
  23. package/src/pages/system/org/index.jsx +153 -173
  24. package/src/pages/system/role/index.jsx +21 -12
  25. package/src/pages/system/role/perm.jsx +1 -2
  26. package/src/pages/system/user/index.jsx +28 -43
  27. package/src/pages/userCenter/index.jsx +3 -2
  28. package/src/pages/userCenter/message.jsx +1 -1
  29. package/src/style/global.less +1 -1
  30. package/src/framework/components/ProTable/components/ToolBar/index.less +0 -53
  31. package/src/framework/components/ProTable/components/ToolBar/index.tsx +0 -123
  32. package/src/pages/system/manual/index.jsx +0 -128
  33. package/src/pages/userCenter/manual.jsx +0 -57
@@ -1,53 +0,0 @@
1
- .pro-table-toolbar {
2
- display: flex;
3
- align-items: center;
4
- justify-content: space-between;
5
- margin-bottom: 8px;
6
- /*
7
- border: 1px solid #ddd;
8
- border-radius: 5px;
9
- background: #F8F9FA;
10
- padding: 8px;
11
- */
12
-
13
- &-option {
14
- display: flex;
15
- align-items: center;
16
- justify-content: flex-end;
17
- gap: 12px;
18
- }
19
-
20
- .btn {
21
- padding: 0;
22
- background: #f8f8f8;
23
- border:none;
24
- font-size: 14px;
25
- font-weight: 400;
26
- cursor: pointer;
27
- user-select: none;
28
- img {
29
- width: 20px;
30
- height: 20px;
31
- }
32
- }
33
- }
34
-
35
- @media (max-width: 575px) {
36
- .pro-table-toolbar {
37
- flex-direction: column;
38
- align-items: flex-start;
39
- justify-content: flex-start;
40
- height: auto;
41
- margin-bottom: 16px;
42
- margin-left: 16px;
43
- padding: 16px 8px 8px;
44
- line-height: normal;
45
-
46
- &-option {
47
- display: flex;
48
- justify-content: space-between;
49
- width: 100%;
50
- }
51
-
52
- }
53
- }
@@ -1,123 +0,0 @@
1
- /**
2
- * 工具栏
3
- */
4
- import {HistoryOutlined, ReloadOutlined} from '@ant-design/icons';
5
- import {Button, Input, message, Modal, Table} from 'antd';
6
- import React from 'react';
7
- import './index.less';
8
- import {DateUtils, PageUtils, StorageUtils} from "../../../../utils";
9
-
10
- export class Toolbar extends React.Component {
11
-
12
- state = {
13
- // 查询历史的模态框
14
- historyOpen: false
15
- }
16
-
17
- render = () => {
18
- const {
19
- onRefresh,
20
- toolBarRender,
21
- loading,
22
- showSearch
23
- } = this.props;
24
-
25
- return <div className='pro-table-toolbar'>
26
-
27
- <div className='pro-table-toolbar-left'>
28
- {showSearch && <Input.Search placeholder='搜索...'
29
- allowClear
30
- onSearch={e=>{
31
- this.props.onSearch({searchText: e})
32
- }}
33
- />}
34
- </div>
35
-
36
- <div className='pro-table-toolbar-option'>
37
- {toolBarRender}
38
- <Button title='刷新' size='small' icon={<ReloadOutlined/>} onClick={onRefresh} loading={loading}/>
39
- <Button title='查询历史' size='small' icon={<HistoryOutlined/>} onClick={this.onClickHistory}/>
40
- </div>
41
-
42
- {this.renderHistory()}
43
- </div>
44
- };
45
-
46
-
47
- renderHistory() {
48
- const {params} = this.props
49
- const list = StorageUtils.get(this.getParamKey()) || []
50
-
51
- const dataSource = [{params, time: '当前'}, ...list]
52
-
53
- return <Modal title='查询方案'
54
- width={800}
55
- open={this.state.historyOpen}
56
- onCancel={() => this.setState({historyOpen: false})}
57
- footer={null}
58
- destroyOnHidden
59
- >
60
-
61
- <Table
62
- dataSource={dataSource}
63
- pagination={false}
64
- rowKey='time'
65
- columns={[
66
- {
67
- dataIndex: 'time', title: '时间'
68
- },
69
- {
70
- dataIndex: 'params', title: '参数',
71
- render(v) {
72
- return JSON.stringify(v)
73
- }
74
- }, {
75
- dataIndex: 'option', title: '-',
76
- render: (v, record) => {
77
- if (record.time === '当前') {
78
- return <Button onClick={this.onSaveHistory}>保存</Button>
79
- } else {
80
- return <Button type='primary' onClick={() => this.onApply(record.params)}>使用</Button>
81
- }
82
- }
83
- }
84
- ]}></Table>
85
-
86
-
87
- </Modal>;
88
- }
89
-
90
- onClickHistory = () => {
91
-
92
- this.setState({historyOpen: true})
93
- }
94
-
95
- getParamKey() {
96
- return 'query-params-' + PageUtils.currentPathname();
97
- }
98
-
99
- onSaveHistory = () => {
100
- const {params} = this.props
101
- const keys = Object.keys(params)
102
- if (keys.length === 0) {
103
- message.error('查询参数为空,无法保存')
104
- return
105
- }
106
- const list = StorageUtils.get(this.getParamKey()) || []
107
- const data = {time: DateUtils.now(), params};
108
- list.unshift(data)
109
- if (list.length > 5) {
110
- list.pop()
111
- }
112
- StorageUtils.set(this.getParamKey(), list)
113
- message.success('保存成功')
114
- this.setState({historyOpen: false})
115
- }
116
-
117
- onApply = (params) => {
118
- this.props.changeFormValues(params)
119
- this.setState({historyOpen: false})
120
- }
121
- }
122
-
123
-
@@ -1,128 +0,0 @@
1
- import {PlusOutlined} from '@ant-design/icons'
2
- import {Button, Form, Input, Modal, Popconfirm} from 'antd'
3
- import React from 'react'
4
- import {ButtonList, FieldUploadFile, HttpUtils, Page, ProTable} from "../../../framework";
5
-
6
-
7
- export default class extends React.Component {
8
-
9
- state = {
10
- formValues: {},
11
- formOpen: false
12
- }
13
-
14
- formRef = React.createRef()
15
- tableRef = React.createRef()
16
-
17
- handleAdd = () => {
18
- this.setState({formOpen: true, formValues: {}})
19
- }
20
-
21
- handleEdit = record => {
22
- this.setState({formOpen: true, formValues: record})
23
- }
24
-
25
- onFinish = values => {
26
- const isNew = !values.id;
27
- const url = isNew ? 'admin/sysManual/create' : 'admin/sysManual/update';
28
- HttpUtils.post(url, values).then(rs => {
29
- this.setState({formOpen: false})
30
- this.tableRef.current.reload()
31
- })
32
- }
33
-
34
- handleDelete = record => {
35
- HttpUtils.post('admin/sysManual/delete', {id: record.id}).then(rs => {
36
- this.tableRef.current.reload()
37
- })
38
- }
39
-
40
- columns = [
41
-
42
- {
43
- title: '名称',
44
- dataIndex: 'name',
45
-
46
-
47
- },
48
-
49
- {
50
- title: '版本',
51
- dataIndex: 'version',
52
- render(version) {
53
- return 'v' + version;
54
- }
55
- },
56
-
57
- {
58
- title: '文件',
59
- dataIndex: 'fileId',
60
- render(id) {
61
- const url = 'admin/sysFile/preview/' + id;
62
- return <a href={url} target='_blank'>查看文件</a>
63
- }
64
-
65
- },
66
- {
67
- title: '操作',
68
- dataIndex: 'option',
69
- render: (_, record) => (
70
- <ButtonList>
71
- <Button size='small' perm='sys-manual:update' onClick={() => this.handleEdit(record)}>编辑</Button>
72
- <Popconfirm perm='sys-manual:delete' title='是否确定删除操作手册'
73
- onConfirm={() => this.handleDelete(record)}>
74
- <Button size='small'>删除</Button>
75
- </Popconfirm>
76
- </ButtonList>
77
- ),
78
- },
79
-
80
- ]
81
-
82
- render() {
83
- return <Page>
84
- <ProTable
85
- actionRef={this.tableRef}
86
- toolBarRender={(params, {selectedRows, selectedRowKeys}) => {
87
- return <ButtonList>
88
- <Button perm='sys-manual:create' type='primary' onClick={this.handleAdd}>
89
- <PlusOutlined/> 新增
90
- </Button>
91
- </ButtonList>
92
- }}
93
- request={(params) => HttpUtils.get('admin/sysManual/page', params)}
94
- columns={this.columns}
95
-
96
- />
97
-
98
- <Modal title='操作手册'
99
- open={this.state.formOpen}
100
- onOk={() => this.formRef.current.submit()}
101
- onCancel={() => this.setState({formOpen: false})}
102
- destroyOnHidden
103
- mask={{ closable: false }}
104
- >
105
-
106
- <Form ref={this.formRef} labelCol={{flex: '100px'}}
107
- initialValues={this.state.formValues}
108
- onFinish={this.onFinish}
109
- >
110
- <Form.Item name='id' noStyle></Form.Item>
111
-
112
- <Form.Item label='名称' name='name' rules={[{required: true}]}>
113
- <Input/>
114
- </Form.Item>
115
-
116
- <Form.Item label='文件' name='fileId' rules={[{required: true}]}>
117
- <FieldUploadFile accept=".pdf" maxCount={1}/>
118
- </Form.Item>
119
-
120
- </Form>
121
- </Modal>
122
- </Page>
123
-
124
-
125
- }
126
- }
127
-
128
-
@@ -1,57 +0,0 @@
1
- import React from 'react'
2
- import {HttpUtils, Page, ProTable} from "../../framework";
3
-
4
-
5
- export default class extends React.Component {
6
-
7
-
8
- tableRef = React.createRef()
9
-
10
- columns = [
11
-
12
- {
13
- title: '名称',
14
- dataIndex: 'name',
15
-
16
-
17
- },
18
-
19
- {
20
- title: '版本',
21
- dataIndex: 'version',
22
- render(version) {
23
- return 'v' + version;
24
- }
25
- },
26
-
27
- {
28
- title: '文件',
29
- dataIndex: 'fileId',
30
- render(id) {
31
- const url = ('admin/sysFile/preview/' + id);
32
- return <a href={url} target='_blank'>查看文件</a>
33
- }
34
-
35
- },
36
-
37
- {
38
- title: '更新时间',
39
- dataIndex: 'updateTime',
40
- },
41
- ]
42
-
43
-
44
- render() {
45
- return <Page>
46
- <ProTable
47
- actionRef={this.tableRef}
48
- request={(params) => HttpUtils.get('admin/sysManual/page-for-user', params)}
49
- columns={this.columns}
50
- />
51
- </Page>
52
-
53
-
54
- }
55
- }
56
-
57
-