This commit is contained in:
zlwu committed 2026-05-17 08:36:37 +08:00
1 parent 246ad2228e
commit 8e2dd8b9f0
186 files changed
+38821 -2571

No files matched your search

+6 -6
View File
@@ -211,8 +211,8 @@
</el-form-item>
</el-form>
<template #footer>
<el-button @click="editVisible = false">取消</el-button>
<el-button type="primary" @click="confirmEdit" :loading="submitLoading">确定</el-button>
<el-button @click="editVisible = false"><el-icon><Close /></el-icon>取消</el-button>
<el-button type="primary" @click="confirmEdit" :loading="submitLoading"><el-icon><Check /></el-icon>确定</el-button>
</template>
</el-dialog>
@@ -242,8 +242,8 @@
</el-form-item>
</el-form>
<template #footer>
<el-button @click="addressVisible = false">取消</el-button>
<el-button type="primary" @click="confirmAddress" :loading="submitLoading">确定</el-button>
<el-button @click="addressVisible = false"><el-icon><Close /></el-icon>取消</el-button>
<el-button type="primary" @click="confirmAddress" :loading="submitLoading"><el-icon><Check /></el-icon>确定</el-button>
</template>
</el-dialog>
</div>
@@ -254,7 +254,7 @@ import { ref, reactive, computed, onMounted, watch } from 'vue'
import { useRouter, useRoute } from 'vue-router'
import { ElMessage, ElMessageBox } from 'element-plus'
import { withFullscreenLoading, fullscreenLoadingText } from '@/utils/fullscreen-loading'
import { ArrowLeft } from '@element-plus/icons-vue'
import { ArrowLeft, Close, Check } from '@element-plus/icons-vue'
import { fetchUserDetail, fetchUpdateUser, fetchActiveRegions } from '@/api/admin'
import { resolveUserAvatarUrl } from '@/utils/user-avatar'
import type { FormInstance, FormRules } from 'element-plus'
@@ -381,7 +381,7 @@ const formatAmount = (amount: number | string) => {
// 返回列表
const goBack = () => {
router.push('/demo/user')
router.push('/system/user')
}
// 加载数据
+67 -18
View File
@@ -11,12 +11,14 @@
<div class="flex gap-4">
<!-- 左侧:组织树 -->
<div class="w-[280px] shrink-0 border-r border-[var(--mint-border)] pr-4">
<div class="panel-top">
<!-- 标题与搜索同处 panel-top:避免标题栏底边与独立输入框之间出现不可控的视觉断层 -->
<div class="panel-top user-dept-aside__head">
<h2 class="title-bar-heading">组织</h2>
<el-input v-model="deptKeyword" placeholder="搜索组织" clearable />
</div>
<el-input v-model="deptKeyword" placeholder="搜索组织" clearable class="mb-3" />
<el-tree
ref="deptTreeRef"
class="user-dept-aside__tree"
:data="deptTree"
:props="{ label: 'deptName', children: 'children' }"
node-key="id"
@@ -74,6 +76,7 @@
v-loading="loading"
stripe
row-key="id"
@row-dblclick="handleView"
>
<el-table-column
type="index"
@@ -85,12 +88,12 @@
/>
<el-table-column prop="userNo" label="用户账号" min-width="120" align="center" header-align="center" />
<el-table-column prop="nickName" label="用户名" min-width="100" align="center" header-align="center" />
<el-table-column prop="deptName" label="所属组织" min-width="120" align="center" header-align="center">
<el-table-column prop="deptName" label="所属组织" min-width="160" align="center" header-align="center">
<template #default="{ row }">
{{ row.deptName || '-' }}
</template>
</el-table-column>
<el-table-column prop="phoneNo" label="手机号" min-width="120" align="center" header-align="center">
<el-table-column prop="phoneNo" label="手机号" min-width="140" align="center" header-align="center">
<template #default="{ row }">
{{ row.phoneNo || '-' }}
</template>
@@ -102,9 +105,10 @@
</el-tag>
</template>
</el-table-column>
<el-table-column prop="createTime" label="创建时间" min-width="160" align="center" header-align="center" />
<el-table-column label="操作" width="320" fixed="right" align="center" header-align="center">
<el-table-column prop="createTime" label="创建时间" min-width="180" align="center" header-align="center" />
<el-table-column label="操作" width="400" fixed="right" align="center" header-align="center">
<template #default="{ row }">
<el-button class="btn-op-item" @click="handleView(row)"><el-icon><View /></el-icon>查看</el-button>
<el-button class="btn-op-item primary" @click="handleEdit(row)">编辑</el-button>
<el-button class="btn-op-item" @click="handleResetPwd(row)">重置密码</el-button>
<el-button class="btn-op-item" @click="handleDelete(row)">删除</el-button>
@@ -175,9 +179,6 @@
<el-option label="停用" value="0" />
</el-select>
</el-form-item>
<el-form-item label="排序">
<el-input-number v-model="formData.orderNum" :min="0" :max="9999" controls-position="right" />
</el-form-item>
<el-form-item label="备注" style="grid-column: 1 / -1">
<el-input v-model="formData.remark" type="textarea" :rows="2" placeholder="可选" />
</el-form-item>
@@ -194,14 +195,23 @@
</el-button>
</template>
</el-dialog>
<SystemViewDialog
v-model:visible="viewVisible"
:title="viewRow?.nickName || '用户详情'"
:icon="UserFilled"
:meta="`${viewRow?.deptName || ''}${viewRow?.deptName && viewRow?.createTime ? ' · ' : ''}${viewRow?.createTime || ''}`"
:sections="viewSections"
/>
</section>
</div>
</template>
<script setup lang="ts">
import { ref, reactive, onMounted, watch } from 'vue'
import { ref, reactive, computed, onMounted, watch } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { Plus, Close, Check } from '@element-plus/icons-vue'
import { Plus, Close, Check, View, UserFilled } from '@element-plus/icons-vue'
import SystemViewDialog from '@/components/business/system-view-dialog/index.vue'
import {
fetchUserList,
fetchCreateUser,
@@ -399,6 +409,39 @@
await fetchResetPassword(row.id)
}
// ---- 查看弹窗 ----
const viewVisible = ref(false)
const viewRow = ref<Api.User.UserItem | null>(null)
const viewSections = computed(() => {
const row = viewRow.value
if (!row) return []
return [
{
title: '基本信息',
fields: [
{ label: '用户账号', value: row.userNo },
{ label: '用户名', value: row.nickName },
{ label: '所属组织', value: row.deptName },
{ label: '手机号', value: row.phoneNo },
{ label: '邮箱', value: row.email },
{
label: '性别',
value: ({ '0': '男', '1': '女', '2': '未知' } as Record<string, string>)[row.sex] || '未知'
},
{ label: '状态', value: row.status === '1' ? '正常' : '停用' },
{ label: '创建时间', value: row.createTime },
{ label: '备注', value: row.remark, span: true }
]
}
]
})
function handleView(row: Api.User.UserItem) {
viewRow.value = row
viewVisible.value = true
}
onMounted(() => {
loadDeptTree()
loadData()
@@ -406,17 +449,23 @@
</script>
<style scoped lang="scss">
/* 侧栏标题区纵向排布:与全局 panel-top 横排工具栏区分,收紧标题与搜索的间距节奏 */
.user-dept-aside__head {
flex-direction: column;
align-items: stretch;
justify-content: flex-start;
flex-wrap: nowrap;
gap: 8px;
}
.user-dept-aside__tree {
margin-top: 12px;
}
.user-dialog-form {
:deep(.el-form-item) {
margin-bottom: 0;
}
:deep(.el-form-item__label) {
font-size: 11px;
font-weight: 500;
color: var(--mint-text-muted);
padding: 0 0 4px;
line-height: 1.2;
}
}
</style>
@@ -32,14 +32,15 @@
</ElForm>
<template #footer>
<div class="dialog-footer">
<ElButton class="btn-ghost" @click="dialogVisible = false">取消</ElButton>
<ElButton class="btn-main" type="primary" @click="handleSubmit">提交</ElButton>
<ElButton class="btn-ghost" @click="dialogVisible = false"><el-icon><Close /></el-icon>取消</ElButton>
<ElButton class="btn-main" type="primary" @click="handleSubmit"><el-icon><Check /></el-icon>提交</ElButton>
</div>
</template>
</ElDialog>
</template>
<script setup lang="ts">
import { Close, Check } from '@element-plus/icons-vue'
import { fetchGetRoleList } from '@/api/admin'
import type { FormInstance, FormRules } from 'element-plus'