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