|
@@ -4,11 +4,23 @@
|
|
|
<el-form :inline="true" :model="searchInfo" class="demo-form-inline">
|
|
|
<el-form-item label="角色权限">
|
|
|
<el-select v-model="searchInfo.authorityId" clearable placeholder="请选择">
|
|
|
- <el-option value="100" label="未审核用户"></el-option>
|
|
|
- <el-option value="777" label="一般用户"></el-option>
|
|
|
- <el-option value="666" label="管理员"></el-option>
|
|
|
+ <el-option value="100" label="未审核用户" />
|
|
|
+ <el-option value="777" label="一般用户" />
|
|
|
+ <el-option value="666" label="管理员" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="小程序标识">
|
|
|
+ <el-input v-model="searchInfo.openId" clearable placeholder="请输入小程序标识" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="微信公众号标识">
|
|
|
+ <el-input v-model="searchInfo.wechatId" clearable placeholder="请输入微信公众号标识" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="系统标识">
|
|
|
+ <el-input v-model="searchInfo.unionId" clearable placeholder="请输入系统标识" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="用户名">
|
|
|
+ <el-input v-model="searchInfo.userName" clearable placeholder="请输入用户名" />
|
|
|
+ </el-form-item>
|
|
|
<el-form-item>
|
|
|
<el-button size="mini" type="primary" icon="el-icon-search" @click="onSubmit">查询</el-button>
|
|
|
</el-form-item>
|
|
@@ -18,20 +30,22 @@
|
|
|
<el-table-column label="微信头像" min-width="80">
|
|
|
<template #default="scope">
|
|
|
<div :style="{'textAlign':'center'}">
|
|
|
- <CustomPic :pic-src="scope.row.headerImg"/>
|
|
|
+ <CustomPic :pic-src="scope.row.headerImg" />
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="openid" min-width="230" prop="openId"/>
|
|
|
+ <el-table-column label="小程序标识" min-width="230" prop="openId" />
|
|
|
+ <el-table-column label="微信公众号标识" min-width="230" prop="wechatId" />
|
|
|
+ <el-table-column label="系统标识" min-width="230" prop="unionId" />
|
|
|
<el-table-column label="用户名" min-width="150" prop="userName">
|
|
|
<template #default="scope">
|
|
|
<span v-if="scope.row.isEditPropertyShow">
|
|
|
- <el-input v-model="scope.row.userName" size="mini" placeholder="请输入内容"/>
|
|
|
+ <el-input v-model="scope.row.userName" size="mini" placeholder="请输入内容" />
|
|
|
</span>
|
|
|
<span v-else>{{ scope.row.userName }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="微信昵称" min-width="150" prop="nickName"/>
|
|
|
+ <el-table-column label="微信昵称" min-width="150" prop="nickName" />
|
|
|
<el-table-column label="角色权限" min-width="80" prop="authorityId">
|
|
|
<template #default="scope">
|
|
|
<el-tag v-show="scope.row.authorityId == 666" type="primary">管理员</el-tag>
|
|
@@ -49,11 +63,11 @@
|
|
|
<el-button v-show="scope.row.isEditPropertyShow" size="small" @click="cancelProperty(scope.row,scope.$index)">
|
|
|
取消
|
|
|
</el-button>
|
|
|
- <el-button type="success" v-show="scope.row.authorityId == 100" icon="el-icon-s-claim" size="mini" @click="updateUser(scope.row,false,'777')">审核通过
|
|
|
+ <el-button v-show="scope.row.authorityId == 100" type="success" icon="el-icon-s-claim" size="mini" @click="updateUser(scope.row,false,'777')">审核通过
|
|
|
</el-button>
|
|
|
- <el-button type="success" v-show="scope.row.authorityId == 666" icon="el-icon-s-claim" size="mini" @click="updateUser(scope.row,false,'777')">一般用户
|
|
|
+ <el-button v-show="scope.row.authorityId == 666" type="success" icon="el-icon-s-claim" size="mini" @click="updateUser(scope.row,false,'777')">一般用户
|
|
|
</el-button>
|
|
|
- <el-button type="success" v-show="scope.row.authorityId == 777" icon="el-icon-s-claim" size="mini" @click="updateUser(scope.row,false,'666')">管理员
|
|
|
+ <el-button v-show="scope.row.authorityId == 777" type="success" icon="el-icon-s-claim" size="mini" @click="updateUser(scope.row,false,'666')">管理员
|
|
|
</el-button>
|
|
|
<el-popover v-model:visible="scope.row.visible" placement="top" width="160">
|
|
|
<p>确定要删除此用户吗</p>
|
|
@@ -70,26 +84,26 @@
|
|
|
</el-table>
|
|
|
<span style="color: red;font-size: 12px">注:右上角头像下拉可切换角色</span>
|
|
|
<el-pagination
|
|
|
- :current-page="page"
|
|
|
- :page-size="pageSize"
|
|
|
- :page-sizes="[10, 30, 50, 100]"
|
|
|
- :style="{float:'right',padding:'20px'}"
|
|
|
- :total="total"
|
|
|
- layout="total, sizes, prev, pager, next, jumper"
|
|
|
- @current-change="handleCurrentChange"
|
|
|
- @size-change="handleSizeChange"
|
|
|
+ :current-page="page"
|
|
|
+ :page-size="pageSize"
|
|
|
+ :page-sizes="[10, 30, 50, 100]"
|
|
|
+ :style="{float:'right',padding:'20px'}"
|
|
|
+ :total="total"
|
|
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
+ @size-change="handleSizeChange"
|
|
|
/>
|
|
|
|
|
|
<el-dialog v-model="addUserDialog" custom-class="user-dialog" title="新增用户">
|
|
|
<el-form ref="userForm" :rules="rules" :model="userInfo">
|
|
|
<el-form-item label="用户名" label-width="80px" prop="username">
|
|
|
- <el-input v-model="userInfo.username"/>
|
|
|
+ <el-input v-model="userInfo.username" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="密码" label-width="80px" prop="password">
|
|
|
- <el-input v-model="userInfo.password"/>
|
|
|
+ <el-input v-model="userInfo.password" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="别名" label-width="80px" prop="nickName">
|
|
|
- <el-input v-model="userInfo.nickName"/>
|
|
|
+ <el-input v-model="userInfo.nickName" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="头像" label-width="80px">
|
|
|
<div style="display:inline-block" @click="openHeaderChange">
|
|
@@ -99,12 +113,12 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item label="用户角色" label-width="80px" prop="authorityId">
|
|
|
<el-cascader
|
|
|
- v-model="userInfo.authorityIds"
|
|
|
- :options="authOptions"
|
|
|
- :show-all-levels="false"
|
|
|
- :props="{ multiple:true,checkStrictly: true,label:'authorityName',value:'authorityId',disabled:'disabled',emitPath:false}"
|
|
|
- filterable
|
|
|
- :clearable="false"
|
|
|
+ v-model="userInfo.authorityIds"
|
|
|
+ :options="authOptions"
|
|
|
+ :show-all-levels="false"
|
|
|
+ :props="{ multiple:true,checkStrictly: true,label:'authorityName',value:'authorityId',disabled:'disabled',emitPath:false}"
|
|
|
+ filterable
|
|
|
+ :clearable="false"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
@@ -115,7 +129,7 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
- <ChooseImg ref="chooseImg" :target="userInfo" :target-key="`headerImg`"/>
|
|
|
+ <ChooseImg ref="chooseImg" :target="userInfo" :target-key="`headerImg`" />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -155,18 +169,18 @@ export default {
|
|
|
},
|
|
|
rules: {
|
|
|
username: [
|
|
|
- {required: true, message: '请输入用户名', trigger: 'blur'},
|
|
|
- {min: 5, message: '最低5位字符', trigger: 'blur'}
|
|
|
+ { required: true, message: '请输入用户名', trigger: 'blur' },
|
|
|
+ { min: 5, message: '最低5位字符', trigger: 'blur' }
|
|
|
],
|
|
|
password: [
|
|
|
- {required: true, message: '请输入用户密码', trigger: 'blur'},
|
|
|
- {min: 6, message: '最低6位字符', trigger: 'blur'}
|
|
|
+ { required: true, message: '请输入用户密码', trigger: 'blur' },
|
|
|
+ { min: 6, message: '最低6位字符', trigger: 'blur' }
|
|
|
],
|
|
|
nickName: [
|
|
|
- {required: true, message: '请输入用户昵称', trigger: 'blur'}
|
|
|
+ { required: true, message: '请输入用户昵称', trigger: 'blur' }
|
|
|
],
|
|
|
authorityId: [
|
|
|
- {required: true, message: '请选择用户角色', trigger: 'blur'}
|
|
|
+ { required: true, message: '请选择用户角色', trigger: 'blur' }
|
|
|
]
|
|
|
}
|
|
|
}
|
|
@@ -177,7 +191,7 @@ export default {
|
|
|
async created() {
|
|
|
await this.getTableData()
|
|
|
this.setAuthorityIds()
|
|
|
- const res = await getAuthorityList({page: 1, pageSize: 999})
|
|
|
+ const res = await getAuthorityList({ page: 1, pageSize: 999 })
|
|
|
this.setOptions(res.data.list)
|
|
|
},
|
|
|
methods: {
|
|
@@ -235,7 +249,7 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
async deleteUser(row) {
|
|
|
- const res = await deleteUser({id: row.ID})
|
|
|
+ const res = await deleteUser({ id: row.ID })
|
|
|
if (res.code === 0) {
|
|
|
this.$message.success('删除成功')
|
|
|
await this.getTableData()
|
|
@@ -270,7 +284,7 @@ export default {
|
|
|
if (valid) {
|
|
|
const res = await register(this.userInfo)
|
|
|
if (res.code === 0) {
|
|
|
- this.$message({type: 'success', message: '创建成功'})
|
|
|
+ this.$message({ type: 'success', message: '创建成功' })
|
|
|
}
|
|
|
await this.getTableData()
|
|
|
this.setAuthorityIds()
|
|
@@ -289,13 +303,13 @@ export default {
|
|
|
if (flag) {
|
|
|
return
|
|
|
}
|
|
|
- this.$nextTick(async () => {
|
|
|
+ this.$nextTick(async() => {
|
|
|
const res = await setUserAuthorities({
|
|
|
ID: row.ID,
|
|
|
authorityIds: row.authorityIds
|
|
|
})
|
|
|
if (res.code === 0) {
|
|
|
- this.$message({type: 'success', message: '角色设置成功'})
|
|
|
+ this.$message({ type: 'success', message: '角色设置成功' })
|
|
|
}
|
|
|
})
|
|
|
}
|