lajicheng 2020-03-04 21:53 采纳率: 0%
浏览 315

easyui页面显示,就是在主页面显示另一个页面,那个页面没有完整的显示出来,但是在地址栏上输入那个页面的地址,那个页面就完整的显示,这怎么农

使用easyui做的main.jsp和busCarsManager.jsp
在main.jsp点击车辆管理即busCarsManager.jsp,显示成了这样
如下图
图片说明
在地址栏输入该页面url地址
图片说明
怎么弄好??
以下是main.jsp代码

Basic Form - jQuery EasyUI Demo





<br> $(function() {<br> $(&#39;#tt&#39;).tree({<br> //点击菜单事件<br> onClick: function(node){<br> //如果选项的url为空,null,直接退出,在页面不变<br> if(node.url==&quot;&quot;||node.url==null){<br> return;<br> }<br> //如果选项卡存在<br> var flag=$(&#39;#tab&#39;).tabs(&#39;exists&#39;,node.text);<br> //存在的条件下,选中,显示其内容<br> if(flag){<br> $(&#39;#tab&#39;).tabs(&#39;select&#39;,node.text);<br> }else{<br> $(&#39;#tab&#39;).tabs(&#39;add&#39;,{<br> title: node.text,<br> href:node.url,<br> closable:true</p> <pre><code> }); } } }); }); &lt;/script&gt; </code></pre> <p><title>汽车租赁系统</title><br> </head><br> <body class="easyui-layout"></p> <pre><code>&lt;div data-options=&quot;region:&#39;north&#39;,split:true&quot; style=&quot;height:100px;background: url(&#39;images/绿色.jpg&#39;)&quot;&gt; &lt;div style=&quot;margin-left: 120px;margin-top: 30px;float:left;&quot;&gt; &lt;span style=&quot;font-size: 32px;color:orange;font-weight:bold;&quot;&gt;汽车租赁系统&lt;/span&gt; &lt;/div&gt; &lt;div style=&quot;float: right ;margin-top: 60px;margin-right: 30px&quot;&gt; &lt;span style=&quot;font-size: 18px;color: red;&quot;&gt;欢迎admin用户登录&lt;/span&gt; &lt;a style=&quot;font-size: 18px;color: red;text-decoration: none&quot;&gt;注销&lt;/a&gt; &lt;/div&gt; &lt;/div&gt; &lt;div data-options=&quot;region:&#39;south&#39;,title:&#39;版权信息&#39;,split:true&quot; style=&quot;height:200px;background: url(&#39;images/版权信息.png&#39;); background-repeat: no-repeat;background-color: silver;background-position: center;&quot;&gt;&lt;/div&gt; &lt;div data-options=&quot;region:&#39;east&#39;,title:&#39;East&#39;,split:true&quot; style=&quot;width:200px;&quot;&gt; &lt;div id=&quot;date&quot; class=&quot;easyui-calendar&quot; style=&quot;width:180px;height:200px;&quot;&gt;&lt;/div&gt; &lt;/div&gt; &lt;div data-options=&quot;region:&#39;west&#39;,title:&#39;West&#39;,split:true&quot; style=&quot;width:150px;&quot;&gt; &lt;div id=&quot;menu&quot; class=&quot;easyui-accordion&quot; data-options=&quot;fit:true,border:false&quot;&gt; &lt;div title=&quot;类别一&quot;&gt; &lt;ul id=&quot;tt&quot; class=&quot;easyui-tree&quot; url=&quot;SysMenusController/findMoreMenus&quot;&gt;&lt;/ul&gt; &lt;/div&gt; &lt;div title=&quot;类别二&quot;&gt;&lt;/div&gt; &lt;div title=&quot;类别三&quot;&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;div data-options=&quot;region:&#39;center&#39;&quot; style=&quot;background:#eee;&quot;&gt; &lt;div id=&quot;tab&quot; class=&quot;easyui-tabs&quot; data-options=&quot;fit:true&quot;&gt; &lt;div title=&quot;默认页&quot;&gt; &lt;img src=&quot;images/默认页.jpeg&quot; width=&quot;90%&quot; height=&quot;90%&quot;&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p></body></p> <p>以下是busCarsManager.jsp代码<br> <body data-options="fit:true"></p> <table id="busCarsManger_dg" title="My Cars" class="easyui-datagrid" style="width:600px;height:250px" url="/busCarsController/findAllBusCars" toolbar="#busCarsManger_toolbar" pagination="true" rownumbers="true" fitColumns="true" singleSelect="true"> <thead> <tr> <th field="carnumber" width="50">汽车牌号</th> <th field="lastname" width="50">汽车类型</th> <th field="pice" width="50">汽车价格</th> <th field="description" width="50">汽车描述</th> <th data-options="field:'carimg',formatter:showImage" width="50">汽车图片</th> </tr> </thead> </table> <pre><code>&lt;div id=&quot;busCarsManger_toolbar&quot;&gt; &lt;a href=&quot;javascript:void(0)&quot; class=&quot;easyui-linkbutton&quot; iconCls=&quot;icon-add&quot; plain=&quot;true&quot; onclick=&quot;newCars()&quot;&gt;新增汽车&lt;/a&gt; &lt;a href=&quot;javascript:void(0)&quot; class=&quot;easyui-linkbutton&quot; iconCls=&quot;icon-edit&quot; plain=&quot;true&quot; onclick=&quot;editCars()&quot;&gt;修改汽车信息&lt;/a&gt; &lt;a href=&quot;javascript:void(0)&quot; class=&quot;easyui-linkbutton&quot; iconCls=&quot;icon-remove&quot; plain=&quot;true&quot; onclick=&quot;destroyCars()&quot;&gt;移除&lt;/a&gt; &lt;/div&gt; &lt;div id=&quot;busCarsManger_dlg&quot; class=&quot;easyui-dialog&quot; style=&quot;width:500px&quot; data-options=&quot;closed:true,modal:true,border:&#39;thin&#39;,buttons:&#39;#busCarsManger_dlg-buttons&#39;&quot;&gt; &lt;form id=&quot;busCarsManger_fm&quot; method=&quot;post&quot; novalidate style=&quot;margin:0;padding:20px 50px&quot;&gt; &lt;h3&gt;汽车信息&lt;/h3&gt; &lt;div style=&quot;margin-bottom:10px&quot;&gt; &lt;input name=&quot;carnumber&quot; class=&quot;easyui-textbox&quot; required=&quot;true&quot; label=&quot;汽车牌号:&quot; style=&quot;width:100%&quot;&gt; &lt;/div&gt; &lt;div style=&quot;margin-bottom:10px&quot;&gt; &lt;input name=&quot;cartype&quot; class=&quot;easyui-textbox&quot; required=&quot;true&quot; label=&quot;汽车类型:&quot; style=&quot;width:100%&quot;&gt; &lt;/div&gt; &lt;div style=&quot;margin-bottom:10px&quot;&gt; &lt;input name=&quot;color&quot; class=&quot;easyui-textbox&quot; required=&quot;true&quot; label=&quot;汽车颜色&quot; style=&quot;width:100%&quot;&gt; &lt;/div&gt; &lt;div style=&quot;margin-bottom:10px&quot;&gt; &lt;input name=&quot;price&quot; class=&quot;easyui-textbox&quot; required=&quot;true&quot; label=&quot;汽车价格&quot; style=&quot;width:100%&quot;&gt; &lt;/div&gt; &lt;div style=&quot;margin-bottom:10px&quot;&gt; &lt;input name=&quot;rentprice&quot; class=&quot;easyui-textbox&quot; required=&quot;true&quot; label=&quot;汽车租金&quot; style=&quot;width:100%&quot;&gt; &lt;/div&gt; &lt;div style=&quot;margin-bottom:10px&quot;&gt; &lt;input name=&quot;deposit&quot; class=&quot;easyui-textbox&quot; required=&quot;true&quot; label=&quot;汽车押金&quot; style=&quot;width:100%&quot;&gt; &lt;/div&gt; &lt;div style=&quot;margin-bottom:10px&quot;&gt; &lt;input name=&quot;description&quot; class=&quot;easyui-textbox&quot; required=&quot;true&quot; label=&quot;汽车描述&quot; style=&quot;width:100%&quot;&gt; &lt;/div&gt; &lt;input type=&quot;text&quot; name=&quot;carimg&quot; id=&quot;carimg&quot;&gt; &lt;/form&gt; &lt;form id=&quot;fm2&quot; method=&quot;post&quot; enctype=&quot;multipart/form-data&quot; style=&quot;margin:0;padding:20px 50px&quot;&gt; &lt;div style=&quot;margin-bottom:10px&quot;&gt; &lt;input name=&quot;fil&quot; class=&quot;easyui-filebox&quot; label=&quot;汽车图片&quot; style=&quot;width:70%&quot;&gt; &lt;a href=&quot;javascript:void(0)&quot; class=&quot;easyui-linkbutton c6&quot; iconCls=&quot;icon-ok&quot; onclick=&quot;fileUpload()&quot; style=&quot;width:100px&quot;&gt;上传图片&lt;/a&gt; &lt;/div&gt; &lt;span id=&quot;sp1&quot;&gt;&lt;/span&gt; &lt;/form&gt; &lt;/div&gt; &lt;div id=&quot;busCarsManger_dlg-buttons&quot;&gt; &lt;a href=&quot;javascript:void(0)&quot; class=&quot;easyui-linkbutton c6&quot; iconCls=&quot;icon-ok&quot; onclick=&quot;saveCars()&quot; style=&quot;width:90px&quot;&gt;Save&lt;/a&gt; &lt;a href=&quot;javascript:void(0)&quot; class=&quot;easyui-linkbutton&quot; iconCls=&quot;icon-cancel&quot; onclick=&quot;javascript:$(&#39;#dlg&#39;).dialog(&#39;close&#39;)&quot; style=&quot;width:90px&quot;&gt;Cancel&lt;/a&gt; &lt;/div&gt; &lt;script type=&quot;text/javascript&quot;&gt; //全局参数地址 var url; //删除车辆系信息操作 function destroyCars(){ //当表格信息被选中 var row= $(&#39;#busCarsManger_dg&#39;).datagrid(&#39;getSelected&#39;); if(row){ //提示是否删除 $.messager.confirm(&quot;提示&quot;,&quot;是否删除该车辆信息&quot;,function(flag){ if(flag){ //发送Ajax请求,通过控制器执行删除车辆操作 $.post(&quot;busCarsController/removeBusCars&quot;,{&#39;carnumber&#39;:row.carnumber},function(result){ if(result&gt;0){ //删除成功重新加载表格数据 $(&quot;#busCarsManger_dg&quot;).datagrid(&quot;reload&quot;); }else{ $.messager.alert(&quot;警告&quot;,&quot;删除失败&quot;,&quot;error&quot;); } }) } }) }else //提示请选中至少一行 $.messager.alert(&quot;提示&quot;,&quot;请选中当前信息表的一行数据&quot;,&quot;info&quot;); } //修改车辆信息 function editCars(){ //当数据表格被选中 var row= $(&#39;#busCarsManger_dg&#39;).datagrid(&#39;getSelected&#39;); if(row){ //执行修改操作,打开修改对话框 $(&quot;#busCarsManger_dlg&quot;).dialog(&quot;open&quot;).dialog(&quot;center&quot;).dialog(&quot;setTitle&quot;,&quot;修改汽车信息&quot;) //加载当前选中信息行的数据,在表单一中回显 $(&quot;busCarsManger_fm&quot;).form(&quot;load&quot;,row); //表单二中图片的回显,不是用append方法,是因为每次点击修改就会加一个图片,故只用文本显示方法html $(&quot;#sp1&quot;).html(&quot;&lt;img src=&#39;images/&quot;+result.url+&quot;&#39;width=&#39;80px&#39;/&gt;&quot;) //点击保存时,实现修改操作,跳转到当前车辆信息表 url:&quot;busCarsController/changeBusCars&quot;; }else{ $.messager.alert(&quot;提示&quot;,&quot;请选中当前信息表的一行数据&quot;,&quot;info&quot;); } } //文件上传的操作 function fileUpload(){ //提交form表单 $(&#39;#fm2&#39;).form(&#39;submit&#39;,{ url: &quot;busCarsController/fileUpload&quot;, success: function(result){ var result=eval(&#39;(&#39;+result+&#39;)&#39;); if(result.url){ //防止在执行修改车辆信息操作,上传图片时,需要清空表单二的图片,防止出现两个图片 $(&quot;#sp1&quot;).empty(); //显示图片 $(&quot;#sp1&quot;).append(&quot;&lt;img src=&#39;images/&quot;+result.url+&quot;&#39;width=&#39;80px&#39;/&gt;&quot;) //将图片名字赋值给隐藏域 $(&quot;#carimg&quot;).val(&quot;result.url&quot;); }else{ $.messager.alert(&quot;提示&quot;,&quot;图片上传失败&quot;,&quot;error&quot;); } } }); } //保存车辆信息 function saveCars(){ //获得表单的所有内容 var val =$(&quot;busCarsManger_fm&quot;).serialize(); $.post(url,val,function(result){ if(result&gt;0){ //关闭当前的对话框 $(&quot;#busCarsManger_dlg&quot;).dialog(&quot;close&quot;) //刷新后面的表格 $(&quot;#busCarsManger_dg&quot;).datagrid(&quot;reload&quot;); } }) } 添加车辆信息 function newCars(){ //添加新增对话框信息 $(&quot;#busCarsManger_dlg&quot;).dialog(&quot;open&quot;).dialog(&quot;center&quot;).dialog(&quot;setTitle&quot;,&quot;新增汽车&quot;) //清除表单之前的内容 $(&quot;busCarsManger_fm&quot;).form(&quot;clear&quot;) //清除图片表单项,要不然下次打开还在 $(&quot;#fm2&quot;).form(&quot;clear&quot;) //清除图片显示 $(&quot;#sp1&quot;).empty(); url=&quot;busCarsController/saveBusCars&quot;; } function showImage(val){ return &quot;&lt;img src=&#39;images/&quot;+val+&quot;&#39; width=&#39;80px&#39;/&gt;&quot;; } &lt;/script&gt; </code></pre> <p></body></p>
  • 写回答

1条回答 默认 最新

  • WaitIKnowYou 2023-09-09 18:47
    关注

    单纯的静态资源 404了吧,放行资源或者配置正确的资源路径

    评论

报告相同问题?

悬赏问题

  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题
  • ¥30 python代码,帮调试
  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