default-searchform-base.vue 22.6 KB
Newer Older
1 2 3 4
<template>
    <i-form :model="this.data" class='app-search-form' ref='searchform' style="">
  <input style="display:none;"/>
  <row>
5
    <i-col span="20" class="form-content">
6
      <row>
7 8
                    <i-col v-show="detailsModel.n_app_like.visible" :style="{}"  :sm="{ span: 24, offset: 0 }" :md="{ span: 12, offset: 0 }" :lg="{ span: 12, offset: 0 }" :xl="{ span: 12, offset: 0 }">
              <app-form-item name='n_app_like' :itemRules="this.rules.n_app_like" class='' :caption="$t('entities.jobsregistry.default_searchform.details.n_app_like')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.n_app_like.error" :isEmptyCaption="false" labelPos="LEFT"> 
9 10 11 12 13 14 15 16 17
              <input-box 
              v-model="data.n_app_like"  
              @enter="onEnter($event)"  
                
              :disabled="detailsModel.n_app_like.disabled" 
              type='text' 
              style="">
          </input-box>
          
18 19 20 21 22
          </app-form-item>
          
          </i-col>
          <i-col v-show="detailsModel.n_status_eq.visible" :style="{}"  :sm="{ span: 24, offset: 0 }" :md="{ span: 12, offset: 0 }" :lg="{ span: 12, offset: 0 }" :xl="{ span: 12, offset: 0 }">
              <app-form-item name='n_status_eq' :itemRules="this.rules.n_status_eq" class='' :caption="$t('entities.jobsregistry.default_searchform.details.n_status_eq')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.n_status_eq.error" :isEmptyCaption="false" labelPos="LEFT"> 
23 24 25 26 27 28
              
           <dropdown-list 
              v-model="data.n_status_eq" 
              :data="data" 
              :context="context"
              :viewparams="viewparams"
29
              :formState="formState" 
30 31 32 33 34 35 36 37 38
              :localContext ='{ }' 
              :localParam ='{ }' 
              :disabled="detailsModel.n_status_eq.disabled" 
              valueType="number"
              tag='CodeListJobStatus' 
              codelistType='STATIC'
              placeholder='请选择...' style="">
           </dropdown-list>
          
39 40 41
          </app-form-item>
          
          </i-col>
42 43
      </row>
    </i-col>
44
    <i-col span="4" class="search-button">
45 46 47 48 49 50 51
      <row v-show="Object.keys(data).length>0">
        <i-button class='search_reset'  size="default" type="primary"  @click="onSearch">{{$t('app.searchButton.search')}}</i-button>
        <i-button class='search_reset'  size="default"  @click="onReset">{{this.$t('app.searchButton.reset')}}</i-button>
      </row>
    </i-col>
  </row>
</i-form>
52

53 54
</template>
<script lang='tsx'>
55
import { Vue, Component, Prop, Provide, Emit, Watch, Model,Inject } from 'vue-property-decorator';
56 57 58
import { CreateElement } from 'vue';
import { Subject, Subscription } from 'rxjs';
import { ControlInterface } from '@/interface/control';
59 60 61
import { UIActionTool,Util,ViewTool } from '@/utils';
import NavDataService from '@/service/app/navdata-service';
import AppCenterService from "@service/app/app-center-service";
62
import JobsRegistryEntityService from '@/service/jobs-registry/jobs-registry-service';
63
import DefaultService from './default-searchform-service';
64
import JobsRegistryUIService from '@/uiservice/jobs-registry/jobs-registry-ui-service';
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
import { FormButtonModel, FormPageModel, FormItemModel, FormDRUIPartModel, FormPartModel, FormGroupPanelModel, FormIFrameModel, FormRowItemModel, FormTabPageModel, FormTabPanelModel, FormUserControlModel } from '@/model/form-detail';
import { debounceTime, distinctUntilChanged } from 'rxjs/operators';


@Component({
    components: {
      
    }
})
export default class DefaultBase extends Vue implements ControlInterface {

    /**
     * 名称
     *
     * @type {string}
80
     * @memberof DefaultBase
81
     */
82
    @Prop() public name?: string;
83 84 85 86 87

    /**
     * 视图通讯对象
     *
     * @type {Subject<ViewState>}
88
     * @memberof DefaultBase
89
     */
90
    @Prop() public viewState!: Subject<ViewState>;
91 92 93 94 95

    /**
     * 应用上下文
     *
     * @type {*}
96
     * @memberof DefaultBase
97
     */
98
    @Prop() public context!: any;
99 100 101 102 103

    /**
     * 视图参数
     *
     * @type {*}
104
     * @memberof DefaultBase
105
     */
106
    @Prop() public viewparams!: any;
107 108 109 110

    /**
     * 视图状态事件
     *
111
     * @public
112
     * @type {(Subscription | undefined)}
113
     * @memberof DefaultBase
114
     */
115
    public viewStateEvent: Subscription | undefined;
116 117 118 119 120

    /**
     * 获取部件类型
     *
     * @returns {string}
121
     * @memberof DefaultBase
122
     */
123
    public getControlType(): string {
124 125 126 127 128 129 130 131 132
        return 'SEARCHFORM'
    }



    /**
     * 计数器服务对象集合
     *
     * @type {Array<*>}
133
     * @memberof DefaultBase
134
     */    
135
    public counterServiceArray:Array<any> = [];
136 137 138 139 140

    /**
     * 建构部件服务对象
     *
     * @type {DefaultService}
141
     * @memberof DefaultBase
142
     */
143
    public service: DefaultService = new DefaultService({ $store: this.$store });
144 145 146 147 148

    /**
     * 实体服务对象
     *
     * @type {JobsRegistryService}
149
     * @memberof DefaultBase
150
     */
151
    public appEntityService: JobsRegistryEntityService = new JobsRegistryEntityService({ $store: this.$store });
152 153 154
    


155 156 157 158 159 160 161 162 163 164 165 166 167
    /**
     * 转化数据
     *
     * @param {any} args
     * @memberof  DefaultBase
     */
    public transformData(args: any) {
        let _this: any = this;
        if(_this.service && _this.service.handleRequestData instanceof Function && _this.service.handleRequestData('transform',_this.context,args)){
            return _this.service.handleRequestData('transform',_this.context,args)['data'];
        }
    }

168 169 170 171
    /**
     * 关闭视图
     *
     * @param {any} args
172
     * @memberof DefaultBase
173
     */
174
    public closeView(args: any): void {
175 176 177 178 179 180 181
        let _this: any = this;
        _this.$emit('closeview', [args]);
    }

    /**
     *  计数器刷新
     *
182
     * @memberof DefaultBase
183 184 185 186 187 188 189 190 191 192 193 194 195
     */
    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();
                }
            })
        }
    }


196

197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222
    /**
     * 获取多项数据
     *
     * @returns {any[]}
     * @memberof DefaultBase
     */
    public getDatas(): any[] {
        return [this.data];
    }

    /**
     * 获取单项树
     *
     * @returns {*}
     * @memberof DefaultBase
     */
    public getData(): any {
        return this.data;
    }

    /**
     * 显示处理提示
     *
     * @type {boolean}
     * @memberof DefaultBase
     */
223
    @Prop({ default: true }) public showBusyIndicator?: boolean;
224 225 226 227 228 229 230
    
    /**
     * 部件行为--loaddraft
     *
     * @type {string}
     * @memberof DefaultBase
     */
231
    @Prop() public loaddraftAction!: string;
232 233 234 235 236 237 238
    
    /**
     * 部件行为--load
     *
     * @type {string}
     * @memberof DefaultBase
     */
239
    @Prop() public loadAction!: string;
240 241 242 243 244 245 246

    /**
     * 视图标识
     *
     * @type {string}
     * @memberof DefaultBase
     */
247
    @Prop() public viewtag!: string;
248 249 250 251 252 253 254

    /**
     * 表单状态
     *
     * @type {Subject<any>}
     * @memberof DefaultBase
     */
