jwyu 1 year ago
parent
commit
af7841bc40

+ 6 - 0
src/api/modules/chartApi.js

@@ -8,6 +8,12 @@ const dataBaseInterface = {
 	targetCatalog:params=>{
 		return http.get('/datamanage/classify/simple',params)
 	},
+	/**
+	 * 指标和目录拖动排序
+	 */
+	classifyMoveSort:params=>{
+		return http.post('/datamanage//edb_classify/move',params)
+	},
 
 	/**
 	 * 新增分类

+ 7 - 1
src/api/modules/predictEdbApi.js

@@ -12,8 +12,14 @@ export const classifyList = params => {
  * @returns 
  */
 export const classifyListV2 = params => {
-    return http.get('/datamanage/predict_classify/list/v2',params)
+    return http.get('/datamanage/predict_classify/tree',params)
 }
+//分类数据
+export const predictEdbCatalog=params=>{
+	return http.get('/datamanage/predict_classify/simple',params)
+}
+
+
 /**
  * 分类的图表列表 IsOnlyMe ClassifyId
  * @param {*} params 

+ 2 - 0
src/utils/buttonConfig.js

@@ -245,6 +245,7 @@ export const edbDataPermission = {
     edbData_switchEn:'edbData:switchEn',//切换英文版
     edbData_classifyOpt_add:'edbData:classifyOpt:add',//添加/编辑分类
     edbData_classifyOpt_delete:'edbData:classifyOpt:delete',//删除分类
+    edbData_classifyOpt_move:'edbData:classifyOpt:move',//移动分类
     edbData_checkRelatedChart:'edbData:checkRelatedChart',//查看关联图表
     edbData_checkRelatedEdb:'edbData:checkRelatedEdb',//查看关联指标
     edbData_checkCalcChart:'edbData:checkCalcChart',//查看计算指标
@@ -272,6 +273,7 @@ export const predictEdbPermission = {
     edbPreData_isOnlyMine:'edbPreData:isOnlyMine',//只看我的
     edbPreData_classifyOpt_add:'edbPreData:classifyOpt:add',//添加/编辑分类
     edbPreData_classifyOpt_delete:'edbPreData:classifyOpt:delete',//删除分类
+    edbPreData_classifyOpt_move:'edbPreData:classifyOpt:move',//移动分类
     edbPreData_checkRelatedChart:'edbPreData:checkRelatedChart',//查看关联图表
     edbPreData_checkRelatedEdb:'edbPreData:checkRelatedEdb',//查看关联指标
     edbPreData_checkPreRule:'edbPreData:checkPreRule',//查看预测规则

+ 4 - 3
src/views/dataEntry_manage/adjustdata/adjustData.vue

@@ -68,7 +68,8 @@
                 label: 'ClassifyName',
                 value: 'ClassifyId',
                 children: 'Children',
-                emitPath: false
+                emitPath: false,
+                checkStrictly: true
               }"
               clearable
               placeholder="请选择指标目录"
@@ -351,7 +352,7 @@ export default {
 		getMenu() {
 			dataBaseInterface.menuListV3().then((res) => {
 				if (res.Ret === 200) {
-					//this.filterNodes(res.Data.AllNodes)
+					this.filterNodes(res.Data.AllNodes||[])
 					this.classifyOptions = res.Data.AllNodes || [];
 				}
 			});
@@ -361,7 +362,7 @@ export default {
 			arr.length &&
 				arr.forEach((item) => {
 					item.Children.length && this.filterNodes(item.Children);
-					if (item.Level === 2) {
+					if (!item.Children.length) {
 						delete item.Children;
 					}
 				});

+ 3 - 2
src/views/dataEntry_manage/codecount/index.vue

@@ -67,6 +67,7 @@
 									label: 'ClassifyName',
 									value: 'ClassifyId',
 									children: 'Children',
+									checkStrictly: true
 								}"
 								@change="menuChange"
 								clearable
@@ -362,7 +363,7 @@ export default {
 		getMenu() {
 			dataBaseInterface.menuListV3().then((res) => {
 				if (res.Ret !== 200) return
-					//this.filterNodes(res.Data.AllNodes);
+					this.filterNodes(res.Data.AllNodes||[]);
 					this.menuOptions = res.Data.AllNodes || [];
 			});
 		},
@@ -371,7 +372,7 @@ export default {
 			arr.length &&
 				arr.forEach((item) => {
 					item.Children.length && this.filterNodes(item.Children);
-					if (item.Level === 2) {
+					if (!item.Children.length) {
 						delete item.Children;
 					}
 				});

+ 0 - 431
src/views/dataEntry_manage/components/targetTree.vue

@@ -1,431 +0,0 @@
-<template>
-  <div class="main-left left" id="left">
-    <div class="tree-cont">
-      <el-tree
-        ref="menuTree"
-        class="target_tree"
-        :data="treeData"
-        node-key="UniqueCode"
-        :props="defaultProp"
-        :allow-drag="canDragHandle"
-        :allow-drop="canDropHandle"
-        :current-node-key="select_node"
-        :default-expanded-keys="defaultShowNodes"
-        draggable
-        :expand-on-click-node="false"
-        check-strictly
-        empty-text="暂无目录"
-        lazy
-        :load="getLazyTreeData"
-        @node-expand="handleNodeExpand"
-        @node-collapse="handleNodeCollapse"
-        @current-change="nodeChange"
-        @node-drop="dropOverHandle"
-        @node-drag-end="dropMouseLeave"
-        @node-drag-leave="dropMouseLeave"
-        @node-drag-enter="dropMouseOver"
-      >
-        <span class="custom-tree-node" slot-scope="{ node, data }">
-          <el-input
-            ref="editVal"
-            style="width: 90px"
-            placeholder="请输入值"
-            class="label-input"
-            v-model="new_label"
-            v-if="data.isEdit && isEdbBtnShow('editCatalog')"
-            @blur="changeValue(node, data)"
-          />
-          <span
-            @dblclick.stop="editNodeLabel(node, data)"
-            v-else
-            class="text_oneLine node_label"
-            :style="`width:${(select_node === data.UniqueCode && node.Nodewidth) || ''}`"
-            :id="`node${data.UniqueCode}`"
-          >
-            <span>{{ currentLang === "en" ? data.ClassifyNameEn || data.ClassifyName : data.ClassifyName }}</span>
-          </span>
-          <span style="display: flex; align-items: center" v-if="select_node === data.UniqueCode">
-            <img src="~@/assets/img/data_m/move_ico.png" alt="" style="width: 14px; height: 14px; margin-right: 8px" v-if="data.Button.MoveButton" />
-            <!-- 添加子项 -->
-            <img
-              src="~@/assets/img/set_m/add.png"
-              alt=""
-              style="width: 14px; height: 14px; margin-right: 8px"
-              @click.stop="addNode(node, data)"
-              v-if="data.Button.AddButton && isEdbBtnShow('editCatalog')"
-            />
-            <!--编辑节点 如果是分类,判断data.Button.OpButton不变;如果是指标,不显示(ETA1.0.3)-->
-            <img
-              src="~@/assets/img/set_m/edit.png"
-              alt=""
-              style="width: 15px; height: 14px; margin-right: 8px"
-              @click.stop="editNode(node, data)"
-              v-if="!data.EdbCode && data.Button.OpButton && isEdbBtnShow('editCatalog')"
-            />
-            <!-- 删除节点 如果是分类,判断data.Button.DeleteButton不变;如果是指标,不显示(ETA1.0.3)-->
-            <img
-              slot="reference"
-              src="~@/assets/img/set_m/del.png"
-              alt=""
-              style="width: 14px; height: 14px"
-              @click.stop="removeNode(node, data)"
-              v-if="!data.EdbCode && data.Button.DeleteButton && isEdbBtnShow('deleteCatalog')"
-            />
-            <!-- 查看计算指标 -->
-            <i class="el-icon-view" v-if="data.EdbType === 2 && ![58, 59, 67, 68].includes(data.Source) && isEdbBtnShow('checkCalcChart')" @click.stop="viewNode(node, data)"></i>
-            <!-- 查看关联图表 -->
-            <img
-              v-if="data.Button.ShowChartRelation && isEdbBtnShow('checkRelatedChart')"
-              @click.stop="(showAssociateChart = true), (showAssociateComputeData = false)"
-              src="~@/assets/img/icons/associate_chart.png"
-              style="width: 14px; height: 14px; margin-left: 8px"
-              alt=""
-            />
-            <!-- 查看关联指标 -->
-            <img
-              v-if="data.Button.ShowEdbRelation && isEdbBtnShow('checkRelatedEdb')"
-              @click.stop="(showAssociateComputeData = true), (showAssociateChart = false)"
-              src="~@/assets/img/icons/associate_data.png"
-              style="width: 14px; height: 14px; margin-left: 8px"
-              alt=""
-            />
-          </span>
-        </span>
-      </el-tree>
-      <div class="noDepart" @click="addLevelOneHandle" v-if="CanOpClassify && isEdbBtnShow('editCatalog')">
-        <img src="~@/assets/img/set_m/add_ico.png" alt="" style="width: 16px; height: 16px; margin-right: 10px" />
-        <span>添加一级目录</span>
-      </div>
-    </div>
-    <span class="move-btn resize" v-drag id="resize" @mousemove="dynamicNode && resetNodeStyle(dynamicNode)"> </span>
-  </div>
-</template>
-
-<script>
-import { dataBaseInterface } from "@/api/api.js";
-export default {
-  name: "targetTree",
-  directives: {
-    drag(el, bindings) {
-      el.onmousedown = function (e) {
-        var init = e.clientX;
-        // console.log(init);
-        var box = $("#box")[0];
-        // console.log(box.clientWidth)
-        let total_wid = box.offsetWidth;
-        var left = $("#left")[0];
-        var right = $("#right")[0];
-        var initWidth = left.offsetWidth;
-        document.onmousemove = function (e) {
-          var end = e.clientX;
-          // console.log(total_wid,initWidth,end);
-          if (end > 310) {
-            var newWidth = end - init + initWidth;
-            // right.style.width = total_wid-end+80 +'px'
-            right.style.width = total_wid - newWidth + "px";
-            left.style.width = newWidth + "px";
-          } else {
-            end = 350;
-            // 最小宽度300
-            left.style.width = 300 + "px";
-            // right.style.width = total_wid-300-20 +'px'
-          }
-        };
-        document.onmouseup = function () {
-          document.onmousemove = document.onmouseup = null;
-          e.releaseCapture && e.releaseCapture();
-        };
-        e.setCapture && e.setCapture();
-        return false;
-      };
-    },
-  },
-  props: {},
-  data() {
-    return {
-      treeData: [], //树形数据
-      defaultShowNodes: [], //默认展开的节点
-      defaultProp: {
-        label: "ClassifyName",
-        children: "Children",
-        isLeaf: "isLeaf",
-      }, //树结构配置项
-      select_node: "", //当前选中的节点
-    };
-  },
-  methods: {
-    /* 判断节点是否能被拖拽 */
-    canDragHandle({ data }) {
-      return data.Button.MoveButton;
-    },
-    /* 判断节点是否能被拖入 */
-    canDropHandle(draggingNode, dropNode, type) {
-      //draggingNode 拖动的节点 dropNode放置的节点
-
-      //拖动的使目录则 只能放置同级下 如拖动2级目录那就只能放在一级目录下或者在2级目录里面排序
-      //拖动的是指标 那只能放在除一级目录下的任意目录下
-      let canDrop = false;
-      // 移动的是一级目录
-      if (draggingNode.level === 1 && dropNode.level === 1 && type !== "inner") {
-        canDrop = true;
-      }
-
-      // 二级目录
-      if (draggingNode.level === 2) {
-        if ((dropNode.level === 1 && type === "inner") || (dropNode.level === 2 && type !== "inner")) {
-          canDrop = true;
-        }
-      }
-
-      //三级目录
-      if (draggingNode.level === 3) {
-        if ((dropNode.level === 2 && type === "inner") || (dropNode.level === 3 && type !== "inner")) {
-          canDrop = true;
-        }
-      }
-      //四级指标
-      if (draggingNode.level === 4) {
-        if ((dropNode.level === 3 && type === "inner") || (dropNode.level === 4 && type !== "inner")) {
-          canDrop = true;
-        }
-      }
-
-      return canDrop;
-    },
-    // 树节点展开
-    handleNodeExpand(data) {
-      // 保存当前展开的节点
-      let flag = false;
-      this.defaultShowNodes.some((item) => {
-        if (item === data.UniqueCode) {
-          // 判断当前节点是否存在, 存在不做处理
-          flag = true;
-          return true;
-        }
-      });
-      if (!flag) {
-        // 不存在则存到数组里
-        this.defaultShowNodes.push(data.UniqueCode);
-      }
-    },
-    // 树节点关闭
-    handleNodeCollapse(data) {
-      this.defaultShowNodes.some((item, index) => {
-        if (item === data.UniqueCode) {
-          // 删除关闭节点
-          this.defaultShowNodes.length = index;
-        }
-      });
-    },
-    /* 节点变化时 */
-    nodeChange(data, node) {
-      this.search_txt = "";
-      this.select_classifyId = !data.EdbInfoId ? data.ClassifyId : 0;
-      this.select_node = data.UniqueCode;
-      this.selected_edbid = data.EdbInfoId;
-      this.resetNodeStyle(node);
-      this.dynamicNode = node;
-      this.showAssociateChart = false;
-      this.showAssociateComputeData = false;
-    },
-    /* 拖拽完成 */
-    dropOverHandle(b, a, i, e) {
-      // b被拖拽节点对应的节点、a结束拖拽时最后进入的节点、i被拖拽节点的放置位置
-      if (b.level === 1 || b.level === 2 || b.level === 3) {
-        this.handleMoveCatalogue(b, a, i, e);
-      }
-
-      // 指标层
-      if (b.level === 4) {
-        this.handleMoveEdb(b, a, i, e);
-      }
-    },
-    /* 拖拽离开/拖拽完成重置背景色 */
-    dropMouseLeave(node1, node2, e) {
-      let arrs = $(".el-tree-node__content");
-      for (let a of arrs) {
-        a.style.backgroundColor = "transparent";
-      }
-    },
-    /* 拖拽覆盖添加背景色 */
-    dropMouseOver(node1, node2, e) {
-      // 被拖拽节点对应的 Node、所进入节点对应的 Node、event
-      if (
-        ((node1.level === 2 && node2.level === 1) || (node1.level === 3 && node2.level === 2)) &&
-        (e.target.childNodes[0].className.includes("el-tree-node__content") || e.target.className.includes("el-tree-node__content"))
-      ) {
-        // console.log(e.target.childNodes[0])
-        e.target.childNodes[0].className.includes("el-tree-node__content") ? (e.target.childNodes[0].style.backgroundColor = "#409eff") : (e.target.style.backgroundColor = "#409eff");
-      }
-    },
-    // 移动的目录
-    handleMoveCatalogue(b, a, i, e) {
-      let list = a.parent.childNodes,
-        targetIndex = 0,
-        PrevClassifyId = 0,
-        NextClassifyId = 0,
-        ParentClassifyId = 0;
-
-      list.forEach((item, index) => {
-        if (item.data.ClassifyId === b.data.ClassifyId) {
-          targetIndex = index;
-          return;
-        }
-      });
-
-      if (targetIndex === 0) {
-        PrevClassifyId = 0;
-        NextClassifyId = list[targetIndex + 1].data.ClassifyId;
-      } else if (targetIndex === list.length - 1) {
-        PrevClassifyId = list[targetIndex - 1].data.ClassifyId;
-        NextClassifyId = 0;
-      } else {
-        PrevClassifyId = list[targetIndex - 1].data.ClassifyId;
-        NextClassifyId = list[targetIndex + 1].data.ClassifyId;
-      }
-
-      if (b.level === 2) {
-        if (i === "inner") {
-          ParentClassifyId = a.data.ClassifyId;
-          PrevClassifyId = 0;
-          NextClassifyId = a.data.Children.length > 1 ? a.data.Children[1].ClassifyId : 0;
-        } else {
-          ParentClassifyId = a.data.ParentId;
-        }
-      }
-
-      if (b.level === 3) {
-        if (i === "inner") {
-          ParentClassifyId = a.data.ClassifyId;
-          PrevClassifyId = 0;
-          NextClassifyId = a.data.Children.length > 1 ? a.data.Children[1].ClassifyId : 0;
-        } else {
-          ParentClassifyId = a.data.ParentId;
-        }
-      }
-
-      dataBaseInterface
-        .classifyMove({
-          ClassifyId: b.data.ClassifyId,
-          ParentClassifyId: ParentClassifyId,
-          PrevClassifyId: PrevClassifyId,
-          NextClassifyId: NextClassifyId,
-        })
-        .then((res) => {
-          if (res.Ret === 200) {
-            this.$message.success("移动成功!");
-          }
-        //   this.getTreeData();
-        });
-    },
-    // 移动的为指标
-    handleMoveEdb(b, a, i, e) {
-      let PrevEdbInfoId = 0,
-        NextEdbInfoId = 0,
-        targetIndex = 0,
-        list = a.parent.childNodes.map((_) => _.data);
-      if (i === "inner") {
-        PrevEdbInfoId = 0;
-        NextEdbInfoId = a.data.Children.length > 1 ? a.data.Children[1].EdbInfoId : 0;
-      } else {
-        list.forEach((item, index) => {
-          if (item.EdbInfoId === b.data.EdbInfoId) {
-            targetIndex = index;
-            return;
-          }
-        });
-
-        if (targetIndex === 0) {
-          PrevEdbInfoId = 0;
-          NextEdbInfoId = list[targetIndex + 1].EdbInfoId;
-        } else if (targetIndex === list.length - 1) {
-          PrevEdbInfoId = list[targetIndex - 1].EdbInfoId;
-          NextEdbInfoId = 0;
-        } else {
-          PrevEdbInfoId = list[targetIndex - 1].EdbInfoId;
-          NextEdbInfoId = list[targetIndex + 1].EdbInfoId;
-        }
-      }
-
-      dataBaseInterface
-        .targetMove({
-          ClassifyId: a.data.ClassifyId,
-          EdbInfoId: b.data.EdbInfoId,
-          PrevEdbInfoId: PrevEdbInfoId,
-          NextEdbInfoId: NextEdbInfoId,
-        })
-        .then((res) => {
-          if (res.Ret === 200) {
-            this.$message.success("移动成功!");
-          }
-        //   this.getTreeData();
-        });
-    },
-    // 懒加载目录数据
-    getLazyTreeData(node, resolve) {
-      //   console.log(node);
-      if (node.level === 0) {
-        resolve(this.treeData);
-      }else{
-        //获取数据,如果是指标的话设置isLeaf:true
-        let arr=[]
-
-        
-
-        resolve(arr)
-      }
-    },
-    // 获取一级目录
-    getTreeData(params) {
-      dataBaseInterface.targetCatalog({ParentId:0}).then((res) => {
-        if (res.Ret === 200) {
-          const arr = res.Data.AllNodes || [];
-          this.treeData = arr.map((item) => {
-            return {
-              ...item,
-              // isLeaf: item.Children.length ? false : true,
-            };
-          });
-          // this.CanOpClassify = res.Data.CanOpClassify;
-          // this.currentLang = res.Data.Language === 'EN' ? 'en' : 'ch';
-          // this.setLangIntoStore()
-          // this.showData = true;
-          // /* 处理树展开和选中图表 */
-          // params && this.selectCurrentNode(params);
-          // !params && this.select_node && this.$refs.menuTree.setCurrentKey(this.select_node);
-        }
-      });
-    },
-    //控制页面按钮权限
-    isEdbBtnShow(type) {
-      const { edbDataPermission, checkPermissionBtn } = this.permissionBtn;
-      const BtnMap = {
-        update: edbDataPermission.edbData_update, //指标更新
-        edit: edbDataPermission.edbData_edit, //指标编辑
-        /* 'toImg':edbDataPermission.edbData_toImgs, */
-        copyData: edbDataPermission.edbData_copyData, //复制数据
-        toSource: edbDataPermission.edbData_edbSource, //指标溯源
-        setEn: edbDataPermission.edbData_enNameSetting, //设置英文名称
-        newValue: edbDataPermission.edbData_newestValue, //添加/编辑最新值
-        refreshAll: edbDataPermission.edbData_refreshAll, //全部刷新
-        saveEdb: edbDataPermission.edbData_saveEdb, //保存指标
-        deleteEdb: edbDataPermission.edbData_deleteEdb, //删除指标
-        showChartBasis: edbDataPermission.edbData_showChartBasis, //展示/隐藏同比图
-        switchSeason: edbDataPermission.edbData_switchSeason, //切换季节性图
-        editLimit: edbDataPermission.edbData_editLimit, //编辑上下限
-        calculateAgain: edbDataPermission.edbData_calculateAgain, //重新计算
-
-        editCatalog: edbDataPermission.edbData_classifyOpt_add, //添加编辑目录
-        deleteCatalog: edbDataPermission.edbData_classifyOpt_delete, //删除目录
-        checkRelatedChart: edbDataPermission.edbData_checkRelatedChart, //查看关联图表
-        checkRelatedEdb: edbDataPermission.edbData_checkRelatedEdb, //查看关联指标
-        checkCalcChart: edbDataPermission.edbData_checkCalcChart, //查看计算指标
-      };
-      return checkPermissionBtn(BtnMap[type]);
-    },
-  },
-  mounted() {
-    this.$route.query.code ? this.getTreeData({ code: this.$route.query.code, id: this.$route.query.id, classifyId: this.$route.query.classifyId }) : this.getTreeData();
-  },
-};
-</script>

