fix: 驼峰转换下划线、lucene
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
<el-col :span="4">
|
||||
<div class="head-container">
|
||||
<el-input
|
||||
v-model="dept_name"
|
||||
v-model="deptName"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请输入部门名称"
|
||||
@@ -216,7 +216,7 @@
|
||||
:data="deptsDatas"
|
||||
:default-checked-keys="depChecked"
|
||||
:props="deptProps"
|
||||
node-key="deptId"
|
||||
node-key="dept_id"
|
||||
highlight-current
|
||||
check-strictly
|
||||
@check="handCheck"
|
||||
@@ -251,7 +251,7 @@
|
||||
<el-form-item label="用户名" prop="username">
|
||||
<el-input v-model="dataDialog.username" disabled style="width: 200px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="姓名" prop="presonName">
|
||||
<el-form-item label="姓名" prop="person_name">
|
||||
<el-input v-model="dataDialog.person_name" disabled style="width: 200px;" />
|
||||
</el-form-item>
|
||||
<el-table
|
||||
@@ -265,15 +265,15 @@
|
||||
<el-table-column label="数据权限">
|
||||
<template slot-scope="scope">
|
||||
<el-select
|
||||
v-model="scope.row.permissionId"
|
||||
v-model="scope.row.permission_id"
|
||||
placeholder="请选择"
|
||||
@change="openRelevance(scope.row, scope.$index)"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in permissions"
|
||||
:key="item.permissionId"
|
||||
:key="item.permission_id"
|
||||
:label="item.name"
|
||||
:value="item.permissionId"
|
||||
:value="item.permission_id"
|
||||
/>
|
||||
</el-select>
|
||||
</template>
|
||||
@@ -395,7 +395,7 @@ export default {
|
||||
dataPerm: false,
|
||||
dataDialog: {},
|
||||
permissions: [],
|
||||
permissionId: '',
|
||||
permission_id: '',
|
||||
multipleSelection: [], // 选中
|
||||
relevanceUser: false, // 关联用户
|
||||
rowData: {}, // 当行数据
|
||||
@@ -465,7 +465,7 @@ export default {
|
||||
this.getSupDepts(form.dept_id)
|
||||
}
|
||||
// this.getRoleLevel() 暂时不用
|
||||
form.is_used = form.enabled.toString()
|
||||
// form.is_used = form.enabled.toString()
|
||||
},
|
||||
// 新增前将多选的值设置为空
|
||||
[CRUD.HOOK.beforeToAdd]() {
|
||||
@@ -534,11 +534,8 @@ export default {
|
||||
}, 100)
|
||||
},
|
||||
getDepts() {
|
||||
console.log('获取部门')
|
||||
crudDept.getDepts({ is_used: true }).then(res => {
|
||||
console.log('获取的部门信息', res)
|
||||
this.depts = res.content.map(function(obj) {
|
||||
console.log('---', obj)
|
||||
if (obj.hasChildren) {
|
||||
obj.children = null
|
||||
}
|
||||
@@ -548,7 +545,6 @@ export default {
|
||||
},
|
||||
getSupDepts(deptId) {
|
||||
crudDept.getDeptSuperior(deptId).then(res => {
|
||||
console.log('父部门', res)
|
||||
const date = res.content
|
||||
this.buildDepts(date)
|
||||
this.depts = date
|
||||
@@ -580,7 +576,7 @@ export default {
|
||||
},
|
||||
normalizer(node) {
|
||||
return {
|
||||
id: node.deptId,
|
||||
id: node.dept_id,
|
||||
label: node.name,
|
||||
children: node.children
|
||||
}
|
||||
@@ -643,13 +639,13 @@ export default {
|
||||
crudDept.getDeptTree().then(res => {
|
||||
this.deptsDatas = res.content
|
||||
})
|
||||
this.openDrawer()
|
||||
this.openDrawer() // 打开抽屉
|
||||
this.drawerTitle = '分配部门权限'
|
||||
this.flag = true
|
||||
// 默认选中
|
||||
const deptIds = []
|
||||
for (var index in row.depts) {
|
||||
deptIds.push(row.depts[index].deptId)
|
||||
deptIds.push(row.depts[index].dept_id)
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.$refs.deptUser.setCheckedKeys(deptIds)
|
||||
@@ -684,23 +680,25 @@ export default {
|
||||
this.multipleSelection = []
|
||||
// 获取权限范围
|
||||
crudDataPermission.getDataScopeType().then(res => {
|
||||
console.log('权限范围', res)
|
||||
this.dataDialog.dataScopeType = res
|
||||
// permissions
|
||||
crudDataPermission.getDataPermissionOption().then(res => {
|
||||
// console.log(res)
|
||||
console.log('数据权限', res)
|
||||
this.permissions = res
|
||||
this.dataDialog.person_name = row.person_name
|
||||
this.dataDialog.username = row.username
|
||||
this.dataDialog.userId = row.userId
|
||||
this.dataDialog.user_id = row.user_id
|
||||
this.dataPermissionTitle = '[' + row.person_name + '] 数据权限'
|
||||
this.dataPerm = true
|
||||
// 回显数据
|
||||
crudDataPermission.getDataShow(row.userId).then(res => {
|
||||
crudDataPermission.getDataShow(row.user_id).then(res => {
|
||||
console.log('要回显的数据', res)
|
||||
this.$nextTick(function() {
|
||||
for (var index = 0; index < res.length; index++) {
|
||||
for (var i = 0; i < this.dataDialog.dataScopeType.length; i++) {
|
||||
if (this.dataDialog.dataScopeType[i].value == res[index].permissionScopeType) {
|
||||
this.dataDialog.dataScopeType[i].permissionId = res[index].permissionId
|
||||
this.dataDialog.dataScopeType[i].permission_id = res[index].permission_id
|
||||
if (res[index].users) this.dataDialog.dataScopeType[i].users = res[index].users
|
||||
if (res[index].depts) this.dataDialog.dataScopeType[i].depts = res[index].depts
|
||||
// 选中
|
||||
@@ -719,24 +717,23 @@ export default {
|
||||
},
|
||||
openRelevance(row, index) {
|
||||
for (var i = 0; i < this.permissions.length; i++) {
|
||||
if (this.permissions[i].permissionId != undefined && this.permissions[i].permissionId && this.permissions[i].permissionId != row.permissionId) {
|
||||
this.$delete(this.dataDialog.dataScopeType[index], this.permissions[i].permissionId.toString())
|
||||
if (this.permissions[i].permission_id != undefined && this.permissions[i].permission_id && this.permissions[i].permission_id != row.permission_id) {
|
||||
this.$delete(this.dataDialog.dataScopeType[index], this.permissions[i].permission_id.toString())
|
||||
}
|
||||
}
|
||||
this.$set(this.dataDialog.dataScopeType[index], this.dataDialog.dataScopeType[index].permissionId, row.permissionId)
|
||||
this.$set(this.dataDialog.dataScopeType[index], this.dataDialog.dataScopeType[index].permission_id, row.permission_id)
|
||||
this.rowData = {}
|
||||
this.deptIds = []
|
||||
this.userIds = []
|
||||
console.log(row)
|
||||
if (row.permissionId == '1605129738328870912') { // 选择用户
|
||||
if (row.permission_id == '1605129738328870912') { // 选择用户
|
||||
this.userIds = this.dataDialog.dataScopeType[index].users
|
||||
this.rowData = row
|
||||
this.relevanceUser = true
|
||||
} else if (row.permissionId == '1605129882164137984') { // 选择部门
|
||||
} else if (row.permission_id == '1605129882164137984') { // 选择部门
|
||||
this.deptIds = this.dataDialog.dataScopeType[index].depts
|
||||
this.rowData = row
|
||||
this.relevanceDept = true
|
||||
} else if (row.permissionId == '1605128919449735168') { // 自身
|
||||
} else if (row.permission_id == '1605128919449735168') { // 自身
|
||||
const param = {
|
||||
userId: this.dataDialog.userId
|
||||
}
|
||||
@@ -749,7 +746,7 @@ export default {
|
||||
},
|
||||
selectUsers(row) { // row对话框传来的数据
|
||||
for (var i = 0; i < this.dataDialog.dataScopeType.length; i++) {
|
||||
if (this.dataDialog.dataScopeType[i].dictId == this.rowData.dictId) {
|
||||
if (this.dataDialog.dataScopeType[i].dict_id == this.rowData.dict_id) {
|
||||
if (this.dataDialog.dataScopeType[i].depts != undefined && this.dataDialog.dataScopeType[i].depts.length > 0) this.dataDialog.dataScopeType[i].depts = []
|
||||
this.dataDialog.dataScopeType[i].users = row
|
||||
break
|
||||
@@ -759,7 +756,7 @@ export default {
|
||||
},
|
||||
selectDepts(row) {
|
||||
for (var i = 0; i < this.dataDialog.dataScopeType.length; i++) {
|
||||
if (this.dataDialog.dataScopeType[i].dictId == this.rowData.dictId) {
|
||||
if (this.dataDialog.dataScopeType[i].dict_id == this.rowData.dictId) {
|
||||
if (this.dataDialog.dataScopeType[i].users != undefined && this.dataDialog.dataScopeType[i].users.length > 0) this.dataDialog.dataScopeType[i].users = []
|
||||
this.dataDialog.dataScopeType[i].depts = row
|
||||
break
|
||||
@@ -772,10 +769,9 @@ export default {
|
||||
},
|
||||
savePermise() {
|
||||
const param = {
|
||||
userId: this.dataDialog.userId,
|
||||
user_id: this.dataDialog.user_id,
|
||||
datas: this.multipleSelection
|
||||
}
|
||||
console.log('param', param)
|
||||
crudDataPermission.saveDataPermission(param).then(res => {
|
||||
this.dataPerm = false
|
||||
this.crud.notify('添加数据权限成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
@@ -788,7 +784,7 @@ export default {
|
||||
this.depChecked = []
|
||||
},
|
||||
giveValue(row) {
|
||||
this.depCheckedId = row.userId
|
||||
this.depCheckedId = row.user_id
|
||||
},
|
||||
clearCheck() { // 清空选中
|
||||
if (this.flag) this.$refs.deptUser.setCheckedKeys([])
|
||||
@@ -806,12 +802,12 @@ export default {
|
||||
},
|
||||
saveChecked() {
|
||||
const user = {
|
||||
userId: this.depCheckedId
|
||||
user_id: this.depCheckedId
|
||||
}
|
||||
if (this.flag) {
|
||||
user.deptIds = this.$refs.deptUser.getCheckedKeys()
|
||||
} else {
|
||||
user.rolesIds = this.crud.selections.map(item => (item.roleId))
|
||||
user.rolesIds = this.crud.selections.map(item => (item.role_id))
|
||||
}
|
||||
crudUser.edit(user).then(res => {
|
||||
this.cancelForm()
|
||||
|
||||
Reference in New Issue
Block a user