Преглед на файлове

#IQRV #comment [Other] 调整音频配置位置

gifur преди 4 години
родител
ревизия
690ecc71e6
променени са 3 файла, в които са добавени 133 реда и са изтрити 74 реда
  1. 25 45
      addin/res/ManagerDesktop/guide.html
  2. 87 18
      addin/res/ManagerDesktop/js/guide.js
  3. 21 11
      addin/res/ManagerDesktop/js/public.js

+ 25 - 45
addin/res/ManagerDesktop/guide.html

@@ -46,14 +46,13 @@
                                     </div>
                                 </td>
                                 <td style="width:52px;" align="center" id="reset_btn">
-                                    <div title="配置重置" class="ic_reset"></div>
+                                    <div title="配置重置" class="ic_reset" id="reset_btn_div"></div>
                                 </td>
                                 <td style="width:52px;" align="center" id="rebootapp_btn">
-                                    <div title="重启应用" class="ic_reboot"
-                                        onclick="RVC.HealthmanagerEntityCtrl.RestartApp();"></div>
+                                    <div title="重启应用" class="ic_reboot" id="rebootapp_btn_div"></div>
                                 </td>
                                 <td style="width:52px;" align="center" id="restartpc_btn">
-                                    <div title="设备重启" class="ic_pcrestart"
+                                    <div title="设备重启" class="ic_pcrestart"  id="restartpc_btn_div"
                                         onclick="RVC.HealthmanagerEntityCtrl.RestartPC();"></div>
                                 </td>
                                 <!-- <td style="width:52px;" align="center" id="upsoffpc_btn">
@@ -313,7 +312,7 @@
                         <div id="media_config_content" style="max-height: 510px; width: 998px;">
                             <div id="gui_media_config_audio_output_outfree_div" class="clearboth" style="padding-top:30px;">
                                 <div class="pull-left" style="width:330px;">
-                                    <div class="text-right guide_input_label">外部扬声器:</div>
+                                    <div class="text-right guide_input_label"><strong>外部</strong>扬声器:</div>
                                 </div>
                                 <div class="controls text-left">
                                     <div id="gui_media_config_audio_output_outfree" class="select_on_normal audio_output_outfree_seleceed_save_btn"
@@ -333,55 +332,55 @@
                                     </div>
                                 </div>
                             </div>
-                            <div id="gui_media_config_audio_output_infree_div" class="clearboth" style="padding-top:14px;">
+                            <div id="gui_media_config_audio_input_outfree_div" class="clearboth" style="padding-top:14px;">
                                 <div class="pull-left" style="width:330px;">
-                                    <div class="text-right guide_input_label">话筒扬声器:</div>
+                                    <div class="text-right guide_input_label"><strong>外部</strong>麦克风:</div>
                                 </div>
                                 <div class="controls text-left">
-                                    <div id="gui_media_config_audio_output_infree" class="select_on_normal audio_output_infree_seleceed_save_btn"
+                                    <div id="gui_media_config_audio_input_outfree" class="select_on_normal audio_input_outfree_seleceed_save_btn"
                                         onclick="SelectItem(this)" value=""></div>
-                                    <div id="gui_media_config_audio_output_infree_list" class="select_list hide">
+                                    <div id="gui_media_config_audio_input_outfree_list" class="select_list hide">
                                     </div>
                                 </div>
                                 
                                 <div id="guide_media_config_audio_ouput_outfree_check" class="pull-left margin-left-30 hide"
                                 style="margin-top: 5px;">
-                                    <button id="ip_connect_check" style="color: #F37253;">播放</button>
+                                    <button id="ip_connect_check" style="color: #F37253;">测试</button>
                                 </div>
                                 <div id="guide_media_config_audio_ouput_outfree_tips" class="clearboth">
                                     <div class="pull-left" style="width:330px;">&nbsp;</div>
                                     <div class="pull-left">
-                                        <div class="text-left guide_input_descript" id="text_guide_media_config_audio_ouput_outfree_tips">
-                                            提示:信创设备请选择<strong>内置音频</strong>(如有)
-                                        </div>
+                                        <div class="text-left guide_error hide" id="text_guide_media_config_audio_ouput_outfree_tips"></div>
                                     </div>
                                 </div>
                             </div>
-                            <div id="gui_media_config_audio_input_outfree_div" class="clearboth" style="padding-top:50px;">
+                            <div id="gui_media_config_audio_output_infree_div" class="clearboth" style="padding-top:50px;">
                                 <div class="pull-left" style="width:330px;">
-                                    <div class="text-right guide_input_label">外部麦克风:</div>
+                                    <div class="text-right guide_input_label"><strong>话筒</strong>扬声器:</div>
                                 </div>
                                 <div class="controls text-left">
