@jiangood/open-admin 1.1.1 → 1.2.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.
- package/package.json +1 -1
- package/src/.umi-production/appData.json +280 -310
- package/src/.umi-production/core/helmet.ts +1 -1
- package/src/.umi-production/core/history.ts +1 -1
- package/src/.umi-production/core/historyIntelli.ts +1 -1
- package/src/.umi-production/core/route.tsx +1 -4
- package/src/.umi-production/exports.ts +3 -3
- package/src/.umi-production/testBrowser.tsx +1 -1
- package/src/.umi-production/tsconfig.json +1 -1
- package/src/.umi-production/umi.ts +2 -2
- package/src/framework/fields/FieldDictSelect/index.jsx +2 -1
- package/src/framework/pages/LoginPageUtils.ts +1 -1
- package/src/framework/utils/system/DictUtils.ts +7 -8
- package/src/layouts/admin/index.jsx +33 -18
- package/src/layouts/admin/index.less +4 -1
- package/src/pages/system/api/index.jsx +1 -1
- package/src/pages/system/dict/index.jsx +188 -12
- package/src/pages/system/file/index.jsx +1 -1
- package/src/pages/system/job/index.jsx +1 -1
- package/src/pages/system/org/index.jsx +2 -3
- package/src/pages/system/role/index.jsx +1 -2
- package/src/pages/system/sysManual/index.jsx +1 -1
- package/src/pages/system/user/index.jsx +1 -1
- package/src/pages/system/dict/Dict.jsx +0 -67
- package/src/pages/system/dict/DictItem.jsx +0 -175
- package/src/pages/ureport/index.jsx +0 -16
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// This file is generated by Umi automatically
|
|
3
3
|
// DO NOT CHANGE IT MANUALLY!
|
|
4
4
|
import React from 'react';
|
|
5
|
-
import { HelmetProvider } from '/home/runner/work/open-admin/open-admin/web/node_modules/.pnpm/@umijs+renderer-react@4.6.
|
|
5
|
+
import { HelmetProvider } from '/home/runner/work/open-admin/open-admin/web/node_modules/.pnpm/@umijs+renderer-react@4.6.27_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@umijs/renderer-react';
|
|
6
6
|
import { context } from './helmetContext';
|
|
7
7
|
|
|
8
8
|
export const innerProvider = (container) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
2
|
// This file is generated by Umi automatically
|
|
3
3
|
// DO NOT CHANGE IT MANUALLY!
|
|
4
|
-
import { createHashHistory, createMemoryHistory, createBrowserHistory } from '/home/runner/work/open-admin/open-admin/web/node_modules/.pnpm/@umijs+renderer-react@4.6.
|
|
4
|
+
import { createHashHistory, createMemoryHistory, createBrowserHistory } from '/home/runner/work/open-admin/open-admin/web/node_modules/.pnpm/@umijs+renderer-react@4.6.27_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@umijs/renderer-react';
|
|
5
5
|
import type { UmiHistory } from './historyIntelli';
|
|
6
6
|
|
|
7
7
|
let history: UmiHistory;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// This file is generated by Umi automatically
|
|
3
3
|
// DO NOT CHANGE IT MANUALLY!
|
|
4
4
|
import { getRoutes } from './route'
|
|
5
|
-
import type { History } from '/home/runner/work/open-admin/open-admin/web/node_modules/.pnpm/@umijs+renderer-react@4.6.
|
|
5
|
+
import type { History } from '/home/runner/work/open-admin/open-admin/web/node_modules/.pnpm/@umijs+renderer-react@4.6.27_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@umijs/renderer-react'
|
|
6
6
|
|
|
7
7
|
type Routes = Awaited<ReturnType<typeof getRoutes>>['routes']
|
|
8
8
|
type AllRoute = Routes[keyof Routes]
|
|
@@ -19,14 +19,13 @@ if (process.env.NODE_ENV === 'development') {
|
|
|
19
19
|
import React from 'react';
|
|
20
20
|
|
|
21
21
|
export async function getRoutes() {
|
|
22
|
-
const routes = {"404":{"path":"*","id":"404","parentId":"@@/global-layout"},"userCenter/ChangePassword":{"path":"userCenter/ChangePassword","id":"userCenter/ChangePassword","parentId":"@@/global-layout"},"system/sysManual/index":{"path":"system/sysManual","id":"system/sysManual/index","parentId":"@@/global-layout"},"system/
|
|
22
|
+
const routes = {"404":{"path":"*","id":"404","parentId":"@@/global-layout"},"userCenter/ChangePassword":{"path":"userCenter/ChangePassword","id":"userCenter/ChangePassword","parentId":"@@/global-layout"},"system/sysManual/index":{"path":"system/sysManual","id":"system/sysManual/index","parentId":"@@/global-layout"},"system/user/UserPerm":{"path":"system/user/UserPerm","id":"system/user/UserPerm","parentId":"@@/global-layout"},"userCenter/message":{"path":"userCenter/message","id":"userCenter/message","parentId":"@@/global-layout"},"system/api/ApiDoc":{"path":"system/api/ApiDoc","id":"system/api/ApiDoc","parentId":"@@/global-layout"},"system/dict/index":{"path":"system/dict","id":"system/dict/index","parentId":"@@/global-layout"},"system/file/index":{"path":"system/file","id":"system/file/index","parentId":"@@/global-layout"},"system/role/index":{"path":"system/role","id":"system/role/index","parentId":"@@/global-layout"},"system/user/index":{"path":"system/user","id":"system/user/index","parentId":"@@/global-layout"},"userCenter/manual":{"path":"userCenter/manual","id":"userCenter/manual","parentId":"@@/global-layout"},"system/api/index":{"path":"system/api","id":"system/api/index","parentId":"@@/global-layout"},"system/job/index":{"path":"system/job","id":"system/job/index","parentId":"@@/global-layout"},"system/log/index":{"path":"system/log","id":"system/log/index","parentId":"@@/global-layout"},"system/org/index":{"path":"system/org","id":"system/org/index","parentId":"@@/global-layout"},"system/role/perm":{"path":"system/role/perm","id":"system/role/perm","parentId":"@@/global-layout"},"userCenter/index":{"path":"userCenter","id":"userCenter/index","parentId":"@@/global-layout"},"system/api/perm":{"path":"system/api/perm","id":"system/api/perm","parentId":"@@/global-layout"},"test/views":{"path":"test/views","id":"test/views","parentId":"@@/global-layout"},"about":{"path":"about","id":"about","parentId":"@@/global-layout"},"index":{"path":"/","id":"index","parentId":"@@/global-layout"},"login":{"path":"login","id":"login","parentId":"@@/global-layout"},"@@/global-layout":{"id":"@@/global-layout","path":"/","isLayout":true}} as const;
|
|
23
23
|
return {
|
|
24
24
|
routes,
|
|
25
25
|
routeComponents: {
|
|
26
26
|
'404': React.lazy(() => import(/* webpackChunkName: "src__pages__404" */'../../../src/pages/404.jsx')),
|
|
27
27
|
'userCenter/ChangePassword': React.lazy(() => import(/* webpackChunkName: "src__pages__userCenter__ChangePassword" */'../../../src/pages/userCenter/ChangePassword.jsx')),
|
|
28
28
|
'system/sysManual/index': React.lazy(() => import(/* webpackChunkName: "src__pages__system__sysManual__index" */'../../../src/pages/system/sysManual/index.jsx')),
|
|
29
|
-
'system/dict/DictItem': React.lazy(() => import(/* webpackChunkName: "src__pages__system__dict__DictItem" */'../../../src/pages/system/dict/DictItem.jsx')),
|
|
30
29
|
'system/user/UserPerm': React.lazy(() => import(/* webpackChunkName: "src__pages__system__user__UserPerm" */'../../../src/pages/system/user/UserPerm.jsx')),
|
|
31
30
|
'userCenter/message': React.lazy(() => import(/* webpackChunkName: "src__pages__userCenter__message" */'../../../src/pages/userCenter/message.jsx')),
|
|
32
31
|
'system/api/ApiDoc': React.lazy(() => import(/* webpackChunkName: "src__pages__system__api__ApiDoc" */'../../../src/pages/system/api/ApiDoc.jsx')),
|
|
@@ -36,14 +35,12 @@ export async function getRoutes() {
|
|
|
36
35
|
'system/user/index': React.lazy(() => import(/* webpackChunkName: "src__pages__system__user__index" */'../../../src/pages/system/user/index.jsx')),
|
|
37
36
|
'userCenter/manual': React.lazy(() => import(/* webpackChunkName: "src__pages__userCenter__manual" */'../../../src/pages/userCenter/manual.jsx')),
|
|
38
37
|
'system/api/index': React.lazy(() => import(/* webpackChunkName: "src__pages__system__api__index" */'../../../src/pages/system/api/index.jsx')),
|
|
39
|
-
'system/dict/Dict': React.lazy(() => import(/* webpackChunkName: "src__pages__system__dict__Dict" */'../../../src/pages/system/dict/Dict.jsx')),
|
|
40
38
|
'system/job/index': React.lazy(() => import(/* webpackChunkName: "src__pages__system__job__index" */'../../../src/pages/system/job/index.jsx')),
|
|
41
39
|
'system/log/index': React.lazy(() => import(/* webpackChunkName: "src__pages__system__log__index" */'../../../src/pages/system/log/index.jsx')),
|
|
42
40
|
'system/org/index': React.lazy(() => import(/* webpackChunkName: "src__pages__system__org__index" */'../../../src/pages/system/org/index.jsx')),
|
|
43
41
|
'system/role/perm': React.lazy(() => import(/* webpackChunkName: "src__pages__system__role__perm" */'../../../src/pages/system/role/perm.jsx')),
|
|
44
42
|
'userCenter/index': React.lazy(() => import(/* webpackChunkName: "src__pages__userCenter__index" */'../../../src/pages/userCenter/index.jsx')),
|
|
45
43
|
'system/api/perm': React.lazy(() => import(/* webpackChunkName: "src__pages__system__api__perm" */'../../../src/pages/system/api/perm.jsx')),
|
|
46
|
-
'ureport/index': React.lazy(() => import(/* webpackChunkName: "src__pages__ureport__index" */'../../../src/pages/ureport/index.jsx')),
|
|
47
44
|
'test/views': React.lazy(() => import(/* webpackChunkName: "src__pages__test__views" */'../../../src/pages/test/views.jsx')),
|
|
48
45
|
'about': React.lazy(() => import(/* webpackChunkName: "src__pages__about" */'../../../src/pages/about.jsx')),
|
|
49
46
|
'index': React.lazy(() => import(/* webpackChunkName: "src__pages__index" */'../../../src/pages/index.jsx')),
|
|
@@ -7,10 +7,10 @@ export type { RuntimeConfig } from './core/defineApp'
|
|
|
7
7
|
// plugins
|
|
8
8
|
// plugins types.d.ts
|
|
9
9
|
// @umijs/renderer-*
|
|
10
|
-
export { createBrowserHistory, createHashHistory, createMemoryHistory, Helmet, HelmetProvider, createSearchParams, generatePath, matchPath, matchRoutes, Navigate, NavLink, Outlet, resolvePath, useLocation, useMatch, useNavigate, useOutlet, useOutletContext, useParams, useResolvedPath, useRoutes, useSearchParams, useAppData, useClientLoaderData, useLoaderData, useRouteProps, useSelectedRoutes, useServerLoaderData, renderClient, __getRoot, Link, useRouteData, __useFetcher, withRouter } from '/home/runner/work/open-admin/open-admin/web/node_modules/.pnpm/@umijs+renderer-react@4.6.
|
|
11
|
-
export type { History, ClientLoader } from '/home/runner/work/open-admin/open-admin/web/node_modules/.pnpm/@umijs+renderer-react@4.6.
|
|
10
|
+
export { createBrowserHistory, createHashHistory, createMemoryHistory, Helmet, HelmetProvider, createSearchParams, generatePath, matchPath, matchRoutes, Navigate, NavLink, Outlet, resolvePath, useLocation, useMatch, useNavigate, useOutlet, useOutletContext, useParams, useResolvedPath, useRoutes, useSearchParams, useAppData, useClientLoaderData, useLoaderData, useRouteProps, useSelectedRoutes, useServerLoaderData, renderClient, __getRoot, Link, useRouteData, __useFetcher, withRouter } from '/home/runner/work/open-admin/open-admin/web/node_modules/.pnpm/@umijs+renderer-react@4.6.27_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@umijs/renderer-react';
|
|
11
|
+
export type { History, ClientLoader } from '/home/runner/work/open-admin/open-admin/web/node_modules/.pnpm/@umijs+renderer-react@4.6.27_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@umijs/renderer-react'
|
|
12
12
|
// umi/client/client/plugin
|
|
13
|
-
export { ApplyPluginsType, PluginManager } from '/home/runner/work/open-admin/open-admin/web/node_modules/.pnpm/umi@4.6.
|
|
13
|
+
export { ApplyPluginsType, PluginManager } from '/home/runner/work/open-admin/open-admin/web/node_modules/.pnpm/umi@4.6.27_@babel+core@7.29.0_@types+node@25.2.2_@types+react@19.2.13_eslint@8.57.1_les_d0ba19fded3380f9860374cae6a91455/node_modules/umi/client/client/plugin.js';
|
|
14
14
|
export { history, createHistory } from './core/history';
|
|
15
15
|
export { terminal } from './core/terminal';
|
|
16
16
|
// react ssr
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// DO NOT CHANGE IT MANUALLY!
|
|
4
4
|
import React, { useEffect, useState } from 'react';
|
|
5
5
|
import { ApplyPluginsType } from 'umi';
|
|
6
|
-
import { renderClient, RenderClientOpts } from '/home/runner/work/open-admin/open-admin/web/node_modules/.pnpm/@umijs+renderer-react@4.6.
|
|
6
|
+
import { renderClient, RenderClientOpts } from '/home/runner/work/open-admin/open-admin/web/node_modules/.pnpm/@umijs+renderer-react@4.6.27_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@umijs/renderer-react';
|
|
7
7
|
import { createHistory } from './core/history';
|
|
8
8
|
import { createPluginManager } from './core/plugin';
|
|
9
9
|
import { getRoutes } from './core/route';
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"src/.umi/*"
|
|
28
28
|
],
|
|
29
29
|
"umi": [
|
|
30
|
-
"../../node_modules/.pnpm/umi@4.6.
|
|
30
|
+
"../../node_modules/.pnpm/umi@4.6.27_@babel+core@7.29.0_@types+node@25.2.2_@types+react@19.2.13_eslint@8.57.1_les_d0ba19fded3380f9860374cae6a91455/node_modules/umi"
|
|
31
31
|
],
|
|
32
32
|
"umi/typings": [
|
|
33
33
|
"src/.umi/typings"
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// DO NOT CHANGE IT MANUALLY!
|
|
4
4
|
import './core/polyfill';
|
|
5
5
|
|
|
6
|
-
import { renderClient } from '/home/runner/work/open-admin/open-admin/web/node_modules/.pnpm/@umijs+renderer-react@4.6.
|
|
6
|
+
import { renderClient } from '/home/runner/work/open-admin/open-admin/web/node_modules/.pnpm/@umijs+renderer-react@4.6.27_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@umijs/renderer-react';
|
|
7
7
|
import { getRoutes } from './core/route';
|
|
8
8
|
import { createPluginManager } from './core/plugin';
|
|
9
9
|
import { createHistory } from './core/history';
|
|
@@ -78,6 +78,6 @@ render();
|
|
|
78
78
|
|
|
79
79
|
if (typeof window !== 'undefined') {
|
|
80
80
|
window.g_umi = {
|
|
81
|
-
version: '4.6.
|
|
81
|
+
version: '4.6.27',
|
|
82
82
|
};
|
|
83
83
|
}
|
|
@@ -6,7 +6,8 @@ export function FieldDictSelect(props) {
|
|
|
6
6
|
const {value, onChange, typeCode, ...rest} = props;
|
|
7
7
|
const options = DictUtils.dictOptions(typeCode);
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
|
|
10
|
+
return <Select value={String(value)}
|
|
10
11
|
onChange={onChange}
|
|
11
12
|
style={{width: '100%', minWidth: 200}}
|
|
12
13
|
options={options}
|
|
@@ -9,7 +9,7 @@ export class LoginPageUtils {
|
|
|
9
9
|
static postLogin(values) {
|
|
10
10
|
return new Promise((resolve, reject) => {
|
|
11
11
|
console.log('开始登录')
|
|
12
|
-
HttpUtils.
|
|
12
|
+
HttpUtils.post('/admin/auth/login', values).then(rs => {
|
|
13
13
|
console.log('登录结果', rs)
|
|
14
14
|
EventBusUtils.emit('loginSuccess')
|
|
15
15
|
let redirect = LoginPageUtils.getRedirect();
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
// 假设的类型定义,你需要确保与你的实际数据结构匹配
|
|
2
2
|
import {SysUtils} from "./SysUtils";
|
|
3
|
+
// 假设 SysUtil 和 StrUtil 的引入和类型
|
|
4
|
+
// 实际使用时需要确保路径和模块存在
|
|
5
|
+
import {Tag} from 'antd';
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import {StringUtils} from "../StringUtils";
|
|
3
8
|
|
|
4
9
|
export interface DictItem {
|
|
5
10
|
value: string | number;
|
|
@@ -8,15 +13,9 @@ export interface DictItem {
|
|
|
8
13
|
}
|
|
9
14
|
|
|
10
15
|
|
|
11
|
-
// 假设 SysUtil 和 StrUtil 的引入和类型
|
|
12
|
-
// 实际使用时需要确保路径和模块存在
|
|
13
|
-
import {Tag} from 'antd';
|
|
14
|
-
import React from 'react';
|
|
15
|
-
import {StringUtils} from "../StringUtils";
|
|
16
|
-
|
|
17
16
|
// 字典选项的格式
|
|
18
17
|
export interface DictOption {
|
|
19
|
-
value: string|number;
|
|
18
|
+
value: string | number;
|
|
20
19
|
label: string;
|
|
21
20
|
}
|
|
22
21
|
|
|
@@ -76,7 +75,7 @@ export class DictUtils {
|
|
|
76
75
|
* @param code 字典项编码
|
|
77
76
|
* @returns Antd Tag 元素或纯字符串名称或空字符串
|
|
78
77
|
*/
|
|
79
|
-
public static dictTag(typeCode: string, code: string | number
|
|
78
|
+
public static dictTag(typeCode: string, code: string | number): React.ReactElement | string {
|
|
80
79
|
if (typeCode == null || code == null) {
|
|
81
80
|
return null;
|
|
82
81
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {Badge, Layout, Menu, Watermark} from 'antd';
|
|
2
|
+
import {Badge, Layout, Menu, Spin, Watermark} from 'antd';
|
|
3
3
|
|
|
4
4
|
import {history, Link} from 'umi';
|
|
5
5
|
import "./index.less"
|
|
@@ -20,12 +20,15 @@ export default class extends React.Component {
|
|
|
20
20
|
menuTree: [],
|
|
21
21
|
menuMap: {},
|
|
22
22
|
pathMenuMap: {},
|
|
23
|
+
defaultOpenKeys: null,
|
|
24
|
+
menuLoading:true,
|
|
23
25
|
|
|
24
26
|
|
|
25
27
|
currentMenuKey: null,
|
|
26
28
|
|
|
27
29
|
|
|
28
30
|
siteInfo: {},
|
|
31
|
+
|
|
29
32
|
}
|
|
30
33
|
|
|
31
34
|
|
|
@@ -43,9 +46,11 @@ export default class extends React.Component {
|
|
|
43
46
|
|
|
44
47
|
|
|
45
48
|
initMenu = () => {
|
|
49
|
+
this.setState({menuLoading: true})
|
|
46
50
|
HttpUtils.get('/admin/menuInfo').then(info => {
|
|
47
51
|
const {menuTree, pathMenuMap, menuMap} = info
|
|
48
|
-
|
|
52
|
+
const defaultOpenKeys = [menuTree.find(e => e.children != null).key]; //打开第一个文件夹
|
|
53
|
+
this.setState({menuMap, defaultOpenKeys})
|
|
49
54
|
|
|
50
55
|
let pathname = PageUtils.currentPathname();
|
|
51
56
|
|
|
@@ -63,6 +68,8 @@ export default class extends React.Component {
|
|
|
63
68
|
this.setState({menuTree, pathMenuMap})
|
|
64
69
|
|
|
65
70
|
this.loadBadge(menuMap)
|
|
71
|
+
}).finally(()=>{
|
|
72
|
+
this.setState({menuLoading: false})
|
|
66
73
|
})
|
|
67
74
|
|
|
68
75
|
|
|
@@ -114,25 +121,12 @@ export default class extends React.Component {
|
|
|
114
121
|
<Gap/>
|
|
115
122
|
|
|
116
123
|
|
|
117
|
-
|
|
118
|
-
theme='dark'
|
|
119
|
-
mode="inline"
|
|
120
|
-
className='left-menu'
|
|
121
|
-
onClick={({key}) => {
|
|
122
|
-
const menu = this.state.menuMap[key]
|
|
123
|
-
let {path} = menu;
|
|
124
|
-
this.setState({currentMenuKey: key})
|
|
125
|
-
history.push(path)
|
|
126
|
-
}}
|
|
127
|
-
selectedKeys={[this.state.currentMenuKey]}
|
|
128
|
-
inlineIndent={16}
|
|
129
|
-
>
|
|
130
|
-
</Menu>
|
|
124
|
+
{this.renderLeftMenu()}
|
|
131
125
|
|
|
132
126
|
</Sider>
|
|
133
127
|
|
|
134
128
|
<Content id='admin-layout-content'>
|
|
135
|
-
{this.
|
|
129
|
+
{this.renderCenterContent(loginInfo)}
|
|
136
130
|
</Content>
|
|
137
131
|
|
|
138
132
|
</Layout>
|
|
@@ -140,7 +134,28 @@ export default class extends React.Component {
|
|
|
140
134
|
}
|
|
141
135
|
|
|
142
136
|
|
|
143
|
-
|
|
137
|
+
renderLeftMenu() {
|
|
138
|
+
if(this.state.menuLoading){
|
|
139
|
+
return <Spin />
|
|
140
|
+
}
|
|
141
|
+
return <Menu items={this.state.menuTree}
|
|
142
|
+
theme='dark'
|
|
143
|
+
mode="inline"
|
|
144
|
+
className='left-menu'
|
|
145
|
+
defaultOpenKeys={this.state.defaultOpenKeys}
|
|
146
|
+
onClick={({key}) => {
|
|
147
|
+
const menu = this.state.menuMap[key]
|
|
148
|
+
let {path} = menu;
|
|
149
|
+
this.setState({currentMenuKey: key})
|
|
150
|
+
history.push(path)
|
|
151
|
+
}}
|
|
152
|
+
selectedKeys={[this.state.currentMenuKey]}
|
|
153
|
+
inlineIndent={16}
|
|
154
|
+
>
|
|
155
|
+
</Menu>;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
renderCenterContent = () => {
|
|
144
159
|
const {siteInfo, loginInfo} = this.state
|
|
145
160
|
if (this.state.menuTree.length === 0) { // 加载菜单中
|
|
146
161
|
return <></>
|
|
@@ -41,7 +41,7 @@ export default class extends React.Component {
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
handleDelete = record => {
|
|
44
|
-
HttpUtils.
|
|
44
|
+
HttpUtils.post('admin/apiAccount/delete', {id: record.id}).then(rs => {
|
|
45
45
|
this.tableRef.current.reload()
|
|
46
46
|
})
|
|
47
47
|
}
|
|
@@ -1,25 +1,201 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
2
|
+
import {Button, Form, Input, InputNumber, Modal, Popconfirm, Splitter, Tag, Tree, Typography} from "antd";
|
|
3
|
+
import {
|
|
4
|
+
ButtonList,
|
|
5
|
+
FieldBoolean, FieldDictSelect,
|
|
6
|
+
HttpUtils,
|
|
7
|
+
Page,
|
|
8
|
+
PageLoading,
|
|
9
|
+
ProTable,
|
|
10
|
+
ViewBooleanEnableDisable
|
|
11
|
+
} from "../../../framework";
|
|
12
|
+
import {PlusOutlined} from "@ant-design/icons";
|
|
5
13
|
|
|
6
14
|
export default class extends React.Component {
|
|
7
15
|
|
|
8
16
|
state = {
|
|
9
|
-
|
|
17
|
+
treeData: [],
|
|
18
|
+
treeLoading: true,
|
|
19
|
+
typeCode: null,
|
|
20
|
+
formValues: {},
|
|
21
|
+
formOpen: false
|
|
10
22
|
}
|
|
11
23
|
|
|
24
|
+
formRef = React.createRef()
|
|
25
|
+
tableRef = React.createRef()
|
|
26
|
+
|
|
27
|
+
async componentDidMount() {
|
|
28
|
+
const treeData = await HttpUtils.get('admin/dict/tree');
|
|
29
|
+
this.setState({treeData, treeLoading: false});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
onSelect = (selectedKeys) => {
|
|
33
|
+
const key = selectedKeys.length === 1 ? selectedKeys[0] : null;
|
|
34
|
+
this.setState({typeCode: key}, () => {
|
|
35
|
+
this.tableRef.current.reload()
|
|
36
|
+
})
|
|
37
|
+
}
|
|
38
|
+
handleAdd = () => {
|
|
39
|
+
this.setState({formOpen: true, formValues: {}})
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
handleEdit = record => {
|
|
43
|
+
this.setState({formOpen: true, formValues: record})
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
onFinish = values => {
|
|
47
|
+
values.sysDict = {id: this.props.sysDictId}
|
|
48
|
+
HttpUtils.post('admin/dict/save', values).then(rs => {
|
|
49
|
+
this.setState({formOpen: false})
|
|
50
|
+
this.tableRef.current.reload()
|
|
51
|
+
})
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
handleDelete = row => {
|
|
55
|
+
HttpUtils.post('admin/dict/delete', row).then(rs => {
|
|
56
|
+
this.tableRef.current.reload()
|
|
57
|
+
})
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
columns = [
|
|
61
|
+
{
|
|
62
|
+
title: '文本',
|
|
63
|
+
dataIndex: 'name',
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
title: '编码',
|
|
67
|
+
dataIndex: 'code',
|
|
68
|
+
},
|
|
69
|
+
|
|
70
|
+
{
|
|
71
|
+
title: '启用',
|
|
72
|
+
dataIndex: 'enabled',
|
|
73
|
+
render(v) {
|
|
74
|
+
return <ViewBooleanEnableDisable value={v}/>
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
title: '显示颜色',
|
|
80
|
+
dataIndex: 'color',
|
|
81
|
+
render(v) {
|
|
82
|
+
if (v) {
|
|
83
|
+
return <Tag color={v.toLowerCase()}>{v}</Tag>
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
|
|
89
|
+
{
|
|
90
|
+
title: '序号',
|
|
91
|
+
dataIndex: 'seq',
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
title: '操作',
|
|
95
|
+
dataIndex: 'option',
|
|
96
|
+
render: (_, record) => {
|
|
97
|
+
|
|
98
|
+
return (
|
|
99
|
+
<ButtonList>
|
|
100
|
+
<Button size='small' perm='sysDict:save'
|
|
101
|
+
onClick={() => this.handleEdit(record)}> 编辑 </Button>
|
|
102
|
+
<Popconfirm perm='sysDict:delete' title='是否确定删除字典项'
|
|
103
|
+
onConfirm={() => this.handleDelete(record)}>
|
|
104
|
+
<Button size='small'>删除</Button>
|
|
105
|
+
</Popconfirm>
|
|
106
|
+
</ButtonList>
|
|
107
|
+
);
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
]
|
|
12
111
|
|
|
13
112
|
render() {
|
|
14
|
-
|
|
15
|
-
<
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
113
|
+
if (this.state.treeLoading) {
|
|
114
|
+
return <PageLoading/>
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
return <Page>
|
|
118
|
+
<Splitter>
|
|
119
|
+
<Splitter.Panel defaultSize={600} style={{paddingRight: 16}}>
|
|
120
|
+
<Tree
|
|
121
|
+
treeData={this.state.treeData}
|
|
122
|
+
onSelect={this.onSelect}
|
|
22
123
|
|
|
124
|
+
showIcon
|
|
125
|
+
blockNode
|
|
126
|
+
showLine
|
|
127
|
+
defaultExpandAll
|
|
128
|
+
>
|
|
129
|
+
</Tree>
|
|
130
|
+
</Splitter.Panel>
|
|
131
|
+
<Splitter.Panel style={{paddingLeft: 16}}>
|
|
132
|
+
{this.renderTypeInfo()}
|
|
133
|
+
<ProTable
|
|
134
|
+
rowKey='code'
|
|
135
|
+
actionRef={this.tableRef}
|
|
136
|
+
toolBarRender={() => {
|
|
137
|
+
return <ButtonList>
|
|
138
|
+
<Button perm='sysDict:save' type='primary' onClick={this.handleAdd} disabled={!this.state.typeCode}>
|
|
139
|
+
<PlusOutlined/> 新增
|
|
140
|
+
</Button>
|
|
141
|
+
</ButtonList>
|
|
142
|
+
}}
|
|
143
|
+
request={(params) => {
|
|
144
|
+
params.typeCode = this.state.typeCode
|
|
145
|
+
return HttpUtils.get('admin/dict/page', params);
|
|
146
|
+
}}
|
|
147
|
+
columns={this.columns}
|
|
148
|
+
search={false}
|
|
149
|
+
/>
|
|
150
|
+
</Splitter.Panel>
|
|
151
|
+
</Splitter>
|
|
152
|
+
<Modal
|
|
153
|
+
title='编辑数据字典项'
|
|
154
|
+
open={this.state.formOpen}
|
|
155
|
+
onOk={() => this.formRef.current.submit()}
|
|
156
|
+
onCancel={() => this.setState({formOpen: false})}
|
|
157
|
+
destroyOnHidden
|
|
158
|
+
>
|
|
159
|
+
|
|
160
|
+
<Form ref={this.formRef} labelCol={{flex: '100px'}}
|
|
161
|
+
initialValues={this.state.formValues}
|
|
162
|
+
onFinish={this.onFinish}>
|
|
163
|
+
<Form.Item name='id' noStyle></Form.Item>
|
|
164
|
+
<Form.Item label='类型编码' name='typeCode' rules={[{required: true}]} initialValue={this.state.typeCode}>
|
|
165
|
+
<Input/>
|
|
166
|
+
</Form.Item>
|
|
167
|
+
<Form.Item label='编码' name='code' rules={[{required: true}]}>
|
|
168
|
+
<Input/>
|
|
169
|
+
</Form.Item>
|
|
170
|
+
<Form.Item label='文本' name='name' rules={[{required: true}]} >
|
|
171
|
+
<Input/>
|
|
172
|
+
</Form.Item>
|
|
173
|
+
<Form.Item label='颜色' name='color' rules={[{required: true}]}>
|
|
174
|
+
<FieldDictSelect typeCode='statusColor' />
|
|
175
|
+
</Form.Item>
|
|
176
|
+
<Form.Item label='序号' name='seq' rules={[{required: true}]}>
|
|
177
|
+
<InputNumber/>
|
|
178
|
+
</Form.Item>
|
|
179
|
+
|
|
180
|
+
<Form.Item label='启用' name='enabled' rules={[{required: true}]}>
|
|
181
|
+
<FieldBoolean/>
|
|
182
|
+
</Form.Item>
|
|
183
|
+
|
|
184
|
+
</Form>
|
|
185
|
+
</Modal>
|
|
186
|
+
</Page>
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
}
|
|
23
190
|
|
|
191
|
+
renderTypeInfo() {
|
|
192
|
+
if(this.state.typeCode){
|
|
193
|
+
return <>
|
|
194
|
+
<Typography.Text italic> 类型:</Typography.Text>
|
|
195
|
+
<Typography.Text copyable>
|
|
196
|
+
{this.state.typeCode}
|
|
197
|
+
</Typography.Text>
|
|
198
|
+
</>;
|
|
199
|
+
}
|
|
24
200
|
}
|
|
25
201
|
}
|
|
@@ -14,7 +14,7 @@ export default class extends React.Component {
|
|
|
14
14
|
formRef = React.createRef()
|
|
15
15
|
|
|
16
16
|
handleDelete = row => {
|
|
17
|
-
HttpUtils.
|
|
17
|
+
HttpUtils.post('admin/sysFile/delete', row).then(rs => {
|
|
18
18
|
this.tableRef.current.reload()
|
|
19
19
|
})
|
|
20
20
|
}
|
|
@@ -92,7 +92,7 @@ export default class extends React.Component {
|
|
|
92
92
|
|
|
93
93
|
handleDelete = row => {
|
|
94
94
|
const hide = message.loading("删除作业中...")
|
|
95
|
-
HttpUtils.
|
|
95
|
+
HttpUtils.post('admin/job/delete', {id: row.id}).then(rs => {
|
|
96
96
|
this.tableRef.current.reload();
|
|
97
97
|
}).catch(hide)
|
|
98
98
|
}
|
|
@@ -52,7 +52,7 @@ export default class extends React.Component {
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
handleDelete = record => {
|
|
55
|
-
HttpUtils.
|
|
55
|
+
HttpUtils.post('admin/sysOrg/delete', {id: record.id})
|
|
56
56
|
.then(rs => {
|
|
57
57
|
this.setState({formValues: null})
|
|
58
58
|
this.loadTree()
|
|
@@ -146,8 +146,7 @@ export default class extends React.Component {
|
|
|
146
146
|
onDrop={this.onDrop}
|
|
147
147
|
showLine
|
|
148
148
|
defaultExpandAll
|
|
149
|
-
|
|
150
|
-
</Tree>
|
|
149
|
+
/>
|
|
151
150
|
{this.state.treeData.length === 0 && <Empty/>}
|
|
152
151
|
</Card>
|
|
153
152
|
</Splitter.Panel>
|
|
@@ -52,7 +52,7 @@ export default class extends React.Component {
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
handleDelete = record => {
|
|
55
|
-
HttpUtils.
|
|
55
|
+
HttpUtils.post('admin/sysRole/delete', {id: record.id}).then(rs => {
|
|
56
56
|
this.tableRef.current.reload()
|
|
57
57
|
})
|
|
58
58
|
}
|
|
@@ -173,7 +173,6 @@ export default class extends React.Component {
|
|
|
173
173
|
menuIds: [...this.state.menuChecked, ...this.state.menuHalfChecked]
|
|
174
174
|
}
|
|
175
175
|
HttpUtils.post('admin/sysRole/grantMenu', params).then(rs => {
|
|
176
|
-
debugger
|
|
177
176
|
this.setState({menuOpen: false})
|
|
178
177
|
})
|
|
179
178
|
}
|
|
@@ -30,7 +30,7 @@ export default class extends React.Component {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
handleDelete = record => {
|
|
33
|
-
HttpUtils.
|
|
33
|
+
HttpUtils.post('admin/sysManual/delete', {id: record.id}).then(rs => {
|
|
34
34
|
this.tableRef.current.reload()
|
|
35
35
|
})
|
|
36
36
|
}
|