样式修改
This commit is contained in:
1 parent
f87f6031de
commit
c0e3c5d692
3 files changed
+211
-4
No files matched your search
@@ -21,8 +21,8 @@
|
||||
*
|
||||
* 详见 `docs/multi-agent-business-chain-dev.md` §7 阶段 1。
|
||||
*/
|
||||
import { useCallback, useEffect, useMemo, useState } from "react";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
||||
import { useNavigate, useSearchParams } from "react-router-dom";
|
||||
import { toast } from "sonner";
|
||||
import { nanoid } from "nanoid";
|
||||
import {
|
||||
@@ -101,6 +101,7 @@ type ActiveDrag =
|
||||
|
||||
export default function BusinessChainEditorPage() {
|
||||
const navigate = useNavigate();
|
||||
const [searchParams] = useSearchParams();
|
||||
|
||||
// ─── 数据 ────────────────────────────────────────────────────────────
|
||||
const [pool, setPool] = useState<RecommendCandidate[]>([]);
|
||||
@@ -184,6 +185,19 @@ export default function BusinessChainEditorPage() {
|
||||
setSeats([]);
|
||||
}, []);
|
||||
|
||||
// ─── URL 参数 chainId:从「业务链条」弹窗点「设置」进来时自动切到该链条 ──────
|
||||
// 只在链条列表加载完后应用一次(用 ref 闸门避免覆盖用户后续的手动切换)。
|
||||
const appliedChainParamRef = useRef(false);
|
||||
useEffect(() => {
|
||||
if (appliedChainParamRef.current) return;
|
||||
const chainId = searchParams.get("chainId");
|
||||
if (!chainId) return;
|
||||
if (chains.length === 0) return; // 等 refreshChains 拉回列表
|
||||
const chain = chains.find((c) => c.id === chainId);
|
||||
if (chain) loadChain(chain);
|
||||
appliedChainParamRef.current = true; // 命中或链条已不存在,都不再重试
|
||||
}, [chains, searchParams, loadChain]);
|
||||
|
||||
// ─── 席位增删改 ───────────────────────────────────────────────────────
|
||||
const addAgentToSeats = useCallback(
|
||||
(agentId: string, atIndex?: number) => {
|
||||
|
||||
Reference in new issue
Block a user