guy 7 years ago
parent
commit
c8de8cafda
  1. 6
      Gruntfile.js
  2. 94
      dist/_fineui.min.js
  3. 465
      dist/bundle.js
  4. 96
      dist/bundle.min.js
  5. 23
      dist/core.js
  6. 94
      dist/fineui.min.js
  7. 2
      dist/fix/fix.compact.js
  8. 5
      dist/index.html
  9. 21
      src/core/utils/load.js
  10. 23
      utils/utils.js

6
Gruntfile.js

@ -101,7 +101,7 @@ module.exports = function (grunt) {
}, },
bundleJs: { bundleJs: {
src: ["dist/core.js", "dist/fix/fix.js", "dist/fix/fix.compact.js", "dist/base.js", "dist/case.js", "dist/widget.js", "dist/router.js", "public/js/**/*.js", "public/js/index.js"], src: ["dist/core.js", "dist/fix/fix.js", "dist/base.js", "dist/case.js", "dist/widget.js", "dist/fix/fix.compact.js", "dist/router.js", "public/js/**/*.js", "public/js/index.js"],
dest: "dist/bundle.js" dest: "dist/bundle.js"
}, },
@ -199,7 +199,7 @@ module.exports = function (grunt) {
dist: { dist: {
files: { files: {
"dist/bundle.min.js": ["<%= concat.bundleJs.dest %>"], "dist/bundle.min.js": ["<%= concat.bundleJs.dest %>"],
"dist/_fineui.min.js": ["dist/polyfill.js", "dist/core.js", "dist/fix/fix.js", "dist/fix/fix.compact.js", "src/third/**/*.js", "dist/_fineui.min.js": ["dist/polyfill.js", "dist/core.js", "dist/fix/fix.js", "src/third/**/*.js",
"src/base/formula/config.js", "src/base/formula/config.js",
"src/base/pane.js", "src/base/pane.js",
"src/base/single/single.js", "src/base/single/single.js",
@ -215,7 +215,7 @@ module.exports = function (grunt) {
"src/base/tree/parttree.js", "src/base/tree/parttree.js",
"src/base/**/*.js", "src/base/**/*.js",
"!src/base/formula/formulaeditor.js", "!src/base/formula/formulaeditor.js",
"dist/case.js", "dist/widget.js", "dist/router.js", "ui/js/**/*.js"] "dist/case.js", "dist/widget.js", "dist/fix/fix.compact.js", "dist/router.js", "ui/js/**/*.js"]
} }
} }
}, },

94
dist/_fineui.min.js vendored

File diff suppressed because one or more lines are too long

465
dist/bundle.js vendored

