控制台应用,yzncms本身基于tp5.1框架,里面的队列用不了,bug,坑
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.

inputItem.html 10KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. {volist name="fieldList" id="vo"}
  2. <div data-favisible="{$vo.visible|default=''}">
  3. <div class="layui-form-item">
  4. {if $vo.type!='hidden'}<label class="layui-form-label {if condition="isset($vo.ifrequire) AND $vo.ifrequire"}layui-form-item-required{/if}">{$vo.title}</label>{/if}
  5. {switch name="vo.type"}
  6. {case value="hidden"}
  7. {if $vo.value}<input type="hidden" class="form-control" name="{$vo.fieldArr}[{$vo.name}]" value="{$vo.value}">{/if}
  8. {/case}
  9. {case value="text"}
  10. <div class="layui-input-block">
  11. <input type="text" name="{$vo.fieldArr}[{$vo.name}]" placeholder="请输入{$vo.title}" autocomplete="off" class="layui-input" value="{$vo.value}">
  12. </div>
  13. {/case}
  14. {case value="password"}
  15. <div class="layui-input-block">
  16. <input type="password" name="{$vo.fieldArr}[{$vo.name}]" placeholder="请输入{$vo.title}" autocomplete="off" class="layui-input" value="{$vo.value}" lay-affix="eye">
  17. </div>
  18. {/case}
  19. {case value="tags"}
  20. <div class="layui-input-block">
  21. <input type="text" name="{$vo.fieldArr}[{$vo.name}]" class="layui-input form-tags tags-{$vo.name}" value="{$vo.value}" data-remark="{$vo.remark|default='输入回车键确认'}">
  22. </div>
  23. {/case}
  24. {case value="number"}
  25. <div class="layui-input-block">
  26. <input type="number" name="{$vo.fieldArr}[{$vo.name}]" placeholder="请输入{$vo.title}" autocomplete="off" lay-affix="number" class="layui-input" value="{$vo.value}">
  27. </div>
  28. {/case}
  29. {case value="switch"}
  30. <div class="layui-input-block">
  31. <input type="checkbox" name="{$vo.fieldArr}[{$vo.name}]" lay-skin="switch" lay-text="ON|OFF" value="{$vo['value']}" {if 1==$vo[ 'value' ]}checked='' {/if}>
  32. </div>
  33. {/case}
  34. {case value="array"}
  35. <dl class="layui-input-block fieldlist" data-name="{$vo.fieldArr}[{$vo.name}]" data-id="{$vo.name}">
  36. <dd>
  37. <ins>键名</ins>
  38. <ins>键值</ins>
  39. </dd>
  40. <dd><button type="button" class="layui-btn btn-append">追加</button></dd>
  41. <textarea name="{$vo.fieldArr}[{$vo.name}]" class="layui-textarea layui-hide">{$vo.value}</textarea>
  42. </dl>
  43. <script type="text/html" id="{$vo.name}Tpl">
  44. <dd class="layui-form-item rules-item">
  45. {{# layui.each(d.lists, function(index, item) { }}
  46. <input type="text" class="layui-input" name="{{item.name}}[{{item.index}}][key]" placeholder="键" value="{{item.key|| ''}}" />
  47. <input type="text" class="layui-input" name="{{item.name}}[{{item.index}}][value]" placeholder="值" value="{{item.value|| ''}}" />
  48. <button type="button" class="layui-btn layui-btn-danger btn-remove layui-btn-xs"><i class="iconfont icon-close"></i></button>
  49. <button type="button" class="layui-btn btn-dragsort layui-btn-xs"><i class="iconfont icon-yidong"></i></button>
  50. {{# }); }}
  51. </dd>
  52. </script>
  53. {/case}
  54. {case value="checkbox"}
  55. <div class="layui-input-block">
  56. {volist name="vo.options" id="v"}
  57. <input type="checkbox" name="{$vo.fieldArr}[{$vo.name}][]" lay-skin="primary" title="{$v}" value="{$key}" {if in_array($key,$vo[ 'value' ])}checked{/if}>
  58. {/volist}
  59. </div>
  60. {/case}
  61. {case value="radio"}
  62. <div class="layui-input-block">
  63. {volist name="vo.options" id="v"}
  64. <input type="radio" name="{$vo.fieldArr}[{$vo.name}]" value="{$key}" title="{$v}" {if $key==$vo [ 'value' ]}checked='' {/if}> {/volist}
  65. </div>
  66. {/case}
  67. {case value="select"}
  68. <div class="layui-input-block">
  69. <select name="{$vo.fieldArr}[{$vo.name}]">
  70. <option value=""></option>
  71. {volist name="vo.options" id="v"}
  72. <option value="{$key}" {if $key==$vo[ 'value' ]}selected="" {/if}>{$v}</option>
  73. {/volist}
  74. </select>
  75. </div>
  76. {/case}
  77. {case value="selects"}
  78. <div class="layui-input-block">
  79. <div class="form-selects" data-name="{$vo.fieldArr}[{$vo.name}]" data-id="{$vo.name}" data-value="{$vo.value}" data-list="{$vo.options|json_encode}"></div>
  80. </div>
  81. {/case}
  82. {case value="selectpage"}
  83. <div class="layui-input-block">
  84. <input class="form-control layui-input selectpage" type="text" name="{$vo.fieldArr}[{$vo.name}]" data-source="{$vo.options.url|url}" data-multiple="{$vo.options.multiple|default='false'}" data-field="{$vo.options.field|default='name'}" data-primary-key="{$vo.options.key|default='id'}" data-max-select-limit="{$vo.options.max|default='20'}" data-pagination="{$vo.options.pagination|default='true'}" data-page-size="{$vo.options.limit|default='10'}" data-order-by="{$vo.options.order|default='id'}" value="{$vo.value}">
  85. </div>
  86. {/case}
  87. {case value="color"}
  88. <div class="layui-input-block">
  89. <div class="layui-input-inline" style="width: 120px;">
  90. <input type="text" name="{$vo.fieldArr}[{$vo.name}]" value="{$vo.value}" placeholder="请选择颜色" class="layui-input test-form-input" id="c-{$vo.name}">
  91. </div>
  92. <div class="layui-inline" style="left: -11px;">
  93. <div class="colorpicker" data-input-id="c-{$vo.name}"></div>
  94. </div>
  95. </div>
  96. {/case}
  97. {case value="datetime"}
  98. <div class="layui-input-block">
  99. <input type="text" class="layui-input datetime" name="{$vo.fieldArr}[{$vo.name}]" placeholder="请输入{$vo.title}" value="{$vo.value}">
  100. </div>
  101. {/case}
  102. {case value="datetimerange"}
  103. <div class="layui-input-block">
  104. <input type="text" class="layui-input datetime" name="{$vo.fieldArr}[{$vo.name}]" placeholder="请输入{$vo.title}" value="{$vo.value}" data-date-range="-">
  105. </div>
  106. {/case}
  107. {case value="textarea"}
  108. <div class="layui-input-block">
  109. <textarea placeholder="请输入{$vo.title}" class="layui-textarea" name="{$vo.fieldArr}[{$vo.name}]">{$vo.value}</textarea>
  110. </div>
  111. {/case}
  112. {case value="image" break="0"}{/case}
  113. {case value="images"}
  114. <div class="layui-input-block">
  115. <div class="layui-col-xs4">
  116. <input type="text" name="{$vo.fieldArr}[{$vo.name}]" id="c-{$vo.name}" value="{$vo.value|default=''}" class="layui-input">
  117. </div>
  118. <button type="button" class="layui-btn faupload" id="faupload-{$vo.name}" data-multiple="{$vo.type=='image'?'false':'true'}" data-input-id="c-{$vo.name}" data-preview-id="p-{$vo.name}" data-type="image"><i class="layui-icon layui-icon-upload"></i> 上传</button><button type="button" class="layui-btn fachoose" data-multiple="{$vo.type=='image'?'false':'true'}" data-mimetype="image" data-input-id="c-{$vo.name}" id="fachoose-c-{$vo.name}"><i class="iconfont icon-other"></i> 选择</button>
  119. <ul class="layui-row list-inline plupload-preview" id="p-{$vo.name}"></ul>
  120. </div>
  121. {/case}
  122. {case value="file" break="0"}{/case}
  123. {case value="files"}
  124. <div class="layui-input-block">
  125. <div class="layui-col-xs4">
  126. <input type="text" name="{$vo.fieldArr}[{$vo.name}]" id="c-{$vo.name}" value="{$vo.value|default=''}" class="layui-input">
  127. </div>
  128. <button type="button" class="layui-btn faupload" id="faupload-{$vo.name}" data-multiple="{$vo.type=='file'?'false':'true'}" data-input-id="c-{$vo.name}" data-preview-id="p-{$vo.name}" data-type="file"><i class="layui-icon layui-icon-upload"></i> 上传</button><button type="button" class="layui-btn fachoose" data-multiple="{$vo.type=='file'?'false':'true'}" data-mimetype="file" data-input-id="c-{$vo.name}" id="fachoose-c-{$vo.name}"><i class="iconfont icon-other"></i> 选择</button>
  129. </div>
  130. {/case}
  131. {case value="Ueditor"}
  132. <div class="layui-input-block">
  133. <script type="text/plain" class="js-ueditor" id="{$vo.name}" name="{$vo.fieldArr}[{$vo.name}]">{$vo.value|raw}</script>
  134. </div>
  135. <div class="{$vo.name}_attr editor_tool" style="margin-left: 140px;">
  136. <a class="layui-btn layui-btn-sm" id="{$vo.name}grabimg" style="margin-top: 4px;">图片本地化</a>
  137. <a class="layui-btn layui-btn-sm" id="{$vo.name}filterword" style="margin-top: 4px;">检测违禁词</a>
  138. </div>
  139. {/case}
  140. {case value="city"}
  141. <div class="layui-input-block">
  142. <input type="text" autocomplete="on" class="layui-input" name="{$vo.fieldArr}[{$vo.name}]" id="{$vo.name}" value="{$vo.value}" data-toggle="city-picker" placeholder="请选择"/>
  143. </div>
  144. {/case}
  145. {case value="custom"}
  146. {$vo.options|raw}
  147. {/case}
  148. {case value="markdown"}
  149. {:hook('markdown',$vo)}
  150. {/case}
  151. {/switch}
  152. {if $vo.remark}<div class="layui-form-mid no-float layui-word-aux">{$vo.remark|raw}</div>{/if}
  153. </div>
  154. </div>
  155. {/volist}