心理咨询网
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

label.html 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. {include file='common/head.html'}
  2. <div class="layui-body">
  3. {if([$list])}
  4. <div class="layui-tab layui-tab-brief" lay-filter="tab">
  5. <ul class="layui-tab-title">
  6. <li class="layui-this" lay-id="t1">标签内容</li>
  7. <li lay-id="t2">标签管理</li>
  8. <li lay-id="t3">新增标签</li>
  9. </ul>
  10. <div class="layui-tab-content">
  11. <div class="layui-tab-item layui-show">
  12. <form action="{url./admin/Label/index}" method="post" class="layui-form">
  13. <input type="hidden" name="formcheck" value="{$formcheck}" >
  14. {foreach $labels(key,value)}
  15. {if($value->type==1)} <!-- 文本 -->
  16. <div class="layui-form-item">
  17. <label class="layui-form-label">[value->description]<br><span class="layui-badge layui-bg-gray">{label:[value->name]}</span></label>
  18. <div class="layui-input-block">
  19. <input type="text" name="[value->name]" value="[value->value]" placeholder="请输入[value->description]" class="layui-input">
  20. </div>
  21. </div>
  22. {/if}
  23. {if($value->type==2)}<!-- 日期 -->
  24. <div class="layui-form-item">
  25. <label class="layui-form-label">[value->description]<br><span class="layui-badge layui-bg-gray">{label:[value->name]}</span></label>
  26. <div class="layui-input-block">
  27. <input type="text" name="[value->name]" readonly value="[value->value]" placeholder="请选择[value->description]" class="layui-input datetime">
  28. </div>
  29. </div>
  30. {/if}
  31. {if($value->type==3)}<!-- 图片 -->
  32. <div class="layui-form-item">
  33. <label class="layui-form-label">[value->description]<br><span class="layui-badge layui-bg-gray">{label:[value->name]}</span></label>
  34. <div class="layui-input-inline">
  35. <input type="text" name="[value->name]" id="[value->name]" value="[value->value]" placeholder="请上传[value->description]" class="layui-input">
  36. </div>
  37. <button type="button" class="layui-btn upload" data-des="[value->name]">
  38. <i class="layui-icon">&#xe67c;</i>上传图片
  39. </button>
  40. <div id="[value->name]_box" class="pic">{if($value->value)}<dl><dt><img src="{SITE_DIR}[value->value]" data-url="[value->value]"></dt><dd>删除</dd></dl>{/if}</div>
  41. </div>
  42. {/if}
  43. {if($value->type==4)}<!-- 文件 -->
  44. <div class="layui-form-item">
  45. <label class="layui-form-label">[value->description]<br><span class="layui-badge layui-bg-gray">{label:[value->name]}</span></label>
  46. <div class="layui-input-inline">
  47. <input type="text" name="[value->name]" id="[value->name]" value="[value->value]" placeholder="请上传[value->description]" class="layui-input">
  48. </div>
  49. <button type="button" class="layui-btn file" data-des="[value->name]">
  50. <i class="layui-icon">&#xe67c;</i>上传文件
  51. </button>
  52. </div>
  53. {/if}
  54. {if($value->type==5)}<!-- 编辑器 -->
  55. <div class="layui-form-item">
  56. <label class="layui-form-label">[value->description]<br><span class="layui-badge layui-bg-gray">{label:[value->name]}</span></label>
  57. <div class="layui-input-block">
  58. <script type="text/plain" id="[value->name]" name="[value->name]" style="width:100%;height:240px;">{fun=decode_string($value->value)}</script>
  59. </div>
  60. </div>
  61. <script>
  62. //初始化编辑器
  63. $(document).ready(function (e) {
  64. var ue = UE.getEditor('[value->name]',{
  65. maximumWords:500
  66. });
  67. })
  68. </script>
  69. {/if}
  70. {if($value->type==6)} <!-- 开关 -->
  71. <div class="layui-form-item">
  72. <label class="layui-form-label">[value->description]<br><span class="layui-badge layui-bg-gray">{label:[value->name]}</span></label>
  73. <div class="layui-input-block">
  74. <input type="radio" name="[value->name]" value="1" title="开启" {if($value->value)}checked{/if}>
  75. <input type="radio" name="[value->name]" value="0" title="关闭" {if(!$value->value)}checked{/if}>
  76. </div>
  77. </div>
  78. {/if}
  79. {if($value->type==7)} <!-- 多行文本 -->
  80. <div class="layui-form-item">
  81. <label class="layui-form-label">[value->description]<br><span class="layui-badge layui-bg-gray">{label:[value->name]}</span></label>
  82. <div class="layui-input-block">
  83. <textarea name="[value->name]" class="layui-textarea" placeholder="请输入[value->description]">{fun=str_replace("<br>","\r\n",html_entity_decode($value->value))}</textarea>
  84. </div>
  85. </div>
  86. {/if}
  87. {/foreach}
  88. <div class="layui-form-item">
  89. <div class="layui-input-block">
  90. <button class="layui-btn" lay-submit>立即提交</button>
  91. <button type="reset" class="layui-btn layui-btn-primary">重置</button>
  92. </div>
  93. </div>
  94. </form>
  95. </div>
  96. <div class="layui-tab-item">
  97. <table class="layui-table">
  98. <thead>
  99. <tr>
  100. <th>序号</th>
  101. <th>名称</th>
  102. <th>描述</th>
  103. <th>类型</th>
  104. <th>添加人员</th>
  105. <th>修改人员</th>
  106. <th>添加时间</th>
  107. <th>修改时间</th>
  108. <th>操作</th>
  109. </tr>
  110. </thead>
  111. <tbody>
  112. {foreach $labels(key,value,num)}
  113. <tr>
  114. <td>[num]</td>
  115. <td>[value->name]</td>
  116. <td>[value->description]</td>
  117. <td>
  118. {if($value->type==1)}单行文本{/if}
  119. {if($value->type==7)}多行文本{/if}
  120. {if($value->type==2)}时间{/if}
  121. {if($value->type==3)}图片{/if}
  122. {if($value->type==4)}附件{/if}
  123. {if($value->type==5)}编辑器{/if}
  124. {if($value->type==6)}开关{/if}
  125. </td>
  126. <td>[value->create_user]</td>
  127. <td>[value->update_user]</td>
  128. <td>[value->create_time]</td>
  129. <td>[value->update_time]</td>
  130. <td>
  131. {fun=get_btn_del($value->id)}
  132. {fun=get_btn_mod($value->id)}
  133. </td>
  134. </tr>
  135. {/foreach}
  136. </tbody>
  137. </table>
  138. </div>
  139. <div class="layui-tab-item">
  140. <form action="{url./admin/Label/add}" method="post" class="layui-form">
  141. <input type="hidden" name="formcheck" value="{$formcheck}" >
  142. <div class="layui-form-item">
  143. <label class="layui-form-label">标签名称</label>
  144. <div class="layui-input-block">
  145. <input type="text" name="name" required lay-verify="required" placeholder="请输入标签名称" class="layui-input">
  146. <div class="layui-form-mid layui-word-aux">只能含有字母、数字、下划线</div>
  147. </div>
  148. </div>
  149. <div class="layui-form-item">
  150. <label class="layui-form-label">标签描述</label>
  151. <div class="layui-input-block">
  152. <input type="text" name="description" required lay-verify="required" placeholder="请输入标签描述" class="layui-input">
  153. </div>
  154. </div>
  155. <div class="layui-form-item">
  156. <label class="layui-form-label">标签类型</label>
  157. <div class="layui-input-block">
  158. <select name="type" lay-verify="required">
  159. <option value="1">单行文本</option>
  160. <option value="7">多行文本</option>
  161. <option value="2">时间</option>
  162. <option value="3">图片</option>
  163. <option value="4">附件</option>
  164. <option value="5">编辑器</option>
  165. <option value="6">开关</option>
  166. </select>
  167. </div>
  168. </div>
  169. <div class="layui-form-item">
  170. <div class="layui-input-block">
  171. <button class="layui-btn" lay-submit>立即提交</button>
  172. <button type="reset" class="layui-btn layui-btn-primary">重置</button>
  173. </div>
  174. </div>
  175. </form>
  176. </div>
  177. </div>
  178. </div>
  179. {/if}
  180. {if([$mod])}
  181. <div class="layui-tab layui-tab-brief" lay-filter="tab">
  182. <ul class="layui-tab-title">
  183. <li class="layui-this">标签修改</li>
  184. </ul>
  185. <div class="layui-tab-content">
  186. <div class="layui-tab-item layui-show">
  187. <form action="{url./admin/Label/mod/id/'.[$get.id].'}{$backurl}" method="post" class="layui-form">
  188. <input type="hidden" name="formcheck" value="{$formcheck}" >
  189. <div class="layui-form-item">
  190. <label class="layui-form-label">标签名称</label>
  191. <div class="layui-input-block">
  192. <input type="text" name="name" required lay-verify="required" value="{$label->name}" placeholder="请输入标签名称" class="layui-input">
  193. <div class="layui-form-mid layui-word-aux">只能含有字母、数字、下划线</div>
  194. </div>
  195. </div>
  196. <div class="layui-form-item">
  197. <label class="layui-form-label">标签描述</label>
  198. <div class="layui-input-block">
  199. <input type="text" name="description" required lay-verify="required" value="{$label->description}" placeholder="请输入标签描述" class="layui-input">
  200. </div>
  201. </div>
  202. <div class="layui-form-item">
  203. <label class="layui-form-label">标签类型</label>
  204. <div class="layui-input-block">
  205. <select name="type" lay-verify="required">
  206. <option value="1" {if([$label->type]==1)}selected{/if}>单行文本</option>
  207. <option value="7" {if([$label->type]==7)}selected{/if}>多行文本</option>
  208. <option value="2" {if([$label->type]==2)}selected{/if}>时间</option>
  209. <option value="3" {if([$label->type]==3)}selected{/if}>图片</option>
  210. <option value="4" {if([$label->type]==4)}selected{/if}>附件</option>
  211. <option value="5" {if([$label->type]==5)}selected{/if}>编辑器</option>
  212. <option value="6" {if([$label->type]==6)}selected{/if}>开关</option>
  213. </select>
  214. </div>
  215. </div>
  216. <div class="layui-form-item">
  217. <div class="layui-input-block">
  218. <button class="layui-btn" lay-submit>立即提交</button>
  219. <button type="reset" class="layui-btn layui-btn-primary">重置</button>
  220. {fun=get_btn_back()}
  221. </div>
  222. </div>
  223. </form>
  224. </div>
  225. </div>
  226. </div>
  227. {/if}
  228. </div>
  229. {include file='common/ueditor.html'}
  230. {include file='common/foot.html'}