|
@@ -1,10 +1,19 @@
|
|
|
var CONST = {
|
|
|
-DeployStep_Begin : 0,
|
|
|
-DeployStep_GetTerminalInfo : 1,
|
|
|
-DeployStep_FetchCenterSettings : 2,
|
|
|
-DeployStep_AccessAuthorize : 3,
|
|
|
-DeployStep_MediaConfig : 4,
|
|
|
-DeployStep_Finished : 5
|
|
|
+ DeployStep_Begin : 0,
|
|
|
+ DeployStep_GetTerminalInfo : 1,
|
|
|
+ DeployStep_FetchCenterSettings : 2,
|
|
|
+ DeployStep_AccessAuthorize : 3,
|
|
|
+ DeployStep_MediaConfig : 4,
|
|
|
+ DeployStep_Finished : 5
|
|
|
+};
|
|
|
+
|
|
|
+var SETCTION = {
|
|
|
+ BEGIN:'start',
|
|
|
+ GETTERMINAL_INFO:'init_param',
|
|
|
+ CENTERSETTINGS:'sync_centersetting',
|
|
|
+ ACCESS_AUTHORIZE:'access_authorize',
|
|
|
+ MEDIA_CONFIG:'media_config',
|
|
|
+ FINSHED:'finish',
|
|
|
};
|
|
|
|
|
|
var MEDIA_TYPE = {
|
|
@@ -29,12 +38,11 @@ var VENDOR = {
|
|
|
};
|
|
|
|
|
|
$(function () {
|
|
|
-
|
|
|
|
|
|
RVC.GuideController = RVC.Object.extend({
|
|
|
hideAllPage: function () {
|
|
|
$('#guide_start_page').hide();
|
|
|
- $('#guide_initparam_page').hide();
|
|
|
+ $('#guide_init_param_page').hide();
|
|
|
$('#guide_sync_centersetting_page').hide();
|
|
|
$('#guide_access_authorize_page').hide();
|
|
|
$('#guide_media_config_page').hide();
|
|
@@ -61,19 +69,19 @@ $(function () {
|
|
|
$('body').scrollLeft(($('body').width() - $(window).width()) / 2);
|
|
|
}, 1000)
|
|
|
}
|
|
|
- $('#guide_initparam_page').css('padding-top', adjustHeight + 'px');
|
|
|
+ $('#guide_init_param_page').css('padding-top', adjustHeight + 'px');
|
|
|
},
|
|
|
beginInstall: function() {
|
|
|
this.gotoPage(CONST.DeployStep_GetTerminalInfo);
|
|
|
},
|
|
|
- gotoPage: function(nextStep) {
|
|
|
+ getPage: function(step) {
|
|
|
var select_page = '';
|
|
|
- switch(nextStep) {
|
|
|
+ switch(step) {
|
|
|
case CONST.DeployStep_Begin:
|
|
|
select_page = 'guide_start_page';
|
|
|
break;
|
|
|
case CONST.DeployStep_GetTerminalInfo :
|
|
|
- select_page = 'guide_initparam_page';
|
|
|
+ select_page = 'guide_init_param_page';
|
|
|
break;
|
|
|
case CONST.DeployStep_FetchCenterSettings:
|
|
|
select_page = 'guide_sync_centersetting_page';
|
|
@@ -90,14 +98,42 @@ $(function () {
|
|
|
default:
|
|
|
break;
|
|
|
}
|
|
|
+ return select_page;
|
|
|
+ },
|
|
|
|
|
|
+ checkPageAvailable: function(step) {
|
|
|
+ const select_page = this.getPage(step);
|
|
|
if(select_page !== '') {
|
|
|
- this.hideAllPage();
|
|
|
+ return true;
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ preLoadPage: function(step) {
|
|
|
+ this.hideAllPage();
|
|
|
+ switch(step) {
|
|
|
+ case CONST.DeployStep_MediaConfig:
|
|
|
+ FulfillMediaDeviceList();
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ postLoadPage: function(step) {
|
|
|
+
|
|
|
+ },
|
|
|
+ gotoPage: function(nextStep) {
|
|
|
+
|
|
|
+ var select_page = this.getPage(nextStep);
|
|
|
+
|
|
|
+ if(select_page !== '') {
|
|
|
+ this.preLoadPage(nextStep);
|
|
|
$('#' + select_page).show();
|
|
|
+ this.postLoadPage(nextStep);
|
|
|
} else {
|
|
|
utilShowToast('无法识别步骤标识:' + nextStep, 3000);
|
|
|
}
|
|
|
-
|
|
|
},
|
|
|
sectOverPass: function() {
|
|
|
|
|
@@ -150,17 +186,17 @@ $(function () {
|
|
|
|
|
|
function showErrTips(val) {
|
|
|
setTimeout(function () {
|
|
|
- $('#text_guide_initparam_ip_tips').addClass('hide');
|
|
|
+ $('#text_guide_init_param_ip_tips').addClass('hide');
|
|
|
}, 3000);
|
|
|
- $('#text_guide_initparam_ip_tips').removeClass('hide')
|
|
|
+ $('#text_guide_init_param_ip_tips').removeClass('hide')
|
|
|
.removeClass('guide_input_descript').addClass('guide_error').html(val);
|
|
|
}
|
|
|
|
|
|
function showSuccTips(val) {
|
|
|
setTimeout(function () {
|
|
|
- $('#text_guide_initparam_ip_tips').addClass('hide');
|
|
|
+ $('#text_guide_init_param_ip_tips').addClass('hide');
|
|
|
}, 3000);
|
|
|
- $('#text_guide_initparam_ip_tips').removeClass('hide')
|
|
|
+ $('#text_guide_init_param_ip_tips').removeClass('hide')
|
|
|
.removeClass('guide_error').addClass('guide_input_descript').html(val);
|
|
|
}
|
|
|
|
|
@@ -171,10 +207,8 @@ $(function () {
|
|
|
|
|
|
RVC.DeviceControlEntityCtrl.TestConnectivity(req, function(ret) {
|
|
|
if(ret.errorCode === 0) {
|
|
|
- console.log('Ping 返回成功');
|
|
|
let result = JSON.parse(ret[RVC.EntityController.sigResponseUUID])
|
|
|
if(result.result == 0) {
|
|
|
- console.log(ip + ' 可正常连通');
|
|
|
showSuccTips('可正常连通');
|
|
|
} else {
|
|
|
console.log(result.additionalMsg);
|
|
@@ -182,7 +216,6 @@ $(function () {
|
|
|
}
|
|
|
} else {
|
|
|
let tips = ip + ' 测试连接失败:' + ErrorCodeStringfy(ret.errorCode);
|
|
|
- console.error(tips);
|
|
|
showErrTips(tips);
|
|
|
}
|
|
|
});
|
|
@@ -195,7 +228,7 @@ $(function () {
|
|
|
req.preStep = CONST.DeployStep_MediaConfig;
|
|
|
req.currStep = CONST.DeployStep_FetchCenterSettings;
|
|
|
req.nextStep = CONST.DeployStep_AccessAuthorize;
|
|
|
- } else {
|
|
|
+ } else { //准入验证
|
|
|
req.preStep = CONST.DeployStep_FetchCenterSettings;
|
|
|
req.currStep = CONST.DeployStep_AccessAuthorize;
|
|
|
req.nextStep = CONST.DeployStep_Finished;
|
|
@@ -204,6 +237,9 @@ $(function () {
|
|
|
req.param1 = parseInt(port, 10);
|
|
|
req.param2 = 0;
|
|
|
req.param3 = server_ip;
|
|
|
+ req.additional = 0;
|
|
|
+ req.restartApp = false;
|
|
|
+ req.restartPC = false;
|
|
|
req.param4 = '';
|
|
|
req.param5 = '';
|
|
|
req.array1 = [0];
|
|
@@ -215,7 +251,7 @@ $(function () {
|
|
|
if(ret.errorCode === 0) {
|
|
|
let result = JSON.parse(ret[RVC.EntityController.sigResponseUUID])
|
|
|
if(result.result == 0) {
|
|
|
- utilStartAlertDialog("操作成功", function() {
|
|
|
+ utilStartAlertDialog("操作成功,进入下一步", function() {
|
|
|
RVC.GuideController.gotoPage(result.nextStep);
|
|
|
});
|
|
|
} else {
|
|
@@ -240,6 +276,9 @@ $(function () {
|
|
|
req.param5 = '';
|
|
|
req.array1 = [0];
|
|
|
req.array2 = [''];
|
|
|
+ req.additional = 0;
|
|
|
+ req.restartApp = false;
|
|
|
+ req.restartPC = false;
|
|
|
|
|
|
utilStartSubmitDialog();
|
|
|
RVC.HealthmanagerEntityCtrl.DeployTerminal(req, function(ret) {
|
|
@@ -247,7 +286,7 @@ $(function () {
|
|
|
if(ret.errorCode === 0) {
|
|
|
let result = JSON.parse(ret[RVC.EntityController.sigResponseUUID])
|
|
|
if(result.result == 0) {
|
|
|
- utilStartAlertDialog("操作成功", function() {
|
|
|
+ utilStartAlertDialog("操作成功,进入下一步", function() {
|
|
|
RVC.GuideController.gotoPage(result.nextStep);
|
|
|
});
|
|
|
|
|
@@ -311,7 +350,7 @@ $(function () {
|
|
|
function FulfillMediaDeviceList(flag)
|
|
|
{
|
|
|
let req = new Request();
|
|
|
- req.type = 6; //不需要摄像头配置
|
|
|
+ req.type = 6; //1,2,4不需要摄像头配置
|
|
|
req.interest = 0;
|
|
|
req.reserverd1 = 0;
|
|
|
req.reserverd2 = '';
|
|
@@ -402,6 +441,9 @@ $(function () {
|
|
|
req.preStep = CONST.DeployStep_GetTerminalInfo;
|
|
|
req.currStep = CONST.DeployStep_MediaConfig;
|
|
|
req.nextStep = CONST.DeployStep_FetchCenterSettings;
|
|
|
+ req.additional = 1; //重命名root.ini
|
|
|
+ req.restartApp = true;
|
|
|
+ req.restartPC = false;
|
|
|
req.param1 = 0;
|
|
|
req.param2 = 0;
|
|
|
req.param3 = '';
|
|
@@ -416,7 +458,7 @@ $(function () {
|
|
|
if(ret.errorCode === 0) {
|
|
|
let result = JSON.parse(ret[RVC.EntityController.sigResponseUUID])
|
|
|
if(result.result == 0) {
|
|
|
- utilStartAlertDialog("操作成功", function() {
|
|
|
+ utilStartAlertDialog("操作成功,进入下一步", function() {
|
|
|
RVC.GuideController.gotoPage(result.nextStep);
|
|
|
});
|
|
|
} else {
|
|
@@ -429,15 +471,15 @@ $(function () {
|
|
|
|
|
|
}
|
|
|
|
|
|
- $(document).on('click', '#guide_initparam_ip_check #ip_connect_check', function(){
|
|
|
+ $(document).on('click', '#guide_init_param_ip_check #ip_connect_check', function(){
|
|
|
var ip = $('#guide_server_ip').val();
|
|
|
console.log('ip: ' + ip);
|
|
|
IPConnectableTest(ip);
|
|
|
});
|
|
|
|
|
|
- $(document).on('click', '#guide_initparam_next', function() {
|
|
|
+ $(document).on('click', '#guide_init_param_next', function() {
|
|
|
const ip = $('#guide_server_ip').val();
|
|
|
- const terminalno = $('#guide_initparam_terminalno').val();
|
|
|
+ const terminalno = $('#guide_init_param_terminalno').val();
|
|
|
if(!isValidIpAddress(ip)) {
|
|
|
utilStartAlertDialog("无效IP格式");
|
|
|
return;
|
|
@@ -447,7 +489,7 @@ $(function () {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- var vendorType = $('#gui_initparam_vendor').attr('value');
|
|
|
+ var vendorType = $('#gui_init_param_vendor').attr('value');
|
|
|
if(vendorType === '' || vendorType === 'None') {
|
|
|
utilStartAlertDialog("请选择设备厂商");
|
|
|
return;
|
|
@@ -481,20 +523,31 @@ $(function () {
|
|
|
SaveMediaDeviceConfig();
|
|
|
});
|
|
|
|
|
|
- if (window.location.href.indexOf('guide.html') !== -1) {
|
|
|
- RVC.GuideController.resizeWindow();
|
|
|
- RVC.Scroll.initScroll('#initparam_content');
|
|
|
- }
|
|
|
if (window.addEventListener) {
|
|
|
window.addEventListener('resize', RVC.GuideController.resizeWindow, false);
|
|
|
} else {
|
|
|
window.attachEvent('resize', RVC.GuideController.resizeWindow);
|
|
|
}
|
|
|
- setTimeout(RVC.GuideController.resizeWindow, 200);
|
|
|
|
|
|
RVC.CameraConfigEntity.init();
|
|
|
- FulfillMediaDeviceList();
|
|
|
|
|
|
- RVC.GuideController.hideAllPage();
|
|
|
- $('#guide_start_page').show();
|
|
|
+ if (window.location.href.indexOf('guide.html') !== -1) {
|
|
|
+ RVC.GuideController.resizeWindow();
|
|
|
+ RVC.Scroll.initScroll('#init_param_content');
|
|
|
+
|
|
|
+ var hash = window.location.href.split('#')[1];
|
|
|
+ if(hash && IsDigital(hash)) {
|
|
|
+ var step = parseInt(hash, 10);
|
|
|
+ if(RVC.GuideController.checkPageAvailable(step)) {
|
|
|
+ utilStartAlertDialog('点击确认继续上次的配置', function() {
|
|
|
+ RVC.GuideController.gotoPage(step);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ RVC.GuideController.gotoPage(CONST.DeployStep_Begin);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ setTimeout(RVC.GuideController.resizeWindow, 200);
|
|
|
+
|
|
|
});
|