-
} onClick={openCreate}>
- 新增对接客服
-
- }
- />
-
-
- }
- placeholder="搜索姓名 / 备注"
- value={keywordInput}
- onChange={(event) => setKeywordInput(event.target.value)}
- style={{ width: 280 }}
- />
-
- } onClick={() => void query.refetch()}>
- 刷新
-
-
- 共 {total} 个,本页启用 {enabledCount} 个
+
+
+ }
+ placeholder="搜索姓名 / 备注"
+ value={keywordInput}
+ onChange={(event) => setKeywordInput(event.target.value)}
+ style={{ width: 280 }}
+ />
+
+ } onClick={() => void query.refetch()}>
+ 刷新
+
+
+ 共 {total} 个,本页启用 {enabledCount} 个
+
+ {canManage ? (
+ } onClick={openCreate}>
+ 新增对接客服
+
+ ) : null}
+
+
+ 打手发布寄卖时必须选择对接客服;已被寄卖记录使用的客服只能禁用,不能删除。
diff --git a/apps/frontend/src/utils/admin-worker-platform-tabs.ts b/apps/frontend/src/utils/admin-worker-platform-tabs.ts
index 544bd0f4..20c46856 100644
--- a/apps/frontend/src/utils/admin-worker-platform-tabs.ts
+++ b/apps/frontend/src/utils/admin-worker-platform-tabs.ts
@@ -14,6 +14,7 @@
export const WORKER_PLATFORM_TAB_KEYS: readonly string[] = [
'orders',
'consignment-inventory',
+ 'consignment-contacts',
'consignment-submissions',
'leaderboard',
'cancel-requests',
@@ -38,6 +39,7 @@ export const WORKER_PLATFORM_TAB_KEYS: readonly string[] = [
*/
export const WORKER_PLATFORM_TAB_QUERY_KEYS: Record
= {
'consignment-inventory': [['admin-consignment-inventories'], ['admin-consignment-stats']],
+ 'consignment-contacts': [['admin-consignment-contacts']],
'consignment-submissions': [
['admin-consignment-submissions'],
['admin-consignment-submissions-pending-total'],
diff --git a/apps/frontend/tests/admin-worker-platform-tabs.test.ts b/apps/frontend/tests/admin-worker-platform-tabs.test.ts
index 38739609..7ce2a2e0 100644
--- a/apps/frontend/tests/admin-worker-platform-tabs.test.ts
+++ b/apps/frontend/tests/admin-worker-platform-tabs.test.ts
@@ -18,6 +18,13 @@ test('风控 tab 必须被 isWorkerPlatformTab 接受(漏登记会导致点击
assert.equal(isWorkerPlatformTab('risk-control'), true)
})
+test('对接客服 tab 必须被 isWorkerPlatformTab 接受,并登记切页刷新缓存', () => {
+ assert.equal(isWorkerPlatformTab('consignment-contacts'), true)
+ assert.deepEqual(WORKER_PLATFORM_TAB_QUERY_KEYS['consignment-contacts'], [
+ ['admin-consignment-contacts'],
+ ])
+})
+
test('每个登记了切页缓存的 tab 都必须在合法 tab 名单里', () => {
const nonTabs = new Set(WORKER_PLATFORM_NON_TAB_QUERY_KEYS)
for (const key of Object.keys(WORKER_PLATFORM_TAB_QUERY_KEYS)) {