hyzp_ybqx-Commit059:已经实现“车流量日统计(含早晚高峰)”功能

master
WinUser01 4 years ago
parent 16fac7bdc2
commit 3844755c6c

@ -1 +1 @@
[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":20211231,"versionName":"1.4.5","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]
[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":20211231,"versionName":"1.4.6","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]

@ -7,6 +7,7 @@ import 'package:flutter/services.dart';
import 'package:flutter_bmfbase/BaiduMap/bmfmap_base.dart' show BMFMapSDK, BMF_COORD_TYPE;
import 'package:flutter_screenutil/screenutil_init.dart';
import 'package:hyzp_ybqx511528_xingwen/pages/Login/LoginTabs2.dart';
import 'package:hyzp_ybqx511528_xingwen/pages/MyMsics/05_updated/MyUpdatedNew.dart';
import 'package:hyzp_ybqx511528_xingwen/pages/Works/TJXX/tj_data.dart';
import 'package:package_info/package_info.dart';
// provider
@ -89,8 +90,8 @@ class _MyAppState extends State<MyApp> {
// Navigator.of(context).push(MaterialPageRoute(
// builder: (context) => MyUpdated(ver: version, date: buildDate, theContext: context)));
// MyUpdatedNew m = await MyUpdatedNew(
// ver: version, date: buildDate, theContext: context, bStartUpdated: true);
MyUpdatedNew m = await MyUpdatedNew(
ver: version, date: buildDate, theContext: context, bStartUpdated: true);
});
super.initState();
}

@ -1,6 +1,7 @@
import 'package:hyzp_ybqx511528_xingwen/components/commonFun.dart';
import 'package:hyzp_ybqx511528_xingwen/components/dioFun.dart';
import 'package:hyzp_ybqx511528_xingwen/components/hyxx_data_handle.dart';
import 'package:hyzp_ybqx511528_xingwen/pages/Works/TJXX/zptj_bar_echarts_trinity_new_getdata.dart';
import 'package:hyzp_ybqx511528_xingwen/services/EventBus.dart';
///
@ -495,6 +496,10 @@ Future startGetStatisDataNew() async {
listAllStatisData = value;
eventBus.fire(StatisDataUpdate('统计数据已更新'));
});
///
cllRStatisDataGeting = true; //
trinityData = ZptjBarEchartsTrinityNewGetData(); //
});
} else {
if (mapStatisInfo['今日抓拍'] < 0) {
@ -512,6 +517,10 @@ Future startGetStatisDataNew() async {
//广
eventBus.fire(StatisDataUpdate('统计数据已更新'));
}
///
cllRStatisDataGeting = true; //
trinityData = ZptjBarEchartsTrinityNewGetData(); //
}
}

@ -0,0 +1,141 @@
//import 'package:flustars/flustars.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:hyzp_ybqx511528_xingwen/components/commonFun.dart';
import 'package:hyzp_ybqx511528_xingwen/components/hyxx_data_handle.dart';
import 'package:hyzp_ybqx511528_xingwen/pages/Works/TJXX/tj_data.dart';
import 'package:hyzp_ybqx511528_xingwen/pages/Works/TJXX/zptj_bar_echarts_trinity_new_getdata.dart';
import 'package:hyzp_ybqx511528_xingwen/widget/table_scrollable/table_scrollable.dart';
import '../../../services/EventBus.dart';
class ZptjBarEchartsTrinityNew extends StatefulWidget {
ZptjBarEchartsTrinityNew({this.statisType, Key key}) : super(key: key);
String statisType; //
@override
State<StatefulWidget> createState() => ZptjBarEchartsTrinityNewState();
}
class ZptjBarEchartsTrinityNewState extends State<ZptjBarEchartsTrinityNew> {
//try_setState(); //
try_setState() {
try {
setState(() {});
} catch (e) {
print('setState(() {})异常:${e}');
}
}
@override
void initState() {
super.initState();
print('cllRStatisDataOk = ${cllRStatisDataOk}');
///
if (!cllRStatisDataOk) {
///
trinityData = ZptjBarEchartsTrinityNewGetData(); //
} else {
updateEchartsAndTable(); //
}
// LED
eventBus.on<SelectLedDwUpdateEvent>().listen((event) async {
print(event.str);
//id
int id = trinityData.listItems.indexOf(event.selectedValue);
print('SelectLedDwUpdateEvent: id = ${id}, nDwbh = ${trinityData.nDwbh}');
if (id != trinityData.nDwbh) {
trinityData.nDwbh = id;
updateEchartsAndTable(bFirst: false); //
}
});
}
Future updateEchartsAndTable({bool bFirst = true}) {
trinityData.replaceEchartsOptionData(bFirst: bFirst).then((value) {
cllRStatisDataOk = true;
try_setState();
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: PreferredSize(
preferredSize: Size.fromHeight(ScreenUtil().setHeight(173)), // appBar
child: AppBar(
automaticallyImplyLeading: false,
centerTitle: true,
titleSpacing: 0.0,
flexibleSpace: Container(
padding: EdgeInsets.only(top: ScreenUtil().statusBarHeight), //
child: Container(
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.centerLeft,
end: Alignment.centerRight,
colors: [
Color.fromRGBO(12, 186, 156, 1),
Color.fromRGBO(39, 127, 235, 1),
],
),
),
),
),
title: Padding(
padding: EdgeInsets.only(left: 0, right: 0),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
getIconAndTextButton(
iconColor: Colors.white,
iconData: Icons.chevron_left_outlined,
onPress: () {
Navigator.pop(context);
},
),
Expanded(
child: RichText(
textAlign: TextAlign.center,
overflow: TextOverflow.ellipsis,
text: TextSpan(children: [
TextSpan(
text: mapStatisType[widget.statisType]['text'],
style: TextStyle(color: Colors.white, fontSize: 20),
),
TextSpan(
text: '\n' + mapStatisType[widget.statisType]['textTerm'],
style: TextStyle(fontSize: 14.0)),
]),
)),
SizedBox(width: 50),
],
),
),
),
),
body: (listCllrtjStatis.isEmpty ||
trinityData.strEchartsOptionNew.isEmpty ||
trinityData.mapAllDw.length < 31)
? getMoreWidget(
color: Colors.black38,
text: '正在下载大量数据,\n请耐心等待...',
size: 25,
textAlign: TextAlign.center)
: Column(
children: [
SizedBox(height: ScreenUtil().setHeight(20)),
//2
trinityData.getBarEcharts(trinityData.strEchartsOptionNew),
//SizedBox(height: ScreenUtil().setHeight(0)),
//3
TableScrollable(mapTableData: trinityData.mapAllDw),
],
),
);
}
}

