示例图:
1. jsp页面
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html lang="en">
<head>
<base href="<%=basePath%>">
<!-- 下拉框 -->
<link rel="stylesheet" href="static/ace/css/chosen.css" />
<!-- jsp文件头和头部 -->
<%@ include file="../../system/index/top.jsp"%>
<!-- 日期框 -->
<link rel="stylesheet" href="static/ace/css/datepicker.css" />
<link rel="stylesheet" href="static/layui/css/layui.css" />
<style type="text/css">
.layui-upload-list {
position: relative;
display: flex;
flex-wrap: wrap;
}
.layui-upload-list div{
position: relative;
}
.layui-upload-list div .delete{
position: absolute;
top: 0px;
right: 10px;
width: 20px;
height: 20px;
border-radius: 100%;
background-color: #FFF;
color: red;
font-weight: bold;
}
.layui-upload-img {
width: 92px;
height: 92px;
margin: 0px 10px 0px 10px;
}
.layui-upload-audio {
width: 300px;
height: 50px;
margin: 0px 10px 0px 10px;
}
.layui-upload-video {
width: 300px;
height: auto;
margin: 0px 10px 0px 10px;
}
</style>
</head>
<body class="no-skin">
<!-- /section:basics/navbar.layout -->
<div class="main-container" id="main-container">
<!-- /section:basics/sidebar -->
<div class="main-content">
<div class="main-content-inner">
<div class="page-content">
<div class="row">
<div class="col-xs-12">
<form action="info/${msg }.do" name="Form" id="Form" method="post">
<input type="hidden" name="INFO_ID" id="INFO_ID" value="${pd.INFO_ID}"/>
<div id="zhongxin" style="padding-top: 13px;">
<table id="table_report" class="table table-striped table-bordered table-hover">
<tr>
<td style="width:75px;text-align: right;padding-top: 13px;">图片:</td>
<td>
<div class="layui-upload">
<button type="button" class="layui-btn" id="uploadPics">上传图片</button><span style="color:red"> *仅上传图片格式:jpg,jpeg,png,bmp,gif</span>
<div class="layui-upload-list" id="demo1"></div>
</div>
<input type="hidden" name="PICTURES" id="PICTURES" value="${pd.PICTURES}" style="width:98%;margin-top: 10px"/>
<input type="hidden" name="THUMBNAILS" id="THUMBNAILS" value="${pd.THUMBNAILS}" style="width:98%;"/>
</td>
</tr>
<tr>
<td style="width:75px;text-align: right;padding-top: 13px;">音频:</td>
<td>
<div class="layui-upload">
<button type="button" class="layui-btn" id="uploadAudios">上传音频</button><span style="color:red"> *仅上传音频格式:wav,mp3,ogg,webm</span>
<div class="layui-upload-list" id="demo2"></div>
</div>
<input type="hidden" name="AUDIOS" id="AUDIOS" value="${pd.AUDIOS}" style="width:98%;margin-top: 10px"/>
</td>
</tr>
<tr>
<td style="width:75px;text-align: right;padding-top: 13px;">视频:</td>
<td>
<div class="layui-upload">
<button type="button" class="layui-btn" id="uploadVideos">上传视频</button><span style="color:red"> *仅上传视频格式:mp4,webm,ogg</span>
<div class="layui-upload-list" id="demo3"></div>
</div>
<input type="hidden" name="VIDEOS" id="VIDEOS" value="${pd.VIDEOS}" style="width:98%;margin-top: 10px"/>
</td>
</tr>
<tr>
<td colspan="2">
<input type="hidden" name="APPENDIXS" id="APPENDIXS" value="${pd.APPENDIXS}" style="width:98%;margin-top: 10px"/>
<div class="layui-upload" style="margin-bottom:25px">
<button type="button" class="layui-btn" id="uploadFiles">上传文件</button><span style="color:red"> *仅上传文件格式:pdf</span>
<div class="layui-upload-list">
<table class="layui-table">
<thead>
<tr>
<th>文件名</th>
<th>状态</th>
<th style="width:240px">操作</th>
</tr>
</thead>
<tbody id="demo4">
</tbody>
</table>
</div>
</div>
</td>
</tr>
<tr>
<td style="text-align: center;" colspan="10">
<a class="btn btn-mini btn-primary" onclick="save();">保存</a>
<a class="btn btn-mini btn-danger" onclick="top.Dialog.close();">取消</a>
</td>
</tr>
</table>
</div>
<div id="zhongxin2