fix(data): 历史数据切换成员列表排除当前查看的用户

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
17792275749
2026-05-26 16:04:51 +08:00
co-authored by Claude Sonnet 4.6
parent 3efd29c84e
commit 87b789f5f3
2 changed files with 11 additions and 1 deletions
@@ -58,6 +58,11 @@ Component({
source: {
type: String,
value: 'addMember'
},
/** 需要排除的用户 ID(history 模式下排除当前查看的成员) */
excludeUserId: {
type: String,
value: ''
}
},
@@ -111,7 +116,11 @@ Component({
wx.showLoading({ title: '加载中...', mask: true })
if (this.properties.source === 'history') {
get<HistoryApiItem[]>('weighingScale/v3/select/history/user', { userId }, { loading: false })
const params: Record<string, string> = { userId }
if (this.properties.excludeUserId) {
params.userIdExclude = this.properties.excludeUserId
}
get<HistoryApiItem[]>('weighingScale/v3/select/history/user', params, { loading: false })
.then((res: any) => {
const members: ExistingMember[] = (res.result ?? []).map((item: HistoryApiItem) => ({
id: item.userId,
+1
View File
@@ -100,6 +100,7 @@
<select-member-drawer
show="{{ showSelectDrawer }}"
source="history"
exclude-user-id="{{ userInfo.userId }}"
bind:select="onSelectMember"
bind:close="onCloseDrawer"
/>