255
    public formState: Subject<any> = new Subject();
256 257 258 259 260 261 262

    /**
     * 忽略表单项值变化
     *
     * @type {boolean}
     * @memberof DefaultBase
     */
263
    public ignorefieldvaluechange: boolean = false;
264 265 266 267

    /**
     * 数据变化
     *
268
     * @public
269 270 271
     * @type {Subject<any>}
     * @memberof DefaultBase
     */
272
    public dataChang: Subject<any> = new Subject();
273 274 275 276

    /**
     * 视图状态事件
     *
277
     * @public
278 279 280
     * @type {(Subscription | undefined)}
     * @memberof DefaultBase
     */
281
    public dataChangEvent: Subscription | undefined;
282 283 284 285

    /**
     * 原始数据
     *
286
     * @public
287 288 289
     * @type {*}
     * @memberof DefaultBase
     */
290
    public oldData: any = {};
291 292 293 294 295 296 297

    /**
     * 表单数据对象
     *
     * @type {*}
     * @memberof DefaultBase
     */
298
    public data: any = {
299 300 301 302
        n_app_like: null,
        n_status_eq: null,
    };

303 304 305 306 307 308 309 310 311 312 313 314 315 316 317
    /**
     * 详情模型集合
     *
     * @type {*}
     * @memberof DefaultBase
     */
    public detailsModel: any = {
        formpage1: new FormPageModel({ caption: '常规条件', detailType: 'FORMPAGE', name: 'formpage1', visible: true, isShowCaption: true, form: this })
, 
        n_app_like: new FormItemModel({ caption: '服务名(文本包含(%))', detailType: 'FORMITEM', name: 'n_app_like', visible: true, isShowCaption: true, form: this,required:false, disabled: false, enableCond: 3 })
, 
        n_status_eq: new FormItemModel({ caption: '状态(等于(=))', detailType: 'FORMITEM', name: 'n_status_eq', visible: true, isShowCaption: true, form: this,required:false, disabled: false, enableCond: 3 })
, 
    };
    
318 319 320 321 322 323
    /**
     * 属性值规则
     *
     * @type {*}
     * @memberof DefaultBase
     */
324
    public rules: any = {
325 326 327
        n_app_like: [
            { type: 'string', message: '服务名(文本包含(%)) 值必须为字符串类型', trigger: 'change' },
            { type: 'string', message: '服务名(文本包含(%)) 值必须为字符串类型', trigger: 'blur' },
328 329
            { required: this.detailsModel.n_app_like.required, type: 'string', message: '服务名(文本包含(%)) 值不能为空', trigger: 'change' },
            { required: this.detailsModel.n_app_like.required, type: 'string', message: '服务名(文本包含(%)) 值不能为空', trigger: 'blur' },
330 331 332 333
        ],
        n_status_eq: [
            { type: 'number', message: '状态(等于(=)) 值必须为数值类型', trigger: 'change' },
            { type: 'number', message: '状态(等于(=)) 值必须为数值类型', trigger: 'blur' },
334 335
            { required: this.detailsModel.n_status_eq.required, type: 'number', message: '状态(等于(=)) 值不能为空', trigger: 'change' },
            { required: this.detailsModel.n_status_eq.required, type: 'number', message: '状态(等于(=)) 值不能为空', trigger: 'blur' },
336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366
        ],
    }

    /**
     * 监控表单属性 n_app_like 值
     *
     * @param {*} newVal
     * @param {*} oldVal
     * @memberof DefaultBase
     */
    @Watch('data.n_app_like')
    onN_app_likeChange(newVal: any, oldVal: any) {
        this.formDataChange({ name: 'n_app_like', newVal: newVal, oldVal: oldVal });
    }

    /**
     * 监控表单属性 n_status_eq 值
     *
     * @param {*} newVal
     * @param {*} oldVal
     * @memberof DefaultBase
     */
    @Watch('data.n_status_eq')
    onN_status_eqChange(newVal: any, oldVal: any) {
        this.formDataChange({ name: 'n_status_eq', newVal: newVal, oldVal: oldVal });
    }


    /**
     * 重置表单项值
     *
367
     * @public
368 369 370
     * @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal }
     * @memberof DefaultBase
     */
