diff --git a/README.md b/README.md index 05f3af5..c190517 100755 --- a/README.md +++ b/README.md @@ -2,6 +2,11 @@ Fork From [jqhph/dcat-admin](https://github.com/jqhph/dcat-admin) +## 安装 + +- `composer config repositories.peidikeji/dcat-admin git git@gitee.com:paddy_technology/dcat-admin.git` +- `composer require peidikeji/dcat-admin` + ## 改动 - 文件: `dcat-admin/src/Form/Footer.php`, 将 `reset` 按钮默认设置为 `false` diff --git a/packages/goods/goods-attr.json b/packages/goods/goods-attr.json new file mode 100644 index 0000000..076531b --- /dev/null +++ b/packages/goods/goods-attr.json @@ -0,0 +1,74 @@ +[ + { + "table": "goods-type.spec", + "name": "颜色", + "values": [ + "白色", + "红色", + "蓝色" + ] + }, + { + "table": "goods-type.attr", + "name": "主体", + "values": [ + "入网型号", + "上市年份" + ] + }, + { + "table": "goods-type.part", + "name": "套餐", + "values": [ + "套餐1", + "套餐2" + ] + }, + { + "table": "goods.attr", + "name": "主体", + "values": [ + { "name": "入网型号", "value": "5G" }, + { "name": "上市年份", "value": "2020" } + ] + }, + { + "table": "goods.spec", + "name": "颜色", + "values": [ + { "name": "白色", "value": 0 }, + { "name": "红色", "value": 0 }, + { "name": "蓝色", "value": 1 } + ] + }, + { + "table": "goods.part", + "name": "套餐", + "values": [ + { "name": "套餐1", "value": 150 }, + { "name": "套餐2", "value": 100 } + ] + }, + { + "table": "goods-sku.attr", + "name": "主体", + "values": [ + { "name": "入网型号", "value": "5G" }, + { "name": "上市年份", "value": "2020" } + ] + }, + { + "table": "goods-sku.spec", + "name": "颜色", + "value": "白色", + "price": 0 + }, + { + "table": "goods-sku.part", + "name": "颜色", + "values": [ + { "name": "套餐1", "price": 150 }, + { "name": "套餐2", "price": 100 } + ] + } +] diff --git a/packages/goods/resources/assets/goods.css b/packages/goods/resources/assets/goods.css new file mode 100644 index 0000000..95218e7 --- /dev/null +++ b/packages/goods/resources/assets/goods.css @@ -0,0 +1,12 @@ +.grid-attr .group:not(:first-child) { + margin-top: 10px; +} +.grid-attr .group-item { + display: inline-block;vertical-align: top; +} +.grid-attr .group-title { + min-width: 80px +} +.grid-attr .group-value:not(:first-child) { + margin-top: 10px; +} diff --git a/packages/goods/resources/lang/zh_CN/goods.php b/packages/goods/resources/lang/zh_CN/goods.php index e3a3a27..47a8f70 100644 --- a/packages/goods/resources/lang/zh_CN/goods.php +++ b/packages/goods/resources/lang/zh_CN/goods.php @@ -8,6 +8,7 @@ return [ 'edit' => '修改', 'attr' => '属性', 'spec' => '规格', + 'part' => '配件', ], 'fields' => [ 'category_id' => '分类', diff --git a/packages/goods/resources/views/form/attr-horizontal.blade.php b/packages/goods/resources/views/form/attr-horizontal.blade.php deleted file mode 100644 index 8142809..0000000 --- a/packages/goods/resources/views/form/attr-horizontal.blade.php +++ /dev/null @@ -1,86 +0,0 @@ - -
-

{!! $label !!}

-
-
- -
- -
- -
- - @foreach($forms as $pk => $form) - -
- - {!! $form->render() !!} - - @if($options['allowDelete']) -
- -
-
 {{ trans('admin.remove') }}
-
-
- @endif -
-
- - @endforeach -
- - - - - @if($options['allowCreate']) -
- -
-
 {{ trans('admin.new') }}
-
-
- @endif - -
- - diff --git a/packages/goods/resources/views/form/attr.blade.php b/packages/goods/resources/views/form/attr.blade.php new file mode 100644 index 0000000..b2f3482 --- /dev/null +++ b/packages/goods/resources/views/form/attr.blade.php @@ -0,0 +1,227 @@ +
+ + + + + @foreach($headers as $item) + + @endforeach + + + + + @foreach($value as $index => $item) + + + + @foreach($item['values'] as $subItem) + + + + + @endforeach + + + + + @endforeach + + + + + +
{{ $item }}
{{ $item['name'] }}
{{ $subItem }} + +
+ + + +
+ + + +
+
+ + diff --git a/packages/goods/resources/views/form/spec.blade.php b/packages/goods/resources/views/form/spec.blade.php index 94990cf..51e8c5d 100644 --- a/packages/goods/resources/views/form/spec.blade.php +++ b/packages/goods/resources/views/form/spec.blade.php @@ -22,9 +22,8 @@ @foreach($item['values'] as $subItem) - @foreach($keys as $key) - {{ data_get($subItem, $key) }} - @endforeach + {{ $subItem['name'] }} + {{ $subItem['value'] }}