123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353 |
- <?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;}*/ ?>
- <!DOCTYPE html>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <meta name="renderer" content="webkit">
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
- <meta name="360-site-verification" content="a7c876fae8b6e3175a52ea9f19543f51" />
- <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=0">
- <script src="/static/dist/xm-select.js"></script>
- <link rel="mobile-prefetch" href=""/>
- <title><?php echo get_system_config('web','admin_title'); ?></title>
- <meta name="keywords" content="<?php echo get_system_config('web','keywords'); ?>"/>
- <meta name="description" content="<?php echo get_system_config('web','desc'); ?>"/>
- <link rel="stylesheet" href="/static/assets/gougu/css/gougu.css?v=<?php echo get_system_config('web','version'); ?>" media="all">
- <style>
- .footer{
- width: 100%;
- height: 25px;
- text-align: center;
- position: fixed;
- bottom: 0;
- }
- </style>
- </head>
- <body class="main-body">
- <!-- 主体 -->
-
- <form class="layui-form p-4">
- <h3 class="pb-3">数据表信息</h3>
- <table class="layui-table layui-table-form">
- <tr>
- <td class="layui-td-gray-2">数据表名称</td>
- <td><?php echo htmlentities($detail['title']); ?></td>
- <td class="layui-td-gray-2">数据表备注</td>
- <td><?php echo htmlentities($detail['Comment']); ?></td>
- <td class="layui-td-gray-2">当前记录数</td>
- <td><?php echo htmlentities($detail['Rows']); ?></td>
- <td class="layui-td-gray-2">创建时间</td>
- <td><?php echo htmlentities($detail['Create_time']); ?></td>
- </tr>
- </table>
- <?php if($detail['c'] != '0'): ?>
- <h3 class="py-3">文件信息</h3>
- <table class="layui-table layui-table-form">
- <tr>
- <td colspan="8" class="red" style="text-align:left; line-height:1.8">
- 温馨提示:<br/>
- 1、【<strong>一键CRUD生成代码</strong>】已帮你完成 <strong>60%</strong> 以上的开发工作,以下是生成的文件所在目录。
- <br/>
- 2、可以刷新系统页面,点击左边的刚刚新增的<strong>菜单</strong>访问相关功能,如需更改菜单左侧图标,请在[系统管理]->[菜单节点]找到对应的菜单编辑修改即可。
- <br/>
- 3、代码生成以后,不建议删除(除非不需要了),建议在当前的基础上修改或新增开发,开发方式与传统的开发方式无区别。
- <br/>
- 4、CRUD生成的代码是最基础的代码,开发者通过二次开发修改,可能使得功能更完善,代码更健壮,特别是逻辑上的处理,以下是二次开发建议。
- <br/>
- 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>
- </td>
- </tr>
- <tr>
- <td class="layui-td-gray-2">控制器</td>
- <td><?php echo htmlentities($detail['c']); ?></td>
- <td class="layui-td-gray">开发建议</td>
- <td class="red">功能逻辑完善、控制器的其他方法的补充完善等</td>
- </tr>
- <tr>
- <td class="layui-td-gray-2">数据模型</td>
- <td><?php echo $detail['m']=='0' ? '-' : htmlentities($detail['m']); ?></td>
- <td class="layui-td-gray">开发建议</td>
- <td class="red">数据搜索条件完善、查询字段增减调整、关联表查询等</td>
- </tr>
- <tr>
- <td class="layui-td-gray-2">数据校验器</td>
- <td><?php echo $detail['v']=='0' ? '-' : htmlentities($detail['v']); ?></td>
- <td class="layui-td-gray">开发建议</td>
- <td class="red">增强数据校验规则、修改调整校验提示等</td>
- </tr>
- <tr>
- <td class="layui-td-gray-2">列表页面</td>
- <td><?php echo $detail['l']=='0' ? '-' : htmlentities($detail['l']); ?></td>
- <td class="layui-td-gray">开发建议</td>
- <td class="red">列表显示字段增减调整、列表字段表格宽度调整、其他按钮、链接的补充完善等</td>
- </tr>
- <tr>
- <td class="layui-td-gray-2">添加页面</td>
- <td><?php echo $detail['a']=='0' ? '-' : htmlentities($detail['a']); ?></td>
- <td class="layui-td-gray">开发建议</td>
- <td class="red">需要输入的字段增减调整、单选、多选、下拉选的内容调整等</td>
- </tr>
- <tr>
- <td class="layui-td-gray-2">编辑页面</td>
- <td><?php echo $detail['e']=='0' ? '-' : htmlentities($detail['e']); ?></td>
- <td class="layui-td-gray">开发建议</td>
- <td class="red">需要编辑的字段增减调整、单选、多选、下拉选的内容调整等</td>
- </tr>
- <tr>
- <td class="layui-td-gray-2">查看页面</td>
- <td><?php echo $detail['r']=='0' ? '-' : htmlentities($detail['r']); ?></td>
- <td class="layui-td-gray">开发建议</td>
- <td class="red">显示字段增减调整、其他按钮、连接的补充完善等</td>
- </tr>
- </table>
- <h3 class="py-3">数据表字段</h3>
- <table class="layui-table layui-form">
- <thead>
- <th style="text-align:center;">字段列名</th>
- <th style="text-align:center;">数据类型</th>
- <th style="text-align:center;">字段注释</th>
- </thead>
- <tbody>
- <?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;?>
- <tr>
- <td><?php echo htmlentities($vo['Field']); ?></td>
- <td><?php echo htmlentities($vo['Type']); ?></td>
- <td><?php echo htmlentities($vo['Comment']); ?></td>
- </tr>
- <?php endforeach; endif; else: echo "" ;endif; ?>
- </tbody>
- </table>
- <?php else: ?>
- <h3 class="py-3">数据表字段</h3>
- <table class="layui-table layui-form">
- <thead>
- <th style="text-align:center;">字段列名</th>
- <th style="text-align:center;">字段注释</th>
- <th style="text-align:center;">数据类型</th>
- <th class="blue" style="text-align:center;">表单字段名称</th>
- <th class="blue" style="text-align:center;">是否必填</th>
- <th class="blue" style="text-align:center;">表单元素类型</th>
- <th class="green" style="text-align:center;">新增页展示</th>
- <th class="green" style="text-align:center;">编辑页展示</th>
- <th class="green" style="text-align:center;">列表页展示</th>
- <th class="green" style="text-align:center;">查询页展示</th>
- </thead>
- <tbody>
- <?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;?>
- <tr>
- <td><?php echo htmlentities($vo['Field']); ?></td>
- <td><?php echo htmlentities($vo['Comment']); ?></td>
- <td><?php echo htmlentities($vo['Type']); ?></td>
- <?php if($vo['Field'] == 'id'): ?>
- <td style="text-align:center;">-</td>
- <td style="text-align:center;">-</td>
- <td style="text-align:center;">-</td>
- <td style="text-align:center;">-</td>
- <td style="text-align:center;">-</td>
- <td style="text-align:center;">-</td>
- <td style="text-align:center;">-</td>
- <?php else: ?>
- <td style="text-align:center;">
- <input type="hidden" name="<?php echo htmlentities($vo['Field']); ?>" value="<?php echo htmlentities($vo['Field']); ?>" class="crud-flie">
- <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>
- <td style="text-align:center;"><input type="checkbox" name="<?php echo htmlentities($vo['Field']); ?>_required" value="1" lay-skin="primary"></td>
- <td>
- <select name="<?php echo htmlentities($vo['Field']); ?>_type">
- <option value="input" selected="">文本框</option>
- <option value="textarea">多行文本</option>
- <option value="select">下拉框</option>
- <option value="radio">单选框</option>
- <option value="checkbox">复选框</option>
- <option value="summernote">富文本</option>
- <option value="datetime">日期控件</option>
- <option value="upload">上传控件</option>
- </select>
- </td>
- <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>
- <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>
- <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>
- <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>
- <?php endif; ?>
- </tr>
- <?php endforeach; endif; else: echo "" ;endif; ?>
- </tbody>
- </table>
- <div class="py-3">
- <input type="hidden" name="field" value="<?php echo htmlentities($detail['title']); ?>">
- <input type="hidden" name="name" value="<?php echo htmlentities($detail['Comment']); ?>">
- <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">一键CRUD生成代码</button>
- <button type="reset" class="layui-btn layui-btn-primary">重置</button>
- </div>
- <?php endif; ?>
- </form>
- <!-- /主体 -->
- <!-- 底部 -->
-
- <div class="footer">
- 逸管工程项目管理系统 © www.yiguanfep.com
- <img src="/static/home/images/police.png" alt="" style="width:14.5px;height:16px;">
- <a href="https://beian.mps.gov.cn/#/query/websearch?code=45030202000160 " rel="\"noreferrer'target=\”blank\"" onclick="window.open(this.href); return false;">桂公网安备45030202000160号</a>
- <a href="https://beian.miit.gov.cn/#/Integrated/index" onclick="window.open(this.href); return false;">桂ICP备17000971号</a>
- </div>
-
-
- <!-- /底部 -->
-
- <!-- 脚本 -->
-
- <script>
- const moduleInit = ['tool'];
- function gouguInit() {
- var form = layui.form,tool=layui.tool;
- //监听提交
- form.on('submit(webform)', function (data) {
- var arr_crud = [],crud_a=[],crud_e=[],crud_r=[],crud_l=[],crud_v=[];
- $('.crud-flie').each(function() {
- arr_crud.push($(this).val());
- });
- let isPost = true;
- for(var i=0;i<arr_crud.length;i++){
- let crud = arr_crud[i];
- let title = $('[name="'+crud+'_title"]').val();
- let type = $('[name="'+crud+'_type"]').val();
- let required = $('input[name="'+crud+'_required"]:checked').val();
-
- let add = $('input[name="'+crud+'_add"]:checked').val();
- let edit = $('input[name="'+crud+'_edit"]:checked').val();
- let read = $('input[name="'+crud+'_read"]:checked').val();
- let list = $('input[name="'+crud+'_list"]:checked').val();
- required=required?1:0;
- if(required){
- if(title == ''){
- layer.msg('字段【'+crud+'】名称不能为空');
- isPost = false;
- break;
- }
- crud_v.push({'field':crud,'type':type,'title':title});
- }
- else{
- required = 0;
- }
-
- if(add){
- if(title == ''){
- layer.msg('字段【'+crud+'】名称不能为空');
- isPost = false;
- break;
- }
- crud_a.push({'field':crud,'type':type,'required':required,'title':title});
- }
-
- if(edit){
- if(title == ''){
- layer.msg('字段【'+crud+'】名称不能为空');
- isPost = false;
- break;
- }
- crud_e.push({'field':crud,'type':type,'required':required,'title':title});
- }
-
- if(read){
- if(title == ''){
- layer.msg('字段【'+crud+'】名称不能为空');
- isPost = false;
- break;
- }
- crud_r.push({'field':crud,'type':type,'required':required,'title':title});
- }
-
- if(list){
- if(title == ''){
- layer.msg('字段【'+crud+'】名称不能为空');
- isPost = false;
- break;
- }
- crud_l.push({'field':crud,'type':type,'required':required,'title':title});
- }
- }
- //数组
- console.log(crud_v);
- console.log(crud_a);
- console.log(crud_e);
- console.log(crud_r);
- console.log(crud_l);
- if(crud_v.length==0 && isPost == true){
- layer.msg('必填选项不能为空');
- return false;
- }
- if(crud_a.length==0 && isPost == true){
- layer.msg('新增页展示不能为空');
- return false;
- }
- if(crud_e.length==0 && isPost == true){
- layer.msg('编辑页展示不能为空');
- return false;
- }
- if(crud_r.length==0 && isPost == true){
- layer.msg('查看页展示不能为空');
- return false;
- }
- if(crud_l.length==0 && isPost == true){
- layer.msg('列表页展示不能为空');
- return false;
- }
-
- let callback = function (e) {
- console.log(e);
- if (e == '') {
- layer.msg('crud生成成功,正在生成菜单...');
- tool.post("/admin/crud/menu", {field:data.field.field,name:data.field.name}, function(res){
- layer.msg(res.msg);
- if (res.code == 0) {
- setTimeout(function(){
- parent.location.reload();
- },2000);
- }
- });
- }
- else{
- layer.msg('代码已生成,如需重新生成,请删除后再重试');
- }
- }
- if(isPost == true){
- 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);
- }
- return false;
- });
- }
- </script>
- <!-- /脚本 -->
-
- <!-- <script src="/static/assets/layui/layui.js"></script> -->
- <script src="/static/assets/layui/layui.js"></script>
- <script src="/static/assets/third_party/echart/echarts.min.js"></script>
- <script src="/static/assets/gougu/gouguInit.js"></script>
- <script src="https://unpkg.com/pinyin-pro"></script>
- <script>
-
- var { pinyin } = pinyinPro;
- </script>
-
-
- <!-- 统计代码 -->
-
- <!-- /统计代码 -->
- </body>
- </html>
|