|
@@ -63,19 +63,20 @@
|
|
|
</div>
|
|
|
<div class="col-xs-12">
|
|
|
<div class="form-group">
|
|
|
- <label class="col-sm-3 control-label is-required">使用规则:</label>
|
|
|
+ <label class="col-sm-3 control-label is-required">状态:</label>
|
|
|
<div class="col-sm-8">
|
|
|
- <input name="notes" th:field="*{notes}" class="form-control" type="text" maxlength="255">
|
|
|
+ <select name="state" class="form-control" th:with="type=${@dict.getType('sys_job_status')}">
|
|
|
+ <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{state}"></option>
|
|
|
+ </select>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="col-xs-12">
|
|
|
<div class="form-group">
|
|
|
- <label class="col-sm-3 control-label is-required">状态:</label>
|
|
|
+ <label class="col-sm-3 control-label is-required">使用规则:</label>
|
|
|
<div class="col-sm-8">
|
|
|
- <select name="state" class="form-control" th:with="type=${@dict.getType('sys_job_status')}">
|
|
|
- <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{state}"></option>
|
|
|
- </select>
|
|
|
+ <input name="notes" th:field="*{notes}" class="form-control" type="hidden" maxlength="255">
|
|
|
+ <div class="summernote" id="notes"></div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -83,6 +84,8 @@
|
|
|
</div>
|
|
|
<th:block th:include="include :: footer" />
|
|
|
<th:block th:include="include :: datetimepicker-js" />
|
|
|
+ <th:block th:include="include :: summernote-js"/>
|
|
|
+ <th:block th:include="include :: summernote-css"/>
|
|
|
<script th:inline="javascript">
|
|
|
var prefix = ctx + "information";
|
|
|
$("#form-information-edit").validate({
|
|
@@ -100,6 +103,48 @@
|
|
|
minView: "month",
|
|
|
autoclose: true
|
|
|
});
|
|
|
+
|
|
|
+ $(function() {
|
|
|
+ $('.summernote').each(function(i) {
|
|
|
+ console.log($('#' + this.id))
|
|
|
+ $('#' + this.id).summernote({
|
|
|
+ lang: 'zh-CN',
|
|
|
+ dialogsInBody: true,
|
|
|
+ height: 200,
|
|
|
+ callbacks: {
|
|
|
+ onChange: function(contents, $edittable) {
|
|
|
+ $("input[name='" + this.id + "']").val(contents);
|
|
|
+ },
|
|
|
+ onImageUpload: function(files) {
|
|
|
+ var obj = this;
|
|
|
+ var data = new FormData();
|
|
|
+ data.append("file", files[0]);
|
|
|
+ $.ajax({
|
|
|
+ type: "post",
|
|
|
+ url: ctx + "common/upload",
|
|
|
+ data: data,
|
|
|
+ cache: false,
|
|
|
+ contentType: false,
|
|
|
+ processData: false,
|
|
|
+ dataType: 'json',
|
|
|
+ success: function(result) {
|
|
|
+ if (result.code == web_status.SUCCESS) {
|
|
|
+ $('#' + obj.id).summernote('insertImage', result.url);
|
|
|
+ } else {
|
|
|
+ $.modal.alertError(result.msg);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error: function(error) {
|
|
|
+ $.modal.alertWarning("图片上传失败。");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ var content = $("input[name='" + this.id + "']").val();
|
|
|
+ $('#' + this.id).summernote('code', content);
|
|
|
+ })
|
|
|
+ });
|
|
|
</script>
|
|
|
</body>
|
|
|
</html>
|