优化本地Mock接单
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
export type MockWorkOrderShop = {
|
||||
sellerId: string
|
||||
shopId: string
|
||||
shopName: string
|
||||
enabled: boolean
|
||||
}
|
||||
|
||||
export function buildMockWorkOrderShopOptions(shops: MockWorkOrderShop[]) {
|
||||
return shops
|
||||
.filter((shop) => shop.enabled)
|
||||
.map((shop) => {
|
||||
const value = String(shop.sellerId || shop.shopId || '').trim()
|
||||
const name = String(shop.shopName || shop.shopId || value).trim()
|
||||
return {
|
||||
value,
|
||||
label: `${name}(${value})`,
|
||||
}
|
||||
})
|
||||
.filter((shop) => Boolean(shop.value))
|
||||
}
|
||||
Reference in New Issue
Block a user