<?php

namespace App\Admin\Controllers;

use App\Services\CoachInfoRecordService;
use Slowlyo\OwlAdmin\Controllers\AdminController;

/**
 * 技师信息记录
 *
 * @property CoachInfoRecordService $service
 */
class CoachInfoRecordController extends AdminController
{
	protected string $serviceName = CoachInfoRecordService::class;

	public function list()
	{
		$crud = $this->baseCRUD()
			->filterTogglable(false)
			->headerToolbar([
				$this->createButton('dialog'),
				...$this->baseHeaderToolBar()
			])
			->columns([
				amis()->TableColumn('id', 'ID')->sortable(),
				amis()->TableColumn('coach_id', '技师编号'),
				amis()->TableColumn('nickname', '昵称'),
				amis()->TableColumn('avatar', '头像'),
				amis()->TableColumn('gender', '性别'),
				amis()->TableColumn('mobile', '服务电话'),
				amis()->TableColumn('birthday', '出生日期'),
				amis()->TableColumn('work_years', '从业年份')->sortable(),
				amis()->TableColumn('intention_city', '意向城市'),
				amis()->TableColumn('introduction', '个人简介'),
				amis()->TableColumn('auditor', '审核人'),
				amis()->TableColumn('audit_time', '审核时间'),
				amis()->TableColumn('audit_remark', '审核回执'),
				amis()->TableColumn('state', '状态'),
				amis()->TableColumn('created_at', admin_trans('admin.created_at'))->type('datetime')->sortable(),
				amis()->TableColumn('updated_at', admin_trans('admin.updated_at'))->type('datetime')->sortable(),
				$this->rowActions('dialog')
			]);

		return $this->baseList($crud);
	}

	public function form($isEdit = false)
	{
		return $this->baseForm()->body([
			amis()->TextControl('coach_id', '技师编号'),
			amis()->TextControl('nickname', '昵称'),
			amis()->TextControl('avatar', '头像'),
			amis()->TextControl('gender', '性别'),
			amis()->TextControl('mobile', '服务电话'),
			amis()->TextControl('birthday', '出生日期'),
			amis()->TextControl('work_years', '从业年份'),
			amis()->TextControl('intention_city', '意向城市'),
			amis()->TextControl('introduction', '个人简介'),
			amis()->TextControl('auditor', '审核人'),
			amis()->TextControl('audit_time', '审核时间'),
			amis()->TextControl('audit_remark', '审核回执'),
			amis()->TextControl('state', '状态'),
		]);
	}

	public function detail()
	{
		return $this->baseDetail()->body([
			amis()->TextControl('id', 'ID')->static(),
			amis()->TextControl('coach_id', '技师编号')->static(),
			amis()->TextControl('nickname', '昵称')->static(),
			amis()->TextControl('avatar', '头像')->static(),
			amis()->TextControl('gender', '性别')->static(),
			amis()->TextControl('mobile', '服务电话')->static(),
			amis()->TextControl('birthday', '出生日期')->static(),
			amis()->TextControl('work_years', '从业年份')->static(),
			amis()->TextControl('intention_city', '意向城市')->static(),
			amis()->TextControl('introduction', '个人简介')->static(),
			amis()->TextControl('auditor', '审核人')->static(),
			amis()->TextControl('audit_time', '审核时间')->static(),
			amis()->TextControl('audit_remark', '审核回执')->static(),
			amis()->TextControl('state', '状态')->static(),
			amis()->TextControl('created_at', admin_trans('admin.created_at'))->static(),
			amis()->TextControl('updated_at', admin_trans('admin.updated_at'))->static(),
		]);
	}
}