用户管理 编辑

This commit is contained in:
zyx.net
2022-11-16 14:22:02 +08:00
parent 2543d40046
commit 196d5a24dc
3 changed files with 16 additions and 4 deletions
+2
View File
@@ -12,6 +12,7 @@ const queryall = (params)=>getAction("/sys/role/queryall",params);
const addUser = (params)=>postAction("/sys/user/add",params);
const editUser = (params)=>putAction("/sys/user/edit",params);
const queryUserRole = (params)=>getAction("/sys/user/queryUserRole",params);
const queryViewerInfo = (params)=>getAction("/sys/user/queryViewerInfo",params);
const getUserList = (params)=>getAction("/sys/user/page",params);
const frozenBatch = (params)=>putAction("/sys/user/frozenBatch",params);
//验证用户是否存在
@@ -106,6 +107,7 @@ export {
addUser,
editUser,
queryUserRole,
queryViewerInfo,
getUserList,
queryall,
frozenBatch,
@@ -12,7 +12,7 @@
<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" @change='selectChange'>
<a-select mode="multiple" :placeholder="$t('PleaseSelect')+$t('RoleAssignment')" v-model:value="selectedRole" @change='selectChange'>
<a-select-option v-for="(role,roleindex) in roleList" :key="role.id" :value="role.id">
<span style="display: inline-block;width: 100%">
{{ role.roleName }}
@@ -81,7 +81,7 @@
:triggerChange="false" :dictCode="'duty_territory'"/>
</a-form-item>
<a-form-item v-if='viewshow' :label="$t('brand')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-multi-select-tag class="box-input" v-model="brands"
<j-multi-select-tag v-model="brands"
:placeholder="$t('PleaseSelect')+$t('brand')"
:type="'select'"
:triggerChange="false" :dictCode="'brand'"/>
@@ -208,7 +208,7 @@
import departWindow from './DepartWindow'
import { ACCESS_TOKEN } from '@/store/mutation-types'
import { getAction, postAction } from '@/api/manage'
import { addUser, editUser, queryUserRole, queryall,ajaxGetDictItems,getDictItemsFromCache } from '@/api/api'
import { addUser, editUser, queryUserRole,queryViewerInfo, queryall,ajaxGetDictItems,getDictItemsFromCache } from '@/api/api'
import { disabledAuthFilter } from '@/utils/authFilter'
import { duplicateCheck } from '@/api/api'
import JImageUpload from '../../../components/jero/JImageUpload'
@@ -361,6 +361,7 @@
})
},
loadUserRoles(userid) {
console.log(11)
queryUserRole({ userid: userid }).then((res) => {
if (res.success) {
this.selectedRole = res.result
@@ -376,12 +377,17 @@
}
})
})
this.initDictData()
} else {
console.log(res.message)
}
})
},
loadUserduty(userid) {
queryViewerInfo({ userId: userid }).then((res) => {
this.dutyTerritories = res.dutyTerritoryList.join(',')
this.brands = res.brandList.join(',')
})
},
selectChange(value){
value.map((item,index) => {
this.roleList.map((val,index) => {
@@ -462,6 +468,7 @@
that.form.resetFields()
if (record.hasOwnProperty('id')) {
that.loadUserRoles(record.id)
that.loadUserduty(record.id)
setTimeout(() => {
this.fileList = record.avatar
}, 5)
@@ -824,6 +831,9 @@
background: #fff;
border-radius: 0 0 2px 2px;
}
/deep/.box-input .ant-select-selection--multiple{
height: 100px !important;
}
</style>
<style>
.selectUserRole .ant-select-selection--multiple {