|
|
@ -1,66 +1,94 @@
|
|
|
|
// Flutter imports:
|
|
|
|
import 'package:aku_community_manager/models/manager/inspection/inspection_list_model.dart';
|
|
|
|
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/style/app_style.dart';
|
|
|
|
import 'package:aku_community_manager/style/app_style.dart';
|
|
|
|
import 'package:aku_community_manager/tools/widget_tool.dart';
|
|
|
|
import 'package:aku_ui/aku_ui.dart';
|
|
|
|
import 'package:aku_community_manager/ui/manage_pages/inspection_manage/inspection_manage_details_page.dart';
|
|
|
|
import 'package:common_utils/common_utils.dart';
|
|
|
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
import 'package:velocity_x/velocity_x.dart';
|
|
|
|
|
|
|
|
|
|
|
|
class InspectionManageCard {
|
|
|
|
class InspectionManageCard extends StatefulWidget {
|
|
|
|
final InspectionManageCardModel cardModel;
|
|
|
|
final InspectionListModel cardModel;
|
|
|
|
final bool extra;
|
|
|
|
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 _textstyle =
|
|
|
|
TextStyle(color: AppStyle.minorTextColor, fontSize: 28.sp);
|
|
|
|
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(
|
|
|
|
return Column(
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
AkuBox.h(16),
|
|
|
|
16.w.heightBox,
|
|
|
|
AkuButton(
|
|
|
|
AkuButton(
|
|
|
|
onPressed: extra
|
|
|
|
onPressed: widget.extra
|
|
|
|
? () {
|
|
|
|
? () {
|
|
|
|
Get.to(InspectionManageDetailsPage(
|
|
|
|
// Get.to(
|
|
|
|
cardModel: cardModel,
|
|
|
|
// InspectionManageDetailsPage(
|
|
|
|
));
|
|
|
|
// widget.cardModel: widget.cardModel,
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
: () {},
|
|
|
|
: () {},
|
|
|
|
child: Container(
|
|
|
|
child: Container(
|
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
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,
|
|
|
|
width: double.infinity,
|
|
|
|
height: extra ? 362.w : 270.w,
|
|
|
|
height: widget.extra ? 362.w : 270.w,
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
borderRadius: BorderRadius.circular(8.w),
|
|
|
|
borderRadius: BorderRadius.circular(8.w),
|
|
|
|
color: Color(0xFFFFFFFF)),
|
|
|
|
color: Color(0xFFFFFFFF)),
|
|
|
|
child: Column(children: [
|
|
|
|
child: Column(children: [
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
height: extra ? 93.w : 86.w,
|
|
|
|
height: widget.extra ? 93.w : 86.w,
|
|
|
|
width: double.infinity,
|
|
|
|
width: double.infinity,
|
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
child: Text(
|
|
|
|
child: Row(
|
|
|
|
cardModel.title,
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Text(
|
|
|
|
|
|
|
|
'1号巡检任务',
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
color: AppStyle.primaryTextColor,
|
|
|
|
color: AppStyle.primaryTextColor,
|
|
|
|
fontSize: extra ? 32.sp : 36.sp,
|
|
|
|
fontSize: widget.extra ? 32.sp : 36.sp,
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
)),
|
|
|
|
),
|
|
|
|
extra
|
|
|
|
Spacer(),
|
|
|
|
|
|
|
|
_inspectionStatus[widget.cardModel.status]
|
|
|
|
|
|
|
|
.text
|
|
|
|
|
|
|
|
.color(_inspectionColor(widget.cardModel.status))
|
|
|
|
|
|
|
|
.bold
|
|
|
|
|
|
|
|
.size(28.sp)
|
|
|
|
|
|
|
|
.make()
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
widget.extra
|
|
|
|
? Divider(
|
|
|
|
? Divider(
|
|
|
|
height: 1.w,
|
|
|
|
height: 1.w,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
: SizedBox(),
|
|
|
|
: SizedBox(),
|
|
|
|
extra ? AkuBox.h(24) : SizedBox(),
|
|
|
|
widget.extra ? 24.w.heightBox : SizedBox(),
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Image.asset(
|
|
|
|
Image.asset(
|
|
|
@ -68,14 +96,14 @@ class InspectionManageCard {
|
|
|
|
width: 40.w,
|
|
|
|
width: 40.w,
|
|
|
|
height: 40.w,
|
|
|
|
height: 40.w,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
AkuBox.w(4),
|
|
|
|
4.w.widthBox,
|
|
|
|
Text(
|
|
|
|
Text(
|
|
|
|
'巡检日期',
|
|
|
|
'巡检编号',
|
|
|
|
style: _textstyle,
|
|
|
|
style: _textstyle,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Spacer(),
|
|
|
|
Spacer(),
|
|
|
|
Text(
|
|
|
|
Text(
|
|
|
|
cardModel.date,
|
|
|
|
widget.cardModel.code,
|
|
|
|
style: AppStyle().primaryStyle,
|
|
|
|
style: AppStyle().primaryStyle,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
],
|
|
|
|
],
|
|
|
@ -88,16 +116,19 @@ class InspectionManageCard {
|
|
|
|
width: 40.w,
|
|
|
|
width: 40.w,
|
|
|
|
height: 40.w,
|
|
|
|
height: 40.w,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
AkuBox.w(4),
|
|
|
|
4.w.widthBox,
|
|
|
|
Text('巡检周期', style: _textstyle),
|
|
|
|
Text('规定巡检时间', style: _textstyle),
|
|
|
|
Spacer(),
|
|
|
|
Spacer(),
|
|
|
|
Text(
|
|
|
|
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,
|
|
|
|
style: AppStyle().primaryStyle,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Spacer(),
|
|
|
|
Spacer(),
|
|
|
|
|
|
|
|
...widget.cardModel.actualBeginDate == null
|
|
|
|
|
|
|
|
? [SizedBox()]
|
|
|
|
|
|
|
|
: [
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Image.asset(
|
|
|
|
Image.asset(
|
|
|
@ -105,20 +136,21 @@ class InspectionManageCard {
|
|
|
|
width: 40.w,
|
|
|
|
width: 40.w,
|
|
|
|
height: 40.w,
|
|
|
|
height: 40.w,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
AkuBox.w(4),
|
|
|
|
4.w.widthBox,
|
|
|
|
Text(
|
|
|
|
Text(
|
|
|
|
'巡检时间',
|
|
|
|
'开始巡检时间',
|
|
|
|
style: _textstyle,
|
|
|
|
style: _textstyle,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Spacer(),
|
|
|
|
Spacer(),
|
|
|
|
Text(
|
|
|
|
Text(
|
|
|
|
cardModel.time,
|
|
|
|
'${DateUtil.formatDateStr(widget.cardModel.actualBeginDate, format: "yyyy-MM-dd HH:mm")}',
|
|
|
|
style: AppStyle().primaryStyle,
|
|
|
|
style: AppStyle().primaryStyle,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
extra ? Spacer() : SizedBox(),
|
|
|
|
Spacer(),
|
|
|
|
extra
|
|
|
|
],
|
|
|
|
|
|
|
|
widget.cardModel.actualEndDate == null
|
|
|
|
? Row(
|
|
|
|
? Row(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Image.asset(
|
|
|
|
Image.asset(
|
|
|
@ -126,16 +158,14 @@ class InspectionManageCard {
|
|
|
|
width: 40.w,
|
|
|
|
width: 40.w,
|
|
|
|
height: 40.w,
|
|
|
|
height: 40.w,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
AkuBox.w(4),
|
|
|
|
4.w.widthBox,
|
|
|
|
Text(
|
|
|
|
Text(
|
|
|
|
'巡检人员',
|
|
|
|
'结束巡检时间',
|
|
|
|
style: _textstyle,
|
|
|
|
style: _textstyle,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Spacer(),
|
|
|
|
Spacer(),
|
|
|
|
Text(
|
|
|
|
Text(
|
|
|
|
cardModel.persons.length > 2
|
|
|
|
'${DateUtil.formatDateStr(widget.cardModel.actualEndDate, format: "yyyy-MM-dd HH:mm")}',
|
|
|
|
? '${cardModel.persons[0]}、${cardModel.persons[1]}等'
|
|
|
|
|
|
|
|
: cardModel.persons[0],
|
|
|
|
|
|
|
|
style: AppStyle().primaryStyle,
|
|
|
|
style: AppStyle().primaryStyle,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|