allen 2 år sedan
förälder
incheckning
5c6be10f4a

+ 32 - 0
package-lock.json

@@ -35,6 +35,7 @@
         "jsencrypt": "3.0.0-rc.1",
         "less": "^2.3.1",
         "nprogress": "0.2.0",
+        "papaparse": "^5.4.1",
         "quill": "1.3.7",
         "screenfull": "5.0.2",
         "sortablejs": "1.10.2",
@@ -61,6 +62,7 @@
         "chalk": "4.1.0",
         "compression-webpack-plugin": "5.0.2",
         "connect": "3.6.6",
+        "csv-loader": "^3.0.5",
         "eslint": "7.15.0",
         "eslint-plugin-vue": "7.2.0",
         "less-loader": "^3.0.0",
@@ -6375,6 +6377,16 @@
       "integrity": "sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==",
       "dev": true
     },
+    "node_modules/csv-loader": {
+      "version": "3.0.5",
+      "resolved": "https://registry.npmmirror.com/csv-loader/-/csv-loader-3.0.5.tgz",
+      "integrity": "sha512-vO01k3mtxlSeipH4bvLgzM3yuhlF3efNBnx3xXpvyG/yZT4cyNgk3jh3cuoilKPHpGC5uvGCvq4pYxoafa5jsQ==",
+      "dev": true,
+      "dependencies": {
+        "loader-utils": "^2.0.0",
+        "papaparse": "^5.2.0"
+      }
+    },
     "node_modules/cyclist": {
       "version": "1.0.1",
       "resolved": "https://registry.npmmirror.com/cyclist/-/cyclist-1.0.1.tgz",
@@ -13029,6 +13041,11 @@
       "resolved": "https://registry.npmmirror.com/pako/-/pako-1.0.11.tgz",
       "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw=="
     },
+    "node_modules/papaparse": {
+      "version": "5.4.1",
+      "resolved": "https://registry.npmmirror.com/papaparse/-/papaparse-5.4.1.tgz",
+      "integrity": "sha512-HipMsgJkZu8br23pW15uvo6sib6wne/4woLZPlFf3rpDyMe9ywEXUsuD7+6K9PRkJlVT51j/sCOYDKGGS3ZJrw=="
+    },
     "node_modules/parallel-transform": {
       "version": "1.2.0",
       "resolved": "https://registry.npmmirror.com/parallel-transform/-/parallel-transform-1.2.0.tgz",
@@ -25107,6 +25124,16 @@
         }
       }
     },
+    "csv-loader": {
+      "version": "3.0.5",
+      "resolved": "https://registry.npmmirror.com/csv-loader/-/csv-loader-3.0.5.tgz",
+      "integrity": "sha512-vO01k3mtxlSeipH4bvLgzM3yuhlF3efNBnx3xXpvyG/yZT4cyNgk3jh3cuoilKPHpGC5uvGCvq4pYxoafa5jsQ==",
+      "dev": true,
+      "requires": {
+        "loader-utils": "^2.0.0",
+        "papaparse": "^5.2.0"
+      }
+    },
     "cyclist": {
       "version": "1.0.1",
       "resolved": "https://registry.npmmirror.com/cyclist/-/cyclist-1.0.1.tgz",
@@ -30511,6 +30538,11 @@
       "resolved": "https://registry.npmmirror.com/pako/-/pako-1.0.11.tgz",
       "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw=="
     },
