Explorar o código

fix some bugs

Allen %!s(int64=2) %!d(string=hai) anos
pai
achega
c701f12b94

+ 1 - 1
src/api/knowledge/entity.js

@@ -38,7 +38,7 @@ export function updateEntity(data) {
 // 删除实体管理
 export function delEntity(entId) {
   return request({
-    url: '/knowledge/entity/' + entId,
+    url: '/knowledge/entity/delete/' + entId,
     method: 'delete'
   })
 }

+ 5 - 1
src/components/TopNav/index.vue

@@ -6,9 +6,13 @@
     active-text-color="#409EFF"
   >
     <el-menu-item :style="{'--theme': theme}" index="/search"
-        ><svg-icon icon-class="dashboard" />
+        ><svg-icon icon-class="nested" />
       检索中心
     </el-menu-item>
+    <el-menu-item :style="{'--theme': theme}" index="/knowledge"
+        ><svg-icon icon-class="dashboard" />
+      知识图谱
+    </el-menu-item>
     <template v-for="(item, index) in topMenus">
       <!-- <el-menu-item :style="{'--theme': theme}" :index="item.path" :key="index" v-if="index < visibleNumber"
         ><svg-icon :icon-class="item.meta.icon" /> -->

+ 1 - 1
src/router/knowledge/index.js

@@ -28,7 +28,7 @@ export default [
     path: '/knowledge',
     name: 'manager',
     component: Knowledge,
-    meta: { title: '检索中心', icon: 'dashboard', activeMenu: '' },
+    meta: { title: '知识图谱', icon: 'dashboard', activeMenu: '' },
     // hidden: false,
     // alwaysShow: true,
     // redirect: "noRedirect",

+ 26 - 25
src/router/search/index.js

@@ -2,31 +2,32 @@ import Home from '@/views/search/Home.vue'
 // import {createRouter, createWebHistory} from 'vue-router'
 
 export default  [
-    {
-        path: '/search',
-        name: 'search',
-        component: Home
-    },
-    {
-        path: '/search/nav',
-        name: 'nav',
-        component: () => import('@/views/search/nav.vue')
-    },
-    {
-        path: '/search/os',
-        name: 'os',
-        component: () => import('@/views/search/os.vue')
-    },
-    {
-        path: '/search/software',
-        name: 'software',
-        component: () => import('@/views/search/software.vue')
-    },
-    {
-        path: '/search/background',
-        name: 'background',
-        component: () => import('@/components/search/Background.vue')
-    }
+  {
+    path: '/search',
+    name: 'search',
+    component: Home,
+    meta: { title: '检索中心', icon: 'dashboard', activeMenu: '' }
+  }
+  // {
+  //     path: '/search/nav',
+  //     name: 'nav',
+  //     component: () => import('@/views/search/nav.vue')
+  // },
+  // {
+  //     path: '/search/os',
+  //     name: 'os',
+  //     component: () => import('@/views/search/os.vue')
+  // },
+  // {
+  //     path: '/search/software',
+  //     name: 'software',
+  //     component: () => import('@/views/search/software.vue')
+  // },
+  // {
+  //     path: '/search/background',
+  //     name: 'background',
+  //     component: () => import('@/components/search/Background.vue')
+  // }
 ]
 
 // const routerHistory = createWebHistory()

+ 2 - 4
src/views/knowledge/graphClass/relationAttrEditor.vue

@@ -1,6 +1,6 @@
 <template>
     <a-row type="flex" align="top">
-        <a-col :span="23">
+        <!-- <a-col :span="23">
           <a-spin :spinning="spinning">
             <a-button class="openAddRelationSty" @click="openModel()">新增关系类属性</a-button>
               <a-table :pagination="false" size="middle" rowKey="attrClsID" :columns="columns" :dataSource="data"
@@ -34,9 +34,7 @@
                   <div class='editable-row-operations' style="width:120px;">
                     <span v-if="record.editable">
                       <a @click="() => save(record,record.attrClsID)">保存</a>
-                      <!-- <a-popconfirm title='确定取消?' @confirm="() => cancel(record.attrClsID)"> -->
                       <a @click="() => cancel(record.attrClsID)" class="cancel-sty">取消</a>
-                      <!-- </a-popconfirm> -->
                     </span>
                     <span v-else>
                       <a-button size="small"><a @click="() => edit(record.attrClsID)">编辑</a></a-button>
@@ -49,7 +47,7 @@
                 </template>
               </a-table>
             </a-spin>
-        </a-col>
+        </a-col> -->
     </a-row>
 </template>
 

+ 3 - 2
src/views/knowledge/graphEntity/relationClsAttrEditor.vue

@@ -11,10 +11,11 @@
         </div>
         <a-table :pagination="false" :loading="loading" :columns="columns" :data-source="data" :row-selection="{ onChange: onTableSelect }">
             <span slot="entName" slot-scope="text, record">
-                <a @click="openNewPage(record)">{{text}}</a>
+              {{text}}
+                <!-- <a @click="openNewPage(record)">{{text}}</a> -->
             </span>
             <span slot="action" slot-scope="text, record">
-                <a @click="edit(record)" style="margin-right: 5px">编辑</a>
+                <!-- <a @click="edit(record)" style="margin-right: 5px">编辑</a> -->
                 <a-popconfirm title="此操作无法恢复,请确认是否删除?"
                               @confirm="() => del(record)">
                   <a href="javascript:;" class="spanMarginl">删除</a>

+ 11 - 8
src/views/knowledge/modal/createRelationClassModal.vue

@@ -42,7 +42,7 @@
           </a-button>
         </a-col>
         <a-col :span="12">
-          <a-select
+          <!-- <a-select
                   showSearch
                   placeholder="选择一个关系类"
                   style="width:200px;"
@@ -55,19 +55,19 @@
             >
               <a-popover placement="left">
                 <template slot="content">
-                  <div>起点:{{item.startEntCls&&item.startEntCls.entClsName}}</div>
+                  <div>起点:{{item.startName}}</div>
                   <div>关系类:{{item.relClsName}}</div>
-                  <div>终点:{{item.endEntCls&&item.endEntCls.entClsName}}</div>
+                  <div>终点:{{item.endName}}</div>
                   <div v-for="(p,i) in attrList" :key="i">属性:{{p.attrClsName}}</div>
                 </template>
                 <span
                         @mouseenter="enter(item)"
                         @mouseleave="leave()"
                 >
-                  {{item.startEntCls&&item.startEntCls.entClsName}}->{{item.relClsName}}->{{item.endEntCls&&item.endEntCls.entClsName}}</span>
+                  {{item.startName}}->{{item.relClsName}}->{{item.endName}}</span>
               </a-popover>
             </a-select-option>
-          </a-select>
+          </a-select> -->
         </a-col>
       </a-row>
     </div>
@@ -180,7 +180,7 @@ export default {
      * @param value
      */
     handleChange(name) {
-      getAllRelationClassListByName(name).then(data => {
+      getAllRelationClassListByName(name,false).then(data => {
         //参数为空,获取所有的列表
         this.filterRelationList = data.records;
       });
@@ -190,11 +190,13 @@ export default {
     },
     getRelationCls() {
       this.$open('getRelationClsListModal', {}, function (data) {
+        debugger;
         if (data) {
+          this.relClsName = data
           this.selectedRelCls = data
-          getAllRelationClassListByName(data).then(data => {
+          getAllRelationClassListByName(data,false).then(data => {
             //参数为空,获取所有的列表
-            this.filterRelationList = data.records;
+            this.filterRelationList = data.rows;
           });
         }
       })
@@ -210,6 +212,7 @@ export default {
       return result;
     },
     async handleOk(e) {
+      debugger;
       let result = await this.getFormData(); // this是当前组件的this,  'form'此表单的名称,一定要是字符串
       const endID = this.EntityClassNode && this.EntityClassNode.entClsID;
       const relClsID = this.selectRelationValue;

+ 2 - 2
src/views/knowledge/statistical/entityClassView.vue

@@ -1,7 +1,7 @@
 <template>
     <div class="flex-row"
          style="height: 100%">
-        <div id="leftPanel"
+        <!-- <div id="leftPanel"
              class="flex-col road"
              v-if="showLeftBar">
             <div class="flex1 flex-col panel"
@@ -38,7 +38,7 @@
                     </a-checkbox-group>
                 </a-spin>
             </div>
-        </div>
+        </div> -->
         <a-spin :spinning="loadingChecked" class="flex1 panel flex-col" style="height: 100%">
             <chart-comp ref="chart"
                         @="getInfoTooltip"