Browse Source

Pull request #3734: BI-139784 fix: 【来源内测BUG】数据编辑过滤

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

* commit '61ea631a5e426905847d3fbc737a06687058078f':
  BI-139784 fix: 【来源内测BUG】数据编辑过滤
research/test
Dailer-刘荣歆 9 months ago
parent
commit
6f76fa6893
  1. 22
      packages/fineui/src/widget/multiselect/trigger/editor.multiselect.js

22
packages/fineui/src/widget/multiselect/trigger/editor.multiselect.js

@ -1,4 +1,15 @@
import { shortcut, Widget, extend, i18nText, createWidget, Controller, isEmptyString, isEmptyArray, BlankSplitChar } from "@/core"; import {
shortcut,
Widget,
extend,
i18nText,
createWidget,
Controller,
isEmptyString,
isEmptyArray,
BlankSplitChar,
first, last, isNotEmptyString
} from "@/core";
import { StateEditor } from "@/case"; import { StateEditor } from "@/case";
import { SelectPatchEditor } from "./editor/editor.patch"; import { SelectPatchEditor } from "./editor/editor.patch";
@ -77,8 +88,13 @@ export class MultiSelectEditor extends Widget {
getKeywords() { getKeywords() {
const val = this.editor.getValue(); const val = this.editor.getValue();
let keywords = val.split(/\u200b\s\u200b/); let keywords = val.split(/\u200b\s\u200b/);
if (isEmptyString(keywords[keywords.length - 1])) { if (isEmptyString(first(keywords)) || isEmptyString(last(keywords))) {
keywords = keywords.slice(0, keywords.length - 1); keywords = keywords.filter((word, index) => {
if (index === 0 || index === keywords.length - 1) {
return isNotEmptyString(word);
}
return true;
});
} }
if (/\u200b\s\u200b$/.test(val)) { if (/\u200b\s\u200b$/.test(val)) {
return keywords.concat([BlankSplitChar]); return keywords.concat([BlankSplitChar]);

Loading…
Cancel
Save