index.html 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  1. <style type="text/css">
  2. @media (max-width: 375px) {
  3. .edit-form tr td input {
  4. width: 100%;
  5. }
  6. .edit-form tr th:first-child, .edit-form tr td:first-child {
  7. width: 20%;
  8. }
  9. .edit-form tr th:nth-last-of-type(-n+2), .edit-form tr td:nth-last-of-type(-n+2) {
  10. display: none;
  11. }
  12. }
  13. .edit-form table > tbody > tr td a.btn-delcfg {
  14. visibility: hidden;
  15. }
  16. .edit-form table > tbody > tr:hover td a.btn-delcfg {
  17. visibility: visible;
  18. }
  19. .ai-measure-tips {
  20. background: #f8f9fa;
  21. border: 1px solid #e9ecef;
  22. border-radius: 4px;
  23. padding: 15px;
  24. margin-bottom: 20px;
  25. }
  26. .ai-measure-tips h5 {
  27. color: #495057;
  28. margin-bottom: 10px;
  29. }
  30. .ai-measure-tips ul {
  31. margin-bottom: 0;
  32. padding-left: 20px;
  33. }
  34. .ai-measure-tips li {
  35. margin-bottom: 5px;
  36. color: #6c757d;
  37. }
  38. </style>
  39. <div class="panel panel-default panel-intro">
  40. <div class="panel-heading">
  41. {:build_heading(null, false)}
  42. <div class="ai-measure-tips">
  43. <h5><i class="fa fa-info-circle"></i> AI测量素材配置说明</h5>
  44. <ul>
  45. <li><strong>自拍模式:</strong>用户自己拍摄照片进行AI测量的相关配置</li>
  46. <li><strong>帮拍模式:</strong>他人协助拍摄照片进行AI测量的相关配置</li>
  47. <li>配置项包括:引导图片、提示文案、限制参数等</li>
  48. </ul>
  49. </div>
  50. <ul class="nav nav-tabs">
  51. {foreach $siteList as $index=>$vo}
  52. <li class="{$vo.active?'active':''}"><a href="#tab-{$vo.name|htmlentities}" data-toggle="tab">{:__(htmlentities($vo.title))}</a></li>
  53. {/foreach}
  54. {if $Think.config.app_debug}
  55. <li data-toggle="tooltip" title="{:__('Add new config')}">
  56. <a href="#addcfg" data-toggle="tab"><i class="fa fa-plus"></i></a>
  57. </li>
  58. {/if}
  59. </ul>
  60. </div>
  61. <div class="panel-body">
  62. <div id="myTabContent" class="tab-content">
  63. <!--@formatter:off-->
  64. {foreach $siteList as $index=>$vo}
  65. <div class="tab-pane fade {$vo.active ? 'active in' : ''}" id="tab-{$vo.name|htmlentities}">
  66. <div class="widget-body no-padding">
  67. <form id="{$vo.name|htmlentities}-form" class="edit-form form-horizontal" role="form" data-toggle="validator" method="POST" action="{:url('general.ai_measure_config/edit')}">
  68. {:token()}
  69. <table class="table table-striped">
  70. <thead>
  71. <tr>
  72. <th width="15%">{:__('Title')}</th>
  73. <th width="68%">{:__('Value')}</th>
  74. <!-- {if $Think.config.app_debug}
  75. <th width="15%">{:__('Name')}</th>
  76. <th width="2%"></th>
  77. {/if} -->
  78. </tr>
  79. </thead>
  80. <tbody>
  81. {foreach $vo.list as $item}
  82. <tr data-favisible="{$item.visible|default=''|htmlentities}" data-name="{$item.name|htmlentities}" class="{if $item.visible??''}hidden{/if}">
  83. <td>{$item.title|htmlentities}</td>
  84. <td>
  85. <div class="row">
  86. <div class="col-sm-8 col-xs-12">
  87. {switch $item.type}
  88. {case string}
  89. <input {$item.extend_html|htmlentities} type="text" name="row[{$item.name|htmlentities}]" value="{$item.value|htmlentities}" class="form-control" data-rule="{$item.rule|htmlentities}" data-tip="{$item.tip|htmlentities}"/>
  90. {/case}
  91. {case password}
  92. <input {$item.extend_html|htmlentities} type="password" name="row[{$item.name|htmlentities}]" value="{$item.value|htmlentities}" class="form-control" data-rule="{$item.rule|htmlentities}" data-tip="{$item.tip|htmlentities}"/>
  93. {/case}
  94. {case text}
  95. <textarea {$item.extend_html|htmlentities} name="row[{$item.name|htmlentities}]" class="form-control" data-rule="{$item.rule|htmlentities}" rows="5" data-tip="{$item.tip|htmlentities}">{$item.value|htmlentities}</textarea>
  96. {/case}
  97. {case editor}
  98. <textarea {$item.extend_html|htmlentities} name="row[{$item.name|htmlentities}]" id="editor-{$item.name|htmlentities}" class="form-control editor" data-rule="{$item.rule|htmlentities}" rows="5" data-tip="{$item.tip|htmlentities}">{$item.value|htmlentities}</textarea>
  99. {/case}
  100. {case array}
  101. <dl {$item.extend_html|htmlentities} class="fieldlist" data-name="row[{$item.name|htmlentities}]">
  102. <dd>
  103. <ins>{:isset($item["setting"]["key"])&&$item["setting"]["key"]?$item["setting"]["key"]:__('Array key')}</ins>
  104. <ins>{:isset($item["setting"]["value"])&&$item["setting"]["value"]?$item["setting"]["value"]:__('Array value')}</ins>
  105. </dd>
  106. <dd><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> {:__('Append')}</a></dd>
  107. <textarea name="row[{$item.name|htmlentities}]" class="form-control hide" cols="30" rows="5">{$item.value|htmlentities}</textarea>
  108. </dl>
  109. {/case}
  110. {case date}
  111. <input {$item.extend_html|htmlentities} type="text" name="row[{$item.name|htmlentities}]" value="{$item.value|htmlentities}" class="form-control datetimepicker" data-date-format="YYYY-MM-DD" data-tip="{$item.tip|htmlentities}" data-rule="{$item.rule|htmlentities}"/>
  112. {/case}
  113. {case time}
  114. <input {$item.extend_html|htmlentities} type="text" name="row[{$item.name|htmlentities}]" value="{$item.value|htmlentities}" class="form-control datetimepicker" data-date-format="HH:mm:ss" data-tip="{$item.tip|htmlentities}" data-rule="{$item.rule|htmlentities}"/>
  115. {/case}
  116. {case datetime}
  117. <input {$item.extend_html|htmlentities} type="text" name="row[{$item.name|htmlentities}]" value="{$item.value|htmlentities}" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-tip="{$item.tip|htmlentities}" data-rule="{$item.rule|htmlentities}"/>
  118. {/case}
  119. {case datetimerange}
  120. <input {$item.extend_html|htmlentities} type="text" name="row[{$item.name|htmlentities}]" value="{$item.value|htmlentities}" class="form-control datetimerange" data-tip="{$item.tip|htmlentities}" data-rule="{$item.rule|htmlentities}"/>
  121. {/case}
  122. {case number}
  123. <input {$item.extend_html|htmlentities} type="number" name="row[{$item.name|htmlentities}]" value="{$item.value|htmlentities}" class="form-control" data-tip="{$item.tip|htmlentities}" data-rule="{$item.rule|htmlentities}"/>
  124. {/case}
  125. {case checkbox}
  126. <div class="checkbox">
  127. {foreach name="item.content" item="vo"}
  128. <label for="row[{$item.name|htmlentities}][]-{$key|htmlentities}"><input id="row[{$item.name|htmlentities}][]-{$key|htmlentities}" name="row[{$item.name|htmlentities}][]" type="checkbox" value="{$key|htmlentities}" data-tip="{$item.tip|htmlentities}" {in name="key" value="$item.value" }checked{/in} /> {$vo|htmlentities}</label>
  129. {/foreach}
  130. </div>
  131. {/case}
  132. {case radio}
  133. <div class="radio">
  134. {foreach name="item.content" item="vo"}
  135. <label for="row[{$item.name|htmlentities}]-{$key|htmlentities}"><input id="row[{$item.name|htmlentities}]-{$key|htmlentities}" name="row[{$item.name|htmlentities}]" type="radio" value="{$key|htmlentities}" data-tip="{$item.tip|htmlentities}" {in name="key" value="$item.value" }checked{/in} /> {$vo|htmlentities}</label>
  136. {/foreach}
  137. </div>
  138. {/case}
  139. {case value="select" break="0"}{/case}
  140. {case value="selects"}
  141. <select {$item.extend_html|htmlentities} name="row[{$item.name|htmlentities}]{$item.type=='selects'?'[]':''}" class="form-control selectpicker" data-tip="{$item.tip|htmlentities}" {$item.type=='selects'?'multiple':''}>
  142. {foreach name="item.content" item="vo"}
  143. <option value="{$key|htmlentities}" {in name="key" value="$item.value" }selected{/in}>{$vo|htmlentities}</option>
  144. {/foreach}
  145. </select>
  146. {/case}
  147. {case value="image" break="0"}{/case}
  148. {case value="images"}
  149. <div class="form-inline">
  150. <input id="c-{$item.name|htmlentities}" class="form-control" size="50" name="row[{$item.name|htmlentities}]" type="text" value="{$item.value|htmlentities}" data-tip="{$item.tip|htmlentities}">
  151. <span><button type="button" id="faupload-{$item.name|htmlentities}" class="btn btn-danger faupload" data-input-id="c-{$item.name|htmlentities}" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="{$item.type=='image'?'false':'true'}" data-preview-id="p-{$item.name|htmlentities}"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
  152. <span><button type="button" id="fachoose-{$item.name|htmlentities}" class="btn btn-primary fachoose" data-input-id="c-{$item.name|htmlentities}" data-mimetype="image/*" data-multiple="{$item.type=='image'?'false':'true'}"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
  153. <span class="msg-box n-right" for="c-{$item.name|htmlentities}"></span>
  154. <ul class="row list-inline faupload-preview" id="p-{$item.name|htmlentities}"></ul>
  155. </div>
  156. {/case}
  157. {case value="file" break="0"}{/case}
  158. {case value="files"}
  159. <div class="form-inline">
  160. <input id="c-{$item.name|htmlentities}" class="form-control" size="50" name="row[{$item.name|htmlentities}]" type="text" value="{$item.value|htmlentities}" data-tip="{$item.tip|htmlentities}">
  161. <span><button type="button" id="faupload-{$item.name|htmlentities}" class="btn btn-danger faupload" data-input-id="c-{$item.name|htmlentities}" data-mimetype="*" data-multiple="{$item.type=='file'?'false':'true'}"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
  162. <span><button type="button" id="fachoose-{$item.name|htmlentities}" class="btn btn-primary fachoose" data-input-id="c-{$item.name|htmlentities}" data-mimetype="*" data-multiple="{$item.type=='file'?'false':'true'}"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
  163. <span class="msg-box n-right" for="c-{$item.name|htmlentities}"></span>
  164. </div>
  165. {/case}
  166. {case switch}
  167. <input id="c-{$item.name|htmlentities}" name="row[{$item.name|htmlentities}]" type="hidden" value="{:$item.value?1:0}">
  168. <a href="javascript:;" data-toggle="switcher" class="btn-switcher" data-input-id="c-{$item.name|htmlentities}" data-yes="1" data-no="0">
  169. <i class="fa fa-toggle-on text-success {if !$item.value}fa-flip-horizontal text-gray{/if} fa-2x"></i>
  170. </a>
  171. {/case}
  172. {case bool}
  173. <label for="row[{$item.name|htmlentities}]-yes"><input id="row[{$item.name|htmlentities}]-yes" name="row[{$item.name|htmlentities}]" type="radio" value="1" {$item.value?'checked':''} data-tip="{$item.tip|htmlentities}" /> {:__('Yes')}</label>
  174. <label for="row[{$item.name|htmlentities}]-no"><input id="row[{$item.name|htmlentities}]-no" name="row[{$item.name|htmlentities}]" type="radio" value="0" {$item.value?'':'checked'} data-tip="{$item.tip|htmlentities}" /> {:__('No')}</label>
  175. {/case}
  176. {case selectpage}
  177. <input {$item.extend_html|htmlentities} type="text" name="row[{$item.name|htmlentities}]" id="c-{$item.name|htmlentities}" value="{$item.value|htmlentities}" class="form-control selectpage" data-source="{:url('general.ai_measure_config/selectpage')}?id={$item.id|htmlentities}" data-primary-key="{$item.setting.primarykey|htmlentities}" data-field="{$item.setting.field|htmlentities}" data-multiple="false" data-tip="{$item.tip|htmlentities}" data-rule="{$item.rule|htmlentities}" />
  178. {/case}
  179. {case custom}
  180. {$item.extend_html|htmlentities}
  181. {/case}
  182. {/switch}
  183. </div>
  184. <div class="col-sm-4"></div>
  185. </div>
  186. </td>
  187. </tr>
  188. {/foreach}
  189. </tbody>
  190. <tfoot>
  191. <tr>
  192. <td></td>
  193. <td>
  194. <div class="layer-footer">
  195. <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
  196. <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
  197. </div>
  198. </td>
  199. {if $Think.config.app_debug}
  200. <td></td>
  201. <td></td>
  202. {/if}
  203. </tr>
  204. </tfoot>
  205. </table>
  206. </form>
  207. </div>
  208. </div>
  209. {/foreach}
  210. <div class="tab-pane fade" id="addcfg">
  211. <form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="{:url('general.ai_measure_config/add')}">
  212. {:token()}
  213. <div class="form-group">
  214. <label class="control-label col-xs-12 col-sm-2">{:__('Group')}:</label>
  215. <div class="col-xs-12 col-sm-4">
  216. <select name="row[group]" class="form-control selectpicker">
  217. {foreach name="groupList" item="vo"}
  218. <option value="{$key|htmlentities}" {in name="key" value="ai_measure_selfie" }selected{/in}>{$vo|htmlentities}</option>
  219. {/foreach}
  220. </select>
  221. </div>
  222. </div>
  223. <div class="form-group">
  224. <label class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
  225. <div class="col-xs-12 col-sm-4">
  226. <select name="row[type]" id="c-type" class="form-control selectpicker">
  227. {foreach name="typeList" item="vo"}
  228. <option value="{$key|htmlentities}" {in name="key" value="string" }selected{/in}>{$vo|htmlentities}</option>
  229. {/foreach}
  230. </select>
  231. </div>
  232. </div>
  233. <div class="form-group">
  234. <label for="name" class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
  235. <div class="col-xs-12 col-sm-4">
  236. <input type="text" class="form-control" id="name" name="row[name]" value="" data-rule="required; length(3~30); remote(general/ai_measure_config/check)"/>
  237. </div>
  238. </div>
  239. <div class="form-group">
  240. <label for="title" class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
  241. <div class="col-xs-12 col-sm-4">
  242. <input type="text" class="form-control" id="title" name="row[title]" value="" data-rule="required"/>
  243. </div>
  244. </div>
  245. <div class="form-group">
  246. <label for="value" class="control-label col-xs-12 col-sm-2">{:__('Value')}:</label>
  247. <div class="col-xs-12 col-sm-4">
  248. <input type="text" class="form-control" id="value" name="row[value]" value="" data-rule=""/>
  249. </div>
  250. </div>
  251. <div class="form-group hide" id="add-content-container">
  252. <label for="content" class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
  253. <div class="col-xs-12 col-sm-4">
  254. <textarea name="row[content]" id="content" cols="30" rows="5" class="form-control" data-rule="required(content)">value1|title1
  255. value2|title2</textarea>
  256. </div>
  257. </div>
  258. <div class="form-group">
  259. <label for="tip" class="control-label col-xs-12 col-sm-2">{:__('Tip')}:</label>
  260. <div class="col-xs-12 col-sm-4">
  261. <input type="text" class="form-control" id="tip" name="row[tip]" value="" data-rule=""/>
  262. </div>
  263. </div>
  264. <div class="form-group">
  265. <label for="rule" class="control-label col-xs-12 col-sm-2">{:__('Rule')}:</label>
  266. <div class="col-xs-12 col-sm-4">
  267. <input type="text" class="form-control" id="rule" name="row[rule]" value="" data-tip="{:__('Rule tips')}"/>
  268. </div>
  269. </div>
  270. <div class="form-group">
  271. <label for="visible" class="control-label col-xs-12 col-sm-2">{:__('Visible condition')}:</label>
  272. <div class="col-xs-12 col-sm-4">
  273. <input type="text" class="form-control" id="visible" name="row[visible]" value="" data-rule=""/>
  274. </div>
  275. </div>
  276. <div class="form-group">
  277. <label for="extend" class="control-label col-xs-12 col-sm-2">{:__('Extend')}:</label>
  278. <div class="col-xs-12 col-sm-4">
  279. <textarea name="row[extend]" id="extend" cols="30" rows="5" class="form-control" data-tip="{:__('Extend tips')}" data-rule="required(extend)" data-msg-extend="当类型为自定义时,扩展属性不能为空"></textarea>
  280. </div>
  281. </div>
  282. <div class="form-group">
  283. <label class="control-label col-xs-12 col-sm-2"></label>
  284. <div class="col-xs-12 col-sm-4">
  285. {if !$Think.config.app_debug}
  286. <button type="button" class="btn btn-primary disabled">{:__('Only work at development environment')}</button>
  287. {else/}
  288. <button type="submit" class="btn btn-primary btn-embossed">{:__('OK')}</button>
  289. <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
  290. {/if}
  291. </div>
  292. </div>
  293. </form>
  294. </div>
  295. <!--@formatter:on-->
  296. </div>
  297. </div>
  298. </div>