可以对资源进行增删改

This commit is contained in:
limqhz
2022-05-07 01:52:25 +08:00
parent 69941133b8
commit e65206fa89
38 changed files with 922 additions and 189 deletions

View File

@@ -22,10 +22,15 @@
<span th:text="${#dates.format(source.getGmtUpdate(),'yyyy-MM-dd')}"></span>
类别-
<span th:text="${source.getCategoryName()}"></span>
<a th:href="@{'/source/download/' + ${source.getId()}}" class="btn btn-outline-success col-md-2 float-right">下载</a>
<a href="javascript:downloadFile(this);" class="btn btn-outline-success col-md-2 float-right">下载</a>
</p>
</div>
<div style="display: none">
<form th:action="@{'/source/download/'+${source.getSid()}}" method="post">
<input type="submit" id="downloadTrans" />
</form>
</div>
<input type="hidden" id="sourceDType" name="sourceDType" th:value="${source.getSourceType()}">
<hr style="margin-top: 18px">
<!--文章主体内容-->
@@ -40,15 +45,15 @@
</div>
<div class="col-md-12 source-main" style="margin-top: 20px">
<form th:action="@{'/source/comment/'+${source.getId()}}" method="post">
<form th:action="@{'/source/comment/'+${source.getSid()}}" method="post">
<input type="hidden" name="userId" th:value="${session.loginUser.getUid()}">
<input type="hidden" name="userName" th:value="${session.loginUser.getUsername()}">
<input type="hidden" name="userAvatar" th:value="${session.loginUser.getAvatar()}">
<input type="hidden" name="topicId" th:value="${source.getId()}">
<input type="hidden" id="topicId" name="topicId" th:value="${source.getSid()}">
<div class="form-group">
<textarea name="content" class="form-control" rows="3" required></textarea>
</div>
<button type="submit" class="btn btn-primary float-right">提交评论</button>
<button type="submit" onclick="this.disabled=true; this.form.submit();" class="btn btn-primary float-right">提交评论</button>
</form>
</div>
@@ -96,6 +101,26 @@
<script th:src="@{/editormd/lib/jquery.flowchart.min.js}"></script>
<script th:src="@{/editormd/editormd.js}"></script>
<script type="text/javascript">
function downloadFile(btn){
btn.disabled=true;
var sid = $('#topicId').val();
var sourceDType = $('#sourceDType').val();
if (sourceDType == 'OSS'){
$('#downloadTrans').click();
}else {
$.ajax({
url: "/source/download/" + sid,
async: false,
type: "post",
data: '',
success: function (res) {
window.open(res);
}
});
}
}
</script>
<script type="text/javascript">
var testEditor;
$(function () {
@@ -109,7 +134,6 @@
sequenceDiagram: true, // 默认不解析
codeFold: true
});});
</script>
</body>