重新定义模型
This commit is contained in:
@@ -6,9 +6,13 @@
|
||||
<h2>{$meta_title}</h2>
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
<a class="btn btn-info" href="{:url('Model/index')}">返回</a>
|
||||
<a class="btn btn-primary" href="{:url('add',array('model_id'=>$model_id))}">新 增</a>
|
||||
<button class="btn btn-danger ajax-post confirm" url="{:url('del')}" target-form="ids">删 除</button>
|
||||
<a class="btn btn-danger" href="{:url('add',array('model_id'=>$model_id))}"><i class="fa fa-plus"></i> 新 增</a>
|
||||
{if $model_id}
|
||||
<button class="btn btn-primary openDilog" url="{:url('insert?id='.$model_id)}">导入字段</button>
|
||||
<button class="btn btn-primary ajax-get" url="{:url('generate?id='.$model_id)}">生成数据库</button>
|
||||
{/if}
|
||||
<!-- <button class="btn btn-danger ajax-post confirm" url="{:url('del')}" target-form="ids"><i class="fa fa-remove"></i> 删 除</button> -->
|
||||
<a class="btn btn-warning" href="{:url('Model/index')}"><i class="fa fa-reply"></i> 返回</a>
|
||||
</div>
|
||||
</header>
|
||||
<div class="main-box-body clearfix">
|
||||
@@ -36,7 +40,7 @@
|
||||
<td>{$item['value']}</td>
|
||||
<td>
|
||||
<a href="{:url('edit',array('id'=>$item['id']))}">编辑</a>
|
||||
<a href="{:url('del',array('id'=>$item['id']))}" class="confirm ajax-get">删除</a>
|
||||
<a href="{:url('del',array('id'=>$item['id'], 'model_id'=>$model_id))}" class="confirm ajax-get">删除</a>
|
||||
</td>
|
||||
</tr>
|
||||
{/volist}
|
||||
@@ -46,4 +50,19 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
{block name="script"}
|
||||
<script type="text/javascript" src="__PUBLIC__/plugs/layer/layer.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$('.openDilog').click(function(){
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: false,
|
||||
area: ['900px', '560px'],
|
||||
content: $('.openDilog').attr('url')
|
||||
});
|
||||
});
|
||||
})
|
||||
</script>
|
||||
{/block}
|
||||
60
application/admin/view/attribute/insert.html
Normal file
60
application/admin/view/attribute/insert.html
Normal file
@@ -0,0 +1,60 @@
|
||||
{include file="admin@public/header" /}
|
||||
<div class="dialog-body">
|
||||
<div class="main-box clearfix">
|
||||
<header class="main-box-header clearfix">
|
||||
<div class="pull-left">
|
||||
<h2>{$meta_title}</h2>
|
||||
</div>
|
||||
</header>
|
||||
<div class="main-box-body clearfix">
|
||||
<div class="table-responsive clearfix">
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><input class="checkbox check-all" type="checkbox"></th>
|
||||
<th>表单标题</th>
|
||||
<th>字段名</th>
|
||||
<th>字段类型</th>
|
||||
<th>字段长度</th>
|
||||
<th>默认值</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{volist name="list" id="item"}
|
||||
<tr>
|
||||
<td><input class="ids row-selected" type="checkbox" name="id[]" value="{$item['id']}"></td>
|
||||
<td>{$item['title']}</td>
|
||||
<td>{$item['name']}</td>
|
||||
<td>{$item['type_text']}</td>
|
||||
<td>{$item['length']}</td>
|
||||
<td>{$item['value']}</td>
|
||||
</tr>
|
||||
{/volist}
|
||||
</tbody>
|
||||
</table>
|
||||
{$page}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer-bar">
|
||||
<button class="btn btn-primary insert-btn">确认导入</button>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
|
||||
//关闭iframe
|
||||
$('button.insert-btn').click(function(){
|
||||
$.ajax({
|
||||
url : "{:url('admin/attribute/insert?id='.$id)}",
|
||||
data : $('input.ids:checked').serialize(),
|
||||
type : "POST",
|
||||
success : function(res){
|
||||
if (res.code == 1) {
|
||||
parent.layer.close(index);
|
||||
}
|
||||
},
|
||||
dataType : 'json'
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{include file="admin@public/footer" /}
|
||||
Reference in New Issue
Block a user