|
@@ -35,16 +35,59 @@
|
|
<h4>
|
|
<h4>
|
|
<span class="fa fa-cloud-upload" id="code-assign" aria-hidden="true"></span>
|
|
<span class="fa fa-cloud-upload" id="code-assign" aria-hidden="true"></span>
|
|
<span class="info">附件</span>
|
|
<span class="info">附件</span>
|
|
|
|
+ <div style="float: right;margin-right: 90px">
|
|
|
|
+ <input type="button" class="btn btn-success" value="新增" onclick="addFile()">
|
|
|
|
+ <input type="button" class="btn btn-info" value="上传" onclick="uploadFile()">
|
|
|
|
+ </div>
|
|
|
|
+
|
|
</h4>
|
|
</h4>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<div class="modal-body" style="max-height: 70vh;overflow-y: scroll;">
|
|
<div class="modal-body" style="max-height: 70vh;overflow-y: scroll;">
|
|
<form class="form-horizontal" role="form">
|
|
<form class="form-horizontal" role="form">
|
|
|
|
+ <div class="group-item">
|
|
|
|
+ <div class="form-group">
|
|
|
|
+ <label class="col-sm-2 control-label">附件名称:</label>
|
|
|
|
+ <div class="col-sm-10">
|
|
|
|
+ <input type="text" class="fname form-control" id="filename" placeholder="附件名称" value="">
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="form-group">
|
|
|
|
+ <label class="col-sm-2 control-label">附件地址:</label>
|
|
|
|
+ <div class="col-sm-10">
|
|
|
|
+ <input type="text" class="furl form-control" id="downloadurl" placeholder="附件下载地址" value="">
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="form-group">
|
|
|
|
+ <label class="col-sm-2 control-label">本地文件:</label>
|
|
|
|
+ <div class="col-sm-5">
|
|
|
|
+ <input type="file" name="file" class="ffile" id="uploadfile-add">
|
|
|
|
+ </div>
|
|
|
|
+<!-- <div style="float: right;margin-right: 158px">-->
|
|
|
|
+<!-- <input type="button" class="btn btn-success" value="新增" onclick="addFile()">-->
|
|
|
|
+<!-- <input type="button" class="btn btn-info" value="上传" onclick="uploadFile()">-->
|
|
|
|
+<!-- </div>-->
|
|
|
|
+ </div>
|
|
|
|
+ <!-- <div class="form-group">-->
|
|
|
|
+ <!-- <label class="col-sm-2 control-label">附件名称:</label>-->
|
|
|
|
+ <!-- <div class="col-sm-5">-->
|
|
|
|
+ <!-- <input type="text" class="fname form-control" id="filename" placeholder="附件名称.类型" value="">-->
|
|
|
|
+ <!-- </div>-->
|
|
|
|
+ <!-- <input type="button" class="btn btn-info" value="新增" onclick="addFile()">-->
|
|
|
|
+ <!-- <input type="button" class="btn btn-info" value="上传" onclick="uploadFile()">-->
|
|
|
|
+ <!-- </div>-->
|
|
|
|
+ </div>
|
|
<div id="TaskDiv">
|
|
<div id="TaskDiv">
|
|
<div id="itemDiv" style="display: none">
|
|
<div id="itemDiv" style="display: none">
|
|
|
|
+ <div class="form-group">
|
|
|
|
+ <label class="col-sm-2 control-label">附件名称:</label>
|
|
|
|
+ <div class="col-sm-10">
|
|
|
|
+ <input type="text" class="fname form-control" placeholder="附件名称" value="">
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
<div class="form-group">
|
|
<div class="form-group">
|
|
<label class="col-sm-2 control-label">附件地址:</label>
|
|
<label class="col-sm-2 control-label">附件地址:</label>
|
|
- <div class="col-sm-5">
|
|
|
|
|
|
+ <div class="col-sm-10">
|
|
<input type="text" class="furl form-control" placeholder="附件下载地址" value="">
|
|
<input type="text" class="furl form-control" placeholder="附件下载地址" value="">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -54,7 +97,7 @@
|
|
<input type="file" name="file" class="ffile" id="uploadfile-add-0">
|
|
<input type="file" name="file" class="ffile" id="uploadfile-add-0">
|
|
</div>
|
|
</div>
|
|
<div style="float: right;margin-right: 158px">
|
|
<div style="float: right;margin-right: 158px">
|
|
- <input type="button" class="btn btn-info" value="删除" onclick="removeFile(this)">
|
|
|
|
|
|
+ <input type="button" class="btn btn-danger" value="删除" onclick="removeFile(this)">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- <div class="form-group">-->
|
|
<!-- <div class="form-group">-->
|
|
@@ -65,32 +108,6 @@
|
|
<!-- </div>-->
|
|
<!-- </div>-->
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- <div class="group-item">
|
|
|
|
- <div class="form-group">
|
|
|
|
- <label class="col-sm-2 control-label">附件地址:</label>
|
|
|
|
- <div class="col-sm-5">
|
|
|
|
- <input type="text" class="furl form-control" id="downloadurl" placeholder="附件下载地址" value="">
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- <div class="form-group">
|
|
|
|
- <label class="col-sm-2 control-label">本地文件:</label>
|
|
|
|
- <div class="col-sm-5">
|
|
|
|
- <input type="file" name="file" class="ffile" id="uploadfile-add">
|
|
|
|
- </div>
|
|
|
|
- <div style="float: right;margin-right: 100px">
|
|
|
|
- <input type="button" class="btn btn-info" value="新增" onclick="addFile()">
|
|
|
|
- <input type="button" class="btn btn-info" value="上传" onclick="uploadFile()">
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
-<!-- <div class="form-group">-->
|
|
|
|
-<!-- <label class="col-sm-2 control-label">附件名称:</label>-->
|
|
|
|
-<!-- <div class="col-sm-5">-->
|
|
|
|
-<!-- <input type="text" class="fname form-control" id="filename" placeholder="附件名称.类型" value="">-->
|
|
|
|
-<!-- </div>-->
|
|
|
|
-<!-- <input type="button" class="btn btn-info" value="新增" onclick="addFile()">-->
|
|
|
|
-<!-- <input type="button" class="btn btn-info" value="上传" onclick="uploadFile()">-->
|
|
|
|
-<!-- </div>-->
|
|
|
|
- </div>
|
|
|
|
</form>
|
|
</form>
|
|
<!--</div> -->
|
|
<!--</div> -->
|
|
</div>
|
|
</div>
|
|
@@ -171,6 +188,7 @@
|
|
edit_data_tmp["detail"] = edit_detail
|
|
edit_data_tmp["detail"] = edit_detail
|
|
edit_data_tmp["contenthtml"] = edit_contentHtml
|
|
edit_data_tmp["contenthtml"] = edit_contentHtml
|
|
edit_data_tmp["summary"] = edit_summary
|
|
edit_data_tmp["summary"] = edit_summary
|
|
|
|
+ var attachments = {{.T.attachments}}
|
|
function parse(str) {
|
|
function parse(str) {
|
|
return JSON.stringify(str, null, "\t")
|
|
return JSON.stringify(str, null, "\t")
|
|
}
|
|
}
|
|
@@ -302,6 +320,23 @@
|
|
}
|
|
}
|
|
|
|
|
|
function showUploadFileModal() {
|
|
function showUploadFileModal() {
|
|
|
|
+ $("#TaskDiv > div.group-item").remove();
|
|
|
|
+ var baseok = false;
|
|
|
|
+ for (var index in attachments){
|
|
|
|
+ var tmp = attachments[index];
|
|
|
|
+ var filename = tmp.filename;
|
|
|
|
+ var url = tmp.org_url;
|
|
|
|
+ if (!baseok){
|
|
|
|
+ $("#filename").val(tmp.filename);
|
|
|
|
+ $("#downloadurl").val(tmp.org_url);
|
|
|
|
+ baseok = true;
|
|
|
|
+ }else{
|
|
|
|
+ var tNode = $('#itemDiv').clone().addClass('group-item').addClass('clone-template').show()
|
|
|
|
+ tNode.find(".fname").val(filename);
|
|
|
|
+ tNode.find(".furl").val(url);
|
|
|
|
+ $('#TaskDiv').append($(tNode))
|
|
|
|
+ }
|
|
|
|
+ }
|
|
$('#uploadfile').modal("show");
|
|
$('#uploadfile').modal("show");
|
|
}
|
|
}
|
|
|
|
|
|
@@ -327,7 +362,10 @@
|
|
if (fFile === undefined) {
|
|
if (fFile === undefined) {
|
|
throw "请选择本地文件";
|
|
throw "请选择本地文件";
|
|
}
|
|
}
|
|
- var fName = $(this).find("input.ffile").val();
|
|
|
|
|
|
+ var fName = $(this).find("input.fname").val();//优先取附件名称,
|
|
|
|
+ if (fName == ""){
|
|
|
|
+ fName = $(this).find("input.ffile").val();//取本地上传文件的名称
|
|
|
|
+ }
|
|
var nameArr = fName.split('\\');
|
|
var nameArr = fName.split('\\');
|
|
fName = nameArr[nameArr.length-1];
|
|
fName = nameArr[nameArr.length-1];
|
|
if (!fileNameReg.test(fName.toLowerCase())){
|
|
if (!fileNameReg.test(fName.toLowerCase())){
|