diff --git a/beike/Admin/View/Components/Form/Select.php b/beike/Admin/View/Components/Form/Select.php index 3984247c..d596a1dc 100644 --- a/beike/Admin/View/Components/Form/Select.php +++ b/beike/Admin/View/Components/Form/Select.php @@ -14,16 +14,19 @@ class Select extends Component public array $options; + public string $width; + public string $key; public string $label; - public function __construct(string $name, string $value, string $title, array $options, ?string $key = 'value', ?string $label = 'label') + public function __construct(string $name, string $value, string $title, array $options, string $width = '400', ?string $key = 'value', ?string $label = 'label') { $this->name = $name; $this->title = $title; $this->value = $value; $this->options = $options; + $this->width = $width; $this->key = $key; $this->label = $label; } diff --git a/resources/beike/admin/css/_global.scss b/resources/beike/admin/css/_global.scss index 6ed7b4af..532df25d 100644 --- a/resources/beike/admin/css/_global.scss +++ b/resources/beike/admin/css/_global.scss @@ -462,4 +462,66 @@ table.table thead th, .fw-bold, h1,h2,h3, h4, h5, h6, b, strong, .card .card-hea } } } +} + +.autocomplete-group-wrapper { + .inline-input { + width: 100%; + } + + .item-group-wrapper { + padding: 10px; + min-height: 280px; + overflow: auto; + background-color: #f5f5f5; + // border: 1px solid #e3e3e3; + + .item { + overflow: hidden; + position: relative; + padding: 5px 8px; + margin-bottom: 4px; + background: #fff; + border: 1px solid #eee; + cursor: move; + display: flex; + align-items: center; // flex-start | center + justify-content: space-between; // flex-end | center | space-between + &:hover { + border-color: #aaa; + } + + div { + display: flex; + line-height: 1; + width: calc(100% - 16px); + align-items: center; // flex-start | center + + i { + margin-right: 4px; + } + } + + span { + font-size: 12px; + overflow: hidden; + padding: 2px 0; + text-overflow:ellipsis; + white-space: nowrap; + } + + i { + // position: absolute; + color: #999; + font-weight: 400; + &.right { + cursor: pointer; + + &:hover { + color: #222; + } + } + } + } + } } \ No newline at end of file diff --git a/resources/beike/admin/css/_page-pages.scss b/resources/beike/admin/css/_page-pages.scss deleted file mode 100644 index a72977d0..00000000 --- a/resources/beike/admin/css/_page-pages.scss +++ /dev/null @@ -1,73 +0,0 @@ -@charset "UTF-8"; - -/** - * @copyright 2022 beikeshop.com - All Rights Reserved. - * @link https://beikeshop.com - * @Author pu shuo - * @Date 2022-08-09 14:12:25 - * @LastEditTime 2022-09-16 19:05:44 - */ - -body.page-pages-form { - .autocomplete-group-wrapper { - .inline-input { - width: 100%; - } - - .item-group-wrapper { - padding: 10px; - min-height: 280px; - overflow: auto; - background-color: #f5f5f5; - // border: 1px solid #e3e3e3; - - .item { - overflow: hidden; - position: relative; - padding: 5px 8px; - margin-bottom: 4px; - background: #fff; - border: 1px solid #eee; - cursor: move; - display: flex; - align-items: center; // flex-start | center - justify-content: space-between; // flex-end | center | space-between - &:hover { - border-color: #aaa; - } - - div { - display: flex; - line-height: 1; - width: calc(100% - 16px); - align-items: center; // flex-start | center - - i { - margin-right: 4px; - } - } - - span { - font-size: 12px; - overflow: hidden; - padding: 2px 0; - text-overflow:ellipsis; - white-space: nowrap; - } - - i { - // position: absolute; - color: #999; - font-weight: 400; - &.right { - cursor: pointer; - - &:hover { - color: #222; - } - } - } - } - } - } -} \ No newline at end of file diff --git a/resources/beike/admin/css/_page-product.scss b/resources/beike/admin/css/_page-product.scss index b836e353..7bcbe53a 100644 --- a/resources/beike/admin/css/_page-product.scss +++ b/resources/beike/admin/css/_page-product.scss @@ -179,66 +179,4 @@ body.page-product-form { } } } - - .autocomplete-group-wrapper { - .inline-input { - width: 100%; - } - - .item-group-wrapper { - padding: 10px; - min-height: 280px; - overflow: auto; - background-color: #f5f5f5; - // border: 1px solid #e3e3e3; - - .item { - overflow: hidden; - position: relative; - padding: 5px 8px; - margin-bottom: 4px; - background: #fff; - border: 1px solid #eee; - cursor: move; - display: flex; - align-items: center; // flex-start | center - justify-content: space-between; // flex-end | center | space-between - &:hover { - border-color: #aaa; - } - - div { - display: flex; - line-height: 1; - width: calc(100% - 16px); - align-items: center; // flex-start | center - - i { - margin-right: 4px; - } - } - - span { - font-size: 12px; - overflow: hidden; - padding: 2px 0; - text-overflow:ellipsis; - white-space: nowrap; - } - - i { - // position: absolute; - color: #999; - font-weight: 400; - &.right { - cursor: pointer; - - &:hover { - color: #222; - } - } - } - } - } - } } \ No newline at end of file diff --git a/resources/beike/admin/css/app.scss b/resources/beike/admin/css/app.scss index 8f942980..1a938b7a 100644 --- a/resources/beike/admin/css/app.scss +++ b/resources/beike/admin/css/app.scss @@ -23,7 +23,6 @@ $primary: #fd560f; @import 'element-ui'; @import 'login'; @import 'page-product'; -@import 'page-pages'; @import 'marketing'; @import 'autocomplete'; @import 'page-category'; diff --git a/resources/beike/admin/js/bootstrap-validation.js b/resources/beike/admin/js/bootstrap-validation.js index 970f5e4e..bcf76fcf 100644 --- a/resources/beike/admin/js/bootstrap-validation.js +++ b/resources/beike/admin/js/bootstrap-validation.js @@ -3,13 +3,24 @@ * @link https://beikeshop.com * @Author pu shuo * @Date 2022-08-17 15:42:46 - * @LastEditTime 2023-04-10 13:56:07 + * @LastEditTime 2023-04-11 09:28:34 */ // Example starter JavaScript for disabling form submissions if there are invalid fields $(function () { var forms = document.querySelectorAll(".needs-validation"); + // 触发表单提交 + $(document).on('click', '.submit-form', function(event) { + const form = $(this).attr('form'); + + if ($(`form#${form}`).find('button[type="submit"]').length > 0) { + $(`form#${form}`).find('button[type="submit"]')[0].click(); + } else { + $(`form#${form}`).submit(); + } + }); + // Loop over them and prevent submission Array.prototype.slice.call(forms).forEach(function (form) { form.addEventListener( diff --git a/resources/beike/admin/js/common.js b/resources/beike/admin/js/common.js index 7621119c..da69b6be 100644 --- a/resources/beike/admin/js/common.js +++ b/resources/beike/admin/js/common.js @@ -3,7 +3,7 @@ * @link https://beikeshop.com * @Author pu shuo * @Date 2022-08-22 18:32:26 - * @LastEditTime 2023-03-30 17:30:08 + * @LastEditTime 2023-04-10 15:47:07 */ export default { @@ -154,4 +154,19 @@ export default { } } }, + + // 列表页使用 vue ajax 分页,点击浏览起前进后退按钮时,重新加载数据 + ajaxPageReloadData(app) { + window.addEventListener('popstate', () => { + const page = this.getQueryString('page'); + + if (app.page < 2) { + window.history.back(-1); + return; + } + + app.page = page * 1 - 1; + app.loadData(); + }); + }, } \ No newline at end of file diff --git a/resources/beike/admin/views/components/form/select.blade.php b/resources/beike/admin/views/components/form/select.blade.php index 2ba849ba..d563d19d 100644 --- a/resources/beike/admin/views/components/form/select.blade.php +++ b/resources/beike/admin/views/components/form/select.blade.php @@ -1,5 +1,5 @@ - @foreach ($options as $option) @endforeach diff --git a/resources/beike/admin/views/pages/brands/index.blade.php b/resources/beike/admin/views/pages/brands/index.blade.php index f2af946e..b69c01c9 100644 --- a/resources/beike/admin/views/pages/brands/index.blade.php +++ b/resources/beike/admin/views/pages/brands/index.blade.php @@ -43,7 +43,7 @@ + :total="brands.total" :current-page.sync="page"> { this.brands = res.data.brands; }) diff --git a/resources/beike/admin/views/pages/page_categories/form.blade.php b/resources/beike/admin/views/pages/page_categories/form.blade.php index ca252139..75d23fff 100644 --- a/resources/beike/admin/views/pages/page_categories/form.blade.php +++ b/resources/beike/admin/views/pages/page_categories/form.blade.php @@ -4,7 +4,7 @@ @section('page-title-right') - + @endsection @@ -25,6 +25,7 @@
@csrf @@ -100,12 +101,6 @@ @push('footer')