From 2980833047d8a20d42d7acddc5c9d5ec59db916f Mon Sep 17 00:00:00 2001 From: pplulee Date: Sun, 27 Sep 2026 11:46:17 +0800 Subject: [PATCH 1/2] feat: add select-all when assigning an item to members Co-authored-by: Cursor --- frontend/src/app.css | 14 +++++++++++++ frontend/src/pages/ItemAddPage.tsx | 32 +++++++++++++++++++++++++++++- 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/frontend/src/app.css b/frontend/src/app.css index 0288f53..ac0be84 100644 --- a/frontend/src/app.css +++ b/frontend/src/app.css @@ -286,6 +286,20 @@ body { margin-top: 2px; } +.bbs-member-select-item .ant-form-item-label > label { + width: 100%; +} + +.bbs-member-select-label { + flex: 1; + width: 100%; +} + +.bbs-member-select-label .ant-btn { + padding-inline: 0; + height: auto; +} + .bbs-member-check-group { display: flex; flex-direction: column; diff --git a/frontend/src/pages/ItemAddPage.tsx b/frontend/src/pages/ItemAddPage.tsx index 944765a..97109a1 100644 --- a/frontend/src/pages/ItemAddPage.tsx +++ b/frontend/src/pages/ItemAddPage.tsx @@ -111,6 +111,17 @@ export function ItemAddPage() { }, [watchPartyId]); const headCount = selectedUsers.length; + const allMemberIds = useMemo(() => members.map((m) => m.id), [members]); + const allSelected = allMemberIds.length > 0 && allMemberIds.every((id) => selectedUsers.includes(id)); + + const toggleSelectAllUsers = () => { + const next = allSelected ? [] : allMemberIds; + const hadError = form.getFieldError('users').length > 0; + form.setFieldsValue({users: next}); + if (next.length > 0 || hadError) { + void form.validateFields(['users']).catch(() => undefined); + } + }; const preview = useMemo(() => { if (splitMode === 'custom') return null; const raw = Number(amountInput); @@ -285,7 +296,26 @@ export function ItemAddPage() { + 记入谁名下(可多选) + + + } rules={[{required: true, type: 'array', min: 1, message: '请至少选择一名成员'}]} > Date: Sun, 27 Sep 2026 12:56:44 +0800 Subject: [PATCH 2/2] fix: load charges assigned to the current user and run CI on self-hosted Co-authored-by: Cursor --- .github/workflows/docker.yml | 2 +- .github/workflows/go-tests.yml | 2 +- internal/httpapi/items.go | 4 ++-- internal/httpapi/party.go | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index f149970..92e0f87 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -20,7 +20,7 @@ concurrency: jobs: build: - runs-on: ubuntu-latest + runs-on: self-hosted steps: - name: Checkout diff --git a/.github/workflows/go-tests.yml b/.github/workflows/go-tests.yml index bf2c33a..4395070 100644 --- a/.github/workflows/go-tests.yml +++ b/.github/workflows/go-tests.yml @@ -11,7 +11,7 @@ concurrency: jobs: test: - runs-on: ubuntu-latest + runs-on: self-hosted steps: - name: Checkout diff --git a/internal/httpapi/items.go b/internal/httpapi/items.go index db44cd0..a5af5a9 100644 --- a/internal/httpapi/items.go +++ b/internal/httpapi/items.go @@ -384,8 +384,8 @@ type itemRow struct { Amount string `json:"amount"` Paid bool `json:"paid"` CreatedAt time.Time `json:"created_at"` - UserID uint64 `json:"userid"` - Initiator uint64 `json:"initiator"` + UserID uint64 `gorm:"column:userid" json:"userid"` + Initiator uint64 `gorm:"column:initiator" json:"initiator"` PayerName string `json:"payer_name"` InitiatorName string `json:"initiator_name"` } diff --git a/internal/httpapi/party.go b/internal/httpapi/party.go index ef769e0..dbf07bb 100644 --- a/internal/httpapi/party.go +++ b/internal/httpapi/party.go @@ -398,8 +398,8 @@ func (h *Handler) showParty(c *gin.Context) { Description string `json:"description"` Amount string `json:"amount"` Paid bool `json:"paid"` - UserID uint64 `json:"userid"` - Initiator uint64 `json:"initiator"` + UserID uint64 `gorm:"column:userid" json:"userid"` + Initiator uint64 `gorm:"column:initiator" json:"initiator"` PayerName string `json:"payer_name"` InitiatorName string `json:"initiator_name"` }