重新定义模型
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
<div class="main-box-body clearfix">
|
||||
|
||||
<!-- 表单 -->
|
||||
<form id="form" action="{:url('update')}" method="post" class="form-horizontal form">
|
||||
<form id="form" method="post" class="form-horizontal form">
|
||||
<!-- 基础 -->
|
||||
<div id="tab1" class="tab-pane in tab1">
|
||||
<div class="form-group">
|
||||
@@ -29,50 +29,6 @@
|
||||
<span class="help-block">(请输入模型的名称)</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-lg-2 control-label">模型类型</label>
|
||||
<div class="col-lg-3 col-sm-10">
|
||||
<select name="extend" class="form-control" style="width:auto">
|
||||
<option value="2">独立模型</option>
|
||||
<option value="1" selected="selected">文档模型</option>
|
||||
</select>
|
||||
<span class="help-block">(目前只支持独立模型和文档模型)</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-lg-2 control-label">引擎类型</label>
|
||||
<div class="col-lg-3 col-sm-10">
|
||||
<select name="engine_type" class="form-control" style="width:auto">
|
||||
<option value="MyISAM">MyISAM</option>
|
||||
<option value="InnoDB">InnoDB</option>
|
||||
<option value="MEMORY">MEMORY</option>
|
||||
<option value="BLACKHOLE">BLACKHOLE</option>
|
||||
<option value="MRG_MYISAM">MRG_MYISAM</option>
|
||||
<option value="ARCHIVE">ARCHIVE</option>
|
||||
</select>
|
||||
<span class="help-block"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-lg-2 control-label">是否需要主键</label>
|
||||
<div class="col-lg-10">
|
||||
<select name="need_pk" class="form-control" style="width:auto">
|
||||
<option value="1" selected="selected">是</option>
|
||||
<option value="0">否</option>
|
||||
</select>
|
||||
<span class="help-block">(选“是”则会新建默认的id字段作为主键)</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-lg-2 control-label">是否会员显示</label>
|
||||
<div class="col-lg-10">
|
||||
<select name="is_user_show" class="form-control" style="width:auto">
|
||||
<option value="1" selected="selected">是</option>
|
||||
<option value="0">否</option>
|
||||
</select>
|
||||
<span class="help-block">(选“是”则会新建默认的id字段作为主键)</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-lg-2 control-label">模型图标</label>
|
||||
<div class="col-lg-6 col-sm-10">
|
||||
@@ -85,7 +41,6 @@
|
||||
<!-- 按钮 -->
|
||||
<div class="form-group">
|
||||
<div class="col-lg-offset-2 col-lg-10">
|
||||
<input type="hidden" name="id" value="{$info.id|default=''}">
|
||||
<button class="btn btn-success submit-btn ajax-post" type="submit" target-form="form-horizontal">确 定</button>
|
||||
<button class="btn btn-danger btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
|
||||
</div>
|
||||
|
||||
@@ -6,13 +6,13 @@
|
||||
<div class="main-box clearfix">
|
||||
<header class="main-box-header clearfix">
|
||||
<div class="pull-left">
|
||||
<h2>{if condition="ACTION_NAME eq 'add'"}新增{else/}编辑{/if}模型</h2>
|
||||
<h2>编辑模型</h2>
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
</div>
|
||||
</header>
|
||||
<div class="main-box-body clearfix">
|
||||
<form id="form" action="{:url('update')}" method="post" class="form form-horizontal">
|
||||
<form id="form" method="post" class="form form-horizontal">
|
||||
<div class="tabs-wrapper">
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="active"><a href="#tab1" data-toggle="tab">基 础</a></li>
|
||||
@@ -25,7 +25,7 @@
|
||||
<div class="form-group">
|
||||
<label class="col-lg-2 control-label">模型标识</label>
|
||||
<div class="col-lg-6 col-sm-10">
|
||||
<input type="text" class="form-control disabled" name="name" value="{$info.name}" disabled>
|
||||
<input type="text" class="form-control disabled" name="name" value="{$info['name']}" disabled>
|
||||
<span class="help-block">(请输入文档模型标识)</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -36,27 +36,6 @@
|
||||
<span class="help-block">(请输入模型的名称)</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-lg-2 control-label">模型类型</label>
|
||||
<div class="col-lg-3 col-sm-10">
|
||||
<select name="extend" class="form-control disabled" readonly disabled>
|
||||
<option value="0" {if condition="$info['extend'] eq '0'"}selected{/if}>--请选择--</option>
|
||||
<option value="1" {if condition="$info['extend'] eq '1'"}selected{/if}>文档模型</option>
|
||||
<option value="2" {if condition="$info['extend'] eq '2'"}selected{/if}>独立模型</option>
|
||||
</select>
|
||||
<span class="help-block">(目前只支持独立模型和文档模型)</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-lg-2 control-label">是否会员显示</label>
|
||||
<div class="col-lg-10">
|
||||
<select name="is_user_show" class="form-control" style="width:auto">
|
||||
<option value="1" {if $info['is_user_show'] ==1}selected="selected"{/if}>是</option>
|
||||
<option value="0" {if $info['is_user_show'] ==0}selected="selected"{/if}>否</option>
|
||||
</select>
|
||||
<span class="help-block">(选“是”则会新建默认的id字段作为主键)</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-lg-2 control-label">模型图标</label>
|
||||
<div class="col-lg-6 col-sm-10">
|
||||
@@ -70,21 +49,21 @@
|
||||
<div class="form-group">
|
||||
<label class="col-lg-2 control-label">字段别名定义</label>
|
||||
<div class="col-lg-6 col-sm-10">
|
||||
<textarea name="attribute_alias" class="form-control">{$info.attribute_alias}</textarea>
|
||||
<textarea name="attribute_alias" class="form-control">{$info['attribute_alias']}</textarea>
|
||||
<span class="help-block">(用于表单显示的名称)</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-lg-2 control-label">表单显示分组</label>
|
||||
<div class="col-lg-6 col-sm-10">
|
||||
<input type="text" class="form-control" name="field_group" value="{$info.field_group}">
|
||||
<input type="text" class="form-control" name="attribute_group" value="{$info['attribute_group']}">
|
||||
<span class="help-block">(用于表单显示的分组,以及设置该模型表单排序的显示)</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-lg-2 control-label">表单显示排序</label>
|
||||
<div class="col-lg-10 boards" id="field_group_sort">
|
||||
{volist name=":parse_field_attr($info['field_group'])" id="vo"}
|
||||
<div class="col-lg-10 boards" id="attribute_group_sort">
|
||||
{volist name=":parse_field_attr($info['attribute_group'])" id="vo"}
|
||||
<div class="board panel panel-info">
|
||||
<div class="panel-heading">{$vo}</div>
|
||||
<div class="panel-body">
|
||||
@@ -93,7 +72,7 @@
|
||||
{if (($field['group'] == -1) or ($field['group'] eq $key))}
|
||||
<div class="board-item">
|
||||
<span data="{$field['id']}">{$field['title']} [{$field['name']}]</span>
|
||||
<input type="hidden" name="field_sort[{$key}][]" value="{$field['id']}"/>
|
||||
<input type="hidden" name="attribute_sort[{$key}][]" value="{$field['id']}"/>
|
||||
</div>
|
||||
{php}
|
||||
unset($fields[$k]);
|
||||
@@ -112,7 +91,7 @@
|
||||
<div class="form-group">
|
||||
<label class="col-lg-2 control-label">列表定义</label>
|
||||
<div class="col-lg-6 col-sm-10">
|
||||
<textarea name="list_grid" class="form-control">{$info.list_grid}</textarea>
|
||||
<textarea name="list_grid" class="form-control">{$info['list_grid']}</textarea>
|
||||
<span class="help-block">(默认列表模板的展示规则)</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -120,14 +99,14 @@
|
||||
<div class="form-group">
|
||||
<label class="col-lg-2 control-label">默认搜索字段</label>
|
||||
<div class="col-lg-6 col-sm-10">
|
||||
<input type="text" class="form-control" name="search_key" value="{$info.search_key}">
|
||||
<input type="text" class="form-control" name="search_key" value="{$info['search_key']}">
|
||||
<span class="help-block">(默认列表模板的默认搜索项)</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-lg-2 control-label">高级搜索字段</label>
|
||||
<div class="col-lg-6 col-sm-10">
|
||||
<input type="text" class="form-control" name="search_list" value="{$info.search_list}">
|
||||
<input type="text" class="form-control" name="search_list" value="{$info['search_list']}">
|
||||
<span class="help-block">(默认列表模板的高级搜索项)</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -180,11 +159,11 @@
|
||||
<script type="text/javascript" src="__PUBLIC__/plugs/board/board.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$('.form-group #field_sort').boards();
|
||||
$('.form-group #field_group_sort').boards({
|
||||
$('.form-group #attribute_sort').boards();
|
||||
$('.form-group #attribute_group_sort').boards({
|
||||
drop: function(e){
|
||||
var group = e.target.closest('.board').find('.board-list').attr('data-group');
|
||||
e.element.find('input').attr('name','field_sort[' + group + '][]')
|
||||
e.element.find('input').attr('name','attribute_sort[' + group + '][]')
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
<a class="btn btn-success" href="{:url('Model/add')}">新 增</a>
|
||||
<button class="btn btn-info ajax-post" target-form="ids" url="{:url('Model/status',array('status'=>1))}">启 用</button>
|
||||
<button class="btn ajax-post" target-form="ids" url="{:url('Model/status',array('status'=>0))}">禁 用</button>
|
||||
</div>
|
||||
</header>
|
||||
@@ -36,7 +35,7 @@
|
||||
<input class="ids" type="checkbox" name="ids[]" value="{$item['id']}" />
|
||||
</td>
|
||||
<td>{$item['id']}</td>
|
||||
<td>{$item['name']}</td>
|
||||
<td><i class="fa fa-{$item['icon']}"></i> {$item['name']}</td>
|
||||
<td>
|
||||
<a data-id="{$item.id}" href="{:url('model/edit?id='.$item['id'])}">{$item.title}</a>
|
||||
</td>
|
||||
@@ -52,17 +51,15 @@
|
||||
</td>
|
||||
<td>
|
||||
<a href="{:url('admin/attribute/index?model_id='.$item['id'])}">字段</a>
|
||||
<a href="{:url('model/status?ids='.$item['id'].'&status='.abs(1-$item['status']))}" class="ajax-get">{$item['status']|show_status_op}</a>
|
||||
<a href="{:url('model/status?id='.$item['id'].'&status='.abs(1-$item['status']))}" class="ajax-get">{$item['status']|show_status_op}</a>
|
||||
<a href="{:url('model/edit?id='.$item['id'])}">编辑</a>
|
||||
<a href="{:url('model/del?id='.$item['id'])}" class="confirm ajax-get">删除</a>
|
||||
{if $item['extend']}
|
||||
<a href="{:url('admin/content/index?model_id='.$item['id'])}">数据</a>
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
{/volist}
|
||||
{else/}
|
||||
<td colspan="7" class="text-center">aOh! 暂时还没有内容!</td>
|
||||
<td colspan="7" class="text-center">aOh! 暂时还没有创建模型!</td>
|
||||
{/notempty}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
Reference in New Issue
Block a user