15061959991 1adf627c0d feat: 财务系统二次开发 - 营销账户账单功能
- 基础环境:Docker 部署配置,源码挂载实时同步
- 修复:super_admin 权限补全、登录重定向循环
- 开发:店铺营销账户账单 - 抖音账户(15字段汇总账单)
- 开发:店铺营销账户账单 - 淘系支付宝账户(8字段流水账单)
- 开发:店铺营销账户账单 - 拼多多账户(7字段流水账单)
- 业务页面导航集成:config/business_navigation.php + Business\Pages 控制器
- 各平台独立表结构和视图,互不影响
2026-07-21 18:43:52 +08:00

143 lines
2.8 KiB
PHP

<?php
namespace App\View\Components;
use App\Abstracts\View\Component;
class Alert extends Component
{
/** @var bool */
public $rounded;
/** @var bool */
public $border;
/** @var string */
public $color;
/** @var string */
public $icon;
/** @var string */
public $typr;
/** @var string */
public $title;
/** @var string */
public $description;
/** @var string */
public $message;
/** @var array */
public $list;
/** @var array */
public $actions;
/** @var bool */
public $dismiss;
/**
* Create a new component instance.
*
* @return void
*/
public function __construct(
bool $rounded = true, bool $border = false,
string $color = '', string $icon = '',
string $type = '',
string $title = '', string $description = '', string $message = '',
array $list = [], array $actions = [],
bool $dismiss = false
) {
$this->rounded = $rounded;
$this->border = $border;
$this->type = $type;
$this->color = $this->getColor($color);
$this->icon = $this->getIcon($icon);
$this->title = $title;
$this->description = $description;
$this->message = $message;
$this->list = $list;
$this->actions = $actions;
$this->dismiss = $dismiss;
}
/**
* Get the view / contents that represent the component.
*
* @return \Illuminate\Contracts\View\View|string
*/
public function render()
{
return view('components.alert.index');
}
protected function getColor($color)
{
if (! empty($color)) {
return $color;
}
switch ($this->type) {
case 'success':
$color = 'green';
break;
case 'info':
$color = 'blue';
break;
case 'warning':
$color = 'orange';
break;
case 'danger':
case 'error':
$color = 'red';
break;
default:
$color = 'green';
break;
}
return $color;
}
protected function getIcon($icon)
{
if (! empty($icon)) {
return $icon;
}
switch ($this->type) {
case 'success':
$icon = 'check_circle';
break;
case 'info':
$icon = 'info';
break;
case 'warning':
$icon = 'warning';
break;
case 'danger':
case 'error':
$icon = 'error';
break;
default:
$icon = 'check_circle';
break;
}
return $icon;
}
}