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/post/index.vue | 138 +++++++++++++++++++++++----------------------- 1 files changed, 69 insertions(+), 69 deletions(-) diff --git a/src/views/system/post/index.vue b/src/views/system/post/index.vue index 729bee7..2608669 100644 --- a/src/views/system/post/index.vue +++ b/src/views/system/post/index.vue @@ -93,20 +93,10 @@ <span>{{ parseTime(scope.row.createTime) }}</span> </template> </el-table-column> - <el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width"> + <el-table-column label="鎿嶄綔" width="180" align="center" class-name="small-padding fixed-width"> <template #default="scope"> - <el-button - type="text" - icon="Edit" - @click="handleUpdate(scope.row)" - v-hasPermi="['system:post:edit']" - >淇敼</el-button> - <el-button - type="text" - icon="Delete" - @click="handleDelete(scope.row)" - v-hasPermi="['system:post:remove']" - >鍒犻櫎</el-button> + <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:post:edit']">淇敼</el-button> + <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:post:remove']">鍒犻櫎</el-button> </template> </el-table-column> </el-table> @@ -136,7 +126,7 @@ <el-radio v-for="dict in sys_normal_disable" :key="dict.value" - :label="dict.value" + :value="dict.value" >{{ dict.label }}</el-radio> </el-radio-group> </el-form-item> @@ -155,20 +145,20 @@ </template> <script setup name="Post"> -import { listPost, addPost, delPost, getPost, updatePost } from "@/api/system/post"; +import { listPost, addPost, delPost, getPost, updatePost } from "@/api/system/post" -const { proxy } = getCurrentInstance(); -const { sys_normal_disable } = proxy.useDict("sys_normal_disable"); +const { proxy } = getCurrentInstance() +const { sys_normal_disable } = proxy.useDict("sys_normal_disable") -const postList = 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 postList = 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: {}, @@ -184,24 +174,26 @@ postCode: [{ required: true, message: "宀椾綅缂栫爜涓嶈兘涓虹┖", trigger: "blur" }], postSort: [{ required: true, message: "宀椾綅椤哄簭涓嶈兘涓虹┖", trigger: "blur" }], } -}); +}) -const { queryParams, form, rules } = toRefs(data); +const { queryParams, form, rules } = toRefs(data) /** 鏌ヨ宀椾綅鍒楄〃 */ function getList() { - loading.value = true; + loading.value = true listPost(queryParams.value).then(response => { - postList.value = response.rows; - total.value = response.total; - loading.value = false; - }); + postList.value = response.rows + total.value = response.total + loading.value = false + }) } + /** 鍙栨秷鎸夐挳 */ function cancel() { - open.value = false; - reset(); + open.value = false + reset() } + /** 琛ㄥ崟閲嶇疆 */ function reset() { form.value = { @@ -211,77 +203,85 @@ postSort: 0, status: "0", remark: undefined - }; - proxy.resetForm("postRef"); + } + proxy.resetForm("postRef") } + /** 鎼滅储鎸夐挳鎿嶄綔 */ 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.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 } + /** 鏂板鎸夐挳鎿嶄綔 */ function handleAdd() { - reset(); - open.value = true; - title.value = "娣诲姞宀椾綅"; + reset() + open.value = true + title.value = "娣诲姞宀椾綅" } + /** 淇敼鎸夐挳鎿嶄綔 */ function handleUpdate(row) { - reset(); - const postId = row.postId || ids.value; + reset() + const postId = row.postId || ids.value getPost(postId).then(response => { - form.value = response.data; - open.value = true; - title.value = "淇敼宀椾綅"; - }); + form.value = response.data + open.value = true + title.value = "淇敼宀椾綅" + }) } + /** 鎻愪氦鎸夐挳 */ function submitForm() { proxy.$refs["postRef"].validate(valid => { if (valid) { if (form.value.postId != undefined) { updatePost(form.value).then(response => { - proxy.$modal.msgSuccess("淇敼鎴愬姛"); - open.value = false; - getList(); - }); + proxy.$modal.msgSuccess("淇敼鎴愬姛") + open.value = false + getList() + }) } else { addPost(form.value).then(response => { - proxy.$modal.msgSuccess("鏂板鎴愬姛"); - open.value = false; - getList(); - }); + proxy.$modal.msgSuccess("鏂板鎴愬姛") + open.value = false + getList() + }) } } - }); + }) } + /** 鍒犻櫎鎸夐挳鎿嶄綔 */ function handleDelete(row) { - const postIds = row.postId || ids.value; + const postIds = row.postId || ids.value proxy.$modal.confirm('鏄惁纭鍒犻櫎宀椾綅缂栧彿涓�"' + postIds + '"鐨勬暟鎹」锛�').then(function() { - return delPost(postIds); + return delPost(postIds) }).then(() => { - getList(); - proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛"); - }).catch(() => {}); + getList() + proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛") + }).catch(() => {}) } + /** 瀵煎嚭鎸夐挳鎿嶄綔 */ function handleExport() { proxy.download("system/post/export", { ...queryParams.value - }, `post_${new Date().getTime()}.xlsx`); + }, `post_${new Date().getTime()}.xlsx`) } -getList(); +getList() </script> -- Gitblit v1.9.3