Commit 05716b0f by 吴春元

bug 修改

parent e6f370e1
...@@ -82,6 +82,12 @@ android { ...@@ -82,6 +82,12 @@ android {
signingConfig signingConfigs.debug signingConfig signingConfigs.debug
} }
} }
//自定义打包时apk名字
android.applicationVariants.all { variant ->
variant.outputs.all {
outputFileName = "special_equipment${variant.versionName}.apk"
}
}
} }
flutter { flutter {
......
...@@ -25,11 +25,11 @@ ...@@ -25,11 +25,11 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>1.0.5</string> <string>1.0.6</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>5</string> <string>6</string>
<key>LSRequiresIPhoneOS</key> <key>LSRequiresIPhoneOS</key>
<true/> <true/>
<key>NSCameraUsageDescription</key> <key>NSCameraUsageDescription</key>
......
// ignore_for_file: unnecessary_brace_in_string_interps, non_constant_identifier_names // ignore_for_file: unnecessary_brace_in_string_interps, non_constant_identifier_names
class Api { class Api {
static var IS_DEBUG = false; static var IS_DEBUG = true;
// static String URL = static String URL =
// IS_DEBUG ? "https://special.sxyztech.cn/" : "http://192.168.19.165:2212/"; IS_DEBUG ? "https://special.sxyztech.cn/" : "http://192.168.19.165:2212/";
///演示 ip ///演示 ip
static String URL = "http://47.92.138.92:8009/"; // static String URL = "http://47.92.138.92:8009/";
// static String URL = "http://192.168.19.164:8087/"; // static String URL = "http://192.168.19.164:8087/";
......
...@@ -116,9 +116,9 @@ class _ExamResultPageState extends State<ExamResultPage> { ...@@ -116,9 +116,9 @@ class _ExamResultPageState extends State<ExamResultPage> {
Text( Text(
examResultDataBo!.score!.round().toString(), examResultDataBo!.score!.round().toString(),
style: TextStyle( style: TextStyle(
color: examResultDataBo!.score! < 90 color: examResultDataBo!.score! >= 90
? Colors.red ? Colors.green
: Colors.green, : Colors.red,
fontSize: 20, fontSize: 20,
fontWeight: FontWeight.bold), fontWeight: FontWeight.bold),
), ),
......
...@@ -12,6 +12,7 @@ import 'package:package_info/package_info.dart'; ...@@ -12,6 +12,7 @@ import 'package:package_info/package_info.dart';
import 'package:special_equipment_flutter/common/edgeInsets_const.dart'; import 'package:special_equipment_flutter/common/edgeInsets_const.dart';
import 'package:special_equipment_flutter/common/route_string.dart'; import 'package:special_equipment_flutter/common/route_string.dart';
import 'package:special_equipment_flutter/dio/http_utils.dart'; import 'package:special_equipment_flutter/dio/http_utils.dart';
import 'package:special_equipment_flutter/model/app_is_open.dart';
import 'package:special_equipment_flutter/model/check_update.dart'; import 'package:special_equipment_flutter/model/check_update.dart';
import 'package:special_equipment_flutter/model/count_bo.dart'; import 'package:special_equipment_flutter/model/count_bo.dart';
import 'package:special_equipment_flutter/model/echart_bo.dart'; import 'package:special_equipment_flutter/model/echart_bo.dart';
...@@ -84,13 +85,15 @@ class _HomePageState extends State<HomePage> ...@@ -84,13 +85,15 @@ class _HomePageState extends State<HomePage>
OverseerHistoryListBo? mOverseerHistoryListBo = OverseerHistoryListBo(); OverseerHistoryListBo? mOverseerHistoryListBo = OverseerHistoryListBo();
int mOverseerHistoryCount = 0; int mOverseerHistoryCount = 0;
List<HistoryListData>? mHistoryListData = []; List<HistoryListData>? mHistoryListData = [];
String? isOpen = '0';
//声明,后面需要销毁 //声明,后面需要销毁
StreamSubscription? event; StreamSubscription? event;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
doAppIsOpen();
///获取版本 ///获取版本
checkUpdateVersion(); checkUpdateVersion();
...@@ -146,6 +149,20 @@ class _HomePageState extends State<HomePage> ...@@ -146,6 +149,20 @@ class _HomePageState extends State<HomePage>
getDeviceData(); getDeviceData();
} }
///版本显示控制
void doAppIsOpen() {
if (Platform.isIOS) {
HttpUtils.doAppIsOpen(context, onSuccess: (value) {
AppIsOpen appIsOpen = value;
if (mounted) {
setState(() {
isOpen = appIsOpen.appIsOpen!;
});
}
});
}
}
///获取监察记录列表 ///获取监察记录列表
void getOverseerHistoryList() { void getOverseerHistoryList() {
HttpUtils.getPapers(context, StorageUtil.getInstance().getUserId(), 1, 10) HttpUtils.getPapers(context, StorageUtil.getInstance().getUserId(), 1, 10)
...@@ -327,6 +344,7 @@ class _HomePageState extends State<HomePage> ...@@ -327,6 +344,7 @@ class _HomePageState extends State<HomePage>
} else { } else {
getQuestionsPerson(); getQuestionsPerson();
} }
doAppIsOpen();
}); });
}, },
child: CustomScrollView( child: CustomScrollView(
...@@ -386,6 +404,7 @@ class _HomePageState extends State<HomePage> ...@@ -386,6 +404,7 @@ class _HomePageState extends State<HomePage>
///统计 ///统计
// buildSliverStatistics(context), // buildSliverStatistics(context),
///监察人员 ///监察人员
] else if (isInspectorRoles( ] else if (isInspectorRoles(
StorageUtil.getInstance().getRoleNames())!) ...[ StorageUtil.getInstance().getRoleNames())!) ...[
...@@ -400,13 +419,22 @@ class _HomePageState extends State<HomePage> ...@@ -400,13 +419,22 @@ class _HomePageState extends State<HomePage>
///日管控整改、周排查整改、月调度整改布局 ///日管控整改、周排查整改、月调度整改布局
buildSliverRiskDayWeekMonth(), buildSliverRiskDayWeekMonth(),
buildSliverToBoxAdapter( if (!isRolesName1(StorageUtil.getInstance().getRoleNames())!) ...[
'assets/examine/exam_title_icon.png', '考核练习'), ///统计
buildSliverStatistics(context)
buildSliverGridExamination(), ] else ...[
if (Platform.isIOS) ...[
///统计 if (isOpen == '1') ...[
// buildSliverStatistics(context), buildSliverToBoxAdapter(
'assets/examine/exam_title_icon.png', '考核练习'),
buildSliverGridExamination(),
]
] else ...[
buildSliverToBoxAdapter(
'assets/examine/exam_title_icon.png', '考核练习'),
buildSliverGridExamination(),
]
]
] ]
], ],
), ),
......
...@@ -222,8 +222,8 @@ class _OverseerHistroyDetailsPageState ...@@ -222,8 +222,8 @@ class _OverseerHistroyDetailsPageState
), ),
child: Column( child: Column(
children: [ children: [
buildTitleContainer(Icons.event_repeat, buildTitleContainer(Icons.person_pin,
ColorConst.blueColor, '考核状态', Colors.black54), ColorConst.blueColor, '考核', Colors.black54),
Container( Container(
padding: const EdgeInsets.only( padding: const EdgeInsets.only(
left: 30, right: 15, top: 0, bottom: 15), left: 30, right: 15, top: 0, bottom: 15),
......
...@@ -34,6 +34,8 @@ class _OverseerHistoryListPageState extends State<OverseerHistoryListPage> { ...@@ -34,6 +34,8 @@ class _OverseerHistoryListPageState extends State<OverseerHistoryListPage> {
List<HistoryListData>? mHistoryListData = []; List<HistoryListData>? mHistoryListData = [];
int page = 1; int page = 1;
bool isLastPage = true; bool isLastPage = true;
OverseerHistoryListBo? mOverseerHistoryListBo = OverseerHistoryListBo();
int mOverseerHistoryCount = 0;
@override @override
void initState() { void initState() {
...@@ -45,16 +47,18 @@ class _OverseerHistoryListPageState extends State<OverseerHistoryListPage> { ...@@ -45,16 +47,18 @@ class _OverseerHistoryListPageState extends State<OverseerHistoryListPage> {
void getOverseerHistoryList() { void getOverseerHistoryList() {
HttpUtils.getPapers(context, StorageUtil.getInstance().getUserId(), 1, 10) HttpUtils.getPapers(context, StorageUtil.getInstance().getUserId(), 1, 10)
.then((value) { .then((value) {
OverseerHistoryListBo mOverseerHistoryListBo = value; mOverseerHistoryListBo = value;
if (mounted) { if (mounted) {
setState(() { setState(() {
mOverseerHistoryCount = mOverseerHistoryListBo!.count!;
if (page == 1) { if (page == 1) {
mHistoryListData!.clear(); mHistoryListData!.clear();
} }
List<HistoryListData>? rows = mOverseerHistoryListBo.data; List<HistoryListData>? rows = mOverseerHistoryListBo!.data;
mHistoryListData!.addAll(rows!); mHistoryListData!.addAll(rows!);
int totalPage = int totalPage =
StringUtils.totalPage(mOverseerHistoryListBo.count, 10); StringUtils.totalPage(mOverseerHistoryListBo!.count, 10);
print('$totalPage==== $page'); print('$totalPage==== $page');
if (totalPage == page) { if (totalPage == page) {
isLastPage = true; isLastPage = true;
...@@ -114,6 +118,38 @@ class _OverseerHistoryListPageState extends State<OverseerHistoryListPage> { ...@@ -114,6 +118,38 @@ class _OverseerHistoryListPageState extends State<OverseerHistoryListPage> {
Column buildBody() { Column buildBody() {
return Column( return Column(
children: [ children: [
Container(
width: double.infinity,
margin:
const EdgeInsets.only(left: 10, right: 10, top: 10, bottom: 0),
padding: const EdgeInsets.only(left: 10, right: 5, top: 3, bottom: 3),
decoration: BoxDecoration(
color: Colors.orange[50],
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(5),
topRight: Radius.circular(5),
bottomLeft: Radius.circular(5),
bottomRight: Radius.circular(5)),
),
child: Text.rich(
softWrap: true,
TextSpan(children: [
const TextSpan(
text: "历史监察记录共 ",
style: TextStyle(fontSize: 14, color: Colors.orange)),
TextSpan(
text: mOverseerHistoryListBo != null
? mOverseerHistoryCount.toString()
: '0',
style: const TextStyle(
fontSize: 18,
color: Colors.orange,
fontWeight: FontWeight.bold)),
const TextSpan(
text: " 条",
style: TextStyle(fontSize: 14, color: Colors.orange))
])),
),
//文章列表 //文章列表
ListView.separated( ListView.separated(
shrinkWrap: true, shrinkWrap: true,
...@@ -137,20 +173,20 @@ class _OverseerHistoryListPageState extends State<OverseerHistoryListPage> { ...@@ -137,20 +173,20 @@ class _OverseerHistoryListPageState extends State<OverseerHistoryListPage> {
InkWell buildItem(int index, BuildContext context) { InkWell buildItem(int index, BuildContext context) {
return InkWell( return InkWell(
onTap: () { onTap: () {
// Get.toNamed(RouteString.DAY_INSPECT_SUBMIT_SY, Get.toNamed(RouteString.OVERSEER_HISTROY_DETAILS_PAGE, arguments: {
// arguments: {'argsData': widget.args, 'listBo': list(index)}) 'id': mHistoryListData![index].id,
// ?.then((value) { })?.then((value) {
// if (value != null && value) { if (value != null && value) {
// getData(); getOverseerHistoryList();
// } }
// }); });
}, },
child: Card( child: Card(
elevation: 10, elevation: 10,
shadowColor: mHistoryListData![index].incomplete != 0 shadowColor: mHistoryListData![index].incomplete != 0
? ColorConst.orangeColor ? ColorConst.orangeColor
: ColorConst.greenColor, : ColorConst.greenColor,
margin: const EdgeInsets.only(left: 0, right: 0, top: 15, bottom: 0), margin: const EdgeInsets.only(left: 0, right: 0, top: 10, bottom: 0),
shape: const RoundedRectangleBorder( shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(10)), borderRadius: BorderRadius.all(Radius.circular(10)),
), ),
...@@ -281,8 +317,9 @@ class _OverseerHistoryListPageState extends State<OverseerHistoryListPage> { ...@@ -281,8 +317,9 @@ class _OverseerHistoryListPageState extends State<OverseerHistoryListPage> {
mHistoryListData! mHistoryListData!
.removeAt(index); .removeAt(index);
//发出通知 //发出通知
EventBusUtils.getInstance() // EventBusUtils.getInstance()
?.fire("2"); // ?.fire("2");
mOverseerHistoryCount--;
ToastUtils.showCenter('删除成功'); ToastUtils.showCenter('删除成功');
Get.back(); Get.back();
}); });
......
...@@ -312,6 +312,9 @@ class _OverseerSettingsState extends State<OverseerSettingsPage> { ...@@ -312,6 +312,9 @@ class _OverseerSettingsState extends State<OverseerSettingsPage> {
controller: singleZJText, controller: singleZJText,
onChanged: (num) { onChanged: (num) {
setState(() { setState(() {
if (num.isEmpty) {
num = '0';
}
if (mDataEq != null && if (mDataEq != null &&
int.parse(num) > mDataEq!.dxNum!) { int.parse(num) > mDataEq!.dxNum!) {
ToastUtils.showCenter( ToastUtils.showCenter(
...@@ -347,6 +350,9 @@ class _OverseerSettingsState extends State<OverseerSettingsPage> { ...@@ -347,6 +350,9 @@ class _OverseerSettingsState extends State<OverseerSettingsPage> {
controller: judgmentZJText, controller: judgmentZJText,
onChanged: (num) { onChanged: (num) {
setState(() { setState(() {
if (num.isEmpty) {
num = '0';
}
if (mDataEq != null && if (mDataEq != null &&
int.parse(num) > mDataEq!.pdNum!) { int.parse(num) > mDataEq!.pdNum!) {
ToastUtils.showCenter( ToastUtils.showCenter(
...@@ -429,6 +435,9 @@ class _OverseerSettingsState extends State<OverseerSettingsPage> { ...@@ -429,6 +435,9 @@ class _OverseerSettingsState extends State<OverseerSettingsPage> {
controller: singleAQYText, controller: singleAQYText,
onChanged: (num) { onChanged: (num) {
setState(() { setState(() {
if (num.isEmpty) {
num = '0';
}
if (mDataEq != null && if (mDataEq != null &&
int.parse(num) > mDataEq!.dxNum!) { int.parse(num) > mDataEq!.dxNum!) {
ToastUtils.showCenter( ToastUtils.showCenter(
...@@ -464,6 +473,9 @@ class _OverseerSettingsState extends State<OverseerSettingsPage> { ...@@ -464,6 +473,9 @@ class _OverseerSettingsState extends State<OverseerSettingsPage> {
controller: judgmentAQYText, controller: judgmentAQYText,
onChanged: (num) { onChanged: (num) {
setState(() { setState(() {
if (num.isEmpty) {
num = '0';
}
if (mDataEq != null && if (mDataEq != null &&
int.parse(num) > mDataEq!.pdNum!) { int.parse(num) > mDataEq!.pdNum!) {
ToastUtils.showCenter( ToastUtils.showCenter(
...@@ -820,15 +832,19 @@ class _OverseerSettingsState extends State<OverseerSettingsPage> { ...@@ -820,15 +832,19 @@ class _OverseerSettingsState extends State<OverseerSettingsPage> {
} }
bool isSafety = false; bool isSafety = false;
bool isSafety1 = false;
bool isSafety2 = false;
for (var i = 0; i < userSafetyDirectorList!.length; i++) { for (var i = 0; i < userSafetyDirectorList!.length; i++) {
if (userSafetyDirectorList![i].isChecked!) { if (userSafetyDirectorList![i].isChecked!) {
isSafety = true; isSafety = true;
isSafety1 = true;
} }
} }
for (var i = 0; i < userSafetyOfficerList!.length; i++) { for (var i = 0; i < userSafetyOfficerList!.length; i++) {
if (userSafetyOfficerList![i].isChecked!) { if (userSafetyOfficerList![i].isChecked!) {
isSafety = true; isSafety = true;
isSafety2 = true;
} }
} }
...@@ -837,9 +853,17 @@ class _OverseerSettingsState extends State<OverseerSettingsPage> { ...@@ -837,9 +853,17 @@ class _OverseerSettingsState extends State<OverseerSettingsPage> {
return; return;
} }
if (allZJ == 0 && allAQY == 0) { if (isSafety1) {
ToastUtils.showCenter('总题数不能为 0'); if (allZJ == 0) {
return; ToastUtils.showCenter('【安全总监】总题数不能为 0');
return;
}
}
if (isSafety2) {
if (allAQY == 0) {
ToastUtils.showCenter('【安全员】总题数不能为 0');
return;
}
} }
Get.dialog(AlertDialog( Get.dialog(AlertDialog(
......
...@@ -171,7 +171,7 @@ class _RegisterPage2State extends State<RegisterPage2> { ...@@ -171,7 +171,7 @@ class _RegisterPage2State extends State<RegisterPage2> {
), ),
child: const Text( child: const Text(
softWrap: true, softWrap: true,
'密码至少包含以下 3 种类别:大写字母、小写字母、数字、特殊符号、8-20位', '密码至少包含以下 3 种类别:大写字母、小写字母、数字、特殊符号( @#*. )、8-20位',
style: TextStyle(color: Colors.orange, fontSize: 12), style: TextStyle(color: Colors.orange, fontSize: 12),
), ),
), ),
...@@ -470,7 +470,7 @@ class _RegisterPage2State extends State<RegisterPage2> { ...@@ -470,7 +470,7 @@ class _RegisterPage2State extends State<RegisterPage2> {
if (!StringUtils.isValidPassword(passwordText!.text)) { if (!StringUtils.isValidPassword(passwordText!.text)) {
passwordFocusNode!.requestFocus(); passwordFocusNode!.requestFocus();
ToastUtils.showCenter('密码至少包含以下 3 种类别:大写字母、小写字母、数字、特殊符号、8-20位'); ToastUtils.showCenter('密码至少包含以下 3 种类别:大写字母、小写字母、数字、特殊符号(@#*.)、8-20位');
return; return;
} }
......
...@@ -261,7 +261,7 @@ class _UserSettingsPageState extends State<UserSettingsPage> { ...@@ -261,7 +261,7 @@ class _UserSettingsPageState extends State<UserSettingsPage> {
), ),
child: const Text( child: const Text(
softWrap: true, softWrap: true,
'密码至少包含以下 3 种类别:大写字母、小写字母、数字、特殊符号、8-20位', '密码至少包含以下 3 种类别:大写字母、小写字母、数字、特殊符号( @#*. )、8-20位',
style: TextStyle(color: Colors.orange, fontSize: 12), style: TextStyle(color: Colors.orange, fontSize: 12),
), ),
), ),
...@@ -1058,7 +1058,7 @@ class _UserSettingsPageState extends State<UserSettingsPage> { ...@@ -1058,7 +1058,7 @@ class _UserSettingsPageState extends State<UserSettingsPage> {
if (!StringUtils.isValidPassword(passwordText!.text)) { if (!StringUtils.isValidPassword(passwordText!.text)) {
passwordFocusNode!.requestFocus(); passwordFocusNode!.requestFocus();
ToastUtils.showCenter( ToastUtils.showCenter(
'密码至少包含以下 3 种类别:大写字母、小写字母、数字、特殊符号、8-20位'); '密码至少包含以下 3 种类别:大写字母、小写字母、数字、特殊符号(@#*.)、8-20位');
return; return;
} }
if (okPasswordText!.text.isEmpty) { if (okPasswordText!.text.isEmpty) {
...@@ -1075,7 +1075,7 @@ class _UserSettingsPageState extends State<UserSettingsPage> { ...@@ -1075,7 +1075,7 @@ class _UserSettingsPageState extends State<UserSettingsPage> {
if (!StringUtils.isValidPassword(passwordText!.text)) { if (!StringUtils.isValidPassword(passwordText!.text)) {
passwordFocusNode!.requestFocus(); passwordFocusNode!.requestFocus();
ToastUtils.showCenter( ToastUtils.showCenter(
'密码至少包含以下 3 种类别:大写字母、小写字母、数字、特殊符号、8-20位'); '密码至少包含以下 3 种类别:大写字母、小写字母、数字、特殊符号(@#*.)、8-20位');
return; return;
} }
if (okPasswordText!.text.isEmpty) { if (okPasswordText!.text.isEmpty) {
......
...@@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev ...@@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts # In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix. # of the product and file versions while build-number is used as the build suffix.
version: 1.0.5+5 version: 1.0.6+6
environment: environment:
sdk: '>=3.1.3 <4.0.0' sdk: '>=3.1.3 <4.0.0'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment