QinGang_interested/lib/pages/home/Tap/special_header.dart

138 lines
3.1 KiB
Dart

enum SpecialWorkTypeEnum {
hotWork('hot_work', 'DH', '动火作业'),
blindboardWork('blindboard_work', 'MBCD', '盲板抽堵作业'),
breakgroundWork('breakground_work', 'DT', '动土作业'),
confinedspaceWork('confinedspace_work', 'SXKJ', '受限空间作业'),
cutRoadWork('cutroad_work', 'DL', '断路作业'),
electricityWork('electricity_work', 'LSYD', '临时用电作业'),
highWork('high_work', 'GC', '高处作业'),
hoistingWork('hoisting_work', 'DZ', '吊装作业');
final String code;
final String shortCode;
final String nameCn;
const SpecialWorkTypeEnum(this.code, this.shortCode, this.nameCn);
/// 根据 code 反查
static SpecialWorkTypeEnum? fromCode(String? code) {
if (code == null || code.isEmpty) return null;
for (final item in SpecialWorkTypeEnum.values) {
if (item.code == code) {
return item;
}
}
return null;
}
/// 根据 code 获取中文名称(常用)
static String getName(String? code) {
return fromCode(code)?.nameCn ?? '';
}
}
enum SpecialListType {
// 待办
task,
// 台账
list,
}
class SpecialListInitData {
List<String> getInitData(SpecialWorkTypeEnum type) {
List<String> list = [
// 动火
"work_place", //动火部位
"work_way",
"workMonitor",
"hotWorkActUser",
"corpinfoId",
"projectExecutionLocationCorpId",
"projectExecutionLocationCorpName",
// 受限空间
"applyDepartment",
"applyUser",
"checkNo",
"signStepFlag",
"gasFlag",
"workLevelName",
"workLevel",
"applyTime",
"operationTypeName",
"xgfFlag",
"limitedSpaceNameAndCode",
"chooseLimitedSpace",
"workContent",
"emergencyEquipment",
"workUserName",
"workChargeUserId",
"workChargeUserName",
"workChargeUserDepartment",
"workChargeUserDepartmentName",
"workGuardianUserId",
"workGuardianUserName",
"workGuardianUserDepartment",
"workGuardianUserDepartmentName",
"isInnerWork",
"projectId",
"projectName",
"xgfId",
"taskWorkLevels",
"preparers",
"workDepartmentName",
"workDepartment",
// 高处作业
"linkSpecialWorks",
"riskResults",
"workStartTime",
"workEndTime",
'workHeight',
// 动土作业
"longitude",
"latitude",
"workScopeAndMethod",
"workScopeAndMethodImage",
// 吊装
"workLocation",
"hoistName",
"pullUserName",
"commandUserName",
"hoistWeight",
// 断路
"relatedUnit",
"breakReason",
// 临时用电
"electricNumber",
"pointPower",
"equipmentNamePower",
"workVoltage",
"electricUser",
"electricUserNo",
"workCommandPerson",
// 盲板抽堵
"blindboardWorkTypeName",
"blindboardWorkType",
"devicePipelineName", // 设备管道名称
"mediumName",
"temperature",
"pressure",
"matertal",
"specification",
"number",
"blindboardWorkParams",
"applyUserSignImage",
];
return list;
}
}
bool isKF = false;