优化代码

This commit is contained in:
RuoYi
2024-06-28 17:01:39 +08:00
parent 49d0fc0bdc
commit 6666ce5526
26 changed files with 253 additions and 8 deletions

View File

@@ -187,11 +187,13 @@ function getList() {
loading.value = false;
});
}
/** 取消按钮 */
function cancel() {
open.value = false;
reset();
}
/** 表单重置 */
function reset() {
form.value = {
@@ -204,28 +206,33 @@ function reset() {
};
proxy.resetForm("postRef");
}
/** 搜索按钮操作 */
function handleQuery() {
queryParams.value.pageNum = 1;
getList();
}
/** 重置按钮操作 */
function resetQuery() {
proxy.resetForm("queryRef");
handleQuery();
}
/** 多选框选中数据 */
function handleSelectionChange(selection) {
ids.value = selection.map(item => item.postId);
single.value = selection.length != 1;
multiple.value = !selection.length;
}
/** 新增按钮操作 */
function handleAdd() {
reset();
open.value = true;
title.value = "添加岗位";
}
/** 修改按钮操作 */
function handleUpdate(row) {
reset();
@@ -236,6 +243,7 @@ function handleUpdate(row) {
title.value = "修改岗位";
});
}
/** 提交按钮 */
function submitForm() {
proxy.$refs["postRef"].validate(valid => {
@@ -256,6 +264,7 @@ function submitForm() {
}
});
}
/** 删除按钮操作 */
function handleDelete(row) {
const postIds = row.postId || ids.value;
@@ -266,6 +275,7 @@ function handleDelete(row) {
proxy.$modal.msgSuccess("删除成功");
}).catch(() => {});
}
/** 导出按钮操作 */
function handleExport() {
proxy.download("system/post/export", {