Showing
1 changed file
with
17 additions
and
3 deletions
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2022-08-29 14:31:20 | 2 | * @Date: 2022-08-29 14:31:20 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2024-07-27 19:44:50 | 4 | + * @LastEditTime: 2024-07-30 09:52:32 |
| 5 | * @FilePath: /data-table/src/components/OrgPickerField/MyComponent.vue | 5 | * @FilePath: /data-table/src/components/OrgPickerField/MyComponent.vue |
| 6 | * @Description: 树形组件 | 6 | * @Description: 树形组件 |
| 7 | --> | 7 | --> |
| ... | @@ -188,7 +188,7 @@ | ... | @@ -188,7 +188,7 @@ |
| 188 | <div> | 188 | <div> |
| 189 | <p>成员</p> | 189 | <p>成员</p> |
| 190 | <div style="border-top: 1px solid #eee; margin: 0.5rem 0;"></div> | 190 | <div style="border-top: 1px solid #eee; margin: 0.5rem 0;"></div> |
| 191 | - <div style="margin-bottom: 1rem;"> | 191 | + <div style="margin-bottom: 1rem; overflow: auto;"> |
| 192 | <van-checkbox | 192 | <van-checkbox |
| 193 | @click="onSearchResultClick(user, $event)" | 193 | @click="onSearchResultClick(user, $event)" |
| 194 | v-for="(user) in user_dept_role.user" | 194 | v-for="(user) in user_dept_role.user" |
| ... | @@ -198,7 +198,15 @@ | ... | @@ -198,7 +198,15 @@ |
| 198 | :key="user.id" | 198 | :key="user.id" |
| 199 | :name="user.id" | 199 | :name="user.id" |
| 200 | shape="square" icon-size="13px" :checked-color="styleColor.baseColor" style="margin-bottom: 0.5rem;"> | 200 | shape="square" icon-size="13px" :checked-color="styleColor.baseColor" style="margin-bottom: 0.5rem;"> |
| 201 | - {{ user.name }} | 201 | + <div class="van-ellipsis" :style="{ maxWidth: maxWidth + 'px' }"> |
| 202 | + <span>{{ user.name }}</span> | ||
| 203 | + <span v-if="user?.dept_list.length">/ | ||
| 204 | + <span v-for="(dept, index) in user?.dept_list" :key="dept.id">{{ dept.name }} </span> | ||
| 205 | + </span> | ||
| 206 | + <span v-if="user.role_list.length">/ | ||
| 207 | + <span v-for="(role, index) in user?.role_list" :key="role.id">{{ role.name }} </span> | ||
| 208 | + </span> | ||
| 209 | + </div> | ||
| 202 | </van-checkbox> | 210 | </van-checkbox> |
| 203 | <div v-if="!user_dept_role.user.length" style="color: #999;">暂无数据</div> | 211 | <div v-if="!user_dept_role.user.length" style="color: #999;">暂无数据</div> |
| 204 | </div> | 212 | </div> |
| ... | @@ -271,6 +279,8 @@ const tabList = computed(() => { | ... | @@ -271,6 +279,8 @@ const tabList = computed(() => { |
| 271 | return arr; | 279 | return arr; |
| 272 | }); | 280 | }); |
| 273 | 281 | ||
| 282 | +const maxWidth = ref(0); | ||
| 283 | + | ||
| 274 | onMounted(async () => { | 284 | onMounted(async () => { |
| 275 | // TAG: 获取后台数据 | 285 | // TAG: 获取后台数据 |
| 276 | const flowDeptList = await getFlowDeptListAPI({ form_code: $route.query.code }); | 286 | const flowDeptList = await getFlowDeptListAPI({ form_code: $route.query.code }); |
| ... | @@ -297,6 +307,10 @@ onMounted(async () => { | ... | @@ -297,6 +307,10 @@ onMounted(async () => { |
| 297 | // 发送到表单数据 | 307 | // 发送到表单数据 |
| 298 | tree_select_value.value = [].concat(...Object.values(emitCheckedGroup.value)); | 308 | tree_select_value.value = [].concat(...Object.values(emitCheckedGroup.value)); |
| 299 | } | 309 | } |
| 310 | + // 获取宽度处理成员角色值可能太长显示问题 | ||
| 311 | + nextTick(() => { | ||
| 312 | + maxWidth.value = $('.select-tree-box').width(); | ||
| 313 | + }) | ||
| 300 | }); | 314 | }); |
| 301 | 315 | ||
| 302 | const openTree = () => { | 316 | const openTree = () => { | ... | ... |
-
Please register or login to post a comment