From ff46cc24356b2cd2f23ab3cd7892e61b682d2b8c Mon Sep 17 00:00:00 2001
From: 祖安之光 <11848914+light-of-zuan@user.noreply.gitee.com>
Date: Mon, 11 May 2026 10:03:42 +0800
Subject: [PATCH] 主线提交
---
src/components/scrollSelect/index.vue | 23 +++++++++++++++++------
1 files changed, 17 insertions(+), 6 deletions(-)
diff --git a/src/components/scrollSelect/index.vue b/src/components/scrollSelect/index.vue
index 2be32c7..e80f5c4 100644
--- a/src/components/scrollSelect/index.vue
+++ b/src/components/scrollSelect/index.vue
@@ -1,7 +1,7 @@
<template>
<el-select v-if="isMounted" v-bind="$attrs" :remote-method="remoteMethod" @change="selectValueUser">
<div v-infinite-scroll="loadMore" style="overflow: hidden">
- <el-option v-for="dict in list" :key="dict.id" :label="dict.name" :value="dict.name" />
+ <el-option v-for="dict in list" :key="dict.id" :label="dict.username" :value="dict.username" />
</div>
</el-select>
</template>
@@ -27,7 +27,7 @@
const list = ref([
{
id: '',
- name: '无上级账号'
+ username: '无上级账号'
}
])
const queryFrom = ref({
@@ -46,7 +46,7 @@
const emit = defineEmits(["getval"]);
const selectValueUser = (val) => {
list.value.forEach(item => {
- if(item.name === val){
+ if(item.username === val){
emit('getval',item.id)
}
})
@@ -69,13 +69,24 @@
props.methods(queryFrom.value).then(res => {
const obj = {
id: '',
- name: '无上级账号'
+ username: '无上级账号'
}
if(type === 'change'){
- list.value = res.data.list
+ list.value = res.data.list.map(item => {
+ return {
+ ...item,
+ username: item.username +'(' + item.name +')'
+ }
+ })
list.value.unshift(obj)
}else {
- list.value = [...list.value, ...res.data.list]
+ const data = res.data.list.map(item => {
+ return {
+ ...item,
+ username: item.username +'(' + item.name +')'
+ }
+ })
+ list.value = [...list.value, ...data]
if(queryFrom.value.pageNum === 1){
list.value.unshift(obj)
}
--
Gitblit v1.9.2