import { ExpBarControlBase } from './expbar-control-base';
/**
 * 卡片导航栏部件基类
 *
 * @export
 * @class FormControlBase
 * @extends {MainControlBase}
 */
export class DataViewExpBarControlBase extends ExpBarControlBase {
    /**
     * 处理数据部件参数
     *
     * @memberof GridExpBarControlBase
     */
    async handleXDataCtrlOptions() {
        var _a, _b, _c, _d, _e, _f;
        const navPSAppView = await ((_b = (_a = this.$xDataControl) === null || _a === void 0 ? void 0 : _a.getNavPSAppView()) === null || _b === void 0 ? void 0 : _b.fill());
        if (navPSAppView) {
            this.navViewName = navPSAppView.modelPath;
        }
        this.navFilter = ((_c = this.$xDataControl) === null || _c === void 0 ? void 0 : _c.navFilter) ? this.$xDataControl.navFilter : "";
        this.navPSDer = ((_e = (_d = this.$xDataControl) === null || _d === void 0 ? void 0 : _d.getNavPSDER) === null || _e === void 0 ? void 0 : _e.call(_d)) ? "n_" + ((_f = this.$xDataControl.getNavPSDER().minorCodeName) === null || _f === void 0 ? void 0 : _f.toLowerCase()) + "_eq" : "";
    }
    /**
     * 部件事件处理
     *
     * @param {string} controlname 部件
     * @param {string} action 行为
     * @param {*} data 数据
     * @memberof DataViewExpBarControlBase
     */
    onCtrlEvent(controlname, action, data) {
        if (controlname != this.xDataControlName) {
            return;
        }
        super.onCtrlEvent(controlname, action, data);
    }
    /**
    * 执行搜索
    *
    * @memberof DataViewExpBarControlBase
    */
    onSearch() {
        var _a;
        if (this.Environment && this.Environment.isPreviewMode) {
            return;
        }
        const dataview = this.$refs[(_a = this.xDataControlName) === null || _a === void 0 ? void 0 : _a.toLowerCase()].ctrl;
        if (dataview) {
            this.viewState.next({ tag: this.xDataControlName, action: "filter", data: { query: this.searchText } });
        }
    }
}
