创建版本
This commit is contained in:
@@ -0,0 +1,71 @@
|
||||
<form method="post" id="model" name="model">
|
||||
<table class="table table-form m-b-none">
|
||||
<tr>
|
||||
<td align="right" width="10%">模型名称</th>
|
||||
<td><input type="text" id="name" name="name" value="{{$model->name}}" onblur="app.pinyin('name','table');" class="form-control input-sm"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right">父节模型</td>
|
||||
<td>
|
||||
<select class="form-control input-sm" name="parent_id" id="parent_id">
|
||||
<option value="0"> - </option>
|
||||
@foreach($models as $_model)
|
||||
<option value="{{$_model->id}}" @if($_model->id == $model->parent_id) selected @endif>{{$_model->name}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right">模型类型</td>
|
||||
<td>
|
||||
<select class="form-control input-sm" name="type" id="type">
|
||||
<option value="0" @if($model->type == 0) selected @endif> - </option>
|
||||
<option value="1" @if($model->type == 1) selected @endif>多行子表</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right">关联外键</td>
|
||||
<td><input type="text" id="relation" name="relation" value="{{$model->relation}}" class="form-control input-sm"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right">数据表名</td>
|
||||
<td><input type="text" id="table" name="table" value="{{$model->table}}" class="form-control input-sm" @if($row->id > 0) readonly @endif></td>
|
||||
</tr>
|
||||
|
||||
<!--
|
||||
<tr>
|
||||
<td align="right">审核类型</td>
|
||||
<td>
|
||||
<label class="radio-inline"><input type="radio" @if($model['audit_type'] == 0) checked @endif value="0" name="audit_type"> 无 </label>
|
||||
<label class="radio-inline"><input type="radio" @if($model['audit_type'] == 1) checked @endif value="1" name="audit_type"> 固定流程 </label>
|
||||
<label class="radio-inline"><input type="radio" @if($model['audit_type'] == 2) checked @endif value="2" name="audit_type"> 自由流程 </label>
|
||||
<label class="radio-inline"><input type="radio" @if($model['audit_type'] == 3) checked @endif value="3" name="audit_type"> 审核 </label>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right">支持回收站</td>
|
||||
<td>
|
||||
<label class="radio-inline"><input type="radio" @if($model['is_trash'] == 0) checked @endif value="0" name="is_trash"> 否 </label>
|
||||
<label class="radio-inline"><input type="radio" @if($model['is_trash'] == 1) checked @endif value="1" name="is_trash"> 是 </label>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right">数据排序</td>
|
||||
<td>
|
||||
<label class="radio-inline"><input type="radio" @if($model['is_sort'] == 0) checked @endif value="1" name="is_sort"> 否 </label>
|
||||
<label class="radio-inline"><input type="radio" @if($model['is_sort'] == 1) checked @endif value="0" name="is_sort"> 是 </label>
|
||||
</td>
|
||||
</tr>
|
||||
-->
|
||||
|
||||
</table>
|
||||
<input type="hidden" name="id" value="{{$model->id}}">
|
||||
|
||||
</form>
|
||||
@@ -0,0 +1,92 @@
|
||||
{{$header["js"]}}
|
||||
|
||||
<div class="panel no-border" id="{{$header['master_table']}}-controller">
|
||||
@include('headers')
|
||||
<div class='list-jqgrid'>
|
||||
<div id="{{$header['master_table']}}-grid" style="width:100%;" class="ag-theme-balham"></div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
(function ($) {
|
||||
var table = '{{$header["master_table"]}}';
|
||||
var config = gdoo.grids[table];
|
||||
var action = config.action;
|
||||
var search = config.search;
|
||||
|
||||
action.dialogType = 'dialog';
|
||||
|
||||
// 自定义搜索方法
|
||||
search.searchInit = function (e) {
|
||||
var self = this;
|
||||
}
|
||||
|
||||
action.field = function(data) {
|
||||
var me = this;
|
||||
var grid = config.grid;
|
||||
var url = app.url('model/field/index', {model_id: data.master_id});
|
||||
var index = layer.open({
|
||||
skin: 'layui-layer-frame',
|
||||
scrollbar: false,
|
||||
closeBtn: 2,
|
||||
title: data.master_name + '[字段]',
|
||||
type: 2,
|
||||
move: false,
|
||||
area: ['100%', '100%'],
|
||||
content: url,
|
||||
});
|
||||
}
|
||||
|
||||
var options = new agGridOptions();
|
||||
var gridDiv = document.querySelector("#{{$header['master_table']}}-grid");
|
||||
gridDiv.style.height = getPanelHeight(48);
|
||||
|
||||
config.cols[0]['hide'] = true;
|
||||
config.cols[1]['hide'] = true;
|
||||
config.cols[2]['hide'] = true;
|
||||
options.autoGroupColumnDef = {
|
||||
headerName: '名称',
|
||||
width: 120,
|
||||
cellRendererParams: {
|
||||
checkbox: true,
|
||||
suppressCount: true,
|
||||
}
|
||||
};
|
||||
options.treeData = true;
|
||||
options.groupDefaultExpanded = -1;
|
||||
options.getDataPath = function(data) {
|
||||
return data.tree_path;
|
||||
};
|
||||
|
||||
options.remoteDataUrl = '{{url()}}';
|
||||
options.remoteParams = search.advanced.query;
|
||||
options.columnDefs = config.cols;
|
||||
options.onRowDoubleClicked = function (params) {
|
||||
if (params.node.rowPinned) {
|
||||
return;
|
||||
}
|
||||
if (params.data == undefined) {
|
||||
return;
|
||||
}
|
||||
if (params.data.master_id > 0) {
|
||||
action.edit(params.data);
|
||||
}
|
||||
};
|
||||
|
||||
new agGrid.Grid(gridDiv, options);
|
||||
|
||||
// 读取数据
|
||||
options.remoteData({page: 1});
|
||||
|
||||
// 绑定自定义事件
|
||||
var $gridDiv = $(gridDiv);
|
||||
$gridDiv.on('click', '[data-toggle="event"]', function () {
|
||||
var data = $(this).data();
|
||||
if (data.master_id > 0) {
|
||||
action[data.action](data);
|
||||
}
|
||||
});
|
||||
config.grid = options;
|
||||
})(jQuery);
|
||||
|
||||
</script>
|
||||
@include('footers')
|
||||
Reference in New Issue
Block a user