allen 2 rokov pred
rodič
commit
24a2849f94

+ 2 - 2
src/api/graph/entity.js

@@ -470,7 +470,7 @@ function getRelationEnt(
 ) {
 	return request({
 		method: 'post',
-		url: `/show/graph`,
+		url: `/knowledge/statisticalMap/show/graph`,
 		data: {
 			entId: id,
 			degree,
@@ -580,7 +580,7 @@ function getRelationClsByEntCls(id) {
 function getRelationAttr(entId, relClsId, direction, isModel, current, size) {
 	return request({
 		method: 'get',
-		url: `/entcls/${direction}/${relClsId}/${entId}`,
+		url: `/knowledge/entityRelation/entcls/${direction}/${relClsId}/${entId}`,
 		params: {
 			entId,
 			relClsId,

+ 9 - 13
src/api/graph/relationClass.js

@@ -174,14 +174,10 @@ function addEntityRelation(data) {
   })
 } */
 //新的deleteEntityRelation函数
-function deleteEntityRelation(relID, isModel) {
+function deleteEntityRelation(relIds, isModel) {
 	return request({
-		method: 'post',
-		url: `/rel/del/${id}`,
-		params: {
-			id: relID,
-			isModel
-		}
+		method: 'delete',
+		url: `/knowledge/entityRelation/rel/del/${relIds}`
 	})
 }
 
@@ -218,7 +214,7 @@ function getAllRelationClass() {
 function addRelBatch(data) {
 	return request({
 		method: 'post',
-		url: `/rel/add/batch`,
+		url: `/knowledge/entityRelation/rel/add/batch`,
 		data: data
 	})
 }
@@ -251,8 +247,8 @@ function getRelclsUnpoint(relClsId, direction, entId, isModel, current, size) {
 		method: 'get',
 		url: `/relcls/${direction}/${relClsId}/unpoint/${entId}`,
 		params: {
-			current,
-			size,
+			pageNum: current,
+			pageSize: size,
 			isModel,
 			direction,
 			relClsId,
@@ -288,11 +284,11 @@ function getRelclsUnpoint(relClsId, direction, entId, isModel, current, size) {
 function getRelclsEnt(relClsId, direction, entId, isModel, entName, current, size) {
 	return request({
 		method: 'get',
-		url: `/relcls/${direction}/${relClsId}/ent/${entId}`,
+		url: `/knowledge/entity/relcls/${direction}/${relClsId}/ent/${entId}`,
 		params: {
 			entName,
-			current,
-			size,
+			pageNum: current,
+			pageSize: size,
 			isModel,
 			direction,
 			relClsId,

+ 25 - 24
src/views/knowledge/graphEntity/attrModelEditor.vue

@@ -84,9 +84,10 @@
 										<a-icon v-if="tab.direction !== 'START'"
 														type="right-square" />
 										<!-- <ellipsis :length="50"
-															tooltip>
+															tooltip> -->
+															
 											{{ tab.otherVName }}
-											<span slot="tooltipTitle"
+											<!-- <span slot="tooltipTitle"
 														v-if="tab.direction === 'START'">
 												{{ entityClass }}->{{ tab.relClsName }}->{{
                           tab.otherVName
@@ -97,8 +98,8 @@
 												{{ tab.otherVName }}->{{ tab.relClsName }}->{{
                           entityClass
                         }}
-											</span>
-										</ellipsis> -->
+											</span> -->
+										<!-- </ellipsis> -->
 									</p>
 								</div>
 							</a-collapse-panel>
@@ -114,9 +115,9 @@
 								<a-icon v-if="tab.direction !== 'START'"
 												type="right-square" />
 								<!-- <ellipsis :length="50"
-													tooltip>
+													tooltip> -->
 									{{ tab.relClsName }}
-									<span slot="tooltipTitle"
+									<!-- <span slot="tooltipTitle"
 												v-if="tab.direction === 'START'">
 										{{ entityClass }}->{{ tab.relClsName }}->{{
                       tab.otherVName
@@ -126,9 +127,9 @@
 												v-else>
 										{{ tab.otherVName }}->{{ tab.relClsName }}->{{
                       entityClass
-                    }}
-									</span>
-								</ellipsis> -->
+                    }} 
+									</span>-->
+								<!-- </ellipsis> -->
 							</p>
 						</div>
 					</a-collapse-panel>
@@ -183,7 +184,7 @@
 						</h3>
 						<div class="card_elem">
 							<a-row v-for="item in ELEMAttr"
-										 :key="item.attrClsId" :gutter="16">
+										 :key="item.attrClsID" :gutter="16">
 								<a-col :span="8">
 									<span v-if="item.notNull"
 												style="color: #f5222d">*</span>
@@ -208,7 +209,7 @@
 						</h3>
 						<div class="card_elem">
 							<a-row v-if="version=='bf'" v-for="item in CIDXAttr"
-										 :key="item.attrClsId" :gutter="16">
+										 :key="item.attrClsID" :gutter="16">
 								<a-col :span="8">
 									<span v-if="item.notNull"
 												style="color: #f5222d">*</span>
@@ -222,7 +223,7 @@
 								</a-col>
 							</a-row>
 							<a-row v-else v-for="item in CIDXAttr"
-										 :key="item.attrClsId" :gutter="16">
+										 :key="item.attrClsID" :gutter="16">
 								<a-col :span="8">
 									<span v-if="item.notNull"
 												style="color: #f5222d">*</span>
@@ -245,7 +246,7 @@
 						</h3>
 						<div class="card_elem">
 							<a-row v-for="mime in MIMEAttr"
-										 :key="mime.attrClsId">
+										 :key="mime.attrClsID">
 								<a-col :span="10"> {{ mime.attrClsName }}: </a-col>
 								<a-col :span="14">
 									<p v-if="mime.attrID">
@@ -317,7 +318,7 @@
 												:entId="entId"
 												:clsId="clsId"
 												:otherVID="tab.otherVID"
-												:relClsId="tab.relClsId"
+												:relClsId="tab.relClsID"
 												:direction="tab.direction"
 												:isModel="isModel"></attr-table>
 						<a-button type="primary"
@@ -756,7 +757,7 @@
 					"uploadMIMEFileModal",
 					{
 						entId: this.entId,
-						attrClsId: mime.attrClsId,
+						attrClsID: mime.attrClsID,
 					},
 					function (data) {
 						if (data) {
@@ -791,7 +792,7 @@
 				// };
 				// this.CIDXAttr.forEach((item) => {
 				// 	if (item.attrValue_z) {
-				// 		content["list[" + count + "].attrClsId"] = item.attrClsId;
+				// 		content["list[" + count + "].attrClsId"] = item.attrClsID;
 				// 		content["list[" + count + "].attrId"] = item.attrID;
 				// 		content["list[" + count + "].attrValue"] = item.attrValue_z;
 				// 		content["list[" + count + "].entAndAttrType"] = "CIDX";
@@ -800,7 +801,7 @@
 				// });
 				// this.ELEMAttr.forEach((item) => {
 				// 	if (item.attrValue_z) {
-				// 		content["list[" + count + "].attrClsId"] = item.attrClsId;
+				// 		content["list[" + count + "].attrClsId"] = item.attrClsID;
 				// 		content["list[" + count + "].attrId"] = item.attrID;
 				// 		content["list[" + count + "].attrValue"] = item.attrValue_z;
 				// 		content["list[" + count + "].entAndAttrType"] = "ELEM";
@@ -814,7 +815,7 @@
 							attrID: item.attrID,
 							attrValue: item.attrValue_z,
 							entId: this.entId,
-							attrClsId: item.attrClsId,
+							attrClsId: item.attrClsID,
 							entAndAttrType: "CIDX"
 						}
 						attrs.push(attr)
@@ -826,7 +827,7 @@
 							attrID: item.attrID,
 							attrValue: item.attrValue_z,
 							entId: this.entId,
-							attrClsId: item.attrClsId,
+							attrClsId: item.attrClsID,
 							entAndAttrType: "ELEM"
 						}
 						attrs.push(attr)
@@ -866,8 +867,8 @@
 							resp.data.entListVO,
 							resp.data.relListVO
 						);
-						this.nodes = data.entListVO;
-						this.links = data.relListVO;
+						this.nodes = resp.data.entListVO;
+						this.links = resp.data.relListVO;
 						this.entityClassList = resp.data.entClsListVO;
 						this.linkClassList = resp.data.relClsListVO;
 					});
@@ -1012,7 +1013,7 @@
                                     let attrFilters = []
                                     arr.forEach((v,i) => {
                                         let innerItem = {
-                                            attrClsId: v.attrClsId,
+                                            attrClsID: v.attrClsID,
                                             attrValue: v.attrValue,
                                             conditionType: v.conditionType,
                                             operatorType: v.operatorType,
@@ -1080,8 +1081,8 @@
 			// 运行测试按钮
 			handlerRunFlow(data) {
 				const vm = this
-				let attrClsId = data.attrClsId
-				runFlow(this.entId, attrClsId, this.isModel).then((data) => {
+				let attrClsID = data.attrClsID
+				runFlow(this.entId, attrClsID, this.isModel).then((data) => {
 					vm.$message.success('计算流程启动成功');
 					this.getCIDXAttr(); // 获取能力属性
 				})

+ 21 - 15
src/views/knowledge/graphEntity/relationClsAttrEditor.vue

@@ -94,7 +94,7 @@
               })
             }
           })
-          res.records.forEach(item => {
+          res.data.forEach(item => {
             item.key = item.entID
             // 新建的关系类没有属性,给一个空的属性列表,方便后面操作
             item.attrList ? item.attrList.forEach(attr => {
@@ -102,7 +102,7 @@
               item[attr.attrClsId + '_name'] = attrClsNameList[attr.attrClsId]
             }) : item.attrList = []
           })
-          vm.data = res.records
+          vm.data = res.data
           vm.loading = false
         })
       },
@@ -140,20 +140,25 @@
       },
       // 新增关系类实体
       addRelEnt(data) {
-        const entityContent = {
-          isModel: this.isModel,
-          relClsId: this.relClsId,
-          'list[0].startEntId': '',
-          'list[0].endEntId': '',
-        }
+        let entityRelations = []
+        let startEntId;
+        let endEntId;
         if (this.direction === 'START') {
-          entityContent['list[0].startEntId'] = this.entId
-          entityContent['list[0].endEntId'] = data
+          startEntId = this.entId
+          endEntId = data
+          
         } else {
-          entityContent['list[0].startEntId'] = data
-          entityContent['list[0].endEntId'] = this.entId
+          startEntId = data
+          endEntId = this.entId
+        }
+        let entityRelation = {
+          startEntId,
+          endEntId,
+          isModel: this.isModel,
+          relClsId: this.relClsId
         }
-        addRelBatch(entityContent).then(res => {
+        entityRelations.push(entityRelation)
+        addRelBatch(entityRelations).then(res => {
           if (res) {
             this.getAttr()
           }
@@ -222,7 +227,7 @@
         this.selectRows.forEach(row => {
           ids.push(row.relId)
         })
-        deleteEntityRelation(ids.join(','), this.isModel).then(res => {
+        deleteEntityRelation(ids, this.isModel).then(res => {
           if (res) {
             this.$notification["success"]({
               message: "删除成功"
@@ -233,7 +238,8 @@
       },
       // 表格删除
       del(record) {
-        deleteEntityRelation(record.relId, this.isModel).then(res => {
+        const relIds = [record.relId]
+        deleteEntityRelation(relIds, this.isModel).then(res => {
           if (res) {
             this.$notification["success"]({
               message: "删除成功"

+ 2 - 1
src/views/knowledge/graphEntity/relationEditor.vue

@@ -165,7 +165,8 @@
       deleteRelation (relation) {
         const relID = relation.relID
         const vm = this
-        deleteEntityRelation(relID).then((result) => {
+        const relIds = [relID]
+        deleteEntityRelation(relIds).then((result) => {
           if (result !== false) {
             vm.$message.success('删除关系类删除成功')
             vm.getEntityAttr(this.entityId, this.entType)

+ 142 - 0
src/views/knowledge/modal/addRelBatchModal.vue

@@ -0,0 +1,142 @@
+<template>
+    <a-modal title="新增实体"
+             :visible="show"
+             :maskClosable="false"
+             :width="800"
+             @ok="handleOk"
+             @cancel="handleClose">
+        <a-input-search v-model="searchValue" size="small" placeholder="请输入名称" enter-button
+                        @keyup.enter="search" @search="search" style="margin-bottom: 10px"/>
+        <a-table
+                :dataSource="data"
+                :columns="columns"
+                :pagination="pagination"
+                :rowSelection="{
+                    selectedRowKeys: checkedList,
+                    onChange: onSelectChange
+                  }"
+                @change="onChangePagination"
+                :rowKey="(record) => record.entId"
+                :loading="loading">
+        </a-table>
+    </a-modal>
+</template>
+
+<script>
+  import { getRelclsEnt, addRelBatch } from '@/api/graph/relationClass'
+  export default {
+    name: 'addRelBatchModal',
+    components: {},
+    props: ['relClsId', 'direction', 'isModel', 'entId'],
+    data() {
+      return {
+        searchValue: '',
+        show: true,
+        loading: false,
+        data: [],
+        columns: [
+          {
+            title: "实体ID",
+            dataIndex: "entId",
+          },
+          {
+            title: "实体名称",
+            dataIndex: "entName",
+          },
+        ],
+        pagination: {
+          current: 1,
+          total: 0,
+          pageSize: 9
+        },
+        checkedList: [],
+      }
+    },
+    mounted() {
+      this.getEntityList()
+    },
+    methods: {
+      // 获取实体列表
+      getEntityList(value) {
+        // relClsId, direction, isModel, current, size
+        getRelclsEnt(this.relClsId, this.direction, this.entId, this.isModel, value, this.pagination.current, this.pagination.pageSize).then(res => {
+          this.columns = [
+            {
+              title: "实体ID",
+              dataIndex: "entId",
+            },
+            {
+              title: "实体名称",
+              dataIndex: "entName",
+            },
+          ]
+          res.headers.forEach(header => {
+            this.columns.push({
+              title: header.attrClsName,
+              dataIndex: header.attrClsID,
+            })
+          })
+          res.data.forEach(item => {
+            for (let i = 0; i < item.notNullAttrVOList.length; i++) {
+              item[item.notNullAttrVOList[i].attrClsID] = item.notNullAttrVOList[i].attrValue
+            }
+          })
+          this.pagination.total = res.total
+          this.data = res.data
+        })
+      },
+      search() {
+        this.pagination = {
+          pageSize: 9,
+          current: 1
+        }
+        this.getEntityList(this.searchValue)
+      },
+      handleOk() {
+        const vm = this
+        let entityRelations = []
+        this.checkedList.forEach((item, index) => {
+          let startEntId;
+          let endEntId;
+          if (vm.direction === 'START') {
+            startEntId = vm.entId
+            endEntId = item
+            
+          } else {
+            startEntId = item
+            endEntId = vm.entId
+          }
+          let entityRelation = {
+            startEntId,
+            endEntId,
+            isModel: this.isModel,
+            relClsId: this.relClsId
+          }
+          entityRelations.push(entityRelation)
+        })
+        addRelBatch(entityRelations).then(res => {
+          if (res) {
+            this.$notification["success"]({
+              message: "新增成功"
+            });
+            this.$close(res)
+          }
+        })
+      },
+      handleClose() {
+        this.$close(false)
+      },
+      onChangePagination(current) {
+        this.pagination = current
+        this.getEntityList()
+      },
+      onSelectChange(selectedRowKeys) {
+        this.checkedList = selectedRowKeys
+      },
+    }
+  }
+</script>
+
+<style scoped>
+
+</style>

+ 2 - 2
src/views/knowledge/modal/index.js

@@ -57,7 +57,7 @@ import cropperImgModal from './cropperImgModal'
 // import viewRelClsRetisterDoneModalV3 from '@/views/modal/viewRelClsRetisterDoneModalV3'
 // import setIsGraphMainModal from '@/views/modal/setIsGraphMainModal'
 // import addTemplateEntityModal from '@/views/modal/addTemplateEntityModal'
-// import addRelBatchModal from '@/views/modal/addRelBatchModal' // 模板实体详情,关系类属性新增实体,弹出框
+import addRelBatchModal from './addRelBatchModal' // 模板实体详情,关系类属性新增实体,弹出框
 // import editTemplateRelAttrbatchModal from '@/views/modal/editTemplateRelAttrbatchModal' // 模板实体详情,关系类属性编辑实体,弹出框
 import getRelationClsListModal from './getRelationClsListModal' // 关系类-关系属性-点击添加-选择一个关系类属性
 // import editSynonymModal from '@/views/modal/editSynonymModal' // 自定义-同义词-编辑同义词组
@@ -90,7 +90,7 @@ export default {
 	// editSynonymModal,
 	getRelationClsListModal,
 	// editTemplateRelAttrbatchModal,
-	// addRelBatchModal,
+	addRelBatchModal,
 	// addTemplateEntityModal,
 	// setIsGraphMainModal,
 	// entClsAttrAlignModal,