detail.html 3.96 KB
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('通知公告')" />
	<th:block th:include="include :: summernote-css" />
    <th:block th:include="include :: bootstrap-fileinput-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-memo-detail" th:object="${notice}">
            <input id="noticeId" name="noticeId" th:field="*{noticeId}"  type="hidden">
            <div class="form-group">
                <label class="col-sm-2 control-label">类型:</label>
                <div class="col-sm-10">
                    <div class="form-control-static" th:text="${@dict.getLabel('sys_notice_type',notice.noticeType)}"></div>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label is-required">标题:</label>
                <div class="col-sm-10">
                    <div class="form-control-static" th:text="*{noticeTitle}"></div>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label is-required">内容:</label>
                <div class="col-sm-10">
                    <input id="noticeContent" name="noticeContent" th:field="*{noticeContent}" type="hidden">
                    <div id="editor" class="summernote"></div>
                </div>
            </div>

		</form>
        <div class="form-group" style="min-height: 20px;"></div>
        <div class="row">
            <div class="col-sm-10 table-striped col-sm-offset-1">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: summernote-js" />
    <th:block th:include="include :: bootstrap-fileinput-js" />
    <th:block th:include="include :: file-upload-parse" />
    <script th:inline="javascript">
        var prefix = ctx + "business/credit/notice";

	    $(function() {
		    $('.summernote').summernote({
		    	height : 192,
				lang : 'zh-CN',
				followingToolbar: false,
				dialogsInBody: true,
                shortcuts: false,
                disableDragAndDrop: true,
                tabDisable: false,
                toolbar:[]

		    });
			var content = $("#noticeContent").val();
            $('#editor').summernote('pasteHTML', content);
            $('#editor').summernote('destroy');
	    });

		$("#form-memo-detail").validate({
			focusCleanup: true
		});


        $(function() {
            var options = {
                data: [[${notice.fileRespList}]],
                sidePagination: "client",
                showSearch: false,
                showRefresh: false,
                showToggle: false,
                showColumns: false,
                pagination: false,
                pageSize: 10,
                columns: [
                    {
                        field : 'id',
                        title : '文件ID',
                        visible: false
                    },
                    {
                        field : 'fileName',
                        title : '文件名',
                    },
                    {
                        title: '操作',
                        align: 'center',
                        formatter: function(value, row, index) {
                            var actions = [];
                            actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="downloadCloud(\'' + row.filePath + '\')"><i class="fa fa-edit"></i>下载</a> ');
                            return actions.join('');
                        }
                    }]
            };
            $.table.init(options);
        });

        function downloadCloud(fileUrl) {
            window.location.href = ctx + "business/common/oss/download?ossKey=" + encodeURI(fileUrl);
        }

	</script>
</body>
</html>