lamphua před 1 týdnem
rodič
revize
c2444634ae

+ 1
- 1
oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/file/FilesProjectController.java Zobrazit soubor

@@ -183,7 +183,7 @@ public class FilesProjectController extends BaseController {
183 183
                 File transferFile = new File( profilePath + "/upload/uploadKmlFiles/" + uploadCpKmlFile.getOriginalFilename());
184 184
                 if (!transferFile.exists())
185 185
                     uploadCpKmlFile.transferTo(transferFile);
186
-                cmcProject.setProjectCp(transferFile.getName());
186
+                cmcProject.setProjectCp("/uploadKmlFiles/" + transferFile.getName());
187 187
                 return false;
188 188
             }
189 189
             else

+ 287
- 14
oa-back/ruoyi-agent/src/main/java/com/ruoyi/agent/service/impl/McpServiceImpl.java Zobrazit soubor

@@ -23,8 +23,11 @@ import io.milvus.v2.service.vector.request.SearchReq;
23 23
 import io.milvus.v2.service.vector.request.data.BaseVector;
24 24
 import io.milvus.v2.service.vector.request.data.FloatVec;
25 25
 import io.milvus.v2.service.vector.response.SearchResp;
26
-import org.apache.poi.extractor.POITextExtractor;
27 26
 import org.apache.poi.extractor.ExtractorFactory;
27
+import org.apache.poi.extractor.POITextExtractor;
28
+import org.apache.poi.hwpf.HWPFDocument;
29
+import org.apache.poi.hwpf.usermodel.Paragraph;
30
+import org.apache.poi.hwpf.usermodel.Range;
28 31
 import org.apache.poi.xwpf.usermodel.*;
29 32
 import org.apache.xmlbeans.XmlCursor;
30 33
 import org.noear.solon.ai.annotation.ToolMapping;
