提交 da86a7dd 编写于 作者: 蔡祥熠

Merge branch 'fix/auditlog' into 'wrdp'

Merge of fix/auditlog to 更改三元管理前台应用名称为AuditLog,并且增加详情页 wrdp

See merge request o2oa/o2oa!5675
......@@ -6,6 +6,7 @@ var apps = [
{ "folder": "x_component_AppMarketV2", "tasks": ["move", "min"] },
{ "folder": "x_component_AppMarketV2_Application", "tasks": ["move", "min"] },
{ "folder": "x_component_Attendance", "tasks": ["move", "min"] },
{ "folder": "x_component_AuditLog", "tasks": ["move", "min"] },
{ "folder": "x_component_BAM", "tasks": ["move", "min"] },
{ "folder": "x_component_Calendar", "tasks": ["move", "min"] },
{ "folder": "x_component_cms_Column", "tasks": ["move", "min"] },
......@@ -80,11 +81,9 @@ var apps = [
{ "folder": "x_component_service_ServiceManager", "tasks": ["move", "min"] },
{ "folder": "x_component_Setting", "tasks": ["move", "min"] },
{ "folder": "x_component_Template", "tasks": ["move", "min"] },
{ "folder": "x_component_TernaryLog", "tasks": ["move", "min"] },
{ "folder": "x_desktop", "tasks": ["move", "min"] },
{ "folder": "x_component_IMV2", "tasks": ["move", "min"] },
{ "folder": "x_component_ConfigDesigner", "tasks": ["move", "min"] },
{ "folder": "x_component_TernaryLog", "tasks": ["move", "min"] }
{ "folder": "x_component_ConfigDesigner", "tasks": ["move", "min"] }
];
module.exports = apps;
......@@ -29,7 +29,7 @@
"width": "40px",
"height": "50px",
"float": "left",
"background": "url(../x_component_TernaryLog/$Main/default/icon/topIcon.png) no-repeat center center"
"background": "url(../x_component_AuditLog/$Main/default/icon/topIcon.png) no-repeat center center"
},
"topTextNode" : {
"color" : "#333",
......@@ -144,7 +144,8 @@
"height": "39px",
"text-align":"center",
"overflow" : "hidden",
"border-bottom": "1px solid #E6E6E6"
"border-bottom": "1px solid #E6E6E6",
"cursor": "pointer"
},
"sortIconNode" : {
......@@ -187,7 +188,8 @@
"min-height": "29px",
"color": "#666666",
"font-family": "Microsoft YaHei",
"font-size": "14px"
"font-size": "14px",
"cursor": "pointer"
},
"documentNode_noread": {
"background-color": "#fcfcfc"
......@@ -195,6 +197,9 @@
"documentNode_over": {
"background-color": "#F7F7F7"
},
"documentNode_down": {
"background-color": "#F7F7F7"
},
"documentNode_remove": {
"background-color": "#ffcccc"
},
......@@ -215,6 +220,23 @@
},
"actionDenyNode_down":{
},
"openAction": {
"height": "20px",
"border-radius": "3px",
"width": "20px",
"line-height": "20px",
"cursor": "pointer",
"display": "inline-block",
"margin-right": "5px",
"background-repeat": "no-repeat",
"background-position": "center center",
"background-image": "url(../x_component_AuditLog/$Main/default/icon/open.png)"
},
"openAction_over": {
"background-repeat": "no-repeat",
"background-position": "center center",
"background-image": "url(../x_component_AuditLog/$Main/default/icon/open_blue.png)"
},
"naviScrollNode" : {
......@@ -241,7 +263,7 @@
"overflow" : "hidden",
"text-overflow" : "ellipsis",
"white-space":"nowrap",
"background": "url(../x_component_TernaryLog/$Main/default/icon/topIcon.png) no-repeat center center"
"background": "url(../x_component_AuditLog/$Main/default/icon/topIcon.png) no-repeat center center"
},
"naviAllNode": {
"display" : "block",
......@@ -253,7 +275,7 @@
"color" : "#333",
"padding-left" : "38px",
"cursor": "pointer",
"background": "url(../x_component_TernaryLog/$Main/default/icon/all.png) no-repeat 13px center"
"background": "url(../x_component_AuditLog/$Main/default/icon/all.png) no-repeat 13px center"
},
"naviAllNode_current" : {
"background-color" : "#F2F5F7",
......@@ -276,11 +298,11 @@
"font-size": "14px",
"color" : "#333",
"padding-left" : "8px",
// "background": "url(../x_component_TernaryLog/$Main/default/icon/triangle_down.png) no-repeat 15px center",
// "background": "url(../x_component_AuditLog/$Main/default/icon/triangle_down.png) no-repeat 15px center",
"cursor": "pointer"
},
// "naviMenuNode_collapse": {
// "background": "url(../x_component_TernaryLog/$Main/default/icon/triangle_right.png) no-repeat 15px center"
// "background": "url(../x_component_AuditLog/$Main/default/icon/triangle_right.png) no-repeat 15px center"
// },
"naviMenuNode_normal": {
"background-color" : "#fff",
......@@ -298,13 +320,13 @@
"width": "30px",
"height": "40px",
"float": "left",
"background": "url(../x_component_TernaryLog/$Main/default/icon/triangle_right.png) no-repeat 5px center"
"background": "url(../x_component_AuditLog/$Main/default/icon/triangle_right.png) no-repeat 5px center"
},
"naviMenuIconNode_expand": {
"width": "30px",
"height": "40px",
"float": "left",
"background": "url(../x_component_TernaryLog/$Main/default/icon/triangle_down.png) no-repeat 5px center"
"background": "url(../x_component_AuditLog/$Main/default/icon/triangle_down.png) no-repeat 5px center"
},
"naviMenuTextNode": {
"margin-left": "25px",
......
......@@ -9,8 +9,8 @@
"html": "<tr styles='documentNode'></tr>",
"mouseoverStyles": "documentNode_over",
"mousedownStyles": "documentNode_down",
"holdMouseDownStyles" : true
// "action": "open"
"holdMouseDownStyles" : true,
"action": "open"
},
"items": [
{
......@@ -138,5 +138,23 @@
}
}
}
// {
// "name": "actionList",
// "head": {
// "html": "<th styles='normalThNode' lable='view'></th>",
// "width": "30"
// },
// "content": {
// "html": "<td styles='normalTdNode'><div styles='openAction' item='openAction'></div></td>",
// "items": {
// "openAction": {
// "title": "viewDetail",
// "action": "open",
// "styles" : "openAction",
// "mouseoverStyles": "openAction_over"
// }
// }
// }
// }
]
}
\ No newline at end of file
MWF.xApplication.TernaryLog = MWF.xApplication.TernaryLog || {};
MWF.xApplication.AuditLog = MWF.xApplication.AuditLog || {};
MWF.require("MWF.widget.O2Identity", null, false);
//MWF.xDesktop.requireApp("TernaryLog", "Access", null, false);
//MWF.xDesktop.requireApp("TernaryLog", "Actions.RestActions", null, false);
//MWF.xDesktop.requireApp("AuditLog", "Access", null, false);
//MWF.xDesktop.requireApp("AuditLog", "Actions.RestActions", null, false);
MWF.xDesktop.requireApp("Template", "Explorer", null, false);
MWF.xDesktop.requireApp("Template", "MForm", null, false);
MWF.xApplication.TernaryLog.options = {
MWF.xApplication.AuditLog.options = {
multitask: false,
executable: true
};
MWF.xApplication.TernaryLog.Main = new Class({
MWF.xApplication.AuditLog.Main = new Class({
Extends: MWF.xApplication.Common.Main,
Implements: [Options, Events],
options: {
"style": "default",
"name": "TernaryLog",
"name": "AuditLog",
"icon": "icon.png",
"width": "1220",
"height": "700",
"isResize": true,
"isMax": true,
"viewPageNum": 1,
"title": MWF.xApplication.TernaryLog.LP.title
"title": MWF.xApplication.AuditLog.LP.title
},
onQueryLoad: function () {
this.lp = MWF.xApplication.TernaryLog.LP;
this.lp = MWF.xApplication.AuditLog.LP;
},
loadApplication: function (callback) {
this.userName = layout.desktop.session.user.distinguishedName;
this.path = "../x_component_TernaryLog/$Main/" + this.options.style + "/";
this.path = "../x_component_AuditLog/$Main/" + this.options.style + "/";
this.createNode();
this.loadApplicationContent();
},
loadController: function (callback) {
//this.access = new MWF.xApplication.TernaryLog.Access( this.restActions, this.lp );
//this.access = new MWF.xApplication.AuditLog.Access( this.restActions, this.lp );
if (callback) callback();
},
......@@ -83,7 +83,7 @@ MWF.xApplication.TernaryLog.Main = new Class({
naviOpt.module = this.options.module || "all";
naviOpt.operation = this.options.operation;
}
this.navi = new MWF.xApplication.TernaryLog.Main.Navi(this, this.naviNode, naviOpt);
this.navi = new MWF.xApplication.AuditLog.Main.Navi(this, this.naviNode, naviOpt);
},
createTopNode: function () {
this.topContainerNode = new Element("div.topContainerNode", {
......@@ -163,7 +163,7 @@ MWF.xApplication.TernaryLog.Main = new Class({
"styles": this.css.viewContainerNode
}).inject(this.contentNode);
this.view = new MWF.xApplication.TernaryLog.Main.View(viewContainerNode, this, this, {
this.view = new MWF.xApplication.AuditLog.Main.View(viewContainerNode, this, this, {
templateUrl: this.path + "listItem.json",
"pagingEnable": true,
"wrapView": true,
......@@ -213,7 +213,7 @@ MWF.xApplication.TernaryLog.Main = new Class({
}
},
loadFilter: function () {
var lp = MWF.xApplication.TernaryLog.LP;
var lp = MWF.xApplication.AuditLog.LP;
this.fileterNode = new Element("div.fileterNode", {
"styles": this.css.fileterNode
}).inject(this.topContentNode);
......@@ -318,7 +318,7 @@ MWF.xApplication.TernaryLog.Main = new Class({
}
});
MWF.xApplication.TernaryLog.Main.Navi = new Class({
MWF.xApplication.AuditLog.Main.Navi = new Class({
Implements: [Options, Events],
options: {
"module": "all"
......@@ -543,10 +543,10 @@ MWF.xApplication.TernaryLog.Main.Navi = new Class({
}
});
MWF.xApplication.TernaryLog.Main.View = new Class({
MWF.xApplication.AuditLog.Main.View = new Class({
Extends: MWF.xApplication.Template.Explorer.ComplexView,
_createDocument: function (data, index) {
return new MWF.xApplication.TernaryLog.Main.Document(this.viewNode, data, this.explorer, this, null, index);
return new MWF.xApplication.AuditLog.Main.Document(this.viewNode, data, this.explorer, this, null, index);
},
_getCurrentPageData: function (callback, count, pageNum) {
this.clearBody();
......@@ -575,7 +575,8 @@ MWF.xApplication.TernaryLog.Main.View = new Class({
},
_openDocument: function (documentData) {
var form = new MWF.xApplication.AuditLog.Main.LogForm({app: this.app}, documentData );
form.open();
},
_queryCreateViewNode: function () {
......@@ -592,7 +593,7 @@ MWF.xApplication.TernaryLog.Main.View = new Class({
});
MWF.xApplication.TernaryLog.Main.Document = new Class({
MWF.xApplication.AuditLog.Main.Document = new Class({
Extends: MWF.xApplication.Template.Explorer.ComplexDocument,
mouseoverDocument: function (itemNode, ev) {
var removeNode = itemNode.getElements("[styles='removeNode']")[0];
......@@ -611,10 +612,134 @@ MWF.xApplication.TernaryLog.Main.Document = new Class({
//} )
},
open: function () {
this.view._openDocument(this.data);
}
});
MWF.xApplication.AuditLog.Main.LogForm = new Class({
Extends: MPopupForm,
Implements: [Options, Events],
options: {
"style": "attendanceV2",
"width": "800",
"height": "700",
"hasTop": true,
"hasIcon": false,
"hasTopIcon" : false,
"hasTopContent" : false,
"draggable": true,
"maxAction" : true,
"resizeable" : true,
"closeAction": true,
"title": MWF.xApplication.AuditLog.LP.logDetail,
"hideBottomWhenReading": true,
"closeByClickMaskWhenReading": true,
},
_postLoad: function(){
o2.Actions.load("x_auditlog_assemble_control").AuditLogAction.get(this.data.id, function (json) {
this.data = json.data;
this._createTableContent_();
}.bind(this))
},
_createTableContent: function(){},
_createTableContent_: function () {
var data = this.data;
data.spendTime1 = data.spendTime+this.lp.millisecond;
data.person1 = data.person.split("@")[0];
this.formTableArea.set("html", this.getHtml());
this.formTableContainer.setStyle("width","90%");
MWF.xDesktop.requireApp("Template", "MForm", function () {
this.form = new MForm(this.formTableArea, data, {
isEdited: this.isEdited || this.isNew,
style : "attendance",
hasColon : true,
itemTemplate: {
person1: { text : this.lp.person, type : "innertext" },
node: { text : this.lp.node, type : "innertext" },
clientIp: { text : this.lp.clientIp, type : "innertext" },
httpType: { text : this.lp.httpType, type : "innertext" },
module: { text : this.lp.module, type : "innertext" },
operation: { text : this.lp.operation, type : "innertext" },
httpStatus: { text : this.lp.httpStatus, type : "innertext" },
spendTime1: { text : this.lp.spendTime1, type : "innertext" },
createTime: { text : this.lp.createTime, type : "innertext" },
updateTime: { text : this.lp.updateTime, type : "innertext" },
httpUrl: { text : this.lp.httpUrl, type : "innertext" },
sendData1: { text : this.lp.sendData, type : "innertext" },
}
}, this.app);
this.form.load();
this.loadScriptEditor();
}.bind(this), true);
},
getHtml : function(){
return "<table width='100%' bordr='0' cellpadding='7' cellspacing='0' styles='formTable' style='table-layout:fixed;'>" +
"<tr><td styles='formTableTitle' lable='person1' width='70' ></td>" +
" <td styles='formTableValue' item='person1' width='200'></td>" +
" <td styles='formTableTitle' lable='node' width='100'></td>" +
" <td styles='formTableValue' item='node' width='200'></td></tr>" +
"<tr><td styles='formTableTitle' lable='clientIp'></td>" +
" <td styles='formTableValue' item='clientIp'></td>" +
" <td styles='formTableTitle' lable='httpType'></td>" +
" <td styles='formTableValue' item='httpType'></td></tr>" +
"<tr><td styles='formTableTitle' lable='module'></td>" +
" <td styles='formTableValue' item='module'></td>" +
" <td styles='formTableTitle' lable='operation'></td>" +
" <td styles='formTableValue' item='operation'></td></tr>" +
"<tr><td styles='formTableTitle' lable='httpStatus'></td>" +
" <td styles='formTableValue' item='httpStatus'></td>" +
" <td styles='formTableTitle' lable='spendTime1'></td>" +
" <td styles='formTableValue' item='spendTime1'></td></tr>" +
"<tr><td styles='formTableTitle' lable='createTime'></td>" +
" <td styles='formTableValue' item='createTime'></td>" +
" <td styles='formTableTitle' lable='updateTime'></td>" +
" <td styles='formTableValue' item='updateTime'></td></tr>" +
"<tr><td styles='formTableTitle' lable='httpUrl'></td>" +
" <td styles='formTableValue' item='httpUrl' colspan='3'></td></tr>" +
"<tr><td styles='formTableTitle' lable='sendData1'></td>" +
" <td styles='formTableValue' item='sendData1' colspan='3'></td></tr>" +
"</table>"+
"<div item='sendData'></div>"
},
loadScriptEditor:function(){
if( !this.data.sendData )return;
MWF.require("MWF.widget.JavascriptEditor", null, false);
var value;
try{
debugger;
var json = JSON.parse(this.data.sendData);
value = JSON.stringify(json, null, "\t");
}catch (e) {}
var sendDataNode = this.formTableContainer.getElement('[item="sendData"]');
if( value ){
this.scriptEditor = new MWF.widget.JavascriptEditor(sendDataNode, {
"forceType": "ace",
"option": {"value": value, "mode" : "json" }
});
this.scriptEditor.load(function(){
debugger;
this.scriptEditor.setValue(value);
this.scriptEditor.editor.setReadOnly(true);
this.addEvent("afterResize", function () {
this.resizeScript();
}.bind(this))
this.resizeScript();
}.bind(this));
}else{
this.form.getItem("sendData1").container.set("text", this.data.sendData);
sendDataNode.hide();
}
},
resizeScript: function () {
var size = this.formTableContainer.getSize();
var tableSize = this.formTableContainer.getElement('table').getSize();
this.formTableContainer.getElement('[item="sendData"]').setStyle("height", size.y - tableSize.y);
if(this.scriptEditor && this.scriptEditor.editor)this.scriptEditor.editor.resize();
}
});
var getDateDiff = function (publishTime) {
if (!publishTime) return "";
......@@ -640,9 +765,9 @@ var getDateDiff = function (publishTime) {
var hourC = diffValue / hour;
var minC = diffValue / minute;
if (yesterday.getFullYear() == dateTimeStamp.getFullYear() && yesterday.getMonth() == dateTimeStamp.getMonth() && yesterday.getDate() == dateTimeStamp.getDate()) {
result = MWF.xApplication.TernaryLog.LP.yesterday + " " + dateTimeStamp.getHours() + ":" + dateTimeStamp.getMinutes();
result = MWF.xApplication.AuditLog.LP.yesterday + " " + dateTimeStamp.getHours() + ":" + dateTimeStamp.getMinutes();
} else if (beforYesterday.getFullYear() == dateTimeStamp.getFullYear() && beforYesterday.getMonth() == dateTimeStamp.getMonth() && beforYesterday.getDate() == dateTimeStamp.getDate()) {
result = MWF.xApplication.TernaryLog.LP.twoDaysAgo + " " + dateTimeStamp.getHours() + ":" + dateTimeStamp.getMinutes();
result = MWF.xApplication.AuditLog.LP.twoDaysAgo + " " + dateTimeStamp.getHours() + ":" + dateTimeStamp.getMinutes();
} else if (yearC > 1) {
result = dateTimeStamp.getFullYear() + "-" + (dateTimeStamp.getMonth() + 1) + "-" + dateTimeStamp.getDate();
} else if (monthC >= 1) {
......@@ -650,15 +775,15 @@ var getDateDiff = function (publishTime) {
// s.getFullYear()+"年";
result = dateTimeStamp.getFullYear() + "-" + (dateTimeStamp.getMonth() + 1) + "-" + dateTimeStamp.getDate();
} else if (weekC >= 1) {
result = parseInt(weekC) + MWF.xApplication.TernaryLog.LP.weekAgo;
result = parseInt(weekC) + MWF.xApplication.AuditLog.LP.weekAgo;
} else if (dayC >= 1) {
result = parseInt(dayC) + MWF.xApplication.TernaryLog.LP.dayAgo;
result = parseInt(dayC) + MWF.xApplication.AuditLog.LP.dayAgo;
} else if (hourC >= 1) {
result = parseInt(hourC) + MWF.xApplication.TernaryLog.LP.hourAgo;
result = parseInt(hourC) + MWF.xApplication.AuditLog.LP.hourAgo;
} else if (minC >= 1) {
result = parseInt(minC) + MWF.xApplication.TernaryLog.LP.minuteAgo;
result = parseInt(minC) + MWF.xApplication.AuditLog.LP.minuteAgo;
} else
result = MWF.xApplication.TernaryLog.LP.publishJustNow;
result = MWF.xApplication.AuditLog.LP.publishJustNow;
return result;
};
......
MWF.xApplication.TernaryLog.LP = {
MWF.xApplication.AuditLog.LP = {
"title": "Three-Member Management Log",
"person": "User",
......@@ -14,12 +14,15 @@ MWF.xApplication.TernaryLog.LP = {
"createTime": "Start Time",
"updateTime": "End Time",
"spendTime": "Execution duration (milliseconds)",
"spendTime1 ":" Execution duration",
"millisecond ": "milliseconds",
"firstPage": "First Page",
"lastPage": "Last Page",
"query": "Search",
"reset": "Reset",
"noItem": "No data can be queried under current conditions",
"all": "All Logs",
"sendData": "Request Data",
"cancel": "Cancel",
"close": "Close",
......@@ -27,6 +30,9 @@ MWF.xApplication.TernaryLog.LP = {
"edit": "Edit",
"remove": "Remove",
"action": "Action",
"view": "View",
"viewDetail": "View Detail",
"logDetail": "Log Detail",
"yesterday": "Yesterday",
"twoDaysAgo": "The day before yesterday",
......
MWF.xApplication.TernaryLog.LP = {
MWF.xApplication.AuditLog.LP = {
"title": "三元管理日志",
"person" : "用户",
......@@ -14,12 +14,15 @@ MWF.xApplication.TernaryLog.LP = {
"createTime": "开始时间",
"updateTime": "结束时间",
"spendTime": "执行持续时间(毫秒)",
"spendTime1": "执行持续时间",
"millisecond": "毫秒",
"firstPage": "第一页",
"lastPage": "最后一页",
"query": "搜索",
"reset": "重置",
"noItem": "当前条件下没有查询到数据",
"all": "所有日志",
"sendData": "请求数据",
"cancel" : "取消",
"close" : "关闭",
......@@ -27,6 +30,9 @@ MWF.xApplication.TernaryLog.LP = {
"edit" : "编辑",
"remove" : "删除",
"action" : "操作",
"view": "查看",
"viewDetail": "查看详情",
"logDetail": "日志详情",
"yesterday": "昨天",
"twoDaysAgo" : "前天",
......
......@@ -141,6 +141,7 @@ var MDomItem = new Class({
this.valSeparator = /,|;|\^\^|\|/; //如果是多值对象,作为用户选择的多个值的分隔符
this.mElement = this.container; //容器
this.node = this.container;
this.items = [];
this.setOptionList( options );
......
......@@ -153,6 +153,9 @@ MWF.xApplication.Template.MPopupForm = MPopupForm = new Class({
this.fireEvent("postEdit");
},
_open: function () {
this.fireEvent("queryLoad");
if(this._queryLoad)this._queryLoad();
if( this.options.hasMask ){
this.formMaskNode = new Element("div.formMaskNode", {
"styles": this.css.formMaskNode,
......@@ -251,10 +254,14 @@ MWF.xApplication.Template.MPopupForm = MPopupForm = new Class({
this.oldCoordinate.height = size.height;
}
this.fireEvent("resizeCompleted");
this.fireEvent("afterResize");
}.bind(this)
});
}
if(this._postLoad)this._postLoad();
this.fireEvent("postLoad");
},
createFormNode: function () {
var _self = this;
......@@ -574,6 +581,7 @@ MWF.xApplication.Template.MPopupForm = MPopupForm = new Class({
this.formTopRestoreActionNode.setStyle("display","");
this.isMax = true;
this.fireEvent("max");
this.fireEvent("afterResize");
},
restoreSize : function(){
if( this.oldCoordinate){
......@@ -589,6 +597,7 @@ MWF.xApplication.Template.MPopupForm = MPopupForm = new Class({
this.formTopRestoreActionNode.setStyle("display","none");
this.isMax = false;
this.fireEvent("restore");
this.fireEvent("afterResize");
},
setFormNodeSize: function (width, height, top, left, bottom, right) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册