|
@@ -755,7 +755,7 @@ let analyzer = {
|
|
|
let expr = me.standard(dispExpr);
|
|
|
let invalidChars = /[^0-9\u4e00-\u9fa5\+\-\*\/\(\)\.\[\]FL%]/g;
|
|
|
if (invalidChars.test(expr)){
|
|
|
- alert('表达式中含有无效的字符!');
|
|
|
+ hintBox.infoBox('系数提示','表达式中含有无效的字符!',1);
|
|
|
return false;
|
|
|
};
|
|
|
|
|
@@ -764,26 +764,26 @@ let analyzer = {
|
|
|
let pattBase = new RegExp(/\[[\u4E00-\u9FA5]+\]/gi);
|
|
|
let arrBase = expr.match(pattBase);
|
|
|
if (arrCn && !arrBase){
|
|
|
- alert('定额基数必须用中括号[]括起来!');
|
|
|
+ hintBox.infoBox('系统提示', '定额基数必须用中括号[]括起来!', 1);
|
|
|
return false;
|
|
|
};
|
|
|
if (arrCn && arrBase && (arrCn.length != arrBase.length)){
|
|
|
for (let cn of arrCn){
|
|
|
let tempBase = `[${cn}]`;
|
|
|
if (!arrBase.includes(tempBase)){
|
|
|
- alert(`定额基数“${cn}”必须用中括号[]括起来!`);
|
|
|
+ hintBox.infoBox('系统提示', `定额基数“${cn}”必须用中括号[]括起来!`, 1);
|
|
|
return false;
|
|
|
}
|
|
|
};
|
|
|
// 这里要加一个保险。因为上面的 for 循环在“主材费 + [主材费]” 情况下有Bug
|
|
|
- alert('定额基数必须用中括号[]括起来!');
|
|
|
+ hintBox.infoBox('系统提示', '定额基数必须用中括号[]括起来!', 1);
|
|
|
return false;
|
|
|
};
|
|
|
if (arrBase){
|
|
|
for (let base of arrBase){
|
|
|
let baseName = base.slice(1, -1);
|
|
|
if (!rationCalcBases[baseName]){
|
|
|
- alert('定额基数 [' + baseName + '] 末定义!');
|
|
|
+ hintBox.infoBox('系统提示', '定额基数 [' + baseName + '] 末定义!', 1);
|
|
|
return false;
|
|
|
}
|
|
|
};
|
|
@@ -793,14 +793,15 @@ let analyzer = {
|
|
|
for (let F of arrF){
|
|
|
let num = F.slice(1);
|
|
|
if (num > template.calcItems.length){
|
|
|
- alert('表达式中 “F'+ num +'” 行号引用错误!');
|
|
|
+ let s = hintBox.font('F'+num);
|
|
|
+ hintBox.infoBox('系统提示', `表达式中 “${s}” 行号引用错误!`, 1);
|
|
|
return false;
|
|
|
};
|
|
|
};
|
|
|
|
|
|
let expression = me.getExpression(expr, template);
|
|
|
if (me.isCycleCalc(expression, itemID, template)){
|
|
|
- alert('表达式中有循环计算!');
|
|
|
+ hintBox.infoBox('系统提示', '表达式中有循环计算!', 1);
|
|
|
return false;
|
|
|
}
|
|
|
|
|
@@ -973,7 +974,7 @@ let executeObj = {
|
|
|
return calcTools.marketPriceToBase(me.treeNode, baseName)
|
|
|
else{
|
|
|
if (!rationCalcBases[baseName]){
|
|
|
- alert('定额基数“' + baseName + '”末定义,计算错误。 (模板 ' + me.template.ID + ',规则 ' + me.tempCalcItem.ID +')');
|
|
|
+ hintBox.infoBox('系统提示', '定额基数“' + baseName + '”末定义,计算错误。 (模板 ' + me.template.ID + ',规则 ' + me.tempCalcItem.ID +')', 1);
|
|
|
return 0;
|
|
|
}
|
|
|
else
|