set.html 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. {%include '../inc/header.html'%}
  5. </head>
  6. <body>
  7. <div class="x-nav">
  8. <span class="layui-breadcrumb">
  9. {% block breadcrumb %}
  10. <a><cite>首页</cite></a>
  11. <a><cite><script>document.write(parent.config.parentTitle)</script></cite></a>
  12. <a><cite><script>document.write(parent.config.subTitle)</script></cite></a>
  13. {% end %}
  14. </span>
  15. <span id="currentUrl"><script>var cur = parent.config.cur;</script></span>
  16. <a class="layui-btn layui-btn-small" style="margin-top:3px;float:right" href="javascript:window.history.back();" title="返回"><i class="layui-icon">&#xe619;</i></a>
  17. </div>
  18. <div class="x-body">
  19. <div class="layui-tab layui-tab-brief">
  20. <div class="layui-tab-content" >
  21. <div class="layui-tab-item layui-show">
  22. <form class="layui-form layui-form-pane" action="{% block action %}{% end %}" method="post" autocomplete="off" target="f1">
  23. {% module xsrf_form_html() %}
  24. <input type="hidden" name="function" id="function" value="msg"/>
  25. <input type="hidden" name="url" id="url" value="{% block url %}{% end %}" />
  26. <input type="hidden" name="project" id="project" value="ai" />
  27. <input type="hidden" name="table" id="table" value="col" />
  28. <input type="hidden" name="id" id="id" value="{% if data['info'] and 'id' in data['info'] and data['info']['id'] > 0 %}{{data['info']['id']}}{% end %}" />
  29. <iframe id="f1" name="f1" style="display:none;"></iframe>
  30. {% block form %}
  31. <div class="layui-form-item">
  32. <label class="layui-form-label">
  33. <span class='x-red'>*</span>网站名称
  34. </label>
  35. <div class="layui-input-block">
  36. <input type="text" name="title" autocomplete="off" placeholder="控制在25个字、50个字节以内"
  37. class="layui-input">
  38. </div>
  39. </div>
  40. <div class="layui-form-item">
  41. <label class="layui-form-label">
  42. <span class='x-red'>*</span>关键词
  43. </label>
  44. <div class="layui-input-block">
  45. <input type="text" name="title" autocomplete="off" placeholder="5个左右,8汉字以内,用英文,隔开"
  46. class="layui-input">
  47. </div>
  48. </div>
  49. <div class="layui-form-item">
  50. <label class="layui-form-label">
  51. <span class='x-red'>*</span>描述
  52. </label>
  53. <div class="layui-input-block">
  54. <input type="text" name="title" autocomplete="off" placeholder="空制在80个汉字,160个字符以内"
  55. class="layui-input">
  56. </div>
  57. </div>
  58. <div class="layui-form-item">
  59. <label class="layui-form-label">
  60. <span class='x-red'>*</span>css、js、images路径配置
  61. </label>
  62. <div class="layui-input-block">
  63. <input type="text" name="title" autocomplete="off" placeholder="默认为空,为相对路径"
  64. class="layui-input">
  65. </div>
  66. </div>
  67. <div class="layui-form-item">
  68. <label class="layui-form-label">
  69. <span class='x-red'>*</span>上传目录配置
  70. </label>
  71. <div class="layui-input-block">
  72. <input type="text" name="title" autocomplete="off" placeholder="默认为uploadfile"
  73. class="layui-input">
  74. </div>
  75. </div>
  76. <div class="layui-form-item">
  77. <label class="layui-form-label">
  78. <span class='x-red'>*</span>底部版权信息
  79. </label>
  80. <div class="layui-input-block">
  81. <input type="text" name="title" autocomplete="off" placeholder="&copy; 2016 X-admin"
  82. class="layui-input">
  83. </div>
  84. </div>
  85. <div class="layui-form-item">
  86. <label class="layui-form-label">
  87. <span class='x-red'>*</span>备案号
  88. </label>
  89. <div class="layui-input-block">
  90. <input type="text" name="title" autocomplete="off" placeholder="京ICP备00000000号"
  91. class="layui-input">
  92. </div>
  93. </div>
  94. <div class="layui-form-item layui-form-text">
  95. <label class="layui-form-label">
  96. <span class='x-red'>*</span>统计代码
  97. </label>
  98. <div class="layui-input-block">
  99. <textarea placeholder="请输入内容" class="layui-textarea"></textarea>
  100. </div>
  101. </div>
  102. {% end %}
  103. <div class="layui-form-item">
  104. <button class="layui-btn" lay-submit lay-filter="update">
  105. 保存
  106. </button>
  107. </div>
  108. </form>
  109. <div style="height:100px;"></div>
  110. </div>
  111. </div>
  112. </div>
  113. </div>
  114. {%include '../inc/footer.html'%}
  115. {%include '../inc/script.html'%}
  116. <script>
  117. layui.use(['laydate', 'form','layer','layedit','upload'], function(){
  118. $ = layui.jquery;
  119. var form = layui.form()
  120. var layer = layui.layer
  121. var layedit = layui.layedit;
  122. if ($('.time').length) {
  123. laydate = layui.laydate;//日期插件
  124. var date = {
  125. //min: laydate.now()
  126. max: '2099-06-16 23:59:59'
  127. ,format: 'YYYY-MM-DD hh:mm:ss'
  128. ,istoday: true
  129. ,istime: true
  130. };
  131. $('.time').each(function()
  132. {
  133. $(this).click(function()
  134. {
  135. date.elem = this;
  136. laydate(date);
  137. })
  138. })
  139. }
  140. var xsrf = getCookie("_xsrf");
  141. var uploadUrl = '/upload?_xsrf='+xsrf;
  142. layedit.set({
  143. uploadImage: {
  144. url: uploadUrl
  145. ,type: 'post'
  146. }
  147. });
  148. layui.upload({
  149. url: uploadUrl
  150. ,success: function(res, input){ //上传成功后的回调
  151. var id = $(input).attr('id').replace('upload_', '');
  152. $('#upload_' + id + '_show').attr('src',res.data.src + '?v' + Date.parse(new Date())).show();
  153. $('#update_' + id).val(res.data.src);
  154. }
  155. });
  156. if ($('.layui-editor').length) {
  157. $('.layui-editor').each(function()
  158. {
  159. id = $(this).attr('id');
  160. var index = layedit.build(id);
  161. layedit.sync(index)
  162. });
  163. }
  164. {% block script %}
  165. {% end %}
  166. form.on('submit(update)');
  167. });
  168. </script>
  169. </body>
  170. </html>