From 585d90f0e3194d6b988a424036291921794678ab Mon Sep 17 00:00:00 2001 From: 马宇豪 <978517621@qq.com> Date: 星期三, 18 十二月 2024 14:28:12 +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