view-context.ts 2.3 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144
/**
 * 视图上下文
 *
 * @class ViewContext
 */
export class ViewContext {

    /**
     * 运行时数据
     *
     * @type {Object}
     * @memberof ViewContext
     */
    public runtimeData:any;

    /**
     *  初始化 ViewContext 对象
     *
     * @memberof ViewContext
     */
    constructor(opts:any){
        this.runtimeData = opts;
    }

    /**
     * 传入应用上下文
     *
     * @return {Object}
     * @memberof ViewContext
     */
    get viewdata(){
        return this.runtimeData.viewdata;
    }

   /**
    * 传入视图参数
    *
    * @return {Object}
    * @memberof ViewContext
    */
    get viewparam(){
        return this.runtimeData.viewparam;
    }

    /**
     * 获取应用上下文
     *
     * @return {Object}
     * @memberof ViewContext
     */
    get context(){
        return this.runtimeData.context;
    }

   /**
    * 获取视图参数
    *
    * @return {Object}
    * @memberof ViewContext
    */
    get viewparams(){
        return this.runtimeData.viewparams;
    }

   /**
    * 获取模型数据
    *
    * @return {Object}
    * @memberof ViewContext
    */    
    get modeldata(){
        return this.runtimeData.modeldata;
    }

   /**
    * 动态模型服务
    *
    * @return {any}
    * @memberof ViewContext
    */       
    get dynamicmodelservice(){
        return this.runtimeData.dynamicmodelservice;
    }

   /**
    * 视图传递对象
    *
    * @return {any}
    * @memberof ViewContext
    */  
    get viewState(){
        return this.runtimeData.viewState;
    }

   /**
    * 视图唯一标识
    *
    * @return {string}
    * @memberof ViewContext
    */  
    get viewtag(){
        return this.runtimeData.viewtag;
    }

   /**
    * 获取视图
    *
    * @return {string}
    * @memberof ViewContext
    */  
   get view(){
    return this.runtimeData.view;
    }

   /**
    * 视图模式
    *
    * @return {*}
    * @memberof ViewContext
    */ 
    get viewDefaultUsage(){
        return this.runtimeData.viewDefaultUsage;
    }

   /**
    * 导航服务
    *
    * @return {*}
    * @memberof ViewContext
    */ 
    get navDataService(){
        return this.runtimeData.navDataService;
    }

   /**
    * 传入通知对象
    *
    * @return {*}
    * @memberof ViewContext
    */ 
    get inputState(){
        return this.runtimeData.inputState;
    }
}