Merge branch 'dhk-1' into 'master'
修改 See merge request knowledge-base-bj/deerflow-server!56
This commit is contained in:
commit
29fdb06cea
5 files changed
+11
-41
No files matched your search
@@ -119,7 +119,7 @@ export function WorkspaceNavChatList({
|
|||||||
</Link>
|
</Link>
|
||||||
</SidebarMenuButton>
|
</SidebarMenuButton>
|
||||||
</SidebarMenuItem>
|
</SidebarMenuItem>
|
||||||
<SidebarMenuItem>
|
{/* <SidebarMenuItem>
|
||||||
<SidebarMenuButton
|
<SidebarMenuButton
|
||||||
isActive={pathname.startsWith("/page/workspace/roundtable/planning")}
|
isActive={pathname.startsWith("/page/workspace/roundtable/planning")}
|
||||||
asChild
|
asChild
|
||||||
@@ -130,7 +130,7 @@ export function WorkspaceNavChatList({
|
|||||||
<span>多智能体规划</span>
|
<span>多智能体规划</span>
|
||||||
</Link>
|
</Link>
|
||||||
</SidebarMenuButton>
|
</SidebarMenuButton>
|
||||||
</SidebarMenuItem>
|
</SidebarMenuItem> */}
|
||||||
<SidebarMenuItem>
|
<SidebarMenuItem>
|
||||||
<SidebarMenuButton
|
<SidebarMenuButton
|
||||||
isActive={pathname === "/page/workspace/scheduled/tasks"}
|
isActive={pathname === "/page/workspace/scheduled/tasks"}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { env } from "@/env";
|
|||||||
* 素材的 recUuid 直接拼接在其后即为完整原文链接。
|
* 素材的 recUuid 直接拼接在其后即为完整原文链接。
|
||||||
*/
|
*/
|
||||||
export const INTRANET_SOURCE_URL_BASE =
|
export const INTRANET_SOURCE_URL_BASE =
|
||||||
"https://chlib.b.uat.4.cn/knowlibrary/#/knowledge/mid_detail?recUuid=";
|
"https://chlib.b.uat.4.cn/knowlibrary/#/knowledge/mid-detail?recUuid=";
|
||||||
|
|
||||||
/** 由 recUuid 构造内网原文详情页地址;recUuid 为空时返回空串。 */
|
/** 由 recUuid 构造内网原文详情页地址;recUuid 为空时返回空串。 */
|
||||||
export function buildIntranetSourceUrl(recUuid?: string | null): string {
|
export function buildIntranetSourceUrl(recUuid?: string | null): string {
|
||||||
|
|||||||
@@ -26,7 +26,10 @@ export const DESENSITIZE_MAP: Record<string, string> = {
|
|||||||
模拟: "MN",
|
模拟: "MN",
|
||||||
推演: "TY",
|
推演: "TY",
|
||||||
认知: "RZ",
|
认知: "RZ",
|
||||||
触及: "CJ"
|
触及: "CJ",
|
||||||
|
军: "J",
|
||||||
|
美军: "MJ",
|
||||||
|
台军: "TJ",
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import { useArticleTypes } from '../../hooks/useArticleTypes';
|
|||||||
interface AIWritingFormProps {
|
interface AIWritingFormProps {
|
||||||
onSubmit: (req: AIWritingRequest) => void;
|
onSubmit: (req: AIWritingRequest) => void;
|
||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
/** workspace 入口:隐藏检索关键词数量、严格模式、目标读者 */
|
/** workspace 入口:隐藏严格模式、目标读者 */
|
||||||
hideAdvancedFields?: boolean;
|
hideAdvancedFields?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -33,7 +33,7 @@ const INPUT_CLASS =
|
|||||||
'placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 ' +
|
'placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 ' +
|
||||||
'focus-visible:ring-ring disabled:opacity-50';
|
'focus-visible:ring-ring disabled:opacity-50';
|
||||||
|
|
||||||
const DEFAULT_KEYWORD_COUNT = 6;
|
const DEFAULT_KEYWORD_COUNT = 1;
|
||||||
const DEFAULT_AUDIENCE = '普通读者';
|
const DEFAULT_AUDIENCE = '普通读者';
|
||||||
const MAX_INTENT_LENGTH = 500;
|
const MAX_INTENT_LENGTH = 500;
|
||||||
|
|
||||||
@@ -50,7 +50,6 @@ export function AIWritingForm({
|
|||||||
const [articleType, setArticleType] = useState('analysis');
|
const [articleType, setArticleType] = useState('analysis');
|
||||||
const [audience, setAudience] = useState('普通读者');
|
const [audience, setAudience] = useState('普通读者');
|
||||||
const [wordCountInput, setWordCountInput] = useState('800');
|
const [wordCountInput, setWordCountInput] = useState('800');
|
||||||
const [keywordCountInput, setKeywordCountInput] = useState('1');
|
|
||||||
const [strictMode, setStrictMode] = useState(false);
|
const [strictMode, setStrictMode] = useState(false);
|
||||||
const [modelName, setModelName] = useState('');
|
const [modelName, setModelName] = useState('');
|
||||||
const [models, setModels] = useState<ModelOption[]>([]);
|
const [models, setModels] = useState<ModelOption[]>([]);
|
||||||
@@ -110,23 +109,10 @@ export function AIWritingForm({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 检索关键词数量限定 1~10,非法值回退默认 6
|
|
||||||
function handleKeywordCountBlur() {
|
|
||||||
const num = parseInt(keywordCountInput, 10);
|
|
||||||
if (isNaN(num)) {
|
|
||||||
setKeywordCountInput('1');
|
|
||||||
} else {
|
|
||||||
setKeywordCountInput(String(Math.max(1, Math.min(10, num))));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleSubmit(e: React.FormEvent) {
|
function handleSubmit(e: React.FormEvent) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
if (!intent.trim()) return;
|
if (!intent.trim()) return;
|
||||||
const wordCount = Math.max(100, parseInt(wordCountInput, 10) || 800);
|
const wordCount = Math.max(100, parseInt(wordCountInput, 10) || 800);
|
||||||
const keywordCount = hideAdvancedFields
|
|
||||||
? DEFAULT_KEYWORD_COUNT
|
|
||||||
: Math.max(1, Math.min(10, parseInt(keywordCountInput, 10) || DEFAULT_KEYWORD_COUNT));
|
|
||||||
onSubmit({
|
onSubmit({
|
||||||
userIntent: intent.trim(),
|
userIntent: intent.trim(),
|
||||||
articleType,
|
articleType,
|
||||||
@@ -134,7 +120,7 @@ export function AIWritingForm({
|
|||||||
? DEFAULT_AUDIENCE
|
? DEFAULT_AUDIENCE
|
||||||
: audience.trim() || DEFAULT_AUDIENCE,
|
: audience.trim() || DEFAULT_AUDIENCE,
|
||||||
wordCountTarget: wordCount,
|
wordCountTarget: wordCount,
|
||||||
keywordCount,
|
keywordCount: DEFAULT_KEYWORD_COUNT,
|
||||||
writingMode: hideAdvancedFields ? 'loose' : strictMode ? 'strict' : 'loose',
|
writingMode: hideAdvancedFields ? 'loose' : strictMode ? 'strict' : 'loose',
|
||||||
modelName: modelName || undefined,
|
modelName: modelName || undefined,
|
||||||
});
|
});
|
||||||
@@ -235,25 +221,6 @@ export function AIWritingForm({
|
|||||||
|
|
||||||
{!hideAdvancedFields && (
|
{!hideAdvancedFields && (
|
||||||
<>
|
<>
|
||||||
<div className="space-y-2">
|
|
||||||
<label className="text-sm font-semibold text-foreground">检索关键词数量(1~10)</label>
|
|
||||||
<input
|
|
||||||
type="number"
|
|
||||||
min={1}
|
|
||||||
max={10}
|
|
||||||
step={1}
|
|
||||||
className={INPUT_CLASS}
|
|
||||||
placeholder="6"
|
|
||||||
value={keywordCountInput}
|
|
||||||
onChange={(e) => setKeywordCountInput(e.target.value)}
|
|
||||||
onBlur={handleKeywordCountBlur}
|
|
||||||
disabled={disabled}
|
|
||||||
/>
|
|
||||||
<p className="text-xs text-muted-foreground/80">
|
|
||||||
素材收集专家用几个关键词检索,越多素材越全面但耗时更长。
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="flex items-start gap-2 rounded-xl border border-[#e8dedd] bg-[#f9f5f5] px-3 py-3">
|
<div className="flex items-start gap-2 rounded-xl border border-[#e8dedd] bg-[#f9f5f5] px-3 py-3">
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ export interface AIWritingRequest {
|
|||||||
targetAudience: string;
|
targetAudience: string;
|
||||||
wordCountTarget: number;
|
wordCountTarget: number;
|
||||||
modelName?: string;
|
modelName?: string;
|
||||||
/** 素材检索关键词数量(1~10,默认 6) */
|
/** 素材检索关键词数量(1~10,默认 1) */
|
||||||
keywordCount: number;
|
keywordCount: number;
|
||||||
/** 写作模式:strict=严格依据素材 / loose=可结合通用知识(默认 loose) */
|
/** 写作模式:strict=严格依据素材 / loose=可结合通用知识(默认 loose) */
|
||||||
writingMode: 'strict' | 'loose';
|
writingMode: 'strict' | 'loose';
|
||||||
|
|||||||
Reference in new issue
Block a user