增加注释
Showing
2 changed files
with
104 additions
and
0 deletions
| ... | @@ -60,16 +60,36 @@ export default { | ... | @@ -60,16 +60,36 @@ export default { |
| 60 | this.iconList = icoNameList | 60 | this.iconList = icoNameList |
| 61 | }, | 61 | }, |
| 62 | methods: { | 62 | methods: { |
| 63 | /** | ||
| 64 | * @description: show | ||
| 65 | * @param {*} show | ||
| 66 | * @author: renchao | ||
| 67 | */ | ||
| 63 | show(show) { | 68 | show(show) { |
| 64 | this.visible = show | 69 | this.visible = show |
| 65 | }, | 70 | }, |
| 71 | /** | ||
| 72 | * @description: handleClick | ||
| 73 | * @param {*} tab | ||
| 74 | * @param {*} event | ||
| 75 | * @author: renchao | ||
| 76 | */ | ||
| 66 | handleClick(tab, event) { | 77 | handleClick(tab, event) { |
| 67 | }, | 78 | }, |
| 79 | /** | ||
| 80 | * @description: changeData | ||
| 81 | * @param {*} iconName | ||
| 82 | * @author: renchao | ||
| 83 | */ | ||
| 68 | changeData(iconName) { | 84 | changeData(iconName) { |
| 69 | this.visible = false | 85 | this.visible = false |
| 70 | // 传递图标名称给父级 | 86 | // 传递图标名称给父级 |
| 71 | this.$emit('iconName', iconName) | 87 | this.$emit('iconName', iconName) |
| 72 | }, | 88 | }, |
| 89 | /** | ||
| 90 | * @description: changeIconName | ||
| 91 | * @author: renchao | ||
| 92 | */ | ||
| 73 | changeIconName() { | 93 | changeIconName() { |
| 74 | this.visible = false | 94 | this.visible = false |
| 75 | // 传递图标名称给父级 | 95 | // 传递图标名称给父级 | ... | ... |
| ... | @@ -125,15 +125,30 @@ export default { | ... | @@ -125,15 +125,30 @@ export default { |
| 125 | }, | 125 | }, |
| 126 | methods: { | 126 | methods: { |
| 127 | // 单选 | 127 | // 单选 |
| 128 | /** | ||
| 129 | * @description: 单选 | ||
| 130 | * @param {*} row | ||
| 131 | * @author: renchao | ||
| 132 | */ | ||
| 128 | singleElection (row) { | 133 | singleElection (row) { |
| 129 | this.selected = this.data.indexOf(row); | 134 | this.selected = this.data.indexOf(row); |
| 130 | }, | 135 | }, |
| 131 | 136 | ||
| 137 | /** | ||
| 138 | * @description: tableRowClassName | ||
| 139 | * @param {*} row | ||
| 140 | * @param {*} rowIndex | ||
| 141 | * @author: renchao | ||
| 142 | */ | ||
| 132 | tableRowClassName ({ row, rowIndex }) { | 143 | tableRowClassName ({ row, rowIndex }) { |
| 133 | if (rowIndex % 2 === 1) { | 144 | if (rowIndex % 2 === 1) { |
| 134 | return 'interlaced'; | 145 | return 'interlaced'; |
| 135 | } | 146 | } |
| 136 | }, | 147 | }, |
| 148 | /** | ||
| 149 | * @description: getHeight | ||
| 150 | * @author: renchao | ||
| 151 | */ | ||
| 137 | getHeight () { | 152 | getHeight () { |
| 138 | if (!this.heightNumSetting) { | 153 | if (!this.heightNumSetting) { |
| 139 | let _this = this | 154 | let _this = this |
| ... | @@ -169,6 +184,12 @@ export default { | ... | @@ -169,6 +184,12 @@ export default { |
| 169 | }) | 184 | }) |
| 170 | } | 185 | } |
| 171 | }, | 186 | }, |
| 187 | /** | ||
| 188 | * @description: calcHeightx | ||
| 189 | * @param {*} value | ||
| 190 | * @param {*} wappered | ||
| 191 | * @author: renchao | ||
| 192 | */ | ||
| 172 | calcHeightx (value, wappered = true) { | 193 | calcHeightx (value, wappered = true) { |
| 173 | //项目自定义的公共header部分的高度,可忽略 | 194 | //项目自定义的公共header部分的高度,可忽略 |
| 174 | let header = document.querySelector(".from-clues-header").offsetHeight; | 195 | let header = document.querySelector(".from-clues-header").offsetHeight; |
| ... | @@ -194,36 +215,91 @@ export default { | ... | @@ -194,36 +215,91 @@ export default { |
| 194 | } | 215 | } |
| 195 | return res; | 216 | return res; |
| 196 | }, | 217 | }, |
| 218 | /** | ||
| 219 | * @description: clearSelection | ||
| 220 | * @author: renchao | ||
| 221 | */ | ||
| 197 | clearSelection () { | 222 | clearSelection () { |
| 198 | this.$refs.elTable.clearSelection() | 223 | this.$refs.elTable.clearSelection() |
| 199 | }, | 224 | }, |
| 225 | /** | ||
| 226 | * @description: toggleRowSelection | ||
| 227 | * @param {*} row | ||
| 228 | * @param {*} selected | ||
| 229 | * @author: renchao | ||
| 230 | */ | ||
| 200 | toggleRowSelection (row, selected) { | 231 | toggleRowSelection (row, selected) { |
| 201 | this.$refs.elTable.toggleRowSelection(row, selected) | 232 | this.$refs.elTable.toggleRowSelection(row, selected) |
| 202 | }, | 233 | }, |
| 234 | /** | ||
| 235 | * @description: toggleAllSelection | ||
| 236 | * @author: renchao | ||
| 237 | */ | ||
| 203 | toggleAllSelection () { | 238 | toggleAllSelection () { |
| 204 | this.$refs.elTable.toggleAllSelection() | 239 | this.$refs.elTable.toggleAllSelection() |
| 205 | }, | 240 | }, |
| 241 | /** | ||
| 242 | * @description: toggleRowExpansion | ||
| 243 | * @param {*} row | ||
| 244 | * @param {*} expanded | ||
| 245 | * @author: renchao | ||
| 246 | */ | ||
| 206 | toggleRowExpansion (row, expanded) { | 247 | toggleRowExpansion (row, expanded) { |
| 207 | this.$refs.elTable.toggleRowExpansion(row, expanded) | 248 | this.$refs.elTable.toggleRowExpansion(row, expanded) |
| 208 | }, | 249 | }, |
| 250 | /** | ||
| 251 | * @description: setCurrentRow | ||
| 252 | * @param {*} row | ||
| 253 | * @author: renchao | ||
| 254 | */ | ||
| 209 | setCurrentRow (row) { | 255 | setCurrentRow (row) { |
| 210 | this.$refs.elTable.setCurrentRow(row) | 256 | this.$refs.elTable.setCurrentRow(row) |
| 211 | }, | 257 | }, |
| 258 | /** | ||
| 259 | * @description: clearSort | ||
| 260 | * @author: renchao | ||
| 261 | */ | ||
| 212 | clearSort () { | 262 | clearSort () { |
| 213 | this.$refs.elTable.clearSort() | 263 | this.$refs.elTable.clearSort() |
| 214 | }, | 264 | }, |
| 265 | /** | ||
| 266 | * @description: clearFilter | ||
| 267 | * @param {*} columnKey | ||
| 268 | * @author: renchao | ||
| 269 | */ | ||
| 215 | clearFilter (columnKey) { | 270 | clearFilter (columnKey) { |
| 216 | this.$refs.elTable.clearFilter(columnKey) | 271 | this.$refs.elTable.clearFilter(columnKey) |
| 217 | }, | 272 | }, |
| 273 | /** | ||
| 274 | * @description: doLayout | ||
| 275 | * @author: renchao | ||
| 276 | */ | ||
| 218 | doLayout () { | 277 | doLayout () { |
| 219 | this.$refs.elTable.doLayout() | 278 | this.$refs.elTable.doLayout() |
| 220 | }, | 279 | }, |
| 280 | /** | ||
| 281 | * @description: sort | ||
| 282 | * @param {*} prop | ||
| 283 | * @param {*} order | ||
| 284 | * @author: renchao | ||
| 285 | */ | ||
| 221 | sort (prop, order) { | 286 | sort (prop, order) { |
| 222 | this.$refs.elTable.sort(prop, order) | 287 | this.$refs.elTable.sort(prop, order) |
| 223 | }, | 288 | }, |
| 289 | /** | ||
| 290 | * @description: paginationCurrentChange | ||
| 291 | * @param {*} val | ||
| 292 | * @author: renchao | ||
| 293 | */ | ||
| 224 | paginationCurrentChange (val) { | 294 | paginationCurrentChange (val) { |
| 225 | this.$emit('p-current-change', val) | 295 | this.$emit('p-current-change', val) |
| 226 | }, | 296 | }, |
| 297 | /** | ||
| 298 | * @description: getMergeArr | ||
| 299 | * @param {*} tableData | ||
| 300 | * @param {*} merge | ||
| 301 | * @author: renchao | ||
| 302 | */ | ||
| 227 | getMergeArr (tableData, merge) { | 303 | getMergeArr (tableData, merge) { |
| 228 | if (!merge) return | 304 | if (!merge) return |
| 229 | this.mergeLine = {} | 305 | this.mergeLine = {} |
| ... | @@ -246,6 +322,14 @@ export default { | ... | @@ -246,6 +322,14 @@ export default { |
| 246 | }) | 322 | }) |
| 247 | }) | 323 | }) |
| 248 | }, | 324 | }, |
| 325 | /** | ||
| 326 | * @description: mergeMethod | ||
| 327 | * @param {*} row | ||
| 328 | * @param {*} column | ||
| 329 | * @param {*} rowIndex | ||
| 330 | * @param {*} columnIndex | ||
| 331 | * @author: renchao | ||
| 332 | */ | ||
| 249 | mergeMethod ({ row, column, rowIndex, columnIndex }) { | 333 | mergeMethod ({ row, column, rowIndex, columnIndex }) { |
| 250 | const index = this.merge.indexOf(column.property) | 334 | const index = this.merge.indexOf(column.property) |
| 251 | if (index > -1) { | 335 | if (index > -1) { | ... | ... |
-
Please register or sign in to post a comment