Jelajahi Sumber

同步代码

yangdr 4 minggu lalu
induk
melakukan
4ab35f4e99

+ 4 - 5
src/dialogs/OCRDialog.vue

@@ -26,9 +26,11 @@
       <el-button @click="dialogFormVisible = false">取 消</el-button>
     </footer>
     <div class="knowledge-base" v-show="knowledgeBase.visible">
-      <div class="topbar"><span @click="knowledgeBase.visible = false" class="close-knowledge-base"><el-icon>
+      <div class="topbar">
+        <span @click="knowledgeBase.visible = false" class="close-knowledge-base"><el-icon>
             <Close />
-          </el-icon></span>
+          </el-icon>
+        </span>
       </div>
       <div class="knowledge-base-content">
         <el-scrollbar class="knowledge-base-list">
@@ -130,12 +132,9 @@
                   @size-change="handleSizeChange" @current-change="handleCurrentChange" />
               </div>
             </el-scrollbar>
-
           </div>
         </div>
-
       </div>
-
     </div>
   </el-dialog>
 

+ 12 - 6
src/stores/menu.js

@@ -8,12 +8,14 @@ import {
 
 export const useMenuStore = defineStore('menu', () => {
   function initRouteList() {
-    return getSessionVar("routeList") ? JSON.parse(getSessionVar("routeList")) : [{
-      path: '/kmplatform/openplatform',
-      name: 'openplatform',
-      title: "开放平台",
-      children: []
-    }]
+    return getSessionVar("routeList") ?
+      JSON.parse(getSessionVar("routeList")) :
+      [{
+        path: '/kmplatform/openplatform',
+        name: 'openplatform',
+        title: "开放平台",
+        children: []
+      }]
   }
   let routeList = ref(initRouteList())
 
@@ -74,6 +76,10 @@ export const useMenuStore = defineStore('menu', () => {
     return operationPermissions.value[code] ? true : false;
   }
   return { routeList, updateRouteList, operationPermissions, isOP }
+}, {
+  persist: {
+    enable: true,
+  }
 })
 
 export default useMenuStore

+ 4 - 4
src/views/ConfigurationView.vue

@@ -3,7 +3,7 @@
         <h2>配置</h2>
     </el-row>
     <el-row style="margin:15px; ">
-        <el-tabs v-model="activeName" style="width: 100%;">
+        <el-tabs v-model="activeName" style="width: 100%; ">
             <el-tab-pane label="基本配置" name="basic"
                 style="width: 100%;height: 800px; overflow-y:auto; display: flex; flex-direction: row;">
                 <el-form :model="basicConfig" label-width="120px" style="margin: 5px;">
@@ -26,9 +26,9 @@
                     </el-form-item>
                 </el-form>
             </el-tab-pane>
-            <el-tab-pane label="队列配置" name="first"
-                style="width: 100%;height: 800px; overflow-y:auto; display: flex; flex-direction: row;">
-                <div v-for="(queue) in queueData" :key="queue.id" style="margin-right:8px;width:350px; ">
+            <el-tab-pane label="队列配置" name="first" style="width: 100%;height: 800px; overflow-y:auto;">
+                <div v-for="(queue) in queueData" :key="queue.id"
+                    style="margin:0px 8px 10px 0px;width:350px; display: inline-block; ">
                     <span style="font-weight: bold;"> {{ queue.queue_label }}</span> <span style="font-size: 8pt;">({{
                         queue.queue_category }}_{{ queue.queue_name }})</span><br />
                     <br />

+ 81 - 75
src/views/GraphManagement.vue

@@ -1,107 +1,112 @@
 <template>
-    <GraphNodeDialog ref="graphNodeDialog" :title="'节点详情'" :graph-id="graphId" ></GraphNodeDialog>
-  <div>
-    <el-row>
-        <span class="view-title">图谱数据管理</span>
-      </el-row>
-    <el-row>
-        <el-tabs v-model="activeName" @tab-click="handleClick" style="width: 100%;">
-            <el-tab-pane label="基本信息" name="tab1">
-                <el-collapse accordion>
-                    <el-collapse-item  name="1">
-                        <template #title><span style="color:blue;">图谱数据概览</span></template>
-                        当前图谱共有 {{ graphSummary.nodes_count }} 个节点,{{ graphSummary.edges_count }} 条边<br>
-                        
-                    </el-collapse-item>
+    <GraphNodeDialog ref="graphNodeDialog" :title="'节点详情'" :graph-id="graphId"></GraphNodeDialog>
+    <div>
+        <el-row>
+            <span class="view-title">图谱数据管理</span>
+        </el-row>
+        <el-row>
+            <el-tabs v-model="activeName" @tab-click="handleClick" style="width: 100%;">
+                <el-tab-pane label="基本信息" name="tab1">
+                    <el-collapse accordion>
+                        <el-collapse-item name="1">
+                            <template #title><span style="color:blue;">图谱数据概览</span></template>
+                            当前图谱共有 {{ graphSummary.nodes_count }} 个节点,{{ graphSummary.edges_count }} 条边<br>
 
-                    <el-collapse-item  name="2">
-                        <template #title><span style="color:blue;">节点类型</span></template>
-                        节点类型包括:{{ graphSummary.nodes_categories.join(', ') }}<br></el-collapse-item>
-                        
-                    <el-collapse-item  name="3">
-                        <template #title><span style="color:blue;">边类型</span></template>
-                        边类型包括:{{ graphSummary.edges_categories.join(', ') }}<br></el-collapse-item>
-                </el-collapse>
-            </el-tab-pane>
-            <el-tab-pane label="节点搜索" name="tab2">                
-                <div style="display: flex; flex-direction: row;">
-                    <el-input style="width: 240px" v-model="formData.searchText" placeholder="请输入你要搜索的节点" />
-                    <el-button type="primary" @click="loadGraphNodes(formData.searchText)">节点搜索</el-button>
-                </div>
-                
-                <el-table :data="graphNodes"  height="650" style="width: 100%"  @current-change="handleCurrentChange">
-                <el-table-column prop="id" label="ID" width="180"></el-table-column>
-                <el-table-column prop="name" label="名称"></el-table-column>
-                <el-table-column prop="category" label="类型"></el-table-column>
+                        </el-collapse-item>
 
-                </el-table>
-            </el-tab-pane>
-            <el-tab-pane label="类型整合" name="tab3">
-                <GraphCategoryMgr :graph-id="graphId"></GraphCategoryMgr>
-            </el-tab-pane>
-            <el-tab-pane label="术语标注" name="tab4">术语标注</el-tab-pane>
-            <el-tab-pane label="语义检查" name="tab5"><el-menu>
-                <el-menu-item index="4-1">孤立节点</el-menu-item>
-                <el-menu-item index="4-2">矛盾关系</el-menu-item>
-                <el-menu-item index="4-2">循环关系</el-menu-item>
-                <el-menu-item index="4-2">冗余关系</el-menu-item>
-                <el-menu-item index="4-2">自动检查</el-menu-item>
-                </el-menu></el-tab-pane>
-        </el-tabs>
+                        <el-collapse-item name="2">
+                            <template #title><span style="color:blue;">节点类型</span></template>
+                            节点类型包括:{{ graphSummary.nodes_categories.join(', ') }}<br></el-collapse-item>
 
-    <el-col :span="18">
+                        <el-collapse-item name="3">
+                            <template #title><span style="color:blue;">边类型</span></template>
+                            边类型包括:{{ graphSummary.edges_categories.join(', ') }}<br></el-collapse-item>
+                    </el-collapse>
+                </el-tab-pane>
+                <el-tab-pane label="节点搜索" name="tab2">
+                    <div style="display: flex; flex-direction: row;">
+                        <el-input style="width: 240px" v-model="formData.searchText" placeholder="请输入你要搜索的节点" />
+                        <el-button type="primary" @click="loadGraphNodes(formData.searchText)">节点搜索</el-button>
+                    </div>
 
-    </el-col>
-    
-    <el-col :span="6">
-        <span style="margin-left: 20px;"> </span>
-    </el-col>
+                    <el-table :data="graphNodes" height="650" style="width: 100%" @current-change="handleCurrentChange">
+                        <el-table-column prop="id" label="ID" width="180"></el-table-column>
+                        <el-table-column prop="name" label="名称"></el-table-column>
+                        <el-table-column prop="category" label="类型"></el-table-column>
 
-    </el-row>
+                    </el-table>
+                </el-tab-pane>
+                <el-tab-pane label="类型整合" name="tab3">
+                    <GraphCategoryMgr :graph-id="graphId"></GraphCategoryMgr>
+                </el-tab-pane>
+                <el-tab-pane label="术语标注" name="tab4">术语标注</el-tab-pane>
+                <el-tab-pane label="语义检查" name="tab5"><el-menu>
+                        <el-menu-item index="4-1">孤立节点</el-menu-item>
+                        <el-menu-item index="4-2">矛盾关系</el-menu-item>
+                        <el-menu-item index="4-2">循环关系</el-menu-item>
+                        <el-menu-item index="4-2">冗余关系</el-menu-item>
+                        <el-menu-item index="4-2">自动检查</el-menu-item>
+                    </el-menu></el-tab-pane>
+            </el-tabs>
 
-  </div>
+            <el-col :span="18">
+
+            </el-col>
+
+            <el-col :span="6">
+                <span style="margin-left: 20px;"> </span>
+            </el-col>
+
+        </el-row>
+
+    </div>
 </template>
 
 <script setup lang="ts">
 import { ref, computed, onMounted } from 'vue'
-import {useRoute,useRouter} from 'vue-router'
+import { useRoute, useRouter } from 'vue-router'
 import { getSessionVar } from '@/utils/session'
 import { searchNodes, getGraphSummary } from '@/api/GraphApi'
 import { ElNotification } from 'element-plus'
-import  GraphNodeDialog  from '@/dialogs/GraphNodeDialog.vue'
+import GraphNodeDialog from '@/dialogs/GraphNodeDialog.vue'
 import GraphCategoryMgr from '@/components/GraphCategoryMgr.vue'
-const graphNodeDialog=ref()
+let activeName = ref("")
+const graphNodeDialog = ref()
 const formData = ref({
     searchText: '%',
 })
 const graphId = ref(0)
-const graphSummary = ref({nodes_count:0, edges_count:0, nodes_categories:[], edges_categories:[]})
-const currentNode = ref({id:0})
+const graphSummary = ref({ nodes_count: 0, edges_count: 0, nodes_categories: [], edges_categories: [] })
+const currentNode = ref({ id: 0 })
 const graphNodes = ref([])
 onMounted(() => {
     var route = useRoute()
-    graphId.value = Number(route.params.id as string  | "0" )
-    console.log("graphId", graphId.value)
+    graphId.value = Number(route.params.id as string | "0")
+    // console.log("graphId", graphId.value)
     loadGraphSummary()
     loadGraphNodes(formData.value.searchText)
 })
-const handleCurrentChange = (val:any) => {
+const handleCurrentChange = (val: any) => {
     if (val == null) return
-    console.log("handleCurrentChange", val)
+    // console.log("handleCurrentChange", val)
     graphNodeDialog.value.showDialog(true, val.id)
 }
 const loadGraphSummary = () => {
-    console.log("loadGraphSummary", graphId.value) 
-    getGraphSummary({graph_id: graphId.value}).then((res:any) => {
-        graphSummary.value = res.records[0]})
+    // console.log("loadGraphSummary", graphId.value) 
+    getGraphSummary({ graph_id: graphId.value }).then((res: any) => {
+        graphSummary.value = res.records[0]
+    })
 }
-const loadGraphNodes = (searchKey:string) => {
-    console.log("loadGraphNodes", searchKey, graphId.value)
+function handleClick() {
+
+}
+const loadGraphNodes = (searchKey: string) => {
+    // console.log("loadGraphNodes", searchKey, graphId.value)
     if (graphId.value == 0 || graphId.value == undefined) {
         ElNotification({
             title: 'Error',
             message: 'Graph ID is required',
-            type: 'error', 
+            type: 'error',
         })
     }
     if (searchKey == '') {
@@ -109,10 +114,10 @@ const loadGraphNodes = (searchKey:string) => {
             title: 'Error',
             message: 'Search key is required',
             type: 'error',
-        }) 
+        })
         return
     }
-    searchNodes(searchKey, graphId.value).then((res:any) => {
+    searchNodes(searchKey, graphId.value).then((res: any) => {
         graphNodes.value = res.records
     })
 }
@@ -122,10 +127,11 @@ const loadGraphNodes = (searchKey:string) => {
 .view-title {
     font-size: 24px;
     font-weight: bold;
-    margin-bottom: 30px; 
-    color:darkblue;
+    margin-bottom: 30px;
+    color: darkblue;
 }
+
 .graphMenu {
-    width:100%
+    width: 100%
 }
 </style>

+ 3 - 3
src/views/GraphStdSchemas.vue

@@ -68,7 +68,7 @@ const loadTableData = () => {
 }
 
 function handleStdSchemaUpdated() {
-    console.log("handleStdSchemaUpdated")
+    // console.log("handleStdSchemaUpdated")
 
 }
 function handleShowStdSchema(data: any) {
@@ -79,14 +79,14 @@ function handleShowStdSchema(data: any) {
 
 
 const handleIndexSchema = (data: any) => {
-    console.log(data)
+    // console.log(data)
     ElMessageBox.confirm('是否确定索引该标准?', '提示', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
         type: 'warning',
     }).then(() => {
         // 用户点击了确定按钮,执行相应的操作
-        console.log('用户点击了确定按钮');
+        // console.log('用户点击了确定按钮');
         reindexSchema({ schema_id: data.id }).then((res: any) => {
             var result = `总计${res.records[0]["entities_count"]}个实体,${res.records[0]["relations_count"]}个关系`
             ElNotification({

+ 9 - 3
src/views/GraphView.vue

@@ -12,14 +12,16 @@
     <el-row>
         <template v-for="(index) in pageData.records" :key="index">
             <el-card shadow="hover" style="width: 300px; margin: 10px;">
-                <div slot="header" style="border-bottom: 1px solid #EFEFEF; height: 50px;">
+                <div slot="header" style="border-bottom: 1px solid #EFEFEF; height: 50px; clear: both;">
                     <span>#{{ index.graph_id }}</span>
                     <el-button @click="handleViewGraph(index)" style="float: right; width:75px; padding: 3px 0"
                         type="">查看</el-button>
                 </div>
                 <div class="card-content">
-                    <div style="margin-top:15px;font-size:16px;">
+                    <div style="margin-top:15px;font-size:16px; clear: both;">
                         {{ index.name }}
+                        <el-button @click="handleApply(index)" type="primary"
+                            style="float: right; width:75px; padding: 3px 0;">应用</el-button>
                     </div>
                 </div>
             </el-card>
@@ -106,12 +108,16 @@ function handleCurrentPageChange(page: number) {
     pageData.value.page = page
     loadGraphs()
 }
+function handleApply(record: GraphData) {
+    // console.log("handleApply", record, record.name)
+    loadGraphs()
+}
 onMounted(() => {
     loadGraphs()
 })
 </script>
 
-<style lang="css" scoped>
+<style lang="less" scoped>
 .prop_header {
     font-weight: bold;
     margin-top: 10px;

+ 4 - 4
src/views/JobView.vue

@@ -202,9 +202,9 @@ function handleTreeNodeClick(data: any, node: any, event: any) {
 }
 function handleViewFile(job: JobData, path: string) {
     const url = '/api/file/view/' + job?.id + '?path=' + encodeURIComponent(path)
-    console.log(url)
+    // console.log(url)
     getFileContent(url).then((res) => {
-        console.log(res)
+        // console.log(res)
         textViewData.value = res.records[0].content
         textViewDialog.value.showDialog(true)
     })
@@ -213,7 +213,7 @@ function handleGoBack() {
     router.push({ name: 'queue', params: { id: 0 } })
 }
 function loadJobData() {
-    console.log(jobId.value)
+    // console.log(jobId.value)
     getJob(jobId.value).then((res) => {
         jobData.value = res.records[0] as JobData
 
@@ -265,7 +265,7 @@ function handleJobChangeCategory(category: string, name: string) {
 }
 onMounted(() => {
     var route = useRoute()
-    console.log(route.params)
+    // console.log(route.params)
     var id = Number.parseInt(route.params.id as string)
     jobId.value = id
     loadJobData()

+ 3 - 3
src/views/KMPlatform/Home/Home.vue

@@ -80,9 +80,9 @@ let modules = ref<any>(initModules())
 watch(routeList, (newValue) => {
   console.log("routeList", newValue)
   modules.value = intersectionBy(initModules(), newValue, 'path')
-  // enableModules.forEach((it)=>it.path=)
-  // modules.value.forEach((it: any) => it.path = "")
-  // assign(modules.value,enableModules)
+  if (modules.value.length === 0) {
+    modules.value = new Array(3).fill({ title: "暂无内容" })
+  }
 }, { immediate: true })
 // watchEffect(() => {
 //   if (getSessionVar('knowledageSystem') == '') {

+ 11 - 11
src/views/QueueView.vue

@@ -11,9 +11,9 @@
     </el-row>
 
     <el-row style="margin:15px;">
-        <el-form :model="searchForm" :inline="true" label-position="right" :size="'medium'">
+        <el-form :model="searchForm" :inline="true" label-position="right">
             <el-form-item label="任务名称" prop="job_name" :label-width="70" style="margin-left:0px;margin-right:0px;">
-                <el-input v-model="searchForm.job_name" placeholder="请输入任务名称" :maxlength="32" :size="30"></el-input>
+                <el-input v-model="searchForm.job_name" placeholder="请输入任务名称" :maxlength="32"></el-input>
             </el-form-item>
             <el-form-item label="任务类型" prop="start_category" :label-width="70"
                 style="margin-left:5px;margin-right:0px;">
@@ -242,7 +242,7 @@ watchEffect(() => {
     if (para == undefined) {
         return
     }
-    console.log('route changed')
+    // console.log('route changed')
     //queueId.value = para
     queueData.value.id = "0"
     // queueData.value.queue_category = "SYSTEM"
@@ -266,17 +266,17 @@ const handleCreateJob = (category: string, name: string, dialog_title: string) =
     if (queue_data == undefined) {
         return
     }
-    console.log("HHHH")
+    // console.log("HHHH")
     if (queue_data.dialog != undefined) {
         queue_data.dialog.showDialog()
     }
 }
 const handleViewFile = (job: any, path: string) => {
-    console.log("handleViewFile")
+    // console.log("handleViewFile")
     const url = '/api/file/view/' + job?.id + '?path=' + encodeURIComponent(path)
-    console.log(url)
+    // console.log(url)
     getFileContent(url).then((res) => {
-        console.log(res)
+        // console.log(res)
         textViewData.value = res.records[0].content
         textViewDialog.value.showDialog(true)
     })
@@ -325,7 +325,7 @@ function resetViewData() {
     pageData.value.page_size = 10
 }
 function loadJobs(reset: boolean) {
-    console.log("searchJobs")
+    // console.log("searchJobs")
     if (reset) {
         resetViewData()
     }
@@ -351,7 +351,7 @@ function loadQueueData() {
     }
 
     if (queue_data.dialog != null) {
-        console.log("queue_data.dialog is allowed")
+        // console.log("queue_data.dialog is allowed")
         allowCreateJob.value = true
     } else {
         allowCreateJob.value = false
@@ -364,7 +364,7 @@ function loadQueueData() {
         queueData.value.queue_category = res.records[0].queue_category
         queueData.value.queue_name = res.records[0].queue_name
         queueData.value.title = queue_data.title
-        console.log(queueData.value, ' queueData')
+        // console.log(queueData.value, ' queueData')
         handleCurrentPageChange(1)
     })
 
@@ -472,7 +472,7 @@ function handleCurrentPageChange(page: number) {
     // }
 }
 function handleJobMenuSelect(key: string, keyPath: string[]) {
-    console.log(key, keyPath)
+    // console.log(key, keyPath)
 }
 function handleViewJob(job: JobData) {
     if (job == null) {