提交 5df63f88 编写于 作者: 楼国栋

Merge branch 'cherry-pick-8d406bc4' into 'develop'

[移动办公]移动App在线打包,一些优化和问题修复 develop

See merge request o2oa/o2oa!4240
......@@ -81,7 +81,7 @@
<div class="pack-info-status-box" data-o2-element="apppackStatusShowNode" style="color: #fb4747;">
</div>
<div class="pack-info-status-refresh" data-o2-element="apppackStatusRefreshNode" style="display: none;">刷新状态</div>
<div class="pack-info-status-refresh" data-o2-element="apppackStatusRefreshNode" style="display: none;">{{$.lp.mobile_apppack_refresh_status_btn}}</div>
</div>
......
......@@ -317,26 +317,28 @@ MWF.xApplication.Setting.AppPackOnlineDocument = new Class({
},
// 直接用原有资料重新打包
reSubmitPack: function() {
this.showLoading();
o2.Actions.load("x_program_center").AppPackAction.androidPackReStart(this.token, function (json) {
console.log(json)
this.hiddenLoading();
if (json.data && json.data.value) {
// 提交成功 获取最新打包对象信息
this.loadAppPackInfo();
} else {
this.app.notice(json.message, "error", this.contentAreaNode);
}
}.bind(this), function (error) {
this.hiddenLoading();
console.log(error);
this.app.notice(error, "error", this.contentAreaNode);
this.confirm(this.lp.alert, this.lp.mobile_apppack_message_alert_submit, function() {
this.showLoading();
o2.Actions.load("x_program_center").AppPackAction.androidPackReStart(this.token, function (json) {
console.log(json)
this.hiddenLoading();
if (json.data && json.data.value) {
// 提交成功 获取最新打包对象信息
this.loadAppPackInfo();
} else {
this.app.notice(json.message, "error", this.contentAreaNode);
}
}.bind(this), function (error) {
this.hiddenLoading();
console.log(error);
this.app.notice(error, "error", this.contentAreaNode);
}.bind(this));
}.bind(this));
},
// 提交打包
submitPack: function () {
var appName = this.apppackAppNameInputNode.get("value");
console.log(appName);
if (!appName || appName === "") {
this.app.notice(this.lp.mobile_apppack_message_appname_not_empty, "error", this.contentAreaNode);
return;
......@@ -348,7 +350,6 @@ MWF.xApplication.Setting.AppPackOnlineDocument = new Class({
var files = this.apppackLogoInputNode.files;
if (files.length) {
var file = files.item(0);
console.log(file.name);
var fileExt = file.name.substring(file.name.lastIndexOf("."));
if (fileExt.toLowerCase() !== ".png") {
this.app.notice(this.lp.mobile_apppack_message_app_logo_need_png, "error", this.contentAreaNode);
......@@ -359,7 +360,6 @@ MWF.xApplication.Setting.AppPackOnlineDocument = new Class({
return;
}
var protocol = this.apppackProtocolInputNode.get("value");
console.log(protocol);
if (!protocol || protocol === "") {
this.app.notice(this.lp.mobile_apppack_message_portocol_not_empty, "error", this.contentAreaNode);
return;
......@@ -369,49 +369,83 @@ MWF.xApplication.Setting.AppPackOnlineDocument = new Class({
return;
}
var host = this.apppackHostInputNode.get("value");
console.log(host);
if (!host || host === "") {
this.app.notice(this.lp.mobile_apppack_message_host_not_empty, "error", this.contentAreaNode);
return;
}
var port = this.apppackPortInputNode.get("value");
console.log(port);
if (!port || port === "") {
this.app.notice(this.lp.mobile_apppack_message_port_not_empty, "error", this.contentAreaNode);
return;
}
var context = this.apppackContextInputNode.get("value");
console.log(context);
if (!context || context === "") {
this.app.notice(this.lp.mobile_apppack_message_context_not_empty, "error", this.contentAreaNode);
return;
}
this.showLoading();
var formData = new FormData();
formData.append('file', file);
formData.append('fileName', file.name);
formData.append('appName', appName);
formData.append('o2ServerProtocol', protocol);
formData.append('o2ServerHost', host);
formData.append('o2ServerPort', port);
formData.append('o2ServerContext', context);
formData.append('token', this.token);
this.confirm(this.lp.alert, this.lp.mobile_apppack_message_alert_submit, function() {
this.showLoading();
var formData = new FormData();
formData.append('file', file);
formData.append('fileName', file.name);
formData.append('appName', appName);
formData.append('o2ServerProtocol', protocol);
formData.append('o2ServerHost', host);
formData.append('o2ServerPort', port);
formData.append('o2ServerContext', context);
formData.append('token', this.token);
o2.Actions.load("x_program_center").AppPackAction.androidPackStart(formData, "{}",function (json) {
console.log(json)
this.hiddenLoading();
if (json.data && json.data.value) {
// 提交成功 获取最新打包对象信息
this.loadAppPackInfo();
} else {
this.app.notice(json.message, "error", this.contentAreaNode);
}
}.bind(this), function (error) {
this.hiddenLoading();
console.log(error);
this.app.notice(error, "error", this.contentAreaNode);
}.bind(this));
}.bind(this));
o2.Actions.load("x_program_center").AppPackAction.androidPackStart(formData, "{}",function (json) {
console.log(json)
this.hiddenLoading();
if (json.data && json.data.value) {
// 提交成功 获取最新打包对象信息
this.loadAppPackInfo();
} else {
this.app.notice(json.message, "error", this.contentAreaNode);
}
}.bind(this), function (error) {
this.hiddenLoading();
console.log(error);
this.app.notice(error, "error", this.contentAreaNode);
},
//确认
confirm: function (title, text, okCallback) {
var width = 600;
var height = 110;
var size = this.app.content.getSize();
var x = (size.x - width) / 2;
var y = (size.y - height) / 2;
MWF.require("MWF.xDesktop.Dialog", function () {
var dlg = new MWF.xDesktop.Dialog({
"title": title,
"style": "settingStyle",
"top": y,
"left": x,
"width": width,
"height": height,
"text": text,
"maskNode": this.app.content,
"container": this.app.content,
"buttonList": [
{
"text": this.lp.ok,
"action": function () {
if (okCallback) { okCallback(); }
this.close();
}
},
{
"text": this.lp.cancel,
"action": function () { this.close(); }
}
]
});
dlg.show();
}.bind(this));
}
});
......
......@@ -222,7 +222,7 @@ MWF.xApplication.Setting.LP = {
"mobile_apppack_tips1": "⚠️ Currently, the online packaging function of mobile app only supports Android.",
"mobile_apppack_tips2": "⚠️ If you need to package online, you must register and log in to [云服务配置] .",
"mobile_apppack_tips2": "⚠️ If you need to package online, you must register and log in to [Cloud Setting] .",
"mobile_apppack_tips3": "⚠️ After submitting the information, the current packing status will be displayed. The packing process takes a long time. You can leave the current page first, wait for the packing to complete, and then download the APK file from this page.",
"mobile_apppack_status_label": "current state",
"mobile_apppack_form_appName": "App Name",
......@@ -256,6 +256,8 @@ MWF.xApplication.Setting.LP = {
"mobile_apppack_message_port_not_empty": "Central server port number cannot be empty!",
"mobile_apppack_message_context_not_empty": "Central server context cannot be empty!",
"mobile_apppack_message_portocol_http_https": "HTTP protocol just support http or https !",
"mobile_apppack_refresh_status_btn": "Refresh Status",
"mobile_apppack_message_alert_submit": "Are you sure you want to submit,The current form information will be packaged as a mobile App ?",
"imgSize": "size of the picture:",
"defaultImg": "Default picture",
......
......@@ -216,6 +216,8 @@ MWF.xApplication.Setting.LP = {
"mobile_mpweixin_menu_save_success": "保存数据成功!",
"mobile_mpweixin_menu_delete_alert_msg": "确认要删除这条数据吗,会同时删除它的子菜单?",
"mobile_mpweixin_menu_delete_success": "删除数据成功!",
"save": "保存",
"alert": "提示",
......@@ -255,7 +257,8 @@ MWF.xApplication.Setting.LP = {
"mobile_apppack_message_port_not_empty": "中心服务器端口号不能为空!",
"mobile_apppack_message_context_not_empty": "中心服务器上下文不能为空!",
"mobile_apppack_message_portocol_http_https": "HTTP协议只能是 http 或 https !",
"mobile_apppack_refresh_status_btn": "刷新状态",
"mobile_apppack_message_alert_submit": "确定要提交吗,当前表单信息将被打包成移动端App ?",
"imgSize": "图片尺寸:",
"defaultImg": "默认图片",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册