Browse Source

Pull request #3586: Es6

Merge in VISUAL/fineui from ~DAILER/fineui:es6 to es6

* commit '17f06cc9612158975df7d5aa0843fdd546409fed':
  BI-128204 fix: 【6.0.12发散】自适应布局及内容缩放下,缩小浏览器窗口,过滤查看已选下方异常
  BI-128204 fix: 【6.0.12发散】自适应布局及内容缩放下,缩小浏览器窗口,过滤查看已选下方异常
es6
Dailer-刘荣歆 1 year ago
parent
commit
aaac7cfbbe
  1. 15
      packages/fineui/src/base/combination/searcher.js

15
packages/fineui/src/base/combination/searcher.js

@ -17,7 +17,8 @@ import {
BlankSplitChar, BlankSplitChar,
Events, Events,
EVENT_RESPONSE_TIME, EVENT_RESPONSE_TIME,
Func Func,
isFunction,
} from "@/core"; } from "@/core";
import { ButtonGroup } from "./group.button"; import { ButtonGroup } from "./group.button";
import { Maskers } from "@/base/0.base"; import { Maskers } from "@/base/0.base";
@ -127,7 +128,8 @@ export class Searcher extends Widget {
} }
_assertPopupView() { _assertPopupView() {
const { masker, popup, chooseType, isAutoSync, adapter } = this.options; const { masker, popup, chooseType, isAutoSync } = this.options;
const adapter = isFunction(this.options.adapter) ? this.options.adapter() : this.options.adapter;
if ((masker && !Maskers.has(this.getName())) || (masker === false && !this.popupView)) { if ((masker && !Maskers.has(this.getName())) || (masker === false && !this.popupView)) {
this.popupView = createWidget(popup, { this.popupView = createWidget(popup, {
type: SearcherView.xtype, type: SearcherView.xtype,
@ -213,7 +215,8 @@ export class Searcher extends Widget {
} }
_search() { _search() {
const { isAutoSearch, adapter, isAutoSync, onSearch } = this.options; const { isAutoSearch, isAutoSync, onSearch } = this.options;
const adapter = isFunction(this.options.adapter) ? this.options.adapter() : this.options.adapter;
const keyword = this.editor.getValue(); const keyword = this.editor.getValue();
if (keyword === "" || this._stop) { if (keyword === "" || this._stop) {
return; return;
@ -333,7 +336,8 @@ export class Searcher extends Widget {
} }
getValue() { getValue() {
const { isAutoSync, adapter, popup } = this.options; const { isAutoSync, popup } = this.options;
const adapter = isFunction(this.options.adapter) ? this.options.adapter() : this.options.adapter;
if (isAutoSync && adapter && adapter.getValue) { if (isAutoSync && adapter && adapter.getValue) {
return adapter.getValue(); return adapter.getValue();
} }
@ -350,7 +354,8 @@ export class Searcher extends Widget {
} }
populate(result, searchResult, keyword) { populate(result, searchResult, keyword) {
const { isAutoSync, adapter } = this.options; const { isAutoSync } = this.options;
const adapter = isFunction(this.options.adapter) ? this.options.adapter() : this.options.adapter;
this._assertPopupView(); this._assertPopupView();
this.popupView.populate(...arguments); this.popupView.populate(...arguments);
if (isAutoSync && adapter && adapter.getValue) { if (isAutoSync && adapter && adapter.getValue) {

Loading…
Cancel
Save