未验证 提交 08d30e75 编写于 作者: Mr.奇淼('s avatar Mr.奇淼( 提交者: GitHub

Merge pull request #905 from flipped-aurora/person-dev

public:让用户对信息修改更加全面和简便——v2.5.0 beta2
......@@ -275,6 +275,8 @@ func (b *BaseApi) SetUserInfo(c *gin.Context) {
var user system.SysUser
_ = c.ShouldBindJSON(&user)
user.Username = ""
user.Password = ""
user.AuthorityId = ""
if err := utils.Verify(user, utils.IdVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
......@@ -299,6 +301,8 @@ func (b *BaseApi) SetSelfInfo(c *gin.Context) {
var user system.SysUser
_ = c.ShouldBindJSON(&user)
user.Username = ""
user.Password = ""
user.AuthorityId = ""
user.ID = utils.GetUserID(c)
if err, ReqUser := userService.SetUserInfo(user); err != nil {
global.GVA_LOG.Error("设置失败!", zap.Error(err))
......
......@@ -38,7 +38,7 @@ func RunWindowsServer() {
fmt.Printf(`
欢迎使用 github.com/flipped-aurora/gin-vue-admin/server
当前版本:V2.5.0 beta
当前版本:V2.5.0 beta.2
加群方式:微信号:shouzi_1994 QQ群:622360840
GVA讨论社区:https://support.qq.com/products/371961
默认自动化文档地址:http://127.0.0.1%s/swagger/index.html
......
......@@ -18,4 +18,6 @@ type SysUser struct {
AuthorityId string `json:"authorityId" gorm:"default:888;comment:用户角色ID"` // 用户角色ID
Authority SysAuthority `json:"authority" gorm:"foreignKey:AuthorityId;references:AuthorityId;comment:用户角色"`
Authorities []SysAuthority `json:"authorities" gorm:"many2many:sys_user_authority;"`
Phone string `json:"phone" gorm:"comment:用户手机号"` // 用户角色ID
Email string `json:"email" gorm:"comment:用户邮箱"` // 用户邮箱
}
......@@ -22,22 +22,22 @@
<el-input v-model="searchInfo.{{.FieldJson}}" placeholder="搜索条件" />
</el-form-item>{{ end }}{{ end }}{{ end }}
<el-form-item>
<el-button size="mini" type="primary" icon="search" @click="onSubmit">查询</el-button>
<el-button size="mini" icon="refresh" @click="onReset">重置</el-button>
<el-button size="small" type="primary" icon="search" @click="onSubmit">查询</el-button>
<el-button size="small" icon="refresh" @click="onReset">重置</el-button>
</el-form-item>
</el-form>
</div>
<div class="gva-table-box">
<div class="gva-btn-list">
<el-button size="mini" type="primary" icon="plus" @click="openDialog">新增</el-button>
<el-button size="small" type="primary" icon="plus" @click="openDialog">新增</el-button>
<el-popover v-model:visible="deleteVisible" placement="top" width="160">
<p>确定要删除吗?</p>
<div style="text-align: right; margin-top: 8px;">
<el-button size="mini" type="text" @click="deleteVisible = false">取消</el-button>
<el-button size="mini" type="primary" @click="onDelete">确定</el-button>
<el-button size="small" type="text" @click="deleteVisible = false">取消</el-button>
<el-button size="small" type="primary" @click="onDelete">确定</el-button>
</div>
<template #reference>
<el-button icon="delete" size="mini" style="margin-left: 10px;" :disabled="!multipleSelection.length">删除</el-button>
<el-button icon="delete" size="small" style="margin-left: 10px;" :disabled="!multipleSelection.length">删除</el-button>
</template>
</el-popover>
</div>
......@@ -70,7 +70,7 @@
<el-table-column align="left" label="按钮组">
<template #default="scope">
<el-button type="text" icon="edit" size="small" class="table-button" @click="update{{.StructName}}Func(scope.row)">变更</el-button>
<el-button type="text" icon="delete" size="mini" @click="deleteRow(scope.row)">删除</el-button>
<el-button type="text" icon="delete" size="small" @click="deleteRow(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
......
......@@ -22,13 +22,13 @@ func (a *api) Initialize() error {
{ApiGroup: "jwt", Method: "POST", Path: "/jwt/jsonInBlacklist", Description: "jwt加入黑名单(退出,必选)"},
{ApiGroup: "系统用户", Method: "DELETE", Path: "/user/deleteUser", Description: "删除用户"},
{ApiGroup: "系统用户", Method: "POST", Path: "/user/register", Description: "用户注册(必选)"},
{ApiGroup: "系统用户", Method: "POST", Path: "/user/register", Description: "用户注册"},
{ApiGroup: "系统用户", Method: "POST", Path: "/user/getUserList", Description: "获取用户列表"},
{ApiGroup: "系统用户", Method: "PUT", Path: "/user/setUserInfo", Description: "设置用户信息"},
{ApiGroup: "系统用户", Method: "PUT", Path: "/user/setSelfInfo", Description: "设置自身信息(必选)"},
{ApiGroup: "系统用户", Method: "GET", Path: "/user/getUserInfo", Description: "获取自身信息(必选)"},
{ApiGroup: "系统用户", Method: "POST", Path: "/user/setUserAuthorities", Description: "设置权限组"},
{ApiGroup: "系统用户", Method: "POST", Path: "/user/changePassword", Description: "修改密码(建(选择)"},
{ApiGroup: "系统用户", Method: "POST", Path: "/user/changePassword", Description: "修改密码(建选择)"},
{ApiGroup: "系统用户", Method: "POST", Path: "/user/setUserAuthority", Description: "修改用户角色(必选)"},
{ApiGroup: "系统用户", Method: "POST", Path: "/user/resetPassword", Description: "重置用户密码"},
......
......@@ -18,8 +18,8 @@ func (u *user) TableName() string {
func (u *user) Initialize() error {
entities := []system.SysUser{
{UUID: uuid.NewV4(), Username: "admin", Password: "e10adc3949ba59abbe56e057f20f883e", NickName: "超级管理员", HeaderImg: "https://qmplusimg.henrongyi.top/gva_header.jpg", AuthorityId: "888"},
{UUID: uuid.NewV4(), Username: "a303176530", Password: "3ec063004a6f31642261936a379fde3d", NickName: "QMPlusUser", HeaderImg: "https:///qmplusimg.henrongyi.top/1572075907logo.png", AuthorityId: "9528"},
{UUID: uuid.NewV4(), Username: "admin", Password: "e10adc3949ba59abbe56e057f20f883e", NickName: "超级管理员", HeaderImg: "https://qmplusimg.henrongyi.top/gva_header.jpg", AuthorityId: "888", Phone: "17611111111", Email: "333333333@qq.com"},
{UUID: uuid.NewV4(), Username: "a303176530", Password: "3ec063004a6f31642261936a379fde3d", NickName: "QMPlusUser", HeaderImg: "https:///qmplusimg.henrongyi.top/1572075907logo.png", AuthorityId: "9528", Phone: "17611111111", Email: "333333333@qq.com"},
}
if err := global.GVA_DB.Create(&entities).Error; err != nil {
return errors.Wrap(err, u.TableName()+"表数据初始化失败!")
......
......@@ -10,11 +10,11 @@
"fix-memory-limit": "cross-env LIMIT=4096 increase-memory-limit"
},
"dependencies": {
"@element-plus/icons": "0.0.11",
"@element-plus/icons-vue": "^0.2.7",
"axios": "^0.19.2",
"core-js": "^3.6.5",
"echarts": "4.9.0",
"element-plus": "1.2.0-beta.6",
"element-plus": "2.0.1",
"highlight.js": "^10.6.0",
"marked": "^2.0.0",
"mitt": "^3.0.0",
......
......@@ -9,7 +9,7 @@
:before-upload="beforeImageUpload"
:multiple="false"
>
<el-button size="mini" type="primary">压缩上传</el-button>
<el-button size="small" type="primary">压缩上传</el-button>
</el-upload>
</div>
</template>
......
......@@ -11,7 +11,7 @@
</div>
</template>
<script setup>
import { WarningFilled } from '@element-plus/icons'
import { WarningFilled } from '@element-plus/icons-vue'
defineProps({
title: {
type: String,
......
......@@ -18,7 +18,7 @@ export const viteLogo = (env) => {
)
console.log(
chalk.green(
`> 当前版本:V2.5.0`
`> 当前版本:V2.5.0 beta.2`
)
)
console.log(
......
......@@ -10,7 +10,7 @@ export default {
register(app)
console.log(`
欢迎使用 Gin-Vue-Admin
当前版本:V2.5.0 beta
当前版本:V2.5.0 beta.2
加群方式:微信:shouzi_1994 QQ群:622360840
GVA讨论社区:https://support.qq.com/products/371961
默认自动化文档地址:http://127.0.0.1:${import.meta.env.VITE_SERVER_PORT}/swagger/index.html
......
......@@ -2,7 +2,7 @@ import config from './config'
import { emitter } from '@/utils/bus.js'
// 统一导入el-icon图标
import * as ElIconModules from '@element-plus/icons'
import * as ElIconModules from '@element-plus/icons-vue'
// 导入转换图标名称的函数
export const closeThisPage = () => {
......
......@@ -68,13 +68,19 @@
background-color: #fff;
border-radius: 2px;
margin-bottom: 12px;
.el-form {
.el-form-item {
padding-right: 28px;
}
}
.el-form--inline{
.el-form-item{
margin-right: 24px;
}
}
.el-input__inner{
height: 40px;
line-height: 40px;
}
.gva-form-box {
padding: 24px;
background-color: #fff;
......@@ -145,8 +151,13 @@
}
}
.el-button--mini {
.el-button--small {
min-height: 32px;
font-size: 12px !important;
}
.el-checkbox{
height: auto;
}
.el-button {
......
......@@ -971,10 +971,10 @@ li {
.el-input-number__increase {
position: absolute;
z-index: 1;
top: 3px !important;
top: 2px !important;
width: 42px;
height: 29px;
line-height: 29px;
height: 28px;
line-height: 28px;
text-align: center;
background: #F5F7FA;
color: #606266;
......
......@@ -8,7 +8,7 @@
position: relative;
.input-icon{
padding-right: 6px;
padding-top: 2px;
padding-top: 4px;
}
.login_panle {
position: absolute;
......@@ -48,15 +48,18 @@
padding-left: 20px;
}
}
.vPicBox{
display:flex;
justify-content:space-between;
width:100%;
}
.vPic {
width: 33%;
height: 38px;
float: right !important;
background: #ccc;
img {
width: 100%;
height: 100%;
cursor: pointer;
vertical-align: middle;
}
}
......
......@@ -8,7 +8,7 @@
<input v-show="false" id="file" ref="FileInput" multiple="multiple" type="file" @change="choseFile">
</div>
</form>
<el-button :disabled="limitFileSize" type="primary" size="mini" class="uploadBtn" @click="getFile">上传文件</el-button>
<el-button :disabled="limitFileSize" type="primary" size="small" class="uploadBtn" @click="getFile">上传文件</el-button>
<div class="el-upload__tip">请上传不超过5MB的文件</div>
<div class="list">
<transition name="list" tag="p">
......
......@@ -3,7 +3,7 @@
<warning-bar title="在资源权限中将此角色的资源权限清空 或者不包含创建者的角色 即可屏蔽此客户资源的显示" />
<div class="gva-table-box">
<div class="gva-btn-list">
<el-button size="mini" type="primary" icon="plus" @click="openDialog">新增</el-button>
<el-button size="small" type="primary" icon="plus" @click="openDialog">新增</el-button>
</div>
<el-table
ref="multipleTable"
......@@ -27,11 +27,11 @@
<el-popover v-model:visible="scope.row.visible" placement="top" width="160">
<p>确定要删除吗?</p>
<div style="text-align: right; margin-top: 8px;">
<el-button size="mini" type="text" @click="scope.row.visible = false">取消</el-button>
<el-button type="primary" size="mini" @click="deleteCustomer(scope.row)">确定</el-button>
<el-button size="small" type="text" @click="scope.row.visible = false">取消</el-button>
<el-button type="primary" size="small" @click="deleteCustomer(scope.row)">确定</el-button>
</div>
<template #reference>
<el-button type="text" icon="delete" size="mini">删除</el-button>
<el-button type="text" icon="delete" size="small" @click="scope.row.visible = true">删除</el-button>
</template>
</el-popover>
</template>
......
......@@ -10,10 +10,10 @@
:on-success="loadExcel"
:show-file-list="false"
>
<el-button size="mini" type="primary" icon="upload">导入</el-button>
<el-button size="small" type="primary" icon="upload">导入</el-button>
</el-upload>
<el-button class="excel-btn" size="mini" type="primary" icon="download" @click="handleExcelExport('ExcelExport.xlsx')">导出</el-button>
<el-button class="excel-btn" size="mini" type="success" icon="download" @click="downloadExcelTemplate()">下载模板</el-button>
<el-button class="excel-btn" size="small" type="primary" icon="download" @click="handleExcelExport('ExcelExport.xlsx')">导出</el-button>
<el-button class="excel-btn" size="small" type="success" icon="download" @click="downloadExcelTemplate()">下载模板</el-button>
</div>
<el-table :data="tableData" row-key="ID">
<el-table-column align="left" label="ID" min-width="100" prop="ID" />
......
......@@ -11,7 +11,7 @@
:show-file-list="false"
class="upload-btn"
>
<el-button size="mini" type="primary">普通上传</el-button>
<el-button size="small" type="primary">普通上传</el-button>
</el-upload>
<upload-image
v-model:imageUrl="imageUrl"
......
......@@ -48,29 +48,33 @@
</template>
</el-input>
</el-form-item>
<el-form-item style="position: relative" prop="captcha">
<el-input
v-model="loginFormData.captcha"
placeholder="请输入验证码"
style="width: 60%"
/>
<div class="vPic">
<img
v-if="picPath"
:src="picPath"
alt="请输入验证码"
@click="loginVerify()"
>
<el-form-item prop="captcha">
<div class="vPicBox">
<el-input
v-model="loginFormData.captcha"
placeholder="请输入验证码"
style="width: 60%"
/>
<div class="vPic">
<img
v-if="picPath"
:src="picPath"
alt="请输入验证码"
@click="loginVerify()"
>
</div>
</div>
</el-form-item>
<el-form-item>
<el-button
type="primary"
style="width: 46%"
size="large"
@click="checkInit"
>前往初始化</el-button>
<el-button
type="primary"
size="large"
style="width: 46%; margin-left: 8%"
@click="submitForm"
>登 录</el-button>
......
......@@ -94,15 +94,15 @@
<li>
<p class="title">密保手机</p>
<p class="desc">
已绑定手机:1245678910
<a href="javascript:void(0)">立即修改</a>
已绑定手机:{{ userStore.userInfo.phone }}
<a href="javascript:void(0)" @click="changePhoneFlag = true">立即修改</a>
</p>
</li>
<li>
<p class="title">密保邮箱</p>
<p class="desc">
已绑定邮箱:gin-vue-admin@google.com.cn
<a href="javascript:void(0)">立即修改</a>
已绑定邮箱:{{ userStore.userInfo.email }}
<a href="javascript:void(0)" @click="changeEmailFlag = true">立即修改</a>
</p>
</li>
<li>
......@@ -167,6 +167,60 @@
</div>
</template>
</el-dialog>
<el-dialog v-model="changePhoneFlag" title="绑定手机" width="600px">
<el-form :model="phoneForm">
<el-form-item label="手机号" label-width="120px">
<el-input v-model="phoneForm.phone" placeholder="请输入手机号" autocomplete="off" />
</el-form-item>
<el-form-item label="验证码" label-width="120px">
<div class="code-box">
<el-input v-model="phoneForm.code" autocomplete="off" placeholder="请自行设计短信服务,此处为模拟随便写" style="width:300px" />
<el-button size="small" type="primary" :disabled="time>0" @click="getCode">{{ time>0?`(${time}s)后重新获取`:'获取验证码' }}</el-button>
</div>
</el-form-item>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button
size="small"
@click="closeChangePhone"
>取消</el-button>
<el-button
type="primary"
size="small"
@click="changePhone"
>更改</el-button>
</span>
</template>
</el-dialog>
<el-dialog v-model="changeEmailFlag" title="绑定邮箱" width="600px">
<el-form :model="emailForm">
<el-form-item label="邮箱" label-width="120px">
<el-input v-model="emailForm.email" placeholder="请输入邮箱" autocomplete="off" />
</el-form-item>
<el-form-item label="验证码" label-width="120px">
<div class="code-box">
<el-input v-model="emailForm.code" placeholder="请自行设计邮件服务,此处为模拟随便写" autocomplete="off" style="width:300px" />
<el-button size="small" type="primary" :disabled="emailTime>0" @click="getEmailCode">{{ emailTime>0?`(${emailTime}s)后重新获取`:'获取验证码' }}</el-button>
</div>
</el-form-item>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button
size="small"
@click="closeChangeEmail"
>取消</el-button>
<el-button
type="primary"
size="small"
@click="changeEmail"
>更改</el-button>
</span>
</template>
</el-dialog>
</div>
</template>
......@@ -288,6 +342,73 @@ const enterEdit = async() => {
const handleClick = (tab, event) => {
console.log(tab, event)
}
const changePhoneFlag = ref(false)
const time = ref(0)
const phoneForm = reactive({
phone: '',
code: ''
})
const getCode = async() => {
time.value = 60
let timer = setInterval(() => {
time.value--
if (time.value <= 0) {
clearInterval(timer)
timer = null
}
}, 1000)
}
const closeChangePhone = () => {
changePhoneFlag.value = false
phoneForm.phone = ''
phoneForm.code = ''
}
const changePhone = async() => {
const res = await setSelfInfo({ phone: phoneForm.phone })
if (res.code === 0) {
ElMessage.success('修改成功')
userStore.ResetUserInfo({ phone: phoneForm.phone })
closeChangePhone()
}
}
const changeEmailFlag = ref(false)
const emailTime = ref(0)
const emailForm = reactive({
email: '',
code: ''
})
const getEmailCode = async() => {
emailTime.value = 60
let timer = setInterval(() => {
emailTime.value--
if (emailTime.value <= 0) {
clearInterval(timer)
timer = null
}
}, 1000)
}
const closeChangeEmail = () => {
changeEmailFlag.value = false
emailForm.email = ''
emailForm.code = ''
}
const changeEmail = async() => {
const res = await setSelfInfo({ email: emailForm.email })
if (res.code === 0) {
ElMessage.success('修改成功')
userStore.ResetUserInfo({ email: emailForm.email })
closeChangeEmail()
}
}
</script>
<style lang="scss">
......@@ -425,4 +546,8 @@ const handleClick = (tab, event) => {
.pointer {
cursor: pointer;
}
.code-box{
display: flex;
justify-content: space-between;
}
</style>
......@@ -22,22 +22,22 @@
</el-select>
</el-form-item>
<el-form-item>
<el-button size="mini" type="primary" icon="search" @click="onSubmit">查询</el-button>
<el-button size="mini" icon="refresh" @click="onReset">重置</el-button>
<el-button size="small" type="primary" icon="search" @click="onSubmit">查询</el-button>
<el-button size="small" icon="refresh" @click="onReset">重置</el-button>
</el-form-item>
</el-form>
</div>
<div class="gva-table-box">
<div class="gva-btn-list">
<el-button size="mini" type="primary" icon="plus" @click="openDialog('addApi')">新增</el-button>
<el-button size="small" type="primary" icon="plus" @click="openDialog('addApi')">新增</el-button>
<el-popover v-model:visible="deleteVisible" placement="top" width="160">
<p>确定要删除吗?</p>
<div style="text-align: right; margin-top: 8px;">
<el-button size="mini" type="text" @click="deleteVisible = false">取消</el-button>
<el-button size="mini" type="primary" @click="onDelete">确定</el-button>
<el-button size="small" type="text" @click="deleteVisible = false">取消</el-button>
<el-button size="small" type="primary" @click="onDelete">确定</el-button>
</div>
<template #reference>
<el-button icon="delete" size="mini" :disabled="!apis.length" style="margin-left: 10px;">删除</el-button>
<el-button icon="delete" size="small" :disabled="!apis.length" style="margin-left: 10px;">删除</el-button>
</template>
</el-popover>
</div>
......
......@@ -3,7 +3,7 @@
<warning-bar title="注:右上角头像下拉可切换角色" />
<div class="gva-table-box">
<div class="gva-btn-list">
<el-button size="mini" type="primary" icon="plus" @click="addAuthority('0')">新增角色</el-button>
<el-button size="small" type="primary" icon="plus" @click="addAuthority('0')">新增角色</el-button>
</div>
<el-table
:data="tableData"
......@@ -17,31 +17,31 @@
<template #default="scope">
<el-button
icon="setting"
size="mini"
size="small"
type="text"
@click="opdendrawer(scope.row)"
>设置权限</el-button>
<el-button
icon="plus"
size="mini"
size="small"
type="text"
@click="addAuthority(scope.row.authorityId)"
>新增子角色</el-button>
<el-button
icon="copy-document"
size="mini"
size="small"
type="text"
@click="copyAuthorityFunc(scope.row)"
>拷贝</el-button>
<el-button
icon="edit"
size="mini"
size="small"
type="text"
@click="editAuthority(scope.row)"
>编辑</el-button>
<el-button
icon="delete"
size="mini"
size="small"
type="text"
@click="deleteAuth(scope.row)"
>删除</el-button>
......
<template>
<div>
<div class="clearflex">
<el-button class="fl-right" size="mini" type="primary" @click="authApiEnter">确 定</el-button>
<el-button class="fl-right" size="small" type="primary" @click="authApiEnter">确 定</el-button>
</div>
<el-tree
ref="apiTree"
......
<template>
<div>
<div class="clearflex" style="margin:18px">
<el-button class="fl-right" size="mini" type="primary" @click="authDataEnter">确 定</el-button>
<el-button class="fl-left" size="mini" type="primary" @click="all">全选</el-button>
<el-button class="fl-left" size="mini" type="primary" @click="self">本角色</el-button>
<el-button class="fl-left" size="mini" type="primary" @click="selfAndChildren">本角色及子角色</el-button>
<el-button class="fl-right" size="small" type="primary" @click="authDataEnter">确 定</el-button>
<el-button class="fl-left" size="small" type="primary" @click="all">全选</el-button>
<el-button class="fl-left" size="small" type="primary" @click="self">本角色</el-button>
<el-button class="fl-left" size="small" type="primary" @click="selfAndChildren">本角色及子角色</el-button>
</div>
<el-checkbox-group v-model="dataAuthorityId" @change="selectAuthority">
<el-checkbox v-for="(item,key) in authoritys" :key="key" :label="item">{{ item.authorityName }}</el-checkbox>
......
<template>
<div>
<div class="clearflex">
<el-button class="fl-right" size="mini" type="primary" @click="relation">确 定</el-button>
<el-button class="fl-right" size="small" type="primary" @click="relation">确 定</el-button>
</div>
<el-tree
ref="menuTree"
......@@ -20,7 +20,7 @@
<span>
<el-button
type="text"
size="mini"
size="small"
:style="{color:row.defaultRouter === data.name?'#E6A23C':'#85ce61'}"
:disabled="!node.checked"
@click="() => setDefault(data)"
......
......@@ -22,13 +22,13 @@
</el-form-item>
<el-form-item>
<el-button
size="mini"
size="small"
type="primary"
icon="search"
@click="onSubmit"
>查询</el-button>
<el-button
size="mini"
size="small"
icon="refresh"
@click="onReset"
>重置</el-button>
......@@ -38,7 +38,7 @@
<div class="gva-table-box">
<div class="gva-btn-list">
<el-button
size="mini"
size="small"
type="primary"
icon="plus"
@click="openDialog"
......@@ -83,13 +83,13 @@
<el-table-column align="left" label="按钮组">
<template #default="scope">
<el-button
size="mini"
size="small"
icon="document"
type="text"
@click="toDetile(scope.row)"
>详情</el-button>
<el-button
size="mini"
size="small"
icon="edit"
type="text"
@click="updateSysDictionaryFunc(scope.row)"
......@@ -102,13 +102,13 @@
<p>确定要删除吗?</p>
<div style="text-align: right; margin-top: 8px">
<el-button
size="mini"
size="small"
type="text"
@click="scope.row.visible = false"
>取消</el-button>
<el-button
type="primary"
size="mini"
size="small"
@click="deleteSysDictionaryFunc(scope.row)"
>确定</el-button>
</div>
......@@ -116,8 +116,9 @@
<el-button
type="text"
icon="delete"
size="mini"
size="small"
style="margin-left: 10px"
@click="scope.row.visible = true"
>删除</el-button>
</template>
</el-popover>
......
......@@ -15,14 +15,14 @@
</el-select>
</el-form-item>
<el-form-item>
<el-button size="mini" type="primary" icon="search" @click="onSubmit">查询</el-button>
<el-button size="mini" icon="refresh" @click="onReset">重置</el-button>
<el-button size="small" type="primary" icon="search" @click="onSubmit">查询</el-button>
<el-button size="small" icon="refresh" @click="onReset">重置</el-button>
</el-form-item>
</el-form>
</div>
<div class="gva-table-box">
<div class="gva-btn-list">
<el-button size="mini" type="primary" icon="plus" @click="openDialog">新增字典项</el-button>
<el-button size="small" type="primary" icon="plus" @click="openDialog">新增字典项</el-button>
</div>
<el-table
ref="multipleTable"
......@@ -52,11 +52,11 @@
<el-popover v-model:visible="scope.row.visible" placement="top" width="160">
<p>确定要删除吗?</p>
<div style="text-align: right; margin-top: 8px;">
<el-button size="mini" type="text" @click="scope.row.visible = false">取消</el-button>
<el-button type="primary" size="mini" @click="deleteSysDictionaryDetailFunc(scope.row)">确定</el-button>
<el-button size="small" type="text" @click="scope.row.visible = false">取消</el-button>
<el-button type="primary" size="small" @click="deleteSysDictionaryDetailFunc(scope.row)">确定</el-button>
</div>
<template #reference>
<el-button type="text" icon="delete" size="mini">删除</el-button>
<el-button type="text" icon="delete" size="small" @click="scope.row.visible = true">删除</el-button>
</template>
</el-popover>
</template>
......
......@@ -2,7 +2,7 @@
<div>
<div class="gva-table-box">
<div class="gva-btn-list">
<el-button size="mini" type="primary" icon="plus" @click="addMenu('0')">新增根菜单</el-button>
<el-button size="small" type="primary" icon="plus" @click="addMenu('0')">新增根菜单</el-button>
</div>
<!-- 由于此处菜单跟左侧列表一一对应所以不需要分页 pageSize默认999 -->
......@@ -36,19 +36,19 @@
<el-table-column align="left" fixed="right" label="操作" width="300">
<template #default="scope">
<el-button
size="mini"
size="small"
type="text"
icon="plus"
@click="addMenu(scope.row.ID)"
>添加子菜单</el-button>
<el-button
size="mini"
size="small"
type="text"
icon="edit"
@click="editMenu(scope.row.ID)"
>编辑</el-button>
<el-button
size="mini"
size="small"
type="text"
icon="delete"
@click="deleteMenu(scope.row.ID)"
......@@ -110,7 +110,7 @@
</el-form-item>
<el-form-item label="文件路径" prop="component" style="width:60%">
<el-input v-model="form.component" autocomplete="off" />
<span style="font-size:12px;margin-right:12px;">如果菜单包含子菜单,请创建router-view二级路由页面或者</span><el-button size="mini" @click="form.component = 'view/routerHolder.vue'">点我设置</el-button>
<span style="font-size:12px;margin-right:12px;">如果菜单包含子菜单,请创建router-view二级路由页面或者</span><el-button style="margin-top:4px" size="small" @click="form.component = 'view/routerHolder.vue'">点我设置</el-button>
</el-form-item>
<el-form-item label="展示名称" prop="meta.title" style="width:30%">
<el-input v-model="form.meta.title" autocomplete="off" />
......
......@@ -12,8 +12,8 @@
<el-input v-model="searchInfo.status" placeholder="搜索条件" />
</el-form-item>
<el-form-item>
<el-button size="mini" type="primary" icon="search" @click="onSubmit">查询</el-button>
<el-button size="mini" icon="refresh" @click="onReset">重置</el-button>
<el-button size="small" type="primary" icon="search" @click="onSubmit">查询</el-button>
<el-button size="small" icon="refresh" @click="onReset">重置</el-button>
</el-form-item>
</el-form>
</div>
......@@ -23,11 +23,11 @@
<el-popover v-model:visible="deleteVisible" placement="top" width="160">
<p>确定要删除吗?</p>
<div style="text-align: right; margin-top: 8px;">
<el-button size="mini" type="text" @click="deleteVisible = false">取消</el-button>
<el-button size="mini" type="primary" @click="onDelete">确定</el-button>
<el-button size="small" type="text" @click="deleteVisible = false">取消</el-button>
<el-button size="small" type="primary" @click="onDelete">确定</el-button>
</div>
<template #reference>
<el-button icon="delete" size="mini" style="margin-left: 10px;" :disabled="!multipleSelection.length">删除</el-button>
<el-button icon="delete" size="small" style="margin-left: 10px;" :disabled="!multipleSelection.length">删除</el-button>
</template>
</el-popover>
</div>
......@@ -94,11 +94,11 @@
<el-popover v-model:visible="scope.row.visible" placement="top" width="160">
<p>确定要删除吗?</p>
<div style="text-align: right; margin-top: 8px;">
<el-button size="mini" type="text" @click="scope.row.visible = false">取消</el-button>
<el-button size="mini" type="primary" @click="deleteSysOperationRecordFunc(scope.row)">确定</el-button>
<el-button size="small" type="text" @click="scope.row.visible = false">取消</el-button>
<el-button size="small" type="primary" @click="deleteSysOperationRecordFunc(scope.row)">确定</el-button>
</div>
<template #reference>
<el-button icon="delete" size="mini" type="text">删除</el-button>
<el-button icon="delete" size="small" type="text" @click="scope.row.visible = true">删除</el-button>
</template>
</el-popover>
</template>
......
......@@ -3,35 +3,23 @@
<warning-bar title="注:右上角头像下拉可切换角色" />
<div class="gva-table-box">
<div class="gva-btn-list">
<el-button size="mini" type="primary" icon="plus" @click="addUser">新增用户</el-button>
<el-button size="small" type="primary" icon="plus" @click="addUser">新增用户</el-button>
</div>
<el-table :data="tableData">
<el-table-column align="left" label="头像" min-width="50">
<el-table
:data="tableData"
row-key="ID"
>
<el-table-column align="left" label="头像" min-width="75">
<template #default="scope">
<CustomPic style="margin-top:8px" :pic-src="scope.row.headerImg" />
</template>
</el-table-column>
<el-table-column align="left" label="UUID" min-width="250" prop="uuid" />
<el-table-column align="left" label="ID" min-width="50" prop="ID" />
<el-table-column align="left" label="用户名" min-width="150" prop="userName" />
<el-table-column align="left" label="昵称" min-width="100" prop="nickName">
<template #default="scope">
<p v-if="!scope.row.editFlag" class="nickName">{{ scope.row.nickName }}
<el-icon class="pointer" color="#66b1ff" @click="openEidt(scope.row)">
<edit />
</el-icon>
</p>
<p v-if="scope.row.editFlag" class="nickName">
<el-input v-model="scope.row.nickName" />
<el-icon class="pointer" color="#67c23a" @click="enterEdit(scope.row)">
<check />
</el-icon>
<el-icon class="pointer" color="#f23c3c" @click="closeEdit(scope.row)">
<close />
</el-icon>
</p>
</template>
</el-table-column>
<el-table-column align="left" label="用户角色" min-width="150">
<el-table-column align="left" label="昵称" min-width="150" prop="nickName" />
<el-table-column align="left" label="手机号" min-width="180" prop="phone" />
<el-table-column align="left" label="邮箱" min-width="180" prop="email" />
<el-table-column align="left" label="用户角色" min-width="200">
<template #default="scope">
<el-cascader
v-model="scope.row.authorityIds"
......@@ -45,21 +33,24 @@
/>
</template>
</el-table-column>
<el-table-column align="left" label="操作" min-width="150">
<el-table-column label="操作" min-width="250" fixed="right">
<template #default="scope">
<el-popover v-model:visible="scope.row.visible" placement="top" width="160">
<p>确定要删除此用户吗</p>
<div style="text-align: right; margin-top: 8px;">
<el-button size="mini" type="text" @click="scope.row.visible = false">取消</el-button>
<el-button type="primary" size="mini" @click="deleteUserFunc(scope.row)">确定</el-button>
<el-button size="small" type="text" @click="scope.row.visible = false">取消</el-button>
<el-button type="primary" size="small" @click="deleteUserFunc(scope.row)">确定</el-button>
</div>
<template #reference>
<el-button type="text" icon="delete" size="mini">删除</el-button>
<el-button type="text" icon="delete" size="small">删除</el-button>
</template>
</el-popover>
<el-button type="text" icon="magic-stick" size="mini" @click="resetPasswordFunc(scope.row)">重置密码</el-button>
<el-button type="text" icon="edit" size="small" @click="openEdit(scope.row)">编辑</el-button>
<el-button type="text" icon="magic-stick" size="small" @click="resetPasswordFunc(scope.row)">重置密码</el-button>
</template>
</el-table-column>
</el-table>
<div class="gva-pagination">
<el-pagination
......@@ -73,35 +64,52 @@
/>
</div>
</div>
<el-dialog v-model="addUserDialog" custom-class="user-dialog" title="新增用户">
<el-form ref="userForm" :rules="rules" :model="userInfo" label-width="80px">
<el-form-item label="用户名" prop="username">
<el-input v-model="userInfo.username" />
</el-form-item>
<el-form-item label="密码" prop="password">
<el-input v-model="userInfo.password" />
</el-form-item>
<el-form-item label="别名" prop="nickName">
<el-input v-model="userInfo.nickName" />
</el-form-item>
<el-form-item label="用户角色" prop="authorityId">
<el-cascader
v-model="userInfo.authorityIds"
style="width:100%"
:options="authOptions"
:show-all-levels="false"
:props="{ multiple:true,checkStrictly: true,label:'authorityName',value:'authorityId',disabled:'disabled',emitPath:false}"
:clearable="false"
/>
</el-form-item>
<el-form-item label="头像" label-width="80px">
<div style="display:inline-block" @click="openHeaderChange">
<img v-if="userInfo.headerImg" class="header-img-box" :src="(userInfo.headerImg && userInfo.headerImg.slice(0, 4) !== 'http')?path+userInfo.headerImg:userInfo.headerImg">
<div v-else class="header-img-box">从媒体库选择</div>
</div>
</el-form-item>
<el-dialog
v-model="addUserDialog"
custom-class="user-dialog"
title="用户"
:show-close="false"
:close-on-press-escape="false"
:close-on-click-modal="false"
>
<div style="height:60vh;overflow:auto;padding:0 12px;">
<el-form ref="userForm" :rules="rules" :model="userInfo" label-width="80px">
<el-form-item v-if="dialogFlag === 'add'" label="用户名" prop="userName">
<el-input v-model="userInfo.userName" />
</el-form-item>
<el-form-item v-if="dialogFlag === 'add'" label="密码" prop="password">
<el-input v-model="userInfo.password" />
</el-form-item>
<el-form-item label="昵称" prop="nickName">
<el-input v-model="userInfo.nickName" />
</el-form-item>
<el-form-item label="手机号" prop="phone">
<el-input v-model="userInfo.phone" />
</el-form-item>
<el-form-item label="邮箱" prop="email">
<el-input v-model="userInfo.email" />
</el-form-item>
<el-form-item label="用户角色" prop="authorityId">
<el-cascader
v-model="userInfo.authorityIds"
style="width:100%"
:options="authOptions"
:show-all-levels="false"
:props="{ multiple:true,checkStrictly: true,label:'authorityName',value:'authorityId',disabled:'disabled',emitPath:false}"
:clearable="false"
/>
</el-form-item>
<el-form-item label="头像" label-width="80px">
<div style="display:inline-block" @click="openHeaderChange">
<img v-if="userInfo.headerImg" class="header-img-box" :src="(userInfo.headerImg && userInfo.headerImg.slice(0, 4) !== 'http')?path+userInfo.headerImg:userInfo.headerImg">
<div v-else class="header-img-box">从媒体库选择</div>
</div>
</el-form-item>
</el-form>
</div>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button size="small" @click="closeAddUserDialog">取 消</el-button>
......@@ -120,6 +128,7 @@ export default {
</script>
<script setup>
import {
getUserList,
setUserAuthorities,
......@@ -242,40 +251,12 @@ const setOptions = (authData) => {
setAuthorityOptions(authData, authOptions.value)
}
const backNickName = ref('')
const openEidt = (row) => {
if (tableData.value.some(item => item.editFlag)) {
ElMessage('当前存在正在编辑的用户')
return
}
backNickName.value = row.nickName
row.editFlag = true
}
const enterEdit = async(row) => {
const res = await setUserInfo({ nickName: row.nickName, ID: row.ID })
if (res.code === 0) {
ElMessage({
type: 'success',
message: '设置成功'
})
}
backNickName.value = ref('')
row.editFlag = false
}
const closeEdit = (row) => {
row.nickName = backNickName.value
backNickName.value = ''
row.editFlag = false
}
const deleteUserFunc = async(row) => {
const res = await deleteUser({ id: row.ID })
if (res.code === 0) {
ElMessage.success('删除成功')
await getTableData()
row.visible = false
await getTableData()
}
}
......@@ -286,11 +267,11 @@ const userInfo = ref({
nickName: '',
headerImg: '',
authorityId: '',
authorityIds: []
authorityIds: [],
})
const rules = ref({
username: [
userName: [
{ required: true, message: '请输入用户名', trigger: 'blur' },
{ min: 5, message: '最低5位字符', trigger: 'blur' }
],
......@@ -310,12 +291,25 @@ const enterAddUserDialog = async() => {
userInfo.value.authorityId = userInfo.value.authorityIds[0]
userForm.value.validate(async valid => {
if (valid) {
const res = await register(userInfo.value)
if (res.code === 0) {
ElMessage({ type: 'success', message: '创建成功' })
const req = {
...userInfo.value
}
if (dialogFlag.value === 'add') {
const res = await register(req)
if (res.code === 0) {
ElMessage({ type: 'success', message: '创建成功' })
await getTableData()
closeAddUserDialog()
}
}
if (dialogFlag.value === 'edit') {
const res = await setUserInfo(req)
if (res.code === 0) {
ElMessage({ type: 'success', message: '编辑成功' })
await getTableData()
closeAddUserDialog()
}
}
await getTableData()
closeAddUserDialog()
}
})
}
......@@ -327,7 +321,11 @@ const closeAddUserDialog = () => {
userInfo.value.authorityIds = []
addUserDialog.value = false
}
const dialogFlag = ref('add')
const addUser = () => {
dialogFlag.value = 'add'
addUserDialog.value = true
}
const changeAuthority = async(row, flag) => {
......@@ -344,6 +342,13 @@ const changeAuthority = async(row, flag) => {
ElMessage({ type: 'success', message: '角色设置成功' })
}
}
const openEdit = (row) => {
dialogFlag.value = 'edit'
userInfo.value = JSON.parse(JSON.stringify(row))
addUserDialog.value = true
}
</script>
<style lang="scss">
......
......@@ -10,7 +10,7 @@
>
<el-form-item label="Field名称" prop="fieldName">
<el-input v-model="middleDate.fieldName" autocomplete="off" style="width:80%" />
<el-button size="mini" style="width:18%;margin-left:2%" @click="autoFill">自动填充</el-button>
<el-button size="small" style="width:18%;margin-left:2%" @click="autoFill">自动填充</el-button>
</el-form-item>
<el-form-item label="Field中文名" prop="fieldDesc">
<el-input v-model="middleDate.fieldDesc" autocomplete="off" />
......
......@@ -39,7 +39,7 @@
</el-select>
</el-form-item>
<el-form-item>
<el-button size="mini" type="primary" @click="getColumnFunc">使用此表创建</el-button>
<el-button size="small" type="primary" @click="getColumnFunc">使用此表创建</el-button>
</el-form-item>
</el-form>
</el-collapse-item>
......@@ -84,7 +84,7 @@
<!-- 组件列表 -->
<div class="gva-table-box">
<div class="gva-btn-list">
<el-button size="mini" type="primary" @click="editAndAddField()">新增Field</el-button>
<el-button size="small" type="primary" @click="editAndAddField()">新增Field</el-button>
</div>
<el-table :data="form.fields">
<el-table-column align="left" type="index" label="序列" width="100" />
......@@ -100,19 +100,19 @@
<el-table-column align="left" label="操作" width="300">
<template #default="scope">
<el-button
size="mini"
size="small"
type="text"
icon="edit"
@click="editAndAddField(scope.row)"
>编辑</el-button>
<el-button
size="mini"
size="small"
type="text"
:disabled="scope.$index === 0"
@click="moveUpField(scope.$index)"
>上移</el-button>
<el-button
size="mini"
size="small"
type="text"
:disabled="(scope.$index + 1) === form.fields.length"
@click="moveDownField(scope.$index)"
......@@ -120,11 +120,11 @@
<el-popover v-model:visible="scope.row.visible" placement="top">
<p>确定删除吗?</p>
<div style="text-align: right; margin-top: 8px;">
<el-button size="mini" type="text" @click="scope.row.visible = false">取消</el-button>
<el-button type="primary" size="mini" @click="deleteField(scope.$index)">确定</el-button>
<el-button size="small" type="text" @click="scope.row.visible = false">取消</el-button>
<el-button type="primary" size="small" @click="deleteField(scope.$index)">确定</el-button>
</div>
<template #reference>
<el-button size="mini" type="text" icon="delete">删除</el-button>
<el-button size="small" type="text" icon="delete" @click="scope.row.visible = true">删除</el-button>
</template>
</el-popover>
</template>
......@@ -132,8 +132,8 @@
</el-table>
<!-- 组件列表 -->
<div class="gva-btn-list justify-content-flex-end auto-btn-list">
<el-button size="mini" type="primary" @click="enterForm(true)">预览代码</el-button>
<el-button size="mini" type="primary" @click="enterForm(false)">生成代码</el-button>
<el-button size="small" type="primary" @click="enterForm(true)">预览代码</el-button>
<el-button size="small" type="primary" @click="enterForm(false)">生成代码</el-button>
</div>
</div>
<!-- 组件弹窗 -->
......@@ -141,8 +141,8 @@
<FieldDialog v-if="dialogFlag" ref="fieldDialogNode" :dialog-middle="dialogMiddle" />
<template #footer>
<div class="dialog-footer">
<el-button size="mini" @click="closeDialog">取 消</el-button>
<el-button size="mini" type="primary" @click="enterDialog">确 定</el-button>
<el-button size="small" @click="closeDialog">取 消</el-button>
<el-button size="small" type="primary" @click="enterDialog">确 定</el-button>
</div>
</template>
</el-dialog>
......@@ -151,8 +151,8 @@
<template #title>
<div class="previewCodeTool">
<p>操作栏:</p>
<el-button size="mini" type="primary" @click="selectText">全选</el-button>
<el-button size="mini" type="primary" @click="copy">复制</el-button>
<el-button size="small" type="primary" @click="selectText">全选</el-button>
<el-button size="small" type="primary" @click="copy">复制</el-button>
</div>
</template>
<PreviewCodeDialog v-if="previewFlag" ref="previewNode" :preview-code="preViewCode" />
......
......@@ -2,7 +2,7 @@
<div>
<div class="gva-table-box">
<div class="gva-btn-list">
<el-button size="mini" type="primary" icon="plus" @click="goAutoCode(null)">新增</el-button>
<el-button size="small" type="primary" icon="plus" @click="goAutoCode(null)">新增</el-button>
</div>
<el-table :data="tableData">
<el-table-column
......@@ -21,14 +21,14 @@
<el-tag
v-if="scope.row.flag"
type="danger"
size="mini"
size="small"
effect="dark"
>
已回滚
</el-tag>
<el-tag
v-else
size="mini"
size="small"
type="success"
effect="dark"
>
......@@ -39,9 +39,9 @@
<el-table-column align="left" label="操作" min-width="180">
<template #default="scope">
<div>
<el-button size="mini" type="text" :disabled="scope.row.flag === 1" @click="rollbackFunc(scope.row)">回滚</el-button>
<el-button size="mini" type="text" @click="goAutoCode(scope.row)">复用</el-button>
<el-button size="mini" type="text" @click="deleteRow(scope.row)">删除</el-button>
<el-button size="small" type="text" :disabled="scope.row.flag === 1" @click="rollbackFunc(scope.row)">回滚</el-button>
<el-button size="small" type="text" @click="goAutoCode(scope.row)">复用</el-button>
<el-button size="small" type="text" @click="deleteRow(scope.row)">删除</el-button>
</div>
</template>
</el-table-column>
......
......@@ -333,8 +333,8 @@
</el-collapse>
</el-form>
<div class="gva-btn-list">
<el-button type="primary" size="mini" @click="update">立即更新</el-button>
<el-button type="primary" size="mini" @click="reload">重启服务(开发中)</el-button>
<el-button type="primary" size="small" @click="update">立即更新</el-button>
<el-button type="primary" size="small" @click="reload">重启服务(开发中)</el-button>
</div>
</div>
</template>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册