You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
881 B
49 lines
881 B
1 year ago
|
<?php
|
||
|
|
||
|
namespace Plugins\Notebook\Enums;
|
||
|
|
||
|
use App\Enums\EnumStatusTrait;
|
||
|
use Sc\Util\HtmlElement\ElementType\AbstractHtmlElement;
|
||
|
|
||
|
/**
|
||
|
* 笔记协作人员 : 权限
|
||
|
*/
|
||
|
enum NotebookUserEnumMode :int
|
||
|
{
|
||
|
use EnumStatusTrait;
|
||
|
|
||
|
/**
|
||
|
* 只读
|
||
|
*/
|
||
|
case ReadOnly = 1;
|
||
|
|
||
|
/**
|
||
|
* 读写
|
||
|
*/
|
||
|
case ReadingAndWriting = 2;
|
||
|
|
||
|
/**
|
||
|
* 获取描述
|
||
|
*
|
||
|
* @return string
|
||
|
*/
|
||
|
public function getDes(): string
|
||
|
{
|
||
|
return match ($this) {
|
||
|
self::ReadOnly => '只读',
|
||
|
self::ReadingAndWriting => '读写',
|
||
|
};
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* 转标签
|
||
|
*/
|
||
|
public function toTag():AbstractHtmlElement
|
||
|
{
|
||
|
return match ($this){
|
||
|
self::ReadOnly => $this->getTag('success', 'light'),
|
||
|
self::ReadingAndWriting => $this->getTag('warning', 'light'),
|
||
|
};
|
||
|
}
|
||
|
}
|