-                                    <div id="gui_media_config_audio_input_outfree" class="select_on_normal audio_input_outfree_seleceed_save_btn"
+                                    <div id="gui_media_config_audio_output_infree" class="select_on_normal audio_output_infree_seleceed_save_btn"
                                         onclick="SelectItem(this)" value=""></div>
-                                    <div id="gui_media_config_audio_input_outfree_list" class="select_list hide">
+                                    <div id="gui_media_config_audio_output_infree_list" class="select_list hide">
                                     </div>
                                 </div>
                                 
                                 <div id="guide_media_config_audio_ouput_outfree_check" class="pull-left margin-left-30 hide"
                                 style="margin-top: 5px;">
-                                    <button id="ip_connect_check" style="color: #F37253;">测试</button>
+                                    <button id="ip_connect_check" style="color: #F37253;">播放</button>
                                 </div>
                                 <div id="guide_media_config_audio_ouput_outfree_tips" class="clearboth">
                                     <div class="pull-left" style="width:330px;">&nbsp;</div>
                                     <div class="pull-left">
-                                        <div class="text-left guide_error hide" id="text_guide_media_config_audio_ouput_outfree_tips"></div>
+                                        <div class="text-left guide_input_descript" id="text_guide_media_config_audio_ouput_outfree_tips">
+                                            上方选择提示:信创设备请选择<strong>内置音频</strong>(如有)
+                                        </div>
                                     </div>
                                 </div>
                             </div>
-                            <div id="gui_media_config_audio_input_infree_div" class="clearboth" style="padding-top:14px;">
+                            <div id="gui_media_config_audio_input_infree_div" class="clearboth" style="padding-top:20px;">
                                 <div class="pull-left" style="width:330px;">
-                                    <div class="text-right guide_input_label">话筒麦克风:</div>
+                                    <div class="text-right guide_input_label"><strong>话筒</strong>麦克风:</div>
                                 </div>
                                 <div class="controls text-left">
                                     <div id="gui_media_config_audio_input_infree" class="select_on_normal audio_input_infree_seleceed_save_btn"
@@ -398,7 +397,7 @@
                                     <div class="pull-left" style="width:330px;">&nbsp;</div>
                                     <div class="pull-left">
                                         <div class="text-left guide_input_descript" id="text_guide_media_config_audio_ouput_outfree_tips">
-                                            提示:信创设备请选择<strong>内置音频</strong>(如有)
+                                            上方选择提示:信创设备请选择<strong>内置音频</strong>(如有)
                                         </div>
                                     </div>
                                 </div>
@@ -426,7 +425,7 @@
                         <div align="center" style="padding-top:20px; padding-bottom:20px;width:640px;">
                             <div class="ic_warning_small pull-left" style="margin-top: 2px;"></div>
                             <div class="pull-left text-left" style="width:580px;padding-left: 8px;">
-                                硬件适配器已根据厂商模板生成默认配置,此页面支持测试和修改;若是第一次安装建议逐一对硬件进行测试验证
+                                硬件适配器已根据厂商模板生成默认配置,此页面支持测试和修改,不需要改动可以直接跳过<strong>若是第一次安装建议逐一对硬件进行测试验证</strong>
                             </div>
                         </div>
                         <div id="adapter_config_content" style="padding-top:10px; max-height: 510px; width: 998px;">
@@ -546,13 +545,7 @@
                                     </div>
                                 </div>
                             </div>
-                            <div id="guide_adapter_config_terminalno_tips" class="clearboth">
-                                <div class="pull-left" style="width:330px;">&nbsp;</div>
-                                <div class="pull-left">
-                                    <div class="text-left guide_error hide" id="text_guide_adapter_config_terminalno_tips"></div>
-                                </div>
-                            </div>
-                            <div class="clearboth" style="padding-top:10px;" id="guide_adapter_config_port">
+                            <div class="clearboth" style="padding-top:20px;" id="guide_adapter_config_port">
                                 <div class="pull-left" style="width:330px;">
                                     <div class="text-right guide_input_label">端口号
                                     </div>
@@ -562,13 +555,7 @@
                                         onfocus="showInputBorder(this)" onblur="hideInputBorder(this)" maxlength="8" value="">
                                 </div>
                             </div>
-                            <div id="guide_adapter_config_port_tips" class="clearboth">
-                                <div class="pull-left" style="width:330px;">&nbsp;</div>
-                                <div class="pull-left">
-                                    <div class="text-left guide_error hide" id="text_guide_adapter_config_port_tips"></div>
-                                </div>
-                            </div>
-                            <div class="clearboth" style="padding-top:10px;" id="guide_adapter_config_baudrate">
+                            <div class="clearboth" style="padding-top:20px;" id="guide_adapter_config_baudrate">
                                 <div class="pull-left" style="width:330px;">
                                     <div class="text-right guide_input_label">波特率
                                     </div>
