Commit 4ffa57f5 authored by 张宏's avatar 张宏

44444444-ui

parent 29eea2f6
This diff is collapsed.
......@@ -31,6 +31,13 @@
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/permission_handler_html-0.1.3+5" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.5.6" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/flutter_secure_storage-9.2.4" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/flutter_image_compress_macos-1.0.3" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/flutter_image_compress-2.4.0" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/flutter_image_compress_ohos-0.0.3" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/flutter_image_compress_common-1.0.6" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/flutter_image_compress_web-0.1.5" />
<root url="file://$PROJECT_DIR$/plugins/vsdk" />
<root url="file://$PROJECT_DIR$/plugins/flutter_webrtc" />
</CLASSES>
<JAVADOC />
<SOURCES />
......
......@@ -52,8 +52,8 @@ class PatientInfoBO extends Equatable {
/// 患者名称
final String name;
/// 家长信息
final String owner;
/// 宠物类型(猫/狗等)
final String type;
/// 联系电话
final String phone;
......@@ -67,28 +67,44 @@ class PatientInfoBO extends Equatable {
/// 患者头像地址
final String avatarUrl;
/// 宠物病因
final String disease;
/// 入住时间
final String checkInDate;
/// 护理等级
final String careLevel;
const PatientInfoBO({
required this.name,
required this.owner,
required this.type,
required this.phone,
required this.breed,
required this.doctor,
required this.disease,
required this.checkInDate,
required this.careLevel,
this.avatarUrl = '',
});
factory PatientInfoBO.fromJson(Map<String, dynamic> json) {
return PatientInfoBO(
name: json['name'] as String? ?? '',
owner: json['owner'] as String? ?? '',
type: json['type'] as String? ?? '',
phone: json['phone'] as String? ?? '',
breed: json['breed'] as String? ?? '',
doctor: json['doctor'] as String? ?? '',
disease: json['disease'] as String? ?? '',
checkInDate: json['checkInDate'] as String? ?? '',
careLevel: json['careLevel'] as String? ?? '',
avatarUrl: json['avatarUrl'] as String? ?? '',
);
}
@override
List<Object?> get props => [name, owner, phone, breed, doctor, avatarUrl];
List<Object?> get props =>
[name, type, phone, breed, doctor, disease, checkInDate, careLevel, avatarUrl];
}
/// 用途:首页监护舱告警信息展示数据
......
......@@ -50,11 +50,14 @@ class MonitoringMockData {
static PatientInfoBO getMockPatientInfo() {
return const PatientInfoBO(
name: '妮蔻 Niko',
owner: '家长:王女士',
phone: '联系电话:15845310589',
breed: '品种:长毛三花',
doctor: '医生:程医生',
name: '妮蔻',
type: '猫',
phone: '130-1111-3333',
breed: '长毛三花',
doctor: '张医生',
disease: '胃炎',
checkInDate: '2025-6-15',
careLevel: '特级',
avatarUrl: '',
);
}
......@@ -67,6 +70,12 @@ class MonitoringMockData {
time: '2026-05-04 16:22:49',
status: '待处理',
),
AlertInfoBO(
title: '温度异常',
description: '温度高于阈值26℃,当前温度29℃,请立即检查温度传感器,字…',
time: '2026-05-04 16:22:49',
status: '已处理',
),
];
}
......
......@@ -63,13 +63,13 @@ class PatientInfoCard extends StatelessWidget {
),
),
SizedBox(height: 8.h),
_buildInfoText(patientInfo.owner),
_buildInfoText('类型:${patientInfo.type}'),
SizedBox(height: 4.h),
_buildInfoText(patientInfo.phone),
_buildInfoText('电话:${patientInfo.phone}'),
SizedBox(height: 4.h),
_buildInfoText(patientInfo.breed),
_buildInfoText('品种:${patientInfo.breed}'),
SizedBox(height: 4.h),
_buildInfoText(patientInfo.doctor),
_buildInfoText('医生:${patientInfo.doctor}'),
],
),
),
......
......@@ -95,7 +95,7 @@ class _MonitoringIndexContentState extends State<MonitoringIndexContent> {
Container(
height: topHeight.clamp(80.0, 104.0),
decoration: BoxDecoration(
border: BoxBorder.all(width: 1.w,color: Colors.red)
// border: BoxBorder.all(width: 1.w,color: Colors.red)
),
child: const MonitoringTopStatusBar(),
),
......@@ -103,7 +103,7 @@ class _MonitoringIndexContentState extends State<MonitoringIndexContent> {
child: Container(
padding: EdgeInsets.zero,
decoration: BoxDecoration(
border: BoxBorder.all(width: 1.w,color: Colors.red)
// border: BoxBorder.all(width: 1.w,color: Colors.red)
),
child: _buildMainArea(state, gap),
),
......@@ -111,7 +111,7 @@ class _MonitoringIndexContentState extends State<MonitoringIndexContent> {
Container(
height: bottomHeight.clamp(92.0, 134.0),
decoration: BoxDecoration(
border: BoxBorder.all(width: 1.w,color: Colors.red)
// border: BoxBorder.all(width: 1.w,color: Colors.red)
),
child: MonitoringBottomMenu(menuItems: state.menuItems),
),
......@@ -190,7 +190,7 @@ class _MonitoringIndexContentState extends State<MonitoringIndexContent> {
child: Container(
padding: EdgeInsets.zero,
decoration: BoxDecoration(
border: BoxBorder.all(width: 1.w,color: Colors.red)
// border: BoxBorder.all(width: 1.w,color: Colors.red)
),
// padding: EdgeInsets.only(
// right: metric == displayMetrics.last ? 0 : gap,
......
......@@ -2,8 +2,6 @@ import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:laki_icu_app/models/bo/monitoring_bo.dart';
import 'monitoring_panel.dart';
class MonitoringAlertCard extends StatelessWidget {
final List<AlertInfoBO> alerts;
......@@ -14,44 +12,39 @@ class MonitoringAlertCard extends StatelessWidget {
@override
Widget build(BuildContext context) {
final hasPending = alerts.any((item) => item.status.contains('待处理'));
return Container(
padding: EdgeInsets.zero,
padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 20.h),
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage('lib/assets/monitoring/alert_box_bg_2.png'),
image: AssetImage(
hasPending
? 'lib/assets/monitoring/alert_box_bg_2.png'
: 'lib/assets/monitoring/alert_box_bg_1.png',
),
fit: BoxFit.fill,
),
border: Border.all(
color: Colors.red,
width: 1.w
)
),
// backgroundAsset: alerts.any((item) => item.status.contains('待处理'))
// ? 'lib/assets/monitoring/alert_box_bg_2.png'
// : 'lib/assets/monitoring/alert_box_bg_1.png',
// padding: EdgeInsets.symmetric(horizontal: 24.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: double.infinity,
height: 100.h,
decoration: BoxDecoration(
border: Border.all(
color: Colors.red,
width: 1.w
)
Text(
'告警信息',
style: TextStyle(
color: Colors.white,
fontSize: 20.sp,
fontWeight: FontWeight.bold,
),
),
SizedBox(height: 12.h),
Expanded(
child: _buildEmpty()// alerts.isEmpty ? _buildEmpty() : _buildList(),
child: alerts.isEmpty ? _buildEmpty() : _buildList(),
),
],
),
);
}
Widget _buildEmpty() {
return Center(
child: Text(
......@@ -63,44 +56,103 @@ class MonitoringAlertCard extends StatelessWidget {
Widget _buildList() {
return ListView.separated(
padding: EdgeInsets.zero,
padding: EdgeInsets.symmetric(vertical: 6.h),
itemCount: alerts.length,
separatorBuilder: (_, __) => SizedBox(height: 12.h),
separatorBuilder: (_, __) => SizedBox(height: 16.h),
itemBuilder: (context, index) {
final item = alerts[index];
final pending = item.status.contains('待处理');
return Container(
height: 170.h,
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 14.h),
decoration: BoxDecoration(
border: Border.all(
width: 1.w,
color: Colors.red
)
// color: pending ? const Color(0x24FFB800) : const Color(0x1820E5FF),
// borderRadius: BorderRadius.circular(14.r),
// border: Border.all(
// color:
// pending ? const Color(0x99FFB800) : const Color(0x6639D8FF),
// width: 1,
// ),
),
return _buildAlertItem(item, pending);
},
);
}
Widget _buildAlertItem(AlertInfoBO item, bool pending) {
return IntrinsicHeight(
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_buildIconBlock(pending),
SizedBox(width: 20.w),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
item.title,
style: TextStyle(
color: pending ? const Color(0xFFF26522) : const Color(0xFFFFC14A),
fontSize: 16.sp,
fontWeight: FontWeight.bold,
),
),
SizedBox(height: 10.h),
Text(
item.description,
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Colors.white,
fontSize: 20.sp,
fontWeight: FontWeight.bold
fontSize: 12.sp,
),
),
// SizedBox(height: 10.h),
Text(
item.time,
style: TextStyle(
color: Colors.white,
fontSize: 12.sp,
),
),
],
),
),
],
),
);
},
}
Widget _buildIconBlock(bool pending) {
return Container(
width: 100.w,
height: 160.h,
alignment: Alignment.topLeft,
child: Stack(
children: [
Container(
// width: 160.w,
// height: 160.h,
decoration: BoxDecoration(
color: const Color(0xFF2A2E3B),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(18.r),
topRight: Radius.circular(18.r),
bottomLeft: Radius.circular(18.r),
bottomRight: Radius.circular(18.r),
),
),
),
Container(
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 6.h),
decoration: BoxDecoration(
color: pending ? const Color(0xFFFBB03B) : const Color(0xFF6FA8DC),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(18.r),
bottomRight: Radius.circular(18.r),
),
),
child: Text(
pending ? '待处理' : '已处理',
style: TextStyle(
color: Colors.white,
fontSize: 12.sp,
// fontWeight: FontWeight.bold,
),
),
),
],
),
);
}
}
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_switch/flutter_switch.dart';
import 'package:laki_icu_app/models/bo/monitoring_bo.dart';
import 'monitoring_panel.dart';
......@@ -7,9 +8,17 @@ import 'monitoring_panel.dart';
class MonitoringMetricCard extends StatelessWidget {
final MonitoringMetricBO metric;
/// 开关状态
final bool switchValue;
/// 开关切换回调
final ValueChanged<bool>? onSwitchToggle;
const MonitoringMetricCard({
super.key,
required this.metric,
this.switchValue = false,
this.onSwitchToggle,
});
@override
......@@ -32,7 +41,7 @@ class MonitoringMetricCard extends StatelessWidget {
SizedBox(width: 20.w),
Expanded(
flex: 2,
flex: 3,
child: Text(
displayLabel,
maxLines: 1,
......@@ -45,15 +54,18 @@ class MonitoringMetricCard extends StatelessWidget {
),
),
Expanded(
flex: 1,
child: Text(
"开关",
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Colors.white,
fontSize: 19.sp,
fontWeight: FontWeight.w600,
flex: 2,
child: Align(
alignment: Alignment.topLeft,
child: FlutterSwitch(
width: 30.w,
height: 30.h,
value: switchValue,
onToggle: onSwitchToggle ?? (_) {},
activeColor: const Color(0xFF75C1DD),
inactiveColor: Color(0xFF0A1B34),
toggleSize: 12.w,
padding: 2.w,
),
),
),
......@@ -95,10 +107,10 @@ class MonitoringMetricCard extends StatelessWidget {
width: 100.w,
margin: EdgeInsets.only(left: 20.w),
decoration: BoxDecoration(
border: Border.all(
color: Colors.red,
width: 1.w
)
// border: Border.all(
// color: Colors.red,
// width: 1.w
// )
),
child: Stack(
clipBehavior: Clip.none,
......
......@@ -11,10 +11,10 @@ class MonitoringVideoCard extends StatelessWidget {
return Container(
decoration: BoxDecoration(
image: DecorationImage(image: AssetImage('lib/assets/monitoring/box_bg_674x509.png'),fit: BoxFit.fill),
border: Border.all(
color: Colors.red,
width: 1.w
)
// border: Border.all(
// color: Colors.red,
// width: 1.w
// )
),
child: Stack(
children: [
......
......@@ -66,13 +66,13 @@ class VideoPlayerWidget extends StatelessWidget {
Widget build(BuildContext context) {
return ClipRRect(
child: Container(
padding: EdgeInsets.only(top: 15.h,bottom: 35.h,left: 18.w,right: 18.w),
padding: EdgeInsets.only(top: 15.h,bottom: 35.h,left: 10.w,right: 15.w),
decoration: BoxDecoration(
image: const DecorationImage(
image: AssetImage('lib/assets/monitoring/box_bg_674x509.png'),
image: AssetImage('lib/assets/monitoring/box_border.png'),
fit: BoxFit.fill,
),
border: Border.all(color: Colors.red, width: 1),
// border: Border.all(color: Colors.red, width: 1),
),
child: Stack(
fit: StackFit.expand,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment