Prechádzať zdrojové kódy

fix(user-manage): 状态筛选默认全部、移除角色长度校验、统一全角问号、清理未用导入

yangyi 2 týždňov pred
rodič
commit
7bd519a503
1 zmenil súbory, kde vykonal 5 pridanie a 6 odobranie
  1. 5 6
      src/view/admin/UserManageView.vue

+ 5 - 6
src/view/admin/UserManageView.vue

@@ -1,7 +1,7 @@
 <script setup lang="ts">
 import { getUserController } from '@/api/user-controller'
 import type { QueryByPageParams, UpdateUserStatusDto, UserDto, UserVo } from '@/api/models'
-import { ElMessage, ElMessageBox, type FormInstance, type FormRules, ElIcon } from 'element-plus'
+import { ElMessage, ElMessageBox, type FormInstance, type FormRules } from 'element-plus'
 import { Plus, RefreshRight, Search, Delete, Edit } from '@element-plus/icons-vue'
 import { ref, reactive, computed } from 'vue'
 
@@ -13,7 +13,7 @@ const searchForm = reactive({
   username: '',
   account: '',
   role: '',
-  enable: 1
+  enable: undefined as number | undefined
 })
 
 // 用户表单(新增/编辑)
@@ -41,8 +41,7 @@ const formRules: FormRules = {
     { min: 4, max: 20, message: '密码长度需在 4 到 20 个字符之间', trigger: 'blur' }
   ],
   role: [
-    { required: true, message: '请选择角色', trigger: 'change' },
-    { min: 4, max: 32, message: '角色长度需在 4 到 32 个字符之间', trigger: 'change' }
+    { required: true, message: '请选择角色', trigger: 'change' }
   ]
 }
 
@@ -194,7 +193,7 @@ const handleDialogClosed = () => {
 
 // 删除
 const handleDelete = (row: UserVo) => {
-  ElMessageBox.confirm('确认删除该用户吗?', '提示', {
+  ElMessageBox.confirm('确认删除该用户吗?', '提示', {
     type: 'warning'
   }).then(async () => {
     try {
@@ -215,7 +214,7 @@ const handleBatchDelete = () => {
     ElMessage.warning('请选择要删除的数据')
     return
   }
-  ElMessageBox.confirm(`确认删除选中的 ${selectedRows.value.length} 条数据吗?`, '提示', {
+  ElMessageBox.confirm(`确认删除选中的 ${selectedRows.value.length} 条数据吗?`, '提示', {
     type: 'warning'
   }).then(async () => {
     try {