数据不重复加载
Showing
1 changed file
with
17 additions
and
4 deletions
... | @@ -70,6 +70,8 @@ export default { | ... | @@ -70,6 +70,8 @@ export default { |
70 | data(){ | 70 | data(){ |
71 | return { | 71 | return { |
72 | tableData: [], | 72 | tableData: [], |
73 | scData:[], | ||
74 | ycData:[], | ||
73 | scyclx:'0', | 75 | scyclx:'0', |
74 | } | 76 | } |
75 | }, | 77 | }, |
... | @@ -80,7 +82,11 @@ export default { | ... | @@ -80,7 +82,11 @@ export default { |
80 | methods:{ | 82 | methods:{ |
81 | 83 | ||
82 | scyclxChange(){ | 84 | scyclxChange(){ |
83 | this.getData(); | 85 | if(this.scyclx === '0'){ |
86 | this.tableData = this.ycData; | ||
87 | }else { | ||
88 | this.tableData = this.scData; | ||
89 | } | ||
84 | }, | 90 | }, |
85 | 91 | ||
86 | chFilter(row, column){ | 92 | chFilter(row, column){ |
... | @@ -101,11 +107,18 @@ export default { | ... | @@ -101,11 +107,18 @@ export default { |
101 | 107 | ||
102 | getData(){ | 108 | getData(){ |
103 | let zrzbsm = this.$store.state.zrzbsm; | 109 | let zrzbsm = this.$store.state.zrzbsm; |
104 | let scyclx = this.scyclx; | 110 | // let scyclx = this.scyclx; |
105 | getDetailInfo(zrzbsm,scyclx).then((res)=>{ | 111 | getDetailInfo(zrzbsm,'0').then((res)=>{ |
112 | if(res.code===200){ | ||
113 | console.log(res.result) | ||
114 | this.ycData = res.result; | ||
115 | this.tableData=this.ycData; | ||
116 | } | ||
117 | }); | ||
118 | getDetailInfo(zrzbsm,'1').then((res)=>{ | ||
106 | if(res.code===200){ | 119 | if(res.code===200){ |
107 | console.log(res.result) | 120 | console.log(res.result) |
108 | this.tableData = res.result; | 121 | this.scData = res.result; |
109 | } | 122 | } |
110 | }) | 123 | }) |
111 | }, | 124 | }, | ... | ... |
-
Please register or sign in to post a comment