|
|
|
|
@ -237,9 +237,6 @@ |
|
|
|
|
return ids.join(","); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
mounted() { |
|
|
|
|
this.initData(); |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
initData() { |
|
|
|
|
getMenuTree().then(res => { |
|
|
|
|
@ -259,8 +256,6 @@ |
|
|
|
|
}, |
|
|
|
|
rowSave(row, loading, done) { |
|
|
|
|
add(row).then((res) => { |
|
|
|
|
// 下拉框数据重载 |
|
|
|
|
this.initData(); |
|
|
|
|
// 获取新增数据的相关字段 |
|
|
|
|
const data = res.data.data; |
|
|
|
|
row.id = data.id; |
|
|
|
|
@ -277,8 +272,6 @@ |
|
|
|
|
}, |
|
|
|
|
rowUpdate(row, index, loading, done) { |
|
|
|
|
update(row).then(() => { |
|
|
|
|
// 下拉框数据重载 |
|
|
|
|
this.initData(); |
|
|
|
|
// 数据回调进行刷新 |
|
|
|
|
loading(row); |
|
|
|
|
this.$message({ |
|
|
|
|
@ -300,8 +293,6 @@ |
|
|
|
|
return remove(row.id); |
|
|
|
|
}) |
|
|
|
|
.then(() => { |
|
|
|
|
// 下拉框数据重载 |
|
|
|
|
this.initData(); |
|
|
|
|
// 数据回调进行刷新 |
|
|
|
|
loading(row); |
|
|
|
|
this.$message({ |
|
|
|
|
@ -310,25 +301,6 @@ |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
searchReset() { |
|
|
|
|
this.query = {}; |
|
|
|
|
this.parentId = 0; |
|
|
|
|
this.onLoad(this.page); |
|
|
|
|
}, |
|
|
|
|
searchChange(params, done) { |
|
|
|
|
this.query = params; |
|
|
|
|
this.parentId = ''; |
|
|
|
|
this.page.currentPage = 1; |
|
|
|
|
this.onLoad(this.page, params); |
|
|
|
|
done(); |
|
|
|
|
}, |
|
|
|
|
selectionChange(list) { |
|
|
|
|
this.selectionList = list; |
|
|
|
|
}, |
|
|
|
|
selectionClear() { |
|
|
|
|
this.selectionList = []; |
|
|
|
|
this.$refs.crud.toggleSelection(); |
|
|
|
|
}, |
|
|
|
|
handleDelete() { |
|
|
|
|
if (this.selectionList.length === 0) { |
|
|
|
|
this.$message.warning("请选择至少一条数据"); |
|
|
|
|
@ -350,15 +322,35 @@ |
|
|
|
|
this.$refs.crud.toggleSelection(); |
|
|
|
|
// 表格数据重载 |
|
|
|
|
this.onLoad(this.page); |
|
|
|
|
// 下拉框数据重载 |
|
|
|
|
this.initData(); |
|
|
|
|
this.$message({ |
|
|
|
|
type: "success", |
|
|
|
|
message: "操作成功!" |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
searchReset() { |
|
|
|
|
this.query = {}; |
|
|
|
|
this.parentId = 0; |
|
|
|
|
this.onLoad(this.page); |
|
|
|
|
}, |
|
|
|
|
searchChange(params, done) { |
|
|
|
|
this.query = params; |
|
|
|
|
this.parentId = ''; |
|
|
|
|
this.page.currentPage = 1; |
|
|
|
|
this.onLoad(this.page, params); |
|
|
|
|
done(); |
|
|
|
|
}, |
|
|
|
|
selectionChange(list) { |
|
|
|
|
this.selectionList = list; |
|
|
|
|
}, |
|
|
|
|
selectionClear() { |
|
|
|
|
this.selectionList = []; |
|
|
|
|
this.$refs.crud.toggleSelection(); |
|
|
|
|
}, |
|
|
|
|
beforeOpen(done, type) { |
|
|
|
|
if (["add", "edit"].includes(type)) { |
|
|
|
|
this.initData(); |
|
|
|
|
} |
|
|
|
|
if (["edit", "view"].includes(type)) { |
|
|
|
|
getMenu(this.form.id).then(res => { |
|
|
|
|
this.form = res.data.data; |
|
|
|
|
|