cloud-web-corejs 1.0.54-dev.414 → 1.0.54-dev.416
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -200,7 +200,7 @@ export function baseReplaceFieldsAndFunctionsOfFormula(VFR, formulaFieldRef, for
|
|
|
200
200
|
//是否要考虑字符串值的替换??
|
|
201
201
|
// resultFormula = resultFormula.replace(mi, fieldRef.currentValue)
|
|
202
202
|
let fieldKeyName = getFieldKeyName(fieldSchema)
|
|
203
|
-
let value = fieldRef.formModel[fieldKeyName];
|
|
203
|
+
let value = fieldRef.formModel[fieldKeyName]??null;
|
|
204
204
|
resultFormula = resultFormula.replace(mi, value)
|
|
205
205
|
} else { //getWidgetRef找不到,则可能是子表单字段
|
|
206
206
|
const subFormNameOfField = VFR.getSubFormNameOfWidget(fieldSchema.options.name)
|
|
@@ -208,7 +208,7 @@ export function baseReplaceFieldsAndFunctionsOfFormula(VFR, formulaFieldRef, for
|
|
|
208
208
|
/* 如果当前计算字段是子表单字段,要判断公式中的子表单字段是否和当前计算字段是否属于同一子表单!! */
|
|
209
209
|
if(row){
|
|
210
210
|
let fieldKeyName = getFieldKeyName(fieldSchema)
|
|
211
|
-
let value = row[fieldKeyName];
|
|
211
|
+
let value = row[fieldKeyName]??null;
|
|
212
212
|
resultFormula = resultFormula.replaceAll(mi, value)
|
|
213
213
|
/*
|
|
214
214
|
let subFormRowId = row._X_ROW_KEY
|
|
@@ -225,7 +225,7 @@ export function baseReplaceFieldsAndFunctionsOfFormula(VFR, formulaFieldRef, for
|
|
|
225
225
|
let subFormRowId = formulaFieldRef.tableParam.row._X_ROW_KEY
|
|
226
226
|
fieldRef = VFR.getWidgetRef(fieldSchema.options.name + '_' + subFormRowId)
|
|
227
227
|
if (!!fieldRef) {
|
|
228
|
-
let value = fieldRef.currentValue;
|
|
228
|
+
let value = fieldRef.currentValue??null;
|
|
229
229
|
resultFormula = resultFormula.replaceAll(mi, value)
|
|
230
230
|
} else {
|
|
231
231
|
quitFlag = true
|
|
@@ -251,7 +251,8 @@ export function baseReplaceFieldsAndFunctionsOfFormula(VFR, formulaFieldRef, for
|
|
|
251
251
|
// const subFieldName = fieldSchema.options.name
|
|
252
252
|
const subFieldName = fieldKeyName(fieldSchema)
|
|
253
253
|
subFormValue.forEach((vi, idx) => {
|
|
254
|
-
|
|
254
|
+
let val = vi[subFieldName]??null
|
|
255
|
+
allSubFieldValues = (idx === 0) ? val : allSubFieldValues + ', ' + val
|
|
255
256
|
})
|
|
256
257
|
resultFormula = resultFormula.replaceAll(mi, allSubFieldValues)
|
|
257
258
|
}
|