。。。。
parent
dbfc4a3ec4
commit
2b6328e742
|
@ -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(
|
||||||
|
|
|
@ -563,7 +563,6 @@ class HomePageState extends State<HomePage> {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
_onRefresh();
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}).toList(),
|
}).toList(),
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
|
@ -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; // 第四列:确认人(头像列)
|
||||||
|
|
||||||
// 如果不显示第4列(isAllowEdit == true),则第4列宽为0,不计入固定总和
|
// 如果不显示第4列(isAllowEdit == true),则第4列宽为0,不计入固定总和
|
||||||
|
@ -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,
|
||||||
|
|
|
@ -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);
|
||||||
|
|
|
@ -371,7 +371,7 @@ class _HotworkSafeFuncSureState extends State<HotworkSafeFuncSure> {
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
ItemListWidget.singleLineTitleText(
|
ItemListWidget.singleLineTitleText(
|
||||||
isNumericInput: true,
|
|
||||||
label: '其他安全措施:',
|
label: '其他安全措施:',
|
||||||
isEditable: true,
|
isEditable: true,
|
||||||
hintText: '请输入其他安全措施',
|
hintText: '请输入其他安全措施',
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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 = [];
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -424,7 +424,7 @@ class _CutroadSafeFuncSureState extends State<CutroadSafeFuncSure> {
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
ItemListWidget.singleLineTitleText(
|
ItemListWidget.singleLineTitleText(
|
||||||
isNumericInput: true,
|
|
||||||
label: '其他安全措施:',
|
label: '其他安全措施:',
|
||||||
isEditable: true,
|
isEditable: true,
|
||||||
hintText: '请输入其他安全措施',
|
hintText: '请输入其他安全措施',
|
||||||
|
|
|
@ -383,7 +383,7 @@ class _BreakgroundSafeFuncSureState extends State<BreakgroundSafeFuncSure> {
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
ItemListWidget.singleLineTitleText(
|
ItemListWidget.singleLineTitleText(
|
||||||
isNumericInput: true,
|
|
||||||
label: '其他安全措施:',
|
label: '其他安全措施:',
|
||||||
isEditable: true,
|
isEditable: true,
|
||||||
hintText: '请输入其他安全措施',
|
hintText: '请输入其他安全措施',
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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: '司索人',
|
|
||||||
),
|
|
||||||
]
|
|
||||||
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
|
@ -382,7 +382,7 @@ class _HoistworkSafeFuncSureState extends State<HoistworkSafeFuncSure> {
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
ItemListWidget.singleLineTitleText(
|
ItemListWidget.singleLineTitleText(
|
||||||
isNumericInput: true,
|
|
||||||
label: '其他安全措施:',
|
label: '其他安全措施:',
|
||||||
isEditable: true,
|
isEditable: true,
|
||||||
hintText: '请输入其他安全措施',
|
hintText: '请输入其他安全措施',
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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, // 不限制行数
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
|
@ -370,7 +370,7 @@ class _HighworkSafeFuncSureState extends State<HighworkSafeFuncSure> {
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
ItemListWidget.singleLineTitleText(
|
ItemListWidget.singleLineTitleText(
|
||||||
isNumericInput: true,
|
|
||||||
label: '其他安全措施:',
|
label: '其他安全措施:',
|
||||||
isEditable: true,
|
isEditable: true,
|
||||||
hintText: '请输入其他安全措施',
|
hintText: '请输入其他安全措施',
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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(
|
||||||
|
|
|
@ -372,7 +372,7 @@ class _ElectricitySafeFuncSureState extends State<ElectricitySafeFuncSure> {
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
ItemListWidget.singleLineTitleText(
|
ItemListWidget.singleLineTitleText(
|
||||||
isNumericInput: true,
|
|
||||||
label: '其他安全措施:',
|
label: '其他安全措施:',
|
||||||
isEditable: true,
|
isEditable: true,
|
||||||
hintText: '请输入其他安全措施',
|
hintText: '请输入其他安全措施',
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
|
@ -385,7 +385,7 @@ class _BlindboardSafeFuncSureState extends State<BlindboardSafeFuncSure> {
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
ItemListWidget.singleLineTitleText(
|
ItemListWidget.singleLineTitleText(
|
||||||
isNumericInput: true,
|
|
||||||
label: '其他安全措施:',
|
label: '其他安全措施:',
|
||||||
isEditable: true,
|
isEditable: true,
|
||||||
hintText: '请输入其他安全措施',
|
hintText: '请输入其他安全措施',
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -370,7 +370,7 @@ class _SpaceworkSafeFuncSureState extends State<SpaceworkSafeFuncSure> {
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
ItemListWidget.singleLineTitleText(
|
ItemListWidget.singleLineTitleText(
|
||||||
isNumericInput: true,
|
|
||||||
label: '其他安全措施:',
|
label: '其他安全措施:',
|
||||||
isEditable: true,
|
isEditable: true,
|
||||||
hintText: '请输入其他安全措施',
|
hintText: '请输入其他安全措施',
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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(
|
||||||
|
|
Loading…
Reference in New Issue