rewrite axios && mock data
This commit is contained in:
@@ -96,8 +96,8 @@
|
||||
getList() {
|
||||
this.listLoading = true;
|
||||
fetchList(this.listQuery).then(response => {
|
||||
this.list = response.items;
|
||||
this.total = response.total;
|
||||
this.list = response.data.items;
|
||||
this.total = response.data.total;
|
||||
this.listLoading = false;
|
||||
this.olderList = this.list.map(v => v.id);
|
||||
this.newList = this.olderList.slice();
|
||||
@@ -124,6 +124,7 @@
|
||||
.drag-handler{
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.show-d{
|
||||
margin-top: 15px;
|
||||
|
@@ -237,9 +237,9 @@
|
||||
},
|
||||
getRemoteUserList(query) {
|
||||
userSearch(query).then(response => {
|
||||
if (!response.items) return;
|
||||
if (!response.data.items) return;
|
||||
console.log(response)
|
||||
this.userLIstOptions = response.items.map(v => ({
|
||||
this.userLIstOptions = response.data.items.map(v => ({
|
||||
key: v.name
|
||||
}));
|
||||
})
|
||||
|
@@ -59,7 +59,6 @@
|
||||
data() {
|
||||
return {
|
||||
list: null,
|
||||
total: null,
|
||||
listLoading: true,
|
||||
listQuery: {
|
||||
page: 1,
|
||||
@@ -84,11 +83,10 @@
|
||||
getList() {
|
||||
this.listLoading = true;
|
||||
fetchList(this.listQuery).then(response => {
|
||||
this.list = response.items.map(v => {
|
||||
this.list = response.data.items.map(v => {
|
||||
v.edit = false;
|
||||
return v
|
||||
});
|
||||
this.total = response.total;
|
||||
this.listLoading = false;
|
||||
})
|
||||
}
|
||||
|
@@ -227,8 +227,8 @@
|
||||
getList() {
|
||||
this.listLoading = true;
|
||||
fetchList(this.listQuery).then(response => {
|
||||
this.list = response.items;
|
||||
this.total = response.total;
|
||||
this.list = response.data.items;
|
||||
this.total = response.data.total;
|
||||
this.listLoading = false;
|
||||
})
|
||||
},
|
||||
|
@@ -24,7 +24,7 @@
|
||||
watch: {
|
||||
role(val) {
|
||||
this.$store.commit('SET_ROLES', [val]);
|
||||
window.location.reload()
|
||||
this.$router.push({ path: '/permission/index?' + +new Date() });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user