basic.ts 16 KB

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