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
linweijiong
jinfa-platform
Commits
f3f9be8e
Commit
f3f9be8e
authored
Jul 16, 2021
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: 替换 table
parent
bf7bb16f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
41 deletions
+33
-41
index.tsx
...ents/FlowRuleForm/components/MemberRoleFormItem/index.tsx
+21
-26
schema.ts
...ents/FlowRuleForm/components/MemberRoleFormItem/schema.ts
+12
-15
No files found.
src/pages/member/memberFlowRule/components/FlowRuleForm/components/MemberRoleFormItem/index.tsx
View file @
f3f9be8e
...
...
@@ -2,20 +2,18 @@
* @Author: XieZhiXiong
* @Date: 2021-05-27 17:12:55
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-0
6-01 14:52:1
8
* @LastEditTime: 2021-0
7-16 15:25:3
8
* @Description: 适用会员角色 Form Item
*/
import
React
,
{
useState
,
use
Ref
}
from
'react'
;
import
React
,
{
useState
,
use
Effect
}
from
'react'
;
import
{
Button
,
Descriptions
,
Drawer
,
message
}
from
'antd'
;
import
{
PlusOutlined
,
}
from
'@ant-design/icons'
;
import
{
StandardTable
}
from
'god'
;
import
{
ColumnType
}
from
'antd/lib/table/interface'
;
import
{
createFormActions
}
from
'@formily/antd'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
useRowSelectionTable
}
from
'@/hooks/useRowSelectionTable'
;
import
NiceForm
from
'@/components/NiceForm
'
;
import
PolymericTable
,
{
FetchParamsType
}
from
'@/components/PolymericTable
'
;
import
querySchema
from
'./schema'
;
import
styles
from
'./index.less'
;
...
...
@@ -42,15 +40,12 @@ export type ValueType = {
businessTypeName
:
string
,
};
const
formActions
=
createFormActions
();
const
fetchListData
=
async
(
params
:
any
)
=>
{
const
payload
=
{
...
params
};
const
res
=
await
PublicApi
.
getMemberProcessRuleRolePage
(
payload
);
if
(
res
.
code
===
1000
)
{
return
res
.
data
;
}
return
[];
};
const
MemberRoleFormItem
=
(
props
)
=>
{
...
...
@@ -61,8 +56,6 @@ const MemberRoleFormItem = (props) => {
}
=
props
;
const
[
visibleDrawer
,
setVisibleDrawer
]
=
useState
(
false
);
const
ref
=
useRef
<
any
>
({});
const
[
rowSelection
,
RowCtl
]
=
useRowSelectionTable
({
customKey
:
'roleId'
,
type
:
'radio'
});
const
columns
:
ColumnType
<
ValueType
>
[]
=
[
...
...
@@ -88,6 +81,13 @@ const MemberRoleFormItem = (props) => {
},
];
useEffect
(()
=>
{
if
(
value
)
{
RowCtl
.
setSelectedRowKeys
([
value
.
roleId
]);
RowCtl
.
setSelectRow
([
value
]);
}
},
[
value
]);
const
handleVisibleDrawer
=
(
flag
:
boolean
)
=>
{
setVisibleDrawer
(
!!
flag
);
};
...
...
@@ -126,6 +126,9 @@ const MemberRoleFormItem = (props) => {
width=
{
1000
}
onClose=
{
()
=>
handleVisibleDrawer
(
false
)
}
visible=
{
visibleDrawer
}
bodyStyle=
{
{
paddingBottom
:
0
,
}
}
footer=
{
<
div
style=
{
{
...
...
@@ -141,24 +144,16 @@ const MemberRoleFormItem = (props) => {
</
div
>
}
>
<
StandardTable
tableProps=
{
{
rowKey
:
'roleId'
,
}
}
<
PolymericTable
rowKey=
"roleId"
columns=
{
columns
}
currentRef=
{
ref
}
rowSelection=
{
rowSelection
}
fetchTableData=
{
(
params
:
any
)
=>
fetchListData
(
params
)
}
controlRender=
{
<
NiceForm
actions=
{
formActions
}
onSubmit=
{
values
=>
ref
.
current
.
reload
(
values
)
}
effects=
{
(
$
,
actions
)
=>
{
}
}
schema=
{
querySchema
}
/>
}
searchFormProps=
{
{
schema
:
querySchema
,
}
}
fetchDataSource=
{
fetchListData
}
defaultPageSize=
{
15
}
full
/>
</
Drawer
>
</
div
>
...
...
src/pages/member/memberFlowRule/components/FlowRuleForm/components/MemberRoleFormItem/schema.ts
View file @
f3f9be8e
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-05-27 18:01:56
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-0
5-28 11:07:18
* @LastEditTime: 2021-0
7-16 14:52:53
* @Description:
*/
import
{
ISchema
}
from
'@formily/antd'
;
...
...
@@ -10,20 +10,17 @@ import { ISchema } from '@formily/antd';
const
querySchema
:
ISchema
=
{
type
:
'object'
,
properties
:
{
MAGE_LAYOUT
:
{
type
:
'object'
,
'x-component'
:
'Mega-Layout'
,
properties
:
{
name
:
{
type
:
'string'
,
'x-component'
:
'Search'
,
'x-component-props'
:
{
placeholder
:
'搜索'
,
tip
:
'输入 中文名称 进行搜索'
,
advanced
:
false
,
align
:
'flex-left'
,
},
},
name
:
{
type
:
'string'
,
'x-mega-props'
:
{
wrapperCol
:
12
,
},
'x-component'
:
'Search'
,
'x-component-props'
:
{
placeholder
:
'搜索'
,
tip
:
'输入 中文名称 进行搜索'
,
advanced
:
false
,
align
:
'flex-left'
,
},
},
},
...
...
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