对小工具进行了一些修复
This commit is contained in:
1 parent
e877ceb560
commit
bb9413cba6
15 files changed
+463
-136
No files matched your search
@@ -19,9 +19,21 @@
|
||||
function dependencyVisible(rule, current) {
|
||||
rule = parseDependency(rule);
|
||||
if (rule.length < 3) return true;
|
||||
var expected = String(rule[2]);
|
||||
var actual = String(current == null ? '' : current);
|
||||
return rule[1] === '==' ? actual === expected : actual !== expected;
|
||||
if (Array.isArray(rule[0])) {
|
||||
return rule.every(function (part) { return dependencyVisible(part, current && typeof current === 'object' ? current[part[0]] : ''); });
|
||||
}
|
||||
var ids = String(rule[0]).split('|');
|
||||
var operators = String(rule[1]).split('|');
|
||||
var expected = String(rule[2]).split('|');
|
||||
var values = current && typeof current === 'object' ? current : Object.fromEntries([[ids[0], current]]);
|
||||
return ids.every(function (id, index) {
|
||||
var actual = String(values[id] == null ? '' : values[id]);
|
||||
var wanted = String(expected[index] == null ? expected[0] : expected[index]);
|
||||
var operator = operators[index] || operators[0] || '!=';
|
||||
if (operator === '==') return actual === wanted;
|
||||
if (operator === 'any') return wanted.split(',').indexOf(actual) !== -1;
|
||||
return actual !== wanted;
|
||||
});
|
||||
}
|
||||
|
||||
function replaceRepeaterIndexes(name, rowIndexes) {
|
||||
|
||||
Reference in new issue
Block a user