Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
H
hs-sky-ui
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
何虹
hs-sky-ui
Commits
7df316df
Commit
7df316df
authored
Jan 20, 2021
by
何虹
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
升级表格组件
parent
118ef195
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
20 deletions
+39
-20
child.vue
src/packages/hs-table/src/child.vue
+39
-20
No files found.
src/packages/hs-table/src/child.vue
View file @
7df316df
...
...
@@ -49,8 +49,8 @@
:row-style=
'setRowStyle'
>
<template
v-for=
'(column,index) in tableColumns'
>
<template
v-if=
"!column.childs"
>
<template
v-for=
'(column
Item
,index) in tableColumns'
>
<template
v-if=
"!column
Item
.childs"
>
<u-table-column
v-if=
'tableConfig.expandChild'
:key=
"index"
...
...
@@ -61,20 +61,20 @@
</
template
>
</u-table-column>
<u-table-column
v-else-if=
"column.showType==='index'"
v-else-if=
"column
Item
.showType==='index'"
:key=
"index"
type=
"index"
width=
"55"
/>
<u-table-column
v-else-if=
"column.showType==='selection'"
v-else-if=
"column
Item
.showType==='selection'"
:key=
"index"
type=
"selection"
width=
"55"
:selectable=
"selectable"
/>
<u-table-column
v-else-if=
'column.showType==="handleColumn"'
v-else-if=
'column
Item
.showType==="handleColumn"'
:key=
"index"
fixed=
"right"
label=
"操作"
...
...
@@ -93,43 +93,49 @@
<u-table-column
v-else
:key=
"index"
:resizable=
"column.resizable"
:show-overflow-tooltip=
"column.showOverflow"
:prop=
"column.prop"
:label=
"column.label"
:fixed=
"column.fixed"
:min-width=
"column.width||80"
:sortable=
"column.isSort?'custom':false"
:resizable=
"column
Item
.resizable"
:show-overflow-tooltip=
"column
Item
.showOverflow"
:prop=
"column
Item
.prop"
:label=
"column
Item
.label"
:fixed=
"column
Item
.fixed"
:min-width=
"column
Item
.width||80"
:sortable=
"column
Item
.isSort?'custom':false"
>
<
template
v-slot:header
>
<span
v-if=
"columnItem.isRequired"
:class=
"
{'is-isRequired': columnItem.isRequired}">
*
</span>
<span>
{{
columnItem
.
label
}}
</span>
</
template
>
<
template
slot-scope=
"scope"
>
<i
v-if=
"column.type==='checkBox'"
:class=
"rowCellBoolean(scope.row[column.prop])"
v-if=
"column
Item
.type==='checkBox'"
:class=
"rowCellBoolean(scope.row[column
Item
.prop])"
></i>
<childItem
v-else
:editable=
'editable'
v-bind=
"$attrs"
v-on=
"$listeners"
:item=
'column'
:prop=
"column.prop"
:item=
'column
Item
'
:prop=
"column
Item
.prop"
:formParms=
'scope.row'
>
</childItem>
</
template
>
</u-table-column>
</template>
<
template
v-else-if=
'column.childs'
>
<
template
v-else-if=
'column
Item
.childs'
>
<u-table-column
:label=
"column.label"
:label=
"column
Item
.label"
:key=
"index"
>
<template
v-for=
"item in column.childs"
>
<template
v-for=
"item in column
Item
.childs"
>
<u-table-column
:prop=
"item.prop"
:label=
"item.label"
:key=
"item.label"
:min-width=
"
column
.width||80"
:min-width=
"
item
.width||80"
>
<template
slot-scope=
"scope"
>
<childItem
...
...
@@ -230,6 +236,12 @@
:min-width=
"column.width||80"
:sortable=
"column.isSort"
>
<
template
v-slot:header
>
<span
v-if=
"column.isRequired"
:class=
"
{'is-isRequired': column.isRequired}">
*
</span>
<span>
{{
column
.
label
}}
</span>
</
template
>
<
template
slot-scope=
"scope"
>
<i
v-if=
"column.type==='checkBox'"
...
...
@@ -432,6 +444,10 @@ export default {
},
mounted
()
{},
methods
:
{
getRequired
(
item
)
{
console
.
log
(
item
)
return
true
},
tableDoLayout
()
{
this
.
$refs
.
plTable
.
doLayout
()
},
...
...
@@ -1067,5 +1083,8 @@ export default {
td
{
height
:
35px
!important
;
}
.is-isRequired
{
color
:
red
;
}
</
style
>
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