|
|
|
@ -1,66 +1,94 @@
|
|
|
|
|
// Flutter imports:
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
|
|
// Package imports:
|
|
|
|
|
import 'package:aku_ui/common_widgets/aku_common_widgets.dart';
|
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
|
import 'package:get/get.dart';
|
|
|
|
|
import 'package:get/instance_manager.dart';
|
|
|
|
|
|
|
|
|
|
// Project imports:
|
|
|
|
|
import 'package:aku_community_manager/const/resource.dart';
|
|
|
|
|
import 'package:aku_community_manager/mock_models/manage_models/manage_model.dart';
|
|
|
|
|
import 'package:aku_community_manager/models/manager/inspection/inspection_list_model.dart';
|
|
|
|
|
import 'package:aku_community_manager/style/app_style.dart';
|
|
|
|
|
import 'package:aku_community_manager/tools/widget_tool.dart';
|
|
|
|
|
import 'package:aku_community_manager/ui/manage_pages/inspection_manage/inspection_manage_details_page.dart';
|
|
|
|
|
import 'package:aku_ui/aku_ui.dart';
|
|
|
|
|
import 'package:common_utils/common_utils.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:velocity_x/velocity_x.dart';
|
|
|
|
|
|
|
|
|
|
class InspectionManageCard {
|
|
|
|
|
final InspectionManageCardModel cardModel;
|
|
|
|
|
class InspectionManageCard extends StatefulWidget {
|
|
|
|
|
final InspectionListModel cardModel;
|
|
|
|
|
final bool extra;
|
|
|
|
|
InspectionManageCard(this.cardModel, {this.extra = true});
|
|
|
|
|
InspectionManageCard({Key key, this.cardModel, this.extra = true})
|
|
|
|
|
: super(key: key);
|
|
|
|
|
|
|
|
|
|
Widget inspectionManageCard() {
|
|
|
|
|
@override
|
|
|
|
|
_InspectionManageCardState createState() => _InspectionManageCardState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class _InspectionManageCardState extends State<InspectionManageCard> {
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
TextStyle _textstyle =
|
|
|
|
|
TextStyle(color: AppStyle.minorTextColor, fontSize: 28.sp);
|
|
|
|
|
Map<int, String> _inspectionStatus = {
|
|
|
|
|
1: '待巡检',
|
|
|
|
|
2: '已巡检',
|
|
|
|
|
};
|
|
|
|
|
Color _inspectionColor(int status) {
|
|
|
|
|
switch (status) {
|
|
|
|
|
case 1:
|
|
|
|
|
return Color(0xFF4501);
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
return Color(0x999999);
|
|
|
|
|
default:
|
|
|
|
|
return Colors.black;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return Column(
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
children: [
|
|
|
|
|
AkuBox.h(16),
|
|
|
|
|
16.w.heightBox,
|
|
|
|
|
AkuButton(
|
|
|
|
|
onPressed: extra
|
|
|
|
|
onPressed: widget.extra
|
|
|
|
|
? () {
|
|
|
|
|
Get.to(InspectionManageDetailsPage(
|
|
|
|
|
cardModel: cardModel,
|
|
|
|
|
));
|
|
|
|
|
// Get.to(
|
|
|
|
|
// InspectionManageDetailsPage(
|
|
|
|
|
// widget.cardModel: widget.cardModel,
|
|
|
|
|
// ),
|
|
|
|
|
// );
|
|
|
|
|
}
|
|
|
|
|
: () {},
|
|
|
|
|
child: Container(
|
|
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
|
left: 24.w, right: 24.w, bottom: extra ? 48.w : 40.w),
|
|
|
|
|
left: 24.w, right: 24.w, bottom: widget.extra ? 48.w : 40.w),
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
height: extra ? 362.w : 270.w,
|
|
|
|
|
height: widget.extra ? 362.w : 270.w,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.circular(8.w),
|
|
|
|
|
color: Color(0xFFFFFFFF)),
|
|
|
|
|
child: Column(children: [
|
|
|
|
|
Container(
|
|
|
|
|
height: extra ? 93.w : 86.w,
|
|
|
|
|
height: widget.extra ? 93.w : 86.w,
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
|
child: Text(
|
|
|
|
|
cardModel.title,
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
Text(
|
|
|
|
|
'1号巡检任务',
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: AppStyle.primaryTextColor,
|
|
|
|
|
fontSize: extra ? 32.sp : 36.sp,
|
|
|
|
|
fontSize: widget.extra ? 32.sp : 36.sp,
|
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
|
)),
|
|
|
|
|
extra
|
|
|
|
|
),
|
|
|
|
|
Spacer(),
|
|
|
|
|
_inspectionStatus[widget.cardModel.status]
|
|
|
|
|
.text
|
|
|
|
|
.color(_inspectionColor(widget.cardModel.status))
|
|
|
|
|
.bold
|
|
|
|
|
.size(28.sp)
|
|
|
|
|
.make()
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
widget.extra
|
|
|
|
|
? Divider(
|
|
|
|
|
height: 1.w,
|
|
|
|
|
)
|
|
|
|
|
: SizedBox(),
|
|
|
|
|
extra ? AkuBox.h(24) : SizedBox(),
|
|
|
|
|
widget.extra ? 24.w.heightBox : SizedBox(),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Image.asset(
|
|
|
|
@ -68,14 +96,14 @@ class InspectionManageCard {
|
|
|
|
|
width: 40.w,
|
|
|
|
|
height: 40.w,
|
|
|
|
|
),
|
|
|
|
|
AkuBox.w(4),
|
|
|
|
|
4.w.widthBox,
|
|
|
|
|
Text(
|
|
|
|
|
'巡检日期',
|
|
|
|
|
'巡检编号',
|
|
|
|
|
style: _textstyle,
|
|
|
|
|
),
|
|
|
|
|
Spacer(),
|
|
|
|
|
Text(
|
|
|
|
|
cardModel.date,
|
|
|
|
|
widget.cardModel.code,
|
|
|
|
|
style: AppStyle().primaryStyle,
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
@ -88,16 +116,19 @@ class InspectionManageCard {
|
|
|
|
|
width: 40.w,
|
|
|
|
|
height: 40.w,
|
|
|
|
|
),
|
|
|
|
|
AkuBox.w(4),
|
|
|
|
|
Text('巡检周期', style: _textstyle),
|
|
|
|
|
4.w.widthBox,
|
|
|
|
|
Text('规定巡检时间', style: _textstyle),
|
|
|
|
|
Spacer(),
|
|
|
|
|
Text(
|
|
|
|
|
cardModel.cycle,
|
|
|
|
|
'${DateUtil.formatDateStr(widget.cardModel.beginDate, format: "yyyy-MM-dd HH:mm")}~${DateUtil.formatDateStr(widget.cardModel.endDate, format: "HH:mm")}',
|
|
|
|
|
style: AppStyle().primaryStyle,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Spacer(),
|
|
|
|
|
...widget.cardModel.actualBeginDate == null
|
|
|
|
|
? [SizedBox()]
|
|
|
|
|
: [
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Image.asset(
|
|
|
|
@ -105,20 +136,21 @@ class InspectionManageCard {
|
|
|
|
|
width: 40.w,
|
|
|
|
|
height: 40.w,
|
|
|
|
|
),
|
|
|
|
|
AkuBox.w(4),
|
|
|
|
|
4.w.widthBox,
|
|
|
|
|
Text(
|
|
|
|
|
'巡检时间',
|
|
|
|
|
'开始巡检时间',
|
|
|
|
|
style: _textstyle,
|
|
|
|
|
),
|
|
|
|
|
Spacer(),
|
|
|
|
|
Text(
|
|
|
|
|
cardModel.time,
|
|
|
|
|
'${DateUtil.formatDateStr(widget.cardModel.actualBeginDate, format: "yyyy-MM-dd HH:mm")}',
|
|
|
|
|
style: AppStyle().primaryStyle,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
extra ? Spacer() : SizedBox(),
|
|
|
|
|
extra
|
|
|
|
|
Spacer(),
|
|
|
|
|
],
|
|
|
|
|
widget.cardModel.actualEndDate == null
|
|
|
|
|
? Row(
|
|
|
|
|
children: [
|
|
|
|
|
Image.asset(
|
|
|
|
@ -126,16 +158,14 @@ class InspectionManageCard {
|
|
|
|
|
width: 40.w,
|
|
|
|
|
height: 40.w,
|
|
|
|
|
),
|
|
|
|
|
AkuBox.w(4),
|
|
|
|
|
4.w.widthBox,
|
|
|
|
|
Text(
|
|
|
|
|
'巡检人员',
|
|
|
|
|
'结束巡检时间',
|
|
|
|
|
style: _textstyle,
|
|
|
|
|
),
|
|
|
|
|
Spacer(),
|
|
|
|
|
Text(
|
|
|
|
|
cardModel.persons.length > 2
|
|
|
|
|
? '${cardModel.persons[0]}、${cardModel.persons[1]}等'
|
|
|
|
|
: cardModel.persons[0],
|
|
|
|
|
'${DateUtil.formatDateStr(widget.cardModel.actualEndDate, format: "yyyy-MM-dd HH:mm")}',
|
|
|
|
|
style: AppStyle().primaryStyle,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|