Răsfoiți Sursa

Merge branch 'debug' of http://8.136.199.33:3000/eta_gn_front/eta_front into debug

shanbinzhang 1 lună în urmă
părinte
comite
bc359f53dd

+ 1 - 0
src/utils/buttonConfig.js

@@ -457,6 +457,7 @@ export const chartLibPermission = {
     // chartLib_publicClassifyOpt_edit: 'chartLib:publicClassifyOpt:edit',//公开目录编辑
     chartLib_publicClassifyOpt_del: 'chartLib:publicClassifyOpt:del',//公开目录删除
     chartLib_publicClassifyOpt_batch_move: 'chartLib:publicClassifyOpt:batch:move',//公开目录批量移动
+    chartLib_move: 'chartLib:move', // 移动图表
 }
 
 /*

+ 9 - 2
src/views/dataEntry_manage/chartSetting.vue

@@ -125,7 +125,7 @@
                             src="~@/assets/img/data_m/move_ico.png"
                             alt=""
                             style="width: 14px; height: 14px; margin-right: 8px"
-                            v-if="data.Button.MoveButton"
+                            v-if="classifyShowType === 'own' ? data.Button.MoveButton : isMoveChartShow()"
                           />
                           <!-- 添加子项 -->
                           <img
@@ -1066,6 +1066,12 @@ export default {
 			return BtnMap[key] ? checkPermissionBtn(BtnMap[key]) : checkPermissionBtn(chartLibPermission[key]);
 		},
 
+    //移动图表是否展示
+    isMoveChartShow() {
+      return this.permissionBtn.checkPermissionBtn(
+        this.permissionBtn.chartLibPermission.chartLib_move
+      )
+    },
 
     /* 获取目录 我的/公共目录 */
     async getTreeData(params) {
@@ -1319,7 +1325,8 @@ export default {
     /* 判断节点是否能被拖拽 */
     canDragHandle(node) {
       let canMove = false;
-      if (node.data.Button.MoveButton) {
+      const {chartLibPermission,checkPermissionBtn} = this.permissionBtn
+      if (this.classifyShowType === 'own' ? node.data.Button.MoveButton : checkPermissionBtn(chartLibPermission.chartLib_move)) {
         canMove = true;
       }
       return canMove;

+ 26 - 8
src/views/ppt_manage/newVersion/components/editor/InsertPageDialog.vue

@@ -120,22 +120,40 @@ export default {
     },
     searchTitle(newVal){
       if(!newVal) return
-      let data = null
-      this.privateList.forEach((item)=>{
-        item.children.forEach(i=>{
-          if(i.PptId===newVal){
-            data = i
-          }
-        })
-      })
+      let data = this.findPptById(this.privateList || [],newVal) || {};
       this.$refs.privateTree.setCurrentKey('ppt'+newVal)
       const node = this.$refs.privateTree.getCurrentNode()
+      if(!node) return;
       !this.privateExpandKeys.includes(node.catalogId)&&this.privateExpandKeys.push(node.catalogId)
       this.choosedItem = data
       this.searchOptions=[]
     }
   },
   methods: {
+    findPptById(data, newVal){
+      let result = null;
+      function traverse(node) {
+          if (!node || result) return;
+
+          if (node.PptId == newVal) {
+            result = node;
+            return;
+          }
+
+          if (Array.isArray(node.children)) {
+            for (const child of node.children) {
+              traverse(child);
+              if (result) break;
+            }
+          }
+      }
+
+      for (const item of data) {
+        traverse(item);
+        if (result) break;
+      }
+      return result;
+    },
     cancelHandle(){this.$emit('cancel')},
     saveHandle(){
       if(this.value.length===0){