소스 검색

构建实体类及实体类关系

twzydn20000928 2 년 전
부모
커밋
18561a3721

+ 1 - 0
package.json

@@ -39,6 +39,7 @@
     "@riophae/vue-treeselect": "0.4.0",
     "@tiptap/core": "^2.0.2",
     "@tiptap/extension-highlight": "^2.0.0-beta.218",
+    "@tiptap/pm": "^2.0.3",
     "@tiptap/starter-kit": "^2.0.2",
     "@tiptap/vue-2": "^2.0.0-beta.218",
     "@wangeditor/editor": "^5.1.23",

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

@@ -63,4 +63,20 @@ export function getResultJson(id) {
     url: '/extract/result/getResult/' + id,
     method: 'get'
   })
+}
+
+export function getClassRelationList(id) {
+  return request({
+    url: '/suport/relation/getClassRelationList/' + id,
+    method: 'get'
+  })
+}
+
+// 构建实体关系
+export function bu1ildEntityRelation(data) {
+  return request({
+    url: '/suport/relation/bu1ildEntityRelation',
+    method: 'post',
+    data: data
+  })
 }

+ 52 - 0
src/api/neo4j/class.js

@@ -0,0 +1,52 @@
+import request from '@/utils/request'
+
+// 查询实体类列表
+export function listClass(query) {
+  return request({
+    url: '/neo4j/class/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询实体类详细
+export function getClass(id) {
+  return request({
+    url: '/neo4j/class/' + id,
+    method: 'get'
+  })
+}
+
+// 新增实体类
+export function addClass(data) {
+  return request({
+    url: '/neo4j/class',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改实体类
+export function updateClass(data) {
+  return request({
+    url: '/neo4j/class',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除实体类
+export function delClass(id) {
+  return request({
+    url: '/neo4j/class/' + id,
+    method: 'delete'
+  })
+}
+
+// 查询实体类管理列表
+export function getEntityClassOption() {
+  return request({
+    url: '/neo4j/class/getOption',
+    method: 'get',
+  })
+}

+ 44 - 0
src/api/neo4j/class_relation.js

@@ -0,0 +1,44 @@
+import request from '@/utils/request'
+
+// 查询实体类关系列表
+export function listClass_relation(query) {
+  return request({
+    url: '/neo4j/class_relation/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询实体类关系详细
+export function getClass_relation(id) {
+  return request({
+    url: '/neo4j/class_relation/' + id,
+    method: 'get'
+  })
+}
+
+// 新增实体类关系
+export function addClass_relation(data) {
+  return request({
+    url: '/neo4j/class_relation',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改实体类关系
+export function updateClass_relation(data) {
+  return request({
+    url: '/neo4j/class_relation',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除实体类关系
+export function delClass_relation(id) {
+  return request({
+    url: '/neo4j/class_relation/' + id,
+    method: 'delete'
+  })
+}

+ 96 - 0
src/views/extract/info/classCreateV.vue

@@ -0,0 +1,96 @@
+<template>
+  <div :loading="loading">
+    <el-row v-show="!readonly">
+      <span style="float: right;">
+        <el-col :span="1.5">
+          <el-button type="primary" plain icon="el-icon-check" size="mini" @click="handleApprove()"  :loading="loading">提交</el-button>
+        </el-col>
+      </span>
+    </el-row>
+    <el-row>
+      <el-col :span="24">
+        <el-card style="margin:10px">
+          <el-table :data="entityClassRelationList" style="width: 100%">
+            <el-table-column prop="subName" label="主体类" width="180" />
+            <el-table-column prop="objName" label="客体类" width="180" />
+            <el-table-column prop="name" label="关系" />
+            <el-table-column prop="" label="主体" width="180" >
+              <template slot-scope="scope"> <el-input v-model="scope.row.subEntity" :disabled="readonly"></el-input> </template>
+            </el-table-column>
+            <el-table-column prop="" label="客体" width="180" >
+              <template slot-scope="scope"> <el-input v-model="scope.row.objEntity" :disabled="readonly"></el-input> </template>
+            </el-table-column>
+          </el-table>
+        </el-card>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+  
+<script>
+import { getClassRelationList,bu1ildEntityRelation } from "@/api/extract/result";
+
+export default {
+  name: "ClassCreateResult",
+  props:{
+    subTask: {
+      type: Object,
+    },
+    readonly: {
+      type: Boolean,
+    },
+  },
+
+  data() {
+    return {
+      loading: false,
+      entityClassRelationList:[],
+    };
+  },
+  created() {
+    this.getResult()
+  },
+
+  computed: {
+  },
+
+  mounted() {
+  },
+  methods: {
+    getResult(){
+      this.loading = true
+      getClassRelationList(this.subTask.id).then(response => {
+        this.entityClassRelationList = response.data
+        this.loading = false
+      });
+    },
+
+    handleApprove() {
+      this.loading = true
+      let entityClassRelationListDummy=[]
+      let that = this
+      this.entityClassRelationList.forEach(function(e){
+        if(e.subEntity&&e.objEntity) {
+          e.subTaskId=that.subTask.id
+          entityClassRelationListDummy.push(e)
+        }
+      });
+      bu1ildEntityRelation(entityClassRelationListDummy).then(resp => {
+        let message ='提交成功'
+        this.$message({
+          message,
+          type: 'success'
+        });
+        this.loading = false
+        this.$emit("closeInfo")
+      })
+      .catch(() => {});
+    },
+
+    handleDelete(index) {
+      this.entityClassRelationList.splice(index, 1);
+    },
+  },
+
+};
+</script>

+ 42 - 6
src/views/extract/subTask/index.vue

@@ -4,7 +4,7 @@
       <el-header>
         <el-steps :active="parseInt(task.status)" simple direction finish-status="wait" process-status="finish">
           <el-step title="知识加工" icon="el-icon-cpu"></el-step>
-          <el-step title="人工审核" icon="el-icon-s-custom"></el-step>
+          <el-step title="人工审核" icon="el-icon-s -custom"></el-step>
           <el-step title="数据入库" icon="el-icon-document-checked"></el-step>
         </el-steps>
       </el-header>
@@ -27,7 +27,7 @@
           <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
             <template slot-scope="scope">
               <el-button
-                v-show="scope.row.status >= 1"
+                v-show="scope.row.type == 1 && scope.row.status >= 1"
                 size="mini"
                 type="text"
                 icon="el-icon-warning-outline"
@@ -43,7 +43,15 @@
                 v-hasPermi="['extract:subTask:edit']"
               >审核</el-button>
               <el-button
-                v-show="scope.row.status == 3"
+                v-show="scope.row.type == 2 && scope.row.status == 0"
+                size="mini"
+                type="text"
+                icon="el-icon-warning-outline"
+                @click="createClass(scope.row)"
+                v-hasPermi="['extract:subTask:edit']"
+              >构建</el-button>
+              <el-button
+                v-show="scope.row.type == 1 && scope.row.status == 3"
                 size="mini"
                 type="text"
                 icon="el-icon-warning-outline"
@@ -51,13 +59,21 @@
                 v-hasPermi="['extract:subTask:edit']"
               >查看抽取结果</el-button>
               <el-button
-                v-show="scope.row.status == 4"
+                v-show="scope.row.type == 1 && scope.row.status == 4"
                 size="mini"
                 type="text"
                 icon="el-icon-finished"
                 @click="handleViewLog(scope.row)"
                 v-hasPermi="['extract:subTask:edit']"
               >查看日志</el-button>
+              <el-button
+                v-show="scope.row.type == 2 && scope.row.status == 3"
+                size="mini"
+                type="text"
+                icon="el-icon-warning-outline"
+                @click="viewResult2(scope.row)"
+                v-hasPermi="['extract:subTask:edit']"
+              >查看构建结果</el-button>
             </template>
           </el-table-column>
         </el-table>
@@ -119,6 +135,10 @@
       <!-- <TripletInfo :subTask="subTask" :subTaskOpen.sync="tripletInfoOpen" @closeInfo="closeInfo"></TripletInfo> -->
       <IndexV2 :subTask="subTask" @closeInfo="closeInfo" :readonly="tripletInfoReadOnly"/>
     </el-dialog>
+    <el-dialog :title="createInfoOpenTitle" v-if="createInfoOpen" :visible.sync="createInfoOpen" width="80%" append-to-body destroy-on-close :close-on-click-modal="false">
+      <!-- <CreateInfo :subTask="subTask" :subTaskOpen.sync="createInfoOpen" @closeInfo="closeInfo"></CreateInfo> -->
+      <classCreateV :subTask="subTask" @closeInfo="closeInfo" :readonly="createInfoReadOnly"/>
+    </el-dialog>
     <el-dialog title="分句结果" v-if="viewSentenceOpen" :visible.sync="viewSentenceOpen" width="80%" append-to-body destroy-on-close :close-on-click-modal="false">
       <p v-for="sentence in sentenceList" :key="sentence.id">
          {{ sentence.id }}. {{ sentence.text }}
@@ -132,10 +152,11 @@ import { listSubTask, getSubTask, delSubTask, addSubTask, updateSubTask } from "
 import { getSentence } from "@/api/extract/result";
 import TripletInfo from '@/views/extract/info';
 import IndexV2 from '@/views/extract/info/indexV2';
+import classCreateV from '@/views/extract/info/classCreateV';
 export default {
   name: "SubTask",
   dicts: ['extract_sub_task_status', 'extract_sub_task_list'],
-  components: { TripletInfo,IndexV2 },
+  components: { TripletInfo,IndexV2,classCreateV },
   props: { 
     task: {
       type: Object,
@@ -183,10 +204,13 @@ export default {
       },
       tripletInfoOpenTitle: "",
       tripletInfoOpen: false,
+      createInfoOpenTitle: "",
+      createInfoOpen: false,
       subTask: {},
       viewSentenceOpen: false,
       sentenceList: [],
       tripletInfoReadOnly: false,
+      createInfoReadOnly: false,
     };
   },
   created() {
@@ -306,12 +330,19 @@ export default {
       this.tripletInfoOpenTitle = this.dict.label.extract_sub_task_list[row.type]
       this.subTask = row
     },
+    createClass(row){
+      this.createInfoReadOnly = false
+      this.createInfoOpen = true
+      this.createtInfoOpenTitle = this.dict.label.extract_sub_task_list[row.type]
+      this.subTask = row
+    },
     handleViewLog(row){
       this.$alert(row.log, '日志', {
         confirmButtonText: '确定',
       });
     },
     closeInfo(){
+      this.createInfoOpen = false
       this.tripletInfoOpen = false
       this.tripletInfoOpenTitle = ''
       this.subTask = {}
@@ -324,11 +355,16 @@ export default {
       })
     },
     viewResult(row){
-      debugger
       this.tripletInfoReadOnly = true
       this.tripletInfoOpen = true
       this.tripletInfoOpenTitle = this.dict.label.extract_sub_task_list[row.type]
       this.subTask = row
+    },
+    viewResult2(row){
+      this.createInfoReadOnly = true
+      this.createInfoOpen = true
+      this.createtInfoOpenTitle = this.dict.label.extract_sub_task_list[row.type]
+      this.subTask = row
     }
   }
 };

+ 264 - 0
src/views/neo4j/class/index.vue

@@ -0,0 +1,264 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="实体类名称" prop="name">
+        <el-input
+          v-model="queryParams.name"
+          placeholder="请输入实体类名称"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['neo4j:class:add']"
+        >新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['neo4j:class:edit']"
+        >修改</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['neo4j:class:remove']"
+        >删除</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport"
+          v-hasPermi="['neo4j:class:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="classList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="实体类ID" align="center" prop="id" />
+      <el-table-column label="实体类名称" align="center" prop="name" />
+      <el-table-column label="实体类描述" align="center" prop="desc" />
+      <el-table-column label="实体类背景颜色" align="center" prop="backGroundColor">
+        <template slot-scope="scope">
+          <el-color-picker v-model="scope.row.backGroundColor" size="mini" disabled></el-color-picker>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['neo4j:class:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['neo4j:class:remove']"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改实体类对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="实体类名称" prop="name">
+          <el-input v-model="form.name" placeholder="请输入实体类名称" />
+        </el-form-item>
+        <el-form-item label="实体类描述" prop="desc">
+          <el-input v-model="form.desc" type="textarea" placeholder="请输入内容" />
+        </el-form-item>
+        <el-form-item label="实体类背景颜色" prop="backGroundColor">
+          <el-color-picker v-model="form.backGroundColor"></el-color-picker>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listClass, getClass, delClass, addClass, updateClass } from "@/api/neo4j/class";
+
+export default {
+  name: "Class",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 实体类表格数据
+      classList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        name: null,
+        desc: null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询实体类列表 */
+    getList() {
+      this.loading = true;
+      listClass(this.queryParams).then(response => {
+        this.classList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        name: null,
+        desc: null,
+        backGroundColor: '#FFFFFF',
+        createBy: null,
+        createTime: null,
+        updateBy: null,
+        updateTime: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加实体类";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getClass(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改实体类";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateClass(this.form).then(response => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addClass(this.form).then(response => {
+              this.$modal.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$modal.confirm('是否确认删除实体类编号为"' + ids + '"的数据项?').then(function() {
+        return delClass(ids);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download('neo4j/class/export', {
+        ...this.queryParams
+      }, `class_${new Date().getTime()}.xlsx`)
+    }
+  }
+};
+</script>

+ 316 - 0
src/views/neo4j/class_relation/index.vue

@@ -0,0 +1,316 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="实体类关系名称" prop="name">
+        <el-input
+          v-model="queryParams.name"
+          placeholder="请输入实体类关系名称"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="起点实体类" prop="startId">
+        <el-input
+          v-model="queryParams.startId"
+          placeholder="请输入起点实体类"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="终点实体类" prop="endId">
+        <el-input
+          v-model="queryParams.endId"
+          placeholder="请输入终点实体类"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['neo4j:class_relation:add']"
+        >新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['neo4j:class_relation:edit']"
+        >修改</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['neo4j:class_relation:remove']"
+        >删除</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport"
+          v-hasPermi="['neo4j:class_relation:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="class_relationList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="实体类关系名称" align="center" prop="name" />
+      <el-table-column label="实体类关系描述" align="center" prop="desc" />
+      <el-table-column label="实体类背景颜色" align="center" prop="backGroundColor" >
+        <template slot-scope="scope">
+          <el-color-picker v-model="scope.row.backGroundColor" size="mini" disabled></el-color-picker>
+        </template>
+      </el-table-column>
+      <el-table-column label="起点实体类" align="center" prop="startName" />
+      <el-table-column label="终点实体类" align="center" prop="endName" />
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['neo4j:class_relation:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['neo4j:class_relation:remove']"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改实体类关系对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="实体类关系名称" prop="name">
+          <el-input v-model="form.name" placeholder="请输入实体类名称" />
+        </el-form-item>
+        <el-form-item label="实体类关系描述" prop="desc">
+          <el-input v-model="form.desc" type="textarea" placeholder="请输入内容" />
+        </el-form-item>
+        <el-form-item label="实体类关系背景颜色" prop="backGroundColor">
+          <el-color-picker v-model="form.backGroundColor"></el-color-picker>
+        </el-form-item>
+        <el-form-item label="起点实体类" prop="startId">
+          <el-select v-model="form.startId" placeholder="请选择起点实体类" value-key="id" filterable >
+            <el-option
+              v-for="item in entityClassList"
+              :key="item.id"
+              :label="item.name"
+              :value="item.id">
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="终点实体类" prop="endId">
+          <el-select v-model="form.endId" placeholder="请选择终点实体类" value-key="id" filterable >
+            <el-option
+              v-for="item in entityClassList"
+              :key="item.id"
+              :label="item.name"
+              :value="item.id">
+            </el-option>
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listClass_relation, getClass_relation, delClass_relation, addClass_relation, updateClass_relation } from "@/api/neo4j/class_relation";
+import { getEntityClassOption  } from "@/api/neo4j/class";
+export default {
+  name: "Class_relation",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 实体类关系表格数据
+      class_relationList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        name: null,
+        desc: null,
+        startId: null,
+        endId: null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      },
+      entityClassList: []
+    };
+  },
+  created() {
+    this.getList();
+    this.getEntityClassOption();
+  },
+  activated(){
+    this. tEntityClassOption();
+  },
+  methods: {
+    /** 查询实体类关系列表 */
+    getList() {
+      this.loading = true;
+      listClass_relation(this.queryParams).then(response => {
+        this.class_relationList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        name: null,
+        desc: null,
+        backGroundColor: '#FFFFFF',
+        startId: null,
+        endId: null,
+        createBy: null,
+        createTime: null,
+        updateBy: null,
+        updateTime: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加实体类关系";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getClass_relation(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改实体类关系";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateClass_relation(this.form).then(response => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addClass_relation(this.form).then(response => {
+              this.$modal.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$modal.confirm('是否确认删除实体类关系编号为"' + ids + '"的数据项?').then(function() {
+        return delClass_relation(ids);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download('neo4j/class_relation/export', {
+        ...this.queryParams
+      }, `class_relation_${new Date().getTime()}.xlsx`)
+    },
+    getEntityClassOption(){
+      getEntityClassOption().then(resp => {
+        this.entityClassList = resp.data
+        console.info(resp)
+      })
+    }
+  }
+};
+</script>