|
@@ -953,8 +953,18 @@ let analyzer = {
|
|
|
return template.calcItems[idx];
|
|
|
},
|
|
|
isCycleCalc: function (expression, ID, template) { // 这里判断expression,是ID引用: @5+@6
|
|
|
- if (expression.includes(`@${ID}`))
|
|
|
- return true;
|
|
|
+ let atID = `@${ID}`;
|
|
|
+ // 避免部分匹配,如:@10匹配@1
|
|
|
+ let idx = expression.indexOf(atID);
|
|
|
+ if (idx >= 0){
|
|
|
+ let nextPos = idx + atID.length;
|
|
|
+ if (nextPos >= expression.length)
|
|
|
+ return true;
|
|
|
+
|
|
|
+ let char = expression.charAt(nextPos);
|
|
|
+ if (!char.isNumberStr())
|
|
|
+ return true;
|
|
|
+ };
|
|
|
|
|
|
let atIDs = analyzer.getAtIDArr(expression);
|
|
|
for (let atID of atIDs) {
|