hyzp_ybqx-Commit042:在点位信息列表页面,对 listDwspGetList2 按 'id' 号排序,解决点位编号不连续的问题
This commit is contained in:
@@ -55,9 +55,14 @@ class _SbglPageState extends State<DwxxGetList> {
|
||||
listDwspGetList2 = listSbglGetList2;
|
||||
|
||||
// 在点位视频列表页面,解决点位编号不连续的问题
|
||||
int _len = listDwspGetList2.length;
|
||||
for (int i = 0; i < _len; i++) {
|
||||
listDwspGetList2[i]['dwbh'] = i + 1;
|
||||
// int _len = listDwspGetList2.length;
|
||||
// for (int i = 0; i < _len; i++) {
|
||||
// listDwspGetList2[i]['dwbh'] = i + 1;
|
||||
// }
|
||||
|
||||
listDwspGetList2.sort((_left, _right) => _left['id'].compareTo(_right['id'])); // list排序
|
||||
for (var item in listDwspGetList2) {
|
||||
print('item = $item');
|
||||
}
|
||||
|
||||
listDwinfoGetList2 = listSbglGetList2;
|
||||
@@ -123,8 +128,11 @@ class _SbglPageState extends State<DwxxGetList> {
|
||||
children: <Widget>[
|
||||
ListTile(
|
||||
//leading: new Icon(Icons.phone),
|
||||
// title: Text(
|
||||
// "${listSbglGetList2[indexRecord]['dwbh'].toString()}. ${listSbglGetList2[indexRecord]['dwmc']}",
|
||||
// style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold)),
|
||||
title: Text(
|
||||
"${listSbglGetList2[indexRecord]['dwbh'].toString()}. ${listSbglGetList2[indexRecord]['dwmc']}",
|
||||
"${listSbglGetList2[indexRecord]['id'].toString()}. ${listSbglGetList2[indexRecord]['dwmc']}",
|
||||
style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold)),
|
||||
subtitle: Text(
|
||||
'dwIP:${listSbglGetList2[indexRecord]['dwip']},${listSbglGetList2[indexRecord]['dwzt']}',
|
||||
|
||||
Reference in New Issue
Block a user