[update] 部门配置

This commit is contained in:
zhaomeijing
2022-05-25 09:40:50 +08:00
parent f00bce4f19
commit 29a9df0403
2 changed files with 168 additions and 1 deletions
+17 -1
View File
@@ -85,7 +85,7 @@
<!-- </a-upload>-->
<!-- <a-button type="primary" icon="hdd" @click="recycleBinVisible=true">{{$t('recycleBin')}}</a-button>-->
<a-button type="primary" icon="hdd" @click="RoleAssignment">{{$t('RoleAssignment')}}</a-button>
<a-button type="primary" icon="hdd" @click="recycleBinVisible=true">{{$t('departmentAllocation')}}</a-button>
<a-button type="primary" icon="hdd" @click="departmentAllocation">{{$t('departmentAllocation')}}</a-button>
<!-- <div @click="handleExportXls($t('userInformation'))" class="operator-text">-->
<!-- <a-icon type="export" :rotate="-90"/>-->
<!-- {{$t('export')}}-->
@@ -127,11 +127,16 @@
<a-modal v-model="rolevisible" :title="$t('RoleAssignment')" width='650px' :footer="null">
<role-assignment v-if='rolevisible' :selectedRowKeysArray='selectedRowKeys'></role-assignment>
</a-modal>
<!-- 部门配置 -->
<a-modal v-model="departmentvisible" :title="$t('RoleAssignment')" width='650px' :footer="null">
<department-allocation v-if='departmentvisible' :selectedRowKeysArray='selectedRowKeys'></department-allocation>
</a-modal>
</a-card>
</template>
<script>
import RoleAssignment from './modules/RoleAssignment'
import DepartmentAllocation from './modules/departmentAllocation'
import UserModal from './modules/UserModal'
import PasswordModal from './modules/PasswordModal'
import { putAction, getFileAccessHttpUrl } from '@/api/manage'
@@ -145,6 +150,7 @@
name: 'UserList',
mixins: [JeroListMixin],
components: {
DepartmentAllocation,
RoleAssignment,
UserModal,
PasswordModal,
@@ -159,6 +165,7 @@
recycleBinVisible: false,
toggleSearchStatus:false,
rolevisible: false, // 角色配置得弹框
departmentvisible: false, // 部门配置得弹框
selectedRowKeys: [],
selectedRowKeysvalue: [],
columns: [
@@ -254,6 +261,15 @@
this.selectedRowKeys = val
this.selectedRowKeysvalue = value
},
// 部门配置
departmentAllocation() {
if(this.selectedRowKeys.length == 0) {
this.$message.warning(this.$t('selectLeastOne'))
} else {
this.departmentvisible = true
}
},
// 角色配置
RoleAssignment: function(){
if(this.selectedRowKeys.length == 0) {
this.$message.warning(this.$t('selectLeastOne'))
@@ -0,0 +1,151 @@
<template>
<div class='diolag-area'>
<a-spin :spinning='spinLoading'>
<a-form-model
class='tag-module'
ref='ruleForm'
:model='form'
:rules='rules'
:label-col='labelCol'
:wrapper-col='wrapperCol'
>
<a-row :gutter='24'>
<a-col :span='24'>
<a-form-item :label="$t('RoleAssignment')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select mode="multiple" :placeholder="$t('PleaseSelect')+$t('controlVerification')" v-model:value="selectedRole">
<a-select-option v-for="(role,roleindex) in roleList" :key="role.id" :value="role.id">
<span style="display: inline-block;width: 100%">
{{ role.roleName }}
</span>
</a-select-option>
</a-select>
</a-form-item>
</a-col>
</a-row>
</a-form-model>
</a-spin>
<div class='drawer-bootom-button'>
<a-button style='margin-right: .8rem' @click='handleCancel'>{{ $t('cancel') }}</a-button>
<a-button @click='handleSubmit' type='primary' :loading='confirmLoading'>{{ $t('determine') }}</a-button>
</div>
</div>
</template>
<script>
import { putAction, postAction, getAction, deleteAction } from '@/api/manage'
import axios from 'axios'
import Vue from 'vue'
import { ACCESS_TOKEN } from '@/store/mutation-types'
import moment from 'moment'
// import eventBUs from '../../common/event'
export default {
name: 'diolagArea',
components: {},
data() {
return {
token:Vue.ls.get(ACCESS_TOKEN),
title: this.$t('add'),
total: 0,
selectedRowKeysDate: {},
loading: false,
editId: '',
newVisible: false,
selectedRole: undefined,
labelCol: {
xs: { span: 24 },
sm: { span: 7 }
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 14 }
},
form: {},
rules: {},
areaTable: [],
flag: false, //表单提交标识
spinLoading: false,
confirmLoading: false,
selectedRowKeys: [],
roleList: [],
defaultValue: undefined
}
},
props: {
selectedRowKeysArray: {
type: Array,
default: [],
require: true
}
},
mounted() {
this.loadData()
},
methods: {
loadData() {
this.loading = true
getAction(`sys/role/queryall`, {}).then(res => {
if (res.success) {
this.roleList = [...res.result]
}
}).finally(() => {
this.loading = false
})
},
handleCancel() {
this.$emit('areaVisibleTaskCutOffTimeflag', false)
},
//保存
handleSubmit() {
let param = {ids: this.selectedRowKeysArray.join(','), selectedroles: `${this.selectedRole.join(',')}` }
postAction('/sys/user/setRole', param).then((res) => {
if (res.success) {
this.$emit('areaVisibleTaskCutOffTimeflag', false)
this.$message.success(res.message)
} else {
this.$message.warning(res.message)
}
})
}
}
}
</script>
<style lang='less' scoped>
@import '~@assets/less/common.less';
.diolag-area {
.table-area {
margin: 20px 0;
.action-edit {
margin-right: 10px;
}
}
.table-del {
color: red;
}
}
.drawer-bootom-button{
display: flex;
justify-content: center;
}
</style>
<style lang='less'>
.area-module {
.ant-modal-wrap {
.ant-modal {
.ant-modal-content {
.ant-modal-footer {
text-align: center;
}
}
}
}
}
.page{
display: flex;
justify-content: flex-end;
margin-bottom: 20px;
}
</style>