Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
npm
/
glsx-components
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 57ed9761
authored
Sep 30, 2021
by
limin
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'master' of
http://192.168.3.233:8090/npm/glsx-components
into master
2 parents
388a1467
1056858b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
115 additions
and
23 deletions
src/packages/Table/src/index.vue
src/packages/theme.scss
src/packages/Table/src/index.vue
View file @
57ed976
<!-- 表格+分页 -->
<!-- 表格+分页
v-show="tableShow"
-->
<
template
>
<
template
>
<div
class=
"glsx-table"
>
<div
class=
"glsx-table"
:class=
"
{'hasTableContent':showClass}">
<el-table
:ref=
"tableParams.mutiSelectName + 'MutiTable' || 'MutiTable'"
:data=
"getListApi ? data : tableData"
:row-key=
"tableParams.mutiSelectUniqueKey || ''"
v-loading=
"loading"
:border=
"border"
:highlight-current-row=
"true"
:stripe=
"true"
@
sort-change=
"sortChange"
@
selection-change=
"handleSelect"
:size=
"size"
:header-cell-style=
"headerStyle"
>
<el-table
id=
"initTable"
:ref=
"tableParams.mutiSelectName + 'MutiTable' || 'MutiTable'"
:data=
"getListApi ? data : tableData"
:row-key=
"tableParams.mutiSelectUniqueKey || ''"
v-loading=
"loading"
:border=
"border"
:height=
"height"
:highlight-current-row=
"true"
:stripe=
"true"
@
sort-change=
"sortChange"
@
selection-change=
"handleSelect"
:size=
"size"
:header-cell-style=
"headerStyle"
>
<el-table-column
v-if=
"tableParams.mutiSelectUniqueKey && tableParams.mutiSelectName"
type=
"selection"
width=
"55"
:selectable=
"checkSelectable"
:reserve-selection=
"true"
></el-table-column>
<el-table-column
v-if=
"tableParams.mutiSelectUniqueKey && tableParams.mutiSelectName"
type=
"selection"
width=
"55"
:selectable=
"checkSelectable"
:reserve-selection=
"true"
></el-table-column>
<el-table-column
v-if=
"hasNum"
align=
"center"
width=
"60px"
label=
"序号"
type=
"index"
:index=
"index => index + (page[this.pageConf.pageNum] - 1) * page[this.pageConf.pageSize] + 1"
></el-table-column>
<el-table-column
v-if=
"hasNum"
align=
"center"
width=
"60px"
label=
"序号"
type=
"index"
:index=
"index => index + (page[this.pageConf.pageNum] - 1) * page[this.pageConf.pageSize] + 1"
></el-table-column>
<el-table-column
v-for=
"(item, index) in tableColumns"
:key=
"index"
:label=
"item.label"
:prop=
"item.prop"
:width=
"item.width"
:min-width=
"item.minWidth"
:align=
"item.align || 'center'"
:sortable=
"item.sortable"
>
<el-table-column
v-for=
"(item, index) in tableColumns"
:key=
"index"
:label=
"item.label"
:prop=
"item.prop"
:width=
"item.width"
:min-width=
"item.minWidth"
:align=
"item.align || 'center'"
:sortable=
"item.sortable"
>
...
@@ -28,7 +28,7 @@
...
@@ -28,7 +28,7 @@
</el-table-column>
</el-table-column>
<div
slot=
"empty"
class=
"emptyBg"
>
<div
slot=
"empty"
class=
"emptyBg"
>
<img
class=
"noDataImg"
:src=
"noDataImg"
v-if=
"noDataImg"
alt=
""
/>
<img
class=
"noDataImg"
:src=
"noDataImg"
v-if=
"noDataImg"
alt=
""
/>
<
p>
{{ noDataText }}
</p
>
<
div>
{{ noDataText }}
</div
>
<slot
name=
"additionalContent"
></slot>
<slot
name=
"additionalContent"
></slot>
</div>
</div>
</el-table>
</el-table>
...
@@ -37,14 +37,8 @@
...
@@ -37,14 +37,8 @@
</template>
</template>
<
script
>
<
script
>
import
{
Table
,
TableColumn
,
Pagination
}
from
'element-ui'
export
default
{
export
default
{
name
:
'GLTable'
,
name
:
'glsx-table'
,
components
:
{
[
Table
.
name
]:
Table
,
[
TableColumn
.
name
]:
TableColumn
,
[
Pagination
.
name
]:
Pagination
},
data
()
{
data
()
{
return
{
return
{
loading
:
false
,
loading
:
false
,
...
@@ -54,7 +48,9 @@ export default {
...
@@ -54,7 +48,9 @@ export default {
total
:
10
,
total
:
10
,
// 多选数组
// 多选数组
mutiSelectArr
:
{},
mutiSelectArr
:
{},
tableColumns
:
[]
tableColumns
:
[],
showClass
:
false
}
}
},
},
...
@@ -63,6 +59,14 @@ export default {
...
@@ -63,6 +59,14 @@ export default {
type
:
String
,
type
:
String
,
default
:
'medium'
default
:
'medium'
},
},
height
:
{
type
:
String
,
default
:
''
},
// maxHeight:{
// type:String,
// default:'3000'
// },
noDataImg
:
{
noDataImg
:
{
type
:
String
,
type
:
String
,
default
:
''
default
:
''
...
@@ -183,6 +187,13 @@ export default {
...
@@ -183,6 +187,13 @@ export default {
watch
:
{
watch
:
{
customHeadShowList
(
val
)
{
customHeadShowList
(
val
)
{
this
.
isCustomHead
&&
this
.
findShowHeadCol
()
this
.
isCustomHead
&&
this
.
findShowHeadCol
()
},
data
:{
immediate
:
true
,
handler
(
val
){
this
.
showClass
=
val
.
length
>
0
?
true
:
false
;
},
deep
:
true
}
}
},
},
...
@@ -192,6 +203,25 @@ export default {
...
@@ -192,6 +203,25 @@ export default {
this
.
page
[
this
.
pageConf
.
pageSize
]
=
10
this
.
page
[
this
.
pageConf
.
pageSize
]
=
10
this
.
page
[
this
.
pageConf
.
pageNum
]
=
1
this
.
page
[
this
.
pageConf
.
pageNum
]
=
1
this
.
getListApi
&&
this
.
refreshTable
()
this
.
getListApi
&&
this
.
refreshTable
()
this
.
$nextTick
(()
=>
{
var
_this
=
this
setTimeout
(()
=>
{
// 使用getListApi获取和返回数组为空时算高度 !(_this.getListApi && _this.data.length==0)
if
(
_this
.
getListApi
){
let
offsettop
=
document
.
getElementById
(
'initTable'
).
offsetTop
console
.
log
(
'表格距离顶部'
,
offsettop
)
let
clientHeight
=
document
.
body
.
clientHeight
console
.
log
(
clientHeight
)
// _this.height=(clientHeight - offsettop - 101)+''
document
.
getElementById
(
'initTable'
).
style
.
height
=
(
clientHeight
-
offsettop
-
231
)
+
'px'
;
}
},
200
)
})
},
},
methods
:
{
methods
:
{
...
@@ -240,6 +270,7 @@ export default {
...
@@ -240,6 +270,7 @@ export default {
}
}
this
.
getListApi
(
params
)
this
.
getListApi
(
params
)
.
then
(
res
=>
{
.
then
(
res
=>
{
console
.
log
(
res
)
this
.
data
=
this
.
findVal
(
res
,
this
.
tableParams
.
listName
)
this
.
data
=
this
.
findVal
(
res
,
this
.
tableParams
.
listName
)
this
.
total
=
this
.
findVal
(
res
,
this
.
pageConf
.
totalCount
)
this
.
total
=
this
.
findVal
(
res
,
this
.
pageConf
.
totalCount
)
this
.
loading
=
false
this
.
loading
=
false
...
@@ -261,6 +292,9 @@ export default {
...
@@ -261,6 +292,9 @@ export default {
// 每页条数
// 每页条数
handleSizeChange
(
value
)
{
handleSizeChange
(
value
)
{
let
offsettop
=
document
.
getElementById
(
'initTable'
).
offsetTop
console
.
log
(
'表格距离顶部1'
,
offsettop
)
this
.
page
[
this
.
pageConf
.
pageSize
]
=
value
this
.
page
[
this
.
pageConf
.
pageSize
]
=
value
this
.
getListApi
?
this
.
refreshTable
(
false
,
false
)
:
this
.
$emit
(
'refreshTable'
,
this
.
page
)
this
.
getListApi
?
this
.
refreshTable
(
false
,
false
)
:
this
.
$emit
(
'refreshTable'
,
this
.
page
)
},
},
...
@@ -295,13 +329,19 @@ export default {
...
@@ -295,13 +329,19 @@ export default {
padding-left
:
14px
!important
;
padding-left
:
14px
!important
;
padding-right
:
14px
!important
;
padding-right
:
14px
!important
;
}
}
.glsx-table
.emptyBg
.noDataImg
{
.glsx-table
.emptyBg
{
display
:
inline-block
;
display
:
inline-block
;
margin-top
:
150px
;
margin-top
:
150px
;
height
:
100%
;
height
:
100%
;
}
}
.glsx-table
.emptyBg
p
{
.glsx-table
.emptyBg
div
{
margin
-top
:
-2
0px
;
margin
:
-20px
0
1
0px
;
height
:
100%
;
height
:
100%
;
}
}
/* .hasTableContent .el-table__body{
height: 100%;
} */
/* .hasTableContent .el-table__body-wrapper{
height: 100%;
} */
</
style
>
</
style
>
src/packages/theme.scss
View file @
57ed976
...
@@ -5,7 +5,7 @@ $dackColor: #4f48e6;
...
@@ -5,7 +5,7 @@ $dackColor: #4f48e6;
/* 按钮 */
/* 按钮 */
.el-button
{
.el-button
{
padding
:
1
0
px
20px
;
padding
:
1
2
px
20px
;
font-size
:
14px
;
font-size
:
14px
;
border-radius
:
4px
border-radius
:
4px
}
}
...
@@ -66,23 +66,23 @@ $dackColor: #4f48e6;
...
@@ -66,23 +66,23 @@ $dackColor: #4f48e6;
}
}
.el-button--small
{
.el-button--small
{
padding
:
9px
20
px
;
padding
:
8px
16
px
;
font-size
:
14px
;
font-size
:
14px
;
border-radius
:
4px
;
border-radius
:
4px
;
}
}
.el-button--small.is-round
{
.el-button--small.is-round
{
padding
:
9px
20
px
;
padding
:
8px
16
px
;
}
}
.el-button--mini
{
.el-button--mini
{
padding
:
9px
16
px
;
padding
:
5px
10
px
;
font-size
:
14px
;
font-size
:
14px
;
border-radius
:
4px
;
border-radius
:
4px
;
}
}
.el-button--mini.is-round
{
.el-button--mini.is-round
{
padding
:
9px
16
px
;
padding
:
5px
10
px
;
}
}
.el-dialog__title
{
.el-dialog__title
{
...
@@ -167,7 +167,13 @@ $dackColor: #4f48e6;
...
@@ -167,7 +167,13 @@ $dackColor: #4f48e6;
.el-radio__input.is-checked
.el-radio__inner
{
.el-radio__input.is-checked
.el-radio__inner
{
border-color
:
$defaultColor
;
border-color
:
$defaultColor
;
background
:
$defaultColor
;
background
:
#fff
;
}
.el-radio__inner
:after
{
background-color
:
$defaultColor
;
width
:
10px
;
height
:
10px
;
}
}
.el-radio__inner
:hover
{
.el-radio__inner
:hover
{
...
@@ -219,6 +225,33 @@ $dackColor: #4f48e6;
...
@@ -219,6 +225,33 @@ $dackColor: #4f48e6;
}
}
/* 面包屑*/
.el-breadcrumb__inner
a
,
.el-breadcrumb__inner.is-link
{
font-weight
:
400
;
color
:
#999999
;
}
.el-breadcrumb__inner
a
:hover
,
.el-breadcrumb__inner.is-link
:hover
{
color
:
$defaultColor
;
}
.el-breadcrumb__inner
{
font-weight
:
700
;
color
:
#3A3A3A
;
}
.el-breadcrumb__item
:last-child
.el-breadcrumb__inner
,
.el-breadcrumb__item
:last-child
.el-breadcrumb__inner
a
,
.el-breadcrumb__item
:last-child
.el-breadcrumb__inner
a
:hover
,
.el-breadcrumb__item
:last-child
.el-breadcrumb__inner
:hover
{
font-weight
:
700
;
color
:
#3A3A3A
;
}
/* 树形 */
/* 树形 */
.el-tree--highlight-current
.el-tree-node.is-current
>
.el-tree-node__content
{
.el-tree--highlight-current
.el-tree-node.is-current
>
.el-tree-node__content
{
...
@@ -234,6 +267,14 @@ $dackColor: #4f48e6;
...
@@ -234,6 +267,14 @@ $dackColor: #4f48e6;
/* 表格 */
/* 表格 */
.el-table--medium
.el-table__cell
{
padding
:
8
.5px
0px
;
}
.el-table
.cell
{
line-height
:
36px
;
}
.el-table
.el-table__header
tr
{
.el-table
.el-table__header
tr
{
background
:
#F4F6FC
;
background
:
#F4F6FC
;
font-size
:
14px
;
font-size
:
14px
;
...
@@ -258,11 +299,22 @@ $dackColor: #4f48e6;
...
@@ -258,11 +299,22 @@ $dackColor: #4f48e6;
}
}
.el-table--striped
.el-table__body
tr
.el-table__row--striped.current-row
td
.el-table__cell
{
.el-table--striped
.el-table__body
tr
.el-table__row--striped.current-row
td
.el-table__cell
{
background-color
:
#F4F
6FC
;
background-color
:
#F4F
3FF
;
}
}
.el-table__body
tr
.current-row
>
td
.el-table__cell
{
.el-table__body
tr
.current-row
>
td
.el-table__cell
{
background-color
:
#F4F6FC
;
background-color
:
#F4F3FF
;
}
.el-table--striped
.el-table__body
tr
.el-table__row--striped
td
.el-table__cell
{
background
:
#fff
;
}
.el-table__body
tr
.hover-row.current-row
>
td
.el-table__cell
,
.el-table__body
tr
.hover-row.el-table__row--striped.current-row
>
td
.el-table__cell
,
.el-table__body
tr
.hover-row.el-table__row--striped
>
td
.el-table__cell
,
.el-table__body
tr
.hover-row
>
td
.el-table__cell
{
background-color
:
#F4F3FF
;
}
}
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment