0d8405fd by yuanbo

增加注释

1 parent bfe8abfb
......@@ -52,6 +52,10 @@ export default {
LbRender
},
methods: {
/**
* @description: setColumn
* @author: renchao
*/
setColumn () {
if (this.column.type) {
this.column.renderHeader = forced[this.column.type].renderHeader
......
......@@ -112,15 +112,30 @@ export default {
},
methods: {
// 单选
/**
* @description: 单选
* @param {*} row
* @author: renchao
*/
singleElection (row) {
this.selected = this.data.indexOf(row);
},
/**
* @description: tableRowClassName
* @param {*} row
* @param {*} rowIndex
* @author: renchao
*/
tableRowClassName ({ row, rowIndex }) {
if (rowIndex % 2 === 1) {
return 'interlaced';
}
},
/**
* @description: getHeight
* @author: renchao
*/
getHeight () {
if (!this.heightNumSetting) {
let _this = this
......@@ -137,6 +152,12 @@ export default {
}
}
},
/**
* @description: calcHeightx
* @param {*} value
* @param {*} wappered
* @author: renchao
*/
calcHeightx (value, wappered = true) {
//项目自定义的公共header部分的高度,可忽略
let header = document.querySelector(".from-clues-header").offsetHeight;
......@@ -156,36 +177,91 @@ export default {
}
return res;
},
/**
* @description: clearSelection
* @author: renchao
*/
clearSelection () {
this.$refs.elTable.clearSelection()
},
/**
* @description: toggleRowSelection
* @param {*} row
* @param {*} selected
* @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 {*} expanded
* @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: clearSort
* @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 = {}
......@@ -208,6 +284,14 @@ export default {
})
})
},
/**
* @description: mergeMethod
* @param {*} row
* @param {*} column
* @param {*} rowIndex
* @param {*} columnIndex
* @author: renchao
*/
mergeMethod ({ row, column, rowIndex, columnIndex }) {
const index = this.merge.indexOf(column.property)
if (index > -1) {
......