hromhierarchy-tree-exp-view-base.tsx 5.1 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 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205
import { Subject } from 'rxjs';
import { TreeExpViewBase } from '@/studio-core';
import HROMHierarchyService from '@/service/hromhierarchy/hromhierarchy-service';
import HROMHierarchyAuthService from '@/authservice/hromhierarchy/hromhierarchy-auth-service';
import TreeExpViewEngine from '@engine/view/tree-exp-view-engine';
import HROMHierarchyUIService from '@/uiservice/hromhierarchy/hromhierarchy-ui-service';

/**
 * 组织层次结构树导航视图视图基类
 *
 * @export
 * @class HROMHierarchyTreeExpViewBase
 * @extends {TreeExpViewBase}
 */
export class HROMHierarchyTreeExpViewBase extends TreeExpViewBase {
    /**
     * 视图对应应用实体名称
     *
     * @protected
     * @type {string}
     * @memberof HROMHierarchyTreeExpViewBase
     */
    protected appDeName: string = 'hromhierarchy';

    /**
     * 应用实体主键
     *
     * @protected
     * @type {string}
     * @memberof HROMHierarchyTreeExpViewBase
     */
    protected appDeKey: string = 'omhierarchyid';

    /**
     * 应用实体主信息
     *
     * @protected
     * @type {string}
     * @memberof HROMHierarchyTreeExpViewBase
     */
    protected appDeMajor: string = 'organizationname';

    /**
     * 实体服务对象
     *
     * @type {HROMHierarchyService}
     * @memberof HROMHierarchyTreeExpViewBase
     */
    protected appEntityService: HROMHierarchyService = new HROMHierarchyService;

    /**
     * 实体权限服务对象
     *
     * @type HROMHierarchyUIService
     * @memberof HROMHierarchyTreeExpViewBase
     */
    public appUIService: HROMHierarchyUIService = new HROMHierarchyUIService(this.$store);


    /**
     * 计数器服务对象集合
     *
     * @protected
     * @type {Array<*>}
     * @memberof HROMHierarchyTreeExpViewBase
     */    
    protected counterServiceArray: Array<any> = [];

    /**
     * 视图模型数据
     *
     * @protected
     * @type {*}
     * @memberof HROMHierarchyTreeExpViewBase
     */
    protected model: any = {
        srfCaption: 'entities.hromhierarchy.views.treeexpview.caption',
        srfTitle: 'entities.hromhierarchy.views.treeexpview.title',
        srfSubTitle: 'entities.hromhierarchy.views.treeexpview.subtitle',
        dataInfo: ''
    }

    /**
     * 容器模型
     *
     * @protected
     * @type {*}
     * @memberof HROMHierarchyTreeExpViewBase
     */
    protected containerModel: any = {
        view_treeexpbar: { name: 'treeexpbar', type: 'TREEEXPBAR' },
    };


	/**
     * 视图唯一标识
     *
     * @protected
     * @type {string}
     * @memberof ViewBase
     */
	protected viewtag: string = 'bf1effbdf9fb9d7d2a1c9d281ab35441';


    /**
     * 视图引擎
     *
     * @public
     * @type {Engine}
     * @memberof HROMHierarchyTreeExpViewBase
     */
    public engine: TreeExpViewEngine = new TreeExpViewEngine();

    /**
     * 引擎初始化
     *
     * @public
     * @memberof HROMHierarchyTreeExpViewBase
     */
    public engineInit(): void {
        this.engine.init({
            view: this,
            treeexpbar: this.$refs.treeexpbar,
            keyPSDEField: 'hromhierarchy',
            majorPSDEField: 'organizationname',
            isLoadDefault: true,
        });
    }

    /**
     * treeexpbar 部件 selectionchange 事件
     *
     * @param {*} [args={}]
     * @param {*} $event
     * @memberof HROMHierarchyTreeExpViewBase
     */
    public treeexpbar_selectionchange($event: any, $event2?: any): void {
        this.engine.onCtrlEvent('treeexpbar', 'selectionchange', $event);
    }

    /**
     * treeexpbar 部件 activated 事件
     *
     * @param {*} [args={}]
     * @param {*} $event
     * @memberof HROMHierarchyTreeExpViewBase
     */
    public treeexpbar_activated($event: any, $event2?: any): void {
        this.engine.onCtrlEvent('treeexpbar', 'activated', $event);
    }

    /**
     * treeexpbar 部件 load 事件
     *
     * @param {*} [args={}]
     * @param {*} $event
     * @memberof HROMHierarchyTreeExpViewBase
     */
    public treeexpbar_load($event: any, $event2?: any): void {
        this.engine.onCtrlEvent('treeexpbar', 'load', $event);
    }

    /**
     * 打开新建数据视图
     *
     * @param {any[]} args
     * @param {*} [params]
     * @param {*} [fullargs]
     * @param {*} [$event]
     * @param {*} [xData]
     * @memberof HROMHierarchyTreeExpView
     */
    public newdata(args: any[],fullargs?:any[], params?: any, $event?: any, xData?: any) {
        let localContext:any = null;
        let localViewParam:any =null;
    this.$Notice.warning({ title: '错误', desc: '未指定关系视图' });
    }


    /**
     * 打开编辑数据视图
     *
     * @param {any[]} args
     * @param {*} [params]
     * @param {*} [fullargs]
     * @param {*} [$event]
     * @param {*} [xData]
     * @memberof HROMHierarchyTreeExpView
     */
    public opendata(args: any[],fullargs?:any[],params?: any, $event?: any, xData?: any) {
    this.$Notice.warning({ title: '错误', desc: '未指定关系视图' });
    }



    /**
     * 视图唯一标识
     *
     * @type {string}
     * @memberof HROMHierarchyTreeExpView
     */
    public viewUID: string = 'base-hromhierarchy-tree-exp-view';


}