MaiXinRong преди 2 месеца
родител
ревизия
0314751755
променени са 1 файла, в които са добавени 6 реда и са изтрити 1 реда
  1. 6 1
      app/public/js/sp_setting_permission.js

+ 6 - 1
app/public/js/sp_setting_permission.js

@@ -19,7 +19,12 @@ $(document).ready(() => {
                 html.push('<tr>');
             }
         }
-        const noCompanyAccount = accountList.filter(x => { return !x.company; });
+        const noCompanyAccount = accountList.filter(x => {
+            if (!x.company) return true;
+            const unit = accountGroup.find(x => { return x.name === x.company; });
+            if (unit) return false;
+            return keyword ? x.role.indexOf(keyword) >= 0 || x.name.indexOf(keyword) >= 0 : true;
+        });
         for (const u of noCompanyAccount) {
             html.push(`<tr class="text-center table-secondary">`);
             html.push(`<td><input type="checkbox" name="sel-batch-check" id="${u.id}" unit="${selectGroup.name}" ${(u.select ? 'checked' : '')} disabled></td>`);