basic.ts 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668
  1. // import { IFlowTabClass, IBillTabClass, ICostTabClass } from './classType';
  2. // eslint-disable-next-line camelcase
  3. import { IDataObjProps, IEventType } 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: string;
  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 IPageAreaObj {
  117. cellsArr: ICell[];
  118. pageCellObj: IPageCellObj;
  119. }
  120. export interface IPageCellObj {
  121. [key: string]: {
  122. cellIdx: number;
  123. cell: ICell;
  124. }[];
  125. }
  126. export interface ICell {
  127. font: string | IFontSubCollection;
  128. control: IControlSubCollection | string;
  129. style: string;
  130. Value: number | string | null;
  131. area: IPosition;
  132. isAutoHeight?: boolean;
  133. Format?: any;
  134. Prefix?: string;
  135. Suffix?: any;
  136. }
  137. export interface IStyleCollection {
  138. BORDER_ALL_AROUND: IPositionExtent;
  139. Default: IPositionExtent;
  140. Default_None: IPositionExtent;
  141. Default_Normal: IPositionExtent;
  142. Label_Topline: IPositionExtent;
  143. Label_Underline: IPositionExtent;
  144. [key: string]: IPositionExtent;
  145. }
  146. export interface IPreviewPageItem {
  147. page_seq: number;
  148. cells: ICell[];
  149. page_merge_border: IPosition;
  150. page_merge_pos: {
  151. 纸张宽高: number[]
  152. }
  153. }
  154. export interface IPreviewPage {
  155. 打印页面_信息: {
  156. 报表名称: string;
  157. 纸张宽高: number[];
  158. 页边距: IPosition;
  159. };
  160. control_collection: IControlCollection;
  161. font_collection: IFontCollection;
  162. items: IPreviewPageItem[];
  163. MergeBand: IMergeBand;
  164. style_collection: IStyleCollection;
  165. pageBreaks?: any[];
  166. }
  167. interface ISimpleJSONPage {
  168. cells: ICell[];
  169. page_merge_border: IPosition;
  170. page_seq: number;
  171. }
  172. export interface IGroupField {
  173. Name: string;
  174. fixedPrecisionNum: number;
  175. ID: number;
  176. DataType: string;
  177. DataSeq: number;
  178. DataNodeName: IDataObjProps;
  179. data_field: number | any; // 暂定
  180. Precision?: {
  181. type?: string;
  182. flexibleRefFieldID?: number;
  183. };
  184. flexiblePrecisionRefObj?: { [key: string]: number }[];
  185. [key: string]: any;
  186. }
  187. export interface ITargetDataSet {
  188. [key: string]: IGroupField;
  189. }
  190. export interface ITargetFields {
  191. 从数据指标_集合: ITargetDataSet;
  192. 主数据指标_集合: ITargetDataSet;
  193. 主数据指标_拓展集合: ITargetDataSet;
  194. 从数据指标_拓展集合: ITargetDataSet;
  195. 离散指标_集合: ITargetDataSet;
  196. 无映射离散指标_集合: ITargetDataSet;
  197. [key: string]: ITargetDataSet;
  198. }
  199. interface IOutputAsPreviewPage {
  200. (rptTpl: IRptTpl, defProperties: IDefProperties): IPreviewPage;
  201. }
  202. interface IOutputAsSimpleJSONPageArray {
  203. (
  204. rptTpl: IRptTpl,
  205. dataObj: IDataObj,
  206. startPage: number,
  207. endPage: number,
  208. defProperties: IDefProperties,
  209. customizeCfg: ICustomizeCfg
  210. ): IPreviewPage;
  211. }
  212. interface IOutputAsSimpleJSONPage {
  213. (
  214. rptTpl: IRptTpl,
  215. dataObj: IDataObj,
  216. bands: IBands,
  217. page: number,
  218. controls: IControlCollection,
  219. customizeCfg: ICustomizeCfg
  220. ): ISimpleJSONPage;
  221. }
  222. export interface IFlowTab {
  223. dispValueIdxLst: number[][];
  224. group_lines_amt: number;
  225. group_node_info: number[][] | null;
  226. group_sum_fields: Fields[] | null;
  227. group_sum_values: { [key: string]: number }[] | null;
  228. isEx: boolean;
  229. multiCols: number;
  230. groupSumValLst: any[];
  231. group_check_fields: any[];
  232. auto_height_fields_idx: any[];
  233. auto_height_info: any[];
  234. disp_fields_ex_idx: any[];
  235. disp_fields_idx: any[];
  236. outputAsPreviewPage: IOutputAsPreviewPage;
  237. outputAsSimpleJSONPage: IOutputAsSimpleJSONPage;
  238. outputAsSimpleJSONPageArray: IOutputAsSimpleJSONPageArray;
  239. checkCombineEvent: (
  240. $RUN_TYPE: string,
  241. $VER_COMB_ARRAY: any[],
  242. $HOR_COMB_ARRAY: any[],
  243. $CURRENT_CELL_ITEMS: Fields,
  244. $CURRENT_RPT: ICurrent_RPT
  245. ) => void;
  246. checkGrpTxtOutEvent: (
  247. $RUN_TYPE: string,
  248. $TEXT: Fields,
  249. $TIMES: number,
  250. $CURRENT_RPT: ICurrent_RPT
  251. ) => void;
  252. combinePageCells: (
  253. rstPageCells: ICell[],
  254. verticalCombinePos: any[],
  255. horizonCombinePos: any[]
  256. ) => void;
  257. commonTabRestOutput: (
  258. dataObj: IDataObj,
  259. page: number,
  260. segIdx: number,
  261. bands: IBands,
  262. band: IBandDetail,
  263. unitFactor: number,
  264. tab: { BandName: string; text_s?: Fields[]; text?: string },
  265. multiColIdx: number
  266. ) => Fields[];
  267. }
  268. export interface IParam {
  269. DataSeq: number;
  270. DataType: string;
  271. ID: string;
  272. Name: string;
  273. Default_Value: string;
  274. }
  275. export interface IParams {
  276. [key: string]: IParam;
  277. }
  278. export interface ICurrent_RPT {
  279. exTotalPages: number;
  280. formulas: IFormula[];
  281. isFollowMode: boolean;
  282. totalPages: number;
  283. params: IParams;
  284. analyzeData: (
  285. rptTpl: IRptTpl,
  286. dataObj: IDataObj,
  287. defProperties: IDefProperties,
  288. option: string,
  289. outputType: string
  290. ) => void;
  291. executeFormulas: (
  292. runType: string,
  293. $CURRENT_TEMPLATE: any,
  294. $CURRENT_DATA: any,
  295. $CURRENT_RPT: ICurrent_RPT
  296. ) => void;
  297. initialize?: (rptTpl: IRptTpl) => void;
  298. outputAsPreviewPage: IOutputAsPreviewPage;
  299. outputAsSimpleJSONPage: IOutputAsSimpleJSONPage;
  300. outputAsSimpleJSONPageArray: IOutputAsSimpleJSONPageArray;
  301. paging: (
  302. rptTpl: IRptTpl,
  303. dataObj: IDataObj,
  304. defProperties: IDefProperties,
  305. option: string,
  306. outputType: string
  307. ) => void;
  308. fields: ITargetFields;
  309. // flowTab: IFlowTabClass;
  310. // flowTabEx: IFlowTabClass;
  311. // billTab: IBillTabClass;
  312. // crossTab: ICostTabClass;
  313. flowTab: any;
  314. flowTabEx: any;
  315. billTab: any;
  316. crossTab: any;
  317. runTimePageData: { currentPage?: number };
  318. formulasObject:Record<string,any>;
  319. }
  320. export interface ICurrent_DATA {
  321. discrete_data: any[];
  322. detail_data_ex: any[];
  323. detail_data: any[];
  324. DecimalObj: {
  325. prjDecimal: any;
  326. unitDecimal: {
  327. default_decimal: number;
  328. };
  329. };
  330. master_data: any[];
  331. master_data_ex: any[];
  332. }
  333. export interface ICustomizeCfg {
  334. fillZero: boolean;
  335. fonts: {
  336. CfgDispName: string;
  337. FontBold: string;
  338. FontHeight: string;
  339. FontItalic: string;
  340. FontUnderline: string;
  341. ID: string;
  342. Name: string;
  343. }[];
  344. isNarrow: boolean;
  345. margins: IPosition;
  346. showVerticalLine: boolean;
  347. userID?: string
  348. }
  349. export interface IOrgBandDetail {
  350. Alignment: string;
  351. DisplayType: string;
  352. Height: string;
  353. MergeBorder: string;
  354. Name: string;
  355. control: string;
  356. style: string;
  357. Width?: string;
  358. CalculationType: string;
  359. normalOnly?: boolean;
  360. exOnly?: boolean;
  361. band_s?: IOrgBandDetail[]
  362. }
  363. export interface IBandDetail {
  364. Alignment: number;
  365. Bottom: number;
  366. CalculationType: number;
  367. control: any;
  368. Width: number;
  369. Top: number;
  370. style: any;
  371. Right: number;
  372. MergeBorder: string;
  373. Left: number;
  374. Height: number;
  375. DisplayType: number;
  376. Name: string;
  377. exOnly?: boolean;
  378. normalOnly?: boolean;
  379. band_s?: any[];
  380. Le?: number;
  381. }
  382. export interface IBands {
  383. [key: string]: IBandDetail; // 剩下的之后补充
  384. }
  385. export interface IGrpLine {
  386. SumKey_S: Fields[];
  387. text_s: any[];
  388. discrete_field_s: any[];
  389. param_s: any;
  390. sum_field_s: any;
  391. }
  392. export interface ITab {
  393. text?: string;
  394. text_s: Fields[]; // 剩下的之后补充 textNode
  395. 离散信息?: any;
  396. }
  397. export interface IGrpPageInfo {
  398. segGrpRecStartIdx: number;
  399. preAddPageGrpInfo: number[];
  400. insertedGrpRecAmt: number;
  401. group_lines_amt: number;
  402. }
  403. //模板信息
  404. export interface IRptTpl {
  405. 事件_集合: {
  406. type: IEventType;
  407. }[];
  408. 布局框_集合: IOrgBandDetail[];
  409. 计算式_集合: IFormula[];
  410. 离散参数_集合: IOrgGroupField[];
  411. 账单式表_信息: {
  412. 离散信息: IDiscrete[];
  413. 账单式表_数据: {
  414. BandName: string;
  415. bill_field_s: Fields[]; // 暂定
  416. text: string;
  417. text_s: string[]; // 暂定
  418. 离散信息: IDiscrete[];
  419. };
  420. };
  421. 交叉表_信息: {
  422. 交叉列合计: ICrossTab;
  423. 交叉行拓展: ICrossTab;
  424. 交叉行拓展合计: ICrossTab;
  425. 交叉数据: ICrossTab; // 暂定
  426. 交叉行: ICrossTab;
  427. 交叉列: ICrossTab;
  428. 交叉行AD_HOC: ICrossTab; // 暂定
  429. 离散信息: IDiscrete[];
  430. [key: string]: any; // 暂定tabNodeName jpc_cross_tab line270
  431. };
  432. 流水式表_信息: {
  433. 多列显示数量: number;
  434. 离散信息: IDiscrete[];
  435. 流水式表_段统计信息: IDiscrete;
  436. 流水式表_分组信息: IFlowGroup;
  437. 流水式表_列: IDiscrete;
  438. 流水式表_数据: IFlowData;
  439. 流水式表_页统计信息: IDiscrete;
  440. };
  441. 流水式表_拓展信息: {
  442. 多列显示数量: number;
  443. 流水拓展显示模式: string;
  444. 离散信息: IDiscrete[];
  445. 流水式表_段统计信息: IDiscrete;
  446. 流水式表_分组信息: IFlowGroup;
  447. 流水式表_列: IDiscrete;
  448. 流水式表_数据: IFlowData;
  449. 流水式表_页统计信息: IDiscrete;
  450. };
  451. 无映射离散指标_集合: IOrgGroupField[];
  452. 映射数据预处理: {
  453. 排序方式: string;
  454. 排序键值集: any[];
  455. 映射数据对象: string;
  456. 预处理类型: string;
  457. 过滤键值集: {
  458. compareObjKey: string
  459. }[];
  460. 分组键值集: {
  461. seeking_parent: string
  462. }[];
  463. 父子排序键: {
  464. 父映射数据对象: string
  465. }[]
  466. }[];
  467. 指标_数据_映射: {
  468. 离散参数_集合: IOrgGroupField[];
  469. 离散指标_集合: IOrgGroupField[];
  470. 主数据指标_集合: IOrgGroupField[];
  471. 从数据指标_集合: IOrgGroupField[];
  472. 主数据指标_拓展集合: IOrgGroupField[];
  473. 从数据指标_拓展集合: IOrgGroupField[];
  474. [key: string]: IOrgGroupField[];
  475. };
  476. 主信息: {
  477. 版本: {
  478. 功能版本: string;
  479. 主版本: string;
  480. };
  481. 报表名称: string;
  482. 打印页面_信息: {
  483. 方向: string;
  484. 页规格: string;
  485. cross_display_order: number;
  486. };
  487. 单位: string;
  488. 页边距: IPosition;
  489. };
  490. GROUP_KEY: string;
  491. ID: number;
  492. ID_KEY: string;
  493. style_collection?: any[];
  494. control_collection: any;
  495. }
  496. // 以后会跟 IGroupField合并
  497. export interface IOrgGroupField {
  498. DataType: string;
  499. descr?: string;
  500. ID: number;
  501. mapExpression: string;
  502. Name: string;
  503. Title?: string;
  504. Precision?: {
  505. type?: string;
  506. flexibleRefFieldID?: number;
  507. fixedMapExpression?: string;
  508. flexibleMapExpression?: string;
  509. };
  510. fixedPrecisionNum?: number;
  511. flexiblePrecisionRefObj?: { [key: string]: number }[];
  512. Default_Value?: string;
  513. isID?: string;
  514. IDSeq: number;
  515. }
  516. export interface IDataObj {
  517. DecimalObj: {
  518. prjDecimal: number;
  519. unitDecimal: {
  520. default_decimal?: number;
  521. unitDecimal?: any
  522. };
  523. };
  524. detail_data: (number | string)[][];
  525. detail_data_ex: any[];
  526. discrete_data: string[][];
  527. master_data: any[];
  528. master_data_ex: any[];
  529. [key: string]: any;
  530. }
  531. // 离散信息
  532. export interface IDiscrete {
  533. BandName: string;
  534. discrete_field_s: Fields[];
  535. text_s: Fields[];
  536. CommonHeight: number;
  537. text: string;
  538. sum_field_s: Fields[];
  539. CommonWidth: number;
  540. }
  541. // 交叉表
  542. export interface ICrossTab {
  543. BandName: string;
  544. cross_field_s: Fields[];
  545. text_s: Fields[];
  546. CommonHeight: number;
  547. text: string;
  548. CommonWidth: number;
  549. }
  550. // 流水式表_数据
  551. interface IFlowData {
  552. BandName: string;
  553. CommonHeight: number;
  554. flow_field_s: Fields[];
  555. CalculationType: string;
  556. }
  557. // 流水式表_分组信息:
  558. interface IFlowGroup {
  559. group_field_s: { FieldID: number }[];
  560. group_lines: IGrpLine[];
  561. sum_field_s: Fields[];
  562. }
  563. export interface IRstPage {
  564. page_seq?: number;
  565. cells: ICell[];
  566. page_merge_border?: IMergeBand;
  567. }
  568. export interface IMergeBand {
  569. Bottom: number;
  570. Left: number;
  571. Right: number;
  572. Top: number;
  573. style?: any;
  574. }
  575. //丢失的interface
  576. export interface IPretreatment {
  577. [key: string]: any;
  578. }
  579. export interface ISubFilters {
  580. [key: string]: any;
  581. }
  582. //报表用户信息的内容
  583. // 报表显示设置参数
  584. export interface IRptConfig{
  585. fillZero: boolean;
  586. fonts: {
  587. CfgDispName: string;
  588. FontBold: string;
  589. FontHeight: string;
  590. FontItalic: string;
  591. FontUnderline: string;
  592. ID: string;
  593. Name: string;
  594. }[];
  595. isNarrow: boolean;
  596. margins: IPosition;
  597. showVerticalLine: boolean;
  598. }
  599. export interface RptTreeNode {
  600. ID: string;
  601. name: string;
  602. icon: string;
  603. children?: RptTreeNode[];
  604. userId?: string;
  605. flags?: {
  606. constructSumType?: string | null;
  607. taxType?: string | null;
  608. auditType?: string | null;
  609. };
  610. }
  611. // 方案列表
  612. export interface IRptSchemeList{
  613. ID: string;
  614. name: string;
  615. data?: string[];
  616. level?:string;//级别,用来区分是单位工程、单项工程和建设项目的
  617. }
  618. //方案数据
  619. export interface IRptSchemeData {
  620. userID:string;
  621. data:IRptSchemeList
  622. }
  623. //报表设置参数
  624. export interface IRptCustomizeCfg {
  625. userID?: string;
  626. rptConfig:IRptConfig,
  627. schemeData:IRptSchemeList[]
  628. }
  629. //方法的参数
  630. export interface IFormulasObject{
  631. [key:string]:any
  632. }