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
922764d9
Commit
922764d9
authored
Nov 30, 2021
by
Bill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 首页布局layout sort方法
parent
c6143ab9
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
package.json
package.json
+1
-1
useGetAuth.tsx
src/pages/home/hooks/useGetAuth.tsx
+4
-3
No files found.
package.json
View file @
922764d9
...
...
@@ -22,7 +22,7 @@
"start-noApi"
:
"yarn scripts:build && cross-env NODE_OPTIONS=--max_old_space_size=4096 UMI_ENV=local umi dev"
,
"build"
:
"yarn api && yarn scripts:build && yarn build:clean"
,
"build-noApi"
:
"yarn scripts:build && yarn build:clean"
,
"build:yxc"
:
"yarn api && yarn scripts:build-yxc && umi bu
ild"
,
"build:yxc"
:
"yarn api && yarn scripts:build-yxc && umi build"
,
"build:analyze"
:
"cross-env NODE_OPTIONS=--max_old_space_size=16384 ANALYZE=1 UMI_ENV=prod umi build"
,
"build:dev"
:
"pm2 start scripts/devServer.js"
,
"build:clean"
:
"cross-env NODE_OPTIONS=--max_old_space_size=16384 UMI_ENV=prod umi build"
,
...
...
src/pages/home/hooks/useGetAuth.tsx
View file @
922764d9
import
{
getAuth
}
from
"@/utils/auth"
import
{
useCallback
,
useMemo
}
from
"react"
;
import
{
sortBy
}
from
'lodash'
type
AbilityNameType
=
"orderAbility"
|
'shopAbility'
...
...
@@ -170,6 +169,7 @@ const useGetAuth = () => {
*
* @param authLayouts 根据pass 平台勾选的大模块, 生成的names 即从getLayoutCenters 得到的值
* @param isCheckedLayouts 后台返回的已勾选的的大模块项
*
*/
const
generateLayoutData
=
useCallback
((
authLayouts
:
string
[],
isCheckedLayouts
:
isCheckedLayoutsType
[])
=>
{
const
filterNameIsNull
=
isCheckedLayouts
.
filter
((
_item
)
=>
_item
.
name
!==
null
);
...
...
@@ -183,11 +183,12 @@ const useGetAuth = () => {
id
:
null
,
code
:
index
,
...
target
,
sort
:
target
.
sort
??
index
+
2
,
isShow
:
target
?.
id
?
true
:
false
,
}
})
// console.log(newLayoutData);
return
sortBy
(
newLayoutData
,
"sort"
);
return
newLayoutData
.
sort
((
a
,
b
)
=>
a
.
sort
-
b
.
sort
)
},
[])
return
{
...
...
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