导入修改为模板渲染

pull/105/MERGE
RuoYi 2019-06-15 11:24:03 +08:00
parent ce18a9e86d
commit 91dd624048
3 changed files with 9 additions and 5 deletions

View File

@ -271,8 +271,7 @@
},
// 导入数据
importExcel: function(formId) {
var currentId = $.common.isEmpty(formId) ? 'importForm' : formId;
$.form.reset(currentId);
var currentId = $.common.isEmpty(formId) ? 'importTpl' : formId;
layer.open({
type: 1,
area: ['400px', '230px'],
@ -281,7 +280,7 @@
maxmin: true,
shade: 0.3,
title: '导入' + $.table._option.modalName + '数据',
content: $('#' + currentId),
content: $('#' + currentId).html(),
btn: ['<i class="fa fa-check"></i> 导入', '<i class="fa fa-remove"></i> 取消'],
// 弹层外区域关闭
shadeClose: true,

View File

@ -108,7 +108,8 @@
</script>
</body>
<!-- 导入区域 -->
<form id="importForm" enctype="multipart/form-data" class="mt20 mb10" style="display: none;">
<script id="importTpl" type="text/template">
<form enctype="multipart/form-data" class="mt20 mb10">
<div class="col-xs-offset-1">
<input type="file" id="file" name="file"/>
<div class="mt10 pt5">
@ -120,4 +121,5 @@
</font>
</div>
</form>
</script>
</html>

View File

@ -243,7 +243,9 @@
}
</script>
</body>
<form id="importForm" enctype="multipart/form-data" class="mt20 mb10" style="display: none;">
<!-- 导入区域 -->
<script id="importTpl" type="text/template">
<form enctype="multipart/form-data" class="mt20 mb10">
<div class="col-xs-offset-1">
<input type="file" id="file" name="file"/>
<div class="mt10 pt5">
@ -255,4 +257,5 @@
</font>
</div>
</form>
</script>
</html>