wfuser-grid-view-base.vue 57.8 KB
Newer Older
ibizdev's avatar
ibizdev committed
1
<template>
2
<div class='view-container degridview wfuser-grid-view'>
3
    <app-studioaction :viewTitle="$t(model.srfCaption)" viewName="wfusergridview"></app-studioaction>
ibizdev's avatar
ibizdev committed
4
    <card class='view-card '  :dis-hover="true" :bordered="false">
5
        <div slot='title' class="header-container">
6
        <span class='caption-info' :title="$t(model.srfCaption)">{{$t(model.srfCaption)}}</span>
7 8 9
        </div>
            <div class='view-top-messages'>
            </div>
10
        <div class='content-container'>
11
            <div style='margin-bottom: 6px;'>
12
                <i-input v-show="!isExpandSearchForm" v-model="query" search enter-button @on-search="onSearch($event)" class='quick-search-input' style='max-width: 400px;padding-left: 24px' placeholder="用户名称" />
13 14 15
                <div class='pull-right'>
                    <div class='toolbar-container'>
                        <tooltip :transfer="true" :max-width="600">
16
                                <i-button v-show="toolBarModels.tbitem3.visabled" :disabled="toolBarModels.tbitem3.disabled" class='' v-loading:i-button @click="toolbar_click({ tag: 'tbitem3' }, $event)">
17 18 19 20 21 22
                                    <i class='fa fa-file-text-o'></i>
                                    <span class='caption'>{{$t('entities.wfuser.gridviewtoolbar_toolbar.tbitem3.caption')}}</span>
                                </i-button>
                            <div slot='content'>{{$t('entities.wfuser.gridviewtoolbar_toolbar.tbitem3.tip')}}</div>
                        </tooltip>
                        <tooltip :transfer="true" :max-width="600">
23
                                <i-button v-show="toolBarModels.tbitem4.visabled" :disabled="toolBarModels.tbitem4.disabled" class='' v-loading:i-button @click="toolbar_click({ tag: 'tbitem4' }, $event)">
24 25 26 27 28 29
                                    <i class='fa fa-edit'></i>
                                    <span class='caption'>{{$t('entities.wfuser.gridviewtoolbar_toolbar.tbitem4.caption')}}</span>
                                </i-button>
                            <div slot='content'>{{$t('entities.wfuser.gridviewtoolbar_toolbar.tbitem4.tip')}}</div>
                        </tooltip>
                        <tooltip :transfer="true" :max-width="600">
30
                                <i-button v-show="toolBarModels.tbitem6.visabled" :disabled="toolBarModels.tbitem6.disabled" class='' v-loading:i-button @click="toolbar_click({ tag: 'tbitem6' }, $event)">
31 32 33 34 35
                                    <i class='fa fa-copy'></i>
                                    <span class='caption'>{{$t('entities.wfuser.gridviewtoolbar_toolbar.tbitem6.caption')}}</span>
                                </i-button>
                            <div slot='content'>{{$t('entities.wfuser.gridviewtoolbar_toolbar.tbitem6.tip')}}</div>
                        </tooltip>
36 37
                        <span class='seperator'>|</span>
                        <tooltip :transfer="true" :max-width="600">
38
                                <i-button v-show="toolBarModels.tbitem8.visabled" :disabled="toolBarModels.tbitem8.disabled" class='' v-loading:i-button @click="toolbar_click({ tag: 'tbitem8' }, $event)">
39 40 41 42 43
                                    <i class='fa fa-remove'></i>
                                    <span class='caption'>{{$t('entities.wfuser.gridviewtoolbar_toolbar.tbitem8.caption')}}</span>
                                </i-button>
                            <div slot='content'>{{$t('entities.wfuser.gridviewtoolbar_toolbar.tbitem8.tip')}}</div>
                        </tooltip>
44 45
                        <span class='seperator'>|</span>
                        <tooltip :transfer="true" :max-width="600">
46 47 48
                            <app-export-excel :item="toolBarModels.tbitem13" :caption="$t('entities.wfuser.gridviewtoolbar_toolbar.tbitem13.caption')" @exportexcel="toolbar_click({ tag: 'tbitem13' }, $event)"></app-export-excel>
                            <div slot='content'>{{$t('entities.wfuser.gridviewtoolbar_toolbar.tbitem13.tip')}}</div>
                        </tooltip>
49 50
                        <span class='seperator'>|</span>
                        <dropdown v-show="toolBarModels.tbitem16.visabled" trigger='click'>
51 52 53 54 55 56 57 58 59 60 61
                            <tooltip :transfer="true" :max-width="600">
                                    <i-button class=''>
                                        <i class=''></i>
                                        <span class='caption'>{{$t('entities.wfuser.gridviewtoolbar_toolbar.tbitem16.caption')}}</span>
                                        <icon type="ios-arrow-down"></icon>
                                    </i-button>
                                <div slot='content'>{{$t('entities.wfuser.gridviewtoolbar_toolbar.tbitem16.tip')}}</div>
                            </tooltip>
                            <dropdown-menu slot='list'>
                                <dropdown-item>
                                    <tooltip :transfer="true" :max-width="600">
62
                                <i-button v-show="toolBarModels.tbitem21.visabled" :disabled="toolBarModels.tbitem21.disabled" class='' v-loading:i-button @click="toolbar_click({ tag: 'tbitem21' }, $event)">
63 64 65 66 67 68 69 70 71 72
                                    <i class='fa fa-download'></i>
                                    <span class='caption'>{{$t('entities.wfuser.gridviewtoolbar_toolbar.tbitem21.caption')}}</span>
                                </i-button>
                            <div slot='content'>{{$t('entities.wfuser.gridviewtoolbar_toolbar.tbitem21.tip')}}</div>
                        </tooltip>
                        
                        
                                </dropdown-item>
                                <dropdown-item>
                                    <tooltip :transfer="true" :max-width="600">
73
                                <i-button v-show="toolBarModels.tbitem23.visabled" :disabled="toolBarModels.tbitem23.disabled" class='' v-loading:i-button @click="toolbar_click({ tag: 'tbitem23' }, $event)">
74 75 76 77 78 79 80 81 82 83
                                    <i class='fa fa-upload'></i>
                                    <span class='caption'>{{$t('entities.wfuser.gridviewtoolbar_toolbar.tbitem23.caption')}}</span>
                                </i-button>
                            <div slot='content'>{{$t('entities.wfuser.gridviewtoolbar_toolbar.tbitem23.tip')}}</div>
                        </tooltip>
                        
                        
                                </dropdown-item>
                            </dropdown-menu>
                        </dropdown>
84 85
                        <span class='seperator'>|</span>
                        <tooltip :transfer="true" :max-width="600">
86
                                <i-button v-show="toolBarModels.tbitem19.visabled" :disabled="toolBarModels.tbitem19.disabled" class='' v-loading:i-button @click="toolbar_click({ tag: 'tbitem19' }, $event)">
87 88 89 90 91 92
                                    <i class='fa fa-filter'></i>
                                    <span class='caption'>{{$t('entities.wfuser.gridviewtoolbar_toolbar.tbitem19.caption')}}</span>
                                </i-button>
                            <div slot='content'>{{$t('entities.wfuser.gridviewtoolbar_toolbar.tbitem19.tip')}}</div>
                        </tooltip>
                        <tooltip :transfer="true" :max-width="600">
93
                                <i-button v-show="toolBarModels.tbitem18.visabled" :disabled="toolBarModels.tbitem18.disabled" class='' v-loading:i-button @click="toolbar_click({ tag: 'tbitem18' }, $event)">
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117
                                    <i class='fa fa-question'></i>
                                    <span class='caption'>{{$t('entities.wfuser.gridviewtoolbar_toolbar.tbitem18.caption')}}</span>
                                </i-button>
                            <div slot='content'>{{$t('entities.wfuser.gridviewtoolbar_toolbar.tbitem18.tip')}}</div>
                        </tooltip>
                    </div>
                </div>
            </div>
            <view_searchform 
                :viewState="viewState"  
                :viewparams="viewparams" 
                :context="context" 
                :showBusyIndicator="true"
                v-show="isExpandSearchForm"
                loaddraftAction="FilterGetDraft"
                loadAction="FilterGet"
            
                name="searchform"  
                ref='searchform' 
                @save="searchform_save($event)"  
                @search="searchform_search($event)"  
                @load="searchform_load($event)"  
                @closeview="closeView($event)">
            </view_searchform>
