<template>
    <i-form :model="this.data" class='app-form' ref='form' style="">
    <input style="display:none;" />
    <row >
    <tabs :animated="false" name='form' :value="detailsModel.form.activiedPage" 
        @on-click="detailsModel.form.clickPage($event)">
            <tab-pane v-show="detailsModel.formpage1.visible" name='formpage1' :index="0" tab='form' class=''  
                :label="(h) =>{
                    return h('span',{
                        class:'caption'
                    },[
                    $t('cpxh.main_form.details.formpage1')
                    ])
                }">
                    
<i-col v-show="detailsModel.group1.visible" :style="{}"  :lg="{ span: 24, offset: 0 }">
    <app-form-group layoutType="TABLE_24COL" titleStyle="" class='' uiActionGroup="detailsModel.group1.uiActionGroup" @groupuiactionclick="groupUIActionClick($event)" :caption="$t('cpxh.main_form.details.group1')" :isShowCaption="true" uiStyle="DEFAULT" :titleBarCloseMode="0" :isInfoGroupMode="false">
    
    <row>
        <i-col v-show="detailsModel.cpxhname.visible" :style="{}"  :md="{ span: 8, offset: 0 }" :lg="{ span: 8, offset: 0 }" :xl="{ span: 8, offset: 0 }">
    <app-form-item name='cpxhname' :itemRules="this.rules.cpxhname" class='' :caption="$t('cpxh.main_form.details.cpxhname')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.cpxhname.error" :isEmptyCaption="false" labelPos="LEFT">
    <input-box v-model="data.cpxhname"  @enter="onEnter($event)"   unit=""  :disabled="detailsModel.cpxhname.disabled" type='string'  style=""></input-box>
</app-form-item>

</i-col>
<i-col v-show="detailsModel.abl.visible" :style="{}"  :md="{ span: 8, offset: 0 }" :lg="{ span: 8, offset: 0 }" :xl="{ span: 8, offset: 0 }">
    <app-form-item name='abl' :itemRules="this.rules.abl" class='' :caption="$t('cpxh.main_form.details.abl')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.abl.error" :isEmptyCaption="false" labelPos="LEFT">
     <dropdown-list v-model="data.abl" :itemParam="{}" :disabled="detailsModel.abl.disabled"  tag='CodeList123' codelistType='STATIC' placeholder='请选择...' style=""></dropdown-list>
</app-form-item>

</i-col>
<i-col v-show="detailsModel.cllxms.visible" :style="{}"  :md="{ span: 8, offset: 0 }" :lg="{ span: 8, offset: 0 }" :xl="{ span: 8, offset: 0 }">
    <app-form-item name='cllxms' :itemRules="this.rules.cllxms" class='' :caption="$t('cpxh.main_form.details.cllxms')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.cllxms.error" :isEmptyCaption="false" labelPos="LEFT">
     <dropdown-list v-model="data.cllxms" :itemParam="{}" :disabled="detailsModel.cllxms.disabled"  tag='CodeList121' codelistType='STATIC' placeholder='请选择...' style=""></dropdown-list>
</app-form-item>

</i-col>
<i-col v-show="detailsModel.bm.visible" :style="{}"  :md="{ span: 8, offset: 0 }" :lg="{ span: 8, offset: 0 }" :xl="{ span: 8, offset: 0 }">
    <app-form-item name='bm' :itemRules="this.rules.bm" class='' :caption="$t('cpxh.main_form.details.bm')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.bm.error" :isEmptyCaption="false" labelPos="LEFT">
    <input-box v-model="data.bm"  @enter="onEnter($event)"   unit=""  :disabled="detailsModel.bm.disabled" type='string'  style=""></input-box>
</app-form-item>

</i-col>
<i-col v-show="detailsModel.cx.visible" :style="{}"  :md="{ span: 8, offset: 0 }" :lg="{ span: 8, offset: 0 }" :xl="{ span: 8, offset: 0 }">
    <app-form-item name='cx' :itemRules="this.rules.cx" class='' :caption="$t('cpxh.main_form.details.cx')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.cx.error" :isEmptyCaption="false" labelPos="LEFT">
    <input-box v-model="data.cx"  @enter="onEnter($event)"   unit=""  :disabled="detailsModel.cx.disabled" type='string'  style=""></input-box>
</app-form-item>

</i-col>
<i-col v-show="detailsModel.cxdm.visible" :style="{}"  :md="{ span: 8, offset: 0 }" :lg="{ span: 8, offset: 0 }" :xl="{ span: 8, offset: 0 }">
    <app-form-item name='cxdm' :itemRules="this.rules.cxdm" class='' :caption="$t('cpxh.main_form.details.cxdm')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.cxdm.error" :isEmptyCaption="false" labelPos="LEFT">
    <input-box v-model="data.cxdm"  @enter="onEnter($event)"   unit=""  :disabled="detailsModel.cxdm.disabled" type='string'  style=""></input-box>
</app-form-item>

</i-col>
<i-col v-show="detailsModel.dycpxh.visible" :style="{}"  :md="{ span: 8, offset: 0 }" :lg="{ span: 8, offset: 0 }" :xl="{ span: 8, offset: 0 }">
    <app-form-item name='dycpxh' :itemRules="this.rules.dycpxh" class='' :caption="$t('cpxh.main_form.details.dycpxh')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.dycpxh.error" :isEmptyCaption="false" labelPos="LEFT">
    <input-box v-model="data.dycpxh"  @enter="onEnter($event)"   unit=""  :disabled="detailsModel.dycpxh.disabled" type='string'  style=""></input-box>
</app-form-item>

</i-col>
<i-col v-show="detailsModel.hdzk.visible" :style="{}"  :md="{ span: 8, offset: 0 }" :lg="{ span: 8, offset: 0 }" :xl="{ span: 8, offset: 0 }">
    <app-form-item name='hdzk' :itemRules="this.rules.hdzk" class='' :caption="$t('cpxh.main_form.details.hdzk')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.hdzk.error" :isEmptyCaption="false" labelPos="LEFT">
    <input-box v-model="data.hdzk"  @enter="onEnter($event)"   unit=""  :disabled="detailsModel.hdzk.disabled" type='number'  style=""></input-box>
</app-form-item>

</i-col>
<i-col v-show="detailsModel.zbzl.visible" :style="{}"  :md="{ span: 8, offset: 0 }" :lg="{ span: 8, offset: 0 }" :xl="{ span: 8, offset: 0 }">
    <app-form-item name='zbzl' :itemRules="this.rules.zbzl" class='' :caption="$t('cpxh.main_form.details.zbzl')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.zbzl.error" :isEmptyCaption="false" labelPos="LEFT">
    <input-box v-model="data.zbzl"  @enter="onEnter($event)"   unit=""  :disabled="detailsModel.zbzl.disabled" type='number'  style=""></input-box>
</app-form-item>

</i-col>
<i-col v-show="detailsModel.ssnf.visible" :style="{}"  :md="{ span: 8, offset: 0 }" :lg="{ span: 8, offset: 0 }" :xl="{ span: 8, offset: 0 }">
    <app-form-item name='ssnf' :itemRules="this.rules.ssnf" class='' :caption="$t('cpxh.main_form.details.ssnf')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.ssnf.error" :isEmptyCaption="false" labelPos="LEFT">
    <input-box v-model="data.ssnf"  @enter="onEnter($event)"   unit=""  :disabled="detailsModel.ssnf.disabled" type='string'  style=""></input-box>
</app-form-item>

</i-col>
<i-col v-show="detailsModel.xcgzj.visible" :style="{}"  :md="{ span: 8, offset: 0 }" :lg="{ span: 8, offset: 0 }" :xl="{ span: 8, offset: 0 }">
    <app-form-item name='xcgzj' :itemRules="this.rules.xcgzj" class='' :caption="$t('cpxh.main_form.details.xcgzj')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.xcgzj.error" :isEmptyCaption="false" labelPos="LEFT">
    <input-box v-model="data.xcgzj"  @enter="onEnter($event)"   unit=""  :disabled="detailsModel.xcgzj.disabled" type='number'  style=""></input-box>
</app-form-item>

</i-col>
<i-col v-show="detailsModel.sccs.visible" :style="{}"  :md="{ span: 8, offset: 0 }" :lg="{ span: 8, offset: 0 }" :xl="{ span: 8, offset: 0 }">
    <app-form-item name='sccs' :itemRules="this.rules.sccs" class='' :caption="$t('cpxh.main_form.details.sccs')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.sccs.error" :isEmptyCaption="false" labelPos="LEFT">
    <input-box v-model="data.sccs"  @enter="onEnter($event)"   unit=""  :disabled="detailsModel.sccs.disabled" type='string'  style=""></input-box>
</app-form-item>

</i-col>
<i-col v-show="detailsModel.pp.visible" :style="{}"  :md="{ span: 8, offset: 0 }" :lg="{ span: 8, offset: 0 }" :xl="{ span: 8, offset: 0 }">
    <app-form-item name='pp' :itemRules="this.rules.pp" class='' :caption="$t('cpxh.main_form.details.pp')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.pp.error" :isEmptyCaption="false" labelPos="LEFT">
    <input-box v-model="data.pp"  @enter="onEnter($event)"   unit=""  :disabled="detailsModel.pp.disabled" type='string'  style=""></input-box>
</app-form-item>

</i-col>
<i-col v-show="detailsModel.clsjjz.visible" :style="{}"  :md="{ span: 8, offset: 0 }" :lg="{ span: 8, offset: 0 }" :xl="{ span: 8, offset: 0 }">
    <app-form-item name='clsjjz' :itemRules="this.rules.clsjjz" class='' :caption="$t('cpxh.main_form.details.clsjjz')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.clsjjz.error" :isEmptyCaption="false" labelPos="LEFT">
    <input-box v-model="data.clsjjz"  @enter="onEnter($event)"   unit=""  :disabled="detailsModel.clsjjz.disabled" type='number'  style=""></input-box>
</app-form-item>

</i-col>
<i-col v-show="detailsModel.pl.visible" :style="{}"  :md="{ span: 8, offset: 0 }" :lg="{ span: 8, offset: 0 }" :xl="{ span: 8, offset: 0 }">
    <app-form-item name='pl' :itemRules="this.rules.pl" class='' :caption="$t('cpxh.main_form.details.pl')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.pl.error" :isEmptyCaption="false" labelPos="LEFT">
    <input-box v-model="data.pl"  @enter="onEnter($event)"   unit=""  :disabled="detailsModel.pl.disabled" type='number'  style=""></input-box>
</app-form-item>

</i-col>
<i-col v-show="detailsModel.hpds.visible" :style="{}"  :md="{ span: 8, offset: 0 }" :lg="{ span: 8, offset: 0 }" :xl="{ span: 8, offset: 0 }">
    <app-form-item name='hpds' :itemRules="this.rules.hpds" class='' :caption="$t('cpxh.main_form.details.hpds')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.hpds.error" :isEmptyCaption="false" labelPos="LEFT">
     <dropdown-list v-model="data.hpds" :itemParam="{}" :disabled="detailsModel.hpds.disabled"  tag='CodeList122' codelistType='STATIC' placeholder='请选择...' style=""></dropdown-list>
</app-form-item>

</i-col>
<i-col v-show="detailsModel.hdzzl.visible" :style="{}"  :md="{ span: 8, offset: 0 }" :lg="{ span: 8, offset: 0 }" :xl="{ span: 8, offset: 0 }">
    <app-form-item name='hdzzl' :itemRules="this.rules.hdzzl" class='' :caption="$t('cpxh.main_form.details.hdzzl')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.hdzzl.error" :isEmptyCaption="false" labelPos="LEFT">
    <input-box v-model="data.hdzzl"  @enter="onEnter($event)"   unit=""  :disabled="detailsModel.hdzzl.disabled" type='number'  style=""></input-box>
</app-form-item>

</i-col>
<i-col v-show="detailsModel.gl.visible" :style="{}"  :md="{ span: 8, offset: 0 }" :lg="{ span: 8, offset: 0 }" :xl="{ span: 8, offset: 0 }">
    <app-form-item name='gl' :itemRules="this.rules.gl" class='' :caption="$t('cpxh.main_form.details.gl')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.gl.error" :isEmptyCaption="false" labelPos="LEFT">
    <input-box v-model="data.gl"  @enter="onEnter($event)"   unit=""  :disabled="detailsModel.gl.disabled" type='number'  style=""></input-box>
</app-form-item>

</i-col>
<i-col v-show="detailsModel.bz.visible" :style="{}"  :md="{ span: 24, offset: 0 }" :lg="{ span: 24, offset: 0 }" :xl="{ span: 24, offset: 0 }">
    <app-form-item name='bz' :itemRules="this.rules.bz" class='' :caption="$t('cpxh.main_form.details.bz')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.bz.error" :isEmptyCaption="false" labelPos="LEFT">
    <input-box v-model="data.bz"  @enter="onEnter($event)"   unit=""  :disabled="detailsModel.bz.disabled" type='string'  style=""></input-box>
</app-form-item>

</i-col>
    
    </row>
</app-form-group>

</i-col>


            </tab-pane> 
            <tab-pane v-show="detailsModel.formpage2.visible" name='formpage2' :index="1" tab='form' class=''  
                :label="(h) =>{
                    return h('span',{
                        class:'caption'
                    },[
                    $t('cpxh.main_form.details.formpage2')
                    ])
                }">
                    
<i-col v-show="detailsModel.group2.visible" :style="{}"  :lg="{ span: 24, offset: 0 }">
    <app-form-group layoutType="TABLE_24COL" titleStyle="" class='' uiActionGroup="detailsModel.group2.uiActionGroup" @groupuiactionclick="groupUIActionClick($event)" :caption="$t('cpxh.main_form.details.group2')" :isShowCaption="true" uiStyle="DEFAULT" :titleBarCloseMode="0" :isInfoGroupMode="false">
    
    <row>
        <i-col v-show="detailsModel.createman.visible" :style="{}"  :lg="{ span: 24, offset: 0 }">
    <app-form-item name='createman' :itemRules="this.rules.createman" class='' :caption="$t('cpxh.main_form.details.createman')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.createman.error" :isEmptyCaption="false" labelPos="LEFT">
    <app-span style="" :data="data.createman" tag='SysOperator' codelistType='DYNAMIC'></app-span>
</app-form-item>

</i-col>
<i-col v-show="detailsModel.createdate.visible" :style="{}"  :lg="{ span: 24, offset: 0 }">
    <app-form-item name='createdate' :itemRules="this.rules.createdate" class='' :caption="$t('cpxh.main_form.details.createdate')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.createdate.error" :isEmptyCaption="false" labelPos="LEFT">
    <app-span style="" :data="data.createdate" ></app-span>
</app-form-item>

</i-col>
<i-col v-show="detailsModel.updateman.visible" :style="{}"  :lg="{ span: 24, offset: 0 }">
    <app-form-item name='updateman' :itemRules="this.rules.updateman" class='' :caption="$t('cpxh.main_form.details.updateman')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.updateman.error" :isEmptyCaption="false" labelPos="LEFT">
    <app-span style="" :data="data.updateman" tag='SysOperator' codelistType='DYNAMIC'></app-span>
</app-form-item>

