11import React from "react" ;
22import Page from "@/components/Layout/Page" ;
3- import {
4- ActionType ,
5- ModalForm ,
6- PageContainer ,
7- ProForm ,
8- ProFormDigit ,
9- ProFormText ,
10- ProFormTextArea ,
11- ProTable
12- } from "@ant-design/pro-components" ;
13- import { list , startLeave } from "@/api/leave" ;
14- import { Button , message } from "antd" ;
15- import FlowSelect from "@/pages/flow/work/select" ;
3+ import { ActionType , PageContainer , ProTable } from "@ant-design/pro-components" ;
4+ import { list } from "@/api/leave" ;
5+ import { Button } from "antd" ;
166import FlowView from "@/components/Flow/flow" ;
177import LeaveForm from "@/pages/flow/leave/LeaveForm" ;
188
@@ -21,8 +11,7 @@ const LeavePage = () => {
2111
2212 const [ visible , setVisible ] = React . useState ( false ) ;
2313
24- const [ flowSelectVisible , setFlowSelectVisible ] = React . useState ( false ) ;
25- const [ form ] = ProForm . useForm ( ) ;
14+ const username = localStorage . getItem ( 'username' ) ;
2615
2716 const actionRef = React . useRef < ActionType > ( ) ;
2817 const columns = [
@@ -41,20 +30,11 @@ const LeavePage = () => {
4130 } ,
4231 {
4332 title : '请假人' ,
44- dataIndex : 'userName ' ,
33+ dataIndex : 'username ' ,
4534 }
4635 ] as any [ ] ;
4736
4837
49- const handleStartFlow = async ( values : any ) => {
50- const res = await startLeave ( values ) ;
51- if ( res . success ) {
52- message . success ( "发起成功,请到待办中心" ) ;
53- setVisible ( false ) ;
54- actionRef . current ?. reload ( ) ;
55- }
56- }
57-
5838 return (
5939 < PageContainer >
6040 < Page >
@@ -83,6 +63,7 @@ const LeavePage = () => {
8363 workCode = { "leave" }
8464 formParams = { {
8565 clazzName : 'com.codingapi.example.domain.Leave' ,
66+ username : username
8667 } }
8768 />
8869
0 commit comments