feat: 完善接口19-顶部通知铃铛与站内通知中心
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 4m5s

This commit is contained in:
luo
2026-07-25 10:20:53 +08:00
parent eb13763020
commit 9289a6e940
37 changed files with 1264 additions and 226 deletions

View File

@@ -141,14 +141,14 @@
>
<ElOption
v-for="salesperson in salespersonOptions"
:key="salesperson.account_id"
:label="salesperson.account_name"
:value="salesperson.account_id"
:key="salesperson.id"
:label="salesperson.username"
:value="salesperson.id"
>
<div style="display: flex; justify-content: space-between">
<span>{{ salesperson.account_name }}</span>
<span>{{ salesperson.username }}</span>
<span style="font-size: 12px; color: var(--el-text-color-secondary)">
{{ salesperson.phone_masked }}
{{ salesperson.phone_summary }}
</span>
</div>
</ElOption>
@@ -328,10 +328,14 @@
import { useCheckedColumns } from '@/composables/useCheckedColumns'
import { useAuth } from '@/composables/useAuth'
import { generateShopCode } from '@/utils/codeGenerator'
import { ShopService, RoleService, AccountService } from '@/api/modules'
import { ShopService, RoleService } from '@/api/modules'
import type { SearchFormItem } from '@/types'
import type { PlatformSalesperson, ShopResponse, ShopRoleResponse } from '@/types/api'
import { AccountStatus, RoleType, RoleStatus } from '@/types/api'
import type {
ShopBusinessOwnerCandidate,
ShopResponse,
ShopRoleResponse
} from '@/types/api'
import { RoleType, RoleStatus } from '@/types/api'
import { formatDateTime } from '@/utils/business/format'
import { CommonStatus, getStatusText, STATUS_SELECT_OPTIONS } from '@/config/constants'
import { regionData } from '@/utils/constants/regionData'
@@ -349,7 +353,7 @@
const defaultRoleLoading = ref(false)
const defaultRoleList = ref<any[]>([])
const salespersonLoading = ref(false)
const salespersonOptions = ref<PlatformSalesperson[]>([])
const salespersonOptions = ref<ShopBusinessOwnerCandidate[]>([])
const detailDialogVisible = ref(false)
const detailShop = ref<ShopResponse | null>(null)
@@ -418,13 +422,11 @@
const searchPlatformSalespeople = async (query: string) => {
salespersonLoading.value = true
try {
const res = await AccountService.getPlatformSalespeople({
page: 1,
page_size: 20,
account_type: 'platform',
status: AccountStatus.ENABLED,
account_name: query || undefined
})
const res = await ShopService.getBusinessOwnerCandidates({
page: 1,
page_size: 20,
keyword: query || undefined
})
if (res.code === 0) {
salespersonOptions.value = res.data.items || []
}
@@ -436,15 +438,25 @@
}
}
const formatBusinessOwner = (shop: ShopResponse) => {
if (!shop.business_owner_name) return '-'
return shop.business_owner_phone_masked
? `${shop.business_owner_name} (${shop.business_owner_phone_masked})`
: shop.business_owner_name
}
const formatBusinessOwner = (shop: ShopResponse) => {
if (!shop.business_owner_username) return '-'
return shop.business_owner_phone_summary
? `${shop.business_owner_username} (${shop.business_owner_phone_summary})`
: shop.business_owner_username
}
const showDetail = (row: ShopResponse) => {
detailShop.value = row
const showDetail = async (row: ShopResponse) => {
try {
const response = await ShopService.getShopDetail(row.id)
if (response.code !== 0 || !response.data) {
ElMessage.error(response.msg || '获取店铺详情失败')
return
}
detailShop.value = response.data
} catch (error: any) {
ElMessage.error(error?.message || '获取店铺详情失败')
return
}
detailDialogVisible.value = true
}
@@ -570,8 +582,8 @@
},
options: () =>
salespersonOptions.value.map((salesperson) => ({
label: `${salesperson.account_name} (${salesperson.phone_masked})`,
value: salesperson.account_id
label: `${salesperson.username} (${salesperson.phone_summary})`,
value: salesperson.id
}))
}
])
@@ -584,7 +596,7 @@
{ label: '所在地区', prop: 'region' },
{ label: '联系人', prop: 'contact_name' },
{ label: '联系电话', prop: 'contact_phone' },
{ label: '平台业务员', prop: 'business_owner_name' },
{ label: '平台业务员', prop: 'business_owner_username' },
...(canModifyShopStatus ? [{ label: '状态', prop: 'status' }] : []),
{ label: '创建时间', prop: 'created_at' },
{ label: '操作', prop: 'operation' }
@@ -717,11 +729,11 @@
width: 130
},
{
prop: 'business_owner_name',
prop: 'business_owner_username',
label: '平台业务员',
minWidth: 180,
showOverflowTooltip: true,
formatter: (row: ShopResponse) => formatBusinessOwner(row)
formatter: (row: ShopResponse) => formatBusinessOwner(row)
},
...(canModifyShopStatus
? [