feat(user): 用户页面搜索区新增用户昵称搜索框
- 在用户组件中将用户名搜索框替换为用户昵称搜索框。 - 给岗位设置最小宽度,防止内容缩起来。 fix(user-management-relation): 管理链路树显示问题 - 当组织类型不为公司时(为部门、方向、团队),为防止根节点变更导致下面的子节点出现紊乱,此时隐藏编辑按钮。 - 把用margin扩充宽度改为用min-width。 fix(role): 选中某角色后的操作列的透明显示问题 - 选中某角色后,当页面分辨率不够时(出现滚动条),创建时间等字段的内容会透过操作列 fix(post): 岗位的名称、编码字段的显示问题 - 给这两个字段设置最小宽度,防止它们缩起来。
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
* - 叶子节点:基层员工,没有下级
|
||||
*/
|
||||
|
||||
import { nextTick, onMounted, reactive, ref } from 'vue';
|
||||
import { computed, nextTick, onMounted, reactive, ref } from 'vue';
|
||||
import type { ElTree } from 'element-plus';
|
||||
import { ElButton, ElPopconfirm, ElTag } from 'element-plus';
|
||||
import { useBoolean } from '@sa/hooks';
|
||||
@@ -35,14 +35,37 @@ defineOptions({ name: 'UserManagementRelation' });
|
||||
* 组件 userQuery 定义
|
||||
*
|
||||
* @param fromUserIndex 是否不是从管理链路 index 页面访问(从 user 页面访问时为 true)
|
||||
* @param deptId 部门 ID
|
||||
* @param orgType 组织类型(company/dept/direction/team)
|
||||
*/
|
||||
interface userQuery {
|
||||
fromUserIndex?: boolean;
|
||||
deptId?: number | null;
|
||||
orgType?: string;
|
||||
}
|
||||
|
||||
// 从user的index组件访问管理链路,fromUserIndex为true,否则false; dept=100是灿能电力的id
|
||||
const { fromUserIndex = false, deptId = 100 } = defineProps<userQuery>();
|
||||
const { fromUserIndex = false, deptId = 100, orgType = 'company' } = defineProps<userQuery>();
|
||||
|
||||
/**
|
||||
* 判断节点是否为母节点(根节点)
|
||||
*
|
||||
* 母节点是指树形数据中的第一层节点
|
||||
*
|
||||
* @param data 节点数据
|
||||
*/
|
||||
function isRootNode(data: Api.SystemManage.UserManagementRelationTreeRespVO): boolean {
|
||||
return treeData.value.some(node => node.userId === data.userId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断母节点的编辑按钮是否应该隐藏
|
||||
*
|
||||
* 当组织类型为部门、方向或团队时,隐藏母节点的编辑按钮
|
||||
*/
|
||||
const shouldHideRootEdit = computed(() => {
|
||||
return fromUserIndex && orgType !== 'company';
|
||||
});
|
||||
|
||||
/**
|
||||
* 初始化搜索参数
|
||||
@@ -379,7 +402,6 @@ onMounted(async () => {
|
||||
:data="treeData"
|
||||
:props="treeProps"
|
||||
node-key="userId"
|
||||
default-expand-all
|
||||
:expand-on-click-node="false"
|
||||
@check="handleNodeCheck"
|
||||
>
|
||||
@@ -389,14 +411,14 @@ onMounted(async () => {
|
||||
<span>{{ node.label }}</span>
|
||||
<!-- <ElTag v-if="data.managerNickname" size="small" type="info">上级:{{ data.managerNickname }}</ElTag>-->
|
||||
</span>
|
||||
<div class="flex items-center">
|
||||
<div class="flex items-center" style="min-width: 200px;">
|
||||
<ElButton link type="primary" size="default" @click.stop="openAdd(data)">
|
||||
<template #icon>
|
||||
<icon-ic-round-plus class="text-icon" />
|
||||
</template>
|
||||
新增
|
||||
</ElButton>
|
||||
<ElButton link type="primary" size="small" @click.stop="openEdit(data)">
|
||||
<ElButton v-if="!(isRootNode(data) && shouldHideRootEdit)" link type="primary" size="small" @click.stop="openEdit(data)">
|
||||
<template #icon>
|
||||
<icon-ic-round-edit class="text-icon" />
|
||||
</template>
|
||||
@@ -416,7 +438,6 @@ onMounted(async () => {
|
||||
</ElButton>
|
||||
</template>
|
||||
</ElPopconfirm>
|
||||
<span v-else-if="hasChildren(data)" style="margin-left: 56px"></span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user