mirror of
https://github.com/chillzhuang/blade-tool
synced 2024-12-12 12:19:27 +08:00
🎉 2.3.1.RELEASE
This commit is contained in:
parent
1b7f4121d3
commit
adcd42b62a
@ -12,13 +12,15 @@
|
|||||||
@search-change="searchChange"
|
@search-change="searchChange"
|
||||||
@search-reset="searchReset"
|
@search-reset="searchReset"
|
||||||
@selection-change="selectionChange"
|
@selection-change="selectionChange"
|
||||||
|
@current-change="currentChange"
|
||||||
|
@size-change="sizeChange"
|
||||||
@on-load="onLoad">
|
@on-load="onLoad">
|
||||||
<template slot="menuLeft">
|
<template slot="menuLeft">
|
||||||
<el-button type="danger"
|
<el-button type="danger"
|
||||||
size="small"
|
size="small"
|
||||||
icon="el-icon-delete"
|
icon="el-icon-delete"
|
||||||
plain
|
plain
|
||||||
v-if="permission.$!{table.entityPath}_delete"
|
v-if="permission.$!{cfg.entityKey}_delete"
|
||||||
@click="handleDelete">删 除
|
@click="handleDelete">删 除
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
@ -69,10 +71,10 @@
|
|||||||
...mapGetters(["permission"]),
|
...mapGetters(["permission"]),
|
||||||
permissionList() {
|
permissionList() {
|
||||||
return {
|
return {
|
||||||
addBtn: this.permission.$!{table.entityPath}_add,
|
addBtn: this.vaildData(this.permission.$!{cfg.entityKey}_add),
|
||||||
viewBtn: this.permission.$!{table.entityPath}_view,
|
viewBtn: this.vaildData(this.permission.$!{cfg.entityKey}_view),
|
||||||
delBtn: this.permission.$!{table.entityPath}_delete,
|
delBtn: this.vaildData(this.permission.$!{cfg.entityKey}_delete),
|
||||||
editBtn: this.permission.$!{table.entityPath}_edit
|
editBtn: this.vaildData(this.permission.$!{cfg.entityKey}_edit)
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
ids() {
|
ids() {
|
||||||
@ -84,7 +86,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
rowSave(row, loading) {
|
rowSave(row, loading, done) {
|
||||||
add(row).then(() => {
|
add(row).then(() => {
|
||||||
loading();
|
loading();
|
||||||
this.onLoad(this.page);
|
this.onLoad(this.page);
|
||||||
@ -92,9 +94,12 @@
|
|||||||
type: "success",
|
type: "success",
|
||||||
message: "操作成功!"
|
message: "操作成功!"
|
||||||
});
|
});
|
||||||
|
}, error => {
|
||||||
|
done();
|
||||||
|
console.log(error);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
rowUpdate(row, index, loading) {
|
rowUpdate(row, index, loading, done) {
|
||||||
update(row).then(() => {
|
update(row).then(() => {
|
||||||
loading();
|
loading();
|
||||||
this.onLoad(this.page);
|
this.onLoad(this.page);
|
||||||
@ -102,6 +107,9 @@
|
|||||||
type: "success",
|
type: "success",
|
||||||
message: "操作成功!"
|
message: "操作成功!"
|
||||||
});
|
});
|
||||||
|
}, error => {
|
||||||
|
done();
|
||||||
|
console.log(error);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
rowDel(row) {
|
rowDel(row) {
|
||||||
@ -152,7 +160,6 @@
|
|||||||
this.$refs.crud.toggleSelection();
|
this.$refs.crud.toggleSelection();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
beforeOpen(done, type) {
|
beforeOpen(done, type) {
|
||||||
if (["edit", "view"].includes(type)) {
|
if (["edit", "view"].includes(type)) {
|
||||||
getDetail(this.form.id).then(res => {
|
getDetail(this.form.id).then(res => {
|
||||||
@ -161,6 +168,12 @@
|
|||||||
}
|
}
|
||||||
done();
|
done();
|
||||||
},
|
},
|
||||||
|
currentChange(currentPage){
|
||||||
|
this.page.currentPage = currentPage;
|
||||||
|
},
|
||||||
|
sizeChange(pageSize){
|
||||||
|
this.page.pageSize = pageSize;
|
||||||
|
},
|
||||||
onLoad(page, params = {}) {
|
onLoad(page, params = {}) {
|
||||||
getList(page.currentPage, page.pageSize, params).then(res => {
|
getList(page.currentPage, page.pageSize, params).then(res => {
|
||||||
const data = res.data.data;
|
const data = res.data.data;
|
||||||
|
Loading…
Reference in New Issue
Block a user