fix:会议详情文件下载

pg_adapter
wangxy 8 months ago
parent b9a6103109
commit 074e1865f0

@ -12,7 +12,7 @@
<div class="row">
<div class="col-sm-12">
<div class="form-group">
<label class="col-sm-2 control-label is-required">会议主题:</label>
<label class="col-sm-2 control-label">会议主题:</label>
<div class="col-sm-10">
<input name="meetingTitle" disabled="disabled" required placeholder="请输入会议主题" th:field="*{meetingTitle}" class="form-control m-b" type="text">
</div>
@ -22,7 +22,7 @@
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">会议时间:</label>
<label class="col-sm-4 control-label">会议时间:</label>
<div class="col-sm-8">
<input type="text" class="form-control m-b" disabled="disabled" placeholder="请选择会议时间" th:value="${#dates.format(meeting.meetingTime, 'yyyy-MM-dd')}" name="meetingTime"></input>
</div>
@ -58,7 +58,7 @@
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">会议类型:</label>
<label class="col-sm-4 control-label">会议类型:</label>
<div class="col-sm-8">
<select name="meetingType" disabled="disabled" required class="form-control m-b" th:with="type=${@dict.getType('sys_meeting_type')}">
<option value="">---请选择---</option>
@ -69,7 +69,7 @@
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">会议状态:</label>
<label class="col-sm-4 control-label">会议状态:</label>
<div class="col-sm-8">
<select name="meetingState" disabled="disabled" required class="form-control m-b" th:with="type=${@dict.getType('sys_meeting_state')}">
<option value="">---请选择---</option>
@ -81,17 +81,16 @@
</div>
<div class="row">
<div class="col-sm-12">
<div class="form-group">
<label class="col-sm-2 control-label is-required">上传文件:</label>
<div class="fileinput fileinput-new col-sm-10" data-provides="fileinput">
<label class="col-sm-2 control-label">上传文件:</label>
<div class="col-sm-8">
<span class="btn btn-white btn-file">
<span disabled="disabled" class="fileinput-new">选择文件</span>
<span disabled="disabled" class="fileinput-exists">更改</span>
<input disabled="disabled" type="file" id="fileUrlId" name="...">
<input disabled="disabled" type="hidden" id="fileUrl" name="fileUrl" th:field="*{fileUrl}">
<input disabled="disabled" type="hidden" id="fileName" name="fileName" th:field="*{fileName}">
<span class="fileinput-filename" onclick="downloadFile()">文件下载</span>
<input type="hidden" id="fileUrl" name="confAgreement" th:field="*{fileUrl}" >
</span>
<span disabled="disabled" class="fileinput-filename">[[*{fileName}]]</span>
<span class="fileinput-filename">[[*{fileName}]]</span>
<a href="#" class="close fileinput-exists" data-dismiss="fileinput" style="float: none"> </a>
</div>
</div>
</div>
@ -126,35 +125,12 @@
minView: "month",
autoclose: true
});
//文件上传
$('#fileUrlId').on('change.bs.fileinput ', function (e) {
// 处理自己的业务
var file = e.target.files[0];
var data = new FormData();
data.append("file", file);
$.ajax({
type: "POST",
url: ctx + "common/upload",
data: data,
cache: false,
contentType: false,
processData: false,
dataType: 'json',
success: function(result) {
if (result.code == web_status.SUCCESS) {
$("#fileUrl").val(result.url);
$("#fileName").val(result.originalFilename);
} else {
$("#fileUrl").val("");
$("#fileName").val("");
}
},
error: function(error) {
$.modal.alertWarning("文件上传失败。");
function downloadFile(){
var fileUrl = $("#fileUrl").val();
window.location.href = ctx + "common/download/resource?resource=" + encodeURI(fileUrl) ;
}
});
});
</script>
</body>
</html>

Loading…
Cancel
Save