用户管理 角色管理修改
This commit is contained in:
+4
-1
@@ -18,6 +18,8 @@ const frozenBatch = (params)=>putAction("/sys/user/frozenBatch",params);
|
|||||||
const checkOnlyUser = (params)=>getAction("/sys/user/checkOnlyUser",params);
|
const checkOnlyUser = (params)=>getAction("/sys/user/checkOnlyUser",params);
|
||||||
//改变密码
|
//改变密码
|
||||||
const changePassword = (params)=>putAction("/sys/user/changePassword",params);
|
const changePassword = (params)=>putAction("/sys/user/changePassword",params);
|
||||||
|
// 重置密码
|
||||||
|
const resetUserPassword = (params) => putAction('',params)
|
||||||
|
|
||||||
//权限管理
|
//权限管理
|
||||||
const addPermission= (params)=>postAction("/sys/permission/add",params);
|
const addPermission= (params)=>postAction("/sys/permission/add",params);
|
||||||
@@ -153,7 +155,8 @@ export {
|
|||||||
saveDeptRolePermission,
|
saveDeptRolePermission,
|
||||||
queryMyDepartTreeList,
|
queryMyDepartTreeList,
|
||||||
getUserNoticeInfo,
|
getUserNoticeInfo,
|
||||||
getDictItemsFromCache
|
getDictItemsFromCache,
|
||||||
|
resetUserPassword
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -89,8 +89,7 @@ export const JeroListMixin = {
|
|||||||
if (res.success) {
|
if (res.success) {
|
||||||
//update-begin---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
|
//update-begin---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
|
||||||
this.dataSource = res.result.records || res.result;
|
this.dataSource = res.result.records || res.result;
|
||||||
if(res.result.total)
|
if (res.result.total) {
|
||||||
{
|
|
||||||
this.ipagination.total = res.result.total;
|
this.ipagination.total = res.result.total;
|
||||||
//清空列表选中
|
//清空列表选中
|
||||||
this.onClearSelected()
|
this.onClearSelected()
|
||||||
@@ -301,6 +300,33 @@ export const JeroListMixin = {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
/*
|
||||||
|
* 下载模板
|
||||||
|
* */
|
||||||
|
downTemplate(fileName) {
|
||||||
|
if (!fileName || typeof fileName != "string") {
|
||||||
|
fileName = "模板文件"
|
||||||
|
}
|
||||||
|
downFile(this.url.downTemplateUrl).then((data) => {
|
||||||
|
if (!data) {
|
||||||
|
this.$message.warning("文件下载失败")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (typeof window.navigator.msSaveBlob !== 'undefined') {
|
||||||
|
window.navigator.msSaveBlob(new Blob([data], {type: 'application/vnd.ms-excel'}), fileName + '.xls')
|
||||||
|
} else {
|
||||||
|
let url = window.URL.createObjectURL(new Blob([data], {type: 'application/vnd.ms-excel'}))
|
||||||
|
let link = document.createElement('a')
|
||||||
|
link.style.display = 'none'
|
||||||
|
link.href = url
|
||||||
|
link.setAttribute('download', fileName + '.xls')
|
||||||
|
document.body.appendChild(link)
|
||||||
|
link.click()
|
||||||
|
document.body.removeChild(link); //下载完成移除元素
|
||||||
|
window.URL.revokeObjectURL(url); //释放掉blob对象
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
/* 导入 */
|
/* 导入 */
|
||||||
handleImportExcel(info) {
|
handleImportExcel(info) {
|
||||||
if (info.file.status !== 'uploading') {
|
if (info.file.status !== 'uploading') {
|
||||||
@@ -315,8 +341,11 @@ export const JeroListMixin = {
|
|||||||
this.$warning({
|
this.$warning({
|
||||||
title: message,
|
title: message,
|
||||||
content: (<div>
|
content: (<div>
|
||||||
<span>{msg}</span><br/>
|
<span>{msg}</span>
|
||||||
<span>具体详情请 <a href={href} target="_blank" download={fileName}>点击下载</a> </span>
|
<br/>
|
||||||
|
<span>具体详情请
|
||||||
|
<a href={href} target="_blank" download={fileName}>点击下载</a>
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ export default {
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
url: {
|
url: {
|
||||||
// list: "/sys/role/page",
|
list: "/sys/role/page",
|
||||||
delete: "/sys/role/delete",
|
delete: "/sys/role/delete",
|
||||||
deleteBatch: "/sys/role/deleteBatch",
|
deleteBatch: "/sys/role/deleteBatch",
|
||||||
list2: "/sys/user/userRoleList",
|
list2: "/sys/user/userRoleList",
|
||||||
|
|||||||
@@ -11,6 +11,37 @@
|
|||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
|
||||||
|
<a-col :md="6" :sm="12">
|
||||||
|
<a-form-item
|
||||||
|
label="角色类型"
|
||||||
|
:labelCol="labelCol"
|
||||||
|
:wrapperCol="wrapperCol">
|
||||||
|
<a-tree-select
|
||||||
|
style="width:100%"
|
||||||
|
:dropdownStyle="{ maxHeight: '200px', overflow: 'auto' }"
|
||||||
|
:treeData="treeRoleData"
|
||||||
|
v-model="queryParam.roleId"
|
||||||
|
placeholder="请选择角色类型"
|
||||||
|
>
|
||||||
|
</a-tree-select>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
|
||||||
|
<a-col :md="6" :sm="12">
|
||||||
|
<a-form-item
|
||||||
|
label="组织机构"
|
||||||
|
:labelCol="labelCol"
|
||||||
|
:wrapperCol="wrapperCol">
|
||||||
|
<a-tree-select
|
||||||
|
style="width:100%"
|
||||||
|
:dropdownStyle="{ maxHeight: '200px',maxWidth:'100px','overflow-x':'hidden',' overflo-y': 'auto' }"
|
||||||
|
:treeData="treeDepartData"
|
||||||
|
v-model="queryParam.departId"
|
||||||
|
placeholder="请选择组织机构">
|
||||||
|
</a-tree-select>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
|
||||||
<a-col :md="6" :sm="8">
|
<a-col :md="6" :sm="8">
|
||||||
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
|
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
|
||||||
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
|
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
|
||||||
@@ -24,6 +55,10 @@
|
|||||||
<!-- 操作按钮区域 -->
|
<!-- 操作按钮区域 -->
|
||||||
<div class="table-operator" style="border-top: 5px">
|
<div class="table-operator" style="border-top: 5px">
|
||||||
<a-button @click="handleAdd" type="primary" icon="plus" v-has="'user:add'">添加用户</a-button>
|
<a-button @click="handleAdd" type="primary" icon="plus" v-has="'user:add'">添加用户</a-button>
|
||||||
|
<a-button @click="downTemplate('用户导入模板')" type="primary" icon="download">下载模板</a-button>
|
||||||
|
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
|
||||||
|
<a-button type="primary" icon="import">导入</a-button>
|
||||||
|
</a-upload>
|
||||||
<a-button @click="batchDel" type="danger" icon="delete">批量删除</a-button>
|
<a-button @click="batchDel" type="danger" icon="delete">批量删除</a-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -44,6 +79,7 @@
|
|||||||
|
|
||||||
<span slot="action" class="action-span-cell" slot-scope="text, record">
|
<span slot="action" class="action-span-cell" slot-scope="text, record">
|
||||||
<a @click="handleEdit(record)" v-has="'user:edit'">编辑</a>
|
<a @click="handleEdit(record)" v-has="'user:edit'">编辑</a>
|
||||||
|
<a @click="resetPassword(record.id)" >重置密码</a>
|
||||||
<a @click="handleDelete(record.id)" v-has="'sys:user:del'">删除</a>
|
<a @click="handleDelete(record.id)" v-has="'sys:user:del'">删除</a>
|
||||||
</span>
|
</span>
|
||||||
<template slot="text" slot-scope="text">
|
<template slot="text" slot-scope="text">
|
||||||
@@ -66,6 +102,8 @@ import { getFileAccessHttpUrl } from "@/api/manage";
|
|||||||
import { JeroListMixin } from "@/mixins/JeroListMixin";
|
import { JeroListMixin } from "@/mixins/JeroListMixin";
|
||||||
import JInput from "@/components/jero/JInput";
|
import JInput from "@/components/jero/JInput";
|
||||||
import JEllipsis from "@comp/jero/JEllipsis";
|
import JEllipsis from "@comp/jero/JEllipsis";
|
||||||
|
import {queryDepartTreeList, resetUserPassword} from "@api/api";
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "UserList",
|
name: "UserList",
|
||||||
@@ -151,6 +189,18 @@ export default {
|
|||||||
width: 170
|
width: 170
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
// 组织机构 下拉数据
|
||||||
|
treeDepartData:[],
|
||||||
|
// 角色类型下拉数据
|
||||||
|
treeRoleData:[],
|
||||||
|
labelCol: {
|
||||||
|
xs: { span: 24 },
|
||||||
|
sm: { span: 5 },
|
||||||
|
},
|
||||||
|
wrapperCol: {
|
||||||
|
xs: { span: 20 },
|
||||||
|
sm: { span: 16 },
|
||||||
|
},
|
||||||
superQueryFieldList: [
|
superQueryFieldList: [
|
||||||
{ type: "input", value: "username", text: "用户账号" }
|
{ type: "input", value: "username", text: "用户账号" }
|
||||||
],
|
],
|
||||||
@@ -163,12 +213,49 @@ export default {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
created() {
|
||||||
|
this.loadDepartTreeData()
|
||||||
|
},
|
||||||
|
computed:{
|
||||||
|
importExcelUrl(){
|
||||||
|
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getAvatarView: function(avatar) {
|
getAvatarView: function(avatar) {
|
||||||
return getFileAccessHttpUrl(avatar);
|
return getFileAccessHttpUrl(avatar);
|
||||||
},
|
},
|
||||||
passwordModalOk() {
|
passwordModalOk() {
|
||||||
//TODO 密码修改完成 不需要刷新页面,可以把datasource中的数据更新一下
|
//TODO 密码修改完成 不需要刷新页面,可以把datasource中的数据更新一下
|
||||||
|
},
|
||||||
|
/*
|
||||||
|
* 组织机构下拉数据
|
||||||
|
* */
|
||||||
|
loadDepartTreeData(){
|
||||||
|
const that = this
|
||||||
|
queryDepartTreeList().then((res) => {
|
||||||
|
if(res.success){
|
||||||
|
that.treeDepartData = [];
|
||||||
|
let treeList = res.result
|
||||||
|
for(let a=0;a<treeList.length;a++){
|
||||||
|
let temp = treeList[a];
|
||||||
|
temp.isLeaf = temp.leaf;
|
||||||
|
that.treeDepartData.push(temp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/*
|
||||||
|
* 重置密码
|
||||||
|
* */
|
||||||
|
resetPassword(id){
|
||||||
|
resetUserPassword({id:id}).then( res => {
|
||||||
|
if(res.success){
|
||||||
|
this.$message.success(res.message)
|
||||||
|
}else {
|
||||||
|
this.$message.warning(res.message)
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -75,7 +75,8 @@
|
|||||||
:labelCol="labelCol"
|
:labelCol="labelCol"
|
||||||
:wrapperCol="wrapperCol"
|
:wrapperCol="wrapperCol"
|
||||||
label="授权标识">
|
label="授权标识">
|
||||||
<a-input placeholder="请输入授权标识, 如: user:list" @change="event => event.target.value = event.target.value.trim()" :maxLength="50" v-decorator="[ 'perms', {rules:[{ required: false, message: '请输入授权标识!' },{validator: this.validatePerms }]}]" :readOnly="disableSubmit"/>
|
<!-- {validator: this.validatePerms }-->
|
||||||
|
<a-input placeholder="请输入授权标识, 如: user:list" @change="event => event.target.value = event.target.value.trim()" :maxLength="50" v-decorator="[ 'perms', {rules:[{ required: false, message: '请输入授权标识!' }]}]" :readOnly="disableSubmit"/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
|
||||||
<a-form-item
|
<a-form-item
|
||||||
@@ -243,6 +244,7 @@
|
|||||||
temp.isLeaf = temp.leaf;
|
temp.isLeaf = temp.leaf;
|
||||||
that.treeData.push(temp);
|
that.treeData.push(temp);
|
||||||
}
|
}
|
||||||
|
console.log(this.treeData)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -102,7 +102,6 @@
|
|||||||
this.edit({});
|
this.edit({});
|
||||||
},
|
},
|
||||||
edit (record) {
|
edit (record) {
|
||||||
debugger
|
|
||||||
this.form.resetFields();
|
this.form.resetFields();
|
||||||
this.model = Object.assign({}, record);
|
this.model = Object.assign({}, record);
|
||||||
this.visible = true;
|
this.visible = true;
|
||||||
|
|||||||
@@ -100,6 +100,36 @@
|
|||||||
</a-select>
|
</a-select>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
|
||||||
|
<a-form-item
|
||||||
|
label="角色类型"
|
||||||
|
:labelCol="labelCol"
|
||||||
|
:wrapperCol="wrapperCol">
|
||||||
|
<a-tree-select
|
||||||
|
style="width:100%"
|
||||||
|
:dropdownStyle="{ maxHeight: '200px', overflow: 'auto' }"
|
||||||
|
:treeData="treeRoleData"
|
||||||
|
v-decorator="[ 'roleParentId', validatorRules.name]"
|
||||||
|
placeholder="请选择角色类型"
|
||||||
|
>
|
||||||
|
</a-tree-select>
|
||||||
|
</a-form-item>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a-form-item
|
||||||
|
label="组织机构"
|
||||||
|
:labelCol="labelCol"
|
||||||
|
:wrapperCol="wrapperCol">
|
||||||
|
<a-tree-select
|
||||||
|
style="width:100%"
|
||||||
|
:dropdownStyle="{ maxHeight: '200px',maxWidth:'100px','overflow-x':'hidden',' overflo-y': 'auto' }"
|
||||||
|
:treeData="treeDepartData"
|
||||||
|
v-decorator="[ 'departId', validatorRules.name]"
|
||||||
|
placeholder="请选择组织机构">
|
||||||
|
</a-tree-select>
|
||||||
|
</a-form-item>
|
||||||
|
|
||||||
|
|
||||||
<a-form-item label="邮箱" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
<a-form-item label="邮箱" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
<a-input placeholder="请输入邮箱" :disabled="disableSubmit" @change="event => event.target.value = event.target.value.trim()" v-decorator="[ 'email', validatorRules.email]" :maxLength="50"/>
|
<a-input placeholder="请输入邮箱" :disabled="disableSubmit" @change="event => event.target.value = event.target.value.trim()" v-decorator="[ 'email', validatorRules.email]" :maxLength="50"/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
@@ -137,7 +167,7 @@ import moment from 'moment'
|
|||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import {ACCESS_TOKEN} from "@/store/mutation-types"
|
import {ACCESS_TOKEN} from "@/store/mutation-types"
|
||||||
import {getAction} from '@/api/manage'
|
import {getAction} from '@/api/manage'
|
||||||
import {addUser, editUser, queryUserRole, queryall} from '@/api/api'
|
import {addUser, editUser, queryUserRole, queryall, queryDepartTreeList} from '@/api/api'
|
||||||
import {disabledAuthFilter} from "@/utils/authFilter"
|
import {disabledAuthFilter} from "@/utils/authFilter"
|
||||||
import {duplicateCheck} from '@/api/api'
|
import {duplicateCheck} from '@/api/api'
|
||||||
import { isEmail, passwordReg} from "@/utils/validate";
|
import { isEmail, passwordReg} from "@/utils/validate";
|
||||||
@@ -156,6 +186,12 @@ export default {
|
|||||||
drawerWidth: 700,
|
drawerWidth: 700,
|
||||||
modaltoggleFlag: true,
|
modaltoggleFlag: true,
|
||||||
confirmDirty: false,
|
confirmDirty: false,
|
||||||
|
// 组织机构 下拉数据
|
||||||
|
treeDepartData:[],
|
||||||
|
// 角色类型下拉数据
|
||||||
|
treeRoleData:[],
|
||||||
|
|
||||||
|
|
||||||
selectedDepartKeys: [], //保存用户选择部门id
|
selectedDepartKeys: [], //保存用户选择部门id
|
||||||
checkedDepartKeys: [],
|
checkedDepartKeys: [],
|
||||||
checkedDepartNames: [], // 保存部门的名称 =>title
|
checkedDepartNames: [], // 保存部门的名称 =>title
|
||||||
@@ -303,6 +339,8 @@ export default {
|
|||||||
},
|
},
|
||||||
edit(record) {
|
edit(record) {
|
||||||
this.resetScreenSize(); // 调用此方法,根据屏幕宽度自适应调整抽屉的宽度
|
this.resetScreenSize(); // 调用此方法,根据屏幕宽度自适应调整抽屉的宽度
|
||||||
|
// 加载组织机构数据
|
||||||
|
this.loadDepartTreeData()
|
||||||
// 获取公钥
|
// 获取公钥
|
||||||
this.getPublicKey()
|
this.getPublicKey()
|
||||||
let that = this;
|
let that = this;
|
||||||
@@ -341,6 +379,21 @@ export default {
|
|||||||
}
|
}
|
||||||
//update-end-author:taoyan date:2020710 for:多租户配置
|
//update-end-author:taoyan date:2020710 for:多租户配置
|
||||||
},
|
},
|
||||||
|
// 组织机构下拉数据
|
||||||
|
loadDepartTreeData(){
|
||||||
|
const that = this
|
||||||
|
queryDepartTreeList().then((res) => {
|
||||||
|
if(res.success){
|
||||||
|
that.treeDepartData = [];
|
||||||
|
let treeList = res.result
|
||||||
|
for(let a=0;a<treeList.length;a++){
|
||||||
|
let temp = treeList[a];
|
||||||
|
temp.isLeaf = temp.leaf;
|
||||||
|
that.treeDepartData.push(temp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
//
|
//
|
||||||
getPublicKey() {
|
getPublicKey() {
|
||||||
// 获取公钥
|
// 获取公钥
|
||||||
|
|||||||
Reference in New Issue
Block a user