+    "papaparse": {
+      "version": "5.4.1",
+      "resolved": "https://registry.npmmirror.com/papaparse/-/papaparse-5.4.1.tgz",
+      "integrity": "sha512-HipMsgJkZu8br23pW15uvo6sib6wne/4woLZPlFf3rpDyMe9ywEXUsuD7+6K9PRkJlVT51j/sCOYDKGGS3ZJrw=="
+    },
     "parallel-transform": {
       "version": "1.2.0",
       "resolved": "https://registry.npmmirror.com/parallel-transform/-/parallel-transform-1.2.0.tgz",

+ 6 - 4
package.json

@@ -37,13 +37,13 @@
   },
   "dependencies": {
     "@riophae/vue-treeselect": "0.4.0",
-    "@wangeditor/editor": "^5.1.23",
-    "@wangeditor/editor-for-vue": "^1.0.2",
-    "@ztree/ztree_v3": "^3.5.48",
     "@tiptap/core": "^2.0.2",
     "@tiptap/extension-highlight": "^2.0.0-beta.218",
-    "@tiptap/vue-2": "^2.0.0-beta.218",
     "@tiptap/starter-kit": "^2.0.2",
+    "@tiptap/vue-2": "^2.0.0-beta.218",
+    "@wangeditor/editor": "^5.1.23",
+    "@wangeditor/editor-for-vue": "^1.0.2",
+    "@ztree/ztree_v3": "^3.5.48",
     "ant-design-vue": "1.7.8",
     "axios": "0.24.0",
     "clipboard": "2.0.8",
@@ -62,6 +62,7 @@
     "jsencrypt": "3.0.0-rc.1",
     "less": "^2.3.1",
     "nprogress": "0.2.0",
+    "papaparse": "^5.4.1",
     "quill": "1.3.7",
     "screenfull": "5.0.2",
     "sortablejs": "1.10.2",
@@ -88,6 +89,7 @@
     "chalk": "4.1.0",
     "compression-webpack-plugin": "5.0.2",
     "connect": "3.6.6",
+    "csv-loader": "^3.0.5",
     "eslint": "7.15.0",
     "eslint-plugin-vue": "7.2.0",
     "less-loader": "^3.0.0",

+ 14 - 0
src/api/extract/result.js

@@ -49,4 +49,18 @@ export function getResultBySubTaskId(id) {
     url: '/extract/result/getResultBySubTaskId/' + id,
     method: 'get'
   })
+}
+
+export function getSentence(id) {
+  return request({
+    url: '/extract/result/getSentence/' + id,
+    method: 'get'
+  })
+}
+
+export function getResultJson(id) {
+  return request({
+    url: '/extract/result/getResult/' + id,
+    method: 'get'
+  })
 }

+ 22 - 17
src/views/extract/info/indexV2.vue

@@ -1,6 +1,6 @@
 <template>
   <div v-if="editor" :loading="loading">
-    <el-row>
+    <el-row v-show="!readonly">
       <span style="float: right;">
         <el-col :span="1.5">
           <el-button type="primary" plain icon="el-icon-check" size="mini" @click="handleApprove('2')"  :loading="loading">审批</el-button>
@@ -13,41 +13,41 @@
     <el-row>
       <el-col :span="12">
         <el-card style="margin:10px">
-          <el-button @click="highlight_new_h" :class="{
+          <el-button v-show="!readonly" @click="highlight_new_h" :class="{
             'is-active': editor.isActive('highlight', { color: '#ff5d5d' }),
           }">
             主体
           </el-button>
-          <el-button @click="highlight_new_t" :class="{
+          <el-button v-show="!readonly" @click="highlight_new_t" :class="{
             'is-active': editor.isActive('highlight', { color: '#119525' }),
           }">
             客体
           </el-button>
-          <el-button @click="editor.chain().focus().unsetHighlight().run()" :disabled="!editor.isActive('highlight')">
+          <el-button v-show="!readonly" @click="editor.chain().focus().unsetHighlight().run()" :disabled="!editor.isActive('highlight')">
             取消标记
           </el-button>
 
-          <el-select v-model="selectedRelationId" placeholder="请选择关系" @change="handleSelectRelation">
+          <el-select v-show="!readonly" v-model="selectedRelationId" placeholder="请选择关系" @change="handleSelectRelation">
             <el-option v-for="relation in relations" :label="relation.name" :value="relation.id"
               :key="relation.id"></el-option>
             <el-option v-if="showAddRelationOption" :label="'添加关系'" :value="-1"></el-option>
           </el-select>
-          <el-dialog :visible.sync="dialogVisible" append-to-body>
+          <el-dialog v-show="!readonly" :visible.sync="dialogVisible" append-to-body>
             <el-input v-model="newRelationName" placeholder="请输入关系名称"></el-input>
             <div slot="footer">
               <el-button @click="dialogVisible = false">取消</el-button>
               <el-button type="primary" @click="handleAddRelation">确定</el-button>
             </div>
           </el-dialog>
