From 0443c850719d9059906ed8b1c844265f1ac104cb Mon Sep 17 00:00:00 2001 From: “shentao” Date: Fri, 30 Sep 2016 20:34:10 +0800 Subject: modify login function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I4546373862406cf379c97de0ed83eb3d6dc03a5c Signed-off-by: “shentao” --- .../src/main/webapp/common/about.html | 2 +- .../src/main/webapp/common/changepwd.html | 90 - .../src/main/webapp/common/default.html | 556 +- .../common/i18n/openo-nsoc-i18n-en-US.properties | 23 + .../common/i18n/openo-nsoc-i18n-zh-CN.properties | 32 + .../common/i18n/openo-roc-i18n-en-US.properties | 21 + .../common/i18n/openo-roc-i18n-zh-CN.properties | 107 + .../common/i18n/openo-umc-i18n-en-US.properties | 27 + .../common/i18n/openo-umc-i18n-zh-CN.properties | 27 + .../i18n/web-portal-login-i18n-en-US.properties | 49 - .../i18n/web-portal-login-i18n-zh-CN.properties | 49 - ...-portal-login-integration-i18n-en-US.properties | 3 +- ...-portal-login-integration-i18n-zh-CN.properties | 1 - .../main/webapp/common/image/integration/logo.png | Bin 5668 -> 0 bytes .../webapp/common/image/integration/openo_bg_1.jpg | Bin 0 -> 143465 bytes .../webapp/common/image/integration/openo_bg_2.jpg | Bin 0 -> 152396 bytes .../webapp/common/image/integration/openo_bg_3.jpg | Bin 0 -> 155899 bytes .../common/image/integration/openo_logo_white.png | Bin 0 -> 5717 bytes .../webapp/common/image/integration/zte_bg_1.jpg | Bin 143465 -> 0 bytes .../webapp/common/image/integration/zte_bg_2.jpg | Bin 152396 -> 0 bytes .../webapp/common/image/integration/zte_bg_3.jpg | Bin 155899 -> 0 bytes .../common/image/integration/zte_logo_16.gif | Bin 106 -> 0 bytes .../common/image/integration/zte_logo_white.png | Bin 5717 -> 0 bytes .../webapp/common/image/integration/ztelogo.png | Bin 2790 -> 0 bytes .../src/main/webapp/common/js/core/ZteFrameWork.js | 4008 ------ .../main/webapp/common/js/core/ZteFrameWork.min.js | 165 - .../main/webapp/common/js/core/openoFrameWork.js | 3997 ++++++ .../webapp/common/js/core/openoFrameWork.min.js | 165 + .../webapp/common/js/i18n/loadi18n-openo-nsoc.js | 20 + .../webapp/common/js/i18n/loadi18n-openo-roc.js | 21 + .../webapp/common/js/i18n/loadi18n-openo-umc.js | 19 + .../common/js/international/loadi18n-login.js | 44 +- .../src/main/webapp/common/js/login.js | 360 +- .../src/main/webapp/common/js/mainpage/about.js | 4 +- .../webapp/common/js/mainpage/ict.main.page.js | 4 - .../src/main/webapp/common/js/moreOperation.js | 4 +- .../src/main/webapp/common/js/tools.js | 19 +- .../src/main/webapp/common/json/main-page.json | 14 +- .../src/main/webapp/common/login.html | 269 +- .../src/main/webapp/common/main-page.html | 54 +- .../src/main/webapp/common/main_Fmegabar.html | 2 +- .../src/main/webapp/common/main_siderbar.html | 211 +- .../common/thirdparty/data-tables/DataTableICT.js | 10 +- .../thirdparty/data-tables/DataTableSmartClient.js | 6 +- .../data-tables/DataTableSmartClientApp.js | 6 +- .../common/thirdparty/data-tables/dataTable.html | 2 +- .../data-tables/jquery.dataTables-1.9.4.js | 12101 ------------------- .../data-tables/jquery.dataTables-1.9.4.min.js | 155 - .../common/thirdparty/fakeLoader/fakeLoader.min.js | 2 +- 49 files changed, 5036 insertions(+), 17613 deletions(-) delete mode 100644 openo-portal/portal-common/src/main/webapp/common/changepwd.html create mode 100644 openo-portal/portal-common/src/main/webapp/common/i18n/openo-nsoc-i18n-en-US.properties create mode 100644 openo-portal/portal-common/src/main/webapp/common/i18n/openo-nsoc-i18n-zh-CN.properties create mode 100644 openo-portal/portal-common/src/main/webapp/common/i18n/openo-roc-i18n-en-US.properties create mode 100644 openo-portal/portal-common/src/main/webapp/common/i18n/openo-roc-i18n-zh-CN.properties create mode 100644 openo-portal/portal-common/src/main/webapp/common/i18n/openo-umc-i18n-en-US.properties create mode 100644 openo-portal/portal-common/src/main/webapp/common/i18n/openo-umc-i18n-zh-CN.properties delete mode 100644 openo-portal/portal-common/src/main/webapp/common/i18n/web-portal-login-i18n-en-US.properties delete mode 100644 openo-portal/portal-common/src/main/webapp/common/i18n/web-portal-login-i18n-zh-CN.properties delete mode 100644 openo-portal/portal-common/src/main/webapp/common/image/integration/logo.png create mode 100644 openo-portal/portal-common/src/main/webapp/common/image/integration/openo_bg_1.jpg create mode 100644 openo-portal/portal-common/src/main/webapp/common/image/integration/openo_bg_2.jpg create mode 100644 openo-portal/portal-common/src/main/webapp/common/image/integration/openo_bg_3.jpg create mode 100644 openo-portal/portal-common/src/main/webapp/common/image/integration/openo_logo_white.png delete mode 100644 openo-portal/portal-common/src/main/webapp/common/image/integration/zte_bg_1.jpg delete mode 100644 openo-portal/portal-common/src/main/webapp/common/image/integration/zte_bg_2.jpg delete mode 100644 openo-portal/portal-common/src/main/webapp/common/image/integration/zte_bg_3.jpg delete mode 100644 openo-portal/portal-common/src/main/webapp/common/image/integration/zte_logo_16.gif delete mode 100644 openo-portal/portal-common/src/main/webapp/common/image/integration/zte_logo_white.png delete mode 100644 openo-portal/portal-common/src/main/webapp/common/image/integration/ztelogo.png delete mode 100644 openo-portal/portal-common/src/main/webapp/common/js/core/ZteFrameWork.js delete mode 100644 openo-portal/portal-common/src/main/webapp/common/js/core/ZteFrameWork.min.js create mode 100644 openo-portal/portal-common/src/main/webapp/common/js/core/openoFrameWork.js create mode 100644 openo-portal/portal-common/src/main/webapp/common/js/core/openoFrameWork.min.js create mode 100644 openo-portal/portal-common/src/main/webapp/common/js/i18n/loadi18n-openo-nsoc.js create mode 100644 openo-portal/portal-common/src/main/webapp/common/js/i18n/loadi18n-openo-roc.js create mode 100644 openo-portal/portal-common/src/main/webapp/common/js/i18n/loadi18n-openo-umc.js delete mode 100644 openo-portal/portal-common/src/main/webapp/common/thirdparty/data-tables/jquery.dataTables-1.9.4.js delete mode 100644 openo-portal/portal-common/src/main/webapp/common/thirdparty/data-tables/jquery.dataTables-1.9.4.min.js (limited to 'openo-portal/portal-common') diff --git a/openo-portal/portal-common/src/main/webapp/common/about.html b/openo-portal/portal-common/src/main/webapp/common/about.html index 77795cd5..c0143021 100644 --- a/openo-portal/portal-common/src/main/webapp/common/about.html +++ b/openo-portal/portal-common/src/main/webapp/common/about.html @@ -24,7 +24,7 @@
- +
diff --git a/openo-portal/portal-common/src/main/webapp/common/changepwd.html b/openo-portal/portal-common/src/main/webapp/common/changepwd.html deleted file mode 100644 index dacfbf5e..00000000 --- a/openo-portal/portal-common/src/main/webapp/common/changepwd.html +++ /dev/null @@ -1,90 +0,0 @@ - -
- -
\ No newline at end of file diff --git a/openo-portal/portal-common/src/main/webapp/common/default.html b/openo-portal/portal-common/src/main/webapp/common/default.html index 49c8812d..8b91d02d 100644 --- a/openo-portal/portal-common/src/main/webapp/common/default.html +++ b/openo-portal/portal-common/src/main/webapp/common/default.html @@ -16,200 +16,99 @@ - - - + + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - -
- +
- - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + - - - - - \ No newline at end of file + diff --git a/openo-portal/portal-common/src/main/webapp/common/i18n/openo-nsoc-i18n-en-US.properties b/openo-portal/portal-common/src/main/webapp/common/i18n/openo-nsoc-i18n-en-US.properties new file mode 100644 index 00000000..cf4261e5 --- /dev/null +++ b/openo-portal/portal-common/src/main/webapp/common/i18n/openo-nsoc-i18n-en-US.properties @@ -0,0 +1,23 @@ +# +# Copyright (C) 2015 ZTE, Inc. and others. All rights reserved. (ZTE) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +org_openo_orchestrator_nsoc_service=Service +org_openo_orchestrator_nsoc_orchestrator=Orchestrator +org_openo_orchestrator_nsoc_model_design=Model Design +org_openo_orchestrator_nsoc_node_type=Node Type +org_openo_orchestrator_nsoc_pkg=Package +org_openo_orchestrator_nsoc_template=Service Template +org_openo_orchestrator_nsoc_lifecycle=Lifecycle +org_openo_orchestrator_nsoc_hostimage=Host Image \ No newline at end of file diff --git a/openo-portal/portal-common/src/main/webapp/common/i18n/openo-nsoc-i18n-zh-CN.properties b/openo-portal/portal-common/src/main/webapp/common/i18n/openo-nsoc-i18n-zh-CN.properties new file mode 100644 index 00000000..d78b800f --- /dev/null +++ b/openo-portal/portal-common/src/main/webapp/common/i18n/openo-nsoc-i18n-zh-CN.properties @@ -0,0 +1,32 @@ +# +# Copyright (C) 2015 ZTE, Inc. and others. All rights reserved. (ZTE) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +org_openo_orchestrator_nsoc=业务 +org_openo_orchestrator_nsoc_orchestrator=编排 +org_openo_orchestrator_nsoc_catalogue=目录管理 +org_openo_orchestrator_nsoc_lifecycle=生命周期管理 +org_openo_orchestrator_nsoc_pkg=包管理 +org_openo_orchestrator_nsoc_template=模板管理 +org_openo_orchestrator_nsoc_templateDetail=模板明细 +org_openo_orchestrator_nsoc_hostimage=主机镜像 +org_openo_orchestrator_nsoc_software_image=软件镜像 +org_openo_orchestrator_nsoc_appCenter=应用中心 +org_openo_orchestrator_nsoc_vapp=虚拟应用 +org_openo_orchestrator_nsoc_nodesApp=节点明细 +org_openo_orchestrator_nsoc_model_design=模型设计 +org_openo_orchestrator_nsoc_node_type=节点类型 + +org_openo_orchestrator_roc_vnfm=VNFM管理 \ No newline at end of file diff --git a/openo-portal/portal-common/src/main/webapp/common/i18n/openo-roc-i18n-en-US.properties b/openo-portal/portal-common/src/main/webapp/common/i18n/openo-roc-i18n-en-US.properties new file mode 100644 index 00000000..72c4e5eb --- /dev/null +++ b/openo-portal/portal-common/src/main/webapp/common/i18n/openo-roc-i18n-en-US.properties @@ -0,0 +1,21 @@ +# +# Copyright (C) 2015 ZTE, Inc. and others. All rights reserved. (ZTE) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +org_openo_orchestrator_roc_resource=Resource +org_openo_orchestrator_roc_managementview=Manage View +org_openo_orchestrator_roc_vim=VIM Manage +org_openo_orchestrator_roc_vnfm=VNFM +org_openo_orchestrator_roc_resourceview=Resource View +org_openo_orchestrator_roc_overview=Overview diff --git a/openo-portal/portal-common/src/main/webapp/common/i18n/openo-roc-i18n-zh-CN.properties b/openo-portal/portal-common/src/main/webapp/common/i18n/openo-roc-i18n-zh-CN.properties new file mode 100644 index 00000000..cdc27fd1 --- /dev/null +++ b/openo-portal/portal-common/src/main/webapp/common/i18n/openo-roc-i18n-zh-CN.properties @@ -0,0 +1,107 @@ +# +# Copyright (C) 2015 ZTE, Inc. and others. All rights reserved. (ZTE) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + + +com_zte_ums_eco_domain=分层管理 +com_zte_ums_eco_ems=网元管理 + +com_zte_ums_zenap_manager=管理 +com_zte_ums_zenap_msb=微服务 +com_zte_ums_zenap_msb_apiroute=api路由 + + +com_zte_ums_eco_roc=资源 +com_zte_ums_eco_roc_managementview=管理视图 +com_zte_ums_eco_roc_vim=VIM管理 +com_zte_ums_eco_roc_vnfm=VNFM管理 + + +com_zte_ums_eco_roc_resourceview=资源视图 +com_zte_ums_eco_roc_overview=资源概览 + +######### do ########## +com_zte_nfv_do_wireless=域管理 - vManager +com_zte_nfv_do_wired=域管理 - vBrasManager +com_zte_nfv_do_application=域管理 - iVLManage +com_zte_nfv_do_vDirector=域管理 - vDirector +com_zte_nfv_do_iRos=域管理 - iRos + +######### iRos ########## +iRos-index=首页 +iRos-resourcemanage=资源管理 +iRos-user=用户管理 +iRos-template=模板管理 +iRos-toInstanceSC=实例管理 + +######### vManager ########## +com_zte_nfv_vmanager_nsoc_overview=概况 +com_zte_nfv_vmanager_nsoc_topo=拓扑 +com_zte_nfv_vmanager_nsoc_vim_tenantmanager=VIM配置管理 +com_zte_nfv_vmanager_nsoc_catalog_pkg=版本包 +com_zte_nfv_vmanager_nsoc_catalog_template=VNF模板 +com_zte_nfv_vmanager_nsoc_catalog_neds=网元目录 +com_zte_nfv_vmanager_nsoc_catalog_nfvr=NFV实例目录 +com_zte_nfv_vmanager_nsoc_catalog_service_chain=Service Chain +com_zte_nfv_vmanager_nsoc_scalable_policy=弹性伸缩策略 + +######### vDirector ########## +vdirector-hd=硬件管理 +vdirector-hd-overview=概览 +vdirector-hd-pod=POD +vdirector-hd-rackAndChassis=机架/机框 +vdirector-hd-boards=刀片 +vdirector-hd-storages=磁盘阵列 +vdirector-hd-switches=交换机 +vdirector-hd-racks=机架 +vdirector-hd-chassis=机框 + +vdirector-cloud=云管理 +vdirector-clouddeploy=云部署 +vdirector-cloudMonitor=云环境 +vdirector-clouddeploy-summary=云部署概览 +vdirector-clouddeploy-Servers=云部署服务器 +vdirector-cloudMonitor-summary=云环境概览 +vdirector-tenant-mgr=租户管理 +vdirector-res=资源配置 + +vdirector-template=模板管理 +vdirector-image=镜像 +vdirector-app=应用软件 +vdirector-app-overview=应用概览 +vdirector-vnfm=vnfm +vdirector-addapp=创建应用 + +######### menus more opencos/openstack ########## +col-nfvroc-vim-sys-dashboard=系统面板 +nfvroc-vim-sys-dashboard-more=更多操作 + +nfvroc-vim-sys-dashboard-overview-i18n=概况 +nfvroc-vim-sys-dashboard-resource-i18n=资源使用情况 +nfvroc-vim-sys-dashboard-vm-i18n=虚拟机管理器 +nfvroc-vim-sys-dashboard-hosts-i18n=主机集合 +nfvroc-vim-sys-dashboard-instance-i18n=实例 +nfvroc-vim-sys-dashboard-cloud-harddisk-i18n=云硬盘 +nfvroc-vim-sys-dashboard-cloud-host-type-i18n=云主机类型 +nfvroc-vim-sys-dashboard-mirror-i18n=镜像 +nfvroc-vim-sys-dashboard-networks-i18n=网络 +nfvroc-vim-sys-dashboard-routers-i18n=路由 +nfvroc-vim-sys-dashboard-sys-info-i18n=系统信息 + + + + + + diff --git a/openo-portal/portal-common/src/main/webapp/common/i18n/openo-umc-i18n-en-US.properties b/openo-portal/portal-common/src/main/webapp/common/i18n/openo-umc-i18n-en-US.properties new file mode 100644 index 00000000..63023eee --- /dev/null +++ b/openo-portal/portal-common/src/main/webapp/common/i18n/openo-umc-i18n-en-US.properties @@ -0,0 +1,27 @@ +# +# Copyright (C) 2015 ZTE, Inc. and others. All rights reserved. (ZTE) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +org_openo_orchestrator_umc_monitor=Monitor +org_openo_orchestrator_umc_monitor_setting=Setting +org_openo_orchestrator_umc_monitor_para_setting=Monitor Para Setting +org_openo_orchestrator_umc_topo=Topology +org_openo_orchestrator_umc_physical_topo=Physical Topology +org_openo_orchestrator_umc_service_topo=Service Topology +org_openo_orchestrator_umc_fm=Alarm +org_openo_orchestrator_umc_fm_currentAlarm=Alarm Query +org_openo_orchestrator_umc_pm=Performance +org_openo_orchestrator_umc_pm_performance_query=Performance Query +org_openo_orchestrator_umc_monitor_service=Service List +org_openo_orchestrator_umc_monitor_service_overview=Overview diff --git a/openo-portal/portal-common/src/main/webapp/common/i18n/openo-umc-i18n-zh-CN.properties b/openo-portal/portal-common/src/main/webapp/common/i18n/openo-umc-i18n-zh-CN.properties new file mode 100644 index 00000000..2fa26b27 --- /dev/null +++ b/openo-portal/portal-common/src/main/webapp/common/i18n/openo-umc-i18n-zh-CN.properties @@ -0,0 +1,27 @@ +# +# Copyright (C) 2015 ZTE, Inc. and others. All rights reserved. (ZTE) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +org_openo_orchestrator_umc_monitor=监控 +org_openo_orchestrator_umc_monitor_access=设置 +org_openo_orchestrator_umc_monitor_access_itmp=监控参数设置 +org_openo_orchestrator_umc_topo=拓扑 +org_openo_orchestrator_umc_physical_topo=物理拓扑 +org_openo_orchestrator_umc_service_topo=业务拓扑 +org_openo_orchestrator_umc_monitor_alarm=告警 +org_openo_orchestrator_umc_monitor_alarm_currentAlarm=当前告警 +org_openo_orchestrator_umc_monitor_perform=性能 +org_openo_orchestrator_umc_monitor_perform_historySearch=历史查询 +org_openo_orchestrator_umc_monitor_service=业务监控 +org_openo_orchestrator_umc_monitor_service_overview=业务概览 \ No newline at end of file diff --git a/openo-portal/portal-common/src/main/webapp/common/i18n/web-portal-login-i18n-en-US.properties b/openo-portal/portal-common/src/main/webapp/common/i18n/web-portal-login-i18n-en-US.properties deleted file mode 100644 index 00a32fbe..00000000 --- a/openo-portal/portal-common/src/main/webapp/common/i18n/web-portal-login-i18n-en-US.properties +++ /dev/null @@ -1,49 +0,0 @@ -# -# Copyright 2016, CMCC Technologies Co., Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -com_zte_ums_ict_portal_login_welcome=Welcome -com_zte_ums_ict_portal_login_userPassword=User Name or Password Error -inputUserName=Please Input User Name -inputPassword=Please Input Password -com_zte_ums_ict_portal_login_rememberMe=Remember Me -com_zte_ums_ict_portal_login_companyName=2014 @; ZTE - Corporation -com_zte_ums_ict_login_inputname=Please Input User Name -com_zte_ums_ict_login_inputpwd=Please Input Password -com_zte_ums_aos_portal_login_username=Username: -com_zte_ums_aos_portal_login_password=Password: -com_zte_ums_aos_portal_login_validateCode=Validate Code:  -com_zte_ums_aos_portal_login_login=Login -com_zte_ums_aos_portal_login_reset=Reset -com_zte_ums_aos_portal_login_notice=To make your experience more smoothly and better, please download the lastest browser(Windows 32bit): -com_zte_ums_aos_portal_login_group_localdownload=Local download -com_zte_ums_aos_portal_login_group_officialdownload=Official download -com_zte_ums_aos_portal_ui_changePwd=Change Password -com_zte_ums_aos_sm_user_op_ok=Operation succeeded. -com_zte_ums_aos_sm_user_close_button=Close -com_zte_ums_aos_sm_user_confirm=Confirm -com_zte_ums_aos_login_warning_title = Warning -com_zte_ums_aos_sm_user_modify_current_password_label=      User Password Set -com_zte_ums_aos_sm_user_modify_current_password=User Password Set -com_zte_ums_aos_sm_user_old_password=Old Password -com_zte_ums_aos_sm_user_confirmpassword=Confirm Password -com_zte_ums_aos_sm_user_cancel_button=Cancel -com_zte_ums_aos_sm_user_password=New Password -com_zte_ums_aos_sm_password_confirm_not_consistent = password and confirm password is not the same. -com_zte_ums_aos_portal_login_group_download = Download -com_zte_ums_aos_portal_login_notice_about_chromeFrame=Please download and install the following browser.Otherwise, some functions may become exceptional. -com_zte_ums_aos_portal_login_recommend_notice=Recommend the use of IE8, IE9, IE10, Chrome27, Firefox20.1 browser, recommend the display resolution: 1280 * 800. -com_zte_ums_ict_portal_login_serv_error=Login Error -com_zte_ums_ict_portal_login_title=NFV Mano System \ No newline at end of file diff --git a/openo-portal/portal-common/src/main/webapp/common/i18n/web-portal-login-i18n-zh-CN.properties b/openo-portal/portal-common/src/main/webapp/common/i18n/web-portal-login-i18n-zh-CN.properties deleted file mode 100644 index 18164a5e..00000000 --- a/openo-portal/portal-common/src/main/webapp/common/i18n/web-portal-login-i18n-zh-CN.properties +++ /dev/null @@ -1,49 +0,0 @@ -# -# Copyright 2016, CMCC Technologies Co., Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -com_zte_ums_ict_portal_login_welcome=欢迎登录 -com_zte_ums_ict_portal_login_userPassword=用户名和密码错误 -inputUserName=请输入用户名 -inputPassword=请输入密码 -com_zte_ums_ict_portal_login_rememberMe=记住我 -com_zte_ums_ict_portal_login_companyName=2014 © ZTE - 中兴通讯股份有限公司 -com_zte_ums_ict_login_inputname=请输入用户名 -com_zte_ums_ict_login_inputpwd=请输入密码 -com_zte_ums_aos_portal_login_username=用户名: -com_zte_ums_aos_portal_login_password=密 码: -com_zte_ums_aos_portal_login_validateCode=验证码: -com_zte_ums_aos_portal_login_login=登录 -com_zte_ums_aos_portal_login_reset=重置 -com_zte_ums_aos_portal_login_notice=为了有更好更流畅的操作体验,请更新到最新的浏览器,请下载(Windows 32位): -com_zte_ums_aos_portal_login_group_localdownload=本地下载 -com_zte_ums_aos_portal_login_group_officialdownload=官方下载 -com_zte_ums_aos_portal_ui_changePwd=修改密码 -com_zte_ums_aos_sm_user_op_ok=操作成功。 -com_zte_ums_aos_sm_user_close_button=关闭 -com_zte_ums_aos_sm_user_confirm=确定 -com_zte_ums_aos_login_warning_title = 警告 -com_zte_ums_aos_sm_user_modify_current_password_label=      当前用户密码设置 -com_zte_ums_aos_sm_user_modify_current_password=当前用户密码设置 -com_zte_ums_aos_sm_user_old_password=旧密码 -com_zte_ums_aos_sm_user_confirmpassword=确认密码 -com_zte_ums_aos_sm_user_cancel_button=取消 -com_zte_ums_aos_sm_user_password=新密码 -com_zte_ums_aos_sm_password_confirm_not_consistent = 密码输入不一致。 -com_zte_ums_aos_portal_login_group_download = 下载 -com_zte_ums_aos_portal_login_notice_about_chromeFrame=为了不影响系统的功能正常使用,请连网安装并使用下面的浏览器: -com_zte_ums_aos_portal_login_recommend_notice=推荐使用IE8及以上、Chrome27及以上、Firefox20.1及以上版本浏览器,推荐显示分辨率:1280×800。 -com_zte_ums_ict_portal_login_serv_error=登录异常 -com_zte_ums_ict_portal_login_title=虚拟化管理编排系统 diff --git a/openo-portal/portal-common/src/main/webapp/common/i18n/web-portal-login-integration-i18n-en-US.properties b/openo-portal/portal-common/src/main/webapp/common/i18n/web-portal-login-integration-i18n-en-US.properties index 8ecfed9f..d84c00d7 100644 --- a/openo-portal/portal-common/src/main/webapp/common/i18n/web-portal-login-integration-i18n-en-US.properties +++ b/openo-portal/portal-common/src/main/webapp/common/i18n/web-portal-login-integration-i18n-en-US.properties @@ -15,13 +15,12 @@ # -com_zte_ums_ict_portal_login_title=ICT Management System +com_zte_ums_ict_portal_login_title=OPEN-O System com_zte_ums_ict_portal_login_welcome=Welcome com_zte_ums_ict_portal_login_userPassword=User Name or Password Error inputUserName=Please Input User Name inputPassword=Please Input Password com_zte_ums_ict_portal_login_rememberMe=Remember Me -com_zte_ums_ict_portal_login_companyName=2014 @; ZTE - Corporation com_zte_ums_ict_login_inputname=Please Input User Name com_zte_ums_ict_login_inputpwd=Please Input Password com_zte_ums_aos_portal_login_username=Username: diff --git a/openo-portal/portal-common/src/main/webapp/common/i18n/web-portal-login-integration-i18n-zh-CN.properties b/openo-portal/portal-common/src/main/webapp/common/i18n/web-portal-login-integration-i18n-zh-CN.properties index c1d96f2d..3fc18d9f 100644 --- a/openo-portal/portal-common/src/main/webapp/common/i18n/web-portal-login-integration-i18n-zh-CN.properties +++ b/openo-portal/portal-common/src/main/webapp/common/i18n/web-portal-login-integration-i18n-zh-CN.properties @@ -21,7 +21,6 @@ com_zte_ums_ict_portal_login_userPassword=用户名和密码错误 inputUserName=请输入用户名 inputPassword=请输入密码 com_zte_ums_ict_portal_login_rememberMe=记住我 -com_zte_ums_ict_portal_login_companyName=2014 © ZTE - 中兴通讯股份有限公司 com_zte_ums_ict_login_inputname=请输入用户名 com_zte_ums_ict_login_inputpwd=请输入密码 com_zte_ums_aos_portal_login_username=用户名: diff --git a/openo-portal/portal-common/src/main/webapp/common/image/integration/logo.png b/openo-portal/portal-common/src/main/webapp/common/image/integration/logo.png deleted file mode 100644 index 9277eb11..00000000 Binary files a/openo-portal/portal-common/src/main/webapp/common/image/integration/logo.png and /dev/null differ diff --git a/openo-portal/portal-common/src/main/webapp/common/image/integration/openo_bg_1.jpg b/openo-portal/portal-common/src/main/webapp/common/image/integration/openo_bg_1.jpg new file mode 100644 index 00000000..4a7b0722 Binary files /dev/null and b/openo-portal/portal-common/src/main/webapp/common/image/integration/openo_bg_1.jpg differ diff --git a/openo-portal/portal-common/src/main/webapp/common/image/integration/openo_bg_2.jpg b/openo-portal/portal-common/src/main/webapp/common/image/integration/openo_bg_2.jpg new file mode 100644 index 00000000..db94b166 Binary files /dev/null and b/openo-portal/portal-common/src/main/webapp/common/image/integration/openo_bg_2.jpg differ diff --git a/openo-portal/portal-common/src/main/webapp/common/image/integration/openo_bg_3.jpg b/openo-portal/portal-common/src/main/webapp/common/image/integration/openo_bg_3.jpg new file mode 100644 index 00000000..f2949dfe Binary files /dev/null and b/openo-portal/portal-common/src/main/webapp/common/image/integration/openo_bg_3.jpg differ diff --git a/openo-portal/portal-common/src/main/webapp/common/image/integration/openo_logo_white.png b/openo-portal/portal-common/src/main/webapp/common/image/integration/openo_logo_white.png new file mode 100644 index 00000000..ef9aedb7 Binary files /dev/null and b/openo-portal/portal-common/src/main/webapp/common/image/integration/openo_logo_white.png differ diff --git a/openo-portal/portal-common/src/main/webapp/common/image/integration/zte_bg_1.jpg b/openo-portal/portal-common/src/main/webapp/common/image/integration/zte_bg_1.jpg deleted file mode 100644 index 4a7b0722..00000000 Binary files a/openo-portal/portal-common/src/main/webapp/common/image/integration/zte_bg_1.jpg and /dev/null differ diff --git a/openo-portal/portal-common/src/main/webapp/common/image/integration/zte_bg_2.jpg b/openo-portal/portal-common/src/main/webapp/common/image/integration/zte_bg_2.jpg deleted file mode 100644 index db94b166..00000000 Binary files a/openo-portal/portal-common/src/main/webapp/common/image/integration/zte_bg_2.jpg and /dev/null differ diff --git a/openo-portal/portal-common/src/main/webapp/common/image/integration/zte_bg_3.jpg b/openo-portal/portal-common/src/main/webapp/common/image/integration/zte_bg_3.jpg deleted file mode 100644 index f2949dfe..00000000 Binary files a/openo-portal/portal-common/src/main/webapp/common/image/integration/zte_bg_3.jpg and /dev/null differ diff --git a/openo-portal/portal-common/src/main/webapp/common/image/integration/zte_logo_16.gif b/openo-portal/portal-common/src/main/webapp/common/image/integration/zte_logo_16.gif deleted file mode 100644 index 2a2d258b..00000000 Binary files a/openo-portal/portal-common/src/main/webapp/common/image/integration/zte_logo_16.gif and /dev/null differ diff --git a/openo-portal/portal-common/src/main/webapp/common/image/integration/zte_logo_white.png b/openo-portal/portal-common/src/main/webapp/common/image/integration/zte_logo_white.png deleted file mode 100644 index ef9aedb7..00000000 Binary files a/openo-portal/portal-common/src/main/webapp/common/image/integration/zte_logo_white.png and /dev/null differ diff --git a/openo-portal/portal-common/src/main/webapp/common/image/integration/ztelogo.png b/openo-portal/portal-common/src/main/webapp/common/image/integration/ztelogo.png deleted file mode 100644 index ebe122a2..00000000 Binary files a/openo-portal/portal-common/src/main/webapp/common/image/integration/ztelogo.png and /dev/null differ diff --git a/openo-portal/portal-common/src/main/webapp/common/js/core/ZteFrameWork.js b/openo-portal/portal-common/src/main/webapp/common/js/core/ZteFrameWork.js deleted file mode 100644 index 9e2b10d8..00000000 --- a/openo-portal/portal-common/src/main/webapp/common/js/core/ZteFrameWork.js +++ /dev/null @@ -1,4008 +0,0 @@ -/* - * Copyright 2016, CMCC Technologies Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -String.prototype.trim = function() { - return this.replace(/(^\s*)|(\s*$)/g, ""); -}; -String.prototype.format=function() { - if(arguments.length==0) return this; - for(var s=this, i=0; i ul > li', panel).each(function () { - var color = $(this).attr("data-style"); - if (color == configColor) { - // 匹配上了才重设默认主题 - $(this).addClass("current"); - $('#style_color').attr("href", "css/themes/" + color + ".css"); - //if (store) { - store('style_color', color); - //} - } - }); -}; - -function setFrameWorkByConf(){ - //设置用户相关的框架下拉菜单是否可用 - var helpMenuItem = ZteFrameWork_conf.helpMenuItem; - var aboutMenuItem = ZteFrameWork_conf.aboutMenuItem; - var flightMenuItem = ZteFrameWork_conf.flightMenuItem; - var fullscreenMenuItem = ZteFrameWork_conf.fullscreenMenuItem; - var logoutMenuItem = ZteFrameWork_conf.logoutMenuItem; - var changePassMenuItem = ZteFrameWork_conf.changePassMenuItem; - if (!helpMenuItem || helpMenuItem === "false") { - $('#uep_ict_help_url').parent('li').remove(); - } - if(!aboutMenuItem|| aboutMenuItem === "false"){ - $('[data-target="#aboutDlg"]').parent('li').remove(); - } - if(!helpMenuItem && !aboutMenuItem){ - $('#uep_ict_help_div').remove(); - } - if (!flightMenuItem|| flightMenuItem === "false") { - $('#header_notification_bar').html("
      
"); - } - if (!fullscreenMenuItem|| fullscreenMenuItem === "false") { - //$('#trigger_fullscreen').parent().css("display", "none"); - $('#trigger_fullscreen_div').html(""); - } - if (!logoutMenuItem || logoutMenuItem === "false") { - //$('#trigger_logout').parent().css("display", "none"); - $('#trigger_logout_div').html(""); - } - if ((!fullscreenMenuItem && !logoutMenuItem) || (fullscreenMenuItem === "false" && logoutMenuItem === "false")) { - $('#full_logout_divider').css("display", "none"); - } - if (!changePassMenuItem ) { - $('#changePwd_labellink').css('display','none'); - $('#full_logout_divider').css('display','none'); - } - - //设置二次开发者选择的框架皮肤 - var defaultColor = ZteFrameWork_conf.defaultThemeColor; - var panel = $('.zte-theme-panel'); - $('ul > li', panel).removeClass("current"); - if (store && !store('style_color')) { // cookie没有才设置默认主题 - setThemeColor(defaultColor); - }else{ - setThemeColor(store('style_color')); - } -}; - -/*新增的hashtabel实现类,用户后续iframe的缓存,前进后退时打开过的页面的菜单id的缓存等*/ -function Hashtable() -{ - this._hash = {}; - this._count = 0; - this.add = function(key, value) - { - if (this._hash.hasOwnProperty(key)) - return false; - else { - this._hash[key] = value; this._count++; return true; - } - } ; - this.hash = function() { return this._hash; }; - this.remove = function(key) { delete this._hash[key]; this._count--; } ; - this.count = function() { return this._count; }; - this.items = function(key) { if (this.contains(key)) return this._hash[key]; }; - this.contains = function(key) { return this._hash.hasOwnProperty(key); }; - this.clear = function() { this._hash = {}; this._count = 0; }; - this.replace = function(key, value) - { //有则删除后增加///相当于更新 - if(this.contains(key)){ - this.remove(key); - } - return this.add(key, value); - } ; -}; - -var fMenuSiderDivId = 'page-f-sidebar-menu'; -var fMenuMegaDivId = 'f_hormenu'; -var megaSiderDivId = 'page-megachild-sidebar-menu'; -var megaDivId = 'main_hormenu'; -var zteframework_menu_horizontal = "horizontal"; -var zteframework_menu_vertical = "vertical"; -var zteframework_menu_fmenu = "fmenu"; -var zteframework_showNav = "true"; -var zteframework_smallView = 960;//原来为992,但是在投影仪上不准(投影仪设置为1024,但是实际尺寸比1024小),边栏菜单也会被移除,这个设置一个稍小的值。 - -/*下面是主框架的核心*/ -var ZteFrameWork = function () { - var defaultLanage=getLanguage(); - var isRTL = false;//文档顺序 - var isTouch=function(){ - try { - document.createEvent("TouchEvent"); - return true; - } catch (e) { - return false; - } - }; - var isDesktop = !isTouch; - var isIE8 = false; - var isIE9 = false; - var isIE10 = false; - var gdocTitle=""; - var _sidebarWidth = 225; - var _sidebarCollapsedWidth = 35; - var responsiveHandlers = []; - var cachedIframes=new Hashtable(); - var cachedIframesObject=new Hashtable(); - var breadcrumbBtnMenus=new Hashtable(); - var _menuCategorys=new Hashtable(); - var _iframe="page-mainIframe"; //全局变量保存的是当前正在打开使用的iframe - var _sceneURLRootPath=""; - var _hashSource="";//信号量 - var _isClicked=false;//信号量 - //var _breadcrumbSource=false; - - // 皮肤颜色 - var layoutColorCodes = { - 'blue': '#4b8df8', - 'red': '#e02222', - 'green': '#35aa47', - 'purple': '#852b99', - 'grey': '#555555', - 'light-grey': '#fafafa', - 'yellow': '#ffb848', - 'ztebluelight': '#3366cc' - }; - // 获取真实的设备窗口大小,参考了 http://andylangton.co.uk/articles/javascript/get-viewport-size-javascript/ - var _getViewPort = function () { - var e = window, a = 'inner'; - if (!('innerWidth' in window)) { - a = 'client'; - e = document.documentElement || document.body; - } - return { - width: e[a + 'Width'], - height: e[a + 'Height'] - } - } - // 初始化 - var dealInit = function () { - var sence = '0'; - var menuSence = getUrlParam("menu"); - var confSence = 0; - if (menuSence) { - sence = menuSence; - } else { - sence = confSence; - } - switch (sence) { - case "1": - gdocTitle = $('#com_zte_ums_ict_framework_ui_page_title_1').text().trim(); - break; - case "2": - gdocTitle = $('#com_zte_ums_ict_framework_ui_page_title_2').text().trim(); - break; - case "3": - gdocTitle = $('#com_zte_ums_ict_framework_ui_page_title_3').text().trim(); - break; - case "0": - default: - gdocTitle = $('#com_zte_ums_ict_framework_ui_page_title').text().trim(); - break; - } - if ($('body').css('direction') === 'rtl') { - isRTL = true; - } - isIE8 = !! navigator.userAgent.match(/MSIE 8.0/); - isIE9 = !! navigator.userAgent.match(/MSIE 9.0/); - isIE10 = !! navigator.userAgent.match(/MSIE 10.0/); - if (isIE10) { - $('html').addClass('ie10'); // IE10 - } - if (isIE10 || isIE9 || isIE8) { - $('html').addClass('ie'); // IE10 - } - var deviceAgent = navigator.userAgent.toLowerCase(); - if (deviceAgent.match(/(iphone|ipod|ipad)/)) { - $(document).on('focus', 'input, textarea', function () { - $('.page-header').hide(); - if($('.page-footer')&&$('.page-footer').length>0) - $('.page-footer').hide(); - }); - $(document).on('blur', 'input, textarea', function () { - $('.page-header').show(); - if($('.page-footer')&&$('.page-footer').length>0) - $('.page-footer').show(); - }); - } else { - $(document).on('focus', 'input, textarea', function () { - if($('.page-footer')&&$('.page-footer').length>0) - $('.page-footer').hide(); - }); - $(document).on('blur', 'input, textarea', function () { - if($('.page-footer')&&$('.page-footer').length>0) - $('.page-footer').show(); - }); - } - } - //处理滚动到 - var dealScrollTo=function (el, offeset) { - - } - var dealstartPageLoading=function(message) { - $('.page-loading').remove(); - $('body').append('
  ' + (message ? message : $.i18n.prop('com_zte_ums_ict_framework_ui_loading')) + '
'); - } - var dealstopPageLoading=function() { - $('.page-loading').remove(); - } - var dealSidebarState = function () { - // 窗体宽度小尺寸(平板和iphone模式下)时移出左边栏 - var viewport = _getViewPort(); - if (viewport.width < zteframework_smallView) { - $('body').removeClass("page-sidebar-closed"); - }else{ - if (getCookie('sidebar_closed') === '1') { - $('body').addClass('page-sidebar-closed'); - } - } - } - // ZteFrameWork.addResponsiveHandler()回调函数. - var runResponsiveHandlers = function () { - //重新初始化其他订阅的元素elements - for (var i = 0; i < responsiveHandlers.length; i++) { - var each = responsiveHandlers[i]; - each.call(); - } - } - // 窗体重新调整大小时初始化调整边栏状态高度 - var dealResponsive = function () { - dealSidebarState(); - ajustHorMenuDropDirection(); - dealSidebarAndContentHeight(); - dealFixedSidebar(); - runResponsiveHandlers(); - } - // 页面重载入时初始化调整内部布局 - var dealResponsiveOnInit = function () { - dealSidebarState(); - dealSidebarAndContentHeight(); - setTimeout(function () { - ajustHorMenuDropDirection(true); - }, 100); - } - // 窗体重新调整大小时初始化调整布局 - var dealResponsiveOnResize = function () { - var resize; - if (isIE8) { - var currheight; - $(window).resize(function () { - if (currheight == document.documentElement.clientHeight) { - return; - } - if (resize) { - clearTimeout(resize); - } - resize = setTimeout(function () { - dealResponsive(); - }, 50); - currheight = document.documentElement.clientHeight; - }); - } else { - $(window).resize(function () { - if (resize) { - clearTimeout(resize); - } - resize = setTimeout(function () { - dealResponsive(); - }, 50); - }); - } - } - var changeSiderBar = function(hideAllMenu){ - var siderbarpos = $(".nav-pos-direction", $(".zte-theme-panel")).val(); - var sidermenu = $("#page-sidebar-menu"); - var hormenu = $("#main_hormenu"); - var fhorMenu = $("#" + fMenuMegaDivId); - var fsiderMenu = $("#" + fMenuSiderDivId); - if(hideAllMenu){ - sidermenu.css('display','block');// 侧边栏显示 - hormenu.css("display", "none");//隐藏水平菜单栏 - fhorMenu.css('display','none'); - fsiderMenu.css('display','none'); - return; - } - if (zteframework_menu_horizontal == siderbarpos) { - sidermenu.css('display','none');// 侧边栏隐藏 - fhorMenu.css('display','none');// 侧边栏隐藏 - fsiderMenu.css('display','none');// 侧边栏隐藏 - hormenu.css("display", "block");//显示水平菜单栏 - } else if (zteframework_menu_vertical == siderbarpos) { - sidermenu.css('display','block');// 侧边栏显示 - hormenu.css("display", "none");//隐藏水平菜单栏 - fhorMenu.css('display','none');// 侧边栏隐藏 - fsiderMenu.css('display','none');// 侧边栏隐藏 - } else if (zteframework_menu_fmenu == siderbarpos) { - sidermenu.css('display','none'); - hormenu.css("display", "none"); - fhorMenu.css('display','block'); - fsiderMenu.css('display','block'); - //除了toggle按钮之外,是否还有其他儿子是要显示的,如果没有,那么竖菜单不显示;反之,显示。 - var lis = fsiderMenu.children(".sidebar-toggler-wrapper").siblings(); - if(lis.length > 0 && lis.css('display') != "none"){ - fsiderMenu.css('display','block'); - // - $("body").removeClass("page-full-width"); - if ($('body').hasClass("page-sidebar-closed")) { - $(".page-content").css("marginLeft", _sidebarCollapsedWidth); - } else { - $(".page-content").css("marginLeft", _sidebarWidth); - } - } - } - } - //根据当前菜单在屏幕的位置,和一级菜单下二级菜单的排列,来决定菜单是向左展开还是向右展开 - var ajustHorMenuDropDirection = function( isInit ){ - //获取屏幕宽度 - var bodyWidth = document.body.clientWidth; - //循环,获取每个一级菜单在屏幕中的位置 - var levelOneAdropdowns = $('a.dropdown-toggle', '#main_hormenu' ); - //每一个文字span的图标、他父亲的margin\padding等占用的位置 - var marginCount = 5 * 2 + 17.5 + 2 * 2 + 30 + 15 * 2 + 3; - for( var i = 0 ; i < levelOneAdropdowns.length ; i++ ){ - var a = $(levelOneAdropdowns[i]); - var leftOffset = a.offset().left; - //获取二级菜单的数量 - var ul = a.parent().children('.dropdown-menu'); - var groupDivs = $('.zteDivWidth' , ul); - var widthOfDropDownMenu = 0; - for(var j = 0 ; j < groupDivs.length && groupDivs.length >0 ; j++ ){//循环获取每个分组的宽度 - var eachDiv = groupDivs[j]; - var maxLengthText = ""; - var maxLength = 0; - var spans = $('span' , eachDiv).each(function(){ - var innerText = this.innerText; - if( innerText.length > maxLength ){ - maxLength= innerText.length; - maxLengthText = innerText; - } - }); - widthOfDropDownMenu = widthOfDropDownMenu + getStringWidth(maxLengthText , 14) + marginCount; - } - //预估每个组占宽度150PX,多预计一点 - if( widthOfDropDownMenu + leftOffset > bodyWidth ){ - console.log("ajust class dropdown-menu-right ,id = "+ a.attr("id") ); - ul.addClass('dropdown-menu-right'); - //var right = bodyWidth - (leftOffset + a.width() + 15); - //ul.attr('style' ,'right:' + right ); - }else{ - ul.removeClass('dropdown-menu-right'); - //ul.removeAttr('style'); - } - } - } - // 屏幕大小发生变化或者移动设备旋转屏幕时处理响应式布局. - var dealSidebarAndContentHeight = function (isToggler) { - var content = $('.page-content'); - var contentbody = $('.page-content-body'); - var sidebar = $('.page-sidebar'); - var body = $('body'); - var height; - var viewport = _getViewPort(); - var scrAvaHeight=Math.min(window.screen.availHeight,viewport.height)-5; - var footer=$('.footer'); - var pgbread=$('.page-breadcrumb'); - var pageableDiv=$('#pageableDiv'); - console.log("pageableDiv height:"+pageableDiv.outerHeight(true)); - var pheader=$('.header'); - var childPagetype=!!cachedIframesObject.items(_iframe)?cachedIframesObject.items(_iframe).childpageType:""; - if(childPagetype==="isc")//smartclient的子页面固定高度为视口可用内容区高度 - { - $('.sidebar-option', panel).val("fixed"); - } - dealShownav(); - var available_height =scrAvaHeight - ((!footer||footer.length<=0)?0:footer.outerHeight(true)) - pheader.outerHeight(true); - var _pageableDivHeight=(!pageableDiv||pageableDiv.length<=0||pageableDiv.is(":visible")==false)?0:pageableDiv.outerHeight(true); - var h= scrAvaHeight-pheader.outerHeight(true)-((!footer||footer.length<=0||footer.is(":visible")==false)?0:footer.outerHeight(true))-pgbread.outerHeight(true)-_pageableDivHeight-(contentbody.outerHeight(true)-contentbody.height()); - var miframe=_iframe==""?"page-mainIframe": _iframe; - var pagemyIframe=$('.page-content .page-content-body .'+miframe); //.page-mainIframe - if(pagemyIframe&&pagemyIframe.length>0){ - //处理iframe,下面计算中间iframe的高度 - var deviceAgent = navigator.userAgent.toLowerCase(); - if (deviceAgent.match(/(iphone|ipod|ipad)/)) { //||viewport.height<=480 - var w=viewport.width-content.offset().left-(pagemyIframe.offset().left-content.offset().left)*2;//宽度=总宽度-左边栏宽度-内容区内边距。左右两个 - pagemyIframe.width(w); - } - //对桌面必须计算高度 - var tmp_style = sidebar.attr('style');// firefox下执行 sidebar.height()会改变style样式,这里缓存下执行前的style样式,执行完后重新赋给页面元素 - console.log("pym:parent iframe "+miframe+" sidebar.height:"+sidebar.height()+" h:"+h); - h=sidebar.height()>h?sidebar.height():h; - //IE下,把iframe的高度再减掉7,因为IE10及以下版本,计算的高度会比IE实际显示区域大,导致出现IE滚动条。 - /*h=h-ICTFRAME_CONST_IFRAME_HEIGHT_AJUST; - if(isIE){ - h=h-ICTFRAME_CONST_IFRAME_HEIGHT_AJUST_IE; - }*/ - sidebar.attr('style',tmp_style); - if (isDesktop) { - //pagemyIframe.attr("height",h); - if(cachedIframesObject.items(miframe).setMinHeight){ - var minHeight=Math.min(scrAvaHeight,h); - console.log("pym:parent iframe "+miframe+" window.screen.availHeight:"+scrAvaHeight+" viewport.height:"+viewport.height+" h:"+h+" minHeight:"+minHeight); - cachedIframesObject.items(miframe).setMinHeight(minHeight); - } - }else{ - //pagemyIframe.attr("height","100%");//去掉这里错误的设置,ipad上测试高度不正确 - var _h=h; - try{ - _h=pagemyIframe.contents().height(); - }catch(e){} - h=_h>h?_h:h; - if(cachedIframesObject.items(miframe).setMinHeight){ - var minHeight=Math.min(scrAvaHeight,h); - console.log("pym:parent iframe "+miframe+" window.screen.availHeight:"+scrAvaHeight+" viewport.height:"+viewport.height+" h:"+h+" minHeight:"+minHeight); - cachedIframesObject.items(miframe).setMinHeight(minHeight); - } - } - } - - if (body.hasClass("page-footer-fixed") === true && body.hasClass("page-sidebar-fixed") === true) { - if (content.height() < available_height) { - //content.attr('style', 'min-height:' + available_height + 'px !important'); - dealAddStyle(content,'min-height',available_height + 'px',true); - } - } else{ - if (body.hasClass("page-footer-fixed") === true && body.hasClass("page-sidebar-fixed") === false) { - if (content.height() < available_height) { - //content.attr('style', 'min-height:' + available_height + 'px !important'); - dealAddStyle(content,'min-height',available_height + 'px',true); - } - } else { - if (body.hasClass('page-sidebar-fixed')) { - height = _calculateFixedSidebarViewportHeight(); - } else { - // firefox下执行 sidebar.height()会改变style样式,这里缓存下执行前的style样式,执行完后重新赋给页面元素 - var tmp_style = sidebar.attr('style'); - // height = sidebar.height() + 20; - sidebar.attr('style',tmp_style); - var headerHeight = pheader.outerHeight(true); - var footerHeight = (!footer||footer.length<=0)?0:footer.outerHeight(true); - if ($(window).width() > 1024 && (height + headerHeight + footerHeight) < scrAvaHeight) { - height = scrAvaHeight - headerHeight - footerHeight; - } - } - if (height <= content.height()) {//这里为了避免内容区域很小的时候出现内容区域无法充满屏幕,把min-height修改为height - //content.attr('style', 'min-height:' + height + 'px !important'); - dealAddStyle(content,'min-height',height + 'px',true); - } - } - } - // 屏幕小尺寸时会隐藏边栏,这时菜单由小屏幕右上图标控制,当屏幕变化到大尺寸屏幕时, - // 需要按原菜单出现方式恢复菜单显示。 - var screenwidth = $(window).width(); - if(screenwidth >= zteframework_smallView){ - changeSiderBar(); - if($(".page-sidebar-menu li").css('display') != "none"){ - if ($('body').hasClass("page-sidebar-closed") && $(".sidebar-toggler").hasClass("close-by-viewportChange")) { - if( !isToggler ){ - $(".sidebar-toggler")[1].click(); - } - $(".sidebar-toggler").removeClass("close-by-viewportChange"); - } - } - } - else { - changeSiderBar(true); - } - } - var showIframe=function(iframe){ - var resize,pagemainIframe; - if (cachedIframes.count()>0) { - for (var i in cachedIframes.hash()) { - cachedIframes.replace(i,0); - var pagemyIframe=$('.page-content .page-content-body .'+i); - if(pagemyIframe&&pagemyIframe.length>0){ - if(iframe==i){ - pagemyIframe.show(); - cachedIframes.replace(i,1); - } else{ - if("page-mainIframe"===i){//2015年12月10日 wimax要求页面切换后删除没有配置cacheNum的缓存页面 - pagemainIframe=i; - pagemyIframe.attr("src",""); - pagemyIframe.remove(); - }else{ - pagemyIframe.hide(); - } - cachedIframes.replace(i,0); - } - } - } - } - if(pagemainIframe){ - delete cachedIframes._hash[pagemainIframe]; - delete cachedIframesObject._hash[pagemainIframe]; - } - if (!cachedIframes.contains(iframe)) { - cachedIframes.add(iframe,1); - //增加的iframe加载完毕后 停止加载中提示信息 - myIframe=$('.'+iframe); - myIframe.show(); - myIframe.load(function(){ - /*if (!isDesktop) { - if (resize) { - clearInterval(resize); - } - resize = setInterval(dealIframeHeight, 400,$(this)); - }*/ - ZteFrameWork.stopPageLoading(); - }); - } - } - var hidemenu=function(){ - $('.hor-menu').hide(); - dealAddStyle($('.page-content'),'margin-left','0px',true); - dealAddStyle($('.page-sidebar'),'display','none',true); - var fsiderMenu = $("#" + fMenuSiderDivId); - fsiderMenu.children().css('display' , 'none'); - } - var hideAlarmLight=function(){ - //$('#header_notification_bar').hide(); - //$('#header_notification_bar').empty(); - $('#header_notification_bar').html("
      
"); - } - var dealShownav=function(){ - var showNav=ZteFrameWork.getLocationURLParameter('showNav'); - if( showNav=="false"){ - zteframework_showNav = showNav; - hidemenu(); - hideAlarmLight(); - } - } - /* 点击菜单时,处理对应该菜单项的横,左菜单项 */ - var dealRelateMenu = function(source) { - // 点击子菜单时,对应的横竖菜单项也联动为选择样式,(高亮,箭头变化) - var panel = $('.zte-theme-panel'); - var navPosOption = $('.nav-pos-direction', panel).val(); - var targetsource = null; - var targetContainer = null; - if (navPosOption === "vertical") { - // 当前是左菜单,则处理对应的横菜单 - targetsource = $("#"+source.attr("id"), $("#main_hormenu")); - targetContainer = $(".header ul"); - } else if (navPosOption === "horizontal") { - var rtn = dealMgaBarRelated(source); - dealFMenuRelated(source , megaSiderDivId); - targetContainer = rtn[0]; - targetsource = rtn[1]; - }else if(navPosOption === zteframework_menu_fmenu){ - dealFMenuRelated(source , fMenuSiderDivId); - } - if (targetContainer) { - // 移除原有菜单项的活动及箭头样式 - targetContainer.children('li.active').removeClass('active'); - targetContainer.find('.arrow.open').removeClass('open'); - } - if (targetsource) { - // 增加活动及箭头样式 - targetsource.parents('li').each(function () { - $(this).addClass('iframe active'); - $(this).find('a > span.arrow').addClass('open'); - }); - targetsource.parents('li').addClass('active'); - if (navPosOption === "horizontal") { - if (targetsource.parent().parent().parent().is("li")) { - $('.arrow', targetsource.parent().parent().parent()).addClass("open"); - } - } - } - } - var dealMgaBarRelated = function(source){ - // 当前是横菜单,则处理对应的左菜单 - targetsource = $("#"+source.attr("id"), $("[class='page-sidebar-menu']")); - targetContainer = $("#page-sidebar-menu ul"); - // 将先前左菜单展开的子菜单收缩 - $("li.open",targetContainer).each(function() { - var style = $("ul.sub-menu", this).attr("style"); - if (style) { - $("ul.sub-menu", this).removeAttr("style"); - $(this).removeClass('open'); - } - }); - // 当前是横菜单,但在屏幕缩小的情况下显示的是tip垂直菜单,而横菜单是隐藏的,所以需额外处理横菜单 - if (source.parent().parent().parent().parent().attr("class").indexOf("page-sidebar-menu") >= 0) { - var tiptargetsource = $("#"+source.attr("id"), $("#main_hormenu")); - var tiptargetContainer = $(".header ul"); - tiptargetContainer.children('li.active').removeClass('active'); - tiptargetContainer.find('.arrow.open').removeClass('open'); - tiptargetsource.parents('li').each(function () { - $(this).addClass('iframe active'); - $(this).find('a > span.arrow').addClass('open'); - }); - tiptargetsource.parents('li').addClass('active'); - } - return [targetContainer ,targetsource ]; - } - var dealFMenuRelated = function(source , siderDivId ){ - var fsiderMenu = $("#" + siderDivId); - if(isMoreMenuItemClick){//更多菜单点击 , 临时方案,增加信号量,使用之后就置为false - isMoreMenuItemClick = false - }else if($(source).parents('li').hasClass('mega-menu-dropdown')){//F的横向菜单的点击 - var id = source.attr('id'); - //非被点击的一级菜单的二级菜单都不显示 - $('#' + siderDivId + '>li').hide(); - var level2Lis = $("a[hparentid= " + id + "]" , fsiderMenu).parent(); - level2Lis.show(); - if(level2Lis.length > 0){//把竖向菜单的收起放大按钮显示出来 - $('#' + siderDivId + '>li.sidebar-toggler-wrapper').show(); - } - if($("a[hparentid= " + id + "]" , fsiderMenu).length > 0){ //有子孙菜单时,把F菜单的竖菜单显示出来 - dealFSidermenu(source ,siderDivId ); - }else{//否则隐藏竖菜单 - fsiderMenu.css('display','none'); - $("body").addClass("page-full-width"); - $(".page-content").css("marginLeft", _sidebarWidth); - } - - }else{//F菜单的竖向菜单点击 - //处理一种特殊情况,告警灯打开新页面,所有的菜单都不出现,因此,虽然这个source在竖菜单,但竖菜单这个时候实际上是没有显示的 - if( zteframework_showNav == "true") { - $('#' + siderDivId + '>li').hide(); - var lis = $(source).parents('li'); - var id = lis.eq(lis.length-1).children( 'a' ).attr('hparentid'); - //var id = $(source).parents('li').children('a').attr('hparentId'); - var level2Lis = $("a[hparentid=" + id + "]" , fsiderMenu).parent(); - level2Lis.show(); - if(level2Lis.length > 0) {//把竖向菜单的收起放大按钮显示出来 - $('#'+ siderDivId + '>li.sidebar-toggler-wrapper').show(); - } - //$('#' + siderDivId + '>li')[0].show(); - dealFSidermenu(source , siderDivId); - } - } - } - var dealFSidermenu = function(source , siderDivId){ - var fsiderMenu = $("#" + siderDivId); - fsiderMenu.css('display','block'); - $('ul.sub-menu',fsiderMenu).css('display','block'); - $('.arrow',fsiderMenu).addClass('open'); - $("body").removeClass("page-full-width"); - if ($('body').hasClass("page-sidebar-closed")) { - $(".page-content").css("marginLeft", _sidebarCollapsedWidth); - } else { - $(".page-content").css("marginLeft", _sidebarWidth); - } - var href = source.attr("href"); - $('li.iframe' ,fsiderMenu ).removeClass('active'); - var selectedIframeLi = $("a[href ='" + href + "']" ,fsiderMenu ).parent(); - selectedIframeLi.addClass('active'); - selectedIframeLi.parent().parent().addClass("open").addClass("active"); - selectedIframeLi.parent().css('display','block'); - selectedIframeLi.parent().parent().children('a').children('.arrow').addClass('open'); - } - var dealMenuItemClick=function(source,e,menuContainerStr){ - var url = source.attr("href"); - if(!url||url.length<2) - return; - e.preventDefault(); - if(!_isClicked){//导航情况下,首先要模拟点开菜单分组 - _isClicked=true;//如果菜单有子菜单点击一次来展开子菜单,注意这个信号量的变化,避免死循环 - var mainMenu=source.parents('li').last(); - if(!mainMenu.hasClass('open')){ - dealLiAClick(mainMenu.children('a:eq(0)')); - } - } - if(menuContainerStr&&menuContainerStr.length>0){ - var menuContainer = $('.'+menuContainerStr+' ul'); - - menuContainer.children('li.active').removeClass('active'); - // menuContainer.children('arrow.open').removeClass('open'); - //menuContainer.find('.arrow.open').addClass('open'); - } - source.parents('li').each(function () { - $(this).addClass('iframe active'); - $(this).children('a > span.arrow').addClass('open'); - }); - source.parents('li').addClass('active'); - // 处理点击菜单对应的横或左菜单项的选择样式 - dealRelateMenu(source); - if(menuContainerStr&&menuContainerStr.length>0){ - if ($(window).width() <= 991 && $('.'+menuContainerStr).hasClass("in")) { - $('.navbar-toggle').click(); - } - } - if(dealMultTabPage(source)) - return true; - dealScrollTo(); - var breadmenuID=e.data&&e.data.breadcrumbBtnMenuItem&&e.data.breadcrumbBtnMenuItem.length>0?e.data.breadcrumbBtnMenuItem:""; - if(breadmenuID.length>0){//面包削导航来的,只需要重新生成面包削即可 - //找到更多菜单按钮 - var moreMenuItem = $('#' + breadmenuID , $('#pageableDiv')); - if( moreMenuItem.length == 0 ){ - moreMenuItem = $('#' + breadmenuID , $('.more-botton-zone')); - } - dealBreadcrumbBtnMenuItemClick(moreMenuItem,e); - //dealBreadcrumb(source,false,e); - }else{//非面包削导航来的, - dealstartPageLoading(); - if(dealIframe(source,e))//当返回true时说明是正常加载iframe了,否则面包削不能切换 - dealBreadcrumb(source,false,e); - } - //dealShownav(); - }; - var dealMenuItemGetFocus=function(source,e,menuContainerStr){ - var url = source.attr("href"); - if(!url||url.length<2) - return; - e.preventDefault(); - if(!_isClicked){//导航情况下,首先要模拟点开菜单分组 - _isClicked=true;//如果菜单有子菜单点击一次来展开子菜单,注意这个信号量的变化,避免死循环 - var mainMenu=source.parents('li').last(); - dealLiAClick(mainMenu.children('a:eq(0)')); - } - if(menuContainerStr&&menuContainerStr.length>0){ - var menuContainer = $('.'+menuContainerStr+' ul'); - - menuContainer.children('li.active').removeClass('active'); - menuContainer.children('arrow.open').removeClass('open'); - } - source.parents('li').each(function () { - $(this).addClass('iframe active'); - $(this).children('a > span.arrow').addClass('open'); - }); - source.parents('li').addClass('active'); - - if(menuContainerStr&&menuContainerStr.length>0){ - if ($(window).width() <= 991 && $('.'+menuContainerStr).hasClass("in")) { - $('.navbar-toggle').click(); - } - } - }; - //处理iframe的核心处理类,逻辑较为复杂,注意各种参数的处理 - var dealIframe=function(aObject,e){ - _hashSource=""; - var url = aObject.attr("href"); - if(!url||url.length<2) - return; - url=ZteFrameWork.handlBaseURL(url); - //-----------2015年9月21日新增V5中大O需要的按照实例(根据选择的系统实例变化url的ip和端口地址)进行动态切换菜单的功能 - var category= aObject.attr("category");//处理菜单中定义的Category属性 - if(category&&category.length>0){//处理Category属性 - var newIpPort=_menuCategorys.items(category); - if(newIpPort&&newIpPort.ipPort&&newIpPort.ipPort.trim()!=""){//如果找到了 - var newIpPortstr=ZteFrameWork.getDomainURL(newIpPort.ipPort);//去掉ip和port后多余的部分 - var urlipport=ZteFrameWork.getDomainURL(url); - console.log("old url:"+url); - url=newIpPortstr+url.replace(urlipport,""); - console.log("newIpPort:"+newIpPortstr+" newURL:"+url); - } - } - //------------ - dealstartPageLoading(); - var cacheNum= aObject.attr("cacheNum");//当第三方应用需要框架缓存曾经打开过的页面时使用。 - var shiftJS= aObject.attr("shiftJS");//当第三方应用不需要后面的href页面进行重新加载仅仅执行某个脚本打开某个功能时使用 - var _iframeName= aObject.attr("iframeName");//对有些第三方应用设置了顶层frame名字的,这个必须设置 - var _iframeAutoScroll= aObject.attr("iframeAutoScroll");//设置iframe的滚动条是否出现,可以设置为auto,yes或者no,默认为no 不出现. - _iframeAutoScroll=!!_iframeAutoScroll?(_iframeAutoScroll==='yes'?'yes':_iframeAutoScroll==='auto'?'auto':'no'):'no'; - _xdomain= aObject.attr("xdomain");//对有些第三方应用如果跨域了,需要设置这个信任域属性,以便于来跨域通讯.这里取值是一个正则表达式 - _xdomain=_xdomain&&_xdomain.length>0?_xdomain:"*"; - var _cssfile= aObject.attr("cssSrc");//设置iframe中页面需要动态加载的css文件. - _cssfile=(_cssfile&&_cssfile.length>0)?_cssfile:""; - var _runShiftJS=""; - var pageContentBody=$('.page-content .page-content-body'); - var tabHtml=""; - var tabContentHtml=""; - var tabID=""; - var tabContentID=""; - var iframename=''; - function createIframe(pdiv,url,id,name,clsname,xdom,autoScroll){ - var pymParent = new pym.Parent(pdiv, url, {xdomain:xdom}); - pymParent.iframe.id=id; - pymParent.iframe.name=name; - //pymParent.iframe.setAttribute('display', "none"); - //pymParent.iframe.style.height="100%"; - //pymParent.iframe.setAttribute('height', "100%"); - pymParent.iframe.setAttribute('class', clsname); - pymParent.iframe.setAttribute('allowfullscreen',''); - pymParent.iframe.setAttribute('mozallowfullscreen',''); - pymParent.iframe.setAttribute('oallowfullscreen',''); - pymParent.iframe.setAttribute('msallowfullscreen',''); - pymParent.iframe.setAttribute('webkitallowfullscreen',''); - //pymParent.iframe.setAttribute('scrolling',autoScroll); - pymParent.iframe.setAttribute('onload', 'ZteFrameWork.SyncCSS(this,0,"'+_cssfile+'");ZteFrameWork.stopPageLoading();'); - cachedIframesObject.replace(id,pymParent);//缓存iframe对象实体 - pymParent.onMessage('height', function(he){ - console.log("The frame "+id+" receive message height is "+he); - var pagemyIframe=$('.page-content .page-content-body .'+id); - var h=Math.max(this.minHeight,he); - pagemyIframe.height(h); - }); - return pymParent; - }; - - if(cacheNum){//处理缓存iframe和iframename标签 - cacheNum="page-mainIframe"+cacheNum; - iframename="fraMain"+cacheNum; - }else{ - cacheNum="page-mainIframe"; - iframename="fraMain"; - } - iframename=!!_iframeName?_iframeName:iframename; - _iframe= cacheNum;//注意这里_iframe是一个全局变量 - - var miframe=_iframe==""?"page-mainIframe": _iframe; - var pagemyIframe=$('.page-content .page-content-body .'+miframe); - var nagivJS=e&&e.data&&e.data.action?e.data.action:""; - nagivJS=(!!nagivJS&&nagivJS.length>0)?(nagivJS.trim().toLowerCase()=="null"?nagivJS:"javascript:$('.page-content .page-content-body ."+miframe+"')[0].contentWindow."+nagivJS.trim()+";"):""; - nagivJS=nagivJS.trim(); - - _runShiftJS=(!!shiftJS&&shiftJS.length>0)?(shiftJS.trim().toLowerCase()=="null"?shiftJS:"javascript:$('.page-content .page-content-body ."+miframe+"')[0].contentWindow."+shiftJS+";"):""; - if(pagemyIframe&&pagemyIframe.length>0){//如果iframe已经添加了,则直接更改url或者执行切换或导航函数 - var src=pagemyIframe.attr("src"); - if((!!shiftJS||nagivJS.length>0)&&(src==url||src.split('?')[0]==url.split('?')[0])&& cacheNum!="page-mainIframe") { //url相同时,处理缓存shiftJS标签 - //这里shiftJS必须定义iframe中的页面定义到window上的函数; - //pagemyIframe.attr("scrolling",_iframeAutoScroll); - cachedIframesObject.items(miframe).settings.xdomain=_xdomain; - if(nagivJS.length>0&&nagivJS.toLowerCase()!="null") - _runShiftJS=nagivJS;//如果是nagivJS导航过来的,nagivJS优先级高于shiftJS,如果有nagivJS就用nagivJS替换_runShiftJS; 直接执行一次导航切换 - try{ - if(_runShiftJS.trim().toLowerCase()!="null") - eval(_runShiftJS); - }catch(e){ - if (e instanceof EvalError) { - console.log(e.name + " EvalError: " + e.message); - } else if (e instanceof SyntaxError) { - console.log(e.name + " SyntaxError: " + e.message); - }else if (e instanceof Error) { - if(e.name.toLowerCase().trim()=="typeerror") - { - //console.log($.i18n.prop('com_zte_ums_ict_framework_ui_clickTooFast')); - var parm={runShiftJS:_runShiftJS}; - pagemyIframe.one('load',parm,function(e){ - var runShiftJS=e&&e.data&&e.data.runShiftJS?e.data.runShiftJS:""; - if(runShiftJS.length>0&&runShiftJS.toLowerCase()!="null") - eval(runShiftJS);//点击太快了,页面没有加载完毕,那就加载完毕了再次执行 - }) - } - } - return false;//返回false 后续不再做其他动作了 - } - finally{ - ZteFrameWork.stopPageLoading(); - } - }else{//否则url不同,或者url相同但没有shiftjs - if(nagivJS.length>0&&nagivJS.toLowerCase()!="null"){//如果是代码导航过来的去掉url参数中的默认action动作 - url=url.split('?')[0];//去掉?参数,防止默认执行动作,只响应nagivJS指定的动作; - } - if(src.split('#')[0]!=url.split('#')[0])//如果相等说明是通过锚点导航的,真实url没有变化,对SPA应用比较普遍 - { - pagemyIframe.attr("src","");//url和src不同说明更换了页面,需要清空重新加载 - }else //if (src.trim()==url.trim()) //没有shiftjs并且url相同,说明不需要再次加载了,已经加载过了 - { - ZteFrameWork.stopPageLoading(); - } - pagemyIframe.attr("src",url); - - if(nagivJS.length>0&&nagivJS.toLowerCase()!="null"){//如果是nagivJS导航过来的,iframe加载完毕后执行一次导航切换脚本 - var parm={nagivJS:nagivJS}; - pagemyIframe.one('load',parm,function(e){ - var nagivJS=e&&e.data&&e.data.nagivJS?e.data.nagivJS:""; - if(nagivJS.length>0&&nagivJS.toLowerCase()!="null") - eval(nagivJS);//如果没有加载过,加载后也要执行跳转的函数 - }); - } - if(_cssfile.length>0&&_cssfile.toLowerCase()!="null"){//如果配置了cssSrc,每次切换都重新执行一边这个css文件,防止有遗漏 - parm={syncCSSJS:'ZteFrameWork.SyncCSS(this,10,"'+_cssfile+'");ZteFrameWork.stopPageLoading();'}; - pagemyIframe.one('load',parm,function(e){ - var syncCSSJS=e&&e.data&&e.data.syncCSSJS?e.data.syncCSSJS:""; - if(syncCSSJS.length>0&&syncCSSJS.toLowerCase()!="null") - eval(syncCSSJS); - }); - } - } - - }else{//否则添加新的iframe元素 overflow:visible; - if(nagivJS.length>0&&nagivJS.toLowerCase()!="null"){//如果是代码导航过来的去掉url参数中的默认action动作 - url=url.split('?')[0];//去掉?参数,防止默认执行动作,只响应nagivJS指定的动作; - } - var pdiv="pdiv_"+miframe; - if($("#"+pdiv).length<=0){//检查下,如果该div没有添加过就添加 - pageContentBody.append("
"); - } - dealstartPageLoading(); - pymParent=createIframe(pdiv, url,miframe,miframe,miframe,_xdomain,_iframeAutoScroll); - pagemyIframe=$(pymParent.iframe); - - if(nagivJS.length>0&&nagivJS.toLowerCase()!="null"){//如果是nagivJS导航过来的,iframe加载完毕后执行一次导航切换 - var parm={nagivJS:nagivJS}; - pagemyIframe=$('.page-content .page-content-body .'+miframe); - if(pagemyIframe&&pagemyIframe.length>0){ - pagemyIframe.one('load',parm,function(e){ - var nagivJS=e&&e.data&&e.data.nagivJS?e.data.nagivJS:""; - if(nagivJS.length>0&&nagivJS.toLowerCase()!="null") - eval(nagivJS);//如果没有加载过,加载后也要执行跳转的函数 - }) - } - } - - } - showIframe(miframe); - ZteFrameWork.fixContentHeight(); // 调整高度 - return true; - } - // 处理边栏菜单 - var dealLiAClick=function(source){ - if (source.next().hasClass('sub-menu') == false) { - if ($('.btn-navbar').hasClass('collapsed') == false) { - $('.btn-navbar').click(); - } - return; - } - - if (source.next().hasClass('sub-menu always-open')) { - return; - } - var parent = source.parent().parent(); - var the = source; - var menu = $('.page-sidebar-menu'); - var sub = source.next(); - var autoScroll = menu.data("auto-scroll") ? menu.data("auto-scroll") : true; - var slideSpeed = menu.data("slide-speed") ? parseInt(menu.data("slide-speed")) : 200; - parent.children('li.open').children('a').children('.arrow').removeClass('open'); - parent.children('li.open').children('.sub-menu:not(.always-open)').slideUp(200); - parent.children('li.open').removeClass('open'); - var slideOffeset = -200; - if (sub.is(":visible")) { - $('.arrow', source).removeClass("open"); - source.parent().removeClass("open"); - sub.slideUp(slideSpeed, function () { - if (autoScroll == true && $('body').hasClass('page-sidebar-closed') == false) { - if ($('body').hasClass('page-sidebar-fixed')) { - - } else { - dealScrollTo(the, slideOffeset); - } - } - dealSidebarAndContentHeight(); - }); - } else { - $('.arrow', source).addClass("open"); - source.parent().addClass("open"); - sub.slideDown(slideSpeed, function () { - if (autoScroll == true && $('body').hasClass('page-sidebar-closed') == false) { - if ($('body').hasClass('page-sidebar-fixed')) { - dealScrollTo(the, slideOffeset); - } - } - dealSidebarAndContentHeight(); - }); - } - } - var dealSidebarMenu = function () {//这里注册和处理边栏菜单的各类点击事件 - $('.page-sidebar').on('click', 'li > a', function (e) { - if ($(this).next().hasClass('sub-menu') == false) { - if ($('.btn-navbar').hasClass('collapsed') == false) { - $('.btn-navbar').click(); - } - return; - } - if ($(this).next().hasClass('sub-menu always-open')) { - return; - } - dealLiAClick($(this)); - e.preventDefault(); - }); - - // 处理左边导航中的菜单连接,显示在iframe中 - $('.page-sidebar').on('click', ' li > a.iframe', function (e) { - //dealMenuItemClick($(this),e,"page-sidebar") - e.preventDefault(); - var menuItemID=$(this).attr("id"); - if(!!menuItemID&&menuItemID.length>0){ - _setLocationHash(menuItemID); - _hashSource="dhByInterface"; - }//else{ - _isClicked=true; - dealMenuItemClick($(this),e,"page-sidebar"); - //} - }); - // 处理更多菜单的菜单连接,显示在iframe中dropdown-menu - $('.page-breadcrumb').on('click', ' li > a.iframe', function (e) { - var url = $(this).attr("href"); - if(url.length<2) - return; - e.preventDefault(); - dealBreadcrumbBtnMenuItemClick($(this),e); - }); - // 处理可翻页更多菜单中的菜单连接,显示在iframe中dropdown-menu - $('#pageableDiv').on('click', ' div > a.iframe', function (e) { - var url = $(this).attr("href"); - if(url.length<2) - return; - e.preventDefault(); - dealBreadcrumbBtnMenuItemClick($(this),e); - }); - // 处理可翻页更多菜单中的菜单连接,显示在iframe中dropdown-menu - $('#pageableDiv').on('click', ' li > a.iframe', function (e) { - var url = $(this).attr("href"); - if(url.length<2) - return; - e.preventDefault(); - if(e.target){ - var tg=$("span",e.target); - tg=tg.length>0?tg[0]:e.target; - $(".open a>div>span",e.target.parentNode.parentNode.parentNode.parentNode.parentNode).replaceWith(tg.outerHTML); - } - dealBreadcrumbBtnMenuItemClick($(this),e); - }); - - // 处理header下拉菜单中的菜单连接,显示在iframe中 - $('.dropdown').on('click', ' li > a.iframe', function (e) { - var url = $(this).attr("href"); - if(url.length<2) - return; - e.preventDefault(); - dealScrollTo(); - dealstartPageLoading(); - - dealIframe($(this),e) - dealBreadcrumb($(this),false,e); - }); - } - var getSceneURL=function(url){ - if(url&&url.trim().length>0){ - url=url.trim(); - //url= - _sceneURLRootPath=_sceneURLRootPath+url; - } - } - var gurl="";//临时全局变量,存储当前加载的more菜单,如果加载过了,就不再加载了。下面的方法中会用到 - var moreMenusisLoaded=true; - var waittime=null; - var getBreadcrumbRightButtons=function(url,e){ - if (url.length<2){ - return; - } - url=ZteFrameWork.handlBaseURL(url); - if (gurl==url){ - if(e===true){ - $('#pageableDiv').show(); - }else if(e&&e.target&&e.currentTarget){ - var defaultDisplay=$(e.target).attr("defaultDisplay"); - defaultDisplay=(!defaultDisplay)?$(e.currentTarget).attr("defaultDisplay"):defaultDisplay; - if(defaultDisplay&&defaultDisplay.trim()=="false"){ - $('#pageableDiv').hide(); - }else{ - $('#pageableDiv').show(); - } - } - return; - - }else{ - gurl=url; - clearMoreOperations(); - } - //处理e参数,注意e可能为null - var breadmenuID=e&&e.data&&e.data.breadcrumbBtnMenuItem&&e.data.breadcrumbBtnMenuItem.length>0?e.data.breadcrumbBtnMenuItem:""; - breadmenuID=breadmenuID.length<=0?(e&&e.breadcrumbBtnMenuItem&&e.breadcrumbBtnMenuItem.length>0?e.breadcrumbBtnMenuItem:""):breadmenuID; - moreMenusisLoaded=false; - $.ajax({ - type: "GET", - cache: false, - url: url, - dataType: "html", - success: function (res) { - try{ - //$('.page-breadcrumb').append(res); - var resScriptsSriped = stripHtmlScripts(res); - //$('.page-breadcrumb').append(resScriptsSriped); - $('.more-botton-zone').children().remove(); - //V5新增逻辑,如果displayType = pageableDiv,那么就用滑动的DIV来显示更多菜单里面的内容,如果没有配置,或为其他值,就按原有方式显示 - var tempDiv = $('
'); - tempDiv.children().remove(); - tempDiv.append(resScriptsSriped); - - //获取UL属性 - var displayType = $('.dropdown-menu',tempDiv).attr('displayType'); - if( displayType && displayType != 'pageableDiv'){ - $('.more-botton-zone').append(resScriptsSriped); - $('#pageableDiv').hide(); - }else{ - var tempUl = $('.dropdown-menu',tempDiv); - if(tempUl.length>0){ - moreOperations(tempUl[0]); - if(e&&e.target&&e.currentTarget){ - var defaultDisplay=$(e.target).attr("defaultDisplay"); - defaultDisplay=(!defaultDisplay)?$(e.currentTarget).attr("defaultDisplay"):defaultDisplay; - if(defaultDisplay&&defaultDisplay.trim()=="false"){ - $('#pageableDiv').hide(); - }else{ - $('#pageableDiv').show(); - } - } - } - } - runHtmlScripts(res); - }catch(ex){ - }finally{ - moreMenusisLoaded=true; - } - groupButtonAuthentication(); - if(breadmenuID.length>0){//面包削导航来的,只需要重新生成面包削即可 - var menuitem=undefined; - var panel = $('.zte-theme-panel'); - var navPosOption = $('.nav-pos-direction', panel).val(); - //var items=$("a[id='"+breadmenuID+"']"); - var items = undefined; - if (navPosOption === "vertical"){ //从垂直菜单里面找 - items=$("#page-sidebar-menu a[id='"+breadmenuID+"']"); - - }else{//从水平菜单里面找 - items=$(".hor-menu a[id='"+breadmenuID+"']"); - } - if (!items || items.length < 1) { - items=$(".page-content a[id='"+breadmenuID+"']"); - } - if(items.length>0){ - for(var i=0;i0) - dealBreadcrumbBtnMenuItemClick(menuitem,e); - } - }, - error: function (xhr, ajaxOptions, thrownError) {//加载操作菜单失败!com_zte_ums_ict_framework_ui_loadmenuerror - $('.page-breadcrumb').append('

'+$.i18n.prop('com_zte_ums_ict_framework_ui_loadmenuerror')+'

'); - moreMenusisLoaded=true; - } - }); - } - - //处理多tab也场景 ----redirect 该标签暂时保留,不建议使用了 - dealMultTabPage=function(clickedObject){ - var url = clickedObject.attr("href"); - if(!url||url.length<2) - return; - var redirect=clickedObject.attr("redirect"); //处理多tab页面的需求 - if (!!redirect&&redirect.length>0){ - var miframe=_iframe==""?"page-mainIframe": _iframe; - var pagemyIframe=$('.page-content .page-content-body .'+miframe); //.page-mainIframe - //var pagemyIframe=$('.page-content .page-content-body .page-mainIframe'); - var oldhref=""; - if(pagemyIframe&&pagemyIframe.length>0){ - oldhref=pagemyIframe.attr("src"); - if(url.split("?")[0]==oldhref.split("?")[0]) - { - eval(redirect); - dealBreadcrumb(clickedObject,false,e); - return true; - } - } - }; - return false; - }; - //处理主菜单面包削导航 - var globleCurrentBreadcrumb=""; - var globleCurrentMainMenuItemID=""; - var dhByBreadcrumb = false; - var dealBreadcrumb=function(clickedObject,notGenUID,e){//notGenUID为true就不重新生成id - var mbreadcrumb=$('.breadcrumbUl'); - ZteFrameWork.setPageTitle(clickedObject.find('span').text().trim()); - var clieckedObj= clickedObject.parent('li'); - if(clieckedObj.length == 0){ //分页式更多菜单,a链接的父亲是div - clieckedObj= clickedObject.parent('div'); - } - //如果点击的是F菜单的竖菜单,还需要找到横菜单上的对应父亲加入到clieckedObj - var navPosOption = $('.nav-pos-direction', panel).val(); - var parentid = clickedObject.attr('hparentid'); - var breadcrumGroupButtonSrc=clickedObject.attr("breadcrumGroupButtonSrc"); - globleCurrentMainMenuItemID=clickedObject.attr("id"); - var mhmtl=""; - var url=""; - var tempObj=null; - //var breadChangeType = e? (e.data ? e.data.breadChangeType:null):null; - if( dhByBreadcrumb ){ - mhmtl = dealClickBreadcrumb(clieckedObj); - dhByBreadcrumb = ""; - }else{ - while (clieckedObj&&clieckedObj.length>0){ - if(clieckedObj.children('a')){ - if(!notGenUID){ - url=ZteFrameWork.getUniqueID("aid");//+Math.floor(Math.random() * (new Date()).getTime()); - clieckedObj.children('a').attr("name",url); - }else{ - url=clieckedObj.children('a').attr("name"); - } - tempObj=clieckedObj.clone(); - tempObj.children('a').removeClass('iframe'); - tempObj.children('a').removeClass('active'); - tempObj.children('a').attr("href","javascript:ZteFrameWork.goToURL('"+url+"');"); - var arrowdown = $(".fa-angle-down", tempObj.children('a')); - if (arrowdown) { - arrowdown.remove(); - } - if(tempObj.children('a').length>0){ - mhmtl=tempObj.children('a')[0].outerHTML+""+mhmtl; - } - //如果是F菜单和横菜单的子竖菜单点击,需要做特殊处理 - if( clieckedObj.parent('ul').attr('id') == fMenuSiderDivId || clieckedObj.parent('ul').attr('id') == megaSiderDivId){ - var id = clieckedObj.children( 'a' ).attr('hparentid'); - //判断是F菜单还是横菜单 - var megaMenu = null; - if(navPosOption == zteframework_menu_horizontal){ - magaMenu = $('#'+megaDivId); - }else if(navPosOption == zteframework_menu_fmenu){ - magaMenu = $('#'+fMenuMegaDivId); - } - clieckedObj = $("a[id=" + id + "]" , magaMenu).parent('li'); - }else{ - clieckedObj=clieckedObj.parents('li'); - } - } - } - if(clieckedObj[0]&&clieckedObj[0].length>0) { - mhmtl=clieckedObj.children('a')[0].outerHTML+""+mhmtl; - } - } - mbreadcrumb.empty(); - $('.more-botton-zone').empty(); - globleCurrentBreadcrumb=mhmtl; - store("globleCurrentBreadcrumb",globleCurrentBreadcrumb); - mbreadcrumb.append(mhmtl); - if(breadcrumGroupButtonSrc&&breadcrumGroupButtonSrc.length>0){ - getBreadcrumbRightButtons(breadcrumGroupButtonSrc,e); - }else{ - $('#pageableDiv').hide(); - } - - }; - //面包屑发起的点击,就不重新生成面包屑,只是把该面包屑的后续节点移出。 - var dealClickBreadcrumb = function(clieckedObj){ - var index = globleCurrentBreadcrumb.indexOf(clieckedObj.children('a').attr("name")); - if( index > -1 ){//截取 - var indexofSign = globleCurrentBreadcrumb.indexOf("",index); - var newBreadcrumb = globleCurrentBreadcrumb.substring(0,indexofSign) + ""; - return newBreadcrumb; - } - } - //处理面包削中菜单点击后的导航(更多菜单的面包屑) - var dealBreadcrumbBtnGroupMenus=function(clickedObject,notGenUID , e ){ - var mbreadcrumb=$('.breadcrumbUl'); - var clieckedObj= clickedObject.parent(); - var breadcrumGroupButtonSrc=clickedObject.attr("breadcrumGroupButtonSrc"); - var mhmtl=""; - var url=""; - var tempObj=null; - var menuid=clickedObject.attr("id"); - if (!breadcrumbBtnMenus.contains(menuid)) {//把当前面包削中的菜单id和该子菜单对应的父菜单关联缓存起来 - breadcrumbBtnMenus.add(menuid,globleCurrentMainMenuItemID); - } - while (clieckedObj&&clieckedObj.length>0){ - tempObj=clieckedObj.clone(); - if(tempObj.children('a')){ - tempObj.children('a').removeClass('iframe'); - url=tempObj.children('a').attr("href"); - tempObj.children('a').attr("onclick","ZteFrameWork.openbreadcrumbLink($(this),event);"); - var tempdiv = tempObj.children('a').children('div'); - if( tempdiv.length > 0 ){ - var innerofDiv = tempdiv[0].innerHTML; - tempdiv.remove(); - tempObj.children('a')[0].innerHTML = innerofDiv; - } - if(tempObj.children('a').length>0){ - mhmtl=tempObj.children('a')[0].outerHTML+""+mhmtl; - } - clieckedObj=clieckedObj.parents('li'); - } - - } - if(clieckedObj[0]&&clieckedObj[0].length>0) { - mhmtl=clieckedObj.children('a')[0].outerHTML+""+mhmtl; - } - - if(breadcrumGroupButtonSrc&&breadcrumGroupButtonSrc.length>0){ - getBreadcrumbRightButtons(breadcrumGroupButtonSrc,true); - }else{ - $('#pageableDiv').hide(); - } - mbreadcrumb.empty(); - var category= clickedObject.attr("category");//处理菜单中定义的Category属性 - if(category&&category.length>0){//处理Category属性 - var newIpPort=_menuCategorys.items(category); - if(newIpPort&&newIpPort.ipTitle&&newIpPort.ipTitle.trim()!=""){//如果找到了 - mhmtl=newIpPort.ipTitle+''+mhmtl; - } - } - mhmtl=globleCurrentBreadcrumb+mhmtl; - mbreadcrumb.append(mhmtl); - }; - var isMoreMenuItemClick = false; - var dealBreadcrumbBtnMenuItemClick=function(clickObj,e){ - dealScrollTo(); - var menuItemID=clickObj.attr("id"); - if(!!menuItemID&&menuItemID.length>0){ - _setLocationHash(menuItemID); - var breadmenuID=e&&e.data&&e.data.breadcrumbBtnMenuItem&&e.data.breadcrumbBtnMenuItem.length>0?e.data.breadcrumbBtnMenuItem:""; - _hashSource=breadmenuID&&breadmenuID.length>0?"":"dhByInterface";//hash进来的,不是导航进来的。 - } - if(!(e&&e.breadcrumbBtnMenuItem&&e.breadcrumbBtnMenuItem.length>0)){//如果仅仅是tab跳转设置bread进来的,就框架不处理菜单点击,直接重新建立bread即可 - dealstartPageLoading(); - dealIframe(clickObj,e); - } - dealBreadcrumbBtnGroupMenus(clickObj,false,e); - } - // 固定边栏布局时计算边栏高度. - var _calculateFixedSidebarViewportHeight = function () { - var viewport = _getViewPort(); - var sidebarHeight =viewport.height - $('.header').height() + 1; - if ($('body').hasClass("page-footer-fixed")) { - sidebarHeight = sidebarHeight - (!$('.footer')||$('.footer').length<=0)?0:$('.footer').outerHeight(); - } - return sidebarHeight; - } - // 处理固定边栏 - var dealFixedSidebar = function () { - var menu = $('.page-sidebar-menu'); - if (menu.parent('.slimScrollDiv').size() === 1) { - menu.removeAttr('style'); - $('.page-sidebar').removeAttr('style'); - } - - if ($('.page-sidebar-fixed').size() === 0) { - dealSidebarAndContentHeight(); - return; - } - - var viewport = _getViewPort(); - if (viewport.width >= zteframework_smallView) { - var sidebarHeight = _calculateFixedSidebarViewportHeight(); - dealSidebarAndContentHeight(); - } - } - // 固定边栏时处理菜单 hover 效果. - var dealFixedSidebarHoverable = function () { - if ($('body').hasClass('page-sidebar-fixed') === false) { - return; - } - $('.page-sidebar').off('mouseenter').on('mouseenter', function () { - dealSiderBarMouseenter(); - }); - $('.page-sidebar').off('mouseleave').on('mouseleave', function () { - dealSiderBarMouseLeave(); - }); - } - var dealSiderBarMouseenter=function(){ - var body = $('body'); - var siderbar=$('.page-sidebar'); - if ((body.hasClass('page-sidebar-closed') === false || body.hasClass('page-sidebar-fixed') === false) || $(this).hasClass('page-sidebar-hovering')) { - return; - } - body.removeClass('page-sidebar-closed').addClass('page-sidebar-hover-on'); - var siderbartoggle=$('.sidebar-toggler'); - - if (body.hasClass("page-sidebar-reversed")) { - siderbar.width(_sidebarWidth); - dealSiderBarWidthChange(); - } else { - siderbar.addClass('page-sidebar-hovering'); - siderbar.animate({ - width: _sidebarWidth - }, 350, '', function () { - siderbar.removeClass('page-sidebar-hovering'); - dealSiderBarWidthChange(); - }); - } - } - var dealSiderBarMouseLeave=function(){ - var body = $('body'); - if ((body.hasClass('page-sidebar-hover-on') === false || body.hasClass('page-sidebar-fixed') === false) || $(this).hasClass('page-sidebar-hovering')) { - return; - } - var siderbar=$('.page-sidebar'); - var siderbartoggle=$('.sidebar-toggler'); - if (body.hasClass("page-sidebar-reversed")) { - body.addClass('page-sidebar-closed').removeClass('page-sidebar-hover-on'); - siderbar.width(_sidebarCollapsedWidth); - if(siderbartoggle){ - siderbartoggle.removeAttr('style'); - } - dealSiderBarWidthChange(); - } else { - siderbar.addClass('page-sidebar-hovering'); - siderbar.animate({ - width: _sidebarCollapsedWidth - }, 350, '', function () { - body.addClass('page-sidebar-closed').removeClass('page-sidebar-hover-on'); - dealSiderBarWidthChange(); - siderbar.removeClass('page-sidebar-hovering'); - if(siderbartoggle){ - siderbartoggle.removeAttr('style'); - } - }); - } - - } - //处理style css - var dealAddStyle=function(element, property, value, important) { - var styleText=element.attr('style')?element.attr('style'):""; - styles=styleText.split(";"); - var find=""; - for(i=0;i=0){ - find=styles[i];//看是否已经添加过,如果添加过就需要替换掉 - break; - } - } - styleText=find.length>0?styleText.replace(find,""):styleText; - styleText=(styleText + ';'+property + ':' + value + ((important) ? ' !important' : '') + ';').replace(/;;/g,";"); - element.attr('style',styleText ); - } - var dealSiderBarWidthChange=function(){ - - } - // 处理边栏菜单切换时的关闭和隐藏. - var dealSidebarToggler = function () { - var viewport = _getViewPort(); - if (getCookie('sidebar_closed') === '1' && viewport.width >= zteframework_smallView) { - $('body').addClass('page-sidebar-closed'); - } - $('.page-sidebar, .sidebar-toggler').on('click', '.sidebar-toggler', function (e) { - e.preventDefault(); - var body = $('body'); - var sidebar = $('.page-sidebar'); - if(body.hasClass('page-sidebar-closed')){ - $(this).removeAttr('style'); - } - } ); - $('.page-sidebar, .header').on('click', '.sidebar-toggler', function (e) { - var body = $('body'); - var sidebar = $('.page-sidebar'); - if ((body.hasClass("page-sidebar-hover-on") && body.hasClass('page-sidebar-fixed')) || sidebar.hasClass('page-sidebar-hovering')) { - body.removeClass('page-sidebar-hover-on'); - sidebar.css('width', '').hide().show(); - dealSidebarAndContentHeight(); //fix content & sidebar height - setCookie('sidebar_closed', '0'); - dealSiderBarWidthChange(); - e.stopPropagation(); - runResponsiveHandlers(); - return; - } - $(".sidebar-search", sidebar).removeClass("open"); - var panel = $('.zte-theme-panel'); - var sidebarPosOption = $('.sidebar-pos-option', panel).val(); - var pcontent = $("[class='page-content']"); - if (body.hasClass("page-sidebar-closed")) { - body.removeClass("page-sidebar-closed"); - if (body.hasClass('page-sidebar-fixed')) { - sidebar.css('width', ''); - } - setCookie('sidebar_closed', '0'); - pcontent.css("marginLeft",_sidebarWidth); - dealSiderBarWidthChange(); - } else { - body.addClass("page-sidebar-closed"); - $(this).removeAttr('style'); - setCookie('sidebar_closed', '1'); - pcontent.css("marginLeft", _sidebarCollapsedWidth); - dealSiderBarWidthChange(); - } - //针对侧边栏伸缩的情况需加入对.page-content的判断。 - dealSidebarAndContentHeight(true); - runResponsiveHandlers(); - }); - } - // 处理水平菜单 - var dealHorizontalMenu = function () { - $('.header').on('click', '.hor-menu .hor-menu-search-form-toggler', function (e) { - if ($(this).hasClass('off')) { - $(this).removeClass('off'); - $('.header .hor-menu .search-form').hide(); - } else { - $(this).addClass('off'); - $('.header .hor-menu .search-form').show(); - } - e.preventDefault(); - }); - // 处理水平菜单 处理header下拉菜单中的菜单连接,显示在iframe中 - $('.header').on('click', ' li > a.iframe', function (e) { - //dealMenuItemClick($(this),e,"header"); - e.preventDefault(); - var menuItemID=$(this).attr("id"); - if(!!menuItemID&&menuItemID.length>0){ - _setLocationHash(menuItemID); - _hashSource="dhByInterface"; - }//else{ - _isClicked=true; - dealMenuItemClick($(this),e,"header"); - //} - }); - //处理TAB点击 - $('.header').on('click', '.hor-menu a[data-toggle="tab"]', function (e) { - e.preventDefault(); - var nav = $(".hor-menu .nav"); - var active_link = nav.find('li.current'); - $('li.active', active_link).removeClass("active"); - $('.selected', active_link).remove(); - var new_link = $(this).parents('li').last(); - new_link.addClass("current"); - new_link.find("a:first").append(''); - }); - } - // 增加一个对服务端的心跳 - var doHeartbeat = function() { - //心跳超时次数 - var heartBeatTimes = 0; - return setInterval(function() { - var userName; - if( userName == null ){ - var userName = ZteFrameWork_conf.userName; - } - var heartUrl = FrameConst.REST_HEARTBEAT + "?username=" + encodeURIComponent(userName); - $.ajax(heartUrl, { - dataType : "text", - cache : false - }).done(function(data) { - // if (data != "true") { //收到不属于取值范围内的回复,说明出现不可预知情况,取消心跳。是原framework.js中的逻辑,比较奇怪,先保留注释。 - // disableHeartbeat(); - // } - //收到心跳回应消息,心跳超时次数置0 - if( data == "true" ){ - heartBeatTimes = 0; - } - }); - heartBeatTimes++; - //心跳超时6次即1分钟,转到登录界面,认为链路断。 - if(heartBeatTimes >= 6){ - disableHeartbeat(); - //console.log(com_zte_ums_aos_framework_ui_heartbeat_timeout); - bootbox.alert($.i18n.prop('com_zte_ums_aos_framework_ui_heartbeat_fail'), function () { - window.location.replace("login.html"); - }); - } - }, 10000); - }; - if( FrameConst.do_heartbeat ){ - var heartbeatTimer = doHeartbeat(); - } - window.enableHeartbeat = function() { - if (!heartbeatTimer) { - //重新启动心跳功能,心跳超时次数置0 - heartBeatTimes = 0; - heartbeatTimer = doHeartbeat(); - return "Enabled"; - } - return "Already enabled!"; - }; - window.disableHeartbeat = function() { - if (heartbeatTimer) { - clearInterval(heartbeatTimer); - heartbeatTimer = null; - return "Disabled"; - } - return "Already disabled!"; - }; - window.doLogout = function(){ - window.location=FrameConst.REST_LOGOUT; - }; - //处理ict注销确认 - $('#trigger_logout').click(function(){ - bootbox.confirm($.i18n.prop('com_zte_ums_ict_framework_ui_confirmlogout'), function(result) { //你确认要注销吗? - if(result){ - doLogout(); - } - }); - }); - // Handle full screen mode toggle - var isscreenFull=false; - var dealFullScreenMode = function() { - // 处理全屏事件 - function toggleFullScreen() { - if(!screenfull.supportsFullScreen){//不支持全屏 - if (isIE&&typeof window.ActiveXObject !== "undefined") { // Older IE. - var wscript = new ActiveXObject("WScript.Shell"); - if (wscript !== null) { - wscript.SendKeys("{F11}"); - isscreenFull=!isscreenFull; - } - }else{ - isscreenFull=screenfull.supportsFullScreen; - }; - }else{ - screenfull.isFullScreen?screenfull.exitFullScreen():screenfull.requestFullScreen(); - isscreenFull= screenfull.isFullscreen; - } - setTimeout(function(){ - if(isscreenFull){ - $("#fullscreen_label").text($.i18n.prop('com_zte_ums_ict_framework_ui_group_exitfullscreen')); - }else{ - $("#fullscreen_label").text($.i18n.prop('com_zte_ums_ict_framework_ui_group_fullscreen')); - } - },500); - } - - $('#trigger_fullscreen').click(function() { - toggleFullScreen(); - }); - } - //清理当前正在显示的iframe之外缓存的iframe, - var dealClearCachedIframes=function(isall){ - if (cachedIframes.count()>0) { - for (var i in cachedIframes.hash()) { - var pagemyIframe=$('.page-content .page-content-body .'+i); - if(pagemyIframe&&pagemyIframe.length>0){ - if(isall==true){ - pagemyIframe.attr("src",""); - pagemyIframe.remove(); - }else if(i!=_iframe) - pagemyIframe.attr("src",""); - pagemyIframe.remove(); - } - } - } - cachedIframes.clear(); - if (cachedIframesObject.count()>0) {//清理缓存的iframe实体对象。 - for (var i in cachedIframesObject.hash()) { - if(i!=_iframe) - cachedIframesObject.remove(i); - } - } - } - var lastSelectedLayout = ''; - var dealTheme = function () { - var panel = $('.zte-theme-panel'); - if ($('body').hasClass('page-boxed') == false) { - $('.layout-option', panel).val("fluid"); - } - $('.sidebar-option', panel).val("default"); - $('.language-option', panel).val(defaultLanage); - $('.header-option', panel).val("fixed"); - $('.footer-option', panel).val("default"); - if ( $('.sidebar-pos-option').attr("disabled") === false) { - $('.sidebar-pos-option', panel).val(ZteFrameWork.isRTL() ? 'right' : 'left'); - } - var _resetLayout = function () { - dealResetLayout(); - } - var _setLayout = function () { - dealSetLayout(); - } - var setColor = function (color) { - var color_ = (ZteFrameWork.isRTL() ? color + '-rtl' : color); - $('#style_color').attr("href", ICTFRAME_CONST_THEME_COLOR_CSS_PREFFIX + color_ + ".css"); - setCookie('style_color', color); - syncColorCSS(); - } - $('.toggler', panel).click(function () { - $('.toggler').hide(); - $('.toggler-close').show(); - $('.zte-theme-panel > .theme-options').show(); - }); - - $('.toggler-close', panel).click(function () { - $('.toggler').show(); - $('.toggler-close').hide(); - $('.zte-theme-panel > .theme-options').hide(); - }); - $('.theme-colors > ul > li', panel).click(function () { - var color = $(this).attr("data-style"); - setColor(color); - $('ul > li', panel).removeClass("current"); - $(this).addClass("current"); - }); - $('.layout-option,.header-option, .sidebar-option, .footer-option, .sidebar-pos-option, .nav-pos-direction', panel).change(_setLayout); - if (getCookie('style_color') != undefined) { - setColor(getCookie('style_color')); - } - $('.language-option', panel).change(function(){ - var languageOption = $('.language-option', panel).val(); - setCookie('language-option', languageOption); - window.location.reload(); - }); - } - var dealResetLayout = function () { - $("body"). - removeClass("page-boxed"). - removeClass("page-footer-fixed"). - removeClass("page-sidebar-fixed"). - removeClass("page-header-fixed"). - removeClass("page-sidebar-reversed"); - $('.header > .header-inner').removeClass("container"); - if ($('.page-container').parent(".container").size() === 1) { - $('.page-container').insertAfter('body > .clearfix'); - } - if ($('.footer > .container').size() === 1) { - $('.footer').html($('.footer > .container').html()); - } else if ($('.footer').parent(".container").size() === 1) { - $('.footer').insertAfter('.page-container'); - } - $('body > .container').remove(); - } - /* - * 此方法在客户端初始化和设置面板上选择菜单方向的时候用。 - * param navPosOption - */ - var dealNavPos = function(navPosOption) { - // 横竖边栏切换功能禁用,则返回 - var panel = $('.zte-theme-panel'); - if ($('.nav-pos-direction', panel).attr("disabled") == "disabled") { - return; - } - var sidermenu = $("#page-sidebar-menu"); - var hormenu = $("#main_hormenu"); - var sidermenu = $("#page-sidebar-menu"); - var hormenu = $("#main_hormenu"); - var horSiderMenu = $('#' + megaSiderDivId ); - var fhorMenu = $("#" + fMenuMegaDivId); - var fsiderMenu = $("#" + fMenuSiderDivId); - var pcontent = $("[class='page-content']"); - if (sidermenu && sidermenu.length > 0 && hormenu && hormenu.length > 0 && fhorMenu && fhorMenu.length > 0) { - if (navPosOption === zteframework_menu_horizontal) { - sidermenu.css('display','none');// 侧边栏隐藏 - fhorMenu.css('display','none'); - fsiderMenu.css('display','none'); - pcontent.css("marginLeft",0); - $("body").addClass("page-full-width");//调整内容显示 - hormenu.css("display", "block");//显示水平菜单栏 - // 导航位置为水平菜单时,边栏和边栏位置为默认和靠左,且将其切换功能禁用掉 - $('.sidebar-option', panel).val("default"); - $('.sidebar-option', panel).attr("disabled", true); - $('.sidebar-pos-option', panel).val("left"); - $('.sidebar-pos-option', panel).attr("disabled", true); - } else if (navPosOption === zteframework_menu_vertical ) { - $("body").removeClass("page-full-width"); - sidermenu.css('display','block');//侧边栏显示 - var body = $('body'); - if (body.hasClass("page-sidebar-closed")) { - pcontent.css("marginLeft", _sidebarCollapsedWidth); - } else { - pcontent.css("marginLeft", _sidebarWidth); - } - hormenu.css("display", "none");//隐藏水平菜单栏 - fhorMenu.css('display','none'); - fsiderMenu.css('display','none'); - horSiderMenu.css('display','none'); - $('.sidebar-option', panel).attr("disabled", false); - $('.sidebar-pos-option', panel).attr("disabled", false); - } else if(navPosOption === zteframework_menu_fmenu ){ - sidermenu.css('display','none');// 侧边栏隐藏 - hormenu.css("display", "none");//隐藏水平菜单栏 - fsiderMenu.css('display','none'); - fhorMenu.css('display','block'); - pcontent.css("marginLeft",0); - $("body").addClass("page-full-width");//调整内容显示 - // 导航位置为水平菜单时,边栏和边栏位置为默认和靠左,且将其切换功能禁用掉 - $('.sidebar-option', panel).val("default"); - $('.sidebar-option', panel).attr("disabled", true); - $('.sidebar-pos-option', panel).val("left"); - $('.sidebar-pos-option', panel).attr("disabled", true); - } - } - } - var dealSetLayout = function(){ - var panel = $('.zte-theme-panel'); - var layoutOption = $('.layout-option', panel).val(); - var languageOption = $('.language-option', panel).val(); - var headerOption = $('.header-option', panel).val(); - var footerOption = $('.footer-option', panel).val(); - var navPosOption = $('.nav-pos-direction', panel).val(); - dealNavPos(navPosOption); - var sidebarOption = $('.sidebar-option', panel).val(); - var sidebarPosOption = $('.sidebar-pos-option', panel).val(); - if (sidebarOption == "fixed" && headerOption == "default") { - alert($.i18n.prop('com_zte_ums_ict_framework_ui_fixedsidedefaultheaderError')); //页头不支持固定边栏,先固定页头才能固定边栏. - $('.header-option', panel).val("fixed"); - $('.sidebar-option', panel).val("fixed"); - sidebarOption = 'fixed'; - headerOption = 'fixed'; - } - if (sidebarOption == "fixed" && sidebarPosOption == "right") { - alert($.i18n.prop('com_zte_ums_ict_framework_ui_fixedsiderightpositionError')); //固定边栏情况下,边栏不能靠右。. - $('.sidebar-pos-option', panel).val("left"); - sidebarPosOption = 'left'; - } - dealResetLayout(); // reset layout to default state - if (layoutOption === "boxed") { - $("body").addClass("page-boxed"); - // set header - $('.header > .header-inner').addClass("container"); - var cont = $('body > .clearfix').after('
'); - // set content - $('.page-container').appendTo('body > .container'); - // set footer - if (footerOption === 'fixed') { - $('.footer').html('
' + $('.footer').html() + '
'); - } else { - $('.footer').appendTo('body > .container'); - } - } - if (lastSelectedLayout != layoutOption) { - runResponsiveHandlers(); - } - lastSelectedLayout = layoutOption; - //header - if (headerOption === 'fixed') { - $("body").addClass("page-header-fixed"); - $(".header").removeClass("navbar-static-top").addClass("navbar-fixed-top"); - } else { - $("body").removeClass("page-header-fixed"); - $(".header").removeClass("navbar-fixed-top").addClass("navbar-static-top"); - } - //sidebar - if ($('body').hasClass('page-full-width') === false) { - if (sidebarOption === 'fixed') { - $("body").addClass("page-sidebar-fixed"); - } else { - $("body").removeClass("page-sidebar-fixed"); - } - } - //footer - if (footerOption === 'fixed') { - $("body").addClass("page-footer-fixed"); - } else { - $("body").removeClass("page-footer-fixed"); - } - //sidebar position - if (ZteFrameWork.isRTL()) { - if (sidebarPosOption === 'left') { - $("body").addClass("page-sidebar-reversed"); - $('#frontend-link').tooltip('destroy').tooltip({placement: 'right'}); - } else { - var pcontent = $("[class='page-content']"); - pcontent.css("marginLeft",0);//侧边栏靠右,则左边内容填充为0 - $("body").removeClass("page-sidebar-reversed"); - $('#frontend-link').tooltip('destroy').tooltip({placement: 'left'}); - } - } else { - if (sidebarPosOption === 'right') { - var pcontent = $("[class='page-content']"); - pcontent.css("marginLeft",0);//侧边栏靠右,则左边内容填充为0 - $("body").addClass("page-sidebar-reversed"); - $('#frontend-link').tooltip('destroy').tooltip({placement: 'left'}); - } else { - $("body").removeClass("page-sidebar-reversed"); - $('#frontend-link').tooltip('destroy').tooltip({placement: 'right'}); - } - } - dealSidebarAndContentHeight(); - dealFixedSidebar(); - dealFixedSidebarHoverable(); - dealSiderBarWidthChange(); - setCookie('layout-option', layoutOption); - setCookie('language-option', languageOption); - setCookie('header-option', headerOption); - setCookie('sidebar-option', sidebarOption); - setCookie('sidebar-pos-option', sidebarPosOption); - setCookie('nav-pos-direction', navPosOption); - } - var setCookie = function (key, value) { - if (store) { - store(key, value); - } - } - var getCookie = function (key) { - if (store) { - return store(key); - } else { - return undefined; - } - } - /*下面处理前进后退和锚点访问*/ - var _getLocationHash = function() { - return location.hash.replace("#_", ""); - } - /*统一入口设置锚点*/ - var _setLocationHash = function(menuItemID) { - location.hash = getLocationHashByMenuId(menuItemID); - } - var getLocationHashByMenuId = function(menuItemID){ - return "#_" + menuItemID; - } - // hash control - var loadCurrentHash = function(e,data){ - var locationhash = _getLocationHash(); //important - if(!!locationhash&&locationhash.length>0){ - if(_hashSource.trim()=="dhByInterface"){ - _hashSource=""; - }else{ - processChangedHash(locationhash,data); - } - } - } - // hash control 这种写法安全点 - var processChangedHash = function(path) { - var id = path; - var action = undefined; - var spIndex = path.indexOf("/"); - if(spIndex != -1) { - id = path.substring(0,spIndex); - action = path.substring(spIndex+1); - } - ZteFrameWork.goToURLByIDAndNewAction(id,action); - } - var syncColorCSS=function(){//注册皮肤切换事件处理函数,处理iframe中的皮肤切换 - var pagemyIframe=null; - if (cachedIframes.count()>0) { - for (var i in cachedIframes.hash()) { - pagemyIframe=$('.page-content .page-content-body .'+i); - if(pagemyIframe&&pagemyIframe.length>0){ - ZteFrameWork.SyncCSS(pagemyIframe[0],1,""); - } - } - } - } - var getCurrentVisibleIframe=function(){ - var pagemyIframe=null; - if (cachedIframes.count()>0) { - for (var i in cachedIframes.hash()) { - if(cachedIframes.items(i)===1){ - pagemyIframe=$('.page-content .page-content-body .'+i); - } - } - } - return pagemyIframe; - } - //处理跨域请求代理,通过该代理进行iframe间传递参数,注意这里的代理页面proxy.html必须部署到要跨域的对端域的服务器web根目录下 - var dealCrossProxy=function(ifrm,crossproxysrc,ifmHeadlins,flag){//crossproxysrc这个是proxy.html对应的url根路径 - var url=$.url(ZteFrameWork.getCurrentScript(document)); - var proxyHtmlPath=url.attr("directory")+"proxy/proxy.html"//这中情况适用于使用了该界面集成框架的应用系统 - var _ifmProxy=$(''); - var _ifm=$('#ifm_Proxy'); - _ifm.hide(); - var pageContentBody=$('.page-content .page-content-body'); - var linksrcs=new Array(); - var linksids=new Array(); - var linktyps=new Array(); - var _src=""; - for (i=0;i0){ - _src=ifmHeadlins[i].link.src; - linktyps.push("javascriptfile"); - }else{ - _src=ifmHeadlins[i].link.text; - linktyps.push("javascripttext"); - } - }else{ - linktyps.push("undefined"); - } - linksrcs.push(_src); - linksids.push({"pos":ifmHeadlins[i].pos,"scope":ifmHeadlins[i].scope,"id":ifmHeadlins[i].link.id}); - } - var parm={iFrame:ifrm,cssLinktyps:linktyps,cssLinksrcs:linksrcs,cssLinkids:linksids,origin:crossproxysrc,flag:flag}; - if(_ifm&&_ifm.length<=0){//没有添加过 - _ifmProxy.appendTo(pageContentBody); - _ifmProxy.one('load',parm,function(e){ - var data={iFrame:e.data.iFrame,cssLinktyps:e.data.cssLinktyps,cssLinksrcs:e.data.cssLinksrcs,cssLinkids:e.data.cssLinkids,flag:flag}; - $('#ifm_Proxy')[0].contentWindow.postMessage(data,e.data.origin);//window.location.origin - }); - }else if(_ifm.attr("oldproxyorigin")!=crossproxysrc){//代理已经添加过了,看是否是同一个网站的代理,如果不是需要重新加载 - _ifm.attr("src",""); - _ifm.attr("oldproxyorigin",crossproxysrc); - _ifm.one('load',parm,function(e){ - var data={iFrame:e.data.iFrame,cssLinktyps:e.data.cssLinktyps,cssLinksrcs:e.data.cssLinksrcs,cssLinkids:e.data.cssLinkids,flag:flag}; - $('#ifm_Proxy')[0].contentWindow.postMessage(data,e.data.origin);//window.location.origin - }); - _ifm.attr("src",_ifmProxy.attr("src")); - }else{//已经添加过,直接触发消息发送即可 - var data={iFrame:parm.iFrame,cssLinktyps:parm.cssLinktyps,cssLinksrcs:parm.cssLinksrcs,cssLinkids:parm.cssLinkids,flag:flag}; - _ifm[0].contentWindow.postMessage(data,parm.origin);//window.location.origin - } - } - return { - init: function () { - if(zte_http_headers){ - store("zte_http_headers",zte_http_headers); - } - dealInit(); - dealResponsiveOnResize(); - dealResponsiveOnInit(); - dealClearCachedIframes(true); ////清理当前正在显示的iframe之外缓存的iframe, - breadcrumbBtnMenus.clear(); - dealFixedSidebar(); // deals fixed sidebar menu - dealFixedSidebarHoverable(); // deals fixed sidebar on hover effect - dealSidebarMenu(); // deals main menu - dealHorizontalMenu(); // deals horizontal menu - dealSidebarToggler(); // deals sidebar hide/show - dealTheme(); // deals style customer tool - dealSetLayout(); - $(function() { - $(window).on('hashchange',function(){ - loadCurrentHash(); - }); - }); - dealFullScreenMode(); // deals full screen - $("#header_dropdown_user").css('display','block'); - $("#com_zte_ums_ict_framework_img_netnumenLogo").css('display','inline'); - $("#com_zte_ums_ict_framework_ui_main_title").css('display','inline'); - handeCtxMenuitem(); - }, - //公开清理缓存的所有Iframe的方法:isALL==true则清理所有,否则清理当前正在显示的iframe之外缓存的iframe,。 - clearCachedIframes:function(isAll){ - dealClearCachedIframes(isAll); - }, - - setBaseURLRoot:function(ipportStr){//菜单url的跟ip和端口例如:http://10.74.151.122:21180 - if (store) { - store('baseURLRoot', ipportStr); - } - var url = $.url(ipportStr); - location.hash=url.attr('fragment'); - var auth=url.attr('query'); - if (store) { - store('baseURLRootAuth', auth); - } - }, - getBaseURLRoot:function(ipportStr){//菜单url的跟ip和端口例如:http://10.74.151.122:21180 - var rooturl=""; - if (store) { - rooturl=store('baseURLRoot'); - } - return !rooturl?"":rooturl; - }, - clearBaseURLRoot:function(){//菜单url的跟ip和端口例如:http://10.74.151.122:21180 - if (store) { - store('baseURLRoot', "",-1); - } - }, - setPageTitle:function(title){//设置页面标题 - $('title').html(title+" - "+gdocTitle); - }, - getLanguage:function(){//获取语言 - return ZteFrameWork_conf.acceptLanguage; - }, - - getLocationHash:function(){ - return _getLocationHash(); - }, - setSceneURLRootPath:function(sceneURLRootPath){ - if(sceneURLRootPath&&sceneURLRootPath.trim().length>0){//如果定义了场景的全局参数 - _sceneURLRootPath=sceneURLRootPath.trim(); - if(_sceneURLRootPath.charAt(_sceneURLRootPath.length-1)!='/') - { - _sceneURLRootPath=_sceneURLRootPath+'/'; - } - } - }, - //public function to add callback a function which will be called on window resize - addResponsiveHandler: function (func) { - responsiveHandlers.push(func); - }, - - hiddenAlarmLight:function(){ - hideAlarmLight(); - }, - - hiddenMenu:function(){ - hidemenu(); - }, - setBreadcrumbByMenuID:function(id){ - //var breaditem=$('#'+id); - var menuitem=undefined; - // var items=$("a[id='"+id+"']"); - var items = undefined; - var panel = $('.zte-theme-panel'); - var navPosOption = $('.nav-pos-direction', panel).val(); - if (navPosOption === "vertical"){ //从垂直菜单里面找 - items=$("#page-sidebar-menu a[id='"+id+"']"); - if (!items || items.length < 1) { - items=$(".page-content a[id='"+id+"']"); - } - }else if(navPosOption === zteframework_menu_horizontal){//从水平菜单里面找 - items=$("#main_hormenu a[id='"+id+"']"); - if(items.length == 0){ - //横菜单没有找到,再在横菜单的子菜单找一次 - items=$("#page-megachild-sidebar-menu a[id='"+id+"']"); - } - }else if(navPosOption === zteframework_menu_fmenu){ - items=$("#f_hormenu a[id='"+id+"']"); - if(items.length == 0){ - //横菜单没有找到,再在竖菜单找一次。 - items=$("#page-f-sidebar-menu a[id='"+id+"']"); - } - } - var isbreadcrumbMenuItem=false; - if(items.length>0){ - for(var i=0;i0){ - if(isbreadcrumbMenuItem){ - dealBreadcrumbBtnGroupMenus(menuitem,false); - }else{ - dealBreadcrumb(menuitem,true,null); - } - }else{ - var breadcrumbBtnMenuItemParent=""; - if(!menuitem||menuitem.length<=0){//没有找到该菜单,可能是面包削中的,需要额外处理 - var menuItemID=id; - if (breadcrumbBtnMenus.contains(menuItemID)) {//有缓存 - breadcrumbBtnMenuItemParent="#"+breadcrumbBtnMenus.items(menuItemID); - menuitem=$(breadcrumbBtnMenuItemParent); - //_breadcrumbSource=true; - } - } - var parm=undefined; - if(breadcrumbBtnMenuItemParent&&breadcrumbBtnMenuItemParent.length>0){ - parm={breadcrumbBtnMenuItem:menuItemID}; - } - if(parm&&menuitem&&menuitem.length>0) { - dealBreadcrumb(menuitem,true,parm); - } - } - }, - setSiderbarCollapseWidth:function(width){ - _sidebarCollapsedWidth = width; - }, - getSiderbarCollapseWidth:function(){ - return _sidebarCollapsedWidth; - }, - setSidebarWidth:function(width){ - _sidebarWidth = width; - }, - getSidebarWidth:function(){ - return _sidebarWidth; - }, - //2015年10月26日新增动态切换菜单的功能,这里的菜单还需要再次更换菜单项访问的ip端口信息 - handlBaseURL:function(url){ - var baseURLRoot=ZteFrameWork.getBaseURLRoot(); - if (baseURLRoot.length>0) {//2015年10月26日新增动态切换菜单的功能,这里的菜单还需要再次更换菜单项访问的ip端口信息 - baseURLRoot=ZteFrameWork.getDomainURL(baseURLRoot);//去掉ip和port后多余的部分 - console.log("old a link href url:"+url); - url=baseURLRoot+url.replace(ZteFrameWork.getDomainURL(url),""); - console.log("baseURLRoot:"+baseURLRoot+" newURL:"+url); - }; - return url; - }, - - startPageLoading: function(message) { - dealstartPageLoading(message); - }, - stopPageLoading: function() { - dealstopPageLoading(); - }, - //public function to get a paremeter by name from URL - getLocationURLParameter: function (paramName,separator) { - var searchString = decodeURIComponent(window.location.search.substring(1)).toLowerCase(), - i, val, params = searchString.split(separator?separator:"&"); - paramName=paramName.toLowerCase(); - for (i = 0; i < params.length; i++) { - val = params[i].split("="); - if (val[0] == paramName) { - return unescape(val[1]); - } - } - return null; - }, - //public function to get a paremeter by name from URL - getURLParameter: function (paramName,url) { - var searchString = decodeURIComponent(url).toLowerCase(), - i, val, params = searchString.split("&"); - paramName=paramName.toLowerCase(); - for (i = 0; i < params.length; i++) { - val = params[i].split("="); - if (val[0] == paramName) { - return unescape(val[1]); - } - } - return null; - }, - // check for device touch support - isTouchDevice: function () { - return isTouch; - }, - getUniqueID: function(prefix) { - return prefix+'_' + Math.floor(Math.random() * (new Date()).getTime()); - }, - // check IE8 mode - isIE8: function () { - return isIE8; - }, - // check IE9 mode - isIE9: function () { - return isIE9; - }, - //check RTL mode - isRTL: function () { - return isRTL; - }, - getViewPort:function(){ - return _getViewPort(); - }, - // get layout color code by color name - getLayoutColorCode: function (name) { - if (layoutColorCodes[name]) { - return layoutColorCodes[name]; - } else { - return ''; - } - } , - fixContentHeight: function () { - dealSidebarAndContentHeight(); - }, - dealAtoIframe:function(aObj,event){ - var containerStr=aObj.parentsUntil('.page-container').hasClass('page-sidebar')?'page-sidebar':"";// - containerStr=aObj.parentsUntil('.header-inner').hasClass('hor-menu')?'header':containerStr; - dealMenuItemClick(aObj,event,containerStr); - _isClicked=false; - }, - getDomainURL:function(urlAddress){ - var url = $.url(urlAddress); - var protocol=url.attr('protocol'); - var host=url.attr('host'); - var port=url.attr('port'); - var crossOrign=protocol+"://"+host+(port.length>0?":"+port:""); - return crossOrign; - }, - getCurrentScript:function(doc) {//doc为 document对象 - /* 注意该功能在其他脚本中调用时出safari获取到的脚本路径为本方法所在脚本的路径, - 其他浏览器获取到的为调用该方法的脚本所在路径 - 取得正在解析的script节点 - */ - if(doc&&doc.currentScript) { //firefox 4+ - console.log("0、 "+doc.currentScript.src); - return doc.currentScript.src; - } - // 参考 https://github.com/samyk/jiagra/blob/master/jiagra.js - var stack; - try { - a.b.c(); //强制报错,以便捕获e.stack - } catch(e) {//safari的错误对象只有line,sourceId 或者高版本还有sourceURL - stack = e.stack; - if(e.sourceURL){//safari 浏览器没有e.stack但有e.sourceURL - stack=e.sourceURL; - }else if(!stack && window.opera){ - //opera 9没有e.stack,但有e.Backtrace,但不能直接取得,需要对e对象转字符串进行抽取 - stack = (String(e).match(/of linked script \S+/g) || []).join(" "); - } - console.log("1、 "+stack); - } - if(stack) { - /*e.stack最后一行在所有支持的浏览器大致如下: - *chrome23: - * at http://113.93.50.63/data.js:4:1 - *firefox17: - *@http://113.93.50.63/query.js:4 - *opera12: - *@http://113.93.50.63/data.js:4 - *IE10: - * at Global code (http://113.93.50.63/data.js:4:1) - */ - console.log("2、 "+stack); - stack = stack.split( /[@ ]/g).pop();//取得最后一行,最后一个空格或@之后的部分 - stack = stack[0] == "(" ? stack.slice(1,-1) : stack; - console.log("3、 "+stack); - return stack.replace(/(:\d+)?:\d+$/i, "");//去掉行号与或许存在的出错字符起始位置 - } - if(doc){ - var nodes = doc.getElementsByTagName("script"); //只在head标签中寻找 - for(var i = 0, node; node = nodes[i++];) { - if(node.readyState === "interactive") { - console.log("4、 "+(node.className = node.src)); - return node.className = node.src; - } - } - } - }, - /*下面的flag为0表示默认不触发孙子iframe中的onload事件,为1表示要触发,flag为10则对cssSrc重复执行,其他不做重复执行*/ - SyncCSS:function(ifrm,flag,cssSrc){//将主框架中的皮肤css应用到打开的iframe页面中 - if(!ifrm)return; - var ifmHeadlins = new Array(); - if(cssSrc&&cssSrc.length>0&&cssSrc.endWith(".css")){ - var _div = $(''); - var csslink=document.createElement("link"); - csslink.href=_div[0].href;//这里同步菜单定义中cssSrc属性指定的css文件到iframe - _div = null; - csslink.rel="stylesheet"; - csslink.type="text/css"; - csslink.id="ifram_csssrc"; - ifmHeadlins.push({"pos":"head","scope":"all","link":csslink});//pos是添加到子iframe中的位置,scope是子窗体作用返回,one表示直接子窗体,all表示嵌套所有子窗体 - } - if(flag!=10){//当flag为10时下面的css和js都不执行 - if($('#style_color').length>0){ - var csslink=document.createElement("link"); - csslink.href=$('#style_color')[0].href.replace(".css","_ifrm.css");//这里同步的皮肤页面修改为原皮肤页面文件名后缀添加ifrm的css皮肤文件 - csslink.rel="stylesheet"; - csslink.type="text/css"; - csslink.id="style_color"; - ifmHeadlins.push({"pos":"head","scope":"all","link":csslink});//pos是添加到子iframe中的位置,scope是子窗体作用返回,one表示直接子窗体,all表示嵌套所有子窗体 - } - // 将 font-awesome字体图标应用到模块iframe - if($('#font_awesome').length>0){ - var awesomelink=document.createElement("link"); - awesomelink.href=$('#font_awesome')[0].href; - awesomelink.rel="stylesheet"; - awesomelink.type="text/css"; - awesomelink.id="font_awesome"; - ifmHeadlins.push({"pos":"head","scope":"all","link":awesomelink}); - } - // 将pym.js or pym.min.js应用到模块iframe - var pymjsObj=$("script[src*='/pym.']");//模糊查找 - pymjsObj=pymjsObj.length>0?pymjsObj:$("script[src*='/pym1.']"); - if(pymjsObj.length>0){ - var pymjs=document.createElement("script"); - pymjs.src=pymjsObj[0].src; - pymjs.type="text/javascript"; - pymjs.id=!!pymjsObj[0].id?pymjsObj[0].id:"pymjs"; - ifmHeadlins.push({"pos":"head","scope":"one","link":pymjs}); - pymjs=document.createElement("script"); //pym脚本文件加载后要执行new pym.Child()进行iframe子窗体实例化,便于子窗体和父窗体通讯new pym.Child({ id: '"+_iframe+"' ,polling: 1000}) - var frameid=(_iframe.split('-').length>0?_iframe.split('-')[1]:"1"); - pymjs.text="var t1;function pmchd(){console.log('In the frame "+_iframe+",pym code call is begining; '+(typeof pym!= 'undefined'));if(typeof pym != 'undefined'){pymChild"+frameid+" = new pym.Child({ id: 'pdiv_"+_iframe+"' ,polling: 500});window.clearInterval(t1); }};t1 = window.setInterval(pmchd,5);"; - pymjs.type="text/javascript"; - pymjs.id="pymChild"; - ifmHeadlins.push({"pos":"htmlend","scope":"one","link":pymjs}); - } - // 将hk.js or hk.min.js应用到模块iframe - var hkjsObj=$("script[src*='/hk.']");//模糊查找 - hkjsObj=hkjsObj.length>0?hkjsObj:$("script[src*='/hk1.']"); - if(hkjsObj.length>0){ - var hkjs=document.createElement("script"); - hkjs.src=hkjsObj[0].src; - hkjs.type="text/javascript"; - hkjs.id=!!hkjsObj[0].id?hkjsObj[0].id:"hkjs"; - ifmHeadlins.push({"pos":"head","scope":"one","link":hkjs}); - hkjs=document.createElement("script"); ////hk.js 加载后拦截ajax请求进行转发 - } - } - var crossOrign=ZteFrameWork.getDomainURL(ifrm.src); - if( window.location.origin==crossOrign){ //第一层同域处理 - for (i=0;i0){ - var ifmHeadlins2 = new Array(); - for (i=0;i0){ - console.log('跨域访问: 系统将进入跨域访问代理处理流程 '); - dealCrossProxy(childifrms[j].name,childOrign,ifmHeadlins2,flag); - } - } - } - } - }else{ - if(ifmHeadlins.length>0){ - console.log('跨域访问: 系统将进入跨域访问代理处理流程 '); - dealCrossProxy(ifrm.name,crossOrign,ifmHeadlins,flag); - } - } - }, - goToURL:function(url){ - dhByBreadcrumb = true;//全局变量,声明此次事件是由点击面包屑发起的 - var showNav=ZteFrameWork.getLocationURLParameter('showNav'); - if(showNav=="false"){//如果不显示菜单,就强制刷新本页 - location.reload(); - }else{ - url="a[name='"+url+"']"; - $(url).click(); - } - }, - goToURLByName:function(name){ - var showNav=ZteFrameWork.getLocationURLParameter('showNav'); - if(showNav=="false"){//如果不显示菜单,就强制刷新本页 - location.reload(); - }else{ - url="a[name='"+name+"']"; - $(url).click(); - } - }, - goToURLByID:function(id){ - if(!id){ - return; - } - var showNav=ZteFrameWork.getLocationURLParameter('showNav'); - if(showNav=="false"){//如果不显示菜单,就强制刷新本页 - location.reload(); - }else{ - if(id.indexOf("#")<0){ - id="#"+id; - } - $(id).click(); - } - }, - goToPortal:function(id){ - var _url=top.location.href; - console.log(_url); - //_url="/ngict/iui/framework/"; - var url=$.url(_url); - top.location=url.attr("directory")+"uifportal.html#"+id+"/"; - }, - //Category - goToURLByIDAndNewIPPort:function(id,newIPPort,newActionStr){ - //先把NewIPPort对象:newIPPort={menuCategoryID:'vim',ipPortStr:'htpp://10.74.151.123:31180',newTitle:''}缓存到Category数组中, - //menuCategoryID属性是更多菜单上配置的菜单的分类id,; - //ipPortStr属性是该id的菜单要替换的新的ip和端口地址字符串,包括协议部分,比如http://10.74.151.64:21169 - //newTitle属性用于放置新开ip的页面对应到面包屑上的名字,可以为“”,空标识不关注 - _menuCategorys.replace(newIPPort.menuCategoryID,{ipPort:newIPPort.ipPortStr,ipTitle:newIPPort.newTitle});//把当前面包削中的菜单id和该子菜单对应的父菜单关联缓存起来 - if (store) { - store('menuCategoryID', newIPPort.menuCategoryID+"[menuCategoryID]"+newIPPort.ipPortStr+"[menuCategoryID]"+(!!newIPPort.newTitle?newIPPort.newTitle:"")); - } - //这里增加按照newIPPort.menuCategoryID分类加载more菜单的处理逻辑 - //首先根据id找到对应的主菜单菜单项 - var menuitem = this.findMenuItemByMenuId(id); - if(!menuitem||menuitem.length<=0){//主菜单中没有找到,就找more菜单,找到id对应的more菜单项所属的主菜单项 - var mainMenuId = this.getMenuItemId_From_MoreMenuRelation(id); - if( !!mainMenuId&&mainMenuId.length>0 ){//more菜单中找到了id对应的主菜单项id,根据id返回主菜单项 - menuitem = this.findMenuItemByMenuId(mainMenuId); - if(!!menuitem&&menuitem.length>0){ - var more=$("#"+id,$('#pageableDiv')).parent(); - $(".box.boxOperation", $(".carousel-inner")).removeClass("moreButtonSelected"); - more=$('a>div.box',more); - if (more.hasClass('moreButtonSelected') == false){ - more.addClass('moreButtonSelected'); - } - var pagesTags=$('.item.moreButtonsTag'); - if(pagesTags.length>0){ - for(var i=0;i0){ - tags.addClass('active'); - } - } - } - } - } - } - //其次找到的菜单项中newIPPort.menuCategoryID对应的src覆盖breadcrumgroupbuttonsrc属性值, - if(!!menuitem&&menuitem.length>0){ - var mulsrc=menuitem.attr(newIPPort.menuCategoryID+"-multiInsrc"); - if(!!mulsrc){ - menuitem.attr("breadcrumgroupbuttonsrc" ,mulsrc); - getBreadcrumbRightButtons(mulsrc,true); - } - } - if (waittime) { - clearInterval(waittime); - } - waittime = setInterval(function () { - if(moreMenusisLoaded==true){ - clearInterval(waittime); - ZteFrameWork.goToURLByIDAndNewAction(id,newActionStr,null); - } - }, 10); - }, - goToURLByIDAndNewAction:function(id,newActionStr,newBrowserPageOption){ - if(!id){ - return; - } - - /*if(id.indexOf("#")<0){ - id="#"+id; - }*/ - var menuitem = this.findMenuItemByMenuId(id); - //处理新开页面情况 - if(newBrowserPageOption){ - var href = ICTFRAME_CONST_DEFAULTPAGE_PATH; - var hash = getLocationHashByMenuId(id); - var newin=window.open(href + newBrowserPageOption.paramStr + hash,newBrowserPageOption.windowTitle); - newin.name=newActionStr;//注意这种传递参数的方法,被打开的页面中需要通过top.name中获取该传递的参数。 - return; - } - //$(window).off('hashchange', loadCurrentHash); - var menuItemID=menuitem?menuitem.attr("id"):""; - if(!!menuItemID&&menuItemID.length>0){ - //menuItemID="#" + menuItemID; - //menuItemID=!!newActionStr?menuItemID:menuItemID+"/no"; - _setLocationHash(menuItemID); - } - var breadcrumbBtnMenuItemParent=""; - if(!menuitem||menuitem.length<=0){//没有找到该菜单,可能是面包削中的,需要额外处理 - menuItemID=id; - if (breadcrumbBtnMenus.contains(menuItemID)) {//有缓存 - breadcrumbBtnMenuItemParent=breadcrumbBtnMenus.items(menuItemID); - menuitem=this.findMenuItemByMenuId(breadcrumbBtnMenuItemParent); - //_breadcrumbSource=true; - } - // else{//在新增的可翻页的更多菜单里面找 - // var pageDiv = $('#pageableDiv'); - // menuitem=$('#' + menuItemID , pageDiv); - // } - if( menuitem && menuitem.length > 0){ - isMoreMenuItemClick = true; - } - } - if(!menuitem||menuitem.length<=0){ - //面包屑和主菜单都没有找到,情况可能是:更多菜单点击打开后,刷新,hash已经更改,但是对应的更多菜单的html没有加载,需要找到更多菜单和主菜单的对应关系 - var mainMenuId = this.getMenuItemId_From_MoreMenuRelation( id ); - if( mainMenuId ){ - menuitem = this.findMenuItemByMenuId(mainMenuId); - } - - } - if (store&&store("globleCurrentBreadcrumb")){ - globleCurrentBreadcrumb=store("globleCurrentBreadcrumb"); - //下面处理下刷新整个页面后从cookie中获取来的最后一次操作的面包屑对应的对应菜单的name属性回写,便于面包屑事件响应能够找到对应的菜单 - var al=$("a",$("
"+globleCurrentBreadcrumb+"
")); - var alink,gal; - for(i=0;i0){ - var panel = $('.zte-theme-panel'); - var navPosOption = $('.nav-pos-direction', panel).val(); - if(navPosOption === zteframework_menu_fmenu){ - var hparentid=menuitem.attr("hparentid"); - var id=menuitem.attr("id"); - var i=0,menuItemH=menuitem; - while (id!=hparentid&&i<20){ - menuItemH=ZteFrameWork.findMenuItemByMenuId(hparentid); - hparentid=menuItemH.attr("hparentid"); - id=menuItemH.attr("id"); - i++; - }; - if(!menuItemH.hasClass('active')) - menuItemH.parent().addClass("active"); - } - }else{ - console.log("goToURLByIDAndNewAction():Can't find the menuitem.The menu ID is:"+id+".Please check if the ID or ID cache is correct."); - } - //try{ - var parm=undefined; - if(!!newActionStr&&breadcrumbBtnMenuItemParent&&breadcrumbBtnMenuItemParent.length>0){ - parm={action:newActionStr,breadcrumbBtnMenuItem:menuItemID}; - }else if(!!newActionStr){ - parm={action:newActionStr}; - }else if(breadcrumbBtnMenuItemParent&&breadcrumbBtnMenuItemParent.length>0){ - parm={breadcrumbBtnMenuItem:menuItemID}; - }else if(mainMenuId){ - isMoreMenuItemClick = true; - parm={breadcrumbBtnMenuItem:menuItemID}; - } - //if(breadChangeType){ - // if(!parm){ - // parm = {}; - // } - // parm.breadChangeType = breadChangeType; - //} - if(parm&&parm.action || parm&&parm.breadChangeType) { - _hashSource="dhByInterface"; - } - - if(menuitem&&menuitem.length>0){ - menuitem.one('click',parm,function(e){ //临时一次性的注册一次click事件处理函数,执行完毕会自动删除 - ZteFrameWork.dealAtoIframe($(this),e); - //$(window).one('hashchange', loadCurrentHash); - return false; - }); - menuitem.click();//后执行 - } - /*}catch(e){} - finally{ - //$(window).on('hashchange', loadCurrentHash); - }*/ - }, - - getBreadcrumbEle:function(){ - return $('.breadcrumbUl')[0]; - }, - - - findMenuItemByMenuId:function( id ){ - var menuitem=undefined; - var panel = $('.zte-theme-panel'); - var navPosOption = $('.nav-pos-direction', panel).val(); - - var items = undefined; - if (navPosOption === "vertical"){ //从垂直菜单里面找 - items=$("#page-sidebar-menu a[id='"+id+"']"); - }else if(navPosOption === zteframework_menu_horizontal){//从水平菜单里面找 - items=$("#main_hormenu a[id='"+id+"']"); - if(items.length == 0){ - //横菜单没有找到,再在横菜单的子菜单找一次 - items=$("#page-megachild-sidebar-menu a[id='"+id+"']"); - } - }else if(navPosOption === zteframework_menu_fmenu){ - items=$("#f_hormenu a[id='"+id+"']"); - if(items.length == 0){ - //横菜单没有找到,再在竖菜单找一次。 - items=$("#page-f-sidebar-menu a[id='"+id+"']"); - - } - - } - if( items&&items.length == 0 ){ - console.log( 'fmenu alink length is :' + $("#page-f-sidebar-menu a").length ); - console.log( 'cant find menu in sidemenu、megamenu and fmenu , the menu id is ' + id ); - } - if(items&&items.length>0){ - for(var i=0;i0){ - for(var i=0;i 0) { - parm = { - breadcrumbBtnMenuItem : menuItemID - }; - } - if (menuitem && menuitem.length > 0) { - menuitem.one('click', parm, function (e) { //临时一次性的注册一次click事件处理函数,执行完毕会自动删除 - var containerStr = $(this).parentsUntil('.page-container').hasClass('page-sidebar') ? 'page-sidebar' : ""; // - containerStr = $(this).parentsUntil('.header-inner').hasClass('hor-menu') ? 'header' : containerStr; - _isClicked = false; - dealMenuItemGetFocus($(this),e,containerStr); - return false; - }); - menuitem.click(); //后执行 - } - }, - // 处理面包削中的按钮菜单增加的导航连接,显示在iframe中 - openbreadcrumbLink:function(aObject,e) { - var url = aObject.attr("href"); - if(!url||url.length<2) - return; - e.preventDefault(); - dealScrollTo(); - var menuItemID=aObject.attr("id"); - if(!!menuItemID&&menuItemID.length>0){ - _setLocationHash(menuItemID); - _hashSource="dhByInterface"; - } - dealstartPageLoading(); - dealIframe(aObject,e); - }, - getURLParam:function(name){ - var reg = new RegExp("(^|&)" + name.toLowerCase() + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象 - var search =decodeURIComponent(location.search.substring(1)).toLowerCase(); - var r =search.match(reg); //匹配目标参数 - if (r != null) return unescape(r[2]); - return null; //返回参数值 - } - }; - -}(); - -var currentRunningScriptSrcPath = {}; -//抽取html片段中任意位置的script标签(包括代码是内嵌的情况)逐个运行(不会在单个script加载不到的时候停下来) -function runHtmlScripts(s) { - var div = document.createElement('div'); - div.innerHTML = s; - var scripts = div.getElementsByTagName('script'); - $(scripts).each(function(){ - var src = this.src; - src=ZteFrameWork.handlBaseURL(src); - if(src){ - //存储当前Script标签的绝对路径以适应该js被其他系统跨域引用的情况 - currentRunningScriptSrcPath[src.substring(src.lastIndexOf("/") + 1)] = src.substring(0, src.lastIndexOf("/")+1); - $.getScript(src); - }else{ - $.globalEval(this.text || this.textContent || this.innerHTML || ''); - } - }); -} -function stripHtmlScripts(s) { - var div = document.createElement('div'); - div.innerHTML = s; - var scripts = div.getElementsByTagName('script'); - $(scripts).each(function(){ - /* if(this.src){ - $.getScript(this.src); - }else{ - $.globalEval(this.text || this.textContent || this.innerHTML || ''); - } */ - this.src=ZteFrameWork.handlBaseURL(this.src); - this.parentNode.removeChild(this); - }); - return div.innerHTML; -} -function getsiderBarMenu(url){ - if (url.length<2){ - return; - } - url=ZteFrameWork.handlBaseURL(url); - ZteFrameWork.startPageLoading();//菜单加载中请稍候.... - var pagesidebar=$('#page-sidebar-menu'); - pagesidebar.empty(); - pagesidebar.append(""); - $.ajax({ - type: "GET", - cache: false, - url: url, - dataType: "html", - success: function (res) { - //去除script标签以后添加到主框架以防止append方法因为加载script标签失败导致后面的代码无法运行 - //res = stripHtmlScripts(res); - var resScriptsSriped = stripHtmlScripts(res); - pagesidebar.append(resScriptsSriped); - runHtmlScripts(res); - - siderBarMenuAuthentication(); - dealMysqlBackupMenu(); - //loadi18n_WebFramework_sideMenu(); - setTimeout(function () { - ZteFrameWork.stopPageLoading(); - goToHomePage(); - }, 1000); - }, - error: function (xhr, ajaxOptions, thrownError) { - //$('#page-sidebar-menu').append('');//加载系统菜单失败!;//加载系统菜单失败! - } - }); -}; -var setLayoutValueByCookie = function () { - var panel = $('.zte-theme-panel'); - if (store('layout-option') != undefined) { - $('.layout-option', panel).val(store('layout-option')); - } - if (store('language-option') != undefined) { - $('.language-option', panel).val(store('language-option')); - } - if (store('sidebar-option') != undefined) { - $('.sidebar-option', panel).val(store('sidebar-option')); - } - if (store('header-option') != undefined) { - $('.header-option', panel).val(store('header-option')); - } - if (store('sidebar-pos-option') != undefined) { - $('.sidebar-pos-option', panel).val(store('sidebar-pos-option')); - } - var horMenuLoadTip = $("[class='nav-load-error']", $(".hormenu")); - var sideMenuLoadTip = $("[class='nav-load-error']", $("[class='page-sidebar-menu']")); - // 横竖菜单都无错误提示,都正确加载 - // if ((!horMenuLoadTip || horMenuLoadTip.length <= 0) && (!sideMenuLoadTip || sideMenuLoadTip.length <= 0)) { - // if (store('nav-pos-direction') != undefined) { - // var navPosOption = store('nav-pos-direction'); - // $('.nav-pos-direction', panel).val(navPosOption); - // } else { - $('.nav-pos-direction', panel).val('fmenu'); - // $.ajax({ - // "dataType" : 'json', - // "type" : "GET", - // "async" : false, - // url : FrameConst.REST_GET_FRAME_MENUDIRECTION + "&tmpstamp=" + new Date().getTime(), - // "success" : function (obj) { - // if (obj.value && (obj.value != "")) { - // $('.nav-pos-direction', panel).val(obj.value); - // } - // } - // }); - //} - // } else { - // $('.nav-pos-direction', panel).attr("disabled", true); - // } -} -function getHorMenu(url){ - setLayoutValueByCookie(); - if (url.length<2){ - return; - } - url=ZteFrameWork.handlBaseURL(url); - ZteFrameWork.startPageLoading();//菜单加载中请稍候.... - var pagehorbar=$('#main_hormenu') - pagehorbar.empty(); - $.ajax({ - type: "GET", - async : false, - cache: false, - url: url, - dataType: "html", - success: function (res) { - //去除script标签以后添加到主框架以防止append方法因为加载script标签失败导致后面的代码无法运行 - //res = stripHtmlScripts(res); - var resScriptsSriped = stripHtmlScripts(res); - $('#main_hormenu').append(resScriptsSriped); - runHtmlScripts(res); - // 增加mysql判断,如果数据库为mysql,去掉基础数据备份功能菜单项 - var dbType = ZteFrameWork_conf.dbType; - if (dbType == "mysql") { - var item=$(".hor-menu a[id='uep-ict-backup-baseDataBack']"); - item.parent().remove(); - } - horMenuAuthentication('main_hormenu'); - ZteFrameWork.stopPageLoading(); - if($('.nav-pos-direction', panel).val() === "horizontal"){ - setTimeout(function () { - //goToHomePage();//注意这里由于水平和左边栏菜单都在一个页面中出现,所以这里只调用一次 - }, 150); - } - }, - error: function (xhr, ajaxOptions, thrownError) { - //$('#main_hormenu').append('');//加载系统菜单失败! - var pcontent = $("[class='page-content']"); - //pcontent.css("marginLeft",225); - $('.nav-pos-direction', panel).attr("disabled", true); - } - }); -}; -//加载横菜单的子菜单,加到左边的siderbar里面 -function getMegaFMenu( url ){ - if (url.length<2){ - return; - } - url=ZteFrameWork.handlBaseURL(url); - ZteFrameWork.startPageLoading();//菜单加载中请稍候.... - var siderDiv =$( '#' + megaSiderDivId ); - siderDiv.empty(); - siderDiv.append(""); - $.ajax({ - type: "GET", - async : false, - cache: false, - url: url, - dataType: "html", - success: function (res) { - //去除script标签以后添加到主框架以防止append方法因为加载script标签失败导致后面的代码无法运行 - var resScriptsSriped = stripHtmlScripts(res); - siderDiv.append(resScriptsSriped); - runHtmlScripts(res); - FMenuAuthentication( megaDivId ,megaSiderDivId ); - rebuildHorMenu(); - ajustFMenu( megaDivId ,megaSiderDivId ); - ZteFrameWork.stopPageLoading(); - }, - error: function (xhr, ajaxOptions, thrownError) { - //siderDiv.append('');//加载系统菜单失败! - //var pcontent = $("[class='page-content']"); - //pcontent.css("marginLeft",225); - } - }); -} - -function iniHorMenu(){ - var hormenu=$('#main_hormenu'); - if(!hormenu) return; - var url=hormenu.attr("menuSrc"); - if(url&&url.length>0){ - getHorMenu(url); - } - // - var megaFMenu = $('#'+megaSiderDivId); - if(!megaFMenu) return; - var url = megaFMenu.attr("menuSrc"); - if(url&&url.length>0){ - getMegaFMenu(url); - } -}; -function iniFMenu(){ - var fhormenu=$('#f_hormenu'); - var fsidemenu=$('#page-f-sidebar-menu'); - if(!fhormenu || !fsidemenu) return; - var urlmega=fhormenu.attr("menuSrc"); - var urlsider=fsidemenu.attr("menuSrc"); - if(urlmega&&urlmega.length>0 && urlsider && urlsider.length > 0){ - getFMenu(urlmega , urlsider); - } -}; -function getFMenu( urlMega , urlSider ){ - if (urlMega.length<2 || urlSider.length<2){ - return; - } - urlMega=ZteFrameWork.handlBaseURL(urlMega); - urlSider=ZteFrameWork.handlBaseURL(urlSider); - ZteFrameWork.startPageLoading();//菜单加载中请稍候.... - var fhorbar=$('#f_hormenu'); - fhorbar.empty(); - var fSideBar= $("#page-f-sidebar-menu"); - fSideBar.empty(); - $.ajax({ - type: "GET", - async : false, - cache: false, - url: urlMega, - dataType: "html", - success: function (res) { - var resScriptsSriped = stripHtmlScripts(res); - $('#f_hormenu').append(resScriptsSriped); - horMenuAuthentication('f_hormenu'); - runHtmlScripts(res); - dealMysqlBackupMenu(); - ZteFrameWork.stopPageLoading(); - }, - error: function (xhr, ajaxOptions, thrownError) { - $('#f_hormenu').append('');//加载系统菜单失败! - var pcontent = $("[class='page-content']"); - $('.nav-pos-direction', panel).attr("disabled", true); - } - }); - var fpagesidebar=$('#' + fMenuSiderDivId); - fpagesidebar.empty(); - fpagesidebar.append(""); - $.ajax({ - type: "GET", - cache: false, - url: urlSider, - dataType: "html", - success: function (res) { - var resScriptsSriped = stripHtmlScripts(res); - fpagesidebar.append(resScriptsSriped); - //先全部隐藏,后面根据与hash的匹配情况来显示 - fpagesidebar.children().css('display','none'); - runHtmlScripts(res); - dealMysqlBackupMenu(); - FMenuAuthentication( fMenuMegaDivId ,fMenuSiderDivId ); - ajustFMenu( fMenuMegaDivId ,fMenuSiderDivId ); - ZteFrameWork.stopPageLoading(); - loadi18n_WebFramework_sideMenu(); - }, - error: function (xhr, ajaxOptions, thrownError) { - $('.page-f-sidebar-menu').append('');//加载系统菜单失败!;//加载系统菜单失败! - } - }); -}; -function iniSidebarMenu(){ - var sidermenu=$('#page-sidebar-menu'); - if(!sidermenu) return; - var url=sidermenu.attr("menuSrc"); - if(url&&url.length>0){ - getsiderBarMenu(url); - } -}; -function getChangePWDDlg(url){ - if (url.length<2){ - return; - } - ZteFrameWork.startPageLoading();//加载中.... - var pageChangepasswd=$('.modal-dialog .Changepasswd'); - pageChangepasswd.empty(); - $.ajax({ - type: "GET", - cache: false, - url: url, - dataType: "html", - success: function (res) { - $('.modal-dialog .Changepasswd').append(res); - ChangePWD.init(); - ZteFrameWork.stopPageLoading(); - }, - error: function (xhr, ajaxOptions, thrownError) { - $('.modal-dialog .Changepasswd').append('

'+$.i18n.prop('com_zte_ums_ict_framework_ui_loadchgpwdpageError')+'

');//加载修改密码页面失败! - } - }); -}; -function iniChangePWDDlg(){ - var url=$('.modal-dialog .Changepasswd').attr("dlgsrc"); - if(url&&url.length>0){ - getChangePWDDlg(url); - } -}; -function getHeaderMenu(url){ - if (url.length<2){ - return; - } - ZteFrameWork.startPageLoading();//加载中请稍候.... - var headerMenu=$('#headerMenu'); - headerMenu.empty(); - $.ajax({ - type: "GET", - cache: false, - async: false, - url: url, - dataType: "html", - success: function (res) { - $('#headerMenu').append(res); - ZteFrameWork.stopPageLoading(); - }, - error: function (xhr, ajaxOptions, thrownError) { - //$('#headerMenu').append('

'+$.i18n.prop('com_zte_ums_ict_framework_ui_loadmenuerror')+'

');//加载系统菜单失败! - } - }); -}; -function goToHomePage(){ - locationhash = ZteFrameWork.getLocationHash(); - if(!!locationhash&&locationhash.length>0){//有锚点,直接触发 - var newIPPort=null; - if (store&&store('menuCategoryID')) { - var s=store('menuCategoryID').split('[menuCategoryID]'); - if(s.length>2){ - newIPPort={menuCategoryID:s[0],ipPortStr:s[1],newTitle:s[2]}; - } - } - if(!!newIPPort){ - ZteFrameWork.goToURLByIDAndNewIPPort(locationhash,newIPPort,null); - }else{ - ZteFrameWork.goToURLByIDAndNewAction(locationhash,null,null); - } - }else{//否则还是模拟点击配置了start类的菜单 - var containerStr = ""; - //var sidermenu = $("[class='page-sidebar-menu']", $("[class='page-sidebar navbar-collapse collapse']")); - var sidermenu = $("#page-sidebar-menu"); - var hormenu = $("#main_hormenu"); - var fhormenu = $('#' + fMenuMegaDivId); - var fhormenusider = $('#page-f-sidebar-menu'); - var startmenu = null; - var navPosOption = $('.nav-pos-direction', panel).val(); - // 侧边栏显示,根据侧边栏CSS选择 - if (navPosOption === "vertical") { - //containerStr=$('.page-sidebar').length>0?'.page-sidebar':""; - startmenu = $('.iframe.start' , sidermenu); - dealStartMenu( startmenu, sidermenu ); - } - // 水平菜单显示,根据水平菜单CSS选择 - else if (navPosOption === "horizontal") { - //containerStr=$('.hor-menu').length>0?'.header':containerStr; - startmenu = $('.iframe.start' , hormenu); - dealStartMenu( startmenu, hormenu ); - - } - //F菜单的恒菜单显示 - else if (navPosOption === zteframework_menu_fmenu) { - //containerStr=$('.hor-menu').length>0?'.header':containerStr; - startmenu = $('.iframe.start' ,fhormenu); - if (startmenu && startmenu.length < 1) { - startmenu = $('.iframe.start' ,fhormenusider); - } - dealStartMenu( startmenu, fhormenu,fhormenusider ); - } - } -}; -var dealStartMenu = function(startmenu , menuContainer,menuContainer2 ){ - var timer =setInterval(function () { - if(startmenu&&startmenu.length>0){ - startmenu.click(); - clearInterval(timer); - }else{ - console.log('the start menu click event is not be triggerd ,so do it repeat!!'); - $('a[operation]', menuContainer).each(function () { - startmenu = $(this); - return false; - }); - if (menuContainer2&&startmenu && startmenu.length < 1) { - $('a[operation]', menuContainer2).each(function () { - startmenu = $(this); - return false; - }); - } - } - }, 100); - handeCtxMenuitem(); - } -// 屏蔽横竖菜单项的右键功能 -function handeCtxMenuitem() { - $(".page-sidebar ul li a").each(function() { - if ($(this).attr("href") && $(this).attr("href") != "javascript:;" && $(this).attr("href") != "#") { - $(this).attr("oncontextmenu", "return false"); - } - }); - $(".hormenu li a").each(function() { - if ($(this).attr("href") && $(this).attr("href") != "javascript:;" && $(this).attr("href") != "#") { - $(this).attr("oncontextmenu", "return false"); - } - }); -} -function initBaseInfo(){ - $("#logout_label").text($.i18n.prop('com_zte_ums_ict_framework_ui_group_logout')); - $("#fullscreen_label").text($.i18n.prop('com_zte_ums_ict_framework_ui_group_fullscreen')); - $("#changePwd_label").text($.i18n.prop('com_zte_ums_ict_framework_ui_changePwd')); - $("#com_zte_ums_ict_framework_moudle_about").text($.i18n.prop('com_zte_ums_ict_framework_moudle_about')); - $("#com_zte_ums_ict_framework_moudle_help").text($.i18n.prop('com_zte_ums_ict_framework_moudle_help')); - $("#zte_menu-toggler").attr("title",$.i18n.prop('com_zte_ums_ict_framework_moudle_menutoggler')); -}; -window.closeModal = function(modalid) { - if(!modalid){ - return; - } - if(modalid.indexOf("#")<0){ - modalid="#"+modalid; - } - $(modalid).modal('hide'); -}; -function getLcsRight(lcsoperations) { - var lcsrights = new Array(); - if (lcsoperations && (lcsoperations.length > 0)) { - // 请求后台license value - //----test data---- - // var testjson = '{"data":[{"id":"mylcs","name":"xxx","value":"false"}]}'; - // var testopt = eval('(' + testjson + ')'); - // var testarray = testopt.data; - //-----end test data--- - var keys = { - "keys" : lcsoperations - }; - var jsonvalues = JSON.stringify(keys); - var data = { - "data" : jsonvalues - }; - var url=FrameConst.REST_GETLICENSEINFO + "?tmpstamp=" + new Date().getTime(); - url=ZteFrameWork.handlBaseURL(url); - $.ajax({ - "dataType" : 'json', - "type" : "GET", - "async" : false, - "url" : url, - "data" : data, - //"contentType" : 'application/json; charset=utf-8', - "success" : function (response) { - if (response) { - lcsrights = response.data; - } - }, - "error" : function (XMLHttpRequest, textStatus, errorThrown) { - lcsrights = null; - } - }); - return lcsrights; - } - return lcsrights; -} -// 侧边栏菜单鉴权 -function siderBarMenuAuthentication() { - // license 鉴权 - var menuids = new Array(); - var lcsoperations = new Array(); - //从页面DOM取得菜单license项。 - $('a[licenseid]', $('.page-sidebar-menu')).each(function () { - var licenseid = $(this).attr("licenseid"); - if (licenseid) { - lcsoperations.push(licenseid); - var id = $(this).attr("id"); - menuids.push(id); - } - }); - var lcsrights = getLcsRight(lcsoperations);// 取得license数据。 - if (lcsrights && (lcsrights.length == menuids.length)) { - // 根据后台license值判断所在菜单项是否显示 - for (var i = 0; i < menuids.length; i++) { - var id = menuids[i]; - var lcskey = lcsoperations[i]; - var lcsitem = lcsrights[i]; - // 菜单项如果配了licenseid, 并且不是true字符串, 则移除菜单项 - if (lcsitem.value != "True") { - $('#'+id, $('.page-sidebar-menu')).parent().remove(); - } - } - } - var operations = new Array(); - $('a[operation]', $('.page-sidebar-menu')).each(function () { - var operation = $(this).attr("operation"); - if (operation) { - operations.push(operation); - } - }); // 遍历菜单项,提取所有的操作码 - var rightObj = getAllOperCodeRights(operations); // 对操作码进行鉴权判断 - $('a[operation]', $('.page-sidebar-menu')).each(function () { - var operation = $(this).attr("operation"); - if (operation) { - if (!hasRight(operation, rightObj)) { - $(this).parent("li").remove(); // 删除没有权限的菜单项 - } - } - }); - rebuildSiderBarMenu(); -}; -// 横向菜单栏鉴权 -function horMenuAuthentication( horMenuId ) { - // license 鉴权 - var menuids = new Array(); - var lcsoperations = new Array(); - //从页面DOM取得菜单license项。 - $('a[licenseid]', $('#'+ horMenuId)).each(function () { - var licenseid = $(this).attr("licenseid"); - if (licenseid) { - lcsoperations.push(licenseid); - var id = $(this).attr("id"); - menuids.push(id); - } - }); - var lcsrights = getLcsRight(lcsoperations);// 取得license数据。 - if (lcsrights && (lcsrights.length == menuids.length)) { - // 根据后台license值判断所在菜单项是否显示 - for (var i = 0; i < menuids.length; i++) { - var id = menuids[i]; - var lcskey = lcsoperations[i]; - var lcsitem = lcsrights[i]; - // 菜单项如果配了licenseid, 并且不是true字符串, 则移除菜单项 - if (lcsitem.value != "True") { - $('#'+id, $('#'+ horMenuId)).parent().remove(); - } - } - } - var operations = new Array(); - $('a[operation]', $('#'+ horMenuId)).each(function () { - var operation = $(this).attr("operation"); - if (operation) { - operations.push(operation); - } - }); // 遍历菜单项,提取所有的操作码 - var rightObj = getAllOperCodeRights(operations); // 对操作码进行鉴权判断 - $('a[operation]', $('#'+ horMenuId)).each(function () { - var operation = $(this).attr("operation"); - if (operation) { - if (!hasRight(operation, rightObj)) { - $(this).parent("li").remove(); // 删除没有权限的菜单项 - } - } - }); - rebuildHorMenu(); -}; -//根据F菜单的竖菜单来调整横菜单。获取hparentid相同的竖菜单中的第一个,来更新横菜单上对应父亲菜单的href、catchnum等信息 -function ajustFMenu(megaBarDivId , siderbarDivId){ - var hparentIds = {}; - $('a[hparentid]', $('#'+ siderbarDivId)).each(function () { - var hparentId = $(this).attr("hparentId"); - var parentMenu = $('a[id = ' + hparentId + ']', $('#' + megaBarDivId)); - var oldAHref = parentMenu.attr("href"); - if (oldAHref == null || oldAHref.trim() == "#" || oldAHref == "javascript") { - var hrefMenu = $(this); - //竖菜单的第一级有可能是虚菜单,则找这个虚节点下面的第一个有href的菜单 - if( $(this).attr('href') == null || $(this).attr('href') == "#" || $(this).attr('href') == "javascript:;"){ - $('a[href]', $(this).parent().children('ul')).each(function () { - hrefMenu = $(this); - if (hrefMenu != null && hrefMenu != "#" && hrefMenu != "javascript") { - return false; //跳出循环 - } - }) - } - parentMenu.attr("href", hrefMenu.attr("href")); - parentMenu.attr("shiftjs", hrefMenu.attr("shiftjs")); - parentMenu.attr("cachenum", hrefMenu.attr("cachenum")); - parentMenu.attr("iframeName", hrefMenu.attr("iframeName")); - parentMenu.attr("xdomain", hrefMenu.attr("xdomain")); - parentMenu.attr("cssSrc", hrefMenu.attr("cssSrc")); - parentMenu.attr("category", hrefMenu.attr("category")); - parentMenu.attr("breadcrumgroupbuttonsrc", hrefMenu.attr("breadcrumgroupbuttonsrc")); - parentMenu.attr("operation", hrefMenu.attr("operation")); - parentMenu.attr("iframeautoscroll", hrefMenu.attr("iframeautoscroll")); - } - }); -} -function FMenuAuthentication(megaBarDivId , siderbarDivId){ - var beforeHparentId = {}; - $('a[hparentid]', $('#'+ siderbarDivId)).each(function(){ - var parentid = $(this).attr("hparentid"); - beforeHparentId[parentid] = 1; - }); - checkFmenuRightByAttr('licenseid' , megaBarDivId , siderbarDivId , getLcsRight); - checkFmenuRightByAttr('operation' , megaBarDivId , siderbarDivId, getAllOperCodeRights); - rebuildSiderBarMenu(); - var afterHparentId={}; - $('a[hparentid]', $('#'+ siderbarDivId)).each(function(){ - var parentid = $(this).attr("hparentid"); - afterHparentId[parentid] = 1; - }); - //比较鉴权前后的父菜单差异,如果这个父菜单自己没有href属性,且鉴权后,所有的子菜单都没有权限,那么这个父菜单需要从界面上去掉 - for( var parentid in beforeHparentId ){ - if( afterHparentId[parentid] == null ){ - var parent = $('#'+ parentid , $('#'+ megaBarDivId)); - if(parent.attr('href') == null || parent.attr('href') == "javascript:;" || parent.attr('href') == "#"){ - parent.parent().remove(); - } - } - } -} -function checkFmenuRightByAttr( attrName, megaBarDivId , siderbarDivId ,callback ){ - // license 鉴权 - var menuids = new Array(); - var parentMenuId = new Array(); - var operations = new Array(); - //从页面DOM取得菜单license项。 - $('a['+ attrName+']', $('#'+ siderbarDivId)).each(function () { - var attrValue = $(this).attr(attrName); - if (attrValue) { - operations.push(attrValue); - var id = $(this).attr("id"); - menuids.push({'id':id }); - } - }); - var rights = callback(operations);// 取得license数据。 - if (rights && (rights.length == menuids.length)) { - // 根据后台license值判断所在菜单项是否显示 - for (var i = 0; i < menuids.length; i++) { - var id = menuids[i].id; - var hparentId =menuids[i].hParentId; - var key = operations[i]; - var item = rights[i]; - // 菜单项如果配了licenseid, 并且不是true字符串, 则移除菜单项 - if (item.value != "True") { - $('#'+id, $('#'+ siderbarDivId)).parent().remove(); - } - } - } -} -// “更多操作”分组按钮鉴权 -function groupButtonAuthentication() { - // license 鉴权 - var menuids = new Array(); - var lcsoperations = new Array(); - //从页面DOM取得菜单license项。 - $('a[licenseid]', $('.more-botton-zone > li.btn-group')).each(function () { - var licenseid = $(this).attr("licenseid"); - if (licenseid) { - lcsoperations.push(licenseid); - var id = $(this).attr("id"); - menuids.push(id); - } - }); - var lcsrights = getLcsRight(lcsoperations);// 取得license数据。 - if (lcsrights && (lcsrights.length == menuids.length)) { - // 根据后台license值判断所在菜单项是否显示 - for (var i = 0; i < menuids.length; i++) { - var id = menuids[i]; - var lcskey = lcsoperations[i]; - var lcsitem = lcsrights[i]; - // 菜单项如果配了licenseid, 并且不是true字符串, 则移除菜单项 - if (lcsitem.value != "True") { - $('#'+id, $('.more-botton-zone > li.btn-group')).parent().remove(); - } - } - } - // 增加mysql判断,如果数据库为mysql,去掉基础数据备份功能菜单项 - var dbType = ZteFrameWork_conf.dbType; - if (dbType == "mysql") { - $("#uep-ict-backup-baseDataBack",$('.more-botton-zone > li.btn-group')).parent().remove(); - } - var operations = new Array(); - $('a[operation]', $('.more-botton-zone > li.btn-group')).each(function () { - var operation = $(this).attr("operation"); - if (operation) { - operations.push(operation); - } - }); // 遍历菜单项,提取所有的操作码 - var rightObj = getAllOperCodeRights(operations); // 对操作码进行鉴权判断 - $('a[operation]', $('.more-botton-zone > li.btn-group')).each(function () { - var operation = $(this).attr("operation"); - if (operation) { - if (!hasRight(operation, rightObj)) { - $(this).parent("li").remove(); // 删除没有权限的菜单项 - } - } - }); - // 如果“更多菜单”下没有子菜单了,则删除整个“更多菜单”下拉框。 - if ($('li > a', $('.more-botton-zone > li.btn-group')).length == 0) { - $('.more-botton-zone > li.btn-group').remove(); - } -}; -// 删除没有子菜单的一级菜单,查看新菜单是否配了登录默认页面,如没有则指定第一个有权限的菜单作为登录后默认页面 -function rebuildSiderBarMenu() { - if ($('a.start').length == 0) { - $('li > a[href!="javascript:;"]', $('.page-sidebar-menu')).eq(0).addClass("start"); - } - $('ul.sub-menu', $('.page-sidebar-menu')).each(function () { - if ($(this).has('li').length == 0) { - $(this).parent("li").remove(); - } - }); -}; -// 删除没有子菜单的一级菜单,查看新菜单是否配了登录默认页面,如没有则指定第一个有权限的菜单作为登录后默认页面 -function rebuildHorMenu() { - if ($('a.start').length == 0) { - $('li > a[href!="#"]', $('#main_hormenu')).eq(0).addClass("start"); - } - $('ul.mega-menu-submenu', $('#main_hormenu')).each(function () { - if ($(this).has('li > a').length == 0) { - $(this).remove(); // 删空的分组列 - } - }); - //删除增加的分组div - $('div.zteDivWidth', $('#main_hormenu')).each(function () { - if ($(this).has('ul').length == 0) { - $(this).remove(); // 删空的分组列 - } - }); - $('ul.dropdown-menu', $('#main_hormenu')).each(function () { - if ($(this).has('ul').length == 0) { - $(this).parent("li").remove(); // 删空的一级菜单栏 - } - }); - $('li.divider', $('#main_hormenu')).each(function () { - if ($(this).next().hasClass('divider')) { - $(this).remove(); // 连续出现分隔线则删除一个 - } - }); - $('li.divider', $('#main_hormenu')).each(function () { - if ($(this).next().length == 0) { - $(this).remove(); // 如果分隔线在最后一行,则删除之 - } - }); -} -//获取页面菜单栏所有的操作码权限 -function getAllOperCodeRights(operations) { - var rights = new Array(); - if( operations && operations.length > 0 ){ - var data = { - "operations" : operations - }; - var sendData = JSON.stringify(data); - var url=FrameConst.REST_CHECKRIGHT + "?data=" + sendData + "&tmpstamp=" + new Date().getTime(); - url=ZteFrameWork.handlBaseURL(url); - $.ajax({ - "dataType" : 'json', - "type" : "GET", - "async" : false, - "url" : url, - "data" : null, - //"contentType" : 'application/json; charset=utf-8', - "success" : function (response) { - rights = response.value; - }, - "error" : function (XMLHttpRequest, textStatus, errorThrown) { - if (XMLHttpRequest.status == 401) { - window.location.replace("login.html"); - } else { - console.log('Communication Error!'); - } - } - }); - } - return { - opCodes : operations, - rights : rights - }; -}; -// 判断操作码是否有权限 -function hasRight(opCode, rightObj) { - for (var i = 0; i < rightObj.opCodes.length; i++) { - if (rightObj.opCodes[i] == opCode) { - return (rightObj.rights[i] == true); - } - } - return false; -}; -// 处理mysql环境下备份菜单的合并问题 -function dealMysqlBackupMenu() { - var dbType = ZteFrameWork_conf.dbType; - if (dbType !== undefined && dbType !== "mysql") { - return; - } - var sidermenu = $("[class='page-sidebar-menu']"); - var hormenu = $(".hormenu"); - //这段代码先这么写,html的位置不一定正确,如果后面位置不一致,再修改。 - if (sidermenu.length > 0 && $('#uep-ict-backup-dataBackup').length > 0) { - $('#uep-ict-backup-dataBackup', sidermenu).attr("breadcrumGroupButtonSrc", ICTFRAME_CONST_DATABACKUP_PATH); - } - if (hormenu.length > 0 && $('#uep-ict-backup-dataBackup').length > 0) { - $('#uep-ict-backup-dataBackup', hormenu).attr("breadcrumGroupButtonSrc", ICTFRAME_CONST_DATABACKUP_PATH); - $('#uep-ict-backup-dataBackup').parent('li').attr('style', 'display:block'); - $('#uep-ict-backup-allDbStructBackup').parent('li').attr('style', 'display:none'); - $('#uep-ict-backup-baseDataBack').parent('li').attr('style', 'display:none'); - } -}; -// 浏览器缩小后导航栏隐藏的情况下点击navbar-toggle显示菜单的前置工作, -// 浏览器缩小后导航栏隐藏的情况下点击navbar-toggle显示菜单的前置工作, -function dealMavToggle(navtoggle) { - var sidermenu = $("#page-sidebar-menu"); - var hormenu = $("#main_hormenu"); - var panel = $(".zte-theme-panel"); - var siderbarpos = $(".nav-pos-direction", panel).val() - if ("hidden" == $(navtoggle).attr("navtoggledispattr")) { - $(navtoggle).attr("navtoggledispattr", "display"); - sidermenu.css('display','block');//侧边栏显示 - hormenu.css("display", "none");//隐藏水平菜单栏 - } else { - $(navtoggle).attr("navtoggledispattr", "hidden"); - sidermenu.css('display','none');//侧边栏隐藏 - hormenu.css("display", "none"); - } -}; diff --git a/openo-portal/portal-common/src/main/webapp/common/js/core/ZteFrameWork.min.js b/openo-portal/portal-common/src/main/webapp/common/js/core/ZteFrameWork.min.js deleted file mode 100644 index 2b5c041d..00000000 --- a/openo-portal/portal-common/src/main/webapp/common/js/core/ZteFrameWork.min.js +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Copyright 2016, CMCC Technologies Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -String.prototype.trim=function(){return this.replace(/(^\s*)|(\s*$)/g,"")};String.prototype.format=function(){if(0==arguments.length)return this;for(var b=this,d=0;d>0;gb?this.data.seg.path.length+b:b-1;return this.data.seg.path[b]},fsegment:function(b){if("undefined"===typeof b)return this.data.seg.fragment;b=0>b?this.data.seg.fragment.length+b:b-1;return this.data.seg.fragment[b]}}} -var l={a:"href",img:"src",form:"action",base:"href",script:"src",iframe:"src",link:"href",embed:"src",object:"data"},u="source protocol authority userInfo user password host port relative path directory file query fragment".split(" "),q={anchor:"fragment"},I={strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}, -w=/^[0-9]+$/;m.jQuery=function(b){null!=b&&(b.fn.url=function(h){var g="";this.length&&(g=b(this).attr(d(this[0]))||"");return m(g,h)},b.url=m)};m.jQuery(window.jQuery);return m});ZteFrameWork_conf={userName:store.get("username"),changePassItem:FrameConst.change_pass?FrameConst.change_pass:!0,helpMenuItem:!1,aboutMenuItem:!1,flightMenuItem:!1,fullscreenMenuItem:!1,logoutMenuItem:!0,defaultThemeColor:"ztebluelight2",dbType:"other",acceptLanguage:"zh-CN"};$("#currentUser").html(ZteFrameWork_conf.userName); -$.ajax({url:FrameConst.REST_FRAMECOMMIFO,type:"GET",cache:!1,contentType:"application/json; charset=utf-8",success:function(b){b.helpMenuItem&&""!=b.helpMenuItem&&(ZteFrameWork_conf.helpMenuItem=b.helpMenuItem);b.aboutMenuItem&&""!=b.aboutMenuItem&&(ZteFrameWork_conf.aboutMenuItem=b.aboutMenuItem);b.flightMenuItem&&""!=b.flightMenuItem&&(ZteFrameWork_conf.flightMenuItem=b.flightMenuItem);b.fullscreenMenuItem&&""!=b.fullscreenMenuItem&&(ZteFrameWork_conf.fullscreenMenuItem=b.fullscreenMenuItem);b.logoutMenuItem&& -""!=b.logoutMenuItem&&(ZteFrameWork_conf.logoutMenuItem=b.logoutMenuItem);b.defaultThemeColor&&""!=b.defaultThemeColor&&(ZteFrameWork_conf.defaultThemeColor=b.defaultThemeColor);b.dbType&&""!=b.dbType&&(ZteFrameWork_conf.dbType=b.dbType);b.acceptLanguage&&""!=b.acceptLanguage&&(ZteFrameWork_conf.acceptLanguage=b.acceptLanguage);b.changePassItem&&""!=b.changePassItem&&(ZteFrameWork_conf.changePassItem=b.changePassItem);setFrameWorkByConf()},error:function(b){setFrameWorkByConf()}}); -function setThemeColor(b){var d=$(".zte-theme-panel");$(".theme-colors > ul > li",d).each(function(){var d=$(this).attr("data-style");d==b&&($(this).addClass("current"),$("#style_color").attr("href","css/themes/"+d+".css"),store("style_color",d))})} -function setFrameWorkByConf(){var b=ZteFrameWork_conf.helpMenuItem,d=ZteFrameWork_conf.aboutMenuItem,h=ZteFrameWork_conf.flightMenuItem,k=ZteFrameWork_conf.fullscreenMenuItem,g=ZteFrameWork_conf.logoutMenuItem,n=ZteFrameWork_conf.changePassMenuItem;b&&"false"!==b||$("#uep_ict_help_url").parent("li").remove();d&&"false"!==d||$('[data-target="#aboutDlg"]').parent("li").remove();b||d||$("#uep_ict_help_div").remove();h&&"false"!==h||$("#header_notification_bar").html("
      
"); -k&&"false"!==k||$("#trigger_fullscreen_div").html("");g&&"false"!==g||$("#trigger_logout_div").html("");(!k&&!g||"false"===k&&"false"===g)&&$("#full_logout_divider").css("display","none");n||($("#changePwd_labellink").css("display","none"),$("#full_logout_divider").css("display","none"));b=ZteFrameWork_conf.defaultThemeColor;d=$(".zte-theme-panel");$("ul > li",d).removeClass("current");store&&!store("style_color")?setThemeColor(b):setThemeColor(store("style_color"))} -function Hashtable(){this._hash={};this._count=0;this.add=function(b,d){if(this._hash.hasOwnProperty(b))return!1;this._hash[b]=d;this._count++;return!0};this.hash=function(){return this._hash};this.remove=function(b){delete this._hash[b];this._count--};this.count=function(){return this._count};this.items=function(b){if(this.contains(b))return this._hash[b]};this.contains=function(b){return this._hash.hasOwnProperty(b)};this.clear=function(){this._hash={};this._count=0};this.replace=function(b,d){this.contains(b)&& -this.remove(b);return this.add(b,d)}} -var fMenuSiderDivId="page-f-sidebar-menu",fMenuMegaDivId="f_hormenu",megaSiderDivId="page-megachild-sidebar-menu",megaDivId="main_hormenu",zteframework_menu_horizontal="horizontal",zteframework_menu_vertical="vertical",zteframework_menu_fmenu="fmenu",zteframework_showNav="true",zteframework_smallView=960,ZteFrameWork=function(){var b=getLanguage(),d=!1,h=function(){try{return document.createEvent("TouchEvent"),!0}catch(c){return!1}},k=!h,g=!1,n=!1,m=!1,l="",u=225,q=35,I=[],w=new Hashtable,x=new Hashtable, -C=new Hashtable,V=new Hashtable,y="page-mainIframe",J="",v="",D=!1,ca={blue:"#4b8df8",red:"#e02222",green:"#35aa47",purple:"#852b99",grey:"#555555","light-grey":"#fafafa",yellow:"#ffb848",ztebluelight:"#3366cc"},G=function(){var c=window,t="inner";"innerWidth"in window||(t="client",c=document.documentElement||document.body);return{width:c[t+"Width"],height:c[t+"Height"]}},va=function(){var c=getUrlParam("menu");switch(c?c:0){case "1":l=$("#com_zte_ums_ict_framework_ui_page_title_1").text().trim(); -break;case "2":l=$("#com_zte_ums_ict_framework_ui_page_title_2").text().trim();break;case "3":l=$("#com_zte_ums_ict_framework_ui_page_title_3").text().trim();break;default:l=$("#com_zte_ums_ict_framework_ui_page_title").text().trim()}"rtl"===$("body").css("direction")&&(d=!0);g=!!navigator.userAgent.match(/MSIE 8.0/);n=!!navigator.userAgent.match(/MSIE 9.0/);(m=!!navigator.userAgent.match(/MSIE 10.0/))&&$("html").addClass("ie10");(m||n||g)&&$("html").addClass("ie");navigator.userAgent.toLowerCase().match(/(iphone|ipod|ipad)/)? -($(document).on("focus","input, textarea",function(){$(".page-header").hide();$(".page-footer")&&0<$(".page-footer").length&&$(".page-footer").hide()}),$(document).on("blur","input, textarea",function(){$(".page-header").show();$(".page-footer")&&0<$(".page-footer").length&&$(".page-footer").show()})):($(document).on("focus","input, textarea",function(){$(".page-footer")&&0<$(".page-footer").length&&$(".page-footer").hide()}),$(document).on("blur","input, textarea",function(){$(".page-footer")&&0< -$(".page-footer").length&&$(".page-footer").show()}))},F=function(c){$(".page-loading").remove();$("body").append('
  '+(c?c:$.i18n.prop("com_zte_ums_ict_framework_ui_loading"))+"
")},da=function(){G().widthm&&(m=c.length,l=c)});h=h+getStringWidth(l,14)+94.5}h+H>c?(console.log("ajust class dropdown-menu-right ,id = "+b.attr("id")),d.addClass("dropdown-menu-right")):d.removeClass("dropdown-menu-right")}},B=function(c){var t=$(".page-content"),f=$(".page-content-body"),b=$(".page-sidebar"),d=$("body"),g,h=G(),l=Math.min(window.screen.availHeight,h.height)-5,z=$(".footer"), -m=$(".page-breadcrumb"),n=$("#pageableDiv");console.log("pageableDiv height:"+n.outerHeight(!0));var u=$(".header");"isc"===(x.items(y)?x.items(y).childpageType:"")&&$(".sidebar-option",panel).val("fixed");var r=ZteFrameWork.getLocationURLParameter("showNav");"false"==r&&(zteframework_showNav=r,ha(),ia());r=l-(!z||0>=z.length?0:z.outerHeight(!0))-u.outerHeight(!0);n=!n||0>=n.length||!1==n.is(":visible")?0:n.outerHeight(!0);f=l-u.outerHeight(!0)-(!z||0>=z.length||!1==z.is(":visible")?0:z.outerHeight(!0))- -m.outerHeight(!0)-n-(f.outerHeight(!0)-f.height());m=""==y?"page-mainIframe":y;if((n=$(".page-content .page-content-body ."+m))&&0f?b.height():f;b.attr("style",q);if(!k){q=f;try{q=n.contents().height()}catch(Ja){}f=q>f?q:f}x.items(m).setMinHeight&& -(n=Math.min(l,f),console.log("pym:parent iframe "+m+" window.screen.availHeight:"+l+" viewport.height:"+h.height+" h:"+f+" minHeight:"+n),x.items(m).setMinHeight(n))}!0===d.hasClass("page-footer-fixed")&&!0===d.hasClass("page-sidebar-fixed")?t.height()=z.length?0:z.outerHeight(!0),1024<$(window).width()&&g+b+z=zteframework_smallView?(ga(),"none"!=$(".page-sidebar-menu li").css("display")&&$("body").hasClass("page-sidebar-closed")&&$(".sidebar-toggler").hasClass("close-by-viewportChange")&&(c||$(".sidebar-toggler")[1].click(),$(".sidebar-toggler").removeClass("close-by-viewportChange"))):ga(!0)},ya=function(c){var t;if(0      ")},Aa=function(c){var b=$(".zte-theme-panel"),b=$(".nav-pos-direction",b).val(),f=null,p=null;"vertical"===b?(f=$("#"+c.attr("id"),$("#main_hormenu")),p=$(".header ul")):"horizontal"===b?(f=za(c),ka(c,megaSiderDivId),p=f[0],f=f[1]):b===zteframework_menu_fmenu&&ka(c,fMenuSiderDivId);p&&(p.children("li.active").removeClass("active"),p.find(".arrow.open").removeClass("open"));f&&(f.parents("li").each(function(){$(this).addClass("iframe active"); -$(this).find("a > span.arrow").addClass("open")}),f.parents("li").addClass("active"),"horizontal"===b&&f.parent().parent().parent().is("li")&&$(".arrow",f.parent().parent().parent()).addClass("open"))},za=function(c){targetsource=$("#"+c.attr("id"),$("[class='page-sidebar-menu']"));targetContainer=$("#page-sidebar-menu ul");$("li.open",targetContainer).each(function(){$("ul.sub-menu",this).attr("style")&&($("ul.sub-menu",this).removeAttr("style"),$(this).removeClass("open"))});if(0<=c.parent().parent().parent().parent().attr("class").indexOf("page-sidebar-menu")){c= -$("#"+c.attr("id"),$("#main_hormenu"));var b=$(".header ul");b.children("li.active").removeClass("active");b.find(".arrow.open").removeClass("open");c.parents("li").each(function(){$(this).addClass("iframe active");$(this).find("a > span.arrow").addClass("open")});c.parents("li").addClass("active")}return[targetContainer,targetsource]},ka=function(c,b){var f=$("#"+b);if(R)R=!1;else if($(c).parents("li").hasClass("mega-menu-dropdown")){var p=c.attr("id");$("#"+b+">li").hide();var d=$("a[hparentid= "+ -p+"]",f).parent();d.show();0li.sidebar-toggler-wrapper").show();0<$("a[hparentid= "+p+"]",f).length?la(c,b):(f.css("display","none"),$("body").addClass("page-full-width"),$(".page-content").css("marginLeft",u))}else"true"==zteframework_showNav&&($("#"+b+">li").hide(),p=$(c).parents("li"),p=p.eq(p.length-1).children("a").attr("hparentid"),d=$("a[hparentid="+p+"]",f).parent(),d.show(),0li.sidebar-toggler-wrapper").show(),la(c,b))},la=function(c,b){var f=$("#"+ -b);f.css("display","block");$("ul.sub-menu",f).css("display","block");$(".arrow",f).addClass("open");$("body").removeClass("page-full-width");$("body").hasClass("page-sidebar-closed")?$(".page-content").css("marginLeft",q):$(".page-content").css("marginLeft",u);var p=c.attr("href");$("li.iframe",f).removeClass("active");f=$("a[href ='"+p+"']",f).parent();f.addClass("active");f.parent().parent().addClass("open").addClass("active");f.parent().css("display","block");f.parent().parent().children("a").children(".arrow").addClass("open")}, -Z=function(c,b,f){var p=c.attr("href");if(p&&!(2>p.length)){b.preventDefault();D||(D=!0,p=c.parents("li").last(),p.hasClass("open")||Y(p.children("a:eq(0)")));f&&0 span.arrow").addClass("open")});c.parents("li").addClass("active");Aa(c);f&&0=$(window).width()&&$("."+f).hasClass("in")&&$(".navbar-toggle").click();if(dealMultTabPage(c))return!0; -f=b.data&&b.data.breadcrumbBtnMenuItem&&0p.length||(b.preventDefault(),D||(D=!0,b=c.parents("li").last(),Y(b.children("a:eq(0)"))),f&&0 span.arrow").addClass("open")}),c.parents("li").addClass("active"),f&&0=$(window).width()&&$("."+f).hasClass("in")&&$(".navbar-toggle").click())},S=function(c,b){function f(c,b,f,t,d,p,g){c=new pym.Parent(c,b,{xdomain:p});c.iframe.id=f;c.iframe.name=t;c.iframe.setAttribute("class",d);c.iframe.setAttribute("allowfullscreen","");c.iframe.setAttribute("mozallowfullscreen","");c.iframe.setAttribute("oallowfullscreen","");c.iframe.setAttribute("msallowfullscreen",""); -c.iframe.setAttribute("webkitallowfullscreen","");c.iframe.setAttribute("onload",'ZteFrameWork.SyncCSS(this,0,"'+m+'");ZteFrameWork.stopPageLoading();');x.replace(f,c);c.onMessage("height",function(c){console.log("The frame "+f+" receive message height is "+c);var b=$(".page-content .page-content-body ."+f);c=Math.max(this.minHeight,c);b.height(c)});return c}v="";var p=c.attr("href");if(p&&!(2>p.length)){var p=ZteFrameWork.handlBaseURL(p),d=c.attr("category");if(d&&0=$("#"+g).length&&u.append("
"),F(),pymParent=f(g,p,d,d,d,_xdomain,l),g=$(pymParent.iframe),0 a",function(c){!1==$(this).next().hasClass("sub-menu")?!1==$(".btn-navbar").hasClass("collapsed")&&$(".btn-navbar").click():$(this).next().hasClass("sub-menu always-open")||(Y($(this)),c.preventDefault())});$(".page-sidebar").on("click"," li > a.iframe",function(c){c.preventDefault();var b=$(this).attr("id");b&&0 a.iframe",function(c){2> -$(this).attr("href").length||(c.preventDefault(),L($(this),c))});$("#pageableDiv").on("click"," div > a.iframe",function(c){2>$(this).attr("href").length||(c.preventDefault(),L($(this),c))});$("#pageableDiv").on("click"," li > a.iframe",function(c){if(!(2>$(this).attr("href").length)){c.preventDefault();if(c.target){var b=$("span",c.target),b=0div>span",c.target.parentNode.parentNode.parentNode.parentNode.parentNode).replaceWith(b.outerHTML)}L($(this),c)}});$(".dropdown").on("click", -" li > a.iframe",function(c){2>$(this).attr("href").length||(c.preventDefault(),F(),S($(this),c),M($(this),!1,c))})},ma="",T=!0,U=null,aa=function(c,b){if(!(2>c.length))if(c=ZteFrameWork.handlBaseURL(c),ma==c)if(!0===b)$("#pageableDiv").show();else{if(b&&b.target&&b.currentTarget){var f=$(b.target).attr("defaultDisplay");(f=f?f:$(b.currentTarget).attr("defaultDisplay"))&&"false"==f.trim()?$("#pageableDiv").hide():$("#pageableDiv").show()}}else{ma=c;clearMoreOperations();var d=b&&b.data&&b.data.breadcrumbBtnMenuItem&& -0=d.length?b&&b.breadcrumbBtnMenuItem&&0');g.children().remove();g.append(f);var h=$(".dropdown-menu",g).attr("displayType");if(h&&"pageableDiv"!=h)$(".more-botton-zone").append(f), -$("#pageableDiv").hide();else{var k=$(".dropdown-menu",g);if(0f.length)f=$(".page-content a[id='"+d+"']");if(0"+$.i18n.prop("com_zte_ums_ict_framework_ui_loadmenuerror")+"");T=!0}})}};dealMultTabPage=function(c){var b=c.attr("href");if(b&&!(2>b.length)){var f= -c.attr("redirect");if(f&&0",b),c=E.substring(0,b)+""):c=void 0,ba="";else{for(;g&&0
"+c),g.parent("ul").attr("id")==fMenuSiderDivId||g.parent("ul").attr("id")==megaSiderDivId?(g=g.children("a").attr("hparentid"),h==zteframework_menu_horizontal?magaMenu=$("#"+megaDivId):h==zteframework_menu_fmenu&&(magaMenu=$("#"+fMenuMegaDivId)),g=$("a[id="+g+"]",magaMenu).parent("li")):g=g.parents("li"));g[0]&&0"+c)}d.empty();$(".more-botton-zone").empty();E=c;store("globleCurrentBreadcrumb",E);d.append(c);k&&0"+f);d=d.parents("li")}d[0]&&0"+f);g&&0'+ -f);f=E+f;b.append(f)},R=!1,L=function(c,b){var f=c.attr("id");f&&0=$(".footer").length)?0:$(".footer").outerHeight());return c},X= -function(){var c=$(".page-sidebar-menu");1===c.parent(".slimScrollDiv").size()&&(c.removeAttr("style"),$(".page-sidebar").removeAttr("style"));0===$(".page-sidebar-fixed").size()?B():G().width>=zteframework_smallView&&(ja(),B())},pa=function(){!1!==$("body").hasClass("page-sidebar-fixed")&&($(".page-sidebar").off("mouseenter").on("mouseenter",function(){Da()}),$(".page-sidebar").off("mouseleave").on("mouseleave",function(){Ea()}))},Da=function(){var c=$("body"),b=$(".page-sidebar");!1===c.hasClass("page-sidebar-closed")|| -!1===c.hasClass("page-sidebar-fixed")||$(this).hasClass("page-sidebar-hovering")||(c.removeClass("page-sidebar-closed").addClass("page-sidebar-hover-on"),$(".sidebar-toggler"),c.hasClass("page-sidebar-reversed")?b.width(u):(b.addClass("page-sidebar-hovering"),b.animate({width:u},350,"",function(){b.removeClass("page-sidebar-hovering")})))},Ea=function(){var c=$("body");if(!1!==c.hasClass("page-sidebar-hover-on")&&!1!==c.hasClass("page-sidebar-fixed")&&!$(this).hasClass("page-sidebar-hovering")){var b= -$(".page-sidebar"),f=$(".sidebar-toggler");c.hasClass("page-sidebar-reversed")?(c.addClass("page-sidebar-closed").removeClass("page-sidebar-hover-on"),b.width(q),f&&f.removeAttr("style")):(b.addClass("page-sidebar-hovering"),b.animate({width:q},350,"",function(){c.addClass("page-sidebar-closed").removeClass("page-sidebar-hover-on");b.removeClass("page-sidebar-hovering");f&&f.removeAttr("style")}))}},K=function(c,b,f,d){var g=c.attr("style")?c.attr("style"):"";styles=g.split(";");var h="";for(i=0;i< -styles.length;i++)if(0<=styles[i].indexOf(b)){h=styles[i];break}g=0=zteframework_smallView&&$("body").addClass("page-sidebar-closed");$(".page-sidebar, .sidebar-toggler").on("click",".sidebar-toggler",function(c){c.preventDefault();c=$("body");$(".page-sidebar");c.hasClass("page-sidebar-closed")&&$(this).removeAttr("style")});$(".page-sidebar, .header").on("click", -".sidebar-toggler",function(c){var b=$("body"),d=$(".page-sidebar");b.hasClass("page-sidebar-hover-on")&&b.hasClass("page-sidebar-fixed")||d.hasClass("page-sidebar-hovering")?(b.removeClass("page-sidebar-hover-on"),d.css("width","").hide().show(),B(),A("sidebar_closed","0"),c.stopPropagation()):($(".sidebar-search",d).removeClass("open"),c=$(".zte-theme-panel"),$(".sidebar-pos-option",c).val(),c=$("[class='page-content']"),b.hasClass("page-sidebar-closed")?(b.removeClass("page-sidebar-closed"),b.hasClass("page-sidebar-fixed")&& -d.css("width",""),A("sidebar_closed","0"),c.css("marginLeft",u)):(b.addClass("page-sidebar-closed"),$(this).removeAttr("style"),A("sidebar_closed","1"),c.css("marginLeft",q)),B(!0));W()})},Ga=function(){$(".header").on("click",".hor-menu .hor-menu-search-form-toggler",function(c){$(this).hasClass("off")?($(this).removeClass("off"),$(".header .hor-menu .search-form").hide()):($(this).addClass("off"),$(".header .hor-menu .search-form").show());c.preventDefault()});$(".header").on("click"," li > a.iframe", -function(c){c.preventDefault();var b=$(this).attr("id");b&&0')})},qa=function(){var c=0;return setInterval(function(){var b;null==b&& -(b=ZteFrameWork_conf.userName);b=FrameConst.REST_HEARTBEAT+"?username="+encodeURIComponent(b);$.ajax(b,{dataType:"text",cache:!1}).done(function(b){"true"==b&&(c=0)});c++;6<=c&&(disableHeartbeat(),bootbox.alert($.i18n.prop("com_zte_ums_aos_framework_ui_heartbeat_fail"),function(){window.location.replace("login.html")}))},1E4)};if(FrameConst.do_heartbeat)var O=qa();window.enableHeartbeat=function(){return O?"Already enabled!":(heartBeatTimes=0,O=qa(),"Enabled")};window.disableHeartbeat=function(){return O? -(clearInterval(O),O=null,"Disabled"):"Already disabled!"};window.doLogout=function(){window.location=FrameConst.REST_LOGOUT};$("#trigger_logout").click(function(){bootbox.confirm($.i18n.prop("com_zte_ums_ict_framework_ui_confirmlogout"),function(c){c&&doLogout()})});var P=!1,Ha=function(){function c(){if(screenfull.supportsFullScreen)screenfull.isFullScreen?screenfull.exitFullScreen():screenfull.requestFullScreen(),P=screenfull.isFullscreen;else if(isIE&&"undefined"!==typeof window.ActiveXObject){var c= -new ActiveXObject("WScript.Shell");null!==c&&(c.SendKeys("{F11}"),P=!P)}else P=screenfull.supportsFullScreen;setTimeout(function(){P?$("#fullscreen_label").text($.i18n.prop("com_zte_ums_ict_framework_ui_group_exitfullscreen")):$("#fullscreen_label").text($.i18n.prop("com_zte_ums_ict_framework_ui_group_fullscreen"))},500)}$("#trigger_fullscreen").click(function(){c()})},ra=function(c){if(0 .theme-options").show()});$(".toggler-close",c).click(function(){$(".toggler").show();$(".toggler-close").hide();$(".zte-theme-panel > .theme-options").hide()}); -$(".theme-colors > ul > li",c).click(function(){var b=$(this).attr("data-style");d(b);$("ul > li",c).removeClass("current");$(this).addClass("current")});$(".layout-option,.header-option, .sidebar-option, .footer-option, .sidebar-pos-option, .nav-pos-direction",c).change(function(){ta()});void 0!=Q("style_color")&&d(Q("style_color"));$(".language-option",c).change(function(){var b=$(".language-option",c).val();A("language-option",b);window.location.reload()})},ta=function(){var c=$(".zte-theme-panel"), -b=$(".layout-option",c).val(),f=$(".language-option",c).val(),d=$(".header-option",c).val(),g=$(".footer-option",c).val(),h=$(".nav-pos-direction",c).val();var k=$(".zte-theme-panel");if("disabled"!=$(".nav-pos-direction",k).attr("disabled")){var l=$("#page-sidebar-menu"),m=$("#main_hormenu"),l=$("#page-sidebar-menu"),m=$("#main_hormenu"),n=$("#"+megaSiderDivId),v=$("#"+fMenuMegaDivId),w=$("#"+fMenuSiderDivId),r=$("[class='page-content']");l&&0 .header-inner").removeClass("container");1===$(".page-container").parent(".container").size()&&$(".page-container").insertAfter("body > .clearfix");1===$(".footer > .container").size()?$(".footer").html($(".footer > .container").html()):1===$(".footer").parent(".container").size()&&$(".footer").insertAfter(".page-container");$("body > .container").remove();"boxed"===b&&($("body").addClass("page-boxed"),$(".header > .header-inner").addClass("container"),$("body > .clearfix").after('
'), -$(".page-container").appendTo("body > .container"),"fixed"===g?$(".footer").html('
'+$(".footer").html()+"
"):$(".footer").appendTo("body > .container"));sa!=b&&W();sa=b;"fixed"===d?($("body").addClass("page-header-fixed"),$(".header").removeClass("navbar-static-top").addClass("navbar-fixed-top")):($("body").removeClass("page-header-fixed"),$(".header").removeClass("navbar-fixed-top").addClass("navbar-static-top"));!1===$("body").hasClass("page-full-width")&&("fixed"=== -k?$("body").addClass("page-sidebar-fixed"):$("body").removeClass("page-sidebar-fixed"));"fixed"===g?$("body").addClass("page-footer-fixed"):$("body").removeClass("page-footer-fixed");ZteFrameWork.isRTL()?"left"===l?($("body").addClass("page-sidebar-reversed"),$("#frontend-link").tooltip("destroy").tooltip({placement:"right"})):(c=$("[class='page-content']"),c.css("marginLeft",0),$("body").removeClass("page-sidebar-reversed"),$("#frontend-link").tooltip("destroy").tooltip({placement:"left"})):"right"=== -l?(c=$("[class='page-content']"),c.css("marginLeft",0),$("body").addClass("page-sidebar-reversed"),$("#frontend-link").tooltip("destroy").tooltip({placement:"left"})):($("body").removeClass("page-sidebar-reversed"),$("#frontend-link").tooltip("destroy").tooltip({placement:"right"}));B();X();pa();A("layout-option",b);A("language-option",f);A("header-option",d);A("sidebar-option",k);A("sidebar-pos-option",l);A("nav-pos-direction",h)},A=function(c,b){store&&store(c,b)},Q=function(c){if(store)return store(c)}, -N=function(c){location.hash="#_"+c},ua=function(c,b,f,d){var g=$.url(ZteFrameWork.getCurrentScript(document)).attr("directory")+"proxy/proxy.html",g=$(''),h=$("#ifm_Proxy");h.hide();var k=$(".page-content .page-content-body"),l=[],m=[],n=[],q="";for(i=0;i=h.length?(g.appendTo(k),g.one("load",c,function(c){var b={iFrame:c.data.iFrame,cssLinktyps:c.data.cssLinktyps,cssLinksrcs:c.data.cssLinksrcs,cssLinkids:c.data.cssLinkids,flag:d};$("#ifm_Proxy")[0].contentWindow.postMessage(b, -c.data.origin)})):h.attr("oldproxyorigin")!=b?(h.attr("src",""),h.attr("oldproxyorigin",b),h.one("load",c,function(c){var b={iFrame:c.data.iFrame,cssLinktyps:c.data.cssLinktyps,cssLinksrcs:c.data.cssLinksrcs,cssLinkids:c.data.cssLinkids,flag:d};$("#ifm_Proxy")[0].contentWindow.postMessage(b,c.data.origin)}),h.attr("src",g.attr("src"))):h[0].contentWindow.postMessage({iFrame:c.iFrame,cssLinktyps:c.cssLinktyps,cssLinksrcs:c.cssLinksrcs,cssLinkids:c.cssLinkids,flag:d},c.origin)};return{init:function(){zte_http_headers&& -store("zte_http_headers",zte_http_headers);va();xa();wa();ra(!0);C.clear();X();pa();Ca();Ga();Fa();Ia();ta();$(function(){$(window).on("hashchange",function(){var c=location.hash.replace("#_","");if(c&&0f.length)f=$(".page-content a[id='"+c+"']")}else d=== -zteframework_menu_horizontal?(f=$("#main_hormenu a[id='"+c+"']"),0==f.length&&(f=$("#page-megachild-sidebar-menu a[id='"+c+"']"))):d===zteframework_menu_fmenu&&(f=$("#f_hormenu a[id='"+c+"']"),0==f.length&&(f=$("#page-f-sidebar-menu a[id='"+c+"']")));d=!1;if(0=b.length){var h=c;C.contains(h)&&(f="#"+C.items(h),b=$(f))}c=void 0;f&&0');var g=document.createElement("link");g.href=f[0].href;f=null;g.rel="stylesheet";g.type="text/css";g.id="ifram_csssrc";d.push({pos:"head",scope:"all",link:g})}10!=b&&(0<$("#style_color").length&&(g=document.createElement("link"),g.href=$("#style_color")[0].href.replace(".css","_ifrm.css"),g.rel="stylesheet",g.type="text/css",g.id="style_color",d.push({pos:"head",scope:"all",link:g})),0<$("#font_awesome").length&&(f=document.createElement("link"),f.href=$("#font_awesome")[0].href, -f.rel="stylesheet",f.type="text/css",f.id="font_awesome",d.push({pos:"head",scope:"all",link:f})),g=$("script[src*='/pym.']"),g=0c.indexOf("#")&&(c="#"+c),$(c).click()))},goToPortal:function(c){var b=top.location.href;console.log(b); -b=$.url(b);top.location=b.attr("directory")+"uifportal.html#"+c+"/"},goToURLByIDAndNewIPPort:function(b,d,f){V.replace(d.menuCategoryID,{ipPort:d.ipPortStr,ipTitle:d.newTitle});store&&store("menuCategoryID",d.menuCategoryID+"[menuCategoryID]"+d.ipPortStr+"[menuCategoryID]"+(d.newTitle?d.newTitle:""));var g=this.findMenuItemByMenuId(b);if(!g||0>=g.length){var h=this.getMenuItemId_From_MoreMenuRelation(b);if(h&&0div.box",h),!1==h.hasClass("moreButtonSelected")&&h.addClass("moreButtonSelected"),h=$(".item.moreButtonsTag"),0=g.length)f=b,C.contains(f)&&(h=C.items(f),g=this.findMenuItemByMenuId(h)),g&&0=g.length){var k=this.getMenuItemId_From_MoreMenuRelation(b);k&&(g=this.findMenuItemByMenuId(k))}if(store&& -store("globleCurrentBreadcrumb")){E=store("globleCurrentBreadcrumb");for(var l=$("a",$("
"+E+"
")),m,n,q=0;qq;)m=ZteFrameWork.findMenuItemByMenuId(l),l=m.attr("hparentid"),b=m.attr("id"),q++;m.hasClass("active")|| -m.parent().addClass("active")}}else console.log("goToURLByIDAndNewAction():Can't find the menuitem.The menu ID is:"+b+".Please check if the ID or ID cache is correct.");b=void 0;d&&h&&0=d.length)menuItemID=b,C.contains(menuItemID)&&(f="#"+C.items(menuItemID),d=$(f));b=void 0; -f&&0f.length||(d.preventDefault(),(f=b.attr("id"))&&0b.length)){b=ZteFrameWork.handlBaseURL(b);ZteFrameWork.startPageLoading();var d=$("#page-sidebar-menu");d.empty();d.append("");$.ajax({type:"GET",cache:!1,url:b,dataType:"html",success:function(b){var k=stripHtmlScripts(b);d.append(k);runHtmlScripts(b);siderBarMenuAuthentication();dealMysqlBackupMenu();setTimeout(function(){ZteFrameWork.stopPageLoading();goToHomePage()}, -1E3)},error:function(b,d,g){}})}} -var setLayoutValueByCookie=function(){var b=$(".zte-theme-panel");void 0!=store("layout-option")&&$(".layout-option",b).val(store("layout-option"));void 0!=store("language-option")&&$(".language-option",b).val(store("language-option"));void 0!=store("sidebar-option")&&$(".sidebar-option",b).val(store("sidebar-option"));void 0!=store("header-option")&&$(".header-option",b).val(store("header-option"));void 0!=store("sidebar-pos-option")&&$(".sidebar-pos-option",b).val(store("sidebar-pos-option"));$("[class='nav-load-error']", -$(".hormenu"));$("[class='nav-load-error']",$("[class='page-sidebar-menu']"));$(".nav-pos-direction",b).val("fmenu")}; -function getHorMenu(b){setLayoutValueByCookie();2>b.length||(b=ZteFrameWork.handlBaseURL(b),ZteFrameWork.startPageLoading(),$("#main_hormenu").empty(),$.ajax({type:"GET",async:!1,cache:!1,url:b,dataType:"html",success:function(b){var h=stripHtmlScripts(b);$("#main_hormenu").append(h);runHtmlScripts(b);"mysql"==ZteFrameWork_conf.dbType&&$(".hor-menu a[id='uep-ict-backup-baseDataBack']").parent().remove();horMenuAuthentication("main_hormenu");ZteFrameWork.stopPageLoading();"horizontal"===$(".nav-pos-direction", -panel).val()&&setTimeout(function(){},150)},error:function(b,h,k){$("[class='page-content']");$(".nav-pos-direction",panel).attr("disabled",!0)}}))} -function getMegaFMenu(b){if(!(2>b.length)){b=ZteFrameWork.handlBaseURL(b);ZteFrameWork.startPageLoading();var d=$("#"+megaSiderDivId);d.empty();d.append("");$.ajax({type:"GET",async:!1,cache:!1,url:b,dataType:"html",success:function(b){var k=stripHtmlScripts(b);d.append(k);runHtmlScripts(b);FMenuAuthentication(megaDivId,megaSiderDivId);rebuildHorMenu();ajustFMenu(megaDivId,megaSiderDivId);ZteFrameWork.stopPageLoading()}, -error:function(b,d,g){}})}}function iniHorMenu(){var b=$("#main_hormenu");b&&((b=b.attr("menuSrc"))&&0b.length||2>d.length)){b=ZteFrameWork.handlBaseURL(b);d=ZteFrameWork.handlBaseURL(d);ZteFrameWork.startPageLoading();$("#f_hormenu").empty();$("#page-f-sidebar-menu").empty();$.ajax({type:"GET",async:!1,cache:!1,url:b,dataType:"html",success:function(b){var d=stripHtmlScripts(b);$("#f_hormenu").append(d);horMenuAuthentication("f_hormenu");runHtmlScripts(b);dealMysqlBackupMenu();ZteFrameWork.stopPageLoading()},error:function(b,d,h){$("#f_hormenu").append('");$("[class='page-content']");$(".nav-pos-direction",panel).attr("disabled",!0)}});var h=$("#"+fMenuSiderDivId);h.empty();h.append("");$.ajax({type:"GET",cache:!1,url:d,dataType:"html",success:function(b){var d=stripHtmlScripts(b);h.append(d);h.children().css("display","none");runHtmlScripts(b);dealMysqlBackupMenu();FMenuAuthentication(fMenuMegaDivId, -fMenuSiderDivId);ajustFMenu(fMenuMegaDivId,fMenuSiderDivId);ZteFrameWork.stopPageLoading();loadi18n_WebFramework_sideMenu()},error:function(b,d,h){$(".page-f-sidebar-menu").append('")}})}}function iniSidebarMenu(){var b=$("#page-sidebar-menu");b&&(b=b.attr("menuSrc"))&&0b.length||(ZteFrameWork.startPageLoading(),$(".modal-dialog .Changepasswd").empty(),$.ajax({type:"GET",cache:!1,url:b,dataType:"html",success:function(b){$(".modal-dialog .Changepasswd").append(b);ChangePWD.init();ZteFrameWork.stopPageLoading()},error:function(b,h,k){$(".modal-dialog .Changepasswd").append("

"+$.i18n.prop("com_zte_ums_ict_framework_ui_loadchgpwdpageError")+"

")}}))} -function iniChangePWDDlg(){var b=$(".modal-dialog .Changepasswd").attr("dlgsrc");b&&0b.length||(ZteFrameWork.startPageLoading(),$("#headerMenu").empty(),$.ajax({type:"GET",cache:!1,async:!1,url:b,dataType:"html",success:function(b){$("#headerMenu").append(b);ZteFrameWork.stopPageLoading()},error:function(b,h,k){}}))} -function goToHomePage(){if((locationhash=ZteFrameWork.getLocationHash())&&0g.length&&(g=$(".iframe.start",k)),dealStartMenu(g,h,k))}} -var dealStartMenu=function(b,d,h){var k=setInterval(function(){b&&0b.length&&$("a[operation]",h).each(function(){b=$(this);return!1}))},100);handeCtxMenuitem()}; -function handeCtxMenuitem(){$(".page-sidebar ul li a").each(function(){$(this).attr("href")&&"javascript:;"!=$(this).attr("href")&&"#"!=$(this).attr("href")&&$(this).attr("oncontextmenu","return false")});$(".hormenu li a").each(function(){$(this).attr("href")&&"javascript:;"!=$(this).attr("href")&&"#"!=$(this).attr("href")&&$(this).attr("oncontextmenu","return false")})} -function initBaseInfo(){$("#logout_label").text($.i18n.prop("com_zte_ums_ict_framework_ui_group_logout"));$("#fullscreen_label").text($.i18n.prop("com_zte_ums_ict_framework_ui_group_fullscreen"));$("#changePwd_label").text($.i18n.prop("com_zte_ums_ict_framework_ui_changePwd"));$("#com_zte_ums_ict_framework_moudle_about").text($.i18n.prop("com_zte_ums_ict_framework_moudle_about"));$("#com_zte_ums_ict_framework_moudle_help").text($.i18n.prop("com_zte_ums_ict_framework_moudle_help"));$("#zte_menu-toggler").attr("title", -$.i18n.prop("com_zte_ums_ict_framework_moudle_menutoggler"))}window.closeModal=function(b){b&&(0>b.indexOf("#")&&(b="#"+b),$(b).modal("hide"))};function getLcsRight(b){var d=[];if(b&&0 li.btn-group")).each(function(){var g=$(this).attr("licenseid");g&&(d.push(g),g=$(this).attr("id"),b.push(g))});var h=getLcsRight(d);if(h&&h.length==b.length)for(var k=0;k li.btn-group")).parent().remove()}"mysql"==ZteFrameWork_conf.dbType&&$("#uep-ict-backup-baseDataBack",$(".more-botton-zone > li.btn-group")).parent().remove();var n= -[];$("a[operation]",$(".more-botton-zone > li.btn-group")).each(function(){var b=$(this).attr("operation");b&&n.push(b)});var m=getAllOperCodeRights(n);$("a[operation]",$(".more-botton-zone > li.btn-group")).each(function(){var b=$(this).attr("operation");b&&(hasRight(b,m)||$(this).parent("li").remove())});0==$("li > a",$(".more-botton-zone > li.btn-group")).length&&$(".more-botton-zone > li.btn-group").remove()} -function rebuildSiderBarMenu(){0==$("a.start").length&&$('li > a[href!="javascript:;"]',$(".page-sidebar-menu")).eq(0).addClass("start");$("ul.sub-menu",$(".page-sidebar-menu")).each(function(){0==$(this).has("li").length&&$(this).parent("li").remove()})} -function rebuildHorMenu(){0==$("a.start").length&&$('li > a[href!="#"]',$("#main_hormenu")).eq(0).addClass("start");$("ul.mega-menu-submenu",$("#main_hormenu")).each(function(){0==$(this).has("li > a").length&&$(this).remove()});$("div.zteDivWidth",$("#main_hormenu")).each(function(){0==$(this).has("ul").length&&$(this).remove()});$("ul.dropdown-menu",$("#main_hormenu")).each(function(){0==$(this).has("ul").length&&$(this).parent("li").remove()});$("li.divider",$("#main_hormenu")).each(function(){$(this).next().hasClass("divider")&& -$(this).remove()});$("li.divider",$("#main_hormenu")).each(function(){0==$(this).next().length&&$(this).remove()})} -function getAllOperCodeRights(b){var d=[];if(b&&0 ul > li', panel).each(function () { + var color = $(this).attr("data-style"); + if (color == configColor) { + // 匹配上了才重设默认主题 + $(this).addClass("current"); + $('#style_color').attr("href", "css/themes/" + color + ".css"); + //if (store) { + store('style_color', color); + //} + } + }); +}; + +function setFrameWorkByConf(){ + //设置用户相关的框架下拉菜单是否可用 + var helpMenuItem = openoFrameWork_conf.helpMenuItem; + var aboutMenuItem = openoFrameWork_conf.aboutMenuItem; + var flightMenuItem = openoFrameWork_conf.flightMenuItem; + var fullscreenMenuItem = openoFrameWork_conf.fullscreenMenuItem; + var logoutMenuItem = openoFrameWork_conf.logoutMenuItem; + var changePassMenuItem = openoFrameWork_conf.changePassMenuItem; + if (!helpMenuItem || helpMenuItem === "false") { + $('#uep_ict_help_url').parent('li').remove(); + } + if(!aboutMenuItem|| aboutMenuItem === "false"){ + $('[data-target="#aboutDlg"]').parent('li').remove(); + } + if(!helpMenuItem && !aboutMenuItem){ + $('#uep_ict_help_div').remove(); + } + if (!flightMenuItem|| flightMenuItem === "false") { + $('#header_notification_bar').html("
      
"); + } + if (!fullscreenMenuItem|| fullscreenMenuItem === "false") { + //$('#trigger_fullscreen').parent().css("display", "none"); + $('#trigger_fullscreen_div').html(""); + } + if (!logoutMenuItem || logoutMenuItem === "false") { + //$('#trigger_logout').parent().css("display", "none"); + $('#trigger_logout_div').html(""); + } + if ((!fullscreenMenuItem && !logoutMenuItem) || (fullscreenMenuItem === "false" && logoutMenuItem === "false")) { + $('#full_logout_divider').css("display", "none"); + } + if (!changePassMenuItem ) { + $('#changePwd_labellink').css('display','none'); + $('#full_logout_divider').css('display','none'); + } + + //设置二次开发者选择的框架皮肤 + var defaultColor = openoFrameWork_conf.defaultThemeColor; + var panel = $('.zte-theme-panel'); + $('ul > li', panel).removeClass("current"); + if (store && !store('style_color')) { // cookie没有才设置默认主题 + setThemeColor(defaultColor); + }else{ + setThemeColor(store('style_color')); + } +}; + +/*新增的hashtabel实现类,用户后续iframe的缓存,前进后退时打开过的页面的菜单id的缓存等*/ +function Hashtable() +{ + this._hash = {}; + this._count = 0; + this.add = function(key, value) + { + if (this._hash.hasOwnProperty(key)) + return false; + else { + this._hash[key] = value; this._count++; return true; + } + } ; + this.hash = function() { return this._hash; }; + this.remove = function(key) { delete this._hash[key]; this._count--; } ; + this.count = function() { return this._count; }; + this.items = function(key) { if (this.contains(key)) return this._hash[key]; }; + this.contains = function(key) { return this._hash.hasOwnProperty(key); }; + this.clear = function() { this._hash = {}; this._count = 0; }; + this.replace = function(key, value) + { //有则删除后增加///相当于更新 + if(this.contains(key)){ + this.remove(key); + } + return this.add(key, value); + } ; +}; + +var fMenuSiderDivId = 'page-f-sidebar-menu'; +var fMenuMegaDivId = 'f_hormenu'; +var megaSiderDivId = 'page-megachild-sidebar-menu'; +var megaDivId = 'main_hormenu'; +var openoFrameWork_menu_horizontal = "horizontal"; +var openoFrameWork_menu_vertical = "vertical"; +var openoFrameWork_menu_fmenu = "fmenu"; +var openoFrameWork_showNav = "true"; +var openoFrameWork_smallView = 960;//原来为992,但是在投影仪上不准(投影仪设置为1024,但是实际尺寸比1024小),边栏菜单也会被移除,这个设置一个稍小的值。 + +/*下面是主框架的核心*/ +var openoFrameWork = function () { + var defaultLanage=getLanguage(); + var isRTL = false;//文档顺序 + var isTouch=function(){ + try { + document.createEvent("TouchEvent"); + return true; + } catch (e) { + return false; + } + }; + var isDesktop = !isTouch; + var isIE8 = false; + var isIE9 = false; + var isIE10 = false; + var gdocTitle=""; + var _sidebarWidth = 225; + var _sidebarCollapsedWidth = 35; + var responsiveHandlers = []; + var cachedIframes=new Hashtable(); + var cachedIframesObject=new Hashtable(); + var breadcrumbBtnMenus=new Hashtable(); + var _menuCategorys=new Hashtable(); + var _iframe="page-mainIframe"; //全局变量保存的是当前正在打开使用的iframe + var _sceneURLRootPath=""; + var _hashSource="";//信号量 + var _isClicked=false;//信号量 + //var _breadcrumbSource=false; + + // 皮肤颜色 + var layoutColorCodes = { + 'blue': '#4b8df8', + 'red': '#e02222', + 'green': '#35aa47', + 'purple': '#852b99', + 'grey': '#555555', + 'light-grey': '#fafafa', + 'yellow': '#ffb848', + 'ztebluelight': '#3366cc' + }; + // 获取真实的设备窗口大小,参考了 http://andylangton.co.uk/articles/javascript/get-viewport-size-javascript/ + var _getViewPort = function () { + var e = window, a = 'inner'; + if (!('innerWidth' in window)) { + a = 'client'; + e = document.documentElement || document.body; + } + return { + width: e[a + 'Width'], + height: e[a + 'Height'] + } + } + // 初始化 + var dealInit = function () { + var sence = '0'; + var menuSence = getUrlParam("menu"); + var confSence = 0; + if (menuSence) { + sence = menuSence; + } else { + sence = confSence; + } + switch (sence) { + case "1": + gdocTitle = $('#com_zte_ums_ict_framework_ui_page_title_1').text().trim(); + break; + case "2": + gdocTitle = $('#com_zte_ums_ict_framework_ui_page_title_2').text().trim(); + break; + case "3": + gdocTitle = $('#com_zte_ums_ict_framework_ui_page_title_3').text().trim(); + break; + case "0": + default: + gdocTitle = $('#com_zte_ums_ict_framework_ui_page_title').text().trim(); + break; + } + if ($('body').css('direction') === 'rtl') { + isRTL = true; + } + isIE8 = !! navigator.userAgent.match(/MSIE 8.0/); + isIE9 = !! navigator.userAgent.match(/MSIE 9.0/); + isIE10 = !! navigator.userAgent.match(/MSIE 10.0/); + if (isIE10) { + $('html').addClass('ie10'); // IE10 + } + if (isIE10 || isIE9 || isIE8) { + $('html').addClass('ie'); // IE10 + } + var deviceAgent = navigator.userAgent.toLowerCase(); + if (deviceAgent.match(/(iphone|ipod|ipad)/)) { + $(document).on('focus', 'input, textarea', function () { + $('.page-header').hide(); + if($('.page-footer')&&$('.page-footer').length>0) + $('.page-footer').hide(); + }); + $(document).on('blur', 'input, textarea', function () { + $('.page-header').show(); + if($('.page-footer')&&$('.page-footer').length>0) + $('.page-footer').show(); + }); + } else { + $(document).on('focus', 'input, textarea', function () { + if($('.page-footer')&&$('.page-footer').length>0) + $('.page-footer').hide(); + }); + $(document).on('blur', 'input, textarea', function () { + if($('.page-footer')&&$('.page-footer').length>0) + $('.page-footer').show(); + }); + } + } + //处理滚动到 + var dealScrollTo=function (el, offeset) { + + } + var dealstartPageLoading=function(message) { + $('.page-loading').remove(); + $('body').append('
  ' + (message ? message : $.i18n.prop('com_zte_ums_ict_framework_ui_loading')) + '
'); + } + var dealstopPageLoading=function() { + $('.page-loading').remove(); + } + var dealSidebarState = function () { + // 窗体宽度小尺寸(平板和iphone模式下)时移出左边栏 + var viewport = _getViewPort(); + if (viewport.width < openoFrameWork_smallView) { + $('body').removeClass("page-sidebar-closed"); + }else{ + if (getCookie('sidebar_closed') === '1') { + $('body').addClass('page-sidebar-closed'); + } + } + } + // openoFrameWork.addResponsiveHandler()回调函数. + var runResponsiveHandlers = function () { + //重新初始化其他订阅的元素elements + for (var i = 0; i < responsiveHandlers.length; i++) { + var each = responsiveHandlers[i]; + each.call(); + } + } + // 窗体重新调整大小时初始化调整边栏状态高度 + var dealResponsive = function () { + dealSidebarState(); + ajustHorMenuDropDirection(); + dealSidebarAndContentHeight(); + dealFixedSidebar(); + runResponsiveHandlers(); + } + // 页面重载入时初始化调整内部布局 + var dealResponsiveOnInit = function () { + dealSidebarState(); + dealSidebarAndContentHeight(); + setTimeout(function () { + ajustHorMenuDropDirection(true); + }, 100); + } + // 窗体重新调整大小时初始化调整布局 + var dealResponsiveOnResize = function () { + var resize; + if (isIE8) { + var currheight; + $(window).resize(function () { + if (currheight == document.documentElement.clientHeight) { + return; + } + if (resize) { + clearTimeout(resize); + } + resize = setTimeout(function () { + dealResponsive(); + }, 50); + currheight = document.documentElement.clientHeight; + }); + } else { + $(window).resize(function () { + if (resize) { + clearTimeout(resize); + } + resize = setTimeout(function () { + dealResponsive(); + }, 50); + }); + } + } + var changeSiderBar = function(hideAllMenu){ + var siderbarpos = $(".nav-pos-direction", $(".zte-theme-panel")).val(); + var sidermenu = $("#page-sidebar-menu"); + var hormenu = $("#main_hormenu"); + var fhorMenu = $("#" + fMenuMegaDivId); + var fsiderMenu = $("#" + fMenuSiderDivId); + if(hideAllMenu){ + sidermenu.css('display','block');// 侧边栏显示 + hormenu.css("display", "none");//隐藏水平菜单栏 + fhorMenu.css('display','none'); + fsiderMenu.css('display','none'); + return; + } + if (openoFrameWork_menu_horizontal == siderbarpos) { + sidermenu.css('display','none');// 侧边栏隐藏 + fhorMenu.css('display','none');// 侧边栏隐藏 + fsiderMenu.css('display','none');// 侧边栏隐藏 + hormenu.css("display", "block");//显示水平菜单栏 + } else if (openoFrameWork_menu_vertical == siderbarpos) { + sidermenu.css('display','block');// 侧边栏显示 + hormenu.css("display", "none");//隐藏水平菜单栏 + fhorMenu.css('display','none');// 侧边栏隐藏 + fsiderMenu.css('display','none');// 侧边栏隐藏 + } else if (openoFrameWork_menu_fmenu == siderbarpos) { + sidermenu.css('display','none'); + hormenu.css("display", "none"); + fhorMenu.css('display','block'); + fsiderMenu.css('display','block'); + //除了toggle按钮之外,是否还有其他儿子是要显示的,如果没有,那么竖菜单不显示;反之,显示。 + var lis = fsiderMenu.children(".sidebar-toggler-wrapper").siblings(); + if(lis.length > 0 && lis.css('display') != "none"){ + fsiderMenu.css('display','block'); + // + $("body").removeClass("page-full-width"); + if ($('body').hasClass("page-sidebar-closed")) { + $(".page-content").css("marginLeft", _sidebarCollapsedWidth); + } else { + $(".page-content").css("marginLeft", _sidebarWidth); + } + } + } + } + //根据当前菜单在屏幕的位置,和一级菜单下二级菜单的排列,来决定菜单是向左展开还是向右展开 + var ajustHorMenuDropDirection = function( isInit ){ + //获取屏幕宽度 + var bodyWidth = document.body.clientWidth; + //循环,获取每个一级菜单在屏幕中的位置 + var levelOneAdropdowns = $('a.dropdown-toggle', '#main_hormenu' ); + //每一个文字span的图标、他父亲的margin\padding等占用的位置 + var marginCount = 5 * 2 + 17.5 + 2 * 2 + 30 + 15 * 2 + 3; + for( var i = 0 ; i < levelOneAdropdowns.length ; i++ ){ + var a = $(levelOneAdropdowns[i]); + var leftOffset = a.offset().left; + //获取二级菜单的数量 + var ul = a.parent().children('.dropdown-menu'); + var groupDivs = $('.zteDivWidth' , ul); + var widthOfDropDownMenu = 0; + for(var j = 0 ; j < groupDivs.length && groupDivs.length >0 ; j++ ){//循环获取每个分组的宽度 + var eachDiv = groupDivs[j]; + var maxLengthText = ""; + var maxLength = 0; + var spans = $('span' , eachDiv).each(function(){ + var innerText = this.innerText; + if( innerText.length > maxLength ){ + maxLength= innerText.length; + maxLengthText = innerText; + } + }); + widthOfDropDownMenu = widthOfDropDownMenu + getStringWidth(maxLengthText , 14) + marginCount; + } + //预估每个组占宽度150PX,多预计一点 + if( widthOfDropDownMenu + leftOffset > bodyWidth ){ + console.log("ajust class dropdown-menu-right ,id = "+ a.attr("id") ); + ul.addClass('dropdown-menu-right'); + //var right = bodyWidth - (leftOffset + a.width() + 15); + //ul.attr('style' ,'right:' + right ); + }else{ + ul.removeClass('dropdown-menu-right'); + //ul.removeAttr('style'); + } + } + } + // 屏幕大小发生变化或者移动设备旋转屏幕时处理响应式布局. + var dealSidebarAndContentHeight = function (isToggler) { + var content = $('.page-content'); + var contentbody = $('.page-content-body'); + var sidebar = $('.page-sidebar'); + var body = $('body'); + var height; + var viewport = _getViewPort(); + var scrAvaHeight=Math.min(window.screen.availHeight,viewport.height)-5; + var footer=$('.footer'); + var pgbread=$('.page-breadcrumb'); + var pageableDiv=$('#pageableDiv'); + console.log("pageableDiv height:"+pageableDiv.outerHeight(true)); + var pheader=$('.header'); + var childPagetype=!!cachedIframesObject.items(_iframe)?cachedIframesObject.items(_iframe).childpageType:""; + if(childPagetype==="isc")//smartclient的子页面固定高度为视口可用内容区高度 + { + $('.sidebar-option', panel).val("fixed"); + } + dealShownav(); + var available_height =scrAvaHeight - ((!footer||footer.length<=0)?0:footer.outerHeight(true)) - pheader.outerHeight(true); + var _pageableDivHeight=(!pageableDiv||pageableDiv.length<=0||pageableDiv.is(":visible")==false)?0:pageableDiv.outerHeight(true); + var h= scrAvaHeight-pheader.outerHeight(true)-((!footer||footer.length<=0||footer.is(":visible")==false)?0:footer.outerHeight(true))-pgbread.outerHeight(true)-_pageableDivHeight-(contentbody.outerHeight(true)-contentbody.height()); + var miframe=_iframe==""?"page-mainIframe": _iframe; + var pagemyIframe=$('.page-content .page-content-body .'+miframe); //.page-mainIframe + if(pagemyIframe&&pagemyIframe.length>0){ + //处理iframe,下面计算中间iframe的高度 + var deviceAgent = navigator.userAgent.toLowerCase(); + if (deviceAgent.match(/(iphone|ipod|ipad)/)) { //||viewport.height<=480 + var w=viewport.width-content.offset().left-(pagemyIframe.offset().left-content.offset().left)*2;//宽度=总宽度-左边栏宽度-内容区内边距。左右两个 + pagemyIframe.width(w); + } + //对桌面必须计算高度 + var tmp_style = sidebar.attr('style');// firefox下执行 sidebar.height()会改变style样式,这里缓存下执行前的style样式,执行完后重新赋给页面元素 + console.log("pym:parent iframe "+miframe+" sidebar.height:"+sidebar.height()+" h:"+h); + h=sidebar.height()>h?sidebar.height():h; + //IE下,把iframe的高度再减掉7,因为IE10及以下版本,计算的高度会比IE实际显示区域大,导致出现IE滚动条。 + /*h=h-ICTFRAME_CONST_IFRAME_HEIGHT_AJUST; + if(isIE){ + h=h-ICTFRAME_CONST_IFRAME_HEIGHT_AJUST_IE; + }*/ + sidebar.attr('style',tmp_style); + if (isDesktop) { + //pagemyIframe.attr("height",h); + if(cachedIframesObject.items(miframe).setMinHeight){ + var minHeight=Math.min(scrAvaHeight,h); + console.log("pym:parent iframe "+miframe+" window.screen.availHeight:"+scrAvaHeight+" viewport.height:"+viewport.height+" h:"+h+" minHeight:"+minHeight); + cachedIframesObject.items(miframe).setMinHeight(minHeight); + } + }else{ + //pagemyIframe.attr("height","100%");//去掉这里错误的设置,ipad上测试高度不正确 + var _h=h; + try{ + _h=pagemyIframe.contents().height(); + }catch(e){} + h=_h>h?_h:h; + if(cachedIframesObject.items(miframe).setMinHeight){ + var minHeight=Math.min(scrAvaHeight,h); + console.log("pym:parent iframe "+miframe+" window.screen.availHeight:"+scrAvaHeight+" viewport.height:"+viewport.height+" h:"+h+" minHeight:"+minHeight); + cachedIframesObject.items(miframe).setMinHeight(minHeight); + } + } + } + + if (body.hasClass("page-footer-fixed") === true && body.hasClass("page-sidebar-fixed") === true) { + if (content.height() < available_height) { + //content.attr('style', 'min-height:' + available_height + 'px !important'); + dealAddStyle(content,'min-height',available_height + 'px',true); + } + } else{ + if (body.hasClass("page-footer-fixed") === true && body.hasClass("page-sidebar-fixed") === false) { + if (content.height() < available_height) { + //content.attr('style', 'min-height:' + available_height + 'px !important'); + dealAddStyle(content,'min-height',available_height + 'px',true); + } + } else { + if (body.hasClass('page-sidebar-fixed')) { + height = _calculateFixedSidebarViewportHeight(); + } else { + // firefox下执行 sidebar.height()会改变style样式,这里缓存下执行前的style样式,执行完后重新赋给页面元素 + var tmp_style = sidebar.attr('style'); + // height = sidebar.height() + 20; + sidebar.attr('style',tmp_style); + var headerHeight = pheader.outerHeight(true); + var footerHeight = (!footer||footer.length<=0)?0:footer.outerHeight(true); + if ($(window).width() > 1024 && (height + headerHeight + footerHeight) < scrAvaHeight) { + height = scrAvaHeight - headerHeight - footerHeight; + } + } + if (height <= content.height()) {//这里为了避免内容区域很小的时候出现内容区域无法充满屏幕,把min-height修改为height + //content.attr('style', 'min-height:' + height + 'px !important'); + dealAddStyle(content,'min-height',height + 'px',true); + } + } + } + // 屏幕小尺寸时会隐藏边栏,这时菜单由小屏幕右上图标控制,当屏幕变化到大尺寸屏幕时, + // 需要按原菜单出现方式恢复菜单显示。 + var screenwidth = $(window).width(); + if(screenwidth >= openoFrameWork_smallView){ + changeSiderBar(); + if($(".page-sidebar-menu li").css('display') != "none"){ + if ($('body').hasClass("page-sidebar-closed") && $(".sidebar-toggler").hasClass("close-by-viewportChange")) { + if( !isToggler ){ + $(".sidebar-toggler")[1].click(); + } + $(".sidebar-toggler").removeClass("close-by-viewportChange"); + } + } + } + else { + changeSiderBar(true); + } + } + var showIframe=function(iframe){ + var resize,pagemainIframe; + if (cachedIframes.count()>0) { + for (var i in cachedIframes.hash()) { + cachedIframes.replace(i,0); + var pagemyIframe=$('.page-content .page-content-body .'+i); + if(pagemyIframe&&pagemyIframe.length>0){ + if(iframe==i){ + pagemyIframe.show(); + cachedIframes.replace(i,1); + } else{ + if("page-mainIframe"===i){//2015年12月10日 wimax要求页面切换后删除没有配置cacheNum的缓存页面 + pagemainIframe=i; + pagemyIframe.attr("src",""); + pagemyIframe.remove(); + }else{ + pagemyIframe.hide(); + } + cachedIframes.replace(i,0); + } + } + } + } + if(pagemainIframe){ + delete cachedIframes._hash[pagemainIframe]; + delete cachedIframesObject._hash[pagemainIframe]; + } + if (!cachedIframes.contains(iframe)) { + cachedIframes.add(iframe,1); + //增加的iframe加载完毕后 停止加载中提示信息 + myIframe=$('.'+iframe); + myIframe.show(); + myIframe.load(function(){ + /*if (!isDesktop) { + if (resize) { + clearInterval(resize); + } + resize = setInterval(dealIframeHeight, 400,$(this)); + }*/ + openoFrameWork.stopPageLoading(); + }); + } + } + var hidemenu=function(){ + $('.hor-menu').hide(); + dealAddStyle($('.page-content'),'margin-left','0px',true); + dealAddStyle($('.page-sidebar'),'display','none',true); + var fsiderMenu = $("#" + fMenuSiderDivId); + fsiderMenu.children().css('display' , 'none'); + } + var hideAlarmLight=function(){ + //$('#header_notification_bar').hide(); + //$('#header_notification_bar').empty(); + $('#header_notification_bar').html("
      
"); + } + var dealShownav=function(){ + var showNav=openoFrameWork.getLocationURLParameter('showNav'); + if( showNav=="false"){ + openoFrameWork_showNav = showNav; + hidemenu(); + hideAlarmLight(); + } + } + /* 点击菜单时,处理对应该菜单项的横,左菜单项 */ + var dealRelateMenu = function(source) { + // 点击子菜单时,对应的横竖菜单项也联动为选择样式,(高亮,箭头变化) + var panel = $('.zte-theme-panel'); + var navPosOption = $('.nav-pos-direction', panel).val(); + var targetsource = null; + var targetContainer = null; + if (navPosOption === "vertical") { + // 当前是左菜单,则处理对应的横菜单 + targetsource = $("#"+source.attr("id"), $("#main_hormenu")); + targetContainer = $(".header ul"); + } else if (navPosOption === "horizontal") { + var rtn = dealMgaBarRelated(source); + dealFMenuRelated(source , megaSiderDivId); + targetContainer = rtn[0]; + targetsource = rtn[1]; + }else if(navPosOption === openoFrameWork_menu_fmenu){ + dealFMenuRelated(source , fMenuSiderDivId); + } + if (targetContainer) { + // 移除原有菜单项的活动及箭头样式 + targetContainer.children('li.active').removeClass('active'); + targetContainer.find('.arrow.open').removeClass('open'); + } + if (targetsource) { + // 增加活动及箭头样式 + targetsource.parents('li').each(function () { + $(this).addClass('iframe active'); + $(this).find('a > span.arrow').addClass('open'); + }); + targetsource.parents('li').addClass('active'); + if (navPosOption === "horizontal") { + if (targetsource.parent().parent().parent().is("li")) { + $('.arrow', targetsource.parent().parent().parent()).addClass("open"); + } + } + } + } + var dealMgaBarRelated = function(source){ + // 当前是横菜单,则处理对应的左菜单 + targetsource = $("#"+source.attr("id"), $("[class='page-sidebar-menu']")); + targetContainer = $("#page-sidebar-menu ul"); + // 将先前左菜单展开的子菜单收缩 + $("li.open",targetContainer).each(function() { + var style = $("ul.sub-menu", this).attr("style"); + if (style) { + $("ul.sub-menu", this).removeAttr("style"); + $(this).removeClass('open'); + } + }); + // 当前是横菜单,但在屏幕缩小的情况下显示的是tip垂直菜单,而横菜单是隐藏的,所以需额外处理横菜单 + if (source.parent().parent().parent().parent().attr("class").indexOf("page-sidebar-menu") >= 0) { + var tiptargetsource = $("#"+source.attr("id"), $("#main_hormenu")); + var tiptargetContainer = $(".header ul"); + tiptargetContainer.children('li.active').removeClass('active'); + tiptargetContainer.find('.arrow.open').removeClass('open'); + tiptargetsource.parents('li').each(function () { + $(this).addClass('iframe active'); + $(this).find('a > span.arrow').addClass('open'); + }); + tiptargetsource.parents('li').addClass('active'); + } + return [targetContainer ,targetsource ]; + } + var dealFMenuRelated = function(source , siderDivId ){ + var fsiderMenu = $("#" + siderDivId); + if(isMoreMenuItemClick){//更多菜单点击 , 临时方案,增加信号量,使用之后就置为false + isMoreMenuItemClick = false + }else if($(source).parents('li').hasClass('mega-menu-dropdown')){//F的横向菜单的点击 + var id = source.attr('id'); + //非被点击的一级菜单的二级菜单都不显示 + $('#' + siderDivId + '>li').hide(); + var level2Lis = $("a[hparentid= " + id + "]" , fsiderMenu).parent(); + level2Lis.show(); + if(level2Lis.length > 0){//把竖向菜单的收起放大按钮显示出来 + $('#' + siderDivId + '>li.sidebar-toggler-wrapper').show(); + } + if($("a[hparentid= " + id + "]" , fsiderMenu).length > 0){ //有子孙菜单时,把F菜单的竖菜单显示出来 + dealFSidermenu(source ,siderDivId ); + }else{//否则隐藏竖菜单 + fsiderMenu.css('display','none'); + $("body").addClass("page-full-width"); + $(".page-content").css("marginLeft", _sidebarWidth); + } + + }else{//F菜单的竖向菜单点击 + //处理一种特殊情况,告警灯打开新页面,所有的菜单都不出现,因此,虽然这个source在竖菜单,但竖菜单这个时候实际上是没有显示的 + if( openoFrameWork_showNav == "true") { + $('#' + siderDivId + '>li').hide(); + var lis = $(source).parents('li'); + var id = lis.eq(lis.length-1).children( 'a' ).attr('hparentid'); + //var id = $(source).parents('li').children('a').attr('hparentId'); + var level2Lis = $("a[hparentid=" + id + "]" , fsiderMenu).parent(); + level2Lis.show(); + if(level2Lis.length > 0) {//把竖向菜单的收起放大按钮显示出来 + $('#'+ siderDivId + '>li.sidebar-toggler-wrapper').show(); + } + //$('#' + siderDivId + '>li')[0].show(); + dealFSidermenu(source , siderDivId); + } + } + } + var dealFSidermenu = function(source , siderDivId){ + var fsiderMenu = $("#" + siderDivId); + fsiderMenu.css('display','block'); + $('ul.sub-menu',fsiderMenu).css('display','block'); + $('.arrow',fsiderMenu).addClass('open'); + $("body").removeClass("page-full-width"); + if ($('body').hasClass("page-sidebar-closed")) { + $(".page-content").css("marginLeft", _sidebarCollapsedWidth); + } else { + $(".page-content").css("marginLeft", _sidebarWidth); + } + var href = source.attr("href"); + $('li.iframe' ,fsiderMenu ).removeClass('active'); + var selectedIframeLi = $("a[href ='" + href + "']" ,fsiderMenu ).parent(); + selectedIframeLi.addClass('active'); + selectedIframeLi.parent().parent().addClass("open").addClass("active"); + selectedIframeLi.parent().css('display','block'); + selectedIframeLi.parent().parent().children('a').children('.arrow').addClass('open'); + } + var dealMenuItemClick=function(source,e,menuContainerStr){ + var url = source.attr("href"); + if(!url||url.length<2) + return; + e.preventDefault(); + if(!_isClicked){//导航情况下,首先要模拟点开菜单分组 + _isClicked=true;//如果菜单有子菜单点击一次来展开子菜单,注意这个信号量的变化,避免死循环 + var mainMenu=source.parents('li').last(); + if(!mainMenu.hasClass('open')){ + dealLiAClick(mainMenu.children('a:eq(0)')); + } + } + if(menuContainerStr&&menuContainerStr.length>0){ + var menuContainer = $('.'+menuContainerStr+' ul'); + + menuContainer.children('li.active').removeClass('active'); + // menuContainer.children('arrow.open').removeClass('open'); + //menuContainer.find('.arrow.open').addClass('open'); + } + source.parents('li').each(function () { + $(this).addClass('iframe active'); + $(this).children('a > span.arrow').addClass('open'); + }); + source.parents('li').addClass('active'); + // 处理点击菜单对应的横或左菜单项的选择样式 + dealRelateMenu(source); + if(menuContainerStr&&menuContainerStr.length>0){ + if ($(window).width() <= 991 && $('.'+menuContainerStr).hasClass("in")) { + $('.navbar-toggle').click(); + } + } + if(dealMultTabPage(source)) + return true; + dealScrollTo(); + var breadmenuID=e.data&&e.data.breadcrumbBtnMenuItem&&e.data.breadcrumbBtnMenuItem.length>0?e.data.breadcrumbBtnMenuItem:""; + if(breadmenuID.length>0){//面包削导航来的,只需要重新生成面包削即可 + //找到更多菜单按钮 + var moreMenuItem = $('#' + breadmenuID , $('#pageableDiv')); + if( moreMenuItem.length == 0 ){ + moreMenuItem = $('#' + breadmenuID , $('.more-botton-zone')); + } + dealBreadcrumbBtnMenuItemClick(moreMenuItem,e); + //dealBreadcrumb(source,false,e); + }else{//非面包削导航来的, + dealstartPageLoading(); + if(dealIframe(source,e))//当返回true时说明是正常加载iframe了,否则面包削不能切换 + dealBreadcrumb(source,false,e); + } + //dealShownav(); + }; + var dealMenuItemGetFocus=function(source,e,menuContainerStr){ + var url = source.attr("href"); + if(!url||url.length<2) + return; + e.preventDefault(); + if(!_isClicked){//导航情况下,首先要模拟点开菜单分组 + _isClicked=true;//如果菜单有子菜单点击一次来展开子菜单,注意这个信号量的变化,避免死循环 + var mainMenu=source.parents('li').last(); + dealLiAClick(mainMenu.children('a:eq(0)')); + } + if(menuContainerStr&&menuContainerStr.length>0){ + var menuContainer = $('.'+menuContainerStr+' ul'); + + menuContainer.children('li.active').removeClass('active'); + menuContainer.children('arrow.open').removeClass('open'); + } + source.parents('li').each(function () { + $(this).addClass('iframe active'); + $(this).children('a > span.arrow').addClass('open'); + }); + source.parents('li').addClass('active'); + + if(menuContainerStr&&menuContainerStr.length>0){ + if ($(window).width() <= 991 && $('.'+menuContainerStr).hasClass("in")) { + $('.navbar-toggle').click(); + } + } + }; + //处理iframe的核心处理类,逻辑较为复杂,注意各种参数的处理 + var dealIframe=function(aObject,e){ + _hashSource=""; + var url = aObject.attr("href"); + if(!url||url.length<2) + return; + url=openoFrameWork.handlBaseURL(url); + //-----------2015年9月21日新增V5中大O需要的按照实例(根据选择的系统实例变化url的ip和端口地址)进行动态切换菜单的功能 + var category= aObject.attr("category");//处理菜单中定义的Category属性 + if(category&&category.length>0){//处理Category属性 + var newIpPort=_menuCategorys.items(category); + if(newIpPort&&newIpPort.ipPort&&newIpPort.ipPort.trim()!=""){//如果找到了 + var newIpPortstr=openoFrameWork.getDomainURL(newIpPort.ipPort);//去掉ip和port后多余的部分 + var urlipport=openoFrameWork.getDomainURL(url); + console.log("old url:"+url); + url=newIpPortstr+url.replace(urlipport,""); + console.log("newIpPort:"+newIpPortstr+" newURL:"+url); + } + } + //------------ + dealstartPageLoading(); + var cacheNum= aObject.attr("cacheNum");//当第三方应用需要框架缓存曾经打开过的页面时使用。 + var shiftJS= aObject.attr("shiftJS");//当第三方应用不需要后面的href页面进行重新加载仅仅执行某个脚本打开某个功能时使用 + var _iframeName= aObject.attr("iframeName");//对有些第三方应用设置了顶层frame名字的,这个必须设置 + var _iframeAutoScroll= aObject.attr("iframeAutoScroll");//设置iframe的滚动条是否出现,可以设置为auto,yes或者no,默认为no 不出现. + _iframeAutoScroll=!!_iframeAutoScroll?(_iframeAutoScroll==='yes'?'yes':_iframeAutoScroll==='auto'?'auto':'no'):'no'; + _xdomain= aObject.attr("xdomain");//对有些第三方应用如果跨域了,需要设置这个信任域属性,以便于来跨域通讯.这里取值是一个正则表达式 + _xdomain=_xdomain&&_xdomain.length>0?_xdomain:"*"; + var _cssfile= aObject.attr("cssSrc");//设置iframe中页面需要动态加载的css文件. + _cssfile=(_cssfile&&_cssfile.length>0)?_cssfile:""; + var _runShiftJS=""; + var pageContentBody=$('.page-content .page-content-body'); + var tabHtml=""; + var tabContentHtml=""; + var tabID=""; + var tabContentID=""; + var iframename=''; + function createIframe(pdiv,url,id,name,clsname,xdom,autoScroll){ + var pymParent = new pym.Parent(pdiv, url, {xdomain:xdom}); + pymParent.iframe.id=id; + pymParent.iframe.name=name; + //pymParent.iframe.setAttribute('display', "none"); + //pymParent.iframe.style.height="100%"; + //pymParent.iframe.setAttribute('height', "100%"); + pymParent.iframe.setAttribute('class', clsname); + pymParent.iframe.setAttribute('allowfullscreen',''); + pymParent.iframe.setAttribute('mozallowfullscreen',''); + pymParent.iframe.setAttribute('oallowfullscreen',''); + pymParent.iframe.setAttribute('msallowfullscreen',''); + pymParent.iframe.setAttribute('webkitallowfullscreen',''); + //pymParent.iframe.setAttribute('scrolling',autoScroll); + pymParent.iframe.setAttribute('onload', 'openoFrameWork.SyncCSS(this,0,"'+_cssfile+'");openoFrameWork.stopPageLoading();'); + cachedIframesObject.replace(id,pymParent);//缓存iframe对象实体 + pymParent.onMessage('height', function(he){ + console.log("The frame "+id+" receive message height is "+he); + var pagemyIframe=$('.page-content .page-content-body .'+id); + var h=Math.max(this.minHeight,he); + pagemyIframe.height(h); + }); + return pymParent; + }; + + if(cacheNum){//处理缓存iframe和iframename标签 + cacheNum="page-mainIframe"+cacheNum; + iframename="fraMain"+cacheNum; + }else{ + cacheNum="page-mainIframe"; + iframename="fraMain"; + } + iframename=!!_iframeName?_iframeName:iframename; + _iframe= cacheNum;//注意这里_iframe是一个全局变量 + + var miframe=_iframe==""?"page-mainIframe": _iframe; + var pagemyIframe=$('.page-content .page-content-body .'+miframe); + var nagivJS=e&&e.data&&e.data.action?e.data.action:""; + nagivJS=(!!nagivJS&&nagivJS.length>0)?(nagivJS.trim().toLowerCase()=="null"?nagivJS:"javascript:$('.page-content .page-content-body ."+miframe+"')[0].contentWindow."+nagivJS.trim()+";"):""; + nagivJS=nagivJS.trim(); + + _runShiftJS=(!!shiftJS&&shiftJS.length>0)?(shiftJS.trim().toLowerCase()=="null"?shiftJS:"javascript:$('.page-content .page-content-body ."+miframe+"')[0].contentWindow."+shiftJS+";"):""; + if(pagemyIframe&&pagemyIframe.length>0){//如果iframe已经添加了,则直接更改url或者执行切换或导航函数 + var src=pagemyIframe.attr("src"); + if((!!shiftJS||nagivJS.length>0)&&(src==url||src.split('?')[0]==url.split('?')[0])&& cacheNum!="page-mainIframe") { //url相同时,处理缓存shiftJS标签 + //这里shiftJS必须定义iframe中的页面定义到window上的函数; + //pagemyIframe.attr("scrolling",_iframeAutoScroll); + cachedIframesObject.items(miframe).settings.xdomain=_xdomain; + if(nagivJS.length>0&&nagivJS.toLowerCase()!="null") + _runShiftJS=nagivJS;//如果是nagivJS导航过来的,nagivJS优先级高于shiftJS,如果有nagivJS就用nagivJS替换_runShiftJS; 直接执行一次导航切换 + try{ + if(_runShiftJS.trim().toLowerCase()!="null") + eval(_runShiftJS); + }catch(e){ + if (e instanceof EvalError) { + console.log(e.name + " EvalError: " + e.message); + } else if (e instanceof SyntaxError) { + console.log(e.name + " SyntaxError: " + e.message); + }else if (e instanceof Error) { + if(e.name.toLowerCase().trim()=="typeerror") + { + //console.log($.i18n.prop('com_zte_ums_ict_framework_ui_clickTooFast')); + var parm={runShiftJS:_runShiftJS}; + pagemyIframe.one('load',parm,function(e){ + var runShiftJS=e&&e.data&&e.data.runShiftJS?e.data.runShiftJS:""; + if(runShiftJS.length>0&&runShiftJS.toLowerCase()!="null") + eval(runShiftJS);//点击太快了,页面没有加载完毕,那就加载完毕了再次执行 + }) + } + } + return false;//返回false 后续不再做其他动作了 + } + finally{ + openoFrameWork.stopPageLoading(); + } + }else{//否则url不同,或者url相同但没有shiftjs + if(nagivJS.length>0&&nagivJS.toLowerCase()!="null"){//如果是代码导航过来的去掉url参数中的默认action动作 + url=url.split('?')[0];//去掉?参数,防止默认执行动作,只响应nagivJS指定的动作; + } + if(src.split('#')[0]!=url.split('#')[0])//如果相等说明是通过锚点导航的,真实url没有变化,对SPA应用比较普遍 + { + pagemyIframe.attr("src","");//url和src不同说明更换了页面,需要清空重新加载 + }else //if (src.trim()==url.trim()) //没有shiftjs并且url相同,说明不需要再次加载了,已经加载过了 + { + openoFrameWork.stopPageLoading(); + } + pagemyIframe.attr("src",url); + + if(nagivJS.length>0&&nagivJS.toLowerCase()!="null"){//如果是nagivJS导航过来的,iframe加载完毕后执行一次导航切换脚本 + var parm={nagivJS:nagivJS}; + pagemyIframe.one('load',parm,function(e){ + var nagivJS=e&&e.data&&e.data.nagivJS?e.data.nagivJS:""; + if(nagivJS.length>0&&nagivJS.toLowerCase()!="null") + eval(nagivJS);//如果没有加载过,加载后也要执行跳转的函数 + }); + } + if(_cssfile.length>0&&_cssfile.toLowerCase()!="null"){//如果配置了cssSrc,每次切换都重新执行一边这个css文件,防止有遗漏 + parm={syncCSSJS:'openoFrameWork.SyncCSS(this,10,"'+_cssfile+'");openoFrameWork.stopPageLoading();'}; + pagemyIframe.one('load',parm,function(e){ + var syncCSSJS=e&&e.data&&e.data.syncCSSJS?e.data.syncCSSJS:""; + if(syncCSSJS.length>0&&syncCSSJS.toLowerCase()!="null") + eval(syncCSSJS); + }); + } + } + + }else{//否则添加新的iframe元素 overflow:visible; + if(nagivJS.length>0&&nagivJS.toLowerCase()!="null"){//如果是代码导航过来的去掉url参数中的默认action动作 + url=url.split('?')[0];//去掉?参数,防止默认执行动作,只响应nagivJS指定的动作; + } + var pdiv="pdiv_"+miframe; + if($("#"+pdiv).length<=0){//检查下,如果该div没有添加过就添加 + pageContentBody.append("
"); + } + dealstartPageLoading(); + pymParent=createIframe(pdiv, url,miframe,miframe,miframe,_xdomain,_iframeAutoScroll); + pagemyIframe=$(pymParent.iframe); + + if(nagivJS.length>0&&nagivJS.toLowerCase()!="null"){//如果是nagivJS导航过来的,iframe加载完毕后执行一次导航切换 + var parm={nagivJS:nagivJS}; + pagemyIframe=$('.page-content .page-content-body .'+miframe); + if(pagemyIframe&&pagemyIframe.length>0){ + pagemyIframe.one('load',parm,function(e){ + var nagivJS=e&&e.data&&e.data.nagivJS?e.data.nagivJS:""; + if(nagivJS.length>0&&nagivJS.toLowerCase()!="null") + eval(nagivJS);//如果没有加载过,加载后也要执行跳转的函数 + }) + } + } + + } + showIframe(miframe); + openoFrameWork.fixContentHeight(); // 调整高度 + return true; + } + // 处理边栏菜单 + var dealLiAClick=function(source){ + if (source.next().hasClass('sub-menu') == false) { + if ($('.btn-navbar').hasClass('collapsed') == false) { + $('.btn-navbar').click(); + } + return; + } + + if (source.next().hasClass('sub-menu always-open')) { + return; + } + var parent = source.parent().parent(); + var the = source; + var menu = $('.page-sidebar-menu'); + var sub = source.next(); + var autoScroll = menu.data("auto-scroll") ? menu.data("auto-scroll") : true; + var slideSpeed = menu.data("slide-speed") ? parseInt(menu.data("slide-speed")) : 200; + parent.children('li.open').children('a').children('.arrow').removeClass('open'); + parent.children('li.open').children('.sub-menu:not(.always-open)').slideUp(200); + parent.children('li.open').removeClass('open'); + var slideOffeset = -200; + if (sub.is(":visible")) { + $('.arrow', source).removeClass("open"); + source.parent().removeClass("open"); + sub.slideUp(slideSpeed, function () { + if (autoScroll == true && $('body').hasClass('page-sidebar-closed') == false) { + if ($('body').hasClass('page-sidebar-fixed')) { + + } else { + dealScrollTo(the, slideOffeset); + } + } + dealSidebarAndContentHeight(); + }); + } else { + $('.arrow', source).addClass("open"); + source.parent().addClass("open"); + sub.slideDown(slideSpeed, function () { + if (autoScroll == true && $('body').hasClass('page-sidebar-closed') == false) { + if ($('body').hasClass('page-sidebar-fixed')) { + dealScrollTo(the, slideOffeset); + } + } + dealSidebarAndContentHeight(); + }); + } + } + var dealSidebarMenu = function () {//这里注册和处理边栏菜单的各类点击事件 + $('.page-sidebar').on('click', 'li > a', function (e) { + if ($(this).next().hasClass('sub-menu') == false) { + if ($('.btn-navbar').hasClass('collapsed') == false) { + $('.btn-navbar').click(); + } + return; + } + if ($(this).next().hasClass('sub-menu always-open')) { + return; + } + dealLiAClick($(this)); + e.preventDefault(); + }); + + // 处理左边导航中的菜单连接,显示在iframe中 + $('.page-sidebar').on('click', ' li > a.iframe', function (e) { + //dealMenuItemClick($(this),e,"page-sidebar") + e.preventDefault(); + var menuItemID=$(this).attr("id"); + if(!!menuItemID&&menuItemID.length>0){ + _setLocationHash(menuItemID); + _hashSource="dhByInterface"; + }//else{ + _isClicked=true; + dealMenuItemClick($(this),e,"page-sidebar"); + //} + }); + // 处理更多菜单的菜单连接,显示在iframe中dropdown-menu + $('.page-breadcrumb').on('click', ' li > a.iframe', function (e) { + var url = $(this).attr("href"); + if(url.length<2) + return; + e.preventDefault(); + dealBreadcrumbBtnMenuItemClick($(this),e); + }); + // 处理可翻页更多菜单中的菜单连接,显示在iframe中dropdown-menu + $('#pageableDiv').on('click', ' div > a.iframe', function (e) { + var url = $(this).attr("href"); + if(url.length<2) + return; + e.preventDefault(); + dealBreadcrumbBtnMenuItemClick($(this),e); + }); + // 处理可翻页更多菜单中的菜单连接,显示在iframe中dropdown-menu + $('#pageableDiv').on('click', ' li > a.iframe', function (e) { + var url = $(this).attr("href"); + if(url.length<2) + return; + e.preventDefault(); + if(e.target){ + var tg=$("span",e.target); + tg=tg.length>0?tg[0]:e.target; + $(".open a>div>span",e.target.parentNode.parentNode.parentNode.parentNode.parentNode).replaceWith(tg.outerHTML); + } + dealBreadcrumbBtnMenuItemClick($(this),e); + }); + + // 处理header下拉菜单中的菜单连接,显示在iframe中 + $('.dropdown').on('click', ' li > a.iframe', function (e) { + var url = $(this).attr("href"); + if(url.length<2) + return; + e.preventDefault(); + dealScrollTo(); + dealstartPageLoading(); + + dealIframe($(this),e) + dealBreadcrumb($(this),false,e); + }); + } + var getSceneURL=function(url){ + if(url&&url.trim().length>0){ + url=url.trim(); + //url= + _sceneURLRootPath=_sceneURLRootPath+url; + } + } + var gurl="";//临时全局变量,存储当前加载的more菜单,如果加载过了,就不再加载了。下面的方法中会用到 + var moreMenusisLoaded=true; + var waittime=null; + var getBreadcrumbRightButtons=function(url,e){ + if (url.length<2){ + return; + } + url=openoFrameWork.handlBaseURL(url); + if (gurl==url){ + if(e===true){ + $('#pageableDiv').show(); + }else if(e&&e.target&&e.currentTarget){ + var defaultDisplay=$(e.target).attr("defaultDisplay"); + defaultDisplay=(!defaultDisplay)?$(e.currentTarget).attr("defaultDisplay"):defaultDisplay; + if(defaultDisplay&&defaultDisplay.trim()=="false"){ + $('#pageableDiv').hide(); + }else{ + $('#pageableDiv').show(); + } + } + return; + + }else{ + gurl=url; + clearMoreOperations(); + } + //处理e参数,注意e可能为null + var breadmenuID=e&&e.data&&e.data.breadcrumbBtnMenuItem&&e.data.breadcrumbBtnMenuItem.length>0?e.data.breadcrumbBtnMenuItem:""; + breadmenuID=breadmenuID.length<=0?(e&&e.breadcrumbBtnMenuItem&&e.breadcrumbBtnMenuItem.length>0?e.breadcrumbBtnMenuItem:""):breadmenuID; + moreMenusisLoaded=false; + $.ajax({ + type: "GET", + cache: false, + url: url, + dataType: "html", + success: function (res) { + try{ + //$('.page-breadcrumb').append(res); + var resScriptsSriped = stripHtmlScripts(res); + //$('.page-breadcrumb').append(resScriptsSriped); + $('.more-botton-zone').children().remove(); + //V5新增逻辑,如果displayType = pageableDiv,那么就用滑动的DIV来显示更多菜单里面的内容,如果没有配置,或为其他值,就按原有方式显示 + var tempDiv = $('
'); + tempDiv.children().remove(); + tempDiv.append(resScriptsSriped); + + //获取UL属性 + var displayType = $('.dropdown-menu',tempDiv).attr('displayType'); + if( displayType && displayType != 'pageableDiv'){ + $('.more-botton-zone').append(resScriptsSriped); + $('#pageableDiv').hide(); + }else{ + var tempUl = $('.dropdown-menu',tempDiv); + if(tempUl.length>0){ + moreOperations(tempUl[0]); + if(e&&e.target&&e.currentTarget){ + var defaultDisplay=$(e.target).attr("defaultDisplay"); + defaultDisplay=(!defaultDisplay)?$(e.currentTarget).attr("defaultDisplay"):defaultDisplay; + if(defaultDisplay&&defaultDisplay.trim()=="false"){ + $('#pageableDiv').hide(); + }else{ + $('#pageableDiv').show(); + } + } + } + } + runHtmlScripts(res); + }catch(ex){ + }finally{ + moreMenusisLoaded=true; + } + groupButtonAuthentication(); + if(breadmenuID.length>0){//面包削导航来的,只需要重新生成面包削即可 + var menuitem=undefined; + var panel = $('.zte-theme-panel'); + var navPosOption = $('.nav-pos-direction', panel).val(); + //var items=$("a[id='"+breadmenuID+"']"); + var items = undefined; + if (navPosOption === "vertical"){ //从垂直菜单里面找 + items=$("#page-sidebar-menu a[id='"+breadmenuID+"']"); + + }else{//从水平菜单里面找 + items=$(".hor-menu a[id='"+breadmenuID+"']"); + } + if (!items || items.length < 1) { + items=$(".page-content a[id='"+breadmenuID+"']"); + } + if(items.length>0){ + for(var i=0;i0) + dealBreadcrumbBtnMenuItemClick(menuitem,e); + } + }, + error: function (xhr, ajaxOptions, thrownError) {//加载操作菜单失败!com_zte_ums_ict_framework_ui_loadmenuerror + $('.page-breadcrumb').append('

'+$.i18n.prop('com_zte_ums_ict_framework_ui_loadmenuerror')+'

'); + moreMenusisLoaded=true; + } + }); + } + + //处理多tab也场景 ----redirect 该标签暂时保留,不建议使用了 + dealMultTabPage=function(clickedObject){ + var url = clickedObject.attr("href"); + if(!url||url.length<2) + return; + var redirect=clickedObject.attr("redirect"); //处理多tab页面的需求 + if (!!redirect&&redirect.length>0){ + var miframe=_iframe==""?"page-mainIframe": _iframe; + var pagemyIframe=$('.page-content .page-content-body .'+miframe); //.page-mainIframe + //var pagemyIframe=$('.page-content .page-content-body .page-mainIframe'); + var oldhref=""; + if(pagemyIframe&&pagemyIframe.length>0){ + oldhref=pagemyIframe.attr("src"); + if(url.split("?")[0]==oldhref.split("?")[0]) + { + eval(redirect); + dealBreadcrumb(clickedObject,false,e); + return true; + } + } + }; + return false; + }; + //处理主菜单面包削导航 + var globleCurrentBreadcrumb=""; + var globleCurrentMainMenuItemID=""; + var dhByBreadcrumb = false; + var dealBreadcrumb=function(clickedObject,notGenUID,e){//notGenUID为true就不重新生成id + var mbreadcrumb=$('.breadcrumbUl'); + openoFrameWork.setPageTitle(clickedObject.find('span').text().trim()); + var clieckedObj= clickedObject.parent('li'); + if(clieckedObj.length == 0){ //分页式更多菜单,a链接的父亲是div + clieckedObj= clickedObject.parent('div'); + } + //如果点击的是F菜单的竖菜单,还需要找到横菜单上的对应父亲加入到clieckedObj + var navPosOption = $('.nav-pos-direction', panel).val(); + var parentid = clickedObject.attr('hparentid'); + var breadcrumGroupButtonSrc=clickedObject.attr("breadcrumGroupButtonSrc"); + globleCurrentMainMenuItemID=clickedObject.attr("id"); + var mhmtl=""; + var url=""; + var tempObj=null; + //var breadChangeType = e? (e.data ? e.data.breadChangeType:null):null; + if( dhByBreadcrumb ){ + mhmtl = dealClickBreadcrumb(clieckedObj); + dhByBreadcrumb = ""; + }else{ + while (clieckedObj&&clieckedObj.length>0){ + if(clieckedObj.children('a')){ + if(!notGenUID){ + url=openoFrameWork.getUniqueID("aid");//+Math.floor(Math.random() * (new Date()).getTime()); + clieckedObj.children('a').attr("name",url); + }else{ + url=clieckedObj.children('a').attr("name"); + } + tempObj=clieckedObj.clone(); + tempObj.children('a').removeClass('iframe'); + tempObj.children('a').removeClass('active'); + tempObj.children('a').attr("href","javascript:openoFrameWork.goToURL('"+url+"');"); + var arrowdown = $(".fa-angle-down", tempObj.children('a')); + if (arrowdown) { + arrowdown.remove(); + } + if(tempObj.children('a').length>0){ + mhmtl=tempObj.children('a')[0].outerHTML+""+mhmtl; + } + //如果是F菜单和横菜单的子竖菜单点击,需要做特殊处理 + if( clieckedObj.parent('ul').attr('id') == fMenuSiderDivId || clieckedObj.parent('ul').attr('id') == megaSiderDivId){ + var id = clieckedObj.children( 'a' ).attr('hparentid'); + //判断是F菜单还是横菜单 + var megaMenu = null; + if(navPosOption == openoFrameWork_menu_horizontal){ + magaMenu = $('#'+megaDivId); + }else if(navPosOption == openoFrameWork_menu_fmenu){ + magaMenu = $('#'+fMenuMegaDivId); + } + clieckedObj = $("a[id=" + id + "]" , magaMenu).parent('li'); + }else{ + clieckedObj=clieckedObj.parents('li'); + } + } + } + if(clieckedObj[0]&&clieckedObj[0].length>0) { + mhmtl=clieckedObj.children('a')[0].outerHTML+""+mhmtl; + } + } + mbreadcrumb.empty(); + $('.more-botton-zone').empty(); + globleCurrentBreadcrumb=mhmtl; + store("globleCurrentBreadcrumb",globleCurrentBreadcrumb); + mbreadcrumb.append(mhmtl); + if(breadcrumGroupButtonSrc&&breadcrumGroupButtonSrc.length>0){ + getBreadcrumbRightButtons(breadcrumGroupButtonSrc,e); + }else{ + $('#pageableDiv').hide(); + } + + }; + //面包屑发起的点击,就不重新生成面包屑,只是把该面包屑的后续节点移出。 + var dealClickBreadcrumb = function(clieckedObj){ + var index = globleCurrentBreadcrumb.indexOf(clieckedObj.children('a').attr("name")); + if( index > -1 ){//截取 + var indexofSign = globleCurrentBreadcrumb.indexOf("",index); + var newBreadcrumb = globleCurrentBreadcrumb.substring(0,indexofSign) + ""; + return newBreadcrumb; + } + } + //处理面包削中菜单点击后的导航(更多菜单的面包屑) + var dealBreadcrumbBtnGroupMenus=function(clickedObject,notGenUID , e ){ + var mbreadcrumb=$('.breadcrumbUl'); + var clieckedObj= clickedObject.parent(); + var breadcrumGroupButtonSrc=clickedObject.attr("breadcrumGroupButtonSrc"); + var mhmtl=""; + var url=""; + var tempObj=null; + var menuid=clickedObject.attr("id"); + if (!breadcrumbBtnMenus.contains(menuid)) {//把当前面包削中的菜单id和该子菜单对应的父菜单关联缓存起来 + breadcrumbBtnMenus.add(menuid,globleCurrentMainMenuItemID); + } + while (clieckedObj&&clieckedObj.length>0){ + tempObj=clieckedObj.clone(); + if(tempObj.children('a')){ + tempObj.children('a').removeClass('iframe'); + url=tempObj.children('a').attr("href"); + tempObj.children('a').attr("onclick","openoFrameWork.openbreadcrumbLink($(this),event);"); + var tempdiv = tempObj.children('a').children('div'); + if( tempdiv.length > 0 ){ + var innerofDiv = tempdiv[0].innerHTML; + tempdiv.remove(); + tempObj.children('a')[0].innerHTML = innerofDiv; + } + if(tempObj.children('a').length>0){ + mhmtl=tempObj.children('a')[0].outerHTML+""+mhmtl; + } + clieckedObj=clieckedObj.parents('li'); + } + + } + if(clieckedObj[0]&&clieckedObj[0].length>0) { + mhmtl=clieckedObj.children('a')[0].outerHTML+""+mhmtl; + } + + if(breadcrumGroupButtonSrc&&breadcrumGroupButtonSrc.length>0){ + getBreadcrumbRightButtons(breadcrumGroupButtonSrc,true); + }else{ + $('#pageableDiv').hide(); + } + mbreadcrumb.empty(); + var category= clickedObject.attr("category");//处理菜单中定义的Category属性 + if(category&&category.length>0){//处理Category属性 + var newIpPort=_menuCategorys.items(category); + if(newIpPort&&newIpPort.ipTitle&&newIpPort.ipTitle.trim()!=""){//如果找到了 + mhmtl=newIpPort.ipTitle+''+mhmtl; + } + } + mhmtl=globleCurrentBreadcrumb+mhmtl; + mbreadcrumb.append(mhmtl); + }; + var isMoreMenuItemClick = false; + var dealBreadcrumbBtnMenuItemClick=function(clickObj,e){ + dealScrollTo(); + var menuItemID=clickObj.attr("id"); + if(!!menuItemID&&menuItemID.length>0){ + _setLocationHash(menuItemID); + var breadmenuID=e&&e.data&&e.data.breadcrumbBtnMenuItem&&e.data.breadcrumbBtnMenuItem.length>0?e.data.breadcrumbBtnMenuItem:""; + _hashSource=breadmenuID&&breadmenuID.length>0?"":"dhByInterface";//hash进来的,不是导航进来的。 + } + if(!(e&&e.breadcrumbBtnMenuItem&&e.breadcrumbBtnMenuItem.length>0)){//如果仅仅是tab跳转设置bread进来的,就框架不处理菜单点击,直接重新建立bread即可 + dealstartPageLoading(); + dealIframe(clickObj,e); + } + dealBreadcrumbBtnGroupMenus(clickObj,false,e); + } + // 固定边栏布局时计算边栏高度. + var _calculateFixedSidebarViewportHeight = function () { + var viewport = _getViewPort(); + var sidebarHeight =viewport.height - $('.header').height() + 1; + if ($('body').hasClass("page-footer-fixed")) { + sidebarHeight = sidebarHeight - (!$('.footer')||$('.footer').length<=0)?0:$('.footer').outerHeight(); + } + return sidebarHeight; + } + // 处理固定边栏 + var dealFixedSidebar = function () { + var menu = $('.page-sidebar-menu'); + if (menu.parent('.slimScrollDiv').size() === 1) { + menu.removeAttr('style'); + $('.page-sidebar').removeAttr('style'); + } + + if ($('.page-sidebar-fixed').size() === 0) { + dealSidebarAndContentHeight(); + return; + } + + var viewport = _getViewPort(); + if (viewport.width >= openoFrameWork_smallView) { + var sidebarHeight = _calculateFixedSidebarViewportHeight(); + dealSidebarAndContentHeight(); + } + } + // 固定边栏时处理菜单 hover 效果. + var dealFixedSidebarHoverable = function () { + if ($('body').hasClass('page-sidebar-fixed') === false) { + return; + } + $('.page-sidebar').off('mouseenter').on('mouseenter', function () { + dealSiderBarMouseenter(); + }); + $('.page-sidebar').off('mouseleave').on('mouseleave', function () { + dealSiderBarMouseLeave(); + }); + } + var dealSiderBarMouseenter=function(){ + var body = $('body'); + var siderbar=$('.page-sidebar'); + if ((body.hasClass('page-sidebar-closed') === false || body.hasClass('page-sidebar-fixed') === false) || $(this).hasClass('page-sidebar-hovering')) { + return; + } + body.removeClass('page-sidebar-closed').addClass('page-sidebar-hover-on'); + var siderbartoggle=$('.sidebar-toggler'); + + if (body.hasClass("page-sidebar-reversed")) { + siderbar.width(_sidebarWidth); + dealSiderBarWidthChange(); + } else { + siderbar.addClass('page-sidebar-hovering'); + siderbar.animate({ + width: _sidebarWidth + }, 350, '', function () { + siderbar.removeClass('page-sidebar-hovering'); + dealSiderBarWidthChange(); + }); + } + } + var dealSiderBarMouseLeave=function(){ + var body = $('body'); + if ((body.hasClass('page-sidebar-hover-on') === false || body.hasClass('page-sidebar-fixed') === false) || $(this).hasClass('page-sidebar-hovering')) { + return; + } + var siderbar=$('.page-sidebar'); + var siderbartoggle=$('.sidebar-toggler'); + if (body.hasClass("page-sidebar-reversed")) { + body.addClass('page-sidebar-closed').removeClass('page-sidebar-hover-on'); + siderbar.width(_sidebarCollapsedWidth); + if(siderbartoggle){ + siderbartoggle.removeAttr('style'); + } + dealSiderBarWidthChange(); + } else { + siderbar.addClass('page-sidebar-hovering'); + siderbar.animate({ + width: _sidebarCollapsedWidth + }, 350, '', function () { + body.addClass('page-sidebar-closed').removeClass('page-sidebar-hover-on'); + dealSiderBarWidthChange(); + siderbar.removeClass('page-sidebar-hovering'); + if(siderbartoggle){ + siderbartoggle.removeAttr('style'); + } + }); + } + + } + //处理style css + var dealAddStyle=function(element, property, value, important) { + var styleText=element.attr('style')?element.attr('style'):""; + styles=styleText.split(";"); + var find=""; + for(i=0;i=0){ + find=styles[i];//看是否已经添加过,如果添加过就需要替换掉 + break; + } + } + styleText=find.length>0?styleText.replace(find,""):styleText; + styleText=(styleText + ';'+property + ':' + value + ((important) ? ' !important' : '') + ';').replace(/;;/g,";"); + element.attr('style',styleText ); + } + var dealSiderBarWidthChange=function(){ + + } + // 处理边栏菜单切换时的关闭和隐藏. + var dealSidebarToggler = function () { + var viewport = _getViewPort(); + if (getCookie('sidebar_closed') === '1' && viewport.width >= openoFrameWork_smallView) { + $('body').addClass('page-sidebar-closed'); + } + $('.page-sidebar, .sidebar-toggler').on('click', '.sidebar-toggler', function (e) { + e.preventDefault(); + var body = $('body'); + var sidebar = $('.page-sidebar'); + if(body.hasClass('page-sidebar-closed')){ + $(this).removeAttr('style'); + } + } ); + $('.page-sidebar, .header').on('click', '.sidebar-toggler', function (e) { + var body = $('body'); + var sidebar = $('.page-sidebar'); + if ((body.hasClass("page-sidebar-hover-on") && body.hasClass('page-sidebar-fixed')) || sidebar.hasClass('page-sidebar-hovering')) { + body.removeClass('page-sidebar-hover-on'); + sidebar.css('width', '').hide().show(); + dealSidebarAndContentHeight(); //fix content & sidebar height + setCookie('sidebar_closed', '0'); + dealSiderBarWidthChange(); + e.stopPropagation(); + runResponsiveHandlers(); + return; + } + $(".sidebar-search", sidebar).removeClass("open"); + var panel = $('.zte-theme-panel'); + var sidebarPosOption = $('.sidebar-pos-option', panel).val(); + var pcontent = $("[class='page-content']"); + if (body.hasClass("page-sidebar-closed")) { + body.removeClass("page-sidebar-closed"); + if (body.hasClass('page-sidebar-fixed')) { + sidebar.css('width', ''); + } + setCookie('sidebar_closed', '0'); + pcontent.css("marginLeft",_sidebarWidth); + dealSiderBarWidthChange(); + } else { + body.addClass("page-sidebar-closed"); + $(this).removeAttr('style'); + setCookie('sidebar_closed', '1'); + pcontent.css("marginLeft", _sidebarCollapsedWidth); + dealSiderBarWidthChange(); + } + //针对侧边栏伸缩的情况需加入对.page-content的判断。 + dealSidebarAndContentHeight(true); + runResponsiveHandlers(); + }); + } + // 处理水平菜单 + var dealHorizontalMenu = function () { + $('.header').on('click', '.hor-menu .hor-menu-search-form-toggler', function (e) { + if ($(this).hasClass('off')) { + $(this).removeClass('off'); + $('.header .hor-menu .search-form').hide(); + } else { + $(this).addClass('off'); + $('.header .hor-menu .search-form').show(); + } + e.preventDefault(); + }); + // 处理水平菜单 处理header下拉菜单中的菜单连接,显示在iframe中 + $('.header').on('click', ' li > a.iframe', function (e) { + //dealMenuItemClick($(this),e,"header"); + e.preventDefault(); + var menuItemID=$(this).attr("id"); + if(!!menuItemID&&menuItemID.length>0){ + _setLocationHash(menuItemID); + _hashSource="dhByInterface"; + }//else{ + _isClicked=true; + dealMenuItemClick($(this),e,"header"); + //} + }); + //处理TAB点击 + $('.header').on('click', '.hor-menu a[data-toggle="tab"]', function (e) { + e.preventDefault(); + var nav = $(".hor-menu .nav"); + var active_link = nav.find('li.current'); + $('li.active', active_link).removeClass("active"); + $('.selected', active_link).remove(); + var new_link = $(this).parents('li').last(); + new_link.addClass("current"); + new_link.find("a:first").append(''); + }); + } + // 增加一个对服务端的心跳 + var doHeartbeat = function() { + //心跳超时次数 + var heartBeatTimes = 0; + return setInterval(function() { + var userName; + if( userName == null ){ + var userName = openoFrameWork_conf.userName; + } + var heartUrl = FrameConst.REST_HEARTBEAT + "?username=" + encodeURIComponent(userName); + $.ajax(heartUrl, { + dataType : "text", + cache : false + }).done(function(data) { + // if (data != "true") { //收到不属于取值范围内的回复,说明出现不可预知情况,取消心跳。是原framework.js中的逻辑,比较奇怪,先保留注释。 + // disableHeartbeat(); + // } + //收到心跳回应消息,心跳超时次数置0 + if( data == "true" ){ + heartBeatTimes = 0; + } + }); + heartBeatTimes++; + //心跳超时6次即1分钟,转到登录界面,认为链路断。 + if(heartBeatTimes >= 6){ + disableHeartbeat(); + //console.log(com_zte_ums_aos_framework_ui_heartbeat_timeout); + bootbox.alert($.i18n.prop('com_zte_ums_aos_framework_ui_heartbeat_fail'), function () { + window.location.replace("login.html"); + }); + } + }, 10000); + }; + if( FrameConst.do_heartbeat ){ + var heartbeatTimer = doHeartbeat(); + } + window.enableHeartbeat = function() { + if (!heartbeatTimer) { + //重新启动心跳功能,心跳超时次数置0 + heartBeatTimes = 0; + heartbeatTimer = doHeartbeat(); + return "Enabled"; + } + return "Already enabled!"; + }; + window.disableHeartbeat = function() { + if (heartbeatTimer) { + clearInterval(heartbeatTimer); + heartbeatTimer = null; + return "Disabled"; + } + return "Already disabled!"; + }; + window.doLogout = function(){ + window.location=FrameConst.REST_LOGOUT; + }; + //处理ict注销确认 + $('#trigger_logout').click(function(){ + bootbox.confirm($.i18n.prop('com_zte_ums_ict_framework_ui_confirmlogout'), function(result) { //你确认要注销吗? + if(result){ + doLogout(); + } + }); + }); + // Handle full screen mode toggle + var isscreenFull=false; + var dealFullScreenMode = function() { + // 处理全屏事件 + function toggleFullScreen() { + if(!screenfull.supportsFullScreen){//不支持全屏 + if (isIE&&typeof window.ActiveXObject !== "undefined") { // Older IE. + var wscript = new ActiveXObject("WScript.Shell"); + if (wscript !== null) { + wscript.SendKeys("{F11}"); + isscreenFull=!isscreenFull; + } + }else{ + isscreenFull=screenfull.supportsFullScreen; + }; + }else{ + screenfull.isFullScreen?screenfull.exitFullScreen():screenfull.requestFullScreen(); + isscreenFull= screenfull.isFullscreen; + } + setTimeout(function(){ + if(isscreenFull){ + $("#fullscreen_label").text($.i18n.prop('com_zte_ums_ict_framework_ui_group_exitfullscreen')); + }else{ + $("#fullscreen_label").text($.i18n.prop('com_zte_ums_ict_framework_ui_group_fullscreen')); + } + },500); + } + + $('#trigger_fullscreen').click(function() { + toggleFullScreen(); + }); + } + //清理当前正在显示的iframe之外缓存的iframe, + var dealClearCachedIframes=function(isall){ + if (cachedIframes.count()>0) { + for (var i in cachedIframes.hash()) { + var pagemyIframe=$('.page-content .page-content-body .'+i); + if(pagemyIframe&&pagemyIframe.length>0){ + if(isall==true){ + pagemyIframe.attr("src",""); + pagemyIframe.remove(); + }else if(i!=_iframe) + pagemyIframe.attr("src",""); + pagemyIframe.remove(); + } + } + } + cachedIframes.clear(); + if (cachedIframesObject.count()>0) {//清理缓存的iframe实体对象。 + for (var i in cachedIframesObject.hash()) { + if(i!=_iframe) + cachedIframesObject.remove(i); + } + } + } + var lastSelectedLayout = ''; + var dealTheme = function () { + var panel = $('.zte-theme-panel'); + if ($('body').hasClass('page-boxed') == false) { + $('.layout-option', panel).val("fluid"); + } + $('.sidebar-option', panel).val("default"); + $('.language-option', panel).val(defaultLanage); + $('.header-option', panel).val("fixed"); + $('.footer-option', panel).val("default"); + if ( $('.sidebar-pos-option').attr("disabled") === false) { + $('.sidebar-pos-option', panel).val(openoFrameWork.isRTL() ? 'right' : 'left'); + } + var _resetLayout = function () { + dealResetLayout(); + } + var _setLayout = function () { + dealSetLayout(); + } + var setColor = function (color) { + var color_ = (openoFrameWork.isRTL() ? color + '-rtl' : color); + $('#style_color').attr("href", ICTFRAME_CONST_THEME_COLOR_CSS_PREFFIX + color_ + ".css"); + setCookie('style_color', color); + syncColorCSS(); + } + $('.toggler', panel).click(function () { + $('.toggler').hide(); + $('.toggler-close').show(); + $('.zte-theme-panel > .theme-options').show(); + }); + + $('.toggler-close', panel).click(function () { + $('.toggler').show(); + $('.toggler-close').hide(); + $('.zte-theme-panel > .theme-options').hide(); + }); + $('.theme-colors > ul > li', panel).click(function () { + var color = $(this).attr("data-style"); + setColor(color); + $('ul > li', panel).removeClass("current"); + $(this).addClass("current"); + }); + $('.layout-option,.header-option, .sidebar-option, .footer-option, .sidebar-pos-option, .nav-pos-direction', panel).change(_setLayout); + if (getCookie('style_color') != undefined) { + setColor(getCookie('style_color')); + } + $('.language-option', panel).change(function(){ + var languageOption = $('.language-option', panel).val(); + setCookie('language-option', languageOption); + window.location.reload(); + }); + } + var dealResetLayout = function () { + $("body"). + removeClass("page-boxed"). + removeClass("page-footer-fixed"). + removeClass("page-sidebar-fixed"). + removeClass("page-header-fixed"). + removeClass("page-sidebar-reversed"); + $('.header > .header-inner').removeClass("container"); + if ($('.page-container').parent(".container").size() === 1) { + $('.page-container').insertAfter('body > .clearfix'); + } + if ($('.footer > .container').size() === 1) { + $('.footer').html($('.footer > .container').html()); + } else if ($('.footer').parent(".container").size() === 1) { + $('.footer').insertAfter('.page-container'); + } + $('body > .container').remove(); + } + /* + * 此方法在客户端初始化和设置面板上选择菜单方向的时候用。 + * param navPosOption + */ + var dealNavPos = function(navPosOption) { + // 横竖边栏切换功能禁用,则返回 + var panel = $('.zte-theme-panel'); + if ($('.nav-pos-direction', panel).attr("disabled") == "disabled") { + return; + } + var sidermenu = $("#page-sidebar-menu"); + var hormenu = $("#main_hormenu"); + var sidermenu = $("#page-sidebar-menu"); + var hormenu = $("#main_hormenu"); + var horSiderMenu = $('#' + megaSiderDivId ); + var fhorMenu = $("#" + fMenuMegaDivId); + var fsiderMenu = $("#" + fMenuSiderDivId); + var pcontent = $("[class='page-content']"); + if (sidermenu && sidermenu.length > 0 && hormenu && hormenu.length > 0 && fhorMenu && fhorMenu.length > 0) { + if (navPosOption === openoFrameWork_menu_horizontal) { + sidermenu.css('display','none');// 侧边栏隐藏 + fhorMenu.css('display','none'); + fsiderMenu.css('display','none'); + pcontent.css("marginLeft",0); + $("body").addClass("page-full-width");//调整内容显示 + hormenu.css("display", "block");//显示水平菜单栏 + // 导航位置为水平菜单时,边栏和边栏位置为默认和靠左,且将其切换功能禁用掉 + $('.sidebar-option', panel).val("default"); + $('.sidebar-option', panel).attr("disabled", true); + $('.sidebar-pos-option', panel).val("left"); + $('.sidebar-pos-option', panel).attr("disabled", true); + } else if (navPosOption === openoFrameWork_menu_vertical ) { + $("body").removeClass("page-full-width"); + sidermenu.css('display','block');//侧边栏显示 + var body = $('body'); + if (body.hasClass("page-sidebar-closed")) { + pcontent.css("marginLeft", _sidebarCollapsedWidth); + } else { + pcontent.css("marginLeft", _sidebarWidth); + } + hormenu.css("display", "none");//隐藏水平菜单栏 + fhorMenu.css('display','none'); + fsiderMenu.css('display','none'); + horSiderMenu.css('display','none'); + $('.sidebar-option', panel).attr("disabled", false); + $('.sidebar-pos-option', panel).attr("disabled", false); + } else if(navPosOption === openoFrameWork_menu_fmenu ){ + sidermenu.css('display','none');// 侧边栏隐藏 + hormenu.css("display", "none");//隐藏水平菜单栏 + fsiderMenu.css('display','none'); + fhorMenu.css('display','block'); + pcontent.css("marginLeft",0); + $("body").addClass("page-full-width");//调整内容显示 + // 导航位置为水平菜单时,边栏和边栏位置为默认和靠左,且将其切换功能禁用掉 + $('.sidebar-option', panel).val("default"); + $('.sidebar-option', panel).attr("disabled", true); + $('.sidebar-pos-option', panel).val("left"); + $('.sidebar-pos-option', panel).attr("disabled", true); + } + } + } + var dealSetLayout = function(){ + var panel = $('.zte-theme-panel'); + var layoutOption = $('.layout-option', panel).val(); + var languageOption = $('.language-option', panel).val(); + var headerOption = $('.header-option', panel).val(); + var footerOption = $('.footer-option', panel).val(); + var navPosOption = $('.nav-pos-direction', panel).val(); + dealNavPos(navPosOption); + var sidebarOption = $('.sidebar-option', panel).val(); + var sidebarPosOption = $('.sidebar-pos-option', panel).val(); + if (sidebarOption == "fixed" && headerOption == "default") { + alert($.i18n.prop('com_zte_ums_ict_framework_ui_fixedsidedefaultheaderError')); //页头不支持固定边栏,先固定页头才能固定边栏. + $('.header-option', panel).val("fixed"); + $('.sidebar-option', panel).val("fixed"); + sidebarOption = 'fixed'; + headerOption = 'fixed'; + } + if (sidebarOption == "fixed" && sidebarPosOption == "right") { + alert($.i18n.prop('com_zte_ums_ict_framework_ui_fixedsiderightpositionError')); //固定边栏情况下,边栏不能靠右。. + $('.sidebar-pos-option', panel).val("left"); + sidebarPosOption = 'left'; + } + dealResetLayout(); // reset layout to default state + if (layoutOption === "boxed") { + $("body").addClass("page-boxed"); + // set header + $('.header > .header-inner').addClass("container"); + var cont = $('body > .clearfix').after('
'); + // set content + $('.page-container').appendTo('body > .container'); + // set footer + if (footerOption === 'fixed') { + $('.footer').html('
' + $('.footer').html() + '
'); + } else { + $('.footer').appendTo('body > .container'); + } + } + if (lastSelectedLayout != layoutOption) { + runResponsiveHandlers(); + } + lastSelectedLayout = layoutOption; + //header + if (headerOption === 'fixed') { + $("body").addClass("page-header-fixed"); + $(".header").removeClass("navbar-static-top").addClass("navbar-fixed-top"); + } else { + $("body").removeClass("page-header-fixed"); + $(".header").removeClass("navbar-fixed-top").addClass("navbar-static-top"); + } + //sidebar + if ($('body').hasClass('page-full-width') === false) { + if (sidebarOption === 'fixed') { + $("body").addClass("page-sidebar-fixed"); + } else { + $("body").removeClass("page-sidebar-fixed"); + } + } + //footer + if (footerOption === 'fixed') { + $("body").addClass("page-footer-fixed"); + } else { + $("body").removeClass("page-footer-fixed"); + } + //sidebar position + if (openoFrameWork.isRTL()) { + if (sidebarPosOption === 'left') { + $("body").addClass("page-sidebar-reversed"); + $('#frontend-link').tooltip('destroy').tooltip({placement: 'right'}); + } else { + var pcontent = $("[class='page-content']"); + pcontent.css("marginLeft",0);//侧边栏靠右,则左边内容填充为0 + $("body").removeClass("page-sidebar-reversed"); + $('#frontend-link').tooltip('destroy').tooltip({placement: 'left'}); + } + } else { + if (sidebarPosOption === 'right') { + var pcontent = $("[class='page-content']"); + pcontent.css("marginLeft",0);//侧边栏靠右,则左边内容填充为0 + $("body").addClass("page-sidebar-reversed"); + $('#frontend-link').tooltip('destroy').tooltip({placement: 'left'}); + } else { + $("body").removeClass("page-sidebar-reversed"); + $('#frontend-link').tooltip('destroy').tooltip({placement: 'right'}); + } + } + dealSidebarAndContentHeight(); + dealFixedSidebar(); + dealFixedSidebarHoverable(); + dealSiderBarWidthChange(); + setCookie('layout-option', layoutOption); + setCookie('language-option', languageOption); + setCookie('header-option', headerOption); + setCookie('sidebar-option', sidebarOption); + setCookie('sidebar-pos-option', sidebarPosOption); + setCookie('nav-pos-direction', navPosOption); + } + var setCookie = function (key, value) { + if (store) { + store(key, value); + } + } + var getCookie = function (key) { + if (store) { + return store(key); + } else { + return undefined; + } + } + /*下面处理前进后退和锚点访问*/ + var _getLocationHash = function() { + return location.hash.replace("#_", ""); + } + /*统一入口设置锚点*/ + var _setLocationHash = function(menuItemID) { + location.hash = getLocationHashByMenuId(menuItemID); + } + var getLocationHashByMenuId = function(menuItemID){ + return "#_" + menuItemID; + } + // hash control + var loadCurrentHash = function(e,data){ + var locationhash = _getLocationHash(); //important + if(!!locationhash&&locationhash.length>0){ + if(_hashSource.trim()=="dhByInterface"){ + _hashSource=""; + }else{ + processChangedHash(locationhash,data); + } + } + } + // hash control 这种写法安全点 + var processChangedHash = function(path) { + var id = path; + var action = undefined; + var spIndex = path.indexOf("/"); + if(spIndex != -1) { + id = path.substring(0,spIndex); + action = path.substring(spIndex+1); + } + openoFrameWork.goToURLByIDAndNewAction(id,action); + } + var syncColorCSS=function(){//注册皮肤切换事件处理函数,处理iframe中的皮肤切换 + var pagemyIframe=null; + if (cachedIframes.count()>0) { + for (var i in cachedIframes.hash()) { + pagemyIframe=$('.page-content .page-content-body .'+i); + if(pagemyIframe&&pagemyIframe.length>0){ + openoFrameWork.SyncCSS(pagemyIframe[0],1,""); + } + } + } + } + var getCurrentVisibleIframe=function(){ + var pagemyIframe=null; + if (cachedIframes.count()>0) { + for (var i in cachedIframes.hash()) { + if(cachedIframes.items(i)===1){ + pagemyIframe=$('.page-content .page-content-body .'+i); + } + } + } + return pagemyIframe; + } + //处理跨域请求代理,通过该代理进行iframe间传递参数,注意这里的代理页面proxy.html必须部署到要跨域的对端域的服务器web根目录下 + var dealCrossProxy=function(ifrm,crossproxysrc,ifmHeadlins,flag){//crossproxysrc这个是proxy.html对应的url根路径 + var url=$.url(openoFrameWork.getCurrentScript(document)); + var proxyHtmlPath=url.attr("directory")+"proxy/proxy.html"//这中情况适用于使用了该界面集成框架的应用系统 + var _ifmProxy=$(''); + var _ifm=$('#ifm_Proxy'); + _ifm.hide(); + var pageContentBody=$('.page-content .page-content-body'); + var linksrcs=new Array(); + var linksids=new Array(); + var linktyps=new Array(); + var _src=""; + for (i=0;i0){ + _src=ifmHeadlins[i].link.src; + linktyps.push("javascriptfile"); + }else{ + _src=ifmHeadlins[i].link.text; + linktyps.push("javascripttext"); + } + }else{ + linktyps.push("undefined"); + } + linksrcs.push(_src); + linksids.push({"pos":ifmHeadlins[i].pos,"scope":ifmHeadlins[i].scope,"id":ifmHeadlins[i].link.id}); + } + var parm={iFrame:ifrm,cssLinktyps:linktyps,cssLinksrcs:linksrcs,cssLinkids:linksids,origin:crossproxysrc,flag:flag}; + if(_ifm&&_ifm.length<=0){//没有添加过 + _ifmProxy.appendTo(pageContentBody); + _ifmProxy.one('load',parm,function(e){ + var data={iFrame:e.data.iFrame,cssLinktyps:e.data.cssLinktyps,cssLinksrcs:e.data.cssLinksrcs,cssLinkids:e.data.cssLinkids,flag:flag}; + $('#ifm_Proxy')[0].contentWindow.postMessage(data,e.data.origin);//window.location.origin + }); + }else if(_ifm.attr("oldproxyorigin")!=crossproxysrc){//代理已经添加过了,看是否是同一个网站的代理,如果不是需要重新加载 + _ifm.attr("src",""); + _ifm.attr("oldproxyorigin",crossproxysrc); + _ifm.one('load',parm,function(e){ + var data={iFrame:e.data.iFrame,cssLinktyps:e.data.cssLinktyps,cssLinksrcs:e.data.cssLinksrcs,cssLinkids:e.data.cssLinkids,flag:flag}; + $('#ifm_Proxy')[0].contentWindow.postMessage(data,e.data.origin);//window.location.origin + }); + _ifm.attr("src",_ifmProxy.attr("src")); + }else{//已经添加过,直接触发消息发送即可 + var data={iFrame:parm.iFrame,cssLinktyps:parm.cssLinktyps,cssLinksrcs:parm.cssLinksrcs,cssLinkids:parm.cssLinkids,flag:flag}; + _ifm[0].contentWindow.postMessage(data,parm.origin);//window.location.origin + } + } + return { + init: function () { + if(zte_http_headers){ + store("zte_http_headers",zte_http_headers); + } + dealInit(); + dealResponsiveOnResize(); + dealResponsiveOnInit(); + dealClearCachedIframes(true); ////清理当前正在显示的iframe之外缓存的iframe, + breadcrumbBtnMenus.clear(); + dealFixedSidebar(); // deals fixed sidebar menu + dealFixedSidebarHoverable(); // deals fixed sidebar on hover effect + dealSidebarMenu(); // deals main menu + dealHorizontalMenu(); // deals horizontal menu + dealSidebarToggler(); // deals sidebar hide/show + dealTheme(); // deals style customer tool + dealSetLayout(); + $(function() { + $(window).on('hashchange',function(){ + loadCurrentHash(); + }); + }); + dealFullScreenMode(); // deals full screen + $("#header_dropdown_user").css('display','block'); + $("#com_zte_ums_ict_framework_img_netnumenLogo").css('display','inline'); + $("#com_zte_ums_ict_framework_ui_main_title").css('display','inline'); + handeCtxMenuitem(); + }, + //公开清理缓存的所有Iframe的方法:isALL==true则清理所有,否则清理当前正在显示的iframe之外缓存的iframe,。 + clearCachedIframes:function(isAll){ + dealClearCachedIframes(isAll); + }, + + setBaseURLRoot:function(ipportStr){//菜单url的跟ip和端口例如:http://10.74.151.122:21180 + if (store) { + store('baseURLRoot', ipportStr); + } + var url = $.url(ipportStr); + location.hash=url.attr('fragment'); + var auth=url.attr('query'); + if (store) { + store('baseURLRootAuth', auth); + } + }, + getBaseURLRoot:function(ipportStr){//菜单url的跟ip和端口例如:http://10.74.151.122:21180 + var rooturl=""; + if (store) { + rooturl=store('baseURLRoot'); + } + return !rooturl?"":rooturl; + }, + clearBaseURLRoot:function(){//菜单url的跟ip和端口例如:http://10.74.151.122:21180 + if (store) { + store('baseURLRoot', "",-1); + } + }, + setPageTitle:function(title){//设置页面标题 + $('title').html(title+" - "+gdocTitle); + }, + getLanguage:function(){//获取语言 + return openoFrameWork_conf.acceptLanguage; + }, + + getLocationHash:function(){ + return _getLocationHash(); + }, + setSceneURLRootPath:function(sceneURLRootPath){ + if(sceneURLRootPath&&sceneURLRootPath.trim().length>0){//如果定义了场景的全局参数 + _sceneURLRootPath=sceneURLRootPath.trim(); + if(_sceneURLRootPath.charAt(_sceneURLRootPath.length-1)!='/') + { + _sceneURLRootPath=_sceneURLRootPath+'/'; + } + } + }, + //public function to add callback a function which will be called on window resize + addResponsiveHandler: function (func) { + responsiveHandlers.push(func); + }, + + hiddenAlarmLight:function(){ + hideAlarmLight(); + }, + + hiddenMenu:function(){ + hidemenu(); + }, + setBreadcrumbByMenuID:function(id){ + //var breaditem=$('#'+id); + var menuitem=undefined; + // var items=$("a[id='"+id+"']"); + var items = undefined; + var panel = $('.zte-theme-panel'); + var navPosOption = $('.nav-pos-direction', panel).val(); + if (navPosOption === "vertical"){ //从垂直菜单里面找 + items=$("#page-sidebar-menu a[id='"+id+"']"); + if (!items || items.length < 1) { + items=$(".page-content a[id='"+id+"']"); + } + }else if(navPosOption === openoFrameWork_menu_horizontal){//从水平菜单里面找 + items=$("#main_hormenu a[id='"+id+"']"); + if(items.length == 0){ + //横菜单没有找到,再在横菜单的子菜单找一次 + items=$("#page-megachild-sidebar-menu a[id='"+id+"']"); + } + }else if(navPosOption === openoFrameWork_menu_fmenu){ + items=$("#f_hormenu a[id='"+id+"']"); + if(items.length == 0){ + //横菜单没有找到,再在竖菜单找一次。 + items=$("#page-f-sidebar-menu a[id='"+id+"']"); + } + } + var isbreadcrumbMenuItem=false; + if(items.length>0){ + for(var i=0;i0){ + if(isbreadcrumbMenuItem){ + dealBreadcrumbBtnGroupMenus(menuitem,false); + }else{ + dealBreadcrumb(menuitem,true,null); + } + }else{ + var breadcrumbBtnMenuItemParent=""; + if(!menuitem||menuitem.length<=0){//没有找到该菜单,可能是面包削中的,需要额外处理 + var menuItemID=id; + if (breadcrumbBtnMenus.contains(menuItemID)) {//有缓存 + breadcrumbBtnMenuItemParent="#"+breadcrumbBtnMenus.items(menuItemID); + menuitem=$(breadcrumbBtnMenuItemParent); + //_breadcrumbSource=true; + } + } + var parm=undefined; + if(breadcrumbBtnMenuItemParent&&breadcrumbBtnMenuItemParent.length>0){ + parm={breadcrumbBtnMenuItem:menuItemID}; + } + if(parm&&menuitem&&menuitem.length>0) { + dealBreadcrumb(menuitem,true,parm); + } + } + }, + setSiderbarCollapseWidth:function(width){ + _sidebarCollapsedWidth = width; + }, + getSiderbarCollapseWidth:function(){ + return _sidebarCollapsedWidth; + }, + setSidebarWidth:function(width){ + _sidebarWidth = width; + }, + getSidebarWidth:function(){ + return _sidebarWidth; + }, + //2015年10月26日新增动态切换菜单的功能,这里的菜单还需要再次更换菜单项访问的ip端口信息 + handlBaseURL:function(url){ + var baseURLRoot=openoFrameWork.getBaseURLRoot(); + if (baseURLRoot.length>0) {//2015年10月26日新增动态切换菜单的功能,这里的菜单还需要再次更换菜单项访问的ip端口信息 + baseURLRoot=openoFrameWork.getDomainURL(baseURLRoot);//去掉ip和port后多余的部分 + console.log("old a link href url:"+url); + url=baseURLRoot+url.replace(openoFrameWork.getDomainURL(url),""); + console.log("baseURLRoot:"+baseURLRoot+" newURL:"+url); + }; + return url; + }, + + startPageLoading: function(message) { + dealstartPageLoading(message); + }, + stopPageLoading: function() { + dealstopPageLoading(); + }, + //public function to get a paremeter by name from URL + getLocationURLParameter: function (paramName,separator) { + var searchString = decodeURIComponent(window.location.search.substring(1)).toLowerCase(), + i, val, params = searchString.split(separator?separator:"&"); + paramName=paramName.toLowerCase(); + for (i = 0; i < params.length; i++) { + val = params[i].split("="); + if (val[0] == paramName) { + return unescape(val[1]); + } + } + return null; + }, + //public function to get a paremeter by name from URL + getURLParameter: function (paramName,url) { + var searchString = decodeURIComponent(url).toLowerCase(), + i, val, params = searchString.split("&"); + paramName=paramName.toLowerCase(); + for (i = 0; i < params.length; i++) { + val = params[i].split("="); + if (val[0] == paramName) { + return unescape(val[1]); + } + } + return null; + }, + // check for device touch support + isTouchDevice: function () { + return isTouch; + }, + getUniqueID: function(prefix) { + return prefix+'_' + Math.floor(Math.random() * (new Date()).getTime()); + }, + // check IE8 mode + isIE8: function () { + return isIE8; + }, + // check IE9 mode + isIE9: function () { + return isIE9; + }, + //check RTL mode + isRTL: function () { + return isRTL; + }, + getViewPort:function(){ + return _getViewPort(); + }, + // get layout color code by color name + getLayoutColorCode: function (name) { + if (layoutColorCodes[name]) { + return layoutColorCodes[name]; + } else { + return ''; + } + } , + fixContentHeight: function () { + dealSidebarAndContentHeight(); + }, + dealAtoIframe:function(aObj,event){ + var containerStr=aObj.parentsUntil('.page-container').hasClass('page-sidebar')?'page-sidebar':"";// + containerStr=aObj.parentsUntil('.header-inner').hasClass('hor-menu')?'header':containerStr; + dealMenuItemClick(aObj,event,containerStr); + _isClicked=false; + }, + getDomainURL:function(urlAddress){ + var url = $.url(urlAddress); + var protocol=url.attr('protocol'); + var host=url.attr('host'); + var port=url.attr('port'); + var crossOrign=protocol+"://"+host+(port.length>0?":"+port:""); + return crossOrign; + }, + getCurrentScript:function(doc) {//doc为 document对象 + /* 注意该功能在其他脚本中调用时出safari获取到的脚本路径为本方法所在脚本的路径, + 其他浏览器获取到的为调用该方法的脚本所在路径 + 取得正在解析的script节点 + */ + if(doc&&doc.currentScript) { //firefox 4+ + console.log("0、 "+doc.currentScript.src); + return doc.currentScript.src; + } + // 参考 https://github.com/samyk/jiagra/blob/master/jiagra.js + var stack; + try { + a.b.c(); //强制报错,以便捕获e.stack + } catch(e) {//safari的错误对象只有line,sourceId 或者高版本还有sourceURL + stack = e.stack; + if(e.sourceURL){//safari 浏览器没有e.stack但有e.sourceURL + stack=e.sourceURL; + }else if(!stack && window.opera){ + //opera 9没有e.stack,但有e.Backtrace,但不能直接取得,需要对e对象转字符串进行抽取 + stack = (String(e).match(/of linked script \S+/g) || []).join(" "); + } + console.log("1、 "+stack); + } + if(stack) { + /*e.stack最后一行在所有支持的浏览器大致如下: + *chrome23: + * at http://113.93.50.63/data.js:4:1 + *firefox17: + *@http://113.93.50.63/query.js:4 + *opera12: + *@http://113.93.50.63/data.js:4 + *IE10: + * at Global code (http://113.93.50.63/data.js:4:1) + */ + console.log("2、 "+stack); + stack = stack.split( /[@ ]/g).pop();//取得最后一行,最后一个空格或@之后的部分 + stack = stack[0] == "(" ? stack.slice(1,-1) : stack; + console.log("3、 "+stack); + return stack.replace(/(:\d+)?:\d+$/i, "");//去掉行号与或许存在的出错字符起始位置 + } + if(doc){ + var nodes = doc.getElementsByTagName("script"); //只在head标签中寻找 + for(var i = 0, node; node = nodes[i++];) { + if(node.readyState === "interactive") { + console.log("4、 "+(node.className = node.src)); + return node.className = node.src; + } + } + } + }, + /*下面的flag为0表示默认不触发孙子iframe中的onload事件,为1表示要触发,flag为10则对cssSrc重复执行,其他不做重复执行*/ + SyncCSS:function(ifrm,flag,cssSrc){//将主框架中的皮肤css应用到打开的iframe页面中 + if(!ifrm)return; + var ifmHeadlins = new Array(); + if(cssSrc&&cssSrc.length>0&&cssSrc.endWith(".css")){ + var _div = $(''); + var csslink=document.createElement("link"); + csslink.href=_div[0].href;//这里同步菜单定义中cssSrc属性指定的css文件到iframe + _div = null; + csslink.rel="stylesheet"; + csslink.type="text/css"; + csslink.id="ifram_csssrc"; + ifmHeadlins.push({"pos":"head","scope":"all","link":csslink});//pos是添加到子iframe中的位置,scope是子窗体作用返回,one表示直接子窗体,all表示嵌套所有子窗体 + } + if(flag!=10){//当flag为10时下面的css和js都不执行 + if($('#style_color').length>0){ + var csslink=document.createElement("link"); + csslink.href=$('#style_color')[0].href.replace(".css","_ifrm.css");//这里同步的皮肤页面修改为原皮肤页面文件名后缀添加ifrm的css皮肤文件 + csslink.rel="stylesheet"; + csslink.type="text/css"; + csslink.id="style_color"; + ifmHeadlins.push({"pos":"head","scope":"all","link":csslink});//pos是添加到子iframe中的位置,scope是子窗体作用返回,one表示直接子窗体,all表示嵌套所有子窗体 + } + // 将 font-awesome字体图标应用到模块iframe + if($('#font_awesome').length>0){ + var awesomelink=document.createElement("link"); + awesomelink.href=$('#font_awesome')[0].href; + awesomelink.rel="stylesheet"; + awesomelink.type="text/css"; + awesomelink.id="font_awesome"; + ifmHeadlins.push({"pos":"head","scope":"all","link":awesomelink}); + } + // 将pym.js or pym.min.js应用到模块iframe + var pymjsObj=$("script[src*='/pym.']");//模糊查找 + pymjsObj=pymjsObj.length>0?pymjsObj:$("script[src*='/pym1.']"); + if(pymjsObj.length>0){ + var pymjs=document.createElement("script"); + pymjs.src=pymjsObj[0].src; + pymjs.type="text/javascript"; + pymjs.id=!!pymjsObj[0].id?pymjsObj[0].id:"pymjs"; + ifmHeadlins.push({"pos":"head","scope":"one","link":pymjs}); + pymjs=document.createElement("script"); //pym脚本文件加载后要执行new pym.Child()进行iframe子窗体实例化,便于子窗体和父窗体通讯new pym.Child({ id: '"+_iframe+"' ,polling: 1000}) + var frameid=(_iframe.split('-').length>0?_iframe.split('-')[1]:"1"); + pymjs.text="var t1;function pmchd(){console.log('In the frame "+_iframe+",pym code call is begining; '+(typeof pym!= 'undefined'));if(typeof pym != 'undefined'){pymChild"+frameid+" = new pym.Child({ id: 'pdiv_"+_iframe+"' ,polling: 500});window.clearInterval(t1); }};t1 = window.setInterval(pmchd,5);"; + pymjs.type="text/javascript"; + pymjs.id="pymChild"; + ifmHeadlins.push({"pos":"htmlend","scope":"one","link":pymjs}); + } + // 将hk.js or hk.min.js应用到模块iframe + var hkjsObj=$("script[src*='/hk.']");//模糊查找 + hkjsObj=hkjsObj.length>0?hkjsObj:$("script[src*='/hk1.']"); + if(hkjsObj.length>0){ + var hkjs=document.createElement("script"); + hkjs.src=hkjsObj[0].src; + hkjs.type="text/javascript"; + hkjs.id=!!hkjsObj[0].id?hkjsObj[0].id:"hkjs"; + ifmHeadlins.push({"pos":"head","scope":"one","link":hkjs}); + hkjs=document.createElement("script"); ////hk.js 加载后拦截ajax请求进行转发 + } + } + var crossOrign=openoFrameWork.getDomainURL(ifrm.src); + if( window.location.origin==crossOrign){ //第一层同域处理 + for (i=0;i0){ + var ifmHeadlins2 = new Array(); + for (i=0;i0){ + console.log('跨域访问: 系统将进入跨域访问代理处理流程 '); + dealCrossProxy(childifrms[j].name,childOrign,ifmHeadlins2,flag); + } + } + } + } + }else{ + if(ifmHeadlins.length>0){ + console.log('跨域访问: 系统将进入跨域访问代理处理流程 '); + dealCrossProxy(ifrm.name,crossOrign,ifmHeadlins,flag); + } + } + }, + goToURL:function(url){ + dhByBreadcrumb = true;//全局变量,声明此次事件是由点击面包屑发起的 + var showNav=openoFrameWork.getLocationURLParameter('showNav'); + if(showNav=="false"){//如果不显示菜单,就强制刷新本页 + location.reload(); + }else{ + url="a[name='"+url+"']"; + $(url).click(); + } + }, + goToURLByName:function(name){ + var showNav=openoFrameWork.getLocationURLParameter('showNav'); + if(showNav=="false"){//如果不显示菜单,就强制刷新本页 + location.reload(); + }else{ + url="a[name='"+name+"']"; + $(url).click(); + } + }, + goToURLByID:function(id){ + if(!id){ + return; + } + var showNav=openoFrameWork.getLocationURLParameter('showNav'); + if(showNav=="false"){//如果不显示菜单,就强制刷新本页 + location.reload(); + }else{ + if(id.indexOf("#")<0){ + id="#"+id; + } + $(id).click(); + } + }, + goToPortal:function(id){ + var _url=top.location.href; + console.log(_url); + //_url="/ngict/iui/framework/"; + var url=$.url(_url); + top.location=url.attr("directory")+"uifportal.html#"+id+"/"; + }, + //Category + goToURLByIDAndNewIPPort:function(id,newIPPort,newActionStr){ + //先把NewIPPort对象:newIPPort={menuCategoryID:'vim',ipPortStr:'htpp://10.74.151.123:31180',newTitle:''}缓存到Category数组中, + //menuCategoryID属性是更多菜单上配置的菜单的分类id,; + //ipPortStr属性是该id的菜单要替换的新的ip和端口地址字符串,包括协议部分,比如http://10.74.151.64:21169 + //newTitle属性用于放置新开ip的页面对应到面包屑上的名字,可以为“”,空标识不关注 + _menuCategorys.replace(newIPPort.menuCategoryID,{ipPort:newIPPort.ipPortStr,ipTitle:newIPPort.newTitle});//把当前面包削中的菜单id和该子菜单对应的父菜单关联缓存起来 + if (store) { + store('menuCategoryID', newIPPort.menuCategoryID+"[menuCategoryID]"+newIPPort.ipPortStr+"[menuCategoryID]"+(!!newIPPort.newTitle?newIPPort.newTitle:"")); + } + //这里增加按照newIPPort.menuCategoryID分类加载more菜单的处理逻辑 + //首先根据id找到对应的主菜单菜单项 + var menuitem = this.findMenuItemByMenuId(id); + if(!menuitem||menuitem.length<=0){//主菜单中没有找到,就找more菜单,找到id对应的more菜单项所属的主菜单项 + var mainMenuId = this.getMenuItemId_From_MoreMenuRelation(id); + if( !!mainMenuId&&mainMenuId.length>0 ){//more菜单中找到了id对应的主菜单项id,根据id返回主菜单项 + menuitem = this.findMenuItemByMenuId(mainMenuId); + if(!!menuitem&&menuitem.length>0){ + var more=$("#"+id,$('#pageableDiv')).parent(); + $(".box.boxOperation", $(".carousel-inner")).removeClass("moreButtonSelected"); + more=$('a>div.box',more); + if (more.hasClass('moreButtonSelected') == false){ + more.addClass('moreButtonSelected'); + } + var pagesTags=$('.item.moreButtonsTag'); + if(pagesTags.length>0){ + for(var i=0;i0){ + tags.addClass('active'); + } + } + } + } + } + } + //其次找到的菜单项中newIPPort.menuCategoryID对应的src覆盖breadcrumgroupbuttonsrc属性值, + if(!!menuitem&&menuitem.length>0){ + var mulsrc=menuitem.attr(newIPPort.menuCategoryID+"-multiInsrc"); + if(!!mulsrc){ + menuitem.attr("breadcrumgroupbuttonsrc" ,mulsrc); + getBreadcrumbRightButtons(mulsrc,true); + } + } + if (waittime) { + clearInterval(waittime); + } + waittime = setInterval(function () { + if(moreMenusisLoaded==true){ + clearInterval(waittime); + openoFrameWork.goToURLByIDAndNewAction(id,newActionStr,null); + } + }, 10); + }, + goToURLByIDAndNewAction:function(id,newActionStr,newBrowserPageOption){ + if(!id){ + return; + } + + /*if(id.indexOf("#")<0){ + id="#"+id; + }*/ + var menuitem = this.findMenuItemByMenuId(id); + //处理新开页面情况 + if(newBrowserPageOption){ + var href = ICTFRAME_CONST_DEFAULTPAGE_PATH; + var hash = getLocationHashByMenuId(id); + var newin=window.open(href + newBrowserPageOption.paramStr + hash,newBrowserPageOption.windowTitle); + newin.name=newActionStr;//注意这种传递参数的方法,被打开的页面中需要通过top.name中获取该传递的参数。 + return; + } + //$(window).off('hashchange', loadCurrentHash); + var menuItemID=menuitem?menuitem.attr("id"):""; + if(!!menuItemID&&menuItemID.length>0){ + //menuItemID="#" + menuItemID; + //menuItemID=!!newActionStr?menuItemID:menuItemID+"/no"; + _setLocationHash(menuItemID); + } + var breadcrumbBtnMenuItemParent=""; + if(!menuitem||menuitem.length<=0){//没有找到该菜单,可能是面包削中的,需要额外处理 + menuItemID=id; + if (breadcrumbBtnMenus.contains(menuItemID)) {//有缓存 + breadcrumbBtnMenuItemParent=breadcrumbBtnMenus.items(menuItemID); + menuitem=this.findMenuItemByMenuId(breadcrumbBtnMenuItemParent); + //_breadcrumbSource=true; + } + // else{//在新增的可翻页的更多菜单里面找 + // var pageDiv = $('#pageableDiv'); + // menuitem=$('#' + menuItemID , pageDiv); + // } + if( menuitem && menuitem.length > 0){ + isMoreMenuItemClick = true; + } + } + if(!menuitem||menuitem.length<=0){ + //面包屑和主菜单都没有找到,情况可能是:更多菜单点击打开后,刷新,hash已经更改,但是对应的更多菜单的html没有加载,需要找到更多菜单和主菜单的对应关系 + var mainMenuId = this.getMenuItemId_From_MoreMenuRelation( id ); + if( mainMenuId ){ + menuitem = this.findMenuItemByMenuId(mainMenuId); + } + + } + if (store&&store("globleCurrentBreadcrumb")){ + globleCurrentBreadcrumb=store("globleCurrentBreadcrumb"); + //下面处理下刷新整个页面后从cookie中获取来的最后一次操作的面包屑对应的对应菜单的name属性回写,便于面包屑事件响应能够找到对应的菜单 + var al=$("a",$("
"+globleCurrentBreadcrumb+"
")); + var alink,gal; + for(i=0;i0){ + var panel = $('.zte-theme-panel'); + var navPosOption = $('.nav-pos-direction', panel).val(); + if(navPosOption === openoFrameWork_menu_fmenu){ + var hparentid=menuitem.attr("hparentid"); + var id=menuitem.attr("id"); + var i=0,menuItemH=menuitem; + while (id!=hparentid&&i<20){ + menuItemH=openoFrameWork.findMenuItemByMenuId(hparentid); + hparentid=menuItemH.attr("hparentid"); + id=menuItemH.attr("id"); + i++; + }; + if(!menuItemH.hasClass('active')) + menuItemH.parent().addClass("active"); + } + }else{ + console.log("goToURLByIDAndNewAction():Can't find the menuitem.The menu ID is:"+id+".Please check if the ID or ID cache is correct."); + } + //try{ + var parm=undefined; + if(!!newActionStr&&breadcrumbBtnMenuItemParent&&breadcrumbBtnMenuItemParent.length>0){ + parm={action:newActionStr,breadcrumbBtnMenuItem:menuItemID}; + }else if(!!newActionStr){ + parm={action:newActionStr}; + }else if(breadcrumbBtnMenuItemParent&&breadcrumbBtnMenuItemParent.length>0){ + parm={breadcrumbBtnMenuItem:menuItemID}; + }else if(mainMenuId){ + isMoreMenuItemClick = true; + parm={breadcrumbBtnMenuItem:menuItemID}; + } + //if(breadChangeType){ + // if(!parm){ + // parm = {}; + // } + // parm.breadChangeType = breadChangeType; + //} + if(parm&&parm.action || parm&&parm.breadChangeType) { + _hashSource="dhByInterface"; + } + + if(menuitem&&menuitem.length>0){ + menuitem.one('click',parm,function(e){ //临时一次性的注册一次click事件处理函数,执行完毕会自动删除 + openoFrameWork.dealAtoIframe($(this),e); + //$(window).one('hashchange', loadCurrentHash); + return false; + }); + menuitem.click();//后执行 + } + /*}catch(e){} + finally{ + //$(window).on('hashchange', loadCurrentHash); + }*/ + }, + + getBreadcrumbEle:function(){ + return $('.breadcrumbUl')[0]; + }, + + + findMenuItemByMenuId:function( id ){ + var menuitem=undefined; + var panel = $('.zte-theme-panel'); + var navPosOption = $('.nav-pos-direction', panel).val(); + + var items = undefined; + if (navPosOption === "vertical"){ //从垂直菜单里面找 + items=$("#page-sidebar-menu a[id='"+id+"']"); + }else if(navPosOption === openoFrameWork_menu_horizontal){//从水平菜单里面找 + items=$("#main_hormenu a[id='"+id+"']"); + if(items.length == 0){ + //横菜单没有找到,再在横菜单的子菜单找一次 + items=$("#page-megachild-sidebar-menu a[id='"+id+"']"); + } + }else if(navPosOption === openoFrameWork_menu_fmenu){ + items=$("#f_hormenu a[id='"+id+"']"); + if(items.length == 0){ + //横菜单没有找到,再在竖菜单找一次。 + items=$("#page-f-sidebar-menu a[id='"+id+"']"); + + } + + } + if( items&&items.length == 0 ){ + console.log( 'fmenu alink length is :' + $("#page-f-sidebar-menu a").length ); + console.log( 'cant find menu in sidemenu、megamenu and fmenu , the menu id is ' + id ); + } + if(items&&items.length>0){ + for(var i=0;i0){ + for(var i=0;i 0) { + parm = { + breadcrumbBtnMenuItem : menuItemID + }; + } + if (menuitem && menuitem.length > 0) { + menuitem.one('click', parm, function (e) { //临时一次性的注册一次click事件处理函数,执行完毕会自动删除 + var containerStr = $(this).parentsUntil('.page-container').hasClass('page-sidebar') ? 'page-sidebar' : ""; // + containerStr = $(this).parentsUntil('.header-inner').hasClass('hor-menu') ? 'header' : containerStr; + _isClicked = false; + dealMenuItemGetFocus($(this),e,containerStr); + return false; + }); + menuitem.click(); //后执行 + } + }, + // 处理面包削中的按钮菜单增加的导航连接,显示在iframe中 + openbreadcrumbLink:function(aObject,e) { + var url = aObject.attr("href"); + if(!url||url.length<2) + return; + e.preventDefault(); + dealScrollTo(); + var menuItemID=aObject.attr("id"); + if(!!menuItemID&&menuItemID.length>0){ + _setLocationHash(menuItemID); + _hashSource="dhByInterface"; + } + dealstartPageLoading(); + dealIframe(aObject,e); + }, + getURLParam:function(name){ + var reg = new RegExp("(^|&)" + name.toLowerCase() + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象 + var search =decodeURIComponent(location.search.substring(1)).toLowerCase(); + var r =search.match(reg); //匹配目标参数 + if (r != null) return unescape(r[2]); + return null; //返回参数值 + } + }; + +}(); + +var currentRunningScriptSrcPath = {}; +//抽取html片段中任意位置的script标签(包括代码是内嵌的情况)逐个运行(不会在单个script加载不到的时候停下来) +function runHtmlScripts(s) { + var div = document.createElement('div'); + div.innerHTML = s; + var scripts = div.getElementsByTagName('script'); + $(scripts).each(function(){ + var src = this.src; + src=openoFrameWork.handlBaseURL(src); + if(src){ + //存储当前Script标签的绝对路径以适应该js被其他系统跨域引用的情况 + currentRunningScriptSrcPath[src.substring(src.lastIndexOf("/") + 1)] = src.substring(0, src.lastIndexOf("/")+1); + $.getScript(src); + }else{ + $.globalEval(this.text || this.textContent || this.innerHTML || ''); + } + }); +} +function stripHtmlScripts(s) { + var div = document.createElement('div'); + div.innerHTML = s; + var scripts = div.getElementsByTagName('script'); + $(scripts).each(function(){ + /* if(this.src){ + $.getScript(this.src); + }else{ + $.globalEval(this.text || this.textContent || this.innerHTML || ''); + } */ + this.src=openoFrameWork.handlBaseURL(this.src); + this.parentNode.removeChild(this); + }); + return div.innerHTML; +} +function getsiderBarMenu(url){ + if (url.length<2){ + return; + } + url=openoFrameWork.handlBaseURL(url); + openoFrameWork.startPageLoading();//菜单加载中请稍候.... + var pagesidebar=$('#page-sidebar-menu'); + pagesidebar.empty(); + pagesidebar.append(""); + $.ajax({ + type: "GET", + cache: false, + url: url, + dataType: "html", + success: function (res) { + //去除script标签以后添加到主框架以防止append方法因为加载script标签失败导致后面的代码无法运行 + //res = stripHtmlScripts(res); + var resScriptsSriped = stripHtmlScripts(res); + pagesidebar.append(resScriptsSriped); + runHtmlScripts(res); + + siderBarMenuAuthentication(); + dealMysqlBackupMenu(); + //loadi18n_WebFramework_sideMenu(); + setTimeout(function () { + openoFrameWork.stopPageLoading(); + goToHomePage(); + }, 1000); + }, + error: function (xhr, ajaxOptions, thrownError) { + //$('#page-sidebar-menu').append('');//加载系统菜单失败!;//加载系统菜单失败! + } + }); +}; +var setLayoutValueByCookie = function () { + var panel = $('.zte-theme-panel'); + if (store('layout-option') != undefined) { + $('.layout-option', panel).val(store('layout-option')); + } + if (store('language-option') != undefined) { + $('.language-option', panel).val(store('language-option')); + } + if (store('sidebar-option') != undefined) { + $('.sidebar-option', panel).val(store('sidebar-option')); + } + if (store('header-option') != undefined) { + $('.header-option', panel).val(store('header-option')); + } + if (store('sidebar-pos-option') != undefined) { + $('.sidebar-pos-option', panel).val(store('sidebar-pos-option')); + } + var horMenuLoadTip = $("[class='nav-load-error']", $(".hormenu")); + var sideMenuLoadTip = $("[class='nav-load-error']", $("[class='page-sidebar-menu']")); + // 横竖菜单都无错误提示,都正确加载 + // if ((!horMenuLoadTip || horMenuLoadTip.length <= 0) && (!sideMenuLoadTip || sideMenuLoadTip.length <= 0)) { + // if (store('nav-pos-direction') != undefined) { + // var navPosOption = store('nav-pos-direction'); + // $('.nav-pos-direction', panel).val(navPosOption); + // } else { + $('.nav-pos-direction', panel).val('fmenu'); + // $.ajax({ + // "dataType" : 'json', + // "type" : "GET", + // "async" : false, + // url : FrameConst.REST_GET_FRAME_MENUDIRECTION + "&tmpstamp=" + new Date().getTime(), + // "success" : function (obj) { + // if (obj.value && (obj.value != "")) { + // $('.nav-pos-direction', panel).val(obj.value); + // } + // } + // }); + //} + // } else { + // $('.nav-pos-direction', panel).attr("disabled", true); + // } +} +function getHorMenu(url){ + setLayoutValueByCookie(); + if (url.length<2){ + return; + } + url=openoFrameWork.handlBaseURL(url); + openoFrameWork.startPageLoading();//菜单加载中请稍候.... + var pagehorbar=$('#main_hormenu') + pagehorbar.empty(); + $.ajax({ + type: "GET", + async : false, + cache: false, + url: url, + dataType: "html", + success: function (res) { + //去除script标签以后添加到主框架以防止append方法因为加载script标签失败导致后面的代码无法运行 + //res = stripHtmlScripts(res); + var resScriptsSriped = stripHtmlScripts(res); + $('#main_hormenu').append(resScriptsSriped); + runHtmlScripts(res); + // 增加mysql判断,如果数据库为mysql,去掉基础数据备份功能菜单项 + var dbType = openoFrameWork_conf.dbType; + if (dbType == "mysql") { + var item=$(".hor-menu a[id='uep-ict-backup-baseDataBack']"); + item.parent().remove(); + } + horMenuAuthentication('main_hormenu'); + openoFrameWork.stopPageLoading(); + if($('.nav-pos-direction', panel).val() === "horizontal"){ + setTimeout(function () { + //goToHomePage();//注意这里由于水平和左边栏菜单都在一个页面中出现,所以这里只调用一次 + }, 150); + } + }, + error: function (xhr, ajaxOptions, thrownError) { + //$('#main_hormenu').append('');//加载系统菜单失败! + var pcontent = $("[class='page-content']"); + //pcontent.css("marginLeft",225); + $('.nav-pos-direction', panel).attr("disabled", true); + } + }); +}; +//加载横菜单的子菜单,加到左边的siderbar里面 +function getMegaFMenu( url ){ + if (url.length<2){ + return; + } + url=openoFrameWork.handlBaseURL(url); + openoFrameWork.startPageLoading();//菜单加载中请稍候.... + var siderDiv =$( '#' + megaSiderDivId ); + siderDiv.empty(); + siderDiv.append(""); + $.ajax({ + type: "GET", + async : false, + cache: false, + url: url, + dataType: "html", + success: function (res) { + //去除script标签以后添加到主框架以防止append方法因为加载script标签失败导致后面的代码无法运行 + var resScriptsSriped = stripHtmlScripts(res); + siderDiv.append(resScriptsSriped); + runHtmlScripts(res); + FMenuAuthentication( megaDivId ,megaSiderDivId ); + rebuildHorMenu(); + ajustFMenu( megaDivId ,megaSiderDivId ); + openoFrameWork.stopPageLoading(); + }, + error: function (xhr, ajaxOptions, thrownError) { + //siderDiv.append('');//加载系统菜单失败! + //var pcontent = $("[class='page-content']"); + //pcontent.css("marginLeft",225); + } + }); +} + +function iniHorMenu(){ + var hormenu=$('#main_hormenu'); + if(!hormenu) return; + var url=hormenu.attr("menuSrc"); + if(url&&url.length>0){ + getHorMenu(url); + } + // + var megaFMenu = $('#'+megaSiderDivId); + if(!megaFMenu) return; + var url = megaFMenu.attr("menuSrc"); + if(url&&url.length>0){ + getMegaFMenu(url); + } +}; +function iniFMenu(){ + var fhormenu=$('#f_hormenu'); + var fsidemenu=$('#page-f-sidebar-menu'); + if(!fhormenu || !fsidemenu) return; + var urlmega=fhormenu.attr("menuSrc"); + var urlsider=fsidemenu.attr("menuSrc"); + if(urlmega&&urlmega.length>0 && urlsider && urlsider.length > 0){ + getFMenu(urlmega , urlsider); + } +}; +function getFMenu( urlMega , urlSider ){ + if (urlMega.length<2 || urlSider.length<2){ + return; + } + urlMega=openoFrameWork.handlBaseURL(urlMega); + urlSider=openoFrameWork.handlBaseURL(urlSider); + openoFrameWork.startPageLoading();//菜单加载中请稍候.... + var fhorbar=$('#f_hormenu'); + fhorbar.empty(); + var fSideBar= $("#page-f-sidebar-menu"); + fSideBar.empty(); + $.ajax({ + type: "GET", + async : false, + cache: false, + url: urlMega, + dataType: "html", + success: function (res) { + var resScriptsSriped = stripHtmlScripts(res); + $('#f_hormenu').append(resScriptsSriped); + horMenuAuthentication('f_hormenu'); + runHtmlScripts(res); + dealMysqlBackupMenu(); + openoFrameWork.stopPageLoading(); + }, + error: function (xhr, ajaxOptions, thrownError) { + $('#f_hormenu').append('');//加载系统菜单失败! + var pcontent = $("[class='page-content']"); + $('.nav-pos-direction', panel).attr("disabled", true); + } + }); + var fpagesidebar=$('#' + fMenuSiderDivId); + fpagesidebar.empty(); + fpagesidebar.append(""); + $.ajax({ + type: "GET", + cache: false, + url: urlSider, + dataType: "html", + success: function (res) { + var resScriptsSriped = stripHtmlScripts(res); + fpagesidebar.append(resScriptsSriped); + //先全部隐藏,后面根据与hash的匹配情况来显示 + fpagesidebar.children().css('display','none'); + runHtmlScripts(res); + dealMysqlBackupMenu(); + FMenuAuthentication( fMenuMegaDivId ,fMenuSiderDivId ); + ajustFMenu( fMenuMegaDivId ,fMenuSiderDivId ); + openoFrameWork.stopPageLoading(); + loadi18n_WebFramework_sideMenu(); + }, + error: function (xhr, ajaxOptions, thrownError) { + $('.page-f-sidebar-menu').append('');//加载系统菜单失败!;//加载系统菜单失败! + } + }); +}; +function iniSidebarMenu(){ + var sidermenu=$('#page-sidebar-menu'); + if(!sidermenu) return; + var url=sidermenu.attr("menuSrc"); + if(url&&url.length>0){ + getsiderBarMenu(url); + } +}; +function getChangePWDDlg(url){ + if (url.length<2){ + return; + } + openoFrameWork.startPageLoading();//加载中.... + var pageChangepasswd=$('.modal-dialog .Changepasswd'); + pageChangepasswd.empty(); + $.ajax({ + type: "GET", + cache: false, + url: url, + dataType: "html", + success: function (res) { + $('.modal-dialog .Changepasswd').append(res); + ChangePWD.init(); + openoFrameWork.stopPageLoading(); + }, + error: function (xhr, ajaxOptions, thrownError) { + $('.modal-dialog .Changepasswd').append('

'+$.i18n.prop('com_zte_ums_ict_framework_ui_loadchgpwdpageError')+'

');//加载修改密码页面失败! + } + }); +}; +function iniChangePWDDlg(){ + var url=$('.modal-dialog .Changepasswd').attr("dlgsrc"); + if(url&&url.length>0){ + getChangePWDDlg(url); + } +}; +function getHeaderMenu(url){ + if (url.length<2){ + return; + } + openoFrameWork.startPageLoading();//加载中请稍候.... + var headerMenu=$('#headerMenu'); + headerMenu.empty(); + $.ajax({ + type: "GET", + cache: false, + async: false, + url: url, + dataType: "html", + success: function (res) { + $('#headerMenu').append(res); + openoFrameWork.stopPageLoading(); + }, + error: function (xhr, ajaxOptions, thrownError) { + //$('#headerMenu').append('

'+$.i18n.prop('com_zte_ums_ict_framework_ui_loadmenuerror')+'

');//加载系统菜单失败! + } + }); +}; +function goToHomePage(){ + locationhash = openoFrameWork.getLocationHash(); + if(!!locationhash&&locationhash.length>0){//有锚点,直接触发 + var newIPPort=null; + if (store&&store('menuCategoryID')) { + var s=store('menuCategoryID').split('[menuCategoryID]'); + if(s.length>2){ + newIPPort={menuCategoryID:s[0],ipPortStr:s[1],newTitle:s[2]}; + } + } + if(!!newIPPort){ + openoFrameWork.goToURLByIDAndNewIPPort(locationhash,newIPPort,null); + }else{ + openoFrameWork.goToURLByIDAndNewAction(locationhash,null,null); + } + }else{//否则还是模拟点击配置了start类的菜单 + var containerStr = ""; + //var sidermenu = $("[class='page-sidebar-menu']", $("[class='page-sidebar navbar-collapse collapse']")); + var sidermenu = $("#page-sidebar-menu"); + var hormenu = $("#main_hormenu"); + var fhormenu = $('#' + fMenuMegaDivId); + var fhormenusider = $('#page-f-sidebar-menu'); + var startmenu = null; + var navPosOption = $('.nav-pos-direction', panel).val(); + // 侧边栏显示,根据侧边栏CSS选择 + if (navPosOption === "vertical") { + //containerStr=$('.page-sidebar').length>0?'.page-sidebar':""; + startmenu = $('.iframe.start' , sidermenu); + dealStartMenu( startmenu, sidermenu ); + } + // 水平菜单显示,根据水平菜单CSS选择 + else if (navPosOption === "horizontal") { + //containerStr=$('.hor-menu').length>0?'.header':containerStr; + startmenu = $('.iframe.start' , hormenu); + dealStartMenu( startmenu, hormenu ); + + } + //F菜单的恒菜单显示 + else if (navPosOption === openoFrameWork_menu_fmenu) { + //containerStr=$('.hor-menu').length>0?'.header':containerStr; + startmenu = $('.iframe.start' ,fhormenu); + if (startmenu && startmenu.length < 1) { + startmenu = $('.iframe.start' ,fhormenusider); + } + dealStartMenu( startmenu, fhormenu,fhormenusider ); + } + } +}; +var dealStartMenu = function(startmenu , menuContainer,menuContainer2 ){ + var timer =setInterval(function () { + if(startmenu&&startmenu.length>0){ + startmenu.click(); + clearInterval(timer); + }else{ + console.log('the start menu click event is not be triggerd ,so do it repeat!!'); + $('a[operation]', menuContainer).each(function () { + startmenu = $(this); + return false; + }); + if (menuContainer2&&startmenu && startmenu.length < 1) { + $('a[operation]', menuContainer2).each(function () { + startmenu = $(this); + return false; + }); + } + } + }, 100); + handeCtxMenuitem(); + } +// 屏蔽横竖菜单项的右键功能 +function handeCtxMenuitem() { + $(".page-sidebar ul li a").each(function() { + if ($(this).attr("href") && $(this).attr("href") != "javascript:;" && $(this).attr("href") != "#") { + $(this).attr("oncontextmenu", "return false"); + } + }); + $(".hormenu li a").each(function() { + if ($(this).attr("href") && $(this).attr("href") != "javascript:;" && $(this).attr("href") != "#") { + $(this).attr("oncontextmenu", "return false"); + } + }); +} +function initBaseInfo(){ + $("#logout_label").text($.i18n.prop('com_zte_ums_ict_framework_ui_group_logout')); + $("#fullscreen_label").text($.i18n.prop('com_zte_ums_ict_framework_ui_group_fullscreen')); + $("#changePwd_label").text($.i18n.prop('com_zte_ums_ict_framework_ui_changePwd')); + $("#com_zte_ums_ict_framework_moudle_about").text($.i18n.prop('com_zte_ums_ict_framework_moudle_about')); + $("#com_zte_ums_ict_framework_moudle_help").text($.i18n.prop('com_zte_ums_ict_framework_moudle_help')); + $("#zte_menu-toggler").attr("title",$.i18n.prop('com_zte_ums_ict_framework_moudle_menutoggler')); +}; +window.closeModal = function(modalid) { + if(!modalid){ + return; + } + if(modalid.indexOf("#")<0){ + modalid="#"+modalid; + } + $(modalid).modal('hide'); +}; +function getLcsRight(lcsoperations) { + var lcsrights = new Array(); + if (lcsoperations && (lcsoperations.length > 0)) { + // 请求后台license value + //----test data---- + // var testjson = '{"data":[{"id":"mylcs","name":"xxx","value":"false"}]}'; + // var testopt = eval('(' + testjson + ')'); + // var testarray = testopt.data; + //-----end test data--- + var keys = { + "keys" : lcsoperations + }; + var jsonvalues = JSON.stringify(keys); + var data = { + "data" : jsonvalues + }; + var url=FrameConst.REST_GETLICENSEINFO + "?tmpstamp=" + new Date().getTime(); + url=openoFrameWork.handlBaseURL(url); + $.ajax({ + "dataType" : 'json', + "type" : "GET", + "async" : false, + "url" : url, + "data" : data, + //"contentType" : 'application/json; charset=utf-8', + "success" : function (response) { + if (response) { + lcsrights = response.data; + } + }, + "error" : function (XMLHttpRequest, textStatus, errorThrown) { + lcsrights = null; + } + }); + return lcsrights; + } + return lcsrights; +} +// 侧边栏菜单鉴权 +function siderBarMenuAuthentication() { + // license 鉴权 + var menuids = new Array(); + var lcsoperations = new Array(); + //从页面DOM取得菜单license项。 + $('a[licenseid]', $('.page-sidebar-menu')).each(function () { + var licenseid = $(this).attr("licenseid"); + if (licenseid) { + lcsoperations.push(licenseid); + var id = $(this).attr("id"); + menuids.push(id); + } + }); + var lcsrights = getLcsRight(lcsoperations);// 取得license数据。 + if (lcsrights && (lcsrights.length == menuids.length)) { + // 根据后台license值判断所在菜单项是否显示 + for (var i = 0; i < menuids.length; i++) { + var id = menuids[i]; + var lcskey = lcsoperations[i]; + var lcsitem = lcsrights[i]; + // 菜单项如果配了licenseid, 并且不是true字符串, 则移除菜单项 + if (lcsitem.value != "True") { + $('#'+id, $('.page-sidebar-menu')).parent().remove(); + } + } + } + var operations = new Array(); + $('a[operation]', $('.page-sidebar-menu')).each(function () { + var operation = $(this).attr("operation"); + if (operation) { + operations.push(operation); + } + }); // 遍历菜单项,提取所有的操作码 + var rightObj = getAllOperCodeRights(operations); // 对操作码进行鉴权判断 + $('a[operation]', $('.page-sidebar-menu')).each(function () { + var operation = $(this).attr("operation"); + if (operation) { + if (!hasRight(operation, rightObj)) { + $(this).parent("li").remove(); // 删除没有权限的菜单项 + } + } + }); + rebuildSiderBarMenu(); +}; +// 横向菜单栏鉴权 +function horMenuAuthentication( horMenuId ) { + // license 鉴权 + var menuids = new Array(); + var lcsoperations = new Array(); + //从页面DOM取得菜单license项。 + $('a[licenseid]', $('#'+ horMenuId)).each(function () { + var licenseid = $(this).attr("licenseid"); + if (licenseid) { + lcsoperations.push(licenseid); + var id = $(this).attr("id"); + menuids.push(id); + } + }); + var lcsrights = getLcsRight(lcsoperations);// 取得license数据。 + if (lcsrights && (lcsrights.length == menuids.length)) { + // 根据后台license值判断所在菜单项是否显示 + for (var i = 0; i < menuids.length; i++) { + var id = menuids[i]; + var lcskey = lcsoperations[i]; + var lcsitem = lcsrights[i]; + // 菜单项如果配了licenseid, 并且不是true字符串, 则移除菜单项 + if (lcsitem.value != "True") { + $('#'+id, $('#'+ horMenuId)).parent().remove(); + } + } + } + var operations = new Array(); + $('a[operation]', $('#'+ horMenuId)).each(function () { + var operation = $(this).attr("operation"); + if (operation) { + operations.push(operation); + } + }); // 遍历菜单项,提取所有的操作码 + var rightObj = getAllOperCodeRights(operations); // 对操作码进行鉴权判断 + $('a[operation]', $('#'+ horMenuId)).each(function () { + var operation = $(this).attr("operation"); + if (operation) { + if (!hasRight(operation, rightObj)) { + $(this).parent("li").remove(); // 删除没有权限的菜单项 + } + } + }); + rebuildHorMenu(); +}; +//根据F菜单的竖菜单来调整横菜单。获取hparentid相同的竖菜单中的第一个,来更新横菜单上对应父亲菜单的href、catchnum等信息 +function ajustFMenu(megaBarDivId , siderbarDivId){ + var hparentIds = {}; + $('a[hparentid]', $('#'+ siderbarDivId)).each(function () { + var hparentId = $(this).attr("hparentId"); + var parentMenu = $('a[id = ' + hparentId + ']', $('#' + megaBarDivId)); + var oldAHref = parentMenu.attr("href"); + if (oldAHref == null || oldAHref.trim() == "#" || oldAHref == "javascript") { + var hrefMenu = $(this); + //竖菜单的第一级有可能是虚菜单,则找这个虚节点下面的第一个有href的菜单 + if( $(this).attr('href') == null || $(this).attr('href') == "#" || $(this).attr('href') == "javascript:;"){ + $('a[href]', $(this).parent().children('ul')).each(function () { + hrefMenu = $(this); + if (hrefMenu != null && hrefMenu != "#" && hrefMenu != "javascript") { + return false; //跳出循环 + } + }) + } + parentMenu.attr("href", hrefMenu.attr("href")); + parentMenu.attr("shiftjs", hrefMenu.attr("shiftjs")); + parentMenu.attr("cachenum", hrefMenu.attr("cachenum")); + parentMenu.attr("iframeName", hrefMenu.attr("iframeName")); + parentMenu.attr("xdomain", hrefMenu.attr("xdomain")); + parentMenu.attr("cssSrc", hrefMenu.attr("cssSrc")); + parentMenu.attr("category", hrefMenu.attr("category")); + parentMenu.attr("breadcrumgroupbuttonsrc", hrefMenu.attr("breadcrumgroupbuttonsrc")); + parentMenu.attr("operation", hrefMenu.attr("operation")); + parentMenu.attr("iframeautoscroll", hrefMenu.attr("iframeautoscroll")); + } + }); +} +function FMenuAuthentication(megaBarDivId , siderbarDivId){ + var beforeHparentId = {}; + $('a[hparentid]', $('#'+ siderbarDivId)).each(function(){ + var parentid = $(this).attr("hparentid"); + beforeHparentId[parentid] = 1; + }); + checkFmenuRightByAttr('licenseid' , megaBarDivId , siderbarDivId , getLcsRight); + checkFmenuRightByAttr('operation' , megaBarDivId , siderbarDivId, getAllOperCodeRights); + rebuildSiderBarMenu(); + var afterHparentId={}; + $('a[hparentid]', $('#'+ siderbarDivId)).each(function(){ + var parentid = $(this).attr("hparentid"); + afterHparentId[parentid] = 1; + }); + //比较鉴权前后的父菜单差异,如果这个父菜单自己没有href属性,且鉴权后,所有的子菜单都没有权限,那么这个父菜单需要从界面上去掉 + for( var parentid in beforeHparentId ){ + if( afterHparentId[parentid] == null ){ + var parent = $('#'+ parentid , $('#'+ megaBarDivId)); + if(parent.attr('href') == null || parent.attr('href') == "javascript:;" || parent.attr('href') == "#"){ + parent.parent().remove(); + } + } + } +} +function checkFmenuRightByAttr( attrName, megaBarDivId , siderbarDivId ,callback ){ + // license 鉴权 + var menuids = new Array(); + var parentMenuId = new Array(); + var operations = new Array(); + //从页面DOM取得菜单license项。 + $('a['+ attrName+']', $('#'+ siderbarDivId)).each(function () { + var attrValue = $(this).attr(attrName); + if (attrValue) { + operations.push(attrValue); + var id = $(this).attr("id"); + menuids.push({'id':id }); + } + }); + var rights = callback(operations);// 取得license数据。 + if (rights && (rights.length == menuids.length)) { + // 根据后台license值判断所在菜单项是否显示 + for (var i = 0; i < menuids.length; i++) { + var id = menuids[i].id; + var hparentId =menuids[i].hParentId; + var key = operations[i]; + var item = rights[i]; + // 菜单项如果配了licenseid, 并且不是true字符串, 则移除菜单项 + if (item.value != "True") { + $('#'+id, $('#'+ siderbarDivId)).parent().remove(); + } + } + } +} +// “更多操作”分组按钮鉴权 +function groupButtonAuthentication() { + // license 鉴权 + var menuids = new Array(); + var lcsoperations = new Array(); + //从页面DOM取得菜单license项。 + $('a[licenseid]', $('.more-botton-zone > li.btn-group')).each(function () { + var licenseid = $(this).attr("licenseid"); + if (licenseid) { + lcsoperations.push(licenseid); + var id = $(this).attr("id"); + menuids.push(id); + } + }); + var lcsrights = getLcsRight(lcsoperations);// 取得license数据。 + if (lcsrights && (lcsrights.length == menuids.length)) { + // 根据后台license值判断所在菜单项是否显示 + for (var i = 0; i < menuids.length; i++) { + var id = menuids[i]; + var lcskey = lcsoperations[i]; + var lcsitem = lcsrights[i]; + // 菜单项如果配了licenseid, 并且不是true字符串, 则移除菜单项 + if (lcsitem.value != "True") { + $('#'+id, $('.more-botton-zone > li.btn-group')).parent().remove(); + } + } + } + // 增加mysql判断,如果数据库为mysql,去掉基础数据备份功能菜单项 + var dbType = openoFrameWork_conf.dbType; + if (dbType == "mysql") { + $("#uep-ict-backup-baseDataBack",$('.more-botton-zone > li.btn-group')).parent().remove(); + } + var operations = new Array(); + $('a[operation]', $('.more-botton-zone > li.btn-group')).each(function () { + var operation = $(this).attr("operation"); + if (operation) { + operations.push(operation); + } + }); // 遍历菜单项,提取所有的操作码 + var rightObj = getAllOperCodeRights(operations); // 对操作码进行鉴权判断 + $('a[operation]', $('.more-botton-zone > li.btn-group')).each(function () { + var operation = $(this).attr("operation"); + if (operation) { + if (!hasRight(operation, rightObj)) { + $(this).parent("li").remove(); // 删除没有权限的菜单项 + } + } + }); + // 如果“更多菜单”下没有子菜单了,则删除整个“更多菜单”下拉框。 + if ($('li > a', $('.more-botton-zone > li.btn-group')).length == 0) { + $('.more-botton-zone > li.btn-group').remove(); + } +}; +// 删除没有子菜单的一级菜单,查看新菜单是否配了登录默认页面,如没有则指定第一个有权限的菜单作为登录后默认页面 +function rebuildSiderBarMenu() { + if ($('a.start').length == 0) { + $('li > a[href!="javascript:;"]', $('.page-sidebar-menu')).eq(0).addClass("start"); + } + $('ul.sub-menu', $('.page-sidebar-menu')).each(function () { + if ($(this).has('li').length == 0) { + $(this).parent("li").remove(); + } + }); +}; +// 删除没有子菜单的一级菜单,查看新菜单是否配了登录默认页面,如没有则指定第一个有权限的菜单作为登录后默认页面 +function rebuildHorMenu() { + if ($('a.start').length == 0) { + $('li > a[href!="#"]', $('#main_hormenu')).eq(0).addClass("start"); + } + $('ul.mega-menu-submenu', $('#main_hormenu')).each(function () { + if ($(this).has('li > a').length == 0) { + $(this).remove(); // 删空的分组列 + } + }); + //删除增加的分组div + $('div.zteDivWidth', $('#main_hormenu')).each(function () { + if ($(this).has('ul').length == 0) { + $(this).remove(); // 删空的分组列 + } + }); + $('ul.dropdown-menu', $('#main_hormenu')).each(function () { + if ($(this).has('ul').length == 0) { + $(this).parent("li").remove(); // 删空的一级菜单栏 + } + }); + $('li.divider', $('#main_hormenu')).each(function () { + if ($(this).next().hasClass('divider')) { + $(this).remove(); // 连续出现分隔线则删除一个 + } + }); + $('li.divider', $('#main_hormenu')).each(function () { + if ($(this).next().length == 0) { + $(this).remove(); // 如果分隔线在最后一行,则删除之 + } + }); +} +//获取页面菜单栏所有的操作码权限 +function getAllOperCodeRights(operations) { + var rights = new Array(); + if( operations && operations.length > 0 ){ + var data = { + "operations" : operations + }; + var sendData = JSON.stringify(data); + var url=FrameConst.REST_CHECKRIGHT + "?data=" + sendData + "&tmpstamp=" + new Date().getTime(); + url=openoFrameWork.handlBaseURL(url); + $.ajax({ + "dataType" : 'json', + "type" : "GET", + "async" : false, + "url" : url, + "data" : null, + //"contentType" : 'application/json; charset=utf-8', + "success" : function (response) { + rights = response.value; + }, + "error" : function (XMLHttpRequest, textStatus, errorThrown) { + if (XMLHttpRequest.status == 401) { + window.location.replace("login.html"); + } else { + console.log('Communication Error!'); + } + } + }); + } + return { + opCodes : operations, + rights : rights + }; +}; +// 判断操作码是否有权限 +function hasRight(opCode, rightObj) { + for (var i = 0; i < rightObj.opCodes.length; i++) { + if (rightObj.opCodes[i] == opCode) { + return (rightObj.rights[i] == true); + } + } + return false; +}; +// 处理mysql环境下备份菜单的合并问题 +function dealMysqlBackupMenu() { + var dbType = openoFrameWork_conf.dbType; + if (dbType !== undefined && dbType !== "mysql") { + return; + } + var sidermenu = $("[class='page-sidebar-menu']"); + var hormenu = $(".hormenu"); + //这段代码先这么写,html的位置不一定正确,如果后面位置不一致,再修改。 + if (sidermenu.length > 0 && $('#uep-ict-backup-dataBackup').length > 0) { + $('#uep-ict-backup-dataBackup', sidermenu).attr("breadcrumGroupButtonSrc", ICTFRAME_CONST_DATABACKUP_PATH); + } + if (hormenu.length > 0 && $('#uep-ict-backup-dataBackup').length > 0) { + $('#uep-ict-backup-dataBackup', hormenu).attr("breadcrumGroupButtonSrc", ICTFRAME_CONST_DATABACKUP_PATH); + $('#uep-ict-backup-dataBackup').parent('li').attr('style', 'display:block'); + $('#uep-ict-backup-allDbStructBackup').parent('li').attr('style', 'display:none'); + $('#uep-ict-backup-baseDataBack').parent('li').attr('style', 'display:none'); + } +}; +// 浏览器缩小后导航栏隐藏的情况下点击navbar-toggle显示菜单的前置工作, +// 浏览器缩小后导航栏隐藏的情况下点击navbar-toggle显示菜单的前置工作, +function dealMavToggle(navtoggle) { + var sidermenu = $("#page-sidebar-menu"); + var hormenu = $("#main_hormenu"); + var panel = $(".zte-theme-panel"); + var siderbarpos = $(".nav-pos-direction", panel).val() + if ("hidden" == $(navtoggle).attr("navtoggledispattr")) { + $(navtoggle).attr("navtoggledispattr", "display"); + sidermenu.css('display','block');//侧边栏显示 + hormenu.css("display", "none");//隐藏水平菜单栏 + } else { + $(navtoggle).attr("navtoggledispattr", "hidden"); + sidermenu.css('display','none');//侧边栏隐藏 + hormenu.css("display", "none"); + } +}; diff --git a/openo-portal/portal-common/src/main/webapp/common/js/core/openoFrameWork.min.js b/openo-portal/portal-common/src/main/webapp/common/js/core/openoFrameWork.min.js new file mode 100644 index 00000000..08132235 --- /dev/null +++ b/openo-portal/portal-common/src/main/webapp/common/js/core/openoFrameWork.min.js @@ -0,0 +1,165 @@ +/* + * Copyright 2016, CMCC Technologies Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +String.prototype.trim=function(){return this.replace(/(^\s*)|(\s*$)/g,"")};String.prototype.format=function(){if(0==arguments.length)return this;for(var b=this,d=0;d>0;gb?this.data.seg.path.length+b:b-1;return this.data.seg.path[b]},fsegment:function(b){if("undefined"===typeof b)return this.data.seg.fragment;b=0>b?this.data.seg.fragment.length+b:b-1;return this.data.seg.fragment[b]}}} +var l={a:"href",img:"src",form:"action",base:"href",script:"src",iframe:"src",link:"href",embed:"src",object:"data"},u="source protocol authority userInfo user password host port relative path directory file query fragment".split(" "),q={anchor:"fragment"},I={strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}, +w=/^[0-9]+$/;m.jQuery=function(b){null!=b&&(b.fn.url=function(h){var g="";this.length&&(g=b(this).attr(d(this[0]))||"");return m(g,h)},b.url=m)};m.jQuery(window.jQuery);return m});openoFrameWork_conf={userName:store.get("username"),changePassItem:FrameConst.change_pass?FrameConst.change_pass:!0,helpMenuItem:!1,aboutMenuItem:!1,flightMenuItem:!1,fullscreenMenuItem:!1,logoutMenuItem:!0,defaultThemeColor:"ztebluelight2",dbType:"other",acceptLanguage:"en-US"};$("#currentUser").html(openoFrameWork_conf.userName); +$.ajax({url:FrameConst.REST_FRAMECOMMIFO,type:"GET",cache:!1,contentType:"application/json; charset=utf-8",success:function(b){b.helpMenuItem&&""!=b.helpMenuItem&&(openoFrameWork_conf.helpMenuItem=b.helpMenuItem);b.aboutMenuItem&&""!=b.aboutMenuItem&&(openoFrameWork_conf.aboutMenuItem=b.aboutMenuItem);b.flightMenuItem&&""!=b.flightMenuItem&&(openoFrameWork_conf.flightMenuItem=b.flightMenuItem);b.fullscreenMenuItem&&""!=b.fullscreenMenuItem&&(openoFrameWork_conf.fullscreenMenuItem=b.fullscreenMenuItem);b.logoutMenuItem&& +""!=b.logoutMenuItem&&(openoFrameWork_conf.logoutMenuItem=b.logoutMenuItem);b.defaultThemeColor&&""!=b.defaultThemeColor&&(openoFrameWork_conf.defaultThemeColor=b.defaultThemeColor);b.dbType&&""!=b.dbType&&(openoFrameWork_conf.dbType=b.dbType);b.acceptLanguage&&""!=b.acceptLanguage&&(openoFrameWork_conf.acceptLanguage=b.acceptLanguage);b.changePassItem&&""!=b.changePassItem&&(openoFrameWork_conf.changePassItem=b.changePassItem);setFrameWorkByConf()},error:function(b){setFrameWorkByConf()}}); +function setThemeColor(b){var d=$(".zte-theme-panel");$(".theme-colors > ul > li",d).each(function(){var d=$(this).attr("data-style");d==b&&($(this).addClass("current"),$("#style_color").attr("href","css/themes/"+d+".css"),store("style_color",d))})} +function setFrameWorkByConf(){var b=openoFrameWork_conf.helpMenuItem,d=openoFrameWork_conf.aboutMenuItem,h=openoFrameWork_conf.flightMenuItem,k=openoFrameWork_conf.fullscreenMenuItem,g=openoFrameWork_conf.logoutMenuItem,n=openoFrameWork_conf.changePassMenuItem;b&&"false"!==b||$("#uep_ict_help_url").parent("li").remove();d&&"false"!==d||$('[data-target="#aboutDlg"]').parent("li").remove();b||d||$("#uep_ict_help_div").remove();h&&"false"!==h||$("#header_notification_bar").html("
      
"); +k&&"false"!==k||$("#trigger_fullscreen_div").html("");g&&"false"!==g||$("#trigger_logout_div").html("");(!k&&!g||"false"===k&&"false"===g)&&$("#full_logout_divider").css("display","none");n||($("#changePwd_labellink").css("display","none"),$("#full_logout_divider").css("display","none"));b=openoFrameWork_conf.defaultThemeColor;d=$(".zte-theme-panel");$("ul > li",d).removeClass("current");store&&!store("style_color")?setThemeColor(b):setThemeColor(store("style_color"))} +function Hashtable(){this._hash={};this._count=0;this.add=function(b,d){if(this._hash.hasOwnProperty(b))return!1;this._hash[b]=d;this._count++;return!0};this.hash=function(){return this._hash};this.remove=function(b){delete this._hash[b];this._count--};this.count=function(){return this._count};this.items=function(b){if(this.contains(b))return this._hash[b]};this.contains=function(b){return this._hash.hasOwnProperty(b)};this.clear=function(){this._hash={};this._count=0};this.replace=function(b,d){this.contains(b)&& +this.remove(b);return this.add(b,d)}} +var fMenuSiderDivId="page-f-sidebar-menu",fMenuMegaDivId="f_hormenu",megaSiderDivId="page-megachild-sidebar-menu",megaDivId="main_hormenu",openoFrameWork_menu_horizontal="horizontal",openoFrameWork_menu_vertical="vertical",openoFrameWork_menu_fmenu="fmenu",openoFrameWork_showNav="true",openoFrameWork_smallView=960,openoFrameWork=function(){var b=getLanguage(),d=!1,h=function(){try{return document.createEvent("TouchEvent"),!0}catch(c){return!1}},k=!h,g=!1,n=!1,m=!1,l="",u=225,q=35,I=[],w=new Hashtable,x=new Hashtable, +C=new Hashtable,V=new Hashtable,y="page-mainIframe",J="",v="",D=!1,ca={blue:"#4b8df8",red:"#e02222",green:"#35aa47",purple:"#852b99",grey:"#555555","light-grey":"#fafafa",yellow:"#ffb848",ztebluelight:"#3366cc"},G=function(){var c=window,t="inner";"innerWidth"in window||(t="client",c=document.documentElement||document.body);return{width:c[t+"Width"],height:c[t+"Height"]}},va=function(){var c=getUrlParam("menu");switch(c?c:0){case "1":l=$("#com_zte_ums_ict_framework_ui_page_title_1").text().trim(); +break;case "2":l=$("#com_zte_ums_ict_framework_ui_page_title_2").text().trim();break;case "3":l=$("#com_zte_ums_ict_framework_ui_page_title_3").text().trim();break;default:l=$("#com_zte_ums_ict_framework_ui_page_title").text().trim()}"rtl"===$("body").css("direction")&&(d=!0);g=!!navigator.userAgent.match(/MSIE 8.0/);n=!!navigator.userAgent.match(/MSIE 9.0/);(m=!!navigator.userAgent.match(/MSIE 10.0/))&&$("html").addClass("ie10");(m||n||g)&&$("html").addClass("ie");navigator.userAgent.toLowerCase().match(/(iphone|ipod|ipad)/)? +($(document).on("focus","input, textarea",function(){$(".page-header").hide();$(".page-footer")&&0<$(".page-footer").length&&$(".page-footer").hide()}),$(document).on("blur","input, textarea",function(){$(".page-header").show();$(".page-footer")&&0<$(".page-footer").length&&$(".page-footer").show()})):($(document).on("focus","input, textarea",function(){$(".page-footer")&&0<$(".page-footer").length&&$(".page-footer").hide()}),$(document).on("blur","input, textarea",function(){$(".page-footer")&&0< +$(".page-footer").length&&$(".page-footer").show()}))},F=function(c){$(".page-loading").remove();$("body").append('
  '+(c?c:$.i18n.prop("com_zte_ums_ict_framework_ui_loading"))+"
")},da=function(){G().widthm&&(m=c.length,l=c)});h=h+getStringWidth(l,14)+94.5}h+H>c?(console.log("ajust class dropdown-menu-right ,id = "+b.attr("id")),d.addClass("dropdown-menu-right")):d.removeClass("dropdown-menu-right")}},B=function(c){var t=$(".page-content"),f=$(".page-content-body"),b=$(".page-sidebar"),d=$("body"),g,h=G(),l=Math.min(window.screen.availHeight,h.height)-5,z=$(".footer"), +m=$(".page-breadcrumb"),n=$("#pageableDiv");console.log("pageableDiv height:"+n.outerHeight(!0));var u=$(".header");"isc"===(x.items(y)?x.items(y).childpageType:"")&&$(".sidebar-option",panel).val("fixed");var r=openoFrameWork.getLocationURLParameter("showNav");"false"==r&&(openoFrameWork_showNav=r,ha(),ia());r=l-(!z||0>=z.length?0:z.outerHeight(!0))-u.outerHeight(!0);n=!n||0>=n.length||!1==n.is(":visible")?0:n.outerHeight(!0);f=l-u.outerHeight(!0)-(!z||0>=z.length||!1==z.is(":visible")?0:z.outerHeight(!0))- +m.outerHeight(!0)-n-(f.outerHeight(!0)-f.height());m=""==y?"page-mainIframe":y;if((n=$(".page-content .page-content-body ."+m))&&0f?b.height():f;b.attr("style",q);if(!k){q=f;try{q=n.contents().height()}catch(Ja){}f=q>f?q:f}x.items(m).setMinHeight&& +(n=Math.min(l,f),console.log("pym:parent iframe "+m+" window.screen.availHeight:"+l+" viewport.height:"+h.height+" h:"+f+" minHeight:"+n),x.items(m).setMinHeight(n))}!0===d.hasClass("page-footer-fixed")&&!0===d.hasClass("page-sidebar-fixed")?t.height()=z.length?0:z.outerHeight(!0),1024<$(window).width()&&g+b+z=openoFrameWork_smallView?(ga(),"none"!=$(".page-sidebar-menu li").css("display")&&$("body").hasClass("page-sidebar-closed")&&$(".sidebar-toggler").hasClass("close-by-viewportChange")&&(c||$(".sidebar-toggler")[1].click(),$(".sidebar-toggler").removeClass("close-by-viewportChange"))):ga(!0)},ya=function(c){var t;if(0      ")},Aa=function(c){var b=$(".zte-theme-panel"),b=$(".nav-pos-direction",b).val(),f=null,p=null;"vertical"===b?(f=$("#"+c.attr("id"),$("#main_hormenu")),p=$(".header ul")):"horizontal"===b?(f=za(c),ka(c,megaSiderDivId),p=f[0],f=f[1]):b===openoFrameWork_menu_fmenu&&ka(c,fMenuSiderDivId);p&&(p.children("li.active").removeClass("active"),p.find(".arrow.open").removeClass("open"));f&&(f.parents("li").each(function(){$(this).addClass("iframe active"); +$(this).find("a > span.arrow").addClass("open")}),f.parents("li").addClass("active"),"horizontal"===b&&f.parent().parent().parent().is("li")&&$(".arrow",f.parent().parent().parent()).addClass("open"))},za=function(c){targetsource=$("#"+c.attr("id"),$("[class='page-sidebar-menu']"));targetContainer=$("#page-sidebar-menu ul");$("li.open",targetContainer).each(function(){$("ul.sub-menu",this).attr("style")&&($("ul.sub-menu",this).removeAttr("style"),$(this).removeClass("open"))});if(0<=c.parent().parent().parent().parent().attr("class").indexOf("page-sidebar-menu")){c= +$("#"+c.attr("id"),$("#main_hormenu"));var b=$(".header ul");b.children("li.active").removeClass("active");b.find(".arrow.open").removeClass("open");c.parents("li").each(function(){$(this).addClass("iframe active");$(this).find("a > span.arrow").addClass("open")});c.parents("li").addClass("active")}return[targetContainer,targetsource]},ka=function(c,b){var f=$("#"+b);if(R)R=!1;else if($(c).parents("li").hasClass("mega-menu-dropdown")){var p=c.attr("id");$("#"+b+">li").hide();var d=$("a[hparentid= "+ +p+"]",f).parent();d.show();0li.sidebar-toggler-wrapper").show();0<$("a[hparentid= "+p+"]",f).length?la(c,b):(f.css("display","none"),$("body").addClass("page-full-width"),$(".page-content").css("marginLeft",u))}else"true"==openoFrameWork_showNav&&($("#"+b+">li").hide(),p=$(c).parents("li"),p=p.eq(p.length-1).children("a").attr("hparentid"),d=$("a[hparentid="+p+"]",f).parent(),d.show(),0li.sidebar-toggler-wrapper").show(),la(c,b))},la=function(c,b){var f=$("#"+ +b);f.css("display","block");$("ul.sub-menu",f).css("display","block");$(".arrow",f).addClass("open");$("body").removeClass("page-full-width");$("body").hasClass("page-sidebar-closed")?$(".page-content").css("marginLeft",q):$(".page-content").css("marginLeft",u);var p=c.attr("href");$("li.iframe",f).removeClass("active");f=$("a[href ='"+p+"']",f).parent();f.addClass("active");f.parent().parent().addClass("open").addClass("active");f.parent().css("display","block");f.parent().parent().children("a").children(".arrow").addClass("open")}, +Z=function(c,b,f){var p=c.attr("href");if(p&&!(2>p.length)){b.preventDefault();D||(D=!0,p=c.parents("li").last(),p.hasClass("open")||Y(p.children("a:eq(0)")));f&&0 span.arrow").addClass("open")});c.parents("li").addClass("active");Aa(c);f&&0=$(window).width()&&$("."+f).hasClass("in")&&$(".navbar-toggle").click();if(dealMultTabPage(c))return!0; +f=b.data&&b.data.breadcrumbBtnMenuItem&&0p.length||(b.preventDefault(),D||(D=!0,b=c.parents("li").last(),Y(b.children("a:eq(0)"))),f&&0 span.arrow").addClass("open")}),c.parents("li").addClass("active"),f&&0=$(window).width()&&$("."+f).hasClass("in")&&$(".navbar-toggle").click())},S=function(c,b){function f(c,b,f,t,d,p,g){c=new pym.Parent(c,b,{xdomain:p});c.iframe.id=f;c.iframe.name=t;c.iframe.setAttribute("class",d);c.iframe.setAttribute("allowfullscreen","");c.iframe.setAttribute("mozallowfullscreen","");c.iframe.setAttribute("oallowfullscreen","");c.iframe.setAttribute("msallowfullscreen",""); +c.iframe.setAttribute("webkitallowfullscreen","");c.iframe.setAttribute("onload",'openoFrameWork.SyncCSS(this,0,"'+m+'");openoFrameWork.stopPageLoading();');x.replace(f,c);c.onMessage("height",function(c){console.log("The frame "+f+" receive message height is "+c);var b=$(".page-content .page-content-body ."+f);c=Math.max(this.minHeight,c);b.height(c)});return c}v="";var p=c.attr("href");if(p&&!(2>p.length)){var p=openoFrameWork.handlBaseURL(p),d=c.attr("category");if(d&&0=$("#"+g).length&&u.append("
"),F(),pymParent=f(g,p,d,d,d,_xdomain,l),g=$(pymParent.iframe),0 a",function(c){!1==$(this).next().hasClass("sub-menu")?!1==$(".btn-navbar").hasClass("collapsed")&&$(".btn-navbar").click():$(this).next().hasClass("sub-menu always-open")||(Y($(this)),c.preventDefault())});$(".page-sidebar").on("click"," li > a.iframe",function(c){c.preventDefault();var b=$(this).attr("id");b&&0 a.iframe",function(c){2> +$(this).attr("href").length||(c.preventDefault(),L($(this),c))});$("#pageableDiv").on("click"," div > a.iframe",function(c){2>$(this).attr("href").length||(c.preventDefault(),L($(this),c))});$("#pageableDiv").on("click"," li > a.iframe",function(c){if(!(2>$(this).attr("href").length)){c.preventDefault();if(c.target){var b=$("span",c.target),b=0div>span",c.target.parentNode.parentNode.parentNode.parentNode.parentNode).replaceWith(b.outerHTML)}L($(this),c)}});$(".dropdown").on("click", +" li > a.iframe",function(c){2>$(this).attr("href").length||(c.preventDefault(),F(),S($(this),c),M($(this),!1,c))})},ma="",T=!0,U=null,aa=function(c,b){if(!(2>c.length))if(c=openoFrameWork.handlBaseURL(c),ma==c)if(!0===b)$("#pageableDiv").show();else{if(b&&b.target&&b.currentTarget){var f=$(b.target).attr("defaultDisplay");(f=f?f:$(b.currentTarget).attr("defaultDisplay"))&&"false"==f.trim()?$("#pageableDiv").hide():$("#pageableDiv").show()}}else{ma=c;clearMoreOperations();var d=b&&b.data&&b.data.breadcrumbBtnMenuItem&& +0=d.length?b&&b.breadcrumbBtnMenuItem&&0');g.children().remove();g.append(f);var h=$(".dropdown-menu",g).attr("displayType");if(h&&"pageableDiv"!=h)$(".more-botton-zone").append(f), +$("#pageableDiv").hide();else{var k=$(".dropdown-menu",g);if(0f.length)f=$(".page-content a[id='"+d+"']");if(0"+$.i18n.prop("com_zte_ums_ict_framework_ui_loadmenuerror")+"");T=!0}})}};dealMultTabPage=function(c){var b=c.attr("href");if(b&&!(2>b.length)){var f= +c.attr("redirect");if(f&&0",b),c=E.substring(0,b)+""):c=void 0,ba="";else{for(;g&&0
"+c),g.parent("ul").attr("id")==fMenuSiderDivId||g.parent("ul").attr("id")==megaSiderDivId?(g=g.children("a").attr("hparentid"),h==openoFrameWork_menu_horizontal?magaMenu=$("#"+megaDivId):h==openoFrameWork_menu_fmenu&&(magaMenu=$("#"+fMenuMegaDivId)),g=$("a[id="+g+"]",magaMenu).parent("li")):g=g.parents("li"));g[0]&&0"+c)}d.empty();$(".more-botton-zone").empty();E=c;store("globleCurrentBreadcrumb",E);d.append(c);k&&0"+f);d=d.parents("li")}d[0]&&0"+f);g&&0'+ +f);f=E+f;b.append(f)},R=!1,L=function(c,b){var f=c.attr("id");f&&0=$(".footer").length)?0:$(".footer").outerHeight());return c},X= +function(){var c=$(".page-sidebar-menu");1===c.parent(".slimScrollDiv").size()&&(c.removeAttr("style"),$(".page-sidebar").removeAttr("style"));0===$(".page-sidebar-fixed").size()?B():G().width>=openoFrameWork_smallView&&(ja(),B())},pa=function(){!1!==$("body").hasClass("page-sidebar-fixed")&&($(".page-sidebar").off("mouseenter").on("mouseenter",function(){Da()}),$(".page-sidebar").off("mouseleave").on("mouseleave",function(){Ea()}))},Da=function(){var c=$("body"),b=$(".page-sidebar");!1===c.hasClass("page-sidebar-closed")|| +!1===c.hasClass("page-sidebar-fixed")||$(this).hasClass("page-sidebar-hovering")||(c.removeClass("page-sidebar-closed").addClass("page-sidebar-hover-on"),$(".sidebar-toggler"),c.hasClass("page-sidebar-reversed")?b.width(u):(b.addClass("page-sidebar-hovering"),b.animate({width:u},350,"",function(){b.removeClass("page-sidebar-hovering")})))},Ea=function(){var c=$("body");if(!1!==c.hasClass("page-sidebar-hover-on")&&!1!==c.hasClass("page-sidebar-fixed")&&!$(this).hasClass("page-sidebar-hovering")){var b= +$(".page-sidebar"),f=$(".sidebar-toggler");c.hasClass("page-sidebar-reversed")?(c.addClass("page-sidebar-closed").removeClass("page-sidebar-hover-on"),b.width(q),f&&f.removeAttr("style")):(b.addClass("page-sidebar-hovering"),b.animate({width:q},350,"",function(){c.addClass("page-sidebar-closed").removeClass("page-sidebar-hover-on");b.removeClass("page-sidebar-hovering");f&&f.removeAttr("style")}))}},K=function(c,b,f,d){var g=c.attr("style")?c.attr("style"):"";styles=g.split(";");var h="";for(i=0;i< +styles.length;i++)if(0<=styles[i].indexOf(b)){h=styles[i];break}g=0=openoFrameWork_smallView&&$("body").addClass("page-sidebar-closed");$(".page-sidebar, .sidebar-toggler").on("click",".sidebar-toggler",function(c){c.preventDefault();c=$("body");$(".page-sidebar");c.hasClass("page-sidebar-closed")&&$(this).removeAttr("style")});$(".page-sidebar, .header").on("click", +".sidebar-toggler",function(c){var b=$("body"),d=$(".page-sidebar");b.hasClass("page-sidebar-hover-on")&&b.hasClass("page-sidebar-fixed")||d.hasClass("page-sidebar-hovering")?(b.removeClass("page-sidebar-hover-on"),d.css("width","").hide().show(),B(),A("sidebar_closed","0"),c.stopPropagation()):($(".sidebar-search",d).removeClass("open"),c=$(".zte-theme-panel"),$(".sidebar-pos-option",c).val(),c=$("[class='page-content']"),b.hasClass("page-sidebar-closed")?(b.removeClass("page-sidebar-closed"),b.hasClass("page-sidebar-fixed")&& +d.css("width",""),A("sidebar_closed","0"),c.css("marginLeft",u)):(b.addClass("page-sidebar-closed"),$(this).removeAttr("style"),A("sidebar_closed","1"),c.css("marginLeft",q)),B(!0));W()})},Ga=function(){$(".header").on("click",".hor-menu .hor-menu-search-form-toggler",function(c){$(this).hasClass("off")?($(this).removeClass("off"),$(".header .hor-menu .search-form").hide()):($(this).addClass("off"),$(".header .hor-menu .search-form").show());c.preventDefault()});$(".header").on("click"," li > a.iframe", +function(c){c.preventDefault();var b=$(this).attr("id");b&&0')})},qa=function(){var c=0;return setInterval(function(){var b;null==b&& +(b=openoFrameWork_conf.userName);b=FrameConst.REST_HEARTBEAT+"?username="+encodeURIComponent(b);$.ajax(b,{dataType:"text",cache:!1}).done(function(b){"true"==b&&(c=0)});c++;6<=c&&(disableHeartbeat(),bootbox.alert($.i18n.prop("com_zte_ums_aos_framework_ui_heartbeat_fail"),function(){window.location.replace("login.html")}))},1E4)};if(FrameConst.do_heartbeat)var O=qa();window.enableHeartbeat=function(){return O?"Already enabled!":(heartBeatTimes=0,O=qa(),"Enabled")};window.disableHeartbeat=function(){return O? +(clearInterval(O),O=null,"Disabled"):"Already disabled!"};window.doLogout=function(){window.location=FrameConst.REST_LOGOUT};$("#trigger_logout").click(function(){bootbox.confirm($.i18n.prop("com_zte_ums_ict_framework_ui_confirmlogout"),function(c){c&&doLogout()})});var P=!1,Ha=function(){function c(){if(screenfull.supportsFullScreen)screenfull.isFullScreen?screenfull.exitFullScreen():screenfull.requestFullScreen(),P=screenfull.isFullscreen;else if(isIE&&"undefined"!==typeof window.ActiveXObject){var c= +new ActiveXObject("WScript.Shell");null!==c&&(c.SendKeys("{F11}"),P=!P)}else P=screenfull.supportsFullScreen;setTimeout(function(){P?$("#fullscreen_label").text($.i18n.prop("com_zte_ums_ict_framework_ui_group_exitfullscreen")):$("#fullscreen_label").text($.i18n.prop("com_zte_ums_ict_framework_ui_group_fullscreen"))},500)}$("#trigger_fullscreen").click(function(){c()})},ra=function(c){if(0 .theme-options").show()});$(".toggler-close",c).click(function(){$(".toggler").show();$(".toggler-close").hide();$(".zte-theme-panel > .theme-options").hide()}); +$(".theme-colors > ul > li",c).click(function(){var b=$(this).attr("data-style");d(b);$("ul > li",c).removeClass("current");$(this).addClass("current")});$(".layout-option,.header-option, .sidebar-option, .footer-option, .sidebar-pos-option, .nav-pos-direction",c).change(function(){ta()});void 0!=Q("style_color")&&d(Q("style_color"));$(".language-option",c).change(function(){var b=$(".language-option",c).val();A("language-option",b);window.location.reload()})},ta=function(){var c=$(".zte-theme-panel"), +b=$(".layout-option",c).val(),f=$(".language-option",c).val(),d=$(".header-option",c).val(),g=$(".footer-option",c).val(),h=$(".nav-pos-direction",c).val();var k=$(".zte-theme-panel");if("disabled"!=$(".nav-pos-direction",k).attr("disabled")){var l=$("#page-sidebar-menu"),m=$("#main_hormenu"),l=$("#page-sidebar-menu"),m=$("#main_hormenu"),n=$("#"+megaSiderDivId),v=$("#"+fMenuMegaDivId),w=$("#"+fMenuSiderDivId),r=$("[class='page-content']");l&&0 .header-inner").removeClass("container");1===$(".page-container").parent(".container").size()&&$(".page-container").insertAfter("body > .clearfix");1===$(".footer > .container").size()?$(".footer").html($(".footer > .container").html()):1===$(".footer").parent(".container").size()&&$(".footer").insertAfter(".page-container");$("body > .container").remove();"boxed"===b&&($("body").addClass("page-boxed"),$(".header > .header-inner").addClass("container"),$("body > .clearfix").after('
'), +$(".page-container").appendTo("body > .container"),"fixed"===g?$(".footer").html('
'+$(".footer").html()+"
"):$(".footer").appendTo("body > .container"));sa!=b&&W();sa=b;"fixed"===d?($("body").addClass("page-header-fixed"),$(".header").removeClass("navbar-static-top").addClass("navbar-fixed-top")):($("body").removeClass("page-header-fixed"),$(".header").removeClass("navbar-fixed-top").addClass("navbar-static-top"));!1===$("body").hasClass("page-full-width")&&("fixed"=== +k?$("body").addClass("page-sidebar-fixed"):$("body").removeClass("page-sidebar-fixed"));"fixed"===g?$("body").addClass("page-footer-fixed"):$("body").removeClass("page-footer-fixed");openoFrameWork.isRTL()?"left"===l?($("body").addClass("page-sidebar-reversed"),$("#frontend-link").tooltip("destroy").tooltip({placement:"right"})):(c=$("[class='page-content']"),c.css("marginLeft",0),$("body").removeClass("page-sidebar-reversed"),$("#frontend-link").tooltip("destroy").tooltip({placement:"left"})):"right"=== +l?(c=$("[class='page-content']"),c.css("marginLeft",0),$("body").addClass("page-sidebar-reversed"),$("#frontend-link").tooltip("destroy").tooltip({placement:"left"})):($("body").removeClass("page-sidebar-reversed"),$("#frontend-link").tooltip("destroy").tooltip({placement:"right"}));B();X();pa();A("layout-option",b);A("language-option",f);A("header-option",d);A("sidebar-option",k);A("sidebar-pos-option",l);A("nav-pos-direction",h)},A=function(c,b){store&&store(c,b)},Q=function(c){if(store)return store(c)}, +N=function(c){location.hash="#_"+c},ua=function(c,b,f,d){var g=$.url(openoFrameWork.getCurrentScript(document)).attr("directory")+"proxy/proxy.html",g=$(''),h=$("#ifm_Proxy");h.hide();var k=$(".page-content .page-content-body"),l=[],m=[],n=[],q="";for(i=0;i=h.length?(g.appendTo(k),g.one("load",c,function(c){var b={iFrame:c.data.iFrame,cssLinktyps:c.data.cssLinktyps,cssLinksrcs:c.data.cssLinksrcs,cssLinkids:c.data.cssLinkids,flag:d};$("#ifm_Proxy")[0].contentWindow.postMessage(b, +c.data.origin)})):h.attr("oldproxyorigin")!=b?(h.attr("src",""),h.attr("oldproxyorigin",b),h.one("load",c,function(c){var b={iFrame:c.data.iFrame,cssLinktyps:c.data.cssLinktyps,cssLinksrcs:c.data.cssLinksrcs,cssLinkids:c.data.cssLinkids,flag:d};$("#ifm_Proxy")[0].contentWindow.postMessage(b,c.data.origin)}),h.attr("src",g.attr("src"))):h[0].contentWindow.postMessage({iFrame:c.iFrame,cssLinktyps:c.cssLinktyps,cssLinksrcs:c.cssLinksrcs,cssLinkids:c.cssLinkids,flag:d},c.origin)};return{init:function(){zte_http_headers&& +store("zte_http_headers",zte_http_headers);va();xa();wa();ra(!0);C.clear();X();pa();Ca();Ga();Fa();Ia();ta();$(function(){$(window).on("hashchange",function(){var c=location.hash.replace("#_","");if(c&&0f.length)f=$(".page-content a[id='"+c+"']")}else d=== +openoFrameWork_menu_horizontal?(f=$("#main_hormenu a[id='"+c+"']"),0==f.length&&(f=$("#page-megachild-sidebar-menu a[id='"+c+"']"))):d===openoFrameWork_menu_fmenu&&(f=$("#f_hormenu a[id='"+c+"']"),0==f.length&&(f=$("#page-f-sidebar-menu a[id='"+c+"']")));d=!1;if(0=b.length){var h=c;C.contains(h)&&(f="#"+C.items(h),b=$(f))}c=void 0;f&&0');var g=document.createElement("link");g.href=f[0].href;f=null;g.rel="stylesheet";g.type="text/css";g.id="ifram_csssrc";d.push({pos:"head",scope:"all",link:g})}10!=b&&(0<$("#style_color").length&&(g=document.createElement("link"),g.href=$("#style_color")[0].href.replace(".css","_ifrm.css"),g.rel="stylesheet",g.type="text/css",g.id="style_color",d.push({pos:"head",scope:"all",link:g})),0<$("#font_awesome").length&&(f=document.createElement("link"),f.href=$("#font_awesome")[0].href, +f.rel="stylesheet",f.type="text/css",f.id="font_awesome",d.push({pos:"head",scope:"all",link:f})),g=$("script[src*='/pym.']"),g=0c.indexOf("#")&&(c="#"+c),$(c).click()))},goToPortal:function(c){var b=top.location.href;console.log(b); +b=$.url(b);top.location=b.attr("directory")+"uifportal.html#"+c+"/"},goToURLByIDAndNewIPPort:function(b,d,f){V.replace(d.menuCategoryID,{ipPort:d.ipPortStr,ipTitle:d.newTitle});store&&store("menuCategoryID",d.menuCategoryID+"[menuCategoryID]"+d.ipPortStr+"[menuCategoryID]"+(d.newTitle?d.newTitle:""));var g=this.findMenuItemByMenuId(b);if(!g||0>=g.length){var h=this.getMenuItemId_From_MoreMenuRelation(b);if(h&&0div.box",h),!1==h.hasClass("moreButtonSelected")&&h.addClass("moreButtonSelected"),h=$(".item.moreButtonsTag"),0=g.length)f=b,C.contains(f)&&(h=C.items(f),g=this.findMenuItemByMenuId(h)),g&&0=g.length){var k=this.getMenuItemId_From_MoreMenuRelation(b);k&&(g=this.findMenuItemByMenuId(k))}if(store&& +store("globleCurrentBreadcrumb")){E=store("globleCurrentBreadcrumb");for(var l=$("a",$("
"+E+"
")),m,n,q=0;qq;)m=openoFrameWork.findMenuItemByMenuId(l),l=m.attr("hparentid"),b=m.attr("id"),q++;m.hasClass("active")|| +m.parent().addClass("active")}}else console.log("goToURLByIDAndNewAction():Can't find the menuitem.The menu ID is:"+b+".Please check if the ID or ID cache is correct.");b=void 0;d&&h&&0=d.length)menuItemID=b,C.contains(menuItemID)&&(f="#"+C.items(menuItemID),d=$(f));b=void 0; +f&&0f.length||(d.preventDefault(),(f=b.attr("id"))&&0b.length)){b=openoFrameWork.handlBaseURL(b);openoFrameWork.startPageLoading();var d=$("#page-sidebar-menu");d.empty();d.append("");$.ajax({type:"GET",cache:!1,url:b,dataType:"html",success:function(b){var k=stripHtmlScripts(b);d.append(k);runHtmlScripts(b);siderBarMenuAuthentication();dealMysqlBackupMenu();setTimeout(function(){openoFrameWork.stopPageLoading();goToHomePage()}, +1E3)},error:function(b,d,g){}})}} +var setLayoutValueByCookie=function(){var b=$(".zte-theme-panel");void 0!=store("layout-option")&&$(".layout-option",b).val(store("layout-option"));void 0!=store("language-option")&&$(".language-option",b).val(store("language-option"));void 0!=store("sidebar-option")&&$(".sidebar-option",b).val(store("sidebar-option"));void 0!=store("header-option")&&$(".header-option",b).val(store("header-option"));void 0!=store("sidebar-pos-option")&&$(".sidebar-pos-option",b).val(store("sidebar-pos-option"));$("[class='nav-load-error']", +$(".hormenu"));$("[class='nav-load-error']",$("[class='page-sidebar-menu']"));$(".nav-pos-direction",b).val("fmenu")}; +function getHorMenu(b){setLayoutValueByCookie();2>b.length||(b=openoFrameWork.handlBaseURL(b),openoFrameWork.startPageLoading(),$("#main_hormenu").empty(),$.ajax({type:"GET",async:!1,cache:!1,url:b,dataType:"html",success:function(b){var h=stripHtmlScripts(b);$("#main_hormenu").append(h);runHtmlScripts(b);"mysql"==openoFrameWork_conf.dbType&&$(".hor-menu a[id='uep-ict-backup-baseDataBack']").parent().remove();horMenuAuthentication("main_hormenu");openoFrameWork.stopPageLoading();"horizontal"===$(".nav-pos-direction", +panel).val()&&setTimeout(function(){},150)},error:function(b,h,k){$("[class='page-content']");$(".nav-pos-direction",panel).attr("disabled",!0)}}))} +function getMegaFMenu(b){if(!(2>b.length)){b=openoFrameWork.handlBaseURL(b);openoFrameWork.startPageLoading();var d=$("#"+megaSiderDivId);d.empty();d.append("");$.ajax({type:"GET",async:!1,cache:!1,url:b,dataType:"html",success:function(b){var k=stripHtmlScripts(b);d.append(k);runHtmlScripts(b);FMenuAuthentication(megaDivId,megaSiderDivId);rebuildHorMenu();ajustFMenu(megaDivId,megaSiderDivId);openoFrameWork.stopPageLoading()}, +error:function(b,d,g){}})}}function iniHorMenu(){var b=$("#main_hormenu");b&&((b=b.attr("menuSrc"))&&0b.length||2>d.length)){b=openoFrameWork.handlBaseURL(b);d=openoFrameWork.handlBaseURL(d);openoFrameWork.startPageLoading();$("#f_hormenu").empty();$("#page-f-sidebar-menu").empty();$.ajax({type:"GET",async:!1,cache:!1,url:b,dataType:"html",success:function(b){var d=stripHtmlScripts(b);$("#f_hormenu").append(d);horMenuAuthentication("f_hormenu");runHtmlScripts(b);dealMysqlBackupMenu();openoFrameWork.stopPageLoading()},error:function(b,d,h){$("#f_hormenu").append('");$("[class='page-content']");$(".nav-pos-direction",panel).attr("disabled",!0)}});var h=$("#"+fMenuSiderDivId);h.empty();h.append("");$.ajax({type:"GET",cache:!1,url:d,dataType:"html",success:function(b){var d=stripHtmlScripts(b);h.append(d);h.children().css("display","none");runHtmlScripts(b);dealMysqlBackupMenu();FMenuAuthentication(fMenuMegaDivId, +fMenuSiderDivId);ajustFMenu(fMenuMegaDivId,fMenuSiderDivId);openoFrameWork.stopPageLoading();loadi18n_WebFramework_sideMenu()},error:function(b,d,h){$(".page-f-sidebar-menu").append('")}})}}function iniSidebarMenu(){var b=$("#page-sidebar-menu");b&&(b=b.attr("menuSrc"))&&0b.length||(openoFrameWork.startPageLoading(),$(".modal-dialog .Changepasswd").empty(),$.ajax({type:"GET",cache:!1,url:b,dataType:"html",success:function(b){$(".modal-dialog .Changepasswd").append(b);ChangePWD.init();openoFrameWork.stopPageLoading()},error:function(b,h,k){$(".modal-dialog .Changepasswd").append("

"+$.i18n.prop("com_zte_ums_ict_framework_ui_loadchgpwdpageError")+"

")}}))} +function iniChangePWDDlg(){var b=$(".modal-dialog .Changepasswd").attr("dlgsrc");b&&0b.length||(openoFrameWork.startPageLoading(),$("#headerMenu").empty(),$.ajax({type:"GET",cache:!1,async:!1,url:b,dataType:"html",success:function(b){$("#headerMenu").append(b);openoFrameWork.stopPageLoading()},error:function(b,h,k){}}))} +function goToHomePage(){if((locationhash=openoFrameWork.getLocationHash())&&0g.length&&(g=$(".iframe.start",k)),dealStartMenu(g,h,k))}} +var dealStartMenu=function(b,d,h){var k=setInterval(function(){b&&0b.length&&$("a[operation]",h).each(function(){b=$(this);return!1}))},100);handeCtxMenuitem()}; +function handeCtxMenuitem(){$(".page-sidebar ul li a").each(function(){$(this).attr("href")&&"javascript:;"!=$(this).attr("href")&&"#"!=$(this).attr("href")&&$(this).attr("oncontextmenu","return false")});$(".hormenu li a").each(function(){$(this).attr("href")&&"javascript:;"!=$(this).attr("href")&&"#"!=$(this).attr("href")&&$(this).attr("oncontextmenu","return false")})} +function initBaseInfo(){$("#logout_label").text($.i18n.prop("com_zte_ums_ict_framework_ui_group_logout"));$("#fullscreen_label").text($.i18n.prop("com_zte_ums_ict_framework_ui_group_fullscreen"));$("#changePwd_label").text($.i18n.prop("com_zte_ums_ict_framework_ui_changePwd"));$("#com_zte_ums_ict_framework_moudle_about").text($.i18n.prop("com_zte_ums_ict_framework_moudle_about"));$("#com_zte_ums_ict_framework_moudle_help").text($.i18n.prop("com_zte_ums_ict_framework_moudle_help"));$("#zte_menu-toggler").attr("title", +$.i18n.prop("com_zte_ums_ict_framework_moudle_menutoggler"))}window.closeModal=function(b){b&&(0>b.indexOf("#")&&(b="#"+b),$(b).modal("hide"))};function getLcsRight(b){var d=[];if(b&&0 li.btn-group")).each(function(){var g=$(this).attr("licenseid");g&&(d.push(g),g=$(this).attr("id"),b.push(g))});var h=getLcsRight(d);if(h&&h.length==b.length)for(var k=0;k li.btn-group")).parent().remove()}"mysql"==openoFrameWork_conf.dbType&&$("#uep-ict-backup-baseDataBack",$(".more-botton-zone > li.btn-group")).parent().remove();var n= +[];$("a[operation]",$(".more-botton-zone > li.btn-group")).each(function(){var b=$(this).attr("operation");b&&n.push(b)});var m=getAllOperCodeRights(n);$("a[operation]",$(".more-botton-zone > li.btn-group")).each(function(){var b=$(this).attr("operation");b&&(hasRight(b,m)||$(this).parent("li").remove())});0==$("li > a",$(".more-botton-zone > li.btn-group")).length&&$(".more-botton-zone > li.btn-group").remove()} +function rebuildSiderBarMenu(){0==$("a.start").length&&$('li > a[href!="javascript:;"]',$(".page-sidebar-menu")).eq(0).addClass("start");$("ul.sub-menu",$(".page-sidebar-menu")).each(function(){0==$(this).has("li").length&&$(this).parent("li").remove()})} +function rebuildHorMenu(){0==$("a.start").length&&$('li > a[href!="#"]',$("#main_hormenu")).eq(0).addClass("start");$("ul.mega-menu-submenu",$("#main_hormenu")).each(function(){0==$(this).has("li > a").length&&$(this).remove()});$("div.zteDivWidth",$("#main_hormenu")).each(function(){0==$(this).has("ul").length&&$(this).remove()});$("ul.dropdown-menu",$("#main_hormenu")).each(function(){0==$(this).has("ul").length&&$(this).parent("li").remove()});$("li.divider",$("#main_hormenu")).each(function(){$(this).next().hasClass("divider")&& +$(this).remove()});$("li.divider",$("#main_hormenu")).each(function(){0==$(this).next().length&&$(this).remove()})} +function getAllOperCodeRights(b){var d=[];if(b&&00){ + if (itemValue.indexOf(';') > 0) { itemValue = itemValue.replace(';', ''); } - if(/[\'\"]/.test(itemValue)){ + if (/[\'\"]/.test(itemValue)) { itemValue = itemValue.replace(/\"/g,''); itemValue = itemValue.replace(/\'/g,''); } - if(typeof($item.attr("title"))!="undefined"){ + if (typeof($item.attr("title")) != "undefined") { $item.attr("title", itemValue); - }else if(typeof($item.attr("placeholder"))!="undefined"){ + } else if (typeof($item.attr("placeholder")) != "undefined") { $item.attr("placeholder", itemValue); - }else{ + } else { $item.text(itemValue); } - } - } - }); + } + } + }); } -function loadi18n_login(lang){ - loadProperties_login(lang); +function loadi18n_login(lang) { + loadProperties_login(lang); } - - diff --git a/openo-portal/portal-common/src/main/webapp/common/js/login.js b/openo-portal/portal-common/src/main/webapp/common/js/login.js index ee774f2c..9e2e7f3a 100644 --- a/openo-portal/portal-common/src/main/webapp/common/js/login.js +++ b/openo-portal/portal-common/src/main/webapp/common/js/login.js @@ -13,213 +13,191 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -String.prototype.trim = function() { - return this.replace(/(^\s*)|(\s*$)/g, ""); +String.prototype.trim = function() { + return this.replace(/(^\s*)|(\s*$)/g, ""); }; + function loginSubmitHandler(form) { - var params = {}; - params["username"] =$("#inputUserName").val().trim(); - var sourcePass = $("#inputPassword").val(); - var pass = sourcePass; - if( FrameConst.isEncypt === "true"){ - pass = ict_framework_func1(pass); - } - params["password"] = pass; - params["isEncypted"] = FrameConst.isEncypt; - saveUserInfo(params); - $.ajax({ - url : FrameConst.REST_LOGIN, - type : 'POST', - data : JSON.stringify(params), - dataType : 'json', - contentType : 'application/json; charset=utf-8', - success : function(data, status, xhr) { - if(data.result == 0){ - var epass=CryptoJS.MD5(params.username+sourcePass); - store("icttka", epass.toLocaleString()); - } - processLoginResult(data,params); - }, - Error : function(xhr, error, exception) { - alert( error ); - if( console ){ - console.log( "login fail:" + error ); - console.log( exception ); - } - } - }); + var params = {}; + params["username"] = $("#inputUserName").val().trim(); + var sourcePass = $("#inputPassword").val(); + var pass = sourcePass; + if (FrameConst.isEncypt === "true") { + pass = ict_framework_func1(pass); + } + params["password"] = pass; + params["isEncypted"] = FrameConst.isEncypt; + saveUserInfo(params); + + $.ajax({ + url : FrameConst.REST_LOGIN, + type : 'POST', + data : JSON.stringify(params), + dataType : 'json', + contentType : 'application/json; charset=utf-8', + success : function(data, status, xhr) { + if (data.result == 0) { + var epass = CryptoJS.MD5(params.username+sourcePass); + store("icttka", epass.toLocaleString()); + } + processLoginResult(data,params); + }, + Error : function(xhr, error, exception) { + if (console) { + console.log("login fail:" + error); + console.log(exception); + } + } + }); }; - var Login = function () { - var handleLogin = function() { $('.login-form').validate({ - errorElement: 'span', //default input error message container - errorClass: 'help-block', // default input error message class - focusInvalid: false, // do not focus the last invalid input - rules: { - username: { - required: true - }, - password: { - required: false - }, - remember: { - required: false - } - }, - - messages: { - username: { - required: $.i18n.prop('com_zte_ums_ict_login_inputname').replace(/\"/g,'') - }, - password: { - required: $.i18n.prop('com_zte_ums_ict_login_inputpwd').replace(/\"/g,'') - } - }, - - invalidHandler: function (event, validator) { //display error alert on form submit - $('.alert-danger', $('.login-form')).show(); - }, - - highlight: function (element) { // hightlight error inputs - $(element) - .closest('.form-group').addClass('has-error'); // set error class to the control group - }, - - success: function (label) { - label.closest('.form-group').removeClass('has-error'); - label.remove(); - }, - - errorPlacement: function (error, element) { - error.insertAfter(element.closest('.input-icon')); - }, - - submitHandler: loginSubmitHandler - }); - - $('.login-form input').keypress(function (e) { - $("#nameOrpwdError").hide(); - $("#loginConnError").hide(); - if (e.which == 13) { - if ($('.login-form').validate().form()) { - $('.login-form').submit(); - } - return false; - } - }); - - $("input[name='remember']").bind("click", function () { - saveUserInfo(); - }); + errorElement: 'span', //default input error message container + errorClass: 'help-block', // default input error message class + focusInvalid: false, // do not focus the last invalid input + rules: { + username: { + required: true + }, + password: { + required: false + }, + remember: { + required: false + } + }, + messages: { + username: { + required: $.i18n.prop('com_zte_ums_ict_login_inputname').replace(/\"/g,'') + }, + password: { + required: $.i18n.prop('com_zte_ums_ict_login_inputpwd').replace(/\"/g,'') + } + }, + invalidHandler: function (event, validator) { + $('.alert-danger', $('.login-form')).show(); + }, + highlight: function (element) { + $(element).closest('.form-group').addClass('has-error'); // set error class to the control group + }, + success: function (label) { + label.closest('.form-group').removeClass('has-error'); + label.remove(); + }, + errorPlacement: function (error, element) { + error.insertAfter(element.closest('.input-icon')); + }, + submitHandler: loginSubmitHandler + }); + + $('.login-form input').keypress(function (e) { + $("#nameOrpwdError").hide(); + $("#loginConnError").hide(); + if (e.which == 13) { + if ($('.login-form').validate().form()) { + $('.login-form').submit(); + } + return false; + } + }); + + $("input[name='remember']").bind("click", function () { + saveUserInfo(); + }); } var handleForgetPassword = function () { $('.forget-form').validate({ - errorElement: 'span', //default input error message container - errorClass: 'help-block', // default input error message class - focusInvalid: false, // do not focus the last invalid input - ignore: "", - rules: { - email: { - required: true, - email: true - } - }, - - messages: { - email: { - required: "Email is required." - } - }, - - invalidHandler: function (event, validator) { //display error alert on form submit - - }, - - highlight: function (element) { // hightlight error inputs - $(element) - .closest('.form-group').addClass('has-error'); // set error class to the control group - }, - - success: function (label) { - label.closest('.form-group').removeClass('has-error'); - label.remove(); - }, - - errorPlacement: function (error, element) { - error.insertAfter(element.closest('.input-icon')); - }, - - submitHandler: function (form) { - form.submit(); - } - }); - - $('.forget-form input').keypress(function (e) { - if (e.which == 13) { - if ($('.forget-form').validate().form()) { - $('.forget-form').submit(); - } - return false; - } - }); - - $('#forget-password').click(function () { - $('.login-form').hide(); - $('.forget-form').show(); - }); - - $('#back-btn').click(function () { - $('.login-form').show(); - $('.forget-form').hide(); - }); - + errorElement: 'span', //default input error message container + errorClass: 'help-block', // default input error message class + focusInvalid: false, // do not focus the last invalid input + ignore: "", + rules: { + email: { + required: true, + email: true + } + }, + messages: { + email: { + required: "Email is required." + } + }, + invalidHandler: function (event, validator) { //display error alert on form submit + }, + highlight: function (element) { // hightlight error inputs + $(element).closest('.form-group').addClass('has-error'); // set error class to the control group + }, + success: function (label) { + label.closest('.form-group').removeClass('has-error'); + label.remove(); + }, + errorPlacement: function (error, element) { + error.insertAfter(element.closest('.input-icon')); + }, + submitHandler: function (form) { + form.submit(); + } + }); + + $('.forget-form input').keypress(function (e) { + if (e.which == 13) { + if ($('.forget-form').validate().form()) { + $('.forget-form').submit(); + } + return false; + } + }); + + $('#forget-password').click(function () { + $('.login-form').hide(); + $('.forget-form').show(); + }); + + $('#back-btn').click(function () { + $('.login-form').show(); + $('.forget-form').hide(); + }); } - return { - //main function to initiate the module - init: function () { - - handleLogin(); - handleForgetPassword(); - - $.backstretch([ - "image/integration/zte_bg_1.jpg", - "image/integration//zte_bg_2.jpg", - "image/integration//zte_bg_3.jpg" - ], { - fade: 500, - duration: 15000 - }); - } - }; -}(); + return { + //main function to initiate the module + init: function () { + handleLogin(); + handleForgetPassword(); + $.backstretch([ + "./common/image/integration/openo_bg_1.jpg", + "./common/image/integration//openo_bg_2.jpg", + "./common/image/integration//openo_bg_3.jpg" + ], { + fade: 500, + duration: 15000 + }); + } + }; +}(); $(document).ready(function() { - if (store("remember") == "true") { - $("input[name='remember']").attr("checked", "checked"); - $("#inputUserName").val(store("inputUserName")); - $("#inputPassword").val(store("inputPassword")); - } + if (store("remember") == "true") { + $("input[name='remember']").attr("checked", "checked"); + $("#inputUserName").val(store("inputUserName")); + $("#inputPassword").val(store("inputPassword")); + } }); - function saveUserInfo(params) { - var rmbcheck=$("input[name='remember']"); - if (rmbcheck.attr("checked")==true||rmbcheck.is(':checked')) { - var userName = $("#inputUserName").val(); - var passWord = $("#inputPassword").val(); - store("remember", "true"); - store("inputUserName", params.username); - store("inputPassword", passWord); - } - else { - store.remove("remember"); - store.remove("inputUserName"); - store.remove("inputPassword"); - } + var rmbcheck = $("input[name='remember']"); + if (rmbcheck.attr("checked") == true || rmbcheck.is(':checked')) { + var userName = $("#inputUserName").val(); + var passWord = $("#inputPassword").val(); + store("remember", "true"); + store("inputUserName", params.username); + store("inputPassword", passWord); + } else { + store.remove("remember"); + store.remove("inputUserName"); + store.remove("inputPassword"); + } } - diff --git a/openo-portal/portal-common/src/main/webapp/common/js/mainpage/about.js b/openo-portal/portal-common/src/main/webapp/common/js/mainpage/about.js index 6468440c..5e516bde 100644 --- a/openo-portal/portal-common/src/main/webapp/common/js/mainpage/about.js +++ b/openo-portal/portal-common/src/main/webapp/common/js/mainpage/about.js @@ -98,7 +98,7 @@ function getAboutDlg(url){ if (url.length<2){ return; } - ZteFrameWork.startPageLoading();//加载中.... + openoFrameWork.startPageLoading();//加载中.... var aboutDiv =jQuery('.modal-dialog .aboutDlg'); aboutDiv.empty(); $.ajax({ @@ -110,7 +110,7 @@ function getAboutDlg(url){ jQuery('.modal-dialog .aboutDlg').append(res); iniAboutInfo(); internationalization(); - ZteFrameWork.stopPageLoading(); + openoFrameWork.stopPageLoading(); }, error: function (xhr, ajaxOptions, thrownError) { diff --git a/openo-portal/portal-common/src/main/webapp/common/js/mainpage/ict.main.page.js b/openo-portal/portal-common/src/main/webapp/common/js/mainpage/ict.main.page.js index 3752ac02..6ccb3e52 100644 --- a/openo-portal/portal-common/src/main/webapp/common/js/mainpage/ict.main.page.js +++ b/openo-portal/portal-common/src/main/webapp/common/js/mainpage/ict.main.page.js @@ -123,10 +123,6 @@ var initMainPage = function(){ }); //添加模块导航链接 -// var parentPage = window.parent; -// while(!parentPage.ZteFrameWork){ -// parentPage = parentPage.parent; -// } $("a.entranceLink").click(function(e){ e.preventDefault(); if($(this).attr("id") && $(this).attr("id") != "undefined"){ diff --git a/openo-portal/portal-common/src/main/webapp/common/js/moreOperation.js b/openo-portal/portal-common/src/main/webapp/common/js/moreOperation.js index 70b0862c..8078f54b 100644 --- a/openo-portal/portal-common/src/main/webapp/common/js/moreOperation.js +++ b/openo-portal/portal-common/src/main/webapp/common/js/moreOperation.js @@ -23,8 +23,8 @@ var resetSelectedItem=function(menuAlink){ } } var reSelected=function(){ - if(ZteFrameWork){ - var menuID = ZteFrameWork.getLocationHash(); + if(openoFrameWork){ + var menuID = openoFrameWork.getLocationHash(); var menuAlink = $('#'+ menuID,$('#pageableDiv')); if(menuAlink.length>0){ resetSelectedItem(menuAlink); diff --git a/openo-portal/portal-common/src/main/webapp/common/js/tools.js b/openo-portal/portal-common/src/main/webapp/common/js/tools.js index e65233ef..b4a6e68f 100644 --- a/openo-portal/portal-common/src/main/webapp/common/js/tools.js +++ b/openo-portal/portal-common/src/main/webapp/common/js/tools.js @@ -873,7 +873,7 @@ $Boot.Config = function() { } //当前语言 默认为英语 - var language = "zh-CN"; + var language = "en-US"; //var languageList = ['ar', 'ba', 'cr', 'cs', 'de', 'el', 'es', 'fi', 'fr', 'fr-FR', 'hu-HU', 'id', 'it', 'ja', 'nb-NO', 'nl', 'pl', 'pl-PL', 'pt', 'pt-BR', 'ro-RO', 'ru-RU', 'sk', 'sr', 'sr-Latn', 'sv-SE', 'en-US','uk-UA', 'zh-CN', 'zh-TW']; var languageList = ['en-US', 'zh-CN']; @@ -953,21 +953,6 @@ $Boot.Config = function() { } - /** - * 取得浏览器语言信息 - */ - this.getLanguage = function() { - var rtnLanguage = localStorage.getItem("language-option"); - if( rtnLanguage == "null" || rtnLanguage == null ){ - rtnLanguage = window.navigator.userLanguage||window.navigator.language; - } - if( rtnLanguage == '"zh-CN"' || rtnLanguage == "zh-CN" ){ - return "zh-CN"; - }else{ - return "en-US"; - } - //return "en-US"; - } this.getUrlParam=function(name){ var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象 @@ -986,7 +971,7 @@ $Boot.createNamespace("com.zte.ums.aos.framework.BootConfig", $Boot.Config); $Boot.bootConfig = new com.zte.ums.aos.framework.BootConfig(); function getLanguage(){ - return $Boot.bootConfig.getLanguage(); + return "en-US"; } function getStringWidth(text,fontSize) diff --git a/openo-portal/portal-common/src/main/webapp/common/json/main-page.json b/openo-portal/portal-common/src/main/webapp/common/json/main-page.json index 9e0118af..2ff3bfa3 100644 --- a/openo-portal/portal-common/src/main/webapp/common/json/main-page.json +++ b/openo-portal/portal-common/src/main/webapp/common/json/main-page.json @@ -16,13 +16,13 @@ { "propertiesFileNamePrefix":"web-framework-integration-i18n", "productName":"Net Numen ICT", - "productImage":"image/integration/zte_logo_white.png", + "productImage":"image/integration/openo_logo_white.png", "modules":[ { "cover":"com_zte_ums_ict_framework_main_page_dashboard", "background":"skyBlue-mainpage", "toolsImage":"toolsImageBrokenLine", - "url":"", + "url":"", "linkId":"ngict-dashboard-index", "contentTip":"" }, @@ -46,7 +46,7 @@ "background":"orange-mainpage", "toolsImage":"toolsImageGear", "url":"", - "linkId":"ngict-fm-summary", + "linkId":"ngict-fm-summary", "contentTip":"" }, @@ -55,7 +55,7 @@ "background":"pinkishRed-mainpage", "toolsImage":"toolsImagePresent", "url":"", - "linkId":"ngict-pm-meatask", + "linkId":"ngict-pm-meatask", "contentTip":"" }, @@ -71,7 +71,7 @@ "background":"grassGreen-mainpage", "toolsImage":"toolsImageFile", "url":"", - "linkId":"ngict-sm", + "linkId":"ngict-sm", "contentTip":"" }, @@ -94,7 +94,7 @@ "background":"orange-mainpage", "toolsImage":"toolsImageGear", "url":"", - "linkId":"ngict-log", + "linkId":"ngict-log", "contentTip":"" }, @@ -103,7 +103,7 @@ "background":"skyBlue-mainpage", "toolsImage":"toolsImageBriefcase", "url":"", - "linkId":"ngict-system", + "linkId":"ngict-system", "contentTip":"" }, diff --git a/openo-portal/portal-common/src/main/webapp/common/login.html b/openo-portal/portal-common/src/main/webapp/common/login.html index 1509dffb..c0c8eb43 100644 --- a/openo-portal/portal-common/src/main/webapp/common/login.html +++ b/openo-portal/portal-common/src/main/webapp/common/login.html @@ -15,180 +15,107 @@ --> - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
- -
- +
- \ No newline at end of file diff --git a/openo-portal/portal-common/src/main/webapp/common/main_Fmegabar.html b/openo-portal/portal-common/src/main/webapp/common/main_Fmegabar.html index 2c11d222..4175819a 100644 --- a/openo-portal/portal-common/src/main/webapp/common/main_Fmegabar.html +++ b/openo-portal/portal-common/src/main/webapp/common/main_Fmegabar.html @@ -52,5 +52,5 @@ - \ No newline at end of file diff --git a/openo-portal/portal-common/src/main/webapp/common/main_siderbar.html b/openo-portal/portal-common/src/main/webapp/common/main_siderbar.html index b1fd2efc..2e16a8ef 100644 --- a/openo-portal/portal-common/src/main/webapp/common/main_siderbar.html +++ b/openo-portal/portal-common/src/main/webapp/common/main_siderbar.html @@ -15,215 +15,146 @@ -->
  • - - - - - - - - + + + +
  • - - - - - - - - + + + +
  • - - - - - - - - - - - + + + + + +
  • - - - - - - - - + + + +
  • - - - \ No newline at end of file + + + diff --git a/openo-portal/portal-common/src/main/webapp/common/thirdparty/data-tables/DataTableICT.js b/openo-portal/portal-common/src/main/webapp/common/thirdparty/data-tables/DataTableICT.js index 03084e2e..ef85de37 100644 --- a/openo-portal/portal-common/src/main/webapp/common/thirdparty/data-tables/DataTableICT.js +++ b/openo-portal/portal-common/src/main/webapp/common/thirdparty/data-tables/DataTableICT.js @@ -488,7 +488,7 @@ var DatatableICT = function () { "contentType": 'application/json; charset=utf-8', "success": function(res, textStatus, jqXHR) { if (res.sMessage) { - ZteFrameWork.alert({type: (res.sStatus == 'OK' ? 'success' : 'danger'), icon: (res.sStatus == 'OK' ? 'check' : 'warning'), message: res.sMessage, container: tableWrapper, place: 'prepend'}); + openoFrameWork.alert({type: (res.sStatus == 'OK' ? 'success' : 'danger'), icon: (res.sStatus == 'OK' ? 'check' : 'warning'), message: res.sMessage, container: tableWrapper, place: 'prepend'}); } if ($('.group-checkable', tableContainer).size() === 1) { $('.group-checkable', tableContainer).attr("checked", false); @@ -512,7 +512,7 @@ var DatatableICT = function () { if (tableOptions.onError) { tableOptions.onError.call(the); } - ZteFrameWork.alert({type: 'danger', icon: 'warning', message: tableOptions.dataTable.oLanguage.sAjaxRequestGeneralError, container: tableWrapper, place: 'prepend'}); + openoFrameWork.alert({type: 'danger', icon: 'warning', message: tableOptions.dataTable.oLanguage.sAjaxRequestGeneralError, container: tableWrapper, place: 'prepend'}); $('.dataTables_processing', tableWrapper).remove(); } } ); @@ -526,7 +526,7 @@ var DatatableICT = function () { "data": aoData, "success": function(res, textStatus, jqXHR) { if (res.sMessage) { - ZteFrameWork.alert({type: (res.sStatus == 'OK' ? 'success' : 'danger'), icon: (res.sStatus == 'OK' ? 'check' : 'warning'), message: res.sMessage, container: tableWrapper, place: 'prepend'}); + openoFrameWork.alert({type: (res.sStatus == 'OK' ? 'success' : 'danger'), icon: (res.sStatus == 'OK' ? 'check' : 'warning'), message: res.sMessage, container: tableWrapper, place: 'prepend'}); } if ($('.group-checkable', tableContainer).size() === 1) { $('.group-checkable', tableContainer).attr("checked", false); @@ -561,7 +561,7 @@ var DatatableICT = function () { if (tableOptions.onError) { tableOptions.onError.call(the); } - ZteFrameWork.alert({type: 'danger', icon: 'warning', message: tableOptions.dataTable.oLanguage.sAjaxRequestGeneralError, container: tableWrapper, place: 'prepend'}); + openoFrameWork.alert({type: 'danger', icon: 'warning', message: tableOptions.dataTable.oLanguage.sAjaxRequestGeneralError, container: tableWrapper, place: 'prepend'}); $('.dataTables_processing', tableWrapper).remove(); } } ); @@ -584,7 +584,7 @@ var DatatableICT = function () { tableInitialized = true; // set table initialized table.show(); // display table } - ZteFrameWork.initUniform($('input[type="checkbox"]', tableContainer)); // reinitialize uniform checkboxes on each table reload + openoFrameWork.initUniform($('input[type="checkbox"]', tableContainer)); // reinitialize uniform checkboxes on each table reload countSelectedRecords(); // reset selected records indicator //所有td不换行 $('table#datatable_ajax' + contextData.curentDatableId).find('td').css('white-space', 'nowrap'); diff --git a/openo-portal/portal-common/src/main/webapp/common/thirdparty/data-tables/DataTableSmartClient.js b/openo-portal/portal-common/src/main/webapp/common/thirdparty/data-tables/DataTableSmartClient.js index 5f28350f..4cb8cb58 100644 --- a/openo-portal/portal-common/src/main/webapp/common/thirdparty/data-tables/DataTableSmartClient.js +++ b/openo-portal/portal-common/src/main/webapp/common/thirdparty/data-tables/DataTableSmartClient.js @@ -438,7 +438,7 @@ var DatatableICT = function () { "data": aoData, "success": function(res, textStatus, jqXHR) { if (res.sMessage) { - ZteFrameWork.alert({type: (res.sStatus == 'OK' ? 'success' : 'danger'), icon: (res.sStatus == 'OK' ? 'check' : 'warning'), message: res.sMessage, container: tableWrapper, place: 'prepend'}); + openoFrameWork.alert({type: (res.sStatus == 'OK' ? 'success' : 'danger'), icon: (res.sStatus == 'OK' ? 'check' : 'warning'), message: res.sMessage, container: tableWrapper, place: 'prepend'}); } if ($('.group-checkable', tableContainer).size() === 1) { $('.group-checkable', tableContainer).attr("checked", false); @@ -466,7 +466,7 @@ var DatatableICT = function () { if (tableOptions.onError) { tableOptions.onError.call(the); } - ZteFrameWork.alert({type: 'danger', icon: 'warning', message: tableOptions.dataTable.oLanguage.sAjaxRequestGeneralError, container: tableWrapper, place: 'prepend'}); + openoFrameWork.alert({type: 'danger', icon: 'warning', message: tableOptions.dataTable.oLanguage.sAjaxRequestGeneralError, container: tableWrapper, place: 'prepend'}); $('.dataTables_processing', tableWrapper).remove(); } } ); @@ -488,7 +488,7 @@ var DatatableICT = function () { tableInitialized = true; // set table initialized table.show(); // display table } - ZteFrameWork.initUniform($('input[type="checkbox"]', tableContainer)); // reinitialize uniform checkboxes on each table reload + openoFrameWork.initUniform($('input[type="checkbox"]', tableContainer)); // reinitialize uniform checkboxes on each table reload countSelectedRecords(); // reset selected records indicator //所有td不换行 $('table#datatable_ajax').find('td').css('white-space', 'nowrap'); diff --git a/openo-portal/portal-common/src/main/webapp/common/thirdparty/data-tables/DataTableSmartClientApp.js b/openo-portal/portal-common/src/main/webapp/common/thirdparty/data-tables/DataTableSmartClientApp.js index 3a74fa95..8584aae3 100644 --- a/openo-portal/portal-common/src/main/webapp/common/thirdparty/data-tables/DataTableSmartClientApp.js +++ b/openo-portal/portal-common/src/main/webapp/common/thirdparty/data-tables/DataTableSmartClientApp.js @@ -495,7 +495,7 @@ var DatatableICT = function () { "data": aoData, "success": function(res, textStatus, jqXHR) { if (res.sMessage) { - ZteFrameWork.alert({type: (res.sStatus == 'OK' ? 'success' : 'danger'), icon: (res.sStatus == 'OK' ? 'check' : 'warning'), message: res.sMessage, container: tableWrapper, place: 'prepend'}); + openoFrameWork.alert({type: (res.sStatus == 'OK' ? 'success' : 'danger'), icon: (res.sStatus == 'OK' ? 'check' : 'warning'), message: res.sMessage, container: tableWrapper, place: 'prepend'}); } if ($('.group-checkable', tableContainer).size() === 1) { $('.group-checkable', tableContainer).attr("checked", false); @@ -532,7 +532,7 @@ var DatatableICT = function () { if (tableOptions.onError) { tableOptions.onError.call(the); } - ZteFrameWork.alert({type: 'danger', icon: 'warning', message: tableOptions.dataTable.oLanguage.sAjaxRequestGeneralError, container: tableWrapper, place: 'prepend'}); + openoFrameWork.alert({type: 'danger', icon: 'warning', message: tableOptions.dataTable.oLanguage.sAjaxRequestGeneralError, container: tableWrapper, place: 'prepend'}); $('.dataTables_processing', tableWrapper).remove(); } } ); @@ -554,7 +554,7 @@ var DatatableICT = function () { tableInitialized = true; // set table initialized table.show(); // display table } - ZteFrameWork.initUniform($('input[type="checkbox"]', tableContainer)); // reinitialize uniform checkboxes on each table reload + openoFrameWork.initUniform($('input[type="checkbox"]', tableContainer)); // reinitialize uniform checkboxes on each table reload countSelectedRecords(); // reset selected records indicator //所有td不换行 $('table#datatable_ajax').find('td').css('white-space', 'nowrap'); diff --git a/openo-portal/portal-common/src/main/webapp/common/thirdparty/data-tables/dataTable.html b/openo-portal/portal-common/src/main/webapp/common/thirdparty/data-tables/dataTable.html index 647866c9..afae5e3c 100644 --- a/openo-portal/portal-common/src/main/webapp/common/thirdparty/data-tables/dataTable.html +++ b/openo-portal/portal-common/src/main/webapp/common/thirdparty/data-tables/dataTable.html @@ -141,7 +141,7 @@ - + diff --git a/openo-portal/portal-common/src/main/webapp/common/thirdparty/data-tables/jquery.dataTables-1.9.4.js b/openo-portal/portal-common/src/main/webapp/common/thirdparty/data-tables/jquery.dataTables-1.9.4.js deleted file mode 100644 index 367680da..00000000 --- a/openo-portal/portal-common/src/main/webapp/common/thirdparty/data-tables/jquery.dataTables-1.9.4.js +++ /dev/null @@ -1,12101 +0,0 @@ -/** - * @summary DataTables - * @description Paginate, search and sort HTML tables - * @version 1.9.4 - * @file jquery.dataTables.js - * @author Allan Jardine (www.sprymedia.co.uk) - * @contact www.sprymedia.co.uk/contact - * - * @copyright Copyright 2008-2012 Allan Jardine, all rights reserved. - * - * This source file is free software, under either the GPL v2 license or a - * BSD style license, available at: - * http://datatables.net/license_gpl2 - * http://datatables.net/license_bsd - * - * This source file is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details. - * - * For details please refer to: http://www.datatables.net - */ - -/*jslint evil: true, undef: true, browser: true */ -/*globals $, jQuery,define,_fnExternApiFunc,_fnInitialise,_fnInitComplete,_fnLanguageCompat,_fnAddColumn,_fnColumnOptions,_fnAddData,_fnCreateTr,_fnGatherData,_fnBuildHead,_fnDrawHead,_fnDraw,_fnReDraw,_fnAjaxUpdate,_fnAjaxParameters,_fnAjaxUpdateDraw,_fnServerParams,_fnAddOptionsHtml,_fnFeatureHtmlTable,_fnScrollDraw,_fnAdjustColumnSizing,_fnFeatureHtmlFilter,_fnFilterComplete,_fnFilterCustom,_fnFilterColumn,_fnFilter,_fnBuildSearchArray,_fnBuildSearchRow,_fnFilterCreateSearch,_fnDataToSearch,_fnSort,_fnSortAttachListener,_fnSortingClasses,_fnFeatureHtmlPaginate,_fnPageChange,_fnFeatureHtmlInfo,_fnUpdateInfo,_fnFeatureHtmlLength,_fnFeatureHtmlProcessing,_fnProcessingDisplay,_fnVisibleToColumnIndex,_fnColumnIndexToVisible,_fnNodeToDataIndex,_fnVisbleColumns,_fnCalculateEnd,_fnConvertToWidth,_fnCalculateColumnWidths,_fnScrollingWidthAdjust,_fnGetWidestNode,_fnGetMaxLenString,_fnStringToCss,_fnDetectType,_fnSettingsFromNode,_fnGetDataMaster,_fnGetTrNodes,_fnGetTdNodes,_fnEscapeRegex,_fnDeleteIndex,_fnReOrderIndex,_fnColumnOrdering,_fnLog,_fnClearTable,_fnSaveState,_fnLoadState,_fnCreateCookie,_fnReadCookie,_fnDetectHeader,_fnGetUniqueThs,_fnScrollBarWidth,_fnApplyToChildren,_fnMap,_fnGetRowData,_fnGetCellData,_fnSetCellData,_fnGetObjectDataFn,_fnSetObjectDataFn,_fnApplyColumnDefs,_fnBindAction,_fnCallbackReg,_fnCallbackFire,_fnJsonString,_fnRender,_fnNodeToColumnIndex,_fnInfoMacros,_fnBrowserDetect,_fnGetColumns*/ - -(/** @lends */function( window, document, undefined ) { - -(function( factory ) { - "use strict"; - - // Define as an AMD module if possible - if ( typeof define === 'function' && define.amd ) - { - define( ['jquery'], factory ); - } - /* Define using browser globals otherwise - * Prevent multiple instantiations if the script is loaded twice - */ - else if ( jQuery && !jQuery.fn.dataTable ) - { - factory( jQuery ); - } -} -(/** @lends */function( $ ) { - "use strict"; - /** - * DataTables is a plug-in for the jQuery Javascript library. It is a - * highly flexible tool, based upon the foundations of progressive - * enhancement, which will add advanced interaction controls to any - * HTML table. For a full list of features please refer to - * DataTables.net. - * - * Note that the DataTable object is not a global variable but is - * aliased to jQuery.fn.DataTable and jQuery.fn.dataTable through which - * it may be accessed. - * - * @class - * @param {object} [oInit={}] Configuration object for DataTables. Options - * are defined by {@link DataTable.defaults} - * @requires jQuery 1.3+ - * - * @example - * // Basic initialisation - * $(document).ready( function { - * $('#example').dataTable(); - * } ); - * - * @example - * // Initialisation with configuration options - in this case, disable - * // pagination and sorting. - * $(document).ready( function { - * $('#example').dataTable( { - * "bPaginate": false, - * "bSort": false - * } ); - * } ); - */ - var DataTable = function( oInit ) - { - - - /** - * Add a column to the list used for the table with default values - * @param {object} oSettings dataTables settings object - * @param {node} nTh The th element for this column - * @memberof DataTable#oApi - */ - function _fnAddColumn( oSettings, nTh ) - { - var oDefaults = DataTable.defaults.columns; - var iCol = oSettings.aoColumns.length; - var oCol = $.extend( {}, DataTable.models.oColumn, oDefaults, { - "sSortingClass": oSettings.oClasses.sSortable, - "sSortingClassJUI": oSettings.oClasses.sSortJUI, - "nTh": nTh ? nTh : document.createElement('th'), - "sTitle": oDefaults.sTitle ? oDefaults.sTitle : nTh ? nTh.innerHTML : '', - "aDataSort": oDefaults.aDataSort ? oDefaults.aDataSort : [iCol], - "mData": oDefaults.mData ? oDefaults.oDefaults : iCol - } ); - oSettings.aoColumns.push( oCol ); - - /* Add a column specific filter */ - if ( oSettings.aoPreSearchCols[ iCol ] === undefined || oSettings.aoPreSearchCols[ iCol ] === null ) - { - oSettings.aoPreSearchCols[ iCol ] = $.extend( {}, DataTable.models.oSearch ); - } - else - { - var oPre = oSettings.aoPreSearchCols[ iCol ]; - - /* Don't require that the user must specify bRegex, bSmart or bCaseInsensitive */ - if ( oPre.bRegex === undefined ) - { - oPre.bRegex = true; - } - - if ( oPre.bSmart === undefined ) - { - oPre.bSmart = true; - } - - if ( oPre.bCaseInsensitive === undefined ) - { - oPre.bCaseInsensitive = true; - } - } - - /* Use the column options function to initialise classes etc */ - _fnColumnOptions( oSettings, iCol, null ); - } - - - /** - * Apply options for a column - * @param {object} oSettings dataTables settings object - * @param {int} iCol column index to consider - * @param {object} oOptions object with sType, bVisible and bSearchable etc - * @memberof DataTable#oApi - */ - function _fnColumnOptions( oSettings, iCol, oOptions ) - { - var oCol = oSettings.aoColumns[ iCol ]; - - /* User specified column options */ - if ( oOptions !== undefined && oOptions !== null ) - { - /* Backwards compatibility for mDataProp */ - if ( oOptions.mDataProp && !oOptions.mData ) - { - oOptions.mData = oOptions.mDataProp; - } - - if ( oOptions.sType !== undefined ) - { - oCol.sType = oOptions.sType; - oCol._bAutoType = false; - } - - $.extend( oCol, oOptions ); - _fnMap( oCol, oOptions, "sWidth", "sWidthOrig" ); - - /* iDataSort to be applied (backwards compatibility), but aDataSort will take - * priority if defined - */ - if ( oOptions.iDataSort !== undefined ) - { - oCol.aDataSort = [ oOptions.iDataSort ]; - } - _fnMap( oCol, oOptions, "aDataSort" ); - } - - /* Cache the data get and set functions for speed */ - var mRender = oCol.mRender ? _fnGetObjectDataFn( oCol.mRender ) : null; - var mData = _fnGetObjectDataFn( oCol.mData ); - - oCol.fnGetData = function (oData, sSpecific) { - var innerData = mData( oData, sSpecific ); - - if ( oCol.mRender && (sSpecific && sSpecific !== '') ) - { - return mRender( innerData, sSpecific, oData ); - } - return innerData; - }; - oCol.fnSetData = _fnSetObjectDataFn( oCol.mData ); - - /* Feature sorting overrides column specific when off */ - if ( !oSettings.oFeatures.bSort ) - { - oCol.bSortable = false; - } - - /* Check that the class assignment is correct for sorting */ - if ( !oCol.bSortable || - ($.inArray('asc', oCol.asSorting) == -1 && $.inArray('desc', oCol.asSorting) == -1) ) - { - oCol.sSortingClass = oSettings.oClasses.sSortableNone; - oCol.sSortingClassJUI = ""; - } - else if ( $.inArray('asc', oCol.asSorting) == -1 && $.inArray('desc', oCol.asSorting) == -1 ) - { - oCol.sSortingClass = oSettings.oClasses.sSortable; - oCol.sSortingClassJUI = oSettings.oClasses.sSortJUI; - } - else if ( $.inArray('asc', oCol.asSorting) != -1 && $.inArray('desc', oCol.asSorting) == -1 ) - { - oCol.sSortingClass = oSettings.oClasses.sSortableAsc; - oCol.sSortingClassJUI = oSettings.oClasses.sSortJUIAscAllowed; - } - else if ( $.inArray('asc', oCol.asSorting) == -1 && $.inArray('desc', oCol.asSorting) != -1 ) - { - oCol.sSortingClass = oSettings.oClasses.sSortableDesc; - oCol.sSortingClassJUI = oSettings.oClasses.sSortJUIDescAllowed; - } - } - - - /** - * Adjust the table column widths for new data. Note: you would probably want to - * do a redraw after calling this function! - * @param {object} oSettings dataTables settings object - * @memberof DataTable#oApi - */ - function _fnAdjustColumnSizing ( oSettings ) - { - /* Not interested in doing column width calculation if auto-width is disabled */ - if ( oSettings.oFeatures.bAutoWidth === false ) - { - return false; - } - - _fnCalculateColumnWidths( oSettings ); - for ( var i=0 , iLen=oSettings.aoColumns.length ; i