/*
 * @Author       : WuWei
 * @LastEditors  : WuWei
 * @Date         : 2023-05-09 16:13:30
 * @LastEditTime : 2023-05-11 15:05:15
 * @Description  : Do not edit
 */

part of '../index.dart';

///详情描述
class _DescListComponent extends StatelessWidget {
  const _DescListComponent({Key? key}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    final store = Provider.of<PrivateRepairDetailStore>(context);
//final style = WTheme.of(context);final colorScheme = style.colorScheme;
//final theme = Theme.of(context);
//final textTheme = theme.textTheme;
    final data = store.data;
    if (data == null) {
      return SliverToBoxAdapter();
    }
    final list = [
      {
        'name': '设备编号',
        'val': data.number,
      },
      {
        'name': '设备品类',
        'val': data.category,
      },
      {
        'name': '设备品牌及型号',
        'val': data.type,
      },
      {
        'name': '所属位置',
        'val':
            '${data.buidingName ?? ''}${data.unitName ?? ''}${data.houseName ?? ''}',
      },
      {
        'name': '设备状态',
        'val': data.status,
      },
      {
        'name': '负责人',
        'val': data.manager,
      },
      {
        'name': '出厂年月',
        'val': data.productDate,
      },
      {
        'name': '出厂编号',
        'val': data.productNumber,
      },
      {
        'name': '安装日期',
        'val': data.installDate,
      },
      {
        'name': '使用年限',
        'val': data.life,
      },
      {
        'name': '报废日期',
        'val': data.scrpdate,
      },
      {
        'name': '巡检规范',
        'val': data.routinginspectionName,
      },
      {
        'name': '保养规范',
        'val': data.maintenancecodeName,
      },
    ];
    return WisSliverList.childBuilder(
      childCount: list.length,
      padding: EdgeInsets.symmetric(horizontal: 15.pt),
      builder: (_, i) {
        final item = list[i];
        return Wisdom.row(
          padding: EdgeInsets.fromLTRB(15.pt, 0, 15.pt, 15.pt),
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: <Widget>[
            Text('${item['name']}'),
            Text('${item['val'] ?? '--'}'),
          ],
        );
      },
    );
  }
}