-          <el-button type="primary" @click="summit" style="margin-left:20px">标记</el-button>
-          <bubble-menu :editor="editor" :tippy-options="{ duration: 100 }" v-if="editor">
+          <el-button v-show="!readonly" type="primary" @click="summit" style="margin-left:20px">标记</el-button>
+          <!-- <bubble-menu :editor="editor" :tippy-options="{ duration: 100 }" v-if="editor">
             <el-button @click="highlight_new_h" style="color: '#ff5d5d'">
               主体
             </el-button>
             <el-button @click="highlight_new_t">
               客体
             </el-button>
-            <!-- <button @click="highlight_new_h" style="backgrand-color:red" :class="{
+            <button @click="highlight_new_h" style="backgrand-color:red" :class="{
                     'is-active': editor.isActive('highlight', { color: '#ff5d5d' }),
                 }">
                     主体
@@ -56,8 +56,8 @@
                     'is-active': editor.isActive('highlight', { color: '#119525' }),
                 }">
                     客体
-                </button> -->
-          </bubble-menu>
+                </button>
+          </bubble-menu> -->
           <editor-content :editor="editor" />
         </el-card>
       </el-col>
@@ -67,12 +67,12 @@
             <el-table-column prop="start" label="主体" width="180" />
             <el-table-column prop="end" label="客体" width="180" />
             <el-table-column prop="relation" label="关系" />
-            <el-table-column prop="" label="操作" min-width="180" align="center">
+            <el-table-column prop="" label="操作" min-width="180" align="center" v-show="!readonly">
               <template slot-scope="scope">
-                <el-button @click="handleDelete(scope.$index)" class="btn-text-red" type="danger" size="mini"
+                <el-button v-show="!readonly" @click="handleDelete(scope.$index)" class="btn-text-red" type="danger" size="mini"
                   icon="el-icon-delete">删除
                 </el-button>
-                <el-button @click="handleSearch(scope.$index)" type="primary" size="mini" icon="el-icon-search">查找
+                <el-button v-show="!readonly" @click="handleSearch(scope.$index)" type="primary" size="mini" icon="el-icon-search">查找
                 </el-button>
               </template>
             </el-table-column>
@@ -90,7 +90,7 @@
 </template>
   
 <script>
-import { getResultBySubTaskId, updateResult } from "@/api/extract/result";
+import { getResultBySubTaskId, getResultJson } from "@/api/extract/result";
 import { approveSubTask } from "@/api/extract/subTask";
 
 import Highlight from "@tiptap/extension-highlight";
@@ -107,6 +107,9 @@ export default {
     subTask: {
       type: Object,
     },
+    readonly: {
+      type: Boolean,
+    },
   },
 
   data() {
@@ -161,8 +164,10 @@ export default {
     getResult(){
       this.loading = true
       getResultBySubTaskId(this.subTask.id).then(response => {
-        this.input = JSON.parse(response.data.result)
         this.result = response.data
+      });
+      getResultJson(this.subTask.id).then(response => {
+        this.input = response.data
         this.createEditor()
         this.loading = false
       });
@@ -438,7 +443,7 @@ export default {
     },
     handleApprove(status) {
       this.loading = true
-      this.result.result = JSON.stringify(this.input)
+      this.result.resultData = JSON.stringify(this.input)
       approveSubTask(this.subTask.id, status, this.result).then(resp => {
         let message;
         if (status == 2){

+ 41 - 2
src/views/extract/subTask/index.vue

@@ -26,6 +26,14 @@
           <el-table-column label="花费时间(s)" align="center" prop="costTime" />
           <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
             <template slot-scope="scope">
+              <el-button
+                v-show="scope.row.status >= 1"
+                size="mini"
+                type="text"
+                icon="el-icon-warning-outline"
+                @click="viewSentence(scope.row)"
+                v-hasPermi="['extract:subTask:edit']"
+              >查看分句</el-button>
               <el-button
                 v-show="scope.row.status == 1"
                 size="mini"
@@ -34,6 +42,14 @@
                 @click="handleApprove(scope.row)"
                 v-hasPermi="['extract:subTask:edit']"
               >审核</el-button>
+              <el-button
+                v-show="scope.row.status == 3"
+                size="mini"
+                type="text"
+                icon="el-icon-warning-outline"
+                @click="viewResult(scope.row)"
+                v-hasPermi="['extract:subTask:edit']"
+              >查看抽取结果</el-button>
               <el-button
                 v-show="scope.row.status == 4"
                 size="mini"
@@ -101,13 +117,19 @@
     </el-dialog>
     <el-dialog :title="tripletInfoOpenTitle" v-if="tripletInfoOpen" :visible.sync="tripletInfoOpen" width="80%" append-to-body destroy-on-close :close-on-click-modal="false">
       <!-- <TripletInfo :subTask="subTask" :subTaskOpen.sync="tripletInfoOpen" @closeInfo="closeInfo"></TripletInfo> -->
-      <IndexV2 :subTask="subTask" @closeInfo="closeInfo" />
+      <IndexV2 :subTask="subTask" @closeInfo="closeInfo" :readonly="tripletInfoReadOnly"/>
+    </el-dialog>
+    <el-dialog title="分句结果" v-if="viewSentenceOpen" :visible.sync="viewSentenceOpen" width="80%" append-to-body destroy-on-close :close-on-click-modal="false">
+      <p v-for="sentence in sentenceList" :key="sentence.id">
+         {{ sentence.id }}. {{ sentence.text }}
+      </p>
     </el-dialog>
   </div>
 </template>
 
 <script>
 import { listSubTask, getSubTask, delSubTask, addSubTask, updateSubTask } from "@/api/extract/subTask";
+import { getSentence } from "@/api/extract/result";
 import TripletInfo from '@/views/extract/info';
 import IndexV2 from '@/views/extract/info/indexV2';
 export default {
@@ -161,7 +183,10 @@ export default {
       },
       tripletInfoOpenTitle: "",
       tripletInfoOpen: false,
-      subTask: {}
+      subTask: {},
+      viewSentenceOpen: false,
+      sentenceList: [],
+      tripletInfoReadOnly: false,
     };
   },
   created() {
@@ -276,6 +301,7 @@ export default {
       this.subTaskOpen = false;
     },
     handleApprove(row){
+      this.tripletInfoReadOnly = false
       this.tripletInfoOpen = true
       this.tripletInfoOpenTitle = this.dict.label.extract_sub_task_list[row.type]
       this.subTask = row
@@ -290,6 +316,19 @@ export default {
       this.tripletInfoOpenTitle = ''
       this.subTask = {}
       this.getListByTaskId()
+    },
+    viewSentence(row){
+      getSentence(row.id).then(resp => {
+        this.sentenceList = resp.data
+        this.viewSentenceOpen = true
+      })
+    },
+    viewResult(row){
+      debugger
+      this.tripletInfoReadOnly = true
+      this.tripletInfoOpen = true
+      this.tripletInfoOpenTitle = this.dict.label.extract_sub_task_list[row.type]
+      this.subTask = row
     }
   }
 };

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 16 - 0
src/views/maintenance/offLineDataAnalysis/chart.vue


+ 52 - 0
src/views/maintenance/offLineDataAnalysis/index.vue

@@ -0,0 +1,52 @@
+<template>
+
+    <div class="app-container">
+      <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="200px">
+      <el-form-item label="氧气浓缩器寿命预测" prop="oxygen" required>
+          <file-upload v-model="formData.filePath" :fileType="fileType"/>
+      </el-form-item>
+      <el-form-item size="large">
+        <el-button type="primary" @click="submitForm">分析</el-button>
+      </el-form-item>
+    </el-form>
+    <el-dialog :title="title" :visible.sync="open" width="1200px">
+      <Chart v-if="open"></Chart>
+    </el-dialog>
+    </div>
+</template>
+
+<script>
+import Chart from "./chart"
+
+export default {
+  components: {Chart},
+  data() {
+    return {
+      title: '离线分析',
+      open: false,
+      formData: {
+        filePath: ""
+      },
+      fileType: ["csv"],
+      rules:{}
+    };
+  },
+  methods: {
+    oxygenBeforeUpload(file) {
+      // let isRightSize = file.size / 1024 / 1024 < 2
+      // if (!isRightSize) {
+      //   this.$message.error('文件大小超过 2MB')
+      // }
+      // return isRightSize
+    },
+    submitForm(){
+      if(this.formData.filePath){
+        this.open = true
+      } else {
+        this.$message.error('请先上传文件');
+      }
+    }
+  },
+
+};
+</script>

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
src/views/maintenance/offLineDataAnalysis/output.csv


Vissa filer visades inte eftersom för många filer har ändrats