用户管理 角色管理修改
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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+92
-63
@@ -3,25 +3,25 @@
|
|||||||
* 高级查询按钮调用 superQuery方法 高级查询组件ref定义为superQueryModal
|
* 高级查询按钮调用 superQuery方法 高级查询组件ref定义为superQueryModal
|
||||||
* data中url定义 list为查询列表 delete为删除单条记录 deleteBatch为批量删除
|
* data中url定义 list为查询列表 delete为删除单条记录 deleteBatch为批量删除
|
||||||
*/
|
*/
|
||||||
import { filterObj } from '@/utils/util';
|
import {filterObj} from '@/utils/util';
|
||||||
import { deleteAction, getAction,downFile,getFileAccessHttpUrl } from '@/api/manage'
|
import {deleteAction, getAction, downFile, getFileAccessHttpUrl} from '@/api/manage'
|
||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import { ACCESS_TOKEN, TENANT_ID } from "@/store/mutation-types"
|
import {ACCESS_TOKEN, TENANT_ID} from "@/store/mutation-types"
|
||||||
import store from '@/store'
|
import store from '@/store'
|
||||||
import {Modal} from 'ant-design-vue'
|
import {Modal} from 'ant-design-vue'
|
||||||
import { deleteByDepartId } from "@api/api";
|
import {deleteByDepartId} from "@api/api";
|
||||||
|
|
||||||
export const JeroListMixin = {
|
export const JeroListMixin = {
|
||||||
data(){
|
data() {
|
||||||
return {
|
return {
|
||||||
/* 查询条件-请不要在queryParam中声明非字符串值的属性 */
|
/* 查询条件-请不要在queryParam中声明非字符串值的属性 */
|
||||||
queryParam: {},
|
queryParam: {},
|
||||||
// 记录上一次查询的条件,防止查询处输入框的数据发生变化,未点击查询按钮,再点击分页的时候数据发生变化
|
// 记录上一次查询的条件,防止查询处输入框的数据发生变化,未点击查询按钮,再点击分页的时候数据发生变化
|
||||||
lastQueryParam: {},
|
lastQueryParam: {},
|
||||||
/* 数据源 */
|
/* 数据源 */
|
||||||
dataSource:[],
|
dataSource: [],
|
||||||
/* 分页参数 */
|
/* 分页参数 */
|
||||||
ipagination:{
|
ipagination: {
|
||||||
current: 1,
|
current: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
pageSizeOptions: ['10', '20', '30', '50'],
|
pageSizeOptions: ['10', '20', '30', '50'],
|
||||||
@@ -33,22 +33,22 @@ export const JeroListMixin = {
|
|||||||
total: 0
|
total: 0
|
||||||
},
|
},
|
||||||
/* 排序参数 */
|
/* 排序参数 */
|
||||||
isorter:{
|
isorter: {
|
||||||
column: 'createTime',
|
column: 'createTime',
|
||||||
order: 'desc',
|
order: 'desc',
|
||||||
},
|
},
|
||||||
/* 筛选参数 */
|
/* 筛选参数 */
|
||||||
filters: {},
|
filters: {},
|
||||||
/* table加载状态 */
|
/* table加载状态 */
|
||||||
loading:false,
|
loading: false,
|
||||||
/* table选中keys*/
|
/* table选中keys*/
|
||||||
selectedRowKeys: [],
|
selectedRowKeys: [],
|
||||||
/* table选中records*/
|
/* table选中records*/
|
||||||
selectionRows: [],
|
selectionRows: [],
|
||||||
/* 查询折叠 */
|
/* 查询折叠 */
|
||||||
toggleSearchStatus:false,
|
toggleSearchStatus: false,
|
||||||
/* 高级查询条件生效状态 */
|
/* 高级查询条件生效状态 */
|
||||||
superQueryFlag:false,
|
superQueryFlag: false,
|
||||||
/* 高级查询条件 */
|
/* 高级查询条件 */
|
||||||
superQueryParams: '',
|
superQueryParams: '',
|
||||||
/** 高级查询拼接方式 */
|
/** 高级查询拼接方式 */
|
||||||
@@ -56,26 +56,26 @@ export const JeroListMixin = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
if(!this.disableMixinCreated){
|
if (!this.disableMixinCreated) {
|
||||||
this.loadData();
|
this.loadData();
|
||||||
//初始化字典配置 在自己页面定义
|
//初始化字典配置 在自己页面定义
|
||||||
this.initDictConfig();
|
this.initDictConfig();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
//token header
|
//token header
|
||||||
tokenHeader(){
|
tokenHeader() {
|
||||||
let head = {'X-Access-Token': Vue.ls.get(ACCESS_TOKEN)}
|
let head = {'X-Access-Token': Vue.ls.get(ACCESS_TOKEN)}
|
||||||
let tenantid = Vue.ls.get(TENANT_ID)
|
let tenantid = Vue.ls.get(TENANT_ID)
|
||||||
if(tenantid){
|
if (tenantid) {
|
||||||
head['tenant_id'] = tenantid
|
head['tenant_id'] = tenantid
|
||||||
}
|
}
|
||||||
return head;
|
return head;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods:{
|
methods: {
|
||||||
loadData(arg) {
|
loadData(arg) {
|
||||||
if(!this.url.list){
|
if (!this.url.list) {
|
||||||
this.$message.error("请设置url.list属性!")
|
this.$message.error("请设置url.list属性!")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -88,34 +88,33 @@ export const JeroListMixin = {
|
|||||||
getAction(this.url.list, params).then((res) => {
|
getAction(this.url.list, params).then((res) => {
|
||||||
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()
|
||||||
}else{
|
} else {
|
||||||
this.ipagination.total = 0;
|
this.ipagination.total = 0;
|
||||||
}
|
}
|
||||||
//update-end---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
|
//update-end---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
|
||||||
}
|
}
|
||||||
if(res.code===510){
|
if (res.code === 510) {
|
||||||
this.$message.warning(res.message)
|
this.$message.warning(res.message)
|
||||||
}
|
}
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
initDictConfig(){
|
initDictConfig() {
|
||||||
|
|
||||||
},
|
},
|
||||||
handleSuperQuery(params, matchType) {
|
handleSuperQuery(params, matchType) {
|
||||||
//高级查询方法
|
//高级查询方法
|
||||||
if(!params){
|
if (!params) {
|
||||||
this.superQueryParams=''
|
this.superQueryParams = ''
|
||||||
this.superQueryFlag = false
|
this.superQueryFlag = false
|
||||||
}else{
|
} else {
|
||||||
this.superQueryFlag = true
|
this.superQueryFlag = true
|
||||||
this.superQueryParams=JSON.stringify(params)
|
this.superQueryParams = JSON.stringify(params)
|
||||||
this.superQueryMatchType = matchType
|
this.superQueryMatchType = matchType
|
||||||
}
|
}
|
||||||
this.loadData(1)
|
this.loadData(1)
|
||||||
@@ -123,12 +122,12 @@ export const JeroListMixin = {
|
|||||||
getQueryParams() {
|
getQueryParams() {
|
||||||
//获取查询条件
|
//获取查询条件
|
||||||
let sqp = {}
|
let sqp = {}
|
||||||
if(this.superQueryParams){
|
if (this.superQueryParams) {
|
||||||
sqp['superQueryParams']=encodeURI(this.superQueryParams)
|
sqp['superQueryParams'] = encodeURI(this.superQueryParams)
|
||||||
sqp['superQueryMatchType'] = this.superQueryMatchType
|
sqp['superQueryMatchType'] = this.superQueryMatchType
|
||||||
}
|
}
|
||||||
// var param = Object.assign(sqp, this.queryParam, this.isorter ,this.filters);
|
// var param = Object.assign(sqp, this.queryParam, this.isorter ,this.filters);
|
||||||
var param = Object.assign(sqp, this.lastQueryParam, this.isorter ,this.filters);
|
var param = Object.assign(sqp, this.lastQueryParam, this.isorter, this.filters);
|
||||||
param.field = this.getQueryField();
|
param.field = this.getQueryField();
|
||||||
param.pageNo = this.ipagination.current;
|
param.pageNo = this.ipagination.current;
|
||||||
param.pageSize = this.ipagination.pageSize;
|
param.pageSize = this.ipagination.pageSize;
|
||||||
@@ -152,7 +151,7 @@ export const JeroListMixin = {
|
|||||||
this.selectionRows = [];
|
this.selectionRows = [];
|
||||||
},
|
},
|
||||||
searchQuery() {
|
searchQuery() {
|
||||||
this.lastQueryParam = { ...this.queryParam }
|
this.lastQueryParam = {...this.queryParam}
|
||||||
this.loadData(1);
|
this.loadData(1);
|
||||||
},
|
},
|
||||||
superQuery() {
|
superQuery() {
|
||||||
@@ -164,7 +163,7 @@ export const JeroListMixin = {
|
|||||||
this.loadData(1);
|
this.loadData(1);
|
||||||
},
|
},
|
||||||
batchDel: function () {
|
batchDel: function () {
|
||||||
if(!this.url.deleteBatch){
|
if (!this.url.deleteBatch) {
|
||||||
this.$message.error("请设置url.deleteBatch属性!")
|
this.$message.error("请设置url.deleteBatch属性!")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -204,7 +203,7 @@ export const JeroListMixin = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleDelete: function (id) {
|
handleDelete: function (id) {
|
||||||
if(!this.url.delete){
|
if (!this.url.delete) {
|
||||||
this.$message.error("请设置url.delete属性!")
|
this.$message.error("请设置url.delete属性!")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -212,7 +211,7 @@ export const JeroListMixin = {
|
|||||||
this.$confirm({
|
this.$confirm({
|
||||||
title: "确认删除",
|
title: "确认删除",
|
||||||
content: "确定要删除此条数据吗?",
|
content: "确定要删除此条数据吗?",
|
||||||
onOk: function() {
|
onOk: function () {
|
||||||
deleteAction(that.url.delete, {id: id}).then((res) => {
|
deleteAction(that.url.delete, {id: id}).then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
that.$message.success(res.message);
|
that.$message.success(res.message);
|
||||||
@@ -248,11 +247,11 @@ export const JeroListMixin = {
|
|||||||
this.ipagination = pagination;
|
this.ipagination = pagination;
|
||||||
this.loadData();
|
this.loadData();
|
||||||
},
|
},
|
||||||
handleToggleSearch(){
|
handleToggleSearch() {
|
||||||
this.toggleSearchStatus = !this.toggleSearchStatus;
|
this.toggleSearchStatus = !this.toggleSearchStatus;
|
||||||
},
|
},
|
||||||
// 给popup查询使用(查询区域不支持回填多个字段,限制只返回一个字段)
|
// 给popup查询使用(查询区域不支持回填多个字段,限制只返回一个字段)
|
||||||
getPopupField(fields){
|
getPopupField(fields) {
|
||||||
return fields.split(',')[0]
|
return fields.split(',')[0]
|
||||||
},
|
},
|
||||||
modalFormOk() {
|
modalFormOk() {
|
||||||
@@ -261,39 +260,66 @@ export const JeroListMixin = {
|
|||||||
//清空列表选中
|
//清空列表选中
|
||||||
this.onClearSelected()
|
this.onClearSelected()
|
||||||
},
|
},
|
||||||
handleDetail:function(record){
|
handleDetail: function (record) {
|
||||||
this.$refs.modalForm.edit(record);
|
this.$refs.modalForm.edit(record);
|
||||||
this.$refs.modalForm.title="详情";
|
this.$refs.modalForm.title = "详情";
|
||||||
this.$refs.modalForm.disableSubmit = true;
|
this.$refs.modalForm.disableSubmit = true;
|
||||||
},
|
},
|
||||||
/* 导出 */
|
/* 导出 */
|
||||||
handleExportXls2(){
|
handleExportXls2() {
|
||||||
let paramsStr = encodeURI(JSON.stringify(this.getQueryParams()));
|
let paramsStr = encodeURI(JSON.stringify(this.getQueryParams()));
|
||||||
let url = `${window._CONFIG['domianURL']}/${this.url.exportXlsUrl}?paramsStr=${paramsStr}`;
|
let url = `${window._CONFIG['domianURL']}/${this.url.exportXlsUrl}?paramsStr=${paramsStr}`;
|
||||||
window.location.href = url;
|
window.location.href = url;
|
||||||
},
|
},
|
||||||
handleExportXls(fileName){
|
handleExportXls(fileName) {
|
||||||
if(!fileName || typeof fileName != "string"){
|
if (!fileName || typeof fileName != "string") {
|
||||||
fileName = "导出文件"
|
fileName = "导出文件"
|
||||||
}
|
}
|
||||||
let param = this.getQueryParams();
|
let param = this.getQueryParams();
|
||||||
if(this.selectedRowKeys && this.selectedRowKeys.length>0){
|
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
|
||||||
param['selections'] = this.selectedRowKeys.join(",")
|
param['selections'] = this.selectedRowKeys.join(",")
|
||||||
}
|
}
|
||||||
console.log("导出参数",param)
|
console.log("导出参数", param)
|
||||||
downFile(this.url.exportXlsUrl,param).then((data)=>{
|
downFile(this.url.exportXlsUrl, param).then((data) => {
|
||||||
if (!data) {
|
if (!data) {
|
||||||
this.$message.warning("文件下载失败")
|
this.$message.warning("文件下载失败")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (typeof window.navigator.msSaveBlob !== 'undefined') {
|
if (typeof window.navigator.msSaveBlob !== 'undefined') {
|
||||||
window.navigator.msSaveBlob(new Blob([data],{type: 'application/vnd.ms-excel'}), fileName+'.xls')
|
window.navigator.msSaveBlob(new Blob([data], {type: 'application/vnd.ms-excel'}), fileName + '.xls')
|
||||||
}else{
|
} else {
|
||||||
let url = window.URL.createObjectURL(new Blob([data],{type: 'application/vnd.ms-excel'}))
|
let url = window.URL.createObjectURL(new Blob([data], {type: 'application/vnd.ms-excel'}))
|
||||||
let link = document.createElement('a')
|
let link = document.createElement('a')
|
||||||
link.style.display = 'none'
|
link.style.display = 'none'
|
||||||
link.href = url
|
link.href = url
|
||||||
link.setAttribute('download', fileName+'.xls')
|
link.setAttribute('download', fileName + '.xls')
|
||||||
|
document.body.appendChild(link)
|
||||||
|
link.click()
|
||||||
|
document.body.removeChild(link); //下载完成移除元素
|
||||||
|
window.URL.revokeObjectURL(url); //释放掉blob对象
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/*
|
||||||
|
* 下载模板
|
||||||
|
* */
|
||||||
|
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)
|
document.body.appendChild(link)
|
||||||
link.click()
|
link.click()
|
||||||
document.body.removeChild(link); //下载完成移除元素
|
document.body.removeChild(link); //下载完成移除元素
|
||||||
@@ -302,7 +328,7 @@ export const JeroListMixin = {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
/* 导入 */
|
/* 导入 */
|
||||||
handleImportExcel(info){
|
handleImportExcel(info) {
|
||||||
if (info.file.status !== 'uploading') {
|
if (info.file.status !== 'uploading') {
|
||||||
console.log(info.file, info.fileList);
|
console.log(info.file, info.fileList);
|
||||||
}
|
}
|
||||||
@@ -310,14 +336,17 @@ export const JeroListMixin = {
|
|||||||
if (info.file.response.success) {
|
if (info.file.response.success) {
|
||||||
// this.$message.success(`${info.file.name} 文件上传成功`);
|
// this.$message.success(`${info.file.name} 文件上传成功`);
|
||||||
if (info.file.response.code === 201) {
|
if (info.file.response.code === 201) {
|
||||||
let { message, result: { msg, fileUrl, fileName } } = info.file.response
|
let {message, result: {msg, fileUrl, fileName}} = info.file.response
|
||||||
let href = window._CONFIG['domianURL'] + fileUrl
|
let href = window._CONFIG['domianURL'] + fileUrl
|
||||||
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/>
|
||||||
</div>
|
<span>具体详情请
|
||||||
|
<a href={href} target="_blank" download={fileName}>点击下载</a>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
@@ -351,21 +380,21 @@ export const JeroListMixin = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
/* 图片预览 */
|
/* 图片预览 */
|
||||||
getImgView(text){
|
getImgView(text) {
|
||||||
if(text && text.indexOf(",")>0){
|
if (text && text.indexOf(",") > 0) {
|
||||||
text = text.substring(0,text.indexOf(","))
|
text = text.substring(0, text.indexOf(","))
|
||||||
}
|
}
|
||||||
return getFileAccessHttpUrl(text)
|
return getFileAccessHttpUrl(text)
|
||||||
},
|
},
|
||||||
/* 文件下载 */
|
/* 文件下载 */
|
||||||
// update--autor:lvdandan-----date:20200630------for:修改下载文件方法名uploadFile改为downloadFile------
|
// update--autor:lvdandan-----date:20200630------for:修改下载文件方法名uploadFile改为downloadFile------
|
||||||
downloadFile(text){
|
downloadFile(text) {
|
||||||
if(!text){
|
if (!text) {
|
||||||
this.$message.warning("未知的文件")
|
this.$message.warning("未知的文件")
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(text.indexOf(",")>0){
|
if (text.indexOf(",") > 0) {
|
||||||
text = text.substring(0,text.indexOf(","))
|
text = text.substring(0, text.indexOf(","))
|
||||||
}
|
}
|
||||||
let url = getFileAccessHttpUrl(text)
|
let url = getFileAccessHttpUrl(text)
|
||||||
window.open(url);
|
window.open(url);
|
||||||
|
|||||||
@@ -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