|
|
|
FR.OssForm = FR.extend(FR.Form, {
|
|
|
|
/**
|
|
|
|
* 上传到OSS服务器
|
|
|
|
*/
|
|
|
|
ossCommit: function (o, target) {
|
|
|
|
var self = this;
|
|
|
|
if (_g().saveReport) {
|
|
|
|
_g().saveReport((function () {
|
|
|
|
this.formSubmit({
|
|
|
|
url: FR.fineServletURL + "/url/oss/upload",
|
|
|
|
data: {
|
|
|
|
cmd: o.cmd,
|
|
|
|
location: target
|
|
|
|
? target.options.location
|
|
|
|
: null,
|
|
|
|
sheetNum: _g().selectedIndex,
|
|
|
|
xmlconf: o.xmlconf,
|
|
|
|
sessionID: _g().currentSessionID || _g().sessionID
|
|
|
|
},
|
|
|
|
callback: function (res) {
|
|
|
|
self.showResult(res);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}).createDelegate(this));
|
|
|
|
} else {
|
|
|
|
this.formSubmit({
|
|
|
|
url: FR.fineServletURL + "/url/oss/upload",
|
|
|
|
data: {
|
|
|
|
xmlconf: o.xmlconf,
|
|
|
|
cmd: o.cmd,
|
|
|
|
sessionID: _g().currentSessionID || _g().sessionID
|
|
|
|
|
|
|
|
},
|
|
|
|
callback: function (res) {
|
|
|
|
self.showResult(res);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
showResult: function (res) {
|
|
|
|
var submitInfo;
|
|
|
|
var json_array = FR.jsonDecode(res.responseText);
|
|
|
|
if (json_array.length > 0) {
|
|
|
|
$.each(json_array, function (idx, item) {
|
|
|
|
if (item.oss_submit_info) {
|
|
|
|
submitInfo = item.oss_submit_info;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
var success = submitInfo.success;
|
|
|
|
if (success !== true && success !== false) {
|
|
|
|
FR.Msg.toast(FR.i18nText("Fine-Engine_Report") + FR.i18nText("Fine-Engine_Report_Write_Attributes_Msg"));
|
|
|
|
} else if (success === true) {
|
|
|
|
FR.Msg.toast(FR.i18nText("Fine-Engine_Report_Successfully"));
|
|
|
|
} else if (success === false) {
|
|
|
|
FR.Msg.toast(FR.i18nText("Fine-Engine_Failed") + ":" + submitInfo.errorMsg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
$.extend(FR, {
|
|
|
|
|
|
|
|
doHyperlinkByOssDownload: function (data) {
|
|
|
|
this.ajax({
|
|
|
|
url: FR.fineServletURL + "/url/oss/download",
|
|
|
|
async: true,
|
|
|
|
type: 'post',
|
|
|
|
data : {
|
|
|
|
sessionID: FR.SessionMgr.getSessionID(),
|
|
|
|
bucket : data.bucket,
|
|
|
|
directory : data.directory,
|
|
|
|
fileName : data.fileName
|
|
|
|
},
|
|
|
|
complete: function (res, status) {
|
|
|
|
window.open(res.responseText);
|
|
|
|
}.createDelegate(this)
|
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|