Rmengdi 3 luni în urmă
părinte
comite
adcb07c35f

+ 1 - 1
.env.development

@@ -5,4 +5,4 @@ ENV = 'development'
 # 开发环境
 VUE_APP_BASE_API ='/api'
 
-VUE_APP_BASE_API_target ='http://localhost:8080'
+VUE_APP_BASE_API_target ='http://localhost:9099'

+ 5 - 5
src/api/als/ERManage.js

@@ -2,25 +2,25 @@ import { get, post } from '@/http/index'
 
 //查询所有三元组
 export const getERList = async () => {
-  return await get('/kgqa/relation/getAllTriples/')
+  return await get('/kgqa/relation/getAllTriples')
 }
 
 //查询数据库中目前已经有的关系
 export const getAllRelationClass = async () => {
-  return await get('/kgqa/relation/getAllRelationClass/')
+  return await get('/kgqa/relation/getAllRelationClass')
 }
 
 // 新增关系
 export const addRelation = async (data) => {
-  return await post('/kgqa/relation/Add/', data)
+  return await post('/kgqa/relation/Add', data)
 }
 
 //修改关系
 export const updateRelation = async (data) => {
-  return await post('/kgqa/relation/Update/', data)
+  return await post('/kgqa/relation/Update', data)
 }
 
 //删除关系
 export const deleteRelation = async (data) => {
-  return await post('/kgqa/relation/Delete/', data)
+  return await post('/kgqa/relation/Delete', data)
 }

+ 6 - 6
src/api/als/entityManage.js

@@ -2,30 +2,30 @@ import { get, post } from '@/http/index'
 
 //查询所有实体
 export const getEntityList = async () => {
-  return await get('/kgqa/entity/getAllEntities/')
+  return await get('/kgqa/entity/getAllEntities')
 }
 
 //	获取图数据库中的所有实体类名称
 export const getAllEntityClass = async () => {
-  return await get('/kgqa/entity/getAllEntityClass/')
+  return await get('/kgqa/entity/getAllEntityClass')
 }
 
 // 新增实体结点
 export const addEntity = async (data) => {
-  return await post('/kgqa/entity/add/', data)
+  return await post('/kgqa/entity/add', data)
 }
 
 //修改实体结点
 export const updateEntity = async (data) => {
-  return await post('/kgqa/entity/update/', data)
+  return await post('/kgqa/entity/update', data)
 }
 
 //查询实体结点
 export const checkEntity = async (data) => {
-  return await post('/kgqa/entity/Check/', data)
+  return await post('/kgqa/entity/Check', data)
 }
 
 //删除实体结点
 export const deleteEntity = async (data) => {
-  return await post('/kgqa/entity/delete/', data)
+  return await post('/kgqa/entity/delete', data)
 }

+ 33 - 8
src/api/als/knowledgeExtraction.js

@@ -12,12 +12,12 @@ export const addTask = async (data) => {
 
 // 修改任务
 export const updateTask = async (data) => {
-  // return await put('/als/lifePrediction', data)
+  return await put('/als/kGraphTask', data)
 }
 
 // 删除任务
 export const removeTask = async (id) => {
-  // return await deletes('/als/lifePrediction/' + id)
+  return await deletes('/als/kGraphTask/' + id)
 }
 
 // 获取文件信息
@@ -32,15 +32,40 @@ export const taskPro = async (data) => {
 
 // 获取分句列表
 export const getClauseList = async (data) => {
-  // return await post('/kgqa/ask/', data)
+  return await get('/als/kGraphClause/list', data)
 }
 
-// 修改知识抽取
-export const updateClause = async (data) => {
-  // return await put('/als/lifePrediction', data)
+// 获取分句详细信息
+export const getClauseInfo = async (id) => {
+  return await get('/als/kGraphClause/' + id)
 }
 
-// 删除知识抽取
+// 删除分句
 export const removeClause = async (id) => {
-  // return await deletes('/als/lifePrediction/' + id)
+  return await deletes('/als/kGraphClause/' + id)
+}
+
+// 修改分句
+export const updateClause = async (data) => {
+  return await put('/als/kGraphClause', data)
+}
+
+// 获取抽取列表
+export const getExtractList = async (data) => {
+  return await get('/als/kGraphEntity/list', data)
+}
+
+// 修改抽取结果
+export const updateExtractInfo = async (data) => {
+  return await put('/als/kGraphEntity', data)
+}
+
+// 删除抽取结果
+export const removeExtractInfo = async (id) => {
+  return await deletes('/als/kGraphEntity/' + id)
+}
+
+// 新增实体关系
+export const addER = async (data) => {
+  return await post('/als/kGraphEntity', data)
 }

+ 1 - 1
src/layout/components/NavBar/index.vue

@@ -40,6 +40,6 @@ export default {
 }
 </script>
 
-<style lang="scss">
+<style lang="scss" scoped>
 @import './index.scss';
 </style>

+ 0 - 1
src/layout/components/NavBar/menu.vue

@@ -24,7 +24,6 @@ export default {
   }
 }
 </script>
-<style></style>
 <style lang="scss" scoped>
 .el-menu-demo {
   display: flex;

+ 5 - 0
src/views/als/faultStatistics/index.vue

@@ -6,6 +6,7 @@
           <div class="view-carrierFlightMission-FlightMission-btn-box" style="width: 24%">
             <el-button type="success" @click="openDialog()" :disabled="currentNode && currentNode.type == 0">新增</el-button>
             <el-button type="warning" @click="remove(tableCheckItems)" :disabled="tableCheckItems.length == 0">删除</el-button>
+            <el-button type="danger" @click="handleSync" :disabled="currentNode && currentNode.type == 0">同步</el-button>
             <el-dropdown split-button type="primary" style="margin-left: 10px" trigger="click" @command="handleExport">
               更多
               <el-dropdown-menu slot="dropdown">
@@ -1037,6 +1038,10 @@ export default {
         })
         .catch(() => {})
     },
+
+    // 同步
+    handleSync() {},
+
     //更多按钮
     handleExport(type) {
       this[type]()

+ 703 - 39
src/views/als/knowledgeExtraction/index.vue

@@ -13,9 +13,9 @@
         </div>
       </div>
       <div class="view-dataType-table">
-        <LTable ref="table" @selection-change="selection" :defaultFetch="false" :fetch="fetch" :columns="columns" :dataSource="tableData" :options="options" :pagination="tableRequset"></LTable>
+        <LTable ref="table" @selection-change="selection" :defaultFetch="false" :fetch="fetch" :columns="columns" :dataSource="tableData" :options="options" :pagination="tableRequest"></LTable>
       </div>
-      <!-- 添加或修改模型信息对话框 -->
+      <!-- 添加或修改抽取任务对话框 -->
       <el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="600px" :before-close="handleClose">
         <el-form ref="form" :model="form" label-width="80px">
           <el-form-item label="任务名称" prop="taskName">
@@ -38,10 +38,10 @@
           <!-- 分句、抽取、审核、入库 -->
           <el-steps :active="active" finish-status="success" process-status="finish">
             <!-- 需要判断分句中、抽取中、。。。。 -->
-            <el-step title="分句"></el-step>
-            <el-step title="抽取"></el-step>
-            <el-step title="审核"></el-step>
-            <el-step title="入库"></el-step>
+            <el-step :title="zeroTitle"></el-step>
+            <el-step :title="oneTitle"></el-step>
+            <el-step :title="twoTitle"></el-step>
+            <el-step :title="threeTitle"></el-step>
           </el-steps>
         </div>
         <div class="view-dataType-table">
@@ -59,21 +59,97 @@
             </el-form>
           </div>
 
-          <LTable ref="table" v-if="active === 1" @selection-change="clauseSelection" :defaultFetch="false" :fetch="fetch" :columns="clauseColumns" :dataSource="clauseTableData" :options="clauseOptions" :pagination="clauseTableRequset"></LTable>
+          <LTable
+            ref="clauseTableRef"
+            v-if="active === 1 || active === 2"
+            @selection-change="clauseSelection"
+            :defaultFetch="false"
+            :fetch="clauseFetch"
+            :columns="clauseColumns"
+            :dataSource="clauseTableData"
+            :options="clauseOptions"
+            :pagination="clauseTableRequest"
+          ></LTable>
+          <!-- <LTable ref="extractTable" v-if="active === 2" @selection-change="extractSelection" :defaultFetch="false" :fetch="fetch" :columns="extractColumns" :dataSource="extractTableData" :options="extractOptions" :pagination="extractTableRequest"></LTable> -->
         </div>
+
+        <el-dialog width="50%" title="详情" :visible.sync="clauseDialogVisible" :before-close="clauseHandleClose" append-to-body>
+          <el-form ref="clauseFormRef" :model="clauseForm" label-width="80px">
+            <el-form-item label="内容" prop="clause">
+              <el-input type="textarea" :rows="7" v-model="clauseForm.clause" placeholder="请输入内容" />
+            </el-form-item>
+          </el-form>
+
+          <div slot="footer" class="dialog-footer">
+            <el-button @click="clauseDialogVisible = false">取 消</el-button>
+            <el-button type="primary" @click="clauseSubmit">确 定</el-button>
+          </div>
+        </el-dialog>
+
+        <el-dialog width="80%" title="抽取详情" :visible.sync="extractDialogVisible" :before-close="extractHandleClose" append-to-body>
+          <div class="content">
+            <div class="left">
+              <p>{{ extractData.content }}</p>
+            </div>
+            <div class="right">
+              <LTable ref="extractDetailTableRef" :defaultFetch="false" :fetch="extractDetailFetch" :columns="extractDetailColumns" :dataSource="extractData.extractDetailTable" :pagination="extractDetailRequest" :options="extractDetailOptions"></LTable>
+            </div>
+          </div>
+          <div slot="footer" class="dialog-footer">
+            <el-button @click="addER">新增实体关系</el-button>
+            <el-button @click="handleCancel">作 废</el-button>
+            <el-button type="primary" @click="passThrough">通 过</el-button>
+          </div>
+        </el-dialog>
         <span slot="footer" class="dialog-footer">
           <!-- <el-button @click="handleClose">取 消</el-button> -->
-          <el-button type="primary" v-if="active === 0" @click="handleClause">分 句</el-button>
-          <el-button type="primary" v-if="active === 1" @click="handleExtract">抽 取</el-button>
-          <el-button type="primary" v-if="active === 2" @click="submit">入 库</el-button>
+          <el-button type="primary" v-if="active === 0 && zeroTitle !== '分句中'" :loading="clauseLoading" @click="handleClause">分 句</el-button>
+          <el-button type="primary" v-if="active === 1 && oneTitle !== '抽取中'" :loading="extractLoading" @click="handleExtract">抽 取</el-button>
+          <el-button type="primary" v-if="active === 2 && oneTitle !== '入库中'" :loading="storageLoading" @click="handleStorage">入 库</el-button>
         </span>
       </el-dialog>
+
+      <el-dialog width="30%" title="增加实体关系" :visible.sync="addERDialogVisible" :before-close="addERHandleClose" append-to-body>
+        <el-form ref="addERFormRef" :model="addERForm" label-width="80px">
+          <el-form-item label="头实体" prop="headEntity">
+            <el-input v-model="addERForm.headEntity" placeholder="请输入内容" />
+          </el-form-item>
+          <el-form-item label="头实体类" prop="headEntityClass">
+            <!-- <el-input  v-model="addERForm.headEntityClass" placeholder="请输入内容" /> -->
+            <el-select v-model="addERForm.headEntityClass" placeholder="请选择实体类型">
+              <el-option v-for="(item, index) in entityClassList" :key="index" :label="item" :value="item" />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="关系" prop="relation">
+            <!-- <el-input  v-model="addERForm.relation" placeholder="请输入内容" /> -->
+            <el-select v-model="addERForm.relation" placeholder="请选择实体类型">
+              <el-option v-for="(item, index) in relationClassList" :key="index" :label="item" :value="item" />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="尾实体" prop="tailEntity">
+            <el-input v-model="addERForm.tailEntity" placeholder="请输入内容" />
+          </el-form-item>
+          <el-form-item label="尾实体类" prop="tailEntityClass">
+            <el-select v-model="addERForm.tailEntityClass" placeholder="请选择实体类型">
+              <el-option v-for="(item, index) in entityClassList" :key="index" :label="item" :value="item" />
+            </el-select>
+          </el-form-item>
+        </el-form>
+
+        <div slot="footer" class="dialog-footer">
+          <el-button @click="addERHandleClose">取 消</el-button>
+          <el-button type="primary" @click="addERSubmit">确 定</el-button>
+        </div>
+      </el-dialog>
     </div>
   </div>
 </template>
 
 <script>
-import { getTaskList, addTask, updateTask, removeTask, taskPro } from '@/api/als/knowledgeExtraction'
+import { getTaskList, addTask, updateTask, removeTask, taskPro, removeClause, updateClause, getClauseList, getExtractList, updateExtractInfo, removeExtractInfo, addER } from '@/api/als/knowledgeExtraction'
+import { getAllEntityClass } from '@/api/als/entityManage'
+import { getAllRelationClass } from '@/api/als/ERManage'
+
 import { getAtlasFile } from '@/api/als/atlasFile'
 import { getOssIdDataAPI } from '@/api/als/algorithm'
 import { deepClone, debounce } from '@/utils/index'
@@ -88,6 +164,12 @@ export default {
       dialogTitle: '新增',
       dialogVisible: false,
       detailDialogVisible: false,
+      clauseDialogVisible: false,
+      extractDialogVisible: false,
+      addERDialogVisible: false,
+      clauseLoading: false,
+      extractLoading: false,
+      storageLoading: false,
       keyWordData: '',
       searchValue: '',
       columns: [
@@ -114,6 +196,7 @@ export default {
             const matchedItem = this.$enumData.extractStatus.find((item) => params.row.status === item.key)
             if (matchedItem) {
               return h('span', matchedItem.name)
+              // return h('span', { class: matchedItem.colorType }, matchedItem.name)
             } else {
               return h('span', {}, '')
             }
@@ -132,6 +215,24 @@ export default {
               onClick: (row, index, scope) => {
                 this.checkProcess(row)
               }
+            },
+            {
+              name: '编辑',
+              type: 'text',
+              round: false,
+              plain: false,
+              onClick: (row, index, scope) => {
+                this.handUpdate(row)
+              }
+            },
+            {
+              name: '删除',
+              type: 'text',
+              round: false,
+              plain: false,
+              onClick: (row, index, scope) => {
+                this.remove([row])
+              }
             }
           ]
         }
@@ -147,7 +248,7 @@ export default {
       },
       tableCheckItems: [],
       tableData: [],
-      tableRequset: {
+      tableRequest: {
         total: 0,
         pageIndex: 1,
         pageSize: 10,
@@ -155,15 +256,43 @@ export default {
       },
       clauseColumns: [
         {
-          prop: 'content',
+          prop: 'clause',
           label: '内容'
         },
+        // {
+        //   prop: 'status',
+        //   label: '状态',
+        //   width: '240px',
+        //   render: (h, params) => {
+        //     if (params.row.status === '0') {
+        //       return h('span', { class: 'success-state' }, '已分句')
+        //     } else {
+        //       return h('span', { class: 'warning-state' }, '抽取中')
+        //     }
+        //   }
+        // },
         {
-          prop: 'status',
+          prop: 'statusKey',
           label: '状态',
           width: '240px',
           render: (h, params) => {
-            return h('span', { class: 'success-state' }, '已分句')
+            // if (params.row.status !== ' ') {
+            //   if (params.row.status == '0') {
+            //     return h('span', { class: 'danger-state' }, '未审核')
+            //   } else if (params.row.status == '1') {
+            //     return h('span', { class: 'success-state' }, '通过')
+            //   } else if (params.row.status == '2') {
+            //     return h('span', { class: 'warning-state' }, '作废')
+            //   }
+            // } else {
+            const matchedItem = this.$enumData.extractStatus.find((item) => params.row.statusKey === item.key)
+            if (matchedItem) {
+              return h('span', { class: 'success-state' }, matchedItem.name)
+              // return h('span', { class: matchedItem.colorType }, matchedItem.name)
+            } else {
+              return h('span', {}, '')
+            }
+            // }
           }
         },
         {
@@ -174,6 +303,8 @@ export default {
             {
               name: '编辑',
               type: 'text',
+              statusKey: 'statusKey',
+              disableKey: [3, 4],
               round: false,
               plain: false,
               onClick: (row, index, scope) => {
@@ -183,11 +314,25 @@ export default {
             {
               name: '删除',
               type: 'text',
+              statusKey: 'statusKey',
+              disableKey: [3, 4],
               round: false,
               plain: false,
               onClick: (row, index, scope) => {
                 this.clauseRemove([row])
               }
+            },
+            {
+              name: '查看抽取结果',
+              type: 'text',
+              statusKey: 'statusKey',
+              unDisableKey: '4',
+              round: false,
+              plain: false,
+              onClick: (row, index, scope) => {
+                // this.getExtractListAPI({ clauseId: row.id })
+                this.checkExtractResult(row)
+              }
             }
           ]
         }
@@ -202,8 +347,8 @@ export default {
         height: 'calc(100vh - 470px)'
       },
       clauseTableCheckItems: [],
-      clauseTableData: [{ content: 'XXXXXXXXX水水水水水水水' }, { content: 'mmmmmmmmmmmAAAAAAAAAAA' }, { content: 'mmmmmmmmmmmAAAAAAAAAAA' }, { content: 'mmmmmmmmmmmAAAAAAAAAAA' }],
-      clauseTableRequset: {
+      clauseTableData: [],
+      clauseTableRequest: {
         total: 0,
         pageIndex: 1,
         pageSize: 10,
@@ -216,33 +361,176 @@ export default {
       },
       taskForm: {
         id: '',
-        taskName: '任务名称',
-        fileName: '抽取文件'
+        ossId: '',
+        status: '',
+        taskName: '',
+        fileName: '',
+        taskType: ''
       },
       debounceFn: debounce(this.fetch, 500),
       fileList: [],
       active: 0,
       clauseForm: {
-        content: ''
+        id: '',
+        taskId: '',
+        clause: '',
+        status: ''
+      },
+      extractData: {
+        content: '',
+        extractDetailTable: []
+      },
+      extractDetailColumns: [
+        {
+          prop: 'headEntity',
+          label: '头实体',
+          edit: true,
+          editStatus: false,
+          onChange: (scope, oldRow) => {
+            const { row } = scope
+            if (oldRow.headEntity == row.headEntity) return
+            this.updateExtractInfoAPI(row)
+          }
+        },
+        {
+          prop: 'headEntityClass',
+          label: '头实体类',
+          edit: true,
+          editStatus: false,
+          onChange: (scope, oldRow) => {
+            const { row } = scope
+            if (oldRow.headEntity == row.headEntityClass) return
+            this.updateExtractInfoAPI(row)
+          }
+        },
+        {
+          prop: 'relation',
+          label: '关系',
+          edit: true,
+          editStatus: false,
+          onChange: (scope, oldRow) => {
+            const { row } = scope
+            if (oldRow.headEntity == row.relation) return
+            this.updateExtractInfoAPI(row)
+          }
+        },
+        {
+          prop: 'tailEntity',
+          label: '尾实体',
+          edit: true,
+          editStatus: false,
+          onChange: (scope, oldRow) => {
+            const { row } = scope
+            if (oldRow.headEntity == row.tailEntity) return
+            this.updateExtractInfoAPI(row)
+          }
+        },
+        {
+          prop: 'tailEntityClass',
+          label: '尾实体类',
+          edit: true,
+          editStatus: false,
+          onChange: (scope, oldRow) => {
+            const { row } = scope
+            if (oldRow.headEntity == row.tailEntityClass) return
+            this.updateExtractInfoAPI(row)
+          }
+        },
+        {
+          button: true,
+          label: '操作',
+          width: '120px',
+          group: [
+            {
+              name: '删除',
+              type: 'text',
+              round: false,
+              plain: false,
+              onClick: (row, index, scope) => {
+                this.removeExtractDetail([row])
+              }
+            }
+          ]
+        }
+      ],
+      extractDetailOptions: {
+        stripe: true, // 斑马纹
+        mutiSelect: false, // 多选框
+        index: true, // 显示序号, 多选则 mutiSelect
+        loading: false, // 表格动画
+        initTable: false, // 是否一挂载就加载数据
+        border: true,
+        height: '450px'
+      },
+      extractDetailRequest: {
+        total: 0,
+        pageIndex: 1,
+        pageSize: 10,
+        searchValue: ''
+      },
+      // extractDetailTableData: [{ content: 'qqq' }, { content: 'www' }, { content: 'eee' }]
+      zeroTitle: '分句',
+      oneTitle: '抽取',
+      twoTitle: '审核',
+      threeTitle: '入库',
+      taskStatus: null,
+      entityClassList: [],
+      relationClassList: [],
+      addERForm: {
+        clauseId: '',
+        headEntity: '',
+        headEntityClass: '',
+        relation: '',
+        tailEntity: '',
+        tailEntityClass: ''
       }
     }
   },
   watch: {
     keyWord() {
-      this.tableRequset.pageIndex = 1
+      this.tableRequest.pageIndex = 1
       this.debounceFn()
     }
   },
   mounted() {
-    this.getTaskListAPI()
-    this.getAtlasFileAPI()
+    this.init()
   },
   methods: {
+    init() {
+      this.getTaskListAPI()
+      this.getAtlasFileAPI()
+      this.getEntityClassAPI()
+      this.getAllRelationClassAPI()
+    },
     async getAtlasFileAPI(params) {
-      const {
-        data: { list, total }
-      } = await getAtlasFile()
-      this.fileList = list
+      try {
+        const {
+          data: { list, total }
+        } = await getAtlasFile()
+        this.fileList = list
+      } catch (error) {}
+    },
+
+    async getEntityClassAPI(params) {
+      try {
+        const {
+          data: { dataList }
+        } = await getAllEntityClass()
+        dataList.forEach((item) => {
+          this.entityClassList.push(item.name)
+        })
+      } catch (error) {}
+    },
+
+    async getAllRelationClassAPI(params) {
+      try {
+        const {
+          data: { dataList }
+        } = await getAllRelationClass()
+        dataList.forEach((item) => {
+          this.relationClassList.push(item.name)
+        })
+      } catch (error) {}
     },
 
     async removeTaskAPI(params) {
@@ -259,21 +547,67 @@ export default {
       } catch (error) {}
     },
 
+    async removeClauseAPI(params) {
+      try {
+        const { code } = await removeClause(params)
+        if (code === 200) {
+          this.$message({
+            type: 'success',
+            message: '操作成功!'
+          })
+          await this.getClauseListAPI({ taskId: this.taskForm.id })
+          this.clauseHandleClose()
+        }
+      } catch (error) {}
+    },
+
     async getTaskListAPI(params) {
       if (this.$refs.table) this.$refs.table.clearSelection()
       const { keyWord } = this
-      const { pageSize, pageIndex } = this.tableRequset
+      const { pageSize, pageIndex } = this.tableRequest
       const {
         data: { list, total }
       } = await getTaskList({ pageSize, pageNum: pageIndex, ...params })
       this.tableData = list
-      this.tableRequset.total = total
+      this.tableRequest.total = total
+    },
+
+    async getClauseListAPI(params) {
+      if (this.$refs.clauseTableRef) this.$refs.clauseTableRef.clearSelection()
+      const { keyWord } = this
+      const { pageSize, pageIndex } = this.clauseTableRequest
+      const {
+        data: { list, total }
+      } = await getClauseList({ pageSize, pageNum: pageIndex, ...params })
+      this.clauseTableData = list.map((el) => {
+        return { ...el, statusKey: this.taskStatus }
+      })
+      this.clauseTableRequest.total = total
+    },
+
+    async getExtractListAPI(params) {
+      if (this.$refs.extractDetailTableRef) this.$refs.extractDetailTableRef.clearSelection()
+      const { keyWord } = this
+      const { pageSize, pageIndex } = this.extractDetailRequest
+      const {
+        data: { list, total }
+      } = await getExtractList({ pageSize, pageNum: pageIndex, ...params })
+      this.extractData.extractDetailTable = list
+      this.extractDetailRequest.total = total
     },
 
     fetch() {
       this.getTaskListAPI()
     },
 
+    clauseFetch() {
+      this.getClauseListAPI({ taskId: this.taskForm.id })
+    },
+
+    extractDetailFetch() {
+      this.getExtractListAPI({ clauseId: this.clauseForm.id })
+    },
+
     async searchClick() {
       this.getTaskListAPI({ name: keyWordData })
     },
@@ -307,6 +641,21 @@ export default {
       } catch (error) {}
     },
 
+    async updateClauseAPI() {
+      try {
+        const { code } = await updateClause({ ...this.clauseForm })
+        if (code === 200) {
+          this.$message({
+            type: 'success',
+            message: '操作成功!'
+          })
+          this.clauseHandleClose()
+          this.extractHandleClose()
+          this.getClauseListAPI({ taskId: this.taskForm.id })
+        }
+      } catch (error) {}
+    },
+
     openDialog() {
       this.dialogTitle = '新增'
       this.dialogVisible = true
@@ -327,6 +676,116 @@ export default {
       this.dialogVisible = true
     },
 
+    // 分句编辑
+    clauseHandUpdate(row) {
+      this.clauseForm = deepClone(row)
+      this.clauseDialogVisible = true
+    },
+
+    // 查看抽取结果
+    checkExtractResult(row) {
+      this.extractData.content = row.clause
+      this.clauseForm = deepClone(row)
+      this.getExtractListAPI({ clauseId: row.id })
+      this.extractDialogVisible = true
+    },
+
+    // 表格更新抽取结果
+    async updateExtractInfoAPI(row) {
+      if (this.handleVerify(row)) {
+        try {
+          console.log('row', row)
+          const { code } = await updateExtractInfo({ ...row })
+          if (code === 200) {
+            this.$message({
+              type: 'success',
+              message: '操作成功!'
+            })
+            // this.clauseHandleClose()
+            // this.getClauseListAPI({ taskId: this.taskForm.id })
+            this.getExtractListAPI({ clauseId: this.clauseForm.id })
+          }
+        } catch (error) {}
+      }
+    },
+
+    // 校验实体关系
+    handleVerify(data) {
+      const { headEntity, headEntityClass, relation, tailEntity, tailEntityClass } = data
+      let str = this.extractData.content
+      if (str.indexOf(headEntity) == -1 || str.indexOf(tailEntity) == -1) {
+        this.extractDetailFetch()
+        this.$message({
+          type: 'warning',
+          message: '实体与文本中匹配有误,请重新输入'
+        })
+        return false
+      }
+      if (!this.entityClassList.includes(headEntityClass) || !this.entityClassList.includes(tailEntityClass)) {
+        this.extractDetailFetch()
+        this.$message({
+          type: 'warning',
+          message: `实体类有误,请重新输入。目前实体类有<${this.entityClassList}>`,
+          duration: 5000
+        })
+        return false
+      }
+
+      if (!this.relationClassList.includes(relation)) {
+        this.extractDetailFetch()
+        this.$message({
+          type: 'warning',
+          message: `关系有误,请重新输入。目前关系有<${this.relationClassList}>`,
+          duration: 5000
+        })
+        return false
+      }
+      return true
+    },
+
+    // 新增实体关系
+    addER() {
+      this.addERDialogVisible = true
+    },
+
+    async addERSubmit() {
+      if (this.handleVerify(this.addERForm)) {
+        try {
+          this.addERForm.clauseId = this.clauseForm.id
+          const { code } = await addER({ ...this.addERForm })
+          if (code === 200) {
+            this.$message({
+              type: 'success',
+              message: '操作成功!'
+            })
+            this.addERHandleClose()
+            this.getExtractListAPI({ clauseId: this.clauseForm.id })
+          }
+        } catch (error) {}
+      }
+    },
+
+    // 作废
+    handleCancel() {
+      // this.clauseForm.status=
+      this.$confirm('是否将该抽取结果作废?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      })
+        .then(() => {
+          // this.removeTaskAPI(row.map((e) => e.id))
+          this.updateClauseAPI()
+        })
+        .catch(() => {})
+    },
+
+    // 通过
+    passThrough() {
+      // this.clauseForm.status=
+      this.updateClauseAPI()
+    },
+
     submit() {
       switch (this.dialogTitle) {
         case '编辑':
@@ -339,6 +798,14 @@ export default {
       }
     },
 
+    clauseSubmit() {
+      this.updateClauseAPI()
+    },
+
+    extractSubmit() {
+      // this.updateClauseAPI()
+    },
+
     selection(val) {
       this.tableCheckItems = val
     },
@@ -347,8 +814,12 @@ export default {
       this.clauseTableCheckItems = val
     },
 
+    // extractSelection(val) {
+    //   this.extractTableCheckItems = val
+    // },
+
     remove(row) {
-      this.$confirm('是否删除该模型', '提示', {
+      this.$confirm('是否删除该数据', '提示', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
         type: 'warning'
@@ -359,9 +830,86 @@ export default {
         .catch(() => {})
     },
 
+    removeExtractDetail(row) {
+      console.log('row', row)
+      this.$confirm('是否删除该条实体关系', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      })
+        .then(() => {
+          this.removeExtractInfoAPI(row.map((e) => e.id))
+        })
+        .catch(() => {})
+    },
+
+    async removeExtractInfoAPI(params) {
+      try {
+        const { code } = await removeExtractInfo(params)
+        if (code === 200) {
+          this.$message({
+            type: 'success',
+            message: '操作成功!'
+          })
+          this.getExtractListAPI({ clauseId: this.clauseForm.id })
+        }
+      } catch (error) {}
+    },
+
+    clauseRemove(row) {
+      this.$confirm('是否删除该数据', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      })
+        .then(() => {
+          this.removeClauseAPI(row.map((e) => e.id))
+        })
+        .catch(() => {})
+    },
+
     checkProcess(row) {
-      // this.$router.push({ name: 'ExtractList', query: { id: row.id } })
+      this.taskStatus = row.status
       this.taskForm = deepClone(row)
+      switch (this.taskStatus) {
+        case '0':
+          this.active = 0
+          this.zeroTitle = '待分句'
+          break
+        case '1':
+          this.active = 0
+          this.zeroTitle = '分句中'
+          break
+        case '2':
+          this.active = 1
+          this.zeroTitle = '分句'
+          this.getClauseListAPI({ taskId: row.id })
+          this.oneTitle = '待抽取'
+          break
+        case '3':
+          this.active = 1
+          this.oneTitle = '抽取中'
+          this.getClauseListAPI({ taskId: row.id })
+          break
+        case '4':
+          this.active = 2
+          this.oneTitle = '抽取'
+          this.getClauseListAPI({ taskId: row.id })
+          this.twoTitle = '审核中'
+          break
+        case '5':
+          this.active = 2
+          this.twoTitle = '入库中'
+          break
+        case '6':
+          this.active = 3
+          this.twoTitle = '审核'
+          this.threeTitle = '已入库'
+          break
+
+        default:
+          break
+      }
       this.detailDialogVisible = true
     },
 
@@ -369,23 +917,123 @@ export default {
       this.detailDialogVisible = false
       this.taskForm = {
         id: '',
+        ossId: '',
+        status: '',
         taskName: '',
-        ossId: ''
+        fileName: '',
+        taskType: ''
+      }
+      this.clauseForm = {
+        id: '',
+        taskId: '',
+        clause: '',
+        status: ''
       }
+    },
+
+    clauseHandleClose() {
+      this.clauseDialogVisible = false
       this.clauseForm = {
-        content: ''
+        id: '',
+        taskId: '',
+        clause: '',
+        status: ''
+      }
+    },
+
+    extractHandleClose() {
+      this.extractDialogVisible = false
+      this.extractData = {
+        content: '',
+        extractDetailTable: []
+      }
+    },
+
+    addERHandleClose() {
+      this.addERDialogVisible = false
+      this.addERForm = {
+        clauseId: '',
+        headEntity: '',
+        headEntityClass: '',
+        relation: '',
+        tailEntity: '',
+        tailEntityClass: ''
       }
     },
 
     async handleClause() {
-      // 调用分句接口
-      // const res=await taskPro()
-      this.active = 1
+      this.clauseLoading = true
+      this.taskForm.taskType = 0
+      try {
+        const { code } = await taskPro(this.taskForm)
+        if (code === 200) {
+          this.$message({
+            type: 'success',
+            message: '文件开始分句中,稍后刷新页面查看进度',
+            duration: 5000
+          })
+          this.getTaskListAPI()
+          this.detailDialogVisible = false
+          this.clauseLoading = false
+          this.active = 1
+        }
+      } catch (error) {
+        this.clauseLoading = false
+        this.$message({
+          type: 'warning',
+          message: '接口错误请联系管理员'
+        })
+      }
     },
 
-    handleExtract() {
-      // 调用分句接口
-      this.active = 2
+    async handleExtract() {
+      this.extractLoading = true
+      this.taskForm.taskType = 2
+      try {
+        const { code } = await taskPro(this.taskForm)
+        if (code === 200) {
+          this.$message({
+            type: 'success',
+            message: '文件开始抽取中,稍后刷新页面查看进度',
+            duration: 5000
+          })
+          this.getTaskListAPI()
+          this.detailDialogVisible = false
+          this.extractLoading = false
+          this.active = 2
+        }
+      } catch (error) {
+        this.extractLoading = false
+        this.$message({
+          type: 'warning',
+          message: '接口错误请联系管理员'
+        })
+      }
+    },
+
+    async handleStorage() {
+      this.storageLoading = true
+      this.taskForm.taskType = 4
+      try {
+        const { code } = await taskPro(this.taskForm)
+        if (code === 200) {
+          this.$message({
+            type: 'success',
+            message: '文件开始入库中,稍后刷新页面查看进度',
+            duration: 5000
+          })
+          this.getTaskListAPI()
+          this.detailDialogVisible = false
+          this.storageLoading = false
+          this.active = 2
+        }
+      } catch (error) {
+        this.storageLoading = false
+        this.$message({
+          type: 'warning',
+          message: '接口错误请联系管理员'
+        })
+      }
     }
   }
 }
@@ -393,4 +1041,20 @@ export default {
 
 <style lang="scss" scoped>
 @import '../index.scss';
+.content {
+  width: 100%;
+  height: 500px;
+  display: flex;
+  .left {
+    width: 30%;
+    padding: 20px;
+    // font-size: 1.1rem;
+    color: white;
+    border-right: 1px solid #eeeeee;
+    overflow: hidden;
+  }
+  .right {
+    width: 70%;
+  }
+}
 </style>

+ 7 - 7
src/views/als/utils/enum-data.js

@@ -12,13 +12,13 @@ export const agloModelList = [
 
 // 抽取状态
 export const extractStatus = [
-  { key: '0', name: '待分句' },
-  { key: '1', name: '分句中' },
-  { key: '2', name: '待抽取' },
-  { key: '3', name: '抽取中' },
-  { key: '4', name: '审核中' },
-  { key: '5', name: '入库中' },
-  { key: '6', name: '已入库' }
+  { key: '0', name: '待分句', colorType: 'info-state' },
+  { key: '1', name: '分句中', colorType: 'info-state' },
+  { key: '2', name: '待抽取', colorType: 'warning-state' },
+  { key: '3', name: '抽取中', colorType: 'warning-state' },
+  { key: '4', name: '审核中', colorType: 'danger-state' },
+  { key: '5', name: '入库中', colorType: 'danger-state' },
+  { key: '6', name: '已入库', colorType: 'success-state' }
 ]
 
 const enumData = {

+ 5 - 5
src/views/carrierStandard/carrierComputationalModel/index.vue

@@ -31,11 +31,11 @@
         </el-table-column>
         <el-table-column label="操作" align="center" width="300">
           <template slot-scope="scope">
-            <el-button @click="edit(scope.row)" type="text" size="small">编辑</el-button>
-            <el-button @click="remove(scope.row)" type="text" size="small">删除</el-button>
-            <el-button :disabled="scope.row.status == 1" @click="updateState(scope.row, '启用')" type="text" size="small">启用</el-button>
-            <el-button :disabled="scope.row.status == 0" @click="updateState(scope.row, '禁用')" type="text" size="small">禁用</el-button>
-            <el-button @click="openDrawer(scope.row)" type="text" size="small">历史版本</el-button>
+            <el-button :disabled="scope.row.isEdit == 0" @click="edit(scope.row)" type="text" size="small">编辑</el-button>
+            <el-button :disabled="scope.row.isEdit == 0" @click="remove(scope.row)" type="text" size="small">删除</el-button>
+            <el-button :disabled="scope.row.status == 1 || scope.row.isEdit == 0" @click="updateState(scope.row, '启用')" type="text" size="small">启用</el-button>
+            <el-button :disabled="scope.row.status == 0 || scope.row.isEdit == 0" @click="updateState(scope.row, '禁用')" type="text" size="small">禁用</el-button>
+            <el-button :disabled="scope.row.isEdit == 0" @click="openDrawer(scope.row)" type="text" size="small">历史版本</el-button>
           </template>
         </el-table-column>
       </el-table>

+ 2 - 2
src/views/carrierStandard/carrierListShipping/components/compile/index.vue

@@ -1,12 +1,12 @@
 <template>
   <div class="view-CarrierListMachineryPreparation-c">
     <div class="view-CarrierListMachineryPreparation-box">
-      <div class="view-CarrierListMachineryPreparation-box-left">
+      <!-- <div class="view-CarrierListMachineryPreparation-box-left">
         <el-radio-group v-model="summarizing">
           <el-radio-button label="汇总数据"></el-radio-button>
           <el-radio-button label="原数据"></el-radio-button>
         </el-radio-group>
-      </div>
+      </div> -->
 
       <div class="view-CarrierListMachineryPreparation-box-right">
         <MissionDetail :detail="detail" />

+ 1 - 1
vue.config.js

@@ -16,7 +16,7 @@ module.exports = defineConfig({
         }
       },
       ['/api/kgqa']: {
-        target: 'http://192.168.0.103:8000',
+        target: 'http://192.168.0.102:7073',
         ws: false,
         changeOrigin: true,
         pathRewrite: {