心理咨询网
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.

model.html 8.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  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. </ul>
  9. <div class="layui-tab-content">
  10. <div class="layui-tab-item layui-show">
  11. <table class="layui-table">
  12. <thead>
  13. <tr>
  14. <th>序号</th>
  15. <th>名称</th>
  16. <th>类型</th>
  17. <th>URL名称</th>
  18. <th>列表页模板</th>
  19. <th>详情页模板</th>
  20. <th>状态</th>
  21. <th>操作</th>
  22. </tr>
  23. </thead>
  24. <tbody>
  25. {foreach $models(key,value)}
  26. <tr>
  27. <td>[num]</td>
  28. <td>[value->name]</td>
  29. <td>
  30. {if($value->type==1)}单页{/if}
  31. {if($value->type==2)}列表{/if}
  32. </td>
  33. <td>[value->urlname]</td>
  34. <td>[value->listtpl]</td>
  35. <td>[value->contenttpl]</td>
  36. <td>
  37. {if($value->status)}
  38. <a href="{url./admin/'.C.'/mod/id/'.$value->id.'/field/status/value/0}" class="switch"><i class='fa fa-toggle-on' title="点击禁用"></i></a>
  39. {else}
  40. <a href="{url./admin/'.C.'/mod/id/'.$value->id.'/field/status/value/1}" class="switch"><i class='fa fa-toggle-off' title="点击启用"></i></a>
  41. {/if}
  42. </td>
  43. <td>
  44. {if(!$value->issystem)}
  45. {fun=get_btn_del($value->id)}
  46. {/if}
  47. {fun=get_btn_mod($value->id)}
  48. </td>
  49. </tr>
  50. {/foreach}
  51. </tbody>
  52. </table>
  53. <div class="page">{$pagebar}</div>
  54. </div>
  55. <div class="layui-tab-item">
  56. <form action="{url./admin/Model/add}" method="post" class="layui-form">
  57. <input type="hidden" name="formcheck" value="{$formcheck}" >
  58. <div class="layui-form-item">
  59. <label class="layui-form-label">模型名称 <span class="layui-text-red">*</span></label>
  60. <div class="layui-input-block">
  61. <input type="text" name="name" required lay-verify="required" placeholder="请输入模型名称" class="layui-input">
  62. </div>
  63. </div>
  64. <div class="layui-form-item">
  65. <label class="layui-form-label">模型类型 <span class="layui-text-red">*</span></label>
  66. <div class="layui-input-block">
  67. <select name="type" lay-verify="required">
  68. <option value="">请选择模型类型</option>
  69. <option value="1">单页</option>
  70. <option value="2">列表</option>
  71. </select>
  72. </div>
  73. </div>
  74. <div class="layui-form-item">
  75. <label class="layui-form-label">URL名称 </label>
  76. <div class="layui-input-block">
  77. <input type="text" name="urlname" placeholder="请输入URL地址名称,如:news" class="layui-input">
  78. </div>
  79. </div>
  80. <div class="layui-form-item">
  81. <label class="layui-form-label">列表页模板</label>
  82. <div class="layui-input-block">
  83. <input type="text" name="listtpl" placeholder="请输入列表页模板" class="layui-input">
  84. </div>
  85. </div>
  86. <div class="layui-form-item">
  87. <label class="layui-form-label">详情页模板</label>
  88. <div class="layui-input-block">
  89. <input type="text" name="contenttpl" placeholder="请输入详情页模板" class="layui-input">
  90. </div>
  91. </div>
  92. <div class="layui-form-item">
  93. <label class="layui-form-label">状态</label>
  94. <div class="layui-input-block">
  95. <input type="radio" name="status" value="1" title="启用" checked>
  96. <input type="radio" name="status" value="0" title="禁用">
  97. </div>
  98. </div>
  99. <div class="layui-form-item">
  100. <div class="layui-input-block">
  101. <button class="layui-btn" lay-submit>立即提交</button>
  102. <button type="reset" class="layui-btn layui-btn-primary">重置</button>
  103. </div>
  104. </div>
  105. </form>
  106. </div>
  107. </div>
  108. </div>
  109. {/if}
  110. {if([$mod])}
  111. <div class="layui-tab layui-tab-brief" lay-filter="tab">
  112. <ul class="layui-tab-title">
  113. <li class="layui-this">模型修改</li>
  114. </ul>
  115. <div class="layui-tab-content">
  116. <div class="layui-tab-item layui-show">
  117. <form action="{url./admin/Model/mod/id/'.[$get.id].'}{$backurl}" method="post" class="layui-form">
  118. <input type="hidden" name="formcheck" value="{$formcheck}" >
  119. <div class="layui-form-item">
  120. <label class="layui-form-label">模型名称 <span class="layui-text-red">*</span></label>
  121. <div class="layui-input-block">
  122. <input type="text" name="name" required lay-verify="required" value="{$model->name}" placeholder="请输入模型名称" class="layui-input">
  123. </div>
  124. </div>
  125. <div class="layui-form-item">
  126. <label class="layui-form-label">模型类型 <span class="layui-text-red">*</span></label>
  127. <div class="layui-input-block">
  128. <select name="type" lay-verify="required">
  129. <option value="">请选择模型类型</option>
  130. <option value="1" {if([$model->type]==1)}selected{/if}>单页</option>
  131. <option value="2" {if([$model->type]==2)}selected{/if}>列表</option>
  132. </select>
  133. </div>
  134. </div>
  135. <div class="layui-form-item">
  136. <label class="layui-form-label">URL名称</label>
  137. <div class="layui-input-block">
  138. <input type="text" name="urlname" value="{$model->urlname}" placeholder="请输入URL地址名称,如:news" class="layui-input">
  139. </div>
  140. </div>
  141. <div class="layui-form-item">
  142. <label class="layui-form-label">列表页模板</label>
  143. <div class="layui-input-block">
  144. <input type="text" name="listtpl" value="{$model->listtpl}" placeholder="请输入列表页模板" class="layui-input">
  145. </div>
  146. </div>
  147. <div class="layui-form-item">
  148. <label class="layui-form-label">详情页模板</label>
  149. <div class="layui-input-block">
  150. <input type="text" name="contenttpl" value="{$model->contenttpl}" placeholder="请输入详情页模板" class="layui-input">
  151. </div>
  152. </div>
  153. <div class="layui-form-item">
  154. <label class="layui-form-label">状态</label>
  155. <div class="layui-input-block">
  156. <input type="radio" name="status" value="1" title="启用" {if([$model->status]==1)}checked{/if}>
  157. <input type="radio" name="status" value="0" title="禁用" {if([$model->status]==0)}checked{/if}>
  158. </div>
  159. </div>
  160. <div class="layui-form-item">
  161. <div class="layui-input-block">
  162. <button class="layui-btn" lay-submit>立即提交</button>
  163. <button type="reset" class="layui-btn layui-btn-primary">重置</button>
  164. {fun=get_btn_back()}
  165. </div>
  166. </div>
  167. </form>
  168. </div>
  169. </div>
  170. </div>
  171. {/if}
  172. </div>
  173. {include file='common/foot.html'}