用户管理修改

This commit is contained in:
fengachen
2021-09-27 18:44:34 +08:00
parent 0f2eed699a
commit c22c21ff92
3 changed files with 41 additions and 22 deletions
+16 -14
View File
@@ -7,15 +7,16 @@
<!-- 搜索区域 -->
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="12">
<a-col :xl="6" :lg="8" :md="8" :sm="24">
<a-form-item label="角色名称" :labelCol="{span: 5}" :wrapperCol="{span: 18, offset: 1}">
<a-input placeholder="请输入角色名称" v-model="queryParam.roleName"></a-input>
</a-form-item>
</a-col>
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-col :md="12" :sm="24">
<a-button type="primary" @click="searchQuery" icon="search" style="margin-left: 21px" v-has="'sys:role:search'">查询</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
<a-col :xl="6" :lg="8" :md="8" :sm="24">
<a-button type="primary" @click="searchQuery" icon="search" style="margin-left: 21px"
v-has="'sys:role:search'">查询</a-button>
<a-button class="reset-button" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
</a-col>
</span>
</a-row>
@@ -24,7 +25,8 @@
<!-- 操作按钮区域 -->
<div class="table-operator" style="margin: 5px 0 10px 2px">
<a-button @click="handleAdd" type="primary" icon="plus" v-has="'sys:role:add'">新增</a-button>
<a-button @click="handleAddLowerLevel" type="primary" icon="plus" v-has="'sys:role:addLowerLevel'">添加下级</a-button>
<a-button @click="handleAddLowerLevel" type="primary" icon="plus" v-has="'sys:role:addLowerLevel'">添加下级
</a-button>
<a-button @click="batchDel" type="danger" icon="delete" v-has="'sys:role:batchDel'">批量删除</a-button>
</div>
<div style="margin-top: 15px">
@@ -60,8 +62,8 @@
</div>
</template>
<script>
import { JeroListMixin } from '@/mixins/JeroListMixin'
import { postAction } from '@/api/manage'
import {JeroListMixin} from '@/mixins/JeroListMixin'
import {postAction} from '@/api/manage'
import RoleModal from './modules/RoleModal'
import UserRoleModal from './modules/UserRoleModal'
import JEllipsis from '@comp/jero/JEllipsis'
@@ -94,13 +96,13 @@ export default {
align: 'center',
dataIndex: 'roleCode',
width: 160,
scopedSlots: { customRender: 'text' }
scopedSlots: {customRender: 'text'}
},
{
title: '角色名称',
align: 'center',
dataIndex: 'roleName',
scopedSlots: { customRender: 'text' }
scopedSlots: {customRender: 'text'}
},
{
title: '上级角色',
@@ -119,7 +121,7 @@ export default {
dataIndex: 'createTime',
align: 'center',
sorter: true,
scopedSlots: { customRender: 'text' },
scopedSlots: {customRender: 'text'},
customRender: (text) => {
return moment(text).format('YYYY-MM-DD HH:mm:ss')
}
@@ -128,7 +130,7 @@ export default {
title: '操作',
dataIndex: 'action',
align: 'center',
scopedSlots: { customRender: 'action' }
scopedSlots: {customRender: 'action'}
}
],
url: {
@@ -146,7 +148,7 @@ export default {
},
computed: {
importExcelUrl: function () {
return `${ window._CONFIG['domianURL'] }/${ this.url.importExcelUrl }`
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
}
},
methods: {
@@ -173,11 +175,11 @@ export default {
* */
handleAddLowerLevel() {
if (this.selectedRowKeys.length === 0) {
this.$message.warning('请选择一条记录')
this.$message.warning('请选择上级角色')
return
}
if (this.selectedRowKeys.length > 1) {
this.$message.warning('只能选择一条记录')
this.$message.warning('只能选择一个角色')
return
}
// 将这行的角色id作为新建角色的的父级id
+19 -5
View File
@@ -7,18 +7,28 @@
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="12">
<a-col :xl="6" :lg="8" :md="8" :sm="24">
<a-form-item label="用户账号">
<a-input placeholder="请输入用户账号" v-model="queryParam.username"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="12">
<a-col :xl="6" :lg="8" :md="8" :sm="24">
<a-form-item label="用户姓名">
<a-input placeholder="请输入用户姓名" v-model="queryParam.realname"></a-input>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="8" :md="8" :sm="24">
<a-form-item
label="角色类型"
:labelCol="labelCol"
:wrapperCol="wrapperCol">
<a-tree-select
:multiple="false"
show-search
tree-default-expand-all
tree-node-filter-prop="title"
style="width:100%"
:dropdownStyle="{ maxHeight: '200px', overflow: 'auto' }"
:treeData="treeRoleData"
@@ -29,12 +39,16 @@
</a-form-item>
</a-col>
<a-col :md="6" :sm="12">
<a-col :xl="6" :lg="8" :md="8" :sm="24">
<a-form-item
label="组织机构"
:labelCol="labelCol"
:wrapperCol="wrapperCol">
<a-tree-select
:multiple="false"
show-search
tree-default-expand-all
tree-node-filter-prop="title"
style="width:100%"
:dropdownStyle="{ maxHeight: '200px',maxWidth:'100px','overflow-x':'hidden',' overflo-y': 'auto' }"
:treeData="treeDepartData"
@@ -47,7 +61,7 @@
<a-col :md="6" :sm="8">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search" v-has="'user:search'">查询</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
<a-button class="reset-button" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
</span>
</a-col>
</a-row>
@@ -174,7 +188,7 @@ export default {
scopedSlots: { customRender: 'text' }
},
{
title: '角色',
title: '角色类型',
align: 'center',
width: 100,
dataIndex: 'roleName',
+6 -3
View File
@@ -106,6 +106,9 @@
:wrapperCol="wrapperCol">
<a-tree-select
multiple
show-search
tree-default-expand-all
tree-node-filter-prop="title"
style="width:100%"
:dropdownStyle="{ maxHeight: '200px', overflow: 'auto' }"
:treeData="treeRoleData"
@@ -245,8 +248,8 @@ export default {
},],
validateTrigger: 'blur'
},
selectedroles:{rules: [{required: true, message:'请选择角色类型'}], validateTrigger: ['blur','change']},
selecteddeparts:{rules: [{required: true, message:'请选择组织机构'}], validateTrigger: ['blur','change']}
selectedroles:{rules: [{required: true, message:'请选择角色类型'}], validateTrigger: ['change']},
selecteddeparts:{rules: [{required: true, message:'请选择组织机构'}], validateTrigger: ['change']}
// sex:{initialValue:((!this.model.sex)?"": (this.model.sex+""))}
},
departIdShow: false,
@@ -499,10 +502,10 @@ export default {
handleSubmit() {
console.log('username',this.form.getFieldValue('username'))
const that = this
that.confirmLoading = true
// 触发表单验证
this.form.validateFields((err, values) => {
if (!err) {
that.confirmLoading = true
console.log('values=======', values)
let formData = Object.assign(this.model, values)
if (that.fileList !== '') {