Parcourir la source

元素库-关联节点修改

duy il y a 2 ans
Parent
commit
956e5e2a55
3 fichiers modifiés avec 49 ajouts et 27 suppressions
  1. 5 0
      src/main.js
  2. 10 1
      src/views/manager/archivetree.vue
  3. 34 26
      src/views/manager/wbsinfo/PublicWbs.vue

+ 5 - 0
src/main.js

@@ -35,6 +35,11 @@ import tenantPackage from './views/system/tenantpackage';
 import "@/styles/icon/index.scss"
 //自定义指令按钮
 import preventClick from './util/preventClick'
+import * as filters from "./util/filter"   //新增过滤器
+// register global utility filters 注册全局过滤 此处是新添加内容002
+Object.keys(filters).forEach(key => {
+  Vue.filter(key, filters[key]);
+})
 Vue.use(preventClick)
 // 注册全局crud驱动
 window.$crudCommon = crudCommon;

+ 10 - 1
src/views/manager/archivetree.vue

@@ -34,7 +34,16 @@
               @mouseleave="mouseLeave(data)"
               style="box-sizing: border-box;width:100%;"
             >
-              <span>{{ data.title }}</span>
+              <!-- <span>{{ data.title }}</span> -->
+                 <!--知识点过长处理,鼠标悬浮文字弹框显示全部内容-->
+            <span  class="custom-tree-node">
+                      <el-tooltip class="item" effect="light" :content="data.title" placement="top-start">
+                        <span > {{ data.title | ellipsis(25) }} </span>
+                      </el-tooltip>
+                  <div>
+                  </div>
+             </span>
+
               <span
                 class="marleft10"
                 v-show="data.moreShow"

+ 34 - 26
src/views/manager/wbsinfo/PublicWbs.vue

@@ -250,6 +250,7 @@ export default {
                 this.AssociatedPublicTap=true;
                 this.addElementForm.nodeName=this.from.title;
                  this.addElementForm.tableType=this.from.tableType+''
+                  this.addElementForm.tableOwner = this.from.tableOwner+''
                  //清除数据
                 this.filterText1 = "";
                 this.exceldata = [];
@@ -407,7 +408,7 @@ export default {
                 row.loading = true;
                 if (type == "关联") {
                     // saveRelation(row.id, this.from.id, this.tableData)
-                   savelinktableInfo({
+                   this.savelinktableInfo({
                     linkids: row.id,
                     tabId: this.from.id,
                     type:1
@@ -420,9 +421,10 @@ export default {
                         row.loading = false;
                     });
                 } else {
-                    cancelRelation({
-                    id: row.id,
-                    excelTabId: this.from.id,
+                   this. savelinktableInfo({
+                    linkids: row.id,
+                    tabId: this.from.id,
+                    type:4
                     })
                     .then(() => {
                         row.checknd = false;
@@ -470,21 +472,17 @@ export default {
                 if (this.addElementForm.wbsId) {
                     console.log(this.tableData,'this.tableData');
                     if (this.activeName == "link") {
-                    this.submitExcelRelationWbsTreeAndElement({
-                        excelTabId: this.from.id,
-                        elementList: this.tableData,
-                        submitStatus: 1,
-                    });
+                      this.savelinktableInfo({
+                        linkids: this.selectNodeIds,
+                        tabId: this.from.id,
+                        type:1
+                      })
                     } else {
                     if (
                         this.addElementForm.nodeName &&
                         this.addElementForm.tableType &&
                         this.addElementForm.tableOwner
                     ) {
-                        // let nodeIds = this.$refs.tree.getCheckedKeys();
-                        // let nodeIds1 = this.$refs.treeall1.getCheckedKeys();
-                        // console.log(nodeIds,'nodeIds');
-                        // console.log(nodeIds1,'nodeIds1');
                         if( this.$refs.tree){
                         this.nodeIds = this.$refs.tree.getCheckedKeys();
                         }
@@ -502,13 +500,11 @@ export default {
                         });
                         return;
                         }
-                       savelinktableInfo({
+                        this.selectNodeIds= this.selectNodeIds.join(',')
+                        this.savelinktableInfo({
                         linkids: this.selectNodeIds,
                         tabId: this.from.id,
                         type:2
-                        }).then((res)=>{
-                          console.log(res,'添加元素表');
-
                         })
                        
                         // this.submitExcelRelationWbsTreeAndElement({
@@ -593,15 +589,27 @@ export default {
                     this.dataType = res.data;
                 }
             },
-             async submitExcelRelationWbsTreeAndElement(da) {
-                 console.log(da,'新增元素信息表');
-                //保存接口
-                da.elementList.forEach((ele) => {
-                    ele.eName = ele.textInfo;
-                    ele.eType = ele.textElementType;
-                    ele.eAllowDeviation = ele.textDeviation;
-                });
-                const { data: res } = await submitExcelRelationWbsTreeAndElement(da);
+            //  async submitExcelRelationWbsTreeAndElement(da) {
+            //      console.log(da,'新增元素信息表');
+            //     //保存接口
+            //     da.elementList.forEach((ele) => {
+            //         ele.eName = ele.textInfo;
+            //         ele.eType = ele.textElementType;
+            //         ele.eAllowDeviation = ele.textDeviation;
+            //     });
+            //     const { data: res } = await submitExcelRelationWbsTreeAndElement(da);
+            //     if (res.code == 200) {
+            //         this.$message({
+            //         type: "success",
+            //         message: "设置成功",
+            //         });
+            //         this.AssociatedPublicTap = false;
+            //         this.AssociatedPublicClose();
+            //     }
+            // },
+            async savelinktableInfo(da) {
+              console.log('新增元素表',da);
+                const { data: res } = await savelinktableInfo(da)
                 if (res.code == 200) {
                     this.$message({
                     type: "success",