< 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
+ 新建指导手册