|
@@ -1,5 +1,7 @@
|
|
|
+import 'package:ecg_list_view/rpc/rpc_bridge.dart';
|
|
|
import 'package:flutter/foundation.dart';
|
|
|
import 'package:flutter/material.dart';
|
|
|
+import 'package:flutter_easyloading/flutter_easyloading.dart';
|
|
|
import 'package:get/get.dart';
|
|
|
import 'package:fis_jsonrpc/rpc.dart';
|
|
|
import 'index.dart';
|
|
@@ -39,7 +41,7 @@ class EcgListPage extends GetView<EcgListController> {
|
|
|
Container(
|
|
|
margin: const EdgeInsets.all(5),
|
|
|
height: 50,
|
|
|
- child: _buildHeader(),
|
|
|
+ child: _buildHeader(context),
|
|
|
),
|
|
|
Expanded(child: _buildListView())
|
|
|
],
|
|
@@ -77,7 +79,7 @@ class EcgListPage extends GetView<EcgListController> {
|
|
|
);
|
|
|
}
|
|
|
|
|
|
- Widget _buildHeader() {
|
|
|
+ Widget _buildHeader(BuildContext context) {
|
|
|
return Row(
|
|
|
children: [
|
|
|
Expanded(
|
|
@@ -127,29 +129,39 @@ class EcgListPage extends GetView<EcgListController> {
|
|
|
title: "已完成",
|
|
|
value: RecordProcessStateEnum.Done,
|
|
|
),
|
|
|
- IconButton(
|
|
|
- onPressed: () {
|
|
|
- Get.dialog(CreateExam(
|
|
|
- onConfirm: () {
|
|
|
- controller.getDatas();
|
|
|
+ if (controller.userFeatures.any((e) => e.code == "RECGCZQX"))
|
|
|
+ GestureDetector(
|
|
|
+ onTap: () {
|
|
|
+ Get.dialog(CreateExam(
|
|
|
+ onConfirm: () {
|
|
|
+ controller.getDatas();
|
|
|
+ },
|
|
|
+ ));
|
|
|
},
|
|
|
- ));
|
|
|
- },
|
|
|
- icon: Row(
|
|
|
- children: const [
|
|
|
- Icon(
|
|
|
- Icons.add,
|
|
|
- color: Colors.blue,
|
|
|
- size: 24,
|
|
|
- ),
|
|
|
- if (kIsWeb)
|
|
|
- Text(
|
|
|
- "新增",
|
|
|
- style: TextStyle(fontSize: 20),
|
|
|
- )
|
|
|
- ],
|
|
|
- ),
|
|
|
- )
|
|
|
+ child: Container(
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ color: Theme.of(context).primaryColor,
|
|
|
+ borderRadius: BorderRadius.circular(8),
|
|
|
+ ),
|
|
|
+ child: Row(
|
|
|
+ children: const [
|
|
|
+ Icon(
|
|
|
+ Icons.add,
|
|
|
+ color: Colors.white,
|
|
|
+ size: 24,
|
|
|
+ ),
|
|
|
+ if (kIsWeb) ...[
|
|
|
+ Text(
|
|
|
+ "新增",
|
|
|
+ style: TextStyle(fontSize: 20, color: Colors.white),
|
|
|
+ ),
|
|
|
+ SizedBox(
|
|
|
+ width: 5,
|
|
|
+ )
|
|
|
+ ]
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ ))
|
|
|
],
|
|
|
);
|
|
|
}
|
|
@@ -388,6 +400,33 @@ class EcgListPage extends GetView<EcgListController> {
|
|
|
child: const Text("检查"),
|
|
|
),
|
|
|
),
|
|
|
+ if (controller.userFeatures.any((e) => e.code == "RECGCZQX")) ...[
|
|
|
+ const SizedBox(
|
|
|
+ width: 15,
|
|
|
+ ),
|
|
|
+ SizedBox(
|
|
|
+ width: 120,
|
|
|
+ child: ElevatedButton(
|
|
|
+ onPressed: () async {
|
|
|
+ ElectrocardiogramRecord examRecord =
|
|
|
+ controller.residentList[controller.currectSelected];
|
|
|
+ bool result = await RPCBridge.ins.rpc.vitalElectrocardiogram
|
|
|
+ .removeElectrocardiogramAsync(
|
|
|
+ GetElectrocardiogramRecordRequest(
|
|
|
+ token: RPCBridge.ins.token,
|
|
|
+ code: examRecord.code,
|
|
|
+ ),
|
|
|
+ );
|
|
|
+ if (result) {
|
|
|
+ EasyLoading.showToast("删除成功");
|
|
|
+ controller.getDatas();
|
|
|
+ controller.loadReports();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ child: const Text("删除记录"),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
],
|
|
|
);
|
|
|
}
|