فهرست منبع

#IQRV #comment [Res] 更新js内容,添加菜单相关操作

gifur 4 سال پیش
والد
کامیت
f778a2b846

+ 0 - 26
addin/res/ManagerDesktop/Include/jQuery/js/emui-jquery.js

@@ -9855,14 +9855,12 @@ var getMessage = function (msgs, key) {
   };
   
   function getScript(filename, callback) {
-	console.log('load lang.....');
 	$.ajax({
 	  async: false,
 	  type: 'GET',
 	  url: filename + '?r=' + Math.random() ,
 	  dataType : 'script',
 	  success: function (res) {
-		showNationalLang();
 		if (callback) {
 		  callback();
 		}
@@ -9870,28 +9868,4 @@ var getMessage = function (msgs, key) {
 	});
   }
   
-  /*
-   * 页面加载完成后,再调用这个函数进行国际化消息处理
-   */
-  function getLang(lang, callback) {
-	var url = '../language/lang_' + lang + '.js';
-	getScript(url, callback);
-  }
-  
-  /*
-   * 同时当前页面需要的全部资源文件,组装路径,进行一次性前部加载,多态
-   arguments[0] 是语种,后面是多语言的路劲
-   */
-  /*
-  function renderMultiScript() {
-	var allfiles = '/atpscriptall_';
-	if (this.arguments.length < 2) {
-	  return;
-	}
-	for (var i = 1; i < arguments.length; i++) {
-	  allfiles += '/js/' + arguments[i];
-	}
-	getScript(allfiles);
-  }
-  */
   

+ 0 - 40
addin/res/ManagerDesktop/js/localmnt.js

@@ -1,40 +0,0 @@
-(function () {
-
-    //DeviceControlService.init();
-    //HealthmanagerService.init();
-
-}());
-
-function setWidth(isfull) {
-    if (isfull) {
-        $('#leftmenuarea').hide();
-        $('#rightpagearea').css('width', '100%');
-    } else {
-        $('#leftmenuarea').show();
-        $('#rightpagearea').css('width', '690px');
-    }
-}
-
-function modelCallback(fn) {
-    var fun = window[fn];
-    if (typeof fun === 'function') {
-        fun.call(this);
-        resetMenuheight();
-    }
-}
-
-function resetMenuheight() {
-    $('#leftmenuarea').css('height', 'auto');
-    setTimeout(function () {
-        var bodyHeight = $(document).height();
-        var colHeight = bodyHeight - 233;
-        $('#leftmenuarea').css('height', colHeight + 'px');
-    }, 50);
-}
-
-if (window.addEventListener) {
-    window.addEventListener('resize', resetMenuheight, false);
-} else {
-    window.attachEvent('resize', resetMenuheight);
-}
-

+ 637 - 0
addin/res/ManagerDesktop/js/menu.js

@@ -0,0 +1,637 @@
+
+var gMenu = [];
+var gOldHomeText = '';
+var gMenuDisplayName = {
+    'home':'首页',
+    'terminalmanagement':'终端管理',
+    'networkmanagement':'网络连接',
+    'hardwareconfig':'硬件管理',
+    'mediacontrol':'媒体控制',
+    'advanceset':'高级设置',
+    'initializer':'终端初始化',
+    'browser':'浏览器设置',
+    'entities':'实体管理',
+    'crontab':'作业调度',
+    'bootmanager':'启动选项',
+    'branchserver':'分行服务',
+    'centersettings':'集中配置',
+    'localnetwork':'本地网络',
+    'dns':'DNS',
+    'adapters':'适配器',
+    'cardissuer':'发卡器',
+    'contactless':'非接读卡器',
+    'idcertificate':'身份证阅读器',
+    'pinpad':'密码键盘',
+    'fingerprint':'指纹仪',
+    'hspscanner':'高拍仪',
+    'gpio':'GPIO',
+    'watchdog':'看门狗',
+    'ups':'UPS',
+    'logswitch': '日志开关',
+    'microphone':'麦克风',
+    'loudspeaker':'扬声器',
+    'camera':'摄像头',
+    'volumn':'音量调节',
+    'banquet':'坐席',
+    'basicinfo':'基本信息',
+    'version':'版本',
+    'vermanagement':'版本管理',
+    'upgrade':'升级',
+    'module':'模块管理',
+    'clearruncfg':'运行时管理',
+    'system':'系统',
+    'reboot':'应用重启',
+    'poweroff':'关机',
+    'diagnosis':'诊断'
+
+};
+
+function getDisplayName(name) {
+    if(typeof gMenuDisplayName[name] === 'undefined')
+        return name;
+    return gMenuDisplayName[name];
+}
+
+function getname(menu) {
+    for (var item1 in menu) {
+        var item = {};
+        item.menuid = item1;
+        item.pagename = item1;
+        var item1Value = menu[item1];
+        if (typeof item1Value === 'string') {
+            item.displayName = item1Value;
+            gMenu.push(item);
+        } else {
+            var submenus = [];
+            for (var subitem in item1Value) {
+                var temp2 = {};
+                    temp2.menuid = subitem;
+                    temp2.pagename = subitem;
+                    var temp2Value = item1Value[subitem];
+                    if (typeof temp2Value === 'string') {
+                        temp2.displayName = temp2Value;
+                        submenus.push(temp2);
+                    } else {
+                        var sub3menus = [];
+                        for (var sub2item in temp2Value) {
+                                var temp3 = {};
+                                temp3.menuid = sub2item;
+                                temp3.pagename = sub2item;
+                                temp3.displayName = temp2Value[sub2item];
+                                sub3menus.push(temp3);
+                        }
+                        if (sub3menus.length > 0) {
+                            if (sub3menus.length > 1) {
+                                temp2.submenus = sub3menus;
+                            } else {
+                                temp2.menuid = sub3menus[0].menuid;
+                                temp2.pagename = sub3menus[0].pagename;
+                                temp2.displayName = sub3menus[0].displayName;
+                            }
+                            submenus.push(temp2);
+                        }
+                    }
+            }
+            if (submenus.length > 0) {
+                if (submenus.length === 1) {
+                    if (submenus[0].submenus) {
+                        item = submenus[0]
+                    } else {
+                        item.menuid = submenus[0].menuid;
+                        item.pagename = submenus[0].pagename;
+                        item.displayName = submenus[0].displayName;
+
+                    }
+                } else {
+                    item.submenus = submenus;
+                }
+                gMenu.push(item);
+            }
+        }
+    }
+}
+
+var OldMenu = {
+    FirstMenu: 'home',
+    SecondMenu: '',
+    ThirdMenu: ''
+};
+var CurrentMenu = {
+    FirstMenu: 'home',
+    SecondMenu: '',
+    ThirdMenu: ''
+};
+var oldHref = '';
+var newHref = window.location.href;
+window.setInterval(listenHashChange, 200);
+function listenHashChange() {
+    newHref = window.location.href;
+    if (gMenu.length === 0) {
+        return;
+    }
+    if (oldHref === newHref) {
+        return;
+    }
+    $('.submit_background,.out_win_content,.submit_white_content').hide();
+    $('#submit_fade').hide();
+    var oldHash = oldHref.split('#')[1];
+    if (typeof window[oldHash + 'Destruction'] === 'function') {
+        window[oldHash + 'Destruction']();
+    }
+    oldHref = newHref;
+    getCurrentMenu();
+    showNewPage(true);
+}
+function rememberOldMenu() {
+    OldMenu.FirstMenu = CurrentMenu.FirstMenu;
+    OldMenu.SecondMenu = CurrentMenu.SecondMenu;
+    OldMenu.ThirdMenu = CurrentMenu.ThirdMenu;
+}
+function initCurrentMenu(first, second, third) {
+    rememberOldMenu();
+    CurrentMenu.FirstMenu = first;
+    CurrentMenu.SecondMenu = second;
+    CurrentMenu.ThirdMenu = third;
+}
+function getCurrentMenu() {
+    var hash = window.location.hash;
+    debugInfo(hash);
+    if (hash.length <= 0) {
+        window.location.href = GLOBAL.INDEX_NO_SIMREDIRECT_PAGE_URL;
+        return;
+    }
+    var pagename = hash.substr(1);
+    var find = false;
+    debugInfo('getCurrentMenu pagename', pagename);
+    for (var i = 0; i < gMenu.length; i++) {
+        var topmenuitem = gMenu[i];
+        if (topmenuitem.pagename === pagename) {
+            if (typeof topmenuitem.submenus === 'undefined') {
+                initCurrentMenu(pagename, '', '');
+                find = true;
+                break;
+            } else {
+                pagename = topmenuitem.submenus[0].pagename;
+                initCurrentMenu(topmenuitem.pagename, pagename, '');
+                find = true;
+            }
+        } else {
+            if (typeof topmenuitem.submenus !== 'undefined') {
+                var Submenus = topmenuitem.submenus;
+                debugInfo('Submenus', Submenus);
+                for (var j = 0; j < Submenus.length; j++) {
+                    debugInfo(j, Submenus[j].pagename);
+                    var submenuj = Submenus[j];
+                    if (pagename === submenuj.pagename) {
+                        if (typeof submenuj.submenus === 'undefined') {
+                            initCurrentMenu(topmenuitem.pagename, pagename, '');
+                            find = true;
+                            break;
+                        } else {
+                            debugInfo('submenuj', submenuj);
+                            if (typeof submenuj.submenus !== 'undefined') {
+                                pagename = submenuj.submenus[0].pagename;
+                                initCurrentMenu(topmenuitem.pagename, submenuj.pagename, pagename);
+                            } else {
+                                pagename = submenuj.pagename;
+                                initCurrentMenu(topmenuitem.pagename, pagename, '');
+                            }
+                            find = true;
+                            break;
+                        }
+                    } else if (typeof submenuj.submenus !== 'undefined') {
+                        var thirdmenu = submenuj.submenus;
+                        var thirdmenulength = thirdmenu.length;
+                        for (var k = 0; k < thirdmenulength; k++) {
+                            if (pagename === thirdmenu[k].pagename) {
+                                initCurrentMenu(topmenuitem.pagename, submenuj.pagename, pagename);
+                                find = true;
+                                break;
+                            }
+                        }
+                    }
+                }
+                if (find) {
+                    break;
+                }
+            }
+            if (find) {
+                break;
+            }
+        }
+    }
+    if (!find) {
+        window.location.href = GLOBAL.HOME_PAGE_URL;
+    }
+}
+function disSelectMenuItem(menuitem) {
+    if (menuitem !== '') {
+        $('#menu_' + menuitem).addClass('color_Darkgray').removeClass('selectmenu');
+        $('#menu_top_' + menuitem).addClass('topmenu_normal').removeClass('topmenu_selected');
+        $('#ic_' + menuitem + '_icon').addClass('ic_' + menuitem).removeClass('ic_' + menuitem + '_selected');
+    }
+}
+function selectMenu(menuitem) {
+    if (menuitem !== '') {
+        $('#menu_' + menuitem).addClass('selectmenu').removeClass('color_Darkgray');
+        $('#menu_top_' + menuitem).addClass('topmenu_selected').removeClass('topmenu_normal');
+        $('#ic_' + menuitem + '_icon').removeClass('ic_' + menuitem).addClass('ic_' + menuitem + '_selected');
+    }
+}
+function hideAllPage() {
+    for (var i = 0; i < gMenu.length; i++) {
+        var menuitems = gMenu[i];
+        $('#' + menuitems.pagename + '_page').hide();
+        disSelectMenuItem(menuitems.pagename);
+        if (typeof menuitems.submenus !== 'undefined') {
+            var subitems = menuitems.submenus;
+            $('#' + subitems.pagename + '_childrens_menu').hide();
+            for (var j = 0; j < subitems.length; j++) {
+                if (typeof subitems[j].submenus !== 'undefined') {
+                    $('#' + subitems[j].pagename + '_childrens_menu').hide();
+                    $('#menu_' + subitems[j].pagename + '_arrow').removeClass('menu_arrow_open').addClass('menu_arrow_close');
+                    var thirdmenus = subitems[j].submenus;
+                    for (var k = 0; k < thirdmenus.length; k++) {
+                        $('#' + thirdmenus[k].pagename + '_page').hide();
+                        disSelectMenuItem(thirdmenus[k].pagename);
+                    }
+                }
+                $('#' + subitems[j].pagename + '_page').hide();
+                disSelectMenuItem(subitems[j].pagename);
+            }
+        }
+        if (OldMenu.FirstMenu !== CurrentMenu.FirstMenu) {
+            $('#' + menuitems.pagename + '_childrens_menu').hide();
+        }
+    }
+}
+function setWidth(isfull) {
+    if (isfull) {
+        $('#leftmenuarea').hide();
+        $('#rightpagearea').css('width', '100%');
+    } else {
+        $('#leftmenuarea').show();
+        $('#rightpagearea').css('width', '690px');
+    }
+}
+function beforeRenderPage(model) {
+    return;
+}
+function afterRenderPage(model) {
+    return;
+}
+function modelCallback(fn) {
+    var fun = window[fn];
+    if (typeof fun === 'function') {
+        fun.call(this);
+        resetMenuheight();
+    }
+}
+function resetMenuheight() {
+    $('#leftmenuarea').css('height', 'auto');
+    setTimeout(function () {
+        var bodyHeight = $(document).height();
+        var colHeight = bodyHeight - 233;
+        $('#leftmenuarea').css('height', colHeight + 'px');
+    }, 50);
+}
+if (window.addEventListener) {
+    window.addEventListener('resize', resetMenuheight, false);
+} else {
+    window.attachEvent('resize', resetMenuheight);
+}
+function showNewPage(type) {
+    $(document).css('height', 'auto');
+    var href = window.location.href;
+    if (href.indexOf('/ManagerDesktop/page.html') < 0) {
+        window.location.href = '/';
+        return;
+    }
+    if (typeof type === 'undefined') {
+        return;
+    }
+    hideAllPage();
+    var Firmenu = CurrentMenu.FirstMenu;
+    var Senmenu = CurrentMenu.SecondMenu;
+    var Thimenu = CurrentMenu.ThirdMenu;
+    var callback;
+    var page;
+    if (Senmenu === '' && Thimenu === '') {
+        if (Firmenu === 'devicemanagement' || Firmenu === 'home' || Firmenu === 'ussd') {
+            $('#rightpagearea').attr('class', 'rightpagearea margin-left-0');
+        } else {
+            $('#rightpagearea').attr('class', 'rightpagearea margin-left-165');
+        }
+        setWidth(true);
+        page = $('#' + Firmenu + '_page');
+        if (page.length > 0) {
+            callback = Firmenu + 'RenderPage';
+            modelCallback(callback);
+            page.show();
+            RVC.Scroll.adapterleftLabelStyle();
+        } else {
+            utilLoadPage('./js/page/' + Firmenu + '.js', function () {
+                callback = Firmenu + 'GenPage';
+                modelCallback(callback);
+            });
+        }
+    } else if (Senmenu !== '' && Thimenu === '') {
+        setWidth(false);
+        page = $('#' + Senmenu + '_page');
+        var childmenu = $('#' + Firmenu + '_childrens_menu');
+        if (childmenu.length <= 0) {
+            generateSecondMenu(Firmenu);
+        }
+        childmenu.show();
+        $('#rightpagearea').attr('class', 'rightpagearea margin-left-50');
+        if (page.length > 0) {
+            callback = Senmenu + 'RenderPage';
+            modelCallback(callback);
+            page.show();
+            RVC.Scroll.adapterleftLabelStyle();
+        } else {
+            utilLoadPage('./js/page/' + Senmenu + '.js', function () {
+                callback = Senmenu + 'GenPage';
+                modelCallback(callback);
+            });
+        }
+    } else if (Senmenu !== '' && Thimenu !== '') {
+        setWidth(false);
+        page = $('#' + Thimenu + '_page');
+        if ($('#' + Firmenu + '_childrens_menu').length <= 0) {
+            generateSecondMenu(Firmenu);
+        }
+        $('#' + Firmenu + '_childrens_menu').show();
+        $('#' + Senmenu + '_childrens_menu').show();
+        var menuArrowId = 'menu_' + Senmenu + '_arrow';
+        var arrowObj = $('#' + menuArrowId);
+        arrowObj.addClass('menu_arrow_open').removeClass('menu_arrow_close');
+        $('#rightpagearea').attr('class', 'rightpagearea margin-left-50');
+        if (page.length > 0) {
+            callback = Thimenu + 'RenderPage';
+            modelCallback(callback);
+            page.show();
+            RVC.Scroll.adapterleftLabelStyle();
+        } else {
+            utilLoadPage('./js/page/' + Thimenu + '.js', function () {
+                callback = Thimenu + 'GenPage';
+                modelCallback(callback);
+            });
+        }
+    } else {
+        window.location.href = 'index.html';
+    }
+    selectMenu(Firmenu);
+    selectMenu(Senmenu);
+    selectMenu(Thimenu);
+}
+function utilLoadPage(scriptName, callback) {
+    $.getScript(scriptName + '?r=' + Math.random()).done(function () {
+        if (callback) {
+            callback();
+        }
+        $('.btn_new,.btn_edit').click(function () {
+            setTimeout(function () { RVC.Scroll.adapterleftLabelStyle('out_win_content'); }, 100)
+        });
+        bindEyeEvent();
+        preLoadEyeImg();
+    }).fail(function (xhr, setting, ex) {
+        alert(setting);
+        debugInfo('error...', xhr, setting, ex);
+    });
+}
+function selectPage(pagename) {
+    var hashname = pagename;
+    var find = false;
+    for (var i = 0; i < gMenu.length; i++) {
+        var topmenuitem = gMenu[i];
+        if (topmenuitem.pagename === pagename) {
+            if (typeof topmenuitem.submenus === 'undefined') {
+                find = true;
+                break;
+            } else {
+                hashname = topmenuitem.submenus[0].pagename;
+                find = true;
+            }
+        } else {
+            if (typeof topmenuitem.submenus !== 'undefined') {
+                var Submenus = topmenuitem.submenus;
+                for (var j = 0; j < Submenus.length; j++) {
+                    var submenuj = Submenus[j];
+                    if (pagename === submenuj.pagename) {
+                        if (typeof submenuj.submenus === 'undefined') {
+                            find = true;
+                            break;
+                        } else {
+                            if (typeof Submenus[0].submenus !== 'undefined') {
+                                hashname = Submenus[0].submenus[0].pagename;
+                            } else {
+                                hashname = Submenus[0].pagename;
+                            }
+                            find = true;
+                            break;
+                        }
+                    } else if (typeof submenuj.submenus !== 'undefined') {
+                        var thirdmenu = submenuj.submenus;
+                        var thirdmenulength = thirdmenu.length;
+                        for (var k = 0; k < thirdmenulength; k++) {
+                            if (pagename === thirdmenu[k].pagename) {
+                                find = true;
+                                break;
+                            }
+                        }
+                    }
+                }
+                if (find) {
+                    break;
+                }
+            }
+            if (find) {
+                break;
+            }
+        }
+    }
+    if (!find) {
+        hashname = 'home';
+    }
+    window.location.hash = '#' + hashname;
+
+}
+function selectThirdPage(pagename, objId) {
+    var obj = '#menu_' + objId;
+    if ($(obj).hasClass('selectmenu')) {
+        $('#' + objId + '_childrens_menu').hide();
+        $(obj).addClass('color_Darkgray').removeClass('selectmenu');
+        $('#menu_' + objId + '_arrow').addClass('menu_arrow_close').removeClass('menu_arrow_open');
+    } else {
+        $('#' + objId + '_childrens_menu').show();
+        $(obj).addClass('selectmenu').removeClass('color_Darkgray');
+        $('#menu_' + objId + '_arrow').addClass('menu_arrow_open').removeClass('menu_arrow_close');
+        if ($('#' + objId + '_childrens_menu').find('#menu_' + CurrentMenu.ThirdMenu).length === 0) {
+            selectPage(pagename);
+        }
+    }
+}
+function generateMenu() {
+    var menupage = [];
+    var right1 = '50px';
+    var left1 = $('.headcontainer').css('margin-left');
+    for (var i = 0; i < gMenu.length; i++) {
+        var menuitems = gMenu[i];
+        var hash = menuitems.pagename;
+        if (menuitems.submenus) {
+            var subitems = menuitems.submenus;
+            hash = subitems[0].pagename;
+            if (typeof subitems[0].submenus !== 'undefined') {
+                hash = subitems[0].submenus[0].pagename;
+            }
+        }
+        if (i === gMenu.length - 1) {
+            right1 = '0px';
+        } else {
+            right1 = '50px';
+        }
+        menupage[i] = '<td class="topmenu" id="menu_' + xss(gMenu[i].pagename) + '" onClick="selectPage(\'' + xss(hash) + '\')">'
+        + '<span id="ic_' + xss(gMenu[i].pagename) + '_icon" style="display:inline-block;vertical-align: middle;margin-right:5px;" class="ic_' + xss(gMenu[i].pagename) + '">&nbsp;</span><span id="menu_top_' + xss(gMenu[i].pagename) + '" style="display:inline-block;vertical-align: middle;" class="topmenu_normal">' + getDisplayName(xss(gMenu[i].pagename))  + '</span></td>';
+    }
+    if (gMenu.length === 7) {
+        $('.header').css('width', '1200px');
+        var menucontent = '<table style="border-spacing:0px;border-collapse:collapse;width:1200px;margin:0 auto;left:' + left1 + ';"><tr>' + menupage.join('') + '</tr></table>';
+    } else if (gMenu.length === 8) {
+        $('.header').css('width', '1300px');
+        var menucontent = '<table style="border-spacing:0px;border-collapse:collapse;width:1300px;margin:0 auto;left:' + left1 + ';"><tr>' + menupage.join('') + '</tr></table>';
+    } else {
+        var menucontent = '<table style="border-spacing:0px;border-collapse:collapse;width:1000px;margin:0 auto;left:' + left1 + ';"><tr>' + menupage.join('') + '</tr></table>';
+    }
+    $(menucontent).appendTo('#topmenucontainer');
+}
+function generateSecondMenu(pagename) {
+    var showmenuflag = false;
+    if ($('#' + pagename + '_childrens_menu').length > 0) {
+        return;
+    }
+    var menucontent = '';
+    for (var i = 0; i < gMenu.length; i++) {
+        var topmenuitem = gMenu[i];
+        if (topmenuitem.pagename === pagename) {
+            if (typeof topmenuitem.submenus === 'undefined') {
+                return;
+            }
+            var submenus = topmenuitem.submenus;
+            for (var j = 0; j < submenus.length; j++) {
+                var hash = submenus[j].pagename;
+                if (typeof submenus[j].submenus !== 'undefined') {
+                    hash = submenus[j].submenus[0].pagename;
+                }
+                if (typeof submenus[j].submenus !== 'undefined') {
+                    $('#rightpagearea').attr('class', 'rightpagearea margin-left-50');
+                    var thirdmenu = submenus[j].submenus;
+                    var thirdmenulength = thirdmenu.length;
+                    menucontent += '<div class="clearboth secondmenu" ' + ' id="menu_' + xss(submenus[j].pagename) + '" onClick="selectThirdPage(\'' + xss(hash) + '\',\'' + xss(submenus[j].pagename) + '\')">'
+                        + '<div class="secondmenu_child">'
+                        + '<div class="pull-left pointer" style="width: 200px;word-break: break-all;">' + getDisplayName(xss(submenus[j].pagename)) + '</div>'
+                        + '<div class="pull-right menu_arrow_close" id="menu_' + xss(submenus[j].pagename) + '_arrow"></div></div></div>'
+                        + '<div id="' + xss(submenus[j].pagename) + '_childrens_menu" class="hide">';
+                    for (var k = 0; k < thirdmenulength; k++) {
+                        menucontent += '<div class="clearboth thirdleftmenu" id="menu_' + xss(thirdmenu[k].pagename) + '" onClick="selectPage(\'' + xss(thirdmenu[k].pagename) + '\')"><div class="pointer">' + getDisplayName(xss(thirdmenu[k].pagename)) + '</div></div>';
+                    }
+                    menucontent += '</div>';
+                } else {
+                    $('#rightpagearea').attr('class', 'rightpagearea margin-left-0');
+                    menucontent += '<div class="clearboth secondmenu" ' + ' id="menu_' + xss(submenus[j].pagename) + '" onClick="selectPage(\'' + xss(hash) + '\')"><div class="pointer secondmenu_child">' + getDisplayName(xss(submenus[j].pagename)) + '</div></div>';
+                }
+            }
+            showmenuflag = true;
+            break;
+        }
+    }
+    var menuhtml = '<div id="' + xss(pagename) + '_childrens_menu">' + menucontent + '</div>';
+    $('#leftmenuarea').prepend(menuhtml);
+    if (showmenuflag) {
+        $('#leftmenuarea').show();
+        $('#rightpagearea').show();
+        resetMenuheight();
+    } else {
+        $('#leftmenuarea').hide();
+        $('#rightpagearea').hide();
+    }
+}
+
+
+$(document).ready(function () {
+
+    var originData = '<?xml version="1.0" encoding="UTF-8"?> \
+    <config> \
+        <title>可视柜台终端管理</title> \
+        <menu> \
+            <home>home</home> \
+            <terminalmanagement> \
+                <initializer>initializer</initializer> \
+                <browser>browser</browser> \
+                <entities> \
+                    <crontab>crontab</crontab> \
+                    <bootmanager>bootmanager</bootmanager> \
+                </entities> \
+            </terminalmanagement> \
+            <networkmanagement> \
+                <branchserver> \
+                    <centersettings>centersettings</centersettings> \
+                </branchserver> \
+                <localnetwork> \
+                    <dns>dns</dns> \
+                </localnetwork> \
+            </networkmanagement> \
+            <hardwareconfig> \
+                    <adapters> \
+                        <cardissuer>cardissuer</cardissuer> \
+                        <contactless>cardissuer</contactless> \
+                        <idcertificate>idcertificate</idcertificate> \
+                        <pinpad>pinpad</pinpad> \
+                        <fingerprint>fingerprint</fingerprint> \
+                        <hspscanner>hspscanner</hspscanner> \
+                        <gpio>gpio</gpio> \
+                        <watchdog>watchdog</watchdog> \
+                        <ups>ups</ups> \
+                    </adapters> \
+                    <logswitch>logswitch</logswitch> \
+            </hardwareconfig> \
+            <mediacontrol> \
+                <microphone>microphone</microphone> \
+                <loudspeaker>loudspeaker</loudspeaker> \
+                <camera>camera</camera> \
+                <volumn>volumn</volumn> \
+                <banquet>banquet</banquet> \
+            </mediacontrol> \
+            <advanceset> \
+                <basicinfo>basicinfo</basicinfo> \
+                <version> \
+                    <vermanagement>vermanagement</vermanagement> \
+                    <upgrade>upgrade</upgrade> \
+                </version> \
+                <module> \
+                    <clearruncfg>clearruncfg</clearruncfg> \
+                </module> \
+                <system> \
+                    <reboot>reboot</reboot> \
+                    <poweroff>poweroff</poweroff> \
+                    <diagnosis>diagnosis</diagnosis> \
+                </system> \
+            </advanceset> \
+        </menu> \
+    </config>';
+
+    var xml;
+    if (!window.ActiveXObject) {
+        var parser = new DOMParser();
+        xml = parser.parseFromString(originData, 'text/xml');
+    } else {
+        xml = new ActiveXObject('Microsoft.XMLDOM');
+        xml.async = false;
+        xml.loadXML(originData);
+    }
+
+    var globalConfig = xml2object($(xml));
+    if (globalConfig.type === 'config') {
+        getname(globalConfig['config']['menu']);
+    }
+});

+ 598 - 19
addin/res/ManagerDesktop/js/public.js

@@ -330,6 +330,10 @@ function utilShowToast(info, showTime) {
     }, showTimes);
 }
 
