Commit 3d9e4f20652e4afde1997ded8c9272a0e194d5fe
1 parent
7f34c510
update Table
update Table
Showing
2 changed files
with
33 additions
and
12 deletions
Show diff stats
src/components/table/table-head.vue
| ... | ... | @@ -48,16 +48,17 @@ |
| 48 | 48 | }, |
| 49 | 49 | selectAll () { |
| 50 | 50 | const status = !this.isSelectAll; |
| 51 | + this.$parent.selectAll(status); | |
| 51 | 52 | |
| 52 | - let tmpData = deepCopy(this.cloneData); | |
| 53 | - tmpData.forEach((data) => { | |
| 54 | - data._isChecked = status; | |
| 55 | - }); | |
| 56 | - this.cloneData = tmpData; | |
| 57 | - | |
| 58 | - if (status) { | |
| 59 | - this.$parent.selectAll(); | |
| 60 | - } | |
| 53 | +// let tmpData = deepCopy(this.cloneData); | |
| 54 | +// tmpData.forEach((data) => { | |
| 55 | +// data._isChecked = status; | |
| 56 | +// }); | |
| 57 | +// this.cloneData = tmpData; | |
| 58 | +// | |
| 59 | +// if (status) { | |
| 60 | +// this.$parent.selectAll(); | |
| 61 | +// } | |
| 61 | 62 | } |
| 62 | 63 | } |
| 63 | 64 | } | ... | ... |
src/components/table/table.vue
| ... | ... | @@ -18,7 +18,13 @@ |
| 18 | 18 | :clone-data="cloneData"></table-body> |
| 19 | 19 | </div> |
| 20 | 20 | <div :class="[prefixCls + '-fixed']"> |
| 21 | - <!--todo设置个div头部--> | |
| 21 | + <!--todo 设置个div头部--> | |
| 22 | + <table-head | |
| 23 | + fixed | |
| 24 | + :prefix-cls="prefixCls" | |
| 25 | + :style="fixedTableStyle" | |
| 26 | + :columns="leftFixedColumns" | |
| 27 | + :clone-data="cloneData"></table-head> | |
| 22 | 28 | <table-body |
| 23 | 29 | fixed |
| 24 | 30 | :prefix-cls="prefixCls" |
| ... | ... | @@ -28,6 +34,12 @@ |
| 28 | 34 | :clone-data="cloneData"></table-body> |
| 29 | 35 | </div> |
| 30 | 36 | <div :class="[prefixCls + '-fixed-right']"> |
| 37 | + <table-head | |
| 38 | + fixed | |
| 39 | + :prefix-cls="prefixCls" | |
| 40 | + :style="fixedRightTableStyle" | |
| 41 | + :columns="rightFixedColumns" | |
| 42 | + :clone-data="cloneData"></table-head> | |
| 31 | 43 | <table-body |
| 32 | 44 | fixed |
| 33 | 45 | :prefix-cls="prefixCls" |
| ... | ... | @@ -238,8 +250,16 @@ |
| 238 | 250 | } |
| 239 | 251 | this.$emit('on-selection-change', selection); |
| 240 | 252 | }, |
| 241 | - selectAll () { | |
| 242 | - this.$emit('on-select-all', this.getSelection()); | |
| 253 | + selectAll (status) { | |
| 254 | + let tmpData = deepCopy(this.cloneData); | |
| 255 | + tmpData.forEach((data) => { | |
| 256 | + data._isChecked = status; | |
| 257 | + }); | |
| 258 | + this.cloneData = tmpData; | |
| 259 | + | |
| 260 | + if (status) { | |
| 261 | + this.$emit('on-select-all', this.getSelection()); | |
| 262 | + } | |
| 243 | 263 | }, |
| 244 | 264 | fixedHeader () { |
| 245 | 265 | if (!!this.height) { | ... | ... |