@@ -76,10 +79,10 @@ public class McpServiceImpl implements IMcpService {
76 79
      */
77 80
     @PostConstruct
78 81
     public void initMilvusClient() {
79
-        if (milvusServiceUrl == null || milvusServiceUrl.trim().isEmpty()) {
82
+        if (milvusServiceUrl == null || milvusServiceUrl.isEmpty()) {
80 83
             throw new IllegalStateException("Milvus service URL 未配置");
81 84
         }
82
-//        this.milvusClient = new MilvusClientV2(
85
+//        milvusClient = new MilvusClientV2(
83 86
 //                ConnectConfig.builder()
84 87
 //                        .uri(milvusServiceUrl)
85 88
 //                        .build());
@@ -414,29 +417,299 @@ public class McpServiceImpl implements IMcpService {
414 417
      */
415 418
     private List<TextSegment> splitDocument(File transferFile) throws IOException {
416 419
         // 加载文档
417
-        Document document;
418 420
         InputStream fileInputStream = new FileInputStream(transferFile);
419 421
         String filename = transferFile.getName().toLowerCase();
420
-        if (filename.endsWith(".doc") || filename.endsWith(".docx")) {
421
-            try (POITextExtractor extractor = ExtractorFactory.createExtractor(fileInputStream)) {
422
-                String text = extractor.getText();
423
-                document = Document.from(text);
422
+        if (filename.endsWith(".docx")) {
423
+            // 使用XWPFDocument处理DOCX文件,按二级标题分割(二级标题样式为2)
424
+            List<TextSegment> segments = new ArrayList<>();
425
+            try (XWPFDocument xwpfDocument = new XWPFDocument(fileInputStream)) {
426
+                StringBuilder currentLevel2Content = new StringBuilder();
427
+                boolean inLevel2Section = false;
428
+
429
+                for (XWPFParagraph paragraph : xwpfDocument.getParagraphs()) {
430
+                    String text = paragraph.getText().trim();
431
+                    if (text.isEmpty()) continue;
432
+
433
+                    if (paragraph.getStyle() != null) {
434
+                        // 二级标题(样式2)开始新的分段
435
+                        if (paragraph.getStyle().equals("2")) {
436
+                            // 保存当前二级标题下的内容
437
+                            if (currentLevel2Content.length() != 0) {
438
+                                // 检查当前二级标题内容的字节数
439
+                                int level2Length = currentLevel2Content.toString().getBytes().length;
440
+                                if (level2Length <= 65535) {
441
+                                    // 字数不大于65535,按二级标题分割
442
+                                    TextSegment segment = TextSegment.from(currentLevel2Content.toString());
443
+                                    segments.add(segment);
444
+                                } else {
445
+                                    // 字数大于65535,按三级标题分割
446
+                                    // 将当前二级标题内容按三级标题重新分割
447
+                                    StringBuilder currentLevel3Content = new StringBuilder();
448
+                                    String[] paragraphs = currentLevel2Content.toString().split("\n");
449
+                                    for (String para : paragraphs) {
450
+                                        if (para.trim().isEmpty()) continue;
451
+                                        
452
+                                        // 检查是否是三级标题
453
+                                        boolean isLevel3Title = false;
454
+                                        for (XWPFParagraph p : xwpfDocument.getParagraphs()) {
455
+                                            if (p.getText().trim().equals(para.trim()) && p.getStyle() != null && p.getStyle().equals("3")) {
456
+                                                isLevel3Title = true;
457
+                                                break;
458
+                                            }
459
+                                        }
460
+                                        
461
+                                        if (isLevel3Title) {
462
+                                            // 保存当前三级标题内容
463
+                                            if (currentLevel3Content.length() != 0) {
464
+                                                TextSegment segment = TextSegment.from(currentLevel3Content.toString());
465
+                                                segments.add(segment);
466
+                                                currentLevel3Content = new StringBuilder();
467
+                                            }
468
+                                            // 开始新的三级标题内容
469
+                                            currentLevel3Content.append(para).append("\n");
470
+                                        } else {
471
+                                            // 普通内容,添加到当前三级标题
472
+                                            if (currentLevel3Content.length() != 0) {
473
+                                                currentLevel3Content.append(para).append("\n");
474
+                                            }
475
+                                        }
476
+                                    }
477
+                                    // 保存最后一个三级标题内容
478
+                                    if (currentLevel3Content.length() != 0) {
479
+                                        TextSegment segment = TextSegment.from(currentLevel3Content.toString());
480
+                                        segments.add(segment);
481
+                                    }
482
+                                }
483
+                                currentLevel2Content = new StringBuilder();
484
+                            }
485
+                            // 开始新的二级标题内容
486
+                            currentLevel2Content.append(text).append("\n");
487
+                            inLevel2Section = true;
488
+                        }
489
+                        // 其他标题样式(包括三级标题)
490
+                        else {
491
+                            if (inLevel2Section) {
492
+                                currentLevel2Content.append(text).append("\n");
493
+                            }
494
+                        }
495
+                    }
496
+                    else {
497
+                        // 普通内容段落
498
+                        if (inLevel2Section) {
499
+                            currentLevel2Content.append(text).append("\n");
500
+                        }
501
+                    }
502
+                }
503
+
504
+                // 保存最后一个二级标题内容
505
+                if (currentLevel2Content.length() != 0) {
506
+                    // 检查字节数
507
+                    int level2Length = currentLevel2Content.toString().getBytes().length;
508
+                    if (level2Length <= 65535) {
509
+                        // 字数不大于65535,按二级标题分割
510
+                        TextSegment segment = TextSegment.from(currentLevel2Content.toString());
511
+                        segments.add(segment);
512
+                    } else {
513
+                        // 字数大于65535,按三级标题分割
514
+                        StringBuilder currentLevel3Content = new StringBuilder();
515
+                        String[] paragraphs = currentLevel2Content.toString().split("\n");
516
+                        for (String para : paragraphs) {
517
+                            if (para.trim().isEmpty()) continue;
518
+                            
519
+                            boolean isLevel3Title = false;
520
+                            for (XWPFParagraph p : xwpfDocument.getParagraphs()) {
521
+                                if (p.getText().trim().equals(para.trim()) && p.getStyle() != null && p.getStyle().equals("3")) {
522
+                                    isLevel3Title = true;
523
+                                    break;
524
+                                }
525
+                            }
526
+                            
527
+                            if (isLevel3Title) {
528
+                                // 保存当前三级标题内容
529
+                                if (currentLevel3Content.length() != 0) {
530
+                                    TextSegment segment = TextSegment.from(currentLevel3Content.toString());
531
+                                    segments.add(segment);
532
+                                    currentLevel3Content = new StringBuilder();
533
+                                }
534
+                                // 开始新的三级标题内容
535
+                                currentLevel3Content.append(para).append("\n");
536
+                            } else {
537
+                                // 普通内容,添加到当前三级标题
538
+                                if (currentLevel3Content.length() != 0) {
539
+                                    currentLevel3Content.append(para).append("\n");
540
+                                }
541
+                            }
542
+                        }
543
+                        // 保存最后一个三级标题内容
544
+                        if (currentLevel3Content.length() != 0) {
545
+                            TextSegment segment = TextSegment.from(currentLevel3Content.toString());
546
+                            segments.add(segment);
547
+                        }
548
+                    }
549
+                }
424 550
             }
425
-            catch (IOException e) {
426
-                throw new RuntimeException(e);
551
+            return segments;
552
+        }
553
+        else if (filename.endsWith(".doc")) {
554
+            // 使用HWPFDocument处理DOC文件
555
+            List<TextSegment> segments = new ArrayList<>();
556
+            try (HWPFDocument hwpfDocument = new HWPFDocument(fileInputStream)) {
557
+                StringBuilder currentLevel2Content = new StringBuilder();
558
+                boolean inLevel2Section = false;
559
+
560
+                Range range = hwpfDocument.getRange();
561
+                for (int i = 0; i < range.numParagraphs(); i++) {
562
+                    Paragraph paragraph = range.getParagraph(i);
563
+                    String text = paragraph.text().trim();
564
+                    if (text.isEmpty()) continue;
565
+
566
+                    // 获取段落样式索引
567
+                    short styleIndex = paragraph.getStyleIndex();
568
+
569
+                    if (styleIndex == 2) {
570
+                        // 二级标题,开始新的分段
571
+                        // 保存当前二级标题下的内容
572
+                        if (currentLevel2Content.length() != 0) {
573
+                            // 检查当前二级标题内容的字节数
574
+                            int level2Length = currentLevel2Content.toString().getBytes().length;
575
+                            if (level2Length <= 65535) {
576
+                                // 字数不大于65535,按二级标题分割
577
+                                TextSegment segment = TextSegment.from(currentLevel2Content.toString());
578
+                                segments.add(segment);
579
+                            } else {
580
+                                // 字数大于65535,按三级标题分割
581
+                                // 将当前二级标题内容按三级标题重新分割
582
+                                StringBuilder currentLevel3Content = new StringBuilder();
583
+                                Range level2Range = hwpfDocument.getRange();
584
+                                boolean foundCurrentLevel2 = false;
585
+                                
586
+                                for (int j = 0; j < level2Range.numParagraphs(); j++) {
587
+                                    Paragraph p = level2Range.getParagraph(j);
588
+                                    String paraText = p.text().trim();
589
+                                    if (paraText.isEmpty()) continue;
590
+                                    
591
+                                    // 找到当前二级标题的开始
592
+                                    if (p.getStyleIndex() == 2 && paraText.equals(currentLevel2Content.toString().split("\n")[0].trim())) {
593
+                                        foundCurrentLevel2 = true;
594
+                                    }
595
+                                    
596
+                                    if (foundCurrentLevel2) {
597
+                                        short paraStyleIndex = p.getStyleIndex();
598
+                                        
599
+                                        if (paraStyleIndex == 3) {
600
+                                            // 三级标题
601
+                                            // 保存当前三级标题内容
602
+                                            if (currentLevel3Content.length() != 0) {
603
+                                                TextSegment segment = TextSegment.from(currentLevel3Content.toString());
604
+                                                segments.add(segment);
605
+                                                currentLevel3Content = new StringBuilder();
606
+                                            }
607
+                                            // 开始新的三级标题内容
608
+                                            currentLevel3Content.append(paraText).append("\n");
609
+                                        } else if (paraStyleIndex == 2 && !paraText.equals(currentLevel2Content.toString().split("\n")[0].trim())) {
610
+                                            // 下一个二级标题,结束当前二级标题的处理
611
+                                            break;
612
+                                        } else {
613
+                                            // 普通内容或当前二级标题
614
+                                            if (currentLevel3Content.length() != 0 || paraStyleIndex == 2) {
615
+                                                currentLevel3Content.append(paraText).append("\n");
616
+                                            }
617
+                                        }
618
+                                    }
619
+                                }
620
+                                
621
+                                // 保存最后一个三级标题内容
622
+                                if (currentLevel3Content.length() != 0) {
623
+                                    TextSegment segment = TextSegment.from(currentLevel3Content.toString());
624
+                                    segments.add(segment);
625
+                                }
626
+                            }
627
+                            currentLevel2Content = new StringBuilder();
628
+                        }
629
+                        // 开始新的二级标题内容
630
+                        currentLevel2Content.append(text).append("\n");
631
+                        inLevel2Section = true;
632
+                    } else {
633
+                        // 非二级标题或普通内容段落
634
+                        if (inLevel2Section) {
635
+                            currentLevel2Content.append(text).append("\n");
636
+                        }
637
+                    }
638
+                }
639
+
640
+                // 保存最后一个二级标题内容
641
+                if (currentLevel2Content.length() != 0) {
642
+                    // 检查字节数
643
+                    int level2Length = currentLevel2Content.toString().getBytes().length;
644
+                    if (level2Length <= 65535) {
645
+                        // 字数不大于65535,按二级标题分割
646
+                        TextSegment segment = TextSegment.from(currentLevel2Content.toString());
647
+                        segments.add(segment);
648
+                    } else {
649
+                        // 字数大于65535,按三级标题分割
650
+                        StringBuilder currentLevel3Content = new StringBuilder();
651
+                        Range level2Range = hwpfDocument.getRange();
652
+                        boolean foundCurrentLevel2 = false;
653
+                        
654
+                        for (int j = 0; j < level2Range.numParagraphs(); j++) {
655
+                            Paragraph p = level2Range.getParagraph(j);
656
+                            String paraText = p.text().trim();
657
+                            if (paraText.isEmpty()) continue;
658
+                            
659
+                            // 找到当前二级标题的开始
660
+                            if (p.getStyleIndex() == 2 && paraText.equals(currentLevel2Content.toString().split("\n")[0].trim())) {
661
+                                foundCurrentLevel2 = true;
662
+                            }
663
+                            
664
+                            if (foundCurrentLevel2) {
665
+                                short paraStyleIndex = p.getStyleIndex();
666
+                                
667
+                                if (paraStyleIndex == 3) {
668
+                                    // 三级标题
669
+                                    // 保存当前三级标题内容
670
+                                    if (currentLevel3Content.length() != 0) {
671
+                                        TextSegment segment = TextSegment.from(currentLevel3Content.toString());
672
+                                        segments.add(segment);
673
+                                        currentLevel3Content = new StringBuilder();
674
+                                    }
675
+                                    // 开始新的三级标题内容
676
+                                    currentLevel3Content.append(paraText).append("\n");
677
+                                } else if (paraStyleIndex == 2 && !paraText.equals(currentLevel2Content.toString().split("\n")[0].trim())) {
678
+                                    // 下一个二级标题,结束当前二级标题的处理
679
+                                    break;
680
+                                } else {
681
+                                    // 普通内容或当前二级标题
682
+                                    if (currentLevel3Content.length() != 0 || paraStyleIndex == 2) {
683
+                                        currentLevel3Content.append(paraText).append("\n");
684
+                                    }
685
+                                }
686
+                            }
687
+                        }
688
+                        
689
+                        // 保存最后一个三级标题内容
690
+                        if (currentLevel3Content.length() != 0) {
691
+                            TextSegment segment = TextSegment.from(currentLevel3Content.toString());
692
+                            segments.add(segment);
693
+                        }
694
+                    }
695
+                }
427 696
             }
697
+            return segments;
428 698
         }
699
+
429 700
         else if (filename.endsWith(".pdf")) {
430
-            document = new ApachePdfBoxDocumentParser().parse(fileInputStream);
701
+            Document document = new ApachePdfBoxDocumentParser().parse(fileInputStream);
702
+            DocumentByParagraphSplitter splitter = new DocumentByParagraphSplitter(300,50);
703
+            return splitter.split(document);
431 704
         }
432 705
         else if (filename.endsWith(".txt")) {
433
-            document = new TextDocumentParser().parse(fileInputStream);
706
+            Document document = new TextDocumentParser().parse(fileInputStream);
707
+            DocumentByParagraphSplitter splitter = new DocumentByParagraphSplitter(300,50);
708
+            return splitter.split(document);
434 709
         }
435 710
         else {
436 711
             throw new UnsupportedOperationException("不支持文件类型: " + filename);
437 712
         }
438
-        DocumentByParagraphSplitter splitter = new DocumentByParagraphSplitter(300,50);
439
-        return splitter.split(document);
440 713
     }
441 714
 
442 715
 }

+ 280
- 7
oa-back/ruoyi-llm/src/main/java/com/ruoyi/web/llm/service/impl/LangChainMilvusServiceImpl.java Zobrazit soubor

@@ -32,8 +32,11 @@ import io.milvus.v2.service.vector.request.data.BaseVector;
32 32
 import io.milvus.v2.service.vector.request.data.FloatVec;
33 33
 import io.milvus.v2.service.vector.response.InsertResp;
34 34
 import io.milvus.v2.service.vector.response.SearchResp;
35
-import org.apache.poi.extractor.POITextExtractor;
36 35
 import org.apache.poi.extractor.ExtractorFactory;
36
+import org.apache.poi.extractor.POITextExtractor;
37
+import org.apache.poi.hwpf.HWPFDocument;
38
+import org.apache.poi.hwpf.usermodel.Paragraph;
39
+import org.apache.poi.hwpf.usermodel.Range;
37 40
 import org.apache.poi.xwpf.usermodel.XWPFDocument;
38 41
 import org.apache.poi.xwpf.usermodel.XWPFParagraph;
39 42
 import org.noear.solon.ai.chat.ChatModel;
@@ -429,14 +432,284 @@ public class LangChainMilvusServiceImpl implements ILangChainMilvusService
429 432
         Document document;
430 433
         InputStream fileInputStream = new FileInputStream(transferFile);
431 434
         String filename = transferFile.getName().toLowerCase();
432
-        if (filename.endsWith(".doc") || filename.endsWith(".docx")) {
433
-            try (POITextExtractor extractor = ExtractorFactory.createExtractor(fileInputStream)) {
434
-                String text = extractor.getText();
435
-                document = Document.from(text);
435
+        if (filename.endsWith(".docx")) {
436
+            // 使用XWPFDocument处理DOCX文件,按二级标题分割(二级标题样式为2)
437
+            List<TextSegment> segments = new ArrayList<>();
438
+            try (XWPFDocument xwpfDocument = new XWPFDocument(fileInputStream)) {
439
+                StringBuilder currentLevel2Content = new StringBuilder();
440
+                boolean inLevel2Section = false;
441
+
442
+                for (XWPFParagraph paragraph : xwpfDocument.getParagraphs()) {
443
+                    String text = paragraph.getText().trim();
444
+                    if (text.isEmpty()) continue;
445
+
446
+                    if (paragraph.getStyle() != null) {
447
+                        // 二级标题(样式2)开始新的分段
448
+                        if (paragraph.getStyle().equals("2")) {
449
+                            // 保存当前二级标题下的内容
450
+                            if (currentLevel2Content.length() != 0) {
451
+                                // 检查当前二级标题内容的字节数
452
+                                int level2Length = currentLevel2Content.toString().getBytes().length;
453
+                                if (level2Length <= 65535) {
454
+                                    // 字数不大于65535,按二级标题分割
455
+                                    TextSegment segment = TextSegment.from(currentLevel2Content.toString());
456
+                                    segments.add(segment);
457
+                                } else {
458
+                                    // 字数大于65535,按三级标题分割
459
+                                    // 将当前二级标题内容按三级标题重新分割
460
+                                    StringBuilder currentLevel3Content = new StringBuilder();
461
+                                    String[] paragraphs = currentLevel2Content.toString().split("\n");
462
+                                    for (String para : paragraphs) {
463
+                                        if (para.trim().isEmpty()) continue;
464
+                                        
465
+                                        // 检查是否是三级标题(简单判断:如果是三级标题,样式应该是3,但这里需要重新解析)
466
+                                        // 由于已经将内容转为字符串,这里采用另一种方式:假设三级标题以数字+点+空格开头(如"1.1.")
467
+                                        // 或者可以重新遍历段落,但为了效率,这里采用简单的判断方式
468
+                                        boolean isLevel3Title = false;
469
+                                        for (XWPFParagraph p : xwpfDocument.getParagraphs()) {
470
+                                            if (p.getText().trim().equals(para.trim()) && p.getStyle() != null && p.getStyle().equals("3")) {
471
+                                                isLevel3Title = true;
472
+                                                break;
473
+                                            }
474
+                                        }
475
+                                        
476
+                                        if (isLevel3Title) {
477
+                                            // 保存当前三级标题内容
478
+                                            if (currentLevel3Content.length() != 0) {
479
+                                                TextSegment segment = TextSegment.from(currentLevel3Content.toString());
480
+                                                segments.add(segment);
481
+                                                currentLevel3Content = new StringBuilder();
482
+                                            }
483
+                                            // 开始新的三级标题内容
484
+                                            currentLevel3Content.append(para).append("\n");
485
+                                        } else {
486
+                                            // 普通内容,添加到当前三级标题
487
+                                            if (currentLevel3Content.length() != 0) {
488
+                                                currentLevel3Content.append(para).append("\n");
489
+                                            }
490
+                                        }
491
+                                    }
492
+                                    // 保存最后一个三级标题内容
493
+                                    if (currentLevel3Content.length() != 0) {
494
+                                        TextSegment segment = TextSegment.from(currentLevel3Content.toString());
495
+                                        segments.add(segment);
496
+                                    }
497
+                                }
498
+                                currentLevel2Content = new StringBuilder();
499
+                            }
500
+                            // 开始新的二级标题内容
501
+                            currentLevel2Content.append(text).append("\n");
502
+                            inLevel2Section = true;
503
+                        }
504
+                        // 其他标题样式(包括三级标题)
505
+                        else {
506
+                            if (inLevel2Section) {
507
+                                currentLevel2Content.append(text).append("\n");
508
+                            }
509
+                        }
510
+                    }
511
+                    else {
512
+                        // 普通内容段落
513
+                        if (inLevel2Section) {
514
+                            currentLevel2Content.append(text).append("\n");
515
+                        }
516
+                    }
517
+                }
518
+
519
+                // 保存最后一个二级标题内容
520
+                if (currentLevel2Content.length() != 0) {
521
+                    // 检查字节数
522
+                    int level2Length = currentLevel2Content.toString().getBytes().length;
523
+                    if (level2Length <= 65535) {
524
+                        // 字数不大于65535,按二级标题分割
525
+                        TextSegment segment = TextSegment.from(currentLevel2Content.toString());
526
+                        segments.add(segment);
527
+                    } else {
528
+                        // 字数大于65535,按三级标题分割
529
+                        StringBuilder currentLevel3Content = new StringBuilder();
530
+                        String[] paragraphs = currentLevel2Content.toString().split("\n");
531
+                        for (String para : paragraphs) {
532
+                            if (para.trim().isEmpty()) continue;
533
+                            
534
+                            boolean isLevel3Title = false;
535
+                            for (XWPFParagraph p : xwpfDocument.getParagraphs()) {
536
+                                if (p.getText().trim().equals(para.trim()) && p.getStyle() != null && p.getStyle().equals("3")) {
537
+                                    isLevel3Title = true;
538
+                                    break;
539
+                                }
540
+                            }
541
+                            
542
+                            if (isLevel3Title) {
543
+                                // 保存当前三级标题内容
544
+                                if (currentLevel3Content.length() != 0) {
545
+                                    TextSegment segment = TextSegment.from(currentLevel3Content.toString());
546
+                                    segments.add(segment);
547
+                                    currentLevel3Content = new StringBuilder();
548
+                                }
549
+                                // 开始新的三级标题内容
550
+                                currentLevel3Content.append(para).append("\n");
551
+                            } else {
552
+                                // 普通内容,添加到当前三级标题
553
+                                if (currentLevel3Content.length() != 0) {
554
+                                    currentLevel3Content.append(para).append("\n");
555
+                                }
556
+                            }
557
+                        }
558
+                        // 保存最后一个三级标题内容
559
+                        if (currentLevel3Content.length() != 0) {
560
+                            TextSegment segment = TextSegment.from(currentLevel3Content.toString());
561
+                            segments.add(segment);
562
+                        }
563
+                    }
564
+                }
436 565
             }
437
-            catch (IOException e) {
438
-                throw new RuntimeException(e);
566
+            return segments;
567
+        }
568
+        else if (filename.endsWith(".doc")) {
569
+            // 使用HWPFDocument处理DOC文件
570
+            List<TextSegment> segments = new ArrayList<>();
571
+            try (HWPFDocument hwpfDocument = new HWPFDocument(fileInputStream)) {
572
+                StringBuilder currentLevel2Content = new StringBuilder();
573
+                boolean inLevel2Section = false;
574
+
575
+                Range range = hwpfDocument.getRange();
576
+                for (int i = 0; i < range.numParagraphs(); i++) {
577
+                    Paragraph paragraph = range.getParagraph(i);
578
+                    String text = paragraph.text().trim();
579
+                    if (text.isEmpty()) continue;
580
+
581
+                    // 获取段落样式索引
582
+                    short styleIndex = paragraph.getStyleIndex();
583
+
584
+                    if (styleIndex == 2) {
585
+                        // 二级标题,开始新的分段
586
+                        // 保存当前二级标题下的内容
587
+                        if (currentLevel2Content.length() != 0) {
588
+                            // 检查当前二级标题内容的字节数
589
+                            int level2Length = currentLevel2Content.toString().getBytes().length;
590
+                            if (level2Length <= 65535) {
591
+                                // 字数不大于65535,按二级标题分割
592
+                                TextSegment segment = TextSegment.from(currentLevel2Content.toString());
593
+                                segments.add(segment);
594
+                            } else {
595
+                                // 字数大于65535,按三级标题分割
596
+                                // 将当前二级标题内容按三级标题重新分割
597
+                                StringBuilder currentLevel3Content = new StringBuilder();
598
+                                Range level2Range = hwpfDocument.getRange();
599
+                                boolean foundCurrentLevel2 = false;
600
+                                
601
+                                for (int j = 0; j < level2Range.numParagraphs(); j++) {
602
+                                    Paragraph p = level2Range.getParagraph(j);
603
+                                    String paraText = p.text().trim();
604
+                                    if (paraText.isEmpty()) continue;
605
+                                    
606
+                                    // 找到当前二级标题的开始
607
+                                    if (p.getStyleIndex() == 2 && paraText.equals(currentLevel2Content.toString().split("\n")[0].trim())) {
608
+                                        foundCurrentLevel2 = true;
609
+                                    }
610
+                                    
611
+                                    if (foundCurrentLevel2) {
612
+                                        short paraStyleIndex = p.getStyleIndex();
613
+                                        
614
+                                        if (paraStyleIndex == 3) {
615
+                                            // 三级标题
616
+                                            // 保存当前三级标题内容
617
+                                            if (currentLevel3Content.length() != 0) {
618
+                                                TextSegment segment = TextSegment.from(currentLevel3Content.toString());
619
+                                                segments.add(segment);
620
+                                                currentLevel3Content = new StringBuilder();
621
+                                            }
622
+                                            // 开始新的三级标题内容
623
+                                            currentLevel3Content.append(paraText).append("\n");
624
+                                        } else if (paraStyleIndex == 2 && !paraText.equals(currentLevel2Content.toString().split("\n")[0].trim())) {
625
+                                            // 下一个二级标题,结束当前二级标题的处理
626
+                                            break;
627
+                                        } else {
628
+                                            // 普通内容或当前二级标题
629
+                                            if (currentLevel3Content.length() != 0 || paraStyleIndex == 2) {
630
+                                                currentLevel3Content.append(paraText).append("\n");
631
+                                            }
632
+                                        }
633
+                                    }
634
+                                }
635
+                                
636
+                                // 保存最后一个三级标题内容
637
+                                if (currentLevel3Content.length() != 0) {
638
+                                    TextSegment segment = TextSegment.from(currentLevel3Content.toString());
639
+                                    segments.add(segment);
640
+                                }
641
+                            }
642
+                            currentLevel2Content = new StringBuilder();
643
+                        }
644
+                        // 开始新的二级标题内容
645
+                        currentLevel2Content.append(text).append("\n");
646
+                        inLevel2Section = true;
647
+                    } else {
648
+                        // 非二级标题或普通内容段落
649
+                        if (inLevel2Section) {
650
+                            currentLevel2Content.append(text).append("\n");
651
+                        }
652
+                    }
653
+                }
654
+
655
+                // 保存最后一个二级标题内容
656
+                if (currentLevel2Content.length() != 0) {
657
+                    // 检查字节数
658
+                    int level2Length = currentLevel2Content.toString().getBytes().length;
659
+                    if (level2Length <= 65535) {
660
+                        // 字数不大于65535,按二级标题分割
661
+                        TextSegment segment = TextSegment.from(currentLevel2Content.toString());
662
+                        segments.add(segment);
663
+                    } else {
664
+                        // 字数大于65535,按三级标题分割
665
+                        StringBuilder currentLevel3Content = new StringBuilder();
666
+                        Range level2Range = hwpfDocument.getRange();
667
+                        boolean foundCurrentLevel2 = false;
668
+                        
669
+                        for (int j = 0; j < level2Range.numParagraphs(); j++) {
670
+                            Paragraph p = level2Range.getParagraph(j);
671
+                            String paraText = p.text().trim();
672
+                            if (paraText.isEmpty()) continue;
673
+                            
674
+                            // 找到当前二级标题的开始
675
+                            if (p.getStyleIndex() == 2 && paraText.equals(currentLevel2Content.toString().split("\n")[0].trim())) {
676
+                                foundCurrentLevel2 = true;
677
+                            }
678
+                            
679
+                            if (foundCurrentLevel2) {
680
+                                short paraStyleIndex = p.getStyleIndex();
681
+                                
682
+                                if (paraStyleIndex == 3) {
683
+                                    // 三级标题
684
+                                    // 保存当前三级标题内容
685
+                                    if (currentLevel3Content.length() != 0) {
686
+                                        TextSegment segment = TextSegment.from(currentLevel3Content.toString());
687
+                                        segments.add(segment);
688
+                                        currentLevel3Content = new StringBuilder();
689
+                                    }
690
+                                    // 开始新的三级标题内容
691
+                                    currentLevel3Content.append(paraText).append("\n");
692
+                                } else if (paraStyleIndex == 2 && !paraText.equals(currentLevel2Content.toString().split("\n")[0].trim())) {
693
+                                    // 下一个二级标题,结束当前二级标题的处理
694
+                                    break;
695
+                                } else {
696
+                                    // 普通内容或当前二级标题
697
+                                    if (currentLevel3Content.length() != 0 || paraStyleIndex == 2) {
698
+                                        currentLevel3Content.append(paraText).append("\n");
699
+                                    }
700
+                                }
701
+                            }
702
+                        }
703
+                        
704
+                        // 保存最后一个三级标题内容
705
+                        if (currentLevel3Content.length() != 0) {
706
+                            TextSegment segment = TextSegment.from(currentLevel3Content.toString());
707
+                            segments.add(segment);
708
+                        }
709
+                    }
710
+                }
439 711
             }
712
+            return segments;
440 713
         }
441 714
         else if (filename.endsWith(".pdf")) {
442 715
             document = new ApachePdfBoxDocumentParser().parse(fileInputStream);

+ 284
- 11
oa-back/ruoyi-system/src/main/java/com/ruoyi/llm/service/impl/CmcAgentServiceImpl.java Zobrazit soubor

@@ -34,6 +34,9 @@ import io.milvus.v2.service.vector.request.data.FloatVec;
34 34
 import io.milvus.v2.service.vector.response.SearchResp;
35 35
 import org.apache.poi.extractor.ExtractorFactory;
36 36
 import org.apache.poi.extractor.POITextExtractor;
37
+import org.apache.poi.hwpf.HWPFDocument;
38
+import org.apache.poi.hwpf.usermodel.Paragraph;
39
+import org.apache.poi.hwpf.usermodel.Range;
37 40
 import org.apache.poi.xwpf.usermodel.*;
38 41
 import org.apache.xmlbeans.XmlCursor;
39 42
 import org.noear.solon.ai.chat.ChatModel;
@@ -871,29 +874,299 @@ public class CmcAgentServiceImpl implements ICmcAgentService
871 874
      */
872 875
     private List<TextSegment> splitDocument(File transferFile, int maxSegmentSizeInChars, int maxOverlapSizeInChars) throws IOException {
873 876
         // 加载文档
874
-        Document document;
875 877
         InputStream fileInputStream = new FileInputStream(transferFile);
876 878
         String filename = transferFile.getName().toLowerCase();
877
-        if (filename.endsWith(".doc") || filename.endsWith(".docx")) {
878
-            try (POITextExtractor extractor = ExtractorFactory.createExtractor(fileInputStream)) {
879
-                String text = extractor.getText();
880
-                document = Document.from(text);
879
+        if (filename.endsWith(".docx")) {
880
+            // 使用XWPFDocument处理DOCX文件,按二级标题分割(二级标题样式为2)
881
+            List<TextSegment> segments = new ArrayList<>();
882
+            try (XWPFDocument xwpfDocument = new XWPFDocument(fileInputStream)) {
883
+                StringBuilder currentLevel2Content = new StringBuilder();
884
+                boolean inLevel2Section = false;
885
+
886
+                for (XWPFParagraph paragraph : xwpfDocument.getParagraphs()) {
887
+                    String text = paragraph.getText().trim();
888
+                    if (text.isEmpty()) continue;
889
+
890
+                    if (paragraph.getStyle() != null) {
891
+                        // 二级标题(样式2)开始新的分段
892
+                        if (paragraph.getStyle().equals("2")) {
893
+                            // 保存当前二级标题下的内容
894
+                            if (currentLevel2Content.length() != 0) {
895
+                                // 检查当前二级标题内容的字节数
896
+                                int level2Length = currentLevel2Content.toString().getBytes().length;
897
+                                if (level2Length <= 65535) {
898
+                                    // 字数不大于65535,按二级标题分割
899
+                                    TextSegment segment = TextSegment.from(currentLevel2Content.toString());
900
+                                    segments.add(segment);
901
+                                } else {
902
+                                    // 字数大于65535,按三级标题分割
903
+                                    // 将当前二级标题内容按三级标题重新分割
904
+                                    StringBuilder currentLevel3Content = new StringBuilder();
905
+                                    String[] paragraphs = currentLevel2Content.toString().split("\n");
906
+                                    for (String para : paragraphs) {
907
+                                        if (para.trim().isEmpty()) continue;
908
+                                        
909
+                                        // 检查是否是三级标题
910
+                                        boolean isLevel3Title = false;
911
+                                        for (XWPFParagraph p : xwpfDocument.getParagraphs()) {
912
+                                            if (p.getText().trim().equals(para.trim()) && p.getStyle() != null && p.getStyle().equals("3")) {
913
+                                                isLevel3Title = true;
914
+                                                break;
915
+                                            }
916
+                                        }
917
+                                        
918
+                                        if (isLevel3Title) {
919
+                                            // 保存当前三级标题内容
920
+                                            if (currentLevel3Content.length() != 0) {
921
+                                                TextSegment segment = TextSegment.from(currentLevel3Content.toString());
922
+                                                segments.add(segment);
923
+                                                currentLevel3Content = new StringBuilder();
924
+                                            }
925
+                                            // 开始新的三级标题内容
926
+                                            currentLevel3Content.append(para).append("\n");
927
+                                        } else {
928
+                                            // 普通内容,添加到当前三级标题
929
+                                            if (currentLevel3Content.length() != 0) {
930
+                                                currentLevel3Content.append(para).append("\n");
931
+                                            }
932
+                                        }
933
+                                    }
934
+                                    // 保存最后一个三级标题内容
935
+                                    if (currentLevel3Content.length() != 0) {
936
+                                        TextSegment segment = TextSegment.from(currentLevel3Content.toString());
937
+                                        segments.add(segment);
938
+                                    }
939
+                                }
940
+                                currentLevel2Content = new StringBuilder();
941
+                            }
942
+                            // 开始新的二级标题内容
943
+                            currentLevel2Content.append(text).append("\n");
944
+                            inLevel2Section = true;
945
+                        }
946
+                        // 其他标题样式(包括三级标题)
947
+                        else {
948
+                            if (inLevel2Section) {
949
+                                currentLevel2Content.append(text).append("\n");
950
+                            }
951
+                        }
952
+                    }
953
+                    else {
954
+                        // 普通内容段落
955
+                        if (inLevel2Section) {
956
+                            currentLevel2Content.append(text).append("\n");
957
+                        }
958
+                    }
959
+                }
960
+
961
+                // 保存最后一个二级标题内容
962
+                if (currentLevel2Content.length() != 0) {
963
+                    // 检查字节数
964
+                    int level2Length = currentLevel2Content.toString().getBytes().length;
965
+                    if (level2Length <= 65535) {
966
+                        // 字数不大于65535,按二级标题分割
967
+                        TextSegment segment = TextSegment.from(currentLevel2Content.toString());
968
+                        segments.add(segment);
969
+                    } else {
970
+                        // 字数大于65535,按三级标题分割
971
+                        StringBuilder currentLevel3Content = new StringBuilder();
972
+                        String[] paragraphs = currentLevel2Content.toString().split("\n");
973
+                        for (String para : paragraphs) {
974
+                            if (para.trim().isEmpty()) continue;
975
+                            
976
+                            boolean isLevel3Title = false;
977
+                            for (XWPFParagraph p : xwpfDocument.getParagraphs()) {
978
+                                if (p.getText().trim().equals(para.trim()) && p.getStyle() != null && p.getStyle().equals("3")) {
979
+                                    isLevel3Title = true;
980
+                                    break;
981
+                                }
982
+                            }
983
+                            
984
+                            if (isLevel3Title) {
985
+                                // 保存当前三级标题内容
986
+                                if (currentLevel3Content.length() != 0) {
987
+                                    TextSegment segment = TextSegment.from(currentLevel3Content.toString());
988
+                                    segments.add(segment);
989
+                                    currentLevel3Content = new StringBuilder();
990
+                                }
991
+                                // 开始新的三级标题内容
992
+                                currentLevel3Content.append(para).append("\n");
993
+                            } else {
994
+                                // 普通内容,添加到当前三级标题
995
+                                if (currentLevel3Content.length() != 0) {
996
+                                    currentLevel3Content.append(para).append("\n");
997
+                                }
998
+                            }
999
+                        }
1000
+                        // 保存最后一个三级标题内容
1001
+                        if (currentLevel3Content.length() != 0) {
1002
+                            TextSegment segment = TextSegment.from(currentLevel3Content.toString());
1003
+                            segments.add(segment);
1004
+                        }
1005
+                    }
1006
+                }
881 1007
             }
882
-            catch (IOException e) {
883
-                throw new RuntimeException(e);
1008
+            return segments;
1009
+        }
1010
+        else if (filename.endsWith(".doc")) {
1011
+            // 使用HWPFDocument处理DOC文件
1012
+            List<TextSegment> segments = new ArrayList<>();
1013
+            try (HWPFDocument hwpfDocument = new HWPFDocument(fileInputStream)) {
1014
+                StringBuilder currentLevel2Content = new StringBuilder();
1015
+                boolean inLevel2Section = false;
1016
+
1017
+                Range range = hwpfDocument.getRange();
1018
+                for (int i = 0; i < range.numParagraphs(); i++) {
1019
+                    Paragraph paragraph = range.getParagraph(i);
1020
+                    String text = paragraph.text().trim();
1021
+                    if (text.isEmpty()) continue;
1022
+
1023
+                    // 获取段落样式索引
1024
+                    short styleIndex = paragraph.getStyleIndex();
1025
+
1026
+                    if (styleIndex == 2) {
1027
+                        // 二级标题,开始新的分段
1028
+                        // 保存当前二级标题下的内容
1029
+                        if (currentLevel2Content.length() != 0) {
1030
+                            // 检查当前二级标题内容的字节数
1031
+                            int level2Length = currentLevel2Content.toString().getBytes().length;
1032
+                            if (level2Length <= 65535) {
1033
+                                // 字数不大于65535,按二级标题分割
1034
+                                TextSegment segment = TextSegment.from(currentLevel2Content.toString());
1035
+                                segments.add(segment);
1036
+                            } else {
1037
+                                // 字数大于65535,按三级标题分割
1038
+                                // 将当前二级标题内容按三级标题重新分割
1039
+                                StringBuilder currentLevel3Content = new StringBuilder();
1040
+                                Range level2Range = hwpfDocument.getRange();
1041
+                                boolean foundCurrentLevel2 = false;
1042
+                                
1043
+                                for (int j = 0; j < level2Range.numParagraphs(); j++) {
1044
+                                    Paragraph p = level2Range.getParagraph(j);
1045
+                                    String paraText = p.text().trim();
1046
+                                    if (paraText.isEmpty()) continue;
1047
+                                    
1048
+                                    // 找到当前二级标题的开始
1049
+                                    if (p.getStyleIndex() == 2 && paraText.equals(currentLevel2Content.toString().split("\n")[0].trim())) {
1050
+                                        foundCurrentLevel2 = true;
1051
+                                    }
1052
+                                    
1053
+                                    if (foundCurrentLevel2) {
1054
+                                        short paraStyleIndex = p.getStyleIndex();
1055
+                                        
1056
+                                        if (paraStyleIndex == 3) {
1057
+                                            // 三级标题
1058
+                                            // 保存当前三级标题内容
1059
+                                            if (currentLevel3Content.length() != 0) {
1060
+                                                TextSegment segment = TextSegment.from(currentLevel3Content.toString());
1061
+                                                segments.add(segment);
1062
+                                                currentLevel3Content = new StringBuilder();
1063
+                                            }
1064
+                                            // 开始新的三级标题内容
1065
+                                            currentLevel3Content.append(paraText).append("\n");
1066
+                                        } else if (paraStyleIndex == 2 && !paraText.equals(currentLevel2Content.toString().split("\n")[0].trim())) {
1067
+                                            // 下一个二级标题,结束当前二级标题的处理
1068
+                                            break;
1069
+                                        } else {
1070
+                                            // 普通内容或当前二级标题
1071
+                                            if (currentLevel3Content.length() != 0 || paraStyleIndex == 2) {
1072
+                                                currentLevel3Content.append(paraText).append("\n");
1073
+                                            }
1074
+                                        }
1075
+                                    }
1076
+                                }
1077
+                                
1078
+                                // 保存最后一个三级标题内容
1079
+                                if (currentLevel3Content.length() != 0) {
1080
+                                    TextSegment segment = TextSegment.from(currentLevel3Content.toString());
1081
+                                    segments.add(segment);
1082
+                                }
1083
+                            }
1084
+                            currentLevel2Content = new StringBuilder();
1085
+                        }
1086
+                        // 开始新的二级标题内容
1087
+                        currentLevel2Content.append(text).append("\n");
1088
+                        inLevel2Section = true;
1089
+                    } else {
1090
+                        // 非二级标题或普通内容段落
1091
+                        if (inLevel2Section) {
1092
+                            currentLevel2Content.append(text).append("\n");
1093
+                        }
1094
+                    }
1095
+                }
1096
+
1097
+                // 保存最后一个二级标题内容
1098
+                if (currentLevel2Content.length() != 0) {
1099
+                    // 检查字节数
1100
+                    int level2Length = currentLevel2Content.toString().getBytes().length;
1101
+                    if (level2Length <= 65535) {
1102
+                        // 字数不大于65535,按二级标题分割
1103
+                        TextSegment segment = TextSegment.from(currentLevel2Content.toString());
1104
+                        segments.add(segment);
1105
+                    } else {
1106
+                        // 字数大于65535,按三级标题分割
1107
+                        StringBuilder currentLevel3Content = new StringBuilder();
1108
+                        Range level2Range = hwpfDocument.getRange();
1109
+                        boolean foundCurrentLevel2 = false;
1110
+                        
1111
+                        for (int j = 0; j < level2Range.numParagraphs(); j++) {
1112
+                            Paragraph p = level2Range.getParagraph(j);
1113
+                            String paraText = p.text().trim();
1114
+                            if (paraText.isEmpty()) continue;
1115
+                            
1116
+                            // 找到当前二级标题的开始
1117
+                            if (p.getStyleIndex() == 2 && paraText.equals(currentLevel2Content.toString().split("\n")[0].trim())) {
1118
+                                foundCurrentLevel2 = true;
1119
+                            }
1120
+                            
1121
+                            if (foundCurrentLevel2) {
1122
+                                short paraStyleIndex = p.getStyleIndex();
1123
+                                
1124
+                                if (paraStyleIndex == 3) {
1125
+                                    // 三级标题
1126
+                                    // 保存当前三级标题内容
1127
+                                    if (currentLevel3Content.length() != 0) {
1128
+                                        TextSegment segment = TextSegment.from(currentLevel3Content.toString());
1129
+                                        segments.add(segment);
1130
+                                        currentLevel3Content = new StringBuilder();
1131
+                                    }
1132
+                                    // 开始新的三级标题内容
1133
+                                    currentLevel3Content.append(paraText).append("\n");
1134
+                                } else if (paraStyleIndex == 2 && !paraText.equals(currentLevel2Content.toString().split("\n")[0].trim())) {
1135
+                                    // 下一个二级标题,结束当前二级标题的处理
1136
+                                    break;
1137
+                                } else {
1138
+                                    // 普通内容或当前二级标题
1139
+                                    if (currentLevel3Content.length() != 0 || paraStyleIndex == 2) {
1140
+                                        currentLevel3Content.append(paraText).append("\n");
1141
+                                    }
1142
+                                }
1143
+                            }
1144
+                        }
1145
+                        
1146
+                        // 保存最后一个三级标题内容
1147
+                        if (currentLevel3Content.length() != 0) {
1148
+                            TextSegment segment = TextSegment.from(currentLevel3Content.toString());
1149
+                            segments.add(segment);
1150
+                        }
1151
+                    }
1152
+                }
884 1153
             }
1154
+            return segments;
885 1155
         }
1156
+
886 1157
         else if (filename.endsWith(".pdf")) {
887
-            document = new ApachePdfBoxDocumentParser().parse(fileInputStream);
1158
+            Document document = new ApachePdfBoxDocumentParser().parse(fileInputStream);
1159
+            DocumentByParagraphSplitter splitter = new DocumentByParagraphSplitter(maxSegmentSizeInChars, maxOverlapSizeInChars);
1160
+            return splitter.split(document);
888 1161
         }
889 1162
         else if (filename.endsWith(".txt")) {
890
-            document = new TextDocumentParser().parse(fileInputStream);
1163
+            Document document = new TextDocumentParser().parse(fileInputStream);
1164
+            DocumentByParagraphSplitter splitter = new DocumentByParagraphSplitter(maxSegmentSizeInChars, maxOverlapSizeInChars);
1165
+            return splitter.split(document);
891 1166
         }
892 1167
         else {
893 1168
             throw new UnsupportedOperationException("不支持文件类型: " + filename);
894 1169
         }
895
-        DocumentByParagraphSplitter splitter = new DocumentByParagraphSplitter(maxSegmentSizeInChars,  maxOverlapSizeInChars);
896
-        return splitter.split(document);
897 1170
     }
898 1171
 
899 1172
     public void generateWordDocument(String content, XWPFDocument document, int insertPos) {

+ 13
- 0
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/domain/CmcTitleEval.java Zobrazit soubor

@@ -51,6 +51,10 @@ public class CmcTitleEval extends BaseEntity
51 51
     @Excel(name = "评审表盖章前")
52 52
     private String sheet;
53 53
 
54
+    /** 保密审核意见 */
55
+    @Excel(name = "保密审核意见")
56
+    private String secretOpinion;
57
+
54 58
     /** 评审表(盖章后) */
55 59
     @Excel(name = "评审表盖章后")
56 60
     private String sheetStamp;
@@ -314,6 +318,15 @@ public class CmcTitleEval extends BaseEntity
314 318
     {
315 319
         return confirmStatus;
316 320
     }
321
+    public void setSecretOpinion(String secretOpinion)
322
+    {
323
+        this.secretOpinion = secretOpinion;
324
+    }
325
+
326
+    public String getSecretOpinion()
327
+    {
328
+        return secretOpinion;
329
+    }
317 330
     public void setApplyUser(SysUser applyUser)
318 331
     {
319 332
         this.applyUser = applyUser;

+ 5
- 1
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcTitleEvalMapper.xml Zobrazit soubor

@@ -27,6 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
27 27
         <result property="confirmer"    column="confirmer"    />
28 28
         <result property="confirmTime"    column="confirm_time"    />
29 29
         <result property="confirmStatus"    column="confirm_status"    />
30
+        <result property="secretOpinion"    column="secret_opinion"    />
30 31
         <association property="applyUser"    javaType="SysUser"         resultMap="ApplyUserResult" />
31 32
         <association property="titleUser"    javaType="SysUser"         resultMap="TitleUserResult" />
32 33
         <association property="confirmUser"    javaType="SysUser"         resultMap="ConfirmUserResult" />
@@ -50,7 +51,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
50 51
     <sql id="selectCmcTitleEvalVo">
51 52
         select te.title_eval_id, te.user_id, u.nick_name as apply_nick_name, te.annual, te.institude, te.type, te.level, te.title_profession, te.sheet, te.sheet_stamp, te.material, te.is_approved, te.publicity_file, te.scan_file,
52 53
                te.obtain_time, te.apply_time, te.title_user_id, u1.nick_name as title_nick_name, te.title_time, te.title_comment, te.material_upload_time, te.confirmer, u2.nick_name as confirm_nick_name, te.confirm_time,
53
-               te.confirm_status from cmc_title_eval as te
54
+               te.confirm_status, te.secret_opinion from cmc_title_eval as te
54 55
         left join sys_user as u on u.user_id = te.user_id
55 56
         left join sys_user as u1 on u1.user_id = te.title_user_id
56 57
         left join sys_user as u2 on u2.user_id = te.confirmer
@@ -113,6 +114,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
113 114
             <if test="confirmer != null">confirmer,</if>
114 115
             <if test="confirmTime != null">confirm_time,</if>
115 116
             <if test="confirmStatus != null">confirm_status,</if>
117
+            <if test="secretOpinion != null">secret_opinion,</if>
116 118
          </trim>
117 119
         <trim prefix="values (" suffix=")" suffixOverrides=",">
118 120
             <if test="titleEvalId != null">#{titleEvalId},</if>
@@ -137,6 +139,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
137 139
             <if test="confirmer != null">#{confirmer},</if>
138 140
             <if test="confirmTime != null">#{confirmTime},</if>
139 141
             <if test="confirmStatus != null">#{confirmStatus},</if>
142
+            <if test="secretOpinion != null">#{secretOpinion},</if>
140 143
          </trim>
141 144
     </insert>
142 145
 
@@ -164,6 +167,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
164 167
             <if test="confirmer != null">confirmer = #{confirmer},</if>
165 168
             <if test="confirmTime != null">confirm_time = #{confirmTime},</if>
166 169
             <if test="confirmStatus != null">confirm_status = #{confirmStatus},</if>
170
+            <if test="secretOpinion != null">secret_opinion = #{secretOpinion},</if>
167 171
         </trim>
168 172
         where title_eval_id = #{titleEvalId}
169 173
     </update>

+ 21
- 2
oa-ui/src/views/flowable/form/business/subContract.vue Zobrazit soubor

@@ -2,7 +2,7 @@
2 2
  * @Author: ysh
3 3
  * @Date: 2024-05-10 15:31:57
4 4
  * @LastEditors: wrh
5
- * @LastEditTime: 2025-12-16 11:06:33
5
+ * @LastEditTime: 2026-01-09 16:14:26
6 6
 -->
7 7
 <template>
8 8
   <div class="app-container">
@@ -352,7 +352,7 @@
352 352
     <el-dialog title="选择承接合同" :visible.sync="contractOpen" width="70%" append-to-body>
353 353
       <choose-contract @choose="confirmContract"></choose-contract>
354 354
     </el-dialog>
355
-    <el-drawer :visible.sync="drawerOpen" title="" :size="'70%'" append-to-body>
355
+    <el-drawer :visible.sync="drawerOpen" title="" :size="'70%'" append-to-body @close="closeDrawerFn">
356 356
       <projectInfo :needReturn="false"></projectInfo>
357 357
     </el-drawer>
358 358
     <el-drawer :visible.sync="formOpen" title="" :size="'55%'" append-to-body>
@@ -1245,6 +1245,25 @@ export default {
1245 1245
     clickProjectFn(row) {
1246 1246
       this.$router.replace({ query: { ...this.$route.query, projectId: row.projectId } });
1247 1247
       this.drawerOpen = true;
1248
+      // 找到当前tab并修改当前tab显示的标题
1249
+      let currentView = this.$store.state.tagsView.visitedViews.find(item => item.path === this.$route.path);
1250
+      if (currentView != null) {
1251
+        currentView.title = row.projectName;
1252
+      }
1253
+    },
1254
+    closeDrawerFn() {
1255
+      this.drawerOpen = false;
1256
+      // 只需要删除 query 中的 projectId参数,保留其他参数
1257
+      const { projectId, ...otherQuery } = this.$route.query;
1258
+      this.$router.replace({ 
1259
+        path: this.$route.path, 
1260
+        query: otherQuery 
1261
+      });
1262
+      // 找到当前tab并修改当前tab显示的标题为"分包合同"
1263
+      let currentView = this.$store.state.tagsView.visitedViews.find(item => item.path === this.$route.path);
1264
+      if (currentView != null) {
1265
+        currentView.title = '分包合同';
1266
+      }
1248 1267
     },
1249 1268
     isReturn(val) {
1250 1269
       this.showAlter = val

+ 108
- 12
oa-ui/src/views/flowable/form/oa/titlesForm.vue Zobrazit soubor

@@ -1,8 +1,8 @@
1 1
 <!--
2 2
  * @Author: ysh
3 3
  * @Date: 2025-08-18 10:59:25
4
- * @LastEditors: Please set LastEditors
5
- * @LastEditTime: 2025-08-19 16:33:56
4
+ * @LastEditors: wrh
5
+ * @LastEditTime: 2026-01-09 15:52:07
6 6
 -->
7 7
 <template>
8 8
   <div>
@@ -37,8 +37,7 @@
37 37
           </el-card>
38 38
         </div>
39 39
 
40
-        <el-form :model="form" :rules="formRules" ref="form" label-width="135px" :disabled="taskName == ''"
41
-          class="mt20">
40
+        <el-form :model="form" :rules="formRules" ref="form" label-width="135px" :disabled="taskName == ''" class="mt20">
42 41
           <!-- 基本信息区域 -->
43 42
           <div class="form-section" v-if="showBasicInfo()">
44 43
             <div class="section-title">
@@ -77,9 +76,10 @@
77 76
             <el-form-item label="职称类型" prop="type">
78 77
               <el-select v-model="form.type" placeholder="请选择职称类型" style="width: 100%"
79 78
                 :disabled="taskName == '' || taskName != '评审申请'">
80
-                <el-option label="工程技术类" value="工程技术类" />
81
-                <el-option label="工程经济类" value="工程经济类" />
82
-                <el-option label="其他" value="其他" />
79
+                <el-option label="工程类" value="工程类" />
80
+                <el-option label="经济类" value="经济类" />
81
+                <el-option label="政工类" value="政工类" />
82
+                <el-option label="企业法律顾问类" value="企业法律顾问类" />
83 83
               </el-select>
84 84
             </el-form-item>
85 85
 
@@ -112,7 +112,7 @@
112 112
             <!-- 盖章前评审表 -->
113 113
             <el-form-item label="评审表(盖章前)" prop="sheet">
114 114
               <FileUpload v-if="taskName == '评审申请' && !form.sheet" :disabled="taskName == '' || taskName != '评审申请'"
115
-                ref="sheetFile" :limit="1" :filePathName="'职称评审/盖章前评审表'" :fileType="['pdf']" @input="getSheetPath">
115
+                ref="sheetFile" :limit="1" :filePathName="'职称评审/盖章前评审表/' + form.annual + '/' + getUserName(form.userId)" :fileType="['pdf']" @input="getSheetPath">
116 116
               </FileUpload>
117 117
               <div v-if="form.sheet">
118 118
                 <el-link type="primary" @click="reviewWord(`${baseUrl}${'/profile/upload' + form.sheet}`)">
@@ -126,11 +126,24 @@
126 126
                   v-if="taskName == '评审申请' && taskName != ''">删除文件</span>
127 127
               </div>
128 128
             </el-form-item>
129
-
129
+            <el-form-item label="保密审核意见单及承诺书" prop="secretOpinion">
130
+              <el-button v-if="taskName == '评审申请' && !form.secretOpinion" type="primary" size="small" @click="openUploadDialog">选取文件</el-button>
131
+              <div v-if="form.secretOpinion">
132
+                <el-link type="primary" @click="reviewWord(`${baseUrl}${'/profile/upload' + form.secretOpinion}`)">
133
+                  {{ getFileName(form.secretOpinion) }}
134
+                </el-link>
135
+                <el-link class="ml20" type="warning" :href="`${baseUrl}${'/profile/upload' + form.secretOpinion}`"
136
+                  :underline="false" target="_blank">
137
+                  <span class="el-icon-download">下载文件</span>
138
+                </el-link>
139
+                <span class="el-icon-delete del-file" @click="deleteDoc('secretOpinion')"
140
+                  v-if="taskName == '评审申请' && taskName != ''">删除文件</span>
141
+              </div>
142
+            </el-form-item>
130 143
             <!-- 其他材料 -->
131 144
             <el-form-item label="其他材料" prop="material">
132 145
               <FileUpload v-if="taskName == '评审申请' && !form.material" :disabled="taskName == '' || taskName != '评审申请'"
133
-                ref="materialFile" :limit="1" :filePathName="'职称评审/其他材料'" :fileType="['rar', 'zip']"
146
+                ref="materialFile" :limit="1" :filePathName="'职称评审/其他材料/' + form.annual + '/' + getUserName(form.userId)" :fileType="['rar', 'zip']"
134 147
                 @input="getMaterialPath">
135 148
               </FileUpload>
136 149
               <div v-if="form.material">
@@ -177,7 +190,7 @@
177 190
             <!-- 盖章后评审表 -->
178 191
             <el-form-item label="评审表(盖章后)" prop="sheetStamp">
179 192
               <FileUpload v-if="taskName == '盖章上传' && !form.sheetStamp" :disabled="taskName == '' || taskName != '盖章上传'"
180
-                ref="sheetStampFile" :limit="1" :filePathName="'职称评审/盖章后评审表'" :fileType="['pdf']"
193
+                ref="sheetStampFile" :limit="1" :filePathName="'职称评审/盖章后评审表/' + form.annual + '/' + getUserName(form.userId)" :fileType="['pdf']"
181 194
                 @input="getSheetStampPath">
182 195
               </FileUpload>
183 196
               <div v-if="form.sheetStamp">
@@ -218,6 +231,28 @@
218 231
       <return-btn :taskForm="taskForm" :comment="commentByRole()" @goBack="$emit('goBack')" @saves=""
219 232
         @cancel="returnOpen = false"></return-btn>
220 233
     </el-dialog>
234
+    <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
235
+      <el-upload ref="uploadRef" accept=".pdf" :headers="upload.headers" :action="upload.url" :data="upload.data"
236
+        :disabled="upload.isUploading" :on-progress="handleFileUploadProgress" :on-change="handleFileUploadChange"
237
+        :on-success="handleFileSuccess" :auto-upload="false" drag v-loading="uploadLoading"
238
+        element-loading-text="正在上传,请稍等">
239
+        <i class="el-icon-upload"></i>
240
+        <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
241
+        <template #tip>
242
+          <div class="el-upload__tip text-center">
243
+            <span>仅允许导入pdf格式文件。</span>
244
+            <el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;"
245
+              @click="importTemplate">下载模板</el-link>
246
+          </div>
247
+        </template>
248
+      </el-upload>
249
+      <template #footer>
250
+        <div class="dialog-footer">
251
+          <el-button type="primary" @click="submitUpload">确 定</el-button>
252
+          <el-button @click="upload.open = false">取 消</el-button>
253
+        </div>
254
+      </template>
255
+    </el-dialog>
221 256
   </div>
222 257
 </template>
223 258
 
@@ -226,6 +261,8 @@ import flow from '@/views/flowable/task/todo/detail/flow'
226 261
 import { flowXmlAndNode } from "@/api/flowable/definition";
227 262
 import { listEval, getEval, delEval, addEval, updateEval } from "@/api/oa/titles/titles";
228 263
 import { complete, getNextFlowNode } from "@/api/flowable/todo";
264
+import { getToken } from "@/utils/auth";
265
+import { downloadTemplate } from "@/api/file/project";
229 266
 import { allocatedUserList } from "@/api/system/role";
230 267
 import ReturnComment from "@/views/flowable/form/components/flowBtn/returnComment.vue";
231 268
 import ReturnBtn from "@/views/flowable/form/components/flowBtn/returnBtn.vue";
@@ -270,10 +307,22 @@ export default {
270 307
         level: '',
271 308
         titleProfession: '',
272 309
         sheet: '',
310
+        secretOpinion: '',
273 311
         material: ''
274 312
       },
275 313
       rules: {},
276
-      returnOpen: false,
314
+      returnOpen: false,      
315
+      upload: {
316
+        open: false,
317
+        title: "上传保密审核意见单",
318
+        isUploading: false,
319
+        updateSupport: 0,
320
+        headers: { 'Authorization': "Bearer " + getToken() },
321
+        data: { 'fileType': '' },
322
+        url: process.env.VUE_APP_BASE_API + "/common/upload"
323
+      },
324
+      uploadLoading: false,
325
+      uploadFormData: undefined,
277 326
       showAlter: true
278 327
     }
279 328
   },
@@ -301,6 +350,9 @@ export default {
301 350
         sheet: [
302 351
           { required: true, message: '请上传盖章前评审表', trigger: 'change' }
303 352
         ],
353
+        secretOpinion: [
354
+          { required: true, message: '请上传保密审核意见单', trigger: 'change' }
355
+        ],
304 356
         material: [
305 357
           { required: true, message: '请上传其他材料', trigger: 'change' }
306 358
         ],
@@ -485,6 +537,50 @@ export default {
485 537
         return this.form.titleComment;
486 538
       }
487 539
     },
540
+    /**PDF文件上传中处理 */
541
+    handleFileUploadProgress(event, file, fileList) {
542
+      this.form.secretOpinion = "/职称评审/保密审核意见单/" + this.form.annual + '/' + this.$store.state.user.name + "/" + file.name;
543
+      this.upload.isUploading = true;
544
+      this.uploadLoading = true;
545
+    },
546
+    /* PDF文件改变时 */
547
+    handleFileUploadChange(file, fileList) {
548
+      if (fileList.length > 1) {
549
+        fileList.splice(0, 1);
550
+      }
551
+      this.uploadFormData = new FormData();
552
+      this.uploadFormData.append("file", file);
553
+      this.form.secretOpinion = "/职称评审/保密审核意见单/" + this.form.annual + '/' + this.$store.state.user.name + "/" + file.name;
554
+    },
555
+    /** PDF文件上传成功处理 */
556
+    handleFileSuccess(response, file, fileList) {
557
+      console.log("成功");
558
+      this.upload.open = false;
559
+      this.upload.isUploading = false;
560
+      this.uploadLoading = false;
561
+      this.fileList = [];
562
+      this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
563
+      this.$refs["uploadRef"].clearFiles();
564
+    },
565
+    /* 打开上传对话框 */
566
+    openUploadDialog() {
567
+      // 设置文件类型和存储路径
568
+      this.upload.data.fileType = '职称评审/保密审核意见单/' + this.form.annual + '/' + this.$store.state.user.name;
569
+      // 打开上传对话框
570
+      this.upload.open = true;
571
+    },
572
+    /* PDF上传提交按钮 */
573
+    submitUpload() {
574
+      this.$refs['uploadRef'].submit();
575
+    },
576
+    /* 下载模板 */
577
+    importTemplate() {
578
+      const path = '/profile/upload/template/opinion.docx'
579
+      downloadTemplate(path).then(res => {
580
+        const blob = new Blob([res])
581
+        saveAs(blob, 'opinion.docx');
582
+      });
583
+    },
488 584
   }
489 585
 }
490 586
 </script>

+ 2
- 2
oa-ui/src/views/llm/agent/AgentDetail.vue Zobrazit soubor

@@ -2,7 +2,7 @@
2 2
  * @Author: wrh
3 3
  * @Date: 2025-01-01 00:00:00
4 4
  * @LastEditors: wrh
5
- * @LastEditTime: 2025-11-19 16:41:27
5
+ * @LastEditTime: 2026-01-19 15:28:10
6 6
 -->
7 7
 <template>
8 8
   <div class="agent-detail-container" v-loading="loading">
@@ -262,7 +262,7 @@ export default {
262 262
         if (this.agentInfo?.agentName) {
263 263
           const res = await opening(this.agentInfo.agentName)
264 264
           this.openingMessage = res.data.resultContent;
265
-          if (this.agentInfo.agentName.includes('技术文件')) {
265
+          if (this.agentInfo.agentName.includes('技术')) {
266 266
             this.selectDocument = '选择招标文件'
267 267
             this.selectDocumentTip = '请上传您需要分析的招标文件(单个文件):'
268 268
           }

+ 2
- 2
oa-ui/src/views/llm/agent/index.vue Zobrazit soubor

@@ -2,7 +2,7 @@
2 2
  * @Author: ysh
3 3
  * @Date: 2025-07-17 18:16:50
4 4
  * @LastEditors: wrh
5
- * @LastEditTime: 2025-11-19 16:26:10
5
+ * @LastEditTime: 2026-01-19 15:24:42
6 6
 -->
7 7
 <template>
8 8
   <div class="app-container">
@@ -150,7 +150,7 @@ export default {
150 150
       dialogTitle: '',
151 151
       isModifyAgent: false,
152 152
       // 模型列表
153
-      modelList: []
153
+      modelList: [{name: "Qwen2.5-7B-Instruct"}]
154 154
     }
155 155
   },
156 156
   mounted() {

+ 4
- 2
oa-ui/src/views/llm/knowledge/index.vue Zobrazit soubor

@@ -273,7 +273,7 @@
273 273
           <el-input v-model="uploadForm.collectionName" disabled />
274 274
         </el-form-item>
275 275
         <el-form-item label="选择文件" prop="file">
276
-          <el-upload ref="knowledgeUpload" multiple accept=".docx,.pdf" :headers="upload.headers" :action="''"
276
+          <el-upload ref="knowledgeUpload" multiple accept=".docx,.doc,.pdf" :headers="upload.headers" :action="''"
277 277
             :disabled="upload.isUploading" :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess"
278 278
             :auto-upload="false" drag :on-change="handleFileChange">
279 279
             <i class="el-icon-upload"></i>
@@ -283,7 +283,7 @@
283 283
                 <el-checkbox v-model="upload.updateSupport" />
284 284
                 是否更新已经存在的文件数据
285 285
               </div>
286
-              <span>支持 .docx、.pdf 格式文件</span>
286
+              <span>支持 .docx、.doc、.pdf 格式文件</span>
287 287
             </div>
288 288
           </el-upload>
289 289
         </el-form-item>
@@ -839,6 +839,8 @@ export default {
839 839
           return 'PDF文档';
840 840
         case 'docx':
841 841
           return 'Word文档';
842
+        case 'doc':
843
+          return 'Word文档';
842 844
         default:
843 845
           return '文档';
844 846
       }

+ 20
- 1
oa-ui/src/views/oa/contract/components/edit.vue Zobrazit soubor

@@ -207,7 +207,7 @@
207 207
         <choose-party-a @confirm="confirmPartyA"></choose-party-a>
208 208
       </div>
209 209
     </el-drawer>
210
-    <el-drawer :visible.sync="drawerOpen" title="" :size="'70%'" append-to-body>
210
+    <el-drawer :visible.sync="drawerOpen" title="" :size="'70%'" append-to-body @close="closeDrawerFn">
211 211
       <projectInfo :needReturn="false"></projectInfo>
212 212
     </el-drawer>
213 213
     <el-drawer :visible.sync="subInfoOpen" title="" :size="'55%'" append-to-body>
@@ -466,6 +466,25 @@ export default {
466 466
     clickProjectFn(row) {
467 467
       this.$router.replace({ query: { ...this.$route.query, projectId: row.projectId } });
468 468
       this.drawerOpen = true;
469
+      // 找到当前tab并修改当前tab显示的标题
470
+      let currentView = this.$store.state.tagsView.visitedViews.find(item => item.path === this.$route.path);
471
+      if (currentView != null) {
472
+        currentView.title = row.projectName;
473
+      }
474
+    },
475
+    closeDrawerFn() {
476
+      this.drawerOpen = false;
477
+      // 只需要删除 query 中的 projectId参数,保留其他参数
478
+      const { projectId, ...otherQuery } = this.$route.query;
479
+      this.$router.replace({ 
480
+        path: this.$route.path, 
481
+        query: otherQuery 
482
+      });
483
+      // 找到当前tab并修改当前tab显示的标题为"承接合同"
484
+      let currentView = this.$store.state.tagsView.visitedViews.find(item => item.path === this.$route.path);
485
+      if (currentView != null) {
486
+        currentView.title = '承接合同';
487
+      }
469 488
     },
470 489
     handleDelete(index, row) {
471 490
       this.connectProjectList.splice(index, 1)

+ 20
- 1
oa-ui/src/views/oa/contract/components/subEdit.vue Zobrazit soubor

@@ -182,7 +182,7 @@
182 182
         <choose-party-a @confirm="confirmPartyA"></choose-party-a>
183 183
       </div>
184 184
     </el-drawer>
185
-    <el-drawer :visible.sync="drawerOpen" title="" :size="'70%'" append-to-body>
185
+    <el-drawer :visible.sync="drawerOpen" title="" :size="'70%'" append-to-body @close="closeDrawerFn">
186 186
       <projectInfo :needReturn="false"></projectInfo>
187 187
     </el-drawer>
188 188
     <el-drawer :visible.sync="formOpen" title="" :size="'60%'" append-to-body>
@@ -501,6 +501,25 @@ export default {
501 501
     clickProjectFn(row) {
502 502
       this.$router.replace({ query: { ...this.$route.query, projectId: row.projectId } });
503 503
       this.drawerOpen = true;
504
+      // 找到当前tab并修改当前tab显示的标题
505
+      let currentView = this.$store.state.tagsView.visitedViews.find(item => item.path === this.$route.path);
506
+      if (currentView != null) {
507
+        currentView.title = row.projectName;
508
+      }
509
+    },
510
+    closeDrawerFn() {
511
+      this.drawerOpen = false;
512
+      // 只需要删除 query 中的 projectId参数,保留其他参数
513
+      const { projectId, ...otherQuery } = this.$route.query;
514
+      this.$router.replace({ 
515
+        path: this.$route.path, 
516
+        query: otherQuery 
517
+      });
518
+      // 找到当前tab并修改当前tab显示的标题为"分包合同"
519
+      let currentView = this.$store.state.tagsView.visitedViews.find(item => item.path === this.$route.path);
520
+      if (currentView != null) {
521
+        currentView.title = '分包合同';
522
+      }
504 523
     },
505 524
     handleDelete(index, row) {
506 525
       this.connectProjectList.splice(index, 1)

+ 78
- 183
oa-ui/src/views/oa/titles/info.vue Zobrazit soubor

@@ -1,38 +1,22 @@
1 1
 <!--
2 2
  * @Author: ysh
3 3
  * @Date: 2025-08-15 16:13:32
4
- * @LastEditors: 
5
- * @LastEditTime: 2025-08-15 16:13:39
4
+ * @LastEditors: wrh
5
+ * @LastEditTime: 2026-01-22 16:40:59
6 6
 -->
7 7
 <template>
8 8
   <div class="app-container">
9
-    <el-form
10
-      :model="queryParams"
11
-      ref="queryForm"
12
-      size="small"
13
-      :inline="true"
14
-      v-show="showSearch"
15
-      label-width="68px"
16
-    >
9
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
17 10
       <el-form-item label="职称类型" prop="type">
18
-        <el-select
19
-          v-model="queryParams.type"
20
-          clearable
21
-          placeholder="请选择职称类型"
22
-          @change="handleQuery"
23
-        >
24
-          <el-option label="工程技术类" value="工程技术类"></el-option>
25
-          <el-option label="工程经济类" value="工程经济类"></el-option>
26
-          <el-option label="其他" value="其他"></el-option>
11
+        <el-select v-model="queryParams.type" clearable placeholder="请选择职称类型" @change="handleQuery">
12
+          <el-option label="工程类" value="工程类" />
13
+          <el-option label="经济类" value="经济类" />
14
+          <el-option label="政工类" value="政工类" />
15
+          <el-option label="企业法律顾问类" value="企业法律顾问类" />
27 16
         </el-select>
28 17
       </el-form-item>
29 18
       <el-form-item label="职称级别" prop="level">
30
-        <el-select
31
-          v-model="queryParams.level"
32
-          clearable
33
-          placeholder="请选择职称级别"
34
-          @change="handleQuery"
35
-        >
19
+        <el-select v-model="queryParams.level" clearable placeholder="请选择职称级别" @change="handleQuery">
36 20
           <el-option label="正高级" value="正高级"></el-option>
37 21
           <el-option label="副高级" value="副高级"></el-option>
38 22
           <el-option label="高级" value="高级"></el-option>
@@ -42,93 +26,39 @@
42 26
         </el-select>
43 27
       </el-form-item>
44 28
       <el-form-item label="姓名" prop="userId">
45
-        <el-select
46
-          v-model="queryParams.userId"
47
-          filterable
48
-          clearable
49
-          @change="handleQuery"
50
-        >
51
-          <el-option
52
-            v-for="item in $store.state.user.userList"
53
-            :key="item.userId"
54
-            :label="item.nickName"
55
-            :value="item.userId"
56
-          >
29
+        <el-select v-model="queryParams.userId" filterable clearable @change="handleQuery">
30
+          <el-option v-for="item in $store.state.user.userList" :key="item.userId" :label="item.nickName"
31
+            :value="item.userId">
57 32
           </el-option>
58 33
         </el-select>
59 34
       </el-form-item>
60 35
       <el-form-item>
61
-        <el-button
62
-          type="primary"
63
-          icon="el-icon-search"
64
-          size="mini"
65
-          @click="handleQuery"
66
-          >搜索</el-button
67
-        >
68
-        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
69
-          >重置</el-button
70
-        >
36
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
37
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
71 38
       </el-form-item>
72 39
     </el-form>
73 40
 
74 41
     <el-row :gutter="10" class="mb8">
75 42
       <el-col :span="1.5">
76
-        <el-button
77
-          type="primary"
78
-          plain
79
-          icon="el-icon-plus"
80
-          size="mini"
81
-          @click="handleAdd"
82
-          v-hasPermi="['oa:title:add']"
83
-          >新增</el-button
84
-        >
43
+        <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
44
+          v-hasPermi="['oa:title:add']">新增</el-button>
85 45
       </el-col>
86 46
       <el-col :span="1.5">
87
-        <el-button
88
-          type="success"
89
-          plain
90
-          icon="el-icon-edit"
91
-          size="mini"
92
-          :disabled="single"
93
-          @click="handleUpdate"
94
-          v-hasPermi="['oa:title:edit']"
95
-          >修改</el-button
96
-        >
47
+        <el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate"
48
+          v-hasPermi="['oa:title:edit']">修改</el-button>
97 49
       </el-col>
98 50
       <el-col :span="1.5">
99
-        <el-button
100
-          type="danger"
101
-          plain
102
-          icon="el-icon-delete"
103
-          size="mini"
104
-          :disabled="multiple"
105
-          @click="handleDelete"
106
-          v-hasPermi="['oa:title:remove']"
107
-          >删除</el-button
108
-        >
51
+        <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
52
+          v-hasPermi="['oa:title:remove']">删除</el-button>
109 53
       </el-col>
110 54
       <el-col :span="1.5">
111
-        <el-button
112
-          type="warning"
113
-          plain
114
-          icon="el-icon-download"
115
-          size="mini"
116
-          @click="handleExport"
117
-          v-hasPermi="['oa:title:export']"
118
-          >导出</el-button
119
-        >
55
+        <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
56
+          v-hasPermi="['oa:title:export']">导出</el-button>
120 57
       </el-col>
121
-      <right-toolbar
122
-        :showSearch.sync="showSearch"
123
-        @queryTable="getList"
124
-      ></right-toolbar>
58
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
125 59
     </el-row>
126 60
 
127
-    <el-table
128
-      v-loading="loading"
129
-      :data="evalList"
130
-      @selection-change="handleSelectionChange"
131
-    >
61
+    <el-table v-loading="loading" :data="evalList" @selection-change="handleSelectionChange">
132 62
       <el-table-column type="selection" width="55" align="center" />
133 63
       <el-table-column label="姓名" align="center" prop="userId">
134 64
         <template slot-scope="scope">
@@ -139,61 +69,35 @@
139 69
       <el-table-column label="职称级别" align="center" prop="level" />
140 70
       <el-table-column label="职称专业名称" align="center" prop="titleProfession" />
141 71
       <el-table-column label="评审单位" align="center" prop="institude" />
142
-      <el-table-column label="证书取得时间" align="center" prop="obtainTime" width="180" >
72
+      <el-table-column label="证书取得时间" align="center" prop="obtainTime" width="180">
143 73
         <template slot-scope="scope">
144 74
           <span>{{ parseTime(scope.row.obtainTime, "{y}-{m}-{d}") }}</span>
145 75
         </template>
146 76
       </el-table-column>
147
-      
148
-      <el-table-column label="文件" align="center" prop="publicityFile" >
149
-      <template slot-scope="scope">
150
-        <el-link
151
-            type="primary" @click="reviewWord(`${baseUrl}${'/profile/upload' + scope.row.publicityFile}`)">
77
+
78
+      <el-table-column label="文件" align="center" prop="publicityFile">
79
+        <template slot-scope="scope">
80
+          <el-link type="primary" @click="reviewWord(`${baseUrl}${scope.row.publicityFile}`)">
152 81
             {{ getFileName(scope.row.publicityFile) }}
153 82
           </el-link>
154 83
           <br>
155
-          <el-link
156
-            class="ml20"
157
-            type="warning"
158
-            :href="`${baseUrl}${'/profile/upload' + scope.row.publicityFile}`"
159
-            :underline="false"
160
-            target="_blank">
84
+          <el-link class="ml20" type="warning" :href="`${baseUrl}${scope.row.publicityFile}`"
85
+            :underline="false" target="_blank">
161 86
           </el-link>
162
-          <el-link
163
-            type="primary" @click="reviewWord(`${baseUrl}${'/profile/upload' + scope.row.scanFile}`)">
87
+          <el-link type="primary" @click="reviewWord(`${baseUrl}${scope.row.scanFile}`)">
164 88
             {{ getFileName(scope.row.scanFile) }}
165 89
           </el-link>
166
-          <el-link
167
-            class="ml20"
168
-            type="warning"
169
-            :href="`${baseUrl}${'/profile/upload' + scope.row.scanFile}`"
170
-            :underline="false"
171
-            target="_blank">
90
+          <el-link class="ml20" type="warning" :href="`${baseUrl}${scope.row.scanFile}`"
91
+            :underline="false" target="_blank">
172 92
           </el-link>
173
-      </template>
93
+        </template>
174 94
       </el-table-column>
175
-      <el-table-column
176
-        label="操作"
177
-        align="center"
178
-        class-name="small-padding fixed-width"
179
-      >
95
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
180 96
         <template slot-scope="scope">
181
-          <el-button
182
-            size="mini"
183
-            type="text"
184
-            icon="el-icon-edit"
185
-            @click="handleUpdate(scope.row)"
186
-            v-hasPermi="['oa:title:edit']"
187
-            >修改</el-button
188
-          >
189
-          <el-button
190
-            size="mini"
191
-            type="text"
192
-            icon="el-icon-delete"
193
-            @click="handleDelete(scope.row)"
194
-            v-hasPermi="['oa:title:remove']"
195
-            >删除</el-button
196
-          >
97
+          <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
98
+            v-hasPermi="['oa:title:edit']">修改</el-button>
99
+          <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
100
+            v-hasPermi="['oa:title:remove']">删除</el-button>
197 101
         </template>
198 102
       </el-table-column>
199 103
     </el-table>
@@ -201,62 +105,55 @@
201 105
     <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
202 106
       @pagination="getList" />
203 107
 
204
-     <!-- 添加或修改职称信息对话框 -->
108
+    <!-- 添加或修改职称信息对话框 -->
205 109
     <el-dialog :title="title" :visible.sync="open" width="60%" append-to-body>
206 110
       <el-form ref="form" :model="form" :rules="formRules" label-width="120px">
207 111
         <el-form-item label="姓名" prop="userId">
208
-          <el-select v-model="form.userId" filterable clearable >
209
-            <el-option
210
-              v-for="item in $store.state.user.userList"
211
-              :key="item.userId"
212
-              :label="item.nickName"
112
+          <el-select v-model="form.userId" filterable clearable>
113
+            <el-option v-for="item in $store.state.user.userList" :key="item.userId" :label="item.nickName"
213 114
               :value="item.userId">
214 115
             </el-option>
215 116
           </el-select>
216 117
         </el-form-item>
217 118
         <el-form-item label="职称类型" prop="type">
218
-              <el-select v-model="form.type" placeholder="请选择职称类型" style="width: 100%">
219
-                <el-option label="工程技术类" value="工程技术类" />
220
-                <el-option label="工程经济类" value="工程经济类" />
221
-                <el-option label="其他" value="其他" />
222
-              </el-select>
223
-            </el-form-item>
224
-         <el-form-item label="职称级别" prop="level">
225
-           <el-select v-model="form.level" placeholder="请选择职称级别" style="width: 100%">
226
-                <el-option label="员级" value="员级" />
227
-                <el-option label="助理级" value="助理级" />
228
-                <el-option label="中级" value="中级" />
229
-                <el-option label="副高级" value="副高级" />
230
-                <el-option label="正高级" value="正高级" />
231
-              </el-select>
119
+          <el-select v-model="form.type" placeholder="请选择职称类型" style="width: 100%">
120
+            <el-option label="工程类" value="工程类" />
121
+            <el-option label="经济类" value="经济类" />
122
+            <el-option label="政工类" value="政工类" />
123
+            <el-option label="企业法律顾问类" value="企业法律顾问类" />
124
+          </el-select>
125
+        </el-form-item>
126
+        <el-form-item label="职称级别" prop="level">
127
+          <el-select v-model="form.level" placeholder="请选择职称级别" style="width: 100%">
128
+            <el-option label="员级" value="员级" />
129
+            <el-option label="助理级" value="助理级" />
130
+            <el-option label="中级" value="中级" />
131
+            <el-option label="副高级" value="副高级" />
132
+            <el-option label="正高级" value="正高级" />
133
+          </el-select>
232 134
         </el-form-item>
233 135
         <el-form-item label="职称专业名称" prop="titleProfession">
234
-           <el-input v-model="form.titleProfession" placeholder="请输入职称专业名称"  maxlength="50" show-word-limit/>
136
+          <el-input v-model="form.titleProfession" placeholder="请输入职称专业名称" maxlength="50" show-word-limit />
235 137
         </el-form-item>
236 138
         <el-form-item label="评审单位" prop="institude">
237
-           <el-select v-model="form.institude" placeholder="请选择评审单位" style="width: 100%">
238
-                <el-option label="中国电建" value="中国电建" />
239
-                <el-option label="成都人社" value="成都人社" />
240
-                <el-option label="四川省测绘局" value="四川省测绘局" />
241
-                <el-option label="四川省建设厅" value="四川省建设厅" />
242
-                <el-option label="其他" value="其他" />
243
-              </el-select>
139
+          <el-select v-model="form.institude" placeholder="请选择评审单位" style="width: 100%">
140
+            <el-option label="中国电建" value="中国电建" />
141
+            <el-option label="成都人社" value="成都人社" />
142
+            <el-option label="四川省测绘局" value="四川省测绘局" />
143
+            <el-option label="四川省建设厅" value="四川省建设厅" />
144
+            <el-option label="其他" value="其他" />
145
+          </el-select>
244 146
         </el-form-item>
245
-        
147
+
246 148
         <el-form-item label="公示红头文件" prop="publicityFile">
247
-          <file-upload v-model="form.publicityFile" :fileType="['pdf']"/>
149
+          <file-upload v-model="form.publicityFile" :fileType="['pdf']" />
248 150
         </el-form-item>
249 151
         <el-form-item label="证书扫描件" prop="scanFile">
250
-          <file-upload v-model="form.scanFile" :fileType="['pdf']"/>
152
+          <file-upload v-model="form.scanFile" :fileType="['pdf']" />
251 153
         </el-form-item>
252 154
         <el-form-item label="证书取得时间" prop="obtainTime">
253
-          <el-date-picker
254
-            clearable
255
-            v-model="form.obtainTime"
256
-            type="date"
257
-            value-format="yyyy-MM-dd"
258
-            placeholder="请选择证书取得时间"
259
-          >
155
+          <el-date-picker clearable v-model="form.obtainTime" type="date" value-format="yyyy-MM-dd"
156
+            placeholder="请选择证书取得时间">
260 157
           </el-date-picker>
261 158
         </el-form-item>
262 159
       </el-form>
@@ -270,14 +167,14 @@
270 167
 </template>
271 168
 
272 169
 <script>
273
-  import {
170
+import {
274 171
   listEval,
275 172
   getEval,
276 173
   delEval,
277 174
   addEval,
278 175
   updateEval,
279 176
 } from "@/api/oa/titles/titles";
280
-import {Snowflake} from"@/utils/snowFlake.js";
177
+import { Snowflake } from "@/utils/snowFlake.js";
281 178
 
282 179
 export default {
283 180
   name: "Eval",
@@ -336,7 +233,7 @@ export default {
336 233
   created() {
337 234
     this.getList();
338 235
   },
339
-  computed:{
236
+  computed: {
340 237
     formRules() {
341 238
       return {
342 239
         userId: [
@@ -371,10 +268,10 @@ export default {
371 268
           { required: () => this.form.isApproved == '1', message: '请上传证书扫描件', trigger: 'change' }
372 269
         ],
373 270
         obtainTime: [
374
-          { required: () => this.form.isApproved == '1', message: '请选择证书取得时间', trigger: 'change'}
271
+          { required: () => this.form.isApproved == '1', message: '请选择证书取得时间', trigger: 'change' }
375 272
         ]
376 273
       }
377
-  }
274
+    }
378 275
   },
379 276
   methods: {
380 277
     /** 查询职称信息列表 */
@@ -486,7 +383,7 @@ export default {
486 383
           this.getList();
487 384
           this.$modal.msgSuccess("删除成功");
488 385
         })
489
-        .catch(() => {});
386
+        .catch(() => { });
490 387
     },
491 388
     /** 导出按钮操作 */
492 389
     handleExport() {
@@ -502,6 +399,4 @@ export default {
502 399
 };
503 400
 </script>
504 401
 
505
-<style lang="scss" scoped>
506
-
507
-</style>
402
+<style lang="scss" scoped></style>

+ 76
- 191
oa-ui/src/views/oa/titles/record.vue Zobrazit soubor

@@ -1,31 +1,16 @@
1 1
 <template>
2 2
   <div class="app-container">
3
-    <el-form
4
-      :model="queryParams"
5
-      ref="queryForm"
6
-      size="small"
7
-      :inline="true"
8
-      v-show="showSearch"
9
-      label-width="68px"
10
-    >
3
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
11 4
       <el-form-item label="职称类型" prop="type">
12
-        <el-select
13
-          v-model="queryParams.type"
14
-          clearable
15
-          placeholder="请选择职称类型"
16
-          @change="handleQuery"
17
-        >
18
-          <el-option label="工程技术类" value="工程技术类"></el-option>
19
-          <el-option label="工程经济类" value="工程经济类"></el-option>
20
-          <el-option label="其他" value="其他"></el-option>
5
+        <el-select v-model="queryParams.type" clearable placeholder="请选择职称类型" @change="handleQuery">
6
+          <el-option label="工程类" value="工程类" />
7
+          <el-option label="经济类" value="经济类" />
8
+          <el-option label="政工类" value="政工类" />
9
+          <el-option label="企业法律顾问类" value="企业法律顾问类" />
21 10
         </el-select>
22 11
       </el-form-item>
23 12
       <el-form-item label="职称级别" prop="level">
24
-        <el-select
25
-          v-model="queryParams.level"
26
-          clearable
27
-          placeholder="请选择职称级别"
28
-          @change="handleQuery">
13
+        <el-select v-model="queryParams.level" clearable placeholder="请选择职称级别" @change="handleQuery">
29 14
           <el-option label="正高级" value="正高级"></el-option>
30 15
           <el-option label="副高级" value="副高级"></el-option>
31 16
           <el-option label="高级" value="高级"></el-option>
@@ -35,81 +20,37 @@
35 20
         </el-select>
36 21
       </el-form-item>
37 22
       <el-form-item label="申请人" prop="userId">
38
-        <el-select
39
-          v-model="queryParams.userId"
40
-          filterable
41
-          clearable
42
-          @change="handleQuery"
43
-        >
44
-          <el-option
45
-            v-for="item in $store.state.user.userList"
46
-            :key="item.userId"
47
-            :label="item.nickName"
48
-            :value="item.userId"
49
-          >
23
+        <el-select v-model="queryParams.userId" filterable clearable @change="handleQuery">
24
+          <el-option v-for="item in $store.state.user.userList" :key="item.userId" :label="item.nickName"
25
+            :value="item.userId">
50 26
           </el-option>
51 27
         </el-select>
52 28
       </el-form-item>
53 29
       <el-form-item>
54
-        <el-button
55
-          type="primary"
56
-          icon="el-icon-search"
57
-          size="mini"
58
-          @click="handleQuery"
59
-          >搜索</el-button
60
-        >
61
-        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
62
-          >重置</el-button
63
-        >
30
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
31
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
64 32
       </el-form-item>
65 33
     </el-form>
66 34
     <el-row :gutter="10" class="mb8">
67 35
       <el-col :span="1.5">
68
-        <el-button
69
-          type="success"
70
-          plain
71
-          icon="el-icon-edit"
72
-          size="mini"
73
-          :disabled="single"
74
-          @click="handleUpdate"
75
-          v-hasPermi="['oa:title:edit']"
76
-          >修改</el-button
77
-        >
36
+        <el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate"
37
+          v-hasPermi="['oa:title:edit']">修改</el-button>
78 38
       </el-col>
79 39
       <el-col :span="1.5">
80
-        <el-button
81
-          type="warning"
82
-          plain
83
-          icon="el-icon-download"
84
-          size="mini"
85
-          @click="handleExport"
86
-          v-hasPermi="['oa:title:export']"
87
-          >导出</el-button
88
-        >
40
+        <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
41
+          v-hasPermi="['oa:title:export']">导出</el-button>
89 42
       </el-col>
90
-      <right-toolbar
91
-        :showSearch.sync="showSearch"
92
-        @queryTable="getList"
93
-      ></right-toolbar>
43
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
94 44
     </el-row>
95 45
 
96
-    <el-table
97
-      v-loading="loading"
98
-      :data="evalList"
99
-      @selection-change="handleSelectionChange"
100
-    >
46
+    <el-table v-loading="loading" :data="evalList" @selection-change="handleSelectionChange">
101 47
       <el-table-column type="selection" width="55" align="center" />
102 48
       <el-table-column label="申请人" align="center" prop="userId">
103 49
         <template slot-scope="scope">
104 50
           {{ getUserName(scope.row.userId) }}
105 51
         </template>
106 52
       </el-table-column>
107
-      <el-table-column
108
-        label="申请时间"
109
-        align="center"
110
-        prop="applyTime"
111
-        width="150"
112
-      >
53
+      <el-table-column label="申请时间" align="center" prop="applyTime" width="150">
113 54
         <template slot-scope="scope">
114 55
           <span>{{ parseTime(scope.row.applyTime, "{y}-{m}-{d}") }}</span>
115 56
         </template>
@@ -118,18 +59,9 @@
118 59
       <el-table-column label="评审单位" align="center" prop="institude" />
119 60
       <el-table-column label="职称类型" align="center" prop="type" />
120 61
       <el-table-column label="职称级别" align="center" prop="level" />
121
-      <el-table-column
122
-        label="职称专业名称"
123
-        align="center"
124
-        prop="titleProfession"
125
-      />
62
+      <el-table-column label="职称专业名称" align="center" prop="titleProfession" />
126 63
       <el-table-column label="审核意见" align="center" prop="titleComment" />
127
-      <el-table-column
128
-        label="审核时间"
129
-        align="center"
130
-        prop="titleTime"
131
-        width="180"
132
-      >
64
+      <el-table-column label="审核时间" align="center" prop="titleTime" width="180">
133 65
         <template slot-scope="scope">
134 66
           <span>{{ parseTime(scope.row.titleTime, "{y}-{m}-{d}") }}</span>
135 67
         </template>
@@ -139,55 +71,35 @@
139 71
           {{ getUserName(scope.row.titleUserId) }}
140 72
         </template>
141 73
       </el-table-column>
142
-      <el-table-column
143
-        label="确认时间"
144
-        align="center"
145
-        prop="confirmTime"
146
-        width="150"
147
-      >
74
+      <el-table-column label="确认时间" align="center" prop="confirmTime" width="150">
148 75
         <template slot-scope="scope">
149 76
           <span>{{ parseTime(scope.row.confirmTime, "{y}-{m}-{d}") }}</span>
150 77
         </template>
151 78
       </el-table-column>
152
-      <el-table-column label="确认状态" align="center" prop="confirmStatus" >
79
+      <el-table-column label="确认状态" align="center" prop="confirmStatus">
153 80
         <template slot-scope="scope">
154 81
           <el-tag :type="scope.row.confirmStatus == '1' ? 'success' : 'danger'">
155 82
             {{ scope.row.confirmStatus == "1" ? "已确认" : "未确认" }}
156 83
           </el-tag>
157 84
         </template>
158 85
       </el-table-column>
159
-      <el-table-column label="是否通过" align="center" prop="isApproved" >
86
+      <el-table-column label="是否通过" align="center" prop="isApproved">
160 87
         <template slot-scope="scope">
161 88
           <el-tag :type="scope.row.isApproved == '1' ? 'success' : 'danger'">
162 89
             {{ scope.row.isApproved == "1" ? "通过" : "未通过" }}
163 90
           </el-tag>
164 91
         </template>
165 92
       </el-table-column>
166
-      <el-table-column
167
-        label="操作"
168
-        align="center"
169
-        class-name="small-padding fixed-width"
170
-      >
93
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
171 94
         <template slot-scope="scope">
172
-          <el-button
173
-            size="mini"
174
-            type="text"
175
-            icon="el-icon-edit"
176
-            @click="handleUpdate(scope.row)"
177
-            v-hasPermi="['oa:title:edit']"
178
-            >修改</el-button
179
-          >
95
+          <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
96
+            v-hasPermi="['oa:title:edit']">修改</el-button>
180 97
         </template>
181 98
       </el-table-column>
182 99
     </el-table>
183 100
 
184
-    <pagination
185
-      v-show="total > 0"
186
-      :total="total"
187
-      :page.sync="queryParams.pageNum"
188
-      :limit.sync="queryParams.pageSize"
189
-      @pagination="getList"
190
-    />
101
+    <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
102
+      @pagination="getList" />
191 103
 
192 104
     <!-- 添加或修改职称评审对话框 -->
193 105
     <el-dialog :title="title" :visible.sync="open" width="60%" append-to-body>
@@ -211,77 +123,49 @@
211 123
           {{ form.titleProfession }}
212 124
         </el-form-item>
213 125
         <el-form-item label="评审表(盖章前)" prop="sheet">
214
-          <el-link
215
-            type="primary"
216
-            @click="reviewWord(`${baseUrl}${'/profile/upload' + form.sheet}`)"
217
-          >
126
+          <el-link type="primary" @click="reviewWord(`${baseUrl}${'/profile/upload' + form.sheet}`)">
218 127
             {{ getFileName(form.sheet) }}
219 128
           </el-link>
220
-          <el-link
221
-            class="ml20"
222
-            type="warning"
223
-            :href="`${baseUrl}${'/profile/upload' + form.sheet}`"
224
-            :underline="false"
225
-            target="_blank"
226
-          >
129
+          <el-link class="ml20" type="warning" :href="`${baseUrl}${'/profile/upload' + form.sheet}`" :underline="false"
130
+            target="_blank">
227 131
             <span class="el-icon-download">下载文件</span>
228 132
           </el-link>
229 133
         </el-form-item>
230 134
         <el-form-item label="评审表(盖章后)" prop="sheetStamp">
231
-          <el-link
232
-            type="primary" @click="reviewWord(`${baseUrl}${'/profile/upload' + form.sheetStamp}`)">
135
+          <el-link type="primary" @click="reviewWord(`${baseUrl}${'/profile/upload' + form.sheetStamp}`)">
233 136
             {{ getFileName(form.sheetStamp) }}
234 137
           </el-link>
235
-          <el-link
236
-            class="ml20"
237
-            type="warning"
238
-            :href="`${baseUrl}${'/profile/upload' + form.sheetStamp}`"
239
-            :underline="false"
240
-            target="_blank"
241
-          >
138
+          <el-link class="ml20" type="warning" :href="`${baseUrl}${'/profile/upload' + form.sheetStamp}`"
139
+            :underline="false" target="_blank">
242 140
             <span class="el-icon-download">下载文件</span>
243 141
           </el-link>
244 142
         </el-form-item>
245 143
         <el-form-item label="其他材料" prop="material">
246
-          <el-link
247
-            type="primary" @click="reviewWord(`${baseUrl}${'/profile/upload' + form.material}`)">
144
+          <el-link type="primary" @click="reviewWord(`${baseUrl}${'/profile/upload' + form.material}`)">
248 145
             {{ getFileName(form.material) }}
249 146
           </el-link>
250
-          <el-link
251
-            class="ml20"
252
-            type="warning"
253
-            :href="`${baseUrl}${'/profile/upload' + form.material}`"
254
-            :underline="false"
147
+          <el-link class="ml20" type="warning" :href="`${baseUrl}${'/profile/upload' + form.material}`" :underline="false"
255 148
             target="_blank">
256 149
             <span class="el-icon-download">下载文件</span>
257 150
           </el-link>
258 151
         </el-form-item>
259 152
         <!-- 审核是否通过并添加材料 -->
260 153
         <el-form-item label="是否通过" prop="isApproved">
261
-          <el-switch
262
-            v-model="form.isApproved"
263
-            active-value="1"
264
-            inactive-value="0"
265
-            active-text="通过"
266
-            inactive-text="未通过">
154
+          <el-switch v-model="form.isApproved" active-value="1" inactive-value="0" active-text="通过" inactive-text="未通过">
267 155
           </el-switch>
268 156
         </el-form-item>
269 157
         <template v-if="form.isApproved == '1'">
270
-        <el-form-item label="公示红头文件" prop="publicityFile">
271
-          <file-upload v-model="form.publicityFile" :fileType="['pdf']"/>
272
-        </el-form-item>
273
-        <el-form-item label="证书扫描件" prop="scanFile">
274
-          <file-upload v-model="form.scanFile" :fileType="['pdf']"/>
275
-        </el-form-item>
276
-        <el-form-item label="证书取得时间" prop="obtainTime">
277
-          <el-date-picker
278
-            clearable
279
-            v-model="form.obtainTime"
280
-            type="date"
281
-            value-format="yyyy-MM-dd"
282
-            placeholder="请选择证书取得时间">
283
-          </el-date-picker>
284
-        </el-form-item>
158
+          <el-form-item label="公示红头文件" prop="publicityFile">
159
+            <file-upload v-model="form.publicityFile" :fileType="['pdf']" />
160
+          </el-form-item>
161
+          <el-form-item label="证书扫描件" prop="scanFile">
162
+            <file-upload v-model="form.scanFile" :fileType="['pdf']" />
163
+          </el-form-item>
164
+          <el-form-item label="证书取得时间" prop="obtainTime">
165
+            <el-date-picker clearable v-model="form.obtainTime" type="date" value-format="yyyy-MM-dd"
166
+              placeholder="请选择证书取得时间">
167
+            </el-date-picker>
168
+          </el-form-item>
285 169
         </template>
286 170
       </el-form>
287 171
       <div slot="footer" class="dialog-footer">
@@ -293,8 +177,8 @@
293 177
 </template>
294 178
 
295 179
 <script>
296
-import {listEval,getEval,delEval,addEval,updateEval} from "@/api/oa/titles/titles";
297
-import {Snowflake} from"@/utils/snowFlake.js";
180
+import { listEval, getEval, delEval, addEval, updateEval } from "@/api/oa/titles/titles";
181
+import { Snowflake } from "@/utils/snowFlake.js";
298 182
 
299 183
 export default {
300 184
   name: "Eval",
@@ -361,7 +245,7 @@ export default {
361 245
       }
362 246
     }
363 247
   },
364
-  computed:{
248
+  computed: {
365 249
     formRules() {
366 250
       return {
367 251
         publicityFile: [
@@ -371,10 +255,10 @@ export default {
371 255
           { required: () => this.form.isApproved == '1', message: '请上传证书扫描件', trigger: 'change' }
372 256
         ],
373 257
         obtainTime: [
374
-          { required: () => this.form.isApproved == '1', message: '请选择证书取得时间', trigger: 'change'}
258
+          { required: () => this.form.isApproved == '1', message: '请选择证书取得时间', trigger: 'change' }
375 259
         ]
376 260
       }
377
-  },
261
+    },
378 262
   },
379 263
   methods: {
380 264
     /** 查询职称评审列表 */
@@ -455,31 +339,32 @@ export default {
455 339
     /**switch切换到未通过时清除上传文件 */
456 340
     clearFiles() {
457 341
       this.form.publicityFile = "";
458
-      this.form.scanFile= "";
342
+      this.form.scanFile = "";
459 343
       this.form.obtainTime = "";
460 344
     },
461 345
     /** 提交按钮 */
462 346
     submitForm() {
463
-      if(this.form.confirmStatus=="1"){
464
-      this.$refs["form"].validate((valid) => {
465
-        if (valid) {
466
-          if (this.form.titleEvalId != null) {
467
-            updateEval(this.form).then((response) => {
468
-              this.$modal.msgSuccess("修改成功");
469
-              this.open = false;
470
-              this.getList();
471
-            });
472
-          } else {
473
-            addEval(this.form).then((response) => {
474
-              this.$modal.msgSuccess("新增成功");
475
-              this.open = false;
476
-              this.getList();
477
-            });
347
+      if (this.form.confirmStatus == "1") {
348
+        this.$refs["form"].validate((valid) => {
349
+          if (valid) {
350
+            if (this.form.titleEvalId != null) {
351
+              updateEval(this.form).then((response) => {
352
+                this.$modal.msgSuccess("修改成功");
353
+                this.open = false;
354
+                this.getList();
355
+              });
356
+            } else {
357
+              addEval(this.form).then((response) => {
358
+                this.$modal.msgSuccess("新增成功");
359
+                this.open = false;
360
+                this.getList();
361
+              });
362
+            }
478 363
           }
479
-        }
480
-      })}
481
-      else{
482
-         this.$message.error('未在流程中确认信息,无法提交。')
364
+        })
365
+      }
366
+      else {
367
+        this.$message.error('未在流程中确认信息,无法提交。')
483 368
       }
484 369
     },
485 370
     /** 删除按钮操作 */
@@ -494,7 +379,7 @@ export default {
494 379
           this.getList();
495 380
           this.$modal.msgSuccess("删除成功");
496 381
         })
497
-        .catch(() => {});
382
+        .catch(() => { });
498 383
     },
499 384
     /** 导出按钮操作 */
500 385
     handleExport() {

Loading…
Zrušit
Uložit