371
    public resetFormData({ name, newVal, oldVal }: { name: string, newVal: any, oldVal: any }): void {
372 373 374 375 376
    }

    /**
     * 表单逻辑
     *
377
     * @public
378 379 380
     * @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal }
     * @memberof DefaultBase
     */
381
    public formLogic({ name, newVal, oldVal }: { name: string, newVal: any, oldVal: any }): void {
382 383 384 385 386 387 388 389 390
                



    }

    /**
     * 表单值变化
     *
391
     * @public
392 393 394 395
     * @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal }
     * @returns {void}
     * @memberof DefaultBase
     */
396
    public formDataChange({ name, newVal, oldVal }: { name: string, newVal: any, oldVal: any }): void {
397 398 399 400 401 402 403 404 405 406 407
        if (this.ignorefieldvaluechange) {
            return;
        }
        this.resetFormData({ name: name, newVal: newVal, oldVal: oldVal });
        this.formLogic({ name: name, newVal: newVal, oldVal: oldVal });
        this.dataChang.next(JSON.stringify(this.data));
    }

    /**
     * 表单加载完成
     *
408
     * @public
409
     * @param {*} [data={}]
410
     * @param {string} [action]
411 412
     * @memberof DefaultBase
     */
413
    public onFormLoad(data: any = {},action:string): void {
414
        this.setFormEnableCond(data);
415
        this.fillForm(data,action);
416 417 418 419 420 421 422
        this.formLogic({ name: '', newVal: null, oldVal: null });
    }

    /**
     * 值填充
     *
     * @param {*} [_datas={}]
423
     * @param {string} [action]
424 425
     * @memberof DefaultBase
     */
426
    public fillForm(_datas: any = {},action:string): void {
427 428 429 430 431 432
        this.ignorefieldvaluechange = true;
        Object.keys(_datas).forEach((name: string) => {
            if (this.data.hasOwnProperty(name)) {
                this.data[name] = _datas[name];
            }
        });
433 434 435
        if(Object.is(action,'loadDraft')){
            this.createDefault();
        }
436 437 438 439 440 441 442 443
        this.$nextTick(function () {
            this.ignorefieldvaluechange = false;
        })
    }

    /**
     * 设置表单项是否启用
     *
444
     * @public
445 446 447
     * @param {*} data
     * @memberof DefaultBase
     */
448
    public setFormEnableCond(data: any): void {
449 450 451 452 453 454 455 456 457
        Object.values(this.detailsModel).forEach((detail: any) => {
            if (!Object.is(detail.detailType, 'FORMITEM')) {
                return;
            }
            const formItem: FormItemModel = detail;
            formItem.setEnableCond(data.srfuf);
        });
    }

458 459 460 461 462 463 464
    /**
     * 新建默认值
     * @memberof DefaultBase
     */
    public createDefault(){                    
    }

465 466 467
    /**
     * 重置草稿表单状态
     *
468
     * @public
469 470
     * @memberof DefaultBase
     */
471
    public resetDraftFormStates(): void {
472 473 474 475 476 477 478 479 480 481 482
        const form: any = this.$refs.form;
        if (form) {
            form.resetFields();
        }
    }

    /**
     * 重置校验结果
     *
     * @memberof DefaultBase
     */
483
    public resetValidates(): void {
484 485 486 487 488 489 490 491 492 493 494 495 496 497 498
        Object.values(this.detailsModel).forEach((detail: any) => {
            if (!Object.is(detail.detailType, 'FORMITEM')) {
                return;
            }
            const formItem: FormItemModel = detail;
            formItem.setError('');
        });
    }

    /**
     * 填充校验结果 (后台)
     *
     * @param {any[]} fieldErrors
     * @memberof DefaultBase
     */
