.
This commit is contained in:
parent
971d120ac5
commit
6fd6403bdb
BIN
android/app/talk.jks
Normal file
BIN
android/app/talk.jks
Normal file
Binary file not shown.
|
|
@ -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<AddNoteDialog> {
|
|||
final TextEditingController _portNumber2Controller = TextEditingController();
|
||||
final TextEditingController _portNumber3Controller = TextEditingController();
|
||||
|
||||
// final List<String> 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<AddNoteDialog> {
|
|||
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<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(
|
||||
alignment: Alignment.centerLeft,
|
||||
margin: EdgeInsets.all(10),
|
||||
|
|
|
|||
|
|
@ -42,8 +42,10 @@ class _ModifyInfoDialogState extends State<ModifyInfoDialog> {
|
|||
bool isConnect = false;
|
||||
bool isLoad = false;
|
||||
|
||||
String equipmentModel = "";
|
||||
String businessName = "";
|
||||
String deviceModel = "";
|
||||
String businessType = "";
|
||||
String portNumber = "";
|
||||
|
||||
// 用列表存储所有输入框的值,通过索引区分不同输入框
|
||||
late List<TextEditingController> _controllers;
|
||||
|
|
@ -84,8 +86,6 @@ class _ModifyInfoDialogState extends State<ModifyInfoDialog> {
|
|||
// 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<ModifyInfoDialog> {
|
|||
(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<ModifyInfoDialog> {
|
|||
}
|
||||
|
||||
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<ModifyInfoDialog> {
|
|||
|
||||
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<ModifyInfoDialog> {
|
|||
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<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(
|
||||
alignment: Alignment.centerLeft,
|
||||
margin: EdgeInsets.all(10),
|
||||
|
|
|
|||
|
|
@ -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, {
|
||||
"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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user