|
|
@@ -10,6 +10,8 @@
|
|
|
:datasource="datasource"
|
|
|
row-key="id"
|
|
|
cache-key="returnKey"
|
|
|
+ autoAmendPage
|
|
|
+ :parse-data="parseData"
|
|
|
:selection.sync="selection"
|
|
|
>
|
|
|
<template v-slot:toolbar>
|
|
|
@@ -59,7 +61,7 @@
|
|
|
selection: [],
|
|
|
|
|
|
returnShow: false,
|
|
|
- returnDetailsId: null ,
|
|
|
+ returnDetailsId: null,
|
|
|
|
|
|
sceneList: []
|
|
|
};
|
|
|
@@ -132,7 +134,7 @@
|
|
|
},
|
|
|
|
|
|
handleReturn() {
|
|
|
- this.returnDetailsId = null
|
|
|
+ this.returnDetailsId = null;
|
|
|
this.returnShow = true;
|
|
|
},
|
|
|
|
|
|
@@ -145,8 +147,8 @@
|
|
|
},
|
|
|
|
|
|
handDetailed(row) {
|
|
|
- this.returnDetailsId = row.id
|
|
|
- this.returnShow = true
|
|
|
+ this.returnDetailsId = row.id;
|
|
|
+ this.returnShow = true;
|
|
|
},
|
|
|
|
|
|
getByCodeFn() {
|
|
|
@@ -174,6 +176,20 @@
|
|
|
/* 刷新表格 */
|
|
|
reload(where = {}) {
|
|
|
this.$refs.table.reload({ page: 1, where });
|
|
|
+ },
|
|
|
+
|
|
|
+ /* 数据转为树形结构 */
|
|
|
+ parseData(data) {
|
|
|
+ return {
|
|
|
+ ...data,
|
|
|
+ list: this.$util.toTreeData({
|
|
|
+ data: data.list,
|
|
|
+ count: data.total,
|
|
|
+
|
|
|
+ idField: 'id',
|
|
|
+ parentIdField: 'parentId'
|
|
|
+ })
|
|
|
+ };
|
|
|
}
|
|
|
}
|
|
|
};
|