Browse Source

Pull request #3740: KERNEL-17875 fix: fineui Dep不能回收问题

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

* commit 'e83a80916c27bbcd0093f4640f1e9ac65b69937e': (27 commits)
  KERNEL-17875 fix: fineui Dep不能回收问题
  REPORT-114436 fix: 编译报错修复
  REPORT-114436 fix: tab设置single时内存泄露问题
  BI-144837 feat: 更新图标
  无JIRA bubble中提供拓展popper的额外modifier
  BI-143459 fix: 修复请求头boundary与formData中WebKitFormBoundary不一致问题
  BI-143696 fix: 对象.**容错
  BI-143459 fix: 修复请求头boundary与formData中WebKitFormBoundary不一致问题
  无jira任务 fix: 更新图标
  REPORT-113703 FineOne 新前端样式统一 弹窗-FR.Msg.Alert()
  REPORT-112276 公共数据取数简道云数据连接部分适配 补充下ts类型
  REPORT-112276 公共数据取数简道云数据连接部分适配 引用lodash.uniqWith
  REPORT-112276 公共数据取数简道云数据连接部分适配 补充下ts类型
  BI-142512 fix: 年份控件切换成动态时间少了横线
  REPORT-112276 公共数据取数简道云数据连接部分适配 引用lodash.uniqWith
  BI-142531 fix: 缓存清空且hasNext为false时仍然显示加载更多数据
  update font
  BI-142225 fix: 再次添加过滤条件,参数值三个字会标红
  REPORT-111844 fix:【填报-预览】更换FR样式后,预览时间不同(可复现)
  BI-140151 fix: 图标更新
  ...
research/test
Dailer-刘荣歆 9 months ago
parent
commit
7834ce90b9
  1. BIN
      packages/fineui/dist/font/iconfont.eot
  2. 36
      packages/fineui/dist/font/iconfont.svg
  3. BIN
      packages/fineui/dist/font/iconfont.ttf
  4. BIN
      packages/fineui/dist/font/iconfont.woff
  5. BIN
      packages/fineui/dist/font/iconfont.woff2
  6. 3
      packages/fineui/src/base/foundation/message.js
  7. 7
      packages/fineui/src/base/single/input/file.js
  8. 1
      packages/fineui/src/case/combo/textvaluecombo/combo.textvalue.js
  9. 25
      packages/fineui/src/core/1.lodash.js
  10. 4
      packages/fineui/src/core/2.base.js
  11. 7
      packages/fineui/src/core/wrapper/layout/layout.card.js
  12. 15
      packages/fineui/src/fix/fix.compact.js
  13. 12
      packages/fineui/src/fix/fix.js
  14. 20
      packages/fineui/src/widget/multiselect/loader.js
  15. 2
      packages/fineui/typescript/core/base.ts

BIN
packages/fineui/dist/font/iconfont.eot vendored

Binary file not shown.

36
packages/fineui/dist/font/iconfont.svg vendored

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 1013 KiB

After

Width:  |  Height:  |  Size: 1024 KiB

BIN
packages/fineui/dist/font/iconfont.ttf vendored

Binary file not shown.

BIN
packages/fineui/dist/font/iconfont.woff vendored

Binary file not shown.

BIN
packages/fineui/dist/font/iconfont.woff2 vendored

Binary file not shown.

3
packages/fineui/src/base/foundation/message.js

