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
shenshaokai
jinfa-platform
Commits
73694be5
Commit
73694be5
authored
Jul 05, 2021
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev-srm' of
http://10.0.0.22:3000/lingxi/lingxi-business-paltform
into dev-srm
parents
1c8b104a
ad313276
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
37 deletions
+67
-37
useGetAuth.tsx
src/pages/home/hooks/useGetAuth.tsx
+2
-2
index.tsx
src/pages/member/memberWarning/ruleSetting/index.tsx
+65
-35
No files found.
src/pages/home/hooks/useGetAuth.tsx
View file @
73694be5
...
...
@@ -42,7 +42,7 @@ const collection2Obj = <T, >(list: T[], name: string, isCover?: boolean) => {
const useGetAuth = () =
>
{
const
userAuth
=
getAuth
();
const
cacheAuth
=
useMemo
(()
=>
userAuth
,
[
userAuth
]);
const
urls
=
useMemo
(()
=>
cacheAuth
.
urls
,
[
cacheAuth
])
const
urls
=
useMemo
(()
=>
cacheAuth
?.
urls
||
[]
,
[
cacheAuth
])
const
abilityUrls
=
useMemo
(()
=>
{
return
{
...
...
@@ -130,7 +130,7 @@ const useGetAuth = () => {
return
currentAbilityUrl
.
some
((
_item
)
=>
urls
?.
some
((
_row
)
=>
_row
.
includes
(
_item
)));
},
[
urls
,
abilityUrls
])
const
isConsumer
=
useMemo
(()
=>
cacheAuth
.
memberRoleType
===
2
,
[
cacheAuth
])
const
isConsumer
=
useMemo
(()
=>
cacheAuth
?
.
memberRoleType
===
2
,
[
cacheAuth
])
/**
* 直接判断有没有大模块如果有,那么表示应该显示此模块,
...
...
src/pages/member/memberWarning/ruleSetting/index.tsx
View file @
73694be5
...
...
@@ -8,50 +8,76 @@ import { useDebounceFn } from '@umijs/hooks';
const
AllQuery
=
()
=>
{
const
[
dataSource
,
setDataSource
]
=
useState
([]);
const
[
dataSource
,
setDataSource
]
=
useState
<
any
[]
>
([]);
const
[
totalCount
,
setTotalCount
]
=
useState
<
number
>
(
1
);
const
[
page
,
setPage
]
=
useState
<
number
>
(
1
);
const
[
pageSize
,
setPageSize
]
=
useState
<
number
>
(
10
);
const
fetchData
=
useCallback
(
async
(
page
:
number
,
pageSize
:
number
)
=>
{
setDataSource
([{
no
:
1
,
value
:
'1'
,
level
:
1
,
}]);
},
[])
useEffect
(()
=>
{
fetchData
(
page
,
pageSize
)
},
[])
const
handleSetValue
=
(
params
:
{
dataIndex
:
string
,
value
:
string
,
index
:
number
})
=>
{
const
{
index
,
dataIndex
,
value
}
=
params
;
const
newData
=
dataSource
.
map
((
_item
,
currentIndex
)
=>
{
if
(
index
===
currentIndex
)
{
return
{
...
_item
,
[
dataIndex
]:
value
,
}
}
return
_item
;
})
setDataSource
(
newData
);
}
const
columns
=
useMemo
<
ColumnsType
<
any
>>
(()
=>
{
return
[
{
title
:
'序号'
,
dataIndex
:
'no'
,
},
{
title
:
'预警条件'
,
dataIndex
:
'memberName'
,
},
{
title
:
'预警提示语'
,
dataIndex
:
'project'
,
},
{
title
:
'预警提示语'
,
dataIndex
:
'notice'
,
},
{
title
:
'预警值'
,
dataIndex
:
'value'
,
render
:
(
text
,
record
,
index
)
=>
{
return
<
Input
value=
{
text
}
onChange=
{
(
e
)
=>
handleSetValue
({
dataIndex
:
'value'
,
value
:
e
.
target
.
value
,
index
:
index
})
}
/>
}
},
{
title
:
'预警值'
,
dataIndex
:
'value'
,
render
:
(
text
,
record
)
=>
{
return
<
Select
value=
{
text
}
/>
}
const
paginationOnChange
=
useCallback
((
page
:
number
,
pageSize
:
number
)
=>
{
setPage
(
page
);
setPageSize
(
pageSize
);
fetchData
(
page
,
pageSize
)
},
[
fetchData
])
const
columns
=
[
{
title
:
'序号'
,
dataIndex
:
'no'
,
},
{
title
:
'预警条件'
,
dataIndex
:
'memberName'
,
},
{
title
:
'预警提示语'
,
dataIndex
:
'project'
,
},
{
title
:
'预警提示语'
,
dataIndex
:
'notice'
,
},
{
title
:
'预警值'
,
dataIndex
:
'value'
,
render
:
(
text
,
record
,
index
)
=>
{
return
<
Input
value=
{
text
}
onChange=
{
(
e
)
=>
handleSetValue
({
dataIndex
:
'value'
,
value
:
e
.
target
.
value
,
index
:
index
})
}
/>
}
]
},
[])
},
{
title
:
'预警级别'
,
dataIndex
:
'level'
,
render
:
(
text
,
record
)
=>
{
return
<
Select
value=
{
text
}
/>
}
}
]
return
(
<
PageHeaderWrapper
...
...
@@ -61,6 +87,10 @@ const AllQuery = () => {
<
Table
columns=
{
columns
}
dataSource=
{
dataSource
}
rowKey=
"no"
pagination=
{
{
onChange
:
paginationOnChange
,
}
}
></
Table
>
</
Card
>
</
PageHeaderWrapper
>
...
...
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