|
|
@ -307,16 +307,20 @@ |
|
|
<el-button @click="transferDialog.visible = false">{{$t('form.cancel')}}</el-button> |
|
|
<el-button @click="transferDialog.visible = false">{{$t('form.cancel')}}</el-button> |
|
|
</div> |
|
|
</div> |
|
|
</el-dialog> |
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
|
|
<Sign ref="signRef" @callback="doChangRoleUser" /> |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
import { listRole, getRole, delRole, addRole, updateRole, dataScope, changeRoleStatus, deptTreeSelect,allocatedUserList,authUserSetAll } from "@/api/system/role" |
|
|
import { listRole, getRole, delRole, addRole, updateRole, dataScope, changeRoleStatus, deptTreeSelect,allocatedUserList,authUserSetAll } from "@/api/system/role" |
|
|
import { treeselect as menuTreeselect, roleMenuTreeselect } from "@/api/system/menu" |
|
|
import { treeselect as menuTreeselect, roleMenuTreeselect } from "@/api/system/menu" |
|
|
|
|
|
import Sign from '@/views/business/study/comp/sign.vue' |
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
name: "Role", |
|
|
name: "Role", |
|
|
dicts: ['sys_normal_disable'], |
|
|
dicts: ['sys_normal_disable'], |
|
|
|
|
|
components:{Sign}, |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
// 遮罩层 |
|
|
// 遮罩层 |
|
|
@ -407,7 +411,9 @@ export default { |
|
|
|
|
|
|
|
|
list:[], |
|
|
list:[], |
|
|
selected:[], |
|
|
selected:[], |
|
|
roleId:'' |
|
|
|
|
|
|
|
|
roleId:'', |
|
|
|
|
|
|
|
|
|
|
|
oldIdList:[] |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
@ -593,6 +599,9 @@ export default { |
|
|
/** 修改按钮操作 */ |
|
|
/** 修改按钮操作 */ |
|
|
handleUpdate(row,readonly) { |
|
|
handleUpdate(row,readonly) { |
|
|
this.readonly = readonly |
|
|
this.readonly = readonly |
|
|
|
|
|
if(readonly){ |
|
|
|
|
|
this.saveSimpleLog({name:row.roleName,nameEn:row.roleName,jcmc:'角色详情',jcmcEn:'Role Detail'}) |
|
|
|
|
|
} |
|
|
this.reset() |
|
|
this.reset() |
|
|
const roleId = row.roleId || this.ids |
|
|
const roleId = row.roleId || this.ids |
|
|
const roleMenu = this.getRoleMenuTreeselect(roleId) |
|
|
const roleMenu = this.getRoleMenuTreeselect(roleId) |
|
|
@ -642,19 +651,22 @@ export default { |
|
|
submitForm: function() { |
|
|
submitForm: function() { |
|
|
this.$refs["form"].validate(valid => { |
|
|
this.$refs["form"].validate(valid => { |
|
|
if (valid) { |
|
|
if (valid) { |
|
|
|
|
|
this.$modal.loading() |
|
|
if (this.form.roleId != undefined) { |
|
|
if (this.form.roleId != undefined) { |
|
|
this.form.menuIds = this.getMenuAllCheckedKeys() |
|
|
this.form.menuIds = this.getMenuAllCheckedKeys() |
|
|
updateRole(this.form).then(response => { |
|
|
updateRole(this.form).then(response => { |
|
|
this.$modal.msgSuccess("修改成功") |
|
|
|
|
|
this.open = false |
|
|
this.open = false |
|
|
this.getList() |
|
|
this.getList() |
|
|
|
|
|
}).finally(()=>{ |
|
|
|
|
|
this.$modal.closeLoading() |
|
|
}) |
|
|
}) |
|
|
} else { |
|
|
} else { |
|
|
this.form.menuIds = this.getMenuAllCheckedKeys() |
|
|
this.form.menuIds = this.getMenuAllCheckedKeys() |
|
|
addRole(this.form).then(response => { |
|
|
addRole(this.form).then(response => { |
|
|
this.$modal.msgSuccess("新增成功") |
|
|
|
|
|
this.open = false |
|
|
this.open = false |
|
|
this.getList() |
|
|
this.getList() |
|
|
|
|
|
}).finally(()=>{ |
|
|
|
|
|
this.$modal.closeLoading() |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
@ -699,6 +711,8 @@ export default { |
|
|
this.transferDialog.selected = response.selected |
|
|
this.transferDialog.selected = response.selected |
|
|
this.transferDialog.list = list |
|
|
this.transferDialog.list = list |
|
|
this.transferDialog.roleId = row.roleId |
|
|
this.transferDialog.roleId = row.roleId |
|
|
|
|
|
|
|
|
|
|
|
this.transferDialog.oldIdList = _.cloneDeep(response.selected) |
|
|
this.transferDialog.visible = true |
|
|
this.transferDialog.visible = true |
|
|
} |
|
|
} |
|
|
) |
|
|
) |
|
|
@ -707,9 +721,35 @@ export default { |
|
|
return item.label.indexOf(query) > -1; |
|
|
return item.label.indexOf(query) > -1; |
|
|
}, |
|
|
}, |
|
|
changRoleUser(){ |
|
|
changRoleUser(){ |
|
|
authUserSetAll({ roleId: this.transferDialog.roleId, userIdList: this.transferDialog.selected && this.transferDialog.selected.length>0 ? this.transferDialog.selected:[] }).then(res => { |
|
|
|
|
|
|
|
|
let update = false |
|
|
|
|
|
let userIdList = this.transferDialog.selected && this.transferDialog.selected.length>0 ? this.transferDialog.selected:[] |
|
|
|
|
|
if(this.transferDialog.oldIdList.length!==userIdList.length){ |
|
|
|
|
|
update = true |
|
|
|
|
|
}else{ |
|
|
|
|
|
for(let i=0;i<this.transferDialog.oldIdList.length;i++){ |
|
|
|
|
|
if(_.findIndex(userIdList,o=>{return o===this.transferDialog.oldIdList[i]})==-1){ |
|
|
|
|
|
update = true |
|
|
|
|
|
break |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
if(update){ |
|
|
|
|
|
this.$refs.signRef.show( |
|
|
|
|
|
this.$t('page.system.role.fpjs'), |
|
|
|
|
|
this.$t('page.system.role.fpjs'), |
|
|
|
|
|
) |
|
|
|
|
|
}else{ |
|
|
this.transferDialog.visible = false |
|
|
this.transferDialog.visible = false |
|
|
}) |
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
doChangRoleUser(sign){ |
|
|
|
|
|
this.$modal.loading() |
|
|
|
|
|
authUserSetAll({ roleId: this.transferDialog.roleId, userIdList: this.transferDialog.selected && this.transferDialog.selected.length>0 ? this.transferDialog.selected:[] ,sign:sign}).then(res => { |
|
|
|
|
|
this.$refs.signRef.cancel() |
|
|
|
|
|
this.transferDialog.visible = false |
|
|
|
|
|
}).finally(()=>{ |
|
|
|
|
|
this.$modal.closeLoading() |
|
|
|
|
|
}) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|