提交 5cc15a9a 编写于 作者: NoSubject's avatar NoSubject

Merge branch 'wrdp' into 'develop'

Wrdp

See merge request o2oa/o2oa!3491
......@@ -65,7 +65,7 @@ if (!window.Promise){
var _href = window.location.href;
var _debug = (_href.indexOf("debugger")!==-1);
var _par = _href.substr(_href.lastIndexOf("?")+1, _href.length);
var _lp = "zh-cn";
var _lp = navigator.language || "zh-cn";
if (_par){
var _parList = _par.split("&");
for (var i=0; i<_parList.length; i++){
......@@ -85,6 +85,11 @@ if (!window.Promise){
"isDebugger": _debug,
"path": "../o2_core/o2"
};
this.o2.languageName = _lp;
_lp = _lp.toLocaleLowerCase();
var supportedLanguages = ["zh-CN", "en"];
if (supportedLanguages.indexOf(_lp)==-1) _lp = "zh-cn";
this.o2.language = _lp;
this.o2.splitStr = /\s*(?:,|;)\s*/;
......@@ -1486,6 +1491,8 @@ if (!window.Promise){
res.setHeader("Content-Type", "application/json; charset=utf-8");
res.setHeader("Accept", "text/html,application/json,*/*");
res.setHeader("Accept-Language", o2.languageName);
if (window.layout) {
if (layout["debugger"]){
res.setHeader("x-debugger", "true");
......
......@@ -140,6 +140,7 @@ o2.LP.desktop = {
"showMessage": "消息",
"logout": "注销",
"userConfig": "个人设置",
"userLanguage": "语言设置",
"application": "组件",
"widget": "小工具",
"process": "应用",
......
......@@ -28,26 +28,27 @@
"pot": "pptx_win.png",
"potx": "pptx_win.png",
"potm": "pptx_win.png",
"css": "css.png",
"mp3": "mp3.png",
"wav": "wav.png",
"wma": "wma.png",
"wmv": "wmv.png",
"bmp": "bmp.png",
"gif": "gif.png",
"png": "png.png",
"psd": "psd.png",
"jpeg": "jpeg.png",
"jpg": "jpeg.png",
"pdf": "pdf.png",
"rar": "rar.png",
"txt": "text.png",
"zip": "zip.png",
"exe": "exe.png",
"ofd": "ofd.png",
"unknow": "unknow.png"
}
\ No newline at end of file
}
......@@ -524,6 +524,13 @@ o2.xDesktop.Default = new Class({
var img = this.path+this.options.style+"/icons/config.png";
this.userMenu.addMenuItem(o2.LP.desktop.userConfig, "click", function(e){this.userConfig(e);}.bind(this), img);
// var lpMenu = new o2.xDesktop.Menu(this.userInforNode, {
// "event": "click", "style": "flatUser", "offsetX": 30, "offsetY":6, "container": this.node
// });
//
// img = this.path+"/lp/zh-cn.png";
// var lp = this.userMenu.addMenuMenu(o2.LP.desktop.userLanguage, "click", function(e){this.userConfig(e);}.bind(this), img);
this.userMenu.addMenuLine();
img = this.path+this.options.style+"/icons/logout.png";
......
!function(e){"object"==typeof exports?module.exports=e():"function"==typeof define&&define.amd?define(e):"undefined"!=typeof window?window.JSZipUtils=e():"undefined"!=typeof global?global.JSZipUtils=e():"undefined"!=typeof self&&(self.JSZipUtils=e())}(function(){var define,module,exports;return(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a){return a(o,!0)}if(i){return i(o,!0)}throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++){s(r[o])}return s})({1:[function(require,module,exports){var JSZipUtils={};JSZipUtils._getBinaryFromXHR=function(xhr){return xhr.response||xhr.responseText};function createStandardXHR(){try{return new window.XMLHttpRequest()}catch(e){}}function createActiveXHR(){try{return new window.ActiveXObject("Microsoft.XMLHTTP")}catch(e){}}var createXHR=(typeof window!=="undefined"&&window.ActiveXObject)?function(){return createStandardXHR()||createActiveXHR()}:createStandardXHR;JSZipUtils.getBinaryContent=function(path,options){var promise,resolve,reject;var callback;if(!options){options={}}if(typeof options==="function"){callback=options;options={}}else{if(typeof options.callback==="function"){callback=options.callback}}if(!callback&&typeof Promise!=="undefined"){promise=new Promise(function(_resolve,_reject){resolve=_resolve;reject=_reject})}else{resolve=function(data){callback(null,data)};reject=function(err){callback(err,null)}}try{var xhr=createXHR();xhr.open("GET",path,true);if("responseType" in xhr){xhr.responseType="arraybuffer"}if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.onreadystatechange=function(event){if(xhr.readyState===4){if(xhr.status===200||xhr.status===0){try{resolve(JSZipUtils._getBinaryFromXHR(xhr))}catch(err){reject(new Error(err))}}else{reject(new Error("Ajax error for "+path+" : "+this.status+" "+this.statusText))}}};if(options.progress){xhr.onprogress=function(e){options.progress({path:path,originalEvent:e,percent:e.loaded/e.total*100,loaded:e.loaded,total:e.total})}}xhr.withCredentials=true;xhr.send()}catch(e){reject(new Error(e),null)}return promise};module.exports=JSZipUtils},{}]},{},[1])(1)});
此差异已折叠。
此差异已折叠。
......@@ -4,7 +4,7 @@
"jsp": "url.png",
"asp": "url.png",
"js": "url.png",
"avi": "avi.png",
"mkv": "avi.png",
"mov": "avi.png",
......@@ -20,21 +20,21 @@
"docx": "docx_win.png",
"dotx": "docx_win.png",
"dot": "docx_win.png",
"vsd": "vsd.png",
"xls": "xlsx_win.png",
"xlsx": "xlsx_win.png",
"xlsm": "xlsx_win.png",
"xlt": "xlsx_win.png",
"xltx": "xlsx_win.png",
"pptx": "pptx_win.png",
"ppt": "pptx_win.png",
"pot": "pptx_win.png",
"potx": "pptx_win.png",
"potm": "pptx_win.png",
"css": "css.png",
"mp3": "mp3.png",
"wav": "wav.png",
......@@ -49,13 +49,14 @@
"jpg": "jpeg.png",
"jpe": "jpeg.png",
"ico": "jpeg.png",
"pdf": "pdf.png",
"rar": "rar.png",
"txt": "text.png",
"zip": "zip.png",
"exe": "exe.png",
"ofd": "ofd.png",
"unknow": "unknow.png"
}
\ No newline at end of file
}
......@@ -67,7 +67,7 @@
}
.o2_profile_inforIconChange {
margin: 22px 10px;
margin: 16px 10px;
cursor: pointer;
float: left;
border: 1px solid #999;
......
......@@ -61,29 +61,29 @@
float: left;
}
.o2_profile_inforIconContent {
width: 100px;
height: 100px;
width: 80px;
height: 80px;
margin: auto;
}
.o2_profile_inforIconContentImg {
border: 0px;
width: 100px;
height: 100px;
width: 80px;
height: 80px;
border-radius: 166.67px;
}
.o2_profile_inforIconChange {
cursor: pointer;
margin: 22px auto;
margin: 16px auto;
width: 90px;
height: 36px;
height: 30px;
border: 1px solid #4A90E2;
border-radius: 100px;
font-family: MicrosoftYaHei;
font-size: 14px;
color: #4A90E2;
line-height: 36px;
line-height: 30px;
text-align: center;
}
.o2_profile_inforContent {
......@@ -110,18 +110,24 @@
.o2_profile_inforContentInput {
background-color: #FFF;
background: #FFFFFF;
border: 1px solid #DEDEDE;
border-radius: 100px;
width:77%;
min-width: 300px;
height: 32px;
font-family: MicrosoftYaHei;
font-size: 14px;
color: #666666;
padding: 0 0 0 8px;
outline:none;
}
.o2_profile_inforContentSelect {
border: 1px solid #DEDEDE;
border-radius: 100px;
height: 32px;
font-size: 14px;
color: #666666;
padding: 0 0 0 8px;
}
.o2_profile_signature{
......
......@@ -67,6 +67,12 @@
<input class="o2_profile_inforContentInput" value="{{$.data.ipAddress}}" placeholder="{{$.lp.ipAddressPlaceHolder}}"/>
</div>
</div>
<div class="o2_profile_inforLine">
<div class="o2_profile_inforTitle">{{ $.lp.language }}</div>
<div class="o2_profile_inforContent">
<input class="o2_profile_inforContentInput" value="{{$.data.ipAddress}}" placeholder="{{$.lp.ipAddressPlaceHolder}}"/>
</div>
</div>
<div class="o2_profile_inforLine">
<div class="o2_profile_saveInforAction">{{ $.lp.saveInfor }}</div>
......
......@@ -68,6 +68,15 @@
</div>
</div>
<div class="o2_profile_inforLine">
<div class="o2_profile_inforTitle">{{ $.lp.language }}</div>
<div class="o2_profile_inforContent">
<select class="o2_profile_inforContentSelect">
<option>简体中文</option>
</select>
</div>
</div>
<div class="o2_profile_inforLine">
<div class="o2_profile_saveInforAction">{{ $.lp.saveInfor }}</div>
</div>
......
......@@ -71,7 +71,7 @@ MWF.xApplication.Profile.Main = new Class({
this.getSiblings().map(function(otabNode) {
otabNode.getChildren().removeClass("mainColor_color");
})
});
}.bind(tabNode));
}.bind(this));
......@@ -131,6 +131,14 @@ MWF.xApplication.Profile.Main = new Class({
this.removeClass("mainColor_border mainColor_color");
});
this.languageSelectNode = this.tab.pages[0].contentNode.getElement("select");
this.languageSelectNode.empty();
if (!this.personData.language) this.personData.language = "zh-cn";
Object.keys(this.lp.lps).each(function(key){
var option = new Element("option", {"value": key, "text": this.lp.lps[key]}).inject(this.languageSelectNode);
if (this.personData.language === key) option.set("selected", true);
}.bind(this));
this.content.getElement(".o2_profile_saveInforAction").addEvent("click", function(){
this.savePersonInfor();
}.bind(this));
......@@ -840,6 +848,8 @@ MWF.xApplication.Profile.Main = new Class({
this.personData.qq = this.qqInputNode.get("value");
this.personData.ipAddress = this.ipAddressInputNode.get("value");
this.personData.signature = this.signatureInputNode.get("value");
this.personData.language = this.languageSelectNode.options[this.languageSelectNode.selectedIndex].value;
this.action.updatePerson(this.personData, function(){
this.notice(this.lp.saveInforOk, "success");
}.bind(this));
......
......@@ -4,101 +4,107 @@ MWF.xApplication.Profile.LP = {
"layoutConfig": "UI",
"ideaConfig": "Opinion",
"passwordConfig": "Password",
"facelogin": "Face Login",
"openFaceSet": "Open FaceSet",
"ssoConfig": "SSO",
"facelogin": "FaceLogin",
"openFaceSet": "click here, Open FaceSet",
"clear": "清除界面数据",
"setDefault": "设置为默认界面",
"clearDefault": "清除默认界面",
"setForce": "设置强制打开应用",
"clearForce": "清除强制打开应用",
"setDefaultOk": "已设置为默认界面",
"setForceOk": "已设置强制打开应用",
"clearok": "桌面缓存记录已清除",
"saveIdea": "保存常用意见",
"saveIdeaDefault": "保存为默认常用意见",
"ideaSaveOk": "常用意见保存完成",
"clear": "Clear ui config data",
"setDefault": "Set as the default ui config",
"clearDefault": "Clear default ui config data",
"setForce": "Set force to open the application",
"clearForce": "Clear forced open application",
"setDefaultOk": "The default ui config has been set",
"setForceOk": "Forced to open the app has been set",
"clearok": "Desktop cache record has been cleared",
"saveIdea": "Save frequently opinions",
"saveIdeaDefault": "Save as default opinions",
"ideaSaveOk": "Frequently opinions saved",
"icon": "头像",
"changeIcon": "更换头像",
"name": "姓名",
"employee": "工号",
"display": "昵称",
"officePhone": "办公电话",
"mail": "邮件地址",
"mobile": "手机号码",
"weixin": "微信号",
"icon": "Avatar",
"changeIcon": "Change",
"name": "Name",
"employee": "Employee",
"display": "Nickname",
"officePhone": "OfficePhone",
"mail": "Mail",
"mobile": "Cellphone",
"weixin": "Wechat",
"QQ": "QQ",
"signature": "个人签名",
"saveInfor": "保存个人信息",
"saveInforOk": "保存个人信息成功",
"ipAddress" : "登录IP",
"ipAddressPlaceHolder" : "如果不为空,匹配的ip地址才能登录该账号,用“,”分隔多值",
"ipAddressIncorrectNotice" : "IP地址格式不正确:",
"signature": "Signature",
"saveInfor": "Save personal information",
"saveInforOk": "Personal information saved successfully",
"ipAddress" : "Login IP",
"ipAddressPlaceHolder" : "If it is not empty, only the matching ip address can log in to the account. Separate multiple values with \",\"",
"ipAddressIncorrectNotice" : "IP address format is incorrect:",
"language": "Language",
"lps": {
"zh-CN": "简体中文",
"en": "English(US)"
},
"passwordRule" : "密码规则",
"oldPassword": "原密码",
"password": "新密码",
"morePassword": "确认密码",
"passwordNotMatch": "新密码与确认密码不一致",
"changePasswordOk": "密码修改成功",
"passwordRule" : "Password rules",
"oldPassword": "Old password",
"password": "New password",
"morePassword": "Confirm password",
"passwordNotMatch": "The new password does not match the confirmed password",
"changePasswordOk": "Password reset complete",
"changePersonIcon": "修改个人头像",
"changePersonIcon": "Change Avatar",
"layoutAction": "界面操作",
"desktopBackground": "桌面背景",
"paswordRule" : "6位以上,包含数字和字母.",
"weak" : "",
"middle" : "",
"high" : "",
"layoutAction": "UI operation",
"desktopBackground": "Desktop background",
"paswordRule" : "6 or more digits, including numbers and letters.",
"weak" : "weak",
"middle" : "middle",
"high" : "high",
"empower":{
"fromPerson":"人员",
"fromIdentity":"身份",
"toPerson":"委托人员",
"toIdentity":"委托身份",
"application":"应用",
"applicationName":"应用名称",
"applicationAlias":"应用别名",
"process":"流程ID",
"processName":"流程名称",
"processAlias":"流程别名",
"type":"授权类型",
"startTime":"授权开始时间",
"completedTime":"授权结束时间",
"emPowerConfig": "外出授权",
"addEmPower": "新增",
"myEmPower": "我的委托",
"receiveEmPower": "收到的委托",
"ok":"保存",
"cancel":"关闭",
"noData":"暂时没有委托",
"withdraw":"撤回",
"alert1":"请选择流程或应用",
"alert2":"请联系管理员添加身份信息!",
"withdrawOk":"撤回委托成功",
"selectEmPower":"请选择委托",
"saveOk":"保存成功",
"type_all":"全部",
"type_application":"应用",
"type_process":"流程",
"type_filter":"文件类型",
"saveNotAll":"部分保存失败",
"title":"标题",
"activityName":"状态",
"createTime":"委托时间",
"edit":"编辑",
"editEmpower":"编辑外出授权",
"enable":"启用",
"disable":"禁用"
"fromPerson":"Person",
"fromIdentity":"Identity",
"toPerson":"EmpoweredPerson",
"toIdentity":"EmpoweredIdentity",
"application":"Application",
"applicationName":"Application Name",
"applicationAlias":"Application Alias",
"process":"Process",
"processName":"Process Name",
"processAlias":"Process Alias",
"type":"Type",
"startTime":"Start Time",
"completedTime":"Completed Time",
"emPowerConfig": "Empowerment",
"addEmPower": "create",
"myEmPower": "My Empowerment",
"receiveEmPower": "Empowered to me",
"ok":"Save",
"cancel":"Cancel",
"noData":"No Empowerment",
"withdraw":"Withdraw",
"alert1":"Please select a process or application",
"alert2":"Please contact the administrator to add identity information!",
"withdrawOk":"Withdraw the empowerment successfully",
"selectEmPower":"Select the empowerment",
"saveOk":"Saved successfully",
"type_all":"All",
"type_application":"Application",
"type_process":"Process",
"type_filter":"File type",
"saveNotAll":"Partial save failed",
"title":"Title",
"activityName":"Activity",
"createTime":"Commission time",
"edit":"Edit",
"editEmpower":"Edit empowerment",
"enable":"Enable",
"disable":"Disable"
},
"emPowerConfig": "外出授权",
"addEmPower": "新增",
"myEmPower": "我的委托",
"receiveEmPower": "收到的委托",
"myEmPowerLog": "委托的待办",
"receiveEmPowerLog": "收到的待办",
"ok":"保存",
"cancel":"关闭"
"emPowerConfig": "Empower",
"addEmPower": "create",
"myEmPower": "My Empowerment",
"receiveEmPower": "Empowered to me",
"myEmPowerLog": "Empowered Task",
"receiveEmPowerLog": "Empowered Task received",
"ok":"Save",
"cancel":"Cancel"
};
......@@ -6,7 +6,7 @@ MWF.xApplication.Profile.LP = {
"passwordConfig": "修改密码",
"ssoConfig": "单点登录",
"facelogin": "人脸登录",
"openFaceSet": "打开人脸登录设置",
"openFaceSet": "点击此处,打开人脸登录设置",
"clear": "清除界面数据",
"setDefault": "设置为默认界面",
......@@ -36,6 +36,11 @@ MWF.xApplication.Profile.LP = {
"ipAddress" : "登录IP",
"ipAddressPlaceHolder" : "如果不为空,匹配的ip地址才能登录,用,分隔多值",
"ipAddressIncorrectNotice" : "IP地址格式不正确:",
"language": "语言设置",
"lps": {
"zh-CN": "简体中文",
"en": "English"
},
"passwordRule" : "密码规则",
"oldPassword": "原密码",
......
......@@ -33,7 +33,7 @@
// "sub": []
// },
{
"title": "数据配置",
"title": MWF.xApplication.process.ProcessManager.LP.dataConfig,
"id": "1.1",
"action": "dataConfig",
"icon": "process_data.png",
......@@ -41,7 +41,7 @@
"sub": []
},
{
"title": "脚本配置",
"title": MWF.xApplication.process.ProcessManager.LP.scriptConfig,
"id": "1.1",
"action": "scriptConfig",
"icon": "process_script.png",
......@@ -49,7 +49,7 @@
"sub": []
},
{
"title": "资源文件",
"title": MWF.xApplication.process.ProcessManager.LP.fileConfig,
"id": "1.1",
"action": "fileConfig",
"icon": "process_file.png",
......@@ -65,7 +65,7 @@
// "sub": []
// },
{
"title": "应用属性",
"title": MWF.xApplication.process.ProcessManager.LP.applicationConfig,
"id": "1.1",
"action": "applicationProperty",
"icon": "process_property.png",
......
......@@ -17,6 +17,13 @@ MWF.xApplication.process.ProcessManager.LP = {
"copyConfirm_cancel": "Cancel",
"copynew": "New",
"formConfig": "Form",
"processConfig": "Process",
"dataConfig": "Data",
"scriptConfig": "Script",
"fileConfig": "Resource",
"applicationConfig": "Attributes",
"findDesigner": "FindCode",
"ok": "OK",
......
......@@ -18,11 +18,11 @@ MWF.xApplication.process.ProcessManager.LP = {
"copynew": "",
"formConfig": "表单配置",
// "formConfig": "",
// "formConfig": "",
// "formConfig": "",
// "formConfig": "",
// "formConfig": "",
"processConfig": "流程配置",
"dataConfig": "数据配置",
"scriptConfig": "脚本配置",
"fileConfig": "资源文件",
"applicationConfig": "应用属性",
"findDesigner": "查找设计",
......
......@@ -1441,7 +1441,7 @@ MWF.xApplication.process.Xform.Attachment = MWF.APPAttachment = new Class(
}, null, null, this.form.json.confirmStyle);
},
previewAttachment: function (attachments) {
var att = attachments[0].data;
var att = attachments[0];
new MWF.xApplication.process.Xform.AttachmenPreview(att,this);
},
deleteAttachment: function (attachment) {
......@@ -1623,7 +1623,7 @@ MWF.xApplication.process.Xform.Attachment = MWF.APPAttachment = new Class(
} else if (window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.downloadAttachment) {
window.webkit.messageHandlers.downloadAttachment.postMessage({ "id": att.data.id, "site": (this.json.site || this.json.id) });
} else if (window.wx && window.__wxjs_environment === 'miniprogram' && this.checkMiniProgramFile(att.data.extension)) { //微信小程序
wx.miniProgram.navigateTo({
wx.miniProgram.navigateTo({
url: '../file/download?attId=' + att.data.id + '&type=work&work=' + this.form.businessData.work.id
});
} else {
......@@ -1647,7 +1647,7 @@ MWF.xApplication.process.Xform.Attachment = MWF.APPAttachment = new Class(
} else if (window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.downloadAttachment) {
window.webkit.messageHandlers.downloadAttachment.postMessage({ "id": att.data.id, "site": (this.json.site || this.json.id) });
} else if (window.wx && window.__wxjs_environment === 'miniprogram' && this.checkMiniProgramFile(att.data.extension)) { //微信小程序
wx.miniProgram.navigateTo({
wx.miniProgram.navigateTo({
url: '../file/download?attId=' + att.data.id + '&type=work&workCompleted=' + this.form.businessData.workCompleted.id
});
} else {
......@@ -1674,7 +1674,7 @@ MWF.xApplication.process.Xform.Attachment = MWF.APPAttachment = new Class(
} else if (window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.downloadAttachment) {
window.webkit.messageHandlers.downloadAttachment.postMessage({ "id": att.data.id, "site": (this.json.site || this.json.id) });
} else if (window.wx && window.__wxjs_environment === 'miniprogram' && this.checkMiniProgramFile(att.data.extension)) { //微信小程序
wx.miniProgram.navigateTo({
wx.miniProgram.navigateTo({
url: '../file/download?attId=' + att.data.id + '&type=work&work=' + this.form.businessData.work.id
});
} else {
......@@ -1699,7 +1699,7 @@ MWF.xApplication.process.Xform.Attachment = MWF.APPAttachment = new Class(
} else if (window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.downloadAttachment) {
window.webkit.messageHandlers.downloadAttachment.postMessage({ "id": att.data.id, "site": (this.json.site || this.json.id) });
} else if (window.wx && window.__wxjs_environment === 'miniprogram' && this.checkMiniProgramFile(att.data.extension)) { //微信小程序
wx.miniProgram.navigateTo({
wx.miniProgram.navigateTo({
url: '../file/download?attId=' + att.data.id + '&type=work&workCompleted=' + this.form.businessData.workCompleted.id
});
} else {
......@@ -1940,12 +1940,12 @@ MWF.xApplication.process.Xform.AttachmenPreview = new Class({
},
load:function(){
var extension = this.att.extension;
var extension = this.att.data.extension;
if(extension === "ofd"){
this.previewOfd();
}
if(extension === "zip"){
//this.previewZip();
this.previewZip();
}
if(extension === "pdf"){
this.previewPdf();
......@@ -1978,105 +1978,158 @@ MWF.xApplication.process.Xform.AttachmenPreview = new Class({
this.previewAce("text");
}
},
// previewZip : function (){
// //zip压缩包预览
// var _self = this;
// var zipViewNode = new Element("div.ztree").inject(document.body);
// o2.load("/o2_lib/zipjs/zip-fs.js",function(){
//
// this.app.form.workAction.getAttachmentUrl(this.att.id, this.app.form.businessData.work.id, function (url) {
// var cookie = Cookie.read("x-token");
// url = url + "?x-token=" + cookie;
// unzip().catch(error => console.error(error));
// async function unzip() {
// zip.configure({ chunkSize: 128 });
// let zipFs = new zip.fs.FS();
// let directory = zipFs.addDirectory("import");
// await directory.importHttpContent(url);
//
// o2.loadCss("/o2_lib/zTree/zTreeStyle.css",function(){
// o2.load(["/o2_lib/jquery/jquery.min.js","/o2_lib/zTree/jquery.ztree.core.min.js"], {"sequence": true}, function(){
// jQuery = jQuery.noConflict(true); //避免js框架冲突
// var nodes = [];
// loadNodes(directory,nodes);
// jQuery.fn.zTree.init(jQuery(zipViewNode), {}, nodes);
//
// var dlg = o2.DL.open({
// "title": _self.att.name,
// "width": "660px",
// "height": "510px",
// "mask": true,
// "content": zipViewNode,
// "container": null,
// "positionNode": document.body,
// "onQueryClose": function () {
// zipViewNode.destroy();
// },
// "buttonList": [
// {
// "text": "关闭",
// "action": function () {
// dlg.close();
// }
// }
// ],
// "onPostShow": function () {
// dlg.reCenter();
// }
// });
//
//
// }.bind(this));
// })
// }
//
// function loadNodes(directory,nodes){
// var folderList = [];
// var fileList = [];
// directory.children.each(function(file){
// if(file.directory){
// folderList.push(file)
// }
// })
// directory.children.each(function(file){
// if(!file.directory){
// fileList.push(file)
// }
// })
// folderList.append(fileList);
// folderList.each(function(file){
// var node = {
// name : file.name
// }
// if(nodes.children){
// nodes.children.push(node);
// }else{
// nodes.push(node);
// }
// if(file.directory){
// node.children = [];
// loadNodes(file,node);
// }
// })
// }
// }.bind(this));
// }.bind(this));
// },
previewZip: function () {
debugger
//zip压缩包预览
var _self = this;
var zipViewNode = new Element("div",{"text":"loadding..."});
o2.load(["../o2_lib/jszip/jszip.min.js", "../o2_lib/jszip/jszip-utils.min.js"], function () {
this.app.getAttachmentUrl(this.att, function (url) {
o2.require("MWF.widget.Tree", function(){
var options = {"style":"form"};
var dlg = o2.DL.open({
"title": _self.att.data.name,
"width": "660px",
"height": "510px",
"mask": true,
"content": zipViewNode,
"container": null,
"positionNode": document.body,
"onQueryClose": function () {
zipViewNode.destroy();
},
"buttonList": [
{
"text": "关闭",
"action": function () {
dlg.close();
}
}
],
"onPostShow": function () {
dlg.reCenter();
},
"onPostLoad" : function(){
}
});
}.bind(this));
zipViewNode.empty();
JSZipUtils.getBinaryContent(url, function (err, data) {
JSZip.loadAsync(data).then(function (zip) {
var nodeList = [];
zip.forEach(function (relativePath, zipEntry) {
nodeList.push(zipEntry.name);
});
var tree = new MWF.widget.Tree(zipViewNode, options);
var treeData = _pathToTree(nodeList);
tree.load(treeData);
});
});
}.bind(this));
}.bind(this));
function _pathToTree(pathList) {
var pathJsonList = [];
for (var i = 0; i < pathList.length; i++) {
var chain = pathList[i].split("/");
var currentNode = pathJsonList;
for (var j = 0; j < chain.length; j++) {
if (chain[j] === "") {
break;
}
var wantedNode = chain[j];
var lastNode = currentNode;
for (var k = 0; k < currentNode.length; k++) {
if (currentNode[k].name == wantedNode) {
currentNode = currentNode[k].sub;
break;
}
}
if (lastNode == currentNode) {
var obj = {
key: pathList[i],
name: wantedNode,
title:wantedNode,
text:wantedNode,
sub: []
};
var newNode = (currentNode[k] = obj);
if (wantedNode.indexOf(".") > -1) {
obj.dir = false;
obj.icon = "file.png";
delete obj.sub;
} else {
obj.dir = true;
obj.expand = false;
currentNode = newNode.sub;
//delete obj.sub;
}
} else {
delete currentNode.sub;
}
}
}
var nodes = [];
var folder = {
"title" : _self.att.name,
"text" : _self.att.name,
"sub" : []
};
pathJsonList.each(function(path){
folder.sub.push(path);
})
_sortPath(folder, nodes);
return nodes;
}
function _sortPath(pathJsonList, nodes) {
var folderList = [];
pathJsonList.sub.each(function (file) {
if (file.dir) {
folderList.push(file);
}
});
pathJsonList.sub.each(function (file) {
if (!file.dir) {
folderList.push(file);
}
});
folderList.each(function (file) {
var node = {
text: file.name,
title: file.name,
expand : false
};
if (!file.dir) {
node.icon = "file.png";
}
nodes.push(node);
if(file.sub && file.sub.length>0){
node.sub = [];
_sortPath(file,node.sub);
}
})
}
},
previewPdf : function(){
this.app.form.workAction.getAttachmentUrl(this.att.id, this.app.form.businessData.work.id, function (url) {
this.app.getAttachmentUrl(this.att, function (url) {
window.open("../o2_lib/pdfjs/web/viewer.html?file=" + url)
});
},
previewOfd : function(){
this.app.form.workAction.getAttachmentUrl(this.att.id, this.app.form.businessData.work.id, function (url) {
this.app.getAttachmentUrl(this.att, function (url) {
window.open("../o2_lib/ofdjs/index.html?file=" + url)
});
},
previewImage : function(){
this.app.form.workAction.getAttachmentUrl(this.att.id, this.app.form.businessData.work.id, function (url) {
this.app.getAttachmentUrl(this.att, function (url) {
var imgNode = new Element("img",{"src":url,"alt":this.att.name}).inject(document.body).hide();
o2.loadCss("../m_app/yunFile/css/viewer.css", document.body,function(){
o2.load("../m_app/yunFile/js/viewer.js", function(){
o2.loadCss("../o2_lib/viewer/viewer.css", document.body,function(){
o2.load("../o2_lib/viewer/viewer.js", function(){
this.viewer = new Viewer(imgNode,{
navbar : false,
toolbar : false,
......@@ -2091,7 +2144,8 @@ MWF.xApplication.process.Xform.AttachmenPreview = new Class({
}.bind(this));
},
previewAce:function(type){
this.app.form.workAction.getAttachmentUrl(this.att.id, this.app.form.businessData.work.id, function (url) {
debugger
this.app.getAttachmentUrl(this.att, function (url) {
o2.require("o2.widget.ace", null, false);
var fileRequest = new Request({
url: url,
......@@ -2109,7 +2163,7 @@ MWF.xApplication.process.Xform.AttachmenPreview = new Class({
}.bind(this));
var dlg = o2.DL.open({
"title": this.att.name,
"title": this.att.data.name,
"width": "960px",
"height": "610px",
"mask": true,
......
......@@ -17,7 +17,7 @@
// },
{
"title": "代理配置",
"title": MWF.xApplication.service.ServiceManager.LP.agent.name,
"id": "1.1",
"action": "agentConfig",
"icon": "agent_script.png",
......@@ -25,7 +25,7 @@
"sub": []
},
{
"title": "接口配置",
"title": MWF.xApplication.service.ServiceManager.LP.invoke.name,
"id": "1.1",
"action": "invokeConfig",
"icon": "agent_script.png",
......
MWF.xApplication.service = MWF.xApplication.service || {};
MWF.xApplication.service.ServiceManager = MWF.xApplication.service.ServiceManager || {};
MWF.xApplication.service.ServiceManager.LP = {
"title": "Service Platform",
"categoryTitle": "Category",
"description": "Description",
"deleteItems": "Delete selected element",
"copy": "Copy",
"copyto": "Copyto...",
"copyInfor": "Select multiple elements, press Ctrl+C to copy the elements, press Ctrl+V to paste elements into the current application",
"copyed": "The selected element has been copied",
"copyConfirmTitle": "Copy element confirmation",
"copyConfirmInfor": "The target area already contains the same elements:",
"copySource": "Original file:",
"copyTarget": "Copy files:",
"copyConfirm_overwrite": "Replace",
"copyConfirm_new": "Create",
"copyConfirm_skip": "Skip",
"copyConfirm_cancel": "Cancel",
"copynew": "New",
"edit": "Edit",
"save": "Save",
"cancel": "Cancel",
"phone": "Phone",
"mail": "Mail",
"deleteElementTitle": "Delete design confirmation",
"deleteElement": "Are you sure you want to delete the selected design element?",
"agent": {
"name": "Agent",
"create": "Create Agent",
"search": "Search Agent",
"searchText": "Please enter key words",
"noAgentNoticeText": "There is no Agent, you can click here to create a new Agent",
"loaded": "Agent loaded",
"deleteProcessTitle": "Delete Agent confirmation",
"deleteProcess": "Are you sure you want to delete the current Agent?",
"noPermission" : "You are not an administrator and cannot view Agents."
},
"invoke": {
"name": "Service",
"create": "Create Service",
"search": "Search Service",
"searchText": "Please enter key words",
"noAgentNoticeText": "There is no Service, you can click here to create a new Service",
"loaded": "Service loaded",
"deleteProcessTitle": "Delete Service confirmation",
"deleteProcess": "Are you sure you want to delete the current Service?",
"noPermission" : "You are not an administrator and cannot view Service."
},
// "application": {
// "inputApplicationName": "Enter the data application name",
// "property": "数据应用属性",
// "name": "数据应用名称",
// "alias": "数据应用别名",
// "description": "数据应用描述",
// "type": "数据应用类型",
// "icon": "数据应用图标",
// "id": "数据应用标识",
// "firstPage": "数据应用主页",
// "controllerList": "管理者",
// "available": "可用范围"
// },
// "createSelectTemplate": "新建:选择模板",
// "templateCategory": "模板分类:",
"all": "All",
"agentConfig" : "Agent Config",
"interfaceConfig" : "Service Config",
"disable" : "Disabled"
};
\ No newline at end of file
......@@ -30,6 +30,7 @@ MWF.xApplication.service.ServiceManager.LP = {
"deleteElement": "是否确定要删除选中的设计元素?",
"agent": {
"name": "代理配置",
"create": "新建代理",
"search": "搜索代理",
"searchText": "请输入关键字",
......@@ -46,6 +47,7 @@ MWF.xApplication.service.ServiceManager.LP = {
},
"invoke": {
"name": "接口配置",
"create": "新建接口",
"search": "搜索接口",
"searchText": "请输入关键字",
......
......@@ -127,7 +127,16 @@ o2.addReady(function () {
layout.sessionPromise = new Promise(function(resolve, reject){
o2.Actions.get("x_organization_assemble_authentication").getAuthentication(function (json) {
if (resolve) resolve(json.data);
if (json.data.language !== o2.languageName){
o2.language = json.data.language.toLowerCase();
o2.languageName = json.data.language;
var lp = o2.session.path + "/lp/" + o2.language + ".js";
o2.load(lp, {"reload": true}, function(){
if (resolve) resolve(json.data);
});
}else{
if (resolve) resolve(json.data);
}
}.bind(this), function (xhr, text, error) {
if (reject) reject({"xhr": xhr, "text": text, "error": error});
}.bind(this));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册