99 lines
4.0 KiB
PHP
99 lines
4.0 KiB
PHP
<?php
|
|
/**
|
|
* SAAS应用系统 --- 十年开发经验汇集巨献!
|
|
* ==========================================================
|
|
* Copy right 2020-2050 成都众联思索科技有限公司,保留所有权利。
|
|
* ----------------------------------------------------------
|
|
* 官方网址: https://www.zoomtk.com
|
|
* 这不是自由软件!未经允许不得用于商业目或程序代码摘取及修改。
|
|
* 任何企业和个人未经允许对程序代码以任何形式任何目的再发布传播。
|
|
* 唯一发布渠道www.zoomtk.com;非官方渠道统一视为侵权行为。
|
|
* ==========================================================
|
|
*/
|
|
namespace App\Mall\Controller\Goods;
|
|
namespace App\Mall\Controller\Goods;
|
|
use Hyperf\HttpServer\Annotation\Controller;
|
|
use Hyperf\HttpServer\Annotation\RequestMapping;
|
|
use Builder\BaseController;
|
|
use Builder\View\Components\Grid\Avatar;
|
|
use Builder\View\Layout\Content;
|
|
use Builder\View\Layout\Row;
|
|
use Builder\View\Components\Widgets\Alert;
|
|
use Builder\View\Components\Widgets\Button;
|
|
use Builder\View\Components\Widgets\Dialog;
|
|
use Builder\View\Components\Widgets\Card;
|
|
use Builder\View\Components\Widgets\Html;
|
|
use Builder\View;
|
|
use Builder\Entity\MenuEntity;
|
|
use Builder\Entity\MenuItemEntity;
|
|
use Builder\Entity\UISettingEntity;
|
|
use Builder\Entity\UserEntity;
|
|
use Builder\View\Form;
|
|
use Builder\View\Grid;
|
|
#[Controller(prefix: "mall/goodscategory")]
|
|
class GoodsCategory extends BaseController
|
|
{
|
|
#[RequestMapping(methods: "get,post")]
|
|
public function lists(){
|
|
$page = request('page');
|
|
$pre = 10;
|
|
$grid = new Grid();
|
|
if ($grid->isGetData()) {
|
|
// $start = ($page - 1) * $pre;
|
|
// $data = file_get_contents('http://web.peakchao.top:250/music/getMusicBanner');
|
|
// $data = json_decode($data, true);
|
|
// $lsat_page = 10;
|
|
// $grid->customData($data['result'], $page, $pre, $lsat_page, 100);
|
|
$grid->customData([
|
|
[
|
|
'pk'=>'1',
|
|
'name'=>'11111',
|
|
'singer'=>'333',
|
|
'img1'=>'https://wx.qlogo.cn/mmopen/vi_32/ajNVdqHZLLBpqXMk6kUC4PeB5VrIVtHyUqrcPg65sjKdPxlkBINiaQ1NG6nZC9iaWOh9qdO6VaApJzgWA1wu5h8Q/132'
|
|
],
|
|
[
|
|
'pk'=>'2',
|
|
'name'=>'xxx',
|
|
'singer'=>'999',
|
|
'img1'=>'https://wx.qlogo.cn/mmopen/vi_32/ajNVdqHZLLBpqXMk6kUC4PeB5VrIVtHyUqrcPg65sjKdPxlkBINiaQ1NG6nZC9iaWOh9qdO6VaApJzgWA1wu5h8Q/132'
|
|
]
|
|
], $page, $pre, 1, 100);
|
|
return $grid;
|
|
}
|
|
$grid->pk('pk'); //显示操作列
|
|
$grid->operationColumn(); //显示操作列
|
|
$grid->tablePagination();//开启分页
|
|
$grid->showCheckedAll();//开启多选
|
|
$grid->dataCompleteRefresh(); //设置编辑删除更新数据
|
|
$grid->addTopButton('add');
|
|
$grid->addTopButton('delete');
|
|
$grid->addTopButton('edit');
|
|
// { formType: 'grid', cols: [ { span: 24, formList: [ { dataIndex: 'avatar' }] }] },
|
|
$a = [
|
|
'width' => 500,
|
|
'layout' => [
|
|
[
|
|
'formType' => 'grid',
|
|
'cols' => [
|
|
[
|
|
'span' => 24,
|
|
'formList' => [
|
|
[
|
|
'dataIndex' => 'img1'
|
|
]
|
|
]
|
|
]
|
|
],
|
|
]
|
|
],
|
|
];
|
|
$grid->formOption($a);
|
|
$grid->column('img1', '图片')
|
|
->defaultValue('https://wx.qlogo.cn/mmopen/vi_32/ajNVdqHZLLBpqXMk6kUC4PeB5VrIVtHyUqrcPg65sjKdPxlkBINiaQ1NG6nZC9iaWOh9qdO6VaApJzgWA1wu5h8Q/132')
|
|
->component(Avatar::make())
|
|
->width(100);
|
|
$grid->column('name','中国')->width(180)->formType('textarea');
|
|
$grid->column('singer','头像')->width(80);
|
|
return $grid;
|
|
}
|
|
} |