|
|
@@ -83,7 +83,10 @@
|
|
|
<el-tooltip v-if="scope.row.roleId !== 1" content="数据权限" placement="top">
|
|
|
<el-button v-hasPermi="['system:role:edit']" link type="primary" icon="CircleCheck" @click="handleDataScope(scope.row)"></el-button>
|
|
|
</el-tooltip>
|
|
|
- <el-tooltip content="分配用户" placement="top">
|
|
|
+ <el-tooltip v-if="scope.row.roleId !== 1" content="分配用户" placement="top">
|
|
|
+ <el-button v-hasPermi="['system:role:edit']" link type="primary" icon="User" @click="handleAuthUser(scope.row)"></el-button>
|
|
|
+ </el-tooltip>
|
|
|
+ <el-tooltip v-if="scope.row.roleId === 1 && isSuperAdmin" content="分配用户" placement="top">
|
|
|
<el-button v-hasPermi="['system:role:edit']" link type="primary" icon="User" @click="handleAuthUser(scope.row)"></el-button>
|
|
|
</el-tooltip>
|
|
|
</template>
|
|
|
@@ -196,7 +199,8 @@ import { addRole, changeRoleStatus, dataScope, delRole, getRole, listRole, updat
|
|
|
import { roleMenuTreeselect, treeselect as menuTreeselect } from '@/api/system/menu/index';
|
|
|
import { RoleVO, RoleForm, RoleQuery, DeptTreeOption } from '@/api/system/role/types';
|
|
|
import { MenuTreeOption, RoleMenuTree } from '@/api/system/menu/types';
|
|
|
-
|
|
|
+import {useUserStore} from '@/store/modules/user';
|
|
|
+import {ref} from "vue";
|
|
|
const router = useRouter();
|
|
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
|
const { sys_normal_disable } = toRefs<any>(proxy?.useDict('sys_normal_disable'));
|
|
|
@@ -216,6 +220,10 @@ const deptExpand = ref(true);
|
|
|
const deptNodeAll = ref(false);
|
|
|
const deptOptions = ref<DeptTreeOption[]>([]);
|
|
|
const openDataScope = ref(false);
|
|
|
+const userStore = useUserStore();
|
|
|
+const isSuperAdmin = ref(false);
|
|
|
+const userId = ref(userStore.userId);
|
|
|
+const permissions = ref(userStore.permissions);
|
|
|
|
|
|
/** 数据范围选项*/
|
|
|
const dataScopeOptions = ref([
|
|
|
@@ -496,7 +504,16 @@ const cancelDataScope = () => {
|
|
|
openDataScope.value = false;
|
|
|
};
|
|
|
|
|
|
+const userIsSuperAdmin = () => {
|
|
|
+ if (userId.value === 1 || permissions.value?.includes('*:*:*')) {
|
|
|
+ isSuperAdmin.value = true;
|
|
|
+ }else {
|
|
|
+ isSuperAdmin.value = false;
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
onMounted(() => {
|
|
|
getList();
|
|
|
+ userIsSuperAdmin();
|
|
|
});
|
|
|
</script>
|