vr-shopxo-source/application/admin/view/default/public/form.html

281 lines
15 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

{{include file="public/header" /}}
<!-- content top hook -->
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}}
<div class="plugins-tag">
<span>{{$hook_name_content_top}}</span>
</div>
{{/if}}
{{php}}
$hook_data = Hook::listen($hook_name_content_top, ['hook_name'=>$hook_name_content_top, 'is_backend'=>true]);
if(!empty($hook_data) && is_array($hook_data))
{
foreach($hook_data as $hook)
{
if(is_string($hook) || is_int($hook))
{
echo htmlspecialchars_decode($hook);
}
}
}
{{/php}}
<!-- right content start -->
<div class="content-right">
<div class="content">
<!-- content inside top hook -->
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}}
<div class="plugins-tag">
<span>{{$hook_name_content_inside_top}}</span>
</div>
{{/if}}
{{php}}
$hook_data = Hook::listen($hook_name_content_inside_top, ['hook_name'=>$hook_name_content_inside_top, 'is_backend'=>true]);
if(!empty($hook_data) && is_array($hook_data))
{
foreach($hook_data as $hook)
{
if(is_string($hook) || is_int($hook))
{
echo htmlspecialchars_decode($hook);
}
}
}
{{/php}}
<!-- form start -->
{{block name="search_form"}}{{/block}}
<!-- form end -->
<!-- top operate start -->
<div class="am-g am-margin-top-sm">
{{block name="form_operate_top"}}
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}}
<div class="plugins-tag">
<span>plugins_view_admin_goods_top_operate</span>
</div>
{{/if}}
{{php}}
$hook_name = 'plugins_view_admin_goods_top_operate';
$hook_data = Hook::listen($hook_name, ['hook_name'=>$hook_name, 'is_backend'=>true]);
if(!empty($hook_data) && is_array($hook_data))
{
foreach($hook_data as $hook)
{
if(is_string($hook) || is_int($hook))
{
echo htmlspecialchars_decode($hook);
}
}
}
{{/php}}
{{/block}}
</div>
<!-- top operate end -->
<!-- list start -->
<div class="am-scrollable-horizontal am-table-scrollable-horizontal am-margin-top-sm">
<table class="am-table am-table-striped am-table-hover am-table-bordered am-text-nowrap">
<thead>
<tr>
{{if !empty($form_table['form'])}}
{{foreach $form_table['form'] as $t}}
<!-- 1. 上下居中 -->
<!-- 2. 格子大小 -->
<!-- 3. 内容位置居(左|中|右) -->
<!-- 4. 格子是否固定left|right 左|右) -->
<th class="
{{if !isset($t['is_middle']) or $t['is_middle'] eq 1}}am-text-middle {{/if}}
{{if !empty($t['grid_size'])}}am-grid-{{$t.grid_size}} {{/if}}
{{if !empty($t['align'])}}am-text-{{$t.align}} {{/if}}
{{if !empty($t['fixed'])}}am-grid-fixed-{{$t.fixed}} {{/if}}
">{{if isset($t['label'])}}{{$t.label}}{{/if}}</th>
{{/foreach}}
{{/if}}
</tr>
</thead>
<tbody>
{{if !empty($data_list) and !empty($form_table['form']) and !empty($form_table['base']) and !empty($form_table['base']['key_field'])}}
<!-- 处理数据数量小于默认数量 -->
{{for start="0" end="(count($data_list) < $page_size ? count($data_list) : $page_size)"}}
<!-- 1. tr 主键id名称 -->
<!-- 2. 是否黄色选中class -->
<tr {{if !empty($form_table['base'])}}
id="data-list-{{if isset($data_list[$i][$form_table['base']['key_field']])}}{{$data_list[$i][$form_table['base']['key_field']]}}{{/if}}"
{{if !empty($form_table['base']['status_field']) and isset($data_list[$i][$form_table['base']['status_field']]) and $data_list[$i][$form_table['base']['status_field']] eq 0}}class="am-active"{{/if}}
{{/if}}>
{{foreach $form_table['form'] as $t}}
<!-- 1. 上下居中 -->
<!-- 2. 格子大小 -->
<!-- 3. 内容位置居(左|中|右) -->
<!-- 4. 格子是否固定left|right 左|右) -->
<!-- 5. 是否操作列 -->
<td class="
{{if !isset($t['is_middle']) or $t['is_middle'] eq 1}}am-text-middle {{/if}}
{{if !empty($t['grid_size'])}}am-grid-{{$t.grid_size}} {{/if}}
{{if !empty($t['align'])}}am-text-{{$t.align}} {{/if}}
{{if !empty($t['fixed'])}}am-grid-fixed-{{$t.fixed}} {{/if}}
{{if !empty($t['view_type']) and $t['view_type'] eq 'operate'}}am-operate-grid {{/if}}
">
{{if isset($data_list[$i]) and !empty($t['view_type']) and !empty($t['view_key'])}}
<!-- 数据匹配 -->
{{switch $t.view_type}}
{{case field}}
<!-- 如果字段为数组则处理多个字段拼接数据 -->
{{if is_array($t['view_key'])}}
{{foreach $t['view_key'] as $fk=>$fv}}
{{if isset($data_list[$i][$fv])}}
{{$data_list[$i][$fv]}}
<!-- 多个字段拼接数据的的拼接字符 -->
{{if isset($t['view_key_join']) and $fk lt count($t['view_key'])-1}}
{{$t.view_key_join|raw}}
{{/if}}
{{/if}}
{{/foreach}}
{{else /}}
<!-- 非数组则直接取值 -->
{{if isset($data_list[$i][$t['view_key']])}}
{{$data_list[$i][$t['view_key']]|raw}}
{{/if}}
{{/if}}
{{/case}}
{{case module}}
<!-- 从模块加载自定义模块数据 -->
{{:ModuleInclude($t['view_key'], $data_list[$i])}}
{{/case}}
{{case status}}
<!-- 数据状态操作按钮组件 -->
{{if !empty($t['key_field']) and !empty($t['post_url'])}}
<a href="javascript:;"
class="am-icon-btn am-icon-check submit-state {{if $data_list[$i][$t['view_key']] eq 1}}am-success{{else /}}am-default{{/if}}"
data-url="{{$t.post_url}}"
data-id="{{if isset($data_list[$i][$t['key_field']])}}{{$data_list[$i][$t['key_field']]}}{{/if}}"
data-state="{{$data_list[$i][$t['view_key']]}}"
data-is-update-status="{{if isset($t['is_form_su'])}}{{$t.is_form_su}}{{else /}}0{{/if}}"
></a>
{{/if}}
{{/case}}
{{case operate}}
<!-- 是否操作列 -->
<!-- 模块数据 -->
{{:ModuleInclude($t['view_key'], $data_list[$i])}}
<!-- 列表操作钩子 -->
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}}
<div class="plugins-tag">
<span>{{$hook_name_form_list_operate}}</span>
</div>
{{/if}}
{{php}}
$hook_data = Hook::listen($hook_name_form_list_operate, [
'hook_name' => $hook_name_form_list_operate,
'is_backend' => true,
'id' => isset($data_list[$i][$form_table['base']['key_field']]) ? $data_list[$i][$form_table['base']['key_field']] : 0,
'data' => $data_list[$i],
]);
if(!empty($hook_data) && is_array($hook_data))
{
foreach($hook_data as $hook)
{
if(is_string($hook) || is_int($hook))
{
echo htmlspecialchars_decode($hook);
}
}
}
{{/php}}
{{/case}}
{{/switch}}
{{/if}}
</td>
{{/foreach}}
</tr>
{{/for}}
{{/if}}
</tbody>
</table>
{{if empty($data_list)}}
<div class="table-no"><i class="am-icon-warning"></i> 没有相关数据</div>
{{/if}}
</div>
<!-- list end -->
<!-- bottom operate start -->
<div class="am-g am-margin-top-sm">
{{block name="form_operate_bottom"}}
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}}
<div class="plugins-tag">
<span>{{$hook_name_form_bottom_operate}}</span>
</div>
{{/if}}
{{php}}
$hook_data = Hook::listen($hook_name_form_bottom_operate, ['hook_name'=>$hook_name_form_bottom_operate, 'is_backend'=>true]);
if(!empty($hook_data) && is_array($hook_data))
{
foreach($hook_data as $hook)
{
if(is_string($hook) || is_int($hook))
{
echo htmlspecialchars_decode($hook);
}
}
}
{{/php}}
{{/block}}
</div>
<!-- bottom operate end -->
<!-- page start -->
{{block name="form_page"}}
{{if !empty($data_list)}}
{{$page_html|raw}}
{{/if}}
{{/block}}
<!-- page end -->
<!-- content inside top hook -->
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}}
<div class="plugins-tag">
<span>{{$hook_name_content_inside_bottom}}</span>
</div>
{{/if}}
{{php}}
$hook_data = Hook::listen($hook_name_content_inside_bottom, ['hook_name'=>$hook_name_content_inside_bottom, 'is_backend'=>true]);
if(!empty($hook_data) && is_array($hook_data))
{
foreach($hook_data as $hook)
{
if(is_string($hook) || is_int($hook))
{
echo htmlspecialchars_decode($hook);
}
}
}
{{/php}}
</div>
</div>
<!-- right content end -->
<!-- content bottom hook -->
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}}
<div class="plugins-tag">
<span>{{$hook_name_content_bottom}}</span>
</div>
{{/if}}
{{php}}
$hook_data = Hook::listen($hook_name_content_bottom, ['hook_name'=>$hook_name_content_bottom, 'is_backend'=>true]);
if(!empty($hook_data) && is_array($hook_data))
{
foreach($hook_data as $hook)
{
if(is_string($hook) || is_int($hook))
{
echo htmlspecialchars_decode($hook);
}
}
}
{{/php}}
<!-- footer start -->
{{include file="public/footer" /}}
<!-- footer end -->