更新
This commit is contained in:
9
src/api/equipment/list.js
Normal file
9
src/api/equipment/list.js
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
import service from '@/utils/request'
|
||||||
|
|
||||||
|
export const resetPassword = (data) => {
|
||||||
|
return service({
|
||||||
|
url: '/user/resetPassword',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
BIN
src/assets/new-background.jpg
Normal file
BIN
src/assets/new-background.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 722 KiB |
@@ -6,7 +6,7 @@ import packageInfo from '../../package.json'
|
|||||||
const greenText = (text) => `\x1b[32m${text}\x1b[0m`
|
const greenText = (text) => `\x1b[32m${text}\x1b[0m`
|
||||||
|
|
||||||
export const config = {
|
export const config = {
|
||||||
appName: 'Gin-Vue-Admin',
|
appName: '智慧用电管理系统',
|
||||||
showViteLogo: true,
|
showViteLogo: true,
|
||||||
KeepAliveTabs: true,
|
KeepAliveTabs: true,
|
||||||
logs: []
|
logs: []
|
||||||
@@ -14,41 +14,6 @@ export const config = {
|
|||||||
|
|
||||||
export const viteLogo = (env) => {
|
export const viteLogo = (env) => {
|
||||||
if (config.showViteLogo) {
|
if (config.showViteLogo) {
|
||||||
console.log(
|
|
||||||
greenText(
|
|
||||||
`> 欢迎使用Gin-Vue-Admin,开源地址:https://github.com/flipped-aurora/gin-vue-admin`
|
|
||||||
)
|
|
||||||
)
|
|
||||||
console.log(greenText(`> 当前版本:v${packageInfo.version}`))
|
|
||||||
console.log(greenText(`> 加群方式:微信:shouzi_1994 QQ群:470239250`))
|
|
||||||
console.log(
|
|
||||||
greenText(`> 项目地址:https://github.com/flipped-aurora/gin-vue-admin`)
|
|
||||||
)
|
|
||||||
console.log(greenText(`> 插件市场:https://plugin.gin-vue-admin.com`))
|
|
||||||
console.log(
|
|
||||||
greenText(`> GVA讨论社区:https://support.qq.com/products/371961`)
|
|
||||||
)
|
|
||||||
console.log(
|
|
||||||
greenText(
|
|
||||||
`> 默认自动化文档地址:http://127.0.0.1:${env.VITE_SERVER_PORT}/swagger/index.html`
|
|
||||||
)
|
|
||||||
)
|
|
||||||
console.log(
|
|
||||||
greenText(`> 默认前端文件运行地址:http://127.0.0.1:${env.VITE_CLI_PORT}`)
|
|
||||||
)
|
|
||||||
console.log(
|
|
||||||
greenText(
|
|
||||||
`--------------------------------------版权声明--------------------------------------`
|
|
||||||
)
|
|
||||||
)
|
|
||||||
console.log(greenText(`** 版权所有方:flipped-aurora开源团队 **`))
|
|
||||||
console.log(greenText(`** 版权持有公司:北京翻转极光科技有限责任公司 **`))
|
|
||||||
console.log(
|
|
||||||
greenText(
|
|
||||||
`** 剔除授权标识需购买商用授权:https://gin-vue-admin.com/empower/index.html **`
|
|
||||||
)
|
|
||||||
)
|
|
||||||
console.log('\n')
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
"/src/view/dashboard/components/table.vue": "Table",
|
"/src/view/dashboard/components/table.vue": "Table",
|
||||||
"/src/view/dashboard/components/wiki.vue": "Wiki",
|
"/src/view/dashboard/components/wiki.vue": "Wiki",
|
||||||
"/src/view/dashboard/index.vue": "Dashboard",
|
"/src/view/dashboard/index.vue": "Dashboard",
|
||||||
|
"/src/view/equipment/list/index.vue": "User",
|
||||||
"/src/view/error/index.vue": "Error",
|
"/src/view/error/index.vue": "Error",
|
||||||
"/src/view/error/reload.vue": "Reload",
|
"/src/view/error/reload.vue": "Reload",
|
||||||
"/src/view/example/breakpoint/breakpoint.vue": "BreakPoint",
|
"/src/view/example/breakpoint/breakpoint.vue": "BreakPoint",
|
||||||
|
|||||||
@@ -115,16 +115,16 @@ const setupRouter = async (userStore) => {
|
|||||||
// 扁平化:将 layout.children 与其余顶层异步路由一并作为二级子路由注册到 layout 下
|
// 扁平化:将 layout.children 与其余顶层异步路由一并作为二级子路由注册到 layout 下
|
||||||
const toRegister = []
|
const toRegister = []
|
||||||
if (layoutRoute?.children?.length) {
|
if (layoutRoute?.children?.length) {
|
||||||
layoutRoute.children.unshift({
|
// layoutRoute.children.unshift({
|
||||||
path: '/largeScreen2',
|
// path: '/largeScreen2',
|
||||||
name: 'largeScreen2',
|
// name: 'largeScreen2',
|
||||||
meta: {
|
// meta: {
|
||||||
title: '数据大屏',
|
// title: '数据大屏',
|
||||||
icon: 'data-analysis',
|
// icon: 'data-analysis',
|
||||||
defaultMenu: true
|
// defaultMenu: true
|
||||||
},
|
// },
|
||||||
component: () => import('@/view/largeScreen2/index.vue')
|
// component: () => import('@/view/largeScreen2/index.vue')
|
||||||
})
|
// })
|
||||||
toRegister.push(...layoutRoute.children)
|
toRegister.push(...layoutRoute.children)
|
||||||
}
|
}
|
||||||
if (baseRouters.length > 1) {
|
if (baseRouters.length > 1) {
|
||||||
|
|||||||
103
src/view/equipment/list/index.vue
Normal file
103
src/view/equipment/list/index.vue
Normal file
@@ -0,0 +1,103 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<!-- <warning-bar title="注:右上角头像下拉可切换角色" /> -->
|
||||||
|
<div class="gva-search-box">
|
||||||
|
<el-form ref="searchForm" :inline="true" :model="searchInfo">
|
||||||
|
<el-form-item label="用户名">
|
||||||
|
<el-input v-model="searchInfo.username" placeholder="用户名" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="昵称">
|
||||||
|
<el-input v-model="searchInfo.nickname" placeholder="昵称" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="search" @click="onSubmit"> 查询 </el-button>
|
||||||
|
<el-button icon="refresh" @click="onReset"> 重置 </el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
<div class="gva-table-box">
|
||||||
|
<div class="gva-btn-list">
|
||||||
|
<el-button type="primary" icon="plus" @click="addUser">新增用户</el-button>
|
||||||
|
</div>
|
||||||
|
<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="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="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 label="操作" :min-width="appStore.operateMinWith" fixed="right">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button type="primary" link icon="delete" @click="deleteUserFunc(scope.row)">删除</el-button>
|
||||||
|
<el-button type="primary" link icon="edit" @click="openEdit(scope.row)">编辑</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<div class="gva-pagination">
|
||||||
|
<el-pagination
|
||||||
|
:current-page="page"
|
||||||
|
:page-size="pageSize"
|
||||||
|
:page-sizes="[10, 30, 50, 100]"
|
||||||
|
:total="total"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
@current-change="handleCurrentChange"
|
||||||
|
@size-change="handleSizeChange"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { getUserList, setUserAuthorities, register, deleteUser } from '@/api/user'
|
||||||
|
|
||||||
|
import { getAuthorityList } from '@/api/authority'
|
||||||
|
import CustomPic from '@/components/customPic/index.vue'
|
||||||
|
import WarningBar from '@/components/warningBar/warningBar.vue'
|
||||||
|
import { setUserInfo, resetPassword } from '@/api/user.js'
|
||||||
|
|
||||||
|
import { nextTick, ref, watch } from 'vue'
|
||||||
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
|
import SelectImage from '@/components/selectImage/selectImage.vue'
|
||||||
|
import { useAppStore } from '@/pinia'
|
||||||
|
|
||||||
|
defineOptions({
|
||||||
|
name: 'User'
|
||||||
|
})
|
||||||
|
|
||||||
|
const appStore = useAppStore()
|
||||||
|
|
||||||
|
const searchInfo = ref({
|
||||||
|
username: '',
|
||||||
|
nickname: '',
|
||||||
|
phone: '',
|
||||||
|
email: ''
|
||||||
|
})
|
||||||
|
|
||||||
|
const onSubmit = () => {
|
||||||
|
page.value = 1
|
||||||
|
getTableData()
|
||||||
|
}
|
||||||
|
|
||||||
|
const onReset = () => {
|
||||||
|
searchInfo.value = {
|
||||||
|
username: '',
|
||||||
|
nickname: '',
|
||||||
|
phone: '',
|
||||||
|
email: ''
|
||||||
|
}
|
||||||
|
getTableData()
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
.header-img-box {
|
||||||
|
@apply w-52 h-52 border border-solid border-gray-300 rounded-xl flex justify-center items-center cursor-pointer;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -4,24 +4,17 @@
|
|||||||
class="rounded-lg flex items-center justify-evenly w-full h-full md:w-screen md:h-screen md:bg-[#194bfb] bg-white"
|
class="rounded-lg flex items-center justify-evenly w-full h-full md:w-screen md:h-screen md:bg-[#194bfb] bg-white"
|
||||||
>
|
>
|
||||||
<div class="md:w-3/5 w-10/12 h-full flex items-center justify-evenly">
|
<div class="md:w-3/5 w-10/12 h-full flex items-center justify-evenly">
|
||||||
<div
|
<div class="oblique h-[130%] w-3/5 bg-white dark:bg-slate-900 transform -rotate-12 absolute -ml-52" />
|
||||||
class="oblique h-[130%] w-3/5 bg-white dark:bg-slate-900 transform -rotate-12 absolute -ml-52"
|
|
||||||
/>
|
|
||||||
<!-- 分割斜块 -->
|
<!-- 分割斜块 -->
|
||||||
<div
|
<div class="z-[999] pt-12 pb-10 md:w-96 w-full rounded-lg flex flex-col justify-between box-border">
|
||||||
class="z-[999] pt-12 pb-10 md:w-96 w-full rounded-lg flex flex-col justify-between box-border"
|
|
||||||
>
|
|
||||||
<div>
|
<div>
|
||||||
<div class="flex items-center justify-center">
|
<!-- <div class="flex items-center justify-center">
|
||||||
<Logo :size="6" />
|
<Logo :size="6" />
|
||||||
</div>
|
</div> -->
|
||||||
<div class="mb-9">
|
<div class="mb-9">
|
||||||
<p class="text-center text-4xl font-bold">
|
<p class="text-center text-4xl font-bold">
|
||||||
{{ $GIN_VUE_ADMIN.appName }}
|
{{ $GIN_VUE_ADMIN.appName }}
|
||||||
</p>
|
</p>
|
||||||
<p class="text-center text-sm font-normal text-gray-500 mt-2.5">
|
|
||||||
A management platform using Golang and Vue
|
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
<el-form
|
<el-form
|
||||||
ref="loginForm"
|
ref="loginForm"
|
||||||
@@ -31,12 +24,7 @@
|
|||||||
@keyup.enter="submitForm"
|
@keyup.enter="submitForm"
|
||||||
>
|
>
|
||||||
<el-form-item prop="username" class="mb-6">
|
<el-form-item prop="username" class="mb-6">
|
||||||
<el-input
|
<el-input v-model="loginFormData.username" size="large" placeholder="请输入用户名" suffix-icon="user" />
|
||||||
v-model="loginFormData.username"
|
|
||||||
size="large"
|
|
||||||
placeholder="请输入用户名"
|
|
||||||
suffix-icon="user"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item prop="password" class="mb-6">
|
<el-form-item prop="password" class="mb-6">
|
||||||
<el-input
|
<el-input
|
||||||
@@ -47,11 +35,7 @@
|
|||||||
placeholder="请输入密码"
|
placeholder="请输入密码"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item v-if="loginFormData.openCaptcha" prop="captcha" class="mb-6">
|
||||||
v-if="loginFormData.openCaptcha"
|
|
||||||
prop="captcha"
|
|
||||||
class="mb-6"
|
|
||||||
>
|
|
||||||
<div class="flex w-full justify-between">
|
<div class="flex w-full justify-between">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="loginFormData.captcha"
|
v-model="loginFormData.captcha"
|
||||||
@@ -71,15 +55,11 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item class="mb-6">
|
<el-form-item class="mb-6">
|
||||||
<el-button
|
<el-button class="shadow shadow-active h-11 w-full" type="primary" size="large" @click="submitForm"
|
||||||
class="shadow shadow-active h-11 w-full"
|
|
||||||
type="primary"
|
|
||||||
size="large"
|
|
||||||
@click="submitForm"
|
|
||||||
>登 录</el-button
|
>登 录</el-button
|
||||||
>
|
>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item class="mb-6">
|
<!-- <el-form-item class="mb-6">
|
||||||
<el-button
|
<el-button
|
||||||
class="shadow shadow-active h-11 w-full"
|
class="shadow shadow-active h-11 w-full"
|
||||||
type="primary"
|
type="primary"
|
||||||
@@ -87,21 +67,17 @@
|
|||||||
@click="checkInit"
|
@click="checkInit"
|
||||||
>前往初始化</el-button
|
>前往初始化</el-button
|
||||||
>
|
>
|
||||||
</el-form-item>
|
</el-form-item> -->
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="hidden md:block w-1/2 h-full float-right bg-[#194bfb]">
|
<div class="hidden md:block w-1/2 h-full float-right bg-[#194bfb]">
|
||||||
<img
|
<img class="h-full" src="@/assets/new-background.jpg" alt="banner" />
|
||||||
class="h-full"
|
|
||||||
src="@/assets/login_right_banner.jpg"
|
|
||||||
alt="banner"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<BottomInfo class="left-0 right-0 absolute bottom-3 mx-auto w-full z-20">
|
<!-- <BottomInfo class="left-0 right-0 absolute bottom-3 mx-auto w-full z-20">
|
||||||
<div class="links items-center justify-center gap-2 hidden md:flex">
|
<div class="links items-center justify-center gap-2 hidden md:flex">
|
||||||
<a href="https://www.gin-vue-admin.com/" target="_blank">
|
<a href="https://www.gin-vue-admin.com/" target="_blank">
|
||||||
<img src="@/assets/docs.png" class="w-8 h-8" alt="文档" />
|
<img src="@/assets/docs.png" class="w-8 h-8" alt="文档" />
|
||||||
@@ -109,17 +85,14 @@
|
|||||||
<a href="https://support.qq.com/product/371961" target="_blank">
|
<a href="https://support.qq.com/product/371961" target="_blank">
|
||||||
<img src="@/assets/kefu.png" class="w-8 h-8" alt="客服" />
|
<img src="@/assets/kefu.png" class="w-8 h-8" alt="客服" />
|
||||||
</a>
|
</a>
|
||||||
<a
|
<a href="https://github.com/flipped-aurora/gin-vue-admin" target="_blank">
|
||||||
href="https://github.com/flipped-aurora/gin-vue-admin"
|
|
||||||
target="_blank"
|
|
||||||
>
|
|
||||||
<img src="@/assets/github.png" class="w-8 h-8" alt="github" />
|
<img src="@/assets/github.png" class="w-8 h-8" alt="github" />
|
||||||
</a>
|
</a>
|
||||||
<a href="https://space.bilibili.com/322210472" target="_blank">
|
<a href="https://space.bilibili.com/322210472" target="_blank">
|
||||||
<img src="@/assets/video.png" class="w-8 h-8" alt="视频站" />
|
<img src="@/assets/video.png" class="w-8 h-8" alt="视频站" />
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</BottomInfo>
|
</BottomInfo> -->
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -166,9 +139,7 @@
|
|||||||
return callback(new Error('验证码须为数字'))
|
return callback(new Error('验证码须为数字'))
|
||||||
}
|
}
|
||||||
if (sanitizedValue.length < captchaRequiredLength.value) {
|
if (sanitizedValue.length < captchaRequiredLength.value) {
|
||||||
return callback(
|
return callback(new Error(`请输入至少${captchaRequiredLength.value}位数字验证码`))
|
||||||
new Error(`请输入至少${captchaRequiredLength.value}位数字验证码`)
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
if (sanitizedValue !== value) {
|
if (sanitizedValue !== value) {
|
||||||
loginFormData.captcha = sanitizedValue
|
loginFormData.captcha = sanitizedValue
|
||||||
|
|||||||
@@ -16,18 +16,14 @@
|
|||||||
<el-input v-model="searchInfo.email" placeholder="邮箱" />
|
<el-input v-model="searchInfo.email" placeholder="邮箱" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="search" @click="onSubmit">
|
<el-button type="primary" icon="search" @click="onSubmit"> 查询 </el-button>
|
||||||
查询
|
|
||||||
</el-button>
|
|
||||||
<el-button icon="refresh" @click="onReset"> 重置 </el-button>
|
<el-button icon="refresh" @click="onReset"> 重置 </el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
<div class="gva-table-box">
|
<div class="gva-table-box">
|
||||||
<div class="gva-btn-list">
|
<div class="gva-btn-list">
|
||||||
<el-button type="primary" icon="plus" @click="addUser"
|
<el-button type="primary" icon="plus" @click="addUser">新增用户</el-button>
|
||||||
>新增用户</el-button
|
|
||||||
>
|
|
||||||
</div>
|
</div>
|
||||||
<el-table :data="tableData" row-key="ID">
|
<el-table :data="tableData" row-key="ID">
|
||||||
<el-table-column align="left" label="头像" min-width="75">
|
<el-table-column align="left" label="头像" min-width="75">
|
||||||
@@ -36,30 +32,10 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="left" label="ID" min-width="50" prop="ID" />
|
<el-table-column align="left" label="ID" min-width="50" prop="ID" />
|
||||||
<el-table-column
|
<el-table-column align="left" label="用户名" min-width="150" prop="userName" />
|
||||||
align="left"
|
<el-table-column align="left" label="昵称" min-width="150" prop="nickName" />
|
||||||
label="用户名"
|
<el-table-column align="left" label="手机号" min-width="180" prop="phone" />
|
||||||
min-width="150"
|
<el-table-column align="left" label="邮箱" min-width="180" prop="email" />
|
||||||
prop="userName"
|
|
||||||
/>
|
|
||||||
<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">
|
<el-table-column align="left" label="用户角色" min-width="200">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-cascader
|
<el-cascader
|
||||||
@@ -107,27 +83,9 @@
|
|||||||
|
|
||||||
<el-table-column label="操作" :min-width="appStore.operateMinWith" fixed="right">
|
<el-table-column label="操作" :min-width="appStore.operateMinWith" fixed="right">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button
|
<el-button type="primary" link icon="delete" @click="deleteUserFunc(scope.row)">删除</el-button>
|
||||||
type="primary"
|
<el-button type="primary" link icon="edit" @click="openEdit(scope.row)">编辑</el-button>
|
||||||
link
|
<el-button type="primary" link icon="magic-stick" @click="resetPasswordFunc(scope.row)">重置密码</el-button>
|
||||||
icon="delete"
|
|
||||||
@click="deleteUserFunc(scope.row)"
|
|
||||||
>删除</el-button
|
|
||||||
>
|
|
||||||
<el-button
|
|
||||||
type="primary"
|
|
||||||
link
|
|
||||||
icon="edit"
|
|
||||||
@click="openEdit(scope.row)"
|
|
||||||
>编辑</el-button
|
|
||||||
>
|
|
||||||
<el-button
|
|
||||||
type="primary"
|
|
||||||
link
|
|
||||||
icon="magic-stick"
|
|
||||||
@click="resetPasswordFunc(scope.row)"
|
|
||||||
>重置密码</el-button
|
|
||||||
>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -187,24 +145,13 @@
|
|||||||
<span class="text-lg">用户</span>
|
<span class="text-lg">用户</span>
|
||||||
<div>
|
<div>
|
||||||
<el-button @click="closeAddUserDialog">取 消</el-button>
|
<el-button @click="closeAddUserDialog">取 消</el-button>
|
||||||
<el-button type="primary" @click="enterAddUserDialog"
|
<el-button type="primary" @click="enterAddUserDialog">确 定</el-button>
|
||||||
>确 定</el-button
|
|
||||||
>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<el-form
|
<el-form ref="userForm" :rules="rules" :model="userInfo" label-width="80px">
|
||||||
ref="userForm"
|
<el-form-item v-if="dialogFlag === 'add'" label="用户名" prop="userName">
|
||||||
:rules="rules"
|
|
||||||
:model="userInfo"
|
|
||||||
label-width="80px"
|
|
||||||
>
|
|
||||||
<el-form-item
|
|
||||||
v-if="dialogFlag === 'add'"
|
|
||||||
label="用户名"
|
|
||||||
prop="userName"
|
|
||||||
>
|
|
||||||
<el-input v-model="userInfo.userName" />
|
<el-input v-model="userInfo.userName" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-if="dialogFlag === 'add'" label="密码" prop="password">
|
<el-form-item v-if="dialogFlag === 'add'" label="密码" prop="password">
|
||||||
@@ -237,12 +184,7 @@
|
|||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="启用" prop="disabled">
|
<el-form-item label="启用" prop="disabled">
|
||||||
<el-switch
|
<el-switch v-model="userInfo.enable" inline-prompt :active-value="1" :inactive-value="2" />
|
||||||
v-model="userInfo.enable"
|
|
||||||
inline-prompt
|
|
||||||
:active-value="1"
|
|
||||||
:inactive-value="2"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="头像" label-width="80px">
|
<el-form-item label="头像" label-width="80px">
|
||||||
<SelectImage v-model="userInfo.headerImg" />
|
<SelectImage v-model="userInfo.headerImg" />
|
||||||
@@ -253,12 +195,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import {
|
import { getUserList, setUserAuthorities, register, deleteUser } from '@/api/user'
|
||||||
getUserList,
|
|
||||||
setUserAuthorities,
|
|
||||||
register,
|
|
||||||
deleteUser
|
|
||||||
} from '@/api/user'
|
|
||||||
|
|
||||||
import { getAuthorityList } from '@/api/authority'
|
import { getAuthorityList } from '@/api/authority'
|
||||||
import CustomPic from '@/components/customPic/index.vue'
|
import CustomPic from '@/components/customPic/index.vue'
|
||||||
@@ -268,7 +205,7 @@
|
|||||||
import { nextTick, ref, watch } from 'vue'
|
import { nextTick, ref, watch } from 'vue'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
import SelectImage from '@/components/selectImage/selectImage.vue'
|
import SelectImage from '@/components/selectImage/selectImage.vue'
|
||||||
import { useAppStore } from "@/pinia";
|
import { useAppStore } from '@/pinia'
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'User'
|
name: 'User'
|
||||||
@@ -383,12 +320,15 @@
|
|||||||
}
|
}
|
||||||
resetPwdInfo.value.password = password
|
resetPwdInfo.value.password = password
|
||||||
// 复制到剪贴板
|
// 复制到剪贴板
|
||||||
navigator.clipboard.writeText(password).then(() => {
|
navigator.clipboard
|
||||||
|
.writeText(password)
|
||||||
|
.then(() => {
|
||||||
ElMessage({
|
ElMessage({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
message: '密码已复制到剪贴板'
|
message: '密码已复制到剪贴板'
|
||||||
})
|
})
|
||||||
}).catch(() => {
|
})
|
||||||
|
.catch(() => {
|
||||||
ElMessage({
|
ElMessage({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
message: '复制失败,请手动复制'
|
message: '复制失败,请手动复制'
|
||||||
@@ -505,9 +445,7 @@
|
|||||||
trigger: 'blur'
|
trigger: 'blur'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
authorityId: [
|
authorityId: [{ required: true, message: '请选择用户角色', trigger: 'blur' }]
|
||||||
{ required: true, message: '请选择用户角色', trigger: 'blur' }
|
|
||||||
]
|
|
||||||
})
|
})
|
||||||
const userForm = ref(null)
|
const userForm = ref(null)
|
||||||
const enterAddUserDialog = async () => {
|
const enterAddUserDialog = async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user