Browse Source

fix: 树样式优化

temp
xuziqiang 4 months ago
parent
commit
2a6de583e1
  1. 5
      hx-ai-intelligent/src/App.vue
  2. 11
      hx-ai-intelligent/src/view/organizationManage/departmentManage/index.vue
  3. 8
      lib/component/tree/tree-api.vue

5
hx-ai-intelligent/src/App.vue

@ -48,6 +48,11 @@
height: 100%; height: 100%;
} }
} }
:deep(.ant-tree-node-content-wrapper) {
overflow: hidden;
text-overflow: ellipsis;
text-wrap: nowrap;
}
// :deep(.ant-menu-item), // :deep(.ant-menu-item),
// :deep(.ant-menu-submenu-title) { // :deep(.ant-menu-submenu-title) {
// &:not(.ant-menu-item-selected) { // &:not(.ant-menu-item-selected) {

11
hx-ai-intelligent/src/view/organizationManage/departmentManage/index.vue

@ -17,7 +17,7 @@
@select="SelectApartmentTree"> @select="SelectApartmentTree">
<template #title="data"> <template #title="data">
<div style="display: flex; justify-content: space-between; align-items: center"> <div style="display: flex; justify-content: space-between; align-items: center">
<span>{{ data.deptInfo?.deptName }}</span> <span class="treeContent">{{ data.deptInfo?.deptName }}</span>
<a-dropdown> <a-dropdown>
<ns-icon name="actionMore" size="14" class="actionMore" /> <ns-icon name="actionMore" size="14" class="actionMore" />
<template #overlay> <template #overlay>
@ -96,7 +96,7 @@
@select="SelectUserTree"> @select="SelectUserTree">
<template #title="data"> <template #title="data">
<div style="display: flex; justify-content: space-between; align-items: center"> <div style="display: flex; justify-content: space-between; align-items: center">
<span> {{ data.zhName }}</span> <span class="treeContent"> {{ data.zhName }}</span>
<a-dropdown> <a-dropdown>
<ns-icon name="actionMore" size="14" class="actionMore" /> <ns-icon name="actionMore" size="14" class="actionMore" />
<template #overlay> <template #overlay>
@ -819,6 +819,7 @@
border-radius: @ns-border-radius; border-radius: @ns-border-radius;
border: 1px solid #ebeef5; border: 1px solid #ebeef5;
padding: 16px; padding: 16px;
min-width: 100px;
} }
.list { .list {
padding-left: @ns-gap; padding-left: @ns-gap;
@ -863,4 +864,10 @@
.form { .form {
margin: 20px; margin: 20px;
} }
.treeContent {
overflow: hidden;
text-overflow: ellipsis;
text-wrap: nowrap;
}
</style> </style>

8
lib/component/tree/tree-api.vue

@ -10,7 +10,7 @@
</div> </div>
</div> </div>
<div style="min-height: 300px; overflow-y: scroll"> <div style="min-height: 150px; overflow-y: scroll">
<ns-tree v-if="treeData?.length" v-bind="getBindValue" v-model:selectedKeys="selectedKeys"> <ns-tree v-if="treeData?.length" v-bind="getBindValue" v-model:selectedKeys="selectedKeys">
<template #[item]="data" v-for="(item, index) in Object.keys($slots)" :key="index"> <template #[item]="data" v-for="(item, index) in Object.keys($slots)" :key="index">
<slot :name="item" v-bind="{ ...data, formModel } || {}"></slot> <slot :name="item" v-bind="{ ...data, formModel } || {}"></slot>
@ -138,9 +138,9 @@
font-weight: bold; font-weight: bold;
user-select: text; user-select: text;
padding: @gap; padding: @gap;
margin-bottom: @gap; // margin-bottom: @gap;
padding-bottom: 10px; // padding-bottom: 10px;
border-bottom: 1px solid #e9e9e9; // border-bottom: 1px solid #e9e9e9;
> span { > span {
padding-left: 6px; padding-left: 6px;

Loading…
Cancel
Save