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
XieZhiXiong
jinfa-platform
Commits
231fdfd9
Commit
231fdfd9
authored
Aug 02, 2021
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 添加禁用属性
parent
1aa900fd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
2 deletions
+20
-2
index.tsx
...tion/marketingAbility/components/ApplicableList/index.tsx
+6
-0
index.tsx
...marketingAbility/components/MemberCheckboxGroup/index.tsx
+7
-1
index.tsx
...n/marketingAbility/components/TofuCheckboxGroup/index.tsx
+7
-1
No files found.
src/pages/transaction/marketingAbility/components/ApplicableList/index.tsx
View file @
231fdfd9
...
...
@@ -44,6 +44,10 @@ export type ApplicableListProps = {
* 选项改变触发事件
*/
onChange
?:
(
value
:
ValueType
)
=>
void
,
/**
* 是否禁用
*/
disabled
?:
boolean
,
};
const
ShopList
:
React
.
FC
<
ApplicableListProps
>
=
(
props
)
=>
{
...
...
@@ -52,6 +56,7 @@ const ShopList: React.FC<ApplicableListProps> = (props) => {
value
:
outerValue
,
defaultValue
=
[],
onChange
,
disabled
,
}
=
props
;
const
initValue
=
'value'
in
props
?
outerValue
:
defaultValue
;
const
[
value
,
setValue
]
=
useState
<
ValueType
>
(
initValue
);
...
...
@@ -77,6 +82,7 @@ const ShopList: React.FC<ApplicableListProps> = (props) => {
value=
{
value
}
onChange=
{
handleChange
}
className=
{
styles
[
'applicable-list-checkboxGroup'
]
}
disabled=
{
disabled
}
>
<
Row
gutter=
{
16
}
>
{
options
.
map
((
item
)
=>
{
...
...
src/pages/transaction/marketingAbility/components/MemberCheckboxGroup/index.tsx
View file @
231fdfd9
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-06-25 11:34:36
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-0
7-08 17:08:39
* @LastEditTime: 2021-0
8-02 17:40:56
* @Description: 会员方块复选框
*/
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
;
...
...
@@ -88,6 +88,10 @@ export type MemberCheckboxGroupProps = {
* fetchOptions 额外的请求参数
*/
extraParams
?:
{
[
key
:
string
]:
any
},
/**
* 是否禁用
*/
disabled
?:
boolean
,
};
const
MemberCheckboxGroup
:
React
.
FC
<
MemberCheckboxGroupProps
>
=
(
props
)
=>
{
...
...
@@ -99,6 +103,7 @@ const MemberCheckboxGroup: React.FC<MemberCheckboxGroupProps> = (props) => {
showMoreAction
=
false
,
fetchOptions
,
extraParams
,
disabled
,
}
=
props
;
const
initValue
=
'value'
in
props
?
outerValue
:
defaultValue
;
const
[
value
,
setValue
]
=
useState
<
ValueType
>
(
initValue
);
...
...
@@ -187,6 +192,7 @@ const MemberCheckboxGroup: React.FC<MemberCheckboxGroupProps> = (props) => {
value=
{
value
}
onChange=
{
handleChange
}
className=
{
styles
[
'member-list-checkboxGroup'
]
}
disabled=
{
disabled
}
>
<
Row
gutter=
{
[
16
,
16
]
}
>
{
optionList
.
map
((
item
)
=>
{
...
...
src/pages/transaction/marketingAbility/components/TofuCheckboxGroup/index.tsx
View file @
231fdfd9
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-06-23 10:14:05
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-0
6-30 19:15:26
* @LastEditTime: 2021-0
8-02 17:42:33
* @Description: 豆腐方块复选框
*/
import
React
,
{
useState
,
useEffect
}
from
'react'
;
...
...
@@ -44,6 +44,10 @@ export type TofuCheckboxGroupProps = {
* 选项改变触发事件
*/
onChange
?:
(
value
:
ValueType
)
=>
void
,
/**
* 是否禁用
*/
disabled
?:
boolean
,
};
const
TofuCheckboxGroup
:
React
.
FC
<
TofuCheckboxGroupProps
>
=
(
props
)
=>
{
...
...
@@ -52,6 +56,7 @@ const TofuCheckboxGroup: React.FC<TofuCheckboxGroupProps> = (props) => {
value
:
outerValue
,
defaultValue
=
[],
onChange
,
disabled
,
}
=
props
;
const
initValue
=
'value'
in
props
?
outerValue
:
defaultValue
;
const
[
value
,
setValue
]
=
useState
<
ValueType
>
(
initValue
);
...
...
@@ -77,6 +82,7 @@ const TofuCheckboxGroup: React.FC<TofuCheckboxGroupProps> = (props) => {
value=
{
value
}
onChange=
{
handleChange
}
className=
{
styles
[
'tofuCheckbox-list-checkboxGroup'
]
}
disabled=
{
disabled
}
>
{
options
.
map
((
item
)
=>
{
const
itemCls
=
classNames
(
styles
[
'tofuCheckbox-list-item'
],
{
...
...
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