diff --git a/application/admin/controller/Myinc.php b/application/admin/controller/Myinc.php deleted file mode 100644 index d8144b9a8..000000000 --- a/application/admin/controller/Myinc.php +++ /dev/null @@ -1,50 +0,0 @@ -IsLogin(); - - // 权限校验 - $this->IsPower(); - } - - public function view($template) - { - //return $template; - return $this->fetch($template); - } - -} \ No newline at end of file diff --git a/application/admin/view/default/lib/module/goods_category.html b/application/admin/view/default/lib/module/goods_category.html new file mode 100644 index 000000000..3356009bb --- /dev/null +++ b/application/admin/view/default/lib/module/goods_category.html @@ -0,0 +1,18 @@ + +{{if !empty($module_data)}} + +{{/if}} \ No newline at end of file diff --git a/application/admin/view/default/public/form.html b/application/admin/view/default/public/form.html index 54f4e8938..1be1f09b9 100644 --- a/application/admin/view/default/public/form.html +++ b/application/admin/view/default/public/form.html @@ -22,7 +22,7 @@
-
+
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}}
@@ -48,8 +48,13 @@ -
+
{{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)}}
plugins_view_admin_goods_top_operate @@ -89,10 +94,91 @@ {{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($t['label'])}}{{$t.label}}{{/if}} {{/foreach}} {{/if}} + {{if isset($form_table['base']) and isset($form_table['base']['is_search']) and $form_table['base']['is_search'] eq 1}} + + {{foreach $form_table['form'] as $t}} + + {{if !empty($t['search_config']) and !empty($t['search_config']['form_type']) and !empty($t['search_config']['form_name'])}} + {{switch $t.search_config.form_type}} + {{case input}} + + + {{/case}} + {{case select}} + + + {{/case}} + {{case section}} + +
+ + - + +
+ {{/case}} + {{case datetime}} +
+ + - + +
+ {{/case}} + {{case date}} +
+ + - + +
+ {{/case}} + {{case time}} +
+ + - + +
+ {{/case}} + {{case module}} + + {{:ModuleInclude($t['search_config']['form_name'], isset($t['search_config']['data']) ? $t['search_config']['data'] : [], isset($params) ? $params : [])}} + {{/case}} + {{/switch}} + {{/if}} + + {{/foreach}} + + {{/if}} {{if !empty($data_list) and !empty($form_table['form']) and !empty($form_table['base']) and !empty($form_table['base']['key_field'])}} @@ -141,7 +227,7 @@ {{/case}} {{case module}} - {{:ModuleInclude($t['view_key'], $data_list[$i])}} + {{:ModuleInclude($t['view_key'], $data_list[$i], isset($params) ? $params : [])}} {{/case}} {{case status}} diff --git a/application/form/GoodsForm.php b/application/form/GoodsForm.php index 409bd2cde..aee1e91f8 100644 --- a/application/form/GoodsForm.php +++ b/application/form/GoodsForm.php @@ -11,6 +11,9 @@ namespace app\form; use think\Db; +use app\service\GoodsService; +use app\service\RegionService; +use app\service\BrandService; /** * 商品表单 @@ -38,6 +41,7 @@ class GoodsForm 'base' => [ 'key_field' => 'id', 'status_field' => 'is_shelves', + 'is_search' => 1, ], // 表单配置 'form' => [ @@ -51,22 +55,63 @@ class GoodsForm 'view_type' => 'module', 'view_key' => 'goods/module/info', 'grid_size' => 'lg', + 'search_config' => [ + 'form_type' => 'input', + 'form_name' => 'title|simple_desc|seo_title|seo_keywords|seo_keywords', + 'placeholder' => '请输入名称/简述/SEO信息' + ], + + // 'search_config' => [ + // // input, select, datetime, date, time, section + // 'form_type' => 'select', + // // 表单字段名称 + // 'form_name' => 'category_id', + // // 提示信息 + // 'placeholder' => '商品分类...', + // // 是否开启占位选择框 + // 'is_seat_select' => 1, + // // 选择占位值(默认空) + // 'seat_select_value' => '', + // // 选择占位文本(默认 placeholder 值) + // 'seat_select_text' => '商品分类...', + // // 条件数据 + // 'data' => [], + // // 数据 key 字段名称(默认取 id) + // 'data_key' => 'id', + // // 数据 name 字段名称(默认取 name) + // 'data_name' => 'name', + // // 数据默认选中值 + // 'default' => '', + // ], ], [ 'label' => '销售价格(元)', 'view_type' => 'field', 'view_key' => 'price', + 'search_config' => [ + 'form_type' => 'section', + 'form_name' => 'min_price', + ], ], [ 'label' => '原价(元)', 'view_type' => 'field', 'view_key' => 'original_price', + 'search_config' => [ + // 表单字段名称 + 'form_name' => 'min_original_price', + 'form_type' => 'section', + ], ], [ 'label' => '库存数量', 'view_type' => 'field', 'view_key' => ['inventory', 'inventory_unit'], 'view_key_join' => ' ', + 'search_config' => [ + 'form_type' => 'section', + 'form_name' => 'inventory', + ], ], [ 'label' => '上下架', @@ -76,6 +121,14 @@ class GoodsForm 'post_url' => MyUrl('admin/goods/statusshelves'), 'is_form_su' => 1, 'align' => 'center', + 'search_config' => [ + 'form_type' => 'select', + 'form_name' => 'is_shelves', + 'data' => lang('common_is_shelves_list'), + 'data_key' => 'id', + 'data_name' => 'name', + 'is_multiple' => 1, + ], ], [ 'label' => '首页推荐', @@ -84,16 +137,55 @@ class GoodsForm 'key_field' => 'id', 'post_url' => MyUrl('admin/goods/statushomerecommended'), 'align' => 'center', + 'search_config' => [ + 'form_type' => 'select', + 'form_name' => 'is_home_recommended', + 'data' => lang('common_is_text_list'), + 'data_key' => 'id', + 'data_name' => 'name', + 'is_multiple' => 1, + ], ], [ 'label' => '商品型号', 'view_type' => 'field', 'view_key' => 'model', + 'search_config' => [ + 'form_type' => 'input', + 'form_name' => 'model', + ], + ], + [ + 'label' => '商品分类', + 'view_type' => 'field', + 'view_key' => 'category_text', + 'search_config' => [ + 'form_type' => 'module', + 'form_name' => 'lib/module/goods_category', + 'data' => GoodsService::GoodsCategoryAll(), + ], ], [ 'label' => '品牌', 'view_type' => 'field', 'view_key' => 'brand_name', + 'search_config' => [ + 'form_type' => 'select', + 'form_name' => 'brand_id', + 'data' => BrandService::CategoryBrand(), + 'data_key' => 'id', + 'data_name' => 'name', + 'is_seat_select' => 1, + ], + ], + [ + 'label' => '创建时间', + 'view_type' => 'field', + 'view_key' => 'add_time', + 'search_config' => [ + 'form_type' => 'datetime', + 'form_name' => 'add_time', + ], ], [ 'label' => '操作', @@ -117,6 +209,49 @@ class GoodsForm */ public function Search($params = []) { + return [ + // 基础配置 + 'base' => [ + 'url' => MyUrl('admin/goods/index'), + 'method' => 'POST', + 'is_more' => 1, + ], + // 大搜索框 + 'search' => [ + 'placeholder' => '标题/型号', + 'submit_text' => '搜索一下', + 'loading_text' => '搜索中哦...', + 'form_name' => 'keywords', + + + ], + + // 更多条件 + 'more' => [ + [ + // 标题名称 + 'label' => '分类', + // 表单字段名称 + 'form_name' => 'category_id', + // select, input + 'form_type' => 'select', + // 提示信息 + 'placeholder' => '商品分类...', + // 是否开启占位选择框 + 'is_seat_select' => 1, + // 选择占位值 + 'seat_select_value' => '', + // 数据 + 'data' => [], + // 数据 key 字段名称 + 'data_key' => 'id', + // 数据 name 字段名称 + 'data_name' => 'name', + // 数据默认选中值 + 'default' => '', + ], + ], + ]; } } \ No newline at end of file diff --git a/application/lang/zh-cn.php b/application/lang/zh-cn.php index a3db85568..4a0909393 100755 --- a/application/lang/zh-cn.php +++ b/application/lang/zh-cn.php @@ -189,8 +189,8 @@ return array( // 是否上架/下架 'common_is_shelves_list' => array( - 0 => array('id' => 0, 'name' => '已下架'), - 1 => array('id' => 1, 'name' => '已上架', 'checked' => true), + 0 => array('id' => 0, 'name' => '下架'), + 1 => array('id' => 1, 'name' => '上架', 'checked' => true), ), // 是否 diff --git a/application/module/ViewInclude.php b/application/module/ViewInclude.php index edd8b4792..8760a441a 100644 --- a/application/module/ViewInclude.php +++ b/application/module/ViewInclude.php @@ -44,12 +44,14 @@ class ViewInclude extends Controller * @date 2020-05-25 * @desc description * @param [string] $template [模板地址] - * @param [mixed] $params [参数数据] + * @param [mixed] $data [请求数据] + * @param [mixed] $params [请求参数] * @return [string] [模板内容] */ - public function Run($template, $params = []) + public function Run($template, $data = [], $params = []) { - $this->assign('module_data', $params); + $this->assign('module_data', $data); + $this->assign('module_params', $params); return $this->fetch($template); } } diff --git a/public/static/common/css/common.css b/public/static/common/css/common.css index b834436a0..f0ec8d05a 100755 --- a/public/static/common/css/common.css +++ b/public/static/common/css/common.css @@ -426,7 +426,7 @@ button.colorpicker-submit img { } /** - * 表格样式 + * 表格-基础样式 */ .am-table-scrollable-horizontal { border: 1px solid #ddd; @@ -445,6 +445,8 @@ button.colorpicker-submit img { .am-table-scrollable-horizontal .am-table > tfoot > tr > td { padding: 12px; line-height: 20px; + min-width: 150px; + max-width: 150px; } .am-table-scrollable-horizontal .am-table .am-nowrap-initial { white-space: initial; @@ -461,13 +463,13 @@ button.colorpicker-submit img { min-width: 350px; } .am-table-scrollable-horizontal .am-table tr .am-grid-sm { - min-width: 200px; + min-width: 250px; } .am-table-scrollable-horizontal .am-table tr .am-grid-xs { - min-width: 150px; + min-width: 200px; } .am-table-scrollable-horizontal .am-table tr .am-operate-grid { - width: 100px; + min-width: 120px; } .am-table-scrollable-horizontal .am-table tr .am-grid-fixed-left, .am-table-scrollable-horizontal .am-table tr .am-grid-fixed-right { @@ -478,7 +480,7 @@ button.colorpicker-submit img { .am-table-scrollable-horizontal .am-table tr td.am-grid-fixed-left, .am-table-scrollable-horizontal .am-table tr td.am-grid-fixed-right { height: auto; - z-index: 2; + z-index: 1011; position: sticky; background: #fff; } @@ -501,4 +503,44 @@ button.colorpicker-submit img { -webkit-box-shadow: -5px 0px 10px rgba(136, 136, 136, 0.3); -moz-box-shadow: -5px 0px 10px rgba(136, 136, 136, 0.3); box-shadow: -5px 0px 10px rgba(136, 136, 136, 0.3); +} + +/** + * 表格-相关样式 + */ +.form-table-operate-top > .am-btn:not(:last-child) { + margin-right: 10px; +} + +/** + * 表格-搜索条件 + */ +.form-table-search { + background: #eee; +} +.form-table-search td { + padding: 8px !important; +} +.form-table-search-section input { + width: calc(50% - 8px); +} +.form-table-search-time > i { + position: absolute; + margin: 4px 0px 0px -15px; +} + + +/** + * 下拉选择器 + */ +.chosen-container-multi .chosen-choices li.search-choice { + margin: 3px 3px 3px 0; + padding: 2px 13px 1px 2px; +} +.chosen-container-multi .chosen-choices li.search-field input[type="text"] { + margin: 0; +} +.chosen-container-multi .chosen-choices li.search-choice .search-choice-close { + top: 2px; + right: 0px; } \ No newline at end of file diff --git a/public/static/common/lib/My97DatePicker/skin/WdatePicker.css b/public/static/common/lib/My97DatePicker/skin/WdatePicker.css index 9a1e944e7..585233d23 100755 --- a/public/static/common/lib/My97DatePicker/skin/WdatePicker.css +++ b/public/static/common/lib/My97DatePicker/skin/WdatePicker.css @@ -1,9 +1,10 @@ .Wdate{ - background:#fff url(datePicker.gif) no-repeat right !important; + background:#fff url(datePicker.gif) no-repeat right 5px center !important; + padding-right: 25px; } .Wdate::-ms-clear{display:none;} .WdateFmtErr{ - font-weight:bold; - color:red; + font-weight: bold; + color: red; } \ No newline at end of file