[修改]修改文本 调整了布局
This commit is contained in:
@@ -23,17 +23,31 @@ class MetricResource extends Resource
|
||||
|
||||
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
|
||||
|
||||
protected static ?string $navigationLabel = '测点配置管理'; // 设置侧边栏的中文名称
|
||||
|
||||
protected static ?string $label = '测点';
|
||||
|
||||
protected static ?string $pluralLabel = '测点';
|
||||
|
||||
public static function getBreadcrumb(): string
|
||||
{
|
||||
return '测点配置管理'; // 修改最外层面包屑标题为 "测点配置管理"
|
||||
}
|
||||
|
||||
|
||||
public static function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
->schema([
|
||||
TextInput::make('name')
|
||||
->label('名称')
|
||||
->required()
|
||||
->maxLength(255),
|
||||
TextInput::make('help')
|
||||
->label('帮助')
|
||||
->maxLength(255),
|
||||
|
||||
Section::make('Node ID')
|
||||
Section::make('节点 ID')
|
||||
->description('节点设置必须唯一')
|
||||
->columns([
|
||||
'default' => 3
|
||||
@@ -47,17 +61,17 @@ class MetricResource extends Resource
|
||||
3 => 'GUID',
|
||||
])
|
||||
->default(1)
|
||||
->label('Identifier Type')
|
||||
->label('标识符类型')
|
||||
->required()
|
||||
->reactive(), // 确保当选择的值变化时触发其他字段的重新渲染
|
||||
|
||||
TextInput::make('namespace_index')
|
||||
->label('Namespace')
|
||||
->label('命名空间')
|
||||
->required(),
|
||||
|
||||
// 数值型标识符字段
|
||||
TextInput::make('numeric_id')
|
||||
->label('Numeric ID')
|
||||
->label('数值 ID')
|
||||
->required()
|
||||
->visible(fn($get) => $get('identifier_type') == Metric::TYPE_NUMERIC),
|
||||
|
||||
@@ -80,9 +94,10 @@ class MetricResource extends Resource
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
TextColumn::make('name'),
|
||||
TextColumn::make('name')
|
||||
->label('名称'),
|
||||
TextColumn::make('nodeid')
|
||||
->label('Node ID')
|
||||
->label('节点 ID')
|
||||
->state(function ($record) {
|
||||
switch ($record->identifier_type) {
|
||||
case 1: // Numeric
|
||||
@@ -96,6 +111,7 @@ class MetricResource extends Resource
|
||||
}
|
||||
}),
|
||||
TextColumn::make('help')
|
||||
->label('帮助')
|
||||
])
|
||||
->filters([
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user