118 119
                    <div class='view-body-messages'>
                    </div>
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
            <view_grid 
                :viewState="viewState"  
                :viewparams="viewparams" 
                :context="context" 
                :isSingleSelect="isSingleSelect"
                :showBusyIndicator="true"
                :isOpenEdit="false"
                :gridRowActiveMode="gridRowActiveMode"
                :isformDruipart="isformDruipart"
                @save="onSave"
                updateAction=""
                removeAction="Remove"
                loaddraftAction=""
                loadAction=""
                createAction=""
                fetchAction="FetchDefault"
                :newdata="newdata"
                :opendata="opendata"
                name="grid"  
                ref='grid' 
                @selectionchange="grid_selectionchange($event)"  
                @beforeload="grid_beforeload($event)"  
                @rowdblclick="grid_rowdblclick($event)"  
                @remove="grid_remove($event)"  
                @load="grid_load($event)"  
                @closeview="closeView($event)">
            </view_grid>
147
        </div>
148 149
            <div class='view-bottom-messages'>
            </div>
ibizdev's avatar
ibizdev committed
150 151 152 153
    </card>
</div>
</template>

ibizdev's avatar
ibizdev committed
154

ibizdev's avatar
ibizdev committed
155
<script lang='tsx'>
156
import { Vue, Component, Prop, Provide, Emit, Watch,Inject } from 'vue-property-decorator';
ibizdev's avatar
ibizdev committed
157
import { UIActionTool,Util } from '@/utils';
158
import NavDataService from '@/service/app/navdata-service';
159
import { Subject,Subscription } from 'rxjs';
ibizdev's avatar
ibizdev committed
160
import WFUserService from '@/service/wfuser/wfuser-service';
161
import WFUserAuthService from '@/authservice/wfuser/wfuser-auth-service';
ibizdev's avatar
ibizdev committed
162 163 164 165

import GridViewEngine from '@engine/view/grid-view-engine';


166
import WFUserUIService from '@/uiservice/wfuser/wfuser-ui-service';
167
import CodeListService from "@/codelist/codelist-service";
ibizdev's avatar
ibizdev committed
168

ibizdev's avatar
ibizdev committed
169 170 171 172 173 174 175 176 177 178 179 180 181

@Component({
    components: {
    },
})
export default class WFUserGridViewBase extends Vue {

    /**
     * 实体服务对象
     *
     * @type {WFUserService}
     * @memberof WFUserGridViewBase
     */
ibizdev's avatar
ibizdev committed
182
    public appEntityService: WFUserService = new WFUserService;
ibizdev's avatar
ibizdev committed
183

184
    /**
185
     * 实体UI服务对象
186
     *
187
     * @type WFUserUIService
188 189
     * @memberof WFUserGridViewBase
     */
190
    public appUIService: WFUserUIService = new WFUserUIService(this.$store);
ibizdev's avatar
ibizdev committed
191 192 193 194 195 196 197 198 199
    
    /**
     * 数据变化
     *
     * @param {*} val
     * @returns {*}
     * @memberof WFUserGridViewBase
     */
    @Emit() 
ibizdev's avatar
ibizdev committed
200
    public viewDatasChange(val: any):any {
ibizdev's avatar
ibizdev committed
201 202 203 204 205 206 207 208 209
        return val;
    }

    /**
     * 传入视图上下文
     *
     * @type {string}
     * @memberof WFUserGridViewBase
     */
ibizdev's avatar
ibizdev committed
210
    @Prop() public viewdata!: string;
ibizdev's avatar
ibizdev committed
211 212 213 214 215 216 217

    /**
     * 传入视图参数
     *
     * @type {string}
     * @memberof WFUserGridViewBase
     */
ibizdev's avatar
ibizdev committed
218
    @Prop() public viewparam!: string;
ibizdev's avatar
ibizdev committed
219 220 221 222 223 224 225

    /**
     * 视图默认使用
     *
     * @type {boolean}
     * @memberof WFUserGridViewBase
     */
ibizdev's avatar
ibizdev committed
226
    @Prop({ default: true }) public viewDefaultUsage!: boolean;
ibizdev's avatar
ibizdev committed
227

228 229 230 231 232 233
    /**
     * 视图默认使用
     *
     * @type {string}
     * @memberof WFUserGridViewBase
     */
234
    @Inject({from:'navModel',default: 'tab'})
235 236
    public navModel!:string;

ibizdev's avatar
ibizdev committed
237 238 239 240 241 242
	/**
	 * 视图标识
	 *
	 * @type {string}
	 * @memberof WFUserGridViewBase
	 */
243
	public viewtag: string = 'cf0fdabd8378e07ca72ac167b1406756';
ibizdev's avatar
ibizdev committed
244 245 246 247 248 249 250

	/**
	 * 自定义视图导航上下文集合
	 *
	 * @type {*}
	 * @memberof WFUserGridViewBase
	 */
ibizdev's avatar
ibizdev committed
251
    public customViewNavContexts:any ={
ibizdev's avatar
ibizdev committed
252 253 254 255 256 257 258 259
    };

	/**
	 * 自定义视图导航参数集合
	 *
	 * @type {*}
	 * @memberof WFUserGridViewBase
	 */
ibizdev's avatar
ibizdev committed
260
    public customViewParams:any ={
ibizdev's avatar
ibizdev committed
261 262 263 264 265 266 267 268
    };

    /**
     * 视图模型数据
     *
     * @type {*}
     * @memberof WFUserGridViewBase
     */
ibizdev's avatar
ibizdev committed
269
    public model: any = {
ibizdev's avatar
ibizdev committed
270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285
        srfCaption: 'entities.wfuser.views.gridview.caption',
        srfTitle: 'entities.wfuser.views.gridview.title',
        srfSubTitle: 'entities.wfuser.views.gridview.subtitle',
        dataInfo: ''
    }

    /**
     * 视图参数变化
     *
     * @param {*} newVal
     * @param {*} oldVal
     * @memberof WFUserGridViewBase
     */
    @Watch('viewparam',{immediate: true, deep: true})
    onParamData(newVal: any, oldVal: any) {
        if(newVal){
286 287
            this.viewparams = {};
            if(typeof newVal == 'string') {
288
                Object.assign(this.viewparams, JSON.parse(this.viewparam));
289 290
            }else{
                this.viewparams = Util.deepCopy(this.viewparam);
291
            }
ibizdev's avatar
ibizdev committed
292 293 294 295 296 297 298 299 300 301 302 303 304 305
            
        } 
    }

    /**
     * 处理应用上下文变化
     *
     * @param {*} newVal
     * @param {*} oldVal
     * @memberof WFUserGridViewBase
     */
    @Watch('viewdata')
    onViewData(newVal: any, oldVal: any) {
        const _this: any = this;
306
        
ibizdev's avatar
ibizdev committed
307
        if (!Object.is(newVal, oldVal) && _this.engine) {
308 309 310 311
            this.$nextTick(()=>{
              _this.parseViewParam();
              _this.engine.load();
            });
312
        } else if(!Object.is(newVal, oldVal) && _this.refresh && _this.refresh instanceof Function) {
313
            _this.refresh();
ibizdev's avatar
ibizdev committed
314 315 316 317 318 319 320 321 322
        }
    }

    /**
     * 容器模型
     *
     * @type {*}
     * @memberof WFUserGridViewBase
     */
ibizdev's avatar
ibizdev committed
323
    public containerModel: any = {
ibizdev's avatar
ibizdev committed
324 325 326 327 328
        view_toolbar: { name: 'toolbar', type: 'TOOLBAR' },
        view_grid: { name: 'grid', type: 'GRID' },
        view_searchform: { name: 'searchform', type: 'SEARCHFORM' },
    };

329 330 331 332 333 334 335 336 337 338 339 340
    /**
     * 视图刷新
     *
     * @param {*} args
     * @memberof WFUserGridViewBase
     */
    public refresh(args?: any): void {
        const refs: any = this.$refs;
        if (refs && refs.grid) {
            refs.grid.refresh();
        }
    }
ibizdev's avatar
ibizdev committed
341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359
    /**
     *  计数器刷新
     *
     * @memberof WFUserGridViewBase
     */
    public counterRefresh(){
        const _this:any =this;
        if(_this.counterServiceArray && _this.counterServiceArray.length >0){
            _this.counterServiceArray.forEach((item:any) =>{
                if(item.refreshData && item.refreshData instanceof Function){
                    item.refreshData();
                }
            })
        }
    }

    /**
     * 视图状态订阅对象
     *
ibizdev's avatar
ibizdev committed
360
     * @public
ibizdev's avatar
ibizdev committed
361 362 363
     * @type {Subject<{action: string, data: any}>}
     * @memberof WFUserGridViewBase
     */
ibizdev's avatar
ibizdev committed
364
    public viewState: Subject<ViewState> = new Subject();
ibizdev's avatar
ibizdev committed
365 366 367 368 369 370 371
    /**
     * 工具栏模型
     *
     * @type {*}
     * @memberof WFUserGridView
     */
    public toolBarModels: any = {
372
        tbitem3: { name: 'tbitem3', actiontarget: 'NONE', caption: '新建', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'New', target: '' } },
ibizdev's avatar
ibizdev committed
373

374
        tbitem4: { name: 'tbitem4', actiontarget: 'NONE', caption: '编辑', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'Edit', target: 'SINGLEKEY' } },