+var GLOBAL = {
+    HOME_PAGE_URL: 'page.html#home'
+};
+
 function gotoPageWithoutHistory(url) {
     var curHref = window.location.href;
     var curSearch = window.location.search;
@@ -403,7 +407,7 @@ function SelectItem(obj) {
     }
     $('#' + selectitemsid).toggle();
     if (selectitemsLength > SHOW_MAX_ITEM_COUNT) {
-        EMUI.Scroll.initScroll('#' + selectitemsid + '_items');
+        RVC.Scroll.initScroll('#' + selectitemsid + '_items');
     }
     var container;
     var content;
@@ -726,7 +730,7 @@ function showErrorMsg(divid, errormsgid, para) {
     }
     if (para) {
         msgcontent = msgcontent.replace('%d', para);
-        msgcontent = msgcontent.replace('%s', publicLang[para]);
+        msgcontent = msgcontent.replace('%s', para);
     }
     errorLabel += '<div class="clearboth error_message">';
     if ($('#' + divid).find('.control-label-win').length !== 0) {
@@ -736,7 +740,7 @@ function showErrorMsg(divid, errormsgid, para) {
         errorLabel += '<div class="control-label">&nbsp;</div>';
         errorLabel += '<div class="controls-win">';
     }
-    errorLabel += '<div id="' + msgid + '" lang-id="' + errormsgid + '" class="error_info ">' + msgcontent + '</div>';
+    errorLabel += '<div id="' + msgid + ' class="error_info ">' + msgcontent + '</div>';
     errorLabel += '</div>';
     errorLabel += '</div>';
     var classVal = '';
@@ -769,9 +773,6 @@ function showErrorMsg(divid, errormsgid, para) {
         });
     }
     $('#' + divid).secureAppend(errorLabel);
