1.首先在前端js页面有一个函数:
function xmlUpload(id){ layer.open({ type : 2, title : '上传', maxmin : true, shadeClose : false, // 点击遮罩关闭层 area : [ '600px', '300px' ], content : '/dim/dimFault/import/'+id // iframe的url }); }
<了解Layui.layer这个弹层组件>
2:跳转到controller层中执行方法:
/** * xml故障上传 */ @GetMapping("/import/{id}") @RequiresPermissions("dim:dimFault:import") String importHtml(@PathVariable("id") String id,Model model){ model.addAttribute("id", id); return "dim/dimFault/import"; }
3:根据方法中的返回类型,跳转到html中去
<!DOCTYPE html> <html> <meta charset="utf-8"> <head th:include="include :: header"></head> <body class="gray-bg"> <div class="wrapper wrapper-content "> <div class="row"> <div class="col-sm-12"> <div class="ibox float-e-margins"> <div class="ibox-content"> <form class="form-horizontal m-t" id="signupForm" enctype="multipart/form-data"