basic.ts 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613
  1. // import { IFlowTabClass, IBillTabClass, ICostTabClass } from './classType';
  2. // eslint-disable-next-line camelcase
  3. import { IDataObjProps, IEventType, IPositionProps } from './enum';
  4. export interface IArea {
  5. Left: number;
  6. Right: number;
  7. Top: number;
  8. Bottom: number;
  9. H_CalculationType?: {
  10. Left: string;
  11. Right: string;
  12. Top: string;
  13. Bottom: string;
  14. };
  15. V_CalculationType?: {
  16. Left: string;
  17. Right: string;
  18. Top: string;
  19. Bottom: string;
  20. };
  21. }
  22. export interface IControlSubCollection {
  23. ID: string;
  24. CloseOutput: string;
  25. Horizon: string;
  26. ShowZero: string;
  27. Shrink: string;
  28. ShrinkFirst: string;
  29. Vertical: string;
  30. VerticalForExcel: string;
  31. Wrap: string;
  32. }
  33. export interface Fields {
  34. area: IArea;
  35. control: string | IControlSubCollection;
  36. FieldID: number;
  37. font: string;
  38. isAutoHeight: boolean;
  39. style: string;
  40. Hidden?: boolean; // 暂定
  41. isSerial: boolean; // 暂定
  42. Format: string;
  43. SumKey: string;
  44. combineType?: string;
  45. isMerge?: boolean;
  46. Default_Value?: string;
  47. Label: string;
  48. Title: string;
  49. [key: string]: any; // 剩下的之后补充
  50. }
  51. export interface IFormula {
  52. expression: string;
  53. format: string;
  54. Name: string;
  55. run_type: string;
  56. }
  57. export interface BorderStyle {
  58. Position: string;
  59. LineWeight: number;
  60. DashStyle: string;
  61. Color: string;
  62. }
  63. export interface IStyles {
  64. ID: string;
  65. CfgDispName: string;
  66. border_style: BorderStyle[];
  67. [key: string]: any; // 剩下的之后补充
  68. }
  69. export interface IDefProperties {
  70. ctrls: IControlSubCollection[];
  71. fonts: IFontSubCollection[];
  72. styles: IStyles[];
  73. }
  74. export interface IControlCollection {
  75. [key: string]: IControlSubCollection;
  76. }
  77. export interface IFontSubCollection {
  78. CfgDispName: string
  79. FontAngle?: string;
  80. FontBold?: string;
  81. FontColor?: string;
  82. FontHeight: number;
  83. FontItalic: string;
  84. FontStrikeOut?: string;
  85. FontUnderline: string;
  86. Name: string;
  87. ID: string;
  88. [key: string]: string | number | undefined
  89. }
  90. export interface IFontCollection {
  91. [key: string]: IFontSubCollection;
  92. }
  93. export interface IPosition {
  94. Bottom: number;
  95. Left: number;
  96. Right: number;
  97. Top: number;
  98. }
  99. export interface IMergePos {
  100. Bottom: number[];
  101. Left: number[];
  102. Right: number[];
  103. Top: number[];
  104. }
  105. interface IPositionExtentDetail {
  106. Color: string;
  107. DashStyle: string;
  108. LineWeight: string;
  109. }
  110. export interface IPositionExtent {
  111. Bottom: IPositionExtentDetail;
  112. Left: IPositionExtentDetail;
  113. Right: IPositionExtentDetail;
  114. Top: IPositionExtentDetail;
  115. }
  116. export interface INode {
  117. font: string;
  118. control: string;
  119. style: string;
  120. Value: number | string | null;
  121. area: IArea;
  122. isAutoHeight: boolean;
  123. }
  124. export interface IPageAreaObj {
  125. cellsArr: ICell[];
  126. pageCellObj: IPageCellObj;
  127. }
  128. export interface IPageCellObj {
  129. [key: string]: {
  130. cellIdx: number;
  131. cell: INode;
  132. }[];
  133. }
  134. export interface ICell {
  135. font: string;
  136. control: IControlSubCollection|string;
  137. style: string;
  138. Value: number | string | null;
  139. area: IPosition;
  140. isAutoHeight?: boolean;
  141. Format?: any;
  142. Prefix?: string;
  143. Suffix?: any;
  144. }
  145. export interface IStyleCollection {
  146. BORDER_ALL_AROUND: IPositionExtent;
  147. Default: IPositionExtent;
  148. Default_None: IPositionExtent;
  149. Default_Normal: IPositionExtent;
  150. Label_Topline: IPositionExtent;
  151. Label_Underline: IPositionExtent;
  152. [key:string]:IPositionExtent;
  153. }
  154. export interface IPreviewPage {
  155. 打印页面_信息: {
  156. 报表名称: string;
  157. 纸张宽高: number[];
  158. 页边距: [number, number];
  159. };
  160. control_collection: IControlCollection;
  161. font_collection: IFontCollection;
  162. items: [
  163. {
  164. page_seq: number;
  165. cells: ICell[];
  166. page_merge_border: IPosition;
  167. page_merge_pos:{
  168. 纸张宽高:number[]
  169. }
  170. }
  171. ];
  172. MergeBand: IMergeBand;
  173. style_collection:IStyleCollection;
  174. }
  175. interface ISimpleJSONPage {
  176. cells: ICell[];
  177. page_merge_border: IPosition;
  178. page_seq: number;
  179. }
  180. export interface IGroupField {
  181. Name: string;
  182. fixedPrecisionNum: number;
  183. ID: number;
  184. DataType: string;
  185. DataSeq: number;
  186. DataNodeName: IDataObjProps;
  187. data_field: number | any; // 暂定
  188. Precision?: {
  189. type?: string;
  190. flexibleRefFieldID?: number;
  191. };
  192. flexiblePrecisionRefObj?: { [key: string]: number }[];
  193. [key: string]: any;
  194. }
  195. export interface ITargetDataSet {
  196. [key: string]: IGroupField;
  197. }
  198. export interface ITargetFields {
  199. 从数据指标_集合: ITargetDataSet;
  200. 主数据指标_集合: ITargetDataSet;
  201. 主数据指标_拓展集合: ITargetDataSet;
  202. 从数据指标_拓展集合: ITargetDataSet;
  203. 离散指标_集合: ITargetDataSet;
  204. 无映射离散指标_集合: ITargetDataSet;
  205. }
  206. interface IOutputAsPreviewPage {
  207. (rptTpl: IRptTpl, defProperties: IDefProperties): IPreviewPage;
  208. }
  209. interface IOutputAsSimpleJSONPageArray {
  210. (
  211. rptTpl: IRptTpl,
  212. dataObj: IDataObj,
  213. startPage: number,
  214. endPage: number,
  215. defProperties: IDefProperties,
  216. customizeCfg: ICustomizeCfg
  217. ): IPreviewPage;
  218. }
  219. interface IOutputAsSimpleJSONPage {
  220. (
  221. rptTpl: IRptTpl,
  222. dataObj: IDataObj,
  223. bands: IBands,
  224. page: number,
  225. controls: IControlCollection,
  226. customizeCfg: ICustomizeCfg
  227. ): ISimpleJSONPage;
  228. }
  229. export interface IFlowTab {
  230. dispValueIdxLst: number[][];
  231. group_lines_amt: number;
  232. group_node_info: number[][] | null;
  233. group_sum_fields: Fields[] | null;
  234. group_sum_values: { [key: string]: number }[] | null;
  235. isEx: boolean;
  236. multiCols: number;
  237. groupSumValLst: any[];
  238. group_check_fields: any[];
  239. auto_height_fields_idx: any[];
  240. auto_height_info: any[];
  241. disp_fields_ex_idx: any[];
  242. disp_fields_idx: any[];
  243. outputAsPreviewPage: IOutputAsPreviewPage;
  244. outputAsSimpleJSONPage: IOutputAsSimpleJSONPage;
  245. outputAsSimpleJSONPageArray: IOutputAsSimpleJSONPageArray;
  246. checkCombineEvent: (
  247. $RUN_TYPE: string,
  248. $VER_COMB_ARRAY: any[],
  249. $HOR_COMB_ARRAY: any[],
  250. $CURRENT_CELL_ITEMS: Fields,
  251. $CURRENT_RPT: ICurrent_RPT
  252. ) => void;
  253. checkGrpTxtOutEvent: (
  254. $RUN_TYPE: string,
  255. $TEXT: Fields,
  256. $TIMES: number,
  257. $CURRENT_RPT: ICurrent_RPT
  258. ) => void;
  259. combinePageCells: (
  260. rstPageCells: ICell[],
  261. verticalCombinePos: any[],
  262. horizonCombinePos: any[]
  263. ) => void;
  264. commonTabRestOutput: (
  265. dataObj: IDataObj,
  266. page: number,
  267. segIdx: number,
  268. bands: IBands,
  269. band: IBandDetail,
  270. unitFactor: number,
  271. tab: { BandName: string; text_s?: Fields[]; text?: string },
  272. multiColIdx: number
  273. ) => Fields[];
  274. }
  275. export interface IParam {
  276. DataSeq: number;
  277. DataType: string;
  278. ID: string;
  279. Name: string;
  280. Default_Value: string;
  281. }
  282. export interface IParams {
  283. [key: string]: IParam;
  284. }
  285. export interface ICurrent_RPT {
  286. exTotalPages: number;
  287. formulas: IFormula[];
  288. isFollowMode: boolean;
  289. totalPages: number;
  290. params: IParams;
  291. analyzeData: (
  292. rptTpl: IRptTpl,
  293. dataObj: IDataObj,
  294. defProperties: IDefProperties,
  295. option: string,
  296. outputType: string
  297. ) => void;
  298. executeFormulas: (
  299. runType: string,
  300. $CURRENT_TEMPLATE: any,
  301. $CURRENT_DATA: any,
  302. $CURRENT_RPT: ICurrent_RPT
  303. ) => void;
  304. initialize?: (rptTpl: IRptTpl) => void;
  305. outputAsPreviewPage: IOutputAsPreviewPage;
  306. outputAsSimpleJSONPage: IOutputAsSimpleJSONPage;
  307. outputAsSimpleJSONPageArray: IOutputAsSimpleJSONPageArray;
  308. paging: (
  309. rptTpl: IRptTpl,
  310. dataObj: IDataObj,
  311. defProperties: IDefProperties,
  312. option: string,
  313. outputType: string
  314. ) => void;
  315. fields: ITargetFields;
  316. // flowTab: IFlowTabClass;
  317. // flowTabEx: IFlowTabClass;
  318. // billTab: IBillTabClass;
  319. // crossTab: ICostTabClass;
  320. flowTab: any;
  321. flowTabEx: any;
  322. billTab: any;
  323. crossTab: any;
  324. runTimePageData: { currentPage?: number };
  325. }
  326. export interface ICurrent_DATA {
  327. discrete_data: any[];
  328. detail_data_ex: any[];
  329. detail_data: any[];
  330. DecimalObj: {
  331. prjDecimal: any;
  332. unitDecimal: {
  333. default_decimal: number;
  334. };
  335. };
  336. master_data: any[];
  337. master_data_ex: any[];
  338. }
  339. export interface ICustomizeCfg {
  340. fillZero: boolean;
  341. fonts: {
  342. CfgDispName: string;
  343. FontBold: string;
  344. FontHeight: number;
  345. FontItalic: string;
  346. FontUnderline: string;
  347. ID: string;
  348. Name: string;
  349. }[];
  350. isNarrow: boolean;
  351. margins: IPosition;
  352. showVerticalLine: boolean;
  353. }
  354. export interface IOrgBandDetail {
  355. Alignment: string;
  356. DisplayType: string;
  357. Height: string;
  358. MergeBorder: string;
  359. Name: string;
  360. control: string;
  361. style: string;
  362. Width?:string;
  363. CalculationType:string;
  364. normalOnly?:boolean;
  365. exOnly?:boolean;
  366. band_s?:IOrgBandDetail[]
  367. }
  368. export interface IBandDetail{
  369. Alignment: number;
  370. Bottom: number;
  371. CalculationType: number;
  372. control: any;
  373. Width: number;
  374. Top: number;
  375. style: any;
  376. Right: number;
  377. MergeBorder: string;
  378. Left: number;
  379. Height: number;
  380. DisplayType: number;
  381. Name: string;
  382. exOnly?: boolean;
  383. normalOnly?: boolean;
  384. band_s?: any[];
  385. Le?: number;
  386. }
  387. export interface IBands {
  388. [key: string]: IBandDetail; // 剩下的之后补充
  389. }
  390. export interface IGrpLine {
  391. SumKey_S: Fields[];
  392. text_s: any[];
  393. discrete_field_s: any[];
  394. param_s: any;
  395. sum_field_s: any;
  396. }
  397. export interface ITab {
  398. text?: string;
  399. text_s: Fields[]; // 剩下的之后补充 textNode
  400. 离散信息?: any;
  401. }
  402. export interface IGrpPageInfo {
  403. segGrpRecStartIdx: number;
  404. preAddPageGrpInfo: number[];
  405. insertedGrpRecAmt: number;
  406. group_lines_amt: number;
  407. }
  408. //模板信息
  409. export interface IRptTpl {
  410. 事件_集合: {
  411. type: IEventType;
  412. }[];
  413. 布局框_集合: IOrgBandDetail[];
  414. 计算式_集合: IFormula[];
  415. 离散参数_集合: IOrgGroupField[];
  416. 账单式表_信息: {
  417. 离散信息: IDiscrete[];
  418. 账单式表_数据: {
  419. BandName: string;
  420. bill_field_s: Fields[]; // 暂定
  421. text: string;
  422. text_s: string[]; // 暂定
  423. 离散信息: IDiscrete[];
  424. };
  425. };
  426. 交叉表_信息: {
  427. 交叉列合计: ICrossTab;
  428. 交叉行拓展: ICrossTab;
  429. 交叉行拓展合计: ICrossTab;
  430. 交叉数据: ICrossTab; // 暂定
  431. 交叉行: ICrossTab;
  432. 交叉列: ICrossTab;
  433. 交叉行AD_HOC: ICrossTab; // 暂定
  434. 离散信息: IDiscrete[];
  435. [key: string]: any; // 暂定tabNodeName jpc_cross_tab line270
  436. };
  437. 流水式表_信息: {
  438. 多列显示数量: number;
  439. 离散信息: IDiscrete[];
  440. 流水式表_段统计信息: IDiscrete;
  441. 流水式表_分组信息: IFlowGroup;
  442. 流水式表_列: IDiscrete;
  443. 流水式表_数据: IFlowData;
  444. 流水式表_页统计信息: IDiscrete;
  445. };
  446. 流水式表_拓展信息: {
  447. 多列显示数量: number;
  448. 流水拓展显示模式: string;
  449. 离散信息: IDiscrete[];
  450. 流水式表_段统计信息: IDiscrete;
  451. 流水式表_分组信息: IFlowGroup;
  452. 流水式表_列: IDiscrete;
  453. 流水式表_数据: IFlowData;
  454. 流水式表_页统计信息: IDiscrete;
  455. };
  456. 无映射离散指标_集合: IOrgGroupField[];
  457. 映射数据预处理: {
  458. 排序方式: string;
  459. 排序键值集: any[];
  460. 映射数据对象: string;
  461. 预处理类型: string;
  462. 过滤键值集: {
  463. compareObjKey: string
  464. }[];
  465. 分组键值集: {
  466. seeking_parent: string
  467. }[];
  468. 父子排序键: {
  469. 父映射数据对象: string
  470. }[]
  471. }[];
  472. 指标_数据_映射: {
  473. 离散参数_集合: IOrgGroupField[];
  474. 离散指标_集合: IOrgGroupField[];
  475. 主数据指标_集合: IOrgGroupField[];
  476. 从数据指标_集合: IOrgGroupField[];
  477. 主数据指标_拓展集合: IOrgGroupField[];
  478. 从数据指标_拓展集合: IOrgGroupField[];
  479. [key: string]: IOrgGroupField[];
  480. };
  481. 主信息: {
  482. 版本: {
  483. 功能版本: string;
  484. 主版本: string;
  485. };
  486. 报表名称: string;
  487. 打印页面_信息: {
  488. 方向: string;
  489. 页规格: string;
  490. cross_display_order: number;
  491. };
  492. 单位: string;
  493. 页边距: IPosition;
  494. };
  495. GROUP_KEY: string;
  496. ID: number;
  497. ID_KEY: string;
  498. style_collection?: any[];
  499. control_collection: any;
  500. }
  501. // 以后会跟 IGroupField合并
  502. export interface IOrgGroupField {
  503. DataType: string;
  504. descr?: string;
  505. ID: number;
  506. mapExpression: string;
  507. Name: string;
  508. Title?: string;
  509. Precision?: {
  510. type?: string;
  511. flexibleRefFieldID?: number;
  512. fixedMapExpression?: string;
  513. flexibleMapExpression?: string;
  514. };
  515. fixedPrecisionNum?: number;
  516. flexiblePrecisionRefObj?: { [key: string]: number }[];
  517. Default_Value?: string;
  518. isID?: string;
  519. IDSeq: number;
  520. }
  521. export interface IDataObj {
  522. DecimalObj: {
  523. prjDecimal: number;
  524. unitDecimal: {
  525. default_decimal?: number;
  526. unitDecimal?: any
  527. };
  528. };
  529. detail_data: (number | string)[][];
  530. detail_data_ex: any[];
  531. discrete_data: string[][];
  532. master_data: any[];
  533. master_data_ex: any[];
  534. [key: string]: any;
  535. }
  536. // 离散信息
  537. export interface IDiscrete {
  538. BandName: string;
  539. discrete_field_s: Fields[];
  540. text_s: Fields[];
  541. CommonHeight: number;
  542. text: string;
  543. sum_field_s: Fields[];
  544. CommonWidth: number;
  545. }
  546. // 交叉表
  547. export interface ICrossTab {
  548. BandName: string;
  549. cross_field_s: Fields[];
  550. text_s: Fields[];
  551. CommonHeight: number;
  552. text: string;
  553. CommonWidth: number;
  554. }
  555. // 流水式表_数据
  556. interface IFlowData {
  557. BandName: string;
  558. CommonHeight: number;
  559. flow_field_s: Fields[];
  560. CalculationType: string;
  561. }
  562. // 流水式表_分组信息:
  563. interface IFlowGroup {
  564. group_field_s: { FieldID: number }[];
  565. group_lines: IGrpLine[];
  566. sum_field_s: Fields[];
  567. }
  568. export interface IRstPage {
  569. page_seq?: number;
  570. cells?: INode[];
  571. page_merge_border?: IMergeBand;
  572. }
  573. export interface IMergeBand {
  574. Bottom:number;
  575. Left:number;
  576. Right:number;
  577. Top:number;
  578. style?: any;
  579. }
  580. //丢失的interface
  581. export interface IPretreatment{
  582. [key: string]: any;
  583. }
  584. export interface ISubFilters{
  585. [key: string]: any;
  586. }