Browse Source

修改加入auth后的连续跳转问题以及新需求

chenbaoxin 4 months ago
parent
commit
377ab365a7

+ 26 - 0
src/components/FrontPage/GeneralForm.vue

@@ -90,6 +90,14 @@
                 @click="deleteAll"
                 >批量删除</el-button
               >
+              <el-button
+                v-no-more-click
+                v-if="addName === '新增词汇'"
+                size="small"
+                @click="chExport"
+                class="search-butt"
+                >批量导出</el-button
+              >
               <el-button
                 v-no-more-click
                 v-if="addName === '新增三元组'"
@@ -178,6 +186,7 @@
                 :sortable="
                   addName == '新增词汇' ||
                   addName == '新增文本' ||
+                  addName == '附件新增' ||
                   addName == '新增三元组'
                     ? 'custom'
                     : false
@@ -443,6 +452,22 @@ export default {
     this.getTree();
   },
   methods: {
+    chExport(){
+      this.postPdfName(
+        "/file/downloadVocabulary",
+        { name: this.ExportNanme === undefined ? "" : this.ExportNanme },
+        "POST"
+      ).then((res) => {
+        let blob = new Blob([res.data]);
+        const elink = document.createElement("a");
+        elink.download = "词汇导出.xlsx";
+        elink.style.display = "none";
+        elink.href = URL.createObjectURL(blob);
+        document.body.appendChild(elink);
+        elink.click();
+        // document.body.removeChild("a"); // 下载完成移除元素
+      });
+    },
     closeDialog(){
       this.rowData={}
       // this.popupShow=false
@@ -520,6 +545,7 @@ export default {
       };
       this.pageHelper.ordercol = prop;
       this.pageHelper.order = order_new[column.order];
+      debugger
       this.VocabularyList(this.title);
     },
     //控制文档修改页面的显示隐藏

+ 88 - 21
src/components/FrontPage/GeneralPopup.vue

@@ -3,6 +3,7 @@
   <div class="">
     <el-dialog
       :title="Title"
+      append-to-body
       :visible.sync="centerDialogVisible"
       :close-on-click-modal="false"
       center
@@ -157,7 +158,7 @@
               align="center"
               :label="Title.indexOf('词汇') === -1 ? '主' : '本体'"
               min-width="150"
-              v-if="Title !== '修改附件'"
+              v-if="Title !== '修改附件'&&Title.indexOf('词汇') == -1"
             >
               <template slot-scope="scope">
                 <el-form-item prop="subject" align="center">
@@ -222,7 +223,7 @@
               align="center"
               :label="Title.indexOf('词汇') === -1 ? '谓' : '关系'"
               min-width="150"
-              v-if="Title != '修改附件'"
+              v-if="Title != '修改附件'&&Title.indexOf('词汇') == -1"
             >
               <template slot-scope="scope">
                 <el-form-item prop="predicate">
@@ -483,6 +484,40 @@
                 </el-form-item>
               </template>
             </el-table-column>
+            <el-table-column
+              align="center"
+              label="词汇类型"
+              min-width="150"
+              v-if="Title.indexOf('词汇') != -1"
+            >
+              <template slot-scope="scope">
+                <el-form-item prop="guanxi">
+                  <el-select
+                    v-model="scope.row.guanxi"
+                    placeholder="请选择"
+                    filterable
+                  >
+                    <el-option
+                      style="max-width: 259px"
+                      v-for="item in dropDown.guanxi"
+                      :key="item.value === undefined ? item.id : item.value"
+                      :label="item.label === undefined ? item.name : item.label"
+                      :value="item.value === undefined ? item.name : item.value"
+                    >
+              
+                    </el-option>
+                  </el-select>
+               
+                </el-form-item>
+                <div
+                  v-show="guanxiIf"
+                  class="judgeCla"
+                  style="margin-left: 43px"
+                >
+                  请选择关系
+                </div>
+              </template>
+            </el-table-column>
           </el-table>
           <div
             class="judge"
@@ -665,6 +700,7 @@ export default {
     return {
       rules: {
         name: [{ required: true, message: "请输入名称", trigger: "blur" }],
+        guanxi: [{ required: true, message: "请选择关系", trigger: "blur" }],
       },
       tableData: [],
       requestTypeMap:{
@@ -721,6 +757,13 @@ export default {
         subject: [],
         predicate: [],
         object: [],
+        guanxi:[{
+          label:'关系',
+          value:'relationSts'
+        },{
+          label:'本体',
+          value:'ontologySts'
+        }]
       },
       formLabelAlignid: [],
       ruleFormAll: {
@@ -761,11 +804,19 @@ export default {
      * centerDialogVisible: 改变父组件弹窗值
      */
     promptTitle(newVal) {
+
+      console.log(newVal,'============');
       if (newVal.indexOf("新增" !== -1)) {
-        this.joinse = "请选择分类";
+        try {
+          
+          this.joinse = "请选择分类";
+        } catch (error) {
+          console.log(error);
+        }
       }
       if (newVal === "删除三元组") return;
       this.Title = newVal;
+
       newVal.indexOf("新增") !== -1 || newVal.indexOf("修改") !== -1
         ? newVal === "新增文件"
           ? (this.widthSet = "45%")
@@ -811,19 +862,27 @@ export default {
           }
         }
         if (this.Title === "新增词汇") {
-          data[0].subject = "1";
-          data[0].predicate = "0";
+          // data[0].subject = "1";
+          // data[0].predicate = "0";
+          data[0].guanxi='relationSts'
           console.log(data);
         }
         if (this.Title === "修改词汇") {
-          data[0].subject = data[0].ontologySts;
-          data[0].predicate = data[0].relationSts;
+          // data[0].subject = data[0].ontologySts;
+          // data[0].predicate = data[0].relationSts;
+          if (data[0].ontologySts==1) {
+            data[0].guanxi='ontologySts'
+
+          }
+          if (data[0].relationSts==1) {
+            data[0].guanxi='relationSts'
+
+          }
     
         //  this.joinse = data[0].typeIds;
         //  this.formLabelAlignid=this.getCascPath(data[0].typeIds, this.temp_treeData)
         }
         this.tableData = data;
-        console.log('----------------------------');
         if (this.tableData[0].typeIds && this.temp_treeData) {
           // this.getFathersById(this.tableData[0].typeIds, this.temp_treeData);
                     this.formLabelAlignid=this.getCascPath(this.tableData[0].typeIds, this.temp_treeData)
@@ -1202,8 +1261,8 @@ findPath(value, source, path = []) {
                 explain: this.tableData[0].explain,
                 // from: this.tableData[0].from,
                 name: this.tableData[0].name,
-                relationSts: this.tableData[0].predicate,
-                ontologySts: this.tableData[0].subject,
+                relationSts: this.tableData[0].guanxi=='relationSts'?1:0,
+                ontologySts:  this.tableData[0].guanxi=='ontologySts'?1:0,
                 typeIds: this.formateArr(this.formLabelAlignid),
               };
               this.postRequest(
@@ -1213,19 +1272,19 @@ findPath(value, source, path = []) {
               ).then((res) => {
                 if (res.data.code !== -1) {
                   if (this.Title.indexOf("词汇") !== -1) {
-                    if (
-                      tabledata.ontologySts == "0" &&
-                      tabledata.relationSts == "0"
-                    ) {
-                      this.$message.error("本体、关系,必须有一个是√");
-                    } else {
+                    // if (
+                    //   tabledata.ontologySts == "0" &&
+                    //   tabledata.relationSts == "0"
+                    // ) {
+                    //   this.$message.error("本体、关系,必须有一个是√");
+                    // } else {
                       this.postRequest(this.URL, tabledata, this.ask)
                         .then((res) => {
                           this.operateSuccess(res);
                         })
                         .catch((err) => {
                         });
-                    }
+                    // }
                   }
                 } else if (res.data.code == -1) {
                   
@@ -1365,13 +1424,15 @@ findPath(value, source, path = []) {
             id: this.tableData[0].id,
           };
           if (this.Title.indexOf("词汇") !== -1) {
-            if (Data.ontologySts == "0" && Data.relationSts == "0") {
-              this.$message.error("本体、关系,必须有一个是√");
-            } else {
+            // if (Data.ontologySts == "0" && Data.relationSts == "0") {
+            //   this.$message.error("本体、关系,必须有一个是√");
+            // } else {
+              Data.relationSts= this.tableData[0].guanxi=='relationSts'?1:0;
+              Data.ontologySts=this.tableData[0].guanxi=='ontologySts'?1:0;
               this.postRequest(this.URL, Data, this.ask).then((res) => {
                 this.operateSuccess(res);
               });
-            }
+            // }
           } else {
             this.postRequest(this.URL, {...this.tableData[0],predicate:!!this.tableData[0].predicate&&this.tableData[0].predicate!='--'?this.tableData[0].predicate:null}, this.ask).then(
               (res) => {
@@ -1533,6 +1594,7 @@ findPath(value, source, path = []) {
           this.$emit("clearSeclect", boolClear);
           this.$store.state.resturantName;
           this.centerDialogVisible = false;
+          this.$emit("submitSuccess");
         }
       }
       // else if (res.message.indexOf("500")) {
@@ -1590,7 +1652,11 @@ findPath(value, source, path = []) {
         (this.nameIf = false);
       this.typeidIf = false;
       this.fileArr = null;
+     try {
       this.success(false);
+     } catch (error) {  
+      console.log(error);
+     }
       this.centerDialogVisible = false;
       let data = JSON.parse(JSON.stringify([this.rowData]));
       if (this.Title === "修改词汇") {
@@ -1603,6 +1669,7 @@ findPath(value, source, path = []) {
         this.Title == "批量导入三元组" ||
         this.Title == "新增附件"
       )
+      this.$emit('cancel')
         return this.$refs.aupload.clearFiles();
     },
     // 遍历树形结构

+ 19 - 2
src/components/FrontPage/components/enums.js

@@ -6,6 +6,7 @@ export const FileManageTobData = [
     label: '名称',
     width: '160',
     align: "center",
+    sortable:'custom'
   },
 ]
 export const FileManageUnderData = [
@@ -24,6 +25,7 @@ export const FileManageUnderData = [
     label: '分类',
     width: '150',
     align: "center",
+    sortable:'custom',
     formatter(row, column, cellValue, index) {
       return cellValue === null ? '--' :cellValue === ''?'--': cellValue
     },
@@ -36,7 +38,7 @@ export const FileManageUnderData = [
     formatter(row, column, cellValue, index) {
       return cellValue === '1' ? '✓' : 'x'
     },
-    sortable:'custom'
+    // sortable:'custom'
   },
   {
     prop: 'relationSts',
@@ -46,7 +48,7 @@ export const FileManageUnderData = [
     formatter(row, column, cellValue, index) {
       return cellValue === '1' ? '✓' : 'x'
     },
-    sortable:'custom'
+    // sortable:'custom'
   },
   // {
   //   prop: 'object',
@@ -67,6 +69,7 @@ export const TripleManageTobData = [
     label: '三元组名称',
     width: '240',
     align: "center",
+    sortable:'custom'
   },
 ]
 export const TripleManageUnderData = [
@@ -116,6 +119,7 @@ export const documentData = [
     label: '名称',
     width: '210',
     align: "center",
+    sortable:'custom'
   },
 ]
 export const documentDatas = [
@@ -161,6 +165,7 @@ export const documentDatas = [
     label: '分类',
     width: '200',
     align: "center",
+    sortable:'custom',
     formatter(row, column, cellValue, index) {
       return cellValue === null ? '--' :cellValue === ''?'--': cellValue
     },
@@ -205,6 +210,7 @@ export const WordManageTobData = [
     label: '名称',
     width: '300',
     align: "center",
+    sortable:'custom'
   },
 ]
 export const WordManageUnderData = [
@@ -232,6 +238,7 @@ export const WordManageUnderData = [
     formatter(row, column, cellValue, index) {
       return cellValue === '' ? '--' :cellValue === null?'--': cellValue
     },
+
     
   },
   {
@@ -271,6 +278,7 @@ export const Ternary = [
     formatter(row, column, cellValue, index) {
       return cellValue === null ? '--' : cellValue
     },
+    sortable:'custom'
   },
   {
     prop: 'explain',
@@ -320,6 +328,7 @@ export const Vocabulary = [
     formatter(row, column, cellValue, index) {
       return cellValue === null ? '--' : cellValue
     },
+    sortable:'custom'
   },
   {
     prop: 'explain',
@@ -338,6 +347,7 @@ export const Vocabulary = [
     formatter(row, column, cellValue, index) {
       return cellValue === null ? '--' : cellValue
     },
+    sortable:'custom'
   },
   {
     prop: 'ontologySts',
@@ -397,6 +407,7 @@ export const WordSameNear = [
     label: '名称',
     width: '250',
     align: "center",
+    sortable:'custom'
   },
   {
     prop: 'keyWords',
@@ -443,6 +454,7 @@ export const entitySameNear = [
     label: '实体名称',
     width: '300',
     align: "center",
+    sortable:'custom'
   },
   {
     prop: 'introduction',
@@ -461,6 +473,7 @@ export const entitySameNear = [
     formatter(row, column, cellValue, index) {
       return cellValue === '' ? '--' : cellValue === null ? '--': cellValue
     },
+    sortable:'custom'
   },
 ]
 
@@ -472,6 +485,7 @@ export const ontologySameNear = [
     label: '名称',
     width: '300',
     align: "center",
+    sortable:'custom'
   },
   {
     prop: 'introduction',
@@ -490,6 +504,7 @@ export const ontologySameNear = [
     formatter(row, column, cellValue, index) {
       return cellValue === null ? '--' : cellValue
     },
+    sortable:'custom'
   }
 ]
 
@@ -501,6 +516,7 @@ export const documentSameNear = [
     label: '名称',
     width: '100',
     align: "center",
+    sortable:'custom'
   },
   {
     prop: 'keyWords',
@@ -547,5 +563,6 @@ export const documentSameNear = [
     formatter(row, column, cellValue, index) {
       return cellValue === null || cellValue === undefined || cellValue === '' ? '--' : cellValue
     },
+    sortable:'custom'
   },
 ]

+ 1 - 1
src/components/FrontPage/components/mixin.js

@@ -24,7 +24,7 @@ let mixinData = {
   
     // 数据列表
     VocabularyList(row, shot) {
-      if (row == '词汇详情' || row == '文本详情' || row == '三元组详情') {
+      if (row == '词汇详情' || row == '文本详情' || row == '三元组详情'|| row == '附件详情') {
         //排序传递字段名
         this.rowProp = this.pageHelper.ordercol
         this.rowDataDataGuDing = this.pageHelper.order

+ 2 - 0
src/components/OntologyEntity/components/enums.js

@@ -6,6 +6,7 @@ export const NoumenonTobData = [
     label: '名称',
     width: '15%',
     align: "center",
+    sortable:'custom'
   },
   {
     prop: 'introduction',
@@ -21,6 +22,7 @@ export const NoumenonTobData = [
     label: '分类',
     width: '25%',
     align: "center",
+    sortable:'custom',
     formatter(row, column, cellValue, index) {
       return cellValue === null ? '--' :cellValue === ''?'--': cellValue
     },

+ 42 - 1
src/components/OntologyEntity/entity.vue

@@ -73,6 +73,8 @@
               ref="multipleTable"
               :data="arrfiles.data"
               tooltip-effect="dark"
+              @sort-change="onSortChange"
+
               style="width: 100%"
               border
             >
@@ -92,6 +94,8 @@
                 :min-width="item.width"
                 :align="item.align"
                 :formatter="item.formatter"
+                :sort-orders="['ascending', 'descending']"
+                :sortable="item.sortable"
                 show-overflow-tooltip
               >
               </el-table-column>
@@ -297,6 +301,7 @@ export default {
           typeIds: "",
         },
       ],
+      pageHelper:{},
       headsTob: NoumenonTobData,
       titleNameSubject: [],
       dialogVisibleDow: false,
@@ -692,9 +697,45 @@ formateArr(val){
         }
       });
     },
+    onSortChange({ column, prop, order }) {
+      $(".ascending").css("border-bottom-color", "");
+      $(".descending").css("border-top-color", "");
+      if (order !== null && this.prevProp !== prop) {
+        let columns = this.$refs.multipleTable.columns.find(
+          (x) => x.property === this.prevProp
+        );
+        if (columns) {
+          columns.order = "";
+        }
+      }
+      if (order === null) {
+        column.order =
+          this.saveSort === "descending" ? "descending" : "ascending";
+        this.prevProp = prop;
+      }
+      this.saveSort = column.order;
+      const order_new = {
+        ascending: "ASC",
+        descending: "DESC",
+      };
+      this.pageHelper.ordercol = prop;
+      this.pageHelper.order = order_new[column.order];
+      this.getPageList(this.title);
+    },
     //获取实体列表
     getPageList() {
-      this.postRequest("/entity/pageList", this.pagesContent, "post").then(
+      // this.rowProp = this.pageHelper.ordercol
+      //   this.rowDataDataGuDing = this.pageHelper.order
+      //   this.rowData = {
+      //     name: this.tableData.name,
+      //     current: this.tableData.current,
+      //     size: this.tableData.size,
+        
+      //     typeId: this.typeid,
+      //   }
+  
+      this.postRequest("/entity/pageList", {...this.pagesContent,  colName: this.pageHelper.ordercol,
+          sort: this.pageHelper.order}, "post").then(
         (res) => {
           if (res.data.code == 0) {
             this.arrfiles = res.data.data;

+ 44 - 2
src/components/OntologyEntity/ontology.vue

@@ -101,8 +101,18 @@
               </div>
             </div>
             <div class="cont-bott haveBorder">
-              <el-table border    :header-cell-class-name="headerClass"
-              :cell-class-name="tableRowClass" :data="tableData.data"  fit   style="width: 100%">
+              <el-table    
+              ref="myTable2"
+               :header-cell-class-name="headerClass"
+              :cell-class-name="tableRowClass"
+               :data="tableData.data"       
+              @sort-change="onSortChange"
+              :row-key="
+                (row) => {
+                  return row.id;
+                }
+              "  
+              style="width: 100%">
                 <el-table-column
                   prop="sequence"
                   type="index"
@@ -119,6 +129,8 @@
                   :prop="item.prop"
                   :label="item.label"
                   :align="item.align"
+                  :sortable="item.sortable"
+                   :sort-orders="['ascending', 'descending']"
                   :formatter="item.formatter"
                   :show-overflow-tooltip="true"
                   >
@@ -412,6 +424,8 @@ export default {
       nameIf: false,
       typeIf: false,
       fullPath: false,
+      rowDataDataGuDing:null,
+      rowProp:null
     };
   },
   computed: {},
@@ -549,6 +563,8 @@ elink.download = `本体:${row.name}.xlsx`;
       this.postRequest(
         "/noumenon/pageList",
         {
+          colName: this.rowProp,
+          sort: this.rowDataDataGuDing,
           name: this.tableData.name,
           current: this.tableData.current,
           size: this.tableData.size,
@@ -750,6 +766,32 @@ elink.download = `本体:${row.name}.xlsx`;
     // table 序号累加
     indexMethod(index) {
       return index + 1 + this.tableData.current * this.tableData.size;
+    },
+      //排序
+      onSortChange({ column, prop, order }) {
+      $(".ascending").css("border-bottom-color", "");
+      $(".descending").css("border-top-color", "");
+      if (order !== null && this.prevProp !== prop) {
+        let columns = this.$refs.myTable2.columns.find(
+          (x) => x.property === this.prevProp
+        );
+        if (columns) {
+          columns.order = "";
+        }
+      }
+      if (order === null) {
+        column.order =
+          this.saveSort === "descending" ? "descending" : "ascending";
+        this.prevProp = prop;
+      }
+      this.saveSort = column.order;
+      const order_new = {
+        ascending: "ASC",
+        descending: "DESC",
+      };
+      this.rowProp = prop;
+      this.rowDataDataGuDing = order_new[column.order];
+      this.VocabularyList(this.title);
     },
     // 当前条
     handleSizeChange(val) {

+ 4 - 3
src/components/controlPanel/components/Wordsgraph.vue

@@ -2,8 +2,8 @@
  * @Description: 近/同义词svg
  * @Author: gaomingxin
  * @Date: 2023-05-17 14:08:21
- * @LastEditors: gaomingxin
- * @LastEditTime: 2023-06-16 15:16:05
+ * @LastEditors: chenbaoxin chenbaoxin
+ * @LastEditTime: 2024-04-01 14:54:16
 -->
 <template>
   <div id="svg_demo" class="graph-continer" preserveAspectRatio="xMidYMid meet">
@@ -1474,7 +1474,7 @@ export default {
       if (d.data.name == "刪除") {
         this.deleteData(node, false);
         this.hiddenALLMenu();
-        this.fatherMethod();
+        // this.fatherMethod();
       } else if (d.data.name === "新增") {
         this.hiddenALLMenu();
         this.$emit('transfer', node)
@@ -1493,6 +1493,7 @@ export default {
     deleteData(d) {
       this.postRequest(`/words/delete/${d.id}`, null, 'DELETE').then(res => {
         if (res.data.code != -1) {
+          this.fatherMethod()
           this.$message({ message: res.data.message, type: "success" });
         } else return this.$message.error(res.data.message);
       })

+ 334 - 106
src/components/controlPanel/components/sameWords.vue

@@ -2,8 +2,8 @@
  * @Description: 近/同义词管理
  * @Author: gaomingxin
  * @Date: 2023-05-16 15:30:16
- * @LastEditors: error: git config user.name & please set dead value or install git
- * @LastEditTime: 2023-06-05 18:03:10
+ * @LastEditors: chenbaoxin chenbaoxin
+ * @LastEditTime: 2024-04-01 10:36:18
 -->
 <template>
   <div id="sameWords">
@@ -32,7 +32,11 @@
         <el-button size="small" class="search-butt" @click="smallClick"
           >批量导入</el-button
         >
-        <el-button size="small" class="search-butt" @click="backHome" :disabled="backtrack"
+        <el-button
+          size="small"
+          class="search-butt"
+          @click="backHome"
+          :disabled="backtrack"
           >返回</el-button
         >
       </div>
@@ -86,6 +90,8 @@
       title="新增同/近义词"
       :visible.sync="dialog"
       width="35%"
+      :close-on-click-modal="false"
+
       center
       v-if="emptyData"
     >
@@ -99,18 +105,76 @@
           class="demo-ruleForm"
         >
           <el-form-item label="词汇名称1:" prop="words1">
-            <el-input v-model="ruleForm.words1" :disabled="disa"></el-input>
+            <!-- <el-input  v-model="ruleForm.words1" :disabled="disa"></el-input> -->
+            <el-select
+              v-model="ruleForm.words1"
+              filterable
+              remote
+              clearable
+              :reserve-keyword="true"
+              placeholder="请输入词汇名称"
+              :remote-method="remoteMethod1"
+              :loading="loading1"
+            >
+              <el-option
+                v-for="item in chSelect1"
+                :key="item.name"
+                :label="item.name"
+                :value="item.name"
+              >{{item.name}}</el-option>
+            </el-select>
           </el-form-item>
           <el-form-item label="同/近义词:" prop="relationName">
-            <el-select v-model="ruleForm.relationName" placeholder="请选择词汇关系">
+            <el-select
+              v-model="ruleForm.relationName"
+              placeholder="请选择词汇关系"
+            >
               <el-option label="同义词" value="同义词"></el-option>
               <el-option label="近义词" value="近义词"></el-option>
             </el-select>
           </el-form-item>
           <el-form-item label="词汇名称2:" prop="words2">
-            <el-input v-model="ruleForm.words2"></el-input>
+            <!-- <el-input v-model="ruleForm.words2"></el-input> -->
+            <el-select
+              v-model="ruleForm.words2"
+              filterable
+              remote
+              clearable
+              :reserve-keyword="true"
+              placeholder="请输入词汇名称"
+              :remote-method="remoteMethod2"
+              :loading="loading2"
+            >
+              <el-option
+                v-for="item in chSelect2"
+                :key="item.name"
+                :label="item.name"
+                :value="item.name"
+              >{{item.name}}</el-option>
+            </el-select>
           </el-form-item>
+          <el-form-item v-if="ruleForm.relationName=='近义词'"  label="是否合并:" prop="status">
+            <el-radio-group style="margin-left:-350px" v-model="ruleForm.status">
+              <el-radio :label="0">否</el-radio>
+              <el-radio :label="1">是</el-radio>
+            </el-radio-group>
+          </el-form-item>
+          <p class="ts" v-if="chMax">
+            未搜索到该词汇,请先&nbsp;<span @click="openCh">新增词汇</span>
+          </p>
+          <!-- <p class="ts" v-if="chMax"> 未搜索到该词汇({{chMaxText}}),请先&nbsp;<span>新增词汇</span></p> -->
         </el-form>
+        <general-popup
+        @cancel="cancel"
+        :promptTitle="promptTitle"
+        :stencil="promptTitle"
+        @submitSuccess="submitSuccess"
+        :rowData="{}"
+        v-if="popipIf"
+        :Association="[]"
+        determine="sheet"
+        ref="dropDown"
+      />
       </span>
       <span slot="footer" class="dialog-footer">
         <el-button @click="abolishment">取 消</el-button>
@@ -136,15 +200,30 @@
           class="demo-ruleForm"
         >
           <el-form-item label="词汇名称:" prop="name">
-            <el-input v-model="Form.name"></el-input>
+            <!-- <el-input v-model="Form.name"></el-input> -->
+            <el-select
+              v-model="Form.name"
+              filterable
+              remote
+              clearable
+              :reserve-keyword="true"
+              placeholder="请输入词汇名称"
+              :remote-method="remoteMethod2"
+              :loading="loading2"
+            >
+              <el-option
+                v-for="item in chSelect2"
+                :key="item.name"
+                :label="item.name"
+                :value="item.name"
+              >{{item.name}}</el-option>
+            </el-select>
           </el-form-item>
         </el-form>
       </span>
       <span slot="footer" class="dialog-footer">
         <el-button @click="abolishment">取 消</el-button>
-        <el-button type="primary" @click="editFom('Form')"
-          >确 定</el-button
-        >
+        <el-button type="primary" @click="editFom('Form')">确 定</el-button>
       </span>
     </el-dialog>
   </div>
@@ -152,15 +231,24 @@
 <script>
 import Wordsgraph from "./Wordsgraph.vue";
 import d3graph from "../../../components/JumpCanvas/d3graph.vue";
+import GeneralPopup from "@/components/FrontPage/GeneralPopup.vue";
 
 export default {
-  components: { Wordsgraph, d3graph },
+  components: { Wordsgraph, d3graph,GeneralPopup },
   data() {
     return {
+      popipIf:false,
+      promptTitle:1,
+      loading1:false,
+      loading2:false,
+      chSelect1: [],
+      chSelect2: [],
+      chMaxText: "",
+      chMax: false,
       contentsKey: "",
       graphWidth: null,
       graphHeight: null,
-      titleName: '修改同/近义词',
+      titleName: "修改同/近义词",
       sameSearch: "",
       graphData: {},
       dialogVisible: false,
@@ -175,7 +263,8 @@ export default {
       ruleForm: {
         words1: "",
         relationName: "",
-        words2: '',
+        words2: "",
+        status: 0,
       },
       Form: {
         name: "",
@@ -185,9 +274,7 @@ export default {
         words1: [
           { required: true, message: "请输入词汇名称", trigger: "blur" },
         ],
-        name: [
-          { required: true, message: "请输入词汇名称", trigger: "blur" },
-        ],
+        name: [{ required: true, message: "请输入词汇名称", trigger: "blur" }],
         relationName: [
           { required: true, message: "请选择词汇关系", trigger: "change" },
         ],
@@ -196,18 +283,126 @@ export default {
         ],
       },
       rul: {
-        name: [
-          { required: true, message: "请输入词汇名称", trigger: "blur" },
-        ],
+        name: [{ required: true, message: "请输入词汇名称", trigger: "blur" }],
       },
     };
   },
   mounted() {
     this.wordsLSist();
-    this.windowSize()
+    this.windowSize();
   },
   watch: {},
   methods: {
+    cancel(){
+      this.popipIf=false
+        },
+    openCh(){
+      this.popipIf=true
+      this.$nextTick(()=>{
+        this.promptTitle="新增词汇1"
+        this.promptTitle="新增词汇"
+        this.$refs.dropDown.centerDialogVisible=true
+      })
+    },
+    submitSuccess(){
+      this.chMax=false
+    },
+    async remoteMethod1(name) {
+      this.postRequest(
+        "/neo4j/checkAll",
+        {
+          name: name,
+        },
+        "POST"
+      ).then((res) => {
+        console.log(res);
+        if (res.data.code!=0) {
+          this.chMax=true
+        }else{
+          this.chMax=false
+        }
+      });
+      if (!!!name) {
+        this.chSelect2 = [];
+      }
+      this.loading1=true
+      this.chSelect1=[]
+      return this.postRequest(
+        "/neo4j/vocabularyList",
+        {
+          name: name,
+          current: 0,
+          size: 1000,
+          typeId: ""
+        },
+        "POST"
+      ).then((res) => {
+        this.loading1=false
+        this.chSelect1 = res.data.data.data;
+        // if (this.chSelect1.length==0) {
+        //   this.chMax=true
+        // }else{
+        //   this.chMax=false
+
+        // }
+      });
+     
+    },
+    async remoteMethod2(name) {
+      if (!!!name) {
+        this.chSelect2 = [];
+      }
+      this.loading2=true
+      this.chSelect2=[]
+      this.postRequest(
+        "/neo4j/checkAll",
+        {
+          name: name,
+        },
+        "POST"
+      ).then((res) => {
+        if (res.data.code!=0) {
+          this.chMax=true
+        }else{
+          this.chMax=false
+        }
+      });
+      return this.postRequest(
+        "/neo4j/vocabularyList",
+        {
+          name: name,
+          current: 0,
+          size: 1000,
+          typeId: ""
+        },
+        "POST"
+      ).then((res) => {
+        this.loading2=false
+       console.log(res);
+        this.chSelect2 = res.data.data.data;
+        if (this.chSelect2.length==0) {
+          this.chMax=true
+        }else{
+          this.chMax=false
+
+        }
+      });
+    },
+    checkChApi(name) {
+      if (!!!name) {
+        return 0;
+      }
+      return this.postRequest(
+        "/neo4j/checkOneVocabulary",
+        {
+          name: name,
+          uri: "",
+        },
+        "POST"
+      ).then((res) => {
+        return res.data.code;
+      });
+    },
     smallClick() {
       this.dialogVisible = true;
     },
@@ -218,141 +413,161 @@ export default {
     },
     // 搜索
     searchClick(name, relName) {
-      this.determine = false
-      let Name = { 
-        words1:  typeof name === 'string' ? name : '',
-        relationName: typeof relName === 'string' ? relName : ''
-      }
+      this.determine = false;
+      let Name = {
+        words1: typeof name === "string" ? name : "",
+        relationName: typeof relName === "string" ? relName : "",
+      };
       setTimeout(() => {
-        this.determine = true
-        this.postRequest("/words/list", Name , "POST").then((res) => {
-        if(res.data.code != -1) {
-          this.convertData(res.data.data.nodes, res.data.data.links)
-            res.data.data.nodes.map(item => {
-              if(res.data.data.node.id != null && item.id === res.data.data.node.id) { item.label = '附件'}
-              if(item.name === this.sameSearch) { item.label = '附件' }
-            })
-          this.graphData = res.data.data
-        }
-      });
-      // Name.words1 = ''
-      },100)
+        this.determine = true;
+        this.postRequest("/words/list", Name, "POST").then((res) => {
+          if (res.data.code != -1) {
+            this.convertData(res.data.data.nodes, res.data.data.links);
+            res.data.data.nodes.map((item) => {
+              if (
+                res.data.data.node.id != null &&
+                item.id === res.data.data.node.id
+              ) {
+                item.label = "附件";
+              }
+              if (item.name === this.sameSearch) {
+                item.label = "附件";
+              }
+            });
+            this.graphData = res.data.data;
+          }
+        });
+        // Name.words1 = ''
+      }, 100);
     },
     // 列表
     wordsLSist() {
-      this.determine = false
+      this.determine = false;
       setTimeout(() => {
-        this.determine = true
+        this.determine = true;
         this.postRequest("/words/list", { words1: "" }, "POST").then((res) => {
-          if(res.data.code != -1) {
-            this.convertData(res.data.data.nodes, res.data.data.links)
-            this.graphData = res.data.data
+          if (res.data.code != -1) {
+            this.convertData(res.data.data.nodes, res.data.data.links);
+            this.graphData = res.data.data;
           }
         });
-      },100)
+      }, 100);
     },
     // 搜索返回
     backHome() {
-      this.wordsLSist()
-      this.backtrack = true
+      this.wordsLSist();
+      this.backtrack = true;
     },
     // 数据转化
-    convertData(nodes, links){
-      let arr = []
-      links.map(item => {
-        item.target = item.endId
-        delete item.endId
-        item.source = item.startId
-        delete item.startId
-        item.value = item.type
-        delete item.type
-        if(item.value === '同义词') {
-          arr.push(item.target)
+    convertData(nodes, links) {
+      let arr = [];
+      links.map((item) => {
+        item.target = item.endId;
+        delete item.endId;
+        item.source = item.startId;
+        delete item.startId;
+        item.value = item.type;
+        delete item.type;
+        if (item.value === "同义词") {
+          arr.push(item.target);
         }
-        return
-      })
-      let strData = JSON.stringify(arr).replace('[', ',').replace(']', ',')
-      nodes.map(item => {
-        item.label = '近义词'
-        if(strData.indexOf(`,${item.id},`) !== -1) {
-          item.label = '同义词'
+        return;
+      });
+      let strData = JSON.stringify(arr).replace("[", ",").replace("]", ",");
+      nodes.map((item) => {
+        item.label = "近义词";
+        if (strData.indexOf(`,${item.id},`) !== -1) {
+          item.label = "同义词";
         }
-        return 
-      })
+        return;
+      });
     },
     // 新增
     addClick() {
-      this.dialog = true
+      this.dialog = true;
     },
     getAdd(msg) {
-      if(msg.name) {
-        this.dialog = true
-        this.ruleForm.words1 = msg.name
-        this.disa = true
+      if (msg.name) {
+        this.dialog = true;
+        this.ruleForm.words1 = msg.name;
+        this.disa = true;
       }
     },
     getRevise(msg) {
-      if(msg.name) {
-        this.dialogs = true
-        this.Form.name = msg.name
-        this.Form.id = msg.id
+      if (msg.name) {
+        this.dialogs = true;
+        this.Form.name = msg.name;
+        this.Form.id = msg.id;
       }
     },
     // 同义词
     getSame(msg) {
-      this.searchClick(msg.name, '同义词')
-      this.backtrack = false
+      this.searchClick(msg.name, "同义词");
+      this.backtrack = false;
     },
     // 近义词
     getClose(msg) {
-      this.searchClick(msg.name, '近义词')
-      this.backtrack = false
+      this.searchClick(msg.name, "近义词");
+      this.backtrack = false;
     },
-    uploadfom(formName){
+    uploadfom(formName) {
       this.$refs[formName].validate((valid) => {
         if (valid) {
-          this.postRequest('/words/add', this.ruleForm, 'POST').then(res => {
-            if (res.data.code != -1 && res.data.data === 'Success') {
+          if (this.ruleForm.relationName=='同义词') {
+            this.ruleForm.status=1
+          }
+          this.postRequest("/words/add", this.ruleForm, "POST").then((res) => {
+            //   if (res.data.code ==-2) {
+            //   this.chMax=true
+            //   this.chMaxText=res.data.message
+            //   return false
+            // }
+            if (res.data.code != -1 && res.data.data === "Success") {
               this.$message({ message: res.data.message, type: "success" });
-              this.wordsLSist()
-            } else { 
-              this.$message.error(typeof res.data.data === 'object' ? res.data.data : res.data.message)
-              if(typeof res.data.data === 'object') {
-                this.titleName = '修改同义词'
+              this.wordsLSist();
+              this.abolishment();
+            } else {
+              this.$message.error(
+                typeof res.data.data === "object"
+                  ? res.data.data
+                  : res.data.message
+              );
+              if (typeof res.data.data === "object") {
+                this.titleName = "修改同义词";
                 let msg = {
                   id: res.data.data.id,
                   name: res.data.data.name,
-                }
-                this.getRevise(msg)
+                };
+                this.getRevise(msg);
+                this.abolishment();
               }
             }
-          })
-          this.abolishment();
+          });
+       
         } else {
           return false;
         }
-      })
+      });
     },
     editFom(formName) {
       this.$refs[formName].validate((valid) => {
         if (valid) {
-          this.postRequest('/words/edit', this.Form, 'POST').then(res => {
+          this.postRequest("/words/edit", this.Form, "POST").then((res) => {
             if (res.data.code != -1) {
               this.$message({ message: res.data.message, type: "success" });
-              this.titleName = '修改同/近义词'
-              this.wordsLSist()
+              this.titleName = "修改同/近义词";
+              this.wordsLSist();
             } else return this.$message.error(res.data);
-          })
+          });
           this.abolishment();
         } else {
           return false;
         }
-      })
+      });
     },
     // 下载模版
     stencil() {
-      let url =
-        "/api/xzzs/words/downloadWordsTemplate";
+      let url = "/api/xzzs/words/downloadWordsTemplate";
       const a = document.createElement("a");
       a.href = url;
       a.download = "近/同义词模版"; // 下载后文件名
@@ -379,7 +594,7 @@ export default {
       ).then((res) => {
         if (res.data.code != -1) {
           this.$message({ message: res.data.message, type: "success" });
-          this.wordsLSist()
+          this.wordsLSist();
         } else return this.$message.error(res.data.message);
       });
       this.abolishment();
@@ -389,11 +604,14 @@ export default {
       this.ruleForm = {
         words1: "",
         relationName: "",
-        words2: '',
-      }
-      this.dialogs = false
+        words2: "",
+      };
+      this.dialogs = false;
       this.emptyData = false;
-      this.dialog = false
+      this.dialog = false;
+      this.chMax=false
+      this.chSelect2=[]
+      this.chSelect1=[]
       this.dialogVisible = false;
       setTimeout(() => {
         this.emptyData = true;
@@ -404,6 +622,16 @@ export default {
 </script>
 <style src="@/assets/css/same.css" scoped></style>
 <style lang="less" scoped>
+.ts {
+  width: 100%;
+  text-align: left;
+  padding-left: 100px;
+  color: #fff;
+  span {
+    cursor: pointer;
+    color: #4ff;
+  }
+}
 #sameWords {
   // background: rgba(158, 158, 158, 0.1);
   .upper {
@@ -459,7 +687,7 @@ export default {
 ::v-deep .el-upload {
   width: 100%;
 }
-::v-deep .el-form-item__label{
+::v-deep .el-form-item__label {
   color: #fff;
   font-size: 13px;
   font-weight: 500;
@@ -470,4 +698,4 @@ export default {
 ::v-deep .el-input.is-disabled .el-input__inner {
   background-color: #282828;
 }
-</style>
+</style>

+ 4 - 4
src/components/controlPanel/index.vue

@@ -22,7 +22,7 @@
             </span>
             <same-words v-if="activeName === 'synonyms'" />
           </el-tab-pane>
-          <el-tab-pane name="first">
+          <!-- <el-tab-pane name="first">
             <span slot="label">
               <span class="span-box">
                 <span>用户管理</span>
@@ -30,7 +30,7 @@
               </span>
             </span>
             <user-graph v-if="activeName === 'first'" />
-          </el-tab-pane>
+          </el-tab-pane> -->
           <!-- <el-tab-pane name="sort">
             <span slot="label">
               <span class="span-box">
@@ -40,7 +40,7 @@
             </span>
             <sortManage ref="iaSon" v-if="iaSonName"></sortManage>
           </el-tab-pane> -->
-          <el-tab-pane name="words">
+          <!-- <el-tab-pane name="words">
             <span slot="label">
               <span class="span-box">
                 <span>工作日志</span>
@@ -48,7 +48,7 @@
               </span>
             </span>
             <work-Word v-if="activeName === 'words'" />
-          </el-tab-pane>
+          </el-tab-pane> -->
         </el-tabs>
       </div>
     </div>

+ 87 - 2
src/components/d3graphTwo.vue

@@ -308,6 +308,7 @@ export default {
   inject:['reload'],
   data() {
     return {
+      mergeId:[],
       mousePosition:null,
       flagUpdate:false,
       cxRightObj:{},
@@ -1378,7 +1379,6 @@ export default {
           this.nodeMenuFlag = false;
 
           if (this.startNodes !== this.radioNods) {
-            debugger
             // this.data.links.push({
             //   source: this.startNodes,
             //   target: this.radioNods,
@@ -1419,6 +1419,8 @@ export default {
           console.log(this.radioNods);
 
           // this.updataGraph();
+        }else{
+          this.$message.error(res.data.data)
         }
       });
     },
@@ -3675,6 +3677,7 @@ this.selectaNumericBool=false
                   name: "复制",
                 })
       }
+   
       let svg = d3.select("#graphSvg");
       let menu = [];
       let pi = Math.PI;
@@ -3706,7 +3709,17 @@ this.selectaNumericBool=false
             name: "打开三元组",
           };
         }
-
+        if (d.label == "词汇") {
+          d.menu.push(
+            {
+            count: 25,
+            enabled: true,
+            fill: "#202a33",
+            icon: "",
+            name: "合并",
+          }
+          )
+        } 
         d.menu.forEach((d) => {
           if (this.fullScreen) {
             pi = Math.PI * 2;
@@ -4370,8 +4383,80 @@ this.selectaNumericBool=false
         this.copyBtn( node);
         this.hiddenALLMenu();
 
+      }else if (d.data.name === "合并") {
+        this.merge(node);
+        this.hiddenALLMenu();
+
       }
     },
+    merge(node){
+      this.postRequest(`/noumenon/checkMerge`, {name:node.name }, "post").then((res) => {
+        if (res.data.code == 0) {
+          if (res.data.data.status==0) {
+            this.$message({
+            message:'无可合并项',
+            type: "error",
+          });
+            return false
+          }
+          if (this.discern=='本体图谱') {
+            this.mergeNoApi(node.id)
+            return false
+          }
+          this.mergeEnApi(node.id)
+          // this.$message({
+          //   message: "合并成功",
+          //   type: "success",
+          // });
+          // this.closure();
+          // // this.reload()
+          // d3.selectAll("#delnode").remove();
+          // this.updataGraph();
+        }else{
+          this.$message({
+            message:'无可合并项',
+            type: "error",
+          });
+        }
+      });
+    },
+    // 实体合并
+    mergeEnApi(nodeId){
+      this.mergeId.push(nodeId)
+      this.postRequest(`/entity/merge`, {entityIds:this.mergeId,entityId:this.formLabelAligIdBACK }, "post").then((res) => {
+        if (res.data.code == 0) {
+          this.data.nodes = res.data.data.nodes;
+                    this.data.links = res.data.data.links;
+          this.closure();
+          // this.reload()
+          d3.selectAll("#delnode").remove();
+          this.updataGraph();
+        }else{
+          this.$message({
+            message:res.data.message,
+            type: "error",
+          });
+        }
+      });
+    },
+    mergeNoApi(nodeId){
+      this.mergeId.push(nodeId)
+      this.postRequest(`/noumenon/merge`, {entityIds:this.mergeId,entityId:this.formLabelAligIdBACK }, "post").then((res) => {
+        if (res.data.code == 0) {
+          this.data.nodes = res.data.data.nodes;
+                    this.data.links = res.data.data.links;
+          this.closure();
+          // this.reload()
+          d3.selectAll("#delnode").remove();
+          this.updataGraph();
+        }else{
+          this.$message({
+            message:res.data.message,
+            type: "error",
+          });
+        }
+      });
+},
     copyBtn(node){
       // 
       let type=2

+ 31 - 0
src/plugins/axios.js

@@ -42,13 +42,17 @@ const hideLoading = () => {
   }
 };
 axios.interceptors.request.use((config) => {
+  
   config.headers.AccessControlAllowOrigin = "*";
   showLoading();
   return config;
 });
 let countLogin=0
+let roleLogin=0
+let roleLoginStatus=false
 axios.interceptors.response.use(
   (success) => {
+
     // 合并loading请求效果 避免重复请求
     setTimeout(() => {
       hideLoading();
@@ -64,6 +68,7 @@ axios.interceptors.response.use(
         }
       });
     }
+
     if (success.data.code==403) {
       countLogin=countLogin+1
       if (countLogin==1) {
@@ -102,6 +107,32 @@ axios.interceptors.response.use(
       Message.error({ message: error.response.data.msg });
     } else {
       // Message.error(error.response.data.message);
+      if (error.response.data.message.includes('无此角色')) {
+        roleLogin++
+     
+
+        if (!roleLoginStatus) {
+          roleLoginStatus=true
+
+          Message.error({ message: '当前用户角色无法访问知识库' });
+         setTimeout(() => {
+          roleLoginStatus=false
+         }, 1000);
+        }
+        throw new Error("当前用户角色无法访问知识库");
+       
+      }
+      if (error.response.data.message=='未能读取到有效Token') {
+        GetRequestInterface('/acc/auth', '',).then((res) => {
+          countLogin++
+          if (countLogin==1) {
+            Message.error({ message: res.data.msg });
+             setTimeout(()=>{
+              window.location.href=res.data.data
+             },1000)
+          }
+        });
+      }
     }
     return error;
   }

+ 2 - 2
vue.config.js

@@ -13,8 +13,8 @@ module.exports = {
     proxy: {
       "/api": {
         // target: "http://192.168.1.107:8089/api",
-        target: "http://192.168.1.104:8088/api",
-        // target: "http://192.168.80.58:11178/api",
+        // target: "http://192.168.1.104:8087/api",
+        target: "http://192.168.80.58:11178/api",
         changeOrigin: true,
         pathRewrite: {
           "^/api": "",