From 5da81072af2123338764f5622b0f16fad9f3fb02 Mon Sep 17 00:00:00 2001 From: GuoQing Zhang Date: Mon, 11 Aug 2025 16:48:00 +0800 Subject: [PATCH 1/4] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=8A=A5=E9=94=99?= =?UTF-8?q?=E6=96=87=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/backend/bisheng/api/services/linsight/sop_manage.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/bisheng/api/services/linsight/sop_manage.py b/src/backend/bisheng/api/services/linsight/sop_manage.py index 3d76666c7..5f33dff70 100644 --- a/src/backend/bisheng/api/services/linsight/sop_manage.py +++ b/src/backend/bisheng/api/services/linsight/sop_manage.py @@ -232,7 +232,7 @@ class SOPManageService: if not name: error_rows.append(f"• 第{i}行: 缺少名称") elif not content: - error_rows.append(f"• 第{i}行: 缺少详细内容内容") + error_rows.append(f"• 第{i}行: 缺少详细内容") elif len(str(name)) >= 500: error_rows.append(f"• 第{i}行: 名称长度超过500字符") elif len(str(content)) >= 50000: From b90588edaddd76ddecb193cc66ea841c2814ee72 Mon Sep 17 00:00:00 2001 From: GuoQing Zhang Date: Mon, 11 Aug 2025 16:53:09 +0800 Subject: [PATCH 2/4] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=81=B5=E6=80=9D?= =?UTF-8?q?=E7=9F=A5=E8=AF=86=E5=BA=93=E5=88=97=E8=A1=A8=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/backend/bisheng_langchain/linsight/agent.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/bisheng_langchain/linsight/agent.py b/src/backend/bisheng_langchain/linsight/agent.py index 0a983b75c..34f7b59e9 100644 --- a/src/backend/bisheng_langchain/linsight/agent.py +++ b/src/backend/bisheng_langchain/linsight/agent.py @@ -46,7 +46,7 @@ class LinsightAgent(BaseModel): knowledge_list_str = "" if knowledge_list: knowledge_list_str = "\n".join(knowledge_list) - knowledge_list_str = f"<知识库列表>\n{knowledge_list_str}\n>" + knowledge_list_str = f"<知识库列表>\n{knowledge_list_str}\n" return knowledge_list_str async def _parse_sop_content(self, sop_prompt: str) -> AsyncIterator[ChatGenerationChunk]: From 4ecfd960c94cbb2286fde28b00c8311acd4f87db Mon Sep 17 00:00:00 2001 From: GuoQing Zhang Date: Mon, 11 Aug 2025 17:05:48 +0800 Subject: [PATCH 3/4] =?UTF-8?q?fix:=20sop=E4=BB=8E=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E6=97=B6=EF=BC=8C=E6=A3=80=E6=9F=A5=E6=AF=8F?= =?UTF-8?q?=E4=B8=80=E8=A1=8C=E6=89=80=E6=9C=89=E7=9A=84=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/services/linsight/sop_manage.py | 25 +++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/src/backend/bisheng/api/services/linsight/sop_manage.py b/src/backend/bisheng/api/services/linsight/sop_manage.py index 5f33dff70..68a3bea7d 100644 --- a/src/backend/bisheng/api/services/linsight/sop_manage.py +++ b/src/backend/bisheng/api/services/linsight/sop_manage.py @@ -229,17 +229,22 @@ class SOPManageService: name = sheet.cell(row=i, column=1).value description = sheet.cell(row=i, column=2).value content = sheet.cell(row=i, column=3).value + error_msg = [] if not name: - error_rows.append(f"• 第{i}行: 缺少名称") - elif not content: - error_rows.append(f"• 第{i}行: 缺少详细内容") - elif len(str(name)) >= 500: - error_rows.append(f"• 第{i}行: 名称长度超过500字符") - elif len(str(content)) >= 50000: - error_rows.append(f"• 第{i}行: 详细内容长度超过50000字符") - elif description and len(str(description)) >= 1000: - error_rows.append(f"• 第{i}行: 描述长度超过1000字符") - elif name and content: + error_msg.append("缺少名称") + if not content: + error_msg.append("缺少详细内容") + if len(str(name)) >= 500: + error_msg.append("名称长度超过500字符") + if len(str(content)) >= 50000: + error_msg.append("详细内容长度超过50000字符") + if description and len(str(description)) >= 1000: + error_msg.append("描述长度超过1000字符") + + if error_msg: + error_msg = "、".join(error_msg) + error_rows.extend(f"• 第{i}行: {error_msg}") + else: success_rows.append({ "name": str(name), "description": str(description) if description is not None else "", From 41ea9ec5523f10055b74dc1ff412b91afe388ca8 Mon Sep 17 00:00:00 2001 From: lmr <350416710@qq.com> Date: Mon, 11 Aug 2025 17:32:52 +0800 Subject: [PATCH 4/4] =?UTF-8?q?bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/LinSight/SopFormDrawer.tsx | 8 +-- .../src/components/LinSight/SopFromRecord.tsx | 6 +-- .../src/pages/BuildPage/bench/LingSiWork.tsx | 51 ++++++++++++------- .../pages/BuildPage/bench/WebSearchConfig.tsx | 6 ++- .../src/pages/BuildPage/bench/index.tsx | 5 +- .../tools/builtInTool/WebSearchFrom.tsx | 7 +-- 6 files changed, 54 insertions(+), 29 deletions(-) diff --git a/src/frontend/platform/src/components/LinSight/SopFormDrawer.tsx b/src/frontend/platform/src/components/LinSight/SopFormDrawer.tsx index caa7446b2..b3e9650b0 100644 --- a/src/frontend/platform/src/components/LinSight/SopFormDrawer.tsx +++ b/src/frontend/platform/src/components/LinSight/SopFormDrawer.tsx @@ -129,14 +129,14 @@ const SopFormDrawer = ({
- {isEditing ? '编辑SOP' : '新建SOP'} + {isEditing ? '编辑指导手册' : '新建指导手册'}
< Input type="text" @@ -147,7 +147,7 @@ const SopFormDrawer = ({ value={sopForm.name} onChange={(e) => handleInputChange('name', e.target.value)} className={`mt-1 block w-full border ${errors.name ? 'border-red-500' : 'border-gray-300'} rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-blue-500 focus:border-blue-500 text-[16px]`} - placeholder="请输入SOP名称" + placeholder="请输入指导手册名称" />
{errors.name && ( @@ -167,7 +167,7 @@ const SopFormDrawer = ({ value={sopForm.description} onChange={(e) => handleInputChange('description', e.target.value)} className="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-blue-500 focus:border-blue-500 text-[16px]" - placeholder="请输入SOP描述" + placeholder="请输入指导手册描述" />
diff --git a/src/frontend/platform/src/components/LinSight/SopFromRecord.tsx b/src/frontend/platform/src/components/LinSight/SopFromRecord.tsx index 7d2843515..9c683a37a 100644 --- a/src/frontend/platform/src/components/LinSight/SopFromRecord.tsx +++ b/src/frontend/platform/src/components/LinSight/SopFromRecord.tsx @@ -247,14 +247,14 @@ const fetchRecords = async (isSearch = false) => { {/* 左侧记录列表 */}
- 从运行记录中导入SOP + 从运行记录中导入指导手册
setSearchTerm(e.target.value)} @@ -466,7 +466,7 @@ const fetchRecords = async (isSearch = false) => { }} disabled={!currentRecord || loading} > - {loading ? '导入中...' : '导入当前SOP'} + {loading ? '导入中...' : '导入当前指导手册'}
diff --git a/src/frontend/platform/src/pages/BuildPage/bench/LingSiWork.tsx b/src/frontend/platform/src/pages/BuildPage/bench/LingSiWork.tsx index a5f406f1e..53736ad8b 100644 --- a/src/frontend/platform/src/pages/BuildPage/bench/LingSiWork.tsx +++ b/src/frontend/platform/src/pages/BuildPage/bench/LingSiWork.tsx @@ -1,7 +1,7 @@ // src/features/chat-config/ChatConfig.tsx import { Button } from "@/components/bs-ui/button"; import { Card, CardContent } from "@/components/bs-ui/card"; -import { toast, useToast } from "@/components/bs-ui/toast/use-toast"; +import { message, toast, useToast } from "@/components/bs-ui/toast/use-toast"; import { AlertTriangle } from "lucide-react"; import SopFormDrawer from "@/components/LinSight/SopFormDrawer"; import ImportFromRecordsDialog from "@/components/LinSight/SopFromRecord"; @@ -27,6 +27,8 @@ import { locationContext } from "@/contexts/locationContext"; import { UploadIcon } from "@/components/bs-icons"; import { Dialog, DialogContent, DialogHeader, DialogTitle } from "@/components/bs-ui/dialog"; import { captureAndAlertRequestErrorHoc } from "@/controllers/request"; +import sampleData from "@/pages/ModelPage/components/sampleData"; +import { downloadJson } from "@/util/utils"; export interface FormErrors { @@ -709,14 +711,17 @@ const [importFormData, setImportFormData] = useState(null); }); }, []); const { getRootProps: getLocalFileRootProps, getInputProps: getLocalFileInputProps } = useDropzone({ - accept: { - 'application/*': appConfig.enableEtl4lm ? - ['.PDF', '.TXT', '.DOCX', '.PPT', '.PPTX', '.MD', '.HTML', '.XLS', '.XLSX', '.CSV', '.DOC', '.PNG', '.JPG', '.JPEG', '.BMP'] - : ['.PDF', '.TXT', '.DOCX', '.DOC', '.PPT', '.PPTX', '.MD', '.HTML', '.XLS', '.XLSX', '.CSV'] - }, - multiple: true, // 允许选择多个文件 + multiple: false, onDrop: (acceptedFiles) => { - setImportFiles(prev => [...prev, ...acceptedFiles]); // 追加新文件 + if (acceptedFiles.length === 0) return; + + const file = acceptedFiles[0]; + const ext = file.name.split('.').pop().toLowerCase(); + if (ext !== 'xlsx') { + message({ variant: 'warning', description: '请上传xlsx格式的文件' }); + return; + } + setImportFiles(acceptedFiles); } }); const handleLocalFileImport = async () => { @@ -749,7 +754,13 @@ const handleLocalFileImport = async () => { setDuplicateDialogOpen(true); setImportFormData(formData); }else{ + sopApi.getSopList({ + page_size: pageSize, + page: 1, + keywords: keywords, + }) toast({ variant: 'success', description: '提交成功' }); + } } @@ -779,6 +790,11 @@ const handleValidationDialogConfirm = async () => { setImportFormData(formData); return }else{ + sopApi.getSopList({ + page_size: pageSize, + page: 1, + keywords: keywords, + }) toast({ variant: 'success', description: '提交成功' }); } }; @@ -827,13 +843,13 @@ const handleValidationDialogConfirm = async () => {
-

灵思SOP库

+

灵思指导手册库

{ @@ -883,7 +899,7 @@ const handleValidationDialogConfirm = async () => { setIsDrawerOpen(true); }} > - 新建SOP + 新建指导手册

{t('code.clickOrDragHere')}

{importFiles.length > 0 && (
- {importFiles.slice(0, 1).map((file, index) => ( // 只显示一个文件 + {importFiles.slice(0, 1).map((file, index) => (
{file.name} @@ -1009,7 +1025,7 @@ const handleValidationDialogConfirm = async () => {