Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
shenshaokai
jinfa-platform
Commits
4c144cd4
Commit
4c144cd4
authored
May 25, 2021
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 添加审核Modal
parent
573a55e7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
129 additions
and
0 deletions
+129
-0
index.less
src/pages/member/components/VerifyModal/index.less
+0
-0
index.tsx
src/pages/member/components/VerifyModal/index.tsx
+78
-0
schema.ts
src/pages/member/components/VerifyModal/schema.ts
+51
-0
No files found.
src/pages/member/components/VerifyModal/index.less
0 → 100644
View file @
4c144cd4
src/pages/member/components/VerifyModal/index.tsx
0 → 100644
View file @
4c144cd4
/*
* @Author: XieZhiXiong
* @Date: 2021-05-25 11:46:35
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-05-25 11:46:36
* @Description: 审核 Modal
*/
import
React
from
'react'
;
import
{
Modal
}
from
'antd'
;
import
{
createFormActions
,
FormEffectHooks
,
FormPath
}
from
'@formily/antd'
;
import
NiceForm
from
'@/components/NiceForm'
;
import
schema
from
'./schema'
;
const
formActions
=
createFormActions
();
const
{
onFieldValueChange$
,
}
=
FormEffectHooks
;
interface
IProps
{
/**
* 是否可见
*/
visible
:
boolean
,
/**
* Modal 关闭事件
*/
onClose
:
()
=>
void
,
/**
* Form 提交事件
*/
onSubmit
:
(
value
:
any
)
=>
void
,
}
const
VerifyModal
:
React
.
FC
<
IProps
>
=
(
props
:
IProps
)
=>
{
const
{
visible
,
onClose
,
onSubmit
,
}
=
props
;
const
handleClose
=
()
=>
{
if
(
onClose
)
{
onClose
();
}
};
const
handleSubmit
=
(
values
:
any
)
=>
{
if
(
onSubmit
)
{
onSubmit
(
values
);
}
};
return
(
<
Modal
title=
"单据审核"
visible=
{
visible
}
confirmLoading=
{
false
}
onOk=
{
()
=>
formActions
.
submit
()
}
onCancel=
{
handleClose
}
destroyOnClose
>
<
NiceForm
effects=
{
(
$
,
{
setFieldState
})
=>
{
onFieldValueChange$
(
'agree'
).
subscribe
(
fieldState
=>
{
setFieldState
(
'reason'
,
state
=>
{
state
.
visible
=
!
fieldState
.
value
;
});
});
}
}
actions=
{
formActions
}
schema=
{
schema
}
onSubmit=
{
handleSubmit
}
/>
</
Modal
>
);
};
export
default
VerifyModal
;
src/pages/member/components/VerifyModal/schema.ts
0 → 100644
View file @
4c144cd4
/*
* @Author: XieZhiXiong
* @Date: 2021-05-25 11:50:00
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-05-25 11:50:00
* @Description:
*/
import
{
ISchema
}
from
'@formily/antd'
;
const
schema
:
ISchema
=
{
type
:
'object'
,
properties
:
{
MEGA_LAYOUT
:
{
type
:
'object'
,
'x-component'
:
'mega-layout'
,
'x-component-props'
:
{
labelAlign
:
'top'
,
},
properties
:
{
agree
:
{
type
:
'string'
,
default
:
1
,
enum
:
[
{
label
:
'审核通过'
,
value
:
1
},
{
label
:
'审核不通过'
,
value
:
0
},
],
'x-component'
:
'radio'
,
'x-component-props'
:
{},
},
reason
:
{
type
:
'string'
,
title
:
'审核不通过原因'
,
'x-component'
:
'textarea'
,
required
:
true
,
'x-component-props'
:
{
placeholder
:
'在此输入你的内容,最长120个字符,60个汉字'
,
rows
:
5
,
},
'x-rules'
:
[
{
limitByte
:
true
,
// 自定义校验规则
maxByte
:
120
,
}
],
},
},
},
},
};
export
default
schema
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment