|
@@ -6,20 +6,17 @@ import JpcFlowTab from './jpc_flow_tab';
|
|
|
import JpcBillTab from './jpc_bill_tab';
|
|
import JpcBillTab from './jpc_bill_tab';
|
|
|
import JpcCrossTab from './jpc_cross_tab';
|
|
import JpcCrossTab from './jpc_cross_tab';
|
|
|
import JpcField from './jpc_field';
|
|
import JpcField from './jpc_field';
|
|
|
-
|
|
|
|
|
import JpcParam from './jpc_param';
|
|
import JpcParam from './jpc_param';
|
|
|
import JpcFunc from './jpc_function';
|
|
import JpcFunc from './jpc_function';
|
|
|
import JpcEvent from './jpc_event';
|
|
import JpcEvent from './jpc_event';
|
|
|
import JpcData from './jpc_data';
|
|
import JpcData from './jpc_data';
|
|
|
import JpcCommonHelper from './helper/jpc_helper_common';
|
|
import JpcCommonHelper from './helper/jpc_helper_common';
|
|
|
-import useReportDate from '../public/ReportDate'
|
|
|
|
|
-
|
|
|
|
|
import { IDefProperties, IFormula, IParams, ICurrent_RPT, ICustomizeCfg, ITargetFields, IRptTpl, IDataObj, IBands, IControlCollection, IStyles, BorderStyle, IFontSubCollection, IControlSubCollection, IRstPage, IMergeBand } from '../interface/basic'
|
|
import { IDefProperties, IFormula, IParams, ICurrent_RPT, ICustomizeCfg, ITargetFields, IRptTpl, IDataObj, IBands, IControlCollection, IStyles, BorderStyle, IFontSubCollection, IControlSubCollection, IRstPage, IMergeBand } from '../interface/basic'
|
|
|
import { IFlowTabClass, IBillTabClass, ICostTabClass } from '../interface/classType';
|
|
import { IFlowTabClass, IBillTabClass, ICostTabClass } from '../interface/classType';
|
|
|
import { IPagingOption } from '../interface/enum';
|
|
import { IPagingOption } from '../interface/enum';
|
|
|
import { Key } from 'readline';
|
|
import { Key } from 'readline';
|
|
|
-import formulasDataSetter from './formulasDataSetter'
|
|
|
|
|
-import stringUtil from '../public/stringUtil'
|
|
|
|
|
|
|
+import {formulaExec} from './formulasFun'
|
|
|
|
|
+
|
|
|
|
|
|
|
|
const JV=$JV;
|
|
const JV=$JV;
|
|
|
class JpcExClass {
|
|
class JpcExClass {
|
|
@@ -126,67 +123,7 @@ class JpcExClass {
|
|
|
|
|
|
|
|
//根据步骤,对formulas中的计算式进行处理,并赋值到相应属性中
|
|
//根据步骤,对formulas中的计算式进行处理,并赋值到相应属性中
|
|
|
executeFormulas(runType: string, $CURRENT_TEMPLATE: IRptTpl, $CURRENT_DATA: IDataObj, $CURRENT_RPT: ICurrent_RPT) {
|
|
executeFormulas(runType: string, $CURRENT_TEMPLATE: IRptTpl, $CURRENT_DATA: IDataObj, $CURRENT_RPT: ICurrent_RPT) {
|
|
|
- let execFmlMe = this;
|
|
|
|
|
- formulasDataSetter.setupData($CURRENT_RPT, $CURRENT_DATA);
|
|
|
|
|
- const {
|
|
|
|
|
- P,
|
|
|
|
|
- F,
|
|
|
|
|
- D,
|
|
|
|
|
- L,
|
|
|
|
|
- getCurrentPage,
|
|
|
|
|
- getTotalPage,
|
|
|
|
|
- setFieldValue,
|
|
|
|
|
- setFieldValueArray,
|
|
|
|
|
- removeFieldValue,
|
|
|
|
|
- insertFieldValue,
|
|
|
|
|
- setData,
|
|
|
|
|
- getNumberArray,
|
|
|
|
|
- copyPrecision,
|
|
|
|
|
- copyFixedPrecisionNum,
|
|
|
|
|
- copyProperty,
|
|
|
|
|
- setDate,
|
|
|
|
|
- DLength
|
|
|
|
|
- } = formulasDataSetter;
|
|
|
|
|
- const {
|
|
|
|
|
- isEmptyString,
|
|
|
|
|
- trim,
|
|
|
|
|
- leftTrim,
|
|
|
|
|
- rightTrim,
|
|
|
|
|
- replaceAll,
|
|
|
|
|
- comdify,
|
|
|
|
|
- convertToCaptionNum,
|
|
|
|
|
- convertStrToBoolean,
|
|
|
|
|
- formatNumber,
|
|
|
|
|
- } = stringUtil;
|
|
|
|
|
-
|
|
|
|
|
- for (let execFmlIdx = 0; execFmlIdx < execFmlMe.formulas.length; execFmlIdx++) {
|
|
|
|
|
- if (execFmlMe.formulas[execFmlIdx].run_type === runType) {
|
|
|
|
|
- let expression = execFmlMe.formulas[execFmlIdx].expression;
|
|
|
|
|
- if (expression) {
|
|
|
|
|
- // 计算式集合,目前是放置打印信息的,用于配置属性的计算
|
|
|
|
|
- let $ME = execFmlMe.formulas[execFmlIdx];
|
|
|
|
|
- // console.log("current expression idx: " + execFmlIdx);
|
|
|
|
|
- // console.log(expression);
|
|
|
|
|
- try {
|
|
|
|
|
- const {format}=$ME;
|
|
|
|
|
- const $JE = JE;
|
|
|
|
|
- const ReportDate = useReportDate;
|
|
|
|
|
- console.log(expression);
|
|
|
|
|
- //临时处理
|
|
|
|
|
- if (expression.indexOf('Date()') > -1) {
|
|
|
|
|
- eval(expression.replace('Date()', 'ReportDate()'));
|
|
|
|
|
- } else {
|
|
|
|
|
-
|
|
|
|
|
- eval(expression);}
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- } catch (ex) {
|
|
|
|
|
- console.log(ex);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- formulasDataSetter.resetData();
|
|
|
|
|
|
|
+ formulaExec(runType, $CURRENT_TEMPLATE, $CURRENT_DATA, $CURRENT_RPT)
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
outputAsPreviewPage(rptTpl: IRptTpl, defProperties: IDefProperties) {
|
|
outputAsPreviewPage(rptTpl: IRptTpl, defProperties: IDefProperties) {
|