fix(data): 历史数据切换成员列表排除当前查看的用户
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
3efd29c84e
commit
87b789f5f3
@@ -58,6 +58,11 @@ Component({
|
|||||||
source: {
|
source: {
|
||||||
type: String,
|
type: String,
|
||||||
value: 'addMember'
|
value: 'addMember'
|
||||||
|
},
|
||||||
|
/** 需要排除的用户 ID(history 模式下排除当前查看的成员) */
|
||||||
|
excludeUserId: {
|
||||||
|
type: String,
|
||||||
|
value: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -111,7 +116,11 @@ Component({
|
|||||||
wx.showLoading({ title: '加载中...', mask: true })
|
wx.showLoading({ title: '加载中...', mask: true })
|
||||||
|
|
||||||
if (this.properties.source === 'history') {
|
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) => {
|
.then((res: any) => {
|
||||||
const members: ExistingMember[] = (res.result ?? []).map((item: HistoryApiItem) => ({
|
const members: ExistingMember[] = (res.result ?? []).map((item: HistoryApiItem) => ({
|
||||||
id: item.userId,
|
id: item.userId,
|
||||||
|
|||||||
@@ -100,6 +100,7 @@
|
|||||||
<select-member-drawer
|
<select-member-drawer
|
||||||
show="{{ showSelectDrawer }}"
|
show="{{ showSelectDrawer }}"
|
||||||
source="history"
|
source="history"
|
||||||
|
exclude-user-id="{{ userInfo.userId }}"
|
||||||
bind:select="onSelectMember"
|
bind:select="onSelectMember"
|
||||||
bind:close="onCloseDrawer"
|
bind:close="onCloseDrawer"
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user