Browse Source

Pull request #3509: REPORT-94791 fix:老代码继承结构不对

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

* commit '88284129bd9f217d2e482c51825636aea2ea9965':
  BI-125433 fix:修复texteditor
  REPORT-94787 fix:纠正 this
  REPORT-94791 fix:老代码继承结构不对
es6
treecat-罗群 2 years ago
parent
commit
72fd75dccc
  1. 9
      packages/fineui/src/base/single/editor/editor.textarea.js
  2. 14
      packages/fineui/src/component/treevaluechooser/abstract.treevaluechooser.js
  3. 2
      packages/fineui/src/core/5.inject.js

9
packages/fineui/src/base/single/editor/editor.textarea.js

@ -212,11 +212,12 @@ export class TextAreaEditor extends Single {
_setErrorVisible(b) { _setErrorVisible(b) {
const { adjustYOffset, adjustXOffset, offsetStyle } = this.options; const { adjustYOffset, adjustXOffset, offsetStyle } = this.options;
if (isFunction(this.options.errorText)) { let errorText = this.options.errorText;
this.options.errorText = this.options.errorText(trim(this.getValue())); if (isFunction(errorText)) {
errorText = errorText(trim(this.getValue()));
} }
if (!this.disabledError && isKey(this.options.errorText)) { if (!this.disabledError && isKey(errorText)) {
Bubbles[b ? "show" : "hide"](this.getName(), this.options.errorText, this, { Bubbles[b ? "show" : "hide"](this.getName(), errorText, this, {
adjustYOffset, adjustYOffset,
adjustXOffset, adjustXOffset,
offsetStyle, offsetStyle,

14
packages/fineui/src/component/treevaluechooser/abstract.treevaluechooser.js

@ -963,13 +963,7 @@ export class AbstractTreeValueChooser extends Widget {
buildCompleteTree(selectedValues) { buildCompleteTree(selectedValues) {
const result = {}; const result = {};
if (selectedValues !== null && !isEmpty(selectedValues)) { const fill = (parentValues, node, selected, r) => {
fill([], this.tree.getRoot(), selectedValues, result);
}
return result;
function fill(parentValues, node, selected, r) {
if (selected === null || isEmpty(selected)) { if (selected === null || isEmpty(selected)) {
each(node.getChildren(), (i, child) => { each(node.getChildren(), (i, child) => {
const newParents = clone(parentValues); const newParents = clone(parentValues);
@ -988,5 +982,11 @@ export class AbstractTreeValueChooser extends Widget {
fill(newParents, node, selected[k], r[k]); fill(newParents, node, selected[k], r[k]);
}); });
} }
if (selectedValues !== null && !isEmpty(selectedValues)) {
fill([], this.tree.getRoot(), selectedValues, result);
}
return result;
} }
} }

2
packages/fineui/src/core/5.inject.js

@ -405,7 +405,7 @@ export function shortcut(xtype, cls) {
} }
// 兼容性 // 兼容性
if(!cls.superclass) { if (!cls.hasOwnProperty("superclass")) {
cls.superclass = Object.getPrototypeOf(cls.prototype); cls.superclass = Object.getPrototypeOf(cls.prototype);
} }

Loading…
Cancel
Save