ibizdev's avatar
ibizdev committed
375

376
        tbitem6: { name: 'tbitem6', actiontarget: 'NONE', caption: '拷贝', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'Copy', target: 'SINGLEKEY' } },
ibizdev's avatar
ibizdev committed
377 378

        tbitem7: {  name: 'tbitem7', type: 'SEPERATOR', visabled: true, dataaccaction: '', uiaction: { } },
379
        tbitem8: { name: 'tbitem8', actiontarget: 'NONE', caption: '删除', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'Remove', target: 'MULTIKEY' } },
ibizdev's avatar
ibizdev committed
380 381

        tbitem9: {  name: 'tbitem9', type: 'SEPERATOR', visabled: true, dataaccaction: '', uiaction: { } },
382
        tbitem13: { name: 'tbitem13', actiontarget: 'NONE', caption: '导出', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'ExportExcel', target: '' }, MaxRowCount: 1000  },
ibizdev's avatar
ibizdev committed
383 384 385

        tbitem10: {  name: 'tbitem10', type: 'SEPERATOR', visabled: true, dataaccaction: '', uiaction: { } },
        tbitem16: { name: 'tbitem16', caption: '其它', disabled: false, type: 'ITEMS', visabled: true, dataaccaction: '', uiaction: { } }, 
386
 tbitem21: { name: 'tbitem21', actiontarget: 'NONE', caption: '导出数据模型', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'ExportModel', target: '' } },
ibizdev's avatar
ibizdev committed
387

388
 tbitem23: { name: 'tbitem23', actiontarget: 'NONE', caption: '数据导入', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'Import', target: '' } },
ibizdev's avatar
ibizdev committed
389 390 391


        tbitem17: {  name: 'tbitem17', type: 'SEPERATOR', visabled: true, dataaccaction: '', uiaction: { } },
392
        tbitem19: { name: 'tbitem19', actiontarget: 'NONE', caption: '过滤', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'ToggleFilter', target: '' } },
ibizdev's avatar
ibizdev committed
393

394
        tbitem18: { name: 'tbitem18', actiontarget: 'NONE', caption: '帮助', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'Help', target: '' } },
ibizdev's avatar
ibizdev committed
395 396 397 398 399 400

    };




ibizdev's avatar
ibizdev committed
401

ibizdev's avatar
ibizdev committed
402 403 404
    /**
     * 视图引擎
     *
ibizdev's avatar
ibizdev committed
405
     * @public
ibizdev's avatar
ibizdev committed
406 407 408
     * @type {Engine}
     * @memberof WFUserGridViewBase
     */
ibizdev's avatar
ibizdev committed
409
    public engine: GridViewEngine = new GridViewEngine();
ibizdev's avatar
ibizdev committed
410 411 412 413

    /**
     * 引擎初始化
     *
ibizdev's avatar
ibizdev committed
414
     * @public
ibizdev's avatar
ibizdev committed
415 416
     * @memberof WFUserGridViewBase
     */
ibizdev's avatar
ibizdev committed
417
    public engineInit(): void {
ibizdev's avatar
ibizdev committed
418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433
        this.engine.init({
            view: this,
            opendata: (args: any[],fullargs?:any[],params?: any, $event?: any, xData?: any) => {
                this.opendata(args,fullargs, params, $event, xData);
            },
            newdata: (args: any[],fullargs?:any[],params?: any, $event?: any, xData?: any) => {
                this.newdata(args,fullargs, params, $event, xData);
            },
            grid: this.$refs.grid,
            searchform: this.$refs.searchform,
            keyPSDEField: 'wfuser',
            majorPSDEField: 'displayname',
            isLoadDefault: true,
        });
    }

434 435 436 437 438 439
    /**
     * 应用导航服务
     *
     * @type {*}
     * @memberof WFUserGridViewBase
     */
440 441 442 443 444 445 446 447 448 449
    public  navDataService = NavDataService.getInstance(this.$store);

    /**
    * 导航服务事件
    *
    * @public
    * @type {(Subscription | undefined)}
    * @memberof WFUserGridViewBase
    */
    public serviceStateEvent: Subscription | undefined;
450

451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467
    /**
     * 门户部件状态对象
     *
     * @type {*}
     * @memberof WFUserGridViewBase
     */
    @Prop() public portletState?: any;

   /**
   * 门户部件状态事件
   *
   * @public
   * @type {(Subscription | undefined)}
   * @memberof WFUserGridViewBase
   */
    public portletStateEvent: Subscription | undefined;

ibizdev's avatar
ibizdev committed
468 469 470 471 472 473
    /**
     * 应用上下文
     *
     * @type {*}
     * @memberof WFUserGridViewBase
     */
ibizdev's avatar
ibizdev committed
474
    public context:any = {};
ibizdev's avatar
ibizdev committed
475 476 477 478 479 480 481

    /**
     * 视图参数
     *
     * @type {*}
     * @memberof WFUserGridViewBase
     */
ibizdev's avatar
ibizdev committed
482
    public viewparams:any = {};
ibizdev's avatar
ibizdev committed
483

484 485 486 487 488 489 490 491
    /**
     * 视图缓存数据
     *
     * @type {*}
     * @memberof WFUserGridViewBase
     */
    public viewCacheData:any;

492 493 494 495 496 497 498 499 500

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

ibizdev's avatar
ibizdev committed
501 502 503
    /**
     * 解析视图参数
     *
ibizdev's avatar
ibizdev committed
504
     * @public
ibizdev's avatar
ibizdev committed
505 506
     * @memberof WFUserGridViewBase
     */
507
    public parseViewParam(inputvalue:any = null): void {
ibizdev's avatar
ibizdev committed
508 509 510
        for(let key in this.context){
            delete this.context[key];
        }
511 512 513
        if(this.$store.getters.getAppData() && this.$store.getters.getAppData().context){
            Object.assign(this.context,this.$store.getters.getAppData().context);
        }
ibizdev's avatar
ibizdev committed
514
        if (!this.viewDefaultUsage && this.viewdata && !Object.is(this.viewdata, '')) {
515 516 517
            if(typeof this.viewdata == 'string') {
                Object.assign(this.context, JSON.parse(this.viewdata));
            }
ibizdev's avatar
ibizdev committed
518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538
            if(this.context && this.context.srfparentdename){
                Object.assign(this.viewparams,{srfparentdename:this.context.srfparentdename});
            }
            if(this.context && this.context.srfparentkey){
                Object.assign(this.viewparams,{srfparentkey:this.context.srfparentkey});
            }
            this.handleCustomViewData();
            return;
        }
        const path = (this.$route.matched[this.$route.matched.length - 1]).path;
        const keys: Array<any> = [];
        const curReg = this.$pathToRegExp.pathToRegexp(path, keys);
        const matchArray = curReg.exec(this.$route.path);
        let tempValue: Object = {};
        keys.forEach((item: any, index: number) => {
            Object.defineProperty(tempValue, item.name, {
                enumerable: true,
                value: matchArray[index + 1]
            });
        });
        this.$viewTool.formatRouteParams(tempValue,this.$route,this.context,this.viewparams);
539 540 541
        if(inputvalue){
            Object.assign(this.context,{'wfuser':inputvalue});
        }
ibizdev's avatar
ibizdev committed
542 543 544
        //初始化视图唯一标识
        Object.assign(this.context,{srfsessionid:this.$util.createUUID()});
        this.handleCustomViewData();
545
        //初始化导航数据
546
        this.initNavDataWithRoute();
ibizdev's avatar
ibizdev committed
547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581
    }

    /**
     * 处理自定义视图数据
     *
     * @memberof WFUserGridViewBase
     */
	public handleCustomViewData(){
		if(Object.keys(this.customViewNavContexts).length > 0){
			Object.keys(this.customViewNavContexts).forEach((item:any) =>{
				let tempContext:any = {};
				let curNavContext:any = this.customViewNavContexts[item];
				this.handleCustomDataLogic(curNavContext,tempContext,item);
				Object.assign(this.context,tempContext);
			})
		}
		if(Object.keys(this.customViewParams).length > 0){
			Object.keys(this.customViewParams).forEach((item:any) =>{
				let tempParam:any = {};
				let curNavParam:any = this.customViewParams[item];
				this.handleCustomDataLogic(curNavParam,tempParam,item);
				Object.assign(this.viewparams,tempParam);
			})
		}
	}

    /**
     * 处理自定义视图数据逻辑
     *
     * @memberof WFUserGridViewBase
     */
	public handleCustomDataLogic(curNavData:any,tempData:any,item:string){
		// 直接值直接赋值
		if(curNavData.isRawValue){
			if(Object.is(curNavData.value,"null") || Object.is(curNavData.value,"")){
ibizdev's avatar
ibizdev committed
582
                Object.defineProperty(tempData, item.toLowerCase(), {
ibizdev's avatar
ibizdev committed
583 584 585 586 587 588
                    value: null,
                    writable : true,
                    enumerable : true,
                    configurable : true
                });
            }else{
ibizdev's avatar
ibizdev committed
589
                Object.defineProperty(tempData, item.toLowerCase(), {
ibizdev's avatar
ibizdev committed
590 591 592 593 594 595 596 597
                    value: curNavData.value,
                    writable : true,
                    enumerable : true,
                    configurable : true
                });
            }
		}else{
			// 先从导航上下文取数,没有再从导航参数(URL)取数,如果导航上下文和导航参数都没有则为null
598
			if(this.context[(curNavData.value).toLowerCase()] != null){
ibizdev's avatar
ibizdev committed
599
				Object.defineProperty(tempData, item.toLowerCase(), {
ibizdev's avatar
ibizdev committed
600
					value: this.context[(curNavData.value).toLowerCase()],
ibizdev's avatar
ibizdev committed
601 602 603 604 605
					writable : true,
					enumerable : true,
					configurable : true
				});
			}else{
606
				if(this.viewparams[(curNavData.value).toLowerCase()] != null){
ibizdev's avatar
ibizdev committed
607
					Object.defineProperty(tempData, item.toLowerCase(), {
ibizdev's avatar
ibizdev committed
608
						value: this.viewparams[(curNavData.value).toLowerCase()],
ibizdev's avatar
ibizdev committed
609 610 611 612 613
						writable : true,
						enumerable : true,
						configurable : true
					});
				}else{
ibizdev's avatar
ibizdev committed
614
					Object.defineProperty(tempData, item.toLowerCase(), {
ibizdev's avatar
ibizdev committed
615 616 617 618 619 620 621 622 623
						value: null,
						writable : true,
						enumerable : true,
						configurable : true
					});
				}
			}
		}
	}
624 625

    /**
626
     * 初始化导航数据(路由模式)
627 628 629
     *
     * @memberof WFUserGridViewBase
     */
630 631
    public initNavDataWithRoute(data:any = null, isNew:boolean = false,  isAlways:boolean = false){
        if( isAlways || (this.viewDefaultUsage && Object.is(this.navModel,"route")) ){
632
            this.navDataService.addNavData({id:'wfuser-grid-view',tag:this.viewtag,srfkey:isNew ? null : this.context.wfuser,title:this.$t(this.model.srfCaption),data:data,context:this.context,viewparams:this.viewparams,path:this.$route.fullPath});
633 634 635 636 637 638 639 640
        }
    }

    /**
     * 初始化导航数据(分页模式)
     *
     * @memberof WFUserGridViewBase
     */
641 642
    public initNavDataWithTab(data:any = null,isOnlyAdd:boolean = true, isAlways:boolean = false){
        if( isAlways || (this.viewDefaultUsage && !Object.is(this.navModel,"route")) ){
643
            this.navDataService.addNavDataByOnly({id:'wfuser-grid-view',tag:this.viewtag,srfkey:this.context.wfuser,title:this.$t(this.model.srfCaption),data:data,context:this.context,viewparams:this.viewparams,path:this.$route.fullPath},isOnlyAdd);
644 645
        }
    }
ibizdev's avatar
ibizdev committed
646 647 648 649 650 651 652
	

    /**
     * Vue声明周期
     *
     * @memberof WFUserGridViewBase
     */
ibizdev's avatar
ibizdev committed
653
    public created() {
ibizdev's avatar
ibizdev committed
654 655 656 657 658 659 660 661
        this.afterCreated();
    }

    /**
     * 执行created后的逻辑
     *
     * @memberof WFUserGridViewBase
     */    
ibizdev's avatar
ibizdev committed
662
    public afterCreated(){
663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680
        let _this:any = this;
        const secondtag = _this.$util.createUUID();
        _this.$store.commit('viewaction/createdView', { viewtag: _this.viewtag, secondtag: secondtag });
        _this.viewtag = secondtag;
        _this.parseViewParam();
        _this.serviceStateEvent = _this.navDataService.serviceState.subscribe(({ action,name, data }:{ action:string,name:any,data:any }) => {
            if(!Object.is(name,'wfuser-grid-view')){
                return;
            }
            if (Object.is(action, 'viewrefresh')) {
                _this.$nextTick(()=>{
                    _this.parseViewParam(data);
                    if(_this.engine){
                        _this.engine.load();
                    }
                }); 
            }
        });
681 682
        if(_this.portletState){
            _this.portletStateEvent = _this.portletState.subscribe((res:any) =>{
683
                if(!Object.is(res.name,'WFUserGridView')){
684 685 686 687 688 689 690
                    return;
                }
                if(Object.is(res.action,'refresh') && _this.refresh && _this.refresh instanceof Function){
                    _this.refresh();
                }
            })
        }
ibizdev's avatar
ibizdev committed
691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709
        if(this.formDruipart){
            this.formDruipart.subscribe((res:any) =>{
                if(Object.is(res.action,'save')){
                    this.viewState.next({ tag:'grid', action: 'save', data: this.viewparams });
                }
                if(Object.is(res.action,'load')){
                    const _this: any = this;
                    _this.engine.load(res.data,true);
                }
            });
        }

    }

    /**
     * 销毁之前
     *
     * @memberof WFUserGridViewBase
     */
ibizdev's avatar
ibizdev committed
710
    public beforeDestroy() {
ibizdev's avatar
ibizdev committed
711 712 713 714 715 716 717 718
        this.$store.commit('viewaction/removeView', this.viewtag);
    }

    /**
     * Vue声明周期(组件初始化完毕)
     *
     * @memberof WFUserGridViewBase
     */
ibizdev's avatar
ibizdev committed
719
    public mounted() {
ibizdev's avatar
ibizdev committed
720 721 722 723 724 725 726 727
        this.afterMounted();
    }

    /**
     * 执行mounted后的逻辑
     * 
     * @memberof WFUserGridViewBase
     */
ibizdev's avatar
ibizdev committed
728
    public afterMounted(){
ibizdev's avatar
ibizdev committed
729 730 731 732 733 734
        const _this: any = this;
        _this.engineInit();
        if (_this.loadModel && _this.loadModel instanceof Function) {
            _this.loadModel();
        }
        
ibizdev's avatar
ibizdev committed
735

ibizdev's avatar
ibizdev committed
736 737 738 739 740 741 742 743 744 745
    }


    /**
     * toolbar 部件 click 事件
     *
     * @param {*} [args={}]
     * @param {*} $event
     * @memberof WFUserGridViewBase
     */
ibizdev's avatar
ibizdev committed
746
    public toolbar_click($event: any, $event2?: any) {
ibizdev's avatar
ibizdev committed
747
        if (Object.is($event.tag, 'tbitem3')) {
748
            this.toolbar_tbitem3_click(null, '', $event2);
ibizdev's avatar
ibizdev committed
749 750
        }
        if (Object.is($event.tag, 'tbitem4')) {
751
            this.toolbar_tbitem4_click(null, '', $event2);
ibizdev's avatar
ibizdev committed
752 753
        }
        if (Object.is($event.tag, 'tbitem5')) {
754
            this.toolbar_tbitem5_click(null, '', $event2);
ibizdev's avatar
ibizdev committed
755 756
        }
        if (Object.is($event.tag, 'tbitem6')) {
757
            this.toolbar_tbitem6_click(null, '', $event2);
ibizdev's avatar
ibizdev committed
758 759
        }
        if (Object.is($event.tag, 'tbitem24')) {
760
            this.toolbar_tbitem24_click(null, '', $event2);
ibizdev's avatar
ibizdev committed
761 762
        }
        if (Object.is($event.tag, 'tbitem25')) {
763
            this.toolbar_tbitem25_click(null, '', $event2);
ibizdev's avatar
ibizdev committed
764 765
        }
        if (Object.is($event.tag, 'tbitem8')) {
766
            this.toolbar_tbitem8_click(null, '', $event2);
ibizdev's avatar
ibizdev committed
767 768
        }
        if (Object.is($event.tag, 'tbitem13')) {
769
            this.toolbar_tbitem13_click(null, '', $event2);
ibizdev's avatar
ibizdev committed
770 771
        }
        if (Object.is($event.tag, 'tbitem11')) {
772
            this.toolbar_tbitem11_click(null, '', $event2);
ibizdev's avatar
ibizdev committed
773 774
        }
        if (Object.is($event.tag, 'tbitem21')) {
775
            this.toolbar_tbitem21_click(null, '', $event2);
ibizdev's avatar
ibizdev committed
776 777
        }
        if (Object.is($event.tag, 'tbitem23')) {
778
            this.toolbar_tbitem23_click(null, '', $event2);
ibizdev's avatar
ibizdev committed
779 780
        }
        if (Object.is($event.tag, 'tbitem19')) {
781
            this.toolbar_tbitem19_click(null, '', $event2);
ibizdev's avatar
ibizdev committed
782 783
        }
        if (Object.is($event.tag, 'tbitem18')) {
784
            this.toolbar_tbitem18_click(null, '', $event2);
ibizdev's avatar
ibizdev committed
785 786 787 788 789 790 791 792 793 794 795
        }
    }


    /**
     * grid 部件 selectionchange 事件
     *
     * @param {*} [args={}]
     * @param {*} $event
     * @memberof WFUserGridViewBase
     */