@ -201,6 +201,9 @@ function _show(hasCancel, title, message, callback, config = {}) {
type: VerticalLayout.xtype,
cls: "bi-card bi-border-radius",
width: 450,
css: {
'max-height': '100%'
},
hgap: 32,
attributes: {
tabIndex: 1,

7
packages/fineui/src/base/single/input/file.js

@ -242,14 +242,11 @@ const sendFile = (toString => {
upload.onloadstart();
}
}
const boundary = `AjaxUploadBoundary${new Date().getTime()}`;
xhr.setRequestHeader("Content-Type", `multipart/form-data; boundary=${boundary}`);
if (handler.file.getAsBinary) {
const boundary = `AjaxUploadBoundary${new Date().getTime()}`;
xhr.setRequestHeader("Content-Type", `multipart/form-data; boundary=${boundary}`);
xhr[xhr.sendAsBinary ? "sendAsBinary" : "send"](multipart(boundary, handler.name, handler.file));
} else {
xhr.setRequestHeader("Content-Type", "multipart/form-data");
// xhr.setRequestHeader("X-Name", handler.name);
// xhr.setRequestHeader("X-File-Name", handler.file.fileName);
const form = new FormData();
form.append("FileData", handler.file);
xhr.send(form);

1
packages/fineui/src/case/combo/textvaluecombo/combo.textvalue.js

@ -216,6 +216,7 @@ export class TextValueCombo extends Widget {
}
setValue(v) {
this.options.value = v;
this.combo.setValue(v);
this._checkError(v);
}

25
packages/fineui/src/core/1.lodash.js

@ -6142,6 +6142,30 @@
return (array && array.length) ? baseUniq(array, baseIteratee(iteratee, 2)) : [];
}
/**
* This method is like `uniq` except that it accepts `comparator` which
* is invoked to compare elements of `array`. The order of result values is
* determined by the order they occur in the array. The comparator is invoked
* with two arguments: (arrVal, othVal).
*
* @since 4.0.0
* @category Array
* @param {Array} array The array to inspect.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new duplicate free array.
* @see uniq, uniqBy
* @example
*
* const objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]
*
* uniqWith(objects, isEqual)
* // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
*/
function uniqWith(array, comparator) {
comparator = typeof comparator === 'function' ? comparator : undefined;
return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
}
/**
* This method is like `_.zip` except that it accepts an array of grouped
* elements and creates an array regrouping the elements to their pre-zip
@ -10041,6 +10065,7 @@
lodash.union = union;
lodash.uniq = uniq;
lodash.uniqBy = uniqBy;
lodash.uniqWith = uniqWith;
lodash.unzip = unzip;
lodash.values = values;
lodash.without = without;

4
packages/fineui/src/core/2.base.js

@ -482,6 +482,7 @@ _.each(
"take",
"takeRight",
"uniqBy",
"uniqWith"
],
name => {
lodashFns[name] = _apply(name);
@ -510,6 +511,7 @@ export const range = lodashFns.range;
export const take = lodashFns.take;
export const takeRight = lodashFns.takeRight;
export const uniqBy = lodashFns.uniqBy;
export const uniqWith = lodashFns.uniqWith;
export const findIndex = lodashFns.findIndex;
export const findLastIndex = lodashFns.findLastIndex;
@ -1367,7 +1369,7 @@ export function parseDateTime(str, fmt) {
m = today.getMonth();
}
if (_global.isNaN(d)) {
d = Math.min(getMonthDays(getDate(y, m)), today.getDate());
d = 1;
}
if (_global.isNaN(hr)) {
hr = today.getHours();

7
packages/fineui/src/core/wrapper/layout/layout.card.js

@ -107,9 +107,12 @@ export class CardLayout extends Layout {
throw new Error("cardName not exist", cardName);
}
const child = this._children[this._getChildName(cardName)];
let child = this._children[this._getChildName(cardName)];
this._deleteCardByName(cardName);
child && child._destroy();
if (child) {
child._destroy();
child = null;
}
}
addCardByName(cardName, cardItem) {

15
packages/fineui/src/fix/fix.compact.js

@ -76,7 +76,7 @@ function popTarget() {
export const Model = Fix.Model;
const oldWatch = Fix.watch;
Fix.watch = function(model, expOrFn, cb, options) {
Fix.watch = function (model, expOrFn, cb, options) {
if (isPlainObject(cb)) {
options = cb;
cb = cb.handler;
@ -89,7 +89,7 @@ Fix.watch = function(model, expOrFn, cb, options) {
this,
model,
expOrFn,
function() {
function () {
options && options.store && pushTarget(options.store);
let res;
try {
@ -167,7 +167,7 @@ export function createStore() {
}
const _init = Widget.prototype._init;
Widget.prototype._init = function() {
Widget.prototype._init = function () {
const needPop = createStore.call(this);
try {
_init.apply(this, arguments);
@ -178,7 +178,7 @@ Widget.prototype._init = function() {
};
const __initWatch = Widget.prototype.__initWatch;
Widget.prototype.__initWatch = function() {
Widget.prototype.__initWatch = function () {
__initWatch.apply(this, arguments);
const workerMode =
Providers.getProvider("bi.provider.system").getWorkerMode();
@ -191,7 +191,7 @@ Widget.prototype.__initWatch = function() {
};
const unMount = Widget.prototype.__destroy;
Widget.prototype.__destroy = function() {
Widget.prototype.__destroy = function () {
try {
unMount.apply(this, arguments);
} catch (e) {
@ -204,6 +204,7 @@ Widget.prototype.__destroy = function() {
unwatch();
});
});
Fix.cleanupDeps();
this._watchers && (this._watchers = []);
if (this.store) {
this.store._parent && (this.store._parent = null);
@ -213,7 +214,7 @@ Widget.prototype.__destroy = function() {
delete this.__cacheStore;
};
Widget.prototype.__watch = function(getter, handler, options) {
Widget.prototype.__watch = function (getter, handler, options) {
this._watchers = this._watchers || [];
const watcher = new Fix.Watcher(
null,
@ -235,7 +236,7 @@ Widget.prototype.__watch = function(getter, handler, options) {
_.each(["_render", "__afterRender", "_mount", "__afterMount"], (name) => {
const old = Widget.prototype[name];
old &&
(Widget.prototype[name] = function() {
(Widget.prototype[name] = function () {
this.store && pushTarget(this.store);
let res;
try {

12
packages/fineui/src/fix/fix.js

@ -110,7 +110,15 @@ function isExtensible(obj) {
function remove(arr, item) {
if (arr && arr.length) {
if (!arr) {
return;
}
const len = arr.length;
if (len) {
if (item === arr[len - 1]) {
arr.length = len - 1;
return;
}
const index = arr.indexOf(item);
if (index > -1) {
return arr.splice(index, 1);
@ -929,7 +937,7 @@ function watch(model, expOrFn, cb, options) {
return m;
} : parsePath(exp);
const v = getter.call(model, model);
if (v.__ob__) {
if (v && v.__ob__) {
const dep = new Dep();
if (isGlobal) {
(v.__ob__._scopeDeps || (v.__ob__._scopeDeps = [])).push(dep);

20
packages/fineui/src/widget/multiselect/loader.js

@ -73,14 +73,14 @@ export class MultiSelectInnerLoader extends Widget {
if (this.cachItems && this.cachItems.length > 0) {
this.next.setLoaded();
const items = this._composeItems(this.cachItems.slice(0, 100));
this.addItems(items);
this.cachItems = this.cachItems.slice(100);
this.addItems(items);
return;
}
o.itemsCreator.apply(this, [
{ times: ++this.times },
function() {
function () {
self.next.setLoaded();
self.addItems(...arguments);
}
@ -105,7 +105,7 @@ export class MultiSelectInnerLoader extends Widget {
],
value: o.value,
});
this.button_group.on(Controller.EVENT_CHANGE, function(type, value, obj) {
this.button_group.on(Controller.EVENT_CHANGE, function (type, value, obj) {
if (type === Events.CLICK) {
const node = self.cachGroup.getNodeByValue(value);
if (node) {
@ -158,12 +158,12 @@ export class MultiSelectInnerLoader extends Widget {
});
o.isDefaultInit &&
isEmpty(o.items) &&
nextTick(
bind(function() {
o.isDefaultInit && isEmpty(o.items) && this._populate();
}, this)
);
isEmpty(o.items) &&
nextTick(
bind(function () {
o.isDefaultInit && isEmpty(o.items) && this._populate();
}, this)
);
}
hasNext() {
@ -221,7 +221,7 @@ export class MultiSelectInnerLoader extends Widget {
if (arguments.length === 0 && isFunction(o.itemsCreator)) {
o.itemsCreator.apply(this, [
{ times: 1 },
function(items, keyword) {
function (items, keyword) {
if (arguments.length === 0) {
throw new Error("object already registered");
}

2
packages/fineui/typescript/core/base.ts

@ -172,6 +172,8 @@ export declare function uniq<T>(array: T[], isSorted?: boolean, iteratee?: any,
export declare function uniqBy<T>(array: T[], iteratee?: any, context?: any): T[];
export declare function uniqWith<T>(array: T[], comparator?: any): T[];
// 对象相关方法
export declare function keys(object: object): string[];

Loading…
Cancel
Save