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/user/index.vue | 282 ++++++++++++++++++++++++++++---------------------------- 1 files changed, 141 insertions(+), 141 deletions(-) diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index 4144812..86de9e1 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -214,33 +214,33 @@ </template> <script setup name="User"> -import { getToken } from "@/utils/auth"; +import { getToken } from "@/utils/auth" import useAppStore from '@/store/modules/app' -import { changeUserStatus, listUser, resetUserPwd, delUser, getUser, updateUser, addUser, deptTreeSelect } from "@/api/system/user"; +import { changeUserStatus, listUser, resetUserPwd, delUser, getUser, updateUser, addUser, deptTreeSelect } from "@/api/system/user" import { Splitpanes, Pane } from "splitpanes" import "splitpanes/dist/splitpanes.css" -const router = useRouter(); +const router = useRouter() const appStore = useAppStore() -const { proxy } = getCurrentInstance(); -const { sys_normal_disable, sys_user_sex } = proxy.useDict("sys_normal_disable", "sys_user_sex"); +const { proxy } = getCurrentInstance() +const { sys_normal_disable, sys_user_sex } = proxy.useDict("sys_normal_disable", "sys_user_sex") -const userList = 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 dateRange = ref([]); -const deptName = ref(""); -const deptOptions = ref(undefined); -const enabledDeptOptions = ref(undefined); -const initPassword = ref(undefined); -const postOptions = ref([]); -const roleOptions = ref([]); +const userList = 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 dateRange = ref([]) +const deptName = ref("") +const deptOptions = ref(undefined) +const enabledDeptOptions = ref(undefined) +const initPassword = ref(undefined) +const postOptions = ref([]) +const roleOptions = ref([]) /*** 鐢ㄦ埛瀵煎叆鍙傛暟 */ const upload = reactive({ // 鏄惁鏄剧ず寮瑰嚭灞傦紙鐢ㄦ埛瀵煎叆锛� @@ -255,7 +255,7 @@ headers: { Authorization: "Bearer " + getToken() }, // 涓婁紶鐨勫湴鍧� url: import.meta.env.VITE_APP_BASE_API + "/system/user/importData" -}); +}) // 鍒楁樉闅愪俊鎭� const columns = ref([ { key: 0, label: `鐢ㄦ埛缂栧彿`, visible: true }, @@ -265,7 +265,7 @@ { key: 4, label: `鎵嬫満鍙风爜`, visible: true }, { key: 5, label: `鐘舵�乣, visible: true }, { key: 6, label: `鍒涘缓鏃堕棿`, visible: true } -]); +]) const data = reactive({ form: {}, @@ -284,122 +284,122 @@ email: [{ type: "email", message: "璇疯緭鍏ユ纭殑閭鍦板潃", trigger: ["blur", "change"] }], phonenumber: [{ pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, message: "璇疯緭鍏ユ纭殑鎵嬫満鍙风爜", trigger: "blur" }] } -}); +}) -const { queryParams, form, rules } = toRefs(data); +const { queryParams, form, rules } = toRefs(data) /** 閫氳繃鏉′欢杩囨护鑺傜偣 */ const filterNode = (value, data) => { - if (!value) return true; - return data.label.indexOf(value) !== -1; -}; + if (!value) return true + return data.label.indexOf(value) !== -1 +} /** 鏍规嵁鍚嶇О绛涢�夐儴闂ㄦ爲 */ watch(deptName, val => { - proxy.$refs["deptTreeRef"].filter(val); -}); + proxy.$refs["deptTreeRef"].filter(val) +}) /** 鏌ヨ鐢ㄦ埛鍒楄〃 */ function getList() { - loading.value = true; + loading.value = true listUser(proxy.addDateRange(queryParams.value, dateRange.value)).then(res => { - loading.value = false; - userList.value = res.rows; - total.value = res.total; - }); -}; + loading.value = false + userList.value = res.rows + total.value = res.total + }) +} /** 鏌ヨ閮ㄩ棬涓嬫媺鏍戠粨鏋� */ function getDeptTree() { deptTreeSelect().then(response => { - deptOptions.value = response.data; - enabledDeptOptions.value = filterDisabledDept(JSON.parse(JSON.stringify(response.data))); - }); -}; + deptOptions.value = response.data + enabledDeptOptions.value = filterDisabledDept(JSON.parse(JSON.stringify(response.data))) + }) +} /** 杩囨护绂佺敤鐨勯儴闂� */ function filterDisabledDept(deptList) { return deptList.filter(dept => { if (dept.disabled) { - return false; + return false } if (dept.children && dept.children.length) { - dept.children = filterDisabledDept(dept.children); + dept.children = filterDisabledDept(dept.children) } - return true; - }); -}; + return true + }) +} /** 鑺傜偣鍗曞嚮浜嬩欢 */ function handleNodeClick(data) { - queryParams.value.deptId = data.id; - handleQuery(); -}; + queryParams.value.deptId = data.id + handleQuery() +} /** 鎼滅储鎸夐挳鎿嶄綔 */ function handleQuery() { - queryParams.value.pageNum = 1; - getList(); -}; + queryParams.value.pageNum = 1 + getList() +} /** 閲嶇疆鎸夐挳鎿嶄綔 */ function resetQuery() { - dateRange.value = []; - proxy.resetForm("queryRef"); - queryParams.value.deptId = undefined; - proxy.$refs.deptTreeRef.setCurrentKey(null); - handleQuery(); -}; + dateRange.value = [] + proxy.resetForm("queryRef") + queryParams.value.deptId = undefined + proxy.$refs.deptTreeRef.setCurrentKey(null) + handleQuery() +} /** 鍒犻櫎鎸夐挳鎿嶄綔 */ function handleDelete(row) { - const userIds = row.userId || ids.value; + const userIds = row.userId || ids.value proxy.$modal.confirm('鏄惁纭鍒犻櫎鐢ㄦ埛缂栧彿涓�"' + userIds + '"鐨勬暟鎹」锛�').then(function () { - return delUser(userIds); + return delUser(userIds) }).then(() => { - getList(); - proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛"); - }).catch(() => {}); -}; + getList() + proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛") + }).catch(() => {}) +} /** 瀵煎嚭鎸夐挳鎿嶄綔 */ function handleExport() { proxy.download("system/user/export", { ...queryParams.value, - },`user_${new Date().getTime()}.xlsx`); -}; + },`user_${new Date().getTime()}.xlsx`) +} /** 鐢ㄦ埛鐘舵�佷慨鏀� */ function handleStatusChange(row) { - let text = row.status === "0" ? "鍚敤" : "鍋滅敤"; + let text = row.status === "0" ? "鍚敤" : "鍋滅敤" proxy.$modal.confirm('纭瑕�"' + text + '""' + row.userName + '"鐢ㄦ埛鍚�?').then(function () { - return changeUserStatus(row.userId, row.status); + return changeUserStatus(row.userId, row.status) }).then(() => { - proxy.$modal.msgSuccess(text + "鎴愬姛"); + proxy.$modal.msgSuccess(text + "鎴愬姛") }).catch(function () { - row.status = row.status === "0" ? "1" : "0"; - }); -}; + row.status = row.status === "0" ? "1" : "0" + }) +} /** 鏇村鎿嶄綔 */ function handleCommand(command, row) { switch (command) { case "handleResetPwd": - handleResetPwd(row); - break; + handleResetPwd(row) + break case "handleAuthRole": - handleAuthRole(row); - break; + handleAuthRole(row) + break default: - break; + break } -}; +} /** 璺宠浆瑙掕壊鍒嗛厤 */ function handleAuthRole(row) { - const userId = row.userId; - router.push("/system/user-auth/role/" + userId); -}; + const userId = row.userId + router.push("/system/user-auth/role/" + userId) +} /** 閲嶇疆瀵嗙爜鎸夐挳鎿嶄綔 */ function handleResetPwd(row) { @@ -416,48 +416,48 @@ }, }).then(({ value }) => { resetUserPwd(row.userId, value).then(response => { - proxy.$modal.msgSuccess("淇敼鎴愬姛锛屾柊瀵嗙爜鏄細" + value); - }); - }).catch(() => {}); -}; + proxy.$modal.msgSuccess("淇敼鎴愬姛锛屾柊瀵嗙爜鏄細" + value) + }) + }).catch(() => {}) +} /** 閫夋嫨鏉℃暟 */ function handleSelectionChange(selection) { - ids.value = selection.map(item => item.userId); - single.value = selection.length != 1; - multiple.value = !selection.length; -}; + ids.value = selection.map(item => item.userId) + single.value = selection.length != 1 + multiple.value = !selection.length +} /** 瀵煎叆鎸夐挳鎿嶄綔 */ function handleImport() { - upload.title = "鐢ㄦ埛瀵煎叆"; - upload.open = true; -}; + upload.title = "鐢ㄦ埛瀵煎叆" + upload.open = true +} /** 涓嬭浇妯℃澘鎿嶄綔 */ function importTemplate() { proxy.download("system/user/importTemplate", { - }, `user_template_${new Date().getTime()}.xlsx`); -}; + }, `user_template_${new Date().getTime()}.xlsx`) +} /**鏂囦欢涓婁紶涓鐞� */ const handleFileUploadProgress = (event, file, fileList) => { - upload.isUploading = true; -}; + upload.isUploading = true +} /** 鏂囦欢涓婁紶鎴愬姛澶勭悊 */ const handleFileSuccess = (response, file, fileList) => { - upload.open = false; - upload.isUploading = false; - proxy.$refs["uploadRef"].handleRemove(file); - proxy.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "瀵煎叆缁撴灉", { dangerouslyUseHTMLString: true }); - getList(); -}; + upload.open = false + upload.isUploading = false + proxy.$refs["uploadRef"].handleRemove(file) + proxy.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "瀵煎叆缁撴灉", { dangerouslyUseHTMLString: true }) + getList() +} /** 鎻愪氦涓婁紶鏂囦欢 */ function submitFileForm() { - proxy.$refs["uploadRef"].submit(); -}; + proxy.$refs["uploadRef"].submit() +} /** 閲嶇疆鎿嶄綔琛ㄥ崟 */ function reset() { @@ -474,43 +474,43 @@ remark: undefined, postIds: [], roleIds: [] - }; - proxy.resetForm("userRef"); -}; + } + proxy.resetForm("userRef") +} /** 鍙栨秷鎸夐挳 */ function cancel() { - open.value = false; - reset(); -}; + open.value = false + reset() +} /** 鏂板鎸夐挳鎿嶄綔 */ function handleAdd() { - reset(); + reset() getUser().then(response => { - postOptions.value = response.posts; - roleOptions.value = response.roles; - open.value = true; - title.value = "娣诲姞鐢ㄦ埛"; - form.value.password = initPassword.value; - }); -}; + postOptions.value = response.posts + roleOptions.value = response.roles + open.value = true + title.value = "娣诲姞鐢ㄦ埛" + form.value.password = initPassword.value + }) +} /** 淇敼鎸夐挳鎿嶄綔 */ function handleUpdate(row) { - reset(); - const userId = row.userId || ids.value; + reset() + const userId = row.userId || ids.value getUser(userId).then(response => { - form.value = response.data; - postOptions.value = response.posts; - roleOptions.value = response.roles; - form.value.postIds = response.postIds; - form.value.roleIds = response.roleIds; - open.value = true; - title.value = "淇敼鐢ㄦ埛"; - form.password = ""; - }); -}; + form.value = response.data + postOptions.value = response.posts + roleOptions.value = response.roles + form.value.postIds = response.postIds + form.value.roleIds = response.roleIds + open.value = true + title.value = "淇敼鐢ㄦ埛" + form.password = "" + }) +} /** 鎻愪氦鎸夐挳 */ function submitForm() { @@ -518,21 +518,21 @@ if (valid) { if (form.value.userId != undefined) { updateUser(form.value).then(response => { - proxy.$modal.msgSuccess("淇敼鎴愬姛"); - open.value = false; - getList(); - }); + proxy.$modal.msgSuccess("淇敼鎴愬姛") + open.value = false + getList() + }) } else { addUser(form.value).then(response => { - proxy.$modal.msgSuccess("鏂板鎴愬姛"); - open.value = false; - getList(); - }); + proxy.$modal.msgSuccess("鏂板鎴愬姛") + open.value = false + getList() + }) } } - }); -}; + }) +} -getDeptTree(); -getList(); +getDeptTree() +getList() </script> -- Gitblit v1.9.3