。。。。

main
hs 2025-09-17 14:38:05 +08:00
parent dbfc4a3ec4
commit 2b6328e742
55 changed files with 247 additions and 275 deletions

View File

@ -1,3 +1,4 @@
// <your_file_name>.dart
import 'dart:async'; import 'dart:async';
import 'dart:io'; import 'dart:io';
import 'package:device_info_plus/device_info_plus.dart'; import 'package:device_info_plus/device_info_plus.dart';
@ -66,12 +67,13 @@ bool _isNetworkPath(String? p) {
} }
/// File /// File
/// ****访existsSync build()
List<File> _localFilesFromPaths(List<String>? paths) { List<File> _localFilesFromPaths(List<String>? paths) {
if (paths == null) return <File>[]; if (paths == null) return <File>[];
return paths return paths
.map((e) => (e ?? '').toString().trim()) .map((e) => (e ?? '').toString().trim())
.where((s) => s.isNotEmpty && !_isNetworkPath(s)) .where((s) => s.isNotEmpty && !_isNetworkPath(s))
.where((s) => File(s).existsSync()) // .where((s) => File(s).existsSync())
.map((s) => File(s)) .map((s) => File(s))
.toList(); .toList();
} }
@ -82,7 +84,6 @@ List<String> _normalizePaths(List<String>? src) {
return src.map((e) => (e ?? '').toString().trim()).where((s) => s.isNotEmpty).toList(); return src.map((e) => (e ?? '').toString().trim()).where((s) => s.isNotEmpty).toList();
} }
/// ---------- MediaPickerRow ----------
/// ---------- MediaPickerRow ---------- /// ---------- MediaPickerRow ----------
class MediaPickerRow extends StatefulWidget { class MediaPickerRow extends StatefulWidget {
final int maxCount; final int maxCount;
@ -120,12 +121,29 @@ class _MediaPickerGridState extends State<MediaPickerRow> {
late List<String> _mediaPaths; late List<String> _mediaPaths;
bool _isProcessing = false; bool _isProcessing = false;
/// build IO
final Map<String, bool> _localExistsCache = {};
@override @override
void initState() { void initState() {
super.initState(); super.initState();
// //
_mediaPaths = _normalizePaths(widget.initialMediaPaths).take(widget.maxCount).toList(); _mediaPaths = _normalizePaths(widget.initialMediaPaths).take(widget.maxCount).toList();
// init
for (final pth in _mediaPaths) {
final t = pth.trim();
if (!_isNetworkPath(t)) {
try {
_localExistsCache[t] = File(t).existsSync();
} catch (_) {
_localExistsCache[t] = false;
}
} else {
_localExistsCache[pth] = false;
}
}
// File // File
final initialLocalFiles = _localFilesFromPaths(_mediaPaths); final initialLocalFiles = _localFilesFromPaths(_mediaPaths);
if (initialLocalFiles.isNotEmpty) { if (initialLocalFiles.isNotEmpty) {
@ -145,6 +163,23 @@ class _MediaPickerGridState extends State<MediaPickerRow> {
if (!listEquals(oldList, newList)) { if (!listEquals(oldList, newList)) {
_mediaPaths = newList.take(widget.maxCount).toList(); _mediaPaths = newList.take(widget.maxCount).toList();
//
for (final pth in _mediaPaths) {
final t = pth.trim();
if (!_localExistsCache.containsKey(t)) {
if (!_isNetworkPath(t)) {
try {
_localExistsCache[t] = File(t).existsSync();
} catch (_) {
_localExistsCache[t] = false;
}
} else {
_localExistsCache[t] = false;
}
}
}
if (mounted) setState(() {}); if (mounted) setState(() {});
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
widget.onChanged(_localFilesFromPaths(_mediaPaths)); widget.onChanged(_localFilesFromPaths(_mediaPaths));
@ -190,6 +225,18 @@ class _MediaPickerGridState extends State<MediaPickerRow> {
if (_mediaPaths.length < widget.maxCount) { if (_mediaPaths.length < widget.maxCount) {
setState(() => _mediaPaths.add(finalPath)); setState(() => _mediaPaths.add(finalPath));
//
if (!_isNetworkPath(finalPath)) {
try {
_localExistsCache[finalPath] = File(finalPath).existsSync();
} catch (_) {
_localExistsCache[finalPath] = false;
}
} else {
_localExistsCache[finalPath] = false;
}
// //
widget.onChanged(_localFilesFromPaths(_mediaPaths)); widget.onChanged(_localFilesFromPaths(_mediaPaths));
widget.onMediaAdded?.call(finalPath); widget.onMediaAdded?.call(finalPath);
@ -248,6 +295,14 @@ class _MediaPickerGridState extends State<MediaPickerRow> {
if (picked != null) { if (picked != null) {
final path = picked.path; final path = picked.path;
setState(() => _mediaPaths.add(path)); setState(() => _mediaPaths.add(path));
//
try {
_localExistsCache[path] = File(path).existsSync();
} catch (_) {
_localExistsCache[path] = false;
}
widget.onChanged(_localFilesFromPaths(_mediaPaths)); widget.onChanged(_localFilesFromPaths(_mediaPaths));
widget.onMediaAdded?.call(path); widget.onMediaAdded?.call(path);
} }
@ -394,6 +449,11 @@ class _MediaPickerGridState extends State<MediaPickerRow> {
if (picked != null) { if (picked != null) {
final path = picked.path; final path = picked.path;
setState(() => _mediaPaths.add(path)); setState(() => _mediaPaths.add(path));
try {
_localExistsCache[path] = File(path).existsSync();
} catch (_) {
_localExistsCache[path] = false;
}
widget.onChanged(_localFilesFromPaths(_mediaPaths)); widget.onChanged(_localFilesFromPaths(_mediaPaths));
widget.onMediaAdded?.call(path); widget.onMediaAdded?.call(path);
} }
@ -421,10 +481,12 @@ class _MediaPickerGridState extends State<MediaPickerRow> {
if (!ok) return; if (!ok) return;
final removed = _mediaPaths[index]; final removed = _mediaPaths[index];
final wasNetwork = _isNetworkPath(removed);
setState(() => _mediaPaths.removeAt(index)); setState(() => _mediaPaths.removeAt(index));
//
_localExistsCache.remove(removed);
// onMediaRemoved // onMediaRemoved
widget.onMediaRemoved?.call(removed); widget.onMediaRemoved?.call(removed);
@ -438,6 +500,10 @@ class _MediaPickerGridState extends State<MediaPickerRow> {
final showAddButton = widget.isEdit && _mediaPaths.length < widget.maxCount; final showAddButton = widget.isEdit && _mediaPaths.length < widget.maxCount;
final itemCount = _mediaPaths.length + (showAddButton ? 1 : 0); final itemCount = _mediaPaths.length + (showAddButton ? 1 : 0);
//
final tileLogicalW = (MediaQuery.of(context).size.width / 4).round();
final cacheWidth = (tileLogicalW * MediaQuery.of(context).devicePixelRatio).round();
return Stack( return Stack(
children: [ children: [
GridView.builder( GridView.builder(
@ -472,24 +538,27 @@ class _MediaPickerGridState extends State<MediaPickerRow> {
? Image.network( ? Image.network(
raw, raw,
fit: BoxFit.cover, fit: BoxFit.cover,
// request a scaled decode to reduce memory
width: tileLogicalW.toDouble(),
height: tileLogicalW.toDouble(),
// errorBuilder for network errors
errorBuilder: (_, __, ___) => Container( errorBuilder: (_, __, ___) => Container(
color: Colors.grey.shade200, color: Colors.grey.shade200,
child: const Center(child: Icon(Icons.broken_image)), child: const Center(child: Icon(Icons.broken_image)),
), ),
) )
: (File(raw).existsSync() : Image.file(
? Image.file(
File(raw), File(raw),
fit: BoxFit.cover, fit: BoxFit.cover,
width: tileLogicalW.toDouble(),
height: tileLogicalW.toDouble(),
// Use cacheWidth to ask the engine to decode a smaller bitmap (reduces memory).
cacheWidth: cacheWidth,
errorBuilder: (_, __, ___) => Container( errorBuilder: (_, __, ___) => Container(
color: Colors.grey.shade200, color: Colors.grey.shade200,
child: const Center(child: Icon(Icons.broken_image)), child: const Center(child: Icon(Icons.broken_image)),
), ),
) ))
: Container(
color: Colors.grey.shade200,
child: const Center(child: Icon(Icons.broken_image)),
)))
: Container( : Container(
color: Colors.black12, color: Colors.black12,
child: const Center( child: const Center(

View File

@ -563,7 +563,6 @@ class HomePageState extends State<HomePage> {
break; break;
} }
_onRefresh();
}, },
); );
}).toList(), }).toList(),

View File

@ -191,7 +191,6 @@ class _StudyDetailPageState extends State<StudyDetailPage>
debugPrint('_onVideoTap ignored because a video is loading'); debugPrint('_onVideoTap ignored because a video is loading');
return; return;
} }
// //
await ApiService.fnClearUserFaceTime(); await ApiService.fnClearUserFaceTime();
_faceTimer?.cancel(); _faceTimer?.cancel();
@ -214,7 +213,6 @@ class _StudyDetailPageState extends State<StudyDetailPage>
); );
} }
// //
try { try {
if (_videoController != null && _videoController!.value.isPlaying) { if (_videoController != null && _videoController!.value.isPlaying) {

View File

@ -68,7 +68,7 @@ class MeasuresListWidget extends StatelessWidget {
// //
double col0Fixed = 40; // double col0Fixed = 40; //
double col2Fixed = 60; // double col2Fixed = 80; //
double col3Fixed = 80; // double col3Fixed = 80; //
// 4isAllowEdit == true40 // 4isAllowEdit == true40
@ -420,7 +420,7 @@ class MeasuresListWidget extends StatelessWidget {
'$baseImgPath${rowPaths[i]}', '$baseImgPath${rowPaths[i]}',
width: imageSize, width: imageSize,
height: imageSize, height: imageSize,
fit: BoxFit.cover, fit: BoxFit.fill,
errorBuilder: errorBuilder:
(_, __, ___) => Container( (_, __, ___) => Container(
width: imageSize, width: imageSize,
@ -768,7 +768,7 @@ class SignaturesListWidget extends StatelessWidget {
fullUrl, fullUrl,
width: 50, width: 50,
height: 50, height: 50,
fit: BoxFit.cover, fit: BoxFit.fill,
errorBuilder: errorBuilder:
(ctx, err, st) => Container( (ctx, err, st) => Container(
width: 50, width: 50,
@ -1443,7 +1443,7 @@ class SignItemWidget extends StatelessWidget {
fullUrl, fullUrl,
width: smallThumbSize, width: smallThumbSize,
height: smallThumbSize, height: smallThumbSize,
fit: BoxFit.cover, fit: BoxFit.fill,
errorBuilder: errorBuilder:
(_, __, ___) => Container( (_, __, ___) => Container(
width: smallThumbSize, width: smallThumbSize,
@ -1897,7 +1897,7 @@ class SignRowImageTitle extends StatelessWidget {
fullUrl, fullUrl,
width: imageSize, width: imageSize,
height: imageSize, height: imageSize,
fit: BoxFit.cover, fit: BoxFit.fill,
errorBuilder: errorBuilder:
(_, __, ___) => Container( (_, __, ___) => Container(
width: imageSize, width: imageSize,

View File

@ -93,7 +93,6 @@ class _DangerousOptionsPageState extends State<DangerousOptionsPage> {
/// ///
Future<void> _onImageAdded(String localPath) async { Future<void> _onImageAdded(String localPath) async {
if (!mounted) return;
LoadingDialogHelper.show(); LoadingDialogHelper.show();
try { try {
@ -101,8 +100,6 @@ class _DangerousOptionsPageState extends State<DangerousOptionsPage> {
final res = await ApiService.uploadSaveFile(localPath).timeout(const Duration(seconds: 30)); final res = await ApiService.uploadSaveFile(localPath).timeout(const Duration(seconds: 30));
LoadingDialogHelper.hide(); LoadingDialogHelper.hide();
if (!mounted) return;
if (res['result'] == 'success') { if (res['result'] == 'success') {
final url = res['FILE_PATH'] as String; final url = res['FILE_PATH'] as String;
setState(() { setState(() {
@ -444,7 +441,6 @@ class _DangerousOptionsPageState extends State<DangerousOptionsPage> {
onChanged: (paths) {}, onChanged: (paths) {},
onMediaAdded: _onImageAdded, onMediaAdded: _onImageAdded,
onMediaRemoved: (path) { onMediaRemoved: (path) {
// localPath
try { try {
final item = imgList.firstWhere((e) => path.contains(e.localPath)); final item = imgList.firstWhere((e) => path.contains(e.localPath));
_onImageRemoved(item); _onImageRemoved(item);

View File

@ -371,7 +371,7 @@ class _HotworkSafeFuncSureState extends State<HotworkSafeFuncSure> {
], ],
), ),
ItemListWidget.singleLineTitleText( ItemListWidget.singleLineTitleText(
isNumericInput: true,
label: '其他安全措施:', label: '其他安全措施:',
isEditable: true, isEditable: true,
hintText: '请输入其他安全措施', hintText: '请输入其他安全措施',

View File

@ -132,11 +132,12 @@ class _HotworkAqglDetailState extends State<HotworkAqglDetail> {
String reasonText = ''; String reasonText = '';
String DESCR = _contentController.text.trim(); String DESCR = _contentController.text.trim();
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入负责人意见');
return;
}
if (status == '1') { if (status == '1') {
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入负责人意见');
return;
}
} else { } else {
reasonText = await CustomAlertDialog.showInput( reasonText = await CustomAlertDialog.showInput(
context, context,

View File

@ -134,11 +134,12 @@ class _HotworkDbbzDetailState extends State<HotworkDbbzDetail> {
String reasonText = ''; String reasonText = '';
String DESCR = _contentController.text.trim(); String DESCR = _contentController.text.trim();
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入负责人意见');
return;
}
if (status == '1') { if (status == '1') {
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入负责人意见');
return;
}
} else { } else {
reasonText = await CustomAlertDialog.showInput( reasonText = await CustomAlertDialog.showInput(
context, context,

View File

@ -132,11 +132,12 @@ class _HotworkDhspDetailState extends State<HotworkDhspDetail> {
String reasonText = ''; String reasonText = '';
String DESCR = _contentController.text.trim(); String DESCR = _contentController.text.trim();
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入负责人意见');
return;
}
if (status == '1') { if (status == '1') {
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入负责人意见');
return;
}
} else { } else {
reasonText = await CustomAlertDialog.showInput( reasonText = await CustomAlertDialog.showInput(
context, context,

View File

@ -161,82 +161,6 @@ class _HotworkSetSafeDetailState extends State<HotworkSetSafeDetail> {
).then((_) {}); ).then((_) {});
} }
///
Future<void> _sign() async {
await NativeOrientation.setLandscape();
final path = await Navigator.push(
context,
MaterialPageRoute(builder: (context) => MineSignPage()),
);
await NativeOrientation.setPortrait();
if (path != null) {
final now = DateFormat('yyyy-MM-dd HH:mm').format(DateTime.now());
setState(() {
imagePaths.add(path);
signTimes.add(now);
});
}
}
Widget _signListWidget() {
return Column(
children:
imagePaths.map((path) {
return Column(
children: [
const SizedBox(height: 10),
const Divider(),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
GestureDetector(
child: // ConstrainedBox BoxFit.contain
ConstrainedBox(
constraints: const BoxConstraints(
maxWidth: 200,
maxHeight: 150,
),
child: Image.file(
File(path),
//
fit: BoxFit.contain,
),
),
onTap: () {
presentOpaque(
SingleImageViewer(imageUrl: path),
context,
);
},
),
Column(
children: [
Container(
padding: const EdgeInsets.only(right: 5),
child: CustomButton(
text: 'X',
height: 30,
padding: const EdgeInsets.symmetric(horizontal: 10),
backgroundColor: Colors.red,
onPressed: () {
setState(() {
imagePaths.remove(path);
});
},
),
),
const SizedBox(height: 80),
],
),
],
),
],
);
}).toList(),
);
}
/// -1 1 /// -1 1
Future<void> _submit(String status) async { Future<void> _submit(String status) async {
List<Map<String, dynamic>> signers = []; List<Map<String, dynamic>> signers = [];

View File

@ -132,11 +132,11 @@ class _HotworkSzdwDetailState extends State<HotworkSzdwDetail> {
String reasonText = ''; String reasonText = '';
String DESCR = _contentController.text.trim(); String DESCR = _contentController.text.trim();
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入所在单位负责人意见');
return;
}
if (status == '1') { if (status == '1') {
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入所在单位负责人意见');
return;
}
} else { } else {
reasonText = await CustomAlertDialog.showInput( reasonText = await CustomAlertDialog.showInput(
context, context,

View File

@ -185,12 +185,12 @@ class _HotworkYsgdDetailState extends State<HotworkYsgdDetail> {
} }
String DESCR = _contentController.text.trim(); String DESCR = _contentController.text.trim();
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入负责人意见');
return;
}
String reasonText = ''; String reasonText = '';
if (status == '1') { if (status == '1') {
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入负责人意见');
return;
}
if (startTime.isEmpty) { if (startTime.isEmpty) {
ToastUtil.showNormal(context, '请选择验收时间'); ToastUtil.showNormal(context, '请选择验收时间');
return; return;

View File

@ -132,11 +132,11 @@ class _HotworkZyfzDetailState extends State<HotworkZyfzDetail> {
String reasonText = ''; String reasonText = '';
String DESCR = _contentController.text.trim(); String DESCR = _contentController.text.trim();
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入负责人意见');
return;
}
if (status == '1') { if (status == '1') {
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入负责人意见');
return;
}
} else { } else {
reasonText = await CustomAlertDialog.showInput( reasonText = await CustomAlertDialog.showInput(
context, context,

View File

@ -424,7 +424,7 @@ class _CutroadSafeFuncSureState extends State<CutroadSafeFuncSure> {
], ],
), ),
ItemListWidget.singleLineTitleText( ItemListWidget.singleLineTitleText(
isNumericInput: true,
label: '其他安全措施:', label: '其他安全措施:',
isEditable: true, isEditable: true,
hintText: '请输入其他安全措施', hintText: '请输入其他安全措施',

View File

@ -383,7 +383,7 @@ class _BreakgroundSafeFuncSureState extends State<BreakgroundSafeFuncSure> {
], ],
), ),
ItemListWidget.singleLineTitleText( ItemListWidget.singleLineTitleText(
isNumericInput: true,
label: '其他安全措施:', label: '其他安全措施:',
isEditable: true, isEditable: true,
hintText: '请输入其他安全措施', hintText: '请输入其他安全措施',

View File

@ -131,12 +131,11 @@ class _BreakgroundDzzhDetailState extends State<BreakgroundDzzhDetail> {
} }
String reasonText = ''; String reasonText = '';
String DESCR = _contentController.text.trim(); String DESCR = _contentController.text.trim();
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入负责人意见');
return;
}
if (status == '1') { if (status == '1') {
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入负责人意见');
return;
}
} else { } else {
reasonText = await CustomAlertDialog.showInput( reasonText = await CustomAlertDialog.showInput(
context, context,

View File

@ -130,12 +130,11 @@ class _BreakgroundShbmDetailState extends State<BreakgroundShbmDetail> {
} }
String reasonText = ''; String reasonText = '';
String DESCR = _contentController.text.trim(); String DESCR = _contentController.text.trim();
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入负责人意见');
return;
}
if (status == '1') { if (status == '1') {
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入负责人意见');
return;
}
} else { } else {
reasonText = await CustomAlertDialog.showInput( reasonText = await CustomAlertDialog.showInput(
context, context,

View File

@ -130,12 +130,11 @@ class _BreakgroundSpbmDetailState extends State<BreakgroundSpbmDetail> {
} }
String reasonText = ''; String reasonText = '';
String DESCR = _contentController.text.trim(); String DESCR = _contentController.text.trim();
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入负责人意见');
return;
}
if (status == '1') { if (status == '1') {
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入负责人意见');
return;
}
} else { } else {
reasonText = await CustomAlertDialog.showInput( reasonText = await CustomAlertDialog.showInput(
context, context,

View File

@ -132,11 +132,11 @@ class _BreakgroundSzdwDetailState extends State<BreakgroundSzdwDetail> {
String reasonText = ''; String reasonText = '';
String DESCR = _contentController.text.trim(); String DESCR = _contentController.text.trim();
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入所在单位负责人意见');
return;
}
if (status == '1') { if (status == '1') {
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入所在单位负责人意见');
return;
}
} else { } else {
reasonText = await CustomAlertDialog.showInput( reasonText = await CustomAlertDialog.showInput(
context, context,

View File

@ -185,12 +185,12 @@ class _BreakgroundYsgdDetailState extends State<BreakgroundYsgdDetail> {
} }
String DESCR = _contentController.text.trim(); String DESCR = _contentController.text.trim();
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入负责人意见');
return;
}
String reasonText = ''; String reasonText = '';
if (status == '1') { if (status == '1') {
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入负责人意见');
return;
}
if (startTime.isEmpty) { if (startTime.isEmpty) {
ToastUtil.showNormal(context, '请选择验收时间'); ToastUtil.showNormal(context, '请选择验收时间');
return; return;

View File

@ -132,11 +132,11 @@ class _BreakgroundZyfzDetailState extends State<BreakgroundZyfzDetail> {
String reasonText = ''; String reasonText = '';
String DESCR = _contentController.text.trim(); String DESCR = _contentController.text.trim();
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入负责人意见');
return;
}
if (status == '1') { if (status == '1') {
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入负责人意见');
return;
}
} else { } else {
reasonText = await CustomAlertDialog.showInput( reasonText = await CustomAlertDialog.showInput(
context, context,

View File

@ -427,18 +427,6 @@ class _HoistworkDetailFormWidgetState extends State<HoistWorkDetailFormWidget> {
onTap: widget.onChooseVideoManager ?? () {}, onTap: widget.onChooseVideoManager ?? () {},
text: pd['VIDEONAME'] ?? '', text: pd['VIDEONAME'] ?? '',
), ),
if (FormUtils.hasValue(widget.signs, 'SISUO')) ...[
const Divider(),
ConfirmWithSignWidget(
signs: widget.signs,
pd: pd,
baseImgPath: ApiService.baseImgPath,
sectionKey: 'SISUO',
nameKey: 'SISUO_USER_NAME',
headerTitle: '司索人',
roleTitle: '司索人',
),
]
], ],
), ),

View File

@ -382,7 +382,7 @@ class _HoistworkSafeFuncSureState extends State<HoistworkSafeFuncSure> {
], ],
), ),
ItemListWidget.singleLineTitleText( ItemListWidget.singleLineTitleText(
isNumericInput: true,
label: '其他安全措施:', label: '其他安全措施:',
isEditable: true, isEditable: true,
hintText: '请输入其他安全措施', hintText: '请输入其他安全措施',

View File

@ -132,11 +132,11 @@ class _HoistworkDzzhDetailState extends State<HoistworkDzzhDetail> {
String reasonText = ''; String reasonText = '';
String DESCR = _contentController.text.trim(); String DESCR = _contentController.text.trim();
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入负责人意见');
return;
}
if (status == '1') { if (status == '1') {
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入负责人意见');
return;
}
} else { } else {
reasonText = await CustomAlertDialog.showInput( reasonText = await CustomAlertDialog.showInput(
context, context,

View File

@ -404,7 +404,7 @@ class _HoistworkListPageState extends State<HoistworkListPage> {
), ),
Expanded( Expanded(
child: Text( child: Text(
"作业人: ${item['WORK_USER_USER_NAME'] ?? ''}", "吊装作业人: ${item['WORK_USER_USER_NAME'] ?? ''}",
softWrap: true, softWrap: true,
textAlign: TextAlign.right, textAlign: TextAlign.right,
maxLines: null, // maxLines: null, //

View File

@ -131,11 +131,11 @@ class _HoistworkShbmDetailState extends State<HoistworkShbmDetail> {
String reasonText = ''; String reasonText = '';
String DESCR = _contentController.text.trim(); String DESCR = _contentController.text.trim();
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入负责人意见');
return;
}
if (status == '1') { if (status == '1') {
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入负责人意见');
return;
}
} else { } else {
reasonText = await CustomAlertDialog.showInput( reasonText = await CustomAlertDialog.showInput(
context, context,

View File

@ -131,11 +131,11 @@ class _HoistworkSpbmDetailState extends State<HoistworkSpbmDetail> {
String reasonText = ''; String reasonText = '';
String DESCR = _contentController.text.trim(); String DESCR = _contentController.text.trim();
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入负责人意见');
return;
}
if (status == '1') { if (status == '1') {
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入负责人意见');
return;
}
} else { } else {
reasonText = await CustomAlertDialog.showInput( reasonText = await CustomAlertDialog.showInput(
context, context,

View File

@ -132,11 +132,11 @@ class _HoistworkSzdwDetailState extends State<HoistworkSzdwDetail> {
String reasonText = ''; String reasonText = '';
String DESCR = _contentController.text.trim(); String DESCR = _contentController.text.trim();
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入所在单位负责人意见');
return;
}
if (status == '1') { if (status == '1') {
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入所在单位负责人意见');
return;
}
} else { } else {
reasonText = await CustomAlertDialog.showInput( reasonText = await CustomAlertDialog.showInput(
context, context,

View File

@ -185,12 +185,12 @@ class _HoistworkYsgdDetailState extends State<HoistworkYsgdDetail> {
} }
String DESCR = _contentController.text.trim(); String DESCR = _contentController.text.trim();
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入负责人意见');
return;
}
String reasonText = ''; String reasonText = '';
if (status == '1') { if (status == '1') {
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入负责人意见');
return;
}
if (startTime.isEmpty) { if (startTime.isEmpty) {
ToastUtil.showNormal(context, '请选择验收时间'); ToastUtil.showNormal(context, '请选择验收时间');
return; return;

View File

@ -132,18 +132,18 @@ class _HoistworkZyfzDetailState extends State<HoistworkZyfzDetail> {
String reasonText = ''; String reasonText = '';
String DESCR = _contentController.text.trim(); String DESCR = _contentController.text.trim();
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入负责人意见');
return;
}
if (status == '1') { if (status == '1') {
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入负责人意见');
return;
}
} else { } else {
reasonText = await CustomAlertDialog.showInput( reasonText = await CustomAlertDialog.showInput(
context, context,
title: '作废原因', title: '作废原因',
hintText: '请输入作废原因', hintText: '请输入作废原因',
cancelText: '取消', cancelText: '取消',
confirmText: '确定' confirmText: '确定',
); );
if (reasonText.isEmpty) { if (reasonText.isEmpty) {
ToastUtil.showNormal(context, '请填写作废原因'); ToastUtil.showNormal(context, '请填写作废原因');
@ -181,7 +181,7 @@ class _HoistworkZyfzDetailState extends State<HoistworkZyfzDetail> {
if (result['result'] == 'success') { if (result['result'] == 'success') {
ToastUtil.showSuccess(context, '保存成功'); ToastUtil.showSuccess(context, '保存成功');
Navigator.of(context).pop(true); Navigator.of(context).pop(true);
}else{ } else {
ToastUtil.showNormal(context, '操作失败:${result['msg'] ?? '未知错误'}'); ToastUtil.showNormal(context, '操作失败:${result['msg'] ?? '未知错误'}');
} }
} catch (e) { } catch (e) {

View File

@ -370,7 +370,7 @@ class _HighworkSafeFuncSureState extends State<HighworkSafeFuncSure> {
], ],
), ),
ItemListWidget.singleLineTitleText( ItemListWidget.singleLineTitleText(
isNumericInput: true,
label: '其他安全措施:', label: '其他安全措施:',
isEditable: true, isEditable: true,
hintText: '请输入其他安全措施', hintText: '请输入其他安全措施',

View File

@ -131,11 +131,11 @@ class _HighworkShbmDetailState extends State<HighworkShbmDetail> {
String reasonText = ''; String reasonText = '';
String DESCR = _contentController.text.trim(); String DESCR = _contentController.text.trim();
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入负责人意见');
return;
}
if (status == '1') { if (status == '1') {
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入负责人意见');
return;
}
} else { } else {
reasonText = await CustomAlertDialog.showInput( reasonText = await CustomAlertDialog.showInput(
context, context,

View File

@ -188,11 +188,11 @@ class _HighworkSpbmDetailState extends State<HighworkSpbmDetail> {
String reasonText = ''; String reasonText = '';
String DESCR = _contentController.text.trim(); String DESCR = _contentController.text.trim();
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入负责人意见');
return;
}
if (status == '1') { if (status == '1') {
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入负责人意见');
return;
}
} else { } else {
reasonText = await CustomAlertDialog.showInput( reasonText = await CustomAlertDialog.showInput(
context, context,

View File

@ -132,11 +132,11 @@ class _HighworkSzdwDetailState extends State<HighworkSzdwDetail> {
String reasonText = ''; String reasonText = '';
String DESCR = _contentController.text.trim(); String DESCR = _contentController.text.trim();
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入所在单位负责人意见');
return;
}
if (status == '1') { if (status == '1') {
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入所在单位负责人意见');
return;
}
} else { } else {
reasonText = await CustomAlertDialog.showInput( reasonText = await CustomAlertDialog.showInput(
context, context,

View File

@ -185,12 +185,12 @@ class _HighworkYsgdDetailState extends State<HighworkYsgdDetail> {
} }
String DESCR = _contentController.text.trim(); String DESCR = _contentController.text.trim();
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入负责人意见');
return;
}
String reasonText = ''; String reasonText = '';
if (status == '1') { if (status == '1') {
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入负责人意见');
return;
}
if (startTime.isEmpty) { if (startTime.isEmpty) {
ToastUtil.showNormal(context, '请选择验收时间'); ToastUtil.showNormal(context, '请选择验收时间');
return; return;

View File

@ -132,10 +132,6 @@ class _HighworkZyfzDetailState extends State<HighworkZyfzDetail> {
String reasonText = ''; String reasonText = '';
String DESCR = _contentController.text.trim(); String DESCR = _contentController.text.trim();
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入负责人意见');
return;
}
if (status == '1') { if (status == '1') {
} else { } else {
reasonText = await CustomAlertDialog.showInput( reasonText = await CustomAlertDialog.showInput(

View File

@ -372,7 +372,7 @@ class _ElectricitySafeFuncSureState extends State<ElectricitySafeFuncSure> {
], ],
), ),
ItemListWidget.singleLineTitleText( ItemListWidget.singleLineTitleText(
isNumericInput: true,
label: '其他安全措施:', label: '其他安全措施:',
isEditable: true, isEditable: true,
hintText: '请输入其他安全措施', hintText: '请输入其他安全措施',

View File

@ -132,11 +132,11 @@ class _ElectricityPsdwDetailState extends State<ElectricityPsdwDetail> {
String reasonText = ''; String reasonText = '';
String DESCR = _contentController.text.trim(); String DESCR = _contentController.text.trim();
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入负责人意见');
return;
}
if (status == '1') { if (status == '1') {
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入负责人意见');
return;
}
} else { } else {
reasonText = await CustomAlertDialog.showInput( reasonText = await CustomAlertDialog.showInput(
context, context,

View File

@ -132,11 +132,11 @@ class _ElectricityYddwDetailState extends State<ElectricityYddwDetail> {
String reasonText = ''; String reasonText = '';
String DESCR = _contentController.text.trim(); String DESCR = _contentController.text.trim();
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入用电单位意见');
return;
}
if (status == '1') { if (status == '1') {
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入用电单位意见');
return;
}
} else { } else {
reasonText = await CustomAlertDialog.showInput( reasonText = await CustomAlertDialog.showInput(
context, context,

View File

@ -185,12 +185,12 @@ class _ElectricityYsgdDetailState extends State<ElectricityYsgdDetail> {
} }
String DESCR = _contentController.text.trim(); String DESCR = _contentController.text.trim();
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入负责人意见');
return;
}
String reasonText = ''; String reasonText = '';
if (status == '1') { if (status == '1') {
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入负责人意见');
return;
}
if (startTime.isEmpty) { if (startTime.isEmpty) {
ToastUtil.showNormal(context, '请选择验收时间'); ToastUtil.showNormal(context, '请选择验收时间');
return; return;

View File

@ -132,18 +132,18 @@ class _ElectricityZyfzDetailState extends State<ElectricityZyfzDetail> {
String reasonText = ''; String reasonText = '';
String DESCR = _contentController.text.trim(); String DESCR = _contentController.text.trim();
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入负责人意见');
return;
}
if (status == '1') { if (status == '1') {
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入负责人意见');
return;
}
} else { } else {
reasonText = await CustomAlertDialog.showInput( reasonText = await CustomAlertDialog.showInput(
context, context,
title: '作废原因', title: '作废原因',
hintText: '请输入作废原因', hintText: '请输入作废原因',
cancelText: '取消', cancelText: '取消',
confirmText: '确定' confirmText: '确定',
); );
if (reasonText.isEmpty) { if (reasonText.isEmpty) {
ToastUtil.showNormal(context, '请填写作废原因'); ToastUtil.showNormal(context, '请填写作废原因');
@ -181,7 +181,7 @@ class _ElectricityZyfzDetailState extends State<ElectricityZyfzDetail> {
if (result['result'] == 'success') { if (result['result'] == 'success') {
ToastUtil.showSuccess(context, '保存成功'); ToastUtil.showSuccess(context, '保存成功');
Navigator.of(context).pop(true); Navigator.of(context).pop(true);
}else{ } else {
ToastUtil.showNormal(context, '操作失败:${result['msg'] ?? '未知错误'}'); ToastUtil.showNormal(context, '操作失败:${result['msg'] ?? '未知错误'}');
} }
} catch (e) { } catch (e) {

View File

@ -385,7 +385,7 @@ class _BlindboardSafeFuncSureState extends State<BlindboardSafeFuncSure> {
], ],
), ),
ItemListWidget.singleLineTitleText( ItemListWidget.singleLineTitleText(
isNumericInput: true,
label: '其他安全措施:', label: '其他安全措施:',
isEditable: true, isEditable: true,
hintText: '请输入其他安全措施', hintText: '请输入其他安全措施',

View File

@ -440,7 +440,9 @@ class _BlindboardApplyDetailState extends State<BlindboardApplyDetail> {
]; ];
final level = pd['WORK_TYPE'] ?? ''; final level = pd['WORK_TYPE'] ?? '';
print('---level-$level'); print('---level-$level');
for (Map item in boardList) {
}
/// ///
final unitRules = <EditUserType>[ final unitRules = <EditUserType>[
EditUserType.GUARDIAN, EditUserType.GUARDIAN,

View File

@ -132,11 +132,11 @@ class _BlindboardShbmDetailState extends State<BlindboardShbmDetail> {
String reasonText = ''; String reasonText = '';
String DESCR = _contentController.text.trim(); String DESCR = _contentController.text.trim();
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入负责人意见');
return;
}
if (status == '1') { if (status == '1') {
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入负责人意见');
return;
}
} else { } else {
reasonText = await CustomAlertDialog.showInput( reasonText = await CustomAlertDialog.showInput(
context, context,

View File

@ -132,11 +132,11 @@ class _BlindboardSpbmDetailState extends State<BlindboardSpbmDetail> {
String reasonText = ''; String reasonText = '';
String DESCR = _contentController.text.trim(); String DESCR = _contentController.text.trim();
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入负责人意见');
return;
}
if (status == '1') { if (status == '1') {
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入负责人意见');
return;
}
} else { } else {
reasonText = await CustomAlertDialog.showInput( reasonText = await CustomAlertDialog.showInput(
context, context,

View File

@ -133,11 +133,11 @@ class _BlindboardSzdwDetailState extends State<BlindboardSzdwDetail> {
String reasonText = ''; String reasonText = '';
String DESCR = _contentController.text.trim(); String DESCR = _contentController.text.trim();
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入所在单位负责人意见');
return;
}
if (status == '1') { if (status == '1') {
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入所在单位负责人意见');
return;
}
} else { } else {
reasonText = await CustomAlertDialog.showInput( reasonText = await CustomAlertDialog.showInput(
context, context,

View File

@ -186,12 +186,12 @@ class _BlindboardYsgdDetailState extends State<BlindboardYsgdDetail> {
} }
String DESCR = _contentController.text.trim(); String DESCR = _contentController.text.trim();
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入负责人意见');
return;
}
String reasonText = ''; String reasonText = '';
if (status == '1') { if (status == '1') {
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入负责人意见');
return;
}
if (startTime.isEmpty) { if (startTime.isEmpty) {
ToastUtil.showNormal(context, '请选择验收时间'); ToastUtil.showNormal(context, '请选择验收时间');
return; return;

View File

@ -133,11 +133,11 @@ class _BlindboardZyfzDetailState extends State<BlindboardZyfzDetail> {
String reasonText = ''; String reasonText = '';
String DESCR = _contentController.text.trim(); String DESCR = _contentController.text.trim();
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入负责人意见');
return;
}
if (status == '1') { if (status == '1') {
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入负责人意见');
return;
}
} else { } else {
reasonText = await CustomAlertDialog.showInput( reasonText = await CustomAlertDialog.showInput(
context, context,

View File

@ -370,7 +370,7 @@ class _SpaceworkSafeFuncSureState extends State<SpaceworkSafeFuncSure> {
], ],
), ),
ItemListWidget.singleLineTitleText( ItemListWidget.singleLineTitleText(
isNumericInput: true,
label: '其他安全措施:', label: '其他安全措施:',
isEditable: true, isEditable: true,
hintText: '请输入其他安全措施', hintText: '请输入其他安全措施',

View File

@ -135,11 +135,11 @@ class _SpaceworkDbbzDetailState extends State<SpaceworkDbbzDetail> {
String reasonText = ''; String reasonText = '';
String DESCR = _contentController.text.trim(); String DESCR = _contentController.text.trim();
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入负责人意见');
return;
}
if (status == '1') { if (status == '1') {
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入负责人意见');
return;
}
} else { } else {
reasonText = await CustomAlertDialog.showInput( reasonText = await CustomAlertDialog.showInput(
context, context,

View File

@ -133,11 +133,11 @@ class _SpaceworkDhspDetailState extends State<SpaceworkDhspDetail> {
String reasonText = ''; String reasonText = '';
String DESCR = _contentController.text.trim(); String DESCR = _contentController.text.trim();
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入负责人意见');
return;
}
if (status == '1') { if (status == '1') {
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入负责人意见');
return;
}
} else { } else {
reasonText = await CustomAlertDialog.showInput( reasonText = await CustomAlertDialog.showInput(
context, context,

View File

@ -133,11 +133,11 @@ class _SpaceworkSzdwDetailState extends State<SpaceworkSzdwDetail> {
String reasonText = ''; String reasonText = '';
String DESCR = _contentController.text.trim(); String DESCR = _contentController.text.trim();
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入所在单位负责人意见');
return;
}
if (status == '1') { if (status == '1') {
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入所在单位负责人意见');
return;
}
} else { } else {
reasonText = await CustomAlertDialog.showInput( reasonText = await CustomAlertDialog.showInput(
context, context,

View File

@ -186,12 +186,12 @@ class _SpaceworkYsgdDetailState extends State<SpaceworkYsgdDetail> {
} }
String DESCR = _contentController.text.trim(); String DESCR = _contentController.text.trim();
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入负责人意见');
return;
}
String reasonText = ''; String reasonText = '';
if (status == '1') { if (status == '1') {
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入负责人意见');
return;
}
if (startTime.isEmpty) { if (startTime.isEmpty) {
ToastUtil.showNormal(context, '请选择验收时间'); ToastUtil.showNormal(context, '请选择验收时间');
return; return;

View File

@ -132,11 +132,11 @@ class _SpaceworkZyfzDetailState extends State<SpaceworkZyfzDetail> {
String reasonText = ''; String reasonText = '';
String DESCR = _contentController.text.trim(); String DESCR = _contentController.text.trim();
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入负责人意见');
return;
}
if (status == '1') { if (status == '1') {
if (DESCR.isEmpty) {
ToastUtil.showNormal(context, '请输入负责人意见');
return;
}
} else { } else {
reasonText = await CustomAlertDialog.showInput( reasonText = await CustomAlertDialog.showInput(
context, context,

View File

@ -130,7 +130,7 @@ class _SpaceworkZyrDetailState extends State<SpaceworkZyrDetail> {
return; return;
} }
String reasonText = ''; String reasonText = '';
if (status == '1') { if (status == '1') {
} else { } else {
reasonText = await CustomAlertDialog.showInput( reasonText = await CustomAlertDialog.showInput(