rev:基础功能维护修改
This commit is contained in:
@@ -122,9 +122,9 @@
|
||||
<!--:disabled="level !== 1 && item.level <= level"-->
|
||||
<el-option
|
||||
v-for="item in roles"
|
||||
:key="item.roleId"
|
||||
:key="item.role_id"
|
||||
:label="item.name"
|
||||
:value="item.roleId"
|
||||
:value="item.role_id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@@ -214,7 +214,7 @@
|
||||
:data="deptsDatas"
|
||||
:default-checked-keys="depChecked"
|
||||
:props="deptProps"
|
||||
node-key="dept_ud"
|
||||
node-key="dept_id"
|
||||
highlight-current
|
||||
check-strictly
|
||||
@check="handCheck"
|
||||
@@ -348,7 +348,7 @@ export default {
|
||||
name: 'User',
|
||||
components: { RelevanceDeptDialog, RelevanceUserDialog, Treeselect, crudOperation, rrOperation, udOperation, pagination },
|
||||
cruds() {
|
||||
return CRUD({ title: '用户', idField: 'userId', url: 'api/users', crudMethod: { ...crudUser }})
|
||||
return CRUD({ title: '用户', idField: 'user_id', url: 'api/users', crudMethod: { ...crudUser }})
|
||||
},
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
// 数据字典
|
||||
@@ -445,6 +445,7 @@ export default {
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
debugger
|
||||
this.crud.delAllLoading = true
|
||||
this.crud.doDelete(datas)
|
||||
}).catch(() => {
|
||||
@@ -453,10 +454,10 @@ export default {
|
||||
// 新增与编辑前做的操作
|
||||
[CRUD.HOOK.afterToCU](crud, form) {
|
||||
this.getRoles()
|
||||
if (form.dept_ud == null) {
|
||||
if (form.dept_id == null) {
|
||||
crudDept.getDepts()
|
||||
} else {
|
||||
this.getSupDepts(form.dept_ud)
|
||||
this.getSupDepts(form.dept_id)
|
||||
}
|
||||
// this.getRoleLevel() 暂时不用
|
||||
form.is_used = form.enabled.toString()
|
||||
@@ -541,8 +542,8 @@ export default {
|
||||
})
|
||||
})
|
||||
},
|
||||
getSupDepts(dept_ud) {
|
||||
crudDept.getDeptSuperior(dept_ud).then(res => {
|
||||
getSupDepts(dept_id) {
|
||||
crudDept.getDeptSuperior(dept_id).then(res => {
|
||||
console.log('父部门', res)
|
||||
const date = res.content
|
||||
this.buildDepts(date)
|
||||
@@ -575,17 +576,18 @@ export default {
|
||||
},
|
||||
normalizer(node) {
|
||||
return {
|
||||
id: node.dept_ud,
|
||||
id: node.dept_id,
|
||||
label: node.name,
|
||||
children: node.children
|
||||
}
|
||||
},
|
||||
// 切换部门
|
||||
handleNodeClick(data) {
|
||||
this.query.dept_ud = data.dept_ud
|
||||
debugger
|
||||
this.query.dept_id = data.dept_id
|
||||
this.query.needAll = true
|
||||
this.crud.toQuery()
|
||||
this.query.dept_ud = null
|
||||
this.query.dept_id = null
|
||||
},
|
||||
// 改变状态
|
||||
changeEnabled(row) {
|
||||
@@ -660,7 +662,7 @@ export default {
|
||||
this.$nextTick(function() {
|
||||
for (let j = 0; j < row.roles.length; j++) {
|
||||
for (let i = 0; i < this.rolesDatas.length; i++) {
|
||||
if (this.rolesDatas[i].roleId == row.roles[j].roleId) {
|
||||
if (this.rolesDatas[i].role_id === row.roles[j].role_id) {
|
||||
this.$refs.roleTable.toggleRowSelection(this.rolesDatas[i], true)
|
||||
break
|
||||
}
|
||||
@@ -686,11 +688,11 @@ export default {
|
||||
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 => {
|
||||
this.$nextTick(function() {
|
||||
for (var index = 0; index < res.length; index++) {
|
||||
for (var i = 0; i < this.dataDialog.dataScopeType.length; i++) {
|
||||
@@ -733,7 +735,7 @@ export default {
|
||||
this.relevanceDept = true
|
||||
} else if (row.permissionId == '1605128919449735168') { // 自身
|
||||
const param = {
|
||||
userId: this.dataDialog.userId
|
||||
user_id: this.dataDialog.user_id
|
||||
}
|
||||
this.dataDialog.dataScopeType[index].users = []
|
||||
this.dataDialog.dataScopeType[index].users.push(param)
|
||||
@@ -767,7 +769,7 @@ export default {
|
||||
},
|
||||
savePermise() {
|
||||
const param = {
|
||||
userId: this.dataDialog.userId,
|
||||
user_id: this.dataDialog.user_id,
|
||||
datas: this.multipleSelection
|
||||
}
|
||||
console.log('param', param)
|
||||
@@ -783,7 +785,7 @@ export default {
|
||||
this.depChecked = []
|
||||
},
|
||||
giveValue(row) {
|
||||
this.depCheckedId = row.userId
|
||||
this.depCheckedId = row.user_id
|
||||
},
|
||||
clearCheck() { // 清空选中
|
||||
if (this.flag) this.$refs.deptUser.setCheckedKeys([])
|
||||
@@ -801,12 +803,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()
|
||||
@@ -860,7 +862,7 @@ export default {
|
||||
},
|
||||
showDatas(row) {
|
||||
const param = {
|
||||
userId: this.dataDialog.userId,
|
||||
user_id: this.dataDialog.user_id,
|
||||
permissionScopeType: row.value
|
||||
}
|
||||
crudDataPermission.getDataDetail(param).then(res => {
|
||||
|
||||
Reference in New Issue
Block a user