feat: 会议ID应用赋值 + 会议表单/详情优化 + admin工作台统计与用户管理
- meetingId 由 DB 自增改为应用赋值 10 位数字 (yyMMdd + 4 位序列, Redis 按日期计数) - 会议开始时间不能晚于结束时间校验; 参会人表单身份证附件/角色单独一行 - 会议详情左右列比例 7:3 -> 8:2 (材料审核列收窄) - admin/workbench 用户总数/角色类型数/各角色分布统计修复 (改用 listByRole 按 role_type 过滤) - 新增 admin 用户管理接口 + 门户页脚 + H5 签到/上传优化
This commit is contained in:
@@ -61,7 +61,7 @@
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="260" fixed="right">
|
||||
<el-table-column label="操作" width="340" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<!-- 查看 (只读详情): 两角色都有, 跳独立详情页 -->
|
||||
<el-button link type="primary" @click="goView(row)">查看</el-button>
|
||||
@@ -71,6 +71,8 @@
|
||||
<el-button link :type="isDisabled(row) ? 'success' : 'danger'" @click="onToggleStatus(row)">
|
||||
{{ isDisabled(row) ? '启用' : '禁用' }}
|
||||
</el-button>
|
||||
<!-- 重置密码: 重置为默认 123456 (与新建人员默认密码一致) -->
|
||||
<el-button v-if="row.userId" link type="primary" @click="onResetPwd(row)">重置密码</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -119,7 +121,7 @@
|
||||
<script setup>
|
||||
import { ref, reactive, onMounted, computed, watch } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { bizList, bizUpdate, importPerson, downloadImportTemplate, changePersonAdmin } from '@/api/public'
|
||||
import { bizList, bizUpdate, importPerson, downloadImportTemplate, changePersonAdmin, resetPersonPassword } from '@/api/public'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { Upload } from '@element-plus/icons-vue'
|
||||
import ImportResultDialog from '@/components/ImportResultDialog.vue'
|
||||
@@ -214,6 +216,23 @@ async function onChangeAdmin(row) {
|
||||
}
|
||||
}
|
||||
|
||||
// ========== 重置密码 ==========
|
||||
async function onResetPwd(row) {
|
||||
try {
|
||||
await ElMessageBox.confirm(
|
||||
`确定重置「${row.name}」的登录密码为默认 123456 吗?`,
|
||||
'重置密码',
|
||||
{ type: 'warning' }
|
||||
)
|
||||
} catch { return }
|
||||
try {
|
||||
await resetPersonPassword(row.personId)
|
||||
ElMessage.success('已重置为 123456')
|
||||
} catch (e) {
|
||||
ElMessage.error(e?.msg || e?.message || '重置失败')
|
||||
}
|
||||
}
|
||||
|
||||
// ========== 跳转 (按角色) ==========
|
||||
function goNew() {
|
||||
router.push({
|
||||
@@ -225,10 +244,22 @@ function goNew() {
|
||||
})
|
||||
}
|
||||
function goEdit(row) {
|
||||
router.push(listBasePath.value + '/edit/' + row.personId)
|
||||
router.push({
|
||||
path: listBasePath.value + '/edit/' + row.personId,
|
||||
query: {
|
||||
...(orgId.value ? { orgId: orgId.value } : {}),
|
||||
...(orgName.value ? { orgName: orgName.value } : {})
|
||||
}
|
||||
})
|
||||
}
|
||||
function goView(row) {
|
||||
router.push(listBasePath.value + '/view/' + row.personId)
|
||||
router.push({
|
||||
path: listBasePath.value + '/view/' + row.personId,
|
||||
query: {
|
||||
...(orgId.value ? { orgId: orgId.value } : {}),
|
||||
...(orgName.value ? { orgName: orgName.value } : {})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// ========== 批量导入 ==========
|
||||
|
||||
@@ -63,6 +63,8 @@ const personId = route.params.id
|
||||
// 角色感知: admin/manager 都能跳到此页, 回跳路径按 route 区分
|
||||
const isAdmin = computed(() => route.path.startsWith('/admin/'))
|
||||
const listBasePath = computed(() => isAdmin.value ? '/admin/sponsor-people' : '/manager/sponsor-people')
|
||||
const orgId = computed(() => route.query.orgId ? Number(route.query.orgId) : null)
|
||||
const orgName = computed(() => route.query.orgName || '')
|
||||
|
||||
const loading = ref(false)
|
||||
const form = reactive({
|
||||
@@ -79,7 +81,13 @@ const form = reactive({
|
||||
})
|
||||
|
||||
function goBack() {
|
||||
router.push(listBasePath.value)
|
||||
router.push({
|
||||
path: listBasePath.value,
|
||||
query: {
|
||||
...(orgId.value ? { orgId: orgId.value } : {}),
|
||||
...(orgName.value ? { orgName: orgName.value } : {})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
async function loadDetail() {
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
|
||||
<el-card v-loading="loadingDetail" shadow="never" class="form-card nested">
|
||||
<el-form :model="form" :rules="rules" ref="formRef" label-width="100px">
|
||||
<el-form-item label="用户名" prop="userName">
|
||||
<el-input v-model="form.userName" placeholder="登录用户名" maxlength="50" :disabled="isEdit" />
|
||||
<el-form-item v-if="!isEdit" label="用户名" prop="userName">
|
||||
<el-input v-model="form.userName" placeholder="登录用户名" maxlength="50" />
|
||||
</el-form-item>
|
||||
<el-form-item label="姓名" prop="name">
|
||||
<el-input v-model="form.name" placeholder="姓名" maxlength="20" />
|
||||
@@ -82,7 +82,13 @@ const rules = {
|
||||
}
|
||||
|
||||
function goBack() {
|
||||
router.push(listBasePath.value)
|
||||
router.push({
|
||||
path: listBasePath.value,
|
||||
query: {
|
||||
...(orgId.value ? { orgId: orgId.value } : {}),
|
||||
...(orgName.value ? { orgName: orgName.value } : {})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
async function loadDetail() {
|
||||
@@ -129,7 +135,6 @@ async function onSave() {
|
||||
// 从 org 页面跳来时 route.query 带 orgId, 直接作为 FK
|
||||
if (!isEdit && orgId.value) payload.orgId = orgId.value
|
||||
if (isEdit) {
|
||||
delete payload.personId
|
||||
await bizUpdate('person', payload)
|
||||
ElMessage.success('修改成功')
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user