@ -0,0 +1,640 @@
import 'package:fl_chart/fl_chart.dart';
//import 'package:flustars/flustars.dart';
import 'package:flutter/material.dart';
import 'package:flutter_echarts/flutter_echarts.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:hyzp_ybqx511528_xingwen/components/commonFun.dart';
import 'package:hyzp_ybqx511528_xingwen/components/dioFun.dart';
import 'package:hyzp_ybqx511528_xingwen/components/doJSON.dart';
import 'package:hyzp_ybqx511528_xingwen/components/hyxx_data_handle.dart';
import 'package:hyzp_ybqx511528_xingwen/pages/Works/TJXX/tj_data.dart';
import 'package:hyzp_ybqx511528_xingwen/widget/DropdownItem.dart';
import '../../../services/EventBus.dart';
class ZptjBarEchartsTrinityNewGetData {
static const Color red = const Color(0xffff5182);
static const Color blue = const Color(0xff0000ff);
static const Color firstBarColor = const Color(0xffff5182);
static const Color secondBarColor = const Color.fromRGBO(0, 150, 150, 1);
static const Color thirdBarColor = const Color(0xff00000f);
// static const Color firstBarColor = const Color.fromRGBO(200, 55, 55, 1);
// static const Color secondBarColor = const Color.fromRGBO(100, 170, 170, 1);
// static const Color thirdBarColor = const Color.fromRGBO(45, 45, 45, 1);
static const Color bottomBarColor = const Color(0xff939393);
static const Color gridColor = const Color(0xffe7e8ec);
static const double width = 7;
static const double widthTrinity = 1;
String _textBottom1;
String _textBottom2;
String _textTop1;
String _textTop2;
int _rate = 10; // today
int _rateCoord = 10000; //
int _interval = 20; //
int _maxY = -1;
List<BarChartGroupData> _listBarData = [];
int nDwbh = 0; // 0
ZptjBarEchartsTrinityNewGetData() {
cllRStatisDataGeting = true;
print('cllRStatisDataOk = ${cllRStatisDataOk}');
///
if (!cllRStatisDataOk) {
//listCllrtjStatis
listCllrtjStatis.clear(); //
// 31 ['2021-03-18', '2021-04-17']
List _listDateDuration = getLast31DateString();
mapStatisType['cllrtj']['startDate'] = _listDateDuration[0];
mapStatisType['cllrtj']['endDate'] = _listDateDuration[1];
}
if (listCllrtjStatis.isEmpty) {
if (listDwinfoGetList2.isEmpty) {
//便
getThePageList(theHyshlx: 'dwxx').then((value) {
listDwinfoGetList2 = value;
print('listDwinfoGetList2 = \n$listDwinfoGetList2');
getCllrtjStatisNew('cllrtj').then((value) {
// sortField
//listCllrtjStatis.sort((a, b) => (a['dwbh']).compareTo(b['dwbh']));
getEchartsOptionData().then((value) {
updateEchartsAndTable(); //
});
});
// getCllrtjStatis('cllrtj').then((value) {
// // sortField
// listCllrtjStatis.sort((a, b) => (a['dwbh']).compareTo(b['dwbh']));
// getEchartsOptionData().then((value) {
// updateEchartsAndTable(); //
// });
// });
});
} else {
//便使
print('listDwinfoGetList2 = \n$listDwinfoGetList2');
getCllrtjStatisNew('cllrtj').then((value) {
// sortField
//listCllrtjStatis.sort((a, b) => (a['dwbh']).compareTo(b['dwbh']));
getEchartsOptionData().then((value) {
updateEchartsAndTable(); //
});
});
}
} else {
updateEchartsAndTable(); //
}
// // LED
// eventBus.on<SelectLedDwUpdateEvent>().listen((event) async {
// print(event.str);
//
// //id
// int id = listItems.indexOf(event.selectedValue);
// print('SelectLedDwUpdateEvent: id = ${id}, nDwbh = ${nDwbh}');
// if (id != nDwbh) {
// nDwbh = id;
// updateEchartsAndTable(bFirst: false); //
// }
// });
}
Future updateEchartsAndTable({bool bFirst = true}) {
if (bFirst) {
getListFlields(); //_listItems
}
replaceEchartsOptionData(bFirst: bFirst).then((value) {
cllRStatisDataOk = true;
cllRStatisDataGeting = false;
eventBus.fire(SelectLedDwUpdateEvent('Dropdown选项已改变', nDwbh.toString()));
//try_setState();
});
}
//LEDListID
List listItems = [
// '全部',
// '1、江北振兴大道',
// '2、宜飞路',
// '3、宜宾南收费站',
// '4、一曼路',
// '5、柏溪收费站',
// '6、七星路万达广场',
// '7、宜宾财政局',
// '8、宜威路南广镇',
// '9、宜长路',
// '10、宜南快速通道',
// '11、观斗山隧道',
// '12、大麦坝',
// '13、外江路',
];
//_listItems
Future getListFlields() async {
listItems = ['全部'];
int len = listDwinfoGetList2.length;
for (int i = 0; i < len; i++) {
listItems.add('${i + 1}.' + listDwinfoGetList2[i]['dwmc']);
}
print('_listItems = $listItems');
//_title = '${widget.title}${widget.id.toString()} / ${listDwinfoGetList2.length}';
//try_setState();
}
//1LED
Widget getSelectLedDw() {
return Container(
padding: EdgeInsets.only(top: ScreenUtil().setHeight(11)),
alignment: Alignment.centerLeft,
child: DropdownItem(
listItems: listItems,
// initValue listItems
initValue: listItems[0],
dropdownEvent: 'SelectLedDwUpdateEvent',
width: ScreenUtil().setWidth(500),
height: 35,
), //SizedBox(width: _marginLeft),
);
}
String strDateNew = 'data: ['; // 13
List listStrFlowNew = [];
List listStrAmRushNew = [];
List listStrPmRushNew = [];
// 31 3
Map mapAllDw = {}; // 31 Map
// listCllrtjStatis
Future getEchartsOptionData() async {
// 13
int j = -1;
for (Map mapDw in listCllrtjStatis) {
List listCllmx = mapDw["cllmx"];
String strFlowList2 = 'data: [';
String strAmRushList2 = 'data: [';
String strPmRushList2 = 'data: [';
// 31
int len = listCllmx.length;
print('len = $len');
j++;
for (int i = len - 1; i > -1; i--) {
Map mapDay = listCllmx[i];
if (0 == j) {
// listAllDw
mapAllDw[mapDay["day"]] = {
"all": 0,
"am": 0,
"pm": 0
}; // 31 Map
}
//print(mapDay);
//print('mapDay = ${mapDay}, len = ${mapDay.length}');
//mapDay = {day: 2021-05-19, am_order: 0730:0930, pm_order: 1730:1930, all: null, am: null, pm: null}, len = 6
//mapDay = {day: 2021-05-09, am_order: 0730:0930, pm_order: 1730:1930, all: null, am: null, pm: null}, len = 6
//print('mapDay["all"] = ${mapDay["all"]}, len = ${mapDay["all"].length}');
//Unhandled Exception: NoSuchMethodError: The getter 'length' was called on null.
if (0 == j) {
//
strDateNew += getStrMonthDay(mapDay["day"]); //
}
strFlowList2 += (null == mapDay["all"] ? '0' : mapDay["all"]) + ', '; //
mapAllDw[mapDay["day"]]["all"] += null == mapDay["all"] ? 0 : int.parse(mapDay["all"]);
strAmRushList2 += (null == mapDay["am"] ? '0' : mapDay["am"]) + ', '; //
mapAllDw[mapDay["day"]]["am"] += null == mapDay["am"] ? 0 : int.parse(mapDay["am"]);
strPmRushList2 += (null == mapDay["pm"] ? '0' : mapDay["pm"]) + ', '; //
mapAllDw[mapDay["day"]]["pm"] += null == mapDay["pm"] ? 0 : int.parse(mapDay["pm"]);
}
strFlowList2 += ']'; //
strAmRushList2 += ']'; //
strPmRushList2 += ']'; //
if (0 == j) {
//
strDateNew += ']'; //
}
listStrFlowNew.add(strFlowList2);
listStrAmRushNew.add(strAmRushList2);
listStrPmRushNew.add(strPmRushList2);
}
// List AllDw
insertAlldwData(mapAllDw);
// my_segmentPrint(strDateList);
// my_segmentPrint(strDateNew);
//data: ['1st', '2nd', '3rd', '4th', '5th', '6th', '7th', '8th', '9th', '10th', '11th', '12th', '13th', '14th', '15th', '16th', '17th', '18th', '19th', '20th
// ', '21st', '22nd', '23rd', '24th', '25th', '26th', '27th', '28th', '29th', '30th', '31st',]
//data: ['3.18', '3.19', '3.20', '3.21', '3.22', '3.23', '3.24', '3.25', '3.26', '3.27', '3.28', '3.29', '3.30', '3.31', '4.01', '4.02', '4.03', '4.04', '4.0
// 5', '4.06', '4.07', '4.08', '4.09', '4.10', '4.11', '4.12', '4.13', '4.14', '4.15', '4.16', '4.17', ]
// my_segmentPrint(strFlowList);
// my_segmentPrint(listStrFlowNew[0]);
//data: [320, 302, 301, 334, 390, 330, 320, 320, 302, 301, 334, 390, 330, 320, 320, 302, 301, 334, 390, 330, 320, 320, 302, 301, 334, 390, 330, 320, 320, 302
// , 301,]
//data: [194893, 211019, 242299, 209904, 100941, 261849, 117473, 94218, 130115, 206901, 203021, 176968, 83047, 168084, 178937, 197859, 224155, 190689, 201393
// , 184673, 198215, 200415, 192958, 203951, 198704, 174829, 200787, 205696, 169762, 196270, 193892, ]
// my_segmentPrint(strAmRushList);
// my_segmentPrint(listStrAmRushNew[0]);
//data: [120, 132, 101, 134, 90, 230, 210, 120, 132, 101, 134, 90, 230, 210, 120, 132, 101, 134, 90, 230, 210, 120, 132, 101, 134, 90, 230, 210, 120, 132, 10
// 1,]
//data: [5055, 31048, 23814, 23344, 38457, 36880, 32959, 7875, 6916, 27568, 26921, 20085, 17335, 16304, 22311, 21469, 21440, 15561, 18854, 25972, 25305, 2374
// 3, 23024, 20813, 17755, 21151, 26523, 25628, 17657, 21632, 16196, ]
// my_segmentPrint(strPmRushList);
// my_segmentPrint(listStrPmRushNew[0]);
//data: [220, 182, 191, 234, 290, 330, 310, 220, 182, 191, 234, 290, 330, 310, 220, 182, 191, 234, 290, 330, 310, 220, 182, 191, 234, 290, 330, 310, 220, 182
// , 191,]
//data: [44288, 36414, 32965, 18464, 4156, 30809, 9437, 6974, 24531, 28787, 21435, 24525, 0, 24785, 29147, 26628, 24129, 21751, 30712, 25291, 33308, 32587, 3
// 1470, 29432, 25386, 25123, 27701, 29828, 30249, 33947, 19888, ]
}
// strEchartsOption
Future replaceEchartsOptionData({bool bFirst = true}) async {
print('replaceEchartsOptionData bFirst = $bFirst');
print('replaceEchartsOptionData nDwbh = $nDwbh');
//1strEchartsOption
String strDateList =
'''data: ['1st', '2nd', '3rd', '4th', '5th', '6th', '7th', '8th', '9th', '10th', '11th', '12th', '13th', '14th', '15th', '16th', '17th', '18th', '19th', '20th', '21st', '22nd', '23rd', '24th', '25th', '26th', '27th', '28th', '29th', '30th', '31st',]''';
String strFlowList =
'''data: [320, 302, 301, 334, 390, 330, 320, 320, 302, 301, 334, 390, 330, 320, 320, 302, 301, 334, 390, 330, 320, 320, 302, 301, 334, 390, 330, 320, 320, 302, 301,]''';
String strAmRushList =
'''data: [120, 132, 101, 134, 90, 230, 210, 120, 132, 101, 134, 90, 230, 210, 120, 132, 101, 134, 90, 230, 210, 120, 132, 101, 134, 90, 230, 210, 120, 132, 101,]''';
String strPmRushList =
'''data: [220, 182, 191, 234, 290, 330, 310, 220, 182, 191, 234, 290, 330, 310, 220, 182, 191, 234, 290, 330, 310, 220, 182, 191, 234, 290, 330, 310, 220, 182, 191,]''';
strEchartsOptionNew = strEchartsOption;
//print('strEchartsOptionNew.indexOf(strDateList) = ${strEchartsOptionNew.indexOf(strDateList)}');
//I/flutter (23047): strEchartsOptionNew.indexOf(strDateList) = 1667
strEchartsOptionNew = strEchartsOptionNew.replaceAll(strDateList, strDateNew);
strEchartsOptionNew = strEchartsOptionNew.replaceAll(strFlowList, listStrFlowNew[nDwbh]);
strEchartsOptionNew = strEchartsOptionNew.replaceAll(strAmRushList, listStrAmRushNew[nDwbh]);
strEchartsOptionNew = strEchartsOptionNew.replaceAll(strPmRushList, listStrPmRushNew[nDwbh]);
// listAllDw
// mapAllDw[mapDay["day"]] = {
// "all": 0,
// "am": 0,
// "pm": 0
// }; // 31 Map
if (!bFirst) {
List _listStrFlow = listStrFlowNew[nDwbh]
.substring(listStrFlowNew[nDwbh].indexOf('[') + 1, listStrFlowNew[nDwbh].lastIndexOf(']'))
.split(',');
List _listStrAmRush = listStrAmRushNew[nDwbh]
.substring(
listStrAmRushNew[nDwbh].indexOf('[') + 1, listStrAmRushNew[nDwbh].lastIndexOf(']'))
.split(',');
List _listStrPmRush = listStrPmRushNew[nDwbh]
.substring(
listStrPmRushNew[nDwbh].indexOf('[') + 1, listStrPmRushNew[nDwbh].lastIndexOf(']'))
.split(',');
List listKeys = mapAllDw.keys.toList();
int len = listKeys.length;
for (int i = 0; i < len; i++) {
mapAllDw[listKeys[i]]["all"] = int.parse(_listStrFlow[i].trim());
mapAllDw[listKeys[i]]["am"] = int.parse(_listStrAmRush[i].trim());
mapAllDw[listKeys[i]]["pm"] = int.parse(_listStrPmRush[i].trim());
}
// Map value
//mapAllDw.forEach((var key, var value) {});
}
}
// List AllDw
insertAlldwData(Map mapAllDw) {
// 31 3
//Map mapAllDw = {}; // 31 Map
String strFlow = 'data: [';
String strAmRush = 'data: [';
String strPmRush = 'data: [';
List list = mapAllDw.values.toList();
for (Map m in list) {
strFlow += (m["all"].toString() + ', ');
strAmRush += (m["am"].toString() + ', ');
strPmRush += (m["pm"].toString() + ', ');
}
strFlow += ']';
strAmRush += ']';
strPmRush += ']';
listStrFlowNew.insert(0, strFlow);
listStrAmRushNew.insert(0, strAmRush);
listStrPmRushNew.insert(0, strPmRush);
}
// _strDate .
String getStrMonthDay(String _strDate) {
String _monthDay = '\'' + getStrMonth(_strDate) + getStrDay(_strDate) + '\',';
_monthDay = _monthDay.replaceAll(' ', '');
return _monthDay + ' ';
}
// _strDate _strDay
String getStrDay(String _strDate) {
String _day = _strDate.substring(_strDate.lastIndexOf('-') + 1);
return _day;
}
// _strDate _strMonth
String getStrMonth(String _strDate) {
String _month = _strDate.substring(_strDate.indexOf('-') + 1, _strDate.lastIndexOf('-'));
_month = '0' == _month[0] ? _month[1] : _month; //0
_month = _month + '.';
return _month;
}
String strEchartsOptionNew = '';
String strEchartsOption = '''
{
height: 260,
tooltip: {
trigger: 'axis',
// position: function (pt) {
// return [pt[0], '10%'];
// }
position: function(point, params, dom, rect, size) {
//pointsizeviewSizecontentSizedivtooltip
var x = point[0];
var y = point[1];
var viewWidth = size.viewSize[0];
var viewHeight = size.viewSize[1];
var boxWidth = size.contentSize[0];
var boxHeight = size.contentSize[1];
var posX = 0; //x
var posY = 0; //y
if (x < boxWidth) { //
posX = 5;
} else { //
posX = x - boxWidth;
}
if (y < boxHeight) { //
posY = 5;
} else { //
posY = y - boxHeight;
}
return [posX, posY];
},
},
toolbox: {
//left: '13',//
right: '12',//
top: '7',//
itemSize: '18',
feature: {
// dataZoom: {
// yAxisIndex: 'none'
// },
restore: {},
// saveAsImage: {},
}
},
legend: {
top: '49',//
left: '70',//
//orient: 'vertical',
//data: ['Flow', 'amRush', 'pmRush']
data: ['车流量', '早高峰', '晚高峰']
},
grid: {
height: 230,
left: '0%',
right: '4%',
bottom: '18%',
containLabel: true
},
yAxis: {
type: 'value',
axisLabel: {
show:true,
// textStyle: {
// color: "rgba(255,255,255,.6)",
// fontSize: '12',
// },
formatter: function(value, index) {
// var value;
// if (value >= 100) {
// value = value / 10000;
// } else if (value < 100) {
// value = value;
// }
value = value / 10000;
var dispValue;
if (value < 10) {
dispValue = value.toFixed(1);
} else {
dispValue = value.toFixed(0);
}
return dispValue
},
},
},
xAxis: {
type: 'category',
data: ['1st', '2nd', '3rd', '4th', '5th', '6th', '7th', '8th', '9th', '10th', '11th', '12th', '13th', '14th', '15th', '16th', '17th', '18th', '19th', '20th', '21st', '22nd', '23rd', '24th', '25th', '26th', '27th', '28th', '29th', '30th', '31st',]
},
series: [
{
name: '车流量',
type: 'bar',
data: [320, 302, 301, 334, 390, 330, 320, 320, 302, 301, 334, 390, 330, 320, 320, 302, 301, 334, 390, 330, 320, 320, 302, 301, 334, 390, 330, 320, 320, 302, 301,]
},
{
name: '早高峰',
type: 'bar',
data: [120, 132, 101, 134, 90, 230, 210, 120, 132, 101, 134, 90, 230, 210, 120, 132, 101, 134, 90, 230, 210, 120, 132, 101, 134, 90, 230, 210, 120, 132, 101,]
},
{
name: '晚高峰',
type: 'bar',
data: [220, 182, 191, 234, 290, 330, 310, 220, 182, 191, 234, 290, 330, 310, 220, 182, 191, 234, 290, 330, 310, 220, 182, 191, 234, 290, 330, 310, 220, 182, 191,]
},
],
dataZoom: [
{
type: 'inside',
start: 0,
end: 100,
},
{
//backgroundColor: 'rgba(255,255,255,1)',
//fillerColor: 'rgba(240,240,240,0.25)',
height: 48, //
top: 318, //,'top', 'middle', 'bottom','20%'
bottom: 0, //,'20%'
//bottom: 30
left: 22, //,'left', 'center', 'right','20%'
right: 17, //,'20%'
start: 0,
end: 100,
handleIcon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z',
handleSize: '60%',
handleStyle: {
color: '#fff',
shadowBlur: 3,
shadowColor: 'rgba(0, 0, 0, 0.6)',
shadowOffsetX: 2,
shadowOffsetY: 2
},
},
],
}
''';
//2
Widget getBarEcharts(String _strEchartsOptionNew) {
return Stack(
children: [
//1 Echarts
Align(
child: Container(
width: 350,
height: 379,
alignment: Alignment(0, 0),
child: Echarts(
// extensions: [darkThemeScript],
// theme: 'dark',
captureAllGestures: true,
extraScript: '''
var base = +new Date(1968, 9, 3);
var oneDay = 24 * 3600 * 1000;
var date = []; //
var data = [Math.random() * 300];
for (var i = 1; i < 20000; i++) {
var now = new Date(base += oneDay);
date.push([now.getFullYear(), now.getMonth() + 1, now.getDate()].join('/'));
data.push(Math.round((Math.random() - 0.5) * 20 + data[i - 1]));
}
''',
option: _strEchartsOptionNew,
),
),
),
//2
Positioned(
top: ScreenUtil().setHeight(5),
left: ScreenUtil().setHeight(85),
child: listItems.isEmpty ? getMoreWidget2() : getSelectLedDw(),
),
//3
Positioned(
top: ScreenUtil().setHeight(155),
left: ScreenUtil().setHeight(20),
child: Text('万辆', style: TextStyle(fontSize: 12)),
),
],
);
}
// @override
// Widget build(BuildContext context) {
// return Scaffold(
// // appBar: AppBar(
// // title: Text(mapStatisType['cllrtj']['text']),
// // centerTitle: true,
// // ),
// appBar: PreferredSize(
// preferredSize: Size.fromHeight(ScreenUtil().setHeight(173)), // appBar
// // appBar
// child: AppBar(
// automaticallyImplyLeading: false,
// centerTitle: true,
// titleSpacing: 0.0,
// flexibleSpace: Container(
// //SizedBox(height: ScreenUtil().statusBarHeight), //
// // SizedBox(height: ScreenUtil().setHeight(10)), //
// padding: EdgeInsets.only(top: ScreenUtil().statusBarHeight), //
// child: Container(
// //height: ScreenUtil().setHeight(173),
// decoration: BoxDecoration(
// gradient: LinearGradient(
// begin: Alignment.centerLeft,
// end: Alignment.centerRight,
// colors: [
// Color.fromRGBO(12, 186, 156, 1),
// Color.fromRGBO(39, 127, 235, 1),
// ],
// ),
// ),
// // decoration: BoxDecoration(
// // gradient: LinearGradient(colors: [
// // Color(0xFF0018EB),
// // Color(0xFF01C1D9),
// // ], begin: Alignment.bottomCenter, end: Alignment.topCenter),
// // ),
// ),
// ),
// title: Padding(
// padding: EdgeInsets.only(left: 0, right: 0),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.start,
// children: [
// getIconAndTextButton(
// iconColor: Colors.white,
// iconData: Icons.chevron_left_outlined,
// onPress: () {
// Navigator.pop(context);
// },
// ),
// Expanded(
// child: RichText(
// textAlign: TextAlign.center,
// overflow: TextOverflow.ellipsis,
// text: TextSpan(children: [
// TextSpan(
// text: mapStatisType['cllrtj']['text'],
// style: TextStyle(color: Colors.white, fontSize: 20),
// ),
// TextSpan(
// text: '\n' + mapStatisType['cllrtj']['textTerm'],
// style: TextStyle(fontSize: 14.0)),
// ]),
// )),
// SizedBox(width: 50),
// ],
// ),
// ),
// ),
// ),
// body: (listCllrtjStatis.isEmpty || strEchartsOptionNew.isEmpty || mapAllDw.length < 31)
// ? getMoreWidget(
// color: Colors.black38,
// text: '正在下载大量数据,\n请耐心等待...',
// size: 25,
// textAlign: TextAlign.center)
// : Column(
// children: [
// SizedBox(height: ScreenUtil().setHeight(20)),
// //2
// getBarEcharts(strEchartsOptionNew),
// //SizedBox(height: ScreenUtil().setHeight(0)),
// //3
// TableScrollable(mapTableData: mapAllDw),
// ],
// ),
// );
// }
}

