用户管理启用禁用
This commit is contained in:
@@ -129,8 +129,12 @@
|
|||||||
}
|
}
|
||||||
this.picUrl = true
|
this.picUrl = true
|
||||||
let arr = paths.split(',')
|
let arr = paths.split(',')
|
||||||
|
console.log(this.fileList)
|
||||||
for(var a=0;a<arr.length;a++){
|
for(var a=0;a<arr.length;a++){
|
||||||
this.fileList.forEach((item)=>{
|
this.fileList.forEach((item)=>{
|
||||||
|
if(this.returnId){
|
||||||
|
item.url = this.getImgUrl(item.response.result.id,item.name)
|
||||||
|
}
|
||||||
if (item.url === arr[a]){
|
if (item.url === arr[a]){
|
||||||
item.uid = uidGenerator()
|
item.uid = uidGenerator()
|
||||||
item.response.status = 'history'
|
item.response.status = 'history'
|
||||||
@@ -189,6 +193,7 @@
|
|||||||
getAvatarView(){
|
getAvatarView(){
|
||||||
if(this.fileList.length>0){
|
if(this.fileList.length>0){
|
||||||
let url = this.fileList[this.fileList.length-1].url
|
let url = this.fileList[this.fileList.length-1].url
|
||||||
|
// console.log( getFileAccessHttpUrl(url),'url')
|
||||||
return getFileAccessHttpUrl(url)
|
return getFileAccessHttpUrl(url)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -53,7 +53,7 @@
|
|||||||
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||||
<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>
|
||||||
<a-button @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
|
<a-button @click="searchReset" icon="reload" class="reset-button" style="margin-left: 8px">重置</a-button>
|
||||||
</span>
|
</span>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
|
|||||||
@@ -13,15 +13,15 @@
|
|||||||
|
|
||||||
<a-col :md="6" :sm="12">
|
<a-col :md="6" :sm="12">
|
||||||
<a-form-item
|
<a-form-item
|
||||||
label="角色类型"
|
label="角色类型"
|
||||||
:labelCol="labelCol"
|
:labelCol="labelCol"
|
||||||
:wrapperCol="wrapperCol">
|
:wrapperCol="wrapperCol">
|
||||||
<a-tree-select
|
<a-tree-select
|
||||||
style="width:100%"
|
style="width:100%"
|
||||||
:dropdownStyle="{ maxHeight: '200px', overflow: 'auto' }"
|
:dropdownStyle="{ maxHeight: '200px', overflow: 'auto' }"
|
||||||
:treeData="treeRoleData"
|
:treeData="treeRoleData"
|
||||||
v-model="queryParam.roleId"
|
v-model="queryParam.roleId"
|
||||||
placeholder="请选择角色类型"
|
placeholder="请选择角色类型"
|
||||||
>
|
>
|
||||||
</a-tree-select>
|
</a-tree-select>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
@@ -29,15 +29,15 @@
|
|||||||
|
|
||||||
<a-col :md="6" :sm="12">
|
<a-col :md="6" :sm="12">
|
||||||
<a-form-item
|
<a-form-item
|
||||||
label="组织机构"
|
label="组织机构"
|
||||||
:labelCol="labelCol"
|
:labelCol="labelCol"
|
||||||
:wrapperCol="wrapperCol">
|
:wrapperCol="wrapperCol">
|
||||||
<a-tree-select
|
<a-tree-select
|
||||||
style="width:100%"
|
style="width:100%"
|
||||||
:dropdownStyle="{ maxHeight: '200px',maxWidth:'100px','overflow-x':'hidden',' overflo-y': 'auto' }"
|
:dropdownStyle="{ maxHeight: '200px',maxWidth:'100px','overflow-x':'hidden',' overflo-y': 'auto' }"
|
||||||
:treeData="treeDepartData"
|
:treeData="treeDepartData"
|
||||||
v-model="queryParam.departId"
|
v-model="queryParam.departId"
|
||||||
placeholder="请选择组织机构">
|
placeholder="请选择组织机构">
|
||||||
</a-tree-select>
|
</a-tree-select>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
@@ -56,7 +56,8 @@
|
|||||||
<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-button @click="downTemplate('用户导入模板')" type="primary" icon="download">下载模板</a-button>
|
||||||
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
|
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl"
|
||||||
|
@change="handleImportExcel">
|
||||||
<a-button type="primary" icon="import">导入</a-button>
|
<a-button type="primary" icon="import">导入</a-button>
|
||||||
</a-upload>
|
</a-upload>
|
||||||
<a-button @click="handleExportXls('用户列表')" type="primary" icon="export">导出</a-button>
|
<a-button @click="handleExportXls('用户列表')" type="primary" icon="export">导出</a-button>
|
||||||
@@ -71,6 +72,7 @@
|
|||||||
bordered
|
bordered
|
||||||
size="middle"
|
size="middle"
|
||||||
rowKey="id"
|
rowKey="id"
|
||||||
|
:scroll="{x:true}"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:dataSource="dataSource"
|
:dataSource="dataSource"
|
||||||
:pagination="ipagination"
|
:pagination="ipagination"
|
||||||
@@ -79,7 +81,9 @@
|
|||||||
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
|
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
|
||||||
@change="handleTableChange">
|
@change="handleTableChange">
|
||||||
|
|
||||||
<span slot="action" class="action-span-cell" slot-scope="text, record">
|
<span slot="action" class="action-span-cell" slot-scope="text, record">
|
||||||
|
<!-- 1是启用 2是禁用 按钮需要反着来-->
|
||||||
|
<a @click="handleEnable(record)" :class="{'color-red':record.status === 1}">{{record.status === 1 ? '禁用' : '启用'}}</a>
|
||||||
<a @click="handleEdit(record)" v-has="'user:edit'">编辑</a>
|
<a @click="handleEdit(record)" v-has="'user:edit'">编辑</a>
|
||||||
<a @click="resetPassword(record)">重置密码</a>
|
<a @click="resetPassword(record)">重置密码</a>
|
||||||
<a @click="handleDelete(record.id)" v-has="'sys:user:del'">删除</a>
|
<a @click="handleDelete(record.id)" v-has="'sys:user:del'">删除</a>
|
||||||
@@ -101,8 +105,10 @@
|
|||||||
<script>
|
<script>
|
||||||
import UserModal from './modules/UserModal'
|
import UserModal from './modules/UserModal'
|
||||||
import {getAction, getFileAccessHttpUrl} from '@/api/manage'
|
import {getAction, getFileAccessHttpUrl} from '@/api/manage'
|
||||||
|
import {frozenBatch} from '@api/api'
|
||||||
|
import '@/assets/less/TableExpand.less'
|
||||||
|
import {JeroListMixin} from '@/mixins/JeroListMixin'
|
||||||
import '@/assets/less/TableExpand.less'
|
import '@/assets/less/TableExpand.less'
|
||||||
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'
|
import {queryDepartTreeList, resetUserPassword} from '@api/api'
|
||||||
@@ -126,7 +132,7 @@ export default {
|
|||||||
key: 'rowIndex',
|
key: 'rowIndex',
|
||||||
width: 60,
|
width: 60,
|
||||||
align: 'center',
|
align: 'center',
|
||||||
customRender: function(t, r, index) {
|
customRender: function (t, r, index) {
|
||||||
return parseInt(index) + 1
|
return parseInt(index) + 1
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -135,14 +141,14 @@ export default {
|
|||||||
align: 'center',
|
align: 'center',
|
||||||
dataIndex: 'username',
|
dataIndex: 'username',
|
||||||
width: 120,
|
width: 120,
|
||||||
scopedSlots: { customRender: 'text' },
|
scopedSlots: {customRender: 'text'},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '用户姓名',
|
title: '用户姓名',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width: 100,
|
width: 160,
|
||||||
dataIndex: 'realname',
|
dataIndex: 'realname',
|
||||||
scopedSlots: { customRender: 'text' },
|
scopedSlots: {customRender: 'text'},
|
||||||
},
|
},
|
||||||
// {
|
// {
|
||||||
// title: "性别",
|
// title: "性别",
|
||||||
@@ -154,23 +160,23 @@ export default {
|
|||||||
{
|
{
|
||||||
title: '手机号',
|
title: '手机号',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width: 100,
|
width: 160,
|
||||||
dataIndex: 'phone',
|
dataIndex: 'phone',
|
||||||
scopedSlots: { customRender: 'text' },
|
scopedSlots: {customRender: 'text'},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '角色',
|
title: '角色',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width: 100,
|
width: 100,
|
||||||
dataIndex: 'roleName',
|
dataIndex: 'roleName',
|
||||||
scopedSlots: { customRender: 'text' },
|
scopedSlots: {customRender: 'text'},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '组织机构',
|
title: '组织机构',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width: 180,
|
width: 180,
|
||||||
dataIndex: 'departIds_dictText',
|
dataIndex: 'departIds_dictText',
|
||||||
scopedSlots: { customRender: 'text' },
|
scopedSlots: {customRender: 'text'},
|
||||||
},
|
},
|
||||||
// {
|
// {
|
||||||
// title: '生日',
|
// title: '生日',
|
||||||
@@ -188,30 +194,37 @@ export default {
|
|||||||
title: '创建时间',
|
title: '创建时间',
|
||||||
dataIndex: 'createTime',
|
dataIndex: 'createTime',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width: 170
|
width: 170,
|
||||||
|
scopedSlots: {customRender: 'text'},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '状态',
|
||||||
|
align: 'center',
|
||||||
|
width: 80,
|
||||||
|
dataIndex: 'status_dictText',
|
||||||
|
scopedSlots: {customRender: 'text'},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',
|
||||||
dataIndex: 'action',
|
dataIndex: 'action',
|
||||||
scopedSlots: { customRender: 'action' },
|
scopedSlots: {customRender: 'action'},
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width: 170
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
// 组织机构 下拉数据
|
// 组织机构 下拉数据
|
||||||
treeDepartData:[],
|
treeDepartData: [],
|
||||||
// 角色类型下拉数据
|
// 角色类型下拉数据
|
||||||
treeRoleData:[],
|
treeRoleData: [],
|
||||||
labelCol: {
|
labelCol: {
|
||||||
xs: { span: 24 },
|
xs: {span: 24},
|
||||||
sm: { span: 5 },
|
sm: {span: 5},
|
||||||
},
|
},
|
||||||
wrapperCol: {
|
wrapperCol: {
|
||||||
xs: { span: 20 },
|
xs: {span: 20},
|
||||||
sm: { span: 16 },
|
sm: {span: 16},
|
||||||
},
|
},
|
||||||
superQueryFieldList: [
|
superQueryFieldList: [
|
||||||
{ type: 'input', value: 'username', text: '用户账号' }
|
{type: 'input', value: 'username', text: '用户账号'}
|
||||||
],
|
],
|
||||||
url: {
|
url: {
|
||||||
list: '/sys/user/pageRoleAndDepart',
|
list: '/sys/user/pageRoleAndDepart',
|
||||||
@@ -219,7 +232,7 @@ export default {
|
|||||||
deleteBatch: '/sys/user/deleteBatch',
|
deleteBatch: '/sys/user/deleteBatch',
|
||||||
exportXlsUrl: '/sys/user/exportXls',
|
exportXlsUrl: '/sys/user/exportXls',
|
||||||
importExcelUrl: 'sys/user/importExcel',
|
importExcelUrl: 'sys/user/importExcel',
|
||||||
downTemplateUrl:'sys/user/exportTemplate'
|
downTemplateUrl: 'sys/user/exportTemplate'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -227,13 +240,13 @@ export default {
|
|||||||
this.loadDepartTreeData()
|
this.loadDepartTreeData()
|
||||||
this.initAllRole()
|
this.initAllRole()
|
||||||
},
|
},
|
||||||
computed:{
|
computed: {
|
||||||
importExcelUrl(){
|
importExcelUrl() {
|
||||||
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
|
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getAvatarView: function(avatar) {
|
getAvatarView: function (avatar) {
|
||||||
return getFileAccessHttpUrl(avatar)
|
return getFileAccessHttpUrl(avatar)
|
||||||
},
|
},
|
||||||
passwordModalOk() {
|
passwordModalOk() {
|
||||||
@@ -242,13 +255,13 @@ export default {
|
|||||||
/*
|
/*
|
||||||
* 组织机构下拉数据
|
* 组织机构下拉数据
|
||||||
* */
|
* */
|
||||||
loadDepartTreeData(){
|
loadDepartTreeData() {
|
||||||
const that = this
|
const that = this
|
||||||
queryDepartTreeList().then((res) => {
|
queryDepartTreeList().then((res) => {
|
||||||
if(res.success){
|
if (res.success) {
|
||||||
that.treeDepartData = []
|
that.treeDepartData = []
|
||||||
let treeList = res.result
|
let treeList = res.result
|
||||||
for(let a=0;a<treeList.length;a++){
|
for (let a = 0; a < treeList.length; a++) {
|
||||||
let temp = treeList[a]
|
let temp = treeList[a]
|
||||||
temp.isLeaf = temp.leaf
|
temp.isLeaf = temp.leaf
|
||||||
that.treeDepartData.push(temp)
|
that.treeDepartData.push(temp)
|
||||||
@@ -267,14 +280,33 @@ export default {
|
|||||||
/*
|
/*
|
||||||
* 重置密码
|
* 重置密码
|
||||||
* */
|
* */
|
||||||
resetPassword(record){
|
resetPassword(record) {
|
||||||
resetUserPassword({username:record.username}).then( res => {
|
resetUserPassword({username: record.username}).then(res => {
|
||||||
if(res.success){
|
if (res.success) {
|
||||||
this.$message.success(res.message)
|
this.$message.success(res.message)
|
||||||
}else {
|
} else {
|
||||||
this.$message.warning(res.message)
|
this.$message.warning(res.message)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
/*
|
||||||
|
* 启用禁用
|
||||||
|
* */
|
||||||
|
handleEnable(record) {
|
||||||
|
let status
|
||||||
|
if(record.status === 1) {
|
||||||
|
status = 2
|
||||||
|
}else if(record.status === 2){
|
||||||
|
status = 1
|
||||||
|
}
|
||||||
|
frozenBatch({ids: record.id, status}).then(res => {
|
||||||
|
if (res.success) {
|
||||||
|
this.$message.success(res.message)
|
||||||
|
this.loadData()
|
||||||
|
} else {
|
||||||
|
this.$message.warn(res.message)
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -282,4 +314,7 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
<style scoped lang="less">
|
<style scoped lang="less">
|
||||||
@import '~@assets/less/common.less';
|
@import '~@assets/less/common.less';
|
||||||
|
.color-red {
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user