Browse Source

补充查找定位可选项目节功能

laiguoran 3 years ago
parent
commit
7fccecc608
2 changed files with 7 additions and 2 deletions
  1. 1 1
      app/public/js/change_revise.js
  2. 6 1
      app/public/js/shares/cs_tools.js

+ 1 - 1
app/public/js/change_revise.js

@@ -2479,7 +2479,7 @@ $(document).ready(() => {
                         },
                         customSearch: [
                             {
-                                key: 'revise', title: '新增部位', valid: true,
+                                key: 'revise', title: '新增部位', valid: true, parent: true,
                                 check: function (node) {
                                     if (node.ccid || node.cid) {
                                         return true;

+ 6 - 1
app/public/js/shares/cs_tools.js

@@ -546,14 +546,19 @@ const showSelectTab = function(select, spread, afterShow) {
             const cs = setting.customSearch.find(function (x) {return x.key === key});
             return cs ? cs.check : null;
         };
+        const getParantFun = function (key) {
+            const cs = setting.customSearch.find(function (x) {return x.key === key});
+            return cs && cs.parent !== undefined ? cs.parent : false;
+        };
         const searchCustom = function (key) {
             const keyword = $('#searchKeyword', obj).val();
             const keyNum = _.toNumber(keyword);
             const checkFun = getCheckFun(key);
             searchResult = [];
             const sortData = SpreadJsObj.getSortData(searchSheet);
+            const parantFun = getParantFun(key);
             for (const node of sortData) {
-                if (node.children && node.children.length > 0) continue;
+                if (node.children && node.children.length > 0 && !parantFun) continue;
                 if (checkFun && checkFun(node)) {
                     if (!keyword ||
                         (node.code && node.code.indexOf(keyword) > -1) ||