-    if (para) {
-        EMUI.LanguageController.registerLanguage(msgid, errormsgid, para);
-    }
 }
 
 function showRangeErrorMsg(divid, errormsgid, para1, para2) {
@@ -999,6 +1000,556 @@ $(function () {
         return temp;
     };
 
+    RVC.popWinController = RVC.Object.extend({
+        content: [],
+        isautoUpgChecked: false,
+        closeAll: function () {
+            var contentLength = this.content.length;
+            for (var i = 0; i < contentLength; i++) {
+                this.content[i]['isClose'] = true;
+            }
+            $('#emui_content_pop_win').hide();
+        },
+        closePopItem: function (moduleName) {
+            var contentLength = this.content.length;
+            for (var i = 0; i < contentLength; i++) {
+                if (this.content[i]['moduleName'] === moduleName) {
+                    this.content[i]['isClose'] = true;
+                }
+            }
+            this.showPop();
+            showPopWin();
+        },
+        addPopItem: function (moduleName, scribInfoId, contentItem) {
+            if (typeof contentItem === 'undefined' && contentItem === '') {
+                return;
+            }
+            var isNeedShowAgain = false;
+            var scribInfo = '';
+            if (typeof scribInfoId !== 'undefined') {
+                scribInfo = scribInfoId;
+            }
+            var isExist = false;
+            var contentLen = this.content.length;
+            for (var i = 0; i < contentLen; i++) {
+                if (this.content[i]['moduleName'] === moduleName) {
+                    if (contentItem !== this.content[i]['contentinfo']) {
+                        this.content[i]['scribInfoId'] = scribInfo;
+                        this.content[i]['contentinfo'] = contentItem;
+                        this.content[i]['isClose'] = false;
+                        isNeedShowAgain = true;
+                    }
+                    isExist = true;
+                    break;
+                }
+            }
+            if (!isExist) {
+                var conItem = {};
+                conItem.moduleName = moduleName;
+                conItem.scribInfoId = scribInfo;
+                conItem.contentinfo = contentItem;
+                conItem.isClose = false;
+                isNeedShowAgain = true;
+                this.content.push(conItem);
+            }
+            if (isNeedShowAgain) {
+                this.showPop();
+                showPopWin();
+            }
+        },
+        toggleMessage: function (index) {
+            var arrowId = 'arrow_content_message_pop_' + index;
+            var messageId = 'body_content_message_pop_' + index;
+            for (var i = 0; i < this.content.length; i++) {
+                var contentItem = this.content[i];
+                if (contentItem['isClose'] === false && i !== index) {
+                    $('#body_content_message_pop_' + i).hide();
+                    $('#arrow_content_message_pop_' + i).removeClass('menu_arrow_open').addClass('menu_arrow_close');
+                }
+            }
+            if ($('#' + arrowId).hasClass('menu_arrow_close')) {
+                $('#' + arrowId).removeClass('menu_arrow_close').addClass('menu_arrow_open');
+            } else {
+                $('#' + arrowId).removeClass('menu_arrow_open').addClass('menu_arrow_close');
+            }
+            $('#' + messageId).toggle();
+            showPopWin();
+        },
+        showPop: function () {
+            var self = this;
+            var contentLen = this.content.length;
+            if (contentLen === 0) {
+                $('#pop_win_content_area').empty();
+                $('#emui_content_pop_win').hide();
+                return;
+            }
+            var showContent = [];
+            var i = 0;
+            var openIndex = '';
+            var curHash = window.location.hash.substr(1);
+            for (i = 0; i < this.content.length; i++) {
+                var contentItem = this.content[i];
+                if (contentItem['isClose'] === false && contentItem['moduleName'].toLowerCase().indexOf(curHash) < 0) {
+                    showContent.push(contentItem);
+                }
+            }
+            contentLen = showContent.length;
+            if (contentLen > 1) {
+                for (i = 0; i < contentLen; i++) {
+                    var arrowId = 'arrow_content_message_pop_' + i;
+                    if ($('#' + arrowId).hasClass('menu_arrow_open')) {
+                        openIndex = i;
+                        break;
+                    }
+                }
+            }
+            $('#pop_win_content_area').empty();
+            $('#emui_pop_win_title').empty();
+            if (contentLen === 0) {
+                $('#pop_win_content_area').empty();
+                $('#emui_content_pop_win').hide();
+                return;
+            } else if (contentLen === 1) {
+                $('#pop_win_content_area').empty();
+                $('#emui_pop_win_title').empty();
+                $('#emui_pop_win_title').attr('lang-id', showContent[0]['scribInfoId']);
+                langStr('emui_pop_win_title', showContent[0]['scribInfoId']);
+                $('#pop_win_content_area').html(showContent[0]['contentinfo']);
+            } else {
+                var bacicHtml = [];
+                $('#emui_pop_win_title').attr('lang-id', 'device.new.message');
+                langStr('emui_pop_win_title', 'device.new.message');
+                for (i = 0; i < contentLen; i++) {
+                    var classTop = 'border_top message_item_split';
+                    if (i === 0) {
+                        classTop = '';
+                    }
+                    var htmlItem = '<div id="content_message_pop_' + i + '" onclick="EMUI.popWinController.toggleMessage(' + i + ');" class="clearboth list_shared  pointer ' + classTop + '">'
+                        + '<div class="dev-table-ip ic_header_new pull-left"></div>'
+                        + '<div class="pull-left public_item_left" lang-id="' + showContent[i]['scribInfoId'] + '">' + publicLang[showContent[i]['scribInfoId']] + '</div>'
+                        + '<div id="arrow_content_message_pop_' + i + '" class="pull-right menu_arrow_close"></div></div><div class="clearboth"></div>'
+                        + '<div class="border_top hide" id="body_content_message_pop_' + i + '" style="margin-top:20px;"><div style="margin-top:20px;">' + showContent[i]['contentinfo'] + '</div></div><div class="clearboth"></div>';
+                    bacicHtml.push(htmlItem);
+                }
+                bacicHtml = '<div style="margin-bottom:10px;">' + bacicHtml.join('') + '</div>';
+                $('#pop_win_content_area').html(bacicHtml);
+            }
+            $(showContent).each(function (i, value) {
+                if (value.moduleName === 'upgrade' && GLOBAL.modules.china_region_enable === '1') {
+                    self.autoUpgStatus();
+                }
+            });
+            $('#emui_content_pop_win').show();
+            if (openIndex !== '') {
+                this.toggleMessage(openIndex);
+            }
+        },
+        autoUpgStatus: function () {
+            if (!this.isautoUpgChecked) {
+                EMUI.indexAutoUpgradeController.load(null, false);
+                this.isautoUpgChecked = true;
+            }
+            if (EMUI.indexAutoUpgradeController.isOpenAutoUpg === 1) {
+                $('#index_autoUpg').show();
+                $('#index_autoUpg_check').attr('class', 'check_on');
+            } else if (EMUI.indexAutoUpgradeController.isOpenAutoUpg === 0) {
+                $('#index_autoUpg').show();
+                $('#index_autoUpg_check').attr('class', 'check_off');
+            } else {
+                $('#index_autoUpg').hide();
+            }
+        }
+    });
+
+    RVC.Scroll = RVC.Object.extend({
+        i: 0,
+        cancelSelectListEvent: false,
+        boxH: {},
+        textH: {},
+        intervalResizeObj: {},
+        isHiddenOld: {},
+        mouseData: {
+            startY: 0,
+            curTop: 0,
+            startBoolear: false,
+            startSelector: ''
+        },
+        touchData: {
+            startY: 0,
+            curTop: 0,
+            startBoolear: false,
+            startSelector: ''
+        },
+        isStartMouseWheel: false,
+        initScroll: function (selectorS) {
+            var self = this;
+            $.each($(selectorS), function (index, selector) {
+                var $selector = $(selector);
+                var i = self.i;
+                if ($selector.find('.scroll_text').length > 0) {
+                    return;
+                }
+                self.$selector = $selector;
+                self.initBoxHtml($selector, i);
+                self.resize($selector);
+                self.resizeTop($('#scroll_bar_' + i), 0);
+                self.intervalResizeObj[i] = setInterval(function () {
+                    self.intervalResize($selector, i);
+                }, 50);
+                self.bindEvent(i);
+                self.i++;
+            });
+        },
+        callbacks: {},
+        callback: function (selectorS, callbackFun) {
+            var self = this;
+            $.each($(selectorS), function (index, selector) {
+                var i = $(selector).attr('scrollID');
+                self.callbacks[i] = callbackFun;
+            })
+        },
+        initBoxHtml: function ($selector, i) {
+            var self = this;
+            $selector.css('position', 'relative');
+            $selector.css('overflow', 'visible');
+            $selector.attr('scrollID', i);
+            $selector.wrapInner('<div id="scroll_left_' + i + '" class="scroll_left">\
+<div id="scroll_text_'+ i + '" class="scroll_text"></div>\
+</div>');
+            $selector.append('<div id="scroll_right_' + i + '" class="scroll_right" style="display:none">\
+<div id="scroll_bar_'+ i + '" class="scroll_bar" style="min-height:40px;"></div>\
+</div>');
+        },
+        intervalResize: function ($selector, i) {
+            var self = this;
+            if ($('#scroll_text_' + i).length === 0 && self.intervalResizeObj[i]) {
+                clearInterval(self.intervalResizeObj[i]);
+                self.intervalResizeObj[i] = null;
+            } else {
+                var isUpdated = self.resize($selector);
+                if (isUpdated === 'updated') {
+                    var curTop = $('#scroll_bar_' + i)[0].offsetTop;
+                    self.resizeTop($('#scroll_bar_' + i), curTop);
+                }
+            }
+        },
+        resize: function ($selector) {
+            var self = this;
+            if (typeof $selector === 'string') {
+                $.each($($selector), function (index, selector) {
+                    self.resize($(selector));
+                });
+                return;
+            }
+            var i = $selector.attr('scrollID');
+            var $scrollRight = $('#scroll_right_' + i);
+            var $scrollLeft = $('#scroll_left_' + i);
+            var $scrollBar = $('#scroll_bar_' + i);
+            var maxHeight = parseInt($selector.css('max-height').slice(0, -2));
+            var height = parseInt($selector.css('height').slice(0, -2));
+            var currentBoxHeight = (maxHeight > height) ? maxHeight : height;
+            var currentTextH = $selector.find('.scroll_text').height();
+            var currentHidden = ($selector.is(':hidden')) ? true : false;
+            var firstInit = ($scrollBar.height() > 0) ? false : true;
+            if (currentHidden) {
+                self.isHiddenOld[i] = true;
+                return;
+            } else {
+                if (self.isHiddenOld[i] && !firstInit) {
+                    self.resizeTop($('#scroll_bar_' + i), 0);
+                }
+                self.isHiddenOld[i] = false;
+            }
+            if (self.boxH[i] === currentBoxHeight && self.textH[i] === currentTextH) {
+                return;
+            }
+            self.boxH[i] = currentBoxHeight;
+            self.textH[i] = currentTextH;
+            if (currentTextH > currentBoxHeight) {
+                $scrollRight.css('display', 'block');
+            } else {
+                self.resizeTop($('#scroll_bar_' + i), 0);
+                $scrollRight.css('display', 'none');
+                return;
+            }
+            var rateH = currentTextH / currentBoxHeight;
+            var scrollBarH = currentBoxHeight / rateH;
+            $scrollLeft.css('max-height', currentBoxHeight + 'px');
+            $scrollRight.css('height', currentBoxHeight + 'px');
+            $scrollBar.css('height', scrollBarH + 'px');
+            return 'updated';
+        },
+        setTop: function (selectorS, top) {
+            var self = this;
+            $.each($(selectorS), function (index, selector) {
+                var i = $(selector).attr('scrollID');
+                var $scrollBar = $('#scroll_bar_' + i);
+                self.resize($(selector));
+                self.resizeTop($scrollBar, top);
+            })
+        },
+        setDomTop: function (selectorS, domTop) {
+            var self = this;
+            $.each($(selectorS), function (index, selector) {
+                var i = $(selector).attr('scrollID');
+                var $scrollBar = $('#scroll_bar_' + i);
+                self.resize($(selector));
+                self.resizeDomTop($scrollBar, domTop);
+            })
+        },
+        setBottom: function (selectorS, bottom) {
+            var self = this;
+            $.each($(selectorS), function (index, selector) {
+                var i = $(selector).attr('scrollID');
+                var $scrollRight = $('#scroll_right_' + i);
+                var $scrollBar = $('#scroll_bar_' + i);
+                var realHeight = $scrollRight.height();
+                var bottomHeight = realHeight - (bottom || 0);
+                self.resize($(selector));
+                self.resizeTop($scrollBar, bottomHeight);
+            })
+        },
+        resizeDomTop: function ($selectorBar, domTop) {
+            var self = this;
+            var barId = $selectorBar.attr('id');
+            var id = barId;
+            var i = id.slice('scroll_bar_'.length);
+            var boxH = self.boxH[i];
+            var textH = self.textH[i];
+            var barH = $selectorBar.height();
+            var rateH = (textH - boxH) / (boxH - barH);
+            var barTop = (domTop / rateH);
+            self.resizeTop($selectorBar, barTop);
+        },
+        resizeTop: function ($selectorBar, barTop, isAllowCallback) {
+            var self = this;
+            if ($selectorBar.is(':hidden')) {
+                return;
+            }
+            var barId = $selectorBar.attr('id');
+            var id = barId;
+            var i = id.slice('scroll_bar_'.length);
+            var boxH = self.boxH[i];
+            var textH = self.textH[i];
+            var barH = $selectorBar.height();
+            if (barTop < 0) {
+                barTop = 0;
+            } else if (barTop > (boxH - barH)) {
+                barTop = boxH - barH;
+            }
+            var rateH = (textH - boxH) / (boxH - barH);
+            var textTop = -(barTop * rateH);
+            if ($('#scroll_left_' + i).scrollTop() !== 0) {
+                $('#scroll_left_' + i).scrollTop(0);
+            }
+            $selectorBar.css('top', barTop + 'px');
+            $('#scroll_text_' + i).css('top', textTop + 'px');
+            if (isAllowCallback && self.callbacks[i]) {
+                self.callbacks[i]();
+            }
+        },
+        bindEvent: function (i) {
+            var self = this;
+            var $targetDom = $('[scrollID=' + i + ']');
+            var isStartClick = false;
+            $targetDom.on('mousedown click', '#scroll_right_' + i, function (e) {
+                if ($('#' + e.target.id).is(':hidden')) {
+                    return;
+                }
+                e.preventDefault();
+                e.stopPropagation();
+                if ($('#' + e.target.id).hasClass('scroll_bar')) {
+                    return;
+                }
+                if (e.type === 'mousedown') {
+                    isStartClick = true;
+                }
+                if (e.type === 'click' && isStartClick) {
+                    isStartClick = false;
+                    var id = e.currentTarget.id;
+                    var i = id.slice('scroll_right_'.length);
+                    self.resizeTop($('#scroll_bar_' + i), e.pageY - $('#' + id).offset().top, 'allowCallback');
+                }
+            });
+            $targetDom.on(((document.onmousewheel !== undefined) ? "mousewheel" : "DOMMouseScroll"), '#scroll_text_' + i, function (e) {
+                var id = e.currentTarget.id;
+                var i = id.slice('scroll_text_'.length);
+                var $selectorBar = $('#scroll_bar_' + i);
+                if ($selectorBar.is(':hidden')) {
+                    return;
+                }
+                var curTop = $selectorBar[0].offsetTop;
+                var wheel = e.originalEvent.wheelDelta || -e.originalEvent.detail;
+                var delta = Math.max(-1, Math.min(1, wheel));
+                var action = (delta < 0) ? 'down' : 'up';
+                var setTopData;
+                var needUpPropagation = false;
+                if (action === 'up' && curTop > 0) {
+                    e.preventDefault();
+                    e.stopPropagation();
+                    setTopData = curTop - 20;
+                } else if (action === 'down' && $('#scroll_right_' + i).height() - $selectorBar.height() - curTop > 1) {
+                    e.preventDefault();
+                    e.stopPropagation();
+                    setTopData = curTop + 20;
+                } else {
+                    needUpPropagation = true;
+                }
+                if (needUpPropagation) {
+                    return;
+                }
+                if (self.isStartMouseWheel) {
+                    return;
+                }
+                self.isStartMouseWheel = true;
+                setTimeout(function () {
+                    self.isStartMouseWheel = false;
+                }, 100);
+                if (setTopData !== undefined) {
+                    self.resizeTop($selectorBar, setTopData, 'allowCallback');
+                }
+            });
+            $targetDom.on('focusin', '#scroll_text_' + i, function (e) {
+                var tagName = e.target.tagName || '';
+                if (tagName.toLowerCase() !== 'input') {
+                    return;
+                }
+                var id = e.currentTarget.id;
+                var i = id.slice('scroll_text_'.length);
+                var $selectorBar = $('#scroll_bar_' + i);
+                if ($selectorBar.is(':hidden')) {
+                    return;
+                }
+                e.preventDefault();
+                e.stopPropagation();
+                var boxTop = $('#' + id)[0].offsetTop;
+                var dulHeight = $(document.activeElement).offset().top - $('#' + id).offset().top;
+                var domHeight = $(document.activeElement).outerHeight();
+                var overTop = boxTop + dulHeight + domHeight - $('#scroll_left_' + i).height();
+                if (overTop >= 0) {
+                    self.resizeDomTop($selectorBar, dulHeight, 'allowCallback');
+                }
+            });
+            $targetDom.on('touchstart', '#scroll_text_' + i + ',#scroll_bar_' + i, function (e) {
+                var id = e.currentTarget.id;
+                var touch = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0];
+                var i;
+                e.stopPropagation();
+                if (id.indexOf('scroll_text') > -1) {
+                    i = id.slice('scroll_text_'.length);
+                } else if (id.indexOf('scroll_bar') > -1) {
+                    i = id.slice('scroll_bar_'.length);
+                } else {
+                    return;
+                }
+                self.touchData = {
+                    startBoolear: true,
+                    startY: touch.pageY,
+                    curTop: $('#scroll_bar_' + i)[0].offsetTop,
+                    startSelector: 'scroll_bar_' + i
+                }
+            });
+            $targetDom.on('touchmove', '#scroll_text_' + i + ',#scroll_bar_' + i + ',#scroll_right_' + i, function (e) {
+                if (!self.touchData.startSelector || !self.touchData.startBoolear || !$('#' + self.touchData.startSelector).length) {
+                    return;
+                }
+                var id = self.touchData.startSelector;
+                var i = id.slice('scroll_bar_'.length);
+                var touch = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0];
+                var dulTop;
+                if ((e.currentTarget.id).indexOf('scroll_text') > -1) {
+                    dulTop = self.touchData.startY - touch.pageY;
+                } else if ((e.currentTarget.id).indexOf('scroll_bar') > -1) {
+                    dulTop = touch.pageY - self.touchData.startY;
+                }
+                var barTop = dulTop + self.touchData.curTop;
+                self.resizeTop($('#' + id), barTop);
+                e.preventDefault();
+                e.stopPropagation();
+            });
+            $targetDom.on('touchend', '#scroll_text_' + i + ',#scroll_bar_' + i, function (e) {
+                if (!self.touchData.startSelector || !$('#' + self.touchData.startSelector).length) {
+                    return;
+                }
+                var id = self.touchData.startSelector;
+                var barTop = $('#' + id)[0].offsetTop;
+                self.touchData.startBoolear = false;
+                self.resizeTop($('#' + id), barTop, 'allowCallback');
+            });
+            $targetDom.on('mousedown', '#scroll_bar_' + i, function (e) {
+                var id = e.currentTarget.id;
+                var i = id.slice('scroll_bar_'.length);
+                self.mouseData = {
+                    startBoolear: true,
+                    startY: e.pageY,
+                    curTop: $('#' + id)[0].offsetTop,
+                    startSelector: id
+                }
+            });
+            $(document).off('mousemove mouseup');
+            $(document).on('mousemove', function (e) {
+                if (!self.mouseData.startSelector || !self.mouseData.startBoolear || !$('#' + self.mouseData.startSelector).length) {
+                    return;
+                }
+                window.getSelection ? window.getSelection().removeAllRanges() : document.selection.empty();
+                var id = self.mouseData.startSelector;
+                var barTop = (e.pageY - self.mouseData.startY) + self.mouseData.curTop;
+                self.resizeTop($('#' + id), barTop);
+            });
+            $(document).on('mouseup', function (e) {
+                if (!self.mouseData.startSelector || !self.mouseData.startBoolear || !$('#' + self.mouseData.startSelector).length) {
+                    return;
+                }
+                self.cancelSelectListEvent = true;
+                var id = self.mouseData.startSelector;
+                var barTop = $('#' + id)[0].offsetTop;
+                self.mouseData.startBoolear = false;
+                self.resizeTop($('#' + id), barTop, 'allowCallback');
+            });
+        },
+        unbindEvent: function () {
+            $('.scroll_text,.scroll_right,.scroll_bar').off();
+        },
+        destroy: function (selectorS) {
+            var self = this;
+            $.each($(selectorS), function (index, selector) {
+                $selector.removeAttr('scrollID');
+                $scrollText = $(selector).find('.scroll_text');
+                if ($scrollText.length === 0) {
+                    return;
+                }
+                var id = $scrollText.attr('id');
+                var index = id.slice('scroll_text_'.length);
+                if (self.intervalResizeObj[index]) {
+                    clearInterval(self.intervalResizeObj[index]);
+                    self.intervalResizeObj[index] = null;
+                }
+                ($(selector).find('.scroll_left')).replaceWith($scrollText.contents());
+                ($(selector).find('.scroll_right')).remove();
+            });
+        },
+        adapterleftLabelStyle: function (para) {
+            var tag;
+            var selectorTag;
+            if (window.location.href.indexOf('/ManagerDesktop/page.html') >= 0) {
+                tag = '#' + window.location.hash.substr(1) + '_page';
+            } else {
+                tag = 'body';
+            }
+            selectorTag = tag + ' .control-label:visible';
+            if (para) {
+                var otherTag = tag + ' .' + para + ' .control-label-win:visible';
+                selectorTag = selectorTag + ',' + otherTag;
+            }
+            $(selectorTag).each(function (index, element) {
+                if ($(element).height() > 25) {
+                    $(element).css('margin-top', '0px')
+                } else {
+                    $(element).css('margin-top', '8px')
+                }
+            });
+        }
+    });
     RVC.EntityController = RVC.Object.extend({
         entityName:'',
         className: '',
@@ -1020,11 +1571,42 @@ $(function () {
         },
         compareObject: function (obj1, obj2) {
             return compareObject(obj1, obj2);
-        }
-    });
+        },
 
