接单平台:新增店铺筛选条件,过滤快手店铺
This commit is contained in:
@@ -206,6 +206,18 @@ function isConsignmentRevocableOrder(row: WorkOrder) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 快手渠道自动生成的占位店铺名(`快手店铺-<sellerId>`)。
|
||||||
|
*
|
||||||
|
* 这类名字不是人工维护的门店,只是同步订单时没拿到店铺名兜底生成的;
|
||||||
|
* 后台「店铺」筛选中把它们隐藏掉,避免下拉里混进一串数字店铺。
|
||||||
|
*/
|
||||||
|
const AUTO_KUAISHOU_SHOP_NAME_PATTERN = /^快手店铺[--]?\s*\d*$/
|
||||||
|
|
||||||
|
function isAutoGeneratedKuaishouShopName(name: string) {
|
||||||
|
return AUTO_KUAISHOU_SHOP_NAME_PATTERN.test(String(name || '').trim())
|
||||||
|
}
|
||||||
|
|
||||||
export default function WorkOrdersPanel() {
|
export default function WorkOrdersPanel() {
|
||||||
const { message, modal } = App.useApp()
|
const { message, modal } = App.useApp()
|
||||||
const navigate = useNavigate()
|
const navigate = useNavigate()
|
||||||
@@ -1886,10 +1898,12 @@ export default function WorkOrdersPanel() {
|
|||||||
className="worker-orders-filter-select worker-orders-filter-select--wide"
|
className="worker-orders-filter-select worker-orders-filter-select--wide"
|
||||||
maxTagCount="responsive"
|
maxTagCount="responsive"
|
||||||
loading={shopOptionsQuery.isLoading}
|
loading={shopOptionsQuery.isLoading}
|
||||||
options={(shopOptionsQuery.data?.data.items || []).map((shopName) => ({
|
options={(shopOptionsQuery.data?.data.items || [])
|
||||||
value: shopName,
|
.filter((shopName) => !isAutoGeneratedKuaishouShopName(shopName))
|
||||||
label: shopName,
|
.map((shopName) => ({
|
||||||
}))}
|
value: shopName,
|
||||||
|
label: shopName,
|
||||||
|
}))}
|
||||||
onChange={(nextShopNames: string[]) => {
|
onChange={(nextShopNames: string[]) => {
|
||||||
setShopNames(nextShopNames)
|
setShopNames(nextShopNames)
|
||||||
setPage(1)
|
setPage(1)
|
||||||
|
|||||||
Reference in New Issue
Block a user