/*
 * @Author       : WuWei
 * @LastEditors: wjc
 * @Date         : 2022-10-13 15:05:16
 * @LastEditTime: 2023-04-03 11:48:41
 * @Description  : Do not edit
 */
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:statistics_package/src/pages/index/components/table.dart';
import 'package:statistics_package/src/view_models/index_store.dart';
import 'package:wisdom_cli/wisdom_cli.dart';

///
///
///
///
///
//***以下为模板代码谨慎修改***
class DayPage extends StatelessWidget {
  const DayPage({Key? key}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    final StatisticsIndexStore _store = Get.find<StatisticsIndexStore>();
    final colorScheme = WTheme.of(context).colorScheme;
    return WisScrollView(
      onInit: () => _store.initList(),
      slivers: <Widget>[
        SliverToBoxAdapter(
          child: WisCard(
            margin: EdgeInsets.symmetric(vertical: 10.pt, horizontal: 15.pt),
            color: Colors.white,
            padding: EdgeInsets.all(5.pt),
            child: Wisdom.column(
              color: Colors.white,
              mainAxisSize: MainAxisSize.min,
              children: <Widget>[
                WisExpansionTile(
                  initiallyExpanded: false,
                  title: Wisdom.row(
                    height: 53.5.pt,
                    children: [
                      Wisdom(
                        borderRadius: BorderRadius.circular(4.pt),
                        width: 3.pt,
                        height: 15.pt,
                        color: colorScheme.primary,
                      ),
                      SizedBox(width: 5.pt),
                      WisText(
                        '物业服务',
                        size: 14.pt,
                        weight: FontWeight.w600,
                        color: colorScheme.mainTitle,
                      ),
                    ],
                  ),
                  children: [
                    Obx(
                      () => Column(
                        children: [
                          for (var item in _store.serveList)
                            TableView(
                              title: item.types,
                              headers: ['状态', '数目'],
                              content: item.content,
                            ),
                        ],
                      ),
                    ),
                  ],
                ).asFlexible(flex: 1),
                WisExpansionTile(
                  initiallyExpanded: false,
                  title: Wisdom.row(
                    height: 53.5.pt,
                    children: [
                      Wisdom(
                        borderRadius: BorderRadius.circular(4.pt),
                        width: 3.pt,
                        height: 15.pt,
                        color: colorScheme.primary,
                      ),
                      SizedBox(width: 5.pt),
                      WisText(
                        '物业收费',
                        size: 14.pt,
                        weight: FontWeight.w600,
                        color: colorScheme.mainTitle,
                      ),
                    ],
                  ),
                  children: [
                    Obx(
                      () => TableView(
                        title: '缴费数据',
                        headers: ['名称', '笔数', '金额'],
                        content: _store.feeList.value.paymentData!,
                      ),
                    ),
                    Obx(
                      () => TableView(
                        title: '欠费情况',
                        headers: ['名称', '往年欠费', '今年欠费'],
                        content: _store.feeList.value.arrearsTemp!,
                      ),
                    ),
                    Obx(
                      () => TableView(
                        title: '实时收费率',
                        content: _store.feeList.value.rate!,
                      ),
                    ),
                  ],
                ).asFlexible(flex: 1),
                WisExpansionTile(
                  initiallyExpanded: false,
                  title: Wisdom.row(
                    height: 53.5.pt,
                    children: [
                      Wisdom(
                        borderRadius: BorderRadius.circular(4.pt),
                        width: 3.pt,
                        height: 15.pt,
                        color: colorScheme.primary,
                      ),
                      SizedBox(width: 5.pt),
                      WisText(
                        '物业工作',
                        size: 14.pt,
                        weight: FontWeight.w600,
                        color: colorScheme.mainTitle,
                      ),
                    ],
                  ),
                  children: [
                    Obx(
                      () => TableView(
                        title: '巡逻保洁',
                        headers: ['名称', '点位', '次数'],
                        content: _store.workList.value.patrolClean!,
                      ),
                    ),
                    Obx(
                      () => TableView(
                        title: '设备养护检修',
                        headers: ['名称', '设备养护检修'],
                        content: _store.workList.value.equipment!,
                      ),
                    ),
                  ],
                ).asFlexible(flex: 1),
                WisExpansionTile(
                  initiallyExpanded: false,
                  title: Wisdom.row(
                    height: 53.5.pt,
                    children: [
                      Wisdom(
                        borderRadius: BorderRadius.circular(4.pt),
                        width: 3.pt,
                        height: 15.pt,
                        color: colorScheme.primary,
                      ),
                      SizedBox(width: 5.pt),
                      WisText(
                        '信息发布',
                        size: 14.pt,
                        weight: FontWeight.w600,
                        color: colorScheme.mainTitle,
                      ),
                    ],
                  ),
                  children: [
                    TableView(
                      headers: ['名称', '数目'],
                      content: _store.releaseList,
                    ),
                  ],
                ).asFlexible(flex: 1),
                WisExpansionTile(
                  initiallyExpanded: false,
                  title: Wisdom.row(
                    height: 53.5.pt,
                    children: [
                      Wisdom(
                        borderRadius: BorderRadius.circular(4.pt),
                        width: 3.pt,
                        height: 15.pt,
                        color: colorScheme.primary,
                      ),
                      SizedBox(width: 5.pt),
                      WisText(
                        '信息公示',
                        size: 14.pt,
                        weight: FontWeight.w600,
                        color: colorScheme.mainTitle,
                      ),
                    ],
                  ),
                  children: [
                    TableView(
                      headers: ['名称', '数目'],
                      content: _store.announcementList,
                    ),
                  ],
                ).asFlexible(flex: 1),
              ],
            ),
          ),
        ),
      ],
    );
  }
}