+        webSocketInvoke: function(req, callback)  {
+            WebSocketBase.sendMsg(req, (data) => {
+                var jsondata = JSON.parse(data);
+                if(typeof callback === 'function') {
+                    try {
+                        callback(jsondata);
+                    } catch(err) {}
+                }
+            });
+        },
+
+        commCallback : function(ret) {
+            if("undefined" != typeof ret.errorCode && ret.errorCode === 0) {
+                utilStartCommonDialog("操作成功!");
+                setTimeout(function () {
+                    utilStopCommonDialog();
+                }, 1000);
+            } else {
+                if('undefined' != typeof ret.userCode) {
+                    utilStartAlertDialog("操作失败! ErrorCode: " + ErrorCodeStringfy(ret.errorCode) + " | UserCode: " + ret.userCode);     
+                } else {
+                    utilStartAlertDialog("操作失败! ErrorCode: " + ErrorCodeStringfy(ret.errorCode));
+                }
+                
+            }
+        } 
+    });
 });
 
+function test()
+{
+    //utilShowToast("操作成功!", 5000);
+}
+
 $(function () {
 
     WebSocketBase.socket.onerror = function () {
@@ -1049,10 +1631,7 @@ $(function () {
             req.methodID = this.methodID.QueryHardwareInfo;
             req.signature = this.methodSignature.QueryHardwareInfo;
     
-            WebSocketBase.sendMsg(req, (data) => {
-                var jsondata = JSON.parse(data);
-                callback(jsondata);
-            });
+            this.webSocketInvoke(req, callback);
         },
     });
 
@@ -1072,10 +1651,7 @@ $(function () {
             req.methodID = this.methodID.ControlTerminalLife;
             req.signature = this.methodSignature.ControlTerminalLife;
     
-            WebSocketBase.sendMsg(req, (data) => {
-                var jsondata = JSON.parse(data);
-                callback(jsondata);
-            });
+            this.webSocketInvoke(req, callback);
         },
 
         ControlTerminalLifeNo: function(cmdValue) {
@@ -1091,7 +1667,10 @@ $(function () {
             this.ControlTerminalLife(req, function(ret) {
                 utilStopSubmitDialog();
                 if (ret.errorCode === 0 && ret.retCode === 0) {
-                    utilShowToast("操作成功!", 5000);
+                    utilStartCommonDialog("操作成功!");
+                    setTimeout(function () {
+                        utilStopCommonDialog();
+                    }, 2000);
                 } else {
                     utilStartAlertDialog("操作失败:" + ErrorCodeStringfy(ret.errorCode) + " | " + ret.retCode);
                 }
@@ -1114,7 +1693,7 @@ $(function () {
             });
         },
         RestartPC: function() {
-            utilStartConfirmDialog("确认要重启可视柜台终端设备?", function() {
+            utilStartConfirmDialog("确认要重启计算机?", function() {
                 RVC.HealthmanagerEntityCtrl.ControlTerminalLifeNo(4);
             });
         }
@@ -1143,7 +1722,7 @@ function GetTerminalBasicInfo() {
             $('#ip4Address span').html(result.ip[0]);
             $('#macAddress span').html(result.mac[0]);
         } else {
-            utilStartAlertDialog("获取终端信息失败:" + ret.errorCode);
+            utilStartAlertDialog("获取终端信息失败:" + ErrorCodeStringfy(ret.errorCode));
         }
     });
 }