3a2ae57274194b29a9d07a3b58fef839.php 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353
  1. <?php /*a:2:{s:58:"D:\phpstudy_pro\WWW\caiping\app\admin\view\crud\table.html";i:1723541257;s:59:"D:\phpstudy_pro\WWW\caiping\app\admin\view\common\base.html";i:1723541257;}*/ ?>
  2. <!DOCTYPE html>
  3. <html>
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <meta name="renderer" content="webkit">
  7. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  8. <meta name="360-site-verification" content="a7c876fae8b6e3175a52ea9f19543f51" />
  9. <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=0">
  10. <script src="/static/dist/xm-select.js"></script>
  11. <link rel="mobile-prefetch" href=""/>
  12. <title><?php echo get_system_config('web','admin_title'); ?></title>
  13. <meta name="keywords" content="<?php echo get_system_config('web','keywords'); ?>"/>
  14. <meta name="description" content="<?php echo get_system_config('web','desc'); ?>"/>
  15. <link rel="stylesheet" href="/static/assets/gougu/css/gougu.css?v=<?php echo get_system_config('web','version'); ?>" media="all">
  16. <style>
  17. .footer{
  18. width: 100%;
  19. height: 25px;
  20. text-align: center;
  21. position: fixed;
  22. bottom: 0;
  23. }
  24. </style>
  25. </head>
  26. <body class="main-body">
  27. <!-- 主体 -->
  28. <form class="layui-form p-4">
  29. <h3 class="pb-3">数据表信息</h3>
  30. <table class="layui-table layui-table-form">
  31. <tr>
  32. <td class="layui-td-gray-2">数据表名称</td>
  33. <td><?php echo htmlentities($detail['title']); ?></td>
  34. <td class="layui-td-gray-2">数据表备注</td>
  35. <td><?php echo htmlentities($detail['Comment']); ?></td>
  36. <td class="layui-td-gray-2">当前记录数</td>
  37. <td><?php echo htmlentities($detail['Rows']); ?></td>
  38. <td class="layui-td-gray-2">创建时间</td>
  39. <td><?php echo htmlentities($detail['Create_time']); ?></td>
  40. </tr>
  41. </table>
  42. <?php if($detail['c'] != '0'): ?>
  43. <h3 class="py-3">文件信息</h3>
  44. <table class="layui-table layui-table-form">
  45. <tr>
  46. <td colspan="8" class="red" style="text-align:left; line-height:1.8">
  47. 温馨提示:<br/>
  48. 1、【<strong>一键CRUD生成代码</strong>】已帮你完成 <strong>60%</strong> 以上的开发工作,以下是生成的文件所在目录。
  49. <br/>
  50. 2、可以刷新系统页面,点击左边的刚刚新增的<strong>菜单</strong>访问相关功能,如需更改菜单左侧图标,请在[系统管理]->[菜单节点]找到对应的菜单编辑修改即可。
  51. <br/>
  52. 3、代码生成以后,不建议删除(除非不需要了),建议在当前的基础上修改或新增开发,开发方式与传统的开发方式无区别。
  53. <br/>
  54. 4、CRUD生成的代码是最基础的代码,开发者通过二次开发修改,可能使得功能更完善,代码更健壮,特别是逻辑上的处理,以下是二次开发建议。
  55. <br/>
  56. 5、后端功能开发参考文档 <a href="https://www.kancloud.cn/manual/thinkphp6_0/1037479" target="_blank" class="layui-btn layui-btn-normal layui-btn-xs">ThinkPHP6开发文档</a>,前端页面开发参考文档 <a href="http://admin.gougucms.com" target="_blank" class="layui-btn layui-btn-xs">UI开发文档</a>
  57. </td>
  58. </tr>
  59. <tr>
  60. <td class="layui-td-gray-2">控制器</td>
  61. <td><?php echo htmlentities($detail['c']); ?></td>
  62. <td class="layui-td-gray">开发建议</td>
  63. <td class="red">功能逻辑完善、控制器的其他方法的补充完善等</td>
  64. </tr>
  65. <tr>
  66. <td class="layui-td-gray-2">数据模型</td>
  67. <td><?php echo $detail['m']=='0' ? '-' : htmlentities($detail['m']); ?></td>
  68. <td class="layui-td-gray">开发建议</td>
  69. <td class="red">数据搜索条件完善、查询字段增减调整、关联表查询等</td>
  70. </tr>
  71. <tr>
  72. <td class="layui-td-gray-2">数据校验器</td>
  73. <td><?php echo $detail['v']=='0' ? '-' : htmlentities($detail['v']); ?></td>
  74. <td class="layui-td-gray">开发建议</td>
  75. <td class="red">增强数据校验规则、修改调整校验提示等</td>
  76. </tr>
  77. <tr>
  78. <td class="layui-td-gray-2">列表页面</td>
  79. <td><?php echo $detail['l']=='0' ? '-' : htmlentities($detail['l']); ?></td>
  80. <td class="layui-td-gray">开发建议</td>
  81. <td class="red">列表显示字段增减调整、列表字段表格宽度调整、其他按钮、链接的补充完善等</td>
  82. </tr>
  83. <tr>
  84. <td class="layui-td-gray-2">添加页面</td>
  85. <td><?php echo $detail['a']=='0' ? '-' : htmlentities($detail['a']); ?></td>
  86. <td class="layui-td-gray">开发建议</td>
  87. <td class="red">需要输入的字段增减调整、单选、多选、下拉选的内容调整等</td>
  88. </tr>
  89. <tr>
  90. <td class="layui-td-gray-2">编辑页面</td>
  91. <td><?php echo $detail['e']=='0' ? '-' : htmlentities($detail['e']); ?></td>
  92. <td class="layui-td-gray">开发建议</td>
  93. <td class="red">需要编辑的字段增减调整、单选、多选、下拉选的内容调整等</td>
  94. </tr>
  95. <tr>
  96. <td class="layui-td-gray-2">查看页面</td>
  97. <td><?php echo $detail['r']=='0' ? '-' : htmlentities($detail['r']); ?></td>
  98. <td class="layui-td-gray">开发建议</td>
  99. <td class="red">显示字段增减调整、其他按钮、连接的补充完善等</td>
  100. </tr>
  101. </table>
  102. <h3 class="py-3">数据表字段</h3>
  103. <table class="layui-table layui-form">
  104. <thead>
  105. <th style="text-align:center;">字段列名</th>
  106. <th style="text-align:center;">数据类型</th>
  107. <th style="text-align:center;">字段注释</th>
  108. </thead>
  109. <tbody>
  110. <?php if(is_array($columns) || $columns instanceof \think\Collection || $columns instanceof \think\Paginator): $i = 0; $__LIST__ = $columns;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
  111. <tr>
  112. <td><?php echo htmlentities($vo['Field']); ?></td>
  113. <td><?php echo htmlentities($vo['Type']); ?></td>
  114. <td><?php echo htmlentities($vo['Comment']); ?></td>
  115. </tr>
  116. <?php endforeach; endif; else: echo "" ;endif; ?>
  117. </tbody>
  118. </table>
  119. <?php else: ?>
  120. <h3 class="py-3">数据表字段</h3>
  121. <table class="layui-table layui-form">
  122. <thead>
  123. <th style="text-align:center;">字段列名</th>
  124. <th style="text-align:center;">字段注释</th>
  125. <th style="text-align:center;">数据类型</th>
  126. <th class="blue" style="text-align:center;">表单字段名称</th>
  127. <th class="blue" style="text-align:center;">是否必填</th>
  128. <th class="blue" style="text-align:center;">表单元素类型</th>
  129. <th class="green" style="text-align:center;">新增页展示</th>
  130. <th class="green" style="text-align:center;">编辑页展示</th>
  131. <th class="green" style="text-align:center;">列表页展示</th>
  132. <th class="green" style="text-align:center;">查询页展示</th>
  133. </thead>
  134. <tbody>
  135. <?php if(is_array($columns) || $columns instanceof \think\Collection || $columns instanceof \think\Paginator): $i = 0; $__LIST__ = $columns;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
  136. <tr>
  137. <td><?php echo htmlentities($vo['Field']); ?></td>
  138. <td><?php echo htmlentities($vo['Comment']); ?></td>
  139. <td><?php echo htmlentities($vo['Type']); ?></td>
  140. <?php if($vo['Field'] == 'id'): ?>
  141. <td style="text-align:center;">-</td>
  142. <td style="text-align:center;">-</td>
  143. <td style="text-align:center;">-</td>
  144. <td style="text-align:center;">-</td>
  145. <td style="text-align:center;">-</td>
  146. <td style="text-align:center;">-</td>
  147. <td style="text-align:center;">-</td>
  148. <?php else: ?>
  149. <td style="text-align:center;">
  150. <input type="hidden" name="<?php echo htmlentities($vo['Field']); ?>" value="<?php echo htmlentities($vo['Field']); ?>" class="crud-flie">
  151. <input type="text" name="<?php echo htmlentities($vo['Field']); ?>_title" value="<?php echo htmlentities((isset($vo['name']) && ($vo['name'] !== '')?$vo['name']:'')); ?>" class="layui-input"></td>
  152. <td style="text-align:center;"><input type="checkbox" name="<?php echo htmlentities($vo['Field']); ?>_required" value="1" lay-skin="primary"></td>
  153. <td>
  154. <select name="<?php echo htmlentities($vo['Field']); ?>_type">
  155. <option value="input" selected="">文本框</option>
  156. <option value="textarea">多行文本</option>
  157. <option value="select">下拉框</option>
  158. <option value="radio">单选框</option>
  159. <option value="checkbox">复选框</option>
  160. <option value="summernote">富文本</option>
  161. <option value="datetime">日期控件</option>
  162. <option value="upload">上传控件</option>
  163. </select>
  164. </td>
  165. <td style="text-align:center;"><input type="checkbox" name="<?php echo htmlentities($vo['Field']); ?>_add" value="<?php echo htmlentities($vo['Field']); ?>" lay-skin="primary"></td>
  166. <td style="text-align:center;"><input type="checkbox" name="<?php echo htmlentities($vo['Field']); ?>_edit" value="<?php echo htmlentities($vo['Field']); ?>" lay-skin="primary"></td>
  167. <td style="text-align:center;"><input type="checkbox" name="<?php echo htmlentities($vo['Field']); ?>_list" value="<?php echo htmlentities($vo['Field']); ?>" lay-skin="primary"></td>
  168. <td style="text-align:center;"><input type="checkbox" name="<?php echo htmlentities($vo['Field']); ?>_read" value="<?php echo htmlentities($vo['Field']); ?>" lay-skin="primary"></td>
  169. <?php endif; ?>
  170. </tr>
  171. <?php endforeach; endif; else: echo "" ;endif; ?>
  172. </tbody>
  173. </table>
  174. <div class="py-3">
  175. <input type="hidden" name="field" value="<?php echo htmlentities($detail['title']); ?>">
  176. <input type="hidden" name="name" value="<?php echo htmlentities($detail['Comment']); ?>">
  177. <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">一键CRUD生成代码</button>
  178. <button type="reset" class="layui-btn layui-btn-primary">重置</button>
  179. </div>
  180. <?php endif; ?>
  181. </form>
  182. <!-- /主体 -->
  183. <!-- 底部 -->
  184. <div class="footer">
  185. 逸管工程项目管理系统 © www.yiguanfep.com
  186. <img src="/static/home/images/police.png" alt="" style="width:14.5px;height:16px;">
  187. <a href="https://beian.mps.gov.cn/#/query/websearch?code=45030202000160 " rel="\&quot;noreferrer'target=\”blank\&quot;" onclick="window.open(this.href); return false;">桂公网安备45030202000160号</a>
  188. <a href="https://beian.miit.gov.cn/#/Integrated/index" onclick="window.open(this.href); return false;">桂ICP备17000971号</a>
  189. </div>
  190. <!-- /底部 -->
  191. <!-- 脚本 -->
  192. <script>
  193. const moduleInit = ['tool'];
  194. function gouguInit() {
  195. var form = layui.form,tool=layui.tool;
  196. //监听提交
  197. form.on('submit(webform)', function (data) {
  198. var arr_crud = [],crud_a=[],crud_e=[],crud_r=[],crud_l=[],crud_v=[];
  199. $('.crud-flie').each(function() {
  200. arr_crud.push($(this).val());
  201. });
  202. let isPost = true;
  203. for(var i=0;i<arr_crud.length;i++){
  204. let crud = arr_crud[i];
  205. let title = $('[name="'+crud+'_title"]').val();
  206. let type = $('[name="'+crud+'_type"]').val();
  207. let required = $('input[name="'+crud+'_required"]:checked').val();
  208. let add = $('input[name="'+crud+'_add"]:checked').val();
  209. let edit = $('input[name="'+crud+'_edit"]:checked').val();
  210. let read = $('input[name="'+crud+'_read"]:checked').val();
  211. let list = $('input[name="'+crud+'_list"]:checked').val();
  212. required=required?1:0;
  213. if(required){
  214. if(title == ''){
  215. layer.msg('字段【'+crud+'】名称不能为空');
  216. isPost = false;
  217. break;
  218. }
  219. crud_v.push({'field':crud,'type':type,'title':title});
  220. }
  221. else{
  222. required = 0;
  223. }
  224. if(add){
  225. if(title == ''){
  226. layer.msg('字段【'+crud+'】名称不能为空');
  227. isPost = false;
  228. break;
  229. }
  230. crud_a.push({'field':crud,'type':type,'required':required,'title':title});
  231. }
  232. if(edit){
  233. if(title == ''){
  234. layer.msg('字段【'+crud+'】名称不能为空');
  235. isPost = false;
  236. break;
  237. }
  238. crud_e.push({'field':crud,'type':type,'required':required,'title':title});
  239. }
  240. if(read){
  241. if(title == ''){
  242. layer.msg('字段【'+crud+'】名称不能为空');
  243. isPost = false;
  244. break;
  245. }
  246. crud_r.push({'field':crud,'type':type,'required':required,'title':title});
  247. }
  248. if(list){
  249. if(title == ''){
  250. layer.msg('字段【'+crud+'】名称不能为空');
  251. isPost = false;
  252. break;
  253. }
  254. crud_l.push({'field':crud,'type':type,'required':required,'title':title});
  255. }
  256. }
  257. //数组
  258. console.log(crud_v);
  259. console.log(crud_a);
  260. console.log(crud_e);
  261. console.log(crud_r);
  262. console.log(crud_l);
  263. if(crud_v.length==0 && isPost == true){
  264. layer.msg('必填选项不能为空');
  265. return false;
  266. }
  267. if(crud_a.length==0 && isPost == true){
  268. layer.msg('新增页展示不能为空');
  269. return false;
  270. }
  271. if(crud_e.length==0 && isPost == true){
  272. layer.msg('编辑页展示不能为空');
  273. return false;
  274. }
  275. if(crud_r.length==0 && isPost == true){
  276. layer.msg('查看页展示不能为空');
  277. return false;
  278. }
  279. if(crud_l.length==0 && isPost == true){
  280. layer.msg('列表页展示不能为空');
  281. return false;
  282. }
  283. let callback = function (e) {
  284. console.log(e);
  285. if (e == '') {
  286. layer.msg('crud生成成功,正在生成菜单...');
  287. tool.post("/admin/crud/menu", {field:data.field.field,name:data.field.name}, function(res){
  288. layer.msg(res.msg);
  289. if (res.code == 0) {
  290. setTimeout(function(){
  291. parent.location.reload();
  292. },2000);
  293. }
  294. });
  295. }
  296. else{
  297. layer.msg('代码已生成,如需重新生成,请删除后再重试');
  298. }
  299. }
  300. if(isPost == true){
  301. tool.post("/admin/crud/crud", {field:data.field.field,name:data.field.name,crud_v:crud_v,crud_a:crud_a,crud_e:crud_e,crud_r:crud_r,crud_l:crud_l}, callback);
  302. }
  303. return false;
  304. });
  305. }
  306. </script>
  307. <!-- /脚本 -->
  308. <!-- <script src="/static/assets/layui/layui.js"></script> -->
  309. <script src="/static/assets/layui/layui.js"></script>
  310. <script src="/static/assets/third_party/echart/echarts.min.js"></script>
  311. <script src="/static/assets/gougu/gouguInit.js"></script>
  312. <script src="https://unpkg.com/pinyin-pro"></script>
  313. <script>
  314. var { pinyin } = pinyinPro;
  315. </script>
  316. <!-- 统计代码 -->
  317. <!-- /统计代码 -->
  318. </body>
  319. </html>