322 lines
16 KiB
Dart
322 lines
16 KiB
Dart
|
|
/// 文件上传类型枚举
|
||
|
|
///
|
||
|
|
/// 该枚举定义了系统中所有支持的文件上传类型,包含类型标识符和对应的存储路径
|
||
|
|
/// 使用示例:
|
||
|
|
/// ```dart
|
||
|
|
/// // 通过类型获取枚举
|
||
|
|
/// UploadFileType? fileType = UploadFileType.fromType('102');
|
||
|
|
///
|
||
|
|
/// // 通过路径获取枚举
|
||
|
|
/// UploadFileType? fileType = UploadFileType.fromPath('hidden_danger_video');
|
||
|
|
///
|
||
|
|
/// // 直接使用枚举值
|
||
|
|
/// String type = UploadFileType.userAvatar.type; // '13'
|
||
|
|
/// String path = UploadFileType.userAvatar.path; // 'user_avatar'
|
||
|
|
/// ```
|
||
|
|
enum UploadFileType {
|
||
|
|
/// 隐患照片 - 类型: '3', 路径: 'hidden_danger_photo'
|
||
|
|
hiddenDangerPhoto('3', 'hidden_danger_photo'),
|
||
|
|
|
||
|
|
/// 隐患整改照片 - 类型: '4', 路径: 'hidden_danger_rectification_photo'
|
||
|
|
hiddenDangerRectificationPhoto('4', 'hidden_danger_rectification_photo'),
|
||
|
|
|
||
|
|
/// 隐患验证照片 - 类型: '5', 路径: 'hidden_danger_verification_photo'
|
||
|
|
hiddenDangerVerificationPhoto('5', 'hidden_danger_verification_photo'),
|
||
|
|
|
||
|
|
/// 证书照片 - 类型: '6', 路径: 'certificate_photo'
|
||
|
|
certificatePhoto('6', 'certificate_photo'),
|
||
|
|
|
||
|
|
/// 受限空间平面图 - 类型: '7', 路径: 'confined_space_plan'
|
||
|
|
confinedSpacePlan('7', 'confined_space_plan'),
|
||
|
|
|
||
|
|
/// 隐患整改方案图 - 类型: '8', 路径: 'hidden_danger_rectification_plan'
|
||
|
|
hiddenDangerRectificationPlan('8', 'hidden_danger_rectification_plan'),
|
||
|
|
|
||
|
|
/// 有限空间确认人签字 - 类型: '9', 路径: 'confined_space_confirmation_signature'
|
||
|
|
confinedSpaceConfirmationSignature('9', 'confined_space_confirmation_signature'),
|
||
|
|
|
||
|
|
/// 劳动合同图片 - 类型: '10', 路径: 'labor_contract_image'
|
||
|
|
laborContractImage('10', 'labor_contract_image'),
|
||
|
|
|
||
|
|
/// 商业保险图片 - 类型: '11', 路径: 'commercial_insurance_image'
|
||
|
|
commercialInsuranceImage('11', 'commercial_insurance_image'),
|
||
|
|
|
||
|
|
/// 证书信息 - 类型: '12', 路径: 'certificate_information'
|
||
|
|
certificateInformation('12', 'certificate_information'),
|
||
|
|
|
||
|
|
/// 用户头像 - 类型: '13', 路径: 'user_avatar'
|
||
|
|
userAvatar('13', 'user_avatar'),
|
||
|
|
|
||
|
|
/// 身份证照片 - 类型: '14', 路径: 'id_card_photo'
|
||
|
|
idCardPhoto('14', 'id_card_photo'),
|
||
|
|
|
||
|
|
/// 社保卡照片 - 类型: '15', 路径: 'social_security_card_photo'
|
||
|
|
socialSecurityCardPhoto('15', 'social_security_card_photo'),
|
||
|
|
|
||
|
|
/// 工伤保险凭证 - 类型: '16', 路径: 'work_related_injury_insurance_certificate'
|
||
|
|
workRelatedInjuryInsuranceCertificate('16', 'work_related_injury_insurance_certificate'),
|
||
|
|
|
||
|
|
/// 特种设备巡检照片 - 类型: '17', 路径: 'special_equipment_inspection_photo'
|
||
|
|
specialEquipmentInspectionPhoto('17', 'special_equipment_inspection_photo'),
|
||
|
|
|
||
|
|
/// 人员证书 - 类型: '18', 路径: 'personnel_certificate'
|
||
|
|
personnelCertificate('18', 'personnel_certificate'),
|
||
|
|
|
||
|
|
/// 三级教育培训 - 类型: '19', 路径: 'three_level_safety_education_training'
|
||
|
|
threeLevelSafetyEducationTraining('19', 'three_level_safety_education_training'),
|
||
|
|
|
||
|
|
/// 重大危险源报警处置前照片 - 类型: '20', 路径: 'major_hazard_source_alarm_before_handling_photo'
|
||
|
|
majorHazardSourceAlarmBeforeHandlingPhoto('20', 'major_hazard_source_alarm_before_handling_photo'),
|
||
|
|
|
||
|
|
/// 重大危险源报警处置后照片 - 类型: '21', 路径: 'major_hazard_source_alarm_after_handling_photo'
|
||
|
|
majorHazardSourceAlarmAfterHandlingPhoto('21', 'major_hazard_source_alarm_after_handling_photo'),
|
||
|
|
|
||
|
|
/// 智能门禁外来车辆驾驶证照片 - 类型: '22', 路径: 'smart_access_control_external_vehicle_driver_license_photo'
|
||
|
|
smartAccessControlExternalVehicleDriverLicensePhoto('22', 'smart_access_control_external_vehicle_driver_license_photo'),
|
||
|
|
|
||
|
|
/// 智能门禁外来车辆行驶证照片 - 类型: '23', 路径: 'smart_access_control_external_vehicle_registration_photo'
|
||
|
|
smartAccessControlExternalVehicleRegistrationPhoto('23', 'smart_access_control_external_vehicle_registration_photo'),
|
||
|
|
|
||
|
|
/// 安全环保检查终验图片 - 类型: '50', 路径: 'safety_and_environmental_inspection_final_acceptance_image'
|
||
|
|
safetyAndEnvironmentalInspectionFinalAcceptanceImage('50', 'safety_and_environmental_inspection_final_acceptance_image'),
|
||
|
|
|
||
|
|
/// 隐患延期临时措施附件 - 类型: '101', 路径: 'hidden_danger_extension_temporary_measures_attachment'
|
||
|
|
hiddenDangerExtensionTemporaryMeasuresAttachment('101', 'hidden_danger_extension_temporary_measures_attachment'),
|
||
|
|
|
||
|
|
/// 隐患视频 - 类型: '102', 路径: 'hidden_danger_video'
|
||
|
|
hiddenDangerVideo('102', 'hidden_danger_video'),
|
||
|
|
|
||
|
|
/// 盲板位置图 - 类型: '105', 路径: 'blind_plate_position_map'
|
||
|
|
blindPlatePositionMap('105', 'blind_plate_position_map'),
|
||
|
|
|
||
|
|
/// 临时处置信息 - 类型: '106', 路径: 'temporary_disposal_information'
|
||
|
|
temporaryDisposalInformation('106', 'temporary_disposal_information'),
|
||
|
|
|
||
|
|
/// 整改建议及方案 - 类型: '107', 路径: 'rectification_suggestions_and_plan'
|
||
|
|
rectificationSuggestionsAndPlan('107', 'rectification_suggestions_and_plan'),
|
||
|
|
|
||
|
|
/// 重大隐患上传隐患调查报告 - 类型: '108', 路径: 'major_hidden_danger_investigation_report'
|
||
|
|
majorHiddenDangerInvestigationReport('108', 'major_hidden_danger_investigation_report'),
|
||
|
|
|
||
|
|
/// 重大隐患安委会或党委会决议记录 - 类型: '109', 路径: 'major_hidden_danger_safety_committee_or_party_committee_resolution_record'
|
||
|
|
majorHiddenDangerSafetyCommitteeOrPartyCommitteeResolutionRecord('109', 'major_hidden_danger_safety_committee_or_party_committee_resolution_record'),
|
||
|
|
|
||
|
|
/// 较大隐患整改-临时处置措施 - 类型: '110', 路径: 'significant_hidden_danger_rectification_temporary_disposal_measures'
|
||
|
|
significantHiddenDangerRectificationTemporaryDisposalMeasures('110', 'significant_hidden_danger_rectification_temporary_disposal_measures'),
|
||
|
|
|
||
|
|
/// 较大隐患整改-隐患整改过程记录 - 类型: '111', 路径: 'significant_hidden_danger_rectification_hidden_danger_rectification_process_record'
|
||
|
|
significantHiddenDangerRectificationHiddenDangerRectificationProcessRecord('111', 'significant_hidden_danger_rectification_hidden_danger_rectification_process_record'),
|
||
|
|
|
||
|
|
/// 补充重大隐患信息 - 类型: '112', 路径: 'supplement_major_hidden_danger_information'
|
||
|
|
supplementMajorHiddenDangerInformation('112', 'supplement_major_hidden_danger_information'),
|
||
|
|
|
||
|
|
/// 安委会办公室会议记录 - 类型: '113', 路径: 'safety_committee_office_meeting_record'
|
||
|
|
safetyCommitteeOfficeMeetingRecord('113', 'safety_committee_office_meeting_record'),
|
||
|
|
|
||
|
|
/// 报警图片 - 类型: '114', 路径: 'alarm_photo'
|
||
|
|
alarmPhoto('114', 'alarm_photo'),
|
||
|
|
|
||
|
|
/// 消防器材类型合格表中照片 - 类型: '115', 路径: 'fire_equipment_type_qualification_photo'
|
||
|
|
fireEquipmentTypeQualificationPhoto('115', 'fire_equipment_type_qualification_photo'),
|
||
|
|
|
||
|
|
/// 动火人图片 - 类型: '116', 路径: 'hot_work_personnel_photo'
|
||
|
|
hotWorkPersonnelPhoto('116', 'hot_work_personnel_photo'),
|
||
|
|
|
||
|
|
/// 安全承诺书签名 - 类型: '117', 路径: 'safety_pledge_signature'
|
||
|
|
safetyPledgeSignature('117', 'safety_pledge_signature'),
|
||
|
|
|
||
|
|
/// 动火单位负责人确认签字 - 类型: '118', 路径: 'hot_work_unit_responsible_person_confirmation_signature'
|
||
|
|
hotWorkUnitResponsiblePersonConfirmationSignature('118', 'hot_work_unit_responsible_person_confirmation_signature'),
|
||
|
|
|
||
|
|
/// 现场管辖单位负责人签字 - 类型: '119', 路径: 'on_site_jurisdiction_unit_responsible_person_signature'
|
||
|
|
onSiteJurisdictionUnitResponsiblePersonSignature('119', 'on_site_jurisdiction_unit_responsible_person_signature'),
|
||
|
|
|
||
|
|
/// 动火许可证签发单位签字 - 类型: '120', 路径: 'hot_work_permit_issuing_unit_signature'
|
||
|
|
hotWorkPermitIssuingUnitSignature('120', 'hot_work_permit_issuing_unit_signature'),
|
||
|
|
|
||
|
|
/// 动火许可证签字 - 类型: '121', 路径: 'hot_work_permit_signature'
|
||
|
|
hotWorkPermitSignature('121', 'hot_work_permit_signature'),
|
||
|
|
|
||
|
|
/// 动火前管辖单位确认签字 - 类型: '122', 路径: 'pre_hot_work_jurisdiction_unit_confirmation_signature'
|
||
|
|
preHotWorkJurisdictionUnitConfirmationSignature('122', 'pre_hot_work_jurisdiction_unit_confirmation_signature'),
|
||
|
|
|
||
|
|
/// 现场负责人确实签字 - 类型: '123', 路径: 'on_site_responsible_person_confirmation_signature'
|
||
|
|
onSiteResponsiblePersonConfirmationSignature('123', 'on_site_responsible_person_confirmation_signature'),
|
||
|
|
|
||
|
|
/// 动火后现场管辖单位确认 - 类型: '124', 路径: 'post_hot_work_site_jurisdiction_unit_confirmation'
|
||
|
|
postHotWorkSiteJurisdictionUnitConfirmation('124', 'post_hot_work_site_jurisdiction_unit_confirmation'),
|
||
|
|
|
||
|
|
/// 延迟监火图片 - 类型: '125', 路径: 'delayed_fire_monitoring_pictures'
|
||
|
|
delayedFireMonitoringPictures('125', 'delayed_fire_monitoring_pictures'),
|
||
|
|
|
||
|
|
/// 安全环保检查发起签字 - 类型: '126', 路径: 'safety_and_environmental_inspection_initiation_signature'
|
||
|
|
safetyAndEnvironmentalInspectionInitiationSignature('126', 'safety_and_environmental_inspection_initiation_signature'),
|
||
|
|
|
||
|
|
/// 检查人确认签字 - 类型: '127', 路径: 'inspector_confirmation_signature'
|
||
|
|
inspectorConfirmationSignature('127', 'inspector_confirmation_signature'),
|
||
|
|
|
||
|
|
/// 被检查人确认签字 - 类型: '128', 路径: 'inspected_person_confirmation_signature'
|
||
|
|
inspectedPersonConfirmationSignature('128', 'inspected_person_confirmation_signature'),
|
||
|
|
|
||
|
|
/// 安全环保检查申辩签字 - 类型: '129', 路径: 'safety_and_environmental_inspection_appeal_signature'
|
||
|
|
safetyAndEnvironmentalInspectionAppealSignature('129', 'safety_and_environmental_inspection_appeal_signature'),
|
||
|
|
|
||
|
|
/// (港股安委办主任)安全总监签发 - 类型: '130', 路径: 'hk_safety_committee_office_director_safety_director_issuance'
|
||
|
|
hkSafetyCommitteeOfficeDirectorSafetyDirectorIssuance('130', 'hk_safety_committee_office_director_safety_director_issuance'),
|
||
|
|
|
||
|
|
/// 动火发包单位签字 - 类型: '131', 路径: 'hot_work_contracting_unit_signature'
|
||
|
|
hotWorkContractingUnitSignature('131', 'hot_work_contracting_unit_signature'),
|
||
|
|
|
||
|
|
/// 安全总监审批 - 类型: '132', 路径: 'safety_director_approval'
|
||
|
|
safetyDirectorApproval('132', 'safety_director_approval'),
|
||
|
|
|
||
|
|
/// 分公司安全总监审批 - 类型: '133', 路径: 'branch_safety_director_approval'
|
||
|
|
branchSafetyDirectorApproval('133', 'branch_safety_director_approval'),
|
||
|
|
|
||
|
|
/// 项目主管部门负责人审核 - 类型: '134', 路径: 'project_authority_review_signature'
|
||
|
|
projectAuthorityReviewSignature('134', 'project_authority_review_signature'),
|
||
|
|
|
||
|
|
/// 分公司主要负责人签批 - 类型: '135', 路径: 'branch_manager_approval_signature'
|
||
|
|
branchManagerApprovalSignature('135', 'branch_manager_approval_signature'),
|
||
|
|
|
||
|
|
/// 事故/事件 - 类型: '136', 路径: 'accident_incident'
|
||
|
|
accidentIncident1('136', 'accident_incident'),
|
||
|
|
|
||
|
|
/// 事故/事件 - 类型: '137', 路径: 'accident_incident'
|
||
|
|
accidentIncident2('137', 'accident_incident'),
|
||
|
|
|
||
|
|
/// 隐患处置方案 - 类型: '138', 路径: 'hidden_disposal_plan'
|
||
|
|
hiddenDisposalPlan('138', 'hidden_disposal_plan'),
|
||
|
|
|
||
|
|
/// 安全环保检查-检查签字 - 类型: '139', 路径: 'safety_environmental_inspection_inspection_signature'
|
||
|
|
safetyEnvironmentalInspectionInspectionSignature('139', 'safety_environmental_inspection_inspection_signature'),
|
||
|
|
|
||
|
|
/// 安全环保检查-检查情况 - 类型: '140', 路径: 'safety_environmental_inspection_inspection_situation'
|
||
|
|
safetyEnvironmentalInspectionInspectionSituation('140', 'safety_environmental_inspection_inspection_situation'),
|
||
|
|
|
||
|
|
/// 安全环保检查-检查人签字 - 类型: '141', 路径: 'safety_environmental_inspection_inspector_signature'
|
||
|
|
safetyEnvironmentalInspectionInspectorSignature('141', 'safety_environmental_inspection_inspector_signature'),
|
||
|
|
|
||
|
|
/// 安全环保检查-被检查人签字 - 类型: '142', 路径: 'safety_environmental_inspection_inspected_signature'
|
||
|
|
safetyEnvironmentalInspectionInspectedSignature('142', 'safety_environmental_inspection_inspected_signature'),
|
||
|
|
|
||
|
|
/// 安全环保检查-被检查文件 - 类型: '143', 路径: 'safety_environmental_inspection_inspected_file'
|
||
|
|
safetyEnvironmentalInspectionInspectedFile('143', 'safety_environmental_inspection_inspected_file'),
|
||
|
|
|
||
|
|
/// 安全环保检查-申辩签字 - 类型: '144', 路径: 'safety_environmental_inspection_defense_signature'
|
||
|
|
safetyEnvironmentalInspectionDefenseSignature('144', 'safety_environmental_inspection_defense_signature'),
|
||
|
|
|
||
|
|
/// 清单检查合格 - 类型: '145', 路径: 'qualified_list_inspection'
|
||
|
|
qualifiedListInspection('145', 'qualified_list_inspection'),
|
||
|
|
|
||
|
|
/// 安全环保检查-验收 - 类型: '146', 路径: 'safety_environmental_inspection_acceptance'
|
||
|
|
safetyEnvironmentalInspectionAcceptance('146', 'safety_environmental_inspection_acceptance'),
|
||
|
|
|
||
|
|
/// 隐患清单排查查签字 - 类型: '147', 路径: 'hidden_qualified_listInspection_signature'
|
||
|
|
hiddenQualifiedListInspectionSignature('147', 'hidden_qualified_listInspection_signature'),
|
||
|
|
|
||
|
|
/// 安全承诺书签字 - 类型: '150', 路径: 'promise_bookmark_photo'
|
||
|
|
promiseBookmarkPhoto('150', 'promise_bookmark_photo'),
|
||
|
|
|
||
|
|
/// 项目相关资料 - 类型: '151', 路径: 'project_related_materials'
|
||
|
|
projectRelatedMaterials('151', 'project_related_materials'),
|
||
|
|
|
||
|
|
/// 人脸识别图片上传 - 类型: '300', 路径: 'facial_recognition_images'
|
||
|
|
facialRecognitionImages('300', 'facial_recognition_images'),
|
||
|
|
/// ai识别图片 - 类型: '301', 路径: 'ai_recognition_images'
|
||
|
|
aiRecognitionImages('301', 'ai_recognition_images'),
|
||
|
|
|
||
|
|
|
||
|
|
/// 门口门禁车辆行驶证照片 - 类型: '601', 路径: 'gate_access_vehicle_license_photo'
|
||
|
|
gateAccessVehicleLicensePhoto('601', 'gate_access_vehicle_license_photo'),
|
||
|
|
|
||
|
|
/// 门口门禁车辆车辆照片 - 类型: '602', 路径: 'gate_access_vehicle_photo'
|
||
|
|
gateAccessVehiclePhoto('602', 'gate_access_vehicle_photo'),
|
||
|
|
|
||
|
|
/// 门口门禁车辆附件 - 类型: '603', 路径: 'gate_access_vehicle_attachment'
|
||
|
|
gateAccessVehicleAttachment('603', 'gate_access_vehicle_attachment'),
|
||
|
|
|
||
|
|
/// 排放标准证明 - 类型: '604', 路径: 'emission_standard_certificate'
|
||
|
|
emissionStandardCertificate('604', 'emission_standard_certificate'),
|
||
|
|
|
||
|
|
/// 机动车登记证书(绿本) - 类型: '605', 路径: 'motor_vehicle_registration_certificate_green_book'
|
||
|
|
motorVehicleRegistrationCertificateGreenBook('605', 'motor_vehicle_registration_certificate_green_book');
|
||
|
|
|
||
|
|
const UploadFileType(this.type, this.path);
|
||
|
|
|
||
|
|
/// 文件类型标识符(字符串格式)
|
||
|
|
final String type;
|
||
|
|
|
||
|
|
/// 文件存储路径
|
||
|
|
final String path;
|
||
|
|
|
||
|
|
/// 通过类型字符串查找对应的枚举值
|
||
|
|
///
|
||
|
|
/// 参数:
|
||
|
|
/// - [type]: 文件类型字符串,如 '102'
|
||
|
|
///
|
||
|
|
/// 返回值:
|
||
|
|
/// - 对应的 UploadFileType 枚举值,如果未找到则返回 null
|
||
|
|
///
|
||
|
|
/// 示例:
|
||
|
|
/// ```dart
|
||
|
|
/// UploadFileType? fileType = UploadFileType.fromType('102');
|
||
|
|
/// if (fileType != null) {
|
||
|
|
/// print(fileType.path); // 输出: hidden_danger_video
|
||
|
|
/// }
|
||
|
|
/// ```
|
||
|
|
static UploadFileType? fromType(String type) {
|
||
|
|
try {
|
||
|
|
return values.firstWhere((element) => element.type == type);
|
||
|
|
} catch (e) {
|
||
|
|
return null;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
/// 通过路径查找对应的枚举值
|
||
|
|
///
|
||
|
|
/// 参数:
|
||
|
|
/// - [path]: 文件存储路径,如 'hidden_danger_video'
|
||
|
|
///
|
||
|
|
/// 返回值:
|
||
|
|
/// - 对应的 UploadFileType 枚举值,如果未找到则返回 null
|
||
|
|
///
|
||
|
|
/// 示例:
|
||
|
|
/// ```dart
|
||
|
|
/// UploadFileType? fileType = UploadFileType.fromPath('hidden_danger_video');
|
||
|
|
/// if (fileType != null) {
|
||
|
|
/// print(fileType.type); // 输出: 102
|
||
|
|
/// }
|
||
|
|
/// ```
|
||
|
|
static UploadFileType? fromPath(String path) {
|
||
|
|
try {
|
||
|
|
return values.firstWhere((element) => element.path == path);
|
||
|
|
} catch (e) {
|
||
|
|
return null;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
/// 获取所有文件类型字符串的列表
|
||
|
|
///
|
||
|
|
/// 返回值:
|
||
|
|
/// - 包含所有文件类型字符串的列表
|
||
|
|
///
|
||
|
|
/// 示例:
|
||
|
|
/// ```dart
|
||
|
|
/// List<String> allTypes = UploadFileType.allTypes;
|
||
|
|
/// print(allTypes.contains('102')); // 输出: true
|
||
|
|
/// ```
|
||
|
|
static List<String> get allTypes => values.map((e) => e.type).toList();
|
||
|
|
|
||
|
|
/// 获取所有文件存储路径的列表
|
||
|
|
///
|
||
|
|
/// 返回值:
|
||
|
|
/// - 包含所有文件存储路径的列表
|
||
|
|
///
|
||
|
|
/// 示例:
|
||
|
|
/// ```dart
|
||
|
|
/// List<String> allPaths = UploadFileType.allPaths;
|
||
|
|
/// print(allPaths.contains('hidden_danger_video')); // 输出: true
|
||
|
|
/// ```
|
||
|
|
static List<String> get allPaths => values.map((e) => e.path).toList();
|
||
|
|
}
|