diff --git a/module/product/ui/all.html.php b/module/product/ui/all.html.php index bdfdd717fc..62db33bef2 100644 --- a/module/product/ui/all.html.php +++ b/module/product/ui/all.html.php @@ -216,6 +216,7 @@ if (\common::hasPriv('product', 'batchEdit')) ); } $others[] = array( + 'id' => 'searchBtn', 'type' => 'button', 'icon' => 'search', 'text' => $lang->product->searchStory, @@ -245,6 +246,102 @@ $btnGroup[] = array( 'url' => createLink('product', 'create') ); +/* Search Form options. */ +$searchOptions = <<", "title": ">" }, + { "value": ">=", "title": ">=" }, + { "value": "<", "title": "<" }, + { "value": "<=", "title": "<=" }, + { "value": "include", "title": "包含" }, + { "value": "between", "title": "介于" }, + { "value": "notinclude", "title": "不包含" }, + { "value": "belong", "title": "从属于" } + ], + "savedQuery": [ + { "id": "1", "title": "条件11", "account": "11", + "content": [ + { "fields": "status", "control": "select", "condition": "=", "value": "doing" }, + { "fields": "openedDate", "control": "date", "condition": "=", "value": "2022-11-15" }, + { "fields": "openedBy", "control": "input", "condition": "=", "value": "" }, + { "fields": "PM", "control": "select", "condition": "!=", "value": "" }, + { "fields": "openedDate", "control": "date", "condition": "include", "value": "" }, + { "fields": "begin", "control": "date", "condition": "=", "value": "" } + ] + } + ], + "andOr": [ + { "value": "and", "title": "并且" }, + { "value": "or", "title": "或者" } + ], + "groupName": [ + "第一组", + "第二组" + ], + "savedQueryTitle": "已保存的查询条件", + "saveSearch": { + "text": "保存搜索条件", + "config": { + "data-toggle": "modal", + "href": "#saveModal", + "data-url": "/index.php?m=search&f=saveQuery&module=task&onMenuBar=yes" + } + } +} +OPTIONS; +$options = json_decode($searchOptions); + +$jsSearch = << array(array('size' => 'sm', 'text' => '编辑', 'btnType' => 'primary')))) ) - ) + ), + modal + ( + setId('saveModal'), + form + ( + setId('saveForm'), + div + ( + setClass('flex flex-row justify-between'), + input + ( + setId('title'), + set('name', 'title'), + setClass('form-control w-5/12'), + set('type', 'text'), + set('placeholder', '请输入保存条件名称') + ), + checkbox + ( + setId('common'), + set('name', 'common'), + setClass('w-3/12'), + '设为公共查询条件' + ), + checkbox + ( + setId('onMenuBar'), + set('name', 'onMenuBar'), + setClass('w-3/12'), + '显示在菜单栏' + ), + btn( + setClass('w-1/12 primary'), + set('data-type', 'submit'), + '保存' + ) + ) + ) + ), + h::js($jsSearch) ); diff --git a/zin/func.php b/zin/func.php index 95ee1aadc6..8baf00f150 100644 --- a/zin/func.php +++ b/zin/func.php @@ -54,3 +54,4 @@ function inputaddon() {return createWg('inputaddon', func_get_args());} function inputgroup() {return createWg('inputgroup', func_get_args());} function inputbtn() {return createWg('inputbtn', func_get_args());} function toolbar() {return createWg('toolbar', func_get_args());} +function searchform() {return createWg('searchform', func_get_args());} diff --git a/zin/wg/btn/v1.php b/zin/wg/btn/v1.php index 13b2137fdb..b109951914 100755 --- a/zin/wg/btn/v1.php +++ b/zin/wg/btn/v1.php @@ -61,8 +61,8 @@ class btn extends wg if(!empty($size)) $classList[] = "size-$size"; $children = array(); - if(!empty($icon)) $children[] = new icon($icon); - if(!empty($text)) $children[] = h::span($text, setClass('text')); + if(!empty($icon)) $children[] = new icon($icon); + if(!empty($text)) $children[] = h::span($text, setClass('text')); $children[] = parent::build(); diff --git a/zin/wg/checkbox/v1.php b/zin/wg/checkbox/v1.php index d0a650ebce..936617b65c 100644 --- a/zin/wg/checkbox/v1.php +++ b/zin/wg/checkbox/v1.php @@ -18,8 +18,13 @@ class checkbox extends wg { return h::label ( + setClass('pl-2'), + set($this->props->skip(array_keys(static::getDefinedProps(), true))), setClass('checkbox'), - h::checkbox(set($this->props->skip(array_keys(static::getDefinedProps()), true))), + h::checkbox + ( + setId($this->prop('id')) + ), $this->prop('text') ); } diff --git a/zin/wg/modal/v1.php b/zin/wg/modal/v1.php index 68c6ee3007..74894a3f3f 100644 --- a/zin/wg/modal/v1.php +++ b/zin/wg/modal/v1.php @@ -84,7 +84,8 @@ class modal extends wg h::div ( setClass('modal-body'), - !isset($this->blocks['body']) ? null : $this->blocks['body'] + !isset($this->blocks['body']) ? null : $this->blocks['body'], + $this->children() ), /* Footer. */ h::div diff --git a/zin/wg/searchform/v1.php b/zin/wg/searchform/v1.php new file mode 100644 index 0000000000..d985ed4276 --- /dev/null +++ b/zin/wg/searchform/v1.php @@ -0,0 +1,15 @@ +