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
05d5a740
Commit
05d5a740
authored
Jun 18, 2021
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 添加虚假的分页
parent
7af88ab6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
86 additions
and
17 deletions
+86
-17
index.less
...ents/FlowRuleForm/components/ComingConfigTable/index.less
+10
-0
index.tsx
...nents/FlowRuleForm/components/ComingConfigTable/index.tsx
+36
-7
utils.ts
...onents/FlowRuleForm/components/ComingConfigTable/utils.ts
+14
-0
index.tsx
...wRule/components/FlowRuleForm/components/Search/index.tsx
+15
-5
index.tsx
...s/member/memberFlowRule/components/FlowRuleForm/index.tsx
+10
-2
schema.ts
...s/member/memberFlowRule/components/FlowRuleForm/schema.ts
+1
-3
No files found.
src/pages/member/memberFlowRule/components/FlowRuleForm/components/ComingConfigTable/index.less
View file @
05d5a740
.config-table {
:global {
.ant-pagination-options-size-changer {
&.ant-select {
width: auto !important;
}
}
}
}
\ No newline at end of file
src/pages/member/memberFlowRule/components/FlowRuleForm/components/ComingConfigTable/index.tsx
View file @
05d5a740
...
@@ -2,16 +2,20 @@
...
@@ -2,16 +2,20 @@
* @Author: XieZhiXiong
* @Author: XieZhiXiong
* @Date: 2021-05-28 15:24:56
* @Date: 2021-05-28 15:24:56
* @LastEditors: XieZhiXiong
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-06-
01 14:44:31
* @LastEditTime: 2021-06-
18 15:57:10
* @Description:
* @Description:
*/
*/
import
React
from
'react'
;
import
React
,
{
useState
}
from
'react'
;
import
{
Popconfirm
,
Button
,
Row
,
Col
}
from
'antd'
;
import
{
Popconfirm
,
Button
,
Row
,
Col
}
from
'antd'
;
import
theme
from
'../../../../../../../../config/lingxi.theme.config'
;
import
theme
from
'../../../../../../../../config/lingxi.theme.config'
;
import
PolymericTable
from
'@/components/PolymericTable'
;
import
PolymericTable
from
'@/components/PolymericTable'
;
import
{
EditableColumns
}
from
'@/components/PolymericTable/interface'
;
import
{
EditableColumns
}
from
'@/components/PolymericTable/interface'
;
import
{
pagingArr
}
from
'./utils'
;
import
ComingCtl
,
{
ValueType
as
ComingCtlValueType
}
from
'../ComingCtl'
;
import
ComingCtl
,
{
ValueType
as
ComingCtlValueType
}
from
'../ComingCtl'
;
import
Search
from
'../Search'
;
import
Search
from
'../Search'
;
import
styles
from
'./index.less'
;
const
PAGE_SIZE
=
5
;
const
ComingConfigTable
=
(
props
)
=>
{
const
ComingConfigTable
=
(
props
)
=>
{
const
{
const
{
...
@@ -20,6 +24,9 @@ const ComingConfigTable = (props) => {
...
@@ -20,6 +24,9 @@ const ComingConfigTable = (props) => {
editable
,
editable
,
}
=
props
;
}
=
props
;
const
{
roleId
}
=
(
props
.
props
[
'x-component-props'
]
||
{});
const
{
roleId
}
=
(
props
.
props
[
'x-component-props'
]
||
{});
const
[
keyword
,
setKeyword
]
=
useState
(
''
);
const
[
page
,
setPage
]
=
useState
(
1
);
const
[
size
,
setSize
]
=
useState
(
PAGE_SIZE
);
const
handleDelete
=
(
id
:
number
)
=>
{
const
handleDelete
=
(
id
:
number
)
=>
{
const
newData
=
[...
value
];
const
newData
=
[...
value
];
...
@@ -70,12 +77,25 @@ const ComingConfigTable = (props) => {
...
@@ -70,12 +77,25 @@ const ComingConfigTable = (props) => {
},
},
];
];
const
handleSearch
=
(
next
:
string
)
=>
{
setKeyword
(
next
);
setPage
(
1
);
};
const
handleConfirm
=
(
value
:
ComingCtlValueType
[])
=>
{
const
handleConfirm
=
(
value
:
ComingCtlValueType
[])
=>
{
mutators
.
change
(
value
);
mutators
.
change
(
value
);
};
};
const
handlePaginationChange
=
(
current
:
number
,
pageSize
:
number
)
=>
{
setPage
(
current
);
setSize
(
pageSize
);
};
const
filtered
=
keyword
?
value
.
filter
((
item
)
=>
item
.
fieldLocalName
.
includes
(
keyword
))
:
[...
value
];
const
dataSource
=
pagingArr
(
page
,
size
,
filtered
);
return
(
return
(
<>
<
div
className=
{
styles
[
'config-table'
]
}
>
<
Row
<
Row
justify=
"space-between"
justify=
"space-between"
style=
{
{
style=
{
{
...
@@ -91,17 +111,26 @@ const ComingConfigTable = (props) => {
...
@@ -91,17 +111,26 @@ const ComingConfigTable = (props) => {
/>
/>
</
Col
>
</
Col
>
<
Col
span=
{
6
}
>
<
Col
span=
{
6
}
>
<
Search
value=
{
''
}
onChange=
{
()
=>
{}
}
onSearch=
{
()
=>
{}
}
/>
<
Search
onSearch=
{
handleSearch
}
/>
</
Col
>
</
Col
>
</
Row
>
</
Row
>
<
PolymericTable
<
PolymericTable
rowKey=
"id"
rowKey=
"id"
dataSource=
{
valu
e
}
dataSource=
{
dataSourc
e
}
columns=
{
columns
}
columns=
{
columns
}
loading=
{
false
}
loading=
{
false
}
pagination=
{
null
}
pagination=
{
(
!
editable
?
{
current
:
page
,
pageSize
:
size
,
total
:
filtered
.
length
,
}
:
null
)
}
onPaginationChange=
{
handlePaginationChange
}
/>
/>
</>
</
div
>
);
);
};
};
...
...
src/pages/member/memberFlowRule/components/FlowRuleForm/components/ComingConfigTable/utils.ts
0 → 100644
View file @
05d5a740
/*
* @Author: XieZhiXiong
* @Date: 2021-06-18 14:56:03
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-06-18 15:26:10
* @Description:
*/
export
function
pagingArr
(
page
,
size
,
arr
)
{
const
sub
=
[...
arr
];
const
star
=
(
page
-
1
)
*
size
;
const
end
=
star
+
size
;
return
sub
.
slice
(
star
,
end
);
};
\ No newline at end of file
src/pages/member/memberFlowRule/components/FlowRuleForm/components/Search/index.tsx
View file @
05d5a740
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
* @LastEditTime: 2021-06-08 16:27:02
* @LastEditTime: 2021-06-08 16:27:02
* @Description: 搜索组件
* @Description: 搜索组件
*/
*/
import
React
from
'react'
;
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
Input
,
Button
}
from
'antd'
;
import
{
Input
,
Button
}
from
'antd'
;
import
styles
from
'./index.less'
;
import
styles
from
'./index.less'
;
...
@@ -13,15 +13,15 @@ interface IProps {
...
@@ -13,15 +13,15 @@ interface IProps {
/**
/**
* 值
* 值
*/
*/
value
:
string
,
value
?
:
string
,
/**
/**
* 输入改变触发事件
* 输入改变触发事件
*/
*/
onChange
:
(
value
:
string
)
=>
void
,
onChange
?
:
(
value
:
string
)
=>
void
,
/**
/**
* 搜索事触发事件
* 搜索事触发事件
*/
*/
onSearch
:
(
value
:
string
)
=>
void
,
onSearch
?
:
(
value
:
string
)
=>
void
,
/**
/**
* 点击重置按钮触发事件
* 点击重置按钮触发事件
*/
*/
...
@@ -41,8 +41,18 @@ const MySearch: React.FC<IProps> = (props: IProps) => {
...
@@ -41,8 +41,18 @@ const MySearch: React.FC<IProps> = (props: IProps) => {
searchOnResetAction
,
searchOnResetAction
,
...
rest
...
rest
}
=
props
;
}
=
props
;
const
[
keyword
,
setKeyword
]
=
useState
(
''
);
useEffect
(()
=>
{
if
(
'value'
in
props
)
{
setKeyword
(
value
);
}
},
[
value
]);
const
handleChange
=
(
e
)
=>
{
const
handleChange
=
(
e
)
=>
{
if
(
!
(
'value'
in
props
))
{
setKeyword
(
e
.
target
.
value
);
}
if
(
onChange
)
{
if
(
onChange
)
{
onChange
(
e
.
target
.
value
);
onChange
(
e
.
target
.
value
);
}
}
...
@@ -68,7 +78,7 @@ const MySearch: React.FC<IProps> = (props: IProps) => {
...
@@ -68,7 +78,7 @@ const MySearch: React.FC<IProps> = (props: IProps) => {
<
div
className=
{
styles
.
search
}
>
<
div
className=
{
styles
.
search
}
>
<
Input
.
Search
<
Input
.
Search
style=
{
{
width
:
'200px'
,
marginRight
:
16
}
}
style=
{
{
width
:
'200px'
,
marginRight
:
16
}
}
value=
{
props
.
value
||
''
}
value=
{
keyword
}
onChange=
{
handleChange
}
onChange=
{
handleChange
}
onSearch=
{
handleSearch
}
onSearch=
{
handleSearch
}
{
...
rest
}
{
...
rest
}
...
...
src/pages/member/memberFlowRule/components/FlowRuleForm/index.tsx
View file @
05d5a740
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Author: XieZhiXiong
* @Date: 2021-05-27 16:13:05
* @Date: 2021-05-27 16:13:05
* @LastEditors: XieZhiXiong
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-06-
01 14:56:14
* @LastEditTime: 2021-06-
18 15:54:33
* @Description:
* @Description:
*/
*/
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
React
,
{
useState
,
useEffect
}
from
'react'
;
...
@@ -153,6 +153,11 @@ const FlowRuleForm: React.FC<MemberFormProps> = ({
...
@@ -153,6 +153,11 @@ const FlowRuleForm: React.FC<MemberFormProps> = ({
}
}
};
};
const
isAdd
=
!
id
&&
isEdit
;
const
configIdsProps
=
{
isAdd
,
};
return
(
return
(
<
Spin
spinning=
{
infoLoading
}
>
<
Spin
spinning=
{
infoLoading
}
>
<
PageHeaderWrapper
<
PageHeaderWrapper
...
@@ -161,7 +166,7 @@ const FlowRuleForm: React.FC<MemberFormProps> = ({
...
@@ -161,7 +166,7 @@ const FlowRuleForm: React.FC<MemberFormProps> = ({
}
}
}
}
onBack=
{
()
=>
history
.
goBack
()
}
onBack=
{
()
=>
history
.
goBack
()
}
backIcon=
{
<
ReutrnEle
description=
"返回"
/>
}
backIcon=
{
<
ReutrnEle
description=
"返回"
/>
}
title=
{
!
id
?
isEdit
?
'新增会员管理流程规则'
:
'查看会员管理流程规则'
:
'编辑会员管理流程规则会员
'
}
title=
{
!
id
?
'新增会员管理流程规则'
:
isEdit
?
'编辑会员管理流程规则会员'
:
'查看会员管理流程规则
'
}
extra=
{
[
extra=
{
[
(
isEdit
?
(
(
isEdit
?
(
<
Button
<
Button
...
@@ -190,6 +195,9 @@ const FlowRuleForm: React.FC<MemberFormProps> = ({
...
@@ -190,6 +195,9 @@ const FlowRuleForm: React.FC<MemberFormProps> = ({
PlatformConfigTable
,
PlatformConfigTable
,
ComingConfigTable
,
ComingConfigTable
,
}
}
}
}
expressionScope=
{
{
configIdsProps
,
}
}
effects=
{
(
$
,
actions
)
=>
{
effects=
{
(
$
,
actions
)
=>
{
createEffects
(
$
,
actions
);
createEffects
(
$
,
actions
);
onFormInputChange$
().
subscribe
(()
=>
{
onFormInputChange$
().
subscribe
(()
=>
{
...
...
src/pages/member/memberFlowRule/components/FlowRuleForm/schema.ts
View file @
05d5a740
...
@@ -147,9 +147,7 @@ const formSchema: ISchema = {
...
@@ -147,9 +147,7 @@ const formSchema: ISchema = {
configIds
:
{
configIds
:
{
type
:
'string'
,
type
:
'string'
,
'x-component'
:
'ComingConfigTable'
,
'x-component'
:
'ComingConfigTable'
,
'x-component-props'
:
{
'x-component-props'
:
{},
},
},
},
},
},
},
},
...
...
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