cloud-web-corejs 1.0.54-dev.413 → 1.0.54-dev.414
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
|
@@ -198,7 +198,7 @@ export function baseReplaceFieldsAndFunctionsOfFormula(VFR, formulaFieldRef, for
|
|
|
198
198
|
let fieldRef = VFR.getWidgetRef(fieldSchema.options.name)
|
|
199
199
|
if (!!fieldRef) {
|
|
200
200
|
//是否要考虑字符串值的替换??
|
|
201
|
-
// resultFormula = resultFormula.replace(mi, fieldRef.
|
|
201
|
+
// resultFormula = resultFormula.replace(mi, fieldRef.currentValue)
|
|
202
202
|
let fieldKeyName = getFieldKeyName(fieldSchema)
|
|
203
203
|
let value = fieldRef.formModel[fieldKeyName];
|
|
204
204
|
resultFormula = resultFormula.replace(mi, value)
|
|
@@ -214,7 +214,7 @@ export function baseReplaceFieldsAndFunctionsOfFormula(VFR, formulaFieldRef, for
|
|
|
214
214
|
let subFormRowId = row._X_ROW_KEY
|
|
215
215
|
fieldRef = VFR.getWidgetRef(fieldSchema.options.name + '_' + subFormRowId)
|
|
216
216
|
if (!!fieldRef) {
|
|
217
|
-
let value = fieldRef.
|
|
217
|
+
let value = fieldRef.currentValue;
|
|
218
218
|
resultFormula = resultFormula.replaceAll(mi, value)
|
|
219
219
|
} else {
|
|
220
220
|
de
|
|
@@ -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.
|
|
228
|
+
let value = fieldRef.currentValue;
|
|
229
229
|
resultFormula = resultFormula.replaceAll(mi, value)
|
|
230
230
|
} else {
|
|
231
231
|
quitFlag = true
|
|
@@ -234,17 +234,19 @@ export function baseReplaceFieldsAndFunctionsOfFormula(VFR, formulaFieldRef, for
|
|
|
234
234
|
} else if (subFormNameOfField === formulaFieldRef.subFormName) {
|
|
235
235
|
fieldRef = VFR.getWidgetRef(fieldSchema.options.name + '@row' + formulaFieldRef.subFormRowId)
|
|
236
236
|
if (!!fieldRef) {
|
|
237
|
-
resultFormula = resultFormula.replaceAll(mi, fieldRef.
|
|
237
|
+
resultFormula = resultFormula.replaceAll(mi, fieldRef.currentValue)
|
|
238
238
|
} else {
|
|
239
239
|
quitFlag = true
|
|
240
240
|
console.error('Field not found: ' + fieldSchema.options.label)
|
|
241
241
|
}
|
|
242
|
-
}
|
|
242
|
+
}else {
|
|
243
243
|
console.error('Invalid formula!')
|
|
244
244
|
}
|
|
245
245
|
} else {
|
|
246
246
|
/* 在主表单字段的计算公式中使用子表单字段,应将子表单所有记录同字段的值代入!! */
|
|
247
|
-
const subFormValue = VFR.formDataModel[subFormNameOfField]
|
|
247
|
+
// const subFormValue = VFR.formDataModel[subFormNameOfField]
|
|
248
|
+
let dataTableRef = VFR.getWidgetRef(subFormNameOfField)
|
|
249
|
+
const subFormValue = VFR.formDataModel[fieldKeyName(dataTableRef.widget)]
|
|
248
250
|
let allSubFieldValues = ''
|
|
249
251
|
// const subFieldName = fieldSchema.options.name
|
|
250
252
|
const subFieldName = fieldKeyName(fieldSchema)
|
|
@@ -325,6 +327,7 @@ export function fieldIsUsedInFormula(fieldName, formula, VFR, fieldTarget) {
|
|
|
325
327
|
return foundResult
|
|
326
328
|
}
|
|
327
329
|
|
|
330
|
+
|
|
328
331
|
/**
|
|
329
332
|
* 替换计算公式中的字段值
|
|
330
333
|
* @param VFR
|
|
@@ -356,7 +359,7 @@ export function replaceFieldsAndFunctionsOfFormula(VFR, formulaFieldRef) {
|
|
|
356
359
|
let fieldRef = VFR.getWidgetRef(fieldSchema.options.name)
|
|
357
360
|
if (!!fieldRef) {
|
|
358
361
|
//是否要考虑字符串值的替换??
|
|
359
|
-
resultFormula = resultFormula.replace(mi, fieldRef.
|
|
362
|
+
resultFormula = resultFormula.replace(mi, fieldRef.currentValue)
|
|
360
363
|
} else { //getWidgetRef找不到,则可能是子表单字段
|
|
361
364
|
const subFormNameOfField = VFR.getSubFormNameOfWidget(fieldSchema.options.name)
|
|
362
365
|
if (!!formulaFieldRef.subFormItemFlag || formulaFieldRef.tableParam) {
|
|
@@ -367,7 +370,7 @@ export function replaceFieldsAndFunctionsOfFormula(VFR, formulaFieldRef) {
|
|
|
367
370
|
let subFormRowId = formulaFieldRef.tableParam.row._X_ROW_KEY
|
|
368
371
|
fieldRef = VFR.getWidgetRef(fieldSchema.options.name + '_' + subFormRowId)
|
|
369
372
|
if (!!fieldRef) {
|
|
370
|
-
resultFormula = resultFormula.replaceAll(mi, fieldRef.
|
|
373
|
+
resultFormula = resultFormula.replaceAll(mi, fieldRef.currentValue)
|
|
371
374
|
} else {
|
|
372
375
|
quitFlag = true
|
|
373
376
|
console.error('Field not found: ' + fieldSchema.options.label)
|
|
@@ -375,7 +378,7 @@ export function replaceFieldsAndFunctionsOfFormula(VFR, formulaFieldRef) {
|
|
|
375
378
|
} else if (subFormNameOfField === formulaFieldRef.subFormName) {
|
|
376
379
|
fieldRef = VFR.getWidgetRef(fieldSchema.options.name + '@row' + formulaFieldRef.subFormRowId)
|
|
377
380
|
if (!!fieldRef) {
|
|
378
|
-
resultFormula = resultFormula.replaceAll(mi, fieldRef.
|
|
381
|
+
resultFormula = resultFormula.replaceAll(mi, fieldRef.currentValue)
|
|
379
382
|
} else {
|
|
380
383
|
quitFlag = true
|
|
381
384
|
console.error('Field not found: ' + fieldSchema.options.label)
|
|
@@ -385,7 +388,10 @@ export function replaceFieldsAndFunctionsOfFormula(VFR, formulaFieldRef) {
|
|
|
385
388
|
}
|
|
386
389
|
} else {
|
|
387
390
|
/* 在主表单字段的计算公式中使用子表单字段,应将子表单所有记录同字段的值代入!! */
|
|
388
|
-
const subFormValue = VFR.formDataModel[subFormNameOfField]
|
|
391
|
+
// const subFormValue = VFR.formDataModel[subFormNameOfField]
|
|
392
|
+
let dataTableRef = VFR.getWidgetRef(subFormNameOfField)
|
|
393
|
+
const subFormValue = VFR.formDataModel[fieldKeyName(dataTableRef.widget)]
|
|
394
|
+
|
|
389
395
|
let allSubFieldValues = ''
|
|
390
396
|
// const subFieldName = fieldSchema.options.name
|
|
391
397
|
const subFieldName = fieldKeyName(fieldSchema)
|