Explorar el Código

#IQRV #comment [JS]添加引导库

gifur hace 4 años
padre
commit
c80ddf15b2

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
addin/res/ManagerDesktop/Include/driver.min.js


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
addin/res/ManagerDesktop/css/driver.min.css


+ 62 - 0
addin/res/ManagerDesktop/js/introduce.js

@@ -0,0 +1,62 @@
+var currHtmlVerion = '0.0.1';
+
+stepsuit001 = [
+    {
+        element: '#rebootapp_btn', // Query selector string or Node to be highlighted
+        popover: {// There will be no popover if empty or not given
+            // className to wrap this specific step popover in addition to the general className in Driver options
+            className: 'popover-class', 
+            // Title on the popover
+            title: '重启可视柜台终端应用程序', 
+             // Body of the popover
+            description: '点击此菜单将会重启可视柜台终端应用程序,此页面在停滞一段时间后也会消失',
+            // position can be left, left-center, left-bottom, top,
+            // top-center, top-right, right, right-center, right-bottom,
+            // bottom, bottom-center, bottom-right, mid-center
+            position: 'bottom',
+        }
+    },
+    {
+        element: '#restartpc_btn',
+        popover: {
+            className: 'popover-class',
+            title: '重启可视柜台设备',
+            description: '点击此菜单将会先退出可视柜台应用,在应用退尽后将会关机重启机器',
+            position: 'bottom',
+        }
+    },
+    {
+        element: '#upsoffpc_btn',
+        popover: {
+            className: 'popover-class',
+            title: '通过UPS关闭设备',
+            description: '该操作能彻底关闭计算机,操作人员在确认后需按照提示及时拔掉电源插座,避免超时后重新启动系统',
+            position: 'bottom',
+        }
+    },
+    {
+        element: '#quitpage_btn',
+        popover: {
+            className: 'popover-class',
+            title: '退出本地终端管理页面',
+            description: '退出当前终端管理页面',
+            position: 'bottom',
+        }
+    },
+    {
+        element: '#menu_top_mediacontrol',
+        popover: {
+            className: 'popover-class',
+            title: '媒体相关配置',
+            description: '控制设备扬声器音量大小等',
+            position: 'bottom',
+        }
+    },
+];
+
+$(document).ready(function () {
+
+    const driver = new Driver(stepGlobalOptions);
+    driver.defineSteps(stepsuit001);
+    driver.start();
+});

+ 43 - 1
addin/res/ManagerDesktop/js/menu.js

@@ -300,6 +300,39 @@ if (window.addEventListener) {
 } else {
     window.attachEvent('resize', resetMenuheight);
 }