@ -23241,28 +23241,7 @@ BI.IntegerBufferSet.prototype = {
return array; return array;
} }
}; };
})();window.BI = window.BI || {}; })();_.extend(BI, {
_.extend(BI, {
$defaultImport: function (options, type) {
var config;
if (BI.isObject(options)) {
config = $.extend({
op: "resource",
path: null,
type: null,
must: false
}, options);
config.url = BI.servletURL + "?op=" + config.op + "&resource=" + config.path;
} else {
config = {
url: BI.servletURL + "?op=resource&resource=" + options,
type: arguments[1],
must: arguments[2]
};
}
this.$import(config.url, config.type, config.must);
},
$import: function () { $import: function () {
var _LOADED = {}; // alex:保存加载过的 var _LOADED = {}; // alex:保存加载过的
function loadReady (src, must) { function loadReady (src, must) {
@ -35280,227 +35259,7 @@ Data.Source = BISource = {
exports.toJSON = toJSON; exports.toJSON = toJSON;
exports.__esModule = true; exports.__esModule = true;
});;(function () { });/* !
function initWatch (vm, watch) {
vm._watchers || (vm._watchers = []);
for (var key in watch) {
var handler = watch[key];
if (BI.isArray(handler)) {
for (var i = 0; i < handler.length; i++) {
vm._watchers.push(createWatcher(vm, key, handler[i]));
}
} else {
vm._watchers.push(createWatcher(vm, key, handler));
}
}
}
function createWatcher (vm, keyOrFn, handler) {
return Fix.watch(vm.model, keyOrFn, _.bind(handler, vm), {
store: vm.store
});
}
var target = null;
var targetStack = [];
function pushTarget (_target) {
if (target) targetStack.push(target);
Fix.Model.target = target = _target;
}
function popTarget () {
Fix.Model.target = target = targetStack.pop();
}
var context = null;
var contextStack = [];
function pushContext (_context) {
if (context) contextStack.push(context);
Fix.Model.context = context = _context;
}
function popContext () {
Fix.Model.context = context = contextStack.pop();
}
var oldWatch = Fix.watch;
Fix.watch = function (model, expOrFn, cb, options) {
if (BI.isPlainObject(cb)) {
options = cb;
cb = cb.handler;
}
if (typeof cb === "string") {
cb = model[cb];
}
return oldWatch.call(this, model, expOrFn, function () {
options && options.store && pushTarget(options.store);
var res = cb.apply(this, arguments);
options && options.store && popTarget();
return res;
}, options);
};
function findStore (widget) {
if (target != null) {
return target;
}
widget = widget || context;
var p = widget;
while (p) {
if (p.store || p.__cacheStore) {
break;
}
p = p._parent || (p.options && p.options.element);
}
if (p) {
widget.__cacheStore = p.store || p.__cacheStore;
return p.__cacheStore || p.store;
}
}
var _create = BI.createWidget;
BI.createWidget = function (item, options, context) {
var pushed = false;
if (BI.isWidget(options)) {
pushContext(options);
pushed = true;
} else if (context != null) {
pushContext(context);
pushed = true;
}
var result = _create.apply(this, arguments);
pushed && popContext();
return result;
};
$(function () {
var populate = BI.Loader.prototype.populate;
BI.Loader.prototype.populate = function () {
pushContext(this);
var result = populate.apply(this, arguments);
popContext();
return result;
};
});
var _init = BI.Widget.prototype._init;
BI.Widget.prototype._init = function () {
var self = this;
var needPop = false;
if (window.Fix && this._store) {
var store = findStore(this.options.element);
if (store) {
pushTarget(store);
needPop = true;
}
this.store = this._store();
needPop && popTarget();
needPop = false;
pushTarget(this.store);
if (this.store instanceof Fix.Model) {
this.model = this.store.model;
} else {
this.model = this.store;
}
needPop = true;
}
_init.apply(this, arguments);
needPop && popTarget();
};
var _render = BI.Widget.prototype._render;
BI.Widget.prototype._render = function () {
var needPop = false;
if (window.Fix && this._store) {
needPop = true;
pushTarget(this.store);
initWatch(this, this.watch);
}
_render.apply(this, arguments);
needPop && popTarget();
};
var unMount = BI.Widget.prototype.__d;
BI.Widget.prototype.__d = function () {
unMount.apply(this, arguments);
this.store && BI.isFunction(this.store.destroy) && this.store.destroy();
BI.each(this._watchers, function (i, unwatches) {
unwatches = BI.isArray(unwatches) ? unwatches : [unwatches];
BI.each(unwatches, function (j, unwatch) {
unwatch();
});
});
this._watchers && (this._watchers = []);
if (this.store) {
this.store._parent && (this.store._parent = null);
this.store = null;
}
delete this.__cacheStore;
};
_.each(["_mount"], function (name) {
var old = BI.Widget.prototype[name];
old && (BI.Widget.prototype[name] = function () {
this.store && pushTarget(this.store);
var res = old.apply(this, arguments);
this.store && popTarget();
return res;
});
});
if (BI.isIE9Below()) {
_.each(["each", "map", "reduce", "reduceRight", "find", "filter", "reject", "every", "all", "some", "any", "max", "min",
"sortBy", "groupBy", "indexBy", "countBy", "partition",
"keys", "allKeys", "values", "pairs", "invert",
"mapObject", "findKey", "pick", "omit", "tap"], function (name) {
var old = BI[name];
BI[name] = function (obj, fn) {
return typeof fn === "function" ? old(obj, function (key, value) {
if (!(key in Fix.$$skipArray)) {
return fn.apply(this, arguments);
}
}) : old.apply(this, arguments);
};
});
BI.isEmpty = function (ob) {
if (BI.isPlainObject(ob) && ob.__ob__) {
return BI.keys(ob).length === 0;
}
return _.isEmpty(ob);
};
BI.keys = function (ob) {
var keys = _.keys(ob);
var nKeys = [];
for (var i = 0; i < keys.length; i++) {
if (!(keys[i] in Fix.$$skipArray)) {
nKeys.push(keys[i]);
}
}
return nKeys;
};
BI.values = function (ob) {
var keys = BI.keys(obj);
var length = keys.length;
var values = [];
for (var i = 0; i < length; i++) {
values[i] = obj[keys[i]];
}
return values;
};
BI.size = function (ob) {
if (BI.isPlainObject(ob) && ob.__ob__) {
return BI.keys(ob).length;
}
return _.size(ob);
};
BI.isEmptyObject = function (ob) {
return BI.size(ob) === 0;
};
}
BI.watch = Fix.watch;
}());/* !
* jQuery Mousewheel 3.1.13 * jQuery Mousewheel 3.1.13
* *
* Copyright jQuery Foundation and other contributors * Copyright jQuery Foundation and other contributors
@ -109819,7 +109578,225 @@ BI.ValueChooserPane = BI.inherit(BI.AbstractValueChooser, {
} }
}); });
BI.ValueChooserPane.EVENT_CHANGE = "ValueChooserPane.EVENT_CHANGE"; BI.ValueChooserPane.EVENT_CHANGE = "ValueChooserPane.EVENT_CHANGE";
BI.shortcut("bi.value_chooser_pane", BI.ValueChooserPane);(function () { BI.shortcut("bi.value_chooser_pane", BI.ValueChooserPane);;(function () {
function initWatch (vm, watch) {
vm._watchers || (vm._watchers = []);
for (var key in watch) {
var handler = watch[key];
if (BI.isArray(handler)) {
for (var i = 0; i < handler.length; i++) {
vm._watchers.push(createWatcher(vm, key, handler[i]));
}
} else {
vm._watchers.push(createWatcher(vm, key, handler));
}
}
}
function createWatcher (vm, keyOrFn, handler) {
return Fix.watch(vm.model, keyOrFn, _.bind(handler, vm), {
store: vm.store
});
}
var target = null;
var targetStack = [];
function pushTarget (_target) {
if (target) targetStack.push(target);
Fix.Model.target = target = _target;
}
function popTarget () {
Fix.Model.target = target = targetStack.pop();
}
var context = null;
var contextStack = [];
function pushContext (_context) {
if (context) contextStack.push(context);
Fix.Model.context = context = _context;
}
function popContext () {
Fix.Model.context = context = contextStack.pop();
}
var oldWatch = Fix.watch;
Fix.watch = function (model, expOrFn, cb, options) {
if (BI.isPlainObject(cb)) {
options = cb;
cb = cb.handler;
}
if (typeof cb === "string") {
cb = model[cb];
}
return oldWatch.call(this, model, expOrFn, function () {
options && options.store && pushTarget(options.store);
var res = cb.apply(this, arguments);
options && options.store && popTarget();
return res;
}, options);
};
function findStore (widget) {
if (target != null) {
return target;
}
widget = widget || context;
var p = widget;
while (p) {
if (p.store || p.__cacheStore) {
break;
}
p = p._parent || (p.options && p.options.element);
}
if (p) {
widget.__cacheStore = p.store || p.__cacheStore;
return p.__cacheStore || p.store;
}
}
var _create = BI.createWidget;
BI.createWidget = function (item, options, context) {
var pushed = false;
if (BI.isWidget(options)) {
pushContext(options);
pushed = true;
} else if (context != null) {
pushContext(context);
pushed = true;
}
var result = _create.apply(this, arguments);
pushed && popContext();
return result;
};
var populate = BI.Loader.prototype.populate;
BI.Loader.prototype.populate = function () {
pushContext(this);
var result = populate.apply(this, arguments);
popContext();
return result;
};
var _init = BI.Widget.prototype._init;
BI.Widget.prototype._init = function () {
var self = this;
var needPop = false;
if (window.Fix && this._store) {
var store = findStore(this.options.element);
if (store) {
pushTarget(store);
needPop = true;
}
this.store = this._store();
needPop && popTarget();
needPop = false;
pushTarget(this.store);
if (this.store instanceof Fix.Model) {
this.model = this.store.model;
} else {
this.model = this.store;
}
needPop = true;
}
_init.apply(this, arguments);
needPop && popTarget();
};
var _render = BI.Widget.prototype._render;
BI.Widget.prototype._render = function () {
var needPop = false;
if (window.Fix && this._store) {
needPop = true;
pushTarget(this.store);
initWatch(this, this.watch);
}
_render.apply(this, arguments);
needPop && popTarget();
};
var unMount = BI.Widget.prototype.__d;
BI.Widget.prototype.__d = function () {
unMount.apply(this, arguments);
this.store && BI.isFunction(this.store.destroy) && this.store.destroy();
BI.each(this._watchers, function (i, unwatches) {
unwatches = BI.isArray(unwatches) ? unwatches : [unwatches];
BI.each(unwatches, function (j, unwatch) {
unwatch();
});
});
this._watchers && (this._watchers = []);
if (this.store) {
this.store._parent && (this.store._parent = null);
this.store = null;
}
delete this.__cacheStore;
};
_.each(["_mount"], function (name) {
var old = BI.Widget.prototype[name];
old && (BI.Widget.prototype[name] = function () {
this.store && pushTarget(this.store);
var res = old.apply(this, arguments);
this.store && popTarget();
return res;
});
});
if (BI.isIE9Below()) {
_.each(["each", "map", "reduce", "reduceRight", "find", "filter", "reject", "every", "all", "some", "any", "max", "min",
"sortBy", "groupBy", "indexBy", "countBy", "partition",
"keys", "allKeys", "values", "pairs", "invert",
"mapObject", "findKey", "pick", "omit", "tap"], function (name) {
var old = BI[name];
BI[name] = function (obj, fn) {
return typeof fn === "function" ? old(obj, function (key, value) {
if (!(key in Fix.$$skipArray)) {
return fn.apply(this, arguments);
}
}) : old.apply(this, arguments);
};
});
BI.isEmpty = function (ob) {
if (BI.isPlainObject(ob) && ob.__ob__) {
return BI.keys(ob).length === 0;
}
return _.isEmpty(ob);
};
BI.keys = function (ob) {
var keys = _.keys(ob);
var nKeys = [];
for (var i = 0; i < keys.length; i++) {
if (!(keys[i] in Fix.$$skipArray)) {
nKeys.push(keys[i]);
}
}
return nKeys;
};
BI.values = function (ob) {
var keys = BI.keys(obj);
var length = keys.length;
var values = [];
for (var i = 0; i < length; i++) {
values[i] = obj[keys[i]];
}
return values;
};
BI.size = function (ob) {
if (BI.isPlainObject(ob) && ob.__ob__) {
return BI.keys(ob).length;
}
return _.size(ob);
};
BI.isEmptyObject = function (ob) {
return BI.size(ob) === 0;
};
}
BI.watch = Fix.watch;
}());(function () {
var Events = { var Events = {
// Bind an event to a `callback` function. Passing `"all"` will bind // Bind an event to a `callback` function. Passing `"all"` will bind

96
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

23
dist/core.js vendored

@ -23241,28 +23241,7 @@ BI.IntegerBufferSet.prototype = {
return array; return array;
} }
}; };
})();window.BI = window.BI || {}; })();_.extend(BI, {
_.extend(BI, {
$defaultImport: function (options, type) {
var config;
if (BI.isObject(options)) {
config = $.extend({
op: "resource",
path: null,
type: null,
must: false
}, options);
config.url = BI.servletURL + "?op=" + config.op + "&resource=" + config.path;
} else {
config = {
url: BI.servletURL + "?op=resource&resource=" + options,
type: arguments[1],
must: arguments[2]
};
}
this.$import(config.url, config.type, config.must);
},
$import: function () { $import: function () {
var _LOADED = {}; // alex:保存加载过的 var _LOADED = {}; // alex:保存加载过的
function loadReady (src, must) { function loadReady (src, must) {

94
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

2
dist/fix/fix.compact.js vendored

@ -93,7 +93,6 @@
return result; return result;
}; };
$(function () {
var populate = BI.Loader.prototype.populate; var populate = BI.Loader.prototype.populate;
BI.Loader.prototype.populate = function () { BI.Loader.prototype.populate = function () {
pushContext(this); pushContext(this);
@ -101,7 +100,6 @@
popContext(); popContext();
return result; return result;
}; };
});
var _init = BI.Widget.prototype._init; var _init = BI.Widget.prototype._init;
BI.Widget.prototype._init = function () { BI.Widget.prototype._init = function () {

5
dist/index.html vendored

@ -25,8 +25,6 @@
<script src="fix/fix-1.0.js"></script> <script src="fix/fix-1.0.js"></script>
<!--fix2.0版本框架, 只用ui的话不用引入, 引入的顺序需在core.js之后--> <!--fix2.0版本框架, 只用ui的话不用引入, 引入的顺序需在core.js之后-->
<script src="fix/fix.js"></script> <script src="fix/fix.js"></script>
<!--fix2.0版本框架, 只用ui的话不用引入, 引入的顺序需在core.js之后-->
<script src="fix/fix.compact.js"></script>
<!--基础js, 包括最基本的控件--> <!--基础js, 包括最基本的控件-->
<script src="base.js"></script> <script src="base.js"></script>
@ -35,6 +33,9 @@
<!--BI控件js--> <!--BI控件js-->
<script src="widget.js"></script> <script src="widget.js"></script>
<!--fix2.0版本框架与fineui结合的代码, 只用ui的话不用引入, 引入的顺序需在fix和控件库(core/base/case/widget)之后之后-->
<script src="fix/fix.compact.js"></script>
<!--工程配置文件,主要是BI.servletURL(根目录)、BI.resourceURL(资源路径)、BI.i18n(国际化)--> <!--工程配置文件,主要是BI.servletURL(根目录)、BI.resourceURL(资源路径)、BI.i18n(国际化)-->
<script src="config.js"></script> <script src="config.js"></script>

21
src/core/utils/load.js

@ -1,25 +1,4 @@
window.BI = window.BI || {};
_.extend(BI, { _.extend(BI, {
$defaultImport: function (options, type) {
var config;
if (BI.isObject(options)) {
config = $.extend({
op: "resource",
path: null,
type: null,
must: false
}, options);
config.url = BI.servletURL + "?op=" + config.op + "&resource=" + config.path;
} else {
config = {
url: BI.servletURL + "?op=resource&resource=" + options,
type: arguments[1],
must: arguments[2]
};
}
this.$import(config.url, config.type, config.must);
},
$import: function () { $import: function () {
var _LOADED = {}; // alex:保存加载过的 var _LOADED = {}; // alex:保存加载过的
function loadReady (src, must) { function loadReady (src, must) {

23
utils/utils.js

@ -14859,28 +14859,7 @@ BI.IntegerBufferSet.prototype = {
return array; return array;
} }
}; };
})();window.BI = window.BI || {}; })();_.extend(BI, {
_.extend(BI, {
$defaultImport: function (options, type) {
var config;
if (BI.isObject(options)) {
config = $.extend({
op: "resource",
path: null,
type: null,
must: false
}, options);
config.url = BI.servletURL + "?op=" + config.op + "&resource=" + config.path;
} else {
config = {
url: BI.servletURL + "?op=resource&resource=" + options,
type: arguments[1],
must: arguments[2]
};
}
this.$import(config.url, config.type, config.must);
},
$import: function () { $import: function () {
var _LOADED = {}; // alex:保存加载过的 var _LOADED = {}; // alex:保存加载过的
function loadReady (src, must) { function loadReady (src, must) {

Loading…
Cancel
Save