add.html 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400
  1. <style>
  2. .relation-item {margin-top:10px;}
  3. legend {padding-bottom:5px;font-size:14px;font-weight:600;}
  4. label {font-weight:normal;}
  5. .form-control{padding:6px 8px;}
  6. #extend-zone .col-xs-2 {margin-top:10px;padding-right:0;}
  7. #extend-zone .col-xs-2:nth-child(6n+0) {padding-right:15px;}
  8. </style>
  9. <div class="panel panel-default panel-intro">
  10. <div class="panel-heading">
  11. <ul class="nav nav-tabs">
  12. <li class="active"><a href="#crud" data-toggle="tab">{:__('一键生成CRUD')}</a></li>
  13. <li><a href="#menu" data-toggle="tab">{:__('一键生成菜单')}</a></li>
  14. <li><a href="#min" data-toggle="tab">{:__('一键压缩打包')}</a></li>
  15. <li><a href="#api" data-toggle="tab">{:__('一键生成API文档')}</a></li>
  16. </ul>
  17. </div>
  18. <div class="panel-body">
  19. <div id="myTabContent" class="tab-content">
  20. <div class="tab-pane fade active in" id="crud">
  21. <div class="row">
  22. <div class="col-xs-12">
  23. <form role="form">
  24. <input type="hidden" name="commandtype" value="crud" />
  25. <div class="form-group">
  26. <div class="row">
  27. <div class="col-xs-3">
  28. <input checked="" name="isrelation" type="hidden" value="0">
  29. <label class="control-label" data-toggle="tooltip" title="当前只支持生成1对1关联模型,选中后请配置关联表和字段">
  30. <input name="isrelation" type="checkbox" value="1">
  31. 关联模型
  32. </label>
  33. </div>
  34. <div class="col-xs-3">
  35. <input checked="" name="local" type="hidden" value="1">
  36. <label class="control-label" data-toggle="tooltip" title="默认模型生成在application/admin/model目录下,选中后将生成在application/common/model目录下">
  37. <input name="local" type="checkbox" value="0"> 全局模型类
  38. </label>
  39. </div>
  40. <div class="col-xs-3">
  41. <input checked="" name="delete" type="hidden" value="0">
  42. <label class="control-label" data-toggle="tooltip" title="删除CRUD生成的相关文件">
  43. <input name="delete" type="checkbox" value="1"> 删除模式
  44. </label>
  45. </div>
  46. <div class="col-xs-3">
  47. <input checked="" name="force" type="hidden" value="0">
  48. <label class="control-label" data-toggle="tooltip" title="选中后,如果已经存在同名文件将被覆盖。如果是删除将不再提醒">
  49. <input name="force" type="checkbox" value="1">
  50. 强制覆盖模式
  51. </label>
  52. </div>
  53. <!--
  54. <div class="col-xs-3">
  55. <input checked="" name="menu" type="hidden" value="0">
  56. <label class="control-label" data-toggle="tooltip" title="选中后,将同时生成后台菜单规则">
  57. <input name="menu" type="checkbox" value="1">
  58. 生成菜单
  59. </label>
  60. </div>
  61. -->
  62. </div>
  63. </div>
  64. <div class="form-group">
  65. <legend>主表设置</legend>
  66. <div class="row">
  67. <div class="col-xs-3">
  68. <label>请选择主表</label>
  69. {:build_select('table',$tableList,null,['class'=>'form-control selectpicker', 'data-live-search'=>'true']);}
  70. </div>
  71. <div class="col-xs-3">
  72. <label>自定义控制器名</label>
  73. <input type="text" class="form-control" name="controller" data-toggle="tooltip" title="默认根据表名自动生成,如果需要放在二级目录请手动填写" placeholder="支持目录层级,以/分隔">
  74. </div>
  75. <div class="col-xs-3">
  76. <label>自定义模型名</label>
  77. <input type="text" class="form-control" name="model" data-toggle="tooltip" title="默认根据表名自动生成" placeholder="不支持目录层级">
  78. </div>
  79. <div class="col-xs-3">
  80. <label>请选择显示字段(默认全部)</label>
  81. <select name="fields[]" id="fields" multiple style="height:30px;" class="form-control selectpicker"></select>
  82. </div>
  83. </div>
  84. </div>
  85. <div class="form-group hide" id="relation-zone">
  86. <legend>关联表设置</legend>
  87. <div class="row" style="margin-top:15px;">
  88. <div class="col-xs-12">
  89. <a href="javascript:;" class="btn btn-primary btn-sm btn-newrelation" data-index="1">追加关联模型</a>
  90. </div>
  91. </div>
  92. </div>
  93. <hr>
  94. <div class="form-group" id="extend-zone">
  95. <legend>字段识别设置 <span style="font-size:12px;font-weight: normal;">(与之匹配的字段都将生成相应组件)</span></legend>
  96. <div class="row">
  97. <div class="col-xs-2">
  98. <label>复选框后缀</label>
  99. <input type="text" class="form-control" name="setcheckboxsuffix" placeholder="默认为set类型" />
  100. </div>
  101. <div class="col-xs-2">
  102. <label>单选框后缀</label>
  103. <input type="text" class="form-control" name="enumradiosuffix" placeholder="默认为enum类型" />
  104. </div>
  105. <div class="col-xs-2">
  106. <label>图片类型后缀</label>
  107. <input type="text" class="form-control" name="imagefield" placeholder="默认为image,images,avatar,avatars" />
  108. </div>
  109. <div class="col-xs-2">
  110. <label>文件类型后缀</label>
  111. <input type="text" class="form-control" name="filefield" placeholder="默认为file,files" />
  112. </div>
  113. <div class="col-xs-2">
  114. <label>日期时间后缀</label>
  115. <input type="text" class="form-control" name="intdatesuffix" placeholder="默认为time" />
  116. </div>
  117. <div class="col-xs-2">
  118. <label>开关后缀</label>
  119. <input type="text" class="form-control" name="switchsuffix" placeholder="默认为switch" />
  120. </div>
  121. <div class="col-xs-2">
  122. <label>城市选择后缀</label>
  123. <input type="text" class="form-control" name="citysuffix" placeholder="默认为city" />
  124. </div>
  125. <div class="col-xs-2">
  126. <label>动态下拉后缀(单)</label>
  127. <input type="text" class="form-control" name="selectpagesuffix" placeholder="默认为_id" />
  128. </div>
  129. <div class="col-xs-2">
  130. <label>动态下拉后缀(多)</label>
  131. <input type="text" class="form-control" name="selectpagessuffix" placeholder="默认为_ids" />
  132. </div>
  133. <div class="col-xs-2">
  134. <label>忽略的字段</label>
  135. <input type="text" class="form-control" name="ignorefields" placeholder="默认无" />
  136. </div>
  137. <div class="col-xs-2">
  138. <label>排序字段</label>
  139. <input type="text" class="form-control" name="sortfield" placeholder="默认为weigh" />
  140. </div>
  141. <div class="col-xs-2">
  142. <label>富文本编辑器</label>
  143. <input type="text" class="form-control" name="editorsuffix" placeholder="默认为content" />
  144. </div>
  145. <div class="col-xs-2">
  146. <label>选项卡过滤字段</label>
  147. <input type="text" class="form-control" name="headingfilterfield" placeholder="默认为status" />
  148. </div>
  149. </div>
  150. </div>
  151. <div class="form-group">
  152. <legend>生成命令行</legend>
  153. <textarea class="form-control" data-toggle="tooltip" title="如果在线执行命令失败,可以将命令复制到命令行进行执行" rel="command" rows="1" placeholder="请点击生成命令行"></textarea>
  154. </div>
  155. <div class="form-group">
  156. <legend>返回结果</legend>
  157. <textarea class="form-control" rel="result" rows="5" placeholder="请点击立即执行"></textarea>
  158. </div>
  159. <div class="form-group">
  160. <button type="button" class="btn btn-info btn-embossed btn-command">{:__('生成命令行')}</button>
  161. <button type="button" class="btn btn-success btn-embossed btn-execute">{:__('立即执行')}</button>
  162. </div>
  163. </form>
  164. </div>
  165. </div>
  166. </div>
  167. <div class="tab-pane fade" id="menu">
  168. <div class="row">
  169. <div class="col-xs-12">
  170. <form role="form">
  171. <input type="hidden" name="commandtype" value="menu" />
  172. <div class="form-group">
  173. <div class="row">
  174. <div class="col-xs-3">
  175. <input checked="" name="allcontroller" type="hidden" value="0">
  176. <label class="control-label">
  177. <input name="allcontroller" data-toggle="collapse" data-target="#controller" type="checkbox" value="1"> 一键生成全部控制器
  178. </label>
  179. </div>
  180. <div class="col-xs-3">
  181. <input checked="" name="delete" type="hidden" value="0">
  182. <label class="control-label">
  183. <input name="delete" type="checkbox" value="1"> 删除模式
  184. </label>
  185. </div>
  186. <div class="col-xs-3">
  187. <input checked="" name="force" type="hidden" value="0">
  188. <label class="control-label">
  189. <input name="force" type="checkbox" value="1"> 强制覆盖模式
  190. </label>
  191. </div>
  192. </div>
  193. </div>
  194. <div class="form-group in" id="controller">
  195. <legend>控制器设置</legend>
  196. <div class="row" style="margin-top:15px;">
  197. <div class="col-xs-12">
  198. <input type="text" name="controllerfile" class="form-control selectpage" style="width:720px;" data-source="command/get_controller_list" data-multiple="true" name="controller" placeholder="请选择控制器" />
  199. </div>
  200. </div>
  201. </div>
  202. <div class="form-group">
  203. <legend>生成命令行</legend>
  204. <textarea class="form-control" rel="command" rows="1" placeholder="请点击生成命令行"></textarea>
  205. </div>
  206. <div class="form-group">
  207. <legend>返回结果</legend>
  208. <textarea class="form-control" rel="result" rows="5" placeholder="请点击立即执行"></textarea>
  209. </div>
  210. <div class="form-group">
  211. <button type="button" class="btn btn-info btn-embossed btn-command">{:__('生成命令行')}</button>
  212. <button type="button" class="btn btn-success btn-embossed btn-execute">{:__('立即执行')}</button>
  213. </div>
  214. </form>
  215. </div>
  216. </div>
  217. </div>
  218. <div class="tab-pane fade" id="min">
  219. <div class="row">
  220. <div class="col-xs-12">
  221. <form role="form">
  222. <input type="hidden" name="commandtype" value="min" />
  223. <div class="form-group">
  224. <legend>基础设置</legend>
  225. <div class="row">
  226. <div class="col-xs-3">
  227. <label>请选择压缩模块</label>
  228. <select name="module" class="form-control selectpicker">
  229. <option value="all" selected>全部</option>
  230. <option value="backend">后台Backend</option>
  231. <option value="frontend">前台Frontend</option>
  232. </select>
  233. </div>
  234. <div class="col-xs-3">
  235. <label>请选择压缩资源</label>
  236. <select name="resource" class="form-control selectpicker">
  237. <option value="all" selected>全部</option>
  238. <option value="js">JS</option>
  239. <option value="css">CSS</option>
  240. </select>
  241. </div>
  242. <div class="col-xs-3">
  243. <label>请选择压缩模式</label>
  244. <select name="optimize" class="form-control selectpicker">
  245. <option value="">无</option>
  246. <option value="uglify">uglify</option>
  247. <option value="closure">closure</option>
  248. </select>
  249. </div>
  250. </div>
  251. </div>
  252. <div class="form-group in">
  253. <legend>控制器设置</legend>
  254. <div class="row" style="margin-top:15px;">
  255. <div class="col-xs-12">
  256. </div>
  257. </div>
  258. </div>
  259. <div class="form-group">
  260. <legend>生成命令行</legend>
  261. <textarea class="form-control" rel="command" rows="1" placeholder="请点击生成命令行"></textarea>
  262. </div>
  263. <div class="form-group">
  264. <legend>返回结果</legend>
  265. <textarea class="form-control" rel="result" rows="5" placeholder="请点击立即执行"></textarea>
  266. </div>
  267. <div class="form-group">
  268. <button type="button" class="btn btn-info btn-embossed btn-command">{:__('生成命令行')}</button>
  269. <button type="button" class="btn btn-success btn-embossed btn-execute">{:__('立即执行')}</button>
  270. </div>
  271. </form>
  272. </div>
  273. </div>
  274. </div>
  275. <div class="tab-pane fade" id="api">
  276. <div class="row">
  277. <div class="col-xs-12">
  278. <form role="form">
  279. <input type="hidden" name="commandtype" value="api" />
  280. <div class="form-group">
  281. <div class="row">
  282. <div class="col-xs-3">
  283. <input checked="" name="force" type="hidden" value="0">
  284. <label class="control-label">
  285. <input name="force" type="checkbox" value="1">
  286. 覆盖模式
  287. </label>
  288. </div>
  289. </div>
  290. </div>
  291. <div class="form-group">
  292. <legend>文档设置</legend>
  293. <div class="row">
  294. <div class="col-xs-3">
  295. <label>请输入接口URL</label>
  296. <input type="text" name="url" class="form-control" placeholder="API URL,可留空" />
  297. </div>
  298. <div class="col-xs-3">
  299. <label>接口生成文件</label>
  300. <input type="text" name="output" class="form-control" placeholder="留空则使用api.html" />
  301. </div>
  302. <div class="col-xs-3">
  303. <label>模板文件</label>
  304. <input type="text" name="template" class="form-control" placeholder="如果不清楚请留空" />
  305. </div>
  306. </div>
  307. <div class="row" style="margin-top:10px;">
  308. <div class="col-xs-3">
  309. <label>文档标题</label>
  310. <input type="text" name="title" class="form-control" placeholder="默认为FastAdmin" />
  311. </div>
  312. <div class="col-xs-3">
  313. <label>文档作者</label>
  314. <input type="text" name="author" class="form-control" placeholder="默认为FastAdmin" />
  315. </div>
  316. <div class="col-xs-3">
  317. <label>文档语言</label>
  318. <select name="language" class="form-control">
  319. <option value="" selected>请选择语言</option>
  320. <option value="zh-cn">中文</option>
  321. <option value="en">英文</option>
  322. </select>
  323. </div>
  324. </div>
  325. </div>
  326. <div class="form-group">
  327. <legend>生成命令行</legend>
  328. <textarea class="form-control" rel="command" rows="1" placeholder="请点击生成命令行"></textarea>
  329. </div>
  330. <div class="form-group">
  331. <legend>返回结果</legend>
  332. <textarea class="form-control" rel="result" rows="5" placeholder="请点击立即执行"></textarea>
  333. </div>
  334. <div class="form-group">
  335. <button type="button" class="btn btn-info btn-embossed btn-command">{:__('生成命令行')}</button>
  336. <button type="button" class="btn btn-success btn-embossed btn-execute">{:__('立即执行')}</button>
  337. </div>
  338. </form>
  339. </div>
  340. </div>
  341. </div>
  342. </div>
  343. </div>
  344. </div>
  345. <script id="relationtpl" type="text/html">
  346. <div class="row relation-item">
  347. <div class="col-xs-2">
  348. <label>请选择关联表</label>
  349. <select name="relation[<%=index%>][relation]" class="form-control relationtable" data-live-search="true"></select>
  350. </div>
  351. <div class="col-xs-2">
  352. <label>请选择关联类型</label>
  353. <select name="relation[<%=index%>][relationmode]" class="form-control relationmode"></select>
  354. </div>
  355. <div class="col-xs-2">
  356. <label>关联外键</label>
  357. <select name="relation[<%=index%>][relationforeignkey]" class="form-control relationforeignkey"></select>
  358. </div>
  359. <div class="col-xs-2">
  360. <label>关联主键</label>
  361. <select name="relation[<%=index%>][relationprimarykey]" class="form-control relationprimarykey"></select>
  362. </div>
  363. <div class="col-xs-2">
  364. <label>请选择显示字段</label>
  365. <select name="relation[<%=index%>][relationfields][]" multiple class="form-control relationfields"></select>
  366. </div>
  367. <div class="col-xs-2">
  368. <label>&nbsp;</label>
  369. <a href="javascript:;" class="btn btn-danger btn-block btn-removerelation">移除</a>
  370. </div>
  371. </div>
  372. </script>