|
|
@ -107,40 +107,51 @@
|
|
|
|
</table-list>
|
|
|
|
</table-list>
|
|
|
|
</el-tab-pane>
|
|
|
|
</el-tab-pane>
|
|
|
|
<el-tab-pane label="角色" name="role">
|
|
|
|
<el-tab-pane label="角色" name="role">
|
|
|
|
<div class="role-list">
|
|
|
|
<template v-if="state.condition2.departmentId">
|
|
|
|
<div v-for="(item, index) in roleList" :key="index" class="system">
|
|
|
|
<div class="role-list">
|
|
|
|
<h3 class="system-header">
|
|
|
|
<div v-for="(item, index) in opts.system" :key="index" class="system">
|
|
|
|
{{ item.systemVO.systemName }}
|
|
|
|
<h3 class="system-header">
|
|
|
|
</h3>
|
|
|
|
{{ item.systemName }}
|
|
|
|
<div class="flex">
|
|
|
|
</h3>
|
|
|
|
<el-tag
|
|
|
|
<div class="flex">
|
|
|
|
v-for="(role, j) in item.roleListVO"
|
|
|
|
<el-tag
|
|
|
|
:key="index + '' + j"
|
|
|
|
v-for="(role, j) in store.getters['deptRole/roleList'](item.id)"
|
|
|
|
closable
|
|
|
|
:key="index + '' + j"
|
|
|
|
size="large"
|
|
|
|
closable
|
|
|
|
@close="handleDelRole(role.id)"
|
|
|
|
size="large"
|
|
|
|
>
|
|
|
|
@close="handleDelRole(role.id)"
|
|
|
|
{{ role.roleName }}
|
|
|
|
>
|
|
|
|
</el-tag>
|
|
|
|
{{ role.roleName }}
|
|
|
|
<el-popover v-model:visible="roleVisible" placement="top" :width="160">
|
|
|
|
</el-tag>
|
|
|
|
<!-- <el-select
|
|
|
|
<el-button @click="handleAddRole(item.id)">添加角色</el-button>
|
|
|
|
:config="{ label: 'roleName', value: 'id' }"
|
|
|
|
</div>
|
|
|
|
:opts="opts.role"
|
|
|
|
|
|
|
|
style="margin-bottom: 10px"
|
|
|
|
|
|
|
|
/> -->
|
|
|
|
|
|
|
|
<p>还没做</p>
|
|
|
|
|
|
|
|
<div style="text-align: right; margin: 0">
|
|
|
|
|
|
|
|
<el-button size="small" text @click="roleVisible = false">取消</el-button>
|
|
|
|
|
|
|
|
<el-button size="small" type="primary" @click="handleAddRole">确定</el-button>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<template #reference>
|
|
|
|
|
|
|
|
<el-button>添加角色</el-button>
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
</el-popover>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
<div v-if="!roleList.length" class="empty">暂无数据</div>
|
|
|
|
<div v-else class="empty">请选择组织架构</div>
|
|
|
|
|
|
|
|
<el-dialog v-model="roleVisible" title="添加角色">
|
|
|
|
|
|
|
|
<el-form v-loading="loading3">
|
|
|
|
|
|
|
|
<el-form-item>
|
|
|
|
|
|
|
|
<el-select
|
|
|
|
|
|
|
|
v-model="checkedRole"
|
|
|
|
|
|
|
|
:config="{
|
|
|
|
|
|
|
|
label: 'roleName',
|
|
|
|
|
|
|
|
value: 'id',
|
|
|
|
|
|
|
|
disabled: (item) =>
|
|
|
|
|
|
|
|
store.getters['deptRole/roleList'](currentSystemId).findIndex(
|
|
|
|
|
|
|
|
(role) => role.id === item.id
|
|
|
|
|
|
|
|
) !== -1,
|
|
|
|
|
|
|
|
}"
|
|
|
|
|
|
|
|
multiple
|
|
|
|
|
|
|
|
:opts="systemRoleList"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
</el-form>
|
|
|
|
|
|
|
|
<template #footer>
|
|
|
|
|
|
|
|
<el-button @click="roleVisible = false">取消</el-button>
|
|
|
|
|
|
|
|
<el-button :loading="loading3" type="primary" @click="handleSaveRole">确定</el-button>
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
</el-dialog>
|
|
|
|
</el-tab-pane>
|
|
|
|
</el-tab-pane>
|
|
|
|
</el-tabs>
|
|
|
|
</el-tabs>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
@ -282,7 +293,9 @@
|
|
|
|
/* 角色 */
|
|
|
|
/* 角色 */
|
|
|
|
const loading3 = ref(false);
|
|
|
|
const loading3 = ref(false);
|
|
|
|
const roleVisible = ref(false);
|
|
|
|
const roleVisible = ref(false);
|
|
|
|
const roleList = computed(() => _.cloneDeep(store.state.deptRole.list));
|
|
|
|
const systemRoleList = ref([]);
|
|
|
|
|
|
|
|
const currentSystemId = ref(null);
|
|
|
|
|
|
|
|
const checkedRole = ref([]);
|
|
|
|
const handleSearchRole = async () => {
|
|
|
|
const handleSearchRole = async () => {
|
|
|
|
if (state.condition3.departmentId) {
|
|
|
|
if (state.condition3.departmentId) {
|
|
|
|
loading3.value = true;
|
|
|
|
loading3.value = true;
|
|
|
@ -304,9 +317,34 @@
|
|
|
|
{ immediate: true, deep: true }
|
|
|
|
{ immediate: true, deep: true }
|
|
|
|
);
|
|
|
|
);
|
|
|
|
const handleDelRole = async (id) => {
|
|
|
|
const handleDelRole = async (id) => {
|
|
|
|
store.dispatch('deptRole/remove', { id });
|
|
|
|
store.dispatch('deptRole/remove', {
|
|
|
|
|
|
|
|
departmentId: state.condition3.departmentId,
|
|
|
|
|
|
|
|
isDeleteDepartmentOfEmployeeRole: true,
|
|
|
|
|
|
|
|
roleId: id,
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
const handleAddRole = async (id) => {
|
|
|
|
|
|
|
|
loading3.value = true;
|
|
|
|
|
|
|
|
roleVisible.value = true;
|
|
|
|
|
|
|
|
currentSystemId.value = id;
|
|
|
|
|
|
|
|
systemRoleList.value = await store.dispatch('deptRole/role', id);
|
|
|
|
|
|
|
|
loading3.value = false;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
const handleSaveRole = async () => {
|
|
|
|
|
|
|
|
loading3.value = true;
|
|
|
|
|
|
|
|
let res =
|
|
|
|
|
|
|
|
!unref(checkedRole).length ||
|
|
|
|
|
|
|
|
(await store.dispatch('deptRole/save', {
|
|
|
|
|
|
|
|
departmentId: state.condition3.departmentId,
|
|
|
|
|
|
|
|
isDistributionCurrentDepartmentEmployee: true,
|
|
|
|
|
|
|
|
roleIds: unref(checkedRole),
|
|
|
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
if (res) {
|
|
|
|
|
|
|
|
roleVisible.value = false;
|
|
|
|
|
|
|
|
handleSearchRole();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
loading3.value = false;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
const handleAddRole = async () => {};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* 表单 */
|
|
|
|
/* 表单 */
|
|
|
|
const refsForm = ref(null);
|
|
|
|
const refsForm = ref(null);
|
|
|
|