|
@@ -969,8 +969,13 @@ export default {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ let lastEle = this.selectEleFormula[this.selectEleFormula.length-1];
|
|
|
|
+ if(this.selectEleFormula.length == 0 && lastEle.type == 'Operator' && lastEle.type == 'Brackets' && lastEle.name == '('){ /* 存在运算符 */
|
|
|
|
+ this.eleAddFormulaHandle(item);
|
|
|
|
+ } else {
|
|
|
|
+ this.itemList.push(item);
|
|
|
|
+ }
|
|
|
|
|
|
- this.itemList.push(item);
|
|
|
|
}else{
|
|
}else{
|
|
let index = -1;
|
|
let index = -1;
|
|
for (let i = 0; i < this.itemList.length; i++) {
|
|
for (let i = 0; i < this.itemList.length; i++) {
|
|
@@ -987,11 +992,11 @@ export default {
|
|
//快捷添加运算符号
|
|
//快捷添加运算符号
|
|
addOperator(operator){
|
|
addOperator(operator){
|
|
|
|
|
|
-
|
|
|
|
|
|
+
|
|
if( this.itemList.length>0){
|
|
if( this.itemList.length>0){
|
|
this.itemList.forEach(e => {
|
|
this.itemList.forEach(e => {
|
|
let lastEle = this.selectEleFormula[this.selectEleFormula.length-1];
|
|
let lastEle = this.selectEleFormula[this.selectEleFormula.length-1];
|
|
- if(this.selectEleFormula.length != 0 && lastEle.type != 'Operator' && lastEle.type != 'Brackets' && lastEle.name != '('){
|
|
|
|
|
|
+ if(this.selectEleFormula.length != 0 && lastEle.type != 'Operator' && lastEle.type != 'Brackets' && lastEle.name != '('){ /* 不存在运算符 */
|
|
this.eleAddFormulaHandle(this.formulaMap[operator]);
|
|
this.eleAddFormulaHandle(this.formulaMap[operator]);
|
|
}
|
|
}
|
|
this.eleAddFormulaHandle(e);
|
|
this.eleAddFormulaHandle(e);
|