|
|
@ -16,6 +16,7 @@ |
|
|
<el-button v-if="isAuth('sys:user:save')" :disabled="this.showButton" type="primary" @click="deptAuthorize()">{{ buttons.deptAuthorization || '部门授权' }}</el-button> |
|
|
<el-button v-if="isAuth('sys:user:save')" :disabled="this.showButton" type="primary" @click="deptAuthorize()">{{ buttons.deptAuthorization || '部门授权' }}</el-button> |
|
|
<el-button v-if="isAuth('sys:user:save')" :disabled="this.showButton" type="primary" @click="businessRoleAuthorize()">{{ buttons.businessRoleAuthorization || '岗位' }} |
|
|
<el-button v-if="isAuth('sys:user:save')" :disabled="this.showButton" type="primary" @click="businessRoleAuthorize()">{{ buttons.businessRoleAuthorization || '岗位' }} |
|
|
</el-button> |
|
|
</el-button> |
|
|
|
|
|
<el-button v-if="isAuth('sys:user:save')" :disabled="this.showButton" type="primary" @click="specialAuthorize()">{{ buttons.specialCompetencies || '特殊权限' }}</el-button> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-form> |
|
|
</el-form> |
|
|
<el-table |
|
|
<el-table |
|
|
@ -663,7 +664,7 @@ import { listAccessDeptByUsername } from '@/api/factory/accessDept.js' |
|
|
import {saveAccessBU, saveBusinessRole} from '@/api/base/site.js' |
|
|
import {saveAccessBU, saveBusinessRole} from '@/api/base/site.js' |
|
|
import AddOrUpdate from './user-add-or-update' |
|
|
import AddOrUpdate from './user-add-or-update' |
|
|
import {saveUserBusinessRole} from '@/api/auditManagement/auditType.js' |
|
|
import {saveUserBusinessRole} from '@/api/auditManagement/auditType.js' |
|
|
import {updateUserSpecialSecurity} from '@/api/factory/userSpecialSecurity.js' |
|
|
|
|
|
|
|
|
import {getUserSpecialSecurity, updateUserSpecialSecurity} from '@/api/factory/userSpecialSecurity.js' |
|
|
import {throttle} from '../../../utils/common' |
|
|
import {throttle} from '../../../utils/common' |
|
|
import {searchFunctionButtonList} from '@/api/sysLanguage.js' |
|
|
import {searchFunctionButtonList} from '@/api/sysLanguage.js' |
|
|
import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js' |
|
|
import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js' |
|
|
@ -694,6 +695,23 @@ export default { |
|
|
userDisplay: '' |
|
|
userDisplay: '' |
|
|
}, |
|
|
}, |
|
|
columnList: [ |
|
|
columnList: [ |
|
|
|
|
|
{ |
|
|
|
|
|
userId: this.$store.state.user.name, |
|
|
|
|
|
serialNumber: 'security' + this.$route.meta.menuId + 'permissionCode', |
|
|
|
|
|
tableId: this.$route.meta.menuId + 'security', |
|
|
|
|
|
tableName: 'securityTable', |
|
|
|
|
|
columnProp: 'permissionCode', |
|
|
|
|
|
headerAlign: 'center', |
|
|
|
|
|
align: 'left', |
|
|
|
|
|
columnLabel: '权限号', |
|
|
|
|
|
columnHidden: false, |
|
|
|
|
|
columnImage: false, |
|
|
|
|
|
columnSortable: false, |
|
|
|
|
|
columnWidth: 28, |
|
|
|
|
|
sortLv: 0, |
|
|
|
|
|
status: true, |
|
|
|
|
|
fixed: '' |
|
|
|
|
|
}, |
|
|
{ |
|
|
{ |
|
|
userId: this.$store.state.user.name, |
|
|
userId: this.$store.state.user.name, |
|
|
serialNumber: 'security' + this.$route.meta.menuId + 'securitydesc', |
|
|
serialNumber: 'security' + this.$route.meta.menuId + 'securitydesc', |
|
|
@ -915,18 +933,49 @@ export default { |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 打开特殊权限 |
|
|
|
|
|
specialAuthorize () { |
|
|
|
|
|
if (!this.selectUser || !this.selectUser.username) { |
|
|
|
|
|
this.$message.warning('请先在列表中选中用户') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
this.dataListLoading = true |
|
|
|
|
|
getUserSpecialSecurity(encodeURIComponent(this.selectUser.username)).then(({ data }) => { |
|
|
|
|
|
this.dataListLoading = false |
|
|
|
|
|
if (data && data.code === 0) { |
|
|
|
|
|
const list = data.list || [] |
|
|
|
|
|
this.securityList = list.map(row => ({ |
|
|
|
|
|
...row, |
|
|
|
|
|
itemvalue: row.itemvalue === true || row.itemvalue === 'Y' |
|
|
|
|
|
})) |
|
|
|
|
|
this.specialVisible = true |
|
|
|
|
|
} else { |
|
|
|
|
|
this.$message.error((data && data.msg) || '加载失败') |
|
|
|
|
|
} |
|
|
|
|
|
}).catch(() => { |
|
|
|
|
|
this.dataListLoading = false |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
// 保存用户权限 |
|
|
// 保存用户权限 |
|
|
saveUserSecurity () { |
|
|
saveUserSecurity () { |
|
|
let securityList = JSON.parse(JSON.stringify(this.securityList)).map(item => { |
|
|
|
|
|
item.itemvalue = item.itemvalue === true ? 'Y' : 'N' |
|
|
|
|
|
return item |
|
|
|
|
|
}) |
|
|
|
|
|
updateUserSpecialSecurity(securityList).then(({data}) => { |
|
|
|
|
|
|
|
|
if (!this.selectUser || !this.selectUser.username) { |
|
|
|
|
|
this.$message.warning('未选中用户') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
const items = this.securityList.map(item => ({ |
|
|
|
|
|
permissionCode: item.permissionCode, |
|
|
|
|
|
itemvalue: item.itemvalue === true ? 'Y' : 'N' |
|
|
|
|
|
})) |
|
|
|
|
|
updateUserSpecialSecurity({ |
|
|
|
|
|
username: this.selectUser.username, |
|
|
|
|
|
items |
|
|
|
|
|
}).then(({data}) => { |
|
|
if (data.code === 0) { |
|
|
if (data.code === 0) { |
|
|
this.$message.success(data.msg) |
|
|
this.$message.success(data.msg) |
|
|
this.specialVisible = false |
|
|
this.specialVisible = false |
|
|
} else { |
|
|
} else { |
|
|
this.$message.success(data.msg) |
|
|
|
|
|
|
|
|
this.$message.error(data.msg || '保存失败') |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|