Skip to content

update ui version #138

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions admin-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"dependencies": {
"@ant-design/icons": "^5.4.0",
"@ant-design/pro-components": "^2.8.7",
"@codingapi/flow-pc": "^0.0.45",
"@codingapi/form-pc": "^0.0.45",
"@codingapi/ui-framework": "^0.0.45",
"@codingapi/flow-pc": "^0.0.58",
"@codingapi/form-pc": "^0.0.58",
"@codingapi/ui-framework": "^0.0.58",
"@dnd-kit/core": "^6.2.0",
"@dnd-kit/sortable": "^9.0.0",
"@handsontable/react-wrapper": "^15.0.0",
Expand Down
30 changes: 22 additions & 8 deletions admin-ui/src/pages/flow/leave/LeaveForm.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, {useEffect} from "react";
import {FlowFormViewProps, ValidateUtils} from "@codingapi/ui-framework";
import {Form, FormInput, FormTextArea} from "@codingapi/form-pc";
import {FlowFormViewProps} from "@codingapi/ui-framework";
import {Form, FormItem} from "@codingapi/form-pc";

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

Expand All @@ -19,29 +19,43 @@ const LeaveForm: React.FC<FlowFormViewProps> = (props) => {
layout={"vertical"}
>

<FormInput
<FormItem
name={"id"}
hidden={true}
type={"input"}
/>

<FormInput
<FormItem
type={"input"}
name={"username"}
hidden={true}
/>

<FormInput
<FormItem
type={"input"}
name={"days"}
label={"请假天数"}
inputType={"number"}
required={true}
validateFunction={ValidateUtils.validateNotEmpty}
rules={[
{
required: true,
message: "请假天数不能为空",
},
]}
/>

<FormTextArea
<FormItem
type={"textarea"}
name={"desc"}
label={"请假原因"}
required={true}
validateFunction={ValidateUtils.validateNotEmpty}
rules={[
{
required: true,
message: "请假原因不能为空",
},
]}
/>

</Form>
Expand Down
43 changes: 31 additions & 12 deletions admin-ui/src/pages/flow/user/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import {changeManager, entrust, list, remove, removeEntrust, save} from "@/api/u
import {Button, message, Modal, Popconfirm, Space} from "antd";
import {DeleteOutlined, SettingOutlined} from "@ant-design/icons";
import UserSelect from "@/pages/flow/user/select";
import {Form,FormInput,FormSwitch} from "@codingapi/form-pc";
import {ValidateUtils} from "@codingapi/ui-framework";
import {Form, FormItem} from "@codingapi/form-pc";

const UserPage = () => {

Expand Down Expand Up @@ -186,8 +185,8 @@ const UserPage = () => {
onCancel={()=>{
setVisible(false);
}}
onOk={async ()=>{
await form.submit();
onOk={ ()=>{
form.submit();
}}
>
<Form
Expand All @@ -197,33 +196,53 @@ const UserPage = () => {
handleSave(values);
}}
>
<FormInput
<FormItem
type={"input"}
name={"id"}
hidden={true}
/>

<FormInput
<FormItem
type={"input"}
name={"name"}
label={"姓名"}
required={true}
validateFunction={ValidateUtils.validateNotEmpty}
rules={[
{
required: true,
message: "姓名不能为空",
}
]}
/>

<FormInput
<FormItem
type={"input"}
name={"username"}
label={"登录账号"}
required={true}
validateFunction={ValidateUtils.validateNotEmpty}
rules={[
{
required: true,
message: "登录账号不能为空",
}
]}
/>

<FormInput
<FormItem
type={"password"}
name={"password"}
label={"登录密码"}
required={true}
validateFunction={ValidateUtils.validateNotEmpty}
rules={[
{
required: true,
message: "登录密码不能为空",
}
]}
/>

<FormSwitch
<FormItem
type={"switch"}
name={"flowManager"}
label={"是否流程管理员"}
/>
Expand Down
48 changes: 34 additions & 14 deletions admin-ui/src/pages/flow/work/index.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import React from "react";
import {Flow,FlowActionType} from "@codingapi/flow-pc";
import {Flow, FlowActionType} from "@codingapi/flow-pc";
import {ActionType, PageContainer, ProTable} from "@ant-design/pro-components";
import {changeState, copy, list, remove, save, schema} from "@/api/flow";
import {Button, Drawer, message, Modal, Popconfirm, Space} from "antd";
import {Form,FormInput,FormTextArea,FormSwitch} from "@codingapi/form-pc";
import {ValidateUtils} from "@codingapi/ui-framework";
import {Form, FormItem} from "@codingapi/form-pc";

const FlowPage = () => {

Expand Down Expand Up @@ -199,8 +198,8 @@ const FlowPage = () => {
onCancel={()=>{
setEditorVisible(false)
}}
onOk={async ()=>{
await form.submit();
onOk={ ()=>{
form.submit();
}}
>

Expand All @@ -209,40 +208,61 @@ const FlowPage = () => {
layout={"vertical"}
onFinish={handlerSave}
>
<FormInput
<FormItem
type={"input"}
name={"id"}
hidden={true}
/>

<FormInput
<FormItem
type={"input"}
name={"title"}
label={"标题"}
required={true}
validateFunction={ValidateUtils.validateNotEmpty}
rules={[
{
required: true,
message: '请输入标题'
}
]}
/>

<FormInput
<FormItem
type={"input"}
name={"code"}
label={"编码"}
required={true}
validateFunction={ValidateUtils.validateNotEmpty}
rules={[
{
required: true,
message: '请输入编码'
}
]}
/>

<FormTextArea
<FormItem
name={"description"}
label={"描述"}
type={"textarea"}
/>

<FormInput
<FormItem
type={"input"}
name={"postponedMax"}
tooltip={"允许流程最大的延期次数"}
label={"最大延期次数"}
inputType={'number'}
required={true}
validateFunction={ValidateUtils.validateNotEmpty}
rules={[
{
required: true,
message: '请输入最大延期次数'
}
]}
/>

<FormSwitch
<FormItem
type={"switch"}
name={"skipIfSameApprover"}
tooltip={"是否跳过相同审批人,默认为否"}
label={"是否跳过相同审批人"}
Expand Down
6 changes: 3 additions & 3 deletions mobile-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@codingapi/flow-mobile": "^0.0.45",
"@codingapi/form-mobile": "^0.0.45",
"@codingapi/ui-framework": "^0.0.45",
"@codingapi/flow-mobile": "^0.0.58",
"@codingapi/form-mobile": "^0.0.58",
"@codingapi/ui-framework": "^0.0.58",
"@logicflow/core": "^2.0.10",
"@logicflow/extension": "^2.0.14",
"@reduxjs/toolkit": "^2.2.7",
Expand Down
20 changes: 10 additions & 10 deletions mobile-ui/src/pages/leave/fields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ export const fields = [
label: "请假天数",
name: "days",
required: true,
validateFunction: async (content) => {
if (content.value <= 0) {
return ["请假天数不能小于0"];
rules: [
{
required: true,
message: "请假天数不能为空"
}
return []
}
],
}
},
{
Expand All @@ -35,12 +35,12 @@ export const fields = [
label: "请假理由",
name: "desc",
required: true,
validateFunction: async (content) => {
if (content.value && content.value.length > 0) {
return []
rules:[
{
required: true,
message: "请假理由不能为空"
}
return ["请假理由不能为空"];
}
]
}
}
] as FormField[]
30 changes: 15 additions & 15 deletions mobile-ui/src/pages/login/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import {Button, Toast} from "antd-mobile";
import {FormInput,FormPassword,Form} from "@codingapi/form-mobile";
import {Form, FormItem} from "@codingapi/form-mobile";
import {useNavigate} from "react-router";
import {initUser, login} from "@/api/account";
import {config} from "@/config/theme";
Expand Down Expand Up @@ -53,32 +53,32 @@ const LoginPage = () => {
)}
>

<FormInput
<FormItem
type={"input"}
name={'username'}
label={'用户名'}
placeholder={'请输入用户名'}
required={true}
validateFunction={async (content)=>{
if(content.value){
return []
}else {
return ["用户名不能为空"]
rules={[
{
required: true,
message: "用户名不能为空"
}
}}
]}
/>

<FormPassword
<FormItem
type={"password"}
name={'password'}
label={'密码'}
placeholder={'请输入密码'}
required={true}
validateFunction={async (content)=>{
if(content.value){
return []
}else {
return ["密码不能为空"]
rules={[
{
required: true,
message: "密码不能为空"
}
}}
]}
/>
</Form>
</div>
Expand Down