ibizdev's avatar
ibizdev committed
796
    public grid_selectionchange($event: any, $event2?: any) {
ibizdev's avatar
ibizdev committed
797 798 799 800 801 802 803 804 805 806 807
        this.engine.onCtrlEvent('grid', 'selectionchange', $event);
    }


    /**
     * grid 部件 beforeload 事件
     *
     * @param {*} [args={}]
     * @param {*} $event
     * @memberof WFUserGridViewBase
     */
ibizdev's avatar
ibizdev committed
808
    public grid_beforeload($event: any, $event2?: any) {
ibizdev's avatar
ibizdev committed
809 810 811 812 813 814 815 816 817 818 819
        this.engine.onCtrlEvent('grid', 'beforeload', $event);
    }


    /**
     * grid 部件 rowdblclick 事件
     *
     * @param {*} [args={}]
     * @param {*} $event
     * @memberof WFUserGridViewBase
     */
ibizdev's avatar
ibizdev committed
820
    public grid_rowdblclick($event: any, $event2?: any) {
ibizdev's avatar
ibizdev committed
821 822 823 824 825 826 827 828 829 830 831
        this.engine.onCtrlEvent('grid', 'rowdblclick', $event);
    }


    /**
     * grid 部件 remove 事件
     *
     * @param {*} [args={}]
     * @param {*} $event
     * @memberof WFUserGridViewBase
     */
ibizdev's avatar
ibizdev committed
832
    public grid_remove($event: any, $event2?: any) {
ibizdev's avatar
ibizdev committed
833 834 835 836 837 838 839 840 841 842 843
        this.engine.onCtrlEvent('grid', 'remove', $event);
    }


    /**
     * grid 部件 load 事件
     *
     * @param {*} [args={}]
     * @param {*} $event
     * @memberof WFUserGridViewBase
     */
ibizdev's avatar
ibizdev committed
844
    public grid_load($event: any, $event2?: any) {
ibizdev's avatar
ibizdev committed
845 846 847 848 849 850 851 852 853 854 855
        this.engine.onCtrlEvent('grid', 'load', $event);
    }


    /**
     * searchform 部件 save 事件
     *
     * @param {*} [args={}]
     * @param {*} $event
     * @memberof WFUserGridViewBase
     */
ibizdev's avatar
ibizdev committed
856
    public searchform_save($event: any, $event2?: any) {
ibizdev's avatar
ibizdev committed
857 858 859 860 861 862 863 864 865 866 867
        this.engine.onCtrlEvent('searchform', 'save', $event);
    }


    /**
     * searchform 部件 search 事件
     *
     * @param {*} [args={}]
     * @param {*} $event
     * @memberof WFUserGridViewBase
     */
ibizdev's avatar
ibizdev committed
868
    public searchform_search($event: any, $event2?: any) {
ibizdev's avatar
ibizdev committed
869 870 871 872 873 874 875 876 877 878 879
        this.engine.onCtrlEvent('searchform', 'search', $event);
    }


    /**
     * searchform 部件 load 事件
     *
     * @param {*} [args={}]
     * @param {*} $event
     * @memberof WFUserGridViewBase
     */
ibizdev's avatar
ibizdev committed
880
    public searchform_load($event: any, $event2?: any) {
ibizdev's avatar
ibizdev committed
881 882 883 884 885 886 887 888 889 890 891 892 893
        this.engine.onCtrlEvent('searchform', 'load', $event);
    }



    /**
     * 逻辑事件
     *
     * @param {*} [params={}]
     * @param {*} [tag]
     * @param {*} [$event]
     * @memberof 
     */
ibizdev's avatar
ibizdev committed
894
    public toolbar_tbitem3_click(params: any = {}, tag?: any, $event?: any) {
ibizdev's avatar
ibizdev committed
895 896 897 898 899 900 901 902 903 904 905 906
        // 参数
        // 取数
        let datas: any[] = [];
        let xData: any = null;
        // _this 指向容器对象
        const _this: any = this;
        let paramJO:any = {};
        let contextJO:any = {};
        xData = this.$refs.grid;
        if (xData.getDatas && xData.getDatas instanceof Function) {
            datas = [...xData.getDatas()];
        }
907 908 909
        if(params){
          datas = [params];
        }
ibizdev's avatar
ibizdev committed
910 911 912 913 914 915 916 917 918 919 920 921
        // 界面行为
        this.New(datas, contextJO,paramJO,  $event, xData,this,"WFUser");
    }

    /**
     * 逻辑事件
     *
     * @param {*} [params={}]
     * @param {*} [tag]
     * @param {*} [$event]
     * @memberof 
     */
ibizdev's avatar
ibizdev committed
922
    public toolbar_tbitem4_click(params: any = {}, tag?: any, $event?: any) {
ibizdev's avatar
ibizdev committed
923 924 925 926 927 928 929 930 931 932 933 934
        // 参数
        // 取数
        let datas: any[] = [];
        let xData: any = null;
        // _this 指向容器对象
        const _this: any = this;
        let paramJO:any = {};
        let contextJO:any = {};
        xData = this.$refs.grid;
        if (xData.getDatas && xData.getDatas instanceof Function) {
            datas = [...xData.getDatas()];
        }
935 936 937
        if(params){
          datas = [params];
        }
ibizdev's avatar
ibizdev committed
938 939 940 941 942 943 944 945 946 947 948 949
        // 界面行为
        this.Edit(datas, contextJO,paramJO,  $event, xData,this,"WFUser");
    }

    /**
     * 逻辑事件
     *
     * @param {*} [params={}]
     * @param {*} [tag]
     * @param {*} [$event]
     * @memberof 
     */
ibizdev's avatar
ibizdev committed
950
    public toolbar_tbitem5_click(params: any = {}, tag?: any, $event?: any) {
ibizdev's avatar
ibizdev committed
951 952 953 954 955 956 957 958 959 960 961 962
        // 参数
        // 取数
        let datas: any[] = [];
        let xData: any = null;
        // _this 指向容器对象
        const _this: any = this;
        let paramJO:any = {};
        let contextJO:any = {};
        xData = this.$refs.grid;
        if (xData.getDatas && xData.getDatas instanceof Function) {
            datas = [...xData.getDatas()];
        }
963 964 965
        if(params){
          datas = [params];
        }
ibizdev's avatar
ibizdev committed
966 967 968 969 970 971 972 973 974 975 976 977
        // 界面行为
        this.View(datas, contextJO,paramJO,  $event, xData,this,"WFUser");
    }

    /**
     * 逻辑事件
     *
     * @param {*} [params={}]
     * @param {*} [tag]
     * @param {*} [$event]
     * @memberof 
     */
ibizdev's avatar
ibizdev committed
978
    public toolbar_tbitem6_click(params: any = {}, tag?: any, $event?: any) {
ibizdev's avatar
ibizdev committed
979 980 981 982 983 984 985 986 987 988 989 990
        // 参数
        // 取数
        let datas: any[] = [];
        let xData: any = null;
        // _this 指向容器对象
        const _this: any = this;
        let paramJO:any = {};
        let contextJO:any = {};
        xData = this.$refs.grid;
        if (xData.getDatas && xData.getDatas instanceof Function) {
            datas = [...xData.getDatas()];
        }
991 992 993
        if(params){
          datas = [params];
        }
ibizdev's avatar
ibizdev committed
994 995 996 997 998 999 1000 1001 1002 1003 1004 1005
        // 界面行为
        this.Copy(datas, contextJO,paramJO,  $event, xData,this,"WFUser");
    }

    /**
     * 逻辑事件
     *
     * @param {*} [params={}]
     * @param {*} [tag]
     * @param {*} [$event]
     * @memberof 
     */
ibizdev's avatar
ibizdev committed
1006
    public toolbar_tbitem24_click(params: any = {}, tag?: any, $event?: any) {
ibizdev's avatar
ibizdev committed
1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018
        // 参数
        // 取数
        let datas: any[] = [];
        let xData: any = null;
        // _this 指向容器对象
        const _this: any = this;
        let paramJO:any = {};
        let contextJO:any = {};
        xData = this.$refs.grid;
        if (xData.getDatas && xData.getDatas instanceof Function) {
            datas = [...xData.getDatas()];
        }
1019 1020 1021
        if(params){
          datas = [params];
        }
ibizdev's avatar
ibizdev committed
1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033
        // 界面行为
        this.ToggleRowEdit(datas, contextJO,paramJO,  $event, xData,this,"WFUser");
    }

    /**
     * 逻辑事件
     *
     * @param {*} [params={}]
     * @param {*} [tag]
     * @param {*} [$event]
     * @memberof 
     */
