Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
Iot_mobile
Project
Project
Details
Activity
Releases
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
wuhao
Iot_mobile
Commits
8b44ded0
Commit
8b44ded0
authored
Feb 22, 2023
by
wuhao
🎯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mobile finished
parent
b123c292
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
63 additions
and
12 deletions
+63
-12
index.jsx
src/components/AutoTable/index.jsx
+8
-2
index.less
src/components/AutoTable/index.less
+3
-2
global.less
src/global.less
+22
-1
BasicLayout.jsx
src/layouts/BasicLayout.jsx
+1
-1
columns.js
src/pages/home/columns.js
+8
-0
index.jsx
src/pages/home/index.jsx
+21
-6
No files found.
src/components/AutoTable/index.jsx
View file @
8b44ded0
...
...
@@ -58,9 +58,15 @@ export default (props) => {
...
searchparams
,
},
});
const
dataes
=
append
?.
data
?.
page
?.
records
??
append
?.
data
?.
dataList
??
[];
const
page
=
append
?.
data
?.
page
;
const
dataes
=
page
?.
records
??
append
?.
data
?.
dataList
??
[];
setData
((
val
)
=>
[...
val
,
...
dataes
]);
return
append
?.
data
?.
page
??
{
hasNextPage
:
false
};
return
page
?
{
...
page
,
hasNextPage
:
page
.
size
>
page
.
current
,
}
:
{
hasNextPage
:
false
};
}
//加载更多数据
async
function
loadMore
()
{
...
...
src/components/AutoTable/index.less
View file @
8b44ded0
...
...
@@ -3,9 +3,10 @@
.header {
display: flex;
align-items: center;
position: sticky;
position: fixed;
width: 100%;
z-index: 122;
top: 4
5
px;
top: 4
0
px;
left: 0;
> div {
width: 100%;
...
...
src/global.less
View file @
8b44ded0
...
...
@@ -86,7 +86,9 @@ a {
padding: 6px 0;
margin: 0px 12px;
border-top: 1px dashed #f0f0f01d;
border-bottom: 1px dashed #f0f0f01a;
}
.split:first-child{
border-top: none !important;
}
.ant-drawer-content {
background: linear-gradient(to bottom, #142f4d, #657b90) !important;
...
...
@@ -118,8 +120,27 @@ a:active{
justify-content: space-between;
flex-direction: column;
padding-left: 12px;
overflow: hidden;
h2,h3,p{
margin: 0;
margin-bottom: 0;
width: 100%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
display: inline-block;
font-weight: bolder;
}
h3,p{
font-size: 14px;
}
p{
font-weight: normal;
}
}
.ant-badge-count{
box-shadow: none !important;
*{
color: #fff !important;
}
}
\ No newline at end of file
src/layouts/BasicLayout.jsx
View file @
8b44ded0
...
...
@@ -343,7 +343,7 @@ function BasicLayout() {
{
currouter
?.
name
}
</
NavBar
>
</
div
>
<
div
style=
{
{
height
:
45
}
}
></
div
>
<
div
style=
{
{
height
:
94
}
}
></
div
>
<
div
onTouchStart=
{
handleTouchStart
}
onTouchMove=
{
handleTouchMove
}
>
<
Outlet
></
Outlet
>
</
div
>
...
...
src/pages/home/columns.js
View file @
8b44ded0
...
...
@@ -5,11 +5,19 @@ function getcolumns(setdrawer) {
title
:
'设备名称'
,
dataIndex
:
'deviceName'
,
key
:
'deviceName'
,
hidetitle
:
true
,
},
{
title
:
'设备状态'
,
dataIndex
:
'deviceStatusName'
,
key
:
'deviceStatusName'
,
hidetitle
:
true
,
render
:
(
text
,
record
)
=>
{
return
<
div
style
=
{{
color
:
record
?.
statusColorList
?.
filter
(
it
=>
it
.
type
===
record
.
deviceStatus
)[
0
].
color
}}
>
{
text
}
<
/div
>
}
},
{
title
:
'活跃时间'
,
...
...
src/pages/home/index.jsx
View file @
8b44ded0
...
...
@@ -3,7 +3,7 @@ import * as React from 'react';
import
{
useState
,
useMemo
,
useRef
}
from
'react'
;
import
DrawerPro
from
'@/components/DrawerPro'
;
import
AutoTable
from
'@/components/AutoTable'
;
import
PremButton
from
'@/components/PremButton
'
;
import
{
Badge
}
from
'antd
'
;
import
getcolumns
from
'./columns'
;
import
{
useAsyncEffect
,
useRequest
}
from
'ahooks'
;
import
{
doFetch
}
from
'@/utils/doFetch'
;
...
...
@@ -116,9 +116,22 @@ const Cards = ({ item, columns }) => {
return
(
<
div
className=
"split"
>
<
div
className=
"spread"
style=
{
{
justifyContent
:
'flex-start'
}
}
>
<
div
style=
{
{
width
:
120
,
height
:
120
,
flexShrink
:
0
}
}
>
<
ReactECharts
option=
{
option
}
style=
{
{
height
:
'100%'
}
}
/>
</
div
>
<
Badge
count=
{
item
.
alarmNum
}
overflowCount=
{
99
}
offset=
{
[
-
10
,
10
]
}
color=
{
item
.
alarmNum
<
10
?
'#108ee9'
:
item
.
alarmNum
<
30
?
'#f76e1e'
:
'red'
}
>
<
div
style=
{
{
width
:
120
,
height
:
120
,
flexShrink
:
0
}
}
>
<
ReactECharts
option=
{
option
}
style=
{
{
height
:
'100%'
}
}
/>
</
div
>
</
Badge
>
<
div
style=
{
{
flex
:
1
}
}
className=
"rightsection"
>
{
columns
...
...
@@ -134,8 +147,10 @@ const Cards = ({ item, columns }) => {
);
return
(
<
Bod
key=
{
it
?.
dataIndex
}
>
{
it
?.
title
}
{
item
[
it
?.
dataIndex
]
}
{
it
?.
hidetitle
?
''
:
`${it?.title}: `
}
{
it
.
render
?
it
.
render
(
item
[
it
?.
dataIndex
],
item
)
:
item
[
it
?.
dataIndex
]
}
</
Bod
>
);
})
}
...
...
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