<!DOCTYPE html>
|
<html lang="zh-CN">
|
<head>
|
<meta charset="UTF-8">
|
<title>系统用户</title>
|
<meta name="renderer" content="webkit">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
<link rel="stylesheet" href="../../static/vue/element/element.css">
|
<link rel="stylesheet" href="../../static/css/cool.css">
|
<style>
|
:root {
|
--card-bg: rgba(255, 255, 255, 0.96);
|
--card-border: rgba(217, 227, 238, 0.96);
|
--text-main: #243447;
|
--text-sub: #6d7f90;
|
}
|
|
[v-cloak] {
|
display: none;
|
}
|
|
html,
|
body {
|
margin: 0;
|
min-height: 100%;
|
color: var(--text-main);
|
font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
|
background:
|
radial-gradient(920px 360px at 0% 0%, rgba(48, 112, 196, 0.10), transparent 58%),
|
radial-gradient(760px 280px at 100% 10%, rgba(25, 160, 138, 0.08), transparent 60%),
|
linear-gradient(180deg, #f3f7fb 0%, #f8fafc 100%);
|
}
|
|
.page-shell {
|
padding: 14px;
|
box-sizing: border-box;
|
}
|
|
.card-shell {
|
max-width: 1600px;
|
margin: 0 auto;
|
border-radius: 22px;
|
border: 1px solid var(--card-border);
|
background:
|
radial-gradient(780px 220px at -8% 0%, rgba(45, 118, 196, 0.05), transparent 58%),
|
radial-gradient(640px 180px at 106% 16%, rgba(24, 150, 129, 0.05), transparent 56%),
|
var(--card-bg);
|
box-shadow: 0 16px 32px rgba(44, 67, 96, 0.08);
|
overflow: hidden;
|
}
|
|
.card-head {
|
padding: 16px 18px 14px;
|
border-bottom: 1px solid rgba(223, 231, 240, 0.92);
|
}
|
|
.head-top {
|
display: flex;
|
align-items: flex-start;
|
justify-content: space-between;
|
gap: 16px;
|
flex-wrap: wrap;
|
margin-bottom: 12px;
|
}
|
|
.head-title {
|
display: flex;
|
flex-direction: column;
|
gap: 6px;
|
}
|
|
.head-title h1 {
|
margin: 0;
|
font-size: 20px;
|
line-height: 1.2;
|
}
|
|
.head-title p {
|
margin: 0;
|
font-size: 13px;
|
line-height: 1.6;
|
color: var(--text-sub);
|
}
|
|
.head-actions {
|
display: flex;
|
gap: 10px;
|
flex-wrap: wrap;
|
}
|
|
.head-actions .el-button {
|
min-width: 96px;
|
}
|
|
.search-form {
|
display: flex;
|
align-items: center;
|
gap: 8px 12px;
|
flex-wrap: wrap;
|
}
|
|
.search-form .el-form-item {
|
margin-bottom: 0;
|
}
|
|
.search-form .el-form-item__label {
|
font-weight: 600;
|
color: #55697d;
|
}
|
|
.search-form .el-input__inner,
|
.search-form .el-button {
|
height: 34px;
|
line-height: 34px;
|
}
|
|
.table-wrap {
|
padding: 12px 18px 16px;
|
}
|
|
.table-shell {
|
border-radius: 18px;
|
overflow: hidden;
|
border: 1px solid rgba(217, 227, 238, 0.98);
|
background: rgba(255, 255, 255, 0.95);
|
}
|
|
.table-shell .el-table th {
|
background: #f7fafc;
|
color: #53677d;
|
font-weight: 700;
|
}
|
|
.table-shell .el-table td,
|
.table-shell .el-table th {
|
padding: 10px 0;
|
}
|
|
.status-switch {
|
display: inline-flex;
|
align-items: center;
|
}
|
|
.pager-bar {
|
padding: 16px 0 0;
|
display: flex;
|
justify-content: flex-end;
|
}
|
|
.dialog-panel .el-dialog {
|
border-radius: 22px;
|
overflow: hidden;
|
}
|
|
.dialog-panel .el-dialog__header {
|
padding: 20px 22px 12px;
|
background: linear-gradient(180deg, #f8fbff 0%, #f3f7fb 100%);
|
border-bottom: 1px solid rgba(224, 232, 241, 0.92);
|
}
|
|
.dialog-panel .el-dialog__title {
|
font-weight: 700;
|
color: var(--text-main);
|
}
|
|
.dialog-panel .el-dialog__body {
|
padding: 20px 22px 8px;
|
}
|
|
.dialog-form .el-form-item {
|
margin-bottom: 16px;
|
}
|
|
.dialog-form .el-form-item__label {
|
font-weight: 600;
|
color: #5b6f83;
|
}
|
|
.dialog-form .el-input__inner,
|
.dialog-form .el-select .el-input__inner {
|
height: 36px;
|
line-height: 36px;
|
}
|
|
.dialog-tip {
|
margin: 4px 0 2px;
|
padding: 10px 12px;
|
border-radius: 12px;
|
font-size: 12px;
|
line-height: 1.6;
|
color: #748497;
|
background: rgba(248, 251, 255, 0.92);
|
border: 1px solid rgba(226, 233, 242, 0.96);
|
}
|
|
.dialog-footer {
|
display: flex;
|
justify-content: flex-end;
|
gap: 10px;
|
}
|
|
.reset-user {
|
margin-bottom: 16px;
|
padding: 12px 14px;
|
border-radius: 12px;
|
background: rgba(248, 251, 255, 0.92);
|
border: 1px solid rgba(226, 233, 242, 0.96);
|
color: var(--text-sub);
|
font-size: 13px;
|
}
|
|
.table-action-danger {
|
color: #f56c6c;
|
}
|
|
@media (max-width: 768px) {
|
.page-shell {
|
padding: 10px;
|
}
|
|
.card-head,
|
.table-wrap {
|
padding-left: 12px;
|
padding-right: 12px;
|
}
|
|
.dialog-panel .el-dialog {
|
width: calc(100% - 24px) !important;
|
}
|
}
|
</style>
|
</head>
|
<body>
|
<div id="app" v-cloak class="page-shell">
|
<div class="card-shell">
|
<div class="card-head">
|
<div class="head-top">
|
<div class="head-title">
|
<h1>系统用户</h1>
|
<p>修改界面不再显示密码,密码调整统一通过“重置密码”完成;角色、状态等字段恢复为选择控件。</p>
|
</div>
|
<div class="head-actions">
|
<el-button type="primary" icon="el-icon-plus" @click="openCreateDialog">新增用户</el-button>
|
<el-button type="danger" icon="el-icon-delete" :disabled="selection.length === 0" @click="removeSelection">删除所选</el-button>
|
</div>
|
</div>
|
<el-form :inline="true" :model="searchForm" class="search-form" @submit.native.prevent>
|
<el-form-item label="登录账户">
|
<el-input v-model.trim="searchForm.username" clearable placeholder="请输入登录账户" @keyup.enter.native="handleSearch"></el-input>
|
</el-form-item>
|
<el-form-item label="账号">
|
<el-input v-model.trim="searchForm.mobile" clearable placeholder="请输入账号" @keyup.enter.native="handleSearch"></el-input>
|
</el-form-item>
|
<el-form-item>
|
<el-button type="primary" icon="el-icon-search" @click="handleSearch">查询</el-button>
|
<el-button icon="el-icon-refresh-left" @click="handleResetSearch">重置</el-button>
|
</el-form-item>
|
</el-form>
|
</div>
|
|
<div class="table-wrap">
|
<div class="table-shell" v-loading="loading">
|
<el-table
|
:data="tableData"
|
border
|
stripe
|
height="calc(100vh - 245px)"
|
@selection-change="handleSelectionChange">
|
<el-table-column type="selection" width="48" align="center"></el-table-column>
|
<el-table-column prop="username" label="登录账户" min-width="150" show-overflow-tooltip></el-table-column>
|
<el-table-column prop="mobile" label="账号" min-width="150" show-overflow-tooltip></el-table-column>
|
<el-table-column prop="roleName" label="角色" min-width="150" show-overflow-tooltip></el-table-column>
|
<el-table-column label="MFA授权" width="110" align="center">
|
<template slot-scope="scope">
|
<el-tag size="mini" :type="Number(scope.row.mfaAllow) === 1 ? 'success' : 'info'">
|
{{ Number(scope.row.mfaAllow) === 1 ? '已授权' : '未授权' }}
|
</el-tag>
|
</template>
|
</el-table-column>
|
<el-table-column label="MFA状态" width="110" align="center">
|
<template slot-scope="scope">
|
<el-tag size="mini" :type="Number(scope.row.mfaEnabled) === 1 ? 'success' : 'warning'">
|
{{ Number(scope.row.mfaEnabled) === 1 ? '已启用' : '未启用' }}
|
</el-tag>
|
</template>
|
</el-table-column>
|
<el-table-column label="状态" width="130" align="center">
|
<template slot-scope="scope">
|
<div class="status-switch">
|
<el-switch
|
v-model="scope.row.status"
|
:active-value="1"
|
:inactive-value="0"
|
active-text="正常"
|
inactive-text="禁用"
|
@change="toggleStatus(scope.row)">
|
</el-switch>
|
</div>
|
</template>
|
</el-table-column>
|
<el-table-column label="操作" width="220" fixed="right" align="center">
|
<template slot-scope="scope">
|
<el-button type="text" @click="openEditDialog(scope.row)">编辑</el-button>
|
<el-button type="text" @click="openResetPasswordDialog(scope.row)">重置密码</el-button>
|
<el-button type="text" class="table-action-danger" @click="removeRows([scope.row.id])">删除</el-button>
|
</template>
|
</el-table-column>
|
</el-table>
|
</div>
|
|
<div class="pager-bar">
|
<el-pagination
|
background
|
layout="total, sizes, prev, pager, next, jumper"
|
:current-page="page.curr"
|
:page-size="page.limit"
|
:page-sizes="[15, 30, 50, 100, 200, 500]"
|
:total="page.total"
|
@size-change="handleSizeChange"
|
@current-change="handleCurrentChange">
|
</el-pagination>
|
</div>
|
</div>
|
</div>
|
|
<el-dialog
|
class="dialog-panel"
|
:title="dialog.mode === 'create' ? '新增用户' : '修改用户'"
|
:visible.sync="dialog.visible"
|
width="620px"
|
:close-on-click-modal="false"
|
append-to-body>
|
<el-form
|
ref="dialogForm"
|
:model="dialogForm"
|
:rules="dialogRules"
|
label-width="88px"
|
class="dialog-form"
|
@submit.native.prevent>
|
<el-row :gutter="18">
|
<el-col :xs="24" :sm="12">
|
<el-form-item label="登录账户" prop="username">
|
<el-input v-model.trim="dialogForm.username" maxlength="32" placeholder="请输入登录账户"></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :xs="24" :sm="12">
|
<el-form-item label="账号" prop="mobile">
|
<el-input v-model.trim="dialogForm.mobile" maxlength="32" placeholder="请输入账号"></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :xs="24" :sm="12">
|
<el-form-item label="角色" prop="roleId">
|
<el-select v-model="dialogForm.roleId" placeholder="请选择角色" style="width: 100%;">
|
<el-option
|
v-for="role in roles"
|
:key="role.id"
|
:label="role.name"
|
:value="Number(role.id)">
|
</el-option>
|
</el-select>
|
</el-form-item>
|
</el-col>
|
<el-col :xs="24" :sm="12">
|
<el-form-item label="状态">
|
<el-select v-model="dialogForm.status" placeholder="请选择状态" style="width: 100%;">
|
<el-option label="正常" :value="1"></el-option>
|
<el-option label="禁用" :value="0"></el-option>
|
</el-select>
|
</el-form-item>
|
</el-col>
|
<el-col :xs="24" :sm="12">
|
<el-form-item label="MFA授权">
|
<el-select v-model="dialogForm.mfaAllow" placeholder="请选择" style="width: 100%;">
|
<el-option label="不允许" :value="0"></el-option>
|
<el-option label="允许" :value="1"></el-option>
|
</el-select>
|
</el-form-item>
|
</el-col>
|
<el-col v-if="dialog.mode === 'create'" :xs="24" :sm="12">
|
<el-form-item label="初始密码" prop="password">
|
<el-input v-model.trim="dialogForm.password" show-password maxlength="32" placeholder="请输入初始密码"></el-input>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<div v-if="dialog.mode === 'edit'" class="dialog-tip">
|
修改界面不显示密码。如需调整密码,请关闭当前窗口后使用列表里的“重置密码”。
|
</div>
|
</el-form>
|
<span slot="footer" class="dialog-footer">
|
<el-button @click="closeDialog">取消</el-button>
|
<el-button type="primary" :loading="dialogSubmitting" @click="submitDialog">保存</el-button>
|
</span>
|
</el-dialog>
|
|
<el-dialog
|
class="dialog-panel"
|
title="重置密码"
|
:visible.sync="resetDialog.visible"
|
width="420px"
|
:close-on-click-modal="false"
|
append-to-body>
|
<div class="reset-user">当前用户:{{ resetDialog.username || '--' }}</div>
|
<el-form
|
ref="resetForm"
|
:model="resetDialog"
|
:rules="resetRules"
|
label-width="72px"
|
class="dialog-form"
|
@submit.native.prevent>
|
<el-form-item label="新密码" prop="password">
|
<el-input v-model.trim="resetDialog.password" show-password maxlength="32" placeholder="请输入新密码"></el-input>
|
</el-form-item>
|
</el-form>
|
<span slot="footer" class="dialog-footer">
|
<el-button @click="closeResetDialog">取消</el-button>
|
<el-button type="primary" :loading="resetSubmitting" @click="submitResetPassword">确定</el-button>
|
</span>
|
</el-dialog>
|
</div>
|
|
<script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script>
|
<script type="text/javascript" src="../../static/vue/js/vue.min.js"></script>
|
<script type="text/javascript" src="../../static/vue/element/element.js"></script>
|
<script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script>
|
<script type="text/javascript" src="../../static/js/tools/md5.js"></script>
|
<script type="text/javascript" src="../../static/js/user/user.js?v=20260311_user_restore1" charset="utf-8"></script>
|
</body>
|
</html>
|