ibizdev's avatar
ibizdev committed
1034
    public toolbar_tbitem25_click(params: any = {}, tag?: any, $event?: any) {
ibizdev's avatar
ibizdev committed
1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046
        // 参数
        // 取数
        let datas: any[] = [];
        let xData: any = null;
        // _this 指向容器对象
        const _this: any = this;
        let paramJO:any = {};
        let contextJO:any = {};
        xData = this.$refs.grid;
        if (xData.getDatas && xData.getDatas instanceof Function) {
            datas = [...xData.getDatas()];
        }
1047 1048 1049
        if(params){
          datas = [params];
        }
ibizdev's avatar
ibizdev committed
1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061
        // 界面行为
        this.NewRow(datas, contextJO,paramJO,  $event, xData,this,"WFUser");
    }

    /**
     * 逻辑事件
     *
     * @param {*} [params={}]
     * @param {*} [tag]
     * @param {*} [$event]
     * @memberof 
     */
ibizdev's avatar
ibizdev committed
1062
    public toolbar_tbitem8_click(params: any = {}, tag?: any, $event?: any) {
ibizdev's avatar
ibizdev committed
1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074
        // 参数
        // 取数
        let datas: any[] = [];
        let xData: any = null;
        // _this 指向容器对象
        const _this: any = this;
        let paramJO:any = {};
        let contextJO:any = {};
        xData = this.$refs.grid;
        if (xData.getDatas && xData.getDatas instanceof Function) {
            datas = [...xData.getDatas()];
        }
1075 1076 1077
        if(params){
          datas = [params];
        }
ibizdev's avatar
ibizdev committed
1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089
        // 界面行为
        this.Remove(datas, contextJO,paramJO,  $event, xData,this,"WFUser");
    }

    /**
     * 逻辑事件
     *
     * @param {*} [params={}]
     * @param {*} [tag]
     * @param {*} [$event]
     * @memberof 
     */
ibizdev's avatar
ibizdev committed
1090
    public toolbar_tbitem13_click(params: any = {}, tag?: any, $event?: any) {
ibizdev's avatar
ibizdev committed
1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102
        // 参数
        // 取数
        let datas: any[] = [];
        let xData: any = null;
        // _this 指向容器对象
        const _this: any = this;
        let paramJO:any = {};
        let contextJO:any = {};
        xData = this.$refs.grid;
        if (xData.getDatas && xData.getDatas instanceof Function) {
            datas = [...xData.getDatas()];
        }
1103 1104 1105
        if(params){
          datas = [params];
        }
ibizdev's avatar
ibizdev committed
1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117
        // 界面行为
        this.ExportExcel(datas, contextJO,paramJO,  $event, xData,this,"WFUser");
    }

    /**
     * 逻辑事件
     *
     * @param {*} [params={}]
     * @param {*} [tag]
     * @param {*} [$event]
     * @memberof 
     */
ibizdev's avatar
ibizdev committed
1118
    public toolbar_tbitem11_click(params: any = {}, tag?: any, $event?: any) {
ibizdev's avatar
ibizdev committed
1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130
        // 参数
        // 取数
        let datas: any[] = [];
        let xData: any = null;
        // _this 指向容器对象
        const _this: any = this;
        let paramJO:any = {};
        let contextJO:any = {};
        xData = this.$refs.grid;
        if (xData.getDatas && xData.getDatas instanceof Function) {
            datas = [...xData.getDatas()];
        }
1131 1132 1133
        if(params){
          datas = [params];
        }
ibizdev's avatar
ibizdev committed
1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145
        // 界面行为
        this.Print(datas, contextJO,paramJO,  $event, xData,this,"WFUser");
    }

    /**
     * 逻辑事件
     *
     * @param {*} [params={}]
     * @param {*} [tag]
     * @param {*} [$event]
     * @memberof 
     */
ibizdev's avatar
ibizdev committed
1146
    public toolbar_tbitem21_click(params: any = {}, tag?: any, $event?: any) {
ibizdev's avatar
ibizdev committed
1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158
        // 参数
        // 取数
        let datas: any[] = [];
        let xData: any = null;
        // _this 指向容器对象
        const _this: any = this;
        let paramJO:any = {};
        let contextJO:any = {};
        xData = this.$refs.grid;
        if (xData.getDatas && xData.getDatas instanceof Function) {
            datas = [...xData.getDatas()];
        }
1159 1160 1161
        if(params){
          datas = [params];
        }
ibizdev's avatar
ibizdev committed
1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173
        // 界面行为
        this.ExportModel(datas, contextJO,paramJO,  $event, xData,this,"WFUser");
    }

    /**
     * 逻辑事件
     *
     * @param {*} [params={}]
     * @param {*} [tag]
     * @param {*} [$event]
     * @memberof 
     */
ibizdev's avatar
ibizdev committed
1174
    public toolbar_tbitem23_click(params: any = {}, tag?: any, $event?: any) {
ibizdev's avatar
ibizdev committed
1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186
        // 参数
        // 取数
        let datas: any[] = [];
        let xData: any = null;
        // _this 指向容器对象
        const _this: any = this;
        let paramJO:any = {};
        let contextJO:any = {};
        xData = this.$refs.grid;
        if (xData.getDatas && xData.getDatas instanceof Function) {
            datas = [...xData.getDatas()];
        }
1187 1188 1189
        if(params){
          datas = [params];
        }
ibizdev's avatar
ibizdev committed
1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201
        // 界面行为
        this.Import(datas, contextJO,paramJO,  $event, xData,this,"WFUser");
    }

    /**
     * 逻辑事件
     *
     * @param {*} [params={}]
     * @param {*} [tag]
     * @param {*} [$event]
     * @memberof 
     */
ibizdev's avatar
ibizdev committed
1202
    public toolbar_tbitem19_click(params: any = {}, tag?: any, $event?: any) {
ibizdev's avatar
ibizdev committed
1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214
        // 参数
        // 取数
        let datas: any[] = [];
        let xData: any = null;
        // _this 指向容器对象
        const _this: any = this;
        let paramJO:any = {};
        let contextJO:any = {};
        xData = this.$refs.grid;
        if (xData.getDatas && xData.getDatas instanceof Function) {
            datas = [...xData.getDatas()];
        }
1215 1216 1217
        if(params){
          datas = [params];
        }
ibizdev's avatar
ibizdev committed
1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229
        // 界面行为
        this.ToggleFilter(datas, contextJO,paramJO,  $event, xData,this,"WFUser");
    }

    /**
     * 逻辑事件
     *
     * @param {*} [params={}]
     * @param {*} [tag]
     * @param {*} [$event]
     * @memberof 
     */
ibizdev's avatar
ibizdev committed
1230
    public toolbar_tbitem18_click(params: any = {}, tag?: any, $event?: any) {
ibizdev's avatar
ibizdev committed
1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242
        // 参数
        // 取数
        let datas: any[] = [];
        let xData: any = null;
        // _this 指向容器对象
        const _this: any = this;
        let paramJO:any = {};
        let contextJO:any = {};
        xData = this.$refs.grid;
        if (xData.getDatas && xData.getDatas instanceof Function) {
            datas = [...xData.getDatas()];
        }
1243 1244 1245
        if(params){
          datas = [params];
        }
ibizdev's avatar
ibizdev committed
1246 1247 1248 1249
        // 界面行为
        this.Help(datas, contextJO,paramJO,  $event, xData,this,"WFUser");
    }

1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285
    /**
     * 打开新建数据视图
     *
     * @param {any[]} args
     * @param {*} [params]
     * @param {*} [fullargs]
     * @param {*} [$event]
     * @param {*} [xData]
     * @memberof WFUserGridView
     */
    public newdata(args: any[],fullargs?:any[], params?: any, $event?: any, xData?: any) {
        let localContext:any = null;
        let localViewParam:any =null;
        const data: any = {};
        if(args[0].srfsourcekey){
            data.srfsourcekey = args[0].srfsourcekey;
        }
        let tempContext = JSON.parse(JSON.stringify(this.context));
        delete tempContext.wfuser;
        if(args.length >0){
            Object.assign(tempContext,args[0]);
        }
        const deResParameters: any[] = [];
        const parameters: any[] = [
            { pathName: 'wfusers', parameterName: 'wfuser' },
            { pathName: 'editview', parameterName: 'editview' },
        ];
        const _this: any = this;
        const openIndexViewTab = (data: any) => {
            const _data: any = { w: (new Date().getTime()) };
            Object.assign(_data, data);
            const routePath = this.$viewTool.buildUpRoutePath(this.$route, tempContext, deResParameters, parameters, args, _data);
            this.$router.push(routePath);
        }
        openIndexViewTab(data);
    }
