add.html 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. <!DOCTYPE html>
  2. <html lang="zh" xmlns:th="http://www.thymeleaf.org" >
  3. <head>
  4. <th:block th:include="include :: header('新增招标网工程类爬虫')" />
  5. <th:block th:include="include :: datetimepicker-css" />
  6. <th:block th:include="include :: summernote-css" />
  7. </head>
  8. <body class="white-bg">
  9. <div class="wrapper wrapper-content animated fadeInRight ibox-content">
  10. <form class="form-horizontal m" id="form-gc-add">
  11. <div class="form-group">
  12. <label class="col-sm-3 control-label">标题:</label>
  13. <div class="col-sm-8">
  14. <input name="title" class="form-control" type="text">
  15. </div>
  16. </div>
  17. <div class="form-group">
  18. <label class="col-sm-3 control-label">招标省市:</label>
  19. <div class="col-sm-8">
  20. <input name="addr" class="form-control" type="text">
  21. </div>
  22. </div>
  23. <div class="form-group">
  24. <label class="col-sm-3 control-label">标文规范:</label>
  25. <div class="col-sm-8">
  26. <input name="rule" class="form-control" type="text">
  27. </div>
  28. </div>
  29. <div class="form-group">
  30. <label class="col-sm-3 control-label">发布时间:</label>
  31. <div class="col-sm-8">
  32. <div class="input-group date">
  33. <input name="time" class="form-control" placeholder="yyyy-MM-dd" type="text">
  34. <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
  35. </div>
  36. </div>
  37. </div>
  38. <div class="form-group">
  39. <label class="col-sm-3 control-label">转载信息:</label>
  40. <div class="col-sm-8">
  41. <input name="other" class="form-control" type="text">
  42. </div>
  43. </div>
  44. <div class="form-group">
  45. <label class="col-sm-3 control-label">标书类型:</label>
  46. <div class="col-sm-8">
  47. <select name="type" class="form-control m-b" th:with="type=${@dict.getType('gc_type')}">
  48. <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
  49. </select>
  50. </div>
  51. </div>
  52. <div class="form-group">
  53. <label class="col-sm-3 control-label">文章详情地址:</label>
  54. <div class="col-sm-8">
  55. <input name="url" class="form-control" type="text">
  56. </div>
  57. </div>
  58. <div class="form-group">
  59. <label class="col-sm-3 control-label">检索关键词:</label>
  60. <div class="col-sm-8">
  61. <input name="searchKey" class="form-control" type="text">
  62. </div>
  63. </div>
  64. <div class="form-group">
  65. <label class="col-sm-3 control-label">部门类型:</label>
  66. <div class="col-sm-8">
  67. <select name="depType" class="form-control m-b" th:with="type=${@dict.getType('gc_dep')}">
  68. <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
  69. </select>
  70. </div>
  71. </div>
  72. <div class="form-group">
  73. <label class="col-sm-3 control-label">部门名称:</label>
  74. <div class="col-sm-8">
  75. <input name="dep" class="form-control" type="text">
  76. </div>
  77. </div>
  78. <div class="form-group">
  79. <label class="col-sm-3 control-label">招标价格:</label>
  80. <div class="col-sm-8">
  81. <input name="price" class="form-control" type="text">
  82. </div>
  83. </div>
  84. <div class="form-group">
  85. <label class="col-sm-3 control-label">标书详细内容:</label>
  86. <div class="col-sm-8">
  87. <input type="hidden" class="form-control" name="word">
  88. <div class="summernote" id="word"></div>
  89. </div>
  90. </div>
  91. </form>
  92. </div>
  93. <th:block th:include="include :: footer" />
  94. <th:block th:include="include :: datetimepicker-js" />
  95. <th:block th:include="include :: summernote-js" />
  96. <script th:inline="javascript">
  97. var prefix = ctx + "system/gc"
  98. $("#form-gc-add").validate({
  99. focusCleanup: true
  100. });
  101. function submitHandler() {
  102. if ($.validate.form()) {
  103. $.operate.save(prefix + "/add", $('#form-gc-add').serialize());
  104. }
  105. }
  106. $("input[name='time']").datetimepicker({
  107. format: "yyyy-mm-dd",
  108. minView: "month",
  109. autoclose: true
  110. });
  111. $(function() {
  112. $('.summernote').summernote({
  113. lang: 'zh-CN',
  114. dialogsInBody: true,
  115. callbacks: {
  116. onChange: function(contents, $edittable) {
  117. $("input[name='" + this.id + "']").val(contents);
  118. },
  119. onImageUpload: function(files) {
  120. var obj = this;
  121. var data = new FormData();
  122. data.append("file", files[0]);
  123. $.ajax({
  124. type: "post",
  125. url: ctx + "common/upload",
  126. data: data,
  127. cache: false,
  128. contentType: false,
  129. processData: false,
  130. dataType: 'json',
  131. success: function(result) {
  132. if (result.code == web_status.SUCCESS) {
  133. $('#' + obj.id).summernote('insertImage', result.url);
  134. } else {
  135. $.modal.alertError(result.msg);
  136. }
  137. },
  138. error: function(error) {
  139. $.modal.alertWarning("图片上传失败。");
  140. }
  141. });
  142. }
  143. }
  144. });
  145. });
  146. </script>
  147. </body>
  148. </html>