GitBucket
4.6.0
Toggle navigation
Sign in
Files
Branches
1
Tags
Issues
Pull Requests
Labels
Milestones
Wiki
08335
/
hivui-platform-template
hivui平台项目模板
Browse code
Merge branch 'master' of http://git.hieap.cn/gitbucket/git/08335/hivui-platform-template
master
commit
82a1e820948aa955d0db6de925201260d251f2e3
2 parents
aaae71c
+
99eb728
20278
authored
on 20 Oct 2023
Showing
3 changed files
project/hivuiMain/lang/def.language
project/hivuiMain/lang/zh-CN.js
vite-plugin/vite-plugin-func.js
Ignore Space
Show notes
View
project/hivuiMain/lang/def.language
hivuiMain_sysInit=系统初始化中... hivuiMain_clickRefresh=【点我刷新】 hivuiMain_recentlyUsed=最近使用 hivuiMain_projectManage=项目管理 hivuiMain_allFunction=全部功能 hivuiMain_nodata=暂无数据 hivuiMain_searchKey=搜索关键字 hivuiMain_customWorkbench=自定义工作台 hivuiMain_logout=退出系统 hivuiMain_sysLoading=系统加载中... hivuiMain_loadedFailClickRefresh=加载失败,点我重试! hivuiMain_dialog_cancel=取消 hivuiMain_dialog_define=确定 hivuiMain_dialog_def_title=提示 hivuiMain_portal_text=暂无功能权限! hivuiMain_tab_ctxmenu_refresh=刷新 hivuiMain_tab_ctxmenu_close=关闭 hivuiMain_tab_ctxmenu_closeleft=关闭左侧 hivuiMain_tab_ctxmenu_closeright=关闭右侧 hivuiMain_tab_ctxmenu_closeother=关闭其它 hivuiMain_tab_ctxmenu_closeall=关闭所有 hivuiMain_tab_ctxmenu_fullscreen=全屏 hivuiMain_tab_ctxmenu_blankPage=新窗口打开 hivuiMain_tab_scroll_lt=左边滚动 hivuiMain_tab_scroll_rt=右边滚动 hivuiMain_tab_scroll_more=更多 hivuiMain_store_msg1=获取 hivuiMain_store_msg2=失败, hivuiMain_store_msg3=点我重试! hivuiMain_store_sysmenu=系统菜单 hivuiMain_store_userinfo=用户信息 hivuiMain_store_bzlist=多岗信息 hivuiMain_store_lately=最近使用功能 hivuiMain_allfuncmenu_text=请输入关键词 hivuiMain_modifypw_title=修改密码 hivuiMain_modifypw_oldpw=旧密码: hivuiMain_modifypw_oldpw=请输入旧密码 hivuiMain_modifypw_newpw=新密码: hivuiMain_modifypw_newpw_ph=请输入4-25个数字、字母或符号组合 hivuiMain_modifypw_valid_pw2_msg=两次输入密码不一致! hivuiMain_modifypw_valid_pw_empty=请输入新密码! hivuiMain_modifypw_valid_pw2_empty=请再次输入新密码! hivuiMain_modifypw_valid_pw2_empty2=请再次输入密码! hivuiMain_modifypw_newpw2=确认新密码: hivuiMain_modifypw_newpw2_ph=再次确认新密码 hivuiMain_modifypw_weak=弱 hivuiMain_modifypw_middle=中 hivuiMain_modifypw_strong=高 hivuiMain_modifypw_success=修改成功!请重新登录 hivuiMain_header_null=空 hivuiMain_header_notification_title=消息提示 hivuiMain_header_bzhoverbtn_title=设为主岗 hivuiMain_header_bzchooseIcon_title=当前主岗 hivuiMain_taskcenter_untreated=未处理 hivuiMain_app_user=用户编号 hivuiMain_app_orgbz=岗位编制 hivuiMain_app_orgname=机构名称 hivuiMain_app_rolename=岗位名称 hivuiMain_app_personal_Center=个人中心 hivuiMain_app_modifyPw=修改密码 hivuiMain_des_title=门户自定义 hivuiMain_des_setHeight=设置高度 hivuiMain_des_dragOrderFlag=拖动排序标识 hivuiMain_des_cancel=取消 hivuiMain_des_ok=确定 hivuiMain_des_editSerialRowLayout=确定 hivuiMain_des_serialRowLayout=第{0}行布局 hivuiMain_des_addColunms=添加门户栏目 hivuiMain_des_dragInArea=拖入此区 hivuiMain_des_save=保存 hivuiMain_des_columnLayout=栏目布局 hivuiMain_des_selectTemplate=选择模板 hivuiMain_des_addSingleLine=添加单行 hivuiMain_des_demoLayoutTip=选择以下模板,拖拽添加至内容区 hivuiMain_des_row24=一行一栏 hivuiMain_des_rowAvg2=两栏均分 hivuiMain_des_row8_16=一行两栏 hivuiMain_des_rowAvg3=三栏均分 hivuiMain_des_rowAvg4=一行四栏 hivuiMain_des_customLayoutTip=自定义分栏数值,数字总和须为24,以空格分隔,点击任意位置确认 hivuiMain_des_custom=自定义 hivuiMain_des_spaceSeparate=数值以[空格]隔开 hivuiMain_des_saving=保存中... hivuiMain_des_saveSuc=保存成功! hivuiMain_des_saveError=保存出错! hivuiMain_app_user=用户 hivuiMain_app_orgbz=岗编 hivuiMain_eap_msgTips=消息提示 hivuiMain_eap_define=确定 hivuiMain_eap_showErrorDetail=弹出报错详情 hivuiMain_eap_hideErrorDetail=收起报错详情 hivuiMain_eap_noPermissionTips=你已被登出,请重新登录 hivuiMain_eap_timeOut=登录超时 hivuiMain_eap_Relist=重新登录 hivuiMain_eap_responseNull=后端请求返回出错,请联系开发人员 hivuiMain_main_bz=主岗 hivuiMain_validate_FMBPHONE=电话号码格式有误 hivuiMain_validate_FEMAIL=邮箱地址格式有误 hivuiMain_validate_FIDCARD=身份证号格式有误 customSysCfg_taskcenter=任务中心 customSysCfg_mainpage=首页 customSysCfg_layout=布局 customSysCfg_updownlayout=上下布局 customSysCfg_leftrightlayout=左右布局 customSysCfg_messagecenter=消息中心 customSysCfg_unreadmessage=您有{0}条未读消息 customSysCfg_companyname=中海创科技 customSysCfg_copyright=版权所有 © 2020-2025 中海创科技 customSysCfg_pageTitle=中海创主页 hivuiMain_personalCenter_sex=性别 hivuiMain_personalCenter_birthday=出生年月 hivuiMain_personalCenter_mbphone=手机号码 hivuiMain_personalCenter_email=邮箱 hivuiMain_personalCenter_WeChat=微信 hivuiMain_personalCenter_usersfz=身份证号 hivuiMain_personalCenter_address=地址 hivuiMain_personalCenter_male=男 hivuiMain_personalCenter_female=女 hivuiMain_personalCenter_editTips=修改成功 hi_messagebox_title=提示 hi_messagebox_confirm=确定 hi_messagebox_cancel=取消 hi_monitor_approvalRecord=审批记录 hi_monitor_flow=流程 hi_monitor_displayname=流程名称 hi_monitor_ordernumber=流程编号 hi_monitor_createtime=创建时间 hi_monitor_finishtime=完成时间 hi_monitor_flowstate=流程状态 hi_monitor_finish=已完成 hi_monitor_taskname=任务名称 hi_monitor_noReceived=未接收 hi_monitor_timeConsuming=耗时 hi_monitor_approver=审批人 hi_monitor_processingStatus=处理状态 hi_monitor_processe=需处理 hi_monitor_postscript=附言 hi_monitor_flowchart=流程图 hi_monitor_processed=已处理 hi_monitor_back=回退 hi_monitor_sysAuto=系统自动流转 hi_monitor_terminate=终止 hi_monitor_cancel=取消 hi_monitor_transfer=转办 hi_monitor_taskWithdraw=任务撤回 hi_monitor_tsBeforSigning=前加签中 hi_monitor_tsAfterSigning=后加签中 hi_monitor_tsBeforSignDW=前加签处理 hi_monitor_tsAfterSignDW=后加签处理 hi_monitor_tsBeforSigned=已前加签 hi_monitor_tsAfterSigned=已后加签 hi_monitor_day=天 hi_monitor_hour=小时 hi_monitor_Min=分 hi_monitor_second=秒 hi_monitor_gantt_dept=所属部门 hi_monitor_gantt_role=岗位职称 hi_taskcenter_myTasks=我的任务 hi_taskcenter_query=查询 hi_taskcenter_reset=重置 hi_taskcenter_operate=操作 hi_taskcenter_batchProcessing=批处理 hi_taskcenter_flowOut=流转 hi_taskcenter_flowBack=回退 hi_taskcenter_process=处理 hi_taskcenter_view=查看 hi_taskcenter_fwithdraw=撤回 hi_taskcenter_originator=发起人 hi_taskcenter_approver=审批人 hi_taskcenter_urgent=急 hi_taskcenter_back=退 hi_taskcenter_summary=流程摘要 hi_taskcenter_summaryinfo=流程摘要信息 hi_taskcenter_task=任务 hi_taskcenter_createtime=创建时间 hi_taskcenter_finishtime=完成时间 hi_taskcenter_monitor=流程监控 hi_taskcenter_batchTitle=任务批处理({0}) hi_taskcenter_batchtip=任务正在处理中{0}/{1},已成功{2}个,失败{3}个。 hi_taskcenter_number=单号 hi_taskcenter_flowname=流程名称 hi_taskcenter_taskname=任务名称 hi_taskcenter_detailMsg=处理结果 hi_taskcenter_untreated=未处理 hi_taskcenter_processed=已处理 hi_taskcenter_completed=已完成 hi_taskcenter_displayname=环节名称 hi_taskcenter_fordernumber=流程单号 hi_taskcenter_fusername=编制ID hi_taskcenter_withdrawinfo=是否撤回任务? hi_taskcenter_taskWithdrawsuccess=任务撤回成功! hi_taskcenter_confirmtitle=确认信息 hi_taskcenter_processSuccess=处理成功 hi_taskcenter_oneselect=请至少选择一条单据!
hivuiMain_sysInit=系统初始化中... hivuiMain_clickRefresh=【点我刷新】 hivuiMain_recentlyUsed=最近使用 hivuiMain_projectManage=项目管理 hivuiMain_allFunction=全部功能 hivuiMain_nodata=暂无数据 hivuiMain_searchKey=搜索关键字 hivuiMain_customWorkbench=自定义工作台 hivuiMain_logout=退出系统 hivuiMain_sysLoading=系统加载中... hivuiMain_loadedFailClickRefresh=加载失败,点我重试! hivuiMain_dialog_cancel=取消 hivuiMain_dialog_define=确定 hivuiMain_dialog_def_title=提示 hivuiMain_portal_text=暂无功能权限! hivuiMain_tab_ctxmenu_refresh=刷新 hivuiMain_tab_ctxmenu_close=关闭 hivuiMain_tab_ctxmenu_closeleft=关闭左侧 hivuiMain_tab_ctxmenu_closeright=关闭右侧 hivuiMain_tab_ctxmenu_closeother=关闭其它 hivuiMain_tab_ctxmenu_closeall=关闭所有 hivuiMain_tab_ctxmenu_fullscreen=全屏 hivuiMain_tab_ctxmenu_blankPage=新窗口打开 hivuiMain_tab_scroll_lt=左边滚动 hivuiMain_tab_scroll_rt=右边滚动 hivuiMain_tab_scroll_more=更多 hivuiMain_store_msg1=获取 hivuiMain_store_msg2=失败, hivuiMain_store_msg3=点我重试! hivuiMain_store_sysmenu=系统菜单 hivuiMain_store_userinfo=用户信息 hivuiMain_store_bzlist=多岗信息 hivuiMain_store_lately=最近使用功能 hivuiMain_allfuncmenu_text=请输入关键词 hivuiMain_modifypw_title=修改密码 hivuiMain_modifypw_oldpw=旧密码: hivuiMain_modifypw_oldpw=请输入旧密码 hivuiMain_modifypw_newpw=新密码: hivuiMain_modifypw_newpw_ph=请输入4-25个数字、字母或符号组合 hivuiMain_modifypw_valid_pw2_msg=两次输入密码不一致! hivuiMain_modifypw_valid_pw_empty=请输入新密码! hivuiMain_modifypw_valid_pw2_empty=请再次输入新密码! hivuiMain_modifypw_valid_pw2_empty2=请再次输入密码! hivuiMain_modifypw_newpw2=确认新密码: hivuiMain_modifypw_newpw2_ph=再次确认新密码 hivuiMain_modifypw_weak=弱 hivuiMain_modifypw_middle=中 hivuiMain_modifypw_strong=高 hivuiMain_modifypw_success=修改成功!请重新登录 hivuiMain_header_null=空 hivuiMain_header_notification_title=消息提示 hivuiMain_header_bzhoverbtn_title=设为主岗 hivuiMain_header_bzchooseIcon_title=当前主岗 hivuiMain_taskcenter_untreated=未处理 hivuiMain_app_user=用户编号 hivuiMain_app_orgbz=岗位编制 hivuiMain_app_orgname=机构名称 hivuiMain_app_rolename=岗位名称 hivuiMain_app_personal_Center=个人中心 hivuiMain_app_modifyPw=修改密码 hivuiMain_des_title=门户自定义 hivuiMain_des_setHeight=设置高度 hivuiMain_des_dragOrderFlag=拖动排序标识 hivuiMain_des_cancel=取消 hivuiMain_des_ok=确定 hivuiMain_des_editSerialRowLayout=确定 hivuiMain_des_serialRowLayout=第{0}行布局 hivuiMain_des_addColunms=添加门户栏目 hivuiMain_des_dragInArea=拖入此区 hivuiMain_des_save=保存 hivuiMain_des_columnLayout=栏目布局 hivuiMain_des_selectTemplate=选择模板 hivuiMain_des_addSingleLine=添加单行 hivuiMain_des_demoLayoutTip=选择以下模板,拖拽添加至内容区 hivuiMain_des_row24=一行一栏 hivuiMain_des_rowAvg2=两栏均分 hivuiMain_des_row8_16=一行两栏 hivuiMain_des_rowAvg3=三栏均分 hivuiMain_des_rowAvg4=一行四栏 hivuiMain_des_customLayoutTip=自定义分栏数值,数字总和须为24,以空格分隔,点击任意位置确认 hivuiMain_des_custom=自定义 hivuiMain_des_spaceSeparate=数值以[空格]隔开 hivuiMain_des_saving=保存中... hivuiMain_des_saveSuc=保存成功! hivuiMain_des_saveError=保存出错! hivuiMain_app_user=用户 hivuiMain_app_orgbz=岗编 hivuiMain_eap_msgTips=消息提示 hivuiMain_eap_define=确定 hivuiMain_eap_showErrorDetail=弹出报错详情 hivuiMain_eap_hideErrorDetail=收起报错详情 hivuiMain_eap_noPermissionTips=你已被登出,请重新登录 hivuiMain_eap_timeOut=登录超时 hivuiMain_eap_Relist=重新登录 hivuiMain_eap_responseNull=后端请求返回出错,请联系开发人员 hivuiMain_main_bz=主岗 hivuiMain_validate_FMBPHONE=电话号码格式有误 hivuiMain_validate_FEMAIL=邮箱地址格式有误 hivuiMain_validate_FIDCARD=身份证号格式有误 customSysCfg_taskcenter=任务中心 customSysCfg_mainpage=首页 customSysCfg_layout=布局 customSysCfg_updownlayout=上下布局 customSysCfg_leftrightlayout=左右布局 customSysCfg_messagecenter=消息中心 customSysCfg_unreadmessage=您有{0}条未读消息 customSysCfg_companyname=中海创科技 customSysCfg_copyright=版权所有 © 2020-2025 中海创科技 customSysCfg_pageTitle=中海创主页 hivuiMain_personalCenter_sex=性别 hivuiMain_personalCenter_birthday=出生年月 hivuiMain_personalCenter_mbphone=手机号码 hivuiMain_personalCenter_email=邮箱 hivuiMain_personalCenter_WeChat=微信 hivuiMain_personalCenter_usersfz=身份证号 hivuiMain_personalCenter_address=地址 hivuiMain_personalCenter_male=男 hivuiMain_personalCenter_female=女 hivuiMain_personalCenter_editTips=修改成功 hi_messagebox_title=提示 hi_messagebox_confirm=确定 hi_messagebox_cancel=取消 hi_monitor_approvalRecord=审批记录 hi_monitor_flow=流程 hi_monitor_displayname=流程名称 hi_monitor_ordernumber=流程编号 hi_monitor_createtime=创建时间 hi_monitor_finishtime=完成时间 hi_monitor_flowstate=流程状态 hi_monitor_finish=已完成 hi_monitor_taskname=任务名称 hi_monitor_noReceived=未接收 hi_monitor_timeConsuming=耗时 hi_monitor_approver=审批人 hi_monitor_processingStatus=处理状态 hi_monitor_processe=需处理 hi_monitor_postscript=附言 hi_monitor_flowchart=流程图 hi_monitor_processed=已处理 hi_monitor_back=回退 hi_monitor_sysAuto=系统自动流转 hi_monitor_terminate=终止 hi_monitor_cancel=取消 hi_monitor_transfer=转办 hi_monitor_taskWithdraw=任务撤回 hi_monitor_tsBeforSigning=前加签中 hi_monitor_tsAfterSigning=后加签中 hi_monitor_tsBeforSignDW=前加签处理 hi_monitor_tsAfterSignDW=后加签处理 hi_monitor_tsBeforSigned=已前加签 hi_monitor_tsAfterSigned=已后加签 hi_monitor_day=天 hi_monitor_hour=小时 hi_monitor_Min=分 hi_monitor_second=秒 hi_monitor_gantt_dept=所属部门 hi_monitor_gantt_role=岗位职称 hi_taskcenter_myTasks=我的任务 hi_taskcenter_query=查询 hi_taskcenter_reset=重置 hi_taskcenter_operate=操作 hi_taskcenter_batchProcessing=批处理 hi_taskcenter_flowOut=流转 hi_taskcenter_flowBack=回退 hi_taskcenter_process=处理 hi_taskcenter_view=查看 hi_taskcenter_fwithdraw=撤回 hi_taskcenter_originator=发起人 hi_taskcenter_approver=审批人 hi_taskcenter_urgent=急 hi_taskcenter_back=退 hi_taskcenter_summary=流程摘要 hi_taskcenter_summaryinfo=流程摘要信息 hi_taskcenter_task=任务 hi_taskcenter_createtime=创建时间 hi_taskcenter_finishtime=完成时间 hi_taskcenter_monitor=流程监控 hi_taskcenter_batchTitle=任务批处理({0}) hi_taskcenter_batchtip=任务正在处理中{0}/{1},已成功{2}个,失败{3}个。 hi_taskcenter_number=单号 hi_taskcenter_flowname=流程名称 hi_taskcenter_taskname=任务名称 hi_taskcenter_detailMsg=处理结果 hi_taskcenter_untreated=未处理 hi_taskcenter_processed=已处理 hi_taskcenter_completed=已完成 hi_taskcenter_displayname=环节名称 hi_taskcenter_fordernumber=流程单号 hi_taskcenter_fusername=编制ID hi_taskcenter_withdrawinfo=是否撤回任务? hi_taskcenter_confirmtitle=确认信息 hi_taskcenter_processSuccess=处理成功 hi_taskcenter_oneselect=请至少选择一条单据!
Ignore Space
Show notes
View
project/hivuiMain/lang/zh-CN.js
var GLOBAL_LANG_TPL = { "hivuiMain_sysInit": "系统初始化中...", "hivuiMain_clickRefresh": "【点我刷新】", "hivuiMain_recentlyUsed": "最近使用", "hivuiMain_projectManage": "项目管理", "hivuiMain_allFunction": "全部功能", "hivuiMain_nodata": "暂无数据", "hivuiMain_searchKey": "搜索关键字", "hivuiMain_customWorkbench": "自定义工作台", "hivuiMain_logout": "退出系统", "hivuiMain_sysLoading": "系统加载中...", "hivuiMain_loadedFailClickRefresh": "加载失败,点我重试!", "hivuiMain_dialog_cancel": "取消", "hivuiMain_dialog_define": "确定", "hivuiMain_dialog_def_title": "提示", "hivuiMain_portal_text": "暂无功能权限!", "hivuiMain_tab_ctxmenu_refresh": "刷新", "hivuiMain_tab_ctxmenu_close": "关闭", "hivuiMain_tab_ctxmenu_closeleft": "关闭左侧", "hivuiMain_tab_ctxmenu_closeright": "关闭右侧", "hivuiMain_tab_ctxmenu_closeother": "关闭其它", "hivuiMain_tab_ctxmenu_closeall": "关闭所有", "hivuiMain_tab_ctxmenu_fullscreen": "全屏", "hivuiMain_tab_ctxmenu_blankPage":"新窗口打开", "hivuiMain_tab_scroll_lt": "左边滚动", "hivuiMain_tab_scroll_rt": "右边滚动", "hivuiMain_tab_scroll_more": "更多", "hivuiMain_store_msg1": "获取", "hivuiMain_store_msg2": "失败,", "hivuiMain_store_msg3": "点我重试!", "hivuiMain_store_sysmenu": "系统菜单", "hivuiMain_store_userinfo": "用户信息", "hivuiMain_store_bzlist": "多岗信息", "hivuiMain_store_lately": "最近使用功能", "hivuiMain_allfuncmenu_text": "请输入关键词", "hivuiMain_modifypw_title": "修改密码", "hivuiMain_modifypw_oldpw": "旧密码:", "hivuiMain_modifypw_oldpw": "请输入旧密码", "hivuiMain_modifypw_newpw": "新密码:", "hivuiMain_modifypw_newpw_ph": "请输入4-25个数字、字母或符号组合", "hivuiMain_modifypw_valid_pw2_msg": "两次输入密码不一致!", "hivuiMain_modifypw_valid_pw_empty": "请输入新密码!", "hivuiMain_modifypw_valid_pw2_empty": "请再次输入新密码!", "hivuiMain_modifypw_valid_pw2_empty2": "请再次输入密码!", "hivuiMain_modifypw_newpw2": "确认新密码:", "hivuiMain_modifypw_newpw2_ph": "再次确认新密码", "hivuiMain_modifypw_weak": "弱", "hivuiMain_modifypw_middle": "中", "hivuiMain_modifypw_strong": "高", "hivuiMain_modifypw_success": "修改成功!请重新登录", "hivuiMain_header_null": "空", "hivuiMain_header_notification_title": "消息提示", "hivuiMain_header_bzhoverbtn_title": "设为主岗", "hivuiMain_header_bzchooseIcon_title":"当前主岗", "hivuiMain_taskcenter_untreated": "未处理", "hivuiMain_app_user": "用户编号", "hivuiMain_app_orgbz": "岗位编制", "hivuiMain_app_orgname": "机构名称", "hivuiMain_app_rolename": "岗位名称", "hivuiMain_app_personal_Center": "个人中心", "hivuiMain_app_modifyPw": "修改密码", "hivuiMain_des_title": "门户自定义", "hivuiMain_des_setHeight": "设置高度", "hivuiMain_des_dragOrderFlag": "拖动排序标识", "hivuiMain_des_cancel": "取消", "hivuiMain_des_ok": "确定", "hivuiMain_des_editSerialRowLayout": "确定", "hivuiMain_des_serialRowLayout": "第{0}行布局", "hivuiMain_des_addColunms": "添加门户栏目", "hivuiMain_des_dragInArea": "拖入此区", "hivuiMain_des_save": "保存", "hivuiMain_des_columnLayout": "栏目布局", "hivuiMain_des_selectTemplate": "选择模板", "hivuiMain_des_addSingleLine": "添加单行", "hivuiMain_des_demoLayoutTip": "选择以下模板,拖拽添加至内容区", "hivuiMain_des_row24": "一行一栏", "hivuiMain_des_rowAvg2": "两栏均分", "hivuiMain_des_row8_16": "一行两栏", "hivuiMain_des_rowAvg3": "三栏均分", "hivuiMain_des_rowAvg4": "一行四栏", "hivuiMain_des_customLayoutTip": "自定义分栏数值,数字总和须为24,以空格分隔,点击任意位置确认", "hivuiMain_des_custom": "自定义", "hivuiMain_des_spaceSeparate": "数值以[空格]隔开", "hivuiMain_des_saving": "保存中...", "hivuiMain_des_saveSuc": "保存成功!", "hivuiMain_des_saveError": "保存出错!", "hivuiMain_app_user": "用户", "hivuiMain_app_orgbz": "岗编", "hivuiMain_eap_msgTips": "消息提示", "hivuiMain_eap_define": "确定", "hivuiMain_eap_showErrorDetail": "弹出报错详情", "hivuiMain_eap_hideErrorDetail": "收起报错详情", "hivuiMain_eap_noPermissionTips": "你已被登出,请重新登录", "hivuiMain_eap_timeOut": "登录超时", "hivuiMain_eap_Relist": "重新登录", "hivuiMain_eap_responseNull":"后端请求返回出错,请联系开发人员", "hivuiMain_main_bz": "主岗", "hivuiMain_validate_FMBPHONE": "电话号码格式有误", "hivuiMain_validate_FEMAIL": "邮箱地址格式有误", "hivuiMain_validate_FIDCARD": "身份证号格式有误", "customSysCfg_taskcenter": "任务中心", "customSysCfg_mainpage": "首页", "customSysCfg_layout": "布局", "customSysCfg_updownlayout": "上下布局", "customSysCfg_leftrightlayout": "左右布局", "customSysCfg_messagecenter": "消息中心", "customSysCfg_unreadmessage": "您有{0}条未读消息", "customSysCfg_companyname": "中海创科技", "customSysCfg_copyright": "版权所有 © 2020-2025 中海创科技", "customSysCfg_pageTitle": "中海创主页", "hivuiMain_personalCenter_name": "姓名", "hivuiMain_personalCenter_sex": "性别", "hivuiMain_personalCenter_birthday": "出生年月", "hivuiMain_personalCenter_mbphone": "手机号码", "hivuiMain_personalCenter_email": "邮箱", "hivuiMain_personalCenter_WeChat": "微信", "hivuiMain_personalCenter_usersfz": "身份证号", "hivuiMain_personalCenter_address": "地址", "hivuiMain_personalCenter_male": "男", "hivuiMain_personalCenter_female": "女", "hivuiMain_personalCenter_editTips": "修改成功", "hi_messagebox_title": "提示", "hi_messagebox_confirm": "确定", "hi_messagebox_cancel": "取消", "hi_monitor_approvalRecord": "审批记录", "hi_monitor_flow": "流程", "hi_monitor_displayname": "流程名称", "hi_monitor_ordernumber": "流程编号", "hi_monitor_createtime": "创建时间", "hi_monitor_finishtime": "完成时间", "hi_monitor_flowstate": "流程状态", "hi_monitor_finish": "已完成", "hi_monitor_taskname": "任务名称", "hi_monitor_noReceived": "未接收", "hi_monitor_timeConsuming": "耗时", "hi_monitor_approver": "审批人", "hi_monitor_processingStatus": "处理状态", "hi_monitor_processe": "需处理", "hi_monitor_postscript": "附言", "hi_monitor_flowchart": "流程图", "hi_monitor_processed": "已处理", "hi_monitor_back": "回退", "hi_monitor_sysAuto": "系统自动流转", "hi_monitor_terminate": "终止", "hi_monitor_cancel": "取消", "hi_monitor_transfer": "转办", "hi_monitor_taskWithdraw": "任务撤回", "hi_monitor_tsBeforSigning": "前加签中", "hi_monitor_tsAfterSigning": "后加签中", "hi_monitor_tsBeforSignDW": "前加签处理", "hi_monitor_tsAfterSignDW": "后加签处理", "hi_monitor_tsBeforSigned": "已前加签", "hi_monitor_tsAfterSigned": "已后加签", "hi_monitor_day": "天", "hi_monitor_hour": "小时", "hi_monitor_Min": "分", "hi_monitor_second": "秒", "hi_taskcenter_myTasks": "我的任务", "hi_taskcenter_query": "查询", "hi_taskcenter_reset": "重置", "hi_taskcenter_operate": "操作", "hi_taskcenter_batchProcessing": "批处理", "hi_taskcenter_flowOut": "流转", "hi_taskcenter_flowBack": "回退", "hi_taskcenter_process": "处理", "hi_taskcenter_view": "查看", "hi_taskcenter_fwithdraw": "撤回", "hi_taskcenter_originator": "发起人", "hi_taskcenter_approver": "审批人", "hi_taskcenter_urgent": "急", "hi_taskcenter_back": "退", "hi_taskcenter_summary": "流程摘要", "hi_taskcenter_summaryinfo": "流程摘要信息", "hi_taskcenter_task": "任务", "hi_taskcenter_createtime": "创建时间", "hi_taskcenter_finishtime": "完成时间", "hi_taskcenter_monitor": "流程监控", "hi_taskcenter_batchTitle": "任务批处理({0})", "hi_taskcenter_batchtip": "任务正在处理中{0}/{1},已成功{2}个,失败{3}个。", "hi_taskcenter_number": "单号", "hi_taskcenter_flowname": "流程名称", "hi_taskcenter_taskname": "任务名称", "hi_taskcenter_detailMsg": "处理结果", "hi_taskcenter_untreated": "未处理", "hi_taskcenter_processed": "已处理", "hi_taskcenter_completed": "已完成", "hi_taskcenter_displayname": "环节名称", "hi_taskcenter_fordernumber": "流程单号", "hi_taskcenter_fusername": "编制ID", "hi_taskcenter_withdrawinfo": "是否撤回任务?", "hi_taskcenter_taskWithdrawsuccess":"任务撤回成功!", "hi_taskcenter_confirmtitle": "确认信息", "hi_taskcenter_processSuccess": "处理成功", "hi_taskcenter_oneselect": "请至少选择一条单据!", };
var GLOBAL_LANG_TPL = { "hivuiMain_sysInit": "系统初始化中...", "hivuiMain_clickRefresh": "【点我刷新】", "hivuiMain_recentlyUsed": "最近使用", "hivuiMain_projectManage": "项目管理", "hivuiMain_allFunction": "全部功能", "hivuiMain_nodata": "暂无数据", "hivuiMain_searchKey": "搜索关键字", "hivuiMain_customWorkbench": "自定义工作台", "hivuiMain_logout": "退出系统", "hivuiMain_sysLoading": "系统加载中...", "hivuiMain_loadedFailClickRefresh": "加载失败,点我重试!", "hivuiMain_dialog_cancel": "取消", "hivuiMain_dialog_define": "确定", "hivuiMain_dialog_def_title": "提示", "hivuiMain_portal_text": "暂无功能权限!", "hivuiMain_tab_ctxmenu_refresh": "刷新", "hivuiMain_tab_ctxmenu_close": "关闭", "hivuiMain_tab_ctxmenu_closeleft": "关闭左侧", "hivuiMain_tab_ctxmenu_closeright": "关闭右侧", "hivuiMain_tab_ctxmenu_closeother": "关闭其它", "hivuiMain_tab_ctxmenu_closeall": "关闭所有", "hivuiMain_tab_ctxmenu_fullscreen": "全屏", "hivuiMain_tab_ctxmenu_blankPage":"新窗口打开", "hivuiMain_tab_scroll_lt": "左边滚动", "hivuiMain_tab_scroll_rt": "右边滚动", "hivuiMain_tab_scroll_more": "更多", "hivuiMain_store_msg1": "获取", "hivuiMain_store_msg2": "失败,", "hivuiMain_store_msg3": "点我重试!", "hivuiMain_store_sysmenu": "系统菜单", "hivuiMain_store_userinfo": "用户信息", "hivuiMain_store_bzlist": "多岗信息", "hivuiMain_store_lately": "最近使用功能", "hivuiMain_allfuncmenu_text": "请输入关键词", "hivuiMain_modifypw_title": "修改密码", "hivuiMain_modifypw_oldpw": "旧密码:", "hivuiMain_modifypw_oldpw": "请输入旧密码", "hivuiMain_modifypw_newpw": "新密码:", "hivuiMain_modifypw_newpw_ph": "请输入4-25个数字、字母或符号组合", "hivuiMain_modifypw_valid_pw2_msg": "两次输入密码不一致!", "hivuiMain_modifypw_valid_pw_empty": "请输入新密码!", "hivuiMain_modifypw_valid_pw2_empty": "请再次输入新密码!", "hivuiMain_modifypw_valid_pw2_empty2": "请再次输入密码!", "hivuiMain_modifypw_newpw2": "确认新密码:", "hivuiMain_modifypw_newpw2_ph": "再次确认新密码", "hivuiMain_modifypw_weak": "弱", "hivuiMain_modifypw_middle": "中", "hivuiMain_modifypw_strong": "高", "hivuiMain_modifypw_success": "修改成功!请重新登录", "hivuiMain_header_null": "空", "hivuiMain_header_notification_title": "消息提示", "hivuiMain_header_bzhoverbtn_title": "设为主岗", "hivuiMain_header_bzchooseIcon_title":"当前主岗", "hivuiMain_taskcenter_untreated": "未处理", "hivuiMain_app_user": "用户编号", "hivuiMain_app_orgbz": "岗位编制", "hivuiMain_app_orgname": "机构名称", "hivuiMain_app_rolename": "岗位名称", "hivuiMain_app_personal_Center": "个人中心", "hivuiMain_app_modifyPw": "修改密码", "hivuiMain_des_title": "门户自定义", "hivuiMain_des_setHeight": "设置高度", "hivuiMain_des_dragOrderFlag": "拖动排序标识", "hivuiMain_des_cancel": "取消", "hivuiMain_des_ok": "确定", "hivuiMain_des_editSerialRowLayout": "确定", "hivuiMain_des_serialRowLayout": "第{0}行布局", "hivuiMain_des_addColunms": "添加门户栏目", "hivuiMain_des_dragInArea": "拖入此区", "hivuiMain_des_save": "保存", "hivuiMain_des_columnLayout": "栏目布局", "hivuiMain_des_selectTemplate": "选择模板", "hivuiMain_des_addSingleLine": "添加单行", "hivuiMain_des_demoLayoutTip": "选择以下模板,拖拽添加至内容区", "hivuiMain_des_row24": "一行一栏", "hivuiMain_des_rowAvg2": "两栏均分", "hivuiMain_des_row8_16": "一行两栏", "hivuiMain_des_rowAvg3": "三栏均分", "hivuiMain_des_rowAvg4": "一行四栏", "hivuiMain_des_customLayoutTip": "自定义分栏数值,数字总和须为24,以空格分隔,点击任意位置确认", "hivuiMain_des_custom": "自定义", "hivuiMain_des_spaceSeparate": "数值以[空格]隔开", "hivuiMain_des_saving": "保存中...", "hivuiMain_des_saveSuc": "保存成功!", "hivuiMain_des_saveError": "保存出错!", "hivuiMain_app_user": "用户", "hivuiMain_app_orgbz": "岗编", "hivuiMain_eap_msgTips": "消息提示", "hivuiMain_eap_define": "确定", "hivuiMain_eap_showErrorDetail": "弹出报错详情", "hivuiMain_eap_hideErrorDetail": "收起报错详情", "hivuiMain_eap_noPermissionTips": "你已被登出,请重新登录", "hivuiMain_eap_timeOut": "登录超时", "hivuiMain_eap_Relist": "重新登录", "hivuiMain_eap_responseNull":"后端请求返回出错,请联系开发人员", "hivuiMain_main_bz": "主岗", "hivuiMain_validate_FMBPHONE": "电话号码格式有误", "hivuiMain_validate_FEMAIL": "邮箱地址格式有误", "hivuiMain_validate_FIDCARD": "身份证号格式有误", "customSysCfg_taskcenter": "任务中心", "customSysCfg_mainpage": "首页", "customSysCfg_layout": "布局", "customSysCfg_updownlayout": "上下布局", "customSysCfg_leftrightlayout": "左右布局", "customSysCfg_messagecenter": "消息中心", "customSysCfg_unreadmessage": "您有{0}条未读消息", "customSysCfg_companyname": "中海创科技", "customSysCfg_copyright": "版权所有 © 2020-2025 中海创科技", "customSysCfg_pageTitle": "中海创主页", "hivuiMain_personalCenter_name": "姓名", "hivuiMain_personalCenter_sex": "性别", "hivuiMain_personalCenter_birthday": "出生年月", "hivuiMain_personalCenter_mbphone": "手机号码", "hivuiMain_personalCenter_email": "邮箱", "hivuiMain_personalCenter_WeChat": "微信", "hivuiMain_personalCenter_usersfz": "身份证号", "hivuiMain_personalCenter_address": "地址", "hivuiMain_personalCenter_male": "男", "hivuiMain_personalCenter_female": "女", "hivuiMain_personalCenter_editTips": "修改成功", "hi_messagebox_title": "提示", "hi_messagebox_confirm": "确定", "hi_messagebox_cancel": "取消", "hi_monitor_approvalRecord": "审批记录", "hi_monitor_flow": "流程", "hi_monitor_displayname": "流程名称", "hi_monitor_ordernumber": "流程编号", "hi_monitor_createtime": "创建时间", "hi_monitor_finishtime": "完成时间", "hi_monitor_flowstate": "流程状态", "hi_monitor_finish": "已完成", "hi_monitor_taskname": "任务名称", "hi_monitor_noReceived": "未接收", "hi_monitor_timeConsuming": "耗时", "hi_monitor_approver": "审批人", "hi_monitor_processingStatus": "处理状态", "hi_monitor_processe": "需处理", "hi_monitor_postscript": "附言", "hi_monitor_flowchart": "流程图", "hi_monitor_processed": "已处理", "hi_monitor_back": "回退", "hi_monitor_sysAuto": "系统自动流转", "hi_monitor_terminate": "终止", "hi_monitor_cancel": "取消", "hi_monitor_transfer": "转办", "hi_monitor_taskWithdraw": "任务撤回", "hi_monitor_tsBeforSigning": "前加签中", "hi_monitor_tsAfterSigning": "后加签中", "hi_monitor_tsBeforSignDW": "前加签处理", "hi_monitor_tsAfterSignDW": "后加签处理", "hi_monitor_tsBeforSigned": "已前加签", "hi_monitor_tsAfterSigned": "已后加签", "hi_monitor_day": "天", "hi_monitor_hour": "小时", "hi_monitor_Min": "分", "hi_monitor_second": "秒", "hi_taskcenter_myTasks": "我的任务", "hi_taskcenter_query": "查询", "hi_taskcenter_reset": "重置", "hi_taskcenter_operate": "操作", "hi_taskcenter_batchProcessing": "批处理", "hi_taskcenter_flowOut": "流转", "hi_taskcenter_flowBack": "回退", "hi_taskcenter_process": "处理", "hi_taskcenter_view": "查看", "hi_taskcenter_fwithdraw": "撤回", "hi_taskcenter_originator": "发起人", "hi_taskcenter_approver": "审批人", "hi_taskcenter_urgent": "急", "hi_taskcenter_back": "退", "hi_taskcenter_summary": "流程摘要", "hi_taskcenter_summaryinfo": "流程摘要信息", "hi_taskcenter_task": "任务", "hi_taskcenter_createtime": "创建时间", "hi_taskcenter_finishtime": "完成时间", "hi_taskcenter_monitor": "流程监控", "hi_taskcenter_batchTitle": "任务批处理({0})", "hi_taskcenter_batchtip": "任务正在处理中{0}/{1},已成功{2}个,失败{3}个。", "hi_taskcenter_number": "单号", "hi_taskcenter_flowname": "流程名称", "hi_taskcenter_taskname": "任务名称", "hi_taskcenter_detailMsg": "处理结果", "hi_taskcenter_untreated": "未处理", "hi_taskcenter_processed": "已处理", "hi_taskcenter_completed": "已完成", "hi_taskcenter_displayname": "环节名称", "hi_taskcenter_fordernumber": "流程单号", "hi_taskcenter_fusername": "编制ID", "hi_taskcenter_withdrawinfo": "是否撤回任务?", "hi_taskcenter_confirmtitle": "确认信息", "hi_taskcenter_processSuccess": "处理成功", "hi_taskcenter_oneselect": "请至少选择一条单据!", };
Ignore Space
Show notes
View
vite-plugin/vite-plugin-func.js
var querystring = require('querystring'); var url = require('url'); const fs = require('fs') var https = require('https'); var request = require('request'); var ejs = require('ejs'); function myPlugin(rawOptions) { let projectName = process.env.VITE_APP_PN.split("/")[0]; let userName = process.env.VITE_APP_PN.split("/")[1]; var previewPath = `${projectName}/setting/studio/preview.json` var setting try { let settingContent = fs.readFileSync(previewPath, { encoding: 'utf8' }); setting = JSON.parse(settingContent) } catch (e) { console.log("preview数据有错!") } var VITE_APP_BASE_API, VITE_APP_SERVER; if (setting) { VITE_APP_BASE_API = (setting.server || {}).VITE_APP_BASE_API || process.env.VITE_APP_BASE_API; VITE_APP_SERVER = (setting.server || {}).VITE_APP_SERVER || process.env.VITE_APP_SERVER; } else { VITE_APP_BASE_API = process.env.VITE_APP_BASE_API; VITE_APP_SERVER = process.env.VITE_APP_SERVER; } const options = { isProduction: process.env.NODE_ENV === 'production', ...rawOptions, VITE_APP_BASE_API: VITE_APP_BASE_API, VITE_APP_SERVER: VITE_APP_SERVER, root: process.cwd(), }; var routerOption = { url: `${VITE_APP_BASE_API}/map.html?pn=${process.env.VITE_APP_PN}`, method: "GET", json: true, headers: { "Content-Type": "application/json;charset=UTF-8" } } const routerMap = {}; request(routerOption, function (error, response, body) { if (body) { for (var i = 0; i < body.length; i++) { let routerPath = body[i].value; routerPath = routerPath.substr(routerPath.indexOf("/") + 1) + ".html" routerMap["/" + body[i].key] = routerPath; } } }) const TokenKey = 'EAP-Token'; let postData; let config; return { name: 'vite-plugin-func', // 必须的,将会显示在 warning 和 error 中 configResolved(resolvedConfig) { // 存储最终解析的配置 config = resolvedConfig }, configureServer(server) { server.middlewares.use((req, res, next) => { var Cookies = {}; if (req.headers.cookie != null) { req.headers.cookie.split(';').forEach(l => { var parts = l.split('='); Cookies[parts[0].trim()] = (parts[1] || '').trim(); }); } var param = req._parsedUrl.query; var result = {}; if (param) { let values = param.split("&"); for (let i = 0; i < values.length; i++) { const element = values[i]; let _val = element.split("="); result[_val[0]] = _val[1]; } } function isFlow(type) { return type.endsWith(".flow") || type.endsWith(".flowc"); } // 接口 function isInfc(type) { return type.endsWith(".infc") } function isFunc(type) { return type.endsWith(".func") } function isHtml(type) { return type.endsWith(".html") } function isStudio(type) { return type.endsWith("/studio.html") } // 渲染页面 function renderHtml(pcform, isGuest, body) { let content; try { content = fs.readFileSync(pcform, { encoding: 'utf8' }) } catch (e) { res.writeHead(404, { "Content-Type": "application/json;charset=UTF-8" }); res.end("pcform:" + pcform + "文件异常!"); return; } const statusCode = 200; if (!body) throw new Error(`No body text found for the ${statusCode} status code`); try { var html = ejs.render(content, options); } catch (e) { res.end(e.message); return; } let postDataStr = JSON.stringify(postData || {}); let varName = options.varName || 'viteRequestData'; let varGlobal = JSON.stringify(options.global || {}); let funcName = new Date().valueOf(); let queryScript = ` function _viteGetQuery${funcName}() { var url = window.location.search; var theRequest = new Object(); if (url.indexOf("?") != -1) { var str = url.substr(1); strs = str.split("&"); for(var i = 0; i < strs.length; i ++) { theRequest[strs[i].split("=")[0]]=decodeURI(strs[i].split("=")[1]); } } return theRequest; }` let titleStr = html.match(/<head(.*?)>/g)[0] || ""; var pathname = req._parsedUrl.pathname; if (!isStudio(pathname)) { html = html.replace( /<head(.*?)>/g, `${titleStr}<script>${queryScript};window.isGuest=${isGuest}; window.${varName} = Object.assign(_viteGetQuery${funcName}(),${postDataStr}); window._global=${varGlobal}</script> ` ) let titleEnd = html.match(/<\/head(.*?)>/g)[0] || ""; let lang = result["locale"] || Cookies["locale"] || "zh-CN"; lang = lang.replace("_", "-"); var sam = ""; var samDef = ""; if (pcform.indexOf("hivuiSam/index.html") != -1) {//统计分析 samDef = `<script src="/${projectName}/hivuiSam/lang/zh-CN.js"></script>` sam = `<script src="${VITE_APP_BASE_API}/lang/ref?pn=${process.env.VITE_APP_PN}&vmId=tpl&filePath=${userName}/${projectName}/hivuiSam/lang/def.language&locale=${lang}"></script>` }; var platfPlugin = ''; var platfPluginDef = ''; if (pcform.indexOf("hivuiBirt/index.html") != -1) {//平台插件 platfPluginDef = `<script src="/${projectName}/hivuiBirt/lang/zh-CN.js"></script>` platfPlugin = `<script src="${VITE_APP_BASE_API}/lang/ref?pn=${process.env.VITE_APP_PN}&vmId=tpl&filePath=${userName}/${projectName}/hivuiBirt/lang/def.language&locale=${lang}"></script>` }; let funcDefLangMap = { 'hivuiLogin/index.html': `/${projectName}/hivuiLogin/lang/zh-CN.js`, 'hivuiMain/index.html': `/${projectName}/hivuiMain/lang/zh-CN.js`, } let funcLangMap = { 'hivuiLogin/index.html': `${VITE_APP_BASE_API}/lang/ref?pn=${process.env.VITE_APP_PN}&vmId=tpl&filePath=${userName}/${projectName}/hivuiLogin/lang/def.language&locale=${lang}`, 'hivuiMain/index.html': `${VITE_APP_BASE_API}/lang/ref?pn=${process.env.VITE_APP_PN}&vmId=tpl&filePath=${userName}/${projectName}/hivuiMain/lang/def.language&locale=${lang}`, 'platf/permission': `${VITE_APP_BASE_API}/lang/ref?pn=${process.env.VITE_APP_PN}&vmId=scheme&bizPath=${projectName}.pro/setting.project_setrootdir/global.dir/rolescheme.roletp&locale=${lang}` } let curFuncLangScript = '' for (let k in funcDefLangMap) { if (pathname.indexOf(k) > -1 || (routerMap[pathname] && routerMap[pathname].indexOf(k) > -1)) { curFuncLangScript += `<script src="${funcDefLangMap[k]}"></script>` break; } } for (let k in funcLangMap) { if (pathname.indexOf(k) > -1 || (routerMap[pathname] && routerMap[pathname].indexOf(k) > -1)) { curFuncLangScript += `<script src="${funcLangMap[k]}"></script>` break; } } var viteData = html.match(/<vite>([\s\S]*)<\/vite>/); var viteTpl = "", viteprojectTpl = ""; let token = Cookies[TokenKey]; if (viteData) { //流引入多语言 var viteDataJson = JSON.parse(html.match(/<vite>([\s\S]*)<\/vite>/)[1]); viteprojectTpl = `<script src="${VITE_APP_BASE_API}/lang/static?pn=${process.env.VITE_APP_PN}&vmId=${viteDataJson.project_vmid}&locale=${lang}"></script>` if (viteDataJson.module_vmid && viteDataJson.bizpath) viteTpl = `<script src="${VITE_APP_BASE_API}/lang/ref?pn=${process.env.VITE_APP_PN}&vmId=${viteDataJson.module_vmid}&bizPath=${viteDataJson.bizpath}&locale=${lang}"></script>` } html = html.replace( /<\/head(.*?)>/g, `<script src="/assets_platform/vue-i18n/vue-i18n.js"></script> <script src="/${projectName}/lang/element-ui/${lang}.js"></script> <script src="${VITE_APP_BASE_API}/lang/ref?pn=${process.env.VITE_APP_PN}&vmId=hiui&filePath=${userName}/${projectName}/lang/hi-ui/def.language&locale=${lang}"></script> ${curFuncLangScript} ${viteprojectTpl} ${viteTpl} ${samDef} ${platfPluginDef} ${sam} ${platfPlugin} <script> try{ window.global={ pName:"${projectName}", pUser:"${userName}", pn:"${projectName}/${userName}" } // 统一输出语言包 zh-CN 名 // if(!window.GLOBAL_LANG_TPL){ // console.log('不影响运行,提示:[[${req.url},当前模板语言包不存在]]') // } // if(!window.GLOBAL_LANG_HIUI){ // console.log('不影响运行,提示:[[${req.url},hiui语言包不存在]]') // } window.lang = window.lang ||{}; window.lang.keys = Object.assign({},window.GLOBAL_LANG_TPL||{},window.GLOBAL_LANG_HIUI||{},window.GLOBAL_LANG_PROJECT||{},window.GLOBAL_LANG_MODULE||{},window.GLOBAL_LANG_SCHEME||{}); Vue.prototype._i18n = new VueI18n({ locale: 'localelang', messages: { 'localelang':window.lang.keys, } }); (function(lang){ lang = lang.split('-'); lang= lang[0]+((lang[1]||'').charAt(0).toUpperCase() + (lang[1]||'').slice(1)); console.log(lang) ELEMENT.locale(ELEMENT.lang[lang]) })('${lang}'); }catch(e){ console.log('语言包加载出错!') } </script> <script src="/assets_platform/customSysCfg/index.js"></script> <script src="/${projectName}/setting/desktop/base.js" type="text/javascript"></script> <script src="/${projectName}/setting/desktop/development.js" type="text/javascript"></script> ${titleEnd}`) } res.writeHead(statusCode, { "serverInfo": `${VITE_APP_BASE_API},${VITE_APP_SERVER}`, // 'Content-Length': html.length, 'Content-Type': 'html' }); res.write(html) res.end(); } var serverPath = VITE_APP_BASE_API + VITE_APP_SERVER; if (req.url.indexOf("/development.js") != -1) { if (req.headers.referer) { if (req.headers.referer.startsWith("https")) { options["VITE_APP_BASE_API"] = options["VITE_APP_BASE_API"].replace("http://", "https://"); } else { options["VITE_APP_BASE_API"] = options["VITE_APP_BASE_API"].replace("https://", "http://"); } } let content; try { content = fs.readFileSync(req.url.substr(1), { encoding: 'utf8' }) } catch (e) { res.writeHead(404, { "Content-Type": "application/json;charset=UTF-8" }); res.end("获取", req.url + "文件异常!"); return; } try { var html = ejs.render(content, options); } catch (e) { res.end(e.message); return; } res.end(html); return; } let pathname = req._parsedUrl.pathname; //console.log(new Date(), 'req.url:', req.url) if (isFlow(pathname) || isFunc(pathname) || isInfc(pathname)) { // let url = req.url; let post = ''; postData = ''; let path; let fmodelpath = pathname; // url.split("?")[0]; var post_data = {}; // var param = req.url.split("?")[1]; if (isFlow(fmodelpath)) { var fversion = ""; var ftaskguid = ""; var fbzid = ""; if (param) { fversion = result["_version"] || result["version"]; ftaskguid = result["_ftaskguid"] || result["ftaskguid"]; fbzid = result["fbzid"]; } post_data = { fmodelpath: fmodelpath, fversion, ftaskguid, fbzid } path = serverPath + "/flow/open?origin=pre&skip=false&pn="; } else if (isInfc(fmodelpath)) { path = serverPath + fmodelpath + "?pn="; } else { var viewItemId = "" if (param) { viewItemId = result["__viewItemId"] || result["viewItemId"] || ""; } path = serverPath + fmodelpath + "?origin=pre&skip=false&viewItemId=" + viewItemId + "&pn=" } // let pn = url.split("/")[1]; function handleFunc() { let token = Cookies[TokenKey]; let requestUrl = path + process.env.VITE_APP_PN; if (param) { requestUrl = requestUrl + "&" + param; } console.log("----requestUrl:", requestUrl, "token:", token); Object.assign(post_data, postData); let lang = result["locale"] || Cookies["locale"] || "zh-CN"; lang = lang.replace("_", "-"); var requestOption = { url: requestUrl, method: "POST", json: true, body: post_data, headers: { "token": token, "Cookie": `locale=${lang}`, "Authorization": "Bearer " + token, "Content-Type": "application/json;charset=UTF-8" } } if (isFlow(pathname)) { requestOption["body"] = post_data; } else if (isFunc(pathname)) { //页面流用表单提交 requestOption["form"] = post_data; } request(requestOption, function (error, response, body) { //console.log(error, response, body); if (!error && response.statusCode == 200) { let pcform; let designPath; let isGuest = false; if (body) { if (isFlow(fmodelpath) && body.outParameter) { pcform = body.outParameter.task.bizpcform; if (!result["locale"] && body.outParameter.locale) { result["locale"] = body.outParameter.locale; } } else if (isFunc(fmodelpath) || isInfc(fmodelpath)) { if (body && body.logicflow || isInfc(fmodelpath)) { //逻辑流 let statusCode = body.status || response.statusCode; res.writeHead(statusCode, { "Content-Type": "application/json;charset=UTF-8" }); res.end(JSON.stringify(body)); return; } else if (body.dataPack) { pcform = body.dataPack.path; designPath = body.dataPack.designPath; isGuest = body.dataPack.isGuest; if (!result["locale"] && body.dataPack.locale) { result["locale"] = body.dataPack.locale; } } } } if (!pcform) { res.writeHead(500, { "serverInfo": `${VITE_APP_BASE_API},${VITE_APP_SERVER}`, "Content-Type": "application/json;charset=UTF-8" }); res.end(JSON.stringify(body)); return; } if (designPath && (designPath.endsWith(".vm") || designPath.endsWith(".dvm"))) { res.writeHead(200, { 'Content-Type': 'html' }); let projectName = process.env.VITE_APP_PN.split("/")[0]; var pn = `pn=${process.env.VITE_APP_PN}` if (req.url.indexOf("?") == -1) { pn = "?" + pn; } else { pn = "&" + pn; } let accessToken = "" if (token) { accessToken = `&access_token=${token}`; } let html = ` <script src="/assets_platform/eap/eap.umd.min.js"></script> <script> window._global ={ env :"dev" } </script> <script src="/${projectName}/setting/desktop/development.js" type="text/javascript"></script> <script> window.location.href="${serverPath}${req.url}${pn}${accessToken}"; </script> ` res.end(html); return; } // var fullPath = "eaptpl/12112/mokuai/shitumulu/biaodan/dtv/1.0.0/desktop/index.html"; renderHtml(pcform, isGuest, body); } else { if (response && response.statusCode == 401) { res.writeHead(200, { "serverInfo": `${VITE_APP_BASE_API},${VITE_APP_SERVER}`, 'Content-Type': 'html' }); let projectName = process.env.VITE_APP_PN.split("/")[0]; let html = ` <script src="/assets_platform/eap/eap.umd.min.js"></script> <script> window._global ={ env :"dev" } </script> <script> if(top.window.SysPage&&top.window.SysPage.openMiniLogin){//小窗口 top.window.SysPage.openMiniLogin(true); }else{ window.location.href=window.HIVUI_SETTING.loginUrl; } </script> ` res.end(html); } else { res.writeHead(500, { "serverInfo": `${VITE_APP_BASE_API},${VITE_APP_SERVER}`, "Content-Type": "application/json;charset=UTF-8" }); res.end(JSON.stringify(body)); } //res.end(requestUrl + ":" + JSON.stringify(error) + JSON.stringify(body)); } }, (msg) => { res.writeHead(404, { "Content-Type": "application/json;charset=UTF-8" }); res.end(JSON.stringify(msg)); // console.log(msg) }); } req.on('data', (chunk) => { post += chunk; postData = querystring.parse(post); }); req.on('end', (chunk) => { handleFunc() }); return; } else if (routerMap[pathname]) { let pcform = routerMap[pathname]; renderHtml(pcform, false, {}) } // else if (pathname.endsWith("studio.html")) { //动态流程 routerMap[pathname]已处理 // let projectName = process.env.VITE_APP_PN.split("/")[0]; // let pcform = `${projectName}/hivuiStudio/index.html` // renderHtml(pcform, false, {}) // } else { if (isHtml(pathname)) { renderHtml(pathname.substr(1), false, {}) } else { var newPath = `/render/${userName}`; var assets_platform = "/render/assets_platform"; if (pathname.indexOf(newPath) != -1) { req.url = req.url.replace(newPath, ""); } if (pathname.indexOf(assets_platform) != -1) { req.url = req.url.replace(assets_platform, "/assets_platform"); } next(); } } }) }, } } export default myPlugin;
var querystring = require('querystring'); var url = require('url'); const fs = require('fs') var https = require('https'); var request = require('request'); var ejs = require('ejs'); function myPlugin(rawOptions) { let projectName = process.env.VITE_APP_PN.split("/")[0]; let userName = process.env.VITE_APP_PN.split("/")[1]; var previewPath = `${projectName}/setting/studio/preview.json` var setting try { let settingContent = fs.readFileSync(previewPath, { encoding: 'utf8' }); setting = JSON.parse(settingContent) } catch (e) { console.log("preview数据有错!") } var VITE_APP_BASE_API, VITE_APP_SERVER; if (setting) { VITE_APP_BASE_API = (setting.server || {}).VITE_APP_BASE_API || process.env.VITE_APP_BASE_API; VITE_APP_SERVER = (setting.server || {}).VITE_APP_SERVER || process.env.VITE_APP_SERVER; } else { VITE_APP_BASE_API = process.env.VITE_APP_BASE_API; VITE_APP_SERVER = process.env.VITE_APP_SERVER; } const options = { isProduction: process.env.NODE_ENV === 'production', ...rawOptions, VITE_APP_BASE_API: VITE_APP_BASE_API, VITE_APP_SERVER: VITE_APP_SERVER, root: process.cwd(), }; var routerOption = { url: `${VITE_APP_BASE_API}/map.html?pn=${process.env.VITE_APP_PN}`, method: "GET", json: true, headers: { "Content-Type": "application/json;charset=UTF-8" } } const routerMap = {}; request(routerOption, function (error, response, body) { if (body) { for (var i = 0; i < body.length; i++) { let routerPath = body[i].value; routerPath = routerPath.substr(routerPath.indexOf("/") + 1) + ".html" routerMap["/" + body[i].key] = routerPath; } } }) const TokenKey = 'EAP-Token'; let postData; let config; return { name: 'vite-plugin-func', // 必须的,将会显示在 warning 和 error 中 configResolved(resolvedConfig) { // 存储最终解析的配置 config = resolvedConfig }, configureServer(server) { server.middlewares.use((req, res, next) => { var Cookies = {}; if (req.headers.cookie != null) { req.headers.cookie.split(';').forEach(l => { var parts = l.split('='); Cookies[parts[0].trim()] = (parts[1] || '').trim(); }); } var param = req._parsedUrl.query; var result = {}; if (param) { let values = param.split("&"); for (let i = 0; i < values.length; i++) { const element = values[i]; let _val = element.split("="); result[_val[0]] = _val[1]; } } function isFlow(type) { return type.endsWith(".flow") || type.endsWith(".flowc"); } // 接口 function isInfc(type) { return type.endsWith(".infc") } function isFunc(type) { return type.endsWith(".func") } function isHtml(type) { return type.endsWith(".html") } function isStudio(type) { return type.endsWith("/studio.html") } // 渲染页面 function renderHtml(pcform, isGuest, body) { let content; try { content = fs.readFileSync(pcform, { encoding: 'utf8' }) } catch (e) { res.writeHead(404, { "Content-Type": "application/json;charset=UTF-8" }); res.end("pcform:" + pcform + "文件异常!"); return; } const statusCode = 200; if (!body) throw new Error(`No body text found for the ${statusCode} status code`); try { var html = ejs.render(content, options); } catch (e) { res.end(e.message); return; } let postDataStr = JSON.stringify(postData || {}); let varName = options.varName || 'viteRequestData'; let varGlobal = JSON.stringify(options.global || {}); let funcName = new Date().valueOf(); let queryScript = ` function _viteGetQuery${funcName}() { var url = window.location.search; var theRequest = new Object(); if (url.indexOf("?") != -1) { var str = url.substr(1); strs = str.split("&"); for(var i = 0; i < strs.length; i ++) { theRequest[strs[i].split("=")[0]]=decodeURI(strs[i].split("=")[1]); } } return theRequest; }` let titleStr = html.match(/<head(.*?)>/g)[0] || ""; var pathname = req._parsedUrl.pathname; if (!isStudio(pathname)) { html = html.replace( /<head(.*?)>/g, `${titleStr}<script>${queryScript};window.isGuest=${isGuest}; window.${varName} = Object.assign(_viteGetQuery${funcName}(),${postDataStr}); window._global=${varGlobal}</script> ` ) let titleEnd = html.match(/<\/head(.*?)>/g)[0] || ""; let lang = result["locale"] || Cookies["locale"] || "zh-CN"; lang = lang.replace("_", "-"); var sam = ""; var samDef = ""; if (pcform.indexOf("hivuiSam/index.html") != -1) {//统计分析 samDef = `<script src="/${projectName}/hivuiSam/lang/zh-CN.js"></script>` sam = `<script src="${VITE_APP_BASE_API}/lang/ref?pn=${process.env.VITE_APP_PN}&vmId=tpl&filePath=${userName}/${projectName}/hivuiSam/lang/def.language&locale=${lang}"></script>` }; var platfPlugin = ''; var platfPluginDef = ''; if (pcform.indexOf("hivuiBirt/index.html") != -1) {//平台插件 platfPluginDef = `<script src="/${projectName}/hivuiBirt/lang/zh-CN.js"></script>` platfPlugin = `<script src="${VITE_APP_BASE_API}/lang/ref?pn=${process.env.VITE_APP_PN}&vmId=tpl&filePath=${userName}/${projectName}/hivuiBirt/lang/def.language&locale=${lang}"></script>` }; let funcDefLangMap = { 'hivuiLogin/index.html': `/${projectName}/hivuiLogin/lang/zh-CN.js`, 'hivuiMain/index.html': `/${projectName}/hivuiMain/lang/zh-CN.js`, } let funcLangMap = { 'hivuiLogin/index.html': `${VITE_APP_BASE_API}/lang/ref?pn=${process.env.VITE_APP_PN}&vmId=tpl&filePath=${userName}/${projectName}/hivuiLogin/lang/def.language&locale=${lang}`, 'hivuiMain/index.html': `${VITE_APP_BASE_API}/lang/ref?pn=${process.env.VITE_APP_PN}&vmId=tpl&filePath=${userName}/${projectName}/hivuiMain/lang/def.language&locale=${lang}`, 'platf/permission': `${VITE_APP_BASE_API}/lang/ref?pn=${process.env.VITE_APP_PN}&vmId=scheme&bizPath=${projectName}.pro/setting.project_setrootdir/global.dir/rolescheme.roletp&locale=${lang}` } let curFuncLangScript = '' for (let k in funcDefLangMap) { if (pathname.indexOf(k) > -1 || (routerMap[pathname] && routerMap[pathname].indexOf(k) > -1)) { curFuncLangScript += `<script src="${funcDefLangMap[k]}"></script>` break; } } for (let k in funcLangMap) { if (pathname.indexOf(k) > -1 || (routerMap[pathname] && routerMap[pathname].indexOf(k) > -1)) { curFuncLangScript += `<script src="${funcLangMap[k]}"></script>` break; } } var viteData = html.match(/<vite>([\s\S]*)<\/vite>/); var viteTpl = "", viteprojectTpl = ""; let token = Cookies[TokenKey]; if (viteData) { //流引入多语言 var viteDataJson = JSON.parse(html.match(/<vite>([\s\S]*)<\/vite>/)[1]); viteprojectTpl = `<script src="${VITE_APP_BASE_API}/lang/static?pn=${process.env.VITE_APP_PN}&vmId=${viteDataJson.project_vmid}&locale=${lang}"></script>` if (viteDataJson.module_vmid && viteDataJson.bizpath) viteTpl = `<script src="${VITE_APP_BASE_API}/lang/ref?pn=${process.env.VITE_APP_PN}&vmId=${viteDataJson.module_vmid}&bizPath=${viteDataJson.bizpath}&locale=${lang}"></script>` } html = html.replace( /<\/head(.*?)>/g, `<script src="/assets_platform/vue-i18n/vue-i18n.js"></script> <script src="/${projectName}/lang/element-ui/${lang}.js"></script> <script src="${VITE_APP_BASE_API}/lang/ref?pn=${process.env.VITE_APP_PN}&vmId=hiui&filePath=${userName}/${projectName}/lang/hi-ui/def.language&locale=${lang}"></script> ${curFuncLangScript} ${viteprojectTpl} ${viteTpl} ${samDef} ${platfPluginDef} ${sam} ${platfPlugin} <script> try{ window.global={ pName:"${projectName}", pUser:"${userName}", pn:"${projectName}/${userName}" } // 统一输出语言包 zh-CN 名 if(!window.GLOBAL_LANG_TPL){ console.log('不影响运行,提示:[[${req.url},当前模板语言包不存在]]') } if(!window.GLOBAL_LANG_HIUI){ console.log('不影响运行,提示:[[${req.url},hiui语言包不存在]]') } window.lang = window.lang ||{}; window.lang.keys = Object.assign({},window.GLOBAL_LANG_TPL||{},window.GLOBAL_LANG_HIUI||{},window.GLOBAL_LANG_PROJECT||{},window.GLOBAL_LANG_MODULE||{},window.GLOBAL_LANG_SCHEME||{}); Vue.prototype._i18n = new VueI18n({ locale: 'localelang', messages: { 'localelang':window.lang.keys, } }); (function(lang){ lang = lang.split('-'); lang= lang[0]+((lang[1]||'').charAt(0).toUpperCase() + (lang[1]||'').slice(1)); console.log(lang) ELEMENT.locale(ELEMENT.lang[lang]) })('${lang}'); }catch(e){ console.log('语言包加载出错!') } </script> <script src="/assets_platform/customSysCfg/index.js"></script> <script src="/${projectName}/setting/desktop/base.js" type="text/javascript"></script> <script src="/${projectName}/setting/desktop/development.js" type="text/javascript"></script> ${titleEnd}`) } res.writeHead(statusCode, { "serverInfo": `${VITE_APP_BASE_API},${VITE_APP_SERVER}`, // 'Content-Length': html.length, 'Content-Type': 'html' }); res.write(html) res.end(); } var serverPath = VITE_APP_BASE_API + VITE_APP_SERVER; if (req.url.indexOf("/development.js") != -1) { if (req.headers.referer) { if (req.headers.referer.startsWith("https")) { options["VITE_APP_BASE_API"] = options["VITE_APP_BASE_API"].replace("http://", "https://"); } else { options["VITE_APP_BASE_API"] = options["VITE_APP_BASE_API"].replace("https://", "http://"); } } let content; try { content = fs.readFileSync(req.url.substr(1), { encoding: 'utf8' }) } catch (e) { res.writeHead(404, { "Content-Type": "application/json;charset=UTF-8" }); res.end("获取", req.url + "文件异常!"); return; } try { var html = ejs.render(content, options); } catch (e) { res.end(e.message); return; } res.end(html); return; } let pathname = req._parsedUrl.pathname; //console.log(new Date(), 'req.url:', req.url) if (isFlow(pathname) || isFunc(pathname) || isInfc(pathname)) { // let url = req.url; let post = ''; postData = ''; let path; let fmodelpath = pathname; // url.split("?")[0]; var post_data = {}; // var param = req.url.split("?")[1]; if (isFlow(fmodelpath)) { var fversion = ""; var ftaskguid = ""; var fbzid = ""; if (param) { fversion = result["_version"] || result["version"]; ftaskguid = result["_ftaskguid"] || result["ftaskguid"]; fbzid = result["fbzid"]; } post_data = { fmodelpath: fmodelpath, fversion, ftaskguid, fbzid } path = serverPath + "/flow/open?origin=pre&skip=false&pn="; } else if (isInfc(fmodelpath)) { path = serverPath + fmodelpath + "?pn="; } else { var viewItemId = "" if (param) { viewItemId = result["__viewItemId"] || result["viewItemId"] || ""; } path = serverPath + fmodelpath + "?origin=pre&skip=false&viewItemId=" + viewItemId + "&pn=" } // let pn = url.split("/")[1]; function handleFunc() { let token = Cookies[TokenKey]; let requestUrl = path + process.env.VITE_APP_PN; if (param) { requestUrl = requestUrl + "&" + param; } console.log("----requestUrl:", requestUrl, "token:", token); Object.assign(post_data, postData); let lang = result["locale"] || Cookies["locale"] || "zh-CN"; lang = lang.replace("_", "-"); var requestOption = { url: requestUrl, method: "POST", json: true, body: post_data, headers: { "token": token, "Cookie": `locale=${lang}`, "Authorization": "Bearer " + token, "Content-Type": "application/json;charset=UTF-8" } } if (isFlow(pathname)) { requestOption["body"] = post_data; } else if (isFunc(pathname)) { //页面流用表单提交 requestOption["form"] = post_data; } request(requestOption, function (error, response, body) { //console.log(error, response, body); if (!error && response.statusCode == 200) { let pcform; let designPath; let isGuest = false; if (body) { if (isFlow(fmodelpath) && body.outParameter) { pcform = body.outParameter.task.bizpcform; if (!result["locale"] && body.outParameter.locale) { result["locale"] = body.outParameter.locale; } } else if (isFunc(fmodelpath) || isInfc(fmodelpath)) { if (body && body.logicflow || isInfc(fmodelpath)) { //逻辑流 let statusCode = body.status || response.statusCode; res.writeHead(statusCode, { "Content-Type": "application/json;charset=UTF-8" }); res.end(JSON.stringify(body)); return; } else if (body.dataPack) { pcform = body.dataPack.path; designPath = body.dataPack.designPath; isGuest = body.dataPack.isGuest; if (!result["locale"] && body.dataPack.locale) { result["locale"] = body.dataPack.locale; } } } } if (!pcform) { res.writeHead(500, { "serverInfo": `${VITE_APP_BASE_API},${VITE_APP_SERVER}`, "Content-Type": "application/json;charset=UTF-8" }); res.end(JSON.stringify(body)); return; } if (designPath && (designPath.endsWith(".vm") || designPath.endsWith(".dvm"))) { res.writeHead(200, { 'Content-Type': 'html' }); let projectName = process.env.VITE_APP_PN.split("/")[0]; var pn = `pn=${process.env.VITE_APP_PN}` if (req.url.indexOf("?") == -1) { pn = "?" + pn; } else { pn = "&" + pn; } let accessToken = "" if (token) { accessToken = `&access_token=${token}`; } let html = ` <script src="/assets_platform/eap/eap.umd.min.js"></script> <script> window._global ={ env :"dev" } </script> <script src="/${projectName}/setting/desktop/development.js" type="text/javascript"></script> <script> window.location.href="${serverPath}${req.url}${pn}${accessToken}"; </script> ` res.end(html); return; } // var fullPath = "eaptpl/12112/mokuai/shitumulu/biaodan/dtv/1.0.0/desktop/index.html"; renderHtml(pcform, isGuest, body); } else { if (response && response.statusCode == 401) { res.writeHead(200, { "serverInfo": `${VITE_APP_BASE_API},${VITE_APP_SERVER}`, 'Content-Type': 'html' }); let projectName = process.env.VITE_APP_PN.split("/")[0]; let html = ` <script src="/assets_platform/eap/eap.umd.min.js"></script> <script> window._global ={ env :"dev" } </script> <script> if(top.window.SysPage&&top.window.SysPage.openMiniLogin){//小窗口 top.window.SysPage.openMiniLogin(true); }else{ window.location.href=window.HIVUI_SETTING.loginUrl; } </script> ` res.end(html); } else { res.writeHead(500, { "serverInfo": `${VITE_APP_BASE_API},${VITE_APP_SERVER}`, "Content-Type": "application/json;charset=UTF-8" }); res.end(JSON.stringify(body)); } //res.end(requestUrl + ":" + JSON.stringify(error) + JSON.stringify(body)); } }, (msg) => { res.writeHead(404, { "Content-Type": "application/json;charset=UTF-8" }); res.end(JSON.stringify(msg)); // console.log(msg) }); } req.on('data', (chunk) => { post += chunk; postData = querystring.parse(post); }); req.on('end', (chunk) => { handleFunc() }); return; } else if (routerMap[pathname]) { let pcform = routerMap[pathname]; renderHtml(pcform, false, {}) } // else if (pathname.endsWith("studio.html")) { //动态流程 routerMap[pathname]已处理 // let projectName = process.env.VITE_APP_PN.split("/")[0]; // let pcform = `${projectName}/hivuiStudio/index.html` // renderHtml(pcform, false, {}) // } else { if (isHtml(pathname)) { renderHtml(pathname.substr(1), false, {}) } else { var newPath = `/render/${userName}`; var assets_platform = "/render/assets_platform"; if (pathname.indexOf(newPath) != -1) { req.url = req.url.replace(newPath, ""); } if (pathname.indexOf(assets_platform) != -1) { req.url = req.url.replace(assets_platform, "/assets_platform"); } next(); } } }) }, } } export default myPlugin;
Show line notes below