Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
bdc
/
bdcdj-web
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
383736e0
authored
2023-07-19 16:46:34 +0800
by
yuanbo
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
增加注释
1 parent
9d811bf2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
93 additions
and
1 deletions
src/components/LbTable/lb-table.vue
src/components/LbTable/lb-table.vue
View file @
383736e
...
...
@@ -106,6 +106,11 @@
components
:
{
LbColumn
,
},
/**
* @description: data
* @author: renchao
*/
data
()
{
return
{
tableHeight
:
'auto'
,
...
...
@@ -114,6 +119,10 @@
selected
:
''
}
},
/**
* @description: created
* @author: renchao
*/
created
()
{
this
.
getMergeArr
(
this
.
data
,
this
.
merge
)
this
.
getHeight
()
...
...
@@ -124,17 +133,29 @@
},
},
methods
:
{
// 单选
/**
* @description: 单选
* @param {*} row
* @author: renchao
*/
singleElection
(
row
)
{
this
.
selected
=
this
.
data
.
indexOf
(
row
);
// this.$emit('row-click', row)
},
/**
* @description: tableRowClassName
* @author: renchao
*/
tableRowClassName
({
row
,
rowIndex
})
{
if
(
rowIndex
%
2
===
1
)
{
return
'interlaced'
;
}
},
/**
* @description: getHeight
* @author: renchao
*/
getHeight
()
{
if
(
!
this
.
heightNumSetting
)
{
let
_this
=
this
...
...
@@ -170,6 +191,12 @@
})
}
},
/**
* @description: calcHeightx
* @param {*} value
* @param {*} wappered
* @author: renchao
*/
calcHeightx
(
value
,
wappered
=
true
)
{
//项目自定义的公共header部分的高度,可忽略
let
header
=
document
.
querySelector
(
".from-clues-header"
).
offsetHeight
;
...
...
@@ -195,36 +222,89 @@
}
return
res
;
},
/**
* @description: clearSelection
* @author: renchao
*/
clearSelection
()
{
this
.
$refs
.
elTable
.
clearSelection
()
},
/**
* @description: toggleRowSelection
* @author: renchao
*/
toggleRowSelection
(
row
,
selected
)
{
this
.
$refs
.
elTable
.
toggleRowSelection
(
row
,
selected
)
},
/**
* @description: toggleAllSelection
* @author: renchao
*/
toggleAllSelection
()
{
this
.
$refs
.
elTable
.
toggleAllSelection
()
},
/**
* @description: toggleRowExpansion
* @param {*} row
* @param {*} bsm
* @author: renchao
*/
toggleRowExpansion
(
row
,
expanded
)
{
this
.
$refs
.
elTable
.
toggleRowExpansion
(
row
,
expanded
)
},
/**
* @description: setCurrentRow
* @param {*} row
* @author: renchao
*/
setCurrentRow
(
row
)
{
this
.
$refs
.
elTable
.
setCurrentRow
(
row
)
},
/**
* @description: setCurrentRow
* @author: renchao
*/
clearSort
()
{
this
.
$refs
.
elTable
.
clearSort
()
},
/**
* @description: clearFilter
* @param {*} columnKey
* @author: renchao
*/
clearFilter
(
columnKey
)
{
this
.
$refs
.
elTable
.
clearFilter
(
columnKey
)
},
/**
* @description: doLayout
* @author: renchao
*/
doLayout
()
{
this
.
$refs
.
elTable
.
doLayout
()
},
/**
* @description: sort
* @param {*} prop
* @param {*} order
* @author: renchao
*/
sort
(
prop
,
order
)
{
this
.
$refs
.
elTable
.
sort
(
prop
,
order
)
},
/**
* @description: paginationCurrentChange
* @param {*} val
* @author: renchao
*/
paginationCurrentChange
(
val
)
{
this
.
$emit
(
'p-current-change'
,
val
)
},
/**
* @description: getMergeArr
* @param {*} tableData
* @param {*} merge
* @author: renchao
*/
getMergeArr
(
tableData
,
merge
)
{
if
(
!
merge
)
return
this
.
mergeLine
=
{}
...
...
@@ -247,6 +327,10 @@
})
})
},
/**
* @description: mergeMethod
* @author: renchao
*/
mergeMethod
({
row
,
column
,
rowIndex
,
columnIndex
})
{
const
index
=
this
.
merge
.
indexOf
(
column
.
property
)
if
(
index
>
-
1
)
{
...
...
@@ -260,9 +344,17 @@
},
},
watch
:
{
/**
* @description: merge
* @author: renchao
*/
merge
()
{
this
.
getMergeArr
(
this
.
data
,
this
.
merge
)
},
/**
* @description: dataLength
* @author: renchao
*/
dataLength
()
{
this
.
getMergeArr
(
this
.
data
,
this
.
merge
)
}
...
...
Please
register
or
sign in
to post a comment