|
@@ -134,6 +134,7 @@ $(document).ready(() => {
|
|
|
this.addBase = add;
|
|
|
this.orderReg = /f\d+/ig;
|
|
|
this.nodeReg = /<<[a-z0-9\-]+>>/ig;
|
|
|
+ this.firstNodeReg = /^<<[a-z0-9\-]+>>/ig;
|
|
|
}
|
|
|
hasBase(expr) {
|
|
|
if (!expr) return false;
|
|
@@ -177,7 +178,7 @@ $(document).ready(() => {
|
|
|
base = '';
|
|
|
}
|
|
|
num = num + expr[i];
|
|
|
- } else if (this.nodeReg.test(subExpr)) {
|
|
|
+ } else if (this.firstNodeReg.test(subExpr)) {
|
|
|
if (num !== '') {
|
|
|
param.push({type: 'num', value: num});
|
|
|
num = '';
|
|
@@ -187,7 +188,7 @@ $(document).ready(() => {
|
|
|
base = '';
|
|
|
}
|
|
|
// const node = this.nodeReg.exec(subExpr);
|
|
|
- const node = subExpr.match(this.nodeReg);
|
|
|
+ const node = subExpr.match(this.firstNodeReg);
|
|
|
param.push({type: 'node', value: node[0]});
|
|
|
i = i + node[0].length - 1;
|
|
|
} else if (/^[a-z]/.test(expr[i])) {
|
|
@@ -287,6 +288,7 @@ $(document).ready(() => {
|
|
|
}
|
|
|
if (p.type === 'left') {
|
|
|
iLeftCount += 1;
|
|
|
+ // if (i !== 0 && (param[i-1].type !== 'calc' || param[i-1].type !== 'left'))
|
|
|
if (i !== 0 && param[i-1].type !== 'calc')
|
|
|
return [false, '输入的表达式非法:(前应有运算符'];
|
|
|
}
|
|
@@ -510,6 +512,19 @@ $(document).ready(() => {
|
|
|
colWidth: true,
|
|
|
},
|
|
|
pos: SpreadJsObj.getObjPos($('#pay-spread')[0]),
|
|
|
+ getColor: function (sheet, data, row, col, defaultColor) {
|
|
|
+ if (!data) return defaultColor;
|
|
|
+
|
|
|
+ if (data.expr && data.expr.indexOf('#ref!') >= 0) {
|
|
|
+ return spreadColor.pay.expr_err;
|
|
|
+ } else if (data.is_pause) {
|
|
|
+ return '#f2f2f2';
|
|
|
+ } else if (data.create_phase_order > 1 && data.create_phase_order === phasePay.phase_order) {
|
|
|
+ return '#FFFFE1';
|
|
|
+ } else {
|
|
|
+ return defaultColor;
|
|
|
+ }
|
|
|
+ }
|
|
|
};
|
|
|
sjsSettingObj.setFxTreeStyle(spreadSetting, sjsSettingObj.FxTreeStyle.phasePay);
|
|
|
SpreadJsObj.initSheet(sheet, spreadSetting);
|