|
@@ -56,22 +56,51 @@
|
|
|
<textarea id="content" name="content" required>[[${data.content}]]</textarea>
|
|
<textarea id="content" name="content" required>[[${data.content}]]</textarea>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="row cl">
|
|
|
|
|
|
|
+ <div class="row cl" th:id="upload_file">
|
|
|
<label class="form-label col-xs-4 col-sm-2"><span>上传附件:</span></label>
|
|
<label class="form-label col-xs-4 col-sm-2"><span>上传附件:</span></label>
|
|
|
<div class="formControls col-xs-8 col-sm-9">
|
|
<div class="formControls col-xs-8 col-sm-9">
|
|
|
- <div class="uploader-thum-container">
|
|
|
|
|
- <div id="fileListPre" class="uploader-list">
|
|
|
|
|
- <th:block th:unless="${data.fileDown==null || data.fileDown.file_url== null}">
|
|
|
|
|
- <a th:href=" ${fileUrl} + ${data.fileDown.file_url}" target="_blank">[[${data.fileDown.file_name}]]</a>
|
|
|
|
|
- </th:block>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div id="filePicker">上传</div>
|
|
|
|
|
- <th:block th:switch="${data.fileDown==null || data.fileDown.file_url== null}">
|
|
|
|
|
- <input th:case="true" type="hidden" name="fileDown.file_id" id="files">
|
|
|
|
|
- <input th:case="false" type="hidden" name="fileDown.file_id" id="files"
|
|
|
|
|
- th:value="${data.fileDown.file_id}">
|
|
|
|
|
|
|
+ <!-- <div class="uploader-thum-container">-->
|
|
|
|
|
+ <!-- <div id="fileListPre" class="uploader-list">-->
|
|
|
|
|
+ <!-- <th:block th:unless="${data.fileDown==null || data.fileDown.file_url== null}">-->
|
|
|
|
|
+ <!-- <a th:href=" ${fileUrl} + ${data.fileDown.file_url}" target="_blank">[[${data.fileDown.file_name}]]</a>-->
|
|
|
|
|
+ <!-- </th:block>-->
|
|
|
|
|
+ <!-- </div>-->
|
|
|
|
|
+ <!-- <div id="filePicker">上传</div>-->
|
|
|
|
|
+ <!-- <th:block th:switch="${data.fileDown==null || data.fileDown.file_url== null}">-->
|
|
|
|
|
+ <!-- <input th:case="true" type="hidden" name="fileDown.file_id" id="files">-->
|
|
|
|
|
+ <!-- <input th:case="false" type="hidden" name="fileDown.file_id" id="files"-->
|
|
|
|
|
+ <!-- th:value="${data.fileDown.file_id}">-->
|
|
|
|
|
+ <!-- </th:block>-->
|
|
|
|
|
+ <!-- </div>-->
|
|
|
|
|
+ <div><i class="Hui-iconfont" style="cursor: pointer;"
|
|
|
|
|
+ th:onclick="'javascript:addFileLine(\'upload_file\')'"> 添加</i></div>
|
|
|
|
|
+ <table class="table table-border table-bordered table-bg table-hover ">
|
|
|
|
|
+ <thead>
|
|
|
|
|
+ <tr class="text-c">
|
|
|
|
|
+ <th>文件</th>
|
|
|
|
|
+ <th>操作</th>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ </thead>
|
|
|
|
|
+ <tbody class="add_file_line" th:id="'tbody_upload_file'">
|
|
|
|
|
+ <th:block th:unless="${data.fileList==null}"
|
|
|
|
|
+ th:each="item,itemStat: ${data.fileList}">
|
|
|
|
|
+ <tr class="text-c">
|
|
|
|
|
+ <td class="td_material">
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <input class="uploadFileName btn btn-upload radius" name="uploadFileName"
|
|
|
|
|
+ readonly="readonly"
|
|
|
|
|
+ type="text" th:value="${item.file_name}"
|
|
|
|
|
+ th:onclick="'javascript:addFileByName(\'/land_supply/addApplyFile\',this);'"/>
|
|
|
|
|
+ <input class="uploadFileId" type="hidden" th:value="${item.file_id}"
|
|
|
|
|
+ th:name="'fileList['+${itemStat.index}+'].file_id'"/>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ <td class="icon_font"><i class='Hui-iconfont' onclick='removeLine(this)'> 删除</i>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ </tr>
|
|
|
</th:block>
|
|
</th:block>
|
|
|
- </div>
|
|
|
|
|
|
|
+ </tbody>
|
|
|
|
|
+ </table>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div th:if="*{canAsk}" th:each="item,itemStat: ${consulDepartmentList}">
|
|
<div th:if="*{canAsk}" th:each="item,itemStat: ${consulDepartmentList}">
|
|
@@ -80,7 +109,7 @@
|
|
|
<label class="form-label col-xs-4 col-sm-2"></label>
|
|
<label class="form-label col-xs-4 col-sm-2"></label>
|
|
|
<div class="formControls col-xs-8 col-sm-9">
|
|
<div class="formControls col-xs-8 col-sm-9">
|
|
|
<div><i class="Hui-iconfont" style="cursor: pointer;"
|
|
<div><i class="Hui-iconfont" style="cursor: pointer;"
|
|
|
- th:onclick="'javascript:addFileLine(\''+'department'+${item.id}+'\')'"> 添加</i></div>
|
|
|
|
|
|
|
+ th:onclick="'javascript:addQuestionLine(\''+'department'+${item.id}+'\')'"> 添加</i></div>
|
|
|
<table class="table table-border table-bordered table-bg table-hover ">
|
|
<table class="table table-border table-bordered table-bg table-hover ">
|
|
|
<thead>
|
|
<thead>
|
|
|
<tr class="text-c">
|
|
<tr class="text-c">
|
|
@@ -341,7 +370,7 @@
|
|
|
dataType: "json",
|
|
dataType: "json",
|
|
|
data: {
|
|
data: {
|
|
|
state: state,
|
|
state: state,
|
|
|
- content_text:editor.text()
|
|
|
|
|
|
|
+ content_text: editor.text()
|
|
|
},
|
|
},
|
|
|
success: function (data) {
|
|
success: function (data) {
|
|
|
if (data.success) {
|
|
if (data.success) {
|
|
@@ -426,7 +455,7 @@
|
|
|
var departmentList = [[${consulDepartmentList}]];
|
|
var departmentList = [[${consulDepartmentList}]];
|
|
|
var index = departmentList.length;
|
|
var index = departmentList.length;
|
|
|
|
|
|
|
|
- function addFileLine(divId) {
|
|
|
|
|
|
|
+ function addQuestionLine(divId) {
|
|
|
var length = index;
|
|
var length = index;
|
|
|
if ($("#" + divId).find('.add_file_line>tr').length > 0) {
|
|
if ($("#" + divId).find('.add_file_line>tr').length > 0) {
|
|
|
var html = "<i class='Hui-iconfont' onclick='removeLine(this)'> 删除</i>";
|
|
var html = "<i class='Hui-iconfont' onclick='removeLine(this)'> 删除</i>";
|
|
@@ -451,6 +480,40 @@
|
|
|
index++;
|
|
index++;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ var fileList = [[${data.fileList}]];
|
|
|
|
|
+ var file_index = fileList.length;
|
|
|
|
|
+
|
|
|
|
|
+ function addFileLine(divId) {
|
|
|
|
|
+ if (file_index == undefined) {
|
|
|
|
|
+ file_index = 0
|
|
|
|
|
+ }
|
|
|
|
|
+ var length = file_index;
|
|
|
|
|
+ if ($("#" + divId).find('.add_file_line>tr').length > 0) {
|
|
|
|
|
+ var html = "<i class='Hui-iconfont' onclick='removeLine(this)'> 删除</i>";
|
|
|
|
|
+ $("#" + divId).find(".add_file_line tr:eq(0)").clone().insertAfter($("#" + divId).find('.add_file_line>tr').eq(-1))
|
|
|
|
|
+ .find(".uploadFileId").removeAttr("name").attr("name", "fileList[" + length + "].file_id").val("").end()
|
|
|
|
|
+ .find(".uploadFileName").val("上传文件").end()
|
|
|
|
|
+ .find(".icon_font").html(html).end();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ var str = "";
|
|
|
|
|
+ str += "<tr class='text-c'>"
|
|
|
|
|
+ str += "<td class='td_material'>"
|
|
|
|
|
+ str += "<div>"
|
|
|
|
|
+ str += "<input class='uploadFileName btn btn-upload radius' name='uploadFileName' readonly='readonly' type='text' value='上传文件' onclick=\"addFileByName('/land_supply/addApplyFile',this);\"/>"
|
|
|
|
|
+ str += "<input class='uploadFileId' hidden name='fileList[" + length + "].file_id'/>"
|
|
|
|
|
+ str += "</div>"
|
|
|
|
|
+ str += "</td>"
|
|
|
|
|
+ str += "<td class='icon_font'><i class='Hui-iconfont' onclick='removeLine(this)'> 删除</i>"
|
|
|
|
|
+ str += "</td>"
|
|
|
|
|
+ str += "</tr>"
|
|
|
|
|
+
|
|
|
|
|
+ $("#tbody_" + divId).html(str);
|
|
|
|
|
+ }
|
|
|
|
|
+ $('#layui-layer2').height(48);
|
|
|
|
|
+ file_index++;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
// function addFileLine(divId) {
|
|
// function addFileLine(divId) {
|
|
|
// // var length = $("#" + divId).find(".add_file_line tr").length;
|
|
// // var length = $("#" + divId).find(".add_file_line tr").length;
|
|
|
// var length = index;
|
|
// var length = index;
|
|
@@ -473,6 +536,13 @@
|
|
|
// $('#layui-layer2').height(48);
|
|
// $('#layui-layer2').height(48);
|
|
|
// }
|
|
// }
|
|
|
|
|
|
|
|
|
|
+ //添加相应name的文件
|
|
|
|
|
+ function addFileByName(url, obj) {
|
|
|
|
|
+ var name = $(obj).next().attr("name");
|
|
|
|
|
+ url += "?fileIdName=" + name;
|
|
|
|
|
+ layer_show('添加文件', pagePath + url, 800, 350);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
function removeLine(obj) {
|
|
function removeLine(obj) {
|
|
|
$(obj).parent().parent().remove();
|
|
$(obj).parent().parent().remove();
|
|
|
}
|
|
}
|