|
|
@ -47,6 +47,47 @@ class ProblemFormPage extends GetView<ProblemFormController> { |
|
|
|
child: SingleChildScrollView( |
|
|
|
child: SingleChildScrollView( |
|
|
|
child: Column( |
|
|
|
child: Column( |
|
|
|
children: [ |
|
|
|
children: [ |
|
|
|
|
|
|
|
if (controller.problem?.bindData != null) |
|
|
|
|
|
|
|
Container( |
|
|
|
|
|
|
|
color: Colors.white, |
|
|
|
|
|
|
|
padding: const EdgeInsets.symmetric( |
|
|
|
|
|
|
|
horizontal: 16.0, |
|
|
|
|
|
|
|
vertical: 8.0, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
child: Column( |
|
|
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
|
|
|
|
children: <Widget>[ |
|
|
|
|
|
|
|
_buildSection( |
|
|
|
|
|
|
|
'项目名称', |
|
|
|
|
|
|
|
controller.bindInfo['projectName'], |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
_buildDivider(), |
|
|
|
|
|
|
|
_buildSection( |
|
|
|
|
|
|
|
'企业名称', |
|
|
|
|
|
|
|
controller.bindInfo['companyName'], |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
_buildDivider(), |
|
|
|
|
|
|
|
_buildSection( |
|
|
|
|
|
|
|
'要素名称', |
|
|
|
|
|
|
|
controller.bindInfo['censorElementName'], |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
_buildDivider(), |
|
|
|
|
|
|
|
_buildSection( |
|
|
|
|
|
|
|
'评估内容', |
|
|
|
|
|
|
|
controller.bindInfo['pgContent'], |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
_buildDivider(), |
|
|
|
|
|
|
|
_buildSection( |
|
|
|
|
|
|
|
'建议项', |
|
|
|
|
|
|
|
controller.bindInfo['suggestion'], |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
_buildDivider(), |
|
|
|
|
|
|
|
_buildSection('问题类型', ''), |
|
|
|
|
|
|
|
_buildDivider(), |
|
|
|
|
|
|
|
_buildSection('工艺设备名称', ''), |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
_buildInputCard( |
|
|
|
_buildInputCard( |
|
|
|
title: '问题描述', |
|
|
|
title: '问题描述', |
|
|
|
textController: controller.descriptionController, |
|
|
|
textController: controller.descriptionController, |
|
|
@ -69,6 +110,61 @@ class ProblemFormPage extends GetView<ProblemFormController> { |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// The main widget to build a section with a title and content. |
|
|
|
|
|
|
|
Widget _buildSection(String title, dynamic content) { |
|
|
|
|
|
|
|
return Padding( |
|
|
|
|
|
|
|
padding: const EdgeInsets.symmetric(vertical: 12.0), |
|
|
|
|
|
|
|
child: Column( |
|
|
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
|
|
|
|
children: [ |
|
|
|
|
|
|
|
Text( |
|
|
|
|
|
|
|
title, |
|
|
|
|
|
|
|
style: const TextStyle( |
|
|
|
|
|
|
|
fontWeight: FontWeight.bold, |
|
|
|
|
|
|
|
fontSize: 16.0, |
|
|
|
|
|
|
|
color: Colors.black87, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
const SizedBox(height: 8.0), |
|
|
|
|
|
|
|
// This is where the content is dynamically rendered |
|
|
|
|
|
|
|
..._buildContent(content), |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// A helper method to handle different types of content |
|
|
|
|
|
|
|
List<Widget> _buildContent(dynamic content) { |
|
|
|
|
|
|
|
if (content is String) { |
|
|
|
|
|
|
|
// If the content is a single string, return a single Text widget. |
|
|
|
|
|
|
|
return [ |
|
|
|
|
|
|
|
Text( |
|
|
|
|
|
|
|
content.isEmpty ? "无" : content, |
|
|
|
|
|
|
|
style: const TextStyle(fontSize: 15.0, color: Colors.black54), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
]; |
|
|
|
|
|
|
|
} else if (content is List) { |
|
|
|
|
|
|
|
// If the content is a list (like suggestions), map it to Text widgets. |
|
|
|
|
|
|
|
return content.map<Widget>((item) { |
|
|
|
|
|
|
|
// Safely access the 'desc' key from each item in the list |
|
|
|
|
|
|
|
final String desc = (item as Map)['desc'] as String; |
|
|
|
|
|
|
|
return Padding( |
|
|
|
|
|
|
|
padding: const EdgeInsets.only(bottom: 4.0), |
|
|
|
|
|
|
|
child: Text( |
|
|
|
|
|
|
|
desc, |
|
|
|
|
|
|
|
style: const TextStyle(fontSize: 15.0, color: Colors.black54), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
}).toList(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// Return an empty list if content is of an unsupported type. |
|
|
|
|
|
|
|
return []; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Widget _buildDivider() { |
|
|
|
|
|
|
|
return Divider(height: 1, color: Colors.grey[300]); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// 构建输入框卡片 |
|
|
|
/// 构建输入框卡片 |
|
|
|
Widget _buildInputCard({ |
|
|
|
Widget _buildInputCard({ |
|
|
|
required String title, |
|
|
|
required String title, |
|
|
|