Skip to content

Commit c177f0e

Browse files
authored
Merge pull request #99 from codingapi/dev
Dev
2 parents b0bcd99 + ecc155b commit c177f0e

File tree

17 files changed

+112
-31
lines changed

17 files changed

+112
-31
lines changed

admin-ui/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
"@ant-design/icons": "^5.4.0",
77
"@ant-design/pro-components": "^2.8.7",
88
"@babel/standalone": "^7.25.6",
9-
"@codingapi/flow-pc": "^0.0.8",
10-
"@codingapi/form-pc": "^0.0.16",
11-
"@codingapi/ui-framework": "^0.0.12",
9+
"@codingapi/flow-pc": "^0.0.17",
10+
"@codingapi/form-pc": "^0.0.17",
11+
"@codingapi/ui-framework": "^0.0.17",
1212
"@dnd-kit/core": "^6.2.0",
1313
"@dnd-kit/sortable": "^9.0.0",
1414
"@handsontable/react-wrapper": "^15.0.0",

admin-ui/src/config/menus.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export const menus = [
2424
{
2525
path: '/mirco',
2626
name: '微前端',
27-
icon: "FormOutlined",
27+
icon: "AppstoreOutlined",
2828
page: 'mirco',
2929
},
3030
{

admin-ui/src/pages/flow/leave/LeaveForm.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
import React, {useEffect} from "react";
2-
import {FlowFormViewProps} from "@codingapi/ui-framework";
3-
import {Form,FormInput,FormTextArea} from "@codingapi/form-pc";
4-
import {ValidateUtils} from "@codingapi/ui-framework";
2+
import {FlowFormViewProps, ValidateUtils} from "@codingapi/ui-framework";
3+
import {Form, FormInput, FormTextArea} from "@codingapi/form-pc";
54

65
const LeaveForm: React.FC<FlowFormViewProps> = (props) => {
76

87
useEffect(() => {
98
if (props.dataVersion && props.data) {
10-
console.log('data',props.data);
9+
console.log('data', props.data);
1110
props.form?.setFieldsValue({
1211
...props.data
1312
});
@@ -33,8 +32,8 @@ const LeaveForm: React.FC<FlowFormViewProps> = (props) => {
3332
<FormInput
3433
name={"days"}
3534
label={"请假天数"}
36-
inputType={"number"}
37-
required={true}
35+
inputType={"number"}
36+
required={true}
3837
validateFunction={ValidateUtils.validateNotEmpty}
3938
/>
4039

admin-ui/src/pages/flow/user/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ const UserPage = () => {
182182
<Modal
183183
title={"编辑用户"}
184184
open={visible}
185+
destroyOnHidden={true}
185186
onClose={()=>{
186187
setVisible(false);
187188
}}

admin-ui/src/pages/flow/user/select.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const UserSelect:React.FC<UserSelectProps> = (props) => {
4343
open={props.visible}
4444
onCancel={() => props.setVisible(false)}
4545
onClose={() => props.setVisible(false)}
46-
destroyOnClose={true}
46+
destroyOnHidden={true}
4747
title={"选择用户"}
4848
onOk={() => {
4949
if (props.onSelect) {

admin-ui/src/pages/flow/work/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ const FlowPage = () => {
195195
data-testid={"flow-editor"}
196196
title="编辑流程"
197197
open={editorVisible}
198-
destroyOnClose={true}
198+
destroyOnHidden={true}
199199
onClose={()=>{
200200
setEditorVisible(false)
201201
}}

admin-ui/src/pages/flow/work/select.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ const FlowSelect: React.FC<FlowSelectProps> = (props) => {
6363
open={props.visible}
6464
onCancel={() => props.setVisible(false)}
6565
onClose={() => props.setVisible(false)}
66-
destroyOnClose={true}
66+
destroyOnHidden={true}
6767
title={"选择流程"}
6868
onOk={() => {
6969
if (props.onSelect) {

admin-ui/src/pages/form/index.tsx

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,25 @@ import React from 'react';
22
import {PageContainer} from "@ant-design/pro-components";
33
import {Button, Col, message, Row} from "antd";
44
import {
5+
Form,
6+
FormCaptcha,
57
FormCascader,
8+
FormCheckbox,
69
FormCode,
710
FormColor,
811
FormDate,
12+
FormInput,
13+
FormPassword,
914
FormRadio,
1015
FormRate,
1116
FormSelect,
1217
FormSlider,
1318
FormStepper,
1419
FormSwitch,
1520
FormTextArea,
16-
FormUploader,
17-
FormCheckbox,
18-
FormCaptcha,
19-
FormPassword,
20-
FormInput,
21-
Form
21+
FormUploader
2222
} from "@codingapi/form-pc";
23-
import {FormInstance,FormField} from "@codingapi/ui-framework";
23+
import {FormField, FormInstance} from "@codingapi/ui-framework";
2424

2525

2626
const FooterButtons: React.FC<{ formInstance: FormInstance }> = ({formInstance}) => {
@@ -69,7 +69,12 @@ const FooterButtons: React.FC<{ formInstance: FormInstance }> = ({formInstance})
6969

7070
<Button
7171
onClick={async () => {
72-
await formInstance.validate();
72+
const result = await formInstance.validate();
73+
if (result) {
74+
message.success("验证通过");
75+
} else {
76+
message.error("验证失败");
77+
}
7378
}}
7479
>验证表单</Button>
7580

@@ -379,6 +384,9 @@ const FormPage = () => {
379384
<Form
380385
form={leftFormInstance}
381386
layout={"horizontal"}
387+
onFinish={async (values)=>{
388+
message.success(JSON.stringify(values));
389+
}}
382390
footer={(
383391
<FooterButtons
384392
formInstance={leftFormInstance}
@@ -567,6 +575,9 @@ const FormPage = () => {
567575

568576
<Col span={12}>
569577
<Form
578+
onFinish={async (values)=>{
579+
message.success(JSON.stringify(values));
580+
}}
570581
form={rightFormInstance}
571582
footer={(
572583
<FooterButtons

admin-ui/todo.md

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

mobile-ui/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
"private": true,
55
"dependencies": {
66
"@babel/standalone": "^7.25.6",
7-
"@codingapi/flow-mobile": "^0.0.3",
8-
"@codingapi/form-mobile": "^0.0.3",
9-
"@codingapi/ui-framework": "^0.0.12",
7+
"@codingapi/flow-mobile": "^0.0.17",
8+
"@codingapi/form-mobile": "^0.0.17",
9+
"@codingapi/ui-framework": "^0.0.17",
1010
"@logicflow/core": "^2.0.10",
1111
"@logicflow/extension": "^2.0.14",
1212
"@reduxjs/toolkit": "^2.2.7",

mobile-ui/readme.md

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,33 @@
1-
# TODO
2-
1. 流程图展示
3-
2. 流程的审批历史记录展示
1+
# Mobile-ui with Antd For Micro Frontends
2+
3+
This is a simple React App with Webpack5 & Typescript.
4+
5+
## Features
6+
1. Support Webpack 5 ModuleFederationPlugin for Micro Frontends
7+
2. Support Dynamic zip component loading
8+
3. Support Dynamic Routing & Dynamic Menu
9+
4. Support Axios for API calls
10+
5. Support Antd & Pro-Components UI Library
11+
6. Support Redux for State Management
12+
7. Support Mock Server for API Mocking
13+
8. Support Monaco Editor for Code Editor
14+
9. Support Access ControlPanel for Menu & Page Components
15+
16+
## Running
17+
```shell
18+
yarn
19+
20+
yarn start
21+
```
22+
## Build
23+
```shell
24+
yarn build
25+
```
26+
27+
## Deploy
28+
```shell
29+
cd scripts
30+
sh package.sh
31+
sh deploy.sh
32+
```
33+

mobile-ui/scripts/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/mobile

mobile-ui/scripts/deploy.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
serverHost=server
2+
serverAccount=root
3+
serverPort=22
4+
serverPath=/opt/test/
5+
6+
7+
scp -o ConnectTimeout=30 -P $serverPort -r * $serverAccount@$serverHost:$serverPath
8+
ssh -p $serverPort $serverAccount@$serverHost "cd $serverPath && sed -i 's/\r//g' *.sh && sh install.sh"

mobile-ui/scripts/docker-compose.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: "3"
2+
3+
services:
4+
admin-nginx:
5+
image: nginx:latest
6+
volumes:
7+
- "./admin:/usr/share/nginx/html"
8+
environment:
9+
TZ: "Asia/Shanghai"
10+
restart: always
11+
ports:
12+
- "13000:80"

mobile-ui/scripts/install.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
docker-compose build --no-cache
2+
docker-compose up -d
3+
docker ps -a

mobile-ui/scripts/package.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
rm -rf mobile
2+
3+
cd ..
4+
yarn
5+
yarn run build
6+
7+
8+
cp -r ./dist/ ./scripts/mobile/

mobile-ui/src/pages/form/index.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,12 @@ const FooterButtons: React.FC<{ formInstance: FormInstance }> = ({formInstance})
6666

6767
<Button
6868
onClick={async () => {
69-
await formInstance.validate();
69+
const result = await formInstance.validate();
70+
if (result) {
71+
Toast.show("验证通过");
72+
} else {
73+
Toast.show("验证失败");
74+
}
7075
}}
7176
>验证表单</Button>
7277

@@ -374,6 +379,9 @@ const FormPage = ()=>{
374379
<Form
375380
layout={"horizontal"}
376381
form={rightFormInstance}
382+
onFinish={async (values)=>{
383+
Toast.show(JSON.stringify(values));
384+
}}
377385
footer={(
378386
<FooterButtons formInstance={rightFormInstance}/>
379387
)}
@@ -390,6 +398,9 @@ const FormPage = ()=>{
390398
<Form
391399
form={leftFormInstance}
392400
layout={"horizontal"}
401+
onFinish={async (values)=>{
402+
Toast.show(JSON.stringify(values));
403+
}}
393404
footer={(
394405
<FooterButtons
395406
formInstance={leftFormInstance}

0 commit comments

Comments
 (0)