<?php /*a:3:{s:64:"/www/wwwroot/btn.millet-mirth.com/view/admin/catetype/index.html";i:1630634048;s:60:"/www/wwwroot/btn.millet-mirth.com/view/admin/common/top.html";i:1625466448;s:63:"/www/wwwroot/btn.millet-mirth.com/view/admin/common/bottom.html";i:1629163316;}*/ ?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title><?php echo config('common.CMS_NAME'); ?></title>
<link rel="stylesheet" href="/static/tqcms/css/common.css">
<link rel="stylesheet" href="/static/tqcms/layui/css/layui.css"><!--layui css-->
<link rel="stylesheet" href="/static/tqcms/css/skin.css">
<script src="/static/tqcms/js/jquery.js"></script>
</head>
<body>
<div class="body_top">
	<ul class="title">
    	<li class="active"><a href="<?php echo url('index'); ?>">模型管理</a></li>
    </ul>
</div>

<div class="body_content_list">

<script type="text/html" id="barDemo">
<span class="tq_table_bar">
  <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
  {{#  if(d.id > 2 ){ }}
  <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
  {{#  } else { }}
  <a class="layui-btn layui-btn-danger layui-btn-xs layui-btn-disabled">删除</a>
  {{#  } }}
</span>
</script>



<script type="text/html" id="tq_btn">
  	<a class="layui-btn layui-btn-normal layui-btn-sm" lay-event="add">添加</a>
</script>
<table class="layui-hide" id="list" lay-filter="list"></table>

</div>
<input name="" id="add_type" type="hidden" value="0" />
<script src="/static/tqcms/layui/layui.js"></script><!--layui js-->
<script src="/static/tqcms/layui/laytq.js"></script><!--layui js-->
<script src="/static/tqcms/js/common.js"></script>
<script src="/static/tqcms/js/md5.js"></script>
<script src="/static/tqcms/js/url.js"></script>
</body>
</html>
<script>
iname=self.frameElement.name;
layui.use('table', function(){
  var table = layui.table,form = layui.form;
  var mpage=1;
  
  table.render({
    elem: '#list'
	,title:'栏目列表信息'
    ,url:'<?php echo url("Catetype/list_data"); ?>'
    ,cellMinWidth: 80 //全局定义常规单元格的最小宽度，layui 2.2.1 新增
	,even: true
	,toolbar: '#tq_btn'
	,defaultToolbar: ['filter']
	,height: 'full-71'
	,cols: [[
      {field:'id', width:80, title: '编号', sort: true}
      ,{field:'name', title: '模型名称'}
      ,{field:'table', title: '扩展表名'}
      ,{field:'list', title: '列表模板'}
      ,{field:'info', title: '详情模板'}
      ,{field:'id', width:166,align:'center',toolbar:'#barDemo', title: '操作'}
    ]]
  });
  
  
//监听工具条
table.on('tool(list)', function(obj){
	var data = obj.data;
	if(obj.event === 'del'){
		window.top.delete_c(obj,iname);
	}

	if(obj.event==='edit'){
		var title='修改模型';
		var url="<?php echo url('edit'); ?>?id="+data.id+"";
		var area=["500px", "350px"];
		window.top.openiframe(title,url,area,iname);
	}

});

//表头操作
table.on('toolbar(list)', function(obj){

	//添加
	if(obj.event==='add'){
		var title='添加模型';
		var url="<?php echo url('add'); ?>";
		var area=["500px", "350px"];
		window.top.openiframe(title,url,area,iname);
	}	
	
});

  
});
//layui end;

function delete_id(info){
	$.post('/admin/Catetype/is_delete',{id:info.data.id,table:info.data.table},function(data){ info.del(); });
}
</script>