From 6af68085ff6615e1ec3a5dd18c761250800d6fca Mon Sep 17 00:00:00 2001 From: LiuHao <liuhaoai545@gmail.com> Date: 星期二, 06 六月 2023 22:23:43 +0800 Subject: [PATCH] update 修改页面代码 去除ele的引入以及vue的类型声明 --- src/views/system/notice/index.vue | 16 +++++++--------- 1 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/views/system/notice/index.vue b/src/views/system/notice/index.vue index d075f5d..8b92af7 100644 --- a/src/views/system/notice/index.vue +++ b/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("鍒犻櫎鎴愬姛"); } -- Gitblit v1.9.3