499
    public fillValidates(fieldErrors: any[]): void {
500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516
        fieldErrors.forEach((error: any) => {
            const formItem: FormItemModel = this.detailsModel[error.field];
            if (!formItem) {
                return;
            }
            this.$nextTick(() => {
                formItem.setError(error.message);
            });
        });
    }

    /**
     * 表单校验状态
     *
     * @returns {boolean} 
     * @memberof DefaultBase
     */
517
    public formValidateStatus(): boolean {
518 519 520 521 522 523 524 525 526 527 528 529 530 531
        const form: any = this.$refs.searchform;
        let validatestate: boolean = true;
        form.validate((valid: boolean) => {
            validatestate = valid ? true : false;
        });
        return validatestate
    }

    /**
     * 获取全部值
     *
     * @returns {*}
     * @memberof DefaultBase
     */
532
    public getValues(): any {
533 534 535 536 537 538 539 540 541 542
        return this.data;
    }

    /**
     * 表单项值变更
     *
     * @param {{ name: string, value: any }} $event
     * @returns {void}
     * @memberof DefaultBase
     */
543
    public onFormItemValueChange($event: { name: string, value: any }): void {
544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560
        if (!$event) {
            return;
        }
        if (!$event.name || Object.is($event.name, '') || !this.data.hasOwnProperty($event.name)) {
            return;
        }
        this.data[$event.name] = $event.value;
    }

    /**
     * 设置数据项值
     *
     * @param {string} name
     * @param {*} value
     * @returns {void}
     * @memberof DefaultBase
     */
561
    public setDataItemValue(name: string, value: any): void {
562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578
        if (!name || Object.is(name, '') || !this.data.hasOwnProperty(name)) {
            return;
        }
        if (Object.is(this.data[name], value)) {
            return;
        }
        this.data[name] = value;
    }



    /**
     * 分组界面行为事件
     *
     * @param {*} $event
     * @memberof DefaultBase
     */
579
    public groupUIActionClick($event: any): void {
580 581 582 583 584 585 586 587 588 589 590
        if (!$event) {
            return;
        }
        const item:any = $event.item;
    }

    /**
     * Vue声明周期(处理组件的输入属性)
     *
     * @memberof DefaultBase
     */
591
    public created(): void {
592 593 594 595 596 597 598 599
        this.afterCreated();
    }

    /**
     * 执行created后的逻辑
     *
     *  @memberof DefaultBase
     */    
600
    public afterCreated(){
601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623
        if (this.viewState) {
            this.viewStateEvent = this.viewState.subscribe(({ tag, action, data }) => {
                if (!Object.is(tag, this.name)) {
                    return;
                }
                if (Object.is('autoload', action)) {
                    this.autoLoad(data);
                }
                if (Object.is('load', action)) {
                    this.load(data);
                }
                if (Object.is('loaddraft', action)) {
                    this.loadDraft(data);
                }
            });
        }
    }

    /**
     * vue 生命周期
     *
     * @memberof DefaultBase
     */
624
    public destroyed() {
625 626 627 628 629 630 631 632
        this.afterDestroy();
    }

    /**
     * 执行destroyed后的逻辑
     *
     * @memberof DefaultBase
     */
633
    public afterDestroy() {
634 635 636 637 638 639 640 641 642 643 644 645 646 647 648
        if (this.viewStateEvent) {
            this.viewStateEvent.unsubscribe();
        }
        if (this.dataChangEvent) {
            this.dataChangEvent.unsubscribe();
        }
    }

    /**
     * 自动加载
     *
     * @param {*} [arg={}]
     * @returns {void}
     * @memberof DefaultBase
     */
649
    public autoLoad(arg: any = {}): void {
650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665
        if (arg.srfkey && !Object.is(arg.srfkey, '')) {
            Object.assign(arg, { srfkey: arg.srfkey });
            this.load(arg);
            return;
        }
        if (arg.srfkeys && !Object.is(arg.srfkeys, '')) {
            Object.assign(arg, { srfkey: arg.srfkeys });
            this.load(arg);
            return;
        }
        this.loadDraft(arg);
    }

    /**
     * 加载
     *
666
     * @public
667 668 669
     * @param {*} [opt={}]
     * @memberof DefaultBase
     */
670
    public load(opt: any = {}): void {
671
        if(!this.loadAction){
672
            this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'JobsRegistryGridView' + (this.$t('app.searchForm.notConfig.loadAction') as string) });
673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690
            return;
        }
        const arg: any = { ...opt };
        Object.assign(arg,{viewparams:this.viewparams});
        const get: Promise<any> = this.service.get(this.loadAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
        get.then((response: any) => {
            if (response && response.status === 200) {
                const data = response.data;
                this.$emit('load', data);
                this.$nextTick(() => {
                    this.formState.next({ type: 'load', data: data });
                });
            }
        }).catch((response: any) => {
            if (response && response.status === 401) {
                return;
            }
            if (!response || !response.status || !response.data) {
691
                this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.commonWords.sysException') as string) });
692 693 694 695 696 697 698 699 700 701 702 703 704 705
                return;
            }

            const { data: _data } = response;
            this.$Notice.error({ title: _data.title, desc: _data.message });
        });
    }

    /**
     * 加载草稿
     *
     * @param {*} [opt={}]
     * @memberof DefaultBase
     */
706
    public loadDraft(opt: any = {},mode?:string): void {
707
        if(!this.loaddraftAction){
708
            this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'JobsRegistryGridView' + (this.$t('app.searchForm.notConfig.loaddraftAction') as string) });
709 710 711 712 713 714 715
            return;
        }
        const arg: any = { ...opt } ;
        Object.assign(arg,{viewparams:this.viewparams});
        let post: Promise<any> = this.service.loadDraft(this.loaddraftAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
        post.then((response: any) => {
            if (!response.status || response.status !== 200) {
716 717
                if (response.data && response.data.message) {
                    this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
718 719 720 721 722 723
                }
                return;
            }

            const data = response.data;
            this.resetDraftFormStates();
724
            this.onFormLoad(data,'loadDraft');
725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748
            setTimeout(() => {
                const form: any = this.$refs.form;
                if (form) {
                    form.fields.forEach((field: any) => {
                        field.validateMessage = "";
                        field.validateState = "";
                        field.validateStatus = false;
                    });
                }
            });
            if(Object.is(mode,'RESET')){
                if (!this.formValidateStatus()) {
                    return;
                }
            }
            this.$emit('load', data);
            this.$nextTick(() => {
                this.formState.next({ type: 'load', data: data });
            });
        }).catch((response: any) => {
            if (response && response.status === 401) {
                return;
            }
            if (!response || !response.status || !response.data) {
749
                this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.commonWords.sysException') as string) });
750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767
                return;
            }

            const { data: _data } = response;
            this.$Notice.error({ title: _data.title, desc: _data.message });
        });
    }

    /**
     * 表单项更新
     *
     * @param {string} mode 界面行为名称
     * @param {*} [data={}] 请求数据
     * @param {string[]} updateDetails 更新项
     * @param {boolean} [showloading] 是否显示加载状态
     * @returns {void}
     * @memberof DefaultBase
     */
768
    public updateFormItems(mode: string, data: any = {}, updateDetails: string[], showloading?: boolean): void {
769 770 771 772 773 774 775 776 777
        
    }

    /**
     * 回车事件
     *
     * @param {*} $event
     * @memberof DefaultBase
     */
778
    public onEnter($event: any): void {
779 780 781
        if (!this.formValidateStatus()) {
            return;
        }
782
        this.$emit('search', this.data);
783 784 785 786 787 788 789
    }

    /**
     * 搜索
     *
     * @memberof DefaultBase
     */
790
    public onSearch() {
791 792 793
        if (!this.formValidateStatus()) {
            return;
        }
794
        this.$emit('search', this.data);
795 796 797 798 799 800 801
    }

    /**
     * 重置
     *
     * @memberof DefaultBase
     */
802
    public onReset() {
803 804 805 806 807 808 809 810
        this.loadDraft({},'RESET');
    }
}
</script>

<style lang='less'>
@import './default-searchform.less';
</style>