ibizdev's avatar
ibizdev committed
1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297


    /**
     * 打开编辑数据视图
     *
     * @param {any[]} args
     * @param {*} [params]
     * @param {*} [fullargs]
     * @param {*} [$event]
     * @param {*} [xData]
     * @memberof WFUserGridView
     */
1298
    public opendata(args: any[],fullargs?:any,params?: any, $event?: any, xData?: any) {
1299 1300 1301 1302 1303 1304 1305
        if(!this.viewDefaultUsage){
            if(Object.is(this.navModel,"route")){
                this.initNavDataWithRoute(this.viewCacheData, false, true);
            }else{
                this.initNavDataWithTab(this.viewCacheData, false, true);
            }
        }
1306 1307
        let localContext:any = null;
        let localViewParam:any =null;
ibizdev's avatar
ibizdev committed
1308
        const data: any = {};
1309
        let tempContext = JSON.parse(JSON.stringify(this.context));
ibizdev's avatar
ibizdev committed
1310
        if(args.length >0){
1311
            Object.assign(tempContext,args[0]);
ibizdev's avatar
ibizdev committed
1312 1313 1314 1315 1316 1317 1318
        }
        const deResParameters: any[] = [];
        const parameters: any[] = [
            { pathName: 'wfusers', parameterName: 'wfuser' },
            { pathName: 'editview', parameterName: 'editview' },
        ];
        const _this: any = this;
1319 1320 1321
        if(fullargs && fullargs.copymode){
            Object.assign(data,{copymode:true});
        }
ibizdev's avatar
ibizdev committed
1322
        const openIndexViewTab = (data: any) => {
1323
            const routePath = this.$viewTool.buildUpRoutePath(this.$route, tempContext, deResParameters, parameters, args, data);
ibizdev's avatar
ibizdev committed
1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340
            this.$router.push(routePath);
        }
        openIndexViewTab(data);
    }


    /**
     * 新建
     *
     * @param {any[]} args 当前数据
     * @param {any} contextJO 行为附加上下文
     * @param {*} [params] 附加参数
     * @param {*} [$event] 事件源
     * @param {*} [xData]  执行行为所需当前部件
     * @param {*} [actionContext]  执行行为上下文
     * @memberof WFUserGridViewBase
     */
ibizdev's avatar
ibizdev committed
1341
    public New(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
ibizdev's avatar
ibizdev committed
1342 1343 1344
         const _this: any = this;
        if (_this.newdata && _this.newdata instanceof Function) {
            const data: any = {};
ibizdev's avatar
ibizdev committed
1345
            _this.newdata([{ ...data }],[{ ...data }], params, $event, xData);
ibizdev's avatar
ibizdev committed
1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360
        } else {
            _this.$Notice.error({ title: '错误', desc: 'newdata 视图处理逻辑不存在,请添加!' });
        }
    }
    /**
     * 编辑
     *
     * @param {any[]} args 当前数据
     * @param {any} contextJO 行为附加上下文
     * @param {*} [params] 附加参数
     * @param {*} [$event] 事件源
     * @param {*} [xData]  执行行为所需当前部件
     * @param {*} [actionContext]  执行行为上下文
     * @memberof WFUserGridViewBase
     */
ibizdev's avatar
ibizdev committed
1361
    public Edit(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
ibizdev's avatar
ibizdev committed
1362 1363 1364 1365 1366 1367 1368 1369 1370
        if (args.length === 0) {
            return;
        }
        const _this: any = this;
        if (_this.opendata && _this.opendata instanceof Function) {
            const data: any = { };
            if (args.length > 0) {
                Object.assign(data, { wfuser: args[0].wfuser })
            }
1371
            _this.opendata([{ ...data }], args, params, $event, xData);
ibizdev's avatar
ibizdev committed
1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386
        } else {
            _this.$Notice.error({ title: '错误', desc: 'opendata 视图处理逻辑不存在,请添加!' });
        }
    }
    /**
     * 查看
     *
     * @param {any[]} args 当前数据
     * @param {any} contextJO 行为附加上下文
     * @param {*} [params] 附加参数
     * @param {*} [$event] 事件源
     * @param {*} [xData]  执行行为所需当前部件
     * @param {*} [actionContext]  执行行为上下文
     * @memberof WFUserGridViewBase
     */
ibizdev's avatar
ibizdev committed
1387
    public View(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
ibizdev's avatar
ibizdev committed
1388 1389 1390 1391 1392 1393 1394 1395 1396
        if (args.length === 0) {
            return;
        }
        const _this: any = this;
        if (_this.opendata && _this.opendata instanceof Function) {
            const data: any = { };
            if (args.length > 0) {
                Object.assign(data, { wfuser: args[0].wfuser })
            }
1397
            _this.opendata([{ ...data }], args, params, $event, xData);
ibizdev's avatar
ibizdev committed
1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412
        } else {
            _this.$Notice.error({ title: '错误', desc: 'opendata 视图处理逻辑不存在,请添加!' });
        }
    }
    /**
     * 拷贝
     *
     * @param {any[]} args 当前数据
     * @param {any} contextJO 行为附加上下文
     * @param {*} [params] 附加参数
     * @param {*} [$event] 事件源
     * @param {*} [xData]  执行行为所需当前部件
     * @param {*} [actionContext]  执行行为上下文
     * @memberof WFUserGridViewBase
     */
ibizdev's avatar
ibizdev committed
1413
    public Copy(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
ibizdev's avatar
ibizdev committed
1414 1415 1416 1417
        if (args.length === 0) {
            return;
        }
        const _this: any = this;
1418 1419
        if (_this.opendata && _this.opendata instanceof Function) {
            const data: any = { };
ibizdev's avatar
ibizdev committed
1420
            if (args.length > 0) {
1421
                Object.assign(data, { wfuser: args[0].wfuser });
ibizdev's avatar
ibizdev committed
1422
            }
1423
            if(!params) params = {};
1424
            Object.assign(args,{copymode:true});
1425
            _this.opendata([{ ...data }], args, params, $event, xData);
ibizdev's avatar
ibizdev committed
1426
        } else {
1427
            Object.assign(this.viewparams,{copymode:true});
ibizdev's avatar
ibizdev committed
1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440
        }
    }
    /**
     * 行编辑
     *
     * @param {any[]} args 当前数据
     * @param {any} contextJO 行为附加上下文
     * @param {*} [params] 附加参数
     * @param {*} [$event] 事件源
     * @param {*} [xData]  执行行为所需当前部件
     * @param {*} [actionContext]  执行行为上下文
     * @memberof WFUserGridViewBase
     */
ibizdev's avatar
ibizdev committed
1441
    public ToggleRowEdit(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
ibizdev's avatar
ibizdev committed
1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454
        xData.actualIsOpenEdit = !xData.actualIsOpenEdit;
    }
    /**
     * 新建行
     *
     * @param {any[]} args 当前数据
     * @param {any} contextJO 行为附加上下文
     * @param {*} [params] 附加参数
     * @param {*} [$event] 事件源
     * @param {*} [xData]  执行行为所需当前部件
     * @param {*} [actionContext]  执行行为上下文
     * @memberof WFUserGridViewBase
     */
ibizdev's avatar
ibizdev committed
1455
    public NewRow(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
ibizdev's avatar
ibizdev committed
1456 1457
        const _this: any = this;
        const data: any = {};
1458
        if (_this.hasOwnProperty('newRow') && _this.newRow instanceof Function) {
ibizdev's avatar
ibizdev committed
1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476
            _this.newRow([{ ...data }], params, $event, xData);
        } else if(xData.newRow && xData.newRow instanceof Function) {
            xData.newRow([{ ...data }], params, $event, xData);
        }else{
            _this.$Notice.error({ title: '错误', desc: 'newRow 视图处理逻辑不存在,请添加!' });
        }
    }
    /**
     * 删除
     *
     * @param {any[]} args 当前数据
     * @param {any} contextJO 行为附加上下文
     * @param {*} [params] 附加参数
     * @param {*} [$event] 事件源
     * @param {*} [xData]  执行行为所需当前部件
     * @param {*} [actionContext]  执行行为上下文
     * @memberof WFUserGridViewBase
     */
ibizdev's avatar
ibizdev committed
1477
    public Remove(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
ibizdev's avatar
ibizdev committed
1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495
        const _this: any = this;
        if (!xData || !(xData.remove instanceof Function)) {
            return ;
        }
        xData.remove(args);
    }

    /**
     * 导出
     *
     * @param {any[]} args 当前数据
     * @param {any} contextJO 行为附加上下文
     * @param {*} [params] 附加参数
     * @param {*} [$event] 事件源
     * @param {*} [xData]  执行行为所需当前部件
     * @param {*} [actionContext]  执行行为上下文
     * @memberof WFUserGridViewBase
     */
