动态表格支持Ym年月选择条件
parent
fdd4893f64
commit
95de4c2263
|
|
@ -110,6 +110,9 @@
|
||||||
<input type="text" autocomplete="off" class="am-form-field am-input-sm am-radius am-inline-block Wdate" id="form-table-search-time-end-{{$t.form_key}}" name="{{$t.form_key}}_end" value="{{if !empty($form_params) and isset($form_params[$t['form_key'].'_end'])}}{{$form_params[$t['form_key'].'_end']}}{{/if}}" placeholder="{{if isset($t['search_config']['placeholder_end'])}}{{$t.search_config.placeholder_end}}{{/if}}" value="" onclick="WdatePicker({firstDayOfWeek:1,dateFmt:'yyyy-MM-dd',minDate:'#F{$dp.$D(\'form-table-search-time-start-{{$t.form_key}}\',{d:+1});}'})" autocomplete="off" {{if !empty($form_params) and isset($form_params[$t['form_key'].'_end'])}}data-am-popover="{theme: 'sm', content: '{{$form_params[$t['form_key'].'_end']}}', trigger: 'hover focus'}"{{/if}} />
|
<input type="text" autocomplete="off" class="am-form-field am-input-sm am-radius am-inline-block Wdate" id="form-table-search-time-end-{{$t.form_key}}" name="{{$t.form_key}}_end" value="{{if !empty($form_params) and isset($form_params[$t['form_key'].'_end'])}}{{$form_params[$t['form_key'].'_end']}}{{/if}}" placeholder="{{if isset($t['search_config']['placeholder_end'])}}{{$t.search_config.placeholder_end}}{{/if}}" value="" onclick="WdatePicker({firstDayOfWeek:1,dateFmt:'yyyy-MM-dd',minDate:'#F{$dp.$D(\'form-table-search-time-start-{{$t.form_key}}\',{d:+1});}'})" autocomplete="off" {{if !empty($form_params) and isset($form_params[$t['form_key'].'_end'])}}data-am-popover="{theme: 'sm', content: '{{$form_params[$t['form_key'].'_end']}}', trigger: 'hover focus'}"{{/if}} />
|
||||||
</div>
|
</div>
|
||||||
{{/case}}
|
{{/case}}
|
||||||
|
{{case ym}}
|
||||||
|
<input type="text" autocomplete="off" class="am-form-field am-input-sm am-radius Wdate" name="{{$t.form_key}}" value="{{if !empty($form_params) and isset($form_params[$t['form_key']])}}{{$form_params[$t['form_key']]}}{{/if}}" placeholder="{{if isset($t['search_config']['placeholder'])}}{{$t.search_config.placeholder}}{{/if}}" value="" onclick="WdatePicker({firstDayOfWeek:1,dateFmt:'yyyy-MM'})" autocomplete="off" {{if !empty($form_params) and isset($form_params[$t['form_key']])}}data-am-popover="{theme: 'sm', content: '{{$form_params[$t['form_key']]}}', trigger: 'hover focus'}"{{/if}} />
|
||||||
|
{{/case}}
|
||||||
{{case module}}
|
{{case module}}
|
||||||
<!-- 从模块加载自定义模块数据 -->
|
<!-- 从模块加载自定义模块数据 -->
|
||||||
{{if !empty($t['search_config']['template'])}}
|
{{if !empty($t['search_config']['template'])}}
|
||||||
|
|
|
||||||
|
|
@ -110,6 +110,9 @@
|
||||||
<input type="text" autocomplete="off" class="am-form-field am-input-sm am-radius am-inline-block Wdate" id="form-table-search-time-end-{{$t.form_key}}" name="{{$t.form_key}}_end" value="{{if !empty($form_params) and isset($form_params[$t['form_key'].'_end'])}}{{$form_params[$t['form_key'].'_end']}}{{/if}}" placeholder="{{if isset($t['search_config']['placeholder_end'])}}{{$t.search_config.placeholder_end}}{{/if}}" value="" onclick="WdatePicker({firstDayOfWeek:1,dateFmt:'yyyy-MM-dd',minDate:'#F{$dp.$D(\'form-table-search-time-start-{{$t.form_key}}\',{d:+1});}'})" autocomplete="off" {{if !empty($form_params) and isset($form_params[$t['form_key'].'_end'])}}data-am-popover="{theme: 'sm', content: '{{$form_params[$t['form_key'].'_end']}}', trigger: 'hover focus'}"{{/if}} />
|
<input type="text" autocomplete="off" class="am-form-field am-input-sm am-radius am-inline-block Wdate" id="form-table-search-time-end-{{$t.form_key}}" name="{{$t.form_key}}_end" value="{{if !empty($form_params) and isset($form_params[$t['form_key'].'_end'])}}{{$form_params[$t['form_key'].'_end']}}{{/if}}" placeholder="{{if isset($t['search_config']['placeholder_end'])}}{{$t.search_config.placeholder_end}}{{/if}}" value="" onclick="WdatePicker({firstDayOfWeek:1,dateFmt:'yyyy-MM-dd',minDate:'#F{$dp.$D(\'form-table-search-time-start-{{$t.form_key}}\',{d:+1});}'})" autocomplete="off" {{if !empty($form_params) and isset($form_params[$t['form_key'].'_end'])}}data-am-popover="{theme: 'sm', content: '{{$form_params[$t['form_key'].'_end']}}', trigger: 'hover focus'}"{{/if}} />
|
||||||
</div>
|
</div>
|
||||||
{{/case}}
|
{{/case}}
|
||||||
|
{{case ym}}
|
||||||
|
<input type="text" autocomplete="off" class="am-form-field am-input-sm am-radius Wdate" name="{{$t.form_key}}" value="{{if !empty($form_params) and isset($form_params[$t['form_key']])}}{{$form_params[$t['form_key']]}}{{/if}}" placeholder="{{if isset($t['search_config']['placeholder'])}}{{$t.search_config.placeholder}}{{/if}}" value="" onclick="WdatePicker({firstDayOfWeek:1,dateFmt:'yyyy-MM'})" autocomplete="off" {{if !empty($form_params) and isset($form_params[$t['form_key']])}}data-am-popover="{theme: 'sm', content: '{{$form_params[$t['form_key']]}}', trigger: 'hover focus'}"{{/if}} />
|
||||||
|
{{/case}}
|
||||||
{{case module}}
|
{{case module}}
|
||||||
<!-- 从模块加载自定义模块数据 -->
|
<!-- 从模块加载自定义模块数据 -->
|
||||||
{{if !empty($t['search_config']['template'])}}
|
{{if !empty($t['search_config']['template'])}}
|
||||||
|
|
|
||||||
|
|
@ -458,6 +458,15 @@ class FormHandleModule
|
||||||
$v['search_config']['placeholder_end'] = '结束';
|
$v['search_config']['placeholder_end'] = '结束';
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
// 年月Ym
|
||||||
|
case 'ym' :
|
||||||
|
// 提示信息处理
|
||||||
|
if(empty($v['search_config']['placeholder']))
|
||||||
|
{
|
||||||
|
$v['search_config']['placeholder'] = '请选择年月';
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 搜索条件数据处理
|
// 搜索条件数据处理
|
||||||
|
|
@ -469,6 +478,7 @@ class FormHandleModule
|
||||||
$where_type_default_arr = [
|
$where_type_default_arr = [
|
||||||
'input' => '=',
|
'input' => '=',
|
||||||
'select' => 'in',
|
'select' => 'in',
|
||||||
|
'ym' => '=',
|
||||||
];
|
];
|
||||||
if(array_key_exists($where_type, $where_type_default_arr))
|
if(array_key_exists($where_type, $where_type_default_arr))
|
||||||
{
|
{
|
||||||
|
|
@ -510,6 +520,12 @@ class FormHandleModule
|
||||||
$value = '%'.$value.'%';
|
$value = '%'.$value.'%';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 年月Ym、去掉横岗
|
||||||
|
if($v['search_config']['form_type'] == 'ym')
|
||||||
|
{
|
||||||
|
$value = str_replace(['-', '/', '|'], '', $value);
|
||||||
|
}
|
||||||
|
|
||||||
// 条件
|
// 条件
|
||||||
$this->where[] = [$where_name, $where_symbol, $value];
|
$this->where[] = [$where_name, $where_symbol, $value];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue