From dbfe263681d211e06e13d55774424521b9fb0dc4 Mon Sep 17 00:00:00 2001 From: LiuHao <liuhaoai545@gmail.com> Date: 星期二, 06 六月 2023 22:27:31 +0800 Subject: [PATCH] update 修改代码缩进格式 --- src/views/system/post/index.vue | 134 ++++++++++++++++++++++---------------------- 1 files changed, 67 insertions(+), 67 deletions(-) diff --git a/src/views/system/post/index.vue b/src/views/system/post/index.vue index 6b1e8fd..d53eb1c 100644 --- a/src/views/system/post/index.vue +++ b/src/views/system/post/index.vue @@ -125,117 +125,117 @@ const queryFormRef = ref<ElFormInstance>(); const dialog = reactive<DialogOption>({ - visible: false, - title: '' + visible: false, + title: '' }); const initFormData: PostForm = { - postId: undefined, - postCode: '', - postName: '', - postSort: 0, - status: "0", - remark: '' + postId: undefined, + postCode: '', + postName: '', + postSort: 0, + status: "0", + remark: '' } const data = reactive<PageData<PostForm, PostQuery>>({ - form: {...initFormData}, - queryParams: { - pageNum: 1, - pageSize: 10, - postCode: '', - postName: '', - status: '' - }, - rules: { - postName: [{ required: true, message: "宀椾綅鍚嶇О涓嶈兘涓虹┖", trigger: "blur" }], - postCode: [{ required: true, message: "宀椾綅缂栫爜涓嶈兘涓虹┖", trigger: "blur" }], - postSort: [{ required: true, message: "宀椾綅椤哄簭涓嶈兘涓虹┖", trigger: "blur" }], - } + form: { ...initFormData }, + queryParams: { + pageNum: 1, + pageSize: 10, + postCode: '', + postName: '', + status: '' + }, + rules: { + postName: [{ required: true, message: "宀椾綅鍚嶇О涓嶈兘涓虹┖", trigger: "blur" }], + postCode: [{ required: true, message: "宀椾綅缂栫爜涓嶈兘涓虹┖", trigger: "blur" }], + postSort: [{ required: true, message: "宀椾綅椤哄簭涓嶈兘涓虹┖", trigger: "blur" }], + } }); const { queryParams, form, rules } = toRefs<PageData<PostForm, PostQuery>>(data); /** 鏌ヨ宀椾綅鍒楄〃 */ const getList = async () => { - loading.value = true; - const res = await listPost(queryParams.value); - postList.value = res.rows; - total.value = res.total; - loading.value = false; + loading.value = true; + const res = await listPost(queryParams.value); + postList.value = res.rows; + total.value = res.total; + loading.value = false; } /** 鍙栨秷鎸夐挳 */ const cancel = () => { - reset(); - dialog.visible = false; + reset(); + dialog.visible = false; } /** 琛ㄥ崟閲嶇疆 */ const reset = () => { - form.value = {...initFormData}; - postFormRef.value?.resetFields(); + form.value = { ...initFormData }; + postFormRef.value?.resetFields(); } /** 鎼滅储鎸夐挳鎿嶄綔 */ const handleQuery = () => { - queryParams.value.pageNum = 1; - getList(); + queryParams.value.pageNum = 1; + getList(); } /** 閲嶇疆鎸夐挳鎿嶄綔 */ const resetQuery = () => { - queryFormRef.value?.resetFields(); - handleQuery(); + queryFormRef.value?.resetFields(); + handleQuery(); } /** 澶氶�夋閫変腑鏁版嵁 */ const handleSelectionChange = (selection: PostVO[]) => { - ids.value = selection.map(item => item.postId); - single.value = selection.length != 1; - multiple.value = !selection.length; + ids.value = selection.map(item => item.postId); + single.value = selection.length != 1; + multiple.value = !selection.length; } /** 鏂板鎸夐挳鎿嶄綔 */ const handleAdd = () => { - dialog.visible = true; - dialog.title = "娣诲姞宀椾綅"; - nextTick(() => { - reset(); - }) + dialog.visible = true; + dialog.title = "娣诲姞宀椾綅"; + nextTick(() => { + reset(); + }) } /** 淇敼鎸夐挳鎿嶄綔 */ const handleUpdate = (row?: PostVO) => { - dialog.visible = true; - dialog.title = "淇敼宀椾綅"; - nextTick(async () => { - reset(); - const postId = row?.postId || ids.value[0]; - const res = await getPost(postId); - form.value = res.data; - }) + dialog.visible = true; + dialog.title = "淇敼宀椾綅"; + nextTick(async () => { + reset(); + const postId = row?.postId || ids.value[0]; + const res = await getPost(postId); + form.value = res.data; + }) } /** 鎻愪氦鎸夐挳 */ const submitForm = () => { - postFormRef.value?.validate(async (valid: boolean) => { - if (valid) { - form.value.postId ? await updatePost(form.value) : await addPost(form.value); - proxy?.$modal.msgSuccess("鎿嶄綔鎴愬姛"); - dialog.visible = false; - await getList(); - } - }); + postFormRef.value?.validate(async (valid: boolean) => { + if (valid) { + form.value.postId ? await updatePost(form.value) : await addPost(form.value); + proxy?.$modal.msgSuccess("鎿嶄綔鎴愬姛"); + dialog.visible = false; + await getList(); + } + }); } /** 鍒犻櫎鎸夐挳鎿嶄綔 */ const handleDelete = async (row?: PostVO) => { - const postIds = row?.postId || ids.value; - await proxy?.$modal.confirm('鏄惁纭鍒犻櫎宀椾綅缂栧彿涓�"' + postIds + '"鐨勬暟鎹」锛�'); - await delPost(postIds); - await getList(); - proxy?.$modal.msgSuccess("鍒犻櫎鎴愬姛"); + const postIds = row?.postId || ids.value; + await proxy?.$modal.confirm('鏄惁纭鍒犻櫎宀椾綅缂栧彿涓�"' + postIds + '"鐨勬暟鎹」锛�'); + await delPost(postIds); + await getList(); + proxy?.$modal.msgSuccess("鍒犻櫎鎴愬姛"); } /** 瀵煎嚭鎸夐挳鎿嶄綔 */ const handleExport = () => { - proxy?.download("system/post/export", { - ...queryParams.value - }, `post_${new Date().getTime()}.xlsx`); + proxy?.download("system/post/export", { + ...queryParams.value + }, `post_${new Date().getTime()}.xlsx`); } onMounted(() => { - getList(); + getList(); }); </script> -- Gitblit v1.9.3