From 2f8a257efd2b64dc40666b0d332edb7824a9768d Mon Sep 17 00:00:00 2001 From: RuoYi <yzz_ivy@163.com> Date: 星期日, 27 四月 2025 09:58:29 +0800 Subject: [PATCH] remove all semicolons --- src/views/system/notice/index.vue | 117 +++++++++++++++++++++++++++++++--------------------------- 1 files changed, 63 insertions(+), 54 deletions(-) diff --git a/src/views/system/notice/index.vue b/src/views/system/notice/index.vue index 55fbc3a..96dadcc 100644 --- a/src/views/system/notice/index.vue +++ b/src/views/system/notice/index.vue @@ -136,7 +136,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> </el-form-item> @@ -159,20 +159,20 @@ </template> <script setup name="Notice"> -import { listNotice, getNotice, delNotice, addNotice, updateNotice } from "@/api/system/notice"; +import { listNotice, getNotice, delNotice, addNotice, updateNotice } from "@/api/system/notice" -const { proxy } = getCurrentInstance(); -const { sys_notice_status, sys_notice_type } = proxy.useDict("sys_notice_status", "sys_notice_type"); +const { proxy } = getCurrentInstance() +const { sys_notice_status, sys_notice_type } = proxy.useDict("sys_notice_status", "sys_notice_type") -const noticeList = ref([]); -const open = ref(false); -const loading = ref(true); -const showSearch = ref(true); -const ids = ref([]); -const single = ref(true); -const multiple = ref(true); -const total = ref(0); -const title = ref(""); +const noticeList = ref([]) +const open = ref(false) +const loading = ref(true) +const showSearch = ref(true) +const ids = ref([]) +const single = ref(true) +const multiple = ref(true) +const total = ref(0) +const title = ref("") const data = reactive({ form: {}, @@ -187,24 +187,26 @@ noticeTitle: [{ required: true, message: "鍏憡鏍囬涓嶈兘涓虹┖", trigger: "blur" }], noticeType: [{ required: true, message: "鍏憡绫诲瀷涓嶈兘涓虹┖", trigger: "change" }] }, -}); +}) -const { queryParams, form, rules } = toRefs(data); +const { queryParams, form, rules } = toRefs(data) /** 鏌ヨ鍏憡鍒楄〃 */ function getList() { - loading.value = true; + loading.value = true listNotice(queryParams.value).then(response => { - noticeList.value = response.rows; - total.value = response.total; - loading.value = false; - }); + noticeList.value = response.rows + total.value = response.total + loading.value = false + }) } + /** 鍙栨秷鎸夐挳 */ function cancel() { - open.value = false; - reset(); + open.value = false + reset() } + /** 琛ㄥ崟閲嶇疆 */ function reset() { form.value = { @@ -213,71 +215,78 @@ noticeType: undefined, noticeContent: undefined, status: "0" - }; - proxy.resetForm("noticeRef"); + } + proxy.resetForm("noticeRef") } + /** 鎼滅储鎸夐挳鎿嶄綔 */ function handleQuery() { - queryParams.value.pageNum = 1; - getList(); + queryParams.value.pageNum = 1 + getList() } + /** 閲嶇疆鎸夐挳鎿嶄綔 */ function resetQuery() { - proxy.resetForm("queryRef"); - handleQuery(); + proxy.resetForm("queryRef") + handleQuery() } + /** 澶氶�夋閫変腑鏁版嵁 */ function handleSelectionChange(selection) { - ids.value = selection.map(item => item.noticeId); - single.value = selection.length != 1; - multiple.value = !selection.length; + ids.value = selection.map(item => item.noticeId) + single.value = selection.length != 1 + multiple.value = !selection.length } + /** 鏂板鎸夐挳鎿嶄綔 */ function handleAdd() { - reset(); - open.value = true; - title.value = "娣诲姞鍏憡"; + reset() + open.value = true + title.value = "娣诲姞鍏憡" } + /**淇敼鎸夐挳鎿嶄綔 */ function handleUpdate(row) { - reset(); - const noticeId = row.noticeId || ids.value; + reset() + const noticeId = row.noticeId || ids.value getNotice(noticeId).then(response => { - form.value = response.data; - open.value = true; - title.value = "淇敼鍏憡"; - }); + form.value = response.data + open.value = true + title.value = "淇敼鍏憡" + }) } + /** 鎻愪氦鎸夐挳 */ function submitForm() { proxy.$refs["noticeRef"].validate(valid => { if (valid) { if (form.value.noticeId != undefined) { updateNotice(form.value).then(response => { - proxy.$modal.msgSuccess("淇敼鎴愬姛"); - open.value = false; - getList(); - }); + proxy.$modal.msgSuccess("淇敼鎴愬姛") + open.value = false + getList() + }) } else { addNotice(form.value).then(response => { - proxy.$modal.msgSuccess("鏂板鎴愬姛"); - open.value = false; - getList(); - }); + proxy.$modal.msgSuccess("鏂板鎴愬姛") + open.value = false + getList() + }) } } - }); + }) } + /** 鍒犻櫎鎸夐挳鎿嶄綔 */ function handleDelete(row) { const noticeIds = row.noticeId || ids.value proxy.$modal.confirm('鏄惁纭鍒犻櫎鍏憡缂栧彿涓�"' + noticeIds + '"鐨勬暟鎹」锛�').then(function() { - return delNotice(noticeIds); + return delNotice(noticeIds) }).then(() => { - getList(); - proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛"); - }).catch(() => {}); + getList() + proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛") + }).catch(() => {}) } -getList(); +getList() </script> -- Gitblit v1.9.3