Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CivManage
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
ReactWeb5
CivManage
Commits
c2a47831
Commit
c2a47831
authored
Nov 21, 2023
by
皮倩雯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: '表/字段记住分页'
parent
d4cc5161
Pipeline
#82007
passed with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
27 deletions
+18
-27
index.jsx
src/pages/bsmanager/base/tablemanager/index.jsx
+18
-27
No files found.
src/pages/bsmanager/base/tablemanager/index.jsx
View file @
c2a47831
...
...
@@ -103,6 +103,7 @@ const TableManager = props => {
const
[
checkMsg
,
setCheckMsg
]
=
useState
();
const
[
fieldConfigShow
,
setFieldConfigShow
]
=
useState
(
false
);
const
[
tableInfo
,
setTableInfo
]
=
useState
({});
const
[
keepGroupArr
,
setKeepGroupArr
]
=
useState
([]);
const
initNum
=
useRef
(
0
);
useEffect
(()
=>
{
GetDefaultTableFields
().
then
(
res
=>
{
...
...
@@ -312,11 +313,15 @@ const TableManager = props => {
}
});
});
setKeepGroupArr
(
newArr
);
setAllData
(
groupData
);
if
(
!
props
.
history
.
location
.
query
||
initNum
.
current
>
0
)
{
if
(
newArr
.
length
>
0
&&
(
!
select
||
isSearch
))
{
setSelect
(
newArr
[
0
].
type
);
}
if
(
groupArr
.
length
>
0
&&
!
isSearch
)
{
newArr
[
pickIndex
]
=
groupArr
[
pickIndex
];
}
setGroupArr
(
newArr
);
}
setKeepTreeFirst
(
bb
);
...
...
@@ -331,6 +336,8 @@ const TableManager = props => {
setTreeLoading
(
false
);
});
};
// 处理数据格式
const
formateArrDataA
=
(
initialArr
,
name
)
=>
{
// 判定传参是否符合规则
if
(
!
(
initialArr
instanceof
Array
))
{
...
...
@@ -339,35 +346,18 @@ const TableManager = props => {
if
(
!
name
)
{
return
'请传入对象属性'
;
}
// 先获取一下这个数组中有多少个"name"
let
nameArr
=
[];
for
(
let
i
in
initialArr
)
{
if
(
nameArr
.
indexOf
(
initialArr
[
i
][
`
${
name
}
`
])
===
-
1
)
{
nameArr
.
push
(
initialArr
[
i
][
`
${
name
}
`
]);
}
}
// 新建一个包含多个list的结果对象
let
tempObj
=
{};
// 根据不同的"name"生成多个数组
for
(
let
k
in
nameArr
)
{
for
(
let
j
in
initialArr
)
{
if
(
initialArr
[
j
][
`
${
name
}
`
]
==
nameArr
[
k
])
{
// 每次外循环时新建一个对应"name"的数组, 内循环时当前数组不变
tempObj
[
nameArr
[
k
]]
=
tempObj
[
nameArr
[
k
]]
||
[];
tempObj
[
nameArr
[
k
]].
push
(
initialArr
[
j
]);
}
let
arr
=
{};
initialArr
.
forEach
((
item
,
index
)
=>
{
let
data
=
item
.
groupName
;
if
(
!
arr
[
data
])
{
arr
[
data
]
=
[
item
];
}
else
{
arr
[
data
].
push
(
item
);
}
}
for
(
let
keys
in
tempObj
)
{
let
arr
=
[];
tempObj
[
keys
].
map
((
item
,
index
)
=>
{
tempObj
[
keys
]
=
arr
;
item
.
key
=
index
;
arr
.
push
(
item
);
});
}
return
tempObj
;
});
return
arr
;
};
const
setRowClassName
=
record
=>
Object
.
entries
(
record
).
toString
()
===
Object
.
entries
(
selectTableName
).
toString
()
?
styles
.
clickRowStyle
...
...
@@ -778,6 +768,7 @@ const TableManager = props => {
setHoverItemIndex
(
''
);
}
}
onClick=
{
()
=>
{
setGroupArr
(
keepGroupArr
);
setPickIndex
(
index
);
setSelect
(
item
.
type
);
setTableData
(
item
.
root
);
...
...
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