Commit a12e2740 by lixiaomin

修改机器详情-组件管理分页

parent 825799f5
...@@ -26,9 +26,9 @@ export function getMachineComLog(id) { ...@@ -26,9 +26,9 @@ export function getMachineComLog(id) {
} }
// 机器组件 // 机器组件
export function getComponentList(id) { export function getComponentList(id,page,limit) {
return request({ return request({
url: "/v1/machine/component?machine_id=" + id, url: "/v1/machine/component?machine_id=" + id+"&page="+page+"&limit="+limit,
method: "get", method: "get",
}); });
} }
......
...@@ -16,6 +16,15 @@ ...@@ -16,6 +16,15 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage"
:page-sizes="[10, 20, 30, 40, 50]"
:page-size="pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="total">
</el-pagination>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
<div slot="footer" class="dialog-footer" > <div slot="footer" class="dialog-footer" >
...@@ -53,7 +62,11 @@ export default { ...@@ -53,7 +62,11 @@ export default {
ros_code:"", ros_code:"",
component_name:"", component_name:"",
materialId:"", materialId:"",
machineState:null machineState:null,
// 总条数
total: 0,
currentPage:1,
pageSize:10
}; };
}, },
created() { created() {
...@@ -70,11 +83,22 @@ export default { ...@@ -70,11 +83,22 @@ export default {
this.machineState=row.state this.machineState=row.state
this.getComponentList(); this.getComponentList();
}, },
handleSizeChange(val){
this.currentPage=1;
this.pageSize=val;
this.getComponentList();
},
handleCurrentChange(val){
this.currentPage=val;
//this.pageSize=1;
this.getComponentList();
},
getComponentList(){ getComponentList(){
this.loading = true; this.loading = true;
getComponentList(this.machineId).then((response) => { getComponentList(this.machineId,this.currentPage,this.pageSize).then((response) => {
if(response.code==0){ if(response.code==0){
this.componentList = response.data; this.componentList = response.data.data;
this.total=response.data.count;
this.loading = false; this.loading = false;
} }
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment