Просмотр исходного кода

fix(report): 新增新的枚举值和类型

lishihao 4 лет назад
Родитель
Сommit
320f1ed434
3 измененных файлов с 113 добавлено и 38 удалено
  1. 1 1
      report/package.json
  2. 34 32
      report/src/interface/basic.ts
  3. 78 5
      report/src/interface/enum.ts

+ 1 - 1
report/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@sc/report",
-  "version": "3.0.3",
+  "version": "3.0.4",
   "description": "Smartcost Report Relative Module",
   "main": "./dist/index.cjs.js",
   "module": "./dist/index.esm.js",

+ 34 - 32
report/src/interface/basic.ts

@@ -137,7 +137,7 @@ export interface IPageCellObj {
 }
 export interface ICell {
     font: string | IFontSubCollection;
-    control: IControlSubCollection|string;
+    control: IControlSubCollection | string;
     style: string;
     Value: number | string | null;
     area: IPosition;
@@ -153,8 +153,19 @@ export interface IStyleCollection {
     Default_Normal: IPositionExtent;
     Label_Topline: IPositionExtent;
     Label_Underline: IPositionExtent;
-    [key:string]:IPositionExtent;
+    [key: string]: IPositionExtent;
 }
+
+export interface IPreviewPageItem {
+    page_seq: number;
+    cells: ICell[];
+    page_merge_border: IPosition;
+    page_merge_pos: {
+        纸张宽高: number[]
+    }
+}
+
+
 export interface IPreviewPage {
     打印页面_信息: {
         报表名称: string;
@@ -163,18 +174,9 @@ export interface IPreviewPage {
     };
     control_collection: IControlCollection;
     font_collection: IFontCollection;
-    items: [
-        {
-            page_seq: number;
-            cells: ICell[];
-            page_merge_border: IPosition;
-            page_merge_pos:{
-                纸张宽高:number[]
-            }
-        }
-    ];
+    items: IPreviewPageItem[];
     MergeBand: IMergeBand;
-    style_collection:IStyleCollection;
+    style_collection: IStyleCollection;
     pageBreaks?: any[];
 }
 
@@ -211,7 +213,7 @@ export interface ITargetFields {
     从数据指标_拓展集合: ITargetDataSet;
     离散指标_集合: ITargetDataSet;
     无映射离散指标_集合: ITargetDataSet;
-    [key:string]:ITargetDataSet;
+    [key: string]: ITargetDataSet;
 }
 
 interface IOutputAsPreviewPage {
@@ -364,24 +366,24 @@ export interface ICustomizeCfg {
     isNarrow: boolean;
     margins: IPosition;
     showVerticalLine: boolean;
-    userID?:string
+    userID?: string
 }
 export interface IOrgBandDetail {
     Alignment: string;
-    DisplayType:  string;
-    Height:  string;
-    MergeBorder:  string;
-    Name:  string;
+    DisplayType: string;
+    Height: string;
+    MergeBorder: string;
+    Name: string;
     control: string;
-    style:  string;
-    Width?:string;
-    CalculationType:string;
-    normalOnly?:boolean;
-    exOnly?:boolean;
-    band_s?:IOrgBandDetail[]
+    style: string;
+    Width?: string;
+    CalculationType: string;
+    normalOnly?: boolean;
+    exOnly?: boolean;
+    band_s?: IOrgBandDetail[]
 }
 
-export interface IBandDetail{
+export interface IBandDetail {
     Alignment: number;
     Bottom: number;
     CalculationType: number;
@@ -593,16 +595,16 @@ export interface IRstPage {
 }
 
 export interface IMergeBand {
-    Bottom:number;
-    Left:number;
-    Right:number;
-    Top:number;
+    Bottom: number;
+    Left: number;
+    Right: number;
+    Top: number;
     style?: any;
 }
 //丢失的interface
-export interface IPretreatment{
+export interface IPretreatment {
     [key: string]: any;
 }
-export interface ISubFilters{
+export interface ISubFilters {
     [key: string]: any;
 }

+ 78 - 5
report/src/interface/enum.ts

@@ -5,7 +5,7 @@ export enum IDataObjProps {
     discrete_data = 'discrete_data',    // 离散指标_集合
     master_data = 'master_data',        //主数据指标_集合
     master_data_ex = 'master_data_ex',  //主数据指标_拓展集合
-    NA='NA'
+    NA = 'NA'
 }
 
 export enum IEventType {
@@ -49,11 +49,84 @@ export enum IFontProps {
 }
 
 export enum IPositionProps {
-   Top,
-   Bottom,
-   Left,
-   Right
+    Top='Top',
+    Bottom='Bottom',
+    Left='Left',
+    Right='Right'
 }
 
+export enum IPositionIdx {
+    Left = 0,
+    Top = 1,
+    Right = 2,
+    Bottom = 3,
+}
+
+
+
+
+//常量,上下左右的顺序,对应于逻辑代码中某些数组的顺序
+export const IDX_LEFT = 0;
+export const IDX_TOP = 1;
+export const IDX_RIGHT = 2;
+export const IDX_BOTTOM = 3;
+
+//输出的偏移量
+export enum IOutputOffset {
+    LEFT = 2,
+    TOP = 2,
+    RIGHT = 1,
+    BOTTOM = 3,
+}
+
+//垂直角度
+export const VERTICAL_ANGLE = '90';
+export const ANTI_VERTICAL_ANGLE = '-90';
+export const VERTICAL_ANGLE_INT = 90;
+export const ANTI_VERTICAL_ANGLE_INT = -90;
+
+export enum FONT_PROPS {
+    NAME = 'Name',
+    FONT_HEIGHT = 'FontHeight',
+    FONT_COLOR = 'FontColor',
+    FONT_BOLD = 'FontBold',
+    FONT_ITALIC = 'FontItalic',
+    FONT_UNDERLINE = 'FontUnderline',
+    FONT_STRIKEOUT = 'FontStrikeOut',
+    FONT_ANGLE = 'FontAngle',
+}
+
+export enum CONTROL_PROPS {
+    SHRINK = 'Shrink',
+    SHOWZERO = 'ShowZero',
+    HORIZON = 'Horizon',
+    VERTICAL = 'Vertical',
+    WRAP = 'Wrap',
+    VERTIVAL_FOR_EXCEL = 'VerticalForExcel',
+    SHRIK_FIRST = 'ShrinkFirst',
+    CLOSE_OUTPUT = 'CloseOutput',
+}
+export const PROP_FONT = 'font';
+
+export enum PAGES_SIZE_STR {
+    A3 = 'A3',
+    A4 = 'A4',
+    A5 = 'A5',
+    B5 = 'B5',
+    LETTER = 'LETTER',
+    LEGAL = 'LEGAL',
+    EXECUTIVE = 'EXECUTIVE',
+    '16K' = '16K',
+}
+export enum PAGES_SIZE {
+    A3 = 8,
+    A4 = 9,
+    A5 = 11,
+    B5 = 13,
+    LETTER = 1,
+    LEGAL = 5,
+    EXECUTIVE = 7,
+    '16K' = 93,
+}
 
 export default {};