From e3ecaac8b90bf46a025a7b42d3fdc25ab2074381 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kevin=2EKing-=E7=8E=8B=E5=87=AF=E5=A3=AE?= Date: Tue, 18 Jul 2023 16:21:12 +0800 Subject: [PATCH 1/2] =?UTF-8?q?REPORT-100874=20fix:=E3=80=90=E4=B8=93?= =?UTF-8?q?=E9=A2=98=E3=80=91=E3=80=90=E6=9D=83=E9=99=90=E5=A4=8D=E7=94=A8?= =?UTF-8?q?=E3=80=91=E6=9D=83=E9=99=90=E5=A4=8D=E7=94=A8=E6=97=B6=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E7=8A=B6=E6=80=81=E4=B8=8B=E9=80=89=E4=B8=AD=E9=83=A8?= =?UTF-8?q?=E9=97=A8=EF=BC=8C=E6=90=9C=E7=B4=A2=E7=8A=B6=E6=80=81=E4=B8=8B?= =?UTF-8?q?=E5=8F=96=E6=B6=88=E5=85=B6=E4=B8=AD1=E4=B8=AA=E8=81=8C?= =?UTF-8?q?=E5=8A=A1=EF=BC=8C=E5=8F=96=E6=B6=88=E6=90=9C=E7=B4=A2=E5=90=8E?= =?UTF-8?q?=E5=8F=91=E7=8E=B0=E8=81=8C=E5=8A=A1=E8=BF=98=E6=98=AF=E9=80=89?= =?UTF-8?q?=E4=B8=AD=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../abstract.treevaluechooser.js | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/packages/fineui/src/component/treevaluechooser/abstract.treevaluechooser.js b/packages/fineui/src/component/treevaluechooser/abstract.treevaluechooser.js index 61323f27c..90bf612d4 100644 --- a/packages/fineui/src/component/treevaluechooser/abstract.treevaluechooser.js +++ b/packages/fineui/src/component/treevaluechooser/abstract.treevaluechooser.js @@ -174,6 +174,7 @@ export class AbstractTreeValueChooser extends Widget { } _reqSelectedTreeNode(op, callback) { + const self = this; const selectedValues = deepClone(op.selectedValues); const notSelectedValue = op.notSelectedValue || {}; const keyword = op.keyword || ""; @@ -188,7 +189,7 @@ export class AbstractTreeValueChooser extends Widget { dealWithSelectedValues(selectedValues); callback(selectedValues); - const dealWithSelectedValues = selectedValues => { + function dealWithSelectedValues(selectedValues) { let p = parentValues.concat(notSelectedValue); // 存储的值中存在这个值就把它删掉 // 例如选中了中国-江苏-南京, 取消中国或江苏或南京 @@ -197,18 +198,18 @@ export class AbstractTreeValueChooser extends Widget { // 如果搜索的值在父亲链中 if (isSearchValueInParent(p)) { // 例如选中了 中国-江苏, 搜索江苏, 取消江苏(干掉了江苏) - this._deleteNode(selectedValues, p); + self._deleteNode(selectedValues, p); } else { const searched = []; // 要找到所有以notSelectedValue为叶子节点的链路 const find = search(parentValues, notSelectedValue, [], searched); if (find && isNotEmptyArray(searched)) { each(searched, (i, arr) => { - const node = this._getNode(selectedValues, arr); + const node = self._getNode(selectedValues, arr); if (node) { // 例如选中了 中国-江苏, 搜索江苏, 取消中国(实际上只想删除中国-江苏,因为搜的是江苏) // 例如选中了 中国-江苏-南京,搜索南京,取消中国(实际上只想删除中国-江苏-南京,因为搜的是南京) - this._deleteNode(selectedValues, arr); + self._deleteNode(selectedValues, arr); } else { // 例如选中了 中国-江苏,搜索南京,取消中国(实际上只想删除中国-江苏-南京,因为搜的是南京) expandSelectedValue(selectedValues, arr, last(arr)); @@ -239,14 +240,14 @@ export class AbstractTreeValueChooser extends Widget { // 添加去掉搜索的结果集 if (result.length > 0) { each(result, (i, strs) => { - this._buildTree(selectedValues, strs); + self._buildTree(selectedValues, strs); }); } } } }; - const expandSelectedValue = (selectedValues, parents, notSelectedValue) => { + function expandSelectedValue(selectedValues, parents, notSelectedValue) { let next = selectedValues; const childrenCount = []; const path = []; @@ -259,7 +260,7 @@ export class AbstractTreeValueChooser extends Widget { } if (isEmpty(next)) { const split = parents.slice(0, i); - const expanded = this._getChildren(split); + const expanded = self._getChildren(split); path.push(split); childrenCount.push(expanded.length); // 如果只有一个值且取消的就是这个值 @@ -270,7 +271,7 @@ export class AbstractTreeValueChooser extends Widget { ) { for (let j = childrenCount.length - 1; j >= 0; j--) { if (childrenCount[j] === 1) { - this._deleteNode(selectedValues, path[j]); + self._deleteNode(selectedValues, path[j]); } else { break; } @@ -295,16 +296,16 @@ export class AbstractTreeValueChooser extends Widget { }); }; - const search = (parents, current, result, searched) => { + function search(parents, current, result, searched) { const newParents = clone(parents); newParents.push(current); - if (this._isMatch(parents, current, keyword)) { + if (self._isMatch(parents, current, keyword)) { searched && searched.push(newParents); return true; } - const children = this._getChildren(newParents); + const children = self._getChildren(newParents); const notSearch = []; let can = false; @@ -327,9 +328,9 @@ export class AbstractTreeValueChooser extends Widget { return can; }; - const isSearchValueInParent = parentValues => { + function isSearchValueInParent(parentValues) { for (let i = 0, len = parentValues.length; i < len; i++) { - if (this._isMatch(parentValues.slice(0, i), parentValues[i], keyword)) { + if (self._isMatch(parentValues.slice(0, i), parentValues[i], keyword)) { return true; } } From 11b8baa5c6c3502113d85b2238a75dd558397099 Mon Sep 17 00:00:00 2001 From: dailer Date: Tue, 18 Jul 2023 17:07:23 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=97=A0JIRA=20$=E5=92=8CJquery=E7=9A=84?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E9=97=AE=E9=A2=98=E5=85=BC=E5=AE=B9FR?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/fineui/src/bundle.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/fineui/src/bundle.js b/packages/fineui/src/bundle.js index 7d9f259d1..a7e875954 100644 --- a/packages/fineui/src/bundle.js +++ b/packages/fineui/src/bundle.js @@ -5,12 +5,15 @@ import {_defineVarProperties} from "@/core/constant/writable.var"; _global.BI = _global.BI || {}; +// for fr, 已经有的就不对外暴露了. +// 要知道BI只有`BI.$`, 挂在全局对象上的只是为了兼容而已 +if (!_global.$ && !_global.jQuery) { + _global.jQuery = _global.$ = fuiExport.$; +} Object.assign(_global, { Fix: fuiExport.Fix, _: fuiExport._, - $: fuiExport.$, - jQuery: fuiExport.$, }); Object.assign(_global.BI, fuiExport, injectFn);