feat(huya): 精英宝典账号支持转入外部单协作

This commit is contained in:
yml2213
2026-11-09 11:39:39 +08:00
parent 84883015b4
commit 2292864754
8 changed files with 223 additions and 2 deletions
+20
View File
@@ -7,6 +7,7 @@
* 3. **内联编辑必须带 `expected_version`**:别人先改过会 409,绝不静默覆盖(Excel 最痛的点)。
*/
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { useLocation, useNavigate } from 'react-router-dom';
import {
Alert, App, Badge, Button, Card, Checkbox, Col, Descriptions, Divider, Drawer, Dropdown,
Empty, Form, Image, Input, InputNumber, Modal, Popconfirm, Popover, Progress, Radio, Row, Select, Space, Statistic,
@@ -499,6 +500,8 @@ function ImageSlotEditor({
export default function HuyaCollabPage() {
const { modal } = App.useApp();
const { can, user } = usePermissions();
const location = useLocation();
const navigate = useNavigate();
const canEdit = can('huya:collab:edit');
const canManage = can('huya:collab:manage');
// 单行复制与批量导出共用这个权限点(默认运营和客服都有)
@@ -819,6 +822,23 @@ export default function HuyaCollabPage() {
[runCkPreview],
);
useEffect(() => {
const state = location.state as { transferCk?: string } | null;
const transferCk = state?.transferCk?.trim();
if (!transferCk) return;
setCreateOpen(true);
setCkPreview(null);
setPreviewing(false);
setGiftHint('');
setDraftRestoredAt(null);
previewSeq.current += 1;
createForm.resetFields();
createForm.setFieldsValue({ ck_text: transferCk });
scheduleCkPreview(transferCk, true);
navigate(location.pathname, { replace: true, state: null });
}, [createForm, location.pathname, location.state, navigate, scheduleCkPreview]);
const isArchiveView = filters.archive_scope === 'archived';
const selectedRows = useMemo(
() => rows.filter((row) => selectedIds.includes(row.id)),