Commit 3d9e4f20652e4afde1997ded8c9272a0e194d5fe

Authored by 梁灏
1 parent 7f34c510

update Table

update Table
src/components/table/table-head.vue
@@ -48,16 +48,17 @@ @@ -48,16 +48,17 @@
48 }, 48 },
49 selectAll () { 49 selectAll () {
50 const status = !this.isSelectAll; 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,7 +18,13 @@
18 :clone-data="cloneData"></table-body> 18 :clone-data="cloneData"></table-body>
19 </div> 19 </div>
20 <div :class="[prefixCls + '-fixed']"> 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 <table-body 28 <table-body
23 fixed 29 fixed
24 :prefix-cls="prefixCls" 30 :prefix-cls="prefixCls"
@@ -28,6 +34,12 @@ @@ -28,6 +34,12 @@
28 :clone-data="cloneData"></table-body> 34 :clone-data="cloneData"></table-body>
29 </div> 35 </div>
30 <div :class="[prefixCls + '-fixed-right']"> 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 <table-body 43 <table-body
32 fixed 44 fixed
33 :prefix-cls="prefixCls" 45 :prefix-cls="prefixCls"
@@ -238,8 +250,16 @@ @@ -238,8 +250,16 @@
238 } 250 }
239 this.$emit('on-selection-change', selection); 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 fixedHeader () { 264 fixedHeader () {
245 if (!!this.height) { 265 if (!!this.height) {