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
add3f04e
Commit
add3f04e
authored
May 09, 2022
by
皮倩雯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: '解决移动配置新增bug'
parent
fb3dc96f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
70 additions
and
41 deletions
+70
-41
standingBook.jsx
src/pages/bsmanager/base/standingBook/standingBook.jsx
+67
-37
miniMenu.jsx
src/pages/productCenter/mobileConfig/menuconfig/miniMenu.jsx
+3
-4
No files found.
src/pages/bsmanager/base/standingBook/standingBook.jsx
View file @
add3f04e
/* eslint-disable no-unused-expressions */
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
Form
,
...
...
@@ -44,6 +45,9 @@ const StandingBook = props => {
const
[
searchData
,
setSearchData
]
=
useState
([]);
const
[
showSearchStyle
,
setShowSearchStyle
]
=
useState
(
false
);
// 是否显示模糊查询样式
const
[
keepTableData
,
setKeepTableData
]
=
useState
([]);
const
[
searchFlag
,
setSearchFlag
]
=
useState
(
0
);
const
[
currentPage
,
setCurrentPage
]
=
useState
(
1
);
const
[
currentPageSize
,
setCurrentPageSize
]
=
useState
(
20
);
const
{
Item
}
=
Form
;
const
{
Search
}
=
Input
;
...
...
@@ -175,17 +179,25 @@ const StandingBook = props => {
setMaxLength
(
res
.
data
.
root
.
length
+
1
);
let
arr
=
formateArrDataA
(
res
.
data
.
root
,
'type'
);
let
newArr
=
[];
newArr
.
push
(
'全部'
);
Object
.
keys
(
arr
).
map
((
item
,
index
)
=>
{
newArr
.
push
(
item
);
});
console
.
log
(
arr
);
arr
.
全部
=
res
.
data
.
root
;
setAllData
(
arr
);
setShowSearchStyle
(
false
);
// 第一次进入展示第一页 不是第一次进入根据当前选择的来进行展示
console
.
log
(
flag
);
console
.
log
(
pickItem
);
flag
===
0
?
setPickItem
(
newArr
[
0
])
:
setPickItem
(
pickItem
);
setPickItem
(
newArr
[
0
]);
//
setPickItem(newArr[0]);
console
.
log
(
newArr
,
'newArr'
);
// newArr.push('全部');
setTableData
(
newArr
);
if
(
searchFlag
===
1
)
{
onSearch
();
}
}
});
},
[
flag
]);
...
...
@@ -258,27 +270,31 @@ const StandingBook = props => {
};
const
onSearch
=
()
=>
{
console
.
log
(
searchWord
);
console
.
log
(
pickItem
);
setSearchFlag
(
1
);
setTableLoading
(
true
);
setCurrentPage
(
1
);
setCurrentPageSize
(
20
);
GetCM_Ledger_LoadLedgers
({
accountName
:
searchWord
}).
then
(
res
=>
{
setTableLoading
(
false
);
if
(
res
.
msg
===
'Ok'
&&
res
.
data
.
root
)
{
console
.
log
(
res
.
data
.
root
);
setMaxLength
(
res
.
data
.
root
.
length
+
1
);
let
arr
=
formateArrDataA
(
res
.
data
.
root
,
'type'
);
let
newArr
=
[];
Object
.
keys
(
arr
).
map
((
item
,
index
)
=>
{
newArr
.
push
(
item
);
});
let
aa
=
res
.
data
.
root
;
if
(
pickItem
==
'全部'
)
{
if
(
aa
.
length
>
0
)
{
aa
.
map
(
i
=>
{
i
.
type
=
'全部'
;
});
}
}
console
.
log
(
aa
);
setMaxLength
(
aa
.
length
+
1
);
let
arr
=
formateArrDataA
(
aa
,
'type'
);
console
.
log
(
arr
);
setShowSearchStyle
(
true
);
// setAllData(arr);
setSearchData
(
res
.
data
.
root
);
setPickItem
(
''
);
setSearchData
(
arr
);
//
setPickItem('');
// 第一次进入展示第一页 不是第一次进入根据当前选择的来进行展示
// flag === 0 ? setPickItem(newArr[0]) : setPickItem(pickItem);
console
.
log
(
newArr
,
'newArr'
);
// setTableData(newArr);
}
});
...
...
@@ -287,29 +303,30 @@ const StandingBook = props => {
const
handleSearch
=
e
=>
{
console
.
log
(
e
.
target
.
value
);
setSearchWord
(
e
.
target
.
value
);
if
(
e
.
target
.
value
==
''
)
{
setTableLoading
(
true
);
GetCM_Ledger_LoadLedgers
().
then
(
res
=>
{
setTableLoading
(
false
);
if
(
res
.
msg
===
'Ok'
&&
res
.
data
.
root
)
{
console
.
log
(
res
.
data
.
root
);
setMaxLength
(
res
.
data
.
root
.
length
+
1
);
let
arr
=
formateArrDataA
(
res
.
data
.
root
,
'type'
);
let
newArr
=
[];
Object
.
keys
(
arr
).
map
((
item
,
index
)
=>
{
newArr
.
push
(
item
);
});
console
.
log
(
arr
);
setAllData
(
arr
);
setShowSearchStyle
(
false
);
// 第一次进入展示第一页 不是第一次进入根据当前选择的来进行展示
flag
===
0
?
setPickItem
(
newArr
[
0
])
:
setPickItem
(
pickItem
);
setPickItem
(
newArr
[
0
]);
console
.
log
(
newArr
,
'newArr'
);
setTableData
(
newArr
);
}
});
}
setSearchFlag
(
0
);
// if (e.target.value == '') {
// setTableLoading(true);
// GetCM_Ledger_LoadLedgers().then(res => {
// setTableLoading(false);
// if (res.msg === 'Ok' && res.data.root) {
// console.log(res.data.root);
// setMaxLength(res.data.root.length + 1);
// let arr = formateArrDataA(res.data.root, 'type');
// let newArr = [];
// Object.keys(arr).map((item, index) => {
// newArr.push(item);
// });
// console.log(arr);
// setAllData(arr);
// setShowSearchStyle(false);
// // 第一次进入展示第一页 不是第一次进入根据当前选择的来进行展示
// flag === 0 ? setPickItem(newArr[0]) : setPickItem(pickItem);
// setPickItem(newArr[0]);
// console.log(newArr, 'newArr');
// setTableData(newArr);
// }
// });
// }
};
// 模糊查询匹配的样式
...
...
@@ -325,6 +342,13 @@ const StandingBook = props => {
const
handleReset
=
()
=>
{
setFlag
(
flag
+
1
);
};
const
pageChage
=
(
page
,
pageSize
)
=>
{
console
.
log
(
page
);
console
.
log
(
pageSize
);
setCurrentPage
(
page
);
setCurrentPageSize
(
pageSize
);
};
return
(
<
PageContainer
className=
{
styles
.
userManageContainer
}
>
<
div
className=
{
styles
.
contentContainers
}
>
...
...
@@ -379,6 +403,9 @@ const StandingBook = props => {
onClick=
{
()
=>
{
setPickItem
(
item
);
setSearchWord
(
''
);
setSearchFlag
(
0
);
setCurrentPage
(
1
);
setCurrentPageSize
(
20
);
}
}
onMouseEnter=
{
()
=>
{
setHoverItemIndex
(
item
);
...
...
@@ -448,7 +475,7 @@ const StandingBook = props => {
}
}
columns=
{
columns
}
loading=
{
tableLoading
}
dataSource=
{
pickItem
?
allData
[
pickItem
]
:
searchData
}
dataSource=
{
searchFlag
===
0
?
allData
[
pickItem
]
:
searchData
[
pickItem
]
}
// loading={tableLoading}
scroll=
{
{
x
:
'max-content'
,
y
:
'calc(100vh - 180px)'
}
}
// scroll={{ x: 'max-content' }}
...
...
@@ -458,6 +485,9 @@ const StandingBook = props => {
defaultPageSize
:
20
,
showQuickJumper
:
true
,
showSizeChanger
:
true
,
current
:
currentPage
,
pageSize
:
currentPageSize
,
onChange
:
(
page
,
pageSize
)
=>
pageChage
(
page
,
pageSize
),
}
}
/>
</
div
>
...
...
src/pages/productCenter/mobileConfig/menuconfig/miniMenu.jsx
View file @
add3f04e
...
...
@@ -78,7 +78,7 @@ const MiniMenu = props => {
},
[
menuID
]);
// 更新树
const
updateTrees
=
(
e
,
h
)
=>
{
const
updateTrees
=
e
=>
{
getMiniAppModuleTree
({
userMode
:
userMode
||
'super'
,
})
...
...
@@ -97,9 +97,8 @@ const MiniMenu = props => {
if
(
result
.
length
>
0
)
{
if
(
e
)
{
result
.
map
(
item
=>
mapData
(
item
,
e
));
let
aa
=
[...
mapDataList
].
find
(
i
=>
i
.
text
===
e
&&
i
.
menuType
===
h
);
let
aa
=
[...
mapDataList
].
find
(
i
=>
i
.
menuID
==
e
);
console
.
log
(
aa
);
console
.
log
(
h
);
setMenuID
(
aa
.
menuID
);
setExpendKey
(
aa
.
menuID
);
switch
(
aa
.
menuType
)
{
...
...
@@ -393,7 +392,7 @@ const MiniMenu = props => {
setFlag
(
flag
+
1
);
console
.
log
(
prop
);
console
.
log
(
item
);
updateTrees
(
prop
.
menuName
,
e
);
updateTrees
(
res
.
data
);
notification
.
success
({
message
:
'提示'
,
description
:
'新增成功'
,
...
...
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