作者 xiaoqiu

优化公共表单

... ... @@ -199,7 +199,7 @@
<el-radio
v-for="dict in sys_notice_status"
:key="dict.value"
:label="dict.value"
:value="dict.value"
>{{ dict.label }}</el-radio
>
</el-radio-group>
... ... @@ -236,7 +236,7 @@ const { sys_notice_status, sys_notice_type } = proxy.useDict(
"sys_notice_status",
"sys_notice_type"
);
const timer = ref(null);
const noticeList = ref([]);
const open = ref(false);
const loading = ref(true);
... ... @@ -277,44 +277,51 @@ function getList() {
loading.value = false;
});
}
/** 取消按钮 */
function cancel() {
open.value = false;
reset();
}
/** 表单重置 */
function reset() {
form.value = {
noticeId: undefined,
noticeTitle: undefined,
noticeType: undefined,
noticeContent: "",
noticeContent: undefined,
status: "0",
};
proxy.resetForm("noticeRef");
}
/** 搜索按钮操作 */
function handleQuery() {
queryParams.value.pageNum = 1;
getList();
}
/** 重置按钮操作 */
function resetQuery() {
proxy.resetForm("queryRef");
handleQuery();
}
/** 多选框选中数据 */
function handleSelectionChange(selection) {
ids.value = selection.map((item) => item.noticeId);
single.value = selection.length != 1;
multiple.value = !selection.length;
}
/** 新增按钮操作 */
function handleAdd() {
reset();
open.value = true;
title.value = "添加公告";
}
/**修改按钮操作 */
function handleUpdate(row) {
reset();
... ... @@ -325,6 +332,7 @@ function handleUpdate(row) {
title.value = "修改公告";
});
}
/** 提交按钮 */
function submitForm() {
proxy.$refs["noticeRef"].validate((valid) => {
... ... @@ -345,6 +353,7 @@ function submitForm() {
}
});
}
/** 删除按钮操作 */
function handleDelete(row) {
const noticeIds = row.noticeId || ids.value;
... ...