[update] 用户管理 角色配置

This commit is contained in:
zhaomeijing
2022-05-24 16:47:49 +08:00
parent a8184eaec6
commit 78815fd1d7
4 changed files with 203 additions and 7 deletions
@@ -0,0 +1,172 @@
<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"
style="width: 100%"
:placeholder="$t('selectUserRole')"
optionFilterProp="children"
v-model="selectedRole"
:getPopupContainer="(target) => target.parentNode">
<a-select-option v-for="(role,roleindex) in roleList" :key="roleindex.toString()" :value="role.id">
{{ role.roleName }}
</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: '',
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: [],
}
},
props: {
selectedRowKeysArray: {
type: String,
default: '',
require: true
}
},
mounted() {
this.loadData()
},
methods: {
loadData() {
this.loading = true
let params = {}
getAction(`sys/role/queryall`, params).then(res => {
if (res.success) {
this.roleList = [...res.result]
}
}).finally(() => {
this.loading = false
})
},
searchQuery() {
this.loadData()
},
searchReset() {
this.form = {}
this.loadData()
},
handleCancel() {
this.$emit('areaVisibleTaskCutOffTimeflag', false)
},
handleTableChange(val) {
},
//保存
handleSubmit() {
console.log(this.selectedRole,'llllllll')
let _this = this
let param = {ids: this.selectedRowKeysArray, deadline: `${this.pickerDate}`, }
postAction('/params/collectManifest/updateDeadlineBatch', param).then((res) => {
if (res.success) {
this.$emit('areaVisibleTaskCutOffTimeflag', false)
this.$message.success(res.message)
} else {
this.$message.warning(res.message)
}
})
},
onChange(val) {
this.pickerDate = moment(val).format('YYYY-MM-DD HH:mm:ss')
},
onOk(val) {
this.pickerDate = moment(val).format('YYYY-MM-DD HH:mm:ss')
},
}
}
</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>