Index: ssts-web/src/main/webapp/networkdisk/addFile.jsp =================================================================== diff -u -r17419 -r28826 --- ssts-web/src/main/webapp/networkdisk/addFile.jsp (.../addFile.jsp) (revision 17419) +++ ssts-web/src/main/webapp/networkdisk/addFile.jsp (.../addFile.jsp) (revision 28826) @@ -2,6 +2,8 @@ <%@ include file="/common/taglibs.jsp"%> <%@ page import="com.forgon.security.acls.*"%> <%@ page import="com.forgon.knowledge.model.KnowledgeFile"%> +<%@ page import="com.forgon.knowledge.model.Vo.ReadRecordVo"%> +<%@ page import="java.util.List"%> 创建文件 @@ -70,6 +72,79 @@ } } + function selReaders(WWWROOT){ + var arg = {}; + var userIdsElement = document.getElementById("readers"); + var userNamesElement = document.getElementById("readersForDisplay"); + + arg.userIds = userIdsElement.value; + arg.userNames = userNamesElement.value; + var userIdsArray = arg.userIds.split(";"); + arg.userNamesArray = arg.userNames.split(";"); + var newArr = []; + for(var i=0,k=0;i 0){ + for(var i = 0;i @@ -79,11 +154,14 @@ <% // TODO:需要判断是否有编辑的权限 request.setAttribute("isEditAuthority", true); - + List readRecordVoList = (List)request.getAttribute("readRecords"); + request.setAttribute("readRecordVoList", readRecordVoList); + System.out.println("readRecordVoList" + readRecordVoList.size()); %> - <% request.setAttribute("isEditAuthority", true); %> + <% request.setAttribute("isEditAuthority", true); + %> <% @@ -104,8 +182,8 @@ - +
  • @@ -160,17 +238,16 @@ + + 读者 + + + + + + + <%--暂时屏蔽读者和管理员--%> - <%----%> - <%--读者--%> - <%----%> - <%----%> - <%----%> - <%----%> - <%----%> - <%----%> - <%----%> - <%--暂时屏蔽读者和管理员--%> 管理员 @@ -198,6 +275,27 @@ +
@@ -208,6 +306,10 @@ - +<% + request.setAttribute("userName",AcegiHelper.getLoginUser().getUserFullName()); +%>
+ <%--这个要放在下面加载,不然moduleId那几个变量有可能会出现空--%> + \ No newline at end of file Index: ssts-web/src/main/webapp/knowledge/viewExt.js =================================================================== diff -u -r27302 -r28826 --- ssts-web/src/main/webapp/knowledge/viewExt.js (.../viewExt.js) (revision 27302) +++ ssts-web/src/main/webapp/knowledge/viewExt.js (.../viewExt.js) (revision 28826) @@ -2,6 +2,9 @@ var gridTitle = moduleName; var grid; var root; +var windowForm; +var trainingRecordStore; +var formPanel; function deleteFileAndFolder(){ var moduleId = getModuleId(); @@ -95,24 +98,56 @@ grid.gotoFirstPage(); // grid.dwrReload(); } -function playVideo(videoName,fileName){ +function playVideo(videoName,fileName,id){ var url = Ext.urlEncode({ videoName : videoName, //视频播放文件名 fileName : fileName //文件名 - }); - openModalWindowForExt(WWWROOT+"/knowledge/watchVideo.jsp?"+url,'', "观看视频", "600", "400"); + }); + Ext.Ajax.request({ + url: WWWROOT + '/disinfectSystem/baseData/readRecordAction!accumulateReadRecord.do?moduleId=trainingManage&id='+id, + success: function (response, options) { + var result = Ext.decode(response.responseText); + if(result.success){ + openModalWindowForExt(WWWROOT+"/knowledge/watchVideo.jsp?"+url,'', "观看视频", "600", "400"); + }else { + showResult(result.msg); + } + }, + failure: function (response, options) { + var result = Ext.decode(response.responseText); + showResult(result.msg); + } + }); } +function openImg(attachFileId,moduleId,id){ + var linkUrl = WWWROOT + "/attachfiles/fileDownLoad?loadType=open&id=" + attachFileId + "&moduleId=" + moduleId; + document.getElementById('clickTab').setAttribute('href',linkUrl); + Ext.Ajax.request({ + url: WWWROOT + '/disinfectSystem/baseData/readRecordAction!accumulateReadRecord.do?moduleId=trainingManage&id='+id, + success: function (response, options) { + var result = Ext.decode(response.responseText); + if(result.success){ + document.getElementById('clickTab').click(); + }else { + showResult(result.msg); + } + }, + failure: function (response, options) { + var result = Ext.decode(response.responseText); + showResult(result.msg); + } + }); +} function rendererImgLink(v, p, record){ var linkUrl = record.data['linkUrl']; var attachFileType = record.data['attacnFileType']; var attachFileId = record.data['attachFileId']; if (!isUndefinedOrNullOrEmpty(attachFileId) && attachFileId.indexOf(",") == -1){ //判断类型是否包含video包含为视频文件 if(attachFileType.indexOf("video")>=0){ - v = ' ' + v + ''; + v = ' ' + v + ''; }else{ - linkUrl = WWWROOT + "/attachfiles/fileDownLoad?loadType=open&id=" + attachFileId + "&moduleId=" + moduleId; - v = ' ' + v + ''; + v = ' ' + v + ''; } } else{ @@ -180,10 +215,331 @@ grid.dwrReload(); } } +function addOrUpdateForm(id){ + formPanel = new top.Ext.FormPanel({ + id : 'addOrUpdateForm', + frame : true, + labelSeparator : ':', + bodyStyle : 'padding:5px 5px 0px 5px', + width : document.body.clientWidth/2, + height : 500, + labelAlign : 'right', + buttonAlign : 'center', + autoScroll : true, + items : [{ + layout : 'column', + items:[{ + xtype : 'hidden', + id:'id', + value:id + },{ + xtype : 'hidden', + id:'userIds' + },{ + xtype : 'hidden', + id:'userIdsStr' + },{ + columnWidth : 1, + layout : 'form', + labelWidth : 60, + items : [{ + xtype : 'textfield', + fieldLabel : '培训主题', + id : 'trainingTopic', + name : 'trainingTopic', + allowBlank : false, + anchor : '100%' + }] + },{ + columnWidth : .5, + layout : 'form', + labelWidth : 60, + items : [{ + xtype : 'textfield', + fieldLabel : '培训人', + id : 'trainer', + name : 'trainer', + allowBlank : false, + anchor : '95%' + }] + },{ + columnWidth : .5, + layout : 'form', + labelWidth : 60, + items : [{ + xtype : 'datefieldWithMin', + fieldLabel : '培训时间', + id : 'trainingTime', + name : 'trainingTime', + format : 'Y-m-d H:i', + readOnly : false, + allowBlank : false, + anchor : '95%' + }] + },{ + columnWidth : .5, + layout : 'form', + labelWidth : 60, + items : [{ + xtype : 'textfield', + fieldLabel : '培训地点', + id : 'trainingPlace', + name : 'trainingPlace', + allowBlank : true, + anchor : '95%' + }] + },{ + columnWidth : .5, + layout : 'form', + labelWidth : 60, + items : [{ + xtype : 'textfield', + fieldLabel : '登记人', + id : 'registrant', + name : 'registrant', + allowBlank : true, + disabled:true, + value:userName, + anchor : '95%' + }] + },{ + columnWidth : .88, + layout : 'form', + labelWidth : 60, + items : [{ + xtype : 'textarea', + fieldLabel : '参与人员', + height:100, + id : 'userNames', + name : 'userNames', + allowBlank : true, + disabled:true, + anchor : '98%' + }] + },{ + columnWidth : .12, + layout : 'form', + labelWidth : 60, + items : [{ + xtype : 'button', + text : '参与人员', + listeners:{ + click : function(){ + changeUser(); + } + } + }] + },{ + columnWidth : 1, + layout : 'form', + labelWidth : 60, + items : [{ + xtype : 'textarea', + fieldLabel : '培训内容', + height:100, + id : 'trainingContent', + name : 'trainingContent', + allowBlank : true, + anchor : '100%' + }] + },{ + columnWidth : 1, + layout : 'form', + labelWidth : 60, + items : [{ + xtype : 'textarea', + fieldLabel : '备注', + height:100, + id : 'remark', + name : 'remark', + allowBlank : true, + anchor : '100%' + }] + }] + }], + buttons : [{ + id : 'saveBtn', + text : '保存', + handler : function(){ + save(); + } + }, { + text : '取消', + id : 'saveAndNewBtn', + handler : function(){ + windowForm.close(); + } + }] + }); + windowForm = new top.Ext.Window({ + id : 'messageWin', + layout : 'fit', + title : '培训记录', + width : 700, + modal : true, + autoHeight : true, + border : false, + plain : true, + items : [ formPanel ] + }); + windowForm.show(); + if(id !== ''){ + Ext.Ajax.request({ + url: WWWROOT + '/disinfectSystem/baseData/trainingRecordAction!getTrainingRecord.do?id='+id, + success: function (response, options) { + var result = Ext.decode(response.responseText); + if(result.success){ + top.Ext.getCmp('id').setValue(result.data.id); + top.Ext.getCmp('registrant').setValue(result.data.registrant); + top.Ext.getCmp('trainingTime').setValue(result.data.trainingTimeStr); + top.Ext.getCmp('remark').setValue(result.data.remark); + top.Ext.getCmp('trainer').setValue(result.data.trainer); + top.Ext.getCmp('trainingContent').setValue(result.data.trainingContent); + top.Ext.getCmp('trainingPlace').setValue(result.data.trainingPlace); + top.Ext.getCmp('trainingTopic').setValue(result.data.trainingTopic); + top.Ext.getCmp('userIds').setValue(result.data.userCodes); + top.Ext.getCmp('userNames').setValue(result.data.userNames); + var userIdsArr = result.data.userCodes.split(','); + var newArr = []; + for(var i=0;i 0){ + top.Ext.getCmp('userIdsStr').setValue(newArr.join(',')); + } + }else { + showResult(result.msg); + } + }, + failure: function (response, options) { + var result = Ext.decode(response.responseText); + showResult(result.msg); + } + }) + } +} +function changeUser(){ + var arg = {}; + var userIdsStrElement = top.Ext.getCmp("userIdsStr"); + var userIdsElement = top.Ext.getCmp("userIds"); + var userNamesElement = top.Ext.getCmp("userNames"); + + arg.userIds = userIdsStrElement.getValue(); + arg.userNames = userNamesElement.getValue(); + + arg.userIdsArray = arg.userIds.split(";"); + arg.userNamesArray = arg.userNames.split(";"); + arg.action = 'includeUsers'; + var selectedUsersArray = openModalWindow(WWWROOT+'/common/selPersonByOrgUnitByExt.jsp', arg, '700', '430'); + var userIds = ''; + var userIdsStr = ''; + var userNames = ''; + if(selectedUsersArray == undefined){ + return; + }else if(selectedUsersArray[0] !== undefined){ + for(var i = 0;i 0){ + for(var i = 0;i" + v + ""; + } + var userModel = [ + new Ext.grid.CheckboxSelectionModel(), + {header: 'id', dataIndex: 'id', width: 100, sortable: true, hidden: true}, + {header: '培训主题', dataIndex: 'trainingTopic', width: 100, sortable: true, hidden: false, renderer : renderCallModifyFunction}, + {header: '培训人', dataIndex: 'trainer', width: 100, sortable: true}, + {header: '培训时间', dataIndex: 'trainingTimeStr', width: 100, sortable: true, hidden: false}, + {header: '培训地点', dataIndex: 'trainingPlace', width: 100, sortable: true, hidden: false}, + {header: '登记人', dataIndex: 'registrant', width: 100, sortable: true, hidden: false}, + {header: '备注', dataIndex: 'remark', width: 100, sortable: true, hidden: false} + ]; + trainingRecordStore = new Ext.data.JsonStore({ + autoDestroy: true, + fields: ['id', 'trainer', 'trainingTopic', 'trainingTimeStr', 'trainingPlace', 'registrant', 'remark'], + url: WWWROOT + '/disinfectSystem/baseData/trainingRecordAction!findTrainingRecordList.do', + root: 'data', + baseParams: {}, + //改写分页传递参数 + // paramNames: {start: 'start', limit: 'limit'} + totalProperty: 'totalCount', + listeners: { + + } + }); + trainingRecordStore.load(); + + var renderCallModifyFunction = function(v, p, record){ + var data = record.data; + return "" + v + ""; + } + var trainingRecordPanel = new Ext.grid.GridPanel({ + height:250, + autoScroll :true, + title: ' 培训记录 ', + columnLines: true, + store: trainingRecordStore, + //用于多选 + sm: new Ext.grid.CheckboxSelectionModel(), + columns: userModel, + tbar:new Ext.Toolbar({ items:[{ - region:'west', - id:'west-panel', - layout : 'accordion', - layoutConfig : { - animate : true - }, - collapsible: true, //允许折叠 - animCollapse:true, //折叠时是否有动画效果 - split: true, //是否允许拖动大小,与下面的折叠形式配合 - collapseMode:'mini', //折叠形式 - width: 200, - minSize : 130, - maxSize : 400, - xtype: 'treepanel', - loader: treeLoader, //数据加载 - autoScroll: true, - lines:true, - root: root, - rootVisible:false, - listeners :{click: onClickTreeNode}, - tbar:[ - new Ext.Action({ - text: '展开所有', - handler: function(){ - var treePanel = viewport.findById('west-panel'); - treePanel.expandAll(); + text:'添加', + iconCls:'btn_ext_add', + handler:function(){ + addOrUpdateForm(''); + } + }, '-', { + text:'修改', + iconCls:'btn_ext_edit', + handler:function(){ + var records = trainingRecordPanel.getSelectionModel().getSelections(); + if (records.length == 0) { + showResult("请选择要修改的培训记录!"); + return false; + } + if (records.length > 1) { + showResult("一次只能修改一个培训记录!"); + return false; + } + id = records[0].data['id']; + addOrUpdateForm(id); + } + }, '-', { + text:'删除', + iconCls:'btn_remove', + handler:function(){ + var records = trainingRecordPanel.getSelectionModel().getSelections(); + if (records.length == 0) { + showResult("请选择要删除的培训记录!"); + return false; + } + top.Ext.MessageBox.confirm("请确认","是否删除这 "+records.length+" 条培训记录?",function(button, text) { + if (button == 'yes'){ + var ids = []; + for(var i=0;i