ibizdev's avatar
ibizdev committed
1496
    public ExportExcel(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
ibizdev's avatar
ibizdev committed
1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513
        const _this: any = this;
        if (!xData || !(xData.exportExcel instanceof Function) || !$event) {
            return ;
        }
        xData.exportExcel($event.exportparms);
    }
    /**
     * 打印
     *
     * @param {any[]} args 当前数据
     * @param {any} contextJO 行为附加上下文
     * @param {*} [params] 附加参数
     * @param {*} [$event] 事件源
     * @param {*} [xData]  执行行为所需当前部件
     * @param {*} [actionContext]  执行行为上下文
     * @memberof WFUserGridViewBase
     */
ibizdev's avatar
ibizdev committed
1514
    public Print(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
ibizdev's avatar
ibizdev committed
1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531
        let _this:any = this;
        if (!xData || !(xData.print instanceof Function) || !$event) {
            return ;
        }
        xData.print();
    }
    /**
     * 导出数据模型
     *
     * @param {any[]} args 当前数据
     * @param {any} contextJO 行为附加上下文
     * @param {*} [params] 附加参数
     * @param {*} [$event] 事件源
     * @param {*} [xData]  执行行为所需当前部件
     * @param {*} [actionContext]  执行行为上下文
     * @memberof WFUserGridViewBase
     */
ibizdev's avatar
ibizdev committed
1532
    public ExportModel(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
ibizdev's avatar
ibizdev committed
1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545
        this.$Notice.error({ title: '错误', desc: '导出数据模型未支持' });
    }
    /**
     * 数据导入
     *
     * @param {any[]} args 当前数据
     * @param {any} contextJO 行为附加上下文
     * @param {*} [params] 附加参数
     * @param {*} [$event] 事件源
     * @param {*} [xData]  执行行为所需当前部件
     * @param {*} [actionContext]  执行行为上下文
     * @memberof WFUserGridViewBase
     */
ibizdev's avatar
ibizdev committed
1546
    public Import(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
ibizdev's avatar
ibizdev committed
1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563
        const _this: any = this;
        if (!xData || !(xData.importExcel instanceof Function) || !$event) {
            return ;
        }
        xData.importExcel(params);
    }
    /**
     * 过滤
     *
     * @param {any[]} args 当前数据
     * @param {any} contextJO 行为附加上下文
     * @param {*} [params] 附加参数
     * @param {*} [$event] 事件源
     * @param {*} [xData]  执行行为所需当前部件
     * @param {*} [actionContext]  执行行为上下文
     * @memberof WFUserGridViewBase
     */
ibizdev's avatar
ibizdev committed
1564
    public ToggleFilter(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
ibizdev's avatar
ibizdev committed
1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580
        const _this: any = this;
        if (_this.hasOwnProperty('isExpandSearchForm')) {
            _this.isExpandSearchForm = !_this.isExpandSearchForm;
        }
    }
    /**
     * 帮助
     *
     * @param {any[]} args 当前数据
     * @param {any} contextJO 行为附加上下文
     * @param {*} [params] 附加参数
     * @param {*} [$event] 事件源
     * @param {*} [xData]  执行行为所需当前部件
     * @param {*} [actionContext]  执行行为上下文
     * @memberof WFUserGridViewBase
     */
ibizdev's avatar
ibizdev committed
1581
    public Help(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
ibizdev's avatar
ibizdev committed
1582 1583 1584 1585 1586 1587 1588 1589 1590
        this.$Notice.error({ title: '错误', desc: '帮助未支持' });
    }

    /**
     * 关闭视图
     *
     * @param {any[]} args
     * @memberof WFUserGridViewBase
     */
ibizdev's avatar
ibizdev committed
1591
    public closeView(args: any[]): void {
ibizdev's avatar
ibizdev committed
1592 1593
        let _view: any = this;
        if (_view.viewdata) {
1594 1595
            _view.$emit('viewdataschange', Array.isArray(args)?args:[args]);
            _view.$emit('close', Array.isArray(args)?args:[args]);
ibizdev's avatar
ibizdev committed
1596 1597 1598 1599 1600 1601 1602 1603 1604 1605
        } else if (_view.$tabPageExp) {
            _view.$tabPageExp.onClose(_view.$route.fullPath);
        }
    }

    /**
     * 销毁视图回调
     *
     * @memberof WFUserGridViewBase
     */
ibizdev's avatar
ibizdev committed
1606
    public destroyed(){
ibizdev's avatar
ibizdev committed
1607 1608 1609 1610 1611 1612 1613 1614
        this.afterDestroyed();
    }

    /**
     * 执行destroyed后的逻辑
     * 
     * @memberof WFUserGridViewBase
     */
ibizdev's avatar
ibizdev committed
1615
    public afterDestroyed(){
ibizdev's avatar
ibizdev committed
1616 1617 1618 1619 1620 1621 1622 1623 1624
        if(this.viewDefaultUsage){
            let localStoreLength = Object.keys(localStorage);
            if(localStoreLength.length > 0){
                localStoreLength.forEach((item:string) =>{
                if(item.startsWith(this.context.srfsessionid)){
                    localStorage.removeItem(item);
                }
                })
            }
1625 1626 1627
            if(Object.is(this.navModel,"tab")){
                this.navDataService.removeNavDataByTag(this.viewtag);
            }
1628 1629 1630
            if (this.serviceStateEvent) {
                this.serviceStateEvent.unsubscribe();
            }
ibizdev's avatar
ibizdev committed
1631
        }
1632 1633 1634 1635 1636 1637 1638 1639
        // 销毁计数器定时器
        if(this.counterServiceArray && this.counterServiceArray.length >0){
            this.counterServiceArray.forEach((item:any) =>{
                if(item.destroyCounter && item.destroyCounter instanceof Function){
                    item.destroyCounter();
                }
            })
        }
1640 1641 1642
        if(this.portletStateEvent){
            this.portletStateEvent.unsubscribe();
        }
ibizdev's avatar
ibizdev committed
1643 1644 1645 1646 1647 1648 1649 1650 1651 1652
    }

    /**
     * 是否单选
     *
     * @type {boolean}
     * @memberof WFUserGridViewBase
     */
    public isSingleSelect: boolean = false;

ibizdev's avatar
ibizdev committed
1653

ibizdev's avatar
ibizdev committed
1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759
    /**
    * 是否嵌入关系界面
    *
    * @type {boolean}
    * @memberof WFUserGridViewBase
    */
    @Prop({default:false}) public isformDruipart?: boolean;

    /**
    * 界面关系通讯对象
    *
    * @type {Subject<ViewState>}
    * @memberof WFUserGridViewBase
    */
    @Prop() public formDruipart?: Subject<ViewState>;

    /**
     * 搜索值
     *
     * @type {string}
     * @memberof WFUserGridViewBase
     */
    public query: string = '';

    /**
     * 是否展开搜索表单
     *
     * @type {boolean}
     * @memberof WFUserGridViewBase
     */
    public isExpandSearchForm: boolean = false;

    /**
     * 表格行数据默认激活模式
     * 0 不激活
     * 1 单击激活
     * 2 双击激活
     *
     * @type {(number | 0 | 1 | 2)}
     * @memberof WFUserGridViewBase
     */
    public gridRowActiveMode: number | 0 | 1 | 2 = 2;

    /**
     * 快速搜索
     *
     * @param {*} $event
     * @memberof WFUserGridViewBase
     */
    public onSearch($event: any): void {
        const grid: any = this.$refs.grid;
        if (grid) {
            grid.load(this.context, true);
        }
    }

    /**
     * grid 部件 save 事件
     *
     * @param {*} [args={}]
     * @param {*} $event
     * @memberof ENTITYTEST1Usr2GridViewBase
     */
    public onSave($event: any) {
        this.$emit('drdatasaved', $event);
    }

    /**
     * 刷新数据
     *
     * @readonly
     * @type {(number | null)}
     * @memberof WFUserGridViewBase
     */
    get refreshdata(): number | null {
        return this.$store.getters['viewaction/getRefreshData'](this.viewtag);
    }

    /**
     * 监控数据变化
     *
     * @param {*} newVal
     * @param {*} oldVal
     * @returns
     * @memberof WFUserGridViewBase
     */
    @Watch('refreshdata')
    onRefreshData(newVal: any, oldVal: any) {
        if (newVal === null || newVal === undefined) {
            return;
        }
        if (newVal === 0) {
            return;
        }
        const grid: any = this.$refs.grid;
        if (grid) {
            grid.load({});
        }
    }

}
</script>

<style lang='less'>
@import './wfuser-grid-view.less';
</style>