瀏覽代碼

基础树结构显示调整

MaiXinRong 2 年之前
父節點
當前提交
0b75e23923
共有 3 個文件被更改,包括 7 次插入29 次删除
  1. 7 4
      app/public/js/path_tree.js
  2. 0 15
      app/public/js/revise_price.js
  3. 0 10
      app/public/js/spreadjs_rela/spreadjs_zh.js

+ 7 - 4
app/public/js/path_tree.js

@@ -393,6 +393,7 @@ const createNewPathTree = function (type, setting) {
             for (const d of this.datas) {
                 d.filter = defaultValue;
             }
+            const parents = [];
             for (const s of this.select) {
                 const node = this.getItems(s);
                 if (!node) continue;
@@ -401,10 +402,12 @@ const createNewPathTree = function (type, setting) {
                 for (const p of posterity) {
                     p.filter = !defaultValue;
                 }
-                const parents = this.getAllParents(node);
-                for (const p of parents) {
-                    p.filter = !defaultValue;
-                }
+                parents.push(...this.getAllParents(node));
+            }
+            parents.sort((x, y) => { return y.level - x.level});
+            for (const parent of parents) {
+                parent.filter = !parent.children.find(x => { return !x.filter });
+
             }
             for (const node of this.nodes) {
                 const parent = this.getParent(node);

+ 0 - 15
app/public/js/revise_price.js

@@ -528,21 +528,6 @@ $(document).ready(() => {
                         return !readOnly;
                     }
                 },
-                noRelaBw: {
-                    name: '不应用于任何部位',
-                    icon: 'fa-unlink',
-                    callback: function (key, opt) {
-                        const price = SpreadJsObj.getSelectObject(priceSheet);
-                        priceOprObj.updateRelaLid(price, '-1');
-                    },
-                    disabled: function (key, opt) {
-                        const node = SpreadJsObj.getSelectObject(priceSheet);
-                        return !node;
-                    },
-                    visible: function (key, opt) {
-                        return !readOnly;
-                    }
-                },
                 chooseRelaChange: {
                     name: '选择应用变更令',
                     icon: 'fa-link',

+ 0 - 10
app/public/js/spreadjs_rela/spreadjs_zh.js

@@ -1190,16 +1190,6 @@ const SpreadJsObj = {
                 sheet.setRowVisible(iRow, true);
             }
         }
-        // if (sheet.zh_tree) {
-        //     for (const iRow in sheet.zh_tree.nodes) {
-        //         const node = sheet.zh_tree.nodes[iRow];
-        //         if (node.visible !== undefined && node.visible !== null) {
-        //             sheet.setRowVisible(iRow, node.visible);
-        //         } else {
-        //             sheet.setRowVisible(iRow, true);
-        //         }
-        //     }
-        // }
         this.endMassOperation(sheet);
     },
     refreshColumnAlign: function (sheet) {