@ -16,6 +16,7 @@ import 'package:hyzp_ybqx511528_xingwen/pages/Works/TJXX/tj_data.dart';
import 'package:hyzp_ybqx511528_xingwen/pages/Works/TJXX/today_list.dart';
import 'package:hyzp_ybqx511528_xingwen/pages/Works/TJXX/zptj_bar_chart.dart';
import 'package:hyzp_ybqx511528_xingwen/pages/Works/TJXX/zptj_bar_chart_one.dart';
import 'package:hyzp_ybqx511528_xingwen/pages/Works/TJXX/zptj_bar_echarts_trinity_new.dart';
import 'package:hyzp_ybqx511528_xingwen/pages/Works/TJXX/zptj_page.dart';
import 'package:hyzp_ybqx511528_xingwen/services/EventBus.dart';
import 'package:url_launcher/url_launcher.dart';
@ -850,12 +851,12 @@ class _Page1_WorksState extends State<Page1_Works>
},
icon: Icons.format_list_numbered_outlined),
);
// list.add(
// _getPicAndTextButton("车流量日统计", "assets/images/车流量日统计.png", () {
// Navigator.of(context).push(MaterialPageRoute(
// builder: (context) => ZptjBarEchartsTrinityNew(statisType: 'cllrtj')));
// }),
// );
list.add(
_getPicAndTextButton("车流量日统计", "assets/images/车流量日统计.png", () {
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => ZptjBarEchartsTrinityNew(statisType: 'cllrtj')));
}),
);
return list;
}

@ -42,7 +42,8 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# version: 1.3.13+20211026
# version: 1.4.1+20211226
# version: 1.4.2+20211227
version: 1.4.4+20211230
# version: 1.4.4+20211230
version: 1.4.6+20211231
environment:
sdk: ">=2.7.0 <3.0.0"

Loading…
Cancel
Save