@@ -578,14 +565,7 @@
                                         onfocus="showInputBorder(this)" onblur="hideInputBorder(this)" maxlength="10" value="">
                                 </div>
                             </div>
-                            <div id="guide_adapter_config_badurate_tips" class="clearboth">
-                                <div class="pull-left" style="width:330px;">&nbsp;</div>
-                                <div class="pull-left">
-                                    <div class="text-left guide_error hide" id="text_guide_adapter_config_badurate_tips"></div>
-                                </div>
-                            </div>
-                            
-                            <div class="clearboth" style="padding-top:15px">
+                            <div class="clearboth" style="padding-top:30px">
                                 <div class="controls_short" style="margin-left: 100px;"><button class="btn_normal_short"
                                         id="guide_adapter_config_test">测试</button></div>
                                 <div class="controls_short"><button class="btn_normal_short"

+ 87 - 18
addin/res/ManagerDesktop/js/guide.js

@@ -274,6 +274,36 @@ function InterestRootSwitch(flag)
         LoadDeviceAdaptersWithEvent();
 }
 
+function MediaDeviceSelectChange(evt)
+{
+    var obj = evt.parentElement.parentElement;
+    var value = evt.textContent;
+    var obj_id = obj.id;
+
+    if(obj_id === 'gui_media_config_audio_output_outfree_list') {
+        var loundspeakers_in_value = $('#gui_media_config_audio_output_infree').attr('value');
+        if(loundspeakers_in_value !== '' && value === loundspeakers_in_value) {
+            utilShowToast('该设备已在话筒扬声器中被选择!');
+        }
+    } else if(obj_id === 'gui_media_config_audio_output_infree_list') {
+        var loundspeakers_out_value = $('#gui_media_config_audio_output_outfree').attr('value');
+        if(loundspeakers_out_value !== '' && value === loundspeakers_out_value) {
+            utilShowToast('该设备已在外部扬声器中被选择!');  
+        }
+    }else if(obj_id === 'gui_media_config_audio_input_outfree_list') {
+        var microphones_in_value = $('#gui_media_config_audio_input_infree').attr('value');
+        if(microphones_in_value !== '' && value === microphones_in_value) {
+            utilShowToast('该设备已在话筒麦克风中被选择!');
+        }
+    }else if(obj_id === 'gui_media_config_audio_input_infree_list') {
+        var microphones_out_value = $('#gui_media_config_audio_input_outfree').attr('value');
+        if(microphones_out_value !== '' && value === microphones_out_value) {
+            utilShowToast('该设备已在外部麦克风中被选择!');
+        }
+    }
+}
+
+
 $(function () {
 
         /**不使用,转到实体里头处理 */
@@ -667,7 +697,7 @@ $(function () {
                 type: selectid
             };
             var pushHtml = '';
-            pushHtml = '<div id="{{type}}_item_{{loop}}" option="{{deviceName}}" class="select_medium hide_with_ellipsis">'
+            pushHtml = '<div id="{{type}}_item_{{loop}}" option="{{deviceName}}" class="select_medium hide_with_ellipsis" onclick=MediaDeviceSelectChange(this)>'
             pushHtml += '{{deviceName}}</div>'
             $('#' +  selectid).secureAppend(pushHtml, deviceTemplateData);
         }
@@ -792,14 +822,14 @@ $(function () {
             return;
         } 
 
-        // if(output_infree == output_outfree) {
-        //     utilStartAlertDialog('扬声器选取冲突,请重新选择');
-        //     return;
-        // }
-        // if(input_infree == input_outfree) {
-        //     utilStartAlertDialog('麦克风选取冲突,请重新选择');
-        //     return;
-        // }
+        if(output_infree == output_outfree) {
+            utilStartAlertDialog('扬声器选取冲突,请重新选择');
+            return;
+        }
+        if(input_infree == input_outfree) {
+            utilStartAlertDialog('麦克风选取冲突,请重新选择');
+            return;
+        }
 
         let req = new Request();
         req.preStep = DeployStepChain.MediaConfig[preStepIndex];
@@ -1551,6 +1581,53 @@ $(function () {
         });
     });
 
+
+    $('#header_right #quitpage_btn_div').bind('click', function() {
+        if(!globalFinishedFlag) {
+            utilStartConfirmDialog("配置还未完成,确定要退出当前配置吗?(应用也将退出)", function() {
+                AbortDeployConfig();                   
+            });
+        } else {
+            AbortDeployConfig(true);
+        }
+    });
+
+    $('#header_right #rebootapp_btn_div').bind('click', function() {
+        if(!globalFinishedFlag) {
+            utilStartConfirmDialog("配置还未完成,确定要重启应用吗?", function() {
+                RVC.HealthmanagerEntityCtrl.RestartApp(true);
+                RVC.GuideController.hideAllPage();
+                RVC.GuideController.hideAllRebootTipElem();
+                $('#guide_restart_loading').show();
+                $('#guide_reboot_page').show();       
+            });
+        } else {
+            RVC.HealthmanagerEntityCtrl.RestartApp(true);
+            RVC.GuideController.hideAllPage();
+            RVC.GuideController.hideAllRebootTipElem();
+            $('#guide_restart_loading').show();
+            $('#guide_reboot_page').show();
+        }
+    });
+
+    $('#header_right #restartpc_btn_div').bind('click', function() {
+        if(!globalFinishedFlag) {
+            utilStartConfirmDialog("配置还未完成,确定要重启设备吗?", function() {
+                RVC.HealthmanagerEntityCtrl.RestartPC(true);
+                RVC.GuideController.hideAllPage();
+                RVC.GuideController.hideAllRebootTipElem();
+                $('#guide_reboot_loading').show();
+                $('#guide_reboot_page').show();       
+            });
+        } else {
+            RVC.HealthmanagerEntityCtrl.RestartPC(true);
+            RVC.GuideController.hideAllPage();
+            RVC.GuideController.hideAllRebootTipElem();
+            $('#guide_reboot_loading').show();
+            $('#guide_reboot_page').show();
+        }
+    });
+
     if (window.addEventListener) {
         window.addEventListener('resize', RVC.GuideController.resizeWindow, false);
     } else {
@@ -1568,15 +1645,7 @@ $(function () {
             utilStartAlertDialog('功能暂未实现!');
         });
 
-        $('#header_right #quitpage_btn_div').bind('click', function() {
-            if(!globalFinishedFlag) {
-                utilStartConfirmDialog("配置还未完成,确定要退出当前配置吗?(应用也将退出)", function() {
-                    AbortDeployConfig();                   
-                });
-            } else {
-                AbortDeployConfig(true);
-            }
-        });
+
         console.log("href:" + window.location.href);
         console.log("search:" + window.location.search);
 

+ 21 - 11
addin/res/ManagerDesktop/js/public.js

@@ -1784,10 +1784,14 @@ $(function () {
             });
         },
 
-        RestartApp: function() {
-            utilStartConfirmDialog("确认要重启可视柜台应用程序?", function() {
+        RestartApp: function(flag) {
+            if(typeof flag === 'undefined') {
+                utilStartConfirmDialog("确认要重启可视柜台应用程序?", function() {
+                    RVC.HealthmanagerEntityCtrl.ControlTerminalLifeNo(1);
+                });
+            } else {
                 RVC.HealthmanagerEntityCtrl.ControlTerminalLifeNo(1);
-            });
+            }
         },
         QuitApp: function(flag) {
             if(typeof flag === 'undefined') {
@@ -1797,24 +1801,30 @@ $(function () {
             } else {
                 RVC.HealthmanagerEntityCtrl.ControlTerminalLifeNo(2);
             }
-
         },
         UPSOffPC: function() {
             utilStartConfirmDialog("确认通过UPS关闭计算机?(点击确认并操作成功后请在5分钟内拔离插座电源线以彻底关闭计算机,否则机器将会重启!)", function() {
                 RVC.HealthmanagerEntityCtrl.ControlTerminalLifeNo(6);
             });
         },
-        PowerOffPC: function() {
-            utilStartConfirmDialog("确认要关闭计算机?", function() {
+        PowerOffPC: function(flag) {
+            if(typeof flag === 'undefined') {
+                utilStartConfirmDialog("确认要关闭计算机?", function() {
+                    RVC.HealthmanagerEntityCtrl.ControlTerminalLifeNo(5);
+                });
+            } else {
                 RVC.HealthmanagerEntityCtrl.ControlTerminalLifeNo(5);
-            });
+            }
         },
-        RestartPC: function() {
-            utilStartConfirmDialog("确认要重启计算机?", function() {
+        RestartPC: function(flag) {
+            if(typeof flag === 'undefined') {
+                utilStartConfirmDialog("确认要重启计算机?", function() {
+                    RVC.HealthmanagerEntityCtrl.ControlTerminalLifeNo(4);
+                });
+            } else {
                 RVC.HealthmanagerEntityCtrl.ControlTerminalLifeNo(4);
-            });
+            }
         }
-
     });
 
     RVC.CameraConfigEntity = RVC.EntityController.extend({