Edit D:\rfid\apache-tomcat-8.5.32\webapps\libsystem\page\circulation\course.jsp
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>???????????</title> <%@ include file="../global/linkcss.jsp" %> <style type="text/css"> .tree-file { background:none !important; } .tree-folder { background:none !important; } .tree-node { height: 26px; white-space: nowrap; cursor: pointer; line-height: 26px; } .tree-expanded, .tree-collapsed, .tree-folder, .tree-file, .tree-checkbox, .tree-indent { display: inline-block; width: 16px; height: 18px; margin: 4px 0; vertical-align: middle; overflow: hidden; } .tree-title { font-size: 12px; display: inline-block; text-decoration: none; vertical-align: middle; white-space: nowrap; padding: 0 2px; margin-top:-4px; height: 18px; line-height: 18px; } </style> </head> <body class="m-top"> <div class="mylayout-div" style="width: 100%;height: 800px;"> <div id="mylayout" class="easyui-layout" data-options="fit:true"> <div id="p" data-options="region:'west',collapsible:false" title="???????????-???(????????????)" style="width:30%;padding:10px"> <ul id="tt" class="easyui-tree" data-options=" animate:true,lines:true, fit:true, onContextMenu:onContextMenuByTree, onSelect:onSelectByTree "></ul> </div> <div class="mylayout-div" data-options="region:'center'" title="??????"> <div class="data-detail" style="height: 400px;overflow :auto;"> </div> <div class="rdr-table-list" style="height: 500px;"> <table title="?????????????" id="rdrDataGridList" class="easyui-datagrid" style="margin-top: -1px;" data-options="singleSelect:true,fit:true,fitColumns:true,pagination:true,striped:true" > <thead> <tr> <th data-options="field:'1'" width="80">???</th> <th data-options="field:'2'" width="80">???</th> <th data-options="field:'3'" width="100">???</th> <th data-options="field:'rdrno'" width="80">???????</th> <th data-options="field:'name'" width="100">???????</th> <th data-options="field:'createdate'" width="80">??????</th> <th data-options="field:'startdate'" width="80">??????</th> </tr> </thead> </table> </div> </div> </div> </div> <div id="mm" class="easyui-menu" style="width:120px;"> <div class="add-yuanxi" onclick="append('0')" data-options="iconCls:' fa fa-plus'">??????</div> <div class="add-kecheng" onclick="append('1')" data-options="iconCls:' fa fa-plus'">??????</div> <div class="add-jiaoshi" onclick="append('2')" data-options="iconCls:' fa fa-plus'">??????</div> <div class="menu-sep"></div> <div class="update-record" onclick="updateRecord()" data-options="iconCls:'fa fa-update'">??????</div> <div class="menu-sep"></div> <div class="delete-record" onclick="removeit()" data-options="iconCls:'fa fa-remove'">??????</div> <div class="menu-sep"></div> <div class="expand-record" onclick="expand()">???</div> <div class="collapse-record" onclick="collapse()">???</div> </div> <!--???????????indow???--> <div id="win" class="easyui-dialog" title="??????????????" style="width:550px;height:500px;padding:10px;" data-options=" modal:true,toolbar:'#dlg-toolbar',closed:true,resizable:false,collapsible:false,minimizable:false,maximizable:false,iconCls:'fa fa-gear', onResize:function(){ $(this).window('center'); }"> <!--???????????--> <div id="dlg-toolbar" style="padding:2px 0"> <table cellpadding="0" cellspacing="0" style="width:100%"> <tr> <td style="padding-left:2px"> <a id="saveRecord" href="javascript:void(0)" class="easyui-linkbutton" data-options="plain:true,iconCls:' fa fa-save'" onclick="saveRecord()">???</a> <a href="javascript:void(0)" class="easyui-linkbutton" data-options="plain:true,iconCls:' fa fa-close'" onclick="closeWin()">???</a> </td> </tr> </table> </div> <div class="table-content"> <input id="id" item-type="record" hidden="hidden"> <input id="parentid" item-type="record" hidden="hidden"> <table class="table-box table-input" style="width:510px;"> <tr> <td>???</td> <td > <input id="name" item-type="record" insert-check="repeat" required="true" class="easyui-textbox" style="width:100%;height: 28px;" data-options="prompt:'????????'"> </td> </tr> <tr style="display: none;"> <td>??????</td> <td> <select id="type" item-type="record" class="easyui-combobox" style="width:100%;height: 28px;" editable="false" data-options="panelHeight:'auto',"> <option value="0">0</option> <option value="1">1</option> <option value="2">2</option> </select> </td> </tr> <tr> <td >????</td> <td ><input id="content" item-type="record" class="easyui-textbox" style="width:100%;height: 80px;" data-options="multiline:true,prompt:'???????'"></td> </tr> <tr> <td >???</td> <td ><input id="note" item-type="record" class="easyui-textbox" style="width:100%;height: 28px;" data-options="prompt:'???????????'"></td> </tr> </table> </div> </div> <%@ include file="../global/easyui-dialog.jsp"%> </body> <%@ include file="../global/linkjs.jsp" %> <script type="text/javascript" src="${pageContext.request.contextPath}/page/global/grid/js/grid.js?version=<%=MyJspUtils.getVersion() %>"></script> <script type="text/javascript"> var treeData = [{ type:'99', text: '???????????', state: 'open', iconCls:"e-icon fa fa-book" }]; $(function() { getTreeDataByPostList(); autoSetPageHeight() }); function autoSetPageHeight(){ var vWindowHeight = $(window).height(); $(".mylayout-div").css("height", vWindowHeight + "px"); $('.easyui-layout').layout('resize'); $('.easyui-panel').panel('resize'); $(".rdr-table-list").css("height", (vWindowHeight-430) + "px"); $('#rdrDataGridList').datagrid('resize'); } function getTreeDataByPostList(){ var url = base_path + 'cir/course/page.do'; var record = {}; $.post(url, record, function(data) { if (data.status == "0") { bulidTreeByData(data); }else{ openMessageDlg(data.message); } }, 'json'); } function bulidTreeByData(data){ if(data.total>0){ var rows = data.rows; var children = []; for(var i = 0;i < rows.length;i++){ if(rows[i].type == "0"){ var node = {}; node.id = rows[i].id; node.text = rows[i].name; node.type = rows[i].type; node.iconCls="e-icon fa fa-university"; node.children = getChildren(node.id,node.type,rows); children.push(node); } } treeData[0].children = children; } $('#tt').tree({ data:treeData }); } function getChildren(id,type,rows){ var children = []; for(var i = 0;i < rows.length;i++){ if(id == rows[i].parentid){ var node = {}; node.id = rows[i].id; node.text = rows[i].name; node.type = rows[i].type; if(node.type == "1"){ node.iconCls="e-icon fa fa-calendar"; node.children = getChildren(node.id,node.type,rows); }else{ node.iconCls="e-icon fa fa-user-circle-o"; } children.push(node); } } return children; } function append(type){ setValue("type",type); $("#win").dialog("open"); } function closeWin(data,isNewRecord){ $("#win").dialog("close"); if(data){ var row = data.rows[0]; var t = $('#tt'); var node = t.tree('getSelected'); if(isNewRecord){ var iconCls = "university"; if(row.type == "1"){ iconCls = "calendar"; } if(row.type == "2"){ iconCls = "user-circle-o"; } t.tree('append', { parent: (node?node.target:null), data: [{ id:row.id, type:row.type, text: row.name, iconCls:"e-icon fa fa-"+iconCls }] }); }else{ var node = $('#tt').tree('getSelected'); if (node){ $('#tt').tree('update', { target: node.target, id:row.id, type:row.type, text: row.name }); } } } } function saveRecord(){ var record = getJsonData(null,'record'); if (!record) { openMessageDlg('??????'); return; } var isNewRecord = true; var url = base_path + 'cir/course/insert.do'; if(record.id){ url = base_path + 'cir/course/update.do'; isNewRecord = false; } $.post(url, record, function(data) { openMessageDlg(data.message); if (data.status == "0") { closeWin(data,isNewRecord); } }, 'json'); } function onContextMenuByTree(e,node){ cleanJsonData('record'); $(".add-yuanxi").hide(); $(".add-kecheng").hide(); $(".add-jiaoshi").hide(); $(".update-record").show(); $(".delete-record").show(); $(".expand-record").hide(); $(".collapse-record").hide(); if(node.type == "99"){ $(".add-yuanxi").show(); $(".expand-record").show(); $(".collapse-record").show(); }else if(node.type == "0"){ $(".add-kecheng").show(); $(".update-record").show(); $(".delete-record").show(); $(".expand-record").show(); $(".collapse-record").show(); }else if(node.type == "1"){ $(".add-jiaoshi").show(); $(".update-record").show(); $(".delete-record").show(); $(".expand-record").show(); $(".collapse-record").show(); }else if(node.type == "1"){ $(".update-record").show(); $(".delete-record").show(); } if(node.id){ setValue("parentid",node.id); } e.preventDefault(); $(this).tree('select',node.target); $('#mm').menu('show',{ left: e.pageX, top: e.pageY }); } function onSelectByTree(node){ var fldArr = [ {"code":"id","name":"?????"}, {"code":"name","name":"???"}, {"code":"content","name":"????"}, {"code":"note","name":"???"} ]; var url = base_path + 'cir/course/get.do'; var param = { 'pk' : node.id }; $.post(url, param, function(data) { var html = ''; var row = data.rows[0]; for(var i = 0; i< fldArr.length;i++){ html +="<div class='div-book-record'><strong>"+ fldArr[i].name +"</strong>," + row[fldArr[i].code] + "</div>"; } $(".data-detail").html(html); }, 'json'); } function updateRecord(){ var node = $('#tt').tree('getSelected'); var url = base_path + 'cir/course/get.do'; var param = { 'pk' : node.id }; $.post(url, param, function(data) { var json = data.rows[0]; setJsonData(null,json); }, 'json'); $("#win").dialog("open"); } function removeit(){ var node = $('#tt').tree('getSelected'); if(node.children && node.children.length>0){ openMessageDlg('???????????????,?????????????????????????????'); return; } $.messager.confirm('??????', '??????????????????', function(r){ if (r){ var url = base_path + 'cir/course/delete.do'; var record = {}; record.pk = node.id; $.post(url, record, function(data) { openMessageDlg(data.message); if (data.status == "0") { $('#tt').tree('remove', node.target); } }, 'json'); } }); } function collapse(){ var node = $('#tt').tree('getSelected'); $('#tt').tree('collapse',node.target); } function expand(){ var node = $('#tt').tree('getSelected'); $('#tt').tree('expand',node.target); } </script> </html>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de