Skip to content

Commit 18832dc

Browse files
author
zengqiao
committed
前端调整
1 parent 5262ae8 commit 18832dc

File tree

31 files changed

+369
-405
lines changed

31 files changed

+369
-405
lines changed

km-console/.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,6 @@ module.exports = {
2929
'@typescript-eslint/no-var-requires': 0,
3030
'prettier/prettier': 2, // 这项配置 对于不符合prettier规范的写法,eslint会提示报错
3131
'no-console': 1,
32+
'react/display-name': 0,
3233
},
3334
};

km-console/README.md

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,43 @@
11
## 安装项目依赖
22

3-
* 安装lerna
3+
- 安装 lerna
4+
45
```
5-
npm i -g lerna
6+
npm install -g lerna
7+
```
8+
9+
- 安装项目依赖
10+
11+
```
12+
npm run i
613
```
714

815
## 启动项目
16+
917
```
1018
npm run start
1119
```
20+
1221
### 环境信息
22+
1323
http://localhost:port
1424

1525
## 构建项目
26+
1627
```
1728
npm run build
1829
19-
```
30+
```
31+
32+
## 目录结构
33+
34+
- packages
35+
- layout-clusters-fe: 基座应用 & 多集群管理
36+
- config-manager-fe: 子应用 - 系统管理
37+
- tool: 启动 & 打包脚本
38+
- ...
39+
40+
## 常见问题
41+
42+
Q: 执行 `npm run start` 时看不到应用构建和热加载过程?
43+
A: 需要到具体的应用中执行 `npm run start`,例如 `cd packages/layout-clusters-fe` 后,执行 `npm run start`
Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,40 @@
1-
# `logi-fe`
1+
## 使用说明
22

3-
> TODO: description
3+
### 依赖安装:
44

5-
## Usage
5+
```
6+
npm install
7+
```
68

7-
### 启动
8-
* npm i @didi/d1-cli -g
9-
* d1 start
9+
### 启动:
1010

11-
### 常见问题
11+
```
12+
npm run start
13+
```
14+
15+
### 构建:
16+
17+
```
18+
npm run build
19+
```
20+
21+
构建后的代码默认会存放到项目根路径下 `km-rest/src/main/resources/templates/config` 文件夹里
22+
23+
## 目录结构
24+
25+
- config: 开发 & 构建配置
26+
- theme.js: antd 主题配置
27+
- d1-webpack.base.js: webpack 基础配置
28+
- src:源代码所在目录
29+
- @types: TypeScript 全局类型声明
30+
- api: 请求定义
31+
- assets:全局资源 img、css
32+
- components:公共组件
33+
- constants: 全局配置、通用方法
34+
- locales: 国际化语言
35+
- pages: 路由匹配的页面组件
36+
- app.tsx: 菜单、路由配置组件
37+
- index.html: 单页
38+
- index.tsx: 入口文件
39+
- tsconfig.json: TypeScript 配置
40+
- webpack.config.js: webpack 配置入口

km-console/packages/config-manager-fe/config/d1-spa-webpack.js

Lines changed: 0 additions & 37 deletions
This file was deleted.

km-console/packages/config-manager-fe/src/@types/index.d.ts

Whitespace-only changes.

km-console/packages/config-manager-fe/src/api/constant.ts

Lines changed: 0 additions & 7 deletions
This file was deleted.

km-console/packages/config-manager-fe/src/pages/UserManage/RoleTabContent.tsx

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,8 @@ export default (props: { curTabKey: string }): JSX.Element => {
376376
const [pagination, setPagination] = useState<any>(defaultPagination);
377377
const [loading, setLoading] = useState<boolean>(true);
378378
const [deleteBtnLoading, setDeleteBtnLoading] = useState<number>(-1);
379-
const [form] = Form.useForm();
379+
const [searchKeywords, setSearchKeywords] = useState('');
380+
const [searchKeywordsInput, setSearchKeywordsInput] = useState('');
380381
const detailRef = useRef(null);
381382
const assignRolesRef = useRef(null);
382383

@@ -472,11 +473,10 @@ export default (props: { curTabKey: string }): JSX.Element => {
472473
];
473474

474475
const getRoleList = (query = {}) => {
475-
const formData = form.getFieldsValue();
476476
const data = {
477477
page: pagination.current,
478478
size: pagination.pageSize,
479-
...formData,
479+
roleName: searchKeywords,
480480
...query,
481481
};
482482

@@ -582,19 +582,33 @@ export default (props: { curTabKey: string }): JSX.Element => {
582582
}
583583
}, [curTabKey]);
584584

585+
useEffect(() => {
586+
(searchKeywords || searchKeywords === '') && getRoleList({ pageNo: 1 });
587+
}, [searchKeywords]);
588+
585589
return (
586590
<>
587-
<div className="operate-bar">
588-
<Form form={form} layout="inline" onFinish={() => getRoleList({ page: 1 })}>
589-
<Form.Item name="roleName">
590-
<Input placeholder="请输入角色名称" />
591-
</Form.Item>
592-
<Form.Item>
593-
<Button type="primary" ghost htmlType="submit">
594-
查询
595-
</Button>
596-
</Form.Item>
597-
</Form>
591+
<div className="operate-bar-right">
592+
<Input
593+
className="search-input"
594+
suffix={
595+
<IconFont
596+
type="icon-fangdajing"
597+
onClick={(_) => {
598+
setSearchKeywords(searchKeywordsInput);
599+
}}
600+
style={{ fontSize: '16px' }}
601+
/>
602+
}
603+
placeholder="请输入角色名称"
604+
value={searchKeywordsInput}
605+
onPressEnter={(_) => {
606+
setSearchKeywords(searchKeywordsInput);
607+
}}
608+
onChange={(e) => {
609+
setSearchKeywordsInput(e.target.value);
610+
}}
611+
/>
598612
{global.hasPermission && global.hasPermission(ConfigPermissionMap.ROLE_ADD) ? (
599613
<Button
600614
type="primary"

km-console/packages/config-manager-fe/src/pages/UserManage/index.less

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,13 @@
4444
.role-tab-assign-user .desc-row {
4545
margin-bottom: 24px;
4646
}
47+
48+
.operate-bar-right {
49+
display: flex;
50+
justify-content: right;
51+
margin-bottom: 12px;
52+
.search-input {
53+
width: 248px;
54+
margin-right: 8px;
55+
}
56+
}
Lines changed: 32 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,45 @@
1-
## Usage
1+
## 使用说明
2+
3+
### 依赖安装:
4+
5+
```
6+
npm install
7+
```
28

39
### 启动:
4-
* 招行环境执行 npm start
5-
* 内部环境执行 npm run start:inner
10+
11+
```
12+
npm run start
13+
```
614

715
### 构建:
8-
* 招行环境执行 npm build
9-
* 内部环境执行 npm run build:inner
1016

11-
构建后的代码默认会存放到 `../pub` 文件夹里
17+
```
18+
npm run build
19+
```
1220

13-
### 部署
14-
* 内部环境:代码提交主干后会自动触发打包部署至http://10.190.14.125:8016
21+
构建后的代码默认会存放到项目根路径下 `km-rest/src/main/resources/templates/layout` 文件夹里
1522

1623
## 目录结构
1724

1825
- config: 开发 & 构建配置
19-
- theme.js:antd 主题配置
20-
- webpack.dev.config.js:webpack 开发环境补充配置,覆盖默认配置
21-
- webpack.build.config.js:webpack 构建补充配置,覆盖默认配置
22-
- webpackConfigResolveAlias.js 文件路径别名配置
26+
- theme.js: antd 主题配置
27+
- registerApps.js: SPA 注册
28+
- systemsConfig.js: 子应用配置
29+
- d1-webpack.base.js: webpack 基础配置
30+
- CoverHtmlWebpackPlugin.js: 输出 html 内容
31+
- CountComponentWebpackPlugin.js: 计算 knowdesign 组件引用次数
32+
- webpackConfigResolveAlias.js: 文件路径别名配置
2333
- src:源代码所在目录
34+
- @types: TypeScript 全局类型声明
35+
- api: 请求定义
2436
- assets:全局资源 img、css
25-
- common: 全局配置、通用方法
2637
- components:公共组件
27-
- pages:路由匹配的页面组件
28-
- app.jsx 菜单、路由配置组件
29-
- index.html:单页
30-
- index.jsx:入口文件
31-
- fetk.config.js 开发工具配置页面
32-
38+
- constants: 全局配置、通用方法
39+
- locales: 国际化语言
40+
- pages: 路由匹配的页面组件
41+
- app.tsx: 菜单、路由配置组件
42+
- index.html: 单页
43+
- index.tsx: 入口文件
44+
- tsconfig.json: TypeScript 配置
45+
- webpack.config.js: webpack 配置入口

km-console/packages/layout-clusters-fe/src/common/api.tsx

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)