From 6fd6403bdbc170e394d42556c8dd7f2ccdcdd66f Mon Sep 17 00:00:00 2001 From: 18631081161 <2088094923@qq.com> Date: Mon, 22 Sep 2025 19:57:10 +0800 Subject: [PATCH] . --- android/app/talk.jks | Bin 0 -> 2692 bytes lib/dialog/add_note_dialog.dart | 97 +++++++++++++++++++++- lib/dialog/modify_info_dialog.dart | 117 ++++----------------------- lib/tools/machine/machine_model.dart | 4 +- 4 files changed, 112 insertions(+), 106 deletions(-) create mode 100644 android/app/talk.jks diff --git a/android/app/talk.jks b/android/app/talk.jks new file mode 100644 index 0000000000000000000000000000000000000000..f8049892893a1cdb66223ff3bcc28e4b7bc3b0c6 GIT binary patch literal 2692 zcma);X*d*&7RSvnqcO-b*|M9GeP--ycB7D`vS&uNgzU|W#DwgOELjpU%DyzVWGsU$ z^M*u<7m=~c7FptTpL?I)=YG2P!~Z$Y`Tx&3AAiq5;F%(T0D1(TNfHc^j6uiju>cqW z1$d_O40tB)Q=1ck2bKL-1j=Q=gR)NTC#OmQL;thI%me@y;6d7_rUt_8_XdasVT(}t zr)5S+F~9E?w=t^^$ zFu-)_lBaufc#Ww|3qf&>NF-@TfA)_5p>x7t67qCPMKMl`b5Cwb9*qg}omU;WEBV1S zo>t}h#^MV)s7M~duTjTL^d9<48O`sa?ayaldnjyZ^q@#0QQWb7OH|+UtJ@g(rB-%{ zz1XVL=)6b0dL-=6k#e^!R=X#e+bxES;un(SN<-c*brIlR&1(q)b=g;jF7)Kg1Q@L? z>}~{L9t$NS-lu|BMPVWLtb zB`;Alu2s&eGB@@Ise=EE$RmFC5yzZ6TdMwmuY>|iVQ#<6pA{Xune8QYbx@u`oVl24 zQNoWb%%1QQgdY6CM;_KvUBqx-jmZ5@ z%~c4mdt+x?+)hZ^)b?wiVsl>64&i4SVvM3I5GBYmz+?KTtFqBjc~XCjiGDLNY{(DLQpC8TR>>7jLAp6qj zaBX;D$Yj!;wEb+uRH^20MtNlqEi!qFsnzWy)p|{(lvFR;Apx#{7W)HE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og.dart +++ b/lib/dialog/add_note_dialog.dart @@ -1,6 +1,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart'; +import '../network/NetworkConfig.dart'; + class AddNoteDialog extends StatefulWidget { Function onTap; @@ -20,10 +22,18 @@ class _AddNoteDialogState extends State { final TextEditingController _portNumber2Controller = TextEditingController(); final TextEditingController _portNumber3Controller = TextEditingController(); + // final List items2 = ['电视', '光缆', '大会员', '电信', '联通']; + + String selectedValue = ""; + String selectedValue2 = ""; + @override void initState() { // TODO: implement initState super.initState(); + + selectedValue = NetworkConfig.diverItems.first; + selectedValue2 = NetworkConfig.businessItems.first; } @override @@ -47,7 +57,8 @@ class _AddNoteDialogState extends State { return; } - widget.onTap(_businessNameController.text, "${_portNumber1Controller.text}/${_portNumber2Controller.text}/${_portNumber3Controller.text}"); + widget.onTap(_businessNameController.text, selectedValue, selectedValue2, + "${_portNumber1Controller.text}/${_portNumber2Controller.text}/${_portNumber3Controller.text}"); Navigator.pop(context); } @@ -106,7 +117,89 @@ class _AddNoteDialogState extends State { ), ), - ///端口号数 + ///设备型号 + Container( + alignment: Alignment.centerLeft, + margin: EdgeInsets.all(10), + child: Text( + "设备型号", + style: TextStyle(fontSize: 12), + ), + ), + Container( + margin: EdgeInsets.only(left: 10, right: 10), + padding: EdgeInsets.symmetric(horizontal: 5), + height: 35, + alignment: Alignment.center, + decoration: BoxDecoration(color: Color(0xFFEBEBEB), borderRadius: BorderRadius.all(Radius.circular(7))), + child: DropdownButton( + value: selectedValue, + // 当前选中的值 + icon: const Icon(Icons.arrow_drop_down, color: Colors.blue), + hint: const Text('请选择设备型号'), + underline: Container(), + isExpanded: true, + dropdownColor: const Color(0xFFEBEBEB), + onChanged: (String? newValue) { + // 当选择改变时,更新状态 + setState(() { + selectedValue = newValue!; + }); + }, + items: NetworkConfig.diverItems.map>((String value) { + return DropdownMenuItem( + value: value, + child: Text( + value, + style: const TextStyle(fontSize: 12, fontWeight: FontWeight.w400), + ), + ); + }).toList(), + ), + ), + + /// + Container( + alignment: Alignment.centerLeft, + margin: EdgeInsets.all(10), + child: Text( + "业务类型", + style: TextStyle(fontSize: 12), + ), + ), + Container( + margin: EdgeInsets.only(left: 10, right: 10), + padding: EdgeInsets.symmetric(horizontal: 5), + height: 35, + alignment: Alignment.center, + decoration: BoxDecoration(color: Color(0xFFEBEBEB), borderRadius: BorderRadius.all(Radius.circular(7))), + child: DropdownButton( + value: selectedValue2, + // 当前选中的值 + icon: const Icon(Icons.arrow_drop_down, color: Colors.blue), + hint: const Text('请选择业务类型'), + underline: Container(), + isExpanded: true, + dropdownColor: const Color(0xFFEBEBEB), + onChanged: (String? newValue) { + // 当选择改变时,更新状态 + setState(() { + selectedValue2 = newValue!; + }); + }, + items: NetworkConfig.businessItems.map>((String value) { + return DropdownMenuItem( + value: value, + child: Text( + value, + style: const TextStyle(fontSize: 12, fontWeight: FontWeight.w400), + ), + ); + }).toList(), + ), + ), + + /// Container( alignment: Alignment.centerLeft, margin: EdgeInsets.all(10), diff --git a/lib/dialog/modify_info_dialog.dart b/lib/dialog/modify_info_dialog.dart index 5ee9eae..a5d2b6f 100644 --- a/lib/dialog/modify_info_dialog.dart +++ b/lib/dialog/modify_info_dialog.dart @@ -42,8 +42,10 @@ class _ModifyInfoDialogState extends State { bool isConnect = false; bool isLoad = false; - String equipmentModel = ""; + String businessName = ""; + String deviceModel = ""; String businessType = ""; + String portNumber = ""; // 用列表存储所有输入框的值,通过索引区分不同输入框 late List _controllers; @@ -84,8 +86,6 @@ class _ModifyInfoDialogState extends State { // TODO: implement initState super.initState(); - equipmentModel = NetworkConfig.diverItems.first; - businessType = NetworkConfig.businessItems.first; subscription = _viewmodel.streamController.stream.listen((event) { String code = event['code']; @@ -115,14 +115,6 @@ class _ModifyInfoDialogState extends State { (index) => TextEditingController(text: odfDetailsBean.historyFault![index].faultReason), ); - if ("${odfDetailsBean.equipmentModel}" == "null" && "${odfDetailsBean.equipmentModel}" == "") { - equipmentModel = "${odfDetailsBean.equipmentModel}"; - } - - if ("${odfDetailsBean.businessType}" != "null" && "${odfDetailsBean.businessType}" != "") { - businessType = "${odfDetailsBean.businessType}"; - } - break; case "save": //保存信息 @@ -163,13 +155,12 @@ class _ModifyInfoDialogState extends State { } if (_items.isNotEmpty) { - // every()检查所有元素的faultTime是否为空 bool allFaultTimeEmpty = _items.every((bean) { - // 判断faultTime为null或空字符串 - return bean.faultTime == null || bean.faultTime!.trim().isEmpty; + // 检查faultTime是否不为null且不是空字符串(去除空格后) + return bean.faultTime != null && bean.faultTime!.trim().isNotEmpty; }); - if (allFaultTimeEmpty) { + if (!allFaultTimeEmpty) { EasyLoading.showToast("请选择障碍发生时间!"); return; } @@ -177,7 +168,7 @@ class _ModifyInfoDialogState extends State { EasyLoading.show(status: "loading..."); _viewmodel.save(widget.id, isConnect ? 1 : 0, _remarksController.text, _opticalAttenuationController.text, _historyRemarksController.text, _items, - _opticalCableOffRemarksController.text, equipmentModel, businessType); + _opticalCableOffRemarksController.text); } @override @@ -219,9 +210,15 @@ class _ModifyInfoDialogState extends State { FunctionUtil.popDialog2( context, AddNoteDialog( - onTap: (value1, value2) { - print("$value1-$value2-"); - appendTextWithNewline("$value1 $value2"); + onTap: (value1, value2, value3, value4) { + print("$value1-$value2-$value3-$value4"); + + appendTextWithNewline("$value1 $value2 $value3 $value4"); + + businessName = value1; + deviceModel = value2; + businessType = value3; + portNumber = value4; setState(() {}); }, ), @@ -357,88 +354,6 @@ class _ModifyInfoDialogState extends State { ), ), - ///设备型号 - Container( - alignment: Alignment.centerLeft, - margin: EdgeInsets.all(10), - child: Text( - "设备型号", - style: TextStyle(fontSize: 12), - ), - ), - Container( - margin: EdgeInsets.only(left: 10, right: 10), - padding: EdgeInsets.symmetric(horizontal: 5), - height: 35, - alignment: Alignment.center, - decoration: BoxDecoration(color: Color(0xFFEBEBEB), borderRadius: BorderRadius.all(Radius.circular(7))), - child: DropdownButton( - value: equipmentModel, - // 当前选中的值 - icon: const Icon(Icons.arrow_drop_down, color: Colors.blue), - hint: const Text('请选择设备型号'), - underline: Container(), - isExpanded: true, - dropdownColor: const Color(0xFFEBEBEB), - onChanged: (String? newValue) { - // 当选择改变时,更新状态 - setState(() { - equipmentModel = newValue!; - }); - }, - items: NetworkConfig.diverItems.map>((String value) { - return DropdownMenuItem( - value: value, - child: Text( - value, - style: const TextStyle(fontSize: 12, fontWeight: FontWeight.w400), - ), - ); - }).toList(), - ), - ), - - ///业务类型 - Container( - alignment: Alignment.centerLeft, - margin: EdgeInsets.all(10), - child: Text( - "业务类型", - style: TextStyle(fontSize: 12), - ), - ), - Container( - margin: EdgeInsets.only(left: 10, right: 10), - padding: EdgeInsets.symmetric(horizontal: 5), - height: 35, - alignment: Alignment.center, - decoration: BoxDecoration(color: Color(0xFFEBEBEB), borderRadius: BorderRadius.all(Radius.circular(7))), - child: DropdownButton( - value: businessType, - // 当前选中的值 - icon: const Icon(Icons.arrow_drop_down, color: Colors.blue), - hint: const Text('请选择业务类型'), - underline: Container(), - isExpanded: true, - dropdownColor: const Color(0xFFEBEBEB), - onChanged: (String? newValue) { - // 当选择改变时,更新状态 - setState(() { - businessType = newValue!; - }); - }, - items: NetworkConfig.businessItems.map>((String value) { - return DropdownMenuItem( - value: value, - child: Text( - value, - style: const TextStyle(fontSize: 12, fontWeight: FontWeight.w400), - ), - ); - }).toList(), - ), - ), - Container( alignment: Alignment.centerLeft, margin: EdgeInsets.all(10), diff --git a/lib/tools/machine/machine_model.dart b/lib/tools/machine/machine_model.dart index b97a4c3..48a2f17 100644 --- a/lib/tools/machine/machine_model.dart +++ b/lib/tools/machine/machine_model.dart @@ -103,7 +103,7 @@ class MachineModel { } ///机架接口信息保存 - Future save(id, status, remarks, opticalAttenuation, historyRemarks, historyFault, opticalCableOffRemarks,equipmentModel,businessType) async { + Future save(id, status, remarks, opticalAttenuation, historyRemarks, historyFault, opticalCableOffRemarks) async { RequestCenter.instance.request(NetworkConfig.save, { "Id": id, "Status": status, @@ -112,8 +112,6 @@ class MachineModel { "HistoryRemarks": historyRemarks, "HistoryFault": historyFault, "OpticalCableOffRemarks": opticalCableOffRemarks, - "EquipmentModel": equipmentModel, - "BusinessType": businessType, }, (dataEntity) { if (dataEntity.code == 200) { // OdfDetailsBean odfDetailsBean = OdfDetailsBean.fromJson(dataEntity.data);