+ 6 - 1
src/views/dataEntry_manage/databaseComponents/batchComptedDialog.vue

@@ -249,6 +249,7 @@ export default {
 				label: 'ClassifyName',
 				value: 'ClassifyId',
 				children: 'Children',
+				checkStrictly: true
 			},
 			frequencyArr: ['日度', '周度','旬度', '月度', '季度', '年度'],
 			fre_options: ['天','周','月','季','年'],
@@ -374,14 +375,18 @@ export default {
 				: await dataBaseInterface.menuListV3()
 				if (res.Ret !== 200) return
 				//this.edbSource !== 'predict' && this.filterNodes(res.Data.AllNodes);
+				// this.options = res.Data.AllNodes || [];
+				
+				this.filterNodes(res.Data.AllNodes||[]);
 				this.options = res.Data.AllNodes || [];
+				
 		},
 		// 递归改变第三级目录结构
 		filterNodes(arr) {
 			arr.length &&
 				arr.forEach((item) => {
 					item.Children.length && this.filterNodes(item.Children);
-					if (item.Level === 2) {
+					if (!item.Children.length) {
 						delete item.Children;
 					}
 				});

+ 3 - 2
src/views/dataEntry_manage/databaseComponents/completeTargetDia.vue

@@ -117,6 +117,7 @@ export default {
 				label: 'ClassifyName',
 				value: 'ClassifyId',
 				children: 'Children',
+				checkStrictly: true
 			},
 			frequencyArr:['日度','周度','旬度','月度','季度','年度']
 		};
@@ -126,7 +127,7 @@ export default {
 		getMenu() {
 			dataBaseInterface.menuListV3().then(res => {
 				if(res.Ret === 200) {
-					//this.filterNodes(res.Data.AllNodes);
+					this.filterNodes(res.Data.AllNodes||[]);
 					this.options = res.Data.AllNodes || [];
 				}
 			})
@@ -135,7 +136,7 @@ export default {
 		filterNodes(arr) {
 			arr.length && arr.forEach(item => {
 				item.Children.length && this.filterNodes(item.Children)
-				if(item.Level === 2) {
+				if(!item.Children.length) {
 					delete item.Children
 				}
 			})

+ 3 - 2
src/views/dataEntry_manage/databaseComponents/computedDialog.vue

@@ -209,6 +209,7 @@ export default {
 				label: 'ClassifyName',
 				value: 'ClassifyId',
 				children: 'Children',
+				checkStrictly: true
 			},
 			frequencyArr: ['日度', '周度','旬度','月度', '季度', '年度'],
 			formRules,
@@ -260,7 +261,7 @@ export default {
 		getMenu() {
 			dataBaseInterface.menuListV3().then((res) => {
 				if (res.Ret === 200) {
-					//this.filterNodes(res.Data.AllNodes);
+					this.filterNodes(res.Data.AllNodes||[]);
 					this.options = res.Data.AllNodes || [];
 				}
 			});
@@ -270,7 +271,7 @@ export default {
 			arr.length &&
 				arr.forEach((item) => {
 					item.Children.length && this.filterNodes(item.Children);
-					if (item.Level === 2) {
+					if (!item.Children.length) {
 						delete item.Children;
 					}
 				});

+ 3 - 7
src/views/dataEntry_manage/databaseComponents/diffusionIndexDia.vue

@@ -225,6 +225,7 @@ export default {
 				label: 'ClassifyName',
 				value: 'ClassifyId',
 				children: 'Children',
+				checkStrictly: true
 			},
 			frequencyArr: ['日度', '周度','旬度', '月度', '季度', '年度'],
 			fre_options: ['天','周','月','季','年'],
@@ -328,12 +329,7 @@ export default {
       ? await preDictEdbInterface.classifyListV2()
       : await dataBaseInterface.menuListV3()
 				if (res.Ret === 200) {
-					/* if(!this.isPredict){
-						this.filterNodes(res.Data.AllNodes);
-						this.options = res.Data.AllNodes || [];
-					}else{
-						this.options = res.Data.AllNodes || [];
-					} */
+					this.filterNodes(res.Data.AllNodes||[]);
 					this.options = res.Data.AllNodes || [];
 				}
 		},
@@ -342,7 +338,7 @@ export default {
 			arr.length &&
 				arr.forEach((item) => {
 					item.Children.length && this.filterNodes(item.Children);
-					if (item.Level === 2) {
+					if (!item.Children.length) {
 						delete item.Children;
 					}
 				});

+ 5 - 7
src/views/dataEntry_manage/databaseComponents/fittingResidueDia.vue

@@ -276,6 +276,7 @@ export default {
 				label: 'ClassifyName',
 				value: 'ClassifyId',
 				children: 'Children',
+				checkStrictly: true
 			},
 			frequencyArr: ['日度', '周度','旬度', '月度', '季度', '年度'],
 			fre_options: ['天','周','月','季','年'],
@@ -350,13 +351,10 @@ export default {
 			const res=this.isPredict?await preDictEdbInterface.classifyListV2():await dataBaseInterface.menuListV3()
 			// dataBaseInterface.menuList().then((res) => {
 				if (res.Ret === 200) {
-					/* if(!this.isPredict){
-						this.filterNodes(res.Data.AllNodes);
-						this.options = res.Data.AllNodes || [];
-					}else{
-						this.options = res.Data.AllNodes || [];
-					} */
+					
+					this.filterNodes(res.Data.AllNodes);
 					this.options = res.Data.AllNodes || [];
+					
 				}
 			// });
 		},
@@ -365,7 +363,7 @@ export default {
 			arr.length &&
 				arr.forEach((item) => {
 					item.Children.length && this.filterNodes(item.Children);
-					if (item.Level === 2) {
+					if (!item.Children.length) {
 						delete item.Children;
 					}
 				});

+ 6 - 5
src/views/dataEntry_manage/databaseComponents/jointTargetDia.vue

@@ -157,6 +157,7 @@
 					label: 'ClassifyName',
 					value: 'ClassifyId',
 					children: 'Children',
+					checkStrictly: true
 				}"
 				style="width: 70%"
 				clearable
@@ -424,13 +425,13 @@ export default {
 			const res=this.isPredict?await preDictEdbInterface.classifyListV2():await dataBaseInterface.menuListV3()
 			// dataBaseInterface.menuList().then(res => {
 				if(res.Ret === 200) {
-					/* if(!this.isPredict){
-						this.filterNodes(res.Data.AllNodes);
+					if(!this.isPredict){
+						this.filterNodes(res.Data.AllNodes||[]);
 						this.menuOptions = res.Data.AllNodes || [];
 					}else{
 						this.menuOptions = res.Data.AllNodes || [];
-					} */
-					this.menuOptions = res.Data.AllNodes || [];
+					} 
+					// this.menuOptions = res.Data.AllNodes || [];
 				}
 			// })
 		},
@@ -438,7 +439,7 @@ export default {
 		filterNodes(arr) {
 			arr.length && arr.forEach(item => {
 				item.Children.length && this.filterNodes(item.Children)
-				if(item.Level === 2) {
+				if(!item.Children.length) {
 					delete item.Children
 				}
 			})

+ 1 - 27
src/views/dataEntry_manage/databaseComponents/openDialog.vue

@@ -21,32 +21,6 @@
 				label-width="80px"
 				:model="formData"
 				:rules="formRules">
-					<!-- 添加/编辑1级目录 -->
-					<!-- <template 
-					v-if="(title=='添加'&&formData.level === 0)
-					|| (title=='编辑'&&formData.level === 1)">
-						<el-form-item label="目录名称" prop="level_1">
-							<el-input
-							v-model="formData.level_1"
-							style="width: 80%"
-							placeholder="必填项"></el-input>
-						</el-form-item>
-					</template> -->
-					<!-- 添加/编辑2级目录 -->
-					<!-- <template 
-					v-else-if="(title=='添加'&&formData.level === 1)
-					|| (title=='编辑'&&formData.level === 2)">
-						<el-form-item label="一级目录" prop="level_1">
-							<span>{{formData.level_1}}</span>
-						</el-form-item>
-						<el-form-item label="目录名称" prop="level_2">
-							<el-input
-							v-model="formData.level_2"
-							style="width: 80%"
-							placeholder="必填项"></el-input>
-						</el-form-item>
-					</template> -->
-					<!-- 添加/编辑3级目录 -->
 					<template v-if="!formData.isEDB">
 						<el-form-item label="上级目录" v-if="formData.level>0">
 							<el-tooltip class="item" effect="dark" :content="getParentName" placement="top">
@@ -230,7 +204,7 @@ export default {
 		getMenu() {
 			dataBaseInterface.menuListV3().then(res => {
 				if(res.Ret === 200) {
-					this.filterNodes(res.Data.AllNodes);
+					this.filterNodes(res.Data.AllNodes||[]);
 					this.options = res.Data.AllNodes || [];
 				}
 			})

+ 3 - 2
src/views/dataEntry_manage/databaseComponents/operationDialog.vue

@@ -411,6 +411,7 @@ export default {
 				label: 'ClassifyName',
 				value: 'ClassifyId',
 				children: 'Children',
+				checkStrictly: true
 			},
 			frequencyArr: ['日度', '周度','旬度', '月度', '季度', '年度'],
 			fre_options: ['天','周','月','季','年'],
@@ -488,7 +489,7 @@ export default {
 		getMenu() {
 			dataBaseInterface.menuListV3().then((res) => {
 				if (res.Ret === 200) {
-					//this.filterNodes(res.Data.AllNodes);
+					this.filterNodes(res.Data.AllNodes||[]);
 					this.options = res.Data.AllNodes || [];
 				}
 			});
@@ -498,7 +499,7 @@ export default {
 			arr.length &&
 				arr.forEach((item) => {
 					item.Children.length && this.filterNodes(item.Children);
-					if (item.Level === 2) {
+					if (!item.Children.length) {
 						delete item.Children;
 					}
 				});

+ 18 - 1
src/views/dataEntry_manage/databaseComponents/smoothEdbDialog.vue

@@ -312,6 +312,7 @@ export default {
                 value: 'ClassifyId',
                 children: 'Children',
                 emitPath: false,
+                checkStrictly: true
             },
 
             select_target:'',
@@ -432,8 +433,24 @@ export default {
                 ? await preDictEdbInterface.classifyListV2()
                 : await dataBaseInterface.menuListV3()
             if(res.Ret!==200) return 
-            this.catalogArr = res.Data.AllNodes || [];
+            // this.catalogArr = res.Data.AllNodes || [];
+            if(!this.isPredict){
+				this.filterNodes(res.Data.AllNodes||[]);
+				this.catalogArr = res.Data.AllNodes || [];
+			}else{
+				this.catalogArr = res.Data.AllNodes || [];
+			} 
         },
+        // 递归改变第三级目录结构
+		filterNodes(arr) {
+			arr.length &&
+				arr.forEach((item) => {
+					item.Children.length && this.filterNodes(item.Children);
+					if (!item.Children.length) {
+						delete item.Children;
+					}
+				});
+		},
         /* 选择指标 */
         chooseTarget(val) {
             if(val) {

+ 80 - 124
src/views/dataEntry_manage/databaseList.vue

@@ -67,7 +67,7 @@
 						:allow-drop="canDropHandle"
 						:current-node-key="select_node"
 						:default-expanded-keys="defaultShowNodes"
-						draggable
+						:draggable="!isEdbBtnShow('moveCatalog')"
 						:expand-on-click-node="false"
 						check-strictly
 						empty-text="暂无目录"
@@ -119,7 +119,7 @@
 									alt=""
 									style="width: 14px; height: 14px; margin-right: 8px"
 									@click.stop="addNode(node,data)"
-									v-if="data.Button.AddButton&&isEdbBtnShow('editCatalog')"
+									v-if="data.Button.AddButton&&isEdbBtnShow('editCatalog')&&node.level<6"
 								/>
 								<!-- 编辑节点 如果是分类,判断data.Button.OpButton不变;如果是指标,不显示(ETA1.0.3) -->
 								<img
@@ -485,7 +485,6 @@ import EdbLabelList from '@/components/edbLabelList.vue';
 import chartTrendRender from './databaseComponents/chartTrendRender.vue';
 import edbDetailData from './databaseComponents/edbDetailData.vue';
 import SmoothEdbDialog from './databaseComponents/smoothEdbDialog.vue';
-import targetTree from './components/targetTree.vue';
 export default {
 	name: '',
 	components: {
@@ -510,7 +509,6 @@ export default {
 		chartTrendRender,
 		edbDetailData,
 		SmoothEdbDialog,
-		targetTree
 	},
 	directives: {
     drag(el, bindings) {
@@ -791,6 +789,7 @@ export default {
 
 				'editCatalog':edbDataPermission.edbData_classifyOpt_add,//添加编辑目录
 				'deleteCatalog':edbDataPermission.edbData_classifyOpt_delete,//删除目录
+				'moveCatalog':edbDataPermission.edbData_classifyOpt_move,//删除目录
 				'checkRelatedChart':edbDataPermission.edbData_checkRelatedChart,//查看关联图表
 				'checkRelatedEdb':edbDataPermission.edbData_checkRelatedEdb,//查看关联指标
 				'checkCalcChart':edbDataPermission.edbData_checkCalcChart,//查看计算指标
@@ -855,11 +854,15 @@ export default {
 						//将指标添加进标签列表中
 						const {EdbNameEn,EdbName,EdbInfoId,UniqueCode,ClassifyId}=res.Data.Item
 						this.addLabel({code:UniqueCode,id:EdbInfoId,classifyId:ClassifyId,EdbName,EdbNameEn})
-						this.defaultShowNodes=["82b85be0c8273579d9f3fb7f6e49335f","bda0a4909f21a54c418a9e5b541a0c16","f373231b9ac9fc5b077acabdd7bce2ea"]
-						// let deep_arr = _.cloneDeep(this.treeData);
-						// this.defaultShowNodes=this.findParentNodeHandle(deep_arr,ClassifyId).reverse()||[]
+						// 展开目录
+						this.defaultShowNodes=classify_arr.reverse().map(item=>item.UniqueCode)
 						//设置tree高亮
-						this.$refs.menuTree.setCurrentKey(UniqueCode);
+						this.$nextTick(()=>{
+							setTimeout(() => {
+								this.$refs.menuTree.setCurrentKey(UniqueCode);
+							}, 1000);
+						})
+						
 
 					}else {
 						this.tableData = [];
@@ -895,7 +898,7 @@ export default {
 							if(overBottom){
 								parent.scrollTop =  node.offsetTop - parent.offsetHeight/2
 							}
-						},400)
+						},1500)
 					})
 					
 				}
@@ -1153,7 +1156,7 @@ export default {
 		},
 		/* 添加节点 */
 		addNode(node,data) {
-			// console.log(node);
+			console.log(node);
 			this.dialog_title = '添加';
 			let arr=[]
 			arr=this.getNodeParentData(node,arr)
@@ -1173,6 +1176,7 @@ export default {
 		},
 		/* 编辑节点 */
 		editNode(node,data) {
+			// console.log(node);
 			this.dialog_title = '编辑';
 			if(data.EdbCode) {
 				/* 编辑指标 */
@@ -1180,15 +1184,15 @@ export default {
 					EdbInfoId: data.EdbInfoId
 				}).then(res => {
 					if(res.Ret === 200) {
+						// 处理所在目录
+						let menuArrId=res.Data.ClassifyList&&res.Data.ClassifyList.map(item=>{
+							return item.ClassifyId
+						}).reverse()
 						this.dialogForm = {
 							parentArr:[],
 							level: 0,
 							levelVal: res.Data.EdbName,
-							level_menu:[
-								// node.parent.parent.parent.data.ClassifyId,
-								// node.parent.parent.data.ClassifyId,
-								// node.parent.data.ClassifyId
-							],
+							level_menu:menuArrId||[],
 							edbinfo_id: res.Data.EdbInfoId,
 							frequency:res.Data.Frequency,
 							unit:res.Data.Unit,
@@ -1347,16 +1351,14 @@ export default {
 		/* 判断节点是否能被拖入 */
 		canDropHandle(draggingNode, dropNode, type) {
 			let canDrop=false
-			console.log(dropNode,type);
-			
 			
 			// 如果拖动的是指标
 			if(draggingNode.data.EdbCode){
-				if(dropNode.level!==0){
+				if(!(dropNode.level===1&&type!=='inner')){
 					canDrop=true
 				}
 			}else{//拖动的是目录
-				console.log(dropNode.level,draggingNode.level);
+				// console.log(dropNode.level,draggingNode.level);
 				//目录只能拖动到层级比他大的里面去
 				if(dropNode.level<draggingNode.level||(dropNode.level===draggingNode.level&&type!=='inner')){
 					canDrop=true
@@ -1367,119 +1369,75 @@ export default {
 		/* 拖拽完成 */
 		dropOverHandle(b,a,i,e) {
 			// 被拖拽节点对应的 Node、结束拖拽时最后进入的节点、被拖拽节点的放置位置
-			if(b.data.EdbCode){//指标
-				this.handleMoveEdb(b,a,i,e)
-			}else{
-				this.handleMoveCatalogue(b,a,i,e)
-			}
-			// if(b.level===1||b.level===2||b.level===3){
-			// 	this.handleMoveCatalogue(b,a,i,e)
-			// }
-
-			// // 指标层
-			// if(b.level===4){
-			// 	this.handleMoveEdb(b,a,i,e)
-			// }
-		},
-
-		// 移动的为一、二、三级目录
-		handleMoveCatalogue(b,a,i,e){
-			let list=a.parent.childNodes,targetIndex=0,PrevClassifyId=0,NextClassifyId=0,ParentClassifyId=0;
-
-			list.forEach((item,index)=>{
-				if(item.data.ClassifyId===b.data.ClassifyId){
-					targetIndex=index
-					return
-				}
-			})
-
-			if(targetIndex===0){
-				PrevClassifyId=0
-				NextClassifyId=list[targetIndex+1].data.ClassifyId
-			}else if(targetIndex===list.length-1){
-				PrevClassifyId=list[targetIndex-1].data.ClassifyId
-				NextClassifyId=0
-			}else{
-				PrevClassifyId=list[targetIndex-1].data.ClassifyId
-				NextClassifyId=list[targetIndex+1].data.ClassifyId
-			}
-
-			if(b.level===2){
-				if(i==='inner'){
-					ParentClassifyId=a.data.ClassifyId
-					PrevClassifyId=0
-					NextClassifyId=a.data.Children.length>1?a.data.Children[1].ClassifyId:0
-				}else{
-					ParentClassifyId=a.data.ParentId
-				}
-			}
-
-			if(b.level===3){
-				if(i==='inner'){
-					ParentClassifyId=a.data.ClassifyId
-					PrevClassifyId=0
-					NextClassifyId=a.data.Children.length>1?a.data.Children[1].ClassifyId:0
-				}else{
-					ParentClassifyId=a.data.ParentId
-				}
-			}
+			console.log(b,a,i);
+			const isEDB=b.data.EdbCode?true:false
+			let list=a.parent.childNodes;
+			let targetIndex=0,PrevClassifyId=0,NextClassifyId=0,ParentClassifyId=0;
+			let ClassifyId=0,EdbInfoId=0,PrevEdbInfoId=0,NextEdbInfoId=0;
 
-			dataBaseInterface.classifyMove({
-				ClassifyId:b.data.ClassifyId,
-				ParentClassifyId:ParentClassifyId,
-				PrevClassifyId:PrevClassifyId,
-				NextClassifyId:NextClassifyId
-			}).then(res=>{
-				if(res.Ret===200){
-					this.$message.success('移动成功!')
-				}
-				this.getTreeData();
-			})
-		},
+			ClassifyId=isEDB?0:b.data.ClassifyId
+			EdbInfoId=isEDB?b.data.EdbInfoId:0
+			ParentClassifyId=a.parent.data.ClassifyId||0
 
-		// 移动的为指标层 四级
-		handleMoveEdb(b,a,i,e){
-			let PrevEdbInfoId=0,NextEdbInfoId=0,targetIndex=0,list=a.parent.childNodes.map(_ => _.data)
-			if(i==='inner'){
-				PrevEdbInfoId=0
-				NextEdbInfoId=a.data.Children.length>1?a.data.Children[1].EdbInfoId:0
-			}else{
+			if(i!=='inner'){
 				list.forEach((item,index)=>{
-					if(item.EdbInfoId===b.data.EdbInfoId){
-						targetIndex=index
-						return
+					if(isEDB){
+						if(item.data.EdbInfoId===b.data.EdbInfoId){
+							targetIndex=index
+						}
+					}else{
+						if(item.data.ClassifyId===b.data.ClassifyId){
+							targetIndex=index
+						}
 					}
+					
 				})
 
+				console.log(targetIndex);
+				
+				
 				if(targetIndex===0){
-					PrevEdbInfoId=0
-					NextEdbInfoId=list[targetIndex+1].EdbInfoId
+					const data=list[targetIndex+1].data
+					NextClassifyId=data.EdbCode?0:data.ClassifyId
+					NextEdbInfoId=data.EdbCode?data.EdbInfoId:0
 				}else if(targetIndex===list.length-1){
-					PrevEdbInfoId=list[targetIndex-1].EdbInfoId
-					NextEdbInfoId=0
+					const data=list[targetIndex-1].data
+					PrevClassifyId=data.EdbCode?0:data.ClassifyId
+					PrevEdbInfoId=data.EdbCode?data.EdbInfoId:0
 				}else{
-					PrevEdbInfoId=list[targetIndex-1].EdbInfoId
-					NextEdbInfoId=list[targetIndex+1].EdbInfoId
+					const pData=list[targetIndex-1].data
+					PrevClassifyId=pData.EdbCode?0:pData.ClassifyId
+
+					PrevEdbInfoId=pData.EdbCode?pData.EdbInfoId:0
+
+					const nData=list[targetIndex+1].data
+					NextClassifyId=nData.EdbCode?0:nData.ClassifyId
+					NextEdbInfoId=nData.EdbCode?nData.EdbInfoId:0
 				}
-			}	
-			
-			dataBaseInterface.targetMove({
-				ClassifyId: a.data.ClassifyId,
-				EdbInfoId: b.data.EdbInfoId,
-				PrevEdbInfoId:PrevEdbInfoId,
-				NextEdbInfoId:NextEdbInfoId
-			}).then(res => {
-				if(res.Ret === 200) {
+			}
+
+			const params={
+				ClassifyId,
+				ParentClassifyId,
+				EdbInfoId,
+				PrevClassifyId,
+				NextClassifyId,
+				PrevEdbInfoId,
+				NextEdbInfoId
+			}
+			console.log(params);
+			dataBaseInterface.classifyMoveSort(params).then(res=>{
+				if(res.Ret===200){
 					this.$message.success('移动成功!')
 				}
-				this.getTreeData();
+				this.getTreeData()
 			})
 		},
 
 		/* 拖拽覆盖添加背景色 */
 		dropMouseOver(node1,node2,e) {
 			// 被拖拽节点对应的 Node、所进入节点对应的 Node、event
-			if(((node1.level===2&&node2.level === 1)||(node1.level===3&&node2.level === 2)) && (e.target.childNodes[0].className.includes('el-tree-node__content') 
+			if((node1.level>=node2.level) && (e.target.childNodes[0].className.includes('el-tree-node__content') 
 			|| e.target.className.includes('el-tree-node__content'))) {
 				// console.log(e.target.childNodes[0])
 				e.target.childNodes[0].className.includes('el-tree-node__content') 
@@ -1646,6 +1604,12 @@ export default {
 		/* 设置回显计算指标的表单 */
 		setComputedDialogForm(type,node,data,res,view=false) {
 			//指标运算 or 其他计算类型指标
+
+			// 处理所在目录
+			let menuArrId=res.EdbInfoDetail.ClassifyList&&res.EdbInfoDetail.ClassifyList.map(item=>{
+				return item.ClassifyId
+			}).reverse()
+
 			if( type === 4 ) {
 				/* 回显指标和表单 */
 				const list = res.CalculateList;
@@ -1664,11 +1628,7 @@ export default {
 				this.calulateForm =  {
 					edb_id:res.EdbInfoDetail.EdbInfoId,
 					formula: res.EdbInfoDetail.CalculateFormula,
-					menu: [
-						node.parent.parent.parent.data.ClassifyId,
-						node.parent.parent.data.ClassifyId,
-						data.ClassifyId
-					],
+					menu: menuArrId||[],
 					targetName: res.EdbInfoDetail.EdbName,
 					unit: res.EdbInfoDetail.Unit,
 					frequency: res.EdbInfoDetail.Frequency,
@@ -1683,11 +1643,7 @@ export default {
 					targetName: dataInfo.EdbName,
 					frequency: dataInfo.Frequency,
 					unit: dataInfo.Unit,
-					menu: [
-						node.parent.parent.parent.data.ClassifyId,
-						node.parent.parent.data.ClassifyId,
-						data.ClassifyId
-					],
+					menu: menuArrId||[],
 					view
 				}
 

+ 1 - 0
src/views/predictEdb_manage/addPredicEdb.vue

@@ -36,6 +36,7 @@
                         label: 'ClassifyName',
                         value: 'ClassifyId',
                         children: 'Children',
+                        checkStrictly: true
                     }"
                     style="width: 90%"
                     placeholder="请选择所属分类"

+ 22 - 12
src/views/predictEdb_manage/components/classifyDia.vue

@@ -19,18 +19,11 @@
 				:model="formData"
 				:rules="formRules">
 				
-				<!-- 添加一级目录的子分类/编辑二级目录时显示 -->
-				<template v-if="(title=='添加'&&formData.Level >= 1)||(title=='编辑'&&formData.Level >= 2)">
-					<el-form-item label="一级目录" prop="level_1_Name">
-						<span>{{formData.level_1_Name}}</span>
-					</el-form-item>
-				</template>
-				<!-- 添加二级目录的子分类/编辑三级目录时显示 -->
-				<template v-if="(title=='添加'&&formData.Level === 2)||(title=='编辑'&&formData.Level === 3)">
-					<el-form-item label="二级目录" prop="level_2_Name">
-						<span>{{formData.level_2_Name}}</span>
-					</el-form-item>
-				</template>
+				<el-form-item label="上级目录" v-if="formData.Level>0">
+					<el-tooltip class="item" effect="dark" :content="getParentName" placement="top">
+      					<span class="parentStr">{{getParentName}}</span>
+    				</el-tooltip>
+				</el-form-item>
 
 				<el-form-item label="目录名称" prop="classify_name">
 					<el-input
@@ -73,6 +66,16 @@ export default {
 			}
 		}
 	},
+	computed:{
+		getParentName(){
+			const arr=this.formData.parentArr||[]
+			let strArr=arr.reverse().map(item=>{
+				return item.classifyName
+			})
+			
+			return strArr.join('/')
+		}
+	},
 	data () {
 		return {			
 			formData: {},
@@ -113,6 +116,13 @@ export default {
 </script>
 <style lang='scss'>
 .predict-classify-dialog {
+	.parentStr{
+		display: block;
+		width: 304px;
+		overflow: hidden;
+		white-space: nowrap;
+		text-overflow: ellipsis;
+	}
 	.dialog-main {
 		padding-left: 50px;
 	}

+ 13 - 0
src/views/predictEdb_manage/components/computedDialog.vue

@@ -121,6 +121,7 @@
 							label: 'ClassifyName',
 							value: 'ClassifyId',
 							children: 'Children',
+							checkStrictly: true
 						}"
 						style="width: 90%"
 						placeholder="请选择所属分类"
@@ -266,11 +267,23 @@ export default {
 		};
 	},
 	methods: {
+		// 递归改变目录结构
+		filterNodes(arr) {
+			arr.length &&
+				arr.forEach((item) => {
+					item.Children.length && this.filterNodes(item.Children);
+					if (!item.Children.length) {
+						delete item.Children;
+					}
+				});
+		},
+
 		/* 获取目录结构 */
 		getMenu() {
 			preDictEdbInterface.classifyListV2().then(res => {
 				if(res.Ret !== 200) return
 
+				this.filterNodes(res.Data.AllNodes||[]);
 				this.options = res.Data.AllNodes || [];
 			}) 
 		},

+ 1 - 1
src/views/predictEdb_manage/components/edbDetail.vue

@@ -139,7 +139,7 @@ export default {
                 })
                 this.$emit('setOpera',res.Data.Button)
 
-                this.$emit('setCurrentClassify',res.Data.EdbInfo.ClassifyId)
+                this.$emit('setCurrentClassify',res.Data.EdbInfo.ClassifyList||[])
                 //更新图片
                 if(type==='updateImg' || !res.Data.EdbInfo.ChartImage) {
                     console.log(type);

+ 17 - 4
src/views/predictEdb_manage/components/operationDialog.vue

@@ -191,6 +191,7 @@
 									label: 'ClassifyName',
 									value: 'ClassifyId',
 									children: 'Children',
+									checkStrictly: true
 								}"
 								style="width: 90%"
 								placeholder="请选择所属分类"
@@ -490,13 +491,25 @@ export default {
 			this.searchApi(this.current_search,++this.search_page)
 		},
 
+		// 递归改变目录结构
+		filterNodes(arr) {
+			arr.length &&
+				arr.forEach((item) => {
+					item.Children.length && this.filterNodes(item.Children);
+					if (!item.Children.length) {
+						delete item.Children;
+					}
+				});
+		},
+
 		/* 获取目录结构 */
 		getMenu() {
-      preDictEdbInterface.classifyListV2().then(res => {
-        if(res.Ret !== 200) return
+			preDictEdbInterface.classifyListV2().then(res => {
+				if(res.Ret !== 200) return
 
-        this.options = res.Data.AllNodes || [];
-      }) 
+				this.filterNodes(res.Data.AllNodes||[]);
+				this.options = res.Data.AllNodes || [];
+			}) 
 		},
 
 		/* 获取指标数据 */

+ 63 - 82
src/views/predictEdb_manage/predictEdb.vue

@@ -56,7 +56,7 @@
 						:allow-drop="canDropHandle"
 						:current-node-key="select_node"
 						:default-expanded-keys="defaultShowNodes"
-						draggable
+						:draggable="isEdbBtnShow('edbPreData_classifyOpt_move')"
 						:expand-on-click-node="false"
 						check-strictly
 						empty-text="暂无分类"
@@ -106,7 +106,7 @@
 									alt=""
 									style="width: 14px; height: 14px; margin-right: 8px"
 									@click.stop="addNode(node, data)"
-									v-if="data.Button.AddButton&&!data.EdbInfoId&&isEdbBtnShow('edbPreData_classifyOpt_add')"
+									v-if="data.Button.AddButton&&!data.EdbInfoId&&isEdbBtnShow('edbPreData_classifyOpt_add')&&node.level<6"
 								/>
 								<!-- 编辑目录 -->
 								<img
@@ -704,43 +704,45 @@ export default {
 			const {predictEdbPermission,checkPermissionBtn}=this.permissionBtn
 			return checkPermissionBtn(predictEdbPermission[type])||false
 		},
-		setCurrentClassify(classifyId){
+		setCurrentClassify(ClassifyList){
 			//获取指标详情后才能拿到准确的classifyId
 			//根据准备的id查找指标的父级目录并展开
-			let deep_arr = _.cloneDeep(this.treeData);
-			let arr = this.findParentNodeHandle(deep_arr, classifyId).reverse();
-
-			this.defaultShowNodes = arr;
-			this.$refs.treeRef.setCurrentKey(this.select_node);
+			
+			// 展开目录
+			this.defaultShowNodes=ClassifyList.reverse().map(item=>item.UniqueCode)
+			
 
 			//滚动到高亮节点位置
 			this.$nextTick(()=>{
 				setTimeout(() => {
-				const dom = document.querySelector(".el-tree-node.is-current");
-				const parentDom = document.querySelector(".target_tree");
-				if (!dom || !parentDom) {
+					const dom = document.querySelector(".el-tree-node.is-current");
+					const parentDom = document.querySelector(".target_tree");
+					if (!dom || !parentDom) {
+						this.searchLoading = false;
+						return;
+					}
+					/* if (dom.offsetTop > parentDom.offsetHeight) {
+						parentDom.scrollTo({
+							top: dom.offsetTop - parentDom.offsetHeight / 2,
+							left: 0,
+							behavior: "smooth",
+						});
+					} */
+					//parent可视区间:[scrollTop,scrollTop+offsetHeight]
+					//node位置:node.offsetTop
+					const overTop = dom.offsetTop+dom.clientHeight<parentDom.scrollTop
+					const overBottom = dom.offsetTop+dom.clientHeight+30>parentDom.scrollTop+parentDom.offsetHeight
+					if(overTop){
+						parentDom.scrollTop = dom.offsetTop-30
+					}
+					if(overBottom){
+						parentDom.scrollTop =  dom.offsetTop - parentDom.offsetHeight/2
+					}
 					this.searchLoading = false;
-					return;
-				}
-				/* if (dom.offsetTop > parentDom.offsetHeight) {
-					parentDom.scrollTo({
-						top: dom.offsetTop - parentDom.offsetHeight / 2,
-						left: 0,
-						behavior: "smooth",
-					});
-				} */
-				//parent可视区间:[scrollTop,scrollTop+offsetHeight]
-				//node位置:node.offsetTop
-				const overTop = dom.offsetTop+dom.clientHeight<parentDom.scrollTop
-				const overBottom = dom.offsetTop+dom.clientHeight+30>parentDom.scrollTop+parentDom.offsetHeight
-				if(overTop){
-					parentDom.scrollTop = dom.offsetTop-30
-				}
-				if(overBottom){
-					parentDom.scrollTop =  dom.offsetTop - parentDom.offsetHeight/2
-				}
-				this.searchLoading = false;
-			}, 300);
+				}, 300);
+				setTimeout(() => {
+					this.$refs.treeRef.setCurrentKey(this.select_node);//设置高亮
+				}, 1500);
 			})
 		},
 		setNameBack({edb_name,edb_nameEn,userid}) {
@@ -759,7 +761,7 @@ export default {
 
 		/* 获取分类 */
 		getTreeData(params=null) {
-			preDictEdbInterface.classifyListV2({IsOnlyMe:this.isOnlyMe||false}).then(res => {
+			preDictEdbInterface.predictEdbCatalog({IsOnlyMe:this.isOnlyMe||false,ParentId:0}).then(res => {
 				const { Ret,Data } = res;
 				
 				if(Ret !== 200) return
@@ -851,23 +853,23 @@ export default {
 			}
 			this.classifyDia = true;
 		},
+		// 递归节点
+		getNodeParentData(data,arr){
+			if(data.level===0) return
+			arr.push({classifyName:data.data.ClassifyName,classifyId:data.data.ClassifyId})
+			this.getNodeParentData(data.parent,arr)
+			return arr
+		},
 		addNode(node,{ClassifyName,ClassifyId}){
 			this.dialog_title = '添加'
+			let arr=[]
+			arr=this.getNodeParentData(node,arr)
 			/* 添加目录 */
 			this.classifyForm = {
 				classify_name:'',
 				Level:node.level,
 				ParentId:ClassifyId,
-				level_1_Name:node.level === 1
-				? ClassifyName
-				: node.level === 2
-				? node.parent.data.ClassifyName
-				: node.parent.parent.data.ClassifyName,
-				level_2_Name:node.level === 1
-				? ''
-				: node.level === 2
-				? ClassifyName
-				: node.parent.data.ClassifyName,
+				parentArr:arr,
 			}
 			this.classifyDia = true;
 		},
@@ -875,22 +877,15 @@ export default {
     editNode(node, { ClassifyName,ClassifyId,Level,ParentId}) {
 
       this.dialog_title = '编辑';
+	  let arr=[]
+	  arr=this.getNodeParentData(node.parent,arr)
       /* 编辑目录 */
       this.classifyForm = {
         classify_name: ClassifyName,
         classify_id: ClassifyId,
-        Level:node.level,
+        Level:node.level-1,
         ParentId:ParentId,
-        level_1_Name:node.level === 1
-            ? ClassifyName
-            : node.level === 2
-            ? node.parent.data.ClassifyName
-            : node.parent.parent.data.ClassifyName,
-        level_2_Name:node.level === 1
-            ? ''
-            : node.level === 2
-            ? ClassifyName
-            : node.parent.data.ClassifyName,
+        parentArr:arr,
       };
       this.classifyDia = true;
     },
@@ -1367,38 +1362,24 @@ export default {
       this.getPublicList();
     },
 		//懒加载el-tree
-		getLazyTreeData(node,resolve,maxLevel=3){
+		async getLazyTreeData(node,resolve,maxLevel=3){
 			if(node.level===0){
-					resolve(this.treeData)
-				}
-				if(node.level>0&&node.level<=maxLevel){
-					//获取对应层级的Child
-					resolve(node.data.Children||[])
-				}
-				if(node.level===maxLevel){
-					//调接口获取该分类下图表的数据
-					preDictEdbInterface.classifyChartList({
-						ClassifyId:node.data.ClassifyId,
-						IsShowMe:this.isOnlyMe
-					}).then(res=>{
-						if(res.Ret===200){
-							let arr=res.Data.EdbInfoList||[]
-							arr=arr.map(item=>{
-								return {
-									...item,
-									isLeaf:true
-								}
-							})
-							resolve(arr)
-						}else{
-							resolve([])
+				resolve(this.treeData)
+			}else{
+				let arr=[]
+				const res=await preDictEdbInterface.predictEdbCatalog({IsOnlyMe:this.isOnlyMe||false,ParentId:node.data.ClassifyId})
+				if (res.Ret === 200) {
+					const temarr = res.Data.AllNodes || [];
+					arr=temarr.map(item=>{
+						return {
+							...item,
+							isLeaf:item.EdbInfoId?true:false
 						}
-						this.changeTreeNode()
 					})
 				}
-				if(node.level>maxLevel){
-					resolve([])
-				}
+				resolve(arr)
+			}
+				
 		},
 		changeTreeNode(){
 			this.$refs.treeRef.setCurrentKey(this.select_node);