Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
vue-gjjs
Overview
Overview
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
zhouqian
vue-gjjs
Commits
041cb5cd
Commit
041cb5cd
authored
Jun 07, 2021
by
1377875331@qq.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IStreamTableDocpan补充
parent
835e150f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
111 additions
and
0 deletions
+111
-0
IStreamTableDocpan.vue
src/components/IStreamTableDocpan.vue
+111
-0
No files found.
src/components/IStreamTableDocpan.vue
0 → 100644
View file @
041cb5cd
<
template
>
<div
class=
"eContainer-table-block"
>
<el-table
:data=
"tableData.slice((currentPage - 1) * pageSize, currentPage * pageSize)"
style=
"width: 100%"
class=
"eContainer-table"
:header-cell-style=
"
{background: 'eef1f6', color: '#606266'}">
<el-table-column
v-for=
"(item, key) in tableColumns"
:key=
"key"
:prop=
"item.prop"
:label=
"item.label"
:width=
"item.width"
></el-table-column>
<slot></slot>
</el-table>
<el-pagination
class=
"eContainer-pagination"
layout=
"prev, pager, next, jumper"
:page-sizes=
"pageSizes"
:page-size=
"pageSize"
:current-page=
"currentPage"
:total=
"tableData.length"
@
size-change=
"sizeChange"
@
current-change=
"currentChange"
></el-pagination>
<div
class=
"paginationLable"
>
当前显示第
{{
(
currentPage
-
1
)
*
pageSize
+
1
}}
-
{{
currentPage
*
pageSize
>
tableData
.
length
?
tableData
.
length
:
currentPage
*
pageSize
}}
条,共
{{
tableData
.
length
}}
条
</div>
</div>
</
template
>
<
script
>
export
default
{
props
:
{
columns
:
{
type
:
Array
,
default
:
()
=>
{
return
[];
},
},
list
:
{
type
:
Array
,
default
:
()
=>
{
return
[];
},
},
column
:
{
default
:
()
=>
{
return
[];
},
}
},
computed
:
{
tableColumns
()
{
const
arr
=
[];
for
(
let
i
=
0
;
i
<
this
.
columns
.
length
;
i
++
)
{
const
vals
=
this
.
columns
[
i
].
split
(
" "
)
arr
.
push
({
prop
:
vals
[
0
],
label
:
vals
[
1
],
width
:
"auto"
,
});
this
.
column
.
push
(
vals
[
0
]);
}
return
arr
;
},
tableData
()
{
const
temp
=
this
.
column
;
const
res
=
[];
return
this
.
list
.
map
((
row
)
=>
{
const
res
=
{}
for
(
let
i
=
0
;
i
<
temp
.
length
;
i
++
)
{
res
[
temp
[
i
]]
=
row
[
temp
[
i
]];
}
return
res
;
});
},
},
data
()
{
return
{
currentPage
:
1
,
pageSizes
:
[
5
,
10
,
20
,
30
,
40
,
50
,
100
],
pageSize
:
5
};
},
methods
:
{
sizeChange
(
size
)
{
this
.
pageSize
=
size
;
},
currentChange
(
currentPage
)
{
this
.
currentPage
=
currentPage
;
}
}
};
</
script
>
<
style
>
.eContainer-table-block
.paginationLable
{
font-size
:
12px
;
color
:
#808080
;
height
:
26px
;
line-height
:
26px
;
float
:
right
;
margin-top
:
20px
;
}
.eContainer-table-block
.el-table__body-wrapper
{
overflow
:
auto
;
}
.el-table
.warning-row
{
background
:
oldlace
;
}
.el-table
.success-row
{
background
:
#f0f9eb
;
}
</
style
>
\ No newline at end of file
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