Commit ae8795df8e77f3e9c0836d70b22ac55fd1b20cf0
1 parent
7e5c44b0
vue3:review 租户列表、租户套餐、用户管理
Showing
6 changed files
with
22 additions
and
10 deletions
yudao-ui-admin-vue3/src/views/system/dept/dept.data.ts
| ... | ... | @@ -13,7 +13,7 @@ export const rules = reactive({ |
| 13 | 13 | phone: [ |
| 14 | 14 | { |
| 15 | 15 | pattern: |
| 16 | - /^(?:(?:\+|00)86)?1(?:(?:3[\d])|(?:4[5-79])|(?:5[0-35-9])|(?:6[5-7])|(?:7[0-8])|(?:8[\d])|(?:9[189]))\d{8}$/, | |
| 16 | + /^(?:(?:\+|00)86)?1(?:(?:3[\d])|(?:4[5-79])|(?:5[0-35-9])|(?:6[5-7])|(?:7[0-8])|(?:8[\d])|(?:9[189]))\d{8}$/, // TODO @星语:前端只校验长度,格式交给后端;因为号码格式不断在变的 | |
| 17 | 17 | trigger: 'blur', |
| 18 | 18 | message: '请输入正确的手机号码' |
| 19 | 19 | } | ... | ... |
yudao-ui-admin-vue3/src/views/system/dept/index.vue
| ... | ... | @@ -204,7 +204,7 @@ const handleDelete = async (rowId: number) => { |
| 204 | 204 | } |
| 205 | 205 | |
| 206 | 206 | const userNicknameFormat = (row) => { |
| 207 | - if (!row || !row.leaderUserId || row.leaderUserId == null) { | |
| 207 | + if (!row || !row.leaderUserId) { | |
| 208 | 208 | return '未设置' |
| 209 | 209 | } |
| 210 | 210 | for (const user of userOption.value) { | ... | ... |
yudao-ui-admin-vue3/src/views/system/tenant/tenant.data.ts
| ... | ... | @@ -36,6 +36,7 @@ export const rules = reactive({ |
| 36 | 36 | // CrudSchema. |
| 37 | 37 | const crudSchemas = reactive<VxeCrudSchema>({ |
| 38 | 38 | primaryKey: 'id', |
| 39 | + primaryTitle: '租户编号', | |
| 39 | 40 | primaryType: 'seq', |
| 40 | 41 | action: true, |
| 41 | 42 | columns: [ |
| ... | ... | @@ -121,7 +122,7 @@ const crudSchemas = reactive<VxeCrudSchema>({ |
| 121 | 122 | { |
| 122 | 123 | title: t('table.createTime'), |
| 123 | 124 | field: 'createTime', |
| 124 | - formatter: 'formatDate', | |
| 125 | + formatter: 'formatDate', // TODO 星语:要不给 formatter = formatDate 的时候,设置一个它的默认宽度,避免缩进 | |
| 125 | 126 | isForm: false |
| 126 | 127 | } |
| 127 | 128 | ] | ... | ... |
yudao-ui-admin-vue3/src/views/system/tenantPackage/tenantPackage.data.ts
| ... | ... | @@ -19,6 +19,7 @@ export const rules = reactive({ |
| 19 | 19 | const crudSchemas = reactive<VxeCrudSchema>({ |
| 20 | 20 | primaryKey: 'id', |
| 21 | 21 | primaryType: 'seq', |
| 22 | + primaryTitle: '套餐编号', | |
| 22 | 23 | action: true, |
| 23 | 24 | columns: [ |
| 24 | 25 | { |
| ... | ... | @@ -35,7 +36,7 @@ const crudSchemas = reactive<VxeCrudSchema>({ |
| 35 | 36 | }, |
| 36 | 37 | { |
| 37 | 38 | title: '菜单权限', |
| 38 | - field: 'menuIds', | |
| 39 | + field: 'menuIds', // TODO 星语:菜单权限,表单可以搞大点哇? | |
| 39 | 40 | isTable: false |
| 40 | 41 | }, |
| 41 | 42 | { | ... | ... |
yudao-ui-admin-vue3/src/views/system/user/index.vue
| ... | ... | @@ -28,8 +28,8 @@ |
| 28 | 28 | </template> |
| 29 | 29 | <!-- 列表 --> |
| 30 | 30 | <vxe-grid ref="xGrid" v-bind="gridOptions" class="xtable-scrollbar"> |
| 31 | - <!-- 操作:新增 --> | |
| 32 | 31 | <template #toolbar_buttons> |
| 32 | + <!-- 操作:新增 --> | |
| 33 | 33 | <XButton |
| 34 | 34 | type="primary" |
| 35 | 35 | preIcon="ep:zoom-in" |
| ... | ... | @@ -37,6 +37,7 @@ |
| 37 | 37 | v-hasPermi="['system:user:create']" |
| 38 | 38 | @click="handleCreate()" |
| 39 | 39 | /> |
| 40 | + <!-- 操作:导入用户 --> | |
| 40 | 41 | <XButton |
| 41 | 42 | type="warning" |
| 42 | 43 | preIcon="ep:upload" |
| ... | ... | @@ -44,6 +45,7 @@ |
| 44 | 45 | v-hasPermi="['system:user:import']" |
| 45 | 46 | @click="importDialogVisible = true" |
| 46 | 47 | /> |
| 48 | + <!-- 操作:导出用户 --> | |
| 47 | 49 | <XButton |
| 48 | 50 | type="warning" |
| 49 | 51 | preIcon="ep:download" |
| ... | ... | @@ -52,6 +54,7 @@ |
| 52 | 54 | @click="exportList('用户数据.xls')" |
| 53 | 55 | /> |
| 54 | 56 | </template> |
| 57 | + <!-- TODO @星语:貌似没生效? --> | |
| 55 | 58 | <template #status="{ row }"> |
| 56 | 59 | <el-switch |
| 57 | 60 | v-model="row.status" |
| ... | ... | @@ -61,6 +64,7 @@ |
| 61 | 64 | /> |
| 62 | 65 | </template> |
| 63 | 66 | <template #actionbtns_default="{ row }"> |
| 67 | + <!-- 操作:编辑 --> | |
| 64 | 68 | <XTextButton |
| 65 | 69 | preIcon="ep:edit" |
| 66 | 70 | :title="t('action.edit')" |
| ... | ... | @@ -74,12 +78,15 @@ |
| 74 | 78 | v-hasPermi="['system:user:update']" |
| 75 | 79 | @click="handleDetail(row.id)" |
| 76 | 80 | /> |
| 81 | + <!-- TODO 芋艿:可以重置角色、密码收起来么,形成【更多】 --> | |
| 82 | + <!-- 操作:重置密码 --> | |
| 77 | 83 | <XTextButton |
| 78 | 84 | preIcon="ep:key" |
| 79 | 85 | title="重置密码" |
| 80 | 86 | v-hasPermi="['system:user:update-password']" |
| 81 | 87 | @click="handleResetPwd(row)" |
| 82 | 88 | /> |
| 89 | + <!-- 操作:分配角色 --> | |
| 83 | 90 | <XTextButton |
| 84 | 91 | preIcon="ep:key" |
| 85 | 92 | title="分配角色" |
| ... | ... | @@ -349,6 +356,7 @@ const handleCreate = async () => { |
| 349 | 356 | deptId.value = null |
| 350 | 357 | postIds.value = [] |
| 351 | 358 | await nextTick() |
| 359 | + // TODO 星语:要不要这个放到新增里?这样和 handleUpdate 统一一点 | |
| 352 | 360 | if (allSchemas.formSchema[0].field !== 'username') { |
| 353 | 361 | unref(formRef)?.addSchema( |
| 354 | 362 | { |
| ... | ... | @@ -371,7 +379,7 @@ const handleCreate = async () => { |
| 371 | 379 | |
| 372 | 380 | // 修改操作 |
| 373 | 381 | const handleUpdate = async (rowId: number) => { |
| 374 | - setDialogTile('update') | |
| 382 | + setDialogTile('update') // TODO @星语:有警告 | |
| 375 | 383 | await nextTick() |
| 376 | 384 | unref(formRef)?.delSchema('username') |
| 377 | 385 | unref(formRef)?.delSchema('password') |
| ... | ... | @@ -475,6 +483,7 @@ const submitRole = async () => { |
| 475 | 483 | roleDialogVisible.value = false |
| 476 | 484 | } |
| 477 | 485 | // ========== 导入相关 ========== |
| 486 | +// TODO @星语:这个要不要把导入用户,封装成一个小组件?可选哈 | |
| 478 | 487 | const importDialogVisible = ref(false) |
| 479 | 488 | const uploadDisabled = ref(false) |
| 480 | 489 | const importDialogTitle = ref('用户导入') | ... | ... |
yudao-ui-admin-vue3/src/views/system/user/user.data.ts
| ... | ... | @@ -14,7 +14,7 @@ export const rules = reactive({ |
| 14 | 14 | mobile: [ |
| 15 | 15 | { |
| 16 | 16 | pattern: |
| 17 | - /^(?:(?:\+|00)86)?1(?:(?:3[\d])|(?:4[5-79])|(?:5[0-35-9])|(?:6[5-7])|(?:7[0-8])|(?:8[\d])|(?:9[189]))\d{8}$/, | |
| 17 | + /^(?:(?:\+|00)86)?1(?:(?:3[\d])|(?:4[5-79])|(?:5[0-35-9])|(?:6[5-7])|(?:7[0-8])|(?:8[\d])|(?:9[189]))\d{8}$/, // TODO @星语:前端只校验长度,格式交给后端;因为号码格式不断在变的 | |
| 18 | 18 | trigger: 'blur', |
| 19 | 19 | message: '请输入正确的手机号码' |
| 20 | 20 | } |
| ... | ... | @@ -24,6 +24,7 @@ export const rules = reactive({ |
| 24 | 24 | const crudSchemas = reactive<VxeCrudSchema>({ |
| 25 | 25 | primaryKey: 'id', |
| 26 | 26 | primaryType: 'seq', |
| 27 | + primaryTitle: '用户编号', | |
| 27 | 28 | action: true, |
| 28 | 29 | actionWidth: '400px', |
| 29 | 30 | columns: [ |
| ... | ... | @@ -56,12 +57,12 @@ const crudSchemas = reactive<VxeCrudSchema>({ |
| 56 | 57 | }, |
| 57 | 58 | { |
| 58 | 59 | title: '部门', |
| 59 | - field: 'deptId', | |
| 60 | + field: 'deptId', // TODO 星语:详情的部门没展示 | |
| 60 | 61 | isTable: false |
| 61 | 62 | }, |
| 62 | 63 | { |
| 63 | 64 | title: '岗位', |
| 64 | - field: 'postIds', | |
| 65 | + field: 'postIds', // TODO 星语:岗位为空的时候,要不要不展示 | |
| 65 | 66 | isTable: false |
| 66 | 67 | }, |
| 67 | 68 | { |
| ... | ... | @@ -74,7 +75,7 @@ const crudSchemas = reactive<VxeCrudSchema>({ |
| 74 | 75 | { |
| 75 | 76 | title: '最后登录时间', |
| 76 | 77 | field: 'loginDate', |
| 77 | - formatter: 'formatDate', | |
| 78 | + formatter: 'formatDate', // TODO 星语:未登录的时候,不要展示 Invalid Date | |
| 78 | 79 | isForm: false |
| 79 | 80 | }, |
| 80 | 81 | { | ... | ... |