feat: 增加部分页面
This commit is contained in:
parent
85d9141d17
commit
5c013ce5c1
@ -1,3 +1,4 @@
|
||||
import 'package:starwork_flutter/api/model/team/response/person_list_response.dart';
|
||||
import 'package:starwork_flutter/api/model/team/response/role_list_response.dart';
|
||||
|
||||
class DepartListResponse {
|
||||
@ -31,8 +32,8 @@ class DepartListResponse {
|
||||
class DepartItem {
|
||||
final int? id;
|
||||
final String? teamNo;
|
||||
String? departNo;
|
||||
String? departName;
|
||||
String? departNo;
|
||||
String? departName;
|
||||
final int? parentId;
|
||||
final PersonItem? leader;
|
||||
final int? level;
|
||||
@ -107,64 +108,3 @@ class DepartItem {
|
||||
return 'DepartItem{id: $id, teamNo: $teamNo, departNo: $departNo, departName: $departName, parentId: $parentId, leader: $leader, level: $level, sort: $sort, hasLeaf: $hasLeaf, personNum: $personNum, persons: $persons}';
|
||||
}
|
||||
}
|
||||
|
||||
// 新增 PersonItem 类
|
||||
class PersonItem {
|
||||
final int? id;
|
||||
final String? personName;
|
||||
final int? userId;
|
||||
final int? jobNumber;
|
||||
final int? sex;
|
||||
final String? personNo;
|
||||
final String? phone;
|
||||
final List<RoleListResponse>? roles;
|
||||
|
||||
PersonItem({
|
||||
this.id,
|
||||
this.personName,
|
||||
this.userId,
|
||||
this.jobNumber,
|
||||
this.sex,
|
||||
this.personNo,
|
||||
this.phone,
|
||||
this.roles,
|
||||
});
|
||||
|
||||
factory PersonItem.fromJson(Map<String, dynamic> json) {
|
||||
List<RoleListResponse>? rolesList;
|
||||
if (json['roles'] != null && json['roles'] is List) {
|
||||
rolesList = (json['roles'] as List)
|
||||
.map((item) => RoleListResponse.fromJson(item as Map<String, dynamic>))
|
||||
.toList();
|
||||
}
|
||||
|
||||
return PersonItem(
|
||||
id: json['id'] as int?,
|
||||
personName: json['personName'] as String?,
|
||||
userId: json['userId'] as int?,
|
||||
jobNumber: json['jobNumber'] as int?,
|
||||
sex: json['sex'] as int?,
|
||||
personNo: json['personNo'] as String?,
|
||||
phone: json['phone'] as String?,
|
||||
roles: rolesList,
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'id': id,
|
||||
'personName': personName,
|
||||
'userId': userId,
|
||||
'jobNumber': jobNumber,
|
||||
'sex': sex,
|
||||
'personNo': personNo,
|
||||
'phone': phone,
|
||||
'roles': roles?.map((item) => item.toJson()).toList(),
|
||||
};
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'PersonItem{id: $id, personName: $personName, userId: $userId, jobNumber: $jobNumber, sex: $sex, personNo: $personNo, phone: $phone, roles: $roles}';
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
import 'package:starwork_flutter/api/model/team/response/role_list_response.dart';
|
||||
|
||||
class PersonListResponse {
|
||||
int? pageNo;
|
||||
int? pageSize;
|
||||
@ -65,8 +67,10 @@ class PersonItem {
|
||||
int? faceCount;
|
||||
int? fingerprintCount;
|
||||
int? cardCount;
|
||||
int? userId;
|
||||
bool? isSuper;
|
||||
bool? isOperationUser;
|
||||
List<RoleListResponse>? roles;
|
||||
|
||||
PersonItem({
|
||||
this.id,
|
||||
@ -85,12 +89,15 @@ class PersonItem {
|
||||
this.faceCount,
|
||||
this.fingerprintCount,
|
||||
this.cardCount,
|
||||
this.userId,
|
||||
this.isSuper,
|
||||
this.isOperationUser,
|
||||
this.roles,
|
||||
});
|
||||
|
||||
PersonItem.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'] as int?;
|
||||
userId = json['userId'] as int?;
|
||||
teamNo = json['teamNo'] as String?;
|
||||
departNo = json['departNo'] as String?;
|
||||
departName = json['departName'] as String?;
|
||||
@ -108,11 +115,20 @@ class PersonItem {
|
||||
cardCount = json['cardCount'] as int?;
|
||||
isSuper = json['isSuper'] as bool?;
|
||||
isOperationUser = json['isOperationUser'] as bool?;
|
||||
|
||||
|
||||
if (json['roles'] != null) {
|
||||
roles = <RoleListResponse>[];
|
||||
json['roles'].forEach((v) {
|
||||
roles!.add(RoleListResponse.fromJson(v as Map<String, dynamic>));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['userId'] = userId;
|
||||
data['teamNo'] = teamNo;
|
||||
data['departNo'] = departNo;
|
||||
data['departName'] = departName;
|
||||
@ -130,11 +146,16 @@ class PersonItem {
|
||||
data['cardCount'] = cardCount;
|
||||
data['isSuper'] = isSuper;
|
||||
data['isOperationUser'] = isOperationUser;
|
||||
|
||||
if (roles != null) {
|
||||
data['roles'] = roles!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'PersonItem{id: $id, teamNo: $teamNo, departNo: $departNo, departName: $departName, personNo: $personNo, personName: $personName, jobNumber: $jobNumber, phone: $phone, sex: $sex, sexName: $sexName, pathName: $pathName, state: $state, userState: $userState, faceCount: $faceCount, fingerprintCount: $fingerprintCount, cardCount: $cardCount, isSuper: $isSuper, isOperationUser: $isOperationUser}';
|
||||
return 'PersonItem{id: $id, teamNo: $teamNo, departNo: $departNo, departName: $departName, personNo: $personNo, personName: $personName, jobNumber: $jobNumber, phone: $phone, sex: $sex, sexName: $sexName, pathName: $pathName, state: $state, userState: $userState, faceCount: $faceCount, fingerprintCount: $fingerprintCount, cardCount: $cardCount, isSuper: $isSuper, isOperationUser: $isOperationUser, roles: $roles}';
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
|
||||
|
||||
import 'package:starwork_flutter/api/model/team/response/depart_list_reponse.dart';
|
||||
import 'package:starwork_flutter/api/model/team/response/person_list_response.dart';
|
||||
|
||||
class RoleListResponse {
|
||||
int? id;
|
||||
|
||||
@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:starwork_flutter/api/model/team/request/create_new_depart_request.dart';
|
||||
import 'package:starwork_flutter/api/model/team/response/depart_list_reponse.dart';
|
||||
import 'package:starwork_flutter/api/model/team/response/person_list_response.dart';
|
||||
import 'package:starwork_flutter/api/service/team_api_service.dart';
|
||||
import 'package:starwork_flutter/base/base_controller.dart';
|
||||
import 'package:starwork_flutter/common/constant/app_view_parameter_keys.dart';
|
||||
|
||||
@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:starwork_flutter/api/model/team/response/depart_list_reponse.dart';
|
||||
import 'package:starwork_flutter/api/model/team/response/person_list_response.dart';
|
||||
import 'package:starwork_flutter/base/app_logger.dart';
|
||||
import 'package:starwork_flutter/common/constant/app_colors.dart';
|
||||
import 'package:starwork_flutter/common/widgets/custom_cell_list_widget.dart';
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import 'package:get/get.dart';
|
||||
import 'package:starwork_flutter/api/model/team/request/edit_person_info_request.dart';
|
||||
import 'package:starwork_flutter/api/model/team/response/depart_list_reponse.dart';
|
||||
import 'package:starwork_flutter/api/model/team/response/person_list_response.dart';
|
||||
import 'package:starwork_flutter/api/model/team/response/role_list_response.dart';
|
||||
import 'package:starwork_flutter/api/service/team_api_service.dart';
|
||||
import 'package:starwork_flutter/base/app_logger.dart';
|
||||
|
||||
@ -3,6 +3,7 @@ import 'package:get/get.dart';
|
||||
import 'package:starwork_flutter/api/model/team/request/edit_person_info_request.dart';
|
||||
import 'package:starwork_flutter/api/model/team/response/depart_list_reponse.dart';
|
||||
import 'package:starwork_flutter/api/model/team/response/person_details_response.dart';
|
||||
import 'package:starwork_flutter/api/model/team/response/person_list_response.dart';
|
||||
import 'package:starwork_flutter/api/model/team/response/role_list_response.dart';
|
||||
import 'package:starwork_flutter/api/service/team_api_service.dart';
|
||||
import 'package:starwork_flutter/base/app_logger.dart';
|
||||
|
||||
@ -237,13 +237,19 @@ class EditPersonView extends GetView<EditPersonController> {
|
||||
child: ListView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
children: [
|
||||
_buildHorizontalItem(title: '人脸', count: 0),
|
||||
_buildHorizontalItem(
|
||||
title: '人脸',
|
||||
count: 0,
|
||||
onTap: () {
|
||||
Get.toNamed(AppRoutes.teamEnterFace, arguments: controller.selectedPersonItem.value);
|
||||
},
|
||||
),
|
||||
SizedBox(width: 5.w), // 添加间距
|
||||
_buildHorizontalItem(title: '指纹', count: 0),
|
||||
_buildHorizontalItem(title: '指纹', count: 0, onTap: () {}),
|
||||
SizedBox(width: 5.w), // 添加间距
|
||||
_buildHorizontalItem(title: '卡片', count: 0),
|
||||
_buildHorizontalItem(title: '卡片', count: 0, onTap: () {}),
|
||||
SizedBox(width: 5.w), // 添加间距
|
||||
_buildHorizontalItem(title: '密码', count: 0),
|
||||
_buildHorizontalItem(title: '密码', count: 0, onTap: () {}),
|
||||
],
|
||||
),
|
||||
),
|
||||
@ -604,48 +610,52 @@ class EditPersonView extends GetView<EditPersonController> {
|
||||
_buildHorizontalItem({
|
||||
required String title,
|
||||
required int count,
|
||||
required GestureTapCallback? onTap,
|
||||
}) {
|
||||
return Container(
|
||||
width: 88.w,
|
||||
height: 44.w,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8.r),
|
||||
),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
count.toString(),
|
||||
style: TextStyle(
|
||||
fontSize: 22.sp,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 2.h,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
title,
|
||||
style: TextStyle(
|
||||
fontSize: 12.sp,
|
||||
color: Colors.black54,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
return GestureDetector(
|
||||
onTap: onTap,
|
||||
child: Container(
|
||||
width: 88.w,
|
||||
height: 44.w,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8.r),
|
||||
),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
count.toString(),
|
||||
style: TextStyle(
|
||||
fontSize: 22.sp,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
Icon(
|
||||
Icons.arrow_forward_ios_rounded,
|
||||
size: 12.sp,
|
||||
color: Colors.black54,
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 2.h,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
title,
|
||||
style: TextStyle(
|
||||
fontSize: 12.sp,
|
||||
color: Colors.black54,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
Icon(
|
||||
Icons.arrow_forward_ios_rounded,
|
||||
size: 12.sp,
|
||||
color: Colors.black54,
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import 'package:get/get.dart';
|
||||
import 'package:starwork_flutter/api/model/team/response/person_list_response.dart';
|
||||
|
||||
import 'package:starwork_flutter/base/base_controller.dart';
|
||||
|
||||
class EnterFaceController extends BaseController {
|
||||
@ -9,7 +10,9 @@ class EnterFaceController extends BaseController {
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
final args = Get.arguments;
|
||||
|
||||
if (args != null && args is PersonItem) {
|
||||
print('args: $args');
|
||||
selectedPersonItem.value = args;
|
||||
}
|
||||
}
|
||||
|
||||
@ -59,7 +59,9 @@ class EnterFaceView extends GetView<EnterFaceController> {
|
||||
),
|
||||
),
|
||||
),
|
||||
Text(controller.selectedPersonItem.value?.personName ?? ''),
|
||||
Obx(
|
||||
() => Text(controller.selectedPersonItem.value?.personName ?? ''),
|
||||
),
|
||||
const Spacer(),
|
||||
Text(
|
||||
'未录入'.tr,
|
||||
@ -324,9 +326,7 @@ class EnterFaceView extends GetView<EnterFaceController> {
|
||||
children: [
|
||||
Expanded(
|
||||
child: ElevatedButton(
|
||||
onPressed: () {
|
||||
|
||||
}.debounce(),
|
||||
onPressed: () {}.debounce(),
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Colors.grey[50],
|
||||
padding: EdgeInsets.symmetric(vertical: 10.h),
|
||||
|
||||
@ -6,6 +6,7 @@ import 'package:get/get.dart';
|
||||
import 'package:starwork_flutter/api/model/team/request/create_new_depart_request.dart';
|
||||
import 'package:starwork_flutter/api/model/team/request/get_depart_list_request.dart';
|
||||
import 'package:starwork_flutter/api/model/team/response/depart_list_reponse.dart';
|
||||
import 'package:starwork_flutter/api/model/team/response/person_list_response.dart';
|
||||
import 'package:starwork_flutter/api/model/user/response/user_info_response.dart';
|
||||
import 'package:starwork_flutter/api/service/team_api_service.dart';
|
||||
import 'package:starwork_flutter/base/app_logger.dart';
|
||||
|
||||
@ -6,6 +6,7 @@ import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:starwork_flutter/api/model/team/response/depart_list_reponse.dart';
|
||||
import 'package:starwork_flutter/api/model/team/response/person_list_response.dart';
|
||||
import 'package:starwork_flutter/base/app_logger.dart';
|
||||
import 'package:starwork_flutter/common/constant/app_colors.dart';
|
||||
import 'package:starwork_flutter/common/constant/app_images.dart';
|
||||
|
||||
@ -222,7 +222,7 @@ class RoleManageView extends GetView<RoleManageController> {
|
||||
// 示例:如果 role.personList 存在且不为空
|
||||
if (role.personList != null && role.personList!.isNotEmpty) {
|
||||
// 提取所有 personName 并用逗号连接
|
||||
personNames = role.personList!.map((person) => person.personName ?? '').join(','); // 使用顿号或逗号分隔
|
||||
personNames = role.personList!.map((person) => person?.personName ?? '').join(','); // 使用顿号或逗号分隔
|
||||
} else {
|
||||
// 默认值或空值处理
|
||||
personNames = '暂无用户';
|
||||
|
||||
@ -3,7 +3,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:starwork_flutter/api/model/team/response/depart_list_reponse.dart';
|
||||
import 'package:starwork_flutter/base/app_logger.dart';
|
||||
import 'package:starwork_flutter/api/model/team/response/person_list_response.dart';
|
||||
import 'package:starwork_flutter/common/constant/app_colors.dart';
|
||||
import 'package:starwork_flutter/common/constant/app_images.dart';
|
||||
import 'package:starwork_flutter/common/widgets/custome_app_bar_wdiget.dart';
|
||||
|
||||
@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:starwork_flutter/api/model/team/request/get_depart_list_request.dart';
|
||||
import 'package:starwork_flutter/api/model/team/response/depart_list_reponse.dart';
|
||||
import 'package:starwork_flutter/api/model/team/response/person_list_response.dart';
|
||||
import 'package:starwork_flutter/api/service/team_api_service.dart';
|
||||
import 'package:starwork_flutter/base/base_controller.dart';
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:starwork_flutter/api/model/team/response/depart_list_reponse.dart';
|
||||
import 'package:starwork_flutter/api/model/team/response/person_list_response.dart';
|
||||
import 'package:starwork_flutter/base/app_logger.dart';
|
||||
import 'package:starwork_flutter/common/constant/app_colors.dart';
|
||||
import 'package:starwork_flutter/common/constant/app_images.dart';
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user