zy-react-library 1.3.16 → 1.3.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import{request as e}from"@cqsjjb/jjb-common-lib/http.js";import{useState as t,useEffect as r}from"react";import{executeWithCache as n}from"../../../../utils/index.js";import i from"../../Basic/index.js";import{jsx as a}from"react/jsx-runtime";function p(p){const{params:s={},searchType:o="current",...l}=p,[d,m]=t([]);return r(()=>{(async()=>{let t="";const r={...s,time:(new Date).getTime()};"current"===o&&(t="/basicInfo/department/listTree",delete r.inType,delete r.enterpriseType),"all"===o&&(t="/basicInfo/department/listAllTree",delete r.inType,delete r.enterpriseType,delete r.eqCorpinfoId,delete r.eqParentId),"inType"===o&&(t="/basicInfo/department/listAllTreeByCorpType",delete r.eqCorpinfoId,delete r.eqParentId,r.enterpriseType&&!Array.isArray(r.enterpriseType)&&(r.enterpriseType=[r.enterpriseType]));const i={searchType:o,params:s};await n(i,async()=>{const{data:n}=await e(t,"post",r);return n},m)})()},[]),a(i,{treeData:d,childrenKey:"childrenList",...l})}p.displayName="DepartmentLeftTree";export{p as default};
1
+ import{request as e}from"@cqsjjb/jjb-common-lib/http.js";import{useState as t,useEffect as r}from"react";import{executeWithCache as n,getBaseGateway as p}from"../../../../utils/index.js";import i from"../../Basic/index.js";import{jsx as a}from"react/jsx-runtime";function s(s){const{params:l={},searchType:o="current",...d}=s,[m,y]=t([]);return r(()=>{(async()=>{let t="";const r={...l,time:(new Date).getTime()};"current"===o&&(t=`/${p()}/department/listTree`,delete r.inType,delete r.enterpriseType),"all"===o&&(t=`/${p()}/department/listAllTree`,delete r.inType,delete r.enterpriseType,delete r.eqCorpinfoId,delete r.eqParentId),"inType"===o&&(t=`/${p()}/department/listAllTreeByCorpType`,delete r.eqCorpinfoId,delete r.eqParentId,r.enterpriseType&&!Array.isArray(r.enterpriseType)&&(r.enterpriseType=[r.enterpriseType]));const i={searchType:o,params:l};await n(i,async()=>{const{data:n}=await e(t,"post",r);return n},y)})()},[]),a(i,{treeData:m,childrenKey:"childrenList",...d})}s.displayName="DepartmentLeftTree";export{s as default};
@@ -1 +1 @@
1
- import{request as e}from"@cqsjjb/jjb-common-lib/http.js";import{useState as t,useEffect as r}from"react";import{executeWithCache as o}from"../../../../utils/index.js";import n from"../../Basic/index.js";import{jsx as i}from"react/jsx-runtime";function a(a){const{params:s={},placeholder:m="人员",isNeedCorpInfoId:p=!1,isNeedDepartmentId:d=!0,isNeedPostId:f=!1,extraParams:c={},...l}=a,u={noMain:"",eqEmploymentFlag:1},[I,y]=t([]);return r(()=>{(async()=>{if(!p&&!d&&!f)return void console.error("【PersonnelSelect】 请至少传入一个参数");if(p&&(!s.corpinfoId||"string"!=typeof s.corpinfoId))return;if(d&&(!s.departmentId||"string"!=typeof s.departmentId))return;if(f&&(!s.postId||"string"!=typeof s.postId))return;const t={...u,...c},r={params:s,extraParams:t};await o(r,async()=>{const{data:r}=await e("/basicInfo/user/listAll","get",{...s,...t,time:(new Date).getTime()});return r},y)})()},[JSON.stringify(s),p,d,f,JSON.stringify(c)]),i(n,{data:I,placeholder:m,...l})}a.displayName="PersonnelSelect";export{a as default};
1
+ import{request as e}from"@cqsjjb/jjb-common-lib/http.js";import{useState as t,useEffect as r}from"react";import{executeWithCache as o,getBaseGateway as n}from"../../../../utils/index.js";import i from"../../Basic/index.js";import{jsx as a}from"react/jsx-runtime";function s(s){const{params:m={},placeholder:p="人员",isNeedCorpInfoId:d=!1,isNeedDepartmentId:f=!0,isNeedPostId:c=!1,extraParams:l={},...u}=s,I={noMain:"",eqEmploymentFlag:1},[y,g]=t([]);return r(()=>{(async()=>{if(!d&&!f&&!c)return void console.error("【PersonnelSelect】 请至少传入一个参数");if(d&&(!m.corpinfoId||"string"!=typeof m.corpinfoId))return;if(f&&(!m.departmentId||"string"!=typeof m.departmentId))return;if(c&&(!m.postId||"string"!=typeof m.postId))return;const t={...I,...l},r={params:m,extraParams:t};await o(r,async()=>{const{data:r}=await e(`/${n()}/user/listAll`,"get",{...m,...t,time:(new Date).getTime()});return r},g)})()},[JSON.stringify(m),d,f,c,JSON.stringify(l)]),a(i,{data:y,placeholder:p,...u})}s.displayName="PersonnelSelect";export{s as default};
@@ -1 +1 @@
1
- import{request as e}from"@cqsjjb/jjb-common-lib/http.js";import{useState as r,useEffect as t}from"react";import{executeWithCache as n}from"../../../../utils/index.js";import i from"../../Basic/index.js";import{jsx as a}from"react/jsx-runtime";function p(p){const{params:s={},placeholder:o="部门",isNeedCorpInfoId:d=!1,isNeedParentId:l=!1,searchType:c="current",...m}=p,[y,f]=r([]);return t(()=>{(async()=>{if("current"===c){if(d&&!s.eqCorpinfoId)return;if(l&&!s.eqParentId)return}let r="";const t={...s,time:(new Date).getTime()};"current"===c&&(r="/basicInfo/department/listTree",delete t.inType,delete t.enterpriseType),"all"===c&&(r="/basicInfo/department/listAllTree",delete t.inType,delete t.enterpriseType,delete t.eqCorpinfoId,delete t.eqParentId),"inType"===c&&(r="/basicInfo/department/listAllTreeByCorpType",delete t.eqCorpinfoId,delete t.eqParentId,t.enterpriseType&&!Array.isArray(t.enterpriseType)&&(t.enterpriseType=[t.enterpriseType]));const i={searchType:c,params:s};await n(i,async()=>{const{data:n}=await e(r,"post",t);return n},f)})()},[JSON.stringify(s),d,l,c]),a(i,{treeData:y,placeholder:o,childrenKey:"childrenList",...m})}p.displayName="DepartmentSelectTree";export{p as default};
1
+ import{request as e}from"@cqsjjb/jjb-common-lib/http.js";import{useState as r,useEffect as t}from"react";import{executeWithCache as n,getBaseGateway as i}from"../../../../utils/index.js";import p from"../../Basic/index.js";import{jsx as a}from"react/jsx-runtime";function s(s){const{params:d={},placeholder:o="部门",isNeedCorpInfoId:l=!1,isNeedParentId:c=!1,searchType:m="current",...y}=s,[T,f]=r([]);return t(()=>{(async()=>{if("current"===m){if(l&&!d.eqCorpinfoId)return;if(c&&!d.eqParentId)return}let r="";const t={...d,time:(new Date).getTime()};"current"===m&&(r=`/${i()}/department/listTree`,delete t.inType,delete t.enterpriseType),"all"===m&&(r=`/${i()}/department/listAllTree`,delete t.inType,delete t.enterpriseType,delete t.eqCorpinfoId,delete t.eqParentId),"inType"===m&&(r=`/${i()}/department/listAllTreeByCorpType`,delete t.eqCorpinfoId,delete t.eqParentId,t.enterpriseType&&!Array.isArray(t.enterpriseType)&&(t.enterpriseType=[t.enterpriseType]));const p={searchType:m,params:d};await n(p,async()=>{const{data:n}=await e(r,"post",t);return n},f)})()},[JSON.stringify(d),l,c,m]),a(p,{treeData:T,placeholder:o,childrenKey:"childrenList",...y})}s.displayName="DepartmentSelectTree";export{s as default};
@@ -122,6 +122,10 @@ export declare const UPLOAD_FILE_TYPE_ENUM: {
122
122
  187: 187; // major_hidden_rectification_process_record 重大隐患-隐患整改过程记录
123
123
  188: 188; // attachment_to_safety_responsibility 安全责任清单 清单附件
124
124
  189: 189; // feedback_attachment_of_safety_responsibility 安全责任清单 清单反馈附件
125
+ 190: 190; // shugang_push_supervision_push_files 数港推送 督办推送附件
126
+ 191: 191; // shugang_push_security_monthly_calendar_files 数港推送 安全月历附件
127
+ 192: 192; // shugang_push_mutual_learning_files 数港推送 互学互鉴附件
128
+ 193: 193; // shugang_push_accident_reporting_files 数港推送 事故上报附件
125
129
  302: 302; // fire_safety_inspection_passed_images - 消防点检检查合格
126
130
  407: 407; // special_operation_restricted_space_ledger_attachment - 特殊作业-受限空间作业台账附件
127
131
  701: 701; // material_equipment_warehouse_equipment_facilities - 物资装备库-设备设施
@@ -261,6 +265,10 @@ export declare const UPLOAD_FILE_PATH_ENUM: {
261
265
  187: "major_hidden_rectification_process_record";
262
266
  188: "attachment_to_safety_responsibility";
263
267
  189: "feedback_attachment_of_safety_responsibility";
268
+ 190: "shugang_push_supervision_push_files";
269
+ 191: "shugang_push_security_monthly_calendar_files";
270
+ 192: "shugang_push_mutual_learning_files";
271
+ 193: "shugang_push_accident_reporting_files";
264
272
  302: "fire_safety_inspection_passed_images";
265
273
  407: "special_operation_restricted_space_ledger_attachment";
266
274
  701: "material_equipment_warehouse_equipment_facilities";
@@ -1 +1 @@
1
- const e={10:10,11:11,12:12,13:13,14:14,15:15,16:16,19:19,601:601,602:602,606:606,611:611,607:607,608:608,609:609,610:610,603:603,604:604,605:605,3:3,4:4,5:5,6:6,7:7,8:8,9:9,17:17,18:18,20:20,21:21,22:22,23:23,50:50,101:101,102:102,105:105,106:106,107:107,108:108,109:109,110:110,111:111,112:112,113:113,114:114,115:115,116:116,117:117,118:118,119:119,120:120,121:121,122:122,123:123,124:124,125:125,126:126,127:127,128:128,129:129,130:130,131:131,132:132,133:133,134:134,135:135,136:136,137:137,138:138,139:139,140:140,141:141,142:142,143:143,144:144,146:146,145:145,147:147,148:148,149:149,150:150,151:151,152:152,153:153,154:154,155:155,156:156,157:157,158:158,159:159,160:160,161:161,162:162,163:163,164:164,165:165,166:166,167:167,168:168,169:169,170:170,171:171,172:172,173:173,174:174,175:175,176:176,177:177,178:178,179:179,180:180,181:181,182:182,183:183,184:184,185:185,186:186,187:187,188:188,189:189,302:302,407:407,701:701,702:702,703:703,704:704,705:705,706:706,707:707,708:708,709:709,800:800,801:801},_={10:"labor_contract_image",11:"commercial_insurance_image",12:"certificate_information",13:"user_avatar",14:"id_card_photo",15:"social_security_card_photo",16:"work_related_injury_insurance_certificate",19:"three_level_safety_education_training",601:"gate_access_vehicle_license_photo",602:"gate_access_vehicle_photo",606:"gate_access_vehicle_applicant_signature",611:"gate_access_personnel_applicant_signature",607:"gate_access_vehicle_violation",608:"gate_access_face_photo",609:"enclosed_area_personnel_applicant_signature",610:"enclosed_area_vehicle_applicant_signature",603:"gate_access_vehicle_attachment",604:"emission_standard_certificate",605:"motor_vehicle_registration_certificate_green_book",3:"hidden_danger_photo",4:"hidden_danger_rectification_photo",5:"hidden_danger_verification_photo",6:"certificate_photo",7:"confined_space_plan",8:"hidden_danger_rectification_plan",9:"confined_space_confirmation_signature",17:"special_equipment_inspection_photo",18:"personnel_certificate",20:"major_hazard_source_alarm_before_handling_photo",21:"major_hazard_source_alarm_after_handling_photo",22:"smart_access_control_external_vehicle_driver_license_photo",23:"smart_access_control_external_vehicle_registration_photo",50:"safety_and_environmental_inspection_final_acceptance_image",101:"hidden_danger_extension_temporary_measures_attachment",102:"hidden_danger_video",105:"blind_plate_position_map",106:"temporary_disposal_information",107:"rectification_suggestions_and_plan",108:"major_hidden_danger_investigation_report",109:"major_hidden_danger_safety_committee_or_party_committee_resolution_record",110:"significant_hidden_danger_rectification_temporary_disposal_measures",111:"significant_hidden_danger_rectification_hidden_danger_rectification_process_record",112:"supplement_major_hidden_danger_information",113:"safety_committee_office_meeting_record",114:"alarm_photo",115:"fire_equipment_type_qualification_photo",116:"hot_work_personnel_photo",117:"safety_pledge_signature",118:"hot_work_unit_responsible_person_confirmation_signature",119:"on_site_jurisdiction_unit_responsible_person_signature",120:"hot_work_permit_issuing_unit_signature",121:"hot_work_permit_signature",122:"pre_hot_work_jurisdiction_unit_confirmation_signature",123:"on_site_responsible_person_confirmation_signature",124:"post_hot_work_site_jurisdiction_unit_confirmation",125:"delayed_fire_monitoring_pictures",126:"safety_and_environmental_inspection_initiation_signature",127:"inspector_confirmation_signature",128:"inspected_person_confirmation_signature",129:"safety_and_environmental_inspection_appeal_signature",130:"hk_safety_committee_office_director_safety_director_issuance",131:"hot_work_contracting_unit_signature",132:"safety_director_approval",133:"branch_safety_director_approval",134:"project_authority_review_signature",135:"branch_manager_approval_signature",136:"accident_incident",137:"accident_incident",138:"hidden_disposal_plan",139:"safety_environmental_inspection_inspection_signature",140:"safety_environmental_inspection_inspection_situation",141:"safety_environmental_inspection_inspector_signature",142:"safety_environmental_inspection_inspected_signature",143:"safety_environmental_inspection_inspected_file",144:"safety_environmental_inspection_defense_signature",145:"qualified_list_inspection",146:"safety_environmental_inspection_acceptance",147:"hidden_qualified_listInspection_signature",148:"special_qualification",149:"safety_qualification",150:"promise_bookmark_photo",151:"project_related_materials",152:"legal_and_regulatory_database",153:"regulations_resource_library",154:"responsibility_based_resource_library",155:"institutional_resource_library",156:"security_management_agreement",157:"supervision_personnel_vehicle",158:"supervision_personnel_vehicle_license",159:"special_operation_personnel_photo",160:"special_equipment_operator_photo",161:"main_responsible_person_photo",162:"photos_safety_production_management_personnel",163:"education_and_training_application",164:"cover_of_education_and_training_courses",165:"online_learning_sign_signature",166:"online_learning_exam_signature",167:"course_work_question_content",168:"key_homework_safety_management_agreement",169:"key_homework_inspection_status_img",170:"key_homework_acceptance_pictures",171:"key_homework_attachment_inspected_person",172:"key_homework_hazard_pictures",173:"key_homework_hazard_video",174:"key_homework_rectification_pictures",175:"key_homework_signature_inspector",176:"key_homework_defendant",177:"key_homework_confirmer",178:"ai_alarm_image",179:"major_temporary_disposal_information_confirm",180:"major_supplement_hazard_information",181:"major_safety_committee_records",182:"major_rectification_suggestions",183:"major_hazard_investigation_report",184:"major_party_committee_resolution_record",185:"major_temporary_disposal_information_rectification",186:"major_hidden_danger_rectification_plan",187:"major_hidden_rectification_process_record",188:"attachment_to_safety_responsibility",189:"feedback_attachment_of_safety_responsibility",302:"fire_safety_inspection_passed_images",407:"special_operation_restricted_space_ledger_attachment",701:"material_equipment_warehouse_equipment_facilities",702:"enterprise_plan",703:"emergency_plan",704:"emergency_drill",705:"emergency_drill_summary_evaluation",706:"emergency_knowledge_library_case",707:"emergency_knowledge_library_dangerous_goods",708:"emergency_knowledge_library_hazardous_chemicals",709:"emergency_knowledge_library_generation_process",800:"lot_alarm_handling_image",801:"lot_alarm_handling_video"};export{_ as UPLOAD_FILE_PATH_ENUM,e as UPLOAD_FILE_TYPE_ENUM};
1
+ const e={10:10,11:11,12:12,13:13,14:14,15:15,16:16,19:19,601:601,602:602,606:606,611:611,607:607,608:608,609:609,610:610,603:603,604:604,605:605,3:3,4:4,5:5,6:6,7:7,8:8,9:9,17:17,18:18,20:20,21:21,22:22,23:23,50:50,101:101,102:102,105:105,106:106,107:107,108:108,109:109,110:110,111:111,112:112,113:113,114:114,115:115,116:116,117:117,118:118,119:119,120:120,121:121,122:122,123:123,124:124,125:125,126:126,127:127,128:128,129:129,130:130,131:131,132:132,133:133,134:134,135:135,136:136,137:137,138:138,139:139,140:140,141:141,142:142,143:143,144:144,146:146,145:145,147:147,148:148,149:149,150:150,151:151,152:152,153:153,154:154,155:155,156:156,157:157,158:158,159:159,160:160,161:161,162:162,163:163,164:164,165:165,166:166,167:167,168:168,169:169,170:170,171:171,172:172,173:173,174:174,175:175,176:176,177:177,178:178,179:179,180:180,181:181,182:182,183:183,184:184,185:185,186:186,187:187,188:188,189:189,190:190,191:191,192:192,193:193,302:302,407:407,701:701,702:702,703:703,704:704,705:705,706:706,707:707,708:708,709:709,800:800,801:801},_={10:"labor_contract_image",11:"commercial_insurance_image",12:"certificate_information",13:"user_avatar",14:"id_card_photo",15:"social_security_card_photo",16:"work_related_injury_insurance_certificate",19:"three_level_safety_education_training",601:"gate_access_vehicle_license_photo",602:"gate_access_vehicle_photo",606:"gate_access_vehicle_applicant_signature",611:"gate_access_personnel_applicant_signature",607:"gate_access_vehicle_violation",608:"gate_access_face_photo",609:"enclosed_area_personnel_applicant_signature",610:"enclosed_area_vehicle_applicant_signature",603:"gate_access_vehicle_attachment",604:"emission_standard_certificate",605:"motor_vehicle_registration_certificate_green_book",3:"hidden_danger_photo",4:"hidden_danger_rectification_photo",5:"hidden_danger_verification_photo",6:"certificate_photo",7:"confined_space_plan",8:"hidden_danger_rectification_plan",9:"confined_space_confirmation_signature",17:"special_equipment_inspection_photo",18:"personnel_certificate",20:"major_hazard_source_alarm_before_handling_photo",21:"major_hazard_source_alarm_after_handling_photo",22:"smart_access_control_external_vehicle_driver_license_photo",23:"smart_access_control_external_vehicle_registration_photo",50:"safety_and_environmental_inspection_final_acceptance_image",101:"hidden_danger_extension_temporary_measures_attachment",102:"hidden_danger_video",105:"blind_plate_position_map",106:"temporary_disposal_information",107:"rectification_suggestions_and_plan",108:"major_hidden_danger_investigation_report",109:"major_hidden_danger_safety_committee_or_party_committee_resolution_record",110:"significant_hidden_danger_rectification_temporary_disposal_measures",111:"significant_hidden_danger_rectification_hidden_danger_rectification_process_record",112:"supplement_major_hidden_danger_information",113:"safety_committee_office_meeting_record",114:"alarm_photo",115:"fire_equipment_type_qualification_photo",116:"hot_work_personnel_photo",117:"safety_pledge_signature",118:"hot_work_unit_responsible_person_confirmation_signature",119:"on_site_jurisdiction_unit_responsible_person_signature",120:"hot_work_permit_issuing_unit_signature",121:"hot_work_permit_signature",122:"pre_hot_work_jurisdiction_unit_confirmation_signature",123:"on_site_responsible_person_confirmation_signature",124:"post_hot_work_site_jurisdiction_unit_confirmation",125:"delayed_fire_monitoring_pictures",126:"safety_and_environmental_inspection_initiation_signature",127:"inspector_confirmation_signature",128:"inspected_person_confirmation_signature",129:"safety_and_environmental_inspection_appeal_signature",130:"hk_safety_committee_office_director_safety_director_issuance",131:"hot_work_contracting_unit_signature",132:"safety_director_approval",133:"branch_safety_director_approval",134:"project_authority_review_signature",135:"branch_manager_approval_signature",136:"accident_incident",137:"accident_incident",138:"hidden_disposal_plan",139:"safety_environmental_inspection_inspection_signature",140:"safety_environmental_inspection_inspection_situation",141:"safety_environmental_inspection_inspector_signature",142:"safety_environmental_inspection_inspected_signature",143:"safety_environmental_inspection_inspected_file",144:"safety_environmental_inspection_defense_signature",145:"qualified_list_inspection",146:"safety_environmental_inspection_acceptance",147:"hidden_qualified_listInspection_signature",148:"special_qualification",149:"safety_qualification",150:"promise_bookmark_photo",151:"project_related_materials",152:"legal_and_regulatory_database",153:"regulations_resource_library",154:"responsibility_based_resource_library",155:"institutional_resource_library",156:"security_management_agreement",157:"supervision_personnel_vehicle",158:"supervision_personnel_vehicle_license",159:"special_operation_personnel_photo",160:"special_equipment_operator_photo",161:"main_responsible_person_photo",162:"photos_safety_production_management_personnel",163:"education_and_training_application",164:"cover_of_education_and_training_courses",165:"online_learning_sign_signature",166:"online_learning_exam_signature",167:"course_work_question_content",168:"key_homework_safety_management_agreement",169:"key_homework_inspection_status_img",170:"key_homework_acceptance_pictures",171:"key_homework_attachment_inspected_person",172:"key_homework_hazard_pictures",173:"key_homework_hazard_video",174:"key_homework_rectification_pictures",175:"key_homework_signature_inspector",176:"key_homework_defendant",177:"key_homework_confirmer",178:"ai_alarm_image",179:"major_temporary_disposal_information_confirm",180:"major_supplement_hazard_information",181:"major_safety_committee_records",182:"major_rectification_suggestions",183:"major_hazard_investigation_report",184:"major_party_committee_resolution_record",185:"major_temporary_disposal_information_rectification",186:"major_hidden_danger_rectification_plan",187:"major_hidden_rectification_process_record",188:"attachment_to_safety_responsibility",189:"feedback_attachment_of_safety_responsibility",190:"shugang_push_supervision_push_files",191:"shugang_push_security_monthly_calendar_files",192:"shugang_push_mutual_learning_files",193:"shugang_push_accident_reporting_files",302:"fire_safety_inspection_passed_images",407:"special_operation_restricted_space_ledger_attachment",701:"material_equipment_warehouse_equipment_facilities",702:"enterprise_plan",703:"emergency_plan",704:"emergency_drill",705:"emergency_drill_summary_evaluation",706:"emergency_knowledge_library_case",707:"emergency_knowledge_library_dangerous_goods",708:"emergency_knowledge_library_hazardous_chemicals",709:"emergency_knowledge_library_generation_process",800:"lot_alarm_handling_image",801:"lot_alarm_handling_video"};export{_ as UPLOAD_FILE_PATH_ENUM,e as UPLOAD_FILE_TYPE_ENUM};
@@ -1 +1 @@
1
- import{request as e}from"@cqsjjb/jjb-common-lib/http.js";import{useState as i}from"react";function l(l="object"){const[t,r]=i(!1);let o=0;const s=i=>{if(i)return o++,o>0&&r(!0),new Promise((l,t)=>{const{files:s=[],single:n=!0}=i;if(s)if(Array.isArray(s)){if(0===s.length)return o--,o<=0&&r(!1),void l();if(n){if(!s[0].filePath)return o--,o<=0&&r(!1),void l()}else if(0===s.filter(e=>e.id).length)return o--,o<=0&&r(!1),void l();e(n?`/basicInfo/imgFiles/delete?filePath=${s[0].filePath}`:`/basicInfo/imgFiles/ids?ids=${s.filter(e=>e.id).map(e=>e.id)}`,"delete").then(e=>{l(e.data)}).catch(e=>{t(e)}).finally(()=>{o--,o<=0&&r(!1)})}else console.error("【deleteFile】 的 files 需要是一个数组");else console.error("【deleteFile】 缺少 files 参数")});console.error("【deleteFile】 缺少 options 参数")};return"array"===l?[t,s]:{loading:t,deleteFile:s}}export{l as default};
1
+ import{request as e}from"@cqsjjb/jjb-common-lib/http.js";import{useState as i}from"react";import{getBaseGateway as t}from"../../utils/index.js";function l(l="object"){const[r,o]=i(!1);let s=0;const n=i=>{if(i)return s++,s>0&&o(!0),new Promise((l,r)=>{const{files:n=[],single:f=!0}=i;if(n)if(Array.isArray(n)){if(0===n.length)return s--,s<=0&&o(!1),void l();if(f){if(!n[0].filePath)return s--,s<=0&&o(!1),void l()}else if(0===n.filter(e=>e.id).length)return s--,s<=0&&o(!1),void l();e(f?`/${t()}/imgFiles/delete?filePath=${n[0].filePath}`:`/${t()}/imgFiles/ids?ids=${n.filter(e=>e.id).map(e=>e.id)}`,"delete").then(e=>{l(e.data)}).catch(e=>{r(e)}).finally(()=>{s--,s<=0&&o(!1)})}else console.error("【deleteFile】 的 files 需要是一个数组");else console.error("【deleteFile】 缺少 files 参数")});console.error("【deleteFile】 缺少 options 参数")};return"array"===l?[r,n]:{loading:r,deleteFile:n}}export{l as default};
@@ -1 +1 @@
1
- import{request as e}from"@cqsjjb/jjb-common-lib/http.js";import{useState as o}from"react";import{UPLOAD_FILE_TYPE_ENUM as r}from"../../enum/uploadFile/gwj/index.js";import{addingPrefixToFile as i}from"../../utils/index.js";function n(n="object"){const[t,l]=o(!1);let s=0;const a=o=>{if(o)return s++,s>0&&l(!0),new Promise((n,t)=>{const{eqType:a,eqForeignKey:c,single:p=!0,foreignKey:f,dataSource:g}=o;if(!a)return void console.error("【getFile】 缺少 options.eqType 参数");if(!Object.values(r).includes(a))return void console.error(`【getFile】 传入的 eqType 不在 UPLOAD_FILE_TYPE_ENUM 中,当前传入的 eqType 是 ${a}`);if(p){if(null==c||""===c)return void console.error("【getFile】 缺少 options.eqForeignKey 参数")}else{if(null==f||""===f)return void console.error("【getFile】 缺少 options.foreignKey 参数");if(null==g||""===g)return void console.error("【getFile】 缺少 options.dataSource 参数");if(0===g.length)return l(!1),void n(g)}const u=p?{eqType:a,eqForeignKey:c}:{eqType:a,inForeignKey:g.map(e=>e[f]).join(",")};e("/basicInfo/imgFiles/listAll","get",u).then(e=>{if(p)n(i(e.data).map(e=>({...e,type:void 0})));else{const o=new Map;e.data.forEach(e=>{o.has(e.foreignKey)||o.set(e.foreignKey,[]),o.get(e.foreignKey).push({...e,type:void 0})});const r=g.map(e=>{const r=e[f],n=o.has(r)?i(o.get(r)):[];return{...e,files:n}});n(r)}}).catch(e=>{t(e)}).finally(()=>{s--,s<=0&&l(!1)})});console.error("【getFile】 缺少 options 参数")};return"array"===n?[t,a]:{loading:t,getFile:a}}export{n as default};
1
+ import{request as e}from"@cqsjjb/jjb-common-lib/http.js";import{useState as o}from"react";import{UPLOAD_FILE_TYPE_ENUM as r}from"../../enum/uploadFile/gwj/index.js";import{getBaseGateway as i,addingPrefixToFile as t}from"../../utils/index.js";function n(n="object"){const[l,s]=o(!1);let a=0;const c=o=>{if(o)return a++,a>0&&s(!0),new Promise((n,l)=>{const{eqType:c,eqForeignKey:p,single:g=!0,foreignKey:f,dataSource:u}=o;if(!c)return void console.error("【getFile】 缺少 options.eqType 参数");if(!Object.values(r).includes(c))return void console.error(`【getFile】 传入的 eqType 不在 UPLOAD_FILE_TYPE_ENUM 中,当前传入的 eqType 是 ${c}`);if(g){if(null==p||""===p)return void console.error("【getFile】 缺少 options.eqForeignKey 参数")}else{if(null==f||""===f)return void console.error("【getFile】 缺少 options.foreignKey 参数");if(null==u||""===u)return void console.error("【getFile】 缺少 options.dataSource 参数");if(0===u.length)return s(!1),void n(u)}const y=g?{eqType:c,eqForeignKey:p}:{eqType:c,inForeignKey:u.map(e=>e[f]).join(",")};e(`/${i()}/imgFiles/listAll`,"get",y).then(e=>{if(g)n(t(e.data).map(e=>({...e,type:void 0})));else{const o=new Map;e.data.forEach(e=>{o.has(e.foreignKey)||o.set(e.foreignKey,[]),o.get(e.foreignKey).push({...e,type:void 0})});const r=u.map(e=>{const r=e[f],i=o.has(r)?t(o.get(r)):[];return{...e,files:i}});n(r)}}).catch(e=>{l(e)}).finally(()=>{a--,a<=0&&s(!1)})});console.error("【getFile】 缺少 options 参数")};return"array"===n?[l,c]:{loading:l,getFile:c}}export{n as default};
@@ -1 +1 @@
1
- import{request as t}from"@cqsjjb/jjb-common-lib/http.js";import{useState as o}from"react";function e(e="object"){const[n,r]=o(!1);let a=0;const c=()=>(a++,a>0&&r(!0),new Promise((o,e)=>{t("/basicInfo/user/getInfo","get",{}).then(t=>{o(t.data)}).catch(t=>{e(t)}).finally(()=>{a--,a<=0&&r(!1)})}));return"array"===e?[n,c]:{loading:n,getUserInfo:c}}export{e as default};
1
+ import{request as t}from"@cqsjjb/jjb-common-lib/http.js";import{useState as o}from"react";import{getBaseGateway as e}from"../../utils/index.js";function r(r="object"){const[n,a]=o(!1);let i=0;const s=()=>(i++,i>0&&a(!0),new Promise((o,r)=>{t(`/${e()}/user/getInfo`,"get",{}).then(t=>{o(t.data)}).catch(t=>{r(t)}).finally(()=>{i--,i<=0&&a(!1)})}));return"array"===r?[n,s]:{loading:n,getUserInfo:s}}export{r as default};
@@ -1 +1 @@
1
- import{request as e}from"@cqsjjb/jjb-common-lib/http.js";import{useState as o}from"react";import{UPLOAD_FILE_TYPE_ENUM as i,UPLOAD_FILE_PATH_ENUM as r}from"../../enum/uploadFile/gwj/index.js";function t(t="object"){const[n,l]=o(!1);let a=0;const s=o=>{if(o)return a++,a>0&&l(!0),new Promise((t,n)=>{const{files:s=[],single:p=!0,params:f}=o;if(!s)return void console.error("【uploadFile】 缺少 files 参数");if(!Array.isArray(s))return void console.error("【uploadFile】 的 files 需要是一个数组");if(!f)return void console.error("【uploadFile】 缺少 options.params 参数");if(!f.type)return void console.error("【uploadFile】 缺少 options.params.type 参数");if(!Object.values(i).includes(f.type))return void console.error(`【uploadFile】 传入的 type 不在 UPLOAD_FILE_TYPE_ENUM 中,当前传入的 type 是 ${f.type}`);const d=r[f.type];if(!d)return void console.error(`【uploadFile】未找到 type ${f.type} 对应的 path `);if(!p){if(!f.hasOwnProperty("foreignKey"))return void console.error("【uploadFile】 的 single 是 false,缺少 options.params.foreignKey 参数");void 0!==f.foreignKey&&null!==f.foreignKey||(f.foreignKey="")}if(0===s.length)return a--,a<=0&&l(!1),void t(p?{filePath:""}:{id:f.foreignKey});const c=new FormData;if(s.forEach(e=>{e.originFileObj&&c.append("files",e.originFileObj)}),Object.keys(f).forEach(e=>{c.append(e,f[e])}),c.append("path",d),0===c.getAll("files").length)return a--,a<=0&&l(!1),void t(p?{filePath:s[0].filePath}:{id:f.foreignKey});e(p?"/basicInfo/imgFiles/save":"/basicInfo/imgFiles/batchSave","post",c,{"Content-Type":"multipart/form-data"}).then(e=>{t(p?{filePath:e.data.filePath}:{id:e.data.foreignKey})}).catch(e=>{n(e)}).finally(()=>{a--,a<=0&&l(!1)})});console.error("【uploadFile】 缺少 options 参数")};return"array"===t?[n,s]:{loading:n,uploadFile:s}}export{t as default};
1
+ import{request as e}from"@cqsjjb/jjb-common-lib/http.js";import{useState as o}from"react";import{UPLOAD_FILE_TYPE_ENUM as r,UPLOAD_FILE_PATH_ENUM as i}from"../../enum/uploadFile/gwj/index.js";import{getBaseGateway as t}from"../../utils/index.js";function l(l="object"){const[n,a]=o(!1);let p=0;const s=o=>{if(o)return p++,p>0&&a(!0),new Promise((l,n)=>{const{files:s=[],single:f=!0,params:d}=o;if(!s)return void console.error("【uploadFile】 缺少 files 参数");if(!Array.isArray(s))return void console.error("【uploadFile】 的 files 需要是一个数组");if(!d)return void console.error("【uploadFile】 缺少 options.params 参数");if(!d.type)return void console.error("【uploadFile】 缺少 options.params.type 参数");if(!Object.values(r).includes(d.type))return void console.error(`【uploadFile】 传入的 type 不在 UPLOAD_FILE_TYPE_ENUM 中,当前传入的 type 是 ${d.type}`);const u=i[d.type];if(!u)return void console.error(`【uploadFile】未找到 type ${d.type} 对应的 path `);if(!f){if(!d.hasOwnProperty("foreignKey"))return void console.error("【uploadFile】 的 single 是 false,缺少 options.params.foreignKey 参数");void 0!==d.foreignKey&&null!==d.foreignKey||(d.foreignKey="")}if(0===s.length)return p--,p<=0&&a(!1),void l(f?{filePath:""}:{id:d.foreignKey});const c=new FormData;if(s.forEach(e=>{e.originFileObj&&c.append("files",e.originFileObj)}),Object.keys(d).forEach(e=>{c.append(e,d[e])}),c.append("path",u),0===c.getAll("files").length)return p--,p<=0&&a(!1),void l(f?{filePath:s[0].filePath}:{id:d.foreignKey});e(f?`/${t()}/imgFiles/save`:`/${t()}/imgFiles/batchSave`,"post",c,{"Content-Type":"multipart/form-data"}).then(e=>{l(f?{filePath:e.data.filePath}:{id:e.data.foreignKey})}).catch(e=>{n(e)}).finally(()=>{p--,p<=0&&a(!1)})});console.error("【uploadFile】 缺少 options 参数")};return"array"===l?[n,s]:{loading:n,uploadFile:s}}export{l as default};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "zy-react-library",
3
3
  "private": false,
4
- "version": "1.3.16",
4
+ "version": "1.3.18",
5
5
  "type": "module",
6
6
  "description": "",
7
7
  "author": "LiuJiaNan",
package/utils/index.d.ts CHANGED
@@ -273,6 +273,12 @@ export function getIndexColumn(pagination: false | BasePaginationConfig): {
273
273
  * 获取文件url
274
274
  */
275
275
  export function getFileUrl(): string;
276
+
277
+ /**
278
+ * 获取基础接口放在哪个gateway服务下
279
+ */
280
+ export function getBaseGateway(): string;
281
+
276
282
  /**
277
283
  * 从服务器获取文件url
278
284
  */
package/utils/index.js CHANGED
@@ -1 +1 @@
1
- import{request}from"@cqsjjb/jjb-common-lib/http.js";import dayjs from"dayjs";import{ID_NUMBER}from"../regular/index.js";function serialNumber(e,t){return(e.current-1)*e.pageSize+(t+1)}function toArrayString(value){return value?eval(value).map(String):[]}function interceptTheSuffix(e,t){return e.substring(e.lastIndexOf("."),e.length).toLowerCase()===t.toLowerCase()}function image2Base64(e){return new Promise(t=>{const n=new Image;n.src=e,n.crossOrigin="Anonymous",n.onload=function(){const e=document.createElement("canvas");e.width=n.width,e.height=n.height,e.getContext("2d").drawImage(n,0,0,n.width,n.height);const r=n.src.substring(n.src.lastIndexOf(".")+1).toLowerCase();t(e.toDataURL(`image/${r}`))}})}function image2Base642(e){return new Promise((t,n)=>{const r=new FileReader;r.readAsDataURL(e),r.onload=e=>{t(e.target.result)},r.onerror=e=>{n(e)}})}function base642File(e,t="file"){const n=e.split(","),r=n[0].match(/:(.*?);/)[1],a=r.split("/")[1],i=atob(n[1]);let s=i.length;const o=new Uint8Array(s);for(;s--;)o[s]=i.charCodeAt(s);return new File([o],`${t}.${a}`,{type:r})}function checkImgExists(e){return new Promise((t,n)=>{const r=new Image;r.src=e,r.onload=function(e){t(e)},r.onerror=function(e){n(e)}})}function getDataType(e){return Object.prototype.toString.call(e).slice(8,-1)}function ArrayDeduplication(e){return[...new Set(e)]}function arrayObjectDeduplication(e,t){const n={};return e.reduce((e,r)=>(n[r[t]]||(n[r[t]]=!0,e.push(r)),e),[])}function findCharIndex(e){const{str:t,char:n,num:r}=e;let a=t.indexOf(n);if(-1===a)return-1;for(let e=0;e<r-1;e++)if(a=t.indexOf(n,a+1),-1===a)return-1;return a}function randoms(e,t){return Math.random()*(t-e+1)+e}function numFormat(e){if(e){const t=e.toString().split("."),n=t[0].split("").reverse();let r=[];for(let e=0;e<n.length;e++)e%3==0&&0!==e&&r.push(","),r.push(n[e]);return r.reverse(),r=t[1]?r.join("").concat(`.${t[1]}`):r.join(""),r}}function isEmpty(e){return null==e||"object"==typeof e&&0===Object.keys(e).length||"string"==typeof e&&0===e.trim().length}function getUrlParam(e){const t=new RegExp(`(^|&)${e}=([^&]*)(&|$)`),n=window.location.search.substr(1).match(t);return null!=n?decodeURI(n[2]):""}function paging(e){const{list:t,currentPage:n,pageSize:r}=e;return t.filter((e,t)=>t<+n*+r&&t>=(+n-1)*+r)}function getFileSuffix(e){return e.substring(e.lastIndexOf(".")+1)}function getFileName(e){return e?e.substring(e.lastIndexOf("/")+1):""}function readTxtDocument(e){return new Promise(t=>{const n=getFileUrl()+e,r=new XMLHttpRequest;r.open("get",n,!0),r.responseType="blob",r.onload=function(e){const n=new FileReader;n.readAsText(e.target.response,"GB2312"),n.onload=function(){t(n.result)}},r.send()})}function secondConversion(e){if(!e)return 0;const t=Number.parseInt((e/60/60).toString(),10),n=Number.parseInt((e/60%60).toString(),10),r=Number.parseInt((e%60).toString(),10);return t?`${t}小时${n}分钟${r}秒`:n?`${n}分钟${r}秒`:`${r}秒`}function addingPrefixToFile(e,t={}){if(!e)return[];const{pathKey:n="filePath",nameKey:r="fileName",idKey:a="id"}=t,i=getFileUrl();return e.filter(e=>e[n]).map(e=>({url:i+e[n],name:e[r]||getFileName(e[n]),id:e[a],...e}))}function getLabelName(e){const{status:t,list:n,idKey:r="bianma",nameKey:a="name"}=e;return(n.find(e=>e[r]?.toString()===t?.toString())||{[a]:""})[a]}function calculateFileSize(e){return e>1024?`${(""+e/1024).substring(0,(""+e/1024).lastIndexOf(".")+3)}MB`:`${e}KB`}function idCardGetDateAndGender(e){let t="",n="";if(ID_NUMBER.test(e)){const r=e.substring(6,14),a=e.substring(16,17),i=`${r.substring(0,4)}-${r.substring(4,6)}-${r.substring(6,8)}`,s=new Date(i.replace(/-/g,"/")),o=s.getMonth()+1;let c;const l=s.getDate();let u;c=o<10?`0${o}`:o,u=l<10?`0${l}`:l,t=a%2==1?"1":"0",n=`${s.getFullYear()}-${c}-${u}`}return{sex:t,date:n}}function getMatchedItems(e){const{list:t,value:n,idKey:r="bianma"}=e;return t.filter(e=>n.includes(e[r]))}function getUnmatchedItems(e){const{list:t,value:n,idKey:r="bianma"}=e;return t.filter(e=>!n.includes(e[r]))}function listTransTree(e){const{json:t,idKey:n,parentIdKey:r,childrenKey:a}=e,i=[],s={};let o=0,c=0;const l=t.length;for(;o<l;o++)s[t[o][n]]=t[o];for(;c<l;c++){const e=t[c],n=s[e[r]];n?(!n[a]&&(n[a]=[]),n[a].push(e)):i.push(e)}return i}function isEmptyToWhether(e,t={}){const{yesText:n="是",noText:r="否",yesValue:a="1"}=t;return isEmpty(e)?"":e.toString()===a.toString()?n:r}function createGuid(e=32){let t="";for(let n=0;n<e;n++)t+="abcdefghijklmnopqrstuvwxyz0123456789".charAt(Math.floor(36*Math.random()));return t}function getIndexColumn(e){return{title:"序号",key:"index",width:70,render:(t,n,r)=>!1===e?r+1:serialNumber(e,r)}}function getTreeNodePaths(e){const{data:t,targetId:n,idKey:r,childrenKey:a,path:i=[],isIncludeOneself:s}=e;for(let e=0;e<t.length;e++){const o=t[e],c=[...i,o];if(o[r]===n)return s?c:i;if(o[a]&&o[a].length>0){const e=getTreeNodePaths({data:o[a],targetId:n,idKey:r,childrenKey:a,path:c,isIncludeOneself:s});if(e)return e}}return null}function processTreeDataByLevel(e){const{data:t,level:n,childrenKey:r,currentLevel:a=1}=e;return t.map(e=>{const t={...e};return n&&a>=n?(t.isLeaf=!0,delete t[r]):e[r]&&e[r].length>0?t[r]=processTreeDataByLevel({data:e[r],currentLevel:a+1,level:n,childrenKey:r}):t.isLeaf=!0,t})}function processTreeDataForOnlyLastLevel(e){const{data:t,childrenKey:n,onlyLastLevel:r=!1}=e;return r?t.map(e=>{const t=e[n]&&e[n].length>0,a={...e,selectable:!t};return t&&(a[n]=processTreeDataForOnlyLastLevel({data:e[n],childrenKey:n,onlyLastLevel:r})),a}):t}function validatorEndTime(e){let{startTime:t,message:n="结束时间不能早于开始时间",type:r=""}=e||{};return{validator:(e,a)=>{if(!a||!t)return Promise.resolve();if(!r){const e=/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/;/^\d{4}-\d{2}-\d{2}$/.test(t)?r="date":e.test(t)&&(r="datetime")}return(dayjs.isDayjs(a)?a:dayjs(a)).isBefore(dayjs(t),"date"===r?"day":"seconds")?Promise.reject(n):Promise.resolve()}}}function validatorTimeGTCurrentDay(e){const{message:t="需要大于当前时间",type:n="date"}=e||{};return{validator:(e,r)=>{if(!r)return Promise.resolve();const a=dayjs.isDayjs(r)?r:dayjs(r),i=dayjs();return("date"===n?a.isAfter(i,"day"):a.isAfter(i,"seconds"))?Promise.resolve():Promise.reject(t)}}}function validatorTimeGECurrentDay(e){const{message:t="需要大于等于当前时间",type:n="date"}=e||{};return{validator:(e,r)=>{if(!r)return Promise.resolve();const a=dayjs.isDayjs(r)?r:dayjs(r),i=dayjs();return("date"===n?a.isBefore(i,"day"):a.isBefore(i,"seconds"))?Promise.reject(t):Promise.resolve()}}}function dynamicLoadJs(e){return new Promise((t,n)=>{const r=document.createElement("script");r.type="text/javascript",r.src=e,r.onload=t,r.onerror=n,document.body.appendChild(r)})}function dynamicLoadCss(e){return new Promise((t,n)=>{const r=document.createElement("link");r.rel="stylesheet",r.type="text/css",r.href=e,r.onload=t,r.onerror=n,document.head.appendChild(r)})}function normalizeEmptyHtml(e){if(!e)return"";const t=e.replace(/\s+/g,"").toLowerCase();return"<p><br></p>"===t||"<p></p>"===t||""===t?"":e}function getFileUrl(){return window.fileUrl||process.env.app.fileUrl}async function getFileUrlFromServer(){if(window.fileUrl)return;const{data:e}=await request("/basicInfo/imgFiles/getImagePath","get");window.fileUrl=e}const requestCacheMap=new Map;async function executeWithCache(e,t,n){n([]);const r="string"==typeof e?e:JSON.stringify(e);if(requestCacheMap.has(r))return n(requestCacheMap.get(r)),requestCacheMap.get(r);const a=await t();return requestCacheMap.set(r,a),n(a),a}export{ArrayDeduplication,addingPrefixToFile,arrayObjectDeduplication,base642File,calculateFileSize,checkImgExists,createGuid,dynamicLoadCss,dynamicLoadJs,executeWithCache,findCharIndex,getDataType,getFileName,getFileSuffix,getFileUrl,getFileUrlFromServer,getIndexColumn,getLabelName,getMatchedItems,getTreeNodePaths,getUnmatchedItems,getUrlParam,idCardGetDateAndGender,image2Base64,image2Base642,interceptTheSuffix,isEmpty,isEmptyToWhether,listTransTree,normalizeEmptyHtml,numFormat,paging,processTreeDataByLevel,processTreeDataForOnlyLastLevel,randoms,readTxtDocument,secondConversion,serialNumber,toArrayString,validatorEndTime,validatorTimeGECurrentDay,validatorTimeGTCurrentDay};
1
+ import{request}from"@cqsjjb/jjb-common-lib/http.js";import dayjs from"dayjs";import{ID_NUMBER}from"../regular/index.js";function serialNumber(e,t){return(e.current-1)*e.pageSize+(t+1)}function toArrayString(value){return value?eval(value).map(String):[]}function interceptTheSuffix(e,t){return e.substring(e.lastIndexOf("."),e.length).toLowerCase()===t.toLowerCase()}function image2Base64(e){return new Promise(t=>{const n=new Image;n.src=e,n.crossOrigin="Anonymous",n.onload=function(){const e=document.createElement("canvas");e.width=n.width,e.height=n.height,e.getContext("2d").drawImage(n,0,0,n.width,n.height);const r=n.src.substring(n.src.lastIndexOf(".")+1).toLowerCase();t(e.toDataURL(`image/${r}`))}})}function image2Base642(e){return new Promise((t,n)=>{const r=new FileReader;r.readAsDataURL(e),r.onload=e=>{t(e.target.result)},r.onerror=e=>{n(e)}})}function base642File(e,t="file"){const n=e.split(","),r=n[0].match(/:(.*?);/)[1],a=r.split("/")[1],i=atob(n[1]);let s=i.length;const o=new Uint8Array(s);for(;s--;)o[s]=i.charCodeAt(s);return new File([o],`${t}.${a}`,{type:r})}function checkImgExists(e){return new Promise((t,n)=>{const r=new Image;r.src=e,r.onload=function(e){t(e)},r.onerror=function(e){n(e)}})}function getDataType(e){return Object.prototype.toString.call(e).slice(8,-1)}function ArrayDeduplication(e){return[...new Set(e)]}function arrayObjectDeduplication(e,t){const n={};return e.reduce((e,r)=>(n[r[t]]||(n[r[t]]=!0,e.push(r)),e),[])}function findCharIndex(e){const{str:t,char:n,num:r}=e;let a=t.indexOf(n);if(-1===a)return-1;for(let e=0;e<r-1;e++)if(a=t.indexOf(n,a+1),-1===a)return-1;return a}function randoms(e,t){return Math.random()*(t-e+1)+e}function numFormat(e){if(e){const t=e.toString().split("."),n=t[0].split("").reverse();let r=[];for(let e=0;e<n.length;e++)e%3==0&&0!==e&&r.push(","),r.push(n[e]);return r.reverse(),r=t[1]?r.join("").concat(`.${t[1]}`):r.join(""),r}}function isEmpty(e){return null==e||"object"==typeof e&&0===Object.keys(e).length||"string"==typeof e&&0===e.trim().length}function getUrlParam(e){const t=new RegExp(`(^|&)${e}=([^&]*)(&|$)`),n=window.location.search.substr(1).match(t);return null!=n?decodeURI(n[2]):""}function paging(e){const{list:t,currentPage:n,pageSize:r}=e;return t.filter((e,t)=>t<+n*+r&&t>=(+n-1)*+r)}function getFileSuffix(e){return e.substring(e.lastIndexOf(".")+1)}function getFileName(e){return e?e.substring(e.lastIndexOf("/")+1):""}function readTxtDocument(e){return new Promise(t=>{const n=getFileUrl()+e,r=new XMLHttpRequest;r.open("get",n,!0),r.responseType="blob",r.onload=function(e){const n=new FileReader;n.readAsText(e.target.response,"GB2312"),n.onload=function(){t(n.result)}},r.send()})}function secondConversion(e){if(!e)return 0;const t=Number.parseInt((e/60/60).toString(),10),n=Number.parseInt((e/60%60).toString(),10),r=Number.parseInt((e%60).toString(),10);return t?`${t}小时${n}分钟${r}秒`:n?`${n}分钟${r}秒`:`${r}秒`}function addingPrefixToFile(e,t={}){if(!e)return[];const{pathKey:n="filePath",nameKey:r="fileName",idKey:a="id"}=t,i=getFileUrl();return e.filter(e=>e[n]).map(e=>({url:i+e[n],name:e[r]||getFileName(e[n]),id:e[a],...e}))}function getLabelName(e){const{status:t,list:n,idKey:r="bianma",nameKey:a="name"}=e;return(n.find(e=>e[r]?.toString()===t?.toString())||{[a]:""})[a]}function calculateFileSize(e){return e>1024?`${(""+e/1024).substring(0,(""+e/1024).lastIndexOf(".")+3)}MB`:`${e}KB`}function idCardGetDateAndGender(e){let t="",n="";if(ID_NUMBER.test(e)){const r=e.substring(6,14),a=e.substring(16,17),i=`${r.substring(0,4)}-${r.substring(4,6)}-${r.substring(6,8)}`,s=new Date(i.replace(/-/g,"/")),o=s.getMonth()+1;let c;const l=s.getDate();let u;c=o<10?`0${o}`:o,u=l<10?`0${l}`:l,t=a%2==1?"1":"0",n=`${s.getFullYear()}-${c}-${u}`}return{sex:t,date:n}}function getMatchedItems(e){const{list:t,value:n,idKey:r="bianma"}=e;return t.filter(e=>n.includes(e[r]))}function getUnmatchedItems(e){const{list:t,value:n,idKey:r="bianma"}=e;return t.filter(e=>!n.includes(e[r]))}function listTransTree(e){const{json:t,idKey:n,parentIdKey:r,childrenKey:a}=e,i=[],s={};let o=0,c=0;const l=t.length;for(;o<l;o++)s[t[o][n]]=t[o];for(;c<l;c++){const e=t[c],n=s[e[r]];n?(!n[a]&&(n[a]=[]),n[a].push(e)):i.push(e)}return i}function isEmptyToWhether(e,t={}){const{yesText:n="是",noText:r="否",yesValue:a="1"}=t;return isEmpty(e)?"":e.toString()===a.toString()?n:r}function createGuid(e=32){let t="";for(let n=0;n<e;n++)t+="abcdefghijklmnopqrstuvwxyz0123456789".charAt(Math.floor(36*Math.random()));return t}function getIndexColumn(e){return{title:"序号",key:"index",width:70,render:(t,n,r)=>!1===e?r+1:serialNumber(e,r)}}function getTreeNodePaths(e){const{data:t,targetId:n,idKey:r,childrenKey:a,path:i=[],isIncludeOneself:s}=e;for(let e=0;e<t.length;e++){const o=t[e],c=[...i,o];if(o[r]===n)return s?c:i;if(o[a]&&o[a].length>0){const e=getTreeNodePaths({data:o[a],targetId:n,idKey:r,childrenKey:a,path:c,isIncludeOneself:s});if(e)return e}}return null}function processTreeDataByLevel(e){const{data:t,level:n,childrenKey:r,currentLevel:a=1}=e;return t.map(e=>{const t={...e};return n&&a>=n?(t.isLeaf=!0,delete t[r]):e[r]&&e[r].length>0?t[r]=processTreeDataByLevel({data:e[r],currentLevel:a+1,level:n,childrenKey:r}):t.isLeaf=!0,t})}function processTreeDataForOnlyLastLevel(e){const{data:t,childrenKey:n,onlyLastLevel:r=!1}=e;return r?t.map(e=>{const t=e[n]&&e[n].length>0,a={...e,selectable:!t};return t&&(a[n]=processTreeDataForOnlyLastLevel({data:e[n],childrenKey:n,onlyLastLevel:r})),a}):t}function validatorEndTime(e){let{startTime:t,message:n="结束时间不能早于开始时间",type:r=""}=e||{};return{validator:(e,a)=>{if(!a||!t)return Promise.resolve();if(!r){const e=/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/;/^\d{4}-\d{2}-\d{2}$/.test(t)?r="date":e.test(t)&&(r="datetime")}return(dayjs.isDayjs(a)?a:dayjs(a)).isBefore(dayjs(t),"date"===r?"day":"seconds")?Promise.reject(n):Promise.resolve()}}}function validatorTimeGTCurrentDay(e){const{message:t="需要大于当前时间",type:n="date"}=e||{};return{validator:(e,r)=>{if(!r)return Promise.resolve();const a=dayjs.isDayjs(r)?r:dayjs(r),i=dayjs();return("date"===n?a.isAfter(i,"day"):a.isAfter(i,"seconds"))?Promise.resolve():Promise.reject(t)}}}function validatorTimeGECurrentDay(e){const{message:t="需要大于等于当前时间",type:n="date"}=e||{};return{validator:(e,r)=>{if(!r)return Promise.resolve();const a=dayjs.isDayjs(r)?r:dayjs(r),i=dayjs();return("date"===n?a.isBefore(i,"day"):a.isBefore(i,"seconds"))?Promise.reject(t):Promise.resolve()}}}function dynamicLoadJs(e){return new Promise((t,n)=>{const r=document.createElement("script");r.type="text/javascript",r.src=e,r.onload=t,r.onerror=n,document.body.appendChild(r)})}function dynamicLoadCss(e){return new Promise((t,n)=>{const r=document.createElement("link");r.rel="stylesheet",r.type="text/css",r.href=e,r.onload=t,r.onerror=n,document.head.appendChild(r)})}function normalizeEmptyHtml(e){if(!e)return"";const t=e.replace(/\s+/g,"").toLowerCase();return"<p><br></p>"===t||"<p></p>"===t||""===t?"":e}function getFileUrl(){return window.fileUrl||process.env.app.fileUrl}function getBaseGateway(){return window.baseGateway||"basicInfo"}async function getFileUrlFromServer(){if(window.fileUrl)return;const{data:e}=await request(`/${getBaseGateway()}/imgFiles/getImagePath`,"get");window.fileUrl=e}const requestCacheMap=new Map;async function executeWithCache(e,t,n){n([]);const r="string"==typeof e?e:JSON.stringify(e);if(requestCacheMap.has(r))return n(requestCacheMap.get(r)),requestCacheMap.get(r);const a=await t();return requestCacheMap.set(r,a),n(a),a}export{ArrayDeduplication,addingPrefixToFile,arrayObjectDeduplication,base642File,calculateFileSize,checkImgExists,createGuid,dynamicLoadCss,dynamicLoadJs,executeWithCache,findCharIndex,getBaseGateway,getDataType,getFileName,getFileSuffix,getFileUrl,getFileUrlFromServer,getIndexColumn,getLabelName,getMatchedItems,getTreeNodePaths,getUnmatchedItems,getUrlParam,idCardGetDateAndGender,image2Base64,image2Base642,interceptTheSuffix,isEmpty,isEmptyToWhether,listTransTree,normalizeEmptyHtml,numFormat,paging,processTreeDataByLevel,processTreeDataForOnlyLastLevel,randoms,readTxtDocument,secondConversion,serialNumber,toArrayString,validatorEndTime,validatorTimeGECurrentDay,validatorTimeGTCurrentDay};