兰宝车间质量管理系统-前端
LiuHao
2023-06-06 6af68085ff6615e1ec3a5dd18c761250800d6fca
src/views/system/notice/index.vue
@@ -121,9 +121,7 @@
<script setup name="Notice" lang="ts">
import { listNotice, getNotice, delNotice, addNotice, updateNotice } from "@/api/system/notice";
import { ComponentInternalInstance } from "vue";
import { NoticeForm, NoticeQuery, NoticeVO } from "@/api/system/notice/types";
import { ElForm } from 'element-plus';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { sys_notice_status, sys_notice_type } = toRefs<any>(proxy?.useDict("sys_notice_status", "sys_notice_type"));
@@ -136,8 +134,8 @@
const multiple = ref(true);
const total = ref(0);
const queryFormRef = ref(ElForm);
const noticeFormRef = ref(ElForm);
const queryFormRef = ref<ElFormInstance>();
const noticeFormRef = ref<ElFormInstance>();
const dialog = reactive<DialogOption>({
@@ -188,7 +186,7 @@
/** 表单重置 */
const reset = () => {
    form.value = { ...initFormData };
    noticeFormRef.value.resetFields();
    noticeFormRef.value?.resetFields();
}
/** 搜索按钮操作 */
const handleQuery = () => {
@@ -197,7 +195,7 @@
}
/** 重置按钮操作 */
const resetQuery = () => {
    queryFormRef.value.resetFields();
    queryFormRef.value?.resetFields();
    handleQuery();
}
/** 多选框选中数据 */
@@ -227,12 +225,12 @@
}
/** 提交按钮 */
const submitForm = () => {
    noticeFormRef.value.validate(async (valid: boolean) => {
    noticeFormRef.value?.validate(async (valid: boolean) => {
        if (valid) {
            form.value.noticeId ? await updateNotice(form.value) : await addNotice(form.value);
            proxy?.$modal.msgSuccess("修改成功");
            dialog.visible = false;
            getList();
            await getList();
        }
    });
}
@@ -241,7 +239,7 @@
    const noticeIds = row?.noticeId || ids.value
    await proxy?.$modal.confirm('是否确认删除公告编号为"' + noticeIds + '"的数据项?');
    await delNotice(noticeIds);
    getList();
    await getList();
    proxy?.$modal.msgSuccess("删除成功");
}