优化表单控件
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<select class="form-control" name="{$name}" id="{$name}" style="width:auto;" {if isset($is_must) && $is_must}data-rule="required"{/if}>
|
||||
<select class="form-control selectpicker" name="{$name}" id="{$name}" style="width:auto; min-width: 150px;" {if isset($is_must) && $is_must}data-rule="required"{/if}>
|
||||
{volist name="option" id="item"}
|
||||
<option value="{$item['key']}" {if $item['key'] == $value}selected{/if}>{$item['label']|raw}</option>
|
||||
{/volist}
|
||||
|
||||
1
app/http/form/template/date.html
Normal file
1
app/http/form/template/date.html
Normal file
@@ -0,0 +1 @@
|
||||
<input type="text" name="{$name}" value="{$value|default=date('Y-m-d')}" data-date-format="YYYY-MM-DD" class="form-control datetimepicker" style="width: 150px;">
|
||||
@@ -1,4 +1,4 @@
|
||||
<select class="form-control" name="{$name}" id="{$name}" style="width:auto;" {if isset($is_must) && $is_must}data-rule="required"{/if}>
|
||||
<select class="form-control selectpicker" name="{$name}" id="{$name}" style="width:auto; min-width: 150px;" {if isset($is_must) && $is_must}data-rule="required"{/if}>
|
||||
{volist name="option" id="item"}
|
||||
<option value="{$item['key']}" {if $item['key'] == $value}selected{/if}>{$item['label']}</option>
|
||||
{/volist}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
<input type="text" class="form-control tagsinput" name="{$name}" id="{$name}" autocomplete="false" value="{$value}" {if isset($is_must) && $is_must}data-rule="required"{/if}>
|
||||
@@ -165,13 +165,14 @@ class Attribute extends \think\Model {
|
||||
}
|
||||
|
||||
public static function getfieldList(){
|
||||
$config = \think\facade\Cache::get('system_config_data');
|
||||
return [
|
||||
'基础' => [
|
||||
['name' => 'id', 'title' => 'id', 'help' => '', 'type' => 'hidden'],
|
||||
['name' => 'model_id', 'title' => 'model_id', 'help' => '', 'type' => 'hidden'],
|
||||
['name' => 'name', 'title' => '字段名', 'help' => '英文字母开头,长度不超过30', 'type' => 'text'],
|
||||
['name' => 'title', 'title' => '字段标题', 'help' => '请输入字段标题,用于表单显示', 'type' => 'text'],
|
||||
['name' => 'type', 'title' => '字段类型', 'help' => '用于表单中的展示方式', 'type' => 'select', 'option' => Config::get('config.config_type_list'), 'help' => ''],
|
||||
['name' => 'type', 'title' => '字段类型', 'help' => '用于表单中的展示方式', 'type' => 'select', 'option' => $config['config_type_list'], 'help' => ''],
|
||||
['name' => 'length', 'title' => '字段长度', 'help' => '字段的长度值', 'type' => 'text'],
|
||||
['name' => 'extra', 'title' => '参数', 'help' => '布尔、枚举、多选字段类型的定义数据', 'type' => 'textarea'],
|
||||
['name' => 'value', 'title' => '默认值', 'help' => '字段的默认值', 'type' => 'text'],
|
||||
|
||||
Reference in New Issue
Block a user