<#ibizinclude>
./VIEW_HEADER.ts.ftl
</#ibizinclude>

<#if view.hasPSControl('grid')>
<#assign grid = view.getPSControl('grid')>
</#if>
<#if grid??>

    /**
     * 是否单选
     *
     * @type {boolean}
     * @memberof ${srfclassname('${view.name}')}
     */
    public isSingleSelect: boolean = ${grid.isSingleSelect()?c};
</#if>

    /**
     * 搜索值
     *
     * @type {string}
     * @memberof ${srfclassname('${view.name}')}
     */
    public query: string = '';

    /**
     * 是否展开搜索表单
     *
     * @type {boolean}
     * @memberof ${srfclassname('${view.name}')}
     */
    public isExpandSearchForm: boolean = ${view.isExpandSearchForm()?c};

    /**
     * 表格行数据默认激活模式
     * 0 不激活
     * 1 单击激活
     * 2 双击激活
     *
     * @type {(number | 0 | 1 | 2)}
     * @memberof ${srfclassname('${view.name}')}
     */
    public gridRowActiveMode: number | 0 | 1 | 2 = ${view.getGridRowActiveMode()?c};

    /**
     * 快速搜索
     *
     * @param {*} $event
     * @memberof ${srfclassname('${view.name}')}
     */
    public onSearch($event: any): void {
        <#if grid??>
        const grid: any = this.${grid.name};
        if (grid) {
            grid.load({});
        }
        </#if>
    }
<#if grid??>

    /**
     * 刷新数据
     *
     * @readonly
     * @type {(number | null)}
     * @memberof ${srfclassname('${view.name}')}
     */
    get refreshdata(): number | null {
        return null;
    }

</#if>

<#ibizinclude>
./VIEW_BOTTOM.ts.ftl
</#ibizinclude>