+
+function guidePage(firstMenu) {
+    var result = false;
+    if(typeof firstMenu === 'undefined') {
+        return result;
+    }
+    var curmenu = $('#menu_top_' + firstMenu);
+    if(typeof curmenu == 'undefined') {
+        return result;
+    }
+
+    if(firstMenu === 'mediacontrol') {
+        const driver = new Driver(stepGlobalOptions);
+        driver.defineSteps([
+            {
+                element: '#menu_volumn',
+                popover: {
+                    className: 'popover-class',
+                    title: '媒体音量调节',
+                    description: '控制设备扬声器音量大小等',
+                    position: 'right',
+                }
+            }
+        ]);
+        driver.start();
+        result = true;
+    }
+
+    return result;
+
+}
+
+var renderFirst = true;
 function showNewPage(type) {
     $(document).css('height', 'auto');
     var href = window.location.href;
@@ -316,8 +349,9 @@ function showNewPage(type) {
     var Thimenu = CurrentMenu.ThirdMenu;
     var callback;
     var page;
+    var pageIsExists = true;
     if (Senmenu === '' && Thimenu === '') {
-        if (Firmenu === 'devicemanagement' || Firmenu === 'home' || Firmenu === 'ussd') {
+        if (Firmenu === 'home') {
             $('#rightpagearea').attr('class', 'rightpagearea margin-left-0');
         } else {
             $('#rightpagearea').attr('class', 'rightpagearea margin-left-165');
@@ -330,6 +364,7 @@ function showNewPage(type) {
             page.show();
             RVC.Scroll.adapterleftLabelStyle();
         } else {
+            pageIsExists = false;
             utilLoadPage('./js/page/' + Firmenu + '.js', function () {
                 callback = Firmenu + 'GenPage';
                 modelCallback(callback);
@@ -350,6 +385,7 @@ function showNewPage(type) {
             page.show();
             RVC.Scroll.adapterleftLabelStyle();
         } else {
+            pageIsExists = false;
             utilLoadPage('./js/page/' + Senmenu + '.js', function () {
                 callback = Senmenu + 'GenPage';
                 modelCallback(callback);
@@ -373,6 +409,7 @@ function showNewPage(type) {
             page.show();
             RVC.Scroll.adapterleftLabelStyle();
         } else {
+            pageIsExists = false;
             utilLoadPage('./js/page/' + Thimenu + '.js', function () {
                 callback = Thimenu + 'GenPage';
                 modelCallback(callback);
@@ -384,6 +421,11 @@ function showNewPage(type) {
     selectMenu(Firmenu);
     selectMenu(Senmenu);
     selectMenu(Thimenu);
+    if(!pageIsExists && renderFirst) {
+        if(guidePage(Firmenu)) {
+            renderFirst = false;
+        }
+    }
 }
 function utilLoadPage(scriptName, callback) {
     $.getScript(scriptName + '?r=' + Math.random()).done(function () {

+ 20 - 28
addin/res/ManagerDesktop/js/public.js

@@ -713,10 +713,6 @@ function toggleHelpInfo(obj) {
     if (curElement && curElement.hasClass('page_help')) {
         curElement.next().toggle();
     }
-    if (window.location.hash === '#wps') {
-        EMUI.LanguageController.registerLanguageEx('wps_page_help', 'wps_page_help', '%s', 'wifi_auth_label');
-        EMUI.LanguageController.transLangEx();
-    }
 }
 
 function showErrorMsg(divid, errormsgid, para) {
@@ -937,6 +933,16 @@ function getQueryStringByName(item) {
 var AJAX_TIMEOUT = 30000;
 var RVC_TIMEOUT = 10000;
 
+const stepGlobalOptions = {
+    doneBtnText: '完成',  // Text on the final button
+    closeBtnText: '关闭', // Text on the close button for this step
+    nextBtnText: '下一步', // Next button text for this step
+    prevBtnText: '上一步', // Previous button text for this step
+    showButtons: true,    // Do not show control buttons in footer
+    allowClose: false,    // Whether the click on overlay should close or not
+    //stageBackground: '#000000',
+    opacity: 0.5,
+};
 
 var RVC = {};
 
@@ -1550,6 +1556,7 @@ $(function () {
             });
         }
     });
+
     RVC.EntityController = RVC.Object.extend({
         entityName:'',
         className: '',
@@ -1585,18 +1592,19 @@ $(function () {
         },
 
         commCallback : function(ret) {
-            if("undefined" != typeof ret.errorCode && ret.errorCode === 0) {
+            if("undefined" !== typeof ret.errorCode && ret.errorCode === 0) {
                 utilStartCommonDialog("操作成功!");
                 setTimeout(function () {
                     utilStopCommonDialog();
                 }, 1000);
-            } else {
+            } else if("undefined" !== typeof ret.errorCode) {
                 if('undefined' != typeof ret.userCode) {
                     utilStartAlertDialog("操作失败! ErrorCode: " + ErrorCodeStringfy(ret.errorCode) + " | UserCode: " + ret.userCode);     
                 } else {
                     utilStartAlertDialog("操作失败! ErrorCode: " + ErrorCodeStringfy(ret.errorCode));
                 }
-                
+            } else {
+                utilStartAlertDialog("操作失败! 响应数据无法解析");
             }
         } 
     });
@@ -1984,41 +1992,25 @@ function utilGetTimeString(timeVal) {
     tmpVal = parseInt(timeInt / (60 * 60 * 24), 10);
     if (tmpVal > 0) {
         timeString += tmpVal;
-        var langId = 'public.day';
-        timeString += '<span lang-id="' + langId + '">' + publicLang[langId] + '</span>';
+        timeString += '<span>天</span>';
     }
     timeInt %= 60 * 60 * 24;
     tmpVal = parseInt(timeInt / (60 * 60), 10);
     if (tmpVal > 0) {
         timeString += tmpVal;
-        if (tmpVal > 1) {
-            langId = 'public.hours';
-        } else {
-            langId = 'public.hour';
-        }
-        timeString += '<span lang-id="' + langId + '">' + publicLang[langId] + '</span>';
+        timeString += '<span>小时</span>';
     }
     timeInt %= 60 * 60;
     tmpVal = parseInt(timeInt / (60), 10);
     if (tmpVal > 0) {
         timeString += tmpVal;
-        if (tmpVal > 1) {
-            langId = 'public.minutes';
-        } else {
-            langId = 'public.minute';
-        }
-        timeString += '<span lang-id="' + langId + '">' + publicLang[langId] + '</span>';
+        timeString += '<span>分钟</span>';
     }
     timeInt %= 60;
     tmpVal = parseInt(timeInt, 10);
     if (tmpVal > 0) {
         timeString += tmpVal;
-        if (tmpVal > 1) {
-            langId = 'public.seconds';
-        } else {
-            langId = 'public.second';
-        }
-        timeString += '<span lang-id="' + langId + '">' + publicLang[langId] + '</span>';
+        timeString += '<span>秒</span>';
     }
     return timeString;
 }
@@ -2032,7 +2024,7 @@ function getCurrentTime(time) {
     }
     times = times - day * 86400;
     if (finalTime !== '') {
-        finalTime += '<span lang-id="public.day">' + publicLang['public.day'] + '</span> ';
+        finalTime += '<span>天</span> ';
     }
     var hours = parseInt((times / 3600), 10);
     if (hours > 9) {

+ 6 - 4
addin/res/ManagerDesktop/page.html

@@ -7,6 +7,7 @@
     <meta name="description" content="default">
     <meta name="author" content="default">
     <link type="text/css" rel="stylesheet" href="css/emui-style.css">
+    <link type="text/css" rel="stylesheet" href="css/driver.min.css">
     <script type="text/javascript" src="Include/LsyCookie.js"></script>
     <script type="text/javascript" src="js/errorCodeEnum.js"></script>
     <script type="text/javascript" src="js/common.js"></script>
@@ -17,6 +18,7 @@
     <script type="text/javascript" src="js/innerEventEmitter.js"></script>
     <script type="text/javascript" src="js/entityService.js"></script>
     <script type="text/javascript" src="Include/jQuery/js/emui-jquery.min.js"></script>
+    <script type="text/javascript" src="Include/driver.min.js"></script>
     <script type="text/javascript" src="js/public.js"></script>
     <script type="text/javascript" src="js/menu.js"></script>
     <script type="text/javascript">
@@ -47,15 +49,15 @@
                                         class="ic_update_normal" onclick="test();">
                                     </div>
                                 </td>
-                                <td style="width:52px;" align="center" id="loginallowed_btn">
+                                <td style="width:52px;" align="center" id="rebootapp_btn">
                                     <div title="重启应用" class="ic_reboot"
                                         onclick="RVC.HealthmanagerEntityCtrl.RestartApp();"></div>
                                 </td>
-                                <td style="width:52px;" align="center">
+                                <td style="width:52px;" align="center" id="restartpc_btn">
                                     <div title="设备重启" class="ic_pcrestart"
                                         onclick="RVC.HealthmanagerEntityCtrl.RestartPC();"></div>
                                 </td>
-                                <td style="width:52px;" align="center">
+                                <td style="width:52px;" align="center" id="upsoffpc_btn">
                                     <div title="通过UPS关机" class="ic_upsoff"
                                         onclick="RVC.HealthmanagerEntityCtrl.UPSOffPC();"></div>
                                 </td>
@@ -138,5 +140,5 @@
 
 
 </body>
-
+<script type="text/javascript" src="js/introduce.js"></script>
 </html>

Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio