Просмотр исходного кода

智能问答界面、知识抽取、菜单bug调整

Rmengdi 7 месяцев назад
Родитель
Сommit
fabc999eb3

+ 6 - 0
src/api/als/intelligentQA.js

@@ -0,0 +1,6 @@
+import { post } from '@/http/index'
+
+// 问答接口
+export const handlerAsk = async (data) => {
+  return await post('/kgqa/ask/', data)
+}

+ 21 - 0
src/api/als/knowledgeExtraction.js

@@ -0,0 +1,21 @@
+import { post } from '@/http/index'
+
+// 查询知识抽取列表
+export const getknowledgeExtraction = async (data) => {
+  // return await post('/kgqa/ask/', data)
+}
+
+// 新增知识抽取
+export const addknowledgeExtraction = async (data) => {
+  return await post('/kgqa/api/upload', data)
+}
+
+// 修改知识抽取
+export const updateknowledgeExtraction = async (data) => {
+  // return await put('/als/lifePrediction', data)
+}
+
+// 删除知识抽取
+export const removeknowledgeExtraction = async (id) => {
+  // return await deletes('/als/lifePrediction/' + id)
+}

+ 59 - 14
src/router/modules/als/knowledgeGraph.js

@@ -15,7 +15,8 @@ export const AtlasFile = {
       component: () => import('@/views/als/atlasFile/index.vue'),
       meta: {
         title: '文件管理'
-      }
+      },
+      sort: 1
     }
   ]
 }
@@ -34,14 +35,15 @@ export const knowledgeExtraction = {
       component: () => import('@/views/als/knowledgeExtraction/index.vue'),
       meta: {
         title: '知识抽取'
-      }
+      },
+      sort: 2
     }
   ]
 }
-export const knowledgeManage = {
+export const graphVisualization = {
   path: '/knowledgeGraph',
   redirect: '/knowledgeGraph/fileManage',
-  name: 'KnowledgeManage',
+  name: 'GraphVisualization',
   component: Layout,
   meta: {
     title: '知识图谱',
@@ -49,18 +51,39 @@ export const knowledgeManage = {
   },
   children: [
     {
-      path: '/knowledgeGraph/knowledgeManage',
-      component: () => import('@/views/als/knowledgeManage/index.vue'),
+      path: '/knowledgeGraph/graphVisualization',
+      component: () => import('@/views/als/graphVisualization/index.vue'),
       meta: {
-        title: '知识管理'
-      }
+        title: '图谱可视化'
+      },
+      sort: 5
     }
   ]
 }
-export const graphVisualization = {
+// export const knowledgeManage = {
+//   path: '/knowledgeGraph',
+//   redirect: '/knowledgeGraph/fileManage',
+//   name: 'KnowledgeManage',
+//   component: Layout,
+//   meta: {
+//     title: '知识图谱',
+//     icon: 'el-icon-s-platform'
+//   },
+//   children: [
+//     {
+//       path: '/knowledgeGraph/knowledgeManage',
+//       component: () => import('@/views/als/knowledgeManage/index.vue'),
+//       meta: {
+//         title: '知识管理'
+//       }
+//     }
+//   ]
+// }
+
+export const entityManage = {
   path: '/knowledgeGraph',
   redirect: '/knowledgeGraph/fileManage',
-  name: 'GraphVisualization',
+  name: 'EntityManage',
   component: Layout,
   meta: {
     title: '知识图谱',
@@ -68,11 +91,33 @@ export const graphVisualization = {
   },
   children: [
     {
-      path: '/knowledgeGraph/graphVisualization',
-      component: () => import('@/views/als/graphVisualization/index.vue'),
+      path: '/knowledgeGraph/entityManage',
+      component: () => import('@/views/als/knowledgeManage/entityManage/index.vue'),
       meta: {
-        title: '图谱可视化'
-      }
+        title: '实体管理'
+      },
+      sort: 3
+    }
+  ]
+}
+
+export const ERManage = {
+  path: '/knowledgeGraph',
+  redirect: '/knowledgeGraph/fileManage',
+  name: 'ERManage',
+  component: Layout,
+  meta: {
+    title: '知识图谱',
+    icon: 'el-icon-s-platform'
+  },
+  children: [
+    {
+      path: '/knowledgeGraph/ERManage',
+      component: () => import('@/views/als/knowledgeManage/ERManage/index.vue'),
+      meta: {
+        title: '实体关系管理'
+      },
+      sort: 4
     }
   ]
 }

+ 2 - 4
src/views/als/components/Charts/graph.vue

@@ -85,10 +85,8 @@ export default {
               show: true,
               formatter: '{c}',
               position: 'middle',
-              textStyle: {
-                fontSize: 14,
-                color: '#333'
-              }
+              fontSize: 14,
+              color: '#333'
             },
             // edgeLabel: {
             //   fontSize: 20

+ 69 - 51
src/views/als/intelligentQA/index.vue

@@ -6,15 +6,15 @@
       <div ref="main" class="main">
         <div class="chatLine">
           <div v-for="(item, index) in chatInfo" :key="index">
-            <div class="chatRow" v-if="item.code === 200">
+            <div class="chatRow" v-if="item.answer">
               <div class="answerData">
-                <div class="answer">{{ item.data.answer }}</div>
+                <div class="answer">{{ item.answer }}</div>
                 <!-- <div class="graph"></div> -->
-                <graphECharts :graphData="item.data.graph" class="charts"></graphECharts>
+                <graphECharts v-if="item.graph" :graphData="item.graph" class="charts"></graphECharts>
               </div>
             </div>
-            <div class="chatRow chatQ" v-if="item.userId">
-              <div class="questionContent">{{ item.data }}</div>
+            <div class="chatRow chatQ" v-if="item.question">
+              <div class="questionContent">{{ item.question }}</div>
             </div>
           </div>
         </div>
@@ -31,32 +31,28 @@
 
 <script>
 import store from '@/store'
+import { handlerAsk } from '@/api/als/intelligentQA'
 import graphECharts from '@/views/als/components/Charts/graph.vue'
+import axios from 'axios'
 
 export default {
   name: 'IntelligentQA',
   components: { graphECharts },
   data() {
     return {
-      userId: '',
       chatInfo: [],
-      questionInput: '',
+      questionInput: '', //202310150010
       currentHeight: 'auto',
       lastScrollHeight: 0,
       isScrollable: false
     }
   },
   mounted() {
-    this.getUserInfo()
     this.adjustHeight()
   },
   watch: {},
   created() {},
   methods: {
-    async getUserInfo() {
-      const { user } = await store.dispatch('user/getUserInfo')
-      this.userId = user.userId
-    },
     adjustHeight() {
       const textarea = this.$el.querySelector('textarea')
       this.currentHeight = 'auto'
@@ -94,54 +90,76 @@ export default {
         }
       }
     },
-    sendQuestion() {
-      console.log('222', this.questionInput.trim())
-      if (this.questionInput.trim() === '') {
-        return
+    async sendQuestion() {
+      const sendInput = {
+        question: this.questionInput,
+        user_id: String(store.state.user.userInfo.user.userId)
       }
-      this.chatInfo.push(
-        {
-          data: this.questionInput,
-          userId: this.userId
-        },
-        {
-          code: 200,
-          msg: '',
-          data: {
-            user_id: 'user',
-            answer: '解决办法为:更换电池或遥控器',
-            graph: {
-              data: [
-                { name: '202310150010', category: 'HMC' },
-                { name: '电视', category: '成品' },
-                { name: '电视遥控器失灵', category: '故障描述' },
-                { name: '家用电器', category: '系统' },
-                { name: '更换电池或遥控器', category: '维修策略' }
-              ],
-              links: [
-                { source: '202310150010', target: '电视', value: '成品' },
-                { source: '202310150010', target: '电视遥控器失灵', value: '故障描述' },
-                { source: '202310150010', target: '家用电器', value: '系统' },
-                { source: '202310150010', target: '更换电池或遥控器', value: '维修策略' }
-              ],
-              categories: [{ name: 'HMC' }, { name: '成品' }, { name: '故障描述' }, { name: '维修策略' }, { name: '系统' }]
+
+      try {
+        if (this.questionInput.trim() === '') {
+          return
+        }
+        this.chatInfo.push(sendInput, {
+          answer: '正在解析您的问题,请稍后......'
+        })
+        this.questionInput = ''
+        const { code, data } = await handlerAsk(sendInput)
+        if (code == 200) {
+          let newData = data
+          const graphData = eval('(' + newData.graph + ')')
+          newData.graph = graphData
+          const categories = []
+          newData.graph.data.forEach((node) => {
+            const flag = categories.find((item) => {
+              return item.name === node.category
+            })
+            if (!flag) {
+              categories.push({ name: node.category })
             }
-          }
+          })
+          newData.graph.categories = categories
+
+          this.chatInfo.pop()
+          this.chatInfo.push(newData)
         }
-      )
+        // 等处理过返回数据后,调用使视图保持在最底部
+        let main = this.$refs.main
+        setTimeout(() => {
+          main.scrollTop = main.scrollHeight
+        }, 0)
+      } catch (error) {}
+      // {
+      //   code: 200,
+      //   msg: '',
+      //   data: {
+      //     user_id: 'user',
+      //     answer: '解决办法为:更换电池或遥控器',
+      //     graph: {
+      //       data: [
+      //         { name: '202310150010', category: 'HMC' },
+      //         { name: '电视', category: '成品' },
+      //         { name: '电视遥控器失灵', category: '故障描述' },
+      //         { name: '家用电器', category: '系统' },
+      //         { name: '更换电池或遥控器', category: '维修策略' }
+      //       ],
+      //       links: [
+      //         { source: '202310150010', target: '电视', value: '成品' },
+      //         { source: '202310150010', target: '电视遥控器失灵', value: '故障描述' },
+      //         { source: '202310150010', target: '家用电器', value: '系统' },
+      //         { source: '202310150010', target: '更换电池或遥控器', value: '维修策略' }
+      //       ],
+      //       categories: [{ name: 'HMC' }, { name: '成品' }, { name: '故障描述' }, { name: '维修策略' }, { name: '系统' }]
+      //     }
+      //   }
+      // }
+
       // data: [
       //           { name: '111', category: 'HMC' },
       //           { name: '更换手机屏幕', category: '维修策略' }
       //         ],
       //         links: [{ source: '111', target: '更换手机屏幕', value: '维修策略' }],
       //         categories: [{ name: 'HMC' }, { name: '维修策略' }]
-      console.log('this.chatInfo', this.chatInfo)
-      this.questionInput = ''
-      // 等处理过返回数据后,调用使视图保持在最底部
-      let main = this.$refs.main
-      setTimeout(() => {
-        main.scrollTop = main.scrollHeight
-      }, 0)
     },
     showGraph(graphData) {
       const { data, links } = graphData

+ 271 - 7
src/views/als/knowledgeExtraction/index.vue

@@ -1,17 +1,281 @@
 <template>
-  <div class="view-knowledgeExtraction">知识抽取</div>
+  <div class="view-table-content">
+    <div style="width: 100%">
+      <div class="view-dataType-title">
+        <div class="view-dataType-title-btn">
+          <el-button type="success" @click="openDialog()">上传文件</el-button>
+          <el-button type="warning" @click="remove(tableCheckItems)" :disabled="tableCheckItems.length == 0">删除</el-button>
+        </div>
+        <div class="view-dataType-title-search">
+          <el-input placeholder="请输入名称" v-model="keyWordData" class="input1">
+            <el-button slot="append" icon="el-icon-search" @click="searchClick"></el-button>
+          </el-input>
+        </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>
+      </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="fileName">
+            <el-input v-model="form.fileName" placeholder="请输入文件名称" />
+          </el-form-item>
+          <el-form-item label="文件类型" prop="fileType">
+            <el-select v-model="form.fileType" placeholder="请选择文件类型">
+              <el-option v-for="item in fileTypeList" :key="item.key" :label="item.name" :value="item.key" />
+            </el-select>
+          </el-form-item> -->
+          <el-form-item label="选择抽取文件" label-width="100px" prop="file">
+            <el-select v-model="form.file" placeholder="请选择文件" @change="handleFile">
+              <el-option v-for="item in fileList" :key="item.ossId" :label="item.fileName" :value="item.ossId" />
+            </el-select>
+            <!-- <FileUpload v-model="form.ossId" :limit="1" :fileSize="500" :fileType="['docx', 'doc', 'pdf', 'txt']" /> -->
+          </el-form-item>
+          <!-- <el-form-item label="备注" prop="remarks">
+            <el-input type="textarea" :rows="2" v-model="form.remarks" placeholder="请输入备注" />
+          </el-form-item> -->
+        </el-form>
+
+        <span slot="footer" class="dialog-footer">
+          <el-button @click="handleClose">取 消</el-button>
+          <el-button type="primary" @click="submit">确 定</el-button>
+        </span>
+      </el-dialog>
+    </div>
+  </div>
 </template>
 
 <script>
+import { getknowledgeExtraction, addknowledgeExtraction, updateknowledgeExtraction, removeknowledgeExtraction } from '@/api/als/knowledgeExtraction'
+import { getAtlasFile } from '@/api/als/atlasFile'
+import { getOssIdDataAPI } from '@/api/als/algorithm'
+import { deepClone, debounce } from '@/utils/index'
+// import FileUpload from '@/views/als/components/FileUpload'
+
 export default {
-  name: 'KnowledgeExtraction',
+  name: 'knowledgeExtraction',
+  components: {},
   data() {
-    return {}
+    // 这里存放数据
+    return {
+      dialogTitle: '新增',
+      dialogVisible: false,
+      keyWordData: '',
+      searchValue: '',
+      columns: [
+        {
+          prop: 'file',
+          label: '文件'
+        },
+        // {
+        //   prop: 'fileName',
+        //   label: '文件名称'
+        // },
+        // {
+        //   prop: 'fileType',
+        //   label: '文件类型'
+        // },
+        // {
+        //   prop: 'ossId',
+        //   label: '文件编号'
+        // },
+        // {
+        //   prop: 'remarks',
+        //   label: '备注'
+        // },
+        {
+          button: true,
+          label: '操作',
+          width: '240px',
+          group: [
+            {
+              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])
+              }
+            }
+          ]
+        }
+      ],
+      options: {
+        stripe: true, // 斑马纹
+        mutiSelect: true, // 多选框
+        index: false, // 显示序号, 多选则 mutiSelect
+        loading: false, // 表格动画
+        initTable: false, // 是否一挂载就加载数据
+        border: true,
+        height: 'calc(100vh - 300px)'
+      },
+      tableCheckItems: [],
+      tableData: [],
+      tableRequset: {
+        total: 0,
+        pageIndex: 1,
+        pageSize: 10,
+        searchValue: ''
+      },
+      form: {
+        id: '',
+        file: ''
+      },
+      debounceFn: debounce(this.fetch, 500),
+      fileList: []
+    }
+  },
+  watch: {
+    keyWord() {
+      this.tableRequset.pageIndex = 1
+      this.debounceFn()
+    }
   },
-  watch: {},
-  created() {},
-  methods: {}
+  mounted() {
+    // this.getknowledgeExtractionAPI()
+    this.getAtlasFileAPI()
+  },
+  methods: {
+    async getAtlasFileAPI(params) {
+      const {
+        data: { list, total }
+      } = await getAtlasFile()
+      this.fileList = list
+    },
+
+    async removeknowledgeExtractionAPI(params) {
+      try {
+        const { code } = await removeknowledgeExtraction(params)
+        if (code === 200) {
+          this.$message({
+            type: 'success',
+            message: '操作成功!'
+          })
+          await this.getknowledgeExtractionAPI()
+          this.handleClose()
+        }
+      } catch (error) {}
+    },
+
+    async getknowledgeExtractionAPI(params) {
+      if (this.$refs.table) this.$refs.table.clearSelection()
+      const { keyWord } = this
+      const { pageSize, pageIndex } = this.tableRequset
+      const {
+        data: { list, total }
+      } = await getknowledgeExtraction({ pageSize, pageNum: pageIndex, ...params })
+      this.tableData = list
+      this.tableRequset.total = total
+    },
+
+    fetch() {
+      this.getknowledgeExtractionAPI()
+    },
+
+    async searchClick() {
+      this.getknowledgeExtractionAPI({ name: keyWordData })
+    },
+
+    async addknowledgeExtractionAPI() {
+      try {
+        delete this.form.aircaftModelName
+        const { code } = await addknowledgeExtraction({ ...this.form })
+        if (code === 200) {
+          this.$message({
+            type: 'success',
+            message: '操作成功!'
+          })
+          this.handleClose()
+          this.getknowledgeExtractionAPI()
+        }
+      } catch (error) {}
+    },
+
+    async updateknowledgeExtractionAPI() {
+      try {
+        const { code } = await updateknowledgeExtraction({ ...this.form })
+        if (code === 200) {
+          this.$message({
+            type: 'success',
+            message: '操作成功!'
+          })
+          this.handleClose()
+          this.getknowledgeExtractionAPI()
+        }
+      } catch (error) {}
+    },
+
+    openDialog() {
+      this.dialogTitle = '新增'
+      this.dialogVisible = true
+    },
+
+    handleClose() {
+      this.dialogVisible = false
+      this.form = {
+        id: '',
+        fileName: '',
+        fileType: '',
+        ossId: '',
+        status: '',
+        remarks: ''
+      }
+    },
+
+    handUpdate(row) {
+      this.dialogTitle = '编辑'
+      this.form = deepClone(row)
+      this.dialogVisible = true
+    },
+
+    submit() {
+      switch (this.dialogTitle) {
+        case '编辑':
+          this.updateknowledgeExtractionAPI()
+
+          break
+        case '新增':
+          this.addknowledgeExtractionAPI()
+
+          break
+      }
+    },
+
+    selection(val) {
+      this.tableCheckItems = val
+    },
+
+    remove(row) {
+      this.$confirm('是否删除该模型', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      })
+        .then(() => {
+          this.removeknowledgeExtractionAPI(row.map((e) => e.id))
+        })
+        .catch(() => {})
+    },
+
+    async handleFile() {
+      const res = await getOssIdDataAPI(this.form.file)
+      console.log('res', res)
+      // const res =await getknowledgeExtraction()
+    }
+  }
 }
 </script>
 
-<style lang="scss"></style>
+<style lang="scss" scoped>
+@import '../index.scss';
+</style>

+ 1 - 1
src/views/als/knowledgeManage/ERManage/index.vue

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

+ 261 - 0
src/views/als/knowledgeManage/entityManage/index.vue

@@ -0,0 +1,261 @@
+<template>
+  <div class="view-table-content">
+    <div style="width: 100%">
+      <div class="view-dataType-title">
+        <div class="view-dataType-title-btn">
+          <el-button type="success" @click="openDialog()">新增</el-button>
+          <el-button type="warning" @click="remove(tableCheckItems)" :disabled="tableCheckItems.length == 0">删除</el-button>
+        </div>
+        <div class="view-dataType-title-search">
+          <el-input placeholder="请输入名称" v-model="keyWordData" class="input1">
+            <el-button slot="append" icon="el-icon-search" @click="searchClick"></el-button>
+          </el-input>
+        </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>
+      </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="fileName">
+            <el-input v-model="form.fileName" placeholder="请输入实体名称" />
+          </el-form-item>
+          <el-form-item label="实体类型" prop="fileType">
+            <el-select v-model="form.fileType" placeholder="请选择实体类型">
+              <el-option v-for="item in fileTypeList" :key="item.key" :label="item.name" :value="item.key" />
+            </el-select>
+          </el-form-item>
+        </el-form>
+
+        <span slot="footer" class="dialog-footer">
+          <el-button @click="handleClose">取 消</el-button>
+          <el-button type="primary" @click="submit">确 定</el-button>
+        </span>
+      </el-dialog>
+    </div>
+  </div>
+</template>
+
+<script>
+import { getAtlasFile, addAtlasFile, updateAtlasFile, removeAtlasFile } from '@/api/als/atlasFile'
+import { deepClone, debounce } from '@/utils/index'
+
+export default {
+  name: 'AtlasFile',
+  components: {},
+  data() {
+    // 这里存放数据
+    return {
+      dialogTitle: '新增',
+      dialogVisible: false,
+      keyWordData: '',
+      searchValue: '',
+      columns: [
+        {
+          prop: 'fileName',
+          label: '文件名称'
+        },
+        {
+          prop: 'fileType',
+          label: '文件类型'
+        },
+        {
+          prop: 'ossId',
+          label: '文件编号'
+        },
+        {
+          prop: 'remarks',
+          label: '备注'
+        },
+        {
+          button: true,
+          label: '操作',
+          width: '240px',
+          group: [
+            {
+              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])
+              }
+            }
+          ]
+        }
+      ],
+      options: {
+        stripe: true, // 斑马纹
+        mutiSelect: true, // 多选框
+        index: false, // 显示序号, 多选则 mutiSelect
+        loading: false, // 表格动画
+        initTable: false, // 是否一挂载就加载数据
+        border: true,
+        height: 'calc(100vh - 300px)'
+      },
+      tableCheckItems: [],
+      tableData: [],
+      tableRequset: {
+        total: 0,
+        pageIndex: 1,
+        pageSize: 10,
+        searchValue: ''
+      },
+      form: {
+        id: '',
+        fileName: '',
+        fileType: '',
+        ossId: '',
+        status: '',
+        remarks: ''
+      },
+      debounceFn: debounce(this.fetch, 500),
+      fileTypeList: [
+        { key: '术语', name: '术语' },
+        { key: '故障案例', name: '故障案例' },
+        { key: '专业手册', name: '专业手册' },
+        { key: '期刊', name: '期刊' },
+        { key: '其它', name: '其它' }
+      ]
+    }
+  },
+  watch: {
+    keyWord() {
+      this.tableRequset.pageIndex = 1
+      this.debounceFn()
+    }
+  },
+  mounted() {
+    this.getAtlasFileAPI()
+  },
+  methods: {
+    async removeAtlasFileAPI(params) {
+      try {
+        const { code } = await removeAtlasFile(params)
+        if (code === 200) {
+          this.$message({
+            type: 'success',
+            message: '操作成功!'
+          })
+          await this.getAtlasFileAPI()
+          this.handleClose()
+        }
+      } catch (error) {}
+    },
+
+    async getAtlasFileAPI(params) {
+      if (this.$refs.table) this.$refs.table.clearSelection()
+      const { keyWord } = this
+      const { pageSize, pageIndex } = this.tableRequset
+      const {
+        data: { list, total }
+      } = await getAtlasFile({ pageSize, pageNum: pageIndex, ...params })
+      this.tableData = list
+      this.tableRequset.total = total
+    },
+
+    fetch() {
+      this.getAtlasFileAPI()
+    },
+
+    async searchClick() {
+      this.getAtlasFileAPI({ name: keyWordData })
+    },
+
+    async addAtlasFileAPI() {
+      try {
+        delete this.form.aircaftModelName
+        const { code } = await addAtlasFile({ ...this.form })
+        if (code === 200) {
+          this.$message({
+            type: 'success',
+            message: '操作成功!'
+          })
+          this.handleClose()
+          this.getAtlasFileAPI()
+        }
+      } catch (error) {}
+    },
+
+    async updateAtlasFileAPI() {
+      try {
+        const { code } = await updateAtlasFile({ ...this.form })
+        if (code === 200) {
+          this.$message({
+            type: 'success',
+            message: '操作成功!'
+          })
+          this.handleClose()
+          this.getAtlasFileAPI()
+        }
+      } catch (error) {}
+    },
+
+    openDialog() {
+      this.dialogTitle = '新增'
+      this.dialogVisible = true
+    },
+
+    handleClose() {
+      this.dialogVisible = false
+      this.form = {
+        id: '',
+        fileName: '',
+        fileType: '',
+        ossId: '',
+        status: '',
+        remarks: ''
+      }
+    },
+
+    handUpdate(row) {
+      this.dialogTitle = '编辑'
+      this.form = deepClone(row)
+      this.dialogVisible = true
+    },
+
+    submit() {
+      switch (this.dialogTitle) {
+        case '编辑':
+          this.updateAtlasFileAPI()
+
+          break
+        case '新增':
+          this.addAtlasFileAPI()
+
+          break
+      }
+    },
+
+    selection(val) {
+      this.tableCheckItems = val
+    },
+
+    remove(row) {
+      this.$confirm('是否删除该模型', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      })
+        .then(() => {
+          this.removeAtlasFileAPI(row.map((e) => e.id))
+        })
+        .catch(() => {})
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+@import '../../index.scss';
+</style>

+ 1 - 1
src/views/als/knowledgeManage/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="view-knowledgeManage">知识管理</div>
+  <div class="view-knowledgeManage"></div>
 </template>
 
 <script>

+ 10 - 2
vue.config.js

@@ -9,12 +9,20 @@ module.exports = defineConfig({
     proxy: {
       ['/api/als']: {
         target: 'http://localhost:9090',
-        ws: false, //也可以忽略不写,不写不会影响跨域
-        changeOrigin: true, //是否开启跨域,值为 true 就是开启, false 不开启
+        ws: false,
+        changeOrigin: true,
         pathRewrite: {
           ['^' + '/api/als']: '/als'
         }
       },
+      ['/api/kgqa']: {
+        target: 'http://192.168.0.105:8000',
+        ws: false,
+        changeOrigin: true,
+        pathRewrite: {
+          ['^' + '/api/kgqa']: '/kgqa'
+        }
+      },
       [process.env.VUE_APP_BASE_API]: {
         target: process.env.VUE_APP_BASE_API_target,
         ws: false, //也可以忽略不写,不写不会影响跨域