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