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 | 58 +++++++++++++++++++++++++++++----------------------------- 1 files changed, 29 insertions(+), 29 deletions(-) diff --git a/src/views/system/notice/index.vue b/src/views/system/notice/index.vue index b041bb2..8b92af7 100644 --- a/src/views/system/notice/index.vue +++ b/src/views/system/notice/index.vue @@ -1,28 +1,30 @@ <template> <div class="p-2"> <transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave"> - <div class="search" v-show="showSearch"> - <el-form :model="queryParams" ref="queryFormRef" :inline="true" label-width="68px"> - <el-form-item label="鍏憡鏍囬" prop="noticeTitle"> - <el-input v-model="queryParams.noticeTitle" placeholder="璇疯緭鍏ュ叕鍛婃爣棰�" clearable style="width: 200px" @keyup.enter="handleQuery" /> - </el-form-item> - <el-form-item label="鎿嶄綔浜哄憳" prop="createByName"> - <el-input v-model="queryParams.createByName" placeholder="璇疯緭鍏ユ搷浣滀汉鍛�" clearable style="width: 200px" @keyup.enter="handleQuery" /> - </el-form-item> - <el-form-item label="绫诲瀷" prop="noticeType"> - <el-select v-model="queryParams.noticeType" placeholder="鍏憡绫诲瀷" clearable style="width: 200px"> - <el-option v-for="dict in sys_notice_type" :key="dict.value" :label="dict.label" :value="dict.value" /> - </el-select> - </el-form-item> - <el-form-item> - <el-button type="primary" icon="Search" @click="handleQuery">鎼滅储</el-button> - <el-button icon="Refresh" @click="resetQuery">閲嶇疆</el-button> - </el-form-item> - </el-form> + <div class="mb-[10px]" v-show="showSearch"> + <el-card shadow="hover"> + <el-form :model="queryParams" ref="queryFormRef" :inline="true" label-width="68px"> + <el-form-item label="鍏憡鏍囬" prop="noticeTitle"> + <el-input v-model="queryParams.noticeTitle" placeholder="璇疯緭鍏ュ叕鍛婃爣棰�" clearable style="width: 200px" @keyup.enter="handleQuery" /> + </el-form-item> + <el-form-item label="鎿嶄綔浜哄憳" prop="createByName"> + <el-input v-model="queryParams.createByName" placeholder="璇疯緭鍏ユ搷浣滀汉鍛�" clearable style="width: 200px" @keyup.enter="handleQuery" /> + </el-form-item> + <el-form-item label="绫诲瀷" prop="noticeType"> + <el-select v-model="queryParams.noticeType" placeholder="鍏憡绫诲瀷" clearable style="width: 200px"> + <el-option v-for="dict in sys_notice_type" :key="dict.value" :label="dict.label" :value="dict.value" /> + </el-select> + </el-form-item> + <el-form-item> + <el-button type="primary" icon="Search" @click="handleQuery">鎼滅储</el-button> + <el-button icon="Refresh" @click="resetQuery">閲嶇疆</el-button> + </el-form-item> + </el-form> + </el-card> </div> </transition> - <el-card shadow="never"> + <el-card shadow="hover"> <template #header> <el-row :gutter="10" class="mb8"> <el-col :span="1.5"> @@ -119,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")); @@ -134,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>({ @@ -186,7 +186,7 @@ /** 琛ㄥ崟閲嶇疆 */ const reset = () => { form.value = { ...initFormData }; - noticeFormRef.value.resetFields(); + noticeFormRef.value?.resetFields(); } /** 鎼滅储鎸夐挳鎿嶄綔 */ const handleQuery = () => { @@ -195,7 +195,7 @@ } /** 閲嶇疆鎸夐挳鎿嶄綔 */ const resetQuery = () => { - queryFormRef.value.resetFields(); + queryFormRef.value?.resetFields(); handleQuery(); } /** 澶氶�夋閫変腑鏁版嵁 */ @@ -225,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(); } }); } @@ -239,11 +239,11 @@ const noticeIds = row?.noticeId || ids.value await proxy?.$modal.confirm('鏄惁纭鍒犻櫎鍏憡缂栧彿涓�"' + noticeIds + '"鐨勬暟鎹」锛�'); await delNotice(noticeIds); - getList(); + await getList(); proxy?.$modal.msgSuccess("鍒犻櫎鎴愬姛"); } onMounted(() => { getList(); }) -</script> \ No newline at end of file +</script> -- Gitblit v1.9.3