动态表格排除选择控件支持更多方式

feat/task1-c-wallet
gongfuxiang 2022-05-06 23:46:47 +08:00
parent a030eac0d1
commit fe9218de80
8 changed files with 57 additions and 24 deletions

View File

@ -108,13 +108,13 @@ class Goods
'view_key' => 'brand_name',
'is_sort' => 1,
'search_config' => [
'form_type' => 'module',
'template' => 'lib/module/category_brand',
'form_type' => 'select',
'form_name' => 'brand_id',
'where_type' => 'in',
'data' => BrandService::CategoryBrand(),
'data_key' => 'id',
'data_name' => 'name',
'where_type' => 'in',
'is_multiple' => 1,
],
],
[

View File

@ -1,8 +0,0 @@
<!-- 分类下品牌 -->
{{if !empty($module_data['data']) && !empty($module_data['form_name_key'])}}
<select class="am-radius chosen-select" multiple name="{{$module_data.form_name_key}}" data-placeholder="品牌...">
{{foreach $module_data.data as $v}}
<option value="{{$v.id}}" {{if !empty($module_data['params']) and !empty($module_data['params'][$module_data['form_name_key']]) and is_array($module_data['params'][$module_data['form_name_key']]) and in_array($v['id'], $module_data['params'][$module_data['form_name_key']])}}selected{{/if}}>{{$v.name}}</option>
{{/foreach}}
</select>
{{/if}}

View File

@ -279,7 +279,16 @@
{{case radio}}
{{if isset($data_list[$i][$form_table['base']['key_field']])}}
<!-- 是否配置指定数据不显示控件 -->
{{if empty($t['not_show_data']) or empty($t['not_show_key']) or !isset($data_list[$i][$t['not_show_key']]) or !in_array($data_list[$i][$t['not_show_key']], $t['not_show_data'])}}
{{if
!isset($t['not_show_data']) or
empty($t['not_show_key']) or
(is_array($t['not_show_data']) and isset($data_list[$i][$t['not_show_key']]) and !in_array($data_list[$i][$t['not_show_key']], $t['not_show_data'])) or
(isset($t['not_show_type']) and isset($data_list[$i][$t['not_show_key']]) and (
($t['not_show_type'] eq 0 and $data_list[$i][$t['not_show_key']] eq $t['not_show_data']) or
($t['not_show_type'] eq 1 and $data_list[$i][$t['not_show_key']] gt $t['not_show_data']) or
($t['not_show_type'] eq 2 and $data_list[$i][$t['not_show_key']] lt $t['not_show_data'])
))
}}
<div class="form-table-operate-radio">
<label class="am-radio am-secondary am-radio-inline">
<input type="radio" name="{{$t.view_key}}" value="{{$data_list[$i][$form_table['base']['key_field']]}}" {{if isset($t['is_checked']) and $t['is_checked'] eq 1}}checked{{/if}} data-am-ucheck />
@ -291,7 +300,16 @@
{{case checkbox}}
{{if isset($data_list[$i][$form_table['base']['key_field']])}}
<!-- 是否配置指定数据不显示控件 -->
{{if empty($t['not_show_data']) or empty($t['not_show_key']) or !isset($data_list[$i][$t['not_show_key']]) or !in_array($data_list[$i][$t['not_show_key']], $t['not_show_data'])}}
{{if
!isset($t['not_show_data']) or
empty($t['not_show_key']) or
(is_array($t['not_show_data']) and isset($data_list[$i][$t['not_show_key']]) and !in_array($data_list[$i][$t['not_show_key']], $t['not_show_data'])) or
(isset($t['not_show_type']) and isset($data_list[$i][$t['not_show_key']]) and !is_array($t['not_show_data']) and (
($t['not_show_type'] eq 0 and $data_list[$i][$t['not_show_key']] eq $t['not_show_data']) or
($t['not_show_type'] eq 1 and $data_list[$i][$t['not_show_key']] gt $t['not_show_data']) or
($t['not_show_type'] eq 2 and $data_list[$i][$t['not_show_key']] lt $t['not_show_data'])
))
}}
<div class="form-table-operate-checkbox">
<label class="am-checkbox am-secondary am-checkbox-inline">
<input type="checkbox" name="{{$t.view_key}}" value="{{$data_list[$i][$form_table['base']['key_field']]}}" {{if isset($t['is_checked']) and $t['is_checked'] eq 1}}checked{{/if}} data-am-ucheck />

View File

@ -123,15 +123,15 @@
</div>
<div class="am-form-group">
<label>{{$data.common_domain_host.name}}<span class="am-form-group-label-tips">{{$data.common_domain_host.describe}}</span></label>
<input type="text" name="{{$data.common_domain_host.only_tag}}" placeholder="{{$data.common_domain_host.describe}}" data-validation-message="{{$data.common_domain_host.error_tips}}" class="am-radius" {{if !empty($data)}}value="{{$data.common_domain_host.value}}"{{/if}} />
<input type="url" name="{{$data.common_domain_host.only_tag}}" placeholder="{{$data.common_domain_host.describe}}" data-validation-message="{{$data.common_domain_host.error_tips}}" class="am-radius" {{if !empty($data)}}value="{{$data.common_domain_host.value}}"{{/if}} />
</div>
<div class="am-form-group">
<label>{{$data.common_cdn_attachment_host.name}}<span class="am-form-group-label-tips">{{$data.common_cdn_attachment_host.describe}}</span></label>
<input type="text" name="{{$data.common_cdn_attachment_host.only_tag}}" placeholder="{{$data.common_cdn_attachment_host.describe}}" data-validation-message="{{$data.common_cdn_attachment_host.error_tips}}" class="am-radius" {{if !empty($data)}}value="{{$data.common_cdn_attachment_host.value}}"{{/if}} />
<input type="url" name="{{$data.common_cdn_attachment_host.only_tag}}" placeholder="{{$data.common_cdn_attachment_host.describe}}" data-validation-message="{{$data.common_cdn_attachment_host.error_tips}}" class="am-radius" {{if !empty($data)}}value="{{$data.common_cdn_attachment_host.value}}"{{/if}} />
</div>
<div class="am-form-group">
<label>{{$data.common_cdn_public_host.name}}<span class="am-form-group-label-tips">{{$data.common_cdn_public_host.describe}}</span></label>
<input type="text" name="{{$data.common_cdn_public_host.only_tag}}" placeholder="{{$data.common_cdn_public_host.describe}}" data-validation-message="{{$data.common_cdn_public_host.error_tips}}" class="am-radius" {{if !empty($data)}}value="{{$data.common_cdn_public_host.value}}"{{/if}} />
<input type="url" name="{{$data.common_cdn_public_host.only_tag}}" placeholder="{{$data.common_cdn_public_host.describe}}" data-validation-message="{{$data.common_cdn_public_host.error_tips}}" class="am-radius" {{if !empty($data)}}value="{{$data.common_cdn_public_host.value}}"{{/if}} />
</div>
</div>
</div>

View File

@ -279,7 +279,16 @@
{{case radio}}
{{if isset($data_list[$i][$form_table['base']['key_field']])}}
<!-- 是否配置指定数据不显示控件 -->
{{if empty($t['not_show_data']) or empty($t['not_show_key']) or !isset($data_list[$i][$t['not_show_key']]) or !in_array($data_list[$i][$t['not_show_key']], $t['not_show_data'])}}
{{if
!isset($t['not_show_data']) or
empty($t['not_show_key']) or
(is_array($t['not_show_data']) and isset($data_list[$i][$t['not_show_key']]) and !in_array($data_list[$i][$t['not_show_key']], $t['not_show_data'])) or
(isset($t['not_show_type']) and isset($data_list[$i][$t['not_show_key']]) and (
($t['not_show_type'] eq 0 and $data_list[$i][$t['not_show_key']] eq $t['not_show_data']) or
($t['not_show_type'] eq 1 and $data_list[$i][$t['not_show_key']] gt $t['not_show_data']) or
($t['not_show_type'] eq 2 and $data_list[$i][$t['not_show_key']] lt $t['not_show_data'])
))
}}
<div class="form-table-operate-radio">
<label class="am-radio am-secondary am-radio-inline">
<input type="radio" name="{{$t.view_key}}" value="{{$data_list[$i][$form_table['base']['key_field']]}}" {{if isset($t['is_checked']) and $t['is_checked'] eq 1}}checked{{/if}} data-am-ucheck />
@ -291,7 +300,16 @@
{{case checkbox}}
{{if isset($data_list[$i][$form_table['base']['key_field']])}}
<!-- 是否配置指定数据不显示控件 -->
{{if empty($t['not_show_data']) or empty($t['not_show_key']) or !isset($data_list[$i][$t['not_show_key']]) or !in_array($data_list[$i][$t['not_show_key']], $t['not_show_data'])}}
{{if
!isset($t['not_show_data']) or
empty($t['not_show_key']) or
(is_array($t['not_show_data']) and isset($data_list[$i][$t['not_show_key']]) and !in_array($data_list[$i][$t['not_show_key']], $t['not_show_data'])) or
(isset($t['not_show_type']) and isset($data_list[$i][$t['not_show_key']]) and (
($t['not_show_type'] eq 0 and $data_list[$i][$t['not_show_key']] eq $t['not_show_data']) or
($t['not_show_type'] eq 1 and $data_list[$i][$t['not_show_key']] gt $t['not_show_data']) or
($t['not_show_type'] eq 2 and $data_list[$i][$t['not_show_key']] lt $t['not_show_data'])
))
}}
<div class="form-table-operate-checkbox">
<label class="am-checkbox am-secondary am-checkbox-inline">
<input type="checkbox" name="{{$t.view_key}}" value="{{$data_list[$i][$form_table['base']['key_field']]}}" {{if isset($t['is_checked']) and $t['is_checked'] eq 1}}checked{{/if}} data-am-ucheck />

View File

@ -368,10 +368,14 @@ class FormHandleModule
if(in_array($v['view_type'], ['checkbox', 'radio']))
{
// 是否部分不显示控件
// 数据处理成为数组
// 可配置 not_show_type 字段指定类型0 eq 等于、 1 gt 大于、 2 lt 小于)
if(isset($v['not_show_data']) && !is_array($v['not_show_data']))
{
$v['not_show_data'] = explode(',', $v['not_show_data']);
// 存在英文逗号则转数组
if(stripos($v['not_show_data'], ',') !== false)
{
$v['not_show_data'] = explode(',', $v['not_show_data']);
}
}
// 数据 key 字段默认主键 id [base->key_field]
if(!empty($v['not_show_data']) && empty($v['not_show_key']))

View File

@ -721,7 +721,7 @@ class GoodsService
}
if(!empty($v['upd_time']))
{
$v['upd_time'] = date('Y-m-d H:i:s', $v['upd_time']);
$v['upd_time'] = empty($v['upd_time']) ? '' : date('Y-m-d H:i:s', $v['upd_time']);
}
// 是否需要分类名称

View File

@ -30,9 +30,10 @@ function ParametersItemHtmlCreated(type, name, value)
html += '<input type="text" name="parameters_value[]" placeholder="参数值" value="'+(value || '')+'" maxlength="200" data-validation-message="请填写参数值" />';
html += '</td>';
html += '<td class="am-text-middle">';
html += '<span class="am-text-xs cr-blue c-p am-margin-right-sm line-move" data-type="top">上移</span>';
html += '<span class="am-text-xs cr-blue c-p am-margin-right-sm line-move" data-type="bottom">下移</span>';
html += '<span class="am-text-xs cr-red c-p line-remove">移除</span></td>';
html += '<a href="javascript:;" class="am-text-xs am-text-secondary am-margin-right-sm line-move" data-type="top">上移</a> ';
html += '<a href="javascript:;" class="am-text-xs am-text-secondary am-margin-right-sm line-move" data-type="bottom">下移</a> ';
html += '<a href="javascript:;" class="am-text-xs am-text-danger line-remove">移除</a>';
html += '</td>';
html += '</tr>';
// 数据添加