|
|
|
@ -581,7 +581,7 @@ BI.Text = BI.inherit(BI.Single, {
|
|
|
|
|
setText: function (text) { |
|
|
|
|
BI.Text.superclass.setText.apply(this, arguments); |
|
|
|
|
this.options.text = text; |
|
|
|
|
this.text.element.html((text + "").replaceAll(" ", " ")); |
|
|
|
|
this.text.element.html(BI.Func.formatSpecialCharInHtml(text)); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
@ -2023,13 +2023,13 @@ BI.shortcut("bi.tree_view", BI.TreeView);/**
|
|
|
|
|
*/ |
|
|
|
|
BI.AsyncTree = BI.inherit(BI.TreeView, { |
|
|
|
|
_defaultConfig: function () { |
|
|
|
|
return BI.extend(BI.AsyncTree.superclass._defaultConfig.apply(this, arguments), {}) |
|
|
|
|
return BI.extend(BI.AsyncTree.superclass._defaultConfig.apply(this, arguments), {}); |
|
|
|
|
}, |
|
|
|
|
_init: function () { |
|
|
|
|
BI.AsyncTree.superclass._init.apply(this, arguments); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
//配置属性
|
|
|
|
|
// 配置属性
|
|
|
|
|
_configSetting: function () { |
|
|
|
|
var paras = this.options.paras; |
|
|
|
|
var self = this; |
|
|
|
@ -2066,23 +2066,23 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
|
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
function onClick(event, treeId, treeNode) { |
|
|
|
|
function onClick (event, treeId, treeNode) { |
|
|
|
|
var zTree = $.fn.zTree.getZTreeObj(treeId); |
|
|
|
|
zTree.checkNode(treeNode, !treeNode.checked, true, true); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function beforeCheck(treeId, treeNode) { |
|
|
|
|
function beforeCheck (treeId, treeNode) { |
|
|
|
|
treeNode.halfCheck = false; |
|
|
|
|
if (treeNode.checked === true) { |
|
|
|
|
//将展开的节点halfCheck设为false,解决展开节点存在halfCheck=true的情况 guy
|
|
|
|
|
//所有的半选状态都需要取消halfCheck=true的情况
|
|
|
|
|
function track(children) { |
|
|
|
|
// 将展开的节点halfCheck设为false,解决展开节点存在halfCheck=true的情况 guy
|
|
|
|
|
// 所有的半选状态都需要取消halfCheck=true的情况
|
|
|
|
|
function track (children) { |
|
|
|
|
BI.each(children, function (i, ch) { |
|
|
|
|
if (ch.halfCheck === true) { |
|
|
|
|
ch.halfCheck = false; |
|
|
|
|
track(ch.children); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
track(treeNode.children); |
|
|
|
@ -2091,23 +2091,23 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
|
|
|
|
|
var nodes = treeObj.getSelectedNodes(); |
|
|
|
|
BI.each(nodes, function (index, node) { |
|
|
|
|
node.halfCheck = false; |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function beforeExpand(treeId, treeNode) { |
|
|
|
|
function beforeExpand (treeId, treeNode) { |
|
|
|
|
self._beforeExpandNode(treeId, treeNode); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function onCheck(event, treeId, treeNode) { |
|
|
|
|
function onCheck (event, treeId, treeNode) { |
|
|
|
|
self._selectTreeNode(treeId, treeNode); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function onExpand(event, treeId, treeNode) { |
|
|
|
|
function onExpand (event, treeId, treeNode) { |
|
|
|
|
treeNode.halfCheck = false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function onCollapse(event, treeId, treeNode) { |
|
|
|
|
function onCollapse (event, treeId, treeNode) { |
|
|
|
|
treeNode.halfCheck = false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -2118,7 +2118,7 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
|
|
|
|
|
var self = this, o = this.options; |
|
|
|
|
var parentValues = BI.deepClone(treeNode.parentValues || self._getParentValues(treeNode)); |
|
|
|
|
var name = this._getNodeValue(treeNode); |
|
|
|
|
// var values = parentValues.concat([name]);
|
|
|
|
|
// var values = parentValues.concat([name]);
|
|
|
|
|
if (treeNode.checked === true) { |
|
|
|
|
} else { |
|
|
|
|
var tNode = treeNode; |
|
|
|
@ -2139,7 +2139,7 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
|
|
|
|
|
BI.AsyncTree.superclass._selectTreeNode.apply(self, arguments); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
//展开节点
|
|
|
|
|
// 展开节点
|
|
|
|
|
_beforeExpandNode: function (treeId, treeNode) { |
|
|
|
|
var self = this, o = this.options; |
|
|
|
|
var parentValues = treeNode.parentValues || self._getParentValues(treeNode); |
|
|
|
@ -2157,7 +2157,7 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
|
|
|
|
|
}; |
|
|
|
|
var times = 1; |
|
|
|
|
|
|
|
|
|
function callback(nodes, hasNext) { |
|
|
|
|
function callback (nodes, hasNext) { |
|
|
|
|
self.nodes.addNodes(treeNode, nodes); |
|
|
|
|
|
|
|
|
|
if (hasNext === true) { |
|
|
|
@ -2170,7 +2170,9 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!treeNode.children) { |
|
|
|
|
o.itemsCreator(op, complete) |
|
|
|
|
setTimeout(function () { |
|
|
|
|
o.itemsCreator(op, complete); |
|
|
|
|
}, 17); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
@ -2179,7 +2181,7 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
|
|
|
|
|
var map = {}; |
|
|
|
|
track([], valueA, valueB); |
|
|
|
|
track([], valueB, valueA); |
|
|
|
|
function track(parent, node, compare) { |
|
|
|
|
function track (parent, node, compare) { |
|
|
|
|
BI.each(node, function (n, item) { |
|
|
|
|
if (BI.isNull(compare[n])) { |
|
|
|
|
self._addTreeNode(map, parent, n, item); |
|
|
|
@ -2188,7 +2190,7 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
|
|
|
|
|
} else { |
|
|
|
|
track(parent.concat([n]), node[n], compare[n]); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return map; |
|
|
|
@ -2212,7 +2214,7 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
|
|
|
|
|
return this._join(checkedValues, this.options.paras.selectedValues); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
//生成树方法
|
|
|
|
|
// 生成树方法
|
|
|
|
|
stroke: function (config) { |
|
|
|
|
delete this.options.keyword; |
|
|
|
|
BI.extend(this.options.paras, config); |
|
|
|
@ -3035,18 +3037,20 @@ BI.Combo = BI.inherit(BI.Widget, {
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
self.element.on("mouseleave." + self.getName(), function (e) { |
|
|
|
|
self.popupView.element.on("mouseenter." + self.getName(), function (e) { |
|
|
|
|
enterPopup = true; |
|
|
|
|
self.popupView.element.on("mouseleave." + self.getName(), function (e) { |
|
|
|
|
hide(); |
|
|
|
|
if (self.popupView) { |
|
|
|
|
self.popupView.element.on("mouseenter." + self.getName(), function (e) { |
|
|
|
|
enterPopup = true; |
|
|
|
|
self.popupView.element.on("mouseleave." + self.getName(), function (e) { |
|
|
|
|
hide(); |
|
|
|
|
}); |
|
|
|
|
self.popupView.element.off("mouseenter." + self.getName()); |
|
|
|
|
}); |
|
|
|
|
self.popupView.element.off("mouseenter." + self.getName()); |
|
|
|
|
}); |
|
|
|
|
BI.defer(function () { |
|
|
|
|
if (!enterPopup) { |
|
|
|
|
hide(); |
|
|
|
|
} |
|
|
|
|
}, 50); |
|
|
|
|
BI.defer(function () { |
|
|
|
|
if (!enterPopup) { |
|
|
|
|
hide(); |
|
|
|
|
} |
|
|
|
|
}, 50); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
break; |
|
|
|
|
case "click": |
|
|
|
@ -3092,18 +3096,20 @@ BI.Combo = BI.inherit(BI.Widget, {
|
|
|
|
|
st(e); |
|
|
|
|
}); |
|
|
|
|
self.element.on("mouseleave." + self.getName(), function (e) { |
|
|
|
|
self.popupView.element.on("mouseenter." + self.getName(), function (e) { |
|
|
|
|
enterPopup = true; |
|
|
|
|
self.popupView.element.on("mouseleave." + self.getName(), function (e) { |
|
|
|
|
hide(); |
|
|
|
|
if (self.popupView) { |
|
|
|
|
self.popupView.element.on("mouseenter." + self.getName(), function (e) { |
|
|
|
|
enterPopup = true; |
|
|
|
|
self.popupView.element.on("mouseleave." + self.getName(), function (e) { |
|
|
|
|
hide(); |
|
|
|
|
}); |
|
|
|
|
self.popupView.element.off("mouseenter." + self.getName()); |
|
|
|
|
}); |
|
|
|
|
self.popupView.element.off("mouseenter." + self.getName()); |
|
|
|
|
}); |
|
|
|
|
BI.defer(function () { |
|
|
|
|
if (!enterPopup) { |
|
|
|
|
hide(); |
|
|
|
|
} |
|
|
|
|
}, 50); |
|
|
|
|
BI.defer(function () { |
|
|
|
|
if (!enterPopup) { |
|
|
|
|
hide(); |
|
|
|
|
} |
|
|
|
|
}, 50); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
@ -14357,7 +14363,9 @@ BI.FormulaEditor = BI.inherit(BI.Single, {
|
|
|
|
|
textWrapping: true, |
|
|
|
|
lineWrapping: true, |
|
|
|
|
lineNumbers: false, |
|
|
|
|
mode: 'formula' |
|
|
|
|
mode: 'formula', |
|
|
|
|
//解决插入字段由括号或其他特殊字符包围时分裂的bug
|
|
|
|
|
specialChars: /[\u0000-\u001f\u007f\u00ad\u200c-\u200f\u2028\u2029\ufeff]/ |
|
|
|
|
}); |
|
|
|
|
o.lineHeight === 1 ? this.element.addClass("codemirror-low-line-height") : this.element.addClass("codemirror-high-line-height"); |
|
|
|
|
this.editor.on("change", function (cm, change) { |
|
|
|
@ -14448,7 +14456,8 @@ BI.FormulaEditor = BI.inherit(BI.Single, {
|
|
|
|
|
*/ |
|
|
|
|
insertField: function (field) { |
|
|
|
|
var from = this.editor.getCursor(); |
|
|
|
|
this.editor.replaceSelection(field); |
|
|
|
|
//解决插入字段由括号或其他特殊字符包围时分裂的bug,在两端以不可见字符包裹一下
|
|
|
|
|
this.editor.replaceSelection('\u200b' + field + '\u200b'); |
|
|
|
|
var to = this.editor.getCursor(); |
|
|
|
|
this.editor.markText(from, to, {className: 'fieldName', atomic: true, startStyle: "start", endStyle: "end"}); |
|
|
|
|
this.editor.replaceSelection(" "); |
|
|
|
@ -14499,7 +14508,8 @@ BI.FormulaEditor = BI.inherit(BI.Single, {
|
|
|
|
|
_.forEach(line.markedSpans, function (i, ms) { |
|
|
|
|
switch (i.marker.className) { |
|
|
|
|
case "fieldName": |
|
|
|
|
var dId = fieldMap[value.substr(i.from, i.to - i.from)]; |
|
|
|
|
//因为插入字段的时候首尾加了不可见字符,所以首尾缩进一个字符
|
|
|
|
|
var dId = fieldMap[value.substr(i.from + 1, i.to - i.from - 2)]; |
|
|
|
|
if (!fields.contains(dId)) { |
|
|
|
|
fields.push(dId); |
|
|
|
|
} |
|
|
|
@ -14538,8 +14548,10 @@ BI.FormulaEditor = BI.inherit(BI.Single, {
|
|
|
|
|
switch (i.marker.className) { |
|
|
|
|
case "fieldName": |
|
|
|
|
var fieldNameLength = i.to - i.from; |
|
|
|
|
var fieldId = fieldMap[value.substr(i.from + num, fieldNameLength)]; |
|
|
|
|
value = value.substr(0, i.from + num) + "$\{" + fieldMap[value.substr(i.from + num, fieldNameLength)] + "\}" + value.substr(i.to + num, value.length); |
|
|
|
|
var start = i.from + num + 1; |
|
|
|
|
var end = fieldNameLength - 2; |
|
|
|
|
var fieldId = fieldMap[value.substr(start, end)]; |
|
|
|
|
value = value.substr(0, i.from + num) + "$\{" + fieldId + "\}" + value.substr(i.to + num, value.length); |
|
|
|
|
num += fieldId.length - fieldNameLength + 3; |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
@ -15669,7 +15681,7 @@ BI.ListView = BI.inherit(BI.Widget, {
|
|
|
|
|
if (items && this.options.items !== items) { |
|
|
|
|
this.restore(); |
|
|
|
|
} |
|
|
|
|
this._populate(); |
|
|
|
|
this._populate(items); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
destroyed: function () { |
|
|
|
@ -16181,10 +16193,6 @@ BI.shortcut("bi.a", BI.A);/**
|
|
|
|
|
* @type {*|void|Object} |
|
|
|
|
*/ |
|
|
|
|
BI.LoadingBar = BI.inherit(BI.Single, { |
|
|
|
|
consts: { |
|
|
|
|
loadedText: BI.i18nText("BI-Load_More"), |
|
|
|
|
endText: BI.i18nText("BI-No_More_Data") |
|
|
|
|
}, |
|
|
|
|
_defaultConfig: function() { |
|
|
|
|
var conf = BI.LoadingBar.superclass._defaultConfig.apply(this, arguments); |
|
|
|
|
return BI.extend( conf, { |
|
|
|
@ -16199,7 +16207,7 @@ BI.LoadingBar = BI.inherit(BI.Single, {
|
|
|
|
|
this.loaded = BI.createWidget({ |
|
|
|
|
type: "bi.text_button", |
|
|
|
|
cls: "loading-text bi-list-item-simple", |
|
|
|
|
text: this.consts.loadedText, |
|
|
|
|
text: BI.i18nText("BI-Load_More"), |
|
|
|
|
width: 120, |
|
|
|
|
handler: this.options.handler |
|
|
|
|
}) |
|
|
|
@ -16237,7 +16245,7 @@ BI.LoadingBar = BI.inherit(BI.Single, {
|
|
|
|
|
|
|
|
|
|
_reset: function(){ |
|
|
|
|
this.visible(); |
|
|
|
|
this.loaded.setText(this.consts.loadedText); |
|
|
|
|
this.loaded.setText(BI.i18nText("BI-Load_More")); |
|
|
|
|
this.loaded.enable(); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
@ -16248,7 +16256,7 @@ BI.LoadingBar = BI.inherit(BI.Single, {
|
|
|
|
|
|
|
|
|
|
setEnd: function(){ |
|
|
|
|
this.setLoaded(); |
|
|
|
|
this.loaded.setText(this.consts.endText); |
|
|
|
|
this.loaded.setText(BI.i18nText("BI-No_More_Data")); |
|
|
|
|
this.loaded.disable(); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
@ -18809,7 +18817,7 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
|
|
|
|
|
e.stopPropagation ? e.stopPropagation() : e.cancelBubble = true; |
|
|
|
|
e.preventDefault ? e.preventDefault() : e.returnValue = false; |
|
|
|
|
} |
|
|
|
|
; |
|
|
|
|
|
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
@ -18818,7 +18826,7 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
|
|
|
|
|
var multipart = function (boundary, name, file) { |
|
|
|
|
return "--".concat( |
|
|
|
|
boundary, CRLF, |
|
|
|
|
'Content-Disposition: form-data; name="', name, '"; filename="', BI.cjkEncode(file.fileName), '"', CRLF, |
|
|
|
|
"Content-Disposition: form-data; name=\"", name, "\"; filename=\"", BI.cjkEncode(file.fileName), "\"", CRLF, |
|
|
|
|
"Content-Type: application/octet-stream", CRLF, |
|
|
|
|
CRLF, |
|
|
|
|
file.getAsBinary(), CRLF, |
|
|
|
@ -18844,15 +18852,15 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
|
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
for (var |
|
|
|
|
xhr = new XMLHttpRequest, |
|
|
|
|
upload = xhr.upload || { |
|
|
|
|
addEventListener: function (event, callback) { |
|
|
|
|
this["on" + event] = callback |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
i = 0; |
|
|
|
|
i < length; |
|
|
|
|
i++ |
|
|
|
|
xhr = new XMLHttpRequest, |
|
|
|
|
upload = xhr.upload || { |
|
|
|
|
addEventListener: function (event, callback) { |
|
|
|
|
this["on" + event] = callback; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
i = 0; |
|
|
|
|
i < length; |
|
|
|
|
i++ |
|
|
|
|
) { |
|
|
|
|
upload.addEventListener( |
|
|
|
|
split[i].substring(2), |
|
|
|
@ -18887,7 +18895,7 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
|
|
|
|
|
}, |
|
|
|
|
false |
|
|
|
|
); |
|
|
|
|
xhr.open("post", handler.url + '&filename=' + window.encodeURIComponent(handler.file.fileName), true); |
|
|
|
|
xhr.open("post", handler.url + "&filename=" + window.encodeURIComponent(handler.file.fileName), true); |
|
|
|
|
if (!xhr.upload) { |
|
|
|
|
var rpe = {loaded: 0, total: handler.file.fileSize || handler.file.size, simulation: true}; |
|
|
|
|
rpe.interval = setInterval(function () { |
|
|
|
@ -18907,8 +18915,7 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
|
|
|
|
|
switch (xhr.readyState) { |
|
|
|
|
case 2: |
|
|
|
|
case 3: |
|
|
|
|
if (rpe.total <= rpe.loaded) |
|
|
|
|
rpe.loaded = rpe.total; |
|
|
|
|
if (rpe.total <= rpe.loaded) {rpe.loaded = rpe.total;} |
|
|
|
|
upload.onprogress(rpe); |
|
|
|
|
break; |
|
|
|
|
case 4: |
|
|
|
@ -18920,7 +18927,7 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
|
|
|
|
|
upload["onload"]({}); |
|
|
|
|
var attachO = BI.jsonDecode(xhr.responseText); |
|
|
|
|
attachO.filename = handler.file.fileName; |
|
|
|
|
if (handler.file.type.indexOf('image') != -1) { |
|
|
|
|
if (handler.file.type.indexOf("image") != -1) { |
|
|
|
|
attachO.attach_type = "image"; |
|
|
|
|
} |
|
|
|
|
handler.attach_array.push(attachO); |
|
|
|
@ -18936,7 +18943,7 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
|
|
|
|
|
switch (xhr.readyState) { |
|
|
|
|
case 4: |
|
|
|
|
var attachO = BI.jsonDecode(xhr.responseText); |
|
|
|
|
if (handler.file.type.indexOf('image') != -1) { |
|
|
|
|
if (handler.file.type.indexOf("image") != -1) { |
|
|
|
|
attachO.attach_type = "image"; |
|
|
|
|
} |
|
|
|
|
attachO.filename = handler.file.fileName; |
|
|
|
@ -18948,7 +18955,8 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
|
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
upload.onloadstart(); |
|
|
|
|
} |
|
|
|
|
var boundary = "AjaxUploadBoundary" + (new Date).getTime(); |
|
|
|
|
xhr.setRequestHeader("Content-Type", "multipart/form-data; boundary=" + boundary); |
|
|
|
@ -18956,8 +18964,8 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
|
|
|
|
|
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);
|
|
|
|
|
// xhr.setRequestHeader("X-Name", handler.name);
|
|
|
|
|
// xhr.setRequestHeader("X-File-Name", handler.file.fileName);
|
|
|
|
|
var form = new FormData(); |
|
|
|
|
form.append("FileData", handler.file); |
|
|
|
|
xhr.send(form); |
|
|
|
@ -18971,10 +18979,8 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
|
|
|
|
|
var url = handler.url.concat(-1 === handler.url.indexOf("?") ? "?" : "&", "AjaxUploadFrame=true"), |
|
|
|
|
rpe = { |
|
|
|
|
loaded: 1, total: 100, simulation: true, interval: setInterval(function () { |
|
|
|
|
if (rpe.loaded < rpe.total) |
|
|
|
|
++rpe.loaded; |
|
|
|
|
if (isFunction(handler.onprogress)) |
|
|
|
|
handler.onprogress(rpe, {}); |
|
|
|
|
if (rpe.loaded < rpe.total) {++rpe.loaded;} |
|
|
|
|
if (isFunction(handler.onprogress)) {handler.onprogress(rpe, {});} |
|
|
|
|
}, 100) |
|
|
|
|
}, |
|
|
|
|
onload = function () { |
|
|
|
@ -18982,15 +18988,15 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
|
|
|
|
|
form.parentNode.removeChild(form); |
|
|
|
|
form = null; |
|
|
|
|
clearInterval(rpe.interval); |
|
|
|
|
//rpe.loaded = rpe.total;
|
|
|
|
|
// rpe.loaded = rpe.total;
|
|
|
|
|
try { |
|
|
|
|
var responseText = (iframe.contentWindow.document || iframe.contentWindow.contentDocument).body.innerHTML; |
|
|
|
|
var attachO = BI.jsonDecode(responseText); |
|
|
|
|
if (handler.file.type.indexOf('image') != -1) { |
|
|
|
|
if (handler.file.type.indexOf("image") != -1) { |
|
|
|
|
attachO.attach_type = "image"; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//attachO.fileSize = responseText.length;
|
|
|
|
|
// attachO.fileSize = responseText.length;
|
|
|
|
|
attachO.filename = BI.cjkDecode(handler.file.fileName); |
|
|
|
|
if (handler.maxlength == 1) { |
|
|
|
|
handler.attach_array[0] = attachO; |
|
|
|
@ -18998,18 +19004,16 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
|
|
|
|
|
handler.attach_array.push(attachO); |
|
|
|
|
} |
|
|
|
|
} catch (e) { |
|
|
|
|
if (isFunction(handler.onerror)) |
|
|
|
|
handler.onerror(rpe, event || window.event); |
|
|
|
|
if (isFunction(handler.onerror)) {handler.onerror(rpe, event || window.event);} |
|
|
|
|
} |
|
|
|
|
if (isFunction(handler.onload)) |
|
|
|
|
handler.onload(rpe, {responseText: responseText}); |
|
|
|
|
if (isFunction(handler.onload)) {handler.onload(rpe, {responseText: responseText});} |
|
|
|
|
}, |
|
|
|
|
target = ["AjaxUpload", (new Date).getTime(), String(Math.random()).substring(2)].join("_"); |
|
|
|
|
try { // IE < 8 does not accept enctype attribute ...
|
|
|
|
|
var form = document.createElement('<form enctype="multipart/form-data"></form>'), |
|
|
|
|
iframe = handler.iframe || (handler.iframe = document.createElement('<iframe id="' + target + '" name="' + target + '" src="' + url + '"></iframe>')); |
|
|
|
|
var form = document.createElement("<form enctype=\"multipart/form-data\"></form>"), |
|
|
|
|
iframe = handler.iframe || (handler.iframe = document.createElement("<iframe id=\"" + target + "\" name=\"" + target + "\" src=\"" + url + "\"></iframe>")); |
|
|
|
|
} catch (e) { |
|
|
|
|
var form = document.createElement('form'), |
|
|
|
|
var form = document.createElement("form"), |
|
|
|
|
iframe = handler.iframe || (handler.iframe = document.createElement("iframe")); |
|
|
|
|
form.setAttribute("enctype", "multipart/form-data"); |
|
|
|
|
iframe.setAttribute("name", iframe.id = target); |
|
|
|
@ -19027,9 +19031,8 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
|
|
|
|
|
if (/loaded|complete/i.test(iframe.readyState)) { |
|
|
|
|
onload(); |
|
|
|
|
|
|
|
|
|
//wei : todo,将附件信息放到handler.attach
|
|
|
|
|
} |
|
|
|
|
else if (isFunction(handler.onloadprogress)) { |
|
|
|
|
// wei : todo,将附件信息放到handler.attach
|
|
|
|
|
} else if (isFunction(handler.onloadprogress)) { |
|
|
|
|
if (rpe.loaded < rpe.total) { |
|
|
|
|
++rpe.loaded; |
|
|
|
|
} |
|
|
|
@ -19056,7 +19059,7 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
|
|
|
|
|
appendChild(form); |
|
|
|
|
form.submit(); |
|
|
|
|
} |
|
|
|
|
; |
|
|
|
|
|
|
|
|
|
return handler; |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
@ -19132,9 +19135,9 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
|
|
|
|
|
name: "", |
|
|
|
|
url: "", |
|
|
|
|
multiple: true, |
|
|
|
|
accept: "", /**'*.jpg; *.zip'**/ |
|
|
|
|
maxSize: -1 //1024 * 1024
|
|
|
|
|
}) |
|
|
|
|
accept: "", /** '*.jpg; *.zip'**/ |
|
|
|
|
maxSize: -1 // 1024 * 1024
|
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
_init: function () { |
|
|
|
@ -19144,77 +19147,78 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
|
|
|
|
|
this.element.attr("multiple", "multiple"); |
|
|
|
|
} |
|
|
|
|
this.element.attr("name", o.name || this.getName()); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
BI.nextTick(function () { |
|
|
|
|
// create the noswfupload.wrap Object
|
|
|
|
|
// wrap.maxSize 文件大小限制
|
|
|
|
|
// wrap.maxlength 文件个数限制
|
|
|
|
|
var _wrap = self.wrap = self._wrap(self.element[0], o.maxSize); |
|
|
|
|
// fileType could contain whatever text but filter checks *.{extension}
|
|
|
|
|
// if present
|
|
|
|
|
|
|
|
|
|
// handlers
|
|
|
|
|
|
|
|
|
|
_wrap.onloadstart = function (rpe, xhr) { |
|
|
|
|
//BI.Msg.toast("loadstart");
|
|
|
|
|
self.fireEvent(BI.File.EVENT_UPLOADSTART); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
_wrap.onprogress = function (rpe, xhr) { |
|
|
|
|
//BI.Msg.toast("onprogress");
|
|
|
|
|
// percent for each bar
|
|
|
|
|
mounted: function () { |
|
|
|
|
var self = this, o = this.options; |
|
|
|
|
// create the noswfupload.wrap Object
|
|
|
|
|
// wrap.maxSize 文件大小限制
|
|
|
|
|
// wrap.maxlength 文件个数限制
|
|
|
|
|
var _wrap = this.wrap = this._wrap(this.element[0], o.maxSize); |
|
|
|
|
// fileType could contain whatever text but filter checks *.{extension}
|
|
|
|
|
// if present
|
|
|
|
|
|
|
|
|
|
// handlers
|
|
|
|
|
|
|
|
|
|
_wrap.onloadstart = function (rpe, xhr) { |
|
|
|
|
// BI.Msg.toast("loadstart");
|
|
|
|
|
self.fireEvent(BI.File.EVENT_UPLOADSTART, arguments); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
// fileSize is -1 only if browser does not support file info access
|
|
|
|
|
// this if splits recent browsers from others
|
|
|
|
|
if (this.file.fileSize !== -1) { |
|
|
|
|
// simulation property indicates when the progress event is fake
|
|
|
|
|
if (rpe.simulation) { |
|
|
|
|
_wrap.onprogress = function (rpe, xhr) { |
|
|
|
|
// BI.Msg.toast("onprogress");
|
|
|
|
|
// percent for each bar
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
// fileSize is -1 only if browser does not support file info access
|
|
|
|
|
// this if splits recent browsers from others
|
|
|
|
|
if (this.file.fileSize !== -1) { |
|
|
|
|
// simulation property indicates when the progress event is fake
|
|
|
|
|
if (rpe.simulation) { |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
// if fileSIze is -1 browser is using an iframe because it does
|
|
|
|
|
// not support
|
|
|
|
|
// files sent via Ajax (XMLHttpRequest)
|
|
|
|
|
// We can still show some information
|
|
|
|
|
} |
|
|
|
|
self.fireEvent(BI.File.EVENT_PROGRESS, { |
|
|
|
|
file: this.file, |
|
|
|
|
total: rpe.total, |
|
|
|
|
loaded: rpe.loaded, |
|
|
|
|
simulation: rpe.simulation |
|
|
|
|
}); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
// generated if there is something wrong during upload
|
|
|
|
|
_wrap.onerror = function () { |
|
|
|
|
// just inform the user something was wrong
|
|
|
|
|
self.fireEvent(BI.File.EVENT_ERROR); |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
// if fileSIze is -1 browser is using an iframe because it does
|
|
|
|
|
// not support
|
|
|
|
|
// files sent via Ajax (XMLHttpRequest)
|
|
|
|
|
// We can still show some information
|
|
|
|
|
} |
|
|
|
|
self.fireEvent(BI.File.EVENT_PROGRESS, { |
|
|
|
|
file: this.file, |
|
|
|
|
total: rpe.total, |
|
|
|
|
loaded: rpe.loaded, |
|
|
|
|
simulation: rpe.simulation |
|
|
|
|
}); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
// generated when every file has been sent (one or more, it does not
|
|
|
|
|
// matter)
|
|
|
|
|
_wrap.onload = function (rpe, xhr) { |
|
|
|
|
var self_ = this; |
|
|
|
|
// just show everything is fine ...
|
|
|
|
|
// ... and after a second reset the component
|
|
|
|
|
setTimeout(function () { |
|
|
|
|
self_.clean(); // remove files from list
|
|
|
|
|
self_.hide(); // hide progress bars and enable input file
|
|
|
|
|
// generated if there is something wrong during upload
|
|
|
|
|
_wrap.onerror = function () { |
|
|
|
|
// just inform the user something was wrong
|
|
|
|
|
self.fireEvent(BI.File.EVENT_ERROR); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
//BI.Msg.toast("onload");
|
|
|
|
|
self.fireEvent(BI.File.EVENT_UPLOADED); |
|
|
|
|
// enable again the submit button/element
|
|
|
|
|
}, 1000); |
|
|
|
|
}; |
|
|
|
|
_wrap.url = o.url ? o.url : BI.servletURL |
|
|
|
|
+ '?op=fr_attach&cmd=ah_upload'; |
|
|
|
|
_wrap.fileType = o.accept; //文件类型限制
|
|
|
|
|
_wrap.attach_array = []; |
|
|
|
|
_wrap.attach_names = []; |
|
|
|
|
_wrap.attachNum = 0; |
|
|
|
|
}); |
|
|
|
|
// generated when every file has been sent (one or more, it does not
|
|
|
|
|
// matter)
|
|
|
|
|
_wrap.onload = function (rpe, xhr) { |
|
|
|
|
var self_ = this; |
|
|
|
|
// just show everything is fine ...
|
|
|
|
|
// ... and after a second reset the component
|
|
|
|
|
setTimeout(function () { |
|
|
|
|
self_.clean(); // remove files from list
|
|
|
|
|
self_.hide(); // hide progress bars and enable input file
|
|
|
|
|
|
|
|
|
|
// BI.Msg.toast("onload");
|
|
|
|
|
self.fireEvent(BI.File.EVENT_UPLOADED); |
|
|
|
|
// enable again the submit button/element
|
|
|
|
|
}, 1000); |
|
|
|
|
}; |
|
|
|
|
_wrap.url = o.url ? o.url : BI.servletURL |
|
|
|
|
+ "?op=fr_attach&cmd=ah_upload"; |
|
|
|
|
_wrap.fileType = o.accept; // 文件类型限制
|
|
|
|
|
_wrap.attach_array = []; |
|
|
|
|
_wrap.attach_names = []; |
|
|
|
|
_wrap.attachNum = 0; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
_events: function (wrap) { |
|
|
|
@ -19228,14 +19232,14 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
|
|
|
|
|
ext = -1 !== value.indexOf(".") ? value.split(".").pop().toLowerCase() : "unknown", |
|
|
|
|
size = item.fileSize || item.size; |
|
|
|
|
if (wrap.fileType && -1 === wrap.fileType.indexOf("*." + ext)) { |
|
|
|
|
//文件类型不支持
|
|
|
|
|
// 文件类型不支持
|
|
|
|
|
BI.Msg.toast(BI.i18nText("BI-Upload_File_Type_Error")); |
|
|
|
|
self.fireEvent(BI.File.EVENT_ERROR, { |
|
|
|
|
errorType: 0, |
|
|
|
|
file: item |
|
|
|
|
}); |
|
|
|
|
} else if (wrap.maxSize !== -1 && size && wrap.maxSize < size) { |
|
|
|
|
//文件大小不支持
|
|
|
|
|
// 文件大小不支持
|
|
|
|
|
BI.Msg.toast(BI.i18nText("BI-Upload_File_Size_Error")); |
|
|
|
|
self.fireEvent(BI.File.EVENT_ERROR, { |
|
|
|
|
errorType: 1, |
|
|
|
@ -19243,7 +19247,7 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
|
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
wrap.files.unshift(item); |
|
|
|
|
//BI.Msg.toast(value);
|
|
|
|
|
// BI.Msg.toast(value);
|
|
|
|
|
self.fireEvent(BI.File.EVENT_CHANGE, { |
|
|
|
|
file: item |
|
|
|
|
}); |
|
|
|
@ -19275,7 +19279,7 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
|
|
|
|
|
disabled: false // internal use, checks input file state
|
|
|
|
|
}, |
|
|
|
|
name: input.name, // name to send for each file ($_FILES[{name}] in the server)
|
|
|
|
|
// maxSize is the maximum amount of bytes for each file
|
|
|
|
|
// maxSize is the maximum amount of bytes for each file
|
|
|
|
|
maxSize: o.maxSize ? o.maxSize >> 0 : -1, |
|
|
|
|
files: [], // file list
|
|
|
|
|
|
|
|
|
@ -30511,6 +30515,11 @@ BI.QuickGridTable = BI.inherit(BI.GridTable, {
|
|
|
|
|
this.bottomRightGrid.setEstimatedColumnSize((o.columnSize.length - freezeColLength) > 0 ? (totalRightColumnSize / (o.columnSize.length - freezeColLength)) : 0); |
|
|
|
|
this.bottomRightGrid.setEstimatedRowSize(o.rowSize); |
|
|
|
|
|
|
|
|
|
this.topLeftGrid.setColumnCount(freezeColLength); |
|
|
|
|
this.topRightGrid.setColumnCount(o.columnSize.length - freezeColLength); |
|
|
|
|
this.bottomLeftGrid.setColumnCount(freezeColLength); |
|
|
|
|
this.bottomRightGrid.setColumnCount(o.columnSize.length - freezeColLength); |
|
|
|
|
|
|
|
|
|
var items = this.contextLayout.attr("items"); |
|
|
|
|
items[1].left = regionSize; |
|
|
|
|
items[2].top = this._getFreezeHeaderHeight(); |
|
|
|
|