Kaynağa Gözat

add view doc for subtask

allen 2 yıl önce
ebeveyn
işleme
1ec21cc6d9

+ 7 - 0
src/api/extract/subTask.js

@@ -50,3 +50,10 @@ export function approveSubTask(id, status, extractResult) {
     data: extractResult
   })
 }
+
+export function getDocPathBySunTaskId(subTaskId) {
+  return request({
+    url: `/extract/subTask/getDocPathBySunTaskId/${subTaskId}`,
+    method: 'get',
+  })
+}

+ 25 - 10
src/views/extract/info/classCreateV2.vue

@@ -3,13 +3,13 @@
     <el-row>
       <span>
         <el-col :span="6" class="center-span">
-          <el-button v-show="!readonly" type="primary" plain icon="el-icon-check" size="mini" @click="createPage()">新建页</el-button>
+          <el-button v-show="!readonly" type="primary" plain icon="el-icon-plus" size="mini" @click="createPage()">新建页</el-button>
         </el-col>
-        <el-col :span="6" class="center-span">
-          <el-button type="primary" plain icon="el-icon-check" size="mini" @click="previousPage()">上一页</el-button>
+        <el-col :span="readonly?12:6" class="center-span">
+          <el-button type="primary" plain icon="el-icon-back" size="mini" @click="previousPage()">上一页</el-button>
         </el-col>
-        <el-col :span="6" class="center-span">
-          <el-button type="primary" plain icon="el-icon-check" size="mini" @click="nextPage()">下一页</el-button>
+        <el-col :span="readonly?12:6" class="center-span">
+          <el-button type="primary" plain icon="el-icon-right" size="mini" @click="nextPage()">下一页</el-button>
         </el-col>
         <el-col :span="6" class="center-span">
           <el-button v-show="!readonly" type="primary" plain icon="el-icon-check" size="mini" @click="handleApprove()"  :loading="loading">提交</el-button>
@@ -17,14 +17,19 @@
       </span>
     </el-row>
     <el-row>
-      <el-col :span="24">
-        <el-card style="margin:10px">
+      <el-col :span="12">
+        <div style="margin: 10px; max-height: calc(100vh - 220px);overflow: auto;">
+          <ViewPdf :src="showPdfPath"/>
+        </div>
+      </el-col>
+      <el-col :span="12">
+        <el-card style="margin: 10px; max-height: calc(100vh - 220px);overflow: auto;">
           <el-form ref="form" :model="extractByHands[pageNum]" label-width="80px">
             <div v-for="(entityClass, detailIndex) in extractByHands[pageNum].details" :key="'entityClass'+pageNum+detailIndex" style="margin:5px">
               <el-row>{{ entityClass.entityClassName }}</el-row>
-              <el-row v-for="(entity,index) in entityClass.entityList" :key="'entity'+pageNum+index" style="margin:5px">
+              <el-row v-for="(entity, index) in entityClass.entityList" :key="'entity'+pageNum+index" style="margin:5px">
                 <el-col :span="23">
-                  <el-input v-model="entityClass.entityList[index]"/>
+                  <el-input v-model="entityClass.entityList[index]" type="textarea" size="mini"/>
                 </el-col>
                 <el-col :span="1">
                   <el-button @click="remove(detailIndex,index)" icon="el-icon-minus" circle type="primary" size="mini"/>
@@ -42,9 +47,12 @@
 <script>
 import { getExtractByHandBySubtaskId, submitBySubTask } from "@/api/suport/hand";
 import { getEntityClassOption } from '@/api/neo4j/class'
+import { getDocPathBySunTaskId } from '@/api/extract/subTask'
+import ViewPdf from '@/views/search/pdf/view'
 
 export default {
   name: "ClassCreateResult",
+  components: { ViewPdf },
   props:{
     subTask: {
       type: Object,
@@ -68,11 +76,13 @@ export default {
         }
       ],
       classes:[],
-      classMap: new Map()
+      classMap: new Map(),
+      showPdfPath: '',
     };
   },
   created() {
     this.getClass()
+    this.getPdfPath()
   },
 
   computed: {
@@ -124,6 +134,11 @@ export default {
       }
       return details;
     },
+    getPdfPath(){
+      getDocPathBySunTaskId(this.subTask.id).then(resp => {
+        this.showPdfPath = process.env.VUE_APP_BASE_API + resp.data
+      })
+    },
     handleApprove() {
       this.loading = true
       submitBySubTask(this.extractByHands).then(resp => {