This commit is contained in:
18631081161 2025-09-22 19:57:10 +08:00
parent 971d120ac5
commit 6fd6403bdb
4 changed files with 112 additions and 106 deletions

BIN
android/app/talk.jks Normal file

Binary file not shown.

View File

@ -1,6 +1,8 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart';
import '../network/NetworkConfig.dart';
class AddNoteDialog extends StatefulWidget { class AddNoteDialog extends StatefulWidget {
Function onTap; Function onTap;
@ -20,10 +22,18 @@ class _AddNoteDialogState extends State<AddNoteDialog> {
final TextEditingController _portNumber2Controller = TextEditingController(); final TextEditingController _portNumber2Controller = TextEditingController();
final TextEditingController _portNumber3Controller = TextEditingController(); final TextEditingController _portNumber3Controller = TextEditingController();
// final List<String> items2 = ['电视', '光缆', '大会员', '电信', '联通'];
String selectedValue = "";
String selectedValue2 = "";
@override @override
void initState() { void initState() {
// TODO: implement initState // TODO: implement initState
super.initState(); super.initState();
selectedValue = NetworkConfig.diverItems.first;
selectedValue2 = NetworkConfig.businessItems.first;
} }
@override @override
@ -47,7 +57,8 @@ class _AddNoteDialogState extends State<AddNoteDialog> {
return; 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); Navigator.pop(context);
} }
@ -106,7 +117,89 @@ class _AddNoteDialogState extends State<AddNoteDialog> {
), ),
), ),
/// ///
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<String>(
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<DropdownMenuItem<String>>((String value) {
return DropdownMenuItem<String>(
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<String>(
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<DropdownMenuItem<String>>((String value) {
return DropdownMenuItem<String>(
value: value,
child: Text(
value,
style: const TextStyle(fontSize: 12, fontWeight: FontWeight.w400),
),
);
}).toList(),
),
),
///
Container( Container(
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
margin: EdgeInsets.all(10), margin: EdgeInsets.all(10),

View File

@ -42,8 +42,10 @@ class _ModifyInfoDialogState extends State<ModifyInfoDialog> {
bool isConnect = false; bool isConnect = false;
bool isLoad = false; bool isLoad = false;
String equipmentModel = ""; String businessName = "";
String deviceModel = "";
String businessType = ""; String businessType = "";
String portNumber = "";
// //
late List<TextEditingController> _controllers; late List<TextEditingController> _controllers;
@ -84,8 +86,6 @@ class _ModifyInfoDialogState extends State<ModifyInfoDialog> {
// TODO: implement initState // TODO: implement initState
super.initState(); super.initState();
equipmentModel = NetworkConfig.diverItems.first;
businessType = NetworkConfig.businessItems.first;
subscription = _viewmodel.streamController.stream.listen((event) { subscription = _viewmodel.streamController.stream.listen((event) {
String code = event['code']; String code = event['code'];
@ -115,14 +115,6 @@ class _ModifyInfoDialogState extends State<ModifyInfoDialog> {
(index) => TextEditingController(text: odfDetailsBean.historyFault![index].faultReason), (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; break;
case "save": // case "save": //
@ -163,13 +155,12 @@ class _ModifyInfoDialogState extends State<ModifyInfoDialog> {
} }
if (_items.isNotEmpty) { if (_items.isNotEmpty) {
// every()faultTime是否为空
bool allFaultTimeEmpty = _items.every((bean) { bool allFaultTimeEmpty = _items.every((bean) {
// faultTime为null或空字符串 // faultTime是否不为null且不是空字符串
return bean.faultTime == null || bean.faultTime!.trim().isEmpty; return bean.faultTime != null && bean.faultTime!.trim().isNotEmpty;
}); });
if (allFaultTimeEmpty) { if (!allFaultTimeEmpty) {
EasyLoading.showToast("请选择障碍发生时间!"); EasyLoading.showToast("请选择障碍发生时间!");
return; return;
} }
@ -177,7 +168,7 @@ class _ModifyInfoDialogState extends State<ModifyInfoDialog> {
EasyLoading.show(status: "loading..."); EasyLoading.show(status: "loading...");
_viewmodel.save(widget.id, isConnect ? 1 : 0, _remarksController.text, _opticalAttenuationController.text, _historyRemarksController.text, _items, _viewmodel.save(widget.id, isConnect ? 1 : 0, _remarksController.text, _opticalAttenuationController.text, _historyRemarksController.text, _items,
_opticalCableOffRemarksController.text, equipmentModel, businessType); _opticalCableOffRemarksController.text);
} }
@override @override
@ -219,9 +210,15 @@ class _ModifyInfoDialogState extends State<ModifyInfoDialog> {
FunctionUtil.popDialog2( FunctionUtil.popDialog2(
context, context,
AddNoteDialog( AddNoteDialog(
onTap: (value1, value2) { onTap: (value1, value2, value3, value4) {
print("$value1-$value2-"); print("$value1-$value2-$value3-$value4");
appendTextWithNewline("$value1 $value2");
appendTextWithNewline("$value1 $value2 $value3 $value4");
businessName = value1;
deviceModel = value2;
businessType = value3;
portNumber = value4;
setState(() {}); setState(() {});
}, },
), ),
@ -357,88 +354,6 @@ class _ModifyInfoDialogState extends State<ModifyInfoDialog> {
), ),
), ),
///
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<String>(
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<DropdownMenuItem<String>>((String value) {
return DropdownMenuItem<String>(
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<String>(
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<DropdownMenuItem<String>>((String value) {
return DropdownMenuItem<String>(
value: value,
child: Text(
value,
style: const TextStyle(fontSize: 12, fontWeight: FontWeight.w400),
),
);
}).toList(),
),
),
Container( Container(
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
margin: EdgeInsets.all(10), margin: EdgeInsets.all(10),

View File

@ -103,7 +103,7 @@ class MachineModel {
} }
/// ///
Future<void> save(id, status, remarks, opticalAttenuation, historyRemarks, historyFault, opticalCableOffRemarks,equipmentModel,businessType) async { Future<void> save(id, status, remarks, opticalAttenuation, historyRemarks, historyFault, opticalCableOffRemarks) async {
RequestCenter.instance.request(NetworkConfig.save, { RequestCenter.instance.request(NetworkConfig.save, {
"Id": id, "Id": id,
"Status": status, "Status": status,
@ -112,8 +112,6 @@ class MachineModel {
"HistoryRemarks": historyRemarks, "HistoryRemarks": historyRemarks,
"HistoryFault": historyFault, "HistoryFault": historyFault,
"OpticalCableOffRemarks": opticalCableOffRemarks, "OpticalCableOffRemarks": opticalCableOffRemarks,
"EquipmentModel": equipmentModel,
"BusinessType": businessType,
}, (dataEntity) { }, (dataEntity) {
if (dataEntity.code == 200) { if (dataEntity.code == 200) {
// OdfDetailsBean odfDetailsBean = OdfDetailsBean.fromJson(dataEntity.data); // OdfDetailsBean odfDetailsBean = OdfDetailsBean.fromJson(dataEntity.data);