</i-col>
<i-col v-show="detailsModel.updatedate.visible" :style="{}"  :lg="{ span: 24, offset: 0 }">
    <app-form-item name='updatedate' :itemRules="this.rules.updatedate" class='' :caption="$t('cpxh.main_form.details.updatedate')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.updatedate.error" :isEmptyCaption="false" labelPos="LEFT">
    <app-span style="" :data="data.updatedate" ></app-span>
</app-form-item>

</i-col>
    
    </row>
</app-form-group>

</i-col>


            </tab-pane> 
    </tabs>
    </row>
</i-form>
</template>

<script lang='ts'>
import { Vue, Component, Prop, Provide, Emit, Watch, Model } from 'vue-property-decorator';
import { CreateElement } from 'vue';
import { Subject, Subscription } from 'rxjs';
import { ControlInterface } from '@/interface/control';
import { UICounter,UIActionTool } from '@/utils';
import CPXHService from '@/service/cpxh/cpxh-service';
import MainService from './main-form-service';

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 MainBase extends Vue implements ControlInterface {

    /**
     * 名称
     *
     * @type {string}
     * @memberof Main
     */
    @Prop() protected name?: string;

    /**
     * 视图通讯对象
     *
     * @type {Subject<ViewState>}
     * @memberof Main
     */
    @Prop() protected viewState!: Subject<ViewState>;

    /**
     * 应用上下文
     *
     * @type {*}
     * @memberof Main
     */
    @Prop() protected context: any;

    /**
     * 视图参数
     *
     * @type {*}
     * @memberof Main
     */
    @Prop() protected viewparams: any;

    /**
     * 视图状态事件
     *
     * @protected
     * @type {(Subscription | undefined)}
     * @memberof Main
     */
    protected viewStateEvent: Subscription | undefined;

    /**
     * 获取部件类型
     *
     * @returns {string}
     * @memberof Main
     */
    protected getControlType(): string {
        return 'FORM'
    }

    /**
     * 建构部件服务对象
     *
     * @type {MainService}
     * @memberof Main
     */
    protected service: MainService = new MainService({ $store: this.$store });

    /**
     * 实体服务对象
     *
     * @type {CPXHService}
     * @memberof Main
     */
    protected appEntityService: CPXHService = new CPXHService({ $store: this.$store });
    


    /**
     * 关闭视图
     *
     * @param {any[]} args
     * @memberof Main
     */
    protected closeView(args: any[]): void {
        let _this: any = this;
        _this.$emit('closeview', args);
    }


    
    /**
     * 获取多项数据
     *
     * @returns {any[]}
     * @memberof Main
     */
    public getDatas(): any[] {
        return [this.data];
    }

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

    /**
     * 是否默认保存
     *
     * @type {boolean}
     * @memberof Main
     */
    @Prop({ default: false }) protected autosave?: boolean;

    /**
     * 显示处理提示
     *
     * @type {boolean}
     * @memberof Main
     */
    @Prop({ default: true }) protected showBusyIndicator?: boolean;

    /**
     * 部件行为--submit
     *
     * @type {string}
     * @memberof Main
     */
    @Prop() protected WFSubmitAction!: string;
    
    /**
     * 部件行为--start
     *
     * @type {string}
     * @memberof Main
     */
    @Prop() protected WFStartAction!: string;
    
    /**
     * 部件行为--update
     *
     * @type {string}
     * @memberof Main
     */
    @Prop() protected updateAction!: string;
    
    /**
     * 部件行为--remove
     *
     * @type {string}
     * @memberof Main
     */
    @Prop() protected removeAction!: string;
    
    /**
     * 部件行为--loaddraft
     *
     * @type {string}
     * @memberof Main
     */
    @Prop() protected loaddraftAction!: string;
    
    /**
     * 部件行为--load
     *
     * @type {string}
     * @memberof Main
     */
    @Prop() protected loadAction!: string;
    
    /**
     * 部件行为--create
     *
     * @type {string}
     * @memberof Main
     */
    @Prop() protected createAction!: string;

    /**
     * 部件行为--create
     *
     * @type {string}
     * @memberof Main
     */
    @Prop() protected searchAction!: string;

    /**
     * 视图标识
     *
     * @type {string}
     * @memberof Main
     */
    @Prop() protected viewtag!: string;

    /**
     * 表单状态
     *
     * @type {Subject<any>}
     * @memberof Main
     */
    protected formState: Subject<any> = new Subject();

    /**
     * 忽略表单项值变化
     *
     * @type {boolean}
     * @memberof Main
     */
    protected ignorefieldvaluechange: boolean = false;

    /**
     * 数据变化
     *
     * @private
     * @type {Subject<any>}
     * @memberof Main
     */
    private dataChang: Subject<any> = new Subject();

    /**
     * 视图状态事件
     *
     * @private
     * @type {(Subscription | undefined)}
     * @memberof Main
     */
    private dataChangEvent: Subscription | undefined;

    /**
     * 原始数据
     *
     * @private
     * @type {*}
     * @memberof Main
     */
    private oldData: any = {};

    /**
     * 表单数据对象
     *
     * @type {*}
     * @memberof Main
     */
    protected data: any = {
        srfupdatedate: null,
        srforikey: null,
        srfkey: null,
        srfmajortext: null,
        srftempmode: null,
        srfuf: null,
        srfdeid: null,
        srfsourcekey: null,
        cpxhname: null,
        abl: null,
        cllxms: null,
        bm: null,
        cx: null,
        cxdm: null,
        dycpxh: null,
        hdzk: null,
        zbzl: null,
        ssnf: null,
        xcgzj: null,
        sccs: null,
        pp: null,
        clsjjz: null,
        pl: null,
        hpds: null,
        hdzzl: null,
        gl: null,
        bz: null,
        createman: null,
        createdate: null,
        updateman: null,
        updatedate: null,
        cpxhid: null,
        cpxh:null,
    };

    /**
      * 当前执行的行为逻辑
      *
      * @type {string}
      * @memberof Main
      */
    protected currentAction: string = "";

    /**
      * 关系界面计数器
      *
      * @type {number}
      * @memberof Main
      */
    protected drcounter: number = 0;

    /**
      * 表单保存回调存储对象
      *
      * @type {any}
      * @memberof Main
      */
    protected saveState:any ;

    /**
     * 属性值规则
     *
     * @type {*}
     * @memberof Main
     */
    protected rules: any = {
        srfupdatedate: [
            { type: 'string', message: '更新时间 值必须为字符串类型', trigger: 'change' },
            { type: 'string', message: '更新时间 值必须为字符串类型', trigger: 'blur' },
            { required: false, type: 'string', message: '更新时间 值不能为空', trigger: 'change' },
            { required: false, type: 'string', message: '更新时间 值不能为空', trigger: 'blur' },
        ],
        srforikey: [
            { type: 'string', message: ' 值必须为字符串类型', trigger: 'change' },
            { type: 'string', message: ' 值必须为字符串类型', trigger: 'blur' },
            { required: false, type: 'string', message: ' 值不能为空', trigger: 'change' },
            { required: false, type: 'string', message: ' 值不能为空', trigger: 'blur' },
        ],
        srfkey: [
            { type: 'string', message: '厂牌型号标识 值必须为字符串类型', trigger: 'change' },
            { type: 'string', message: '厂牌型号标识 值必须为字符串类型', trigger: 'blur' },
            { required: false, type: 'string', message: '厂牌型号标识 值不能为空', trigger: 'change' },
            { required: false, type: 'string', message: '厂牌型号标识 值不能为空', trigger: 'blur' },
        ],
        srfmajortext: [
            { type: 'string', message: '厂牌型号名称 值必须为字符串类型', trigger: 'change' },
            { type: 'string', message: '厂牌型号名称 值必须为字符串类型', trigger: 'blur' },
            { required: false, type: 'string', message: '厂牌型号名称 值不能为空', trigger: 'change' },
            { required: false, type: 'string', message: '厂牌型号名称 值不能为空', trigger: 'blur' },
        ],
        srftempmode: [
            { type: 'string', message: ' 值必须为字符串类型', trigger: 'change' },
            { type: 'string', message: ' 值必须为字符串类型', trigger: 'blur' },
            { required: false, type: 'string', message: ' 值不能为空', trigger: 'change' },
            { required: false, type: 'string', message: ' 值不能为空', trigger: 'blur' },
        ],
        srfuf: [
            { type: 'string', message: ' 值必须为字符串类型', trigger: 'change' },
            { type: 'string', message: ' 值必须为字符串类型', trigger: 'blur' },
            { required: false, type: 'string', message: ' 值不能为空', trigger: 'change' },
            { required: false, type: 'string', message: ' 值不能为空', trigger: 'blur' },
        ],
        srfdeid: [
            { type: 'string', message: ' 值必须为字符串类型', trigger: 'change' },
            { type: 'string', message: ' 值必须为字符串类型', trigger: 'blur' },
            { required: false, type: 'string', message: ' 值不能为空', trigger: 'change' },
            { required: false, type: 'string', message: ' 值不能为空', trigger: 'blur' },
        ],
        srfsourcekey: [
            { type: 'string', message: ' 值必须为字符串类型', trigger: 'change' },
            { type: 'string', message: ' 值必须为字符串类型', trigger: 'blur' },
            { required: false, type: 'string', message: ' 值不能为空', trigger: 'change' },
            { required: false, type: 'string', message: ' 值不能为空', trigger: 'blur' },
        ],
        cpxhname: [
            { type: 'string', message: '厂牌型号名称 值必须为字符串类型', trigger: 'change' },
            { type: 'string', message: '厂牌型号名称 值必须为字符串类型', trigger: 'blur' },
            { required: false, type: 'string', message: '厂牌型号名称 值不能为空', trigger: 'change' },
            { required: false, type: 'string', message: '厂牌型号名称 值不能为空', trigger: 'blur' },
        ],
        abl: [
            { type: 'string', message: 'A/B类 值必须为字符串类型', trigger: 'change' },
            { type: 'string', message: 'A/B类 值必须为字符串类型', trigger: 'blur' },
            { required: false, type: 'string', message: 'A/B类 值不能为空', trigger: 'change' },
            { required: false, type: 'string', message: 'A/B类 值不能为空', trigger: 'blur' },
        ],
        cllxms: [
            { type: 'string', message: '车辆类型描述 值必须为字符串类型', trigger: 'change' },
            { type: 'string', message: '车辆类型描述 值必须为字符串类型', trigger: 'blur' },
            { required: false, type: 'string', message: '车辆类型描述 值不能为空', trigger: 'change' },
            { required: false, type: 'string', message: '车辆类型描述 值不能为空', trigger: 'blur' },
        ],
        bm: [
            { type: 'string', message: '别名 值必须为字符串类型', trigger: 'change' },
            { type: 'string', message: '别名 值必须为字符串类型', trigger: 'blur' },
            { required: false, type: 'string', message: '别名 值不能为空', trigger: 'change' },
            { required: false, type: 'string', message: '别名 值不能为空', trigger: 'blur' },
        ],
        cx: [
            { type: 'string', message: '车系 值必须为字符串类型', trigger: 'change' },
            { type: 'string', message: '车系 值必须为字符串类型', trigger: 'blur' },
            { required: false, type: 'string', message: '车系 值不能为空', trigger: 'change' },
            { required: false, type: 'string', message: '车系 值不能为空', trigger: 'blur' },
        ],
        cxdm: [
            { type: 'string', message: '车型代码 值必须为字符串类型', trigger: 'change' },
            { type: 'string', message: '车型代码 值必须为字符串类型', trigger: 'blur' },
            { required: false, type: 'string', message: '车型代码 值不能为空', trigger: 'change' },
            { required: false, type: 'string', message: '车型代码 值不能为空', trigger: 'blur' },
        ],
        dycpxh: [
            { type: 'string', message: '打印厂牌型号 值必须为字符串类型', trigger: 'change' },
            { type: 'string', message: '打印厂牌型号 值必须为字符串类型', trigger: 'blur' },
            { required: false, type: 'string', message: '打印厂牌型号 值不能为空', trigger: 'change' },
            { required: false, type: 'string', message: '打印厂牌型号 值不能为空', trigger: 'blur' },
        ],
        hdzk: [
            { type: 'number', message: '核定载客 值必须为数值类型', trigger: 'change' },
            { type: 'number', message: '核定载客 值必须为数值类型', trigger: 'blur' },
            { required: false, type: 'number', message: '核定载客 值不能为空', trigger: 'change' },
            { required: false, type: 'number', message: '核定载客 值不能为空', trigger: 'blur' },
        ],
        zbzl: [
            { type: 'number', message: '整备质量 值必须为数值类型', trigger: 'change' },
            { type: 'number', message: '整备质量 值必须为数值类型', trigger: 'blur' },
            { required: false, type: 'number', message: '整备质量 值不能为空', trigger: 'change' },
            { required: false, type: 'number', message: '整备质量 值不能为空', trigger: 'blur' },
        ],
        ssnf: [
            { type: 'string', message: '上市年份 值必须为字符串类型', trigger: 'change' },
            { type: 'string', message: '上市年份 值必须为字符串类型', trigger: 'blur' },
            { required: false, type: 'string', message: '上市年份 值不能为空', trigger: 'change' },
            { required: false, type: 'string', message: '上市年份 值不能为空', trigger: 'blur' },
        ],
        xcgzj: [
            { type: 'number', message: '新车购置价 值必须为数值类型', trigger: 'change' },
            { type: 'number', message: '新车购置价 值必须为数值类型', trigger: 'blur' },
            { required: false, type: 'number', message: '新车购置价 值不能为空', trigger: 'change' },
            { required: false, type: 'number', message: '新车购置价 值不能为空', trigger: 'blur' },
        ],
        sccs: [
            { type: 'string', message: '生产厂商 值必须为字符串类型', trigger: 'change' },
            { type: 'string', message: '生产厂商 值必须为字符串类型', trigger: 'blur' },
            { required: false, type: 'string', message: '生产厂商 值不能为空', trigger: 'change' },
            { required: false, type: 'string', message: '生产厂商 值不能为空', trigger: 'blur' },
        ],
        pp: [
            { type: 'string', message: '品牌 值必须为字符串类型', trigger: 'change' },
            { type: 'string', message: '品牌 值必须为字符串类型', trigger: 'blur' },
            { required: false, type: 'string', message: '品牌 值不能为空', trigger: 'change' },
            { required: false, type: 'string', message: '品牌 值不能为空', trigger: 'blur' },
        ],
        clsjjz: [
            { type: 'number', message: '车辆实际价值 值必须为数值类型', trigger: 'change' },
            { type: 'number', message: '车辆实际价值 值必须为数值类型', trigger: 'blur' },
            { required: false, type: 'number', message: '车辆实际价值 值不能为空', trigger: 'change' },
            { required: false, type: 'number', message: '车辆实际价值 值不能为空', trigger: 'blur' },
        ],
        pl: [
            { type: 'number', message: '排量 值必须为数值类型', trigger: 'change' },
            { type: 'number', message: '排量 值必须为数值类型', trigger: 'blur' },
            { required: false, type: 'number', message: '排量 值不能为空', trigger: 'change' },
            { required: false, type: 'number', message: '排量 值不能为空', trigger: 'blur' },
        ],
        hpds: [
            { type: 'string', message: '号牌底色 值必须为字符串类型', trigger: 'change' },
            { type: 'string', message: '号牌底色 值必须为字符串类型', trigger: 'blur' },
            { required: false, type: 'string', message: '号牌底色 值不能为空', trigger: 'change' },
            { required: false, type: 'string', message: '号牌底色 值不能为空', trigger: 'blur' },
        ],
        hdzzl: [
            { type: 'number', message: '核定载质量 值必须为数值类型', trigger: 'change' },
            { type: 'number', message: '核定载质量 值必须为数值类型', trigger: 'blur' },
            { required: false, type: 'number', message: '核定载质量 值不能为空', trigger: 'change' },
            { required: false, type: 'number', message: '核定载质量 值不能为空', trigger: 'blur' },
        ],
        gl: [
            { type: 'number', message: '功率 值必须为数值类型', trigger: 'change' },
            { type: 'number', message: '功率 值必须为数值类型', trigger: 'blur' },
            { required: false, type: 'number', message: '功率 值不能为空', trigger: 'change' },
            { required: false, type: 'number', message: '功率 值不能为空', trigger: 'blur' },
        ],
        bz: [
            { type: 'string', message: '备注 值必须为字符串类型', trigger: 'change' },
            { type: 'string', message: '备注 值必须为字符串类型', trigger: 'blur' },
            { required: false, type: 'string', message: '备注 值不能为空', trigger: 'change' },
            { required: false, type: 'string', message: '备注 值不能为空', trigger: 'blur' },
        ],
        createman: [
            { type: 'string', message: '建立人 值必须为字符串类型', trigger: 'change' },
            { type: 'string', message: '建立人 值必须为字符串类型', trigger: 'blur' },
            { required: false, type: 'string', message: '建立人 值不能为空', trigger: 'change' },
            { required: false, type: 'string', message: '建立人 值不能为空', trigger: 'blur' },
        ],
        createdate: [
            { type: 'string', message: '建立时间 值必须为字符串类型', trigger: 'change' },
            { type: 'string', message: '建立时间 值必须为字符串类型', trigger: 'blur' },
            { required: false, type: 'string', message: '建立时间 值不能为空', trigger: 'change' },
            { required: false, type: 'string', message: '建立时间 值不能为空', trigger: 'blur' },
        ],
        updateman: [
            { type: 'string', message: '更新人 值必须为字符串类型', trigger: 'change' },
            { type: 'string', message: '更新人 值必须为字符串类型', trigger: 'blur' },
            { required: false, type: 'string', message: '更新人 值不能为空', trigger: 'change' },
            { required: false, type: 'string', message: '更新人 值不能为空', trigger: 'blur' },
        ],
        updatedate: [
            { type: 'string', message: '更新时间 值必须为字符串类型', trigger: 'change' },
            { type: 'string', message: '更新时间 值必须为字符串类型', trigger: 'blur' },
            { required: false, type: 'string', message: '更新时间 值不能为空', trigger: 'change' },
            { required: false, type: 'string', message: '更新时间 值不能为空', trigger: 'blur' },
        ],
        cpxhid: [
            { type: 'string', message: '厂牌型号标识 值必须为字符串类型', trigger: 'change' },
            { type: 'string', message: '厂牌型号标识 值必须为字符串类型', trigger: 'blur' },
            { required: false, type: 'string', message: '厂牌型号标识 值不能为空', trigger: 'change' },
            { required: false, type: 'string', message: '厂牌型号标识 值不能为空', trigger: 'blur' },
        ],
    }

    /**
     * 详情模型集合
     *
     * @type {*}
     * @memberof Main
     */
    protected detailsModel: any = {
        group1: new FormGroupPanelModel({ caption: '车牌型号基本信息', detailType: 'GROUPPANEL', name: 'group1', visible: true, isShowCaption: true, form: this, uiActionGroup: { caption: '', langbase: 'cpxh.main_form', extractMode: 'ITEM', details: [] } })
, 
        formpage1: new FormPageModel({ caption: '基本信息', detailType: 'FORMPAGE', name: 'formpage1', visible: true, isShowCaption: true, form: this })
, 
        group2: new FormGroupPanelModel({ caption: '操作信息', detailType: 'GROUPPANEL', name: 'group2', visible: true, isShowCaption: true, form: this, uiActionGroup: { caption: '', langbase: 'cpxh.main_form', extractMode: 'ITEM', details: [] } })
, 
        formpage2: new FormPageModel({ caption: '其它', detailType: 'FORMPAGE', name: 'formpage2', visible: true, isShowCaption: true, form: this })
, 
        srfupdatedate: new FormItemModel({ caption: '更新时间', detailType: 'FORMITEM', name: 'srfupdatedate', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        srforikey: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srforikey', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        srfkey: new FormItemModel({ caption: '厂牌型号标识', detailType: 'FORMITEM', name: 'srfkey', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        srfmajortext: new FormItemModel({ caption: '厂牌型号名称', detailType: 'FORMITEM', name: 'srfmajortext', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        srftempmode: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srftempmode', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        srfuf: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srfuf', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        srfdeid: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srfdeid', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        srfsourcekey: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srfsourcekey', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        cpxhname: new FormItemModel({ caption: '厂牌型号名称', detailType: 'FORMITEM', name: 'cpxhname', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        abl: new FormItemModel({ caption: 'A/B类', detailType: 'FORMITEM', name: 'abl', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        cllxms: new FormItemModel({ caption: '车辆类型描述', detailType: 'FORMITEM', name: 'cllxms', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        bm: new FormItemModel({ caption: '别名', detailType: 'FORMITEM', name: 'bm', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        cx: new FormItemModel({ caption: '车系', detailType: 'FORMITEM', name: 'cx', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        cxdm: new FormItemModel({ caption: '车型代码', detailType: 'FORMITEM', name: 'cxdm', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        dycpxh: new FormItemModel({ caption: '打印厂牌型号', detailType: 'FORMITEM', name: 'dycpxh', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        hdzk: new FormItemModel({ caption: '核定载客', detailType: 'FORMITEM', name: 'hdzk', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        zbzl: new FormItemModel({ caption: '整备质量', detailType: 'FORMITEM', name: 'zbzl', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        ssnf: new FormItemModel({ caption: '上市年份', detailType: 'FORMITEM', name: 'ssnf', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        xcgzj: new FormItemModel({ caption: '新车购置价', detailType: 'FORMITEM', name: 'xcgzj', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        sccs: new FormItemModel({ caption: '生产厂商', detailType: 'FORMITEM', name: 'sccs', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        pp: new FormItemModel({ caption: '品牌', detailType: 'FORMITEM', name: 'pp', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        clsjjz: new FormItemModel({ caption: '车辆实际价值', detailType: 'FORMITEM', name: 'clsjjz', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        pl: new FormItemModel({ caption: '排量', detailType: 'FORMITEM', name: 'pl', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        hpds: new FormItemModel({ caption: '号牌底色', detailType: 'FORMITEM', name: 'hpds', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        hdzzl: new FormItemModel({ caption: '核定载质量', detailType: 'FORMITEM', name: 'hdzzl', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        gl: new FormItemModel({ caption: '功率', detailType: 'FORMITEM', name: 'gl', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        bz: new FormItemModel({ caption: '备注', detailType: 'FORMITEM', name: 'bz', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        createman: new FormItemModel({ caption: '建立人', detailType: 'FORMITEM', name: 'createman', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        createdate: new FormItemModel({ caption: '建立时间', detailType: 'FORMITEM', name: 'createdate', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        updateman: new FormItemModel({ caption: '更新人', detailType: 'FORMITEM', name: 'updateman', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        updatedate: new FormItemModel({ caption: '更新时间', detailType: 'FORMITEM', name: 'updatedate', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        cpxhid: new FormItemModel({ caption: '厂牌型号标识', detailType: 'FORMITEM', name: 'cpxhid', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        form: new FormTabPanelModel({ caption: 'form', detailType: 'TABPANEL', name: 'form', visible: true, isShowCaption: true, form: this, tabPages: [{ name: 'formpage1', index: 0, visible: true }, { name: 'formpage2', index: 1, visible: true }] }),
    };

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


    /**
     * 重置表单项值
     *
     * @private
     * @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal }
     * @memberof Main
     */
    private resetFormData({ name, newVal, oldVal }: { name: string, newVal: any, oldVal: any }): void {
    }

    /**
      * 置空对象
      *
      * @param {any[]} args
      * @memberof EditForm
      */
    protected ResetData(_datas:any){
        if(Object.keys(_datas).length >0){
            Object.keys(_datas).forEach((name: string) => {
                if (this.data.hasOwnProperty(name)) {
                    this.data[name] = null;
                }
            });
        }
    }

    /**
     * 表单逻辑
     *
     * @private
     * @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal }
     * @memberof Main
     */
    private formLogic({ name, newVal, oldVal }: { name: string, newVal: any, oldVal: any }): void {
                




































    }

    /**
     * 表单值变化
     *
     * @private
     * @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal }
     * @returns {void}
     * @memberof Main
     */
    private formDataChange({ name, newVal, oldVal }: { name: string, newVal: any, oldVal: any }): void {
        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));
    }

    /**
     * 表单加载完成
     *
     * @private
     * @param {*} [data={}]
     * @memberof Main
     */
    private onFormLoad(data: any = {}): void {
        this.setFormEnableCond(data);
        this.fillForm(data);
        this.oldData = {};
        Object.assign(this.oldData, JSON.parse(JSON.stringify(this.data)));
        this.$store.commit('viewaction/setViewDataChange', { viewtag: this.viewtag, viewdatachange: false });
        this.formLogic({ name: '', newVal: null, oldVal: null });
    }

    /**
     * 值填充
     *
     * @param {*} [_datas={}]
     * @memberof Main
     */
    protected fillForm(_datas: any = {}): void {
        this.ignorefieldvaluechange = true;
        Object.keys(_datas).forEach((name: string) => {
            if (this.data.hasOwnProperty(name)) {
                this.data[name] = _datas[name];
            }
        });
        this.$nextTick(function () {
            this.ignorefieldvaluechange = false;
        })
    }

    /**
     * 设置表单项是否启用
     *
     * @protected
     * @param {*} data
     * @memberof Main
     */
    protected setFormEnableCond(data: any): void {
        Object.values(this.detailsModel).forEach((detail: any) => {
            if (!Object.is(detail.detailType, 'FORMITEM')) {
                return;
            }
            const formItem: FormItemModel = detail;
            formItem.setEnableCond(data.srfuf);
        });
    }

    /**
     * 重置草稿表单状态
     *
     * @private
     * @memberof Main
     */
    private resetDraftFormStates(): void {
        const form: any = this.$refs.form;
        if (form) {
            form.resetFields();
        }
    }

    /**
     * 重置校验结果
     *
     * @memberof Main
     */
    protected resetValidates(): void {
        Object.values(this.detailsModel).forEach((detail: any) => {
            if (!Object.is(detail.detailType, 'FORMITEM')) {
                return;
            }
            const formItem: FormItemModel = detail;
            formItem.setError('');
        });
    }

    /**
     * 填充校验结果 （后台）
     *
     * @param {any[]} fieldErrors
     * @memberof Main
     */
    protected fillValidates(fieldErrors: any[]): void {
        fieldErrors.forEach((error: any) => {
            const formItem: FormItemModel = this.detailsModel[error.field];
            if (!formItem) {
                return;
            }
            this.$nextTick(() => {
                formItem.setError(error.message);
            });
        });
    }

    /**
     * 表单校验状态
     *
     * @returns {boolean} 
     * @memberof Main
     */
    protected formValidateStatus(): boolean {
        const form: any = this.$refs.form;
        let validatestate: boolean = true;
        form.validate((valid: boolean) => {
            validatestate = valid ? true : false;
        });
        return validatestate
    }

    /**
     * 获取全部值
     *
     * @returns {*}
     * @memberof Main
     */
    protected getValues(): any {
        return this.data;
    }

    /**
     * 表单项值变更
     *
     * @param {{ name: string, value: any }} $event
     * @returns {void}
     * @memberof Main
     */
    protected onFormItemValueChange($event: { name: string, value: any }): void {
        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 Main
     */
    protected setDataItemValue(name: string, value: any): void {
        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 Main
     */
    protected groupUIActionClick($event: any): void {
        if (!$event) {
            return;
        }
        const item:any = $event.item;
    }

    /**
     * Vue声明周期(处理组件的输入属性)
     *
     * @memberof Main
     */
    protected created(): void {
        this.afterCreated();
    }

    /**
     * 执行created后的逻辑
     *
     *  @memberof Main
     */    
    protected afterCreated(){
        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);
                }
                if (Object.is('save', action)) {
                    this.save(data,data.showResultInfo);
                }
                if (Object.is('remove', action)) {
                    this.remove(data);
                }
                if (Object.is('saveandexit', action)) {
                    this.saveAndExit(data);
                }
                if (Object.is('saveandnew', action)) {
                    this.saveAndNew(data);
                }
                if (Object.is('removeandexit', action)) {
                    this.removeAndExit(data);
                }
                if (Object.is('refresh', action)) {
                    this.refresh(data);
                }
            });
        }
        this.dataChang
            .pipe(
                debounceTime(300),
                distinctUntilChanged()
            ).subscribe((data: any) => {
                if (this.autosave) {
                    this.autoSave();
                }
                const state = !Object.is(JSON.stringify(this.oldData), JSON.stringify(this.data)) ? true : false;
                this.$store.commit('viewaction/setViewDataChange', { viewtag: this.viewtag, viewdatachange: state });
            });
    }

    /**
     * vue 生命周期
     *
     * @memberof Main
     */
    protected destroyed() {
        this.afterDestroy();
    }

    /**
     * 执行destroyed后的逻辑
     *
     * @memberof Main
     */
    protected afterDestroy() {
        if (this.viewStateEvent) {
            this.viewStateEvent.unsubscribe();
        }
        if (this.dataChangEvent) {
            this.dataChangEvent.unsubscribe();
        }
    }

    /**
     * 拷贝内容
     *
     * @param {*} [arg={}]
     * @memberof @memberof Main
     */
    protected copy(arg: any = {}): void {
        this.loadDraft(arg);
    }

    /**
     * 部件刷新
     *
     * @param {any[]} args
     * @memberof Main
     */
    protected refresh(args: any[]): void {
        let arg: any = {};
        Object.assign(arg,args[0]);
        if (this.data.srfkey && !Object.is(this.data.srfkey, '')) {
            Object.assign(arg, { srfkey: this.data.srfkey });
            this.load(arg);
            return;
        }
        if (this.data.srfkeys && !Object.is(this.data.srfkeys, '')) {
            Object.assign(arg, { srfkey: this.data.srfkeys });
            this.load(arg);
            return;
        }
    }

    /**
     * 自动加载
     *
     * @param {*} [arg={}]
     * @returns {void}
     * @memberof Main
     */
    protected autoLoad(arg: any = {}): void {
        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);
    }

    /**
     * 加载
     *
     * @private
     * @param {*} [opt={}]
     * @memberof Main
     */
    private load(opt: any = {}): void {
        if(!this.loadAction){
            this.$Notice.error({ title: '错误', desc: 'CPXHEditView视图表单loadAction参数未配置' });
            return;
        }
        const arg: any = { ...opt };
        const get: Promise<any> = this.service.get(this.loadAction,this.context,arg, this.showBusyIndicator);
        get.then((response: any) => {
            if (response && response.status === 200) {
                const data = response.data;
                this.onFormLoad(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) {
                this.$Notice.error({ title: '错误', desc: '系统异常' });
                return;
            }

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

    /**
     * 加载草稿
     *
     * @param {*} [opt={}]
     * @memberof Main
     */
    protected loadDraft(opt: any = {}): void {
        if(!this.loaddraftAction){
            this.$Notice.error({ title: '错误', desc: 'CPXHEditView视图表单loaddraftAction参数未配置' });
            return;
        }
        const arg: any = { ...opt } ;
        let post: Promise<any> = this.service.loadDraft(this.loaddraftAction,this.context,arg, this.showBusyIndicator);
        post.then((response: any) => {
            if (!response.status || response.status !== 200) {
                if (response.errorMessage) {
                    this.$Notice.error({ title: '错误', desc: response.errorMessage });
                }
                return;
            }

            const data = response.data;
            if(data.cpxh){
                Object.assign(this.context,{cpxh:data.cpxh})
            }
            this.resetDraftFormStates();
            this.onFormLoad(data);
            this.$emit('load', data);
            this.$nextTick(() => {
                this.formState.next({ type: 'load', data: data });
            });
            setTimeout(() => {
                const form: any = this.$refs.form;
                if (form) {
                    form.fields.forEach((field: any) => {
                        field.validateMessage = "";
                        field.validateState = "";
                        field.validateStatus = false;
                    });
                }
            });
        }).catch((response: any) => {
            if (response && response.status === 401) {
                return;
            }
            if (!response || !response.status || !response.data) {
                this.$Notice.error({ title: '错误', desc: '系统异常' });
                return;
            }

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

    /**
     * 自动保存
     *
     * @param {*} [opt={}]
     * @memberof Main
     */
    protected autoSave(opt: any = {}): void {
        if (!this.formValidateStatus()) {
            return;
        }
        const arg: any = { ...opt };
        const data = this.getValues();
        Object.assign(arg, data);
        const action: any = Object.is(data.srfuf, '1') ? this.updateAction : this.createAction;
        if(!action){
            let actionName:any = Object.is(data.srfuf, '1')?"updateAction":"createAction";
            this.$Notice.error({ title: '错误', desc: 'CPXHEditView视图表单'+actionName+'参数未配置' });
            return;
        }
        Object.assign(arg,this.viewparams);
        const post: Promise<any> = this.service.add(action, this.context,arg, this.showBusyIndicator);
        post.then((response: any) => {
            if (!response.status || response.status !== 200) {
                if (response.errorMessage) {
                    this.$Notice.error({ title: '错误', desc: response.errorMessage });
                }
                return;
            }

            const data = response.data;
            this.onFormLoad(data);
            this.$emit('save', data);
            this.$store.dispatch('viewaction/datasaved', { viewtag: this.viewtag });
            this.$nextTick(() => {
                this.formState.next({ type: 'save', data: data });
            });
        }).catch((response: any) => {
            if (response && response.status === 401) {
                return;
            }
            if (!response || !response.status || !response.data) {
                this.$Notice.error({ title: '错误', desc: '系统异常' });
                return;
            }

            const { data: _data } = response;
            if (Object.is(_data.status, 'BAD_REQUEST') && _data.parameters && _data.parameters.fieldErrors) {
                this.resetValidates();
                this.fillValidates(_data.parameters.fieldErrors)
            }
            this.$Notice.error({ title: _data.title, desc: _data.message });
        });
    }

    /**
     * 保存
     *
     * @param {*} [opt={}]
     * @param {boolean} [showResultInfo] 
     * @param {boolean} [ifStateNext] formState是否下发通知
     * @returns {Promise<any>}
     * @memberof Main
     */
    protected async save(opt: any = {}, showResultInfo?: boolean, ifStateNext: boolean = true): Promise<any> {
        return new Promise((resolve: any, reject: any) => {
            showResultInfo = showResultInfo === undefined ? true : false;
            opt.saveEmit = opt.saveEmit === undefined ? true :false;
            if (!this.formValidateStatus()) {
                this.$Notice.error({ title: '错误', desc: '值规则校验异常' });
                return;
            }
            const arg: any = { ...opt };
            const data = this.getValues();
            Object.assign(arg, data);
            Object.assign(arg, this.context);
            if (ifStateNext) {
                this.drcounter = 0;
                if(this.drcounter !== 0){
                    this.formState.next({ type: 'beforesave', data: arg });//先通知关系界面保存
                    this.saveState = resolve;
                    return;
                }
            }
            const action: any = Object.is(data.srfuf, '1') ? this.updateAction : this.createAction;
            if(!action){
                let actionName:any = Object.is(data.srfuf, '1')?"updateAction":"createAction";
                this.$Notice.error({ title: '错误', desc: 'CPXHEditView视图表单'+actionName+'参数未配置' });
                return;
            }
            Object.assign(arg,this.viewparams);
            const post: Promise<any> = Object.is(data.srfuf, '1')?this.service.update(action, this.context,arg, this.showBusyIndicator):this.service.add(action,this.context,arg, this.showBusyIndicator);
            post.then((response: any) => {
                if (!response.status || response.status !== 200) {
                    if (response.errorMessage) {
                        this.$Notice.error({ title: '错误', desc: response.errorMessage });
                    }
                    return;
                }

                const data = response.data;
                this.onFormLoad(data);
                if(!opt.saveEmit){
                    this.$emit('save', data);
                }                
                this.$store.dispatch('viewaction/datasaved', { viewtag: this.viewtag });
                this.$nextTick(() => {
                    this.formState.next({ type: 'save', data: data });
                });
                if (showResultInfo) {
                    this.$Notice.success({ title: '', desc: (data.srfmajortext ? data.srfmajortext : '') + '&nbsp;保存成功！' });
                }
                resolve(response);
            }).catch((response: any) => {
                if (response && response.status === 401) {
                    return;
                }
                if (!response || !response.status || !response.data) {
                    this.$Notice.error({ title: '错误', desc: '系统异常' });
                    reject(response);
                    return;
                }

                const { data: _data } = response;
                if (Object.is(_data.status, 'BAD_REQUEST') && _data.parameters && _data.parameters.fieldErrors) {
                    this.resetValidates();
                    this.fillValidates(_data.parameters.fieldErrors)
                }
                this.$Notice.error({ title: _data.title, desc: _data.message });
                reject(response);
            });
        })
    }

    /**
    * 删除
    *
    * @private
    * @param {*} [opt={}]
    * @memberof EditForm
    */
    private remove(opt:Array<any> = [],showResultInfo?: boolean): Promise<any> {
        return new Promise((resolve: any, reject: any) => {
            if(!this.removeAction){
                this.$Notice.error({ title: '错误', desc: 'CPXHEditView视图表单removeAction参数未配置' });
                return;
            }
            const arg: any = opt[0];
            const _this: any = this;
            Object.assign(arg,this.viewparams);
            this.service.delete(_this.removeAction, this.context,arg, showResultInfo).then((response: any) => {
                if (response) {
                    const data = response.data;
                    this.$emit('remove',data);
                    this.formState.next({ type: 'remove', data: data });
                    this.data.ismodify = false;
                    this.$Notice.success({ title: '', desc: (data.srfmajortext ? data.srfmajortext : '') + '&nbsp;删除成功！' });
                    resolve(response);
                }
            }).catch((error: any) => {
                const { data: _data } = error;
                this.$Notice.error({ title: _data.title, desc: _data.message });
                reject(error);
            });
        });
    }

    /**
     * 工作流启动
     *
     * @param {*} [data={}]
     * @returns {Promise<any>}
     * @memberof Main
     */
    protected async wfstart(data: any): Promise<any> {
        return new Promise((resolve: any, reject: any) => {
            if(!this.WFStartAction){
                this.$Notice.error({ title: '错误', desc: 'WFCIDEditView视图表单WFStartAction参数未配置' });
                return;
            }
            const _this: any = this;
            const arg: any = data[0];
            const post: Promise<any> = Object.is(data.srfuf, '1')?this.service.update(this.updateAction, this.context,arg, this.showBusyIndicator):this.service.add(this.createAction,this.context,arg, this.showBusyIndicator);
            post.then((response:any) =>{
                const arg:any = response.data;
                if(this.viewparams){
                    Object.assign(arg,{viewparams:this.viewparams});
                }
                const result: Promise<any> = this.service.wfstart(_this.WFStartAction, this.context,arg, this.showBusyIndicator);
                result.then((response: any) => {
                    if (response && response.status === 401) {
                        return;
                    }
                    if (!response || response.status !== 200) {
                        this.$Notice.error({ title: '', desc: '工作流启动失败, ' + response.info });
                        return;
                    }
                    this.$Notice.info({ title: '', desc: '工作流启动成功' });
                    resolve(response);
            }).catch((response: any) => {
                if (response && response.status === 401) {
                    return;
                }
                if (!response || !response.status || !response.data) {
                    this.$Notice.error({ title: '错误', desc: '系统异常' });
                    reject(response);
                    return;
                }
                const { data: _data } = response;
                if (Object.is(_data.status, 'BAD_REQUEST') && _data.parameters && _data.parameters.fieldErrors) {
                    this.resetValidates();
                    this.fillValidates(_data.parameters.fieldErrors)
                }
                this.$Notice.error({ title: _data.title, desc: _data.message });
                reject(response);
            });
            }).catch((response: any) => {
                if (response && response.status === 401) {
                        return;
                    }
                    if (!response || !response.status || !response.data) {
                        this.$Notice.error({ title: '错误', desc: '系统异常' });
                        reject(response);
                        return;
                    }
                    const { data: _data } = response;
                    if (Object.is(_data.status, 'BAD_REQUEST') && _data.parameters && _data.parameters.fieldErrors) {
                        this.resetValidates();
                        this.fillValidates(_data.parameters.fieldErrors)
                    }
                    this.$Notice.error({ title: _data.title, desc: _data.message });
                    reject(response);
            })
        });
    }

    /**
     * 工作流提交
     *
     * @param {*} [data={}]
     * @returns {Promise<any>}
     * @memberof Main
     */
    protected async wfsubmit(data: any): Promise<any> {
        if(!this.WFSubmitAction){
            this.$Notice.error({ title: '错误', desc: 'CPXHEditView视图表单WFSubmitAction参数未配置' });
            return;
        }
        const _this: any = this;
        const arg: any = data[0];
        if (!arg.cpxh || Object.is(arg.cpxh, '')) {
            return;
        }
        const post: Promise<any> = this.service.wfsubmit(_this.WFSubmitAction,this.context, arg, this.showBusyIndicator);
        return new Promise((resolve: any, reject: any) => {
            post.then((response: any) => {
                if (response && response.status === 401) {
                    return;
                }

                if (!response || response.status !== 200) {
                    this.$Notice.error({ title: '', desc: '工作流提交失败, ' + response.info });
                    return;
                }
                this.$Notice.info({ title: '', desc: '工作流提交成功' });
                resolve(response);
            }).catch((response: any) => {
                if (response && response.status === 401) {
                    return;
                }
                if (!response || !response.status || !response.data) {
                    this.$Notice.error({ title: '错误', desc: '系统异常' });
                    reject(response);
                    return;
                }

                const { data: _data } = response;
                if (Object.is(_data.status, 'BAD_REQUEST') && _data.parameters && _data.parameters.fieldErrors) {
                    this.resetValidates();
                    this.fillValidates(_data.parameters.fieldErrors)
                }
                this.$Notice.error({ title: _data.title, desc: _data.message });
                reject(response);
            });
        });
    }

    /**
     * 表单项更新
     *
     * @param {string} mode 界面行为名称
     * @param {*} [data={}] 请求数据
     * @param {string[]} updateDetails 更新项
     * @param {boolean} [showloading] 是否显示加载状态
     * @returns {void}
     * @memberof Main
     */
    protected updateFormItems(mode: string, data: any = {}, updateDetails: string[], showloading?: boolean): void {
        if (!mode || (mode && Object.is(mode, ''))) {
            return;
        }
        const arg: any = { ...data };
        Object.assign(arg,this.viewparams);
        const post: Promise<any> = this.service.frontLogic(mode,this.context,arg, showloading);
        post.then((response: any) => {
            if (!response || response.status !== 200) {
                this.$Notice.error({ title: '错误', desc: '表单项更新失败' });
                return;
            }
            const data = response.data;
            const _data: any = {};
            updateDetails.forEach((name: string) => {
                if (!data.hasOwnProperty(name)) {
                    return;
                }
                Object.assign(_data, { [name]: data[name] });
            });
            this.setFormEnableCond(_data);
            this.fillForm(_data);
            this.formLogic({ name: '', newVal: null, oldVal: null });
            this.dataChang.next(JSON.stringify(this.data));
            this.$nextTick(() => {
                this.formState.next({ type: 'updateformitem', ufimode: arg.srfufimode, data: _data });
            });
        }).catch((response: any) => {
            if (response && response.status === 401) {
                return;
            }
            if (!response || !response.status || !response.data) {
                this.$Notice.error({ title: '错误', desc: '系统异常' });
                return;
            }

            const { data: _data } = response;
            if (Object.is(_data.status, 'BAD_REQUEST') && _data.parameters && _data.parameters.fieldErrors) {
                this.resetValidates();
                this.fillValidates(_data.parameters.fieldErrors)
            }
            this.$Notice.error({ title: _data.title, desc: _data.message });
        });
    }

    /**
     * 回车事件
     *
     * @param {*} $event
     * @memberof Main
     */
    protected onEnter($event: any): void {
    }

    /**
     * 保存并退出
     *
     * @param {any[]} args
     * @memberof Main
     */
    protected saveAndExit(data:any[]):Promise<any>{
        let _this = this;
        return new Promise((resolve: any, reject: any) =>{
            let arg: any = {};
            Object.assign(arg,data[0]);
            _this.currentAction = "saveAndExit";
            _this.save([arg]).then((res) =>{
                if(res){
                    _this.closeView(res.data);
                }
                resolve(res);
            }).catch((error) =>{
                reject(error);
            })
        })
    }

    /**
     * 保存并新建
     *
     * @param {any[]} args
     * @memberof Main
     */
    protected saveAndNew(data:any[]):Promise<any>{
        let _this = this;
        return new Promise((resolve: any, reject: any) =>{
            let arg: any = {};
            Object.assign(arg,data[0]);
            _this.currentAction = "saveAndNew";
            _this.save([arg]).then((res) =>{
                _this.ResetData(res);
                _this.loadDraft({});
            }).catch((error) =>{
                reject(error);
            })
        })
    }

    /**
     * 删除并退出
     *
     * @param {any[]} args
     * @memberof Main
     */
    protected removeAndExit(data:any[]):Promise<any>{
        let _this = this;
        return new Promise((resolve: any, reject: any) =>{
            let arg: any = {};
            Object.assign(arg,data[0]);
            _this.remove([arg]).then((res) =>{
                if(res){
                  _this.closeView(res.data);
                }
                resolve(res);
            }).catch((error) =>{
                reject(error);
            })
        })
    }

    /**
    * 关系界面数据保存完成
    *
    * @param {any} $event
    * @memberof Main
    */
    protected drdatasaved($event:any){
        let _this = this;
        this.drcounter--;
        if(this.drcounter > 0){
            return;
        }
        this.save({}, undefined, false).then((res) =>{
            this.saveState(res);
            if(Object.is(_this.currentAction, "saveAndNew")){
                _this.ResetData(res);
                _this.loadDraft({});
            }else if(Object.is(_this.currentAction, "saveAndExit")){
                if(res){
                    _this.closeView(res.data);
                }
            }
        });
    }
    
}
</script>

<style lang='less'>
@import './main-form.less';
</style>