Kaynağa Gözat

修改js获取后台数据到页面显示,由于后台封装不符合规范修改了下展示时获取js数据的方式

shiyj 6 yıl önce
ebeveyn
işleme
a2854129b5

+ 5 - 5
WebService/src/main/resources/components/list-demo/listDemo.html

@@ -25,20 +25,20 @@
                         </tr>
                         </thead>
                         <tbody>
-                        <tr v-for="owner in listDemoInfo.owners">
+                        <tr v-for="demo in listDemoInfo.demos">
                             <td>
-                                {{demos.demoId}}
+                                {{demo.demoId}}
                             </td>
 
                             <td>
-                                {{demos.demoName}}
+                                {{demo.demoName}}
                             </td>
 
                             <td>
-                                {{demos.demoValue}}
+                                {{demo.demoValue}}
                             </td>
                             <td>
-                                {{demos.demoRemark}}
+                                {{demo.demoRemark}}
                             </td>
                             <td class="text-right">
                                 <div class="btn-group">

+ 3 - 4
WebService/src/main/resources/components/list-demo/listDemo.js

@@ -35,10 +35,9 @@
                              param,
                              function(json,res){
                                 var listDemoDate =JSON.parse(json);
-
-                                vc.component.listDemoInfo.total = listDemoDate.total;
-                                vc.component.listDemoInfo.records = listDemoDate.records;
-                                vc.component.listDemoInfo.demos = listDemoDate.demos;
+                                vc.component.listDemoInfo.total = listDemoDate[0].total;
+                                vc.component.listDemoInfo.records = listDemoDate[0].records;
+                                vc.component.listDemoInfo.demos = listDemoDate;
 
                                 vc.emit('pagination','init',{
                                     total:vc.component.listDemoInfo.records,