diff --git a/supervise-customer-ui/src/api/tobacco/orderCommodity.js b/supervise-customer-ui/src/api/tobacco/orderCommodity.js
index 6b811983..bfb948d2 100644
--- a/supervise-customer-ui/src/api/tobacco/orderCommodity.js
+++ b/supervise-customer-ui/src/api/tobacco/orderCommodity.js
@@ -6,7 +6,7 @@ export default {
listPage: function(params) {
return request({
baseURL: '/api',
- url: '/customer/v1/purchaserequisitionpro/listPage',
+ url: '/customer/v1/purchaserequisitionstore/listPage',
method: 'post',
data: params,
headers: {
@@ -17,7 +17,7 @@ export default {
exportExcel: function(params) {
return request({
baseURL: '/api',
- url: '/customer/v1/purchaserequisitionpro/exportExcel',
+ url: '/customer/v1/purchaserequisitionstore/exportExcel',
method: 'post',
responseType: 'blob', // 表明返回服务器返回的数据类型
data: params,
diff --git a/supervise-customer-ui/src/api/tobacco/orders.js b/supervise-customer-ui/src/api/tobacco/orders.js
index 2066f0ba..0ff9995b 100644
--- a/supervise-customer-ui/src/api/tobacco/orders.js
+++ b/supervise-customer-ui/src/api/tobacco/orders.js
@@ -6,7 +6,7 @@ export default {
listPage: function(params) {
return request({
baseURL: '/api',
- url: '/customer/v1/purchaserequisition/listPage',
+ url: '/customer/v1/purchaserequisitiontobacco/listPage',
method: 'post',
data: params,
headers: {
@@ -17,7 +17,7 @@ export default {
exportExcel: function(params) {
return request({
baseURL: '/api',
- url: '/customer/v1/purchaserequisition/exportExcel',
+ url: '/customer/v1/purchaserequisitiontobacco/exportExcel',
method: 'post',
responseType: 'blob', // 表明返回服务器返回的数据类型
data: params,
diff --git a/supervise-message-ui/.env.development b/supervise-message-ui/.env.development
index 09337635..572331cf 100644
--- a/supervise-message-ui/.env.development
+++ b/supervise-message-ui/.env.development
@@ -2,8 +2,8 @@
ENV = 'development'
# base api
-VUE_APP_BASE_API = '/api'
+VUE_APP_BASE_API = '/api/service'
## 配置测试和本地开发时的 接口地址
-VUE_APP_URL = "http://127.0.0.1:8112"
+VUE_APP_URL = "http://192.168.3.173:8112"
##VUE_APP_URL = "http://120.46.172.184:8111"
diff --git a/supervise-message-ui/src/api/message/mbxx.js b/supervise-message-ui/src/api/message/mbxx.js
new file mode 100644
index 00000000..05c971f4
--- /dev/null
+++ b/supervise-message-ui/src/api/message/mbxx.js
@@ -0,0 +1,50 @@
+import request from '@/utils/request'
+// 模板信息
+export default {
+ // 新增模板消息
+ addSave: function(params) {
+ return request({
+ // baseURL: '/api',
+ url: '/v1/wechattemplate/save',
+ method: 'post',
+ data: params,
+ headers: {
+ 'Content-Type': 'application/json'
+ }
+ })
+ },
+ // 查询分页列表
+ listPage: function(params) {
+ return request({
+ // baseURL: '/api',
+ url: '/v1/wechattemplate/listPage',
+ method: 'post',
+ data: params,
+ headers: {
+ 'Content-Type': 'application/json'
+ }
+ })
+ },
+ // 初始化
+ fetchBySid: function(sid) {
+ return request({
+ url: '/v1/wechattemplate/getTemplateBySid/' + sid,
+ method: 'get',
+ })
+ },
+ // 修改
+ updateData: function(data) {
+ return request({
+ url: '/v1/wechattemplate/update',
+ method: 'post',
+ data: data
+ });
+ },
+ // 删除
+ delBySids: function(sid) {
+ return request({
+ url: '/v1/wechattemplate/delete/' + sid,
+ method: 'delete',
+ })
+ },
+}
\ No newline at end of file
diff --git a/supervise-message-ui/src/api/portal/Upload.js b/supervise-message-ui/src/api/portal/Upload.js
new file mode 100644
index 00000000..7a3d36e6
--- /dev/null
+++ b/supervise-message-ui/src/api/portal/Upload.js
@@ -0,0 +1,29 @@
+import request from '@/utils/request'
+import qs from 'qs'
+// 统一请求路径前缀
+const base = process.env.VUE_APP_URL
+
+// 文件上传接口
+export const uploadFile = process.env.VUE_APP_BASE_API + '/customer/file/upload'
+
+
+
+// 上传图片
+// export function imageUpload(data) {
+// return request({
+// url: '/portal/file/upload',
+// method: 'post',
+// data,
+// headers: { 'Content-Type': 'multipart/form-data' }
+// })
+// }
+
+// 移除图片
+export function deleteFilesOss(data) {
+ return request({
+ url: '/base/v1/baseVehicleAppendixs/deleteFilesOss',
+ method: 'post',
+ data: qs.stringify(data),
+ // headers: { 'Content-Type': 'multipart/form-data' }
+ })
+}
diff --git a/supervise-message-ui/src/api/portal/areaPicker.js b/supervise-message-ui/src/api/portal/areaPicker.js
new file mode 100644
index 00000000..8a2eee36
--- /dev/null
+++ b/supervise-message-ui/src/api/portal/areaPicker.js
@@ -0,0 +1,34 @@
+import request from '@/utils/request'
+
+// 获取省/portal/v1/regions/getProvince
+export function getProvince(data) {
+ return request({
+ url: '/portal/v1/regions/getProvince',data,
+ method: 'get',
+ params:data,
+ })
+}
+// 根据省sid获取该省的所有市
+export function getCity(data) {
+ return request({
+ url: '/portal/v1/regions/getCity',
+ params:data,
+ method: 'get',
+ })
+}
+// 根据市sid获取该市的所有县区
+export function getCounty(data) {
+ return request({
+ url: '/portal/v1/regions/getCounty',
+ method: 'get',
+ params:data,
+ })
+}
+// // 区域列表(省市县均可用)
+// export function selectsList(data) {
+// return request({
+// url: '/portal/v1/regions/selectsList', data,
+// method: 'post',
+// headers: { 'Content-Type': 'application/json' }
+// })
+// }
diff --git a/supervise-message-ui/src/components/uploadFile/upload_yanchejianchaTuBiao.vue b/supervise-message-ui/src/components/uploadFile/upload_yanchejianchaTuBiao.vue
index b7c1089a..08b6fffd 100644
--- a/supervise-message-ui/src/components/uploadFile/upload_yanchejianchaTuBiao.vue
+++ b/supervise-message-ui/src/components/uploadFile/upload_yanchejianchaTuBiao.vue
@@ -1,222 +1,247 @@
-
-
+
+
-
+
-
+
\ No newline at end of file
diff --git a/supervise-message-ui/src/router/modules/codemenu.js b/supervise-message-ui/src/router/modules/codemenu.js
index 439aca82..0770c2c4 100644
--- a/supervise-message-ui/src/router/modules/codemenu.js
+++ b/supervise-message-ui/src/router/modules/codemenu.js
@@ -48,5 +48,21 @@ const codemenu = [{
noCache: true
}
}]
+}, {
+ path: '/xxzxydxx',
+ component: Layout,
+ redirect: '/mbxx/index',
+ meta: {
+ title: '模板消息'
+ },
+ children: [{
+ path: '/mbxx/index',
+ component: () => import('@/views/message/mbxx.vue'),
+ name: 'XxzxYdxx',
+ meta: {
+ title: '模板消息',
+ noCache: true
+ }
+ }]
}]
export default codemenu
diff --git a/supervise-message-ui/src/settings.js b/supervise-message-ui/src/settings.js
index 0dc7efda..9f78bf67 100644
--- a/supervise-message-ui/src/settings.js
+++ b/supervise-message-ui/src/settings.js
@@ -1,6 +1,6 @@
module.exports = {
- title: '汇融供应链贷后监管平台
+ title: '汇融供应链贷后监管平台',
/**
* @type {boolean} true | false
diff --git a/supervise-message-ui/src/utils/request.js b/supervise-message-ui/src/utils/request.js
index 12093fa6..41d3f0e9 100644
--- a/supervise-message-ui/src/utils/request.js
+++ b/supervise-message-ui/src/utils/request.js
@@ -1,7 +1,13 @@
import axios from 'axios'
-import { MessageBox, Message } from 'element-ui'
+import {
+ MessageBox,
+ Message
+} from 'element-ui'
import store from '@/store'
-import { getToken, getStorage } from '@/utils/auth'
+import {
+ getToken,
+ getStorage
+} from '@/utils/auth'
// create an axios instance
const service = axios.create({
@@ -49,9 +55,11 @@ service.interceptors.response.use(
* You can also judge the status by HTTP Status Code
*/
response => {
+
const res = response.data
const statusCode = response.status
-
+ console.log("response>>>", response)
+ console.log("response.data>>>", response.data)
// if the custom code is not 20000, it is judged as an error.
if (statusCode !== 200) {
Message({
@@ -62,7 +70,8 @@ service.interceptors.response.use(
})
// 50008: Illegal token; 50012: Other clients logged in; 50014: Token expired;
- if (statusCode === 401 || res.code === '5000' || res.code === 5000 || res.code === 50012 || res.code === 50014) {
+ if (statusCode === 401 || res.code === '5000' || res.code === 5000 || res.code === 50012 || res.code ===
+ 50014) {
// to re-login
MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', {
confirmButtonText: '重新登录',
@@ -100,4 +109,4 @@ service.interceptors.response.use(
}
)
-export default service
+export default service
\ No newline at end of file
diff --git a/supervise-message-ui/src/views/message/mbxx.vue b/supervise-message-ui/src/views/message/mbxx.vue
new file mode 100644
index 00000000..2c50a028
--- /dev/null
+++ b/supervise-message-ui/src/views/message/mbxx.vue
@@ -0,0 +1,261 @@
+
+
+
+
+
+
+
+ {{ searchxianshitit }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 修改
+ 删除
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/supervise-message-ui/src/views/message/mbxxAdd.vue b/supervise-message-ui/src/views/message/mbxxAdd.vue
new file mode 100644
index 00000000..ea856d15
--- /dev/null
+++ b/supervise-message-ui/src/views/message/mbxxAdd.vue
@@ -0,0 +1,310 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ 模板ID:
+
+
+
+
+ 标题:
+
+
+
+
+ 行业:
+
+
+
+
+
详细内容:
+
+
+ {{item.key}}
+ :
+ {{item.value}}
+ 删除
+
+
+
+ :
+
+ 添加
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 是否确认要删除?
+
+
+
+
+
+
+
+
+
+
+
diff --git a/supervise-message-ui/src/views/message/mbxxInfo.vue b/supervise-message-ui/src/views/message/mbxxInfo.vue
new file mode 100644
index 00000000..db5bbdcd
--- /dev/null
+++ b/supervise-message-ui/src/views/message/mbxxInfo.vue
@@ -0,0 +1,288 @@
+
+
+
+
+
+ 姓名 |
+
+
+ |
+
+
+ 员工类型 |
+
+
+
+
+
+ |
+
+
+ 部门 |
+
+
+
+
+
+
+
+ |
+
+
+
+ 手机号码 |
+
+
+ |
+
+
+ 微信号 |
+
+
+ |
+
+
+
+
+ 保 存
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/supervise-message-ui/vue.config.js b/supervise-message-ui/vue.config.js
index 4acce309..68dba461 100644
--- a/supervise-message-ui/vue.config.js
+++ b/supervise-message-ui/vue.config.js
@@ -6,7 +6,7 @@ function resolve(dir) {
return path.join(__dirname, dir)
}
-const name = defaultSettings.title || '汇融供应链贷后监管平台// page title
+const name = defaultSettings.title || '汇融供应链贷后监管平台'// page title
// 如果端口设置为80,
// 使用管理员权限执行命令行。
diff --git a/supervise-monitor-ui/.env.development b/supervise-monitor-ui/.env.development
index da1d55ed..bdfda30b 100644
--- a/supervise-monitor-ui/.env.development
+++ b/supervise-monitor-ui/.env.development
@@ -5,5 +5,5 @@ ENV = 'development'
VUE_APP_BASE_API = '/api'
## 配置测试和本地开发时的 接口地址
-VUE_APP_URL = "http://8.130.39.13:8112"
-##VUE_APP_URL = "http://120.46.172.184:8111"
+##VUE_APP_URL = "http://8.130.39.13:8112"
+VUE_APP_URL = "http://192.168.3.173:8112"
diff --git a/supervise-monitor-ui/.eslintignore b/supervise-monitor-ui/.eslintignore
index e6529fc0..33963bfb 100644
--- a/supervise-monitor-ui/.eslintignore
+++ b/supervise-monitor-ui/.eslintignore
@@ -2,3 +2,4 @@ build/*.js
src/assets
public
dist
+src/*
\ No newline at end of file
diff --git a/supervise-monitor-ui/babel.config.js b/supervise-monitor-ui/babel.config.js
index c9349132..b0ac7d5a 100644
--- a/supervise-monitor-ui/babel.config.js
+++ b/supervise-monitor-ui/babel.config.js
@@ -4,6 +4,7 @@ module.exports = {
// '@vue/cli-plugin-babel/preset',
['@vue/app', { useBuiltIns: 'entry' }]
],
+ "ignore" : ["./src/api/hikvision/webVideoCtrl.js"],
'env': {
'development': {
// babel-plugin-dynamic-import-node plugin only does one thing by converting all import() to require().
diff --git a/supervise-monitor-ui/package.json b/supervise-monitor-ui/package.json
index 8ec1fff3..f0a18357 100644
--- a/supervise-monitor-ui/package.json
+++ b/supervise-monitor-ui/package.json
@@ -33,7 +33,8 @@
"vue-router": "3.0.6",
"vuex": "3.1.0",
"vuex-persistedstate": "^4.0.0",
- "xcrud": "^0.4.19"
+ "xcrud": "^0.4.19",
+ "web-control": "^1.0.2"
},
"devDependencies": {
"@vue/cli-plugin-babel": "4.4.4",
@@ -70,4 +71,4 @@
"npm": ">= 3.0.0"
},
"license": "MIT"
-}
+}
\ No newline at end of file
diff --git a/supervise-monitor-ui/public/WebComponentsKit.exe b/supervise-monitor-ui/public/WebComponentsKit.exe
new file mode 100644
index 00000000..6d22708d
Binary files /dev/null and b/supervise-monitor-ui/public/WebComponentsKit.exe differ
diff --git a/supervise-monitor-ui/src/api/hikvision/demo.js b/supervise-monitor-ui/src/api/hikvision/demo.js
new file mode 100644
index 00000000..724a6c52
--- /dev/null
+++ b/supervise-monitor-ui/src/api/hikvision/demo.js
@@ -0,0 +1,2019 @@
+// 初始化插件
+
+// 全局保存当前选中窗口
+var g_iWndIndex = 0; //可以不用设置这个变量,有窗口参数的接口中,不用传值,开发包会默认使用当前选择窗口
+$(function () {
+ // 检查插件是否已经安装过
+ var iRet = WebVideoCtrl.I_CheckPluginInstall();
+ if (-1 == iRet) {
+ alert("您还未安装过插件,双击开发包目录里的WebComponentsKit.exe安装!");
+ return;
+ }
+
+ // 初始化插件参数及插入插件
+ WebVideoCtrl.I_InitPlugin(500, 300, {
+ bWndFull: true, //是否支持单窗口双击全屏,默认支持 true:支持 false:不支持
+ iPackageType: 2, //2:PS 11:MP4
+ iWndowType: 2,
+ bNoPlugin: true,
+ cbSelWnd: function (xmlDoc) {
+ g_iWndIndex = parseInt($(xmlDoc).find("SelectWnd").eq(0).text(), 10);
+ var szInfo = "当前选择的窗口编号:" + g_iWndIndex;
+ showCBInfo(szInfo);
+ },
+ cbDoubleClickWnd: function (iWndIndex, bFullScreen) {
+ var szInfo = "当前放大的窗口编号:" + iWndIndex;
+ if (!bFullScreen) {
+ szInfo = "当前还原的窗口编号:" + iWndIndex;
+ }
+ showCBInfo(szInfo);
+
+ // 此处可以处理单窗口的码流切换
+ /*if (bFullScreen) {
+ clickStartRealPlay(1);
+ } else {
+ clickStartRealPlay(2);
+ }*/
+ },
+ cbEvent: function (iEventType, iParam1, iParam2) {
+ if (2 == iEventType) {// 回放正常结束
+ showCBInfo("窗口" + iParam1 + "回放结束!");
+ } else if (-1 == iEventType) {
+ showCBInfo("设备" + iParam1 + "网络错误!");
+ } else if (3001 == iEventType) {
+ clickStopRecord(g_szRecordType, iParam1);
+ }
+ },
+ cbRemoteConfig: function () {
+ showCBInfo("关闭远程配置库!");
+ },
+ cbInitPluginComplete: function () {
+ WebVideoCtrl.I_InsertOBJECTPlugin("divPlugin");
+
+ // 检查插件是否最新
+ if (-1 == WebVideoCtrl.I_CheckPluginVersion()) {
+ alert("检测到新的插件版本,双击开发包目录里的WebComponentsKit.exe升级!");
+ return;
+ }
+ }
+ });
+
+ // 窗口事件绑定
+ $(window).bind({
+ resize: function () {
+ var $Restart = $("#restartDiv");
+ if ($Restart.length > 0) {
+ var oSize = getWindowSize();
+ $Restart.css({
+ width: oSize.width + "px",
+ height: oSize.height + "px"
+ });
+ }
+ }
+ });
+
+ //初始化日期时间
+ var szCurTime = dateFormat(new Date(), "yyyy-MM-dd");
+ $("#starttime").val(szCurTime + " 00:00:00");
+ $("#endtime").val(szCurTime + " 23:59:59");
+});
+
+// 显示操作信息
+function showOPInfo(szInfo, status, xmlDoc) {
+ var szTip = "
" + dateFormat(new Date(), "yyyy-MM-dd hh:mm:ss") + " " + szInfo;
+ if (typeof status != "undefined" && status != 200) {
+ var szStatusString = $(xmlDoc).find("statusString").eq(0).text();
+ var szSubStatusCode = $(xmlDoc).find("subStatusCode").eq(0).text();
+ if ("" === szSubStatusCode) {
+ szTip += "(" + status + ", " + szStatusString + ")";
+ } else {
+ szTip += "(" + status + ", " + szSubStatusCode + ")";
+ }
+ }
+ szTip += "
";
+
+ $("#opinfo").html(szTip + $("#opinfo").html());
+}
+
+// 显示回调信息
+function showCBInfo(szInfo) {
+ szInfo = "" + dateFormat(new Date(), "yyyy-MM-dd hh:mm:ss") + " " + szInfo + "
";
+ $("#cbinfo").html(szInfo + $("#cbinfo").html());
+}
+
+// 格式化时间
+function dateFormat(oDate, fmt) {
+ var o = {
+ "M+": oDate.getMonth() + 1, //月份
+ "d+": oDate.getDate(), //日
+ "h+": oDate.getHours(), //小时
+ "m+": oDate.getMinutes(), //分
+ "s+": oDate.getSeconds(), //秒
+ "q+": Math.floor((oDate.getMonth() + 3) / 3), //季度
+ "S": oDate.getMilliseconds()//毫秒
+ };
+ if (/(y+)/.test(fmt)) {
+ fmt = fmt.replace(RegExp.$1, (oDate.getFullYear() + "").substr(4 - RegExp.$1.length));
+ }
+ for (var k in o) {
+ if (new RegExp("(" + k + ")").test(fmt)) {
+ fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
+ }
+ }
+ return fmt;
+}
+
+// 获取窗口尺寸
+function getWindowSize() {
+ var nWidth = $(this).width() + $(this).scrollLeft(),
+ nHeight = $(this).height() + $(this).scrollTop();
+
+ return {width: nWidth, height: nHeight};
+}
+
+// 打开选择框 0:文件夹 1:文件
+function clickOpenFileDlg(id, iType) {
+ var szDirPath = WebVideoCtrl.I_OpenFileDlg(iType);
+
+ if (szDirPath != -1 && szDirPath != "" && szDirPath != null) {
+ $("#" + id).val(szDirPath);
+ }
+}
+
+// 获取本地参数
+function clickGetLocalCfg() {
+ var xmlDoc = WebVideoCtrl.I_GetLocalCfg();
+
+ if (xmlDoc != null) {
+ $("#netsPreach").val($(xmlDoc).find("BuffNumberType").eq(0).text());
+ $("#wndSize").val($(xmlDoc).find("PlayWndType").eq(0).text());
+ $("#rulesInfo").val($(xmlDoc).find("IVSMode").eq(0).text());
+ $("#captureFileFormat").val($(xmlDoc).find("CaptureFileFormat").eq(0).text());
+ $("#packSize").val($(xmlDoc).find("PackgeSize").eq(0).text());
+ $("#recordPath").val($(xmlDoc).find("RecordPath").eq(0).text());
+ $("#downloadPath").val($(xmlDoc).find("DownloadPath").eq(0).text());
+ $("#previewPicPath").val($(xmlDoc).find("CapturePath").eq(0).text());
+ $("#playbackPicPath").val($(xmlDoc).find("PlaybackPicPath").eq(0).text());
+ $("#devicePicPath").val($(xmlDoc).find("DeviceCapturePath").eq(0).text());
+ $("#playbackFilePath").val($(xmlDoc).find("PlaybackFilePath").eq(0).text());
+ $("#protocolType").val($(xmlDoc).find("ProtocolType").eq(0).text());
+
+ showOPInfo("本地配置获取成功!");
+ } else {
+ showOPInfo("本地配置获取失败!");
+ }
+}
+
+// 设置本地参数
+function clickSetLocalCfg() {
+ var arrXml = [],
+ szInfo = "";
+
+ arrXml.push("");
+ arrXml.push("" + $("#packSize").val() + "");
+ arrXml.push("" + $("#wndSize").val() + "");
+ arrXml.push("" + $("#netsPreach").val() + "");
+ arrXml.push("" + $("#recordPath").val() + "");
+ arrXml.push("" + $("#previewPicPath").val() + "");
+ arrXml.push("" + $("#playbackFilePath").val() + "");
+ arrXml.push("" + $("#playbackPicPath").val() + "");
+ arrXml.push("" + $("#devicePicPath").val() + "");
+ arrXml.push("" + $("#downloadPath").val() + "");
+ arrXml.push("" + $("#rulesInfo").val() + "");
+ arrXml.push("" + $("#captureFileFormat").val() + "");
+ arrXml.push("" + $("#protocolType").val() + "");
+ arrXml.push("");
+
+ var iRet = WebVideoCtrl.I_SetLocalCfg(arrXml.join(""));
+
+ if (0 == iRet) {
+ szInfo = "本地配置设置成功!";
+ } else {
+ szInfo = "本地配置设置失败!";
+ }
+ showOPInfo(szInfo);
+}
+
+// 窗口分割数
+function changeWndNum(iType) {
+ iType = parseInt(iType, 10);
+ WebVideoCtrl.I_ChangeWndNum(iType);
+}
+
+// 登录
+function clickLogin() {
+ var szIP = $("#loginip").val(),
+ szPort = $("#port").val(),
+ szUsername = $("#username").val(),
+ szPassword = $("#password").val();
+
+ if ("" == szIP || "" == szPort) {
+ return;
+ }
+
+ var szDeviceIdentify = szIP + "_" + szPort;
+
+ var iRet = WebVideoCtrl.I_Login(szIP, 1, szPort, szUsername, szPassword, {
+ success: function (xmlDoc) {
+ showOPInfo(szDeviceIdentify + " 登录成功!");
+
+ $("#ip").prepend("");
+ setTimeout(function () {
+ $("#ip").val(szDeviceIdentify);
+ getChannelInfo();
+ getDevicePort();
+ }, 10);
+ },
+ error: function (status, xmlDoc) {
+ showOPInfo(szDeviceIdentify + " 登录失败!", status, xmlDoc);
+ }
+ });
+
+ if (-1 == iRet) {
+ showOPInfo(szDeviceIdentify + " 已登录过!");
+ }
+}
+
+// 退出
+function clickLogout() {
+ var szDeviceIdentify = $("#ip").val(),
+ szInfo = "";
+
+ if (null == szDeviceIdentify) {
+ return;
+ }
+
+ var iRet = WebVideoCtrl.I_Logout(szDeviceIdentify);
+ if (0 == iRet) {
+ szInfo = "退出成功!";
+
+ $("#ip option[value='" + szDeviceIdentify + "']").remove();
+ getChannelInfo();
+ getDevicePort();
+ } else {
+ szInfo = "退出失败!";
+ }
+ showOPInfo(szDeviceIdentify + " " + szInfo);
+}
+
+// 获取设备信息
+function clickGetDeviceInfo() {
+ var szDeviceIdentify = $("#ip").val();
+
+ if (null == szDeviceIdentify) {
+ return;
+ }
+
+ WebVideoCtrl.I_GetDeviceInfo(szDeviceIdentify, {
+ success: function (xmlDoc) {
+ var arrStr = [];
+ arrStr.push("设备名称:" + $(xmlDoc).find("deviceName").eq(0).text() + "\r\n");
+ arrStr.push("设备ID:" + $(xmlDoc).find("deviceID").eq(0).text() + "\r\n");
+ arrStr.push("型号:" + $(xmlDoc).find("model").eq(0).text() + "\r\n");
+ arrStr.push("设备序列号:" + $(xmlDoc).find("serialNumber").eq(0).text() + "\r\n");
+ arrStr.push("MAC地址:" + $(xmlDoc).find("macAddress").eq(0).text() + "\r\n");
+ arrStr.push("主控版本:" + $(xmlDoc).find("firmwareVersion").eq(0).text() + " " + $(xmlDoc).find("firmwareReleasedDate").eq(0).text() + "\r\n");
+ arrStr.push("编码版本:" + $(xmlDoc).find("encoderVersion").eq(0).text() + " " + $(xmlDoc).find("encoderReleasedDate").eq(0).text() + "\r\n");
+
+ showOPInfo(szDeviceIdentify + " 获取设备信息成功!");
+ alert(arrStr.join(""));
+ },
+ error: function (status, xmlDoc) {
+ showOPInfo(szDeviceIdentify + " 获取设备信息失败!", status, xmlDoc);
+ }
+ });
+}
+
+// 获取通道
+function getChannelInfo() {
+ var szDeviceIdentify = $("#ip").val(),
+ oSel = $("#channels").empty();
+
+ if (null == szDeviceIdentify) {
+ return;
+ }
+
+ // 模拟通道
+ WebVideoCtrl.I_GetAnalogChannelInfo(szDeviceIdentify, {
+ async: false,
+ success: function (xmlDoc) {
+ var oChannels = $(xmlDoc).find("VideoInputChannel");
+
+ $.each(oChannels, function (i) {
+ var id = $(this).find("id").eq(0).text(),
+ name = $(this).find("name").eq(0).text();
+ if ("" == name) {
+ name = "Camera " + (i < 9 ? "0" + (i + 1) : (i + 1));
+ }
+ oSel.append("");
+ });
+ showOPInfo(szDeviceIdentify + " 获取模拟通道成功!");
+ },
+ error: function (status, xmlDoc) {
+ showOPInfo(szDeviceIdentify + " 获取模拟通道失败!", status, xmlDoc);
+ }
+ });
+ // 数字通道
+ WebVideoCtrl.I_GetDigitalChannelInfo(szDeviceIdentify, {
+ async: false,
+ success: function (xmlDoc) {
+ var oChannels = $(xmlDoc).find("InputProxyChannelStatus");
+
+ $.each(oChannels, function (i) {
+ var id = $(this).find("id").eq(0).text(),
+ name = $(this).find("name").eq(0).text(),
+ online = $(this).find("online").eq(0).text();
+ if ("false" == online) {// 过滤禁用的数字通道
+ return true;
+ }
+ if ("" == name) {
+ name = "IPCamera " + (i < 9 ? "0" + (i + 1) : (i + 1));
+ }
+ oSel.append("");
+ });
+ showOPInfo(szDeviceIdentify + " 获取数字通道成功!");
+ },
+ error: function (status, xmlDoc) {
+ showOPInfo(szDeviceIdentify + " 获取数字通道失败!", status, xmlDoc);
+ }
+ });
+ // 零通道
+ WebVideoCtrl.I_GetZeroChannelInfo(szDeviceIdentify, {
+ async: false,
+ success: function (xmlDoc) {
+ var oChannels = $(xmlDoc).find("ZeroVideoChannel");
+
+ $.each(oChannels, function (i) {
+ var id = $(this).find("id").eq(0).text(),
+ name = $(this).find("name").eq(0).text();
+ if ("" == name) {
+ name = "Zero Channel " + (i < 9 ? "0" + (i + 1) : (i + 1));
+ }
+ if ("true" == $(this).find("enabled").eq(0).text()) {// 过滤禁用的零通道
+ oSel.append("");
+ }
+ });
+ showOPInfo(szDeviceIdentify + " 获取零通道成功!");
+ },
+ error: function (status, xmlDoc) {
+ showOPInfo(szDeviceIdentify + " 获取零通道失败!", status, xmlDoc);
+ }
+ });
+}
+
+// 获取端口
+function getDevicePort() {
+ var szDeviceIdentify = $("#ip").val();
+
+ if (null == szDeviceIdentify) {
+ return;
+ }
+
+ var oPort = WebVideoCtrl.I_GetDevicePort(szDeviceIdentify);
+ if (oPort != null) {
+ $("#deviceport").val(oPort.iDevicePort);
+ $("#rtspport").val(oPort.iRtspPort);
+
+ showOPInfo(szDeviceIdentify + " 获取端口成功!");
+ } else {
+ showOPInfo(szDeviceIdentify + " 获取端口失败!");
+ }
+}
+
+// 获取数字通道
+function clickGetDigitalChannelInfo() {
+ var szDeviceIdentify = $("#ip").val(),
+ iAnalogChannelNum = 0;
+
+ $("#digitalchannellist").empty();
+
+ if (null == szDeviceIdentify) {
+ return;
+ }
+
+ // 模拟通道
+ WebVideoCtrl.I_GetAnalogChannelInfo(szDeviceIdentify, {
+ async: false,
+ success: function (xmlDoc) {
+ iAnalogChannelNum = $(xmlDoc).find("VideoInputChannel").length;
+ },
+ error: function () {
+
+ }
+ });
+
+ // 数字通道
+ WebVideoCtrl.I_GetDigitalChannelInfo(szDeviceIdentify, {
+ async: false,
+ success: function (xmlDoc) {
+ var oChannels = $(xmlDoc).find("InputProxyChannelStatus");
+
+ $.each(oChannels, function () {
+ var id = parseInt($(this).find("id").eq(0).text(), 10),
+ ipAddress = $(this).find("ipAddress").eq(0).text(),
+ srcInputPort = $(this).find("srcInputPort").eq(0).text(),
+ managePortNo = $(this).find("managePortNo").eq(0).text(),
+ online = $(this).find("online").eq(0).text(),
+ proxyProtocol = $(this).find("proxyProtocol").eq(0).text();
+
+ var objTr = $("#digitalchannellist").get(0).insertRow(-1);
+ var objTd = objTr.insertCell(0);
+ objTd.innerHTML = (id - iAnalogChannelNum) < 10 ? "D0" + (id - iAnalogChannelNum) : "D" + (id - iAnalogChannelNum);
+ objTd = objTr.insertCell(1);
+ objTd.width = "25%";
+ objTd.innerHTML = ipAddress;
+ objTd = objTr.insertCell(2);
+ objTd.width = "15%";
+ objTd.innerHTML = srcInputPort;
+ objTd = objTr.insertCell(3);
+ objTd.width = "20%";
+ objTd.innerHTML = managePortNo;
+ objTd = objTr.insertCell(4);
+ objTd.width = "15%";
+ objTd.innerHTML = "true" == online ? "在线" : "离线";
+ objTd = objTr.insertCell(5);
+ objTd.width = "25%";
+ objTd.innerHTML = proxyProtocol;
+ });
+ showOPInfo(szDeviceIdentify + " 获取数字通道成功!");
+ },
+ error: function (status, xmlDoc) {
+ showOPInfo(szDeviceIdentify + " 没有数字通道!", status, xmlDoc);
+ }
+ });
+}
+
+// 开始预览
+function clickStartRealPlay(iStreamType) {
+ var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex),
+ szDeviceIdentify = $("#ip").val(),
+ iRtspPort = parseInt($("#rtspport").val(), 10),
+ iChannelID = parseInt($("#channels").val(), 10),
+ bZeroChannel = $("#channels option").eq($("#channels").get(0).selectedIndex).attr("bZero") == "true" ? true : false,
+ szInfo = "";
+
+ if ("undefined" === typeof iStreamType) {
+ iStreamType = parseInt($("#streamtype").val(), 10);
+ }
+
+ if (null == szDeviceIdentify) {
+ return;
+ }
+
+ var startRealPlay = function () {
+ WebVideoCtrl.I_StartRealPlay(szDeviceIdentify, {
+ iRtspPort: iRtspPort,
+ iStreamType: iStreamType,
+ iChannelID: iChannelID,
+ bZeroChannel: bZeroChannel,
+ success: function () {
+ szInfo = "开始预览成功!";
+ showOPInfo(szDeviceIdentify + " " + szInfo);
+ },
+ error: function (status, xmlDoc) {
+ if (403 === status) {
+ szInfo = "设备不支持Websocket取流!";
+ } else {
+ szInfo = "开始预览失败!";
+ }
+ showOPInfo(szDeviceIdentify + " " + szInfo);
+ }
+ });
+ };
+
+ if (oWndInfo != null) {// 已经在播放了,先停止
+ WebVideoCtrl.I_Stop({
+ success: function () {
+ startRealPlay();
+ }
+ });
+ } else {
+ startRealPlay();
+ }
+}
+
+// 停止预览
+function clickStopRealPlay() {
+ var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex),
+ szInfo = "";
+
+ if (oWndInfo != null) {
+ WebVideoCtrl.I_Stop({
+ success: function () {
+ szInfo = "停止预览成功!";
+ showOPInfo(oWndInfo.szDeviceIdentify + " " + szInfo);
+ },
+ error: function () {
+ szInfo = "停止预览失败!";
+ showOPInfo(oWndInfo.szDeviceIdentify + " " + szInfo);
+ }
+ });
+ }
+}
+
+// 打开声音
+function clickOpenSound() {
+ var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex),
+ szInfo = "";
+
+ if (oWndInfo != null) {
+ var allWndInfo = WebVideoCtrl.I_GetWindowStatus();
+ // 循环遍历所有窗口,如果有窗口打开了声音,先关闭
+ for (var i = 0, iLen = allWndInfo.length; i < iLen; i++) {
+ oWndInfo = allWndInfo[i];
+ if (oWndInfo.bSound) {
+ WebVideoCtrl.I_CloseSound(oWndInfo.iIndex);
+ break;
+ }
+ }
+
+ var iRet = WebVideoCtrl.I_OpenSound();
+
+ if (0 == iRet) {
+ szInfo = "打开声音成功!";
+ } else {
+ szInfo = "打开声音失败!";
+ }
+ showOPInfo(oWndInfo.szDeviceIdentify + " " + szInfo);
+ }
+}
+
+// 关闭声音
+function clickCloseSound() {
+ var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex),
+ szInfo = "";
+
+ if (oWndInfo != null) {
+ var iRet = WebVideoCtrl.I_CloseSound();
+ if (0 == iRet) {
+ szInfo = "关闭声音成功!";
+ } else {
+ szInfo = "关闭声音失败!";
+ }
+ showOPInfo(oWndInfo.szDeviceIdentify + " " + szInfo);
+ }
+}
+
+// 设置音量
+function clickSetVolume() {
+ var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex),
+ iVolume = parseInt($("#volume").val(), 10),
+ szInfo = "";
+
+ if (oWndInfo != null) {
+ var iRet = WebVideoCtrl.I_SetVolume(iVolume);
+ if (0 == iRet) {
+ szInfo = "音量设置成功!";
+ } else {
+ szInfo = "音量设置失败!";
+ }
+ showOPInfo(oWndInfo.szDeviceIdentify + " " + szInfo);
+ }
+}
+
+// 抓图
+function clickCapturePic() {
+ var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex),
+ szInfo = "";
+
+ if (oWndInfo != null) {
+ var xmlDoc = WebVideoCtrl.I_GetLocalCfg();
+ var szCaptureFileFormat = "0";
+ if (xmlDoc != null) {
+ szCaptureFileFormat = $(xmlDoc).find("CaptureFileFormat").eq(0).text();
+ }
+
+ var szChannelID = $("#channels").val();
+ var szPicName = oWndInfo.szDeviceIdentify + "_" + szChannelID + "_" + new Date().getTime();
+
+ szPicName += ("0" === szCaptureFileFormat) ? ".jpg": ".bmp";
+
+ var iRet = WebVideoCtrl.I_CapturePic(szPicName, {
+ bDateDir: true //是否生成日期文件
+ });
+ if (0 == iRet) {
+ szInfo = "抓图成功!";
+ } else {
+ szInfo = "抓图失败!";
+ }
+ showOPInfo(oWndInfo.szDeviceIdentify + " " + szInfo);
+ }
+}
+
+// 开始录像
+var g_szRecordType = "";
+function clickStartRecord(szType) {
+ var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex),
+ szInfo = "";
+
+ g_szRecordType = szType;
+
+ if (oWndInfo != null) {
+ var szChannelID = $("#channels").val(),
+ szFileName = oWndInfo.szDeviceIdentify + "_" + szChannelID + "_" + new Date().getTime();
+
+ WebVideoCtrl.I_StartRecord(szFileName, {
+ bDateDir: true, //是否生成日期文件
+ success: function () {
+ if ('realplay' === szType) {
+ szInfo = "开始录像成功!";
+ } else if ('playback' === szType) {
+ szInfo = "开始剪辑成功!";
+ }
+ showOPInfo(oWndInfo.szDeviceIdentify + " " + szInfo);
+ },
+ error: function () {
+ if ('realplay' === szType) {
+ szInfo = "开始录像失败!";
+ } else if ('playback' === szType) {
+ szInfo = "开始剪辑失败!";
+ }
+ showOPInfo(oWndInfo.szDeviceIdentify + " " + szInfo);
+ }
+ });
+ }
+}
+
+// 停止录像
+function clickStopRecord(szType, iWndIndex) {
+ if ("undefined" === typeof iWndIndex) {
+ iWndIndex = g_iWndIndex;
+ }
+ var oWndInfo = WebVideoCtrl.I_GetWindowStatus(iWndIndex),
+ szInfo = "";
+
+ if (oWndInfo != null) {
+ WebVideoCtrl.I_StopRecord({
+ success: function () {
+ if ('realplay' === szType) {
+ szInfo = "停止录像成功!";
+ } else if ('playback' === szType) {
+ szInfo = "停止剪辑成功!";
+ }
+ showOPInfo(oWndInfo.szDeviceIdentify + " " + szInfo);
+ },
+ error: function () {
+ if ('realplay' === szType) {
+ szInfo = "停止录像失败!";
+ } else if ('playback' === szType) {
+ szInfo = "停止剪辑失败!";
+ }
+ showOPInfo(oWndInfo.szDeviceIdentify + " " + szInfo);
+ }
+ });
+ }
+}
+
+// 获取对讲通道
+function clickGetAudioInfo() {
+ var szDeviceIdentify = $("#ip").val();
+
+ if (null == szDeviceIdentify) {
+ return;
+ }
+
+ WebVideoCtrl.I_GetAudioInfo(szDeviceIdentify, {
+ success: function (xmlDoc) {
+ var oAudioChannels = $(xmlDoc).find("TwoWayAudioChannel"),
+ oSel = $("#audiochannels").empty();
+ $.each(oAudioChannels, function () {
+ var id = $(this).find("id").eq(0).text();
+
+ oSel.append("");
+ });
+ showOPInfo(szDeviceIdentify + " 获取对讲通道成功!");
+ },
+ error: function (status, xmlDoc) {
+ showOPInfo(szDeviceIdentify + " 获取对讲通道失败!", status, xmlDoc);
+ }
+ });
+}
+
+// 开始对讲
+function clickStartVoiceTalk() {
+ var szDeviceIdentify = $("#ip").val(),
+ iAudioChannel = parseInt($("#audiochannels").val(), 10),
+ szInfo = "";
+
+ if (null == szDeviceIdentify) {
+ return;
+ }
+
+ if (isNaN(iAudioChannel)) {
+ alert("请选择对讲通道!");
+ return;
+ }
+
+ var iRet = WebVideoCtrl.I_StartVoiceTalk(szDeviceIdentify, iAudioChannel);
+
+ if (0 == iRet) {
+ szInfo = "开始对讲成功!";
+ } else {
+ szInfo = "开始对讲失败!";
+ }
+ showOPInfo(szDeviceIdentify + " " + szInfo);
+}
+
+// 停止对讲
+function clickStopVoiceTalk() {
+ var szDeviceIdentify = $("#ip").val(),
+ iRet = WebVideoCtrl.I_StopVoiceTalk(),
+ szInfo = "";
+
+ if (null == szDeviceIdentify) {
+ return;
+ }
+
+ if (0 == iRet) {
+ szInfo = "停止对讲成功!";
+ } else {
+ szInfo = "停止对讲失败!";
+ }
+ showOPInfo(szDeviceIdentify + " " + szInfo);
+}
+
+// 启用电子放大
+function clickEnableEZoom() {
+ var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex),
+ szInfo = "";
+
+ if (oWndInfo != null) {
+ var iRet = WebVideoCtrl.I_EnableEZoom();
+ if (0 == iRet) {
+ szInfo = "启用电子放大成功!";
+ } else {
+ szInfo = "启用电子放大失败!";
+ }
+ showOPInfo(oWndInfo.szDeviceIdentify + " " + szInfo);
+ }
+}
+
+// 禁用电子放大
+function clickDisableEZoom() {
+ var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex),
+ szInfo = "";
+
+ if (oWndInfo != null) {
+ var iRet = WebVideoCtrl.I_DisableEZoom();
+ if (0 == iRet) {
+ szInfo = "禁用电子放大成功!";
+ } else {
+ szInfo = "禁用电子放大失败!";
+ }
+ showOPInfo(oWndInfo.szDeviceIdentify + " " + szInfo);
+ }
+}
+
+// 启用3D放大
+function clickEnable3DZoom() {
+ var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex),
+ szInfo = "";
+
+ if (oWndInfo != null) {
+ var iRet = WebVideoCtrl.I_Enable3DZoom();
+ if (0 == iRet) {
+ szInfo = "启用3D放大成功!";
+ } else {
+ szInfo = "启用3D放大失败!";
+ }
+ showOPInfo(oWndInfo.szDeviceIdentify + " " + szInfo);
+ }
+}
+
+// 禁用3D放大
+function clickDisable3DZoom() {
+ var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex),
+ szInfo = "";
+
+ if (oWndInfo != null) {
+ var iRet = WebVideoCtrl.I_Disable3DZoom();
+ if (0 == iRet) {
+ szInfo = "禁用3D放大成功!";
+ } else {
+ szInfo = "禁用3D放大失败!";
+ }
+ showOPInfo(oWndInfo.szDeviceIdentify + " " + szInfo);
+ }
+}
+
+// 全屏
+function clickFullScreen() {
+ WebVideoCtrl.I_FullScreen(true);
+}
+
+// PTZ控制 9为自动,1,2,3,4,5,6,7,8为方向PTZ
+var g_bPTZAuto = false;
+function mouseDownPTZControl(iPTZIndex) {
+ var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex),
+ bZeroChannel = $("#channels option").eq($("#channels").get(0).selectedIndex).attr("bZero") == "true" ? true : false,
+ iPTZSpeed = $("#ptzspeed").val();
+
+ if (bZeroChannel) {// 零通道不支持云台
+ return;
+ }
+
+ if (oWndInfo != null) {
+ if (9 == iPTZIndex && g_bPTZAuto) {
+ iPTZSpeed = 0;// 自动开启后,速度置为0可以关闭自动
+ } else {
+ g_bPTZAuto = false;// 点击其他方向,自动肯定会被关闭
+ }
+
+ WebVideoCtrl.I_PTZControl(iPTZIndex, false, {
+ iPTZSpeed: iPTZSpeed,
+ success: function (xmlDoc) {
+ if (9 == iPTZIndex && g_bPTZAuto) {
+ showOPInfo(oWndInfo.szDeviceIdentify + " 停止云台成功!");
+ } else {
+ showOPInfo(oWndInfo.szDeviceIdentify + " 开启云台成功!");
+ }
+ if (9 == iPTZIndex) {
+ g_bPTZAuto = !g_bPTZAuto;
+ }
+ },
+ error: function (status, xmlDoc) {
+ showOPInfo(oWndInfo.szDeviceIdentify + " 开启云台失败!", status, xmlDoc);
+ }
+ });
+ }
+}
+
+// 方向PTZ停止
+function mouseUpPTZControl() {
+ var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex);
+
+ if (oWndInfo != null) {
+ WebVideoCtrl.I_PTZControl(1, true, {
+ success: function (xmlDoc) {
+ showOPInfo(oWndInfo.szDeviceIdentify + " 停止云台成功!");
+ },
+ error: function (status, xmlDoc) {
+ showOPInfo(oWndInfo.szDeviceIdentify + " 停止云台失败!", status, xmlDoc);
+ }
+ });
+ }
+}
+
+// 设置预置点
+function clickSetPreset() {
+ var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex),
+ iPresetID = parseInt($("#preset").val(), 10);
+
+ if (oWndInfo != null) {
+ WebVideoCtrl.I_SetPreset(iPresetID, {
+ success: function (xmlDoc) {
+ showOPInfo(oWndInfo.szDeviceIdentify + " 设置预置点成功!");
+ },
+ error: function (status, xmlDoc) {
+ showOPInfo(oWndInfo.szDeviceIdentify + " 设置预置点失败!", status, xmlDoc);
+ }
+ });
+ }
+}
+
+// 调用预置点
+function clickGoPreset() {
+ var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex),
+ iPresetID = parseInt($("#preset").val(), 10);
+
+ if (oWndInfo != null) {
+ WebVideoCtrl.I_GoPreset(iPresetID, {
+ success: function (xmlDoc) {
+ showOPInfo(oWndInfo.szDeviceIdentify + " 调用预置点成功!");
+ },
+ error: function (status, xmlDoc) {
+ showOPInfo(oWndInfo.szDeviceIdentify + " 调用预置点失败!", status, xmlDoc);
+ }
+ });
+ }
+}
+
+// 搜索录像
+var g_iSearchTimes = 0;
+function clickRecordSearch(iType) {
+ var szDeviceIdentify = $("#ip").val(),
+ iChannelID = parseInt($("#channels").val(), 10),
+ bZeroChannel = $("#channels option").eq($("#channels").get(0).selectedIndex).attr("bZero") == "true" ? true : false,
+ iStreamType = parseInt($("#record_streamtype").val(), 10),
+ szStartTime = $("#starttime").val(),
+ szEndTime = $("#endtime").val();
+
+ if (null == szDeviceIdentify) {
+ return;
+ }
+
+ if (bZeroChannel) {// 零通道不支持录像搜索
+ return;
+ }
+
+ if (0 == iType) {// 首次搜索
+ $("#searchlist").empty();
+ g_iSearchTimes = 0;
+ }
+
+ WebVideoCtrl.I_RecordSearch(szDeviceIdentify, iChannelID, szStartTime, szEndTime, {
+ iStreamType: iStreamType,
+ iSearchPos: g_iSearchTimes * 40,
+ success: function (xmlDoc) {
+ if ("MORE" === $(xmlDoc).find("responseStatusStrg").eq(0).text()) {
+
+ for(var i = 0, nLen = $(xmlDoc).find("searchMatchItem").length; i < nLen; i++) {
+ var szPlaybackURI = $(xmlDoc).find("playbackURI").eq(i).text();
+ if(szPlaybackURI.indexOf("name=") < 0) {
+ break;
+ }
+ var szStartTime = $(xmlDoc).find("startTime").eq(i).text();
+ var szEndTime = $(xmlDoc).find("endTime").eq(i).text();
+ var szFileName = szPlaybackURI.substring(szPlaybackURI.indexOf("name=") + 5, szPlaybackURI.indexOf("&size="));
+
+ var objTr = $("#searchlist").get(0).insertRow(-1);
+ var objTd = objTr.insertCell(0);
+ objTd.id = "downloadTd" + i;
+ objTd.innerHTML = g_iSearchTimes * 40 + (i + 1);
+ objTd = objTr.insertCell(1);
+ objTd.width = "30%";
+ objTd.innerHTML = szFileName;
+ objTd = objTr.insertCell(2);
+ objTd.width = "30%";
+ objTd.innerHTML = (szStartTime.replace("T", " ")).replace("Z", "");
+ objTd = objTr.insertCell(3);
+ objTd.width = "30%";
+ objTd.innerHTML = (szEndTime.replace("T", " ")).replace("Z", "");
+ objTd = objTr.insertCell(4);
+ objTd.width = "10%";
+ objTd.innerHTML = "下载";
+ $("#downloadTd" + (i + g_iSearchTimes * 40)).data("fileName", szFileName);
+ $("#downloadTd" + (i + g_iSearchTimes * 40)).data("playbackURI", szPlaybackURI);
+ }
+
+ g_iSearchTimes++;
+ clickRecordSearch(1);// 继续搜索
+ } else if ("OK" === $(xmlDoc).find("responseStatusStrg").eq(0).text()) {
+ var iLength = $(xmlDoc).find("searchMatchItem").length;
+ for(var i = 0; i < iLength; i++) {
+ var szPlaybackURI = $(xmlDoc).find("playbackURI").eq(i).text();
+ if(szPlaybackURI.indexOf("name=") < 0) {
+ break;
+ }
+ var szStartTime = $(xmlDoc).find("startTime").eq(i).text();
+ var szEndTime = $(xmlDoc).find("endTime").eq(i).text();
+ var szFileName = szPlaybackURI.substring(szPlaybackURI.indexOf("name=") + 5, szPlaybackURI.indexOf("&size="));
+
+ var objTr = $("#searchlist").get(0).insertRow(-1);
+ var objTd = objTr.insertCell(0);
+ objTd.id = "downloadTd" + i;
+ objTd.innerHTML = g_iSearchTimes * 40 + (i + 1);
+ objTd = objTr.insertCell(1);
+ objTd.width = "30%";
+ objTd.innerHTML = szFileName;
+ objTd = objTr.insertCell(2);
+ objTd.width = "30%";
+ objTd.innerHTML = (szStartTime.replace("T", " ")).replace("Z", "");
+ objTd = objTr.insertCell(3);
+ objTd.width = "30%";
+ objTd.innerHTML = (szEndTime.replace("T", " ")).replace("Z", "");
+ objTd = objTr.insertCell(4);
+ objTd.width = "10%";
+ objTd.innerHTML = "下载";
+ $("#downloadTd" + (i + g_iSearchTimes * 40)).data("fileName", szFileName);
+ $("#downloadTd" + (i + g_iSearchTimes * 40)).data("playbackURI", szPlaybackURI);
+ }
+ showOPInfo(szDeviceIdentify + " 搜索录像文件成功!");
+ } else if("NO MATCHES" === $(xmlDoc).find("responseStatusStrg").eq(0).text()) {
+ setTimeout(function() {
+ showOPInfo(szDeviceIdentify + " 没有录像文件!");
+ }, 50);
+ }
+ },
+ error: function (status, xmlDoc) {
+ showOPInfo(szDeviceIdentify + " 搜索录像文件失败!", status, xmlDoc);
+ }
+ });
+}
+
+// 开始回放
+function clickStartPlayback() {
+ var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex),
+ szDeviceIdentify = $("#ip").val(),
+ iRtspPort = parseInt($("#rtspport").val(), 10),
+ iStreamType = parseInt($("#record_streamtype").val(), 10),
+ bZeroChannel = $("#channels option").eq($("#channels").get(0).selectedIndex).attr("bZero") == "true" ? true : false,
+ iChannelID = parseInt($("#channels").val(), 10),
+ szStartTime = $("#starttime").val(),
+ szEndTime = $("#endtime").val(),
+ szInfo = "",
+ bChecked = $("#transstream").prop("checked"),
+ iRet = -1;
+
+ if (null == szDeviceIdentify) {
+ return;
+ }
+
+ if (bZeroChannel) {// 零通道不支持回放
+ return;
+ }
+
+ var startPlayback = function () {
+ if (bChecked) {// 启用转码回放
+ var oTransCodeParam = {
+ TransFrameRate: "14",// 0:全帧率,5:1,6:2,7:4,8:6,9:8,10:10,11:12,12:16,14:15,15:18,13:20,16:22
+ TransResolution: "1",// 255:Auto,3:4CIF,2:QCIF,1:CIF
+ TransBitrate: "19"// 2:32K,3:48K,4:64K,5:80K,6:96K,7:128K,8:160K,9:192K,10:224K,11:256K,12:320K,13:384K,14:448K,15:512K,16:640K,17:768K,18:896K,19:1024K,20:1280K,21:1536K,22:1792K,23:2048K,24:3072K,25:4096K,26:8192K
+ };
+ WebVideoCtrl.I_StartPlayback(szDeviceIdentify, {
+ iRtspPort: iRtspPort,
+ iStreamType: iStreamType,
+ iChannelID: iChannelID,
+ szStartTime: szStartTime,
+ szEndTime: szEndTime,
+ oTransCodeParam: oTransCodeParam,
+ success: function () {
+ szInfo = "开始回放成功!";
+ showOPInfo(szDeviceIdentify + " " + szInfo);
+ },
+ error: function (status, xmlDoc) {
+ if (403 === status) {
+ szInfo = "设备不支持Websocket取流!";
+ } else {
+ szInfo = "开始回放失败!";
+ }
+ showOPInfo(szDeviceIdentify + " " + szInfo);
+ }
+ });
+ } else {
+ WebVideoCtrl.I_StartPlayback(szDeviceIdentify, {
+ iRtspPort: iRtspPort,
+ iStreamType: iStreamType,
+ iChannelID: iChannelID,
+ szStartTime: szStartTime,
+ szEndTime: szEndTime,
+ success: function () {
+ szInfo = "开始回放成功!";
+ showOPInfo(szDeviceIdentify + " " + szInfo);
+ },
+ error: function (status, xmlDoc) {
+ if (403 === status) {
+ szInfo = "设备不支持Websocket取流!";
+ } else {
+ szInfo = "开始回放失败!";
+ }
+ showOPInfo(szDeviceIdentify + " " + szInfo);
+ }
+ });
+ }
+ };
+
+ if (oWndInfo != null) {// 已经在播放了,先停止
+ WebVideoCtrl.I_Stop({
+ success: function () {
+ startPlayback();
+ }
+ });
+ } else {
+ startPlayback();
+ }
+}
+
+// 停止回放
+function clickStopPlayback() {
+ var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex),
+ szInfo = "";
+
+ if (oWndInfo != null) {
+ WebVideoCtrl.I_Stop({
+ success: function () {
+ szInfo = "停止回放成功!";
+ showOPInfo(oWndInfo.szDeviceIdentify + " " + szInfo);
+ },
+ error: function () {
+ szInfo = "停止回放失败!";
+ showOPInfo(oWndInfo.szDeviceIdentify + " " + szInfo);
+ }
+ });
+ }
+}
+
+// 开始倒放
+function clickReversePlayback() {
+ var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex),
+ szDeviceIdentify = $("#ip").val(),
+ iRtspPort = parseInt($("#rtspport").val(), 10),
+ iStreamType = parseInt($("#record_streamtype").val(), 10),
+ bZeroChannel = $("#channels option").eq($("#channels").get(0).selectedIndex).attr("bZero") == "true" ? true : false,
+ iChannelID = parseInt($("#channels").val(), 10),
+ szStartTime = $("#starttime").val(),
+ szEndTime = $("#endtime").val(),
+ szInfo = "";
+
+ if (null == szDeviceIdentify) {
+ return;
+ }
+
+ if (bZeroChannel) {// 零通道不支持倒放
+ return;
+ }
+
+ var reversePlayback = function () {
+ var iRet = WebVideoCtrl.I_ReversePlayback(szDeviceIdentify, {
+ iRtspPort: iRtspPort,
+ iStreamType: iStreamType,
+ iChannelID: iChannelID,
+ szStartTime: szStartTime,
+ szEndTime: szEndTime
+ });
+
+ if (0 == iRet) {
+ szInfo = "开始倒放成功!";
+ } else {
+ szInfo = "开始倒放失败!";
+ }
+ showOPInfo(szDeviceIdentify + " " + szInfo);
+ };
+
+ if (oWndInfo != null) {// 已经在播放了,先停止
+ WebVideoCtrl.I_Stop({
+ success: function () {
+ reversePlayback();
+ }
+ });
+ } else {
+ reversePlayback();
+ }
+}
+
+// 单帧
+function clickFrame() {
+ var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex),
+ szInfo = "";
+
+ if (oWndInfo != null) {
+ WebVideoCtrl.I_Frame({
+ success: function () {
+ szInfo = "单帧播放成功!";
+ showOPInfo(oWndInfo.szDeviceIdentify + " " + szInfo);
+ },
+ error: function () {
+ szInfo = "单帧播放失败!";
+ showOPInfo(oWndInfo.szDeviceIdentify + " " + szInfo);
+ }
+ });
+ }
+}
+
+// 暂停
+function clickPause() {
+ var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex),
+ szInfo = "";
+
+ if (oWndInfo != null) {
+ WebVideoCtrl.I_Pause({
+ success: function () {
+ szInfo = "暂停成功!";
+ showOPInfo(oWndInfo.szDeviceIdentify + " " + szInfo);
+ },
+ error: function () {
+ szInfo = "暂停失败!";
+ showOPInfo(oWndInfo.szDeviceIdentify + " " + szInfo);
+ }
+ });
+ }
+}
+
+// 恢复
+function clickResume() {
+ var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex),
+ szInfo = "";
+
+ if (oWndInfo != null) {
+ WebVideoCtrl.I_Resume({
+ success: function () {
+ szInfo = "恢复成功!";
+ showOPInfo(oWndInfo.szDeviceIdentify + " " + szInfo);
+ },
+ error: function () {
+ szInfo = "恢复失败!";
+ showOPInfo(oWndInfo.szDeviceIdentify + " " + szInfo);
+ }
+ });
+ }
+}
+
+// 慢放
+function clickPlaySlow() {
+ var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex),
+ szInfo = "";
+
+ if (oWndInfo != null) {
+ WebVideoCtrl.I_PlaySlow({
+ success: function () {
+ szInfo = "慢放成功!";
+ showOPInfo(oWndInfo.szDeviceIdentify + " " + szInfo);
+ },
+ error: function () {
+ szInfo = "慢放失败!";
+ showOPInfo(oWndInfo.szDeviceIdentify + " " + szInfo);
+ }
+ });
+ }
+}
+
+// 快放
+function clickPlayFast() {
+ var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex),
+ szInfo = "";
+
+ if (oWndInfo != null) {
+ WebVideoCtrl.I_PlayFast({
+ success: function () {
+ szInfo = "快放成功!";
+ showOPInfo(oWndInfo.szDeviceIdentify + " " + szInfo);
+ },
+ error: function () {
+ szInfo = "快放失败!";
+ showOPInfo(oWndInfo.szDeviceIdentify + " " + szInfo);
+ }
+ });
+ }
+}
+
+// OSD时间
+function clickGetOSDTime() {
+ var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex);
+
+ if (oWndInfo != null) {
+ var szTime = WebVideoCtrl.I_GetOSDTime({
+ success: function (szOSDTime) {
+ $("#osdtime").val(szOSDTime);
+ showOPInfo(oWndInfo.szDeviceIdentify + " 获取OSD时间成功!");
+ },
+ error: function () {
+ showOPInfo(oWndInfo.szDeviceIdentify + " 获取OSD时间失败!");
+ }
+ });
+ }
+}
+
+// 下载录像
+var g_iDownloadID = -1;
+var g_tDownloadProcess = 0;
+function clickStartDownloadRecord(i) {
+ var szDeviceIdentify = $("#ip").val(),
+ szChannelID = $("#channels").val(),
+ szFileName = $("#downloadTd" + i).data("fileName"),
+ szPlaybackURI = $("#downloadTd" + i).data("playbackURI");
+
+ if (null == szDeviceIdentify) {
+ return;
+ }
+
+ g_iDownloadID = WebVideoCtrl.I_StartDownloadRecord(szDeviceIdentify, szPlaybackURI, szFileName, {
+ bDateDir: true //是否生成日期文件
+ });
+
+ if (g_iDownloadID < 0) {
+ var iErrorValue = WebVideoCtrl.I_GetLastError();
+ if (34 == iErrorValue) {
+ showOPInfo(szDeviceIdentify + " 已下载!");
+ } else if (33 == iErrorValue) {
+ showOPInfo(szDeviceIdentify + " 空间不足!");
+ } else {
+ showOPInfo(szDeviceIdentify + " 下载失败!");
+ }
+ } else {
+ $("").appendTo("body");
+ g_tDownloadProcess = setInterval("downProcess(" + i + ")", 1000);
+ }
+}
+// 下载进度
+function downProcess() {
+ var iStatus = WebVideoCtrl.I_GetDownloadStatus(g_iDownloadID);
+ if (0 == iStatus) {
+ $("#downProcess").css({
+ width: $("#searchlist").width() + "px",
+ height: "100px",
+ lineHeight: "100px",
+ left: $("#searchdiv").offset().left + "px",
+ top: $("#searchdiv").offset().top + "px"
+ });
+ var iProcess = WebVideoCtrl.I_GetDownloadProgress(g_iDownloadID);
+ if (iProcess < 0) {
+ clearInterval(g_tDownloadProcess);
+ g_tDownloadProcess = 0;
+ g_iDownloadID = -1;
+ } else if (iProcess < 100) {
+ $("#downProcess").text(iProcess + "%");
+ } else {
+ $("#downProcess").text("100%");
+ setTimeout(function () {
+ $("#downProcess").remove();
+ }, 1000);
+
+ WebVideoCtrl.I_StopDownloadRecord(g_iDownloadID);
+
+ showOPInfo("录像下载完成!");
+ clearInterval(g_tDownloadProcess);
+ g_tDownloadProcess = 0;
+ g_iDownloadID = -1;
+ }
+ } else {
+ WebVideoCtrl.I_StopDownloadRecord(g_iDownloadID);
+
+ clearInterval(g_tDownloadProcess);
+ g_tDownloadProcess = 0;
+ g_iDownloadID = -1;
+ }
+}
+
+// 导出配置文件
+function clickExportDeviceConfig() {
+ var szDeviceIdentify = $("#ip").val(),
+ szInfo = "";
+
+ if (null == szDeviceIdentify) {
+ return;
+ }
+
+ var iRet = WebVideoCtrl.I_ExportDeviceConfig(szDeviceIdentify);
+
+ if (0 == iRet) {
+ szInfo = "导出配置文件成功!";
+ } else {
+ szInfo = "导出配置文件失败!";
+ }
+ showOPInfo(szDeviceIdentify + " " + szInfo);
+}
+
+// 导入配置文件
+function clickImportDeviceConfig() {
+ var szDeviceIdentify = $("#ip").val(),
+ szFileName = $("#configFile").val();
+
+ if (null == szDeviceIdentify) {
+ return;
+ }
+
+ if ("" == szFileName) {
+ alert("请选择配置文件!");
+ return;
+ }
+
+ var iRet = WebVideoCtrl.I_ImportDeviceConfig(szDeviceIdentify, szFileName);
+
+ if (0 == iRet) {
+ WebVideoCtrl.I_Restart(szDeviceIdentify, {
+ success: function (xmlDoc) {
+ $("重启中...
").appendTo("body");
+ var oSize = getWindowSize();
+ $("#restartDiv").css({
+ width: oSize.width + "px",
+ height: oSize.height + "px",
+ lineHeight: oSize.height + "px",
+ left: 0,
+ top: 0
+ });
+ setTimeout("reconnect('" + szDeviceIdentify + "')", 20000);
+ },
+ error: function (status, xmlDoc) {
+ showOPInfo(szDeviceIdentify + " 重启失败!", status, xmlDoc);
+ }
+ });
+ } else {
+ showOPInfo(szDeviceIdentify + " 导入失败!");
+ }
+}
+
+// 重连
+function reconnect(szDeviceIdentify) {
+ WebVideoCtrl.I_Reconnect(szDeviceIdentify, {
+ success: function (xmlDoc) {
+ $("#restartDiv").remove();
+ },
+ error: function (status, xmlDoc) {
+ if (401 == status) {// 无插件方案,重启后session已失效,程序执行登出,从已登录设备中删除
+ $("#restartDiv").remove();
+ clickLogout();
+ } else {
+ setTimeout(function () {reconnect(szDeviceIdentify);}, 5000);
+ }
+ }
+ });
+}
+
+// 开始升级
+var g_tUpgrade = 0;
+function clickStartUpgrade(szDeviceIdentify) {
+ var szDeviceIdentify = $("#ip").val(),
+ szFileName = $("#upgradeFile").val();
+
+ if (null == szDeviceIdentify) {
+ return;
+ }
+
+ if ("" == szFileName) {
+ alert("请选择升级文件!");
+ return;
+ }
+
+ var iRet = WebVideoCtrl.I_StartUpgrade(szDeviceIdentify, szFileName);
+ if (0 == iRet) {
+ g_tUpgrade = setInterval("getUpgradeStatus('" + szDeviceIdentify + "')", 1000);
+ } else {
+ showOPInfo(szDeviceIdentify + " 升级失败!");
+ }
+}
+
+// 获取升级状态
+function getUpgradeStatus(szDeviceIdentify) {
+ var iStatus = WebVideoCtrl.I_UpgradeStatus();
+ if (iStatus == 0) {
+ var iProcess = WebVideoCtrl.I_UpgradeProgress();
+ if (iProcess < 0) {
+ clearInterval(g_tUpgrade);
+ g_tUpgrade = 0;
+ showOPInfo(szDeviceIdentify + " 获取进度失败!");
+ return;
+ } else if (iProcess < 100) {
+ if (0 == $("#restartDiv").length) {
+ $("").appendTo("body");
+ var oSize = getWindowSize();
+ $("#restartDiv").css({
+ width: oSize.width + "px",
+ height: oSize.height + "px",
+ lineHeight: oSize.height + "px",
+ left: 0,
+ top: 0
+ });
+ }
+ $("#restartDiv").text(iProcess + "%");
+ } else {
+ WebVideoCtrl.I_StopUpgrade();
+ clearInterval(g_tUpgrade);
+ g_tUpgrade = 0;
+
+ $("#restartDiv").remove();
+
+ WebVideoCtrl.I_Restart(szDeviceIdentify, {
+ success: function (xmlDoc) {
+ $("重启中...
").appendTo("body");
+ var oSize = getWindowSize();
+ $("#restartDiv").css({
+ width: oSize.width + "px",
+ height: oSize.height + "px",
+ lineHeight: oSize.height + "px",
+ left: 0,
+ top: 0
+ });
+ setTimeout("reconnect('" + szDeviceIdentify + "')", 20000);
+ },
+ error: function (status, xmlDoc) {
+ showOPInfo(szDeviceIdentify + " 重启失败!", status, xmlDoc);
+ }
+ });
+ }
+ } else if (iStatus == 1) {
+ WebVideoCtrl.I_StopUpgrade();
+ showOPInfo(szDeviceIdentify + " 升级失败!");
+ clearInterval(g_tUpgrade);
+ g_tUpgrade = 0;
+ } else if (iStatus == 2) {
+ mWebVideoCtrl.I_StopUpgrade();
+ showOPInfo(szDeviceIdentify + " 语言不匹配!");
+ clearInterval(g_tUpgrade);
+ g_tUpgrade = 0;
+ } else {
+ mWebVideoCtrl.I_StopUpgrade();
+ showOPInfo(szDeviceIdentify + " 获取状态失败!");
+ clearInterval(g_tUpgrade);
+ g_tUpgrade = 0;
+ }
+}
+
+// 检查插件版本
+function clickCheckPluginVersion() {
+ var iRet = WebVideoCtrl.I_CheckPluginVersion();
+ if (0 == iRet) {
+ alert("您的插件版本已经是最新的!");
+ } else {
+ alert("检测到新的插件版本!");
+ }
+}
+
+// 远程配置库
+function clickRemoteConfig() {
+ var szDeviceIdentify = $("#ip").val(),
+ iDevicePort = parseInt($("#deviceport").val(), 10) || "",
+ szInfo = "";
+
+ if (null == szDeviceIdentify) {
+ return;
+ }
+
+ var iRet = WebVideoCtrl.I_RemoteConfig(szDeviceIdentify, {
+ iDevicePort: iDevicePort,
+ iLan: 1
+ });
+
+ if (-1 == iRet) {
+ szInfo = "调用远程配置库失败!";
+ } else {
+ szInfo = "调用远程配置库成功!";
+ }
+ showOPInfo(szDeviceIdentify + " " + szInfo);
+}
+
+function clickRestoreDefault() {
+ var szDeviceIdentify = $("#ip").val(),
+ szMode = "basic";
+ WebVideoCtrl.I_RestoreDefault(szDeviceIdentify, szMode, {
+ timeout: 30000,
+ success: function (xmlDoc) {
+ $("#restartDiv").remove();
+ showOPInfo(szDeviceIdentify + " 恢复默认参数成功!");
+ //恢复完成后需要重启
+ WebVideoCtrl.I_Restart(szDeviceIdentify, {
+ success: function (xmlDoc) {
+ $("重启中...
").appendTo("body");
+ var oSize = getWindowSize();
+ $("#restartDiv").css({
+ width: oSize.width + "px",
+ height: oSize.height + "px",
+ lineHeight: oSize.height + "px",
+ left: 0,
+ top: 0
+ });
+ setTimeout("reconnect('" + szDeviceIdentify + "')", 20000);
+ },
+ error: function (status, xmlDoc) {
+ showOPInfo(szDeviceIdentify + " 重启失败!", status, xmlDoc);
+ }
+ });
+ },
+ error: function (status, xmlDoc) {
+ showOPInfo(szDeviceIdentify + " 恢复默认参数失败!", status, xmlDoc);
+ }
+ });
+}
+
+function PTZZoomIn() {
+ var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex);
+
+ if (oWndInfo != null) {
+ WebVideoCtrl.I_PTZControl(10, false, {
+ iWndIndex: g_iWndIndex,
+ success: function (xmlDoc) {
+ showOPInfo(oWndInfo.szDeviceIdentify + " 调焦+成功!");
+ },
+ error: function (status, xmlDoc) {
+ showOPInfo(oWndInfo.szDeviceIdentify + " 调焦+失败!", status, xmlDoc);
+ }
+ });
+ }
+}
+
+function PTZZoomout() {
+ var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex);
+
+ if (oWndInfo != null) {
+ WebVideoCtrl.I_PTZControl(11, false, {
+ iWndIndex: g_iWndIndex,
+ success: function (xmlDoc) {
+ showOPInfo(oWndInfo.szDeviceIdentify + " 调焦-成功!");
+ },
+ error: function (status, xmlDoc) {
+ showOPInfo(oWndInfo.szDeviceIdentify + " 调焦-失败!", status, xmlDoc);
+ }
+ });
+ }
+}
+
+function PTZZoomStop() {
+ var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex);
+
+ if (oWndInfo != null) {
+ WebVideoCtrl.I_PTZControl(11, true, {
+ iWndIndex: g_iWndIndex,
+ success: function (xmlDoc) {
+ showOPInfo(oWndInfo.szDeviceIdentify + " 调焦停止成功!");
+ },
+ error: function (status, xmlDoc) {
+ showOPInfo(oWndInfo.szDeviceIdentify + " 调焦停止失败!", status, xmlDoc);
+ }
+ });
+ }
+}
+
+function PTZFocusIn() {
+ var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex);
+
+ if (oWndInfo != null) {
+ WebVideoCtrl.I_PTZControl(12, false, {
+ iWndIndex: g_iWndIndex,
+ success: function (xmlDoc) {
+ showOPInfo(oWndInfo.szDeviceIdentify + " 聚焦+成功!");
+ },
+ error: function (status, xmlDoc) {
+ showOPInfo(oWndInfo.szDeviceIdentify + " 聚焦+失败!", status, xmlDoc);
+ }
+ });
+ }
+}
+
+function PTZFoucusOut() {
+ var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex);
+
+ if (oWndInfo != null) {
+ WebVideoCtrl.I_PTZControl(13, false, {
+ iWndIndex: g_iWndIndex,
+ success: function (xmlDoc) {
+ showOPInfo(oWndInfo.szDeviceIdentify + " 聚焦-成功!");
+ },
+ error: function (status, xmlDoc) {
+ showOPInfo(oWndInfo.szDeviceIdentify + " 聚焦-失败!", status, xmlDoc);
+ }
+ });
+ }
+}
+
+function PTZFoucusStop() {
+ var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex);
+
+ if (oWndInfo != null) {
+ WebVideoCtrl.I_PTZControl(12, true, {
+ iWndIndex: g_iWndIndex,
+ success: function (xmlDoc) {
+ showOPInfo(oWndInfo.szDeviceIdentify + " 聚焦停止成功!");
+ },
+ error: function (status, xmlDoc) {
+ showOPInfo(oWndInfo.szDeviceIdentify + " 聚焦停止失败!", status, xmlDoc);
+ }
+ });
+ }
+}
+
+function PTZIrisIn() {
+ var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex);
+
+ if (oWndInfo != null) {
+ WebVideoCtrl.I_PTZControl(14, false, {
+ iWndIndex: g_iWndIndex,
+ success: function (xmlDoc) {
+ showOPInfo(oWndInfo.szDeviceIdentify + " 光圈+成功!");
+ },
+ error: function (status, xmlDoc) {
+ showOPInfo(oWndInfo.szDeviceIdentify + " 光圈+失败!", status, xmlDoc);
+ }
+ });
+ }
+}
+
+function PTZIrisOut() {
+ var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex);
+
+ if (oWndInfo != null) {
+ WebVideoCtrl.I_PTZControl(15, false, {
+ iWndIndex: g_iWndIndex,
+ success: function (xmlDoc) {
+ showOPInfo(oWndInfo.szDeviceIdentify + " 光圈-成功!");
+ },
+ error: function (status, xmlDoc) {
+ showOPInfo(oWndInfo.szDeviceIdentify + " 光圈-失败!", status, xmlDoc);
+ }
+ });
+ }
+}
+
+function PTZIrisStop() {
+ var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex);
+
+ if (oWndInfo != null) {
+ WebVideoCtrl.I_PTZControl(14, true, {
+ iWndIndex: g_iWndIndex,
+ success: function (xmlDoc) {
+ showOPInfo(oWndInfo.szDeviceIdentify + " 光圈停止成功!");
+ },
+ error: function (status, xmlDoc) {
+ showOPInfo(oWndInfo.szDeviceIdentify + " 光圈停止失败!", status, xmlDoc);
+ }
+ });
+ }
+}
+
+// 切换模式
+function changeIPMode(iType) {
+ var arrPort = [0, 7071, 80];
+
+ $("#serverport").val(arrPort[iType]);
+}
+
+// 获取设备IP
+function clickGetDeviceIP() {
+ var iDeviceMode = parseInt($("#devicemode").val(), 10),
+ szAddress = $("#serveraddress").val(),
+ iPort = parseInt($("#serverport").val(), 10) || 0,
+ szDeviceID = $("#deviceid").val(),
+ szDeviceInfo = "";
+
+ szDeviceInfo = WebVideoCtrl.I_GetIPInfoByMode(iDeviceMode, szAddress, iPort, szDeviceID);
+
+ if ("" == szDeviceInfo) {
+ showOPInfo("设备IP和端口解析失败!");
+ } else {
+ showOPInfo("设备IP和端口解析成功!");
+
+ var arrTemp = szDeviceInfo.split("-");
+ $("#loginip").val(arrTemp[0]);
+ $("#deviceport").val(arrTemp[1]);
+ }
+}
+
+// 启用多边形绘制
+var g_bEnableDraw = false;
+function clickEnableDraw() {
+ var iRet = WebVideoCtrl.I_SetPlayModeType(6);// 多边形模式
+
+ if (0 === iRet) {
+ g_bEnableDraw = true;
+
+ showOPInfo("启用绘制成功!");
+ } else {
+ showOPInfo("启用绘制失败!");
+ }
+}
+
+// 禁用多边形绘制
+function clickDisableDraw() {
+ var iRet = WebVideoCtrl.I_SetPlayModeType(0);// 预览模式
+ if (0 === iRet) {
+ g_bEnableDraw = false;
+
+ showOPInfo("禁用绘制成功!");
+ } else {
+ showOPInfo("禁用绘制失败!");
+ }
+}
+
+// 添加图形
+function clickAddSnapPolygon() {
+ if (!g_bEnableDraw) {
+ return;
+ }
+
+ var szId = $("#snapId").val();
+ var szName = encodeString($("#snapName").val());
+
+ var szInfo = "";
+ szInfo += "";
+ szInfo += "";
+ szInfo += "" + szId + ""; // [1, 32]
+ szInfo += "1";
+ szInfo += "17"; // [MinClosed, 17]
+ szInfo += "4"; // [4, 17]
+ szInfo += "#" + szId + "#" + szName + "";
+ szInfo += "false";
+ szInfo += "02550";
+ szInfo += "";
+ szInfo += "";
+ szInfo += "";
+
+ var iRet = WebVideoCtrl.I_SetSnapPolygonInfo(g_iWndIndex, szInfo);
+ if (0 === iRet) {
+ showOPInfo("窗口" + g_iWndIndex + "添加图形成功!");
+ } else if (-1 === iRet) {
+ showOPInfo("窗口" + g_iWndIndex + "添加图形失败!");
+ } else if (-2 === iRet) {
+ alert("参数错误!");
+ } else if (-3 === iRet) {
+ alert("图形个数达到上限!");
+ } else if (-4 === iRet) {
+ alert("图形ID已存在!");
+ }
+ WebVideoCtrl.I_SetSnapDrawMode(g_iWndIndex, 2);
+}
+
+// 删除图形
+function clickDelSnapPolygon() {
+ if (!g_bEnableDraw) {
+ return;
+ }
+
+ var szId = $("#snapId").val();
+
+ var iIndex = getSnapPolygon(szId);
+ if (iIndex != -1) {
+ var oXML = getSnapPolygon();
+ $(oXML).find("SnapPolygon").eq(iIndex).remove();
+
+ var szInfo = toXMLStr(oXML);
+
+ WebVideoCtrl.I_ClearSnapInfo(g_iWndIndex);
+ WebVideoCtrl.I_SetSnapPolygonInfo(g_iWndIndex, szInfo);
+ WebVideoCtrl.I_SetSnapDrawMode(g_iWndIndex, 3);
+ } else {
+ alert("图形ID不存在!");
+ }
+}
+
+// 编辑图形
+function clickEditSnapPolygon() {
+ if (!g_bEnableDraw) {
+ return;
+ }
+
+ var iRet = WebVideoCtrl.I_SetSnapDrawMode(g_iWndIndex, 3);
+ if (0 === iRet) {
+ showOPInfo("窗口" + g_iWndIndex + "编辑图形成功!");
+ } else {
+ showOPInfo("窗口" + g_iWndIndex + "编辑图形失败!");
+ }
+}
+
+// 停止编辑
+function clickStopSnapPolygon() {
+ if (!g_bEnableDraw) {
+ return;
+ }
+
+ var iRet = WebVideoCtrl.I_SetSnapDrawMode(g_iWndIndex, -1);
+ if (0 === iRet) {
+ showOPInfo("窗口" + g_iWndIndex + "停止编辑成功!");
+ } else {
+ showOPInfo("窗口" + g_iWndIndex + "停止编辑失败!");
+ }
+}
+
+function getSnapPolygon(szId) {
+ var szInfo = WebVideoCtrl.I_GetSnapPolygonInfo(g_iWndIndex);
+ var oXML = loadXML(szInfo);
+
+ if (typeof szId === "undefined") {
+ return oXML;
+ } else {
+ var iIndex = -1;
+
+ var aNodeList = $(oXML).find("SnapPolygon");
+ if (aNodeList.length > 0) {
+ $.each(aNodeList, function (i) {
+ if ($(this).find("id").text() === szId) {
+ iIndex = i;
+ return false;
+ }
+ });
+ }
+
+ return iIndex;
+ }
+}
+
+// 获取图形,保存到自己数据库中
+function clickGetSnapPolygon() {
+ if (!g_bEnableDraw) {
+ return;
+ }
+
+ var szInfo = WebVideoCtrl.I_GetSnapPolygonInfo(g_iWndIndex);
+
+ alert(szInfo);
+}
+
+// 设置图形,页面打开时可以设置以前设置过的图形
+function clickSetSnapPolygon() {
+ if (!g_bEnableDraw) {
+ return;
+ }
+
+ WebVideoCtrl.I_ClearSnapInfo(g_iWndIndex);
+
+ var szInfo = "";
+ szInfo += "";
+ szInfo += "";
+ szInfo += "1";
+ szInfo += "1";
+ szInfo += "#1#设置1";
+ szInfo += "true";
+ szInfo += "02550";
+ szInfo += "";
+ szInfo += "0.7379030.229730";
+ szInfo += "0.9475810.804054";
+ szInfo += "0.3629030.777027";
+ szInfo += "";
+ szInfo += "";
+ szInfo += "";
+ szInfo += "2";
+ szInfo += "1";
+ szInfo += "#2#设置2";
+ szInfo += "true";
+ szInfo += "02550";
+ szInfo += "";
+ szInfo += "0.4516130.216216";
+ szInfo += "0.4475810.729730";
+ szInfo += "0.1169350.554054";
+ szInfo += "";
+ szInfo += "";
+ szInfo += "";
+
+ var iRet = WebVideoCtrl.I_SetSnapPolygonInfo(g_iWndIndex, szInfo);
+ if (0 === iRet) {
+ showOPInfo("窗口" + g_iWndIndex + "设置图形成功!");
+ } else if (-1 === iRet) {
+ showOPInfo("窗口" + g_iWndIndex + "设置图形失败!");
+ } else if (-2 === iRet) {
+ alert("参数错误!");
+ } else if (-3 === iRet) {
+ alert("图形个数达到上限!");
+ } else if (-4 === iRet) {
+ alert("图形ID已存在!");
+ }
+}
+
+// 清空图形
+function clickDelAllSnapPolygon() {
+ if (!g_bEnableDraw) {
+ return;
+ }
+
+ var iRet = WebVideoCtrl.I_ClearSnapInfo(g_iWndIndex);
+ if (0 === iRet) {
+ showOPInfo("窗口" + g_iWndIndex + "清空图形成功!");
+ } else {
+ showOPInfo("窗口" + g_iWndIndex + "清空图形失败!");
+ }
+}
+
+// 设备抓图
+function clickDeviceCapturePic() {
+ var szInfo = "";
+ var szDeviceIdentify = $("#ip").val();
+ var bZeroChannel = $("#channels option").eq($("#channels").get(0).selectedIndex).attr("bZero") == "true" ? true : false;
+ var iChannelID = parseInt($("#channels").val(), 10);
+ var iResolutionWidth = parseInt($("#resolutionWidth").val(), 10);
+ var iResolutionHeight = parseInt($("#resolutionHeight").val(), 10);
+
+ if (null == szDeviceIdentify) {
+ return;
+ }
+
+ if (bZeroChannel) {// 零通道不支持设备抓图
+ return;
+ }
+
+ var szPicName = szDeviceIdentify + "_" + iChannelID + "_" + new Date().getTime();
+ var iRet = WebVideoCtrl.I_DeviceCapturePic(szDeviceIdentify, iChannelID, szPicName, {
+ bDateDir: true, //是否生成日期文件
+ iResolutionWidth: iResolutionWidth,
+ iResolutionHeight: iResolutionHeight
+ });
+
+ if (0 == iRet) {
+ szInfo = "设备抓图成功!";
+ } else {
+ szInfo = "设备抓图失败!";
+ }
+ showOPInfo(szDeviceIdentify + " " + szInfo);
+}
+
+function loadXML(szXml) {
+ if(null == szXml || "" == szXml) {
+ return null;
+ }
+
+ var oXmlDoc = null;
+
+ if (window.DOMParser) {
+ var oParser = new DOMParser();
+ oXmlDoc = oParser.parseFromString(szXml, "text/xml");
+ } else {
+ oXmlDoc = new ActiveXObject("Microsoft.XMLDOM");
+ oXmlDoc.async = false;
+ oXmlDoc.loadXML(szXml);
+ }
+
+ return oXmlDoc;
+}
+
+function toXMLStr(oXmlDoc) {
+ var szXmlDoc = "";
+
+ try {
+ var oSerializer = new XMLSerializer();
+ szXmlDoc = oSerializer.serializeToString(oXmlDoc);
+ } catch (e) {
+ try {
+ szXmlDoc = oXmlDoc.xml;
+ } catch (e) {
+ return "";
+ }
+ }
+ if (szXmlDoc.indexOf("" + szXmlDoc;
+ }
+
+ return szXmlDoc;
+}
+
+function encodeString(str) {
+ if (str) {
+ return str.replace(/&/g, '&').replace(//g, '>');
+ } else {
+ return "";
+ }
+}
\ No newline at end of file
diff --git a/supervise-monitor-ui/src/api/hikvision/hkVideo.js b/supervise-monitor-ui/src/api/hikvision/hkVideo.js
new file mode 100644
index 00000000..c5bb4984
--- /dev/null
+++ b/supervise-monitor-ui/src/api/hikvision/hkVideo.js
@@ -0,0 +1,430 @@
+import { Message } from "element-ui";
+
+var webVideoCtrl = window.WebVideoCtrl;
+var $ = window.$;
+/**
+ * 初始化
+ * @param {number} iWndowType 分屏类型:1 - 1*1,2 - 2*2,3 - 3*3,4 - 4*4,默认值1,单画面
+ * @param {number} width 插件的宽度(单位为”px”, 100%表示撑满插件容器)
+ * @param {number} height 插件的高度(单位为”px”, 100%表示撑满插件容器)
+ * @returns null
+ */
+let init = (iWndowType, width, height) => {
+ // 检查浏览器是否支持无插件
+ if (!webVideoCtrl.I_SupportNoPlugin()) {
+ Message.warning(
+ "当前浏览器不支持无插件预览监控视频,已自动切换成插件模式,如果还未安装插件请安装"
+ );
+ // 检查插件是否已经安装
+ const isInstall = webVideoCtrl.I_CheckPluginInstall();
+ if (isInstall == -1) {
+ Message.warning(
+ "您还未安装过插件,请先下载WebComponentsKit.exe双击安装!"
+ );
+ return;
+ }
+ }
+ // 初始化插件
+ webVideoCtrl.I_InitPlugin(width, height, {
+ szColorProperty:
+ "plugin-background:ffffff; sub-background:00000; sub-border:D0DAE4; sub-border-select:409EFF", // 表示插件的背景颜色,插件子窗口的背景颜色,窗口边框的颜色,窗口边框选中后的颜色
+ iWndowType,
+ bNoPlugin: true, // 支持无插件
+ cbSelWnd: (xmlDoc) => {
+ let iWndIndex = parseInt($(xmlDoc)?.find("SelectWnd").eq(0).text(), 10);
+ console.log("当前选择的窗口编号:" + iWndIndex);
+ },
+ cbDoubleClickWnd: (iWndIndex, bFullScreen) => {
+ let szInfo = "当前放大的窗口编号:" + iWndIndex;
+ if (!bFullScreen) {
+ szInfo = "当前还原的窗口编号:" + iWndIndex;
+ }
+ console.log(szInfo);
+ }, // 无插件模式不起效
+ cbInitPluginComplete: () => {
+ // 嵌入播放插件
+ webVideoCtrl.I_InsertOBJECTPlugin("divPlugin");
+ console.log("初始化成功--------");
+ resize();
+ // 检查插件是否最新
+ if (webVideoCtrl.I_CheckPluginVersion() == -1) {
+ Message.warning("检测到新的插件版本,双击WebComponentsKit.exe升级!");
+ return;
+ }
+ // login(
+ // global.hk_ip, // 设备的 IP 地址或者普通域名
+ // global.hk_prototocol,// http 协议,1 表示 http 协议 2 表示 https 协议
+ // global.hk_port,//登录设备的 http/https 端口号,根据 iPrototocol 选择传入不同的端口
+ // global.hk_username,//登录用户名称
+ // global.hk_password//用户密码
+ // );
+
+ login(
+ "192.168.3.175", // 设备的 IP 地址或者普通域名
+ "1",// http 协议,1 表示 http 协议 2 表示 https 协议
+ "80",//登录设备的 http/https 端口号,根据 iPrototocol 选择传入不同的端口
+ "admin",//登录用户名称
+ "Yxt123456"//用户密码
+ );
+ }, // 插件初始化完成回调,必须要定义
+ });
+};
+
+let destroy = () => {};
+
+/**
+ * 调整大小
+ */
+let resize = () => {
+ webVideoCtrl.I_Resize($("#divPlugin").width(), $("#divPlugin").height());
+};
+
+/**
+ * 登录
+ * @param {string} ip 设备的 IP 地址或者普通域名
+ * @param {number} prototocol http 协议,1 表示 http 协议 2 表示 https 协议
+ * @param {number} port 登录设备的 http/https 端口号,根据 iPrototocol 选择传入不同的端口
+ * @param {string} userName 登录用户名称
+ * @param {string} password 用户密码
+ */
+let login = (ip, prototocol, port, userName, password) => {
+ webVideoCtrl.I_Login(ip, prototocol, port, userName, password, {
+ async: true, // http 交互方式,true 表示异步,false 表示同步
+ cgi: 1, // CGI 协议选择,1 表示 ISAPI,2 表示 PSIA,如果不传这个参数,会自动选择一种设备支持的协议.
+ // 登录成功回调
+ success: (xmlDoc) => {
+ console.log("login success-----------", xmlDoc);
+ // getAnalogChannelInfo(`${ip}_${port}`, {
+ // async: true,
+ // success: (analogChannelInfo) => {
+ // let analogCameras = analysisAnalogChannelInfo(analogChannelInfo);
+ // console.log(
+ // "获取模拟通道----------",
+ // analogChannelInfo,
+ // analogCameras
+ // );
+ // },
+ // error: (statusA, xmlDocA) => {
+ // console.log("获取模拟通道 error-----------", statusA, xmlDocA);
+ // },
+ // });
+ getDigitalChannelInfo(`${ip}_${port}`, {
+ async: true,
+ success: (digitalChannelInfo) => {
+ let digitalCameras = analysisDigitalChannelInfo(digitalChannelInfo);
+ console.log(
+ "获取数字通道----------",
+ digitalChannelInfo,
+ digitalCameras
+ );
+ },
+ error: (statusD, xmlDocD) => {
+ console.log("获取数字通道 error-----------", statusD, xmlDocD);
+ },
+ });
+ // getZeroChannelInfo(`${ip}_${port}`, {
+ // async: true,
+ // success: (zeroChannelInfo) => {
+ // let zeroCameras = analysisZeroChannelInfo(zeroChannelInfo);
+ // console.log("获取零通道----------", zeroChannelInfo, zeroCameras);
+ // },
+ // error: (statusZ, xmlDocZ) => {
+ // console.log("获取零通道 error-----------", statusZ, xmlDocZ);
+ // },
+ // });
+ },
+ // 失败函数回调
+ error: () => {
+ console.log("login error-----------");
+ },
+ });
+};
+
+/**
+ * 登出
+ * @param {string} deviceIdentify 设备标识(IP_Port)
+ * @returns 成功返回 0,失败返回-1
+ */
+let logout = (deviceIdentify) => {
+ return webVideoCtrl.I_Logout(deviceIdentify);
+};
+
+/**
+ * 获取设备基本信息
+ * @param {string} deviceIdentify 设备标识(IP_Port)
+ * @param {*} options 可选参数对象:
+ * * async http 交互方式,true 表示异步,false 表示同步;
+ * * success 成功回调函数,有一个参数,表示返回的 XML 内容。;
+ * * error 失败回调函数,有两个参数,第一个是 http 状态码,第二个是设备返回的 XML(可能为空)
+ */
+let getDeviceInfo = (deviceIdentify, options) => {
+ webVideoCtrl.I_GetDeviceInfo(deviceIdentify, options);
+};
+
+/**
+ * 获取模拟通道
+ * @param {string} deviceIdentify 设备标识(IP_Port)
+ * @param {*} options 可选参数对象:
+ * * async http 交互方式,true 表示异步,false 表示同步;
+ * * success 成功回调函数,有一个参数,表示返回的 XML 内容。;
+ * * error 失败回调函数,有两个参数,第一个是 http 状态码,第二个是设备返回的 XML(可能为空)
+ */
+let getAnalogChannelInfo = (deviceIdentify, options) => {
+ webVideoCtrl.I_GetAnalogChannelInfo(deviceIdentify, options);
+};
+
+/**
+ * 解析模拟通道XML内容
+ * @param {XMLDocument} xmlDoc XML内容
+ * @returns cameraList: 监控列表
+ */
+let analysisAnalogChannelInfo = (xmlDoc) => {
+ let cameraList = [];
+ let channels = $(xmlDoc)?.find("VideoInputChannel");
+ $.each(channels, (i, channel) => {
+ let id = $(channel).find("id").eq(0).text();
+ let name = $(channel).find("name").eq(0).text();
+ if (name == "") {
+ name = "Camera " + (i < 9 ? "0" + (i + 1) : i + 1);
+ }
+ cameraList.push({
+ id,
+ name,
+ });
+ });
+ return cameraList;
+};
+
+/**
+ * 获取数字通道
+ * @param {string} deviceIdentify 设备标识(IP_Port)
+ * @param {*} options 可选参数对象:
+ * * async http 交互方式,true 表示异步,false 表示同步;
+ * * success 成功回调函数,有一个参数,表示返回的 XML 内容。;
+ * * error 失败回调函数,有两个参数,第一个是 http 状态码,第二个是设备返回的 XML(可能为空)
+ */
+let getDigitalChannelInfo = (deviceIdentify, options) => {
+ webVideoCtrl.I_GetDigitalChannelInfo(deviceIdentify, options);
+};
+
+/**
+ * 解析数字通道XML内容
+ * @param {XMLDocument} xmlDoc XML内容
+ * @param {boolean} filterOnline 是否过滤禁用的数字通道
+ * @returns cameraList: 监控列表
+ */
+let analysisDigitalChannelInfo = (xmlDoc, filterOnline) => {
+ let cameraList = [];
+ let channels = $(xmlDoc)?.find("InputProxyChannelStatus");
+
+ $.each(channels, (i, channel) => {
+ let id = $(channel).find("id").eq(0).text();
+ let name = $(channel).find("name").eq(0).text();
+ let online = $(channel).find("online").eq(0).text();
+ if (filterOnline && online == "false") {
+ // 过滤禁用的数字通道
+ return true;
+ }
+ if (name == "") {
+ name = "IPCamera " + (i < 9 ? "0" + (i + 1) : i + 1);
+ }
+ cameraList.push({
+ id,
+ name,
+ online,
+ });
+ });
+ return cameraList;
+};
+
+/**
+ * 获取零通道
+ * @param {string} deviceIdentify 设备标识(IP_Port)
+ * @param {*} options 可选参数对象:
+ * * async http 交互方式,true 表示异步,false 表示同步;
+ * * success 成功回调函数,有一个参数,表示返回的 XML 内容。;
+ * * error 失败回调函数,有两个参数,第一个是 http 状态码,第二个是设备返回的 XML(可能为空)
+ */
+let getZeroChannelInfo = (deviceIdentify, options) => {
+ webVideoCtrl.I_GetZeroChannelInfo(deviceIdentify, options);
+};
+
+/**
+ * 解析零通道XML内容
+ * @param {XMLDocument} xmlDoc XML内容
+ * @param {boolean} filterEnabled 是否过滤禁用的零通道
+ * @returns cameraList: 监控列表
+ */
+let analysisZeroChannelInfo = (xmlDoc, filterEnabled) => {
+ let cameraList = [];
+ let channels = $(xmlDoc)?.find("ZeroVideoChannel");
+
+ $.each(channels, (i, channel) => {
+ let id = $(channel).find("id").eq(0).text();
+ let name = $(channel).find("name").eq(0).text();
+ if (name == "") {
+ name = "Zero Channel " + (i < 9 ? "0" + (i + 1) : i + 1);
+ }
+ let enabled = $(channel).find("enabled").eq(0).text();
+ if (filterEnabled && enabled == "false") {
+ // 过滤禁用的零通道
+ return true;
+ }
+ cameraList.push({
+ id,
+ name,
+ enabled,
+ });
+ });
+ return cameraList;
+};
+
+/**
+ * 录像搜索
+ * @param {string} deviceIdentify 设备标识(IP_Port)
+ * @param {string} channelId 通道 ID
+ * @param {string} startTime 开始时间:如:2013-12-23 00:00:00
+ * @param {string} endTime 结束时间:如:2013-12-23 23:59:59
+ * @param {*} options 可选参数对象:
+ * * async http 交互方式,true 表示异步,false 表示同步
+ * * iSearchPos 搜索录像的位置(默认为 0),0 表示返回结果的第 0-40 条,40 表示 40-80 条,依次类推
+ * * success 成功回调函数,有一个参数,表示返回的 XML 内容。
+ * * error 失败回调函数,有两个参数,第一个是 http 状态码,第二个是设备返回的 XML(可能为空)
+ * * iStreamType 码流类型 1-主码流,2-子码流,默认主码流
+ */
+let recordSearch = (deviceIdentify, channelId, startTime, endTime, options) => {
+ webVideoCtrl.I_RecordSearch(
+ deviceIdentify,
+ channelId,
+ startTime,
+ endTime,
+ options
+ );
+};
+
+/**
+ * 开始预览
+ * @param {string} deviceIdentify 设备标识(IP_Port)
+ * @param {*} options 可选参数对象:
+ * * iWndIndex 播放窗口,如果不传,则默认使用当前选择窗口播放(默认选中窗口 0)
+ * * iStreamType 码流类型 1-主码流,2-子码流,默认使用主码流预览
+ * * iChannelID 播放通道号,默认通道 1
+ * * bZeroChannel 是否播放零通道,默认为 false
+ * * iPort RTSP 端口号,可以选择传入,如果不传,开发包会自动判断设备的 RTSP 端口
+ * * success 成功回调函数
+ * * error 失败回调函数
+ */
+let startRealPlay = (deviceIdentify, options) => {
+ webVideoCtrl.I_StartRealPlay(deviceIdentify, options);
+};
+
+/**
+ * 开始回放
+ * @param {string} deviceIdentify 设备标识(IP_Port)
+ * @param {*} options 可选参数对象:
+ * * iWndIndex 播放窗口,如果不传,则默认使用当前选择窗口播放(默认选中窗口 0)
+ * * iStreamType 码流类型 1-主码流,2-子码流,默认使用主码流预览
+ * * szStartTime 开始时间,默认为当天 00:00:00,格式如:2013-12-23 00:00:00
+ * * szEndTime 结束时间,默认为当天 23:59:59,格式如:2013-12-23 23:59:59
+ * * iChannelID 播放通道号,默认通道 1
+ * * iPort RTSP 端口号,可以选择传入,如果不传,开发包会自动判断设备的 RTSP 端口
+ * * oTransCodeParam 转码回放参数对象,传入此参数,将按照此对象中的编码参数进行转码回放(转码回放需要设备支持,如果不支持,则不要传入这个参数)。
+ * * iStreamType 码流类型 1-主码流,2-子码流,默认主码流
+ * * success 成功回调函数
+ * * error 失败回调函数
+ */
+let startPlayBack = (deviceIdentify, options) => {
+ webVideoCtrl.I_StartPlayback(deviceIdentify, options);
+};
+
+/**
+ * 停止播放
+ * @param {*} options 可选参数对象:
+ * * iWndIndex 播放窗口号,可不传,表示操作当前选中窗口
+ * * success 成功回调函数
+ * * error 失败回调函数
+ */
+let stopPlay = (options) => {
+ webVideoCtrl.I_Stop(options);
+};
+
+/**
+ * 暂停
+ * @param {*} options 可选参数对象:
+ * * iWndIndex 播放窗口号,可不传,表示操作当前选中窗口
+ * * success 成功回调函数
+ * * error 失败回调函数
+ */
+let pause = (options) => {
+ webVideoCtrl.I_Pause(options);
+};
+
+/**
+ * 打开声音
+ * @param {number} iWndIndex 播放窗口号,可不传,表示操作当前选中窗口
+ * @returns 成功返回 0,失败返回-1
+ */
+let openSound = (iWndIndex) => {
+ return webVideoCtrl.I_OpenSound(iWndIndex);
+};
+
+/**
+ * 关闭声音
+ * @param {number} iWndIndex 播放窗口号,可不传,表示操作当前选中窗口
+ * @returns 成功返回 0,失败返回-1
+ */
+let closeSound = (iWndIndex) => {
+ return webVideoCtrl.I_CloseSound(iWndIndex);
+};
+
+/**
+ * 设置音量
+ * @param {number} iVolume 音量大小
+ * @param {number} iWndIndex 播放窗口号,可不传,表示操作当前选中窗口
+ * @returns 成功返回 0,失败返回-1
+ */
+let setVolume = (iVolume, iWndIndex) => {
+ return webVideoCtrl.I_SetVolume(iVolume, iWndIndex);
+};
+
+/**
+ * 修改画面分割类型
+ * @param {number} iWndType 画面分割类型:1- 1*1,2- 2*2,3- 3*3,4- 4*4,5- 5*5,6- 6*6,7- 7*7,8- 8*8
+ * @returns 成功返回 0,失败返回-1
+ */
+let changeWndNum = (iWndType) => {
+ return webVideoCtrl.I_ChangeWndNum(iWndType);
+};
+
+/**
+ * 全屏播放
+ * @param {boolean} full 是否全屏:true-全屏 false-退出全屏
+ */
+let fullScreen = (full) => {
+ webVideoCtrl.I_FullScreen(full);
+};
+
+export default {
+ init,
+ destroy,
+ resize,
+ login,
+ logout,
+ getDeviceInfo,
+ getAnalogChannelInfo,
+ analysisAnalogChannelInfo,
+ getDigitalChannelInfo,
+ analysisDigitalChannelInfo,
+ getZeroChannelInfo,
+ analysisZeroChannelInfo,
+ recordSearch,
+ startRealPlay,
+ startPlayBack,
+ stopPlay,
+ pause,
+ openSound,
+ closeSound,
+ setVolume,
+ changeWndNum,
+ fullScreen,
+};
diff --git a/supervise-monitor-ui/src/api/hikvision/jquery-1.7.1.min.js b/supervise-monitor-ui/src/api/hikvision/jquery-1.7.1.min.js
new file mode 100644
index 00000000..835d77d5
--- /dev/null
+++ b/supervise-monitor-ui/src/api/hikvision/jquery-1.7.1.min.js
@@ -0,0 +1,4 @@
+/*! jQuery v1.7.1 jquery.com | jquery.org/license */
+(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"":"")+""),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){if(c!=="border")for(;g=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,t2=/(trident.*rv:)([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i0&& b[1].indexOf("trident")>-1){b[1]="msie"}return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f instanceof e&&!(f instanceof a)&&(f=a(f));return e.fn.init.call(this,d,f,b)},a.fn.init.prototype=a.fn;var b=a(c);return a},browser:{}}),e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){I["[object "+b+"]"]=b.toLowerCase()}),z=e.uaMatch(y),z.browser&&(e.browser[z.browser]=!0,e.browser.version=z.version),e.browser.webkit&&(e.browser.safari=!0),j.test(" ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?B=function(){c.removeEventListener("DOMContentLoaded",B,!1),e.ready()}:c.attachEvent&&(B=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",B),e.ready())});return e}(),g={};f.Callbacks=function(a){a=a?g[a]||h(a):{};var c=[],d=[],e,i,j,k,l,m=function(b){var d,e,g,h,i;for(d=0,e=b.length;d1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;ca",d=q.getElementsByTagName("*"),e=q.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=q.getElementsByTagName("input")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName("tbody").length,htmlSerialize:!!q.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:q.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent("onclick",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML="",a.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",q.style.width="2px",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(q.attachEvent)for(o in{submit:1,change:1,focusin:1})n="on"+o,p=n in q,p||(q.setAttribute(n,"return;"),p=typeof q[n]=="function"),b[o+"Bubbles"]=p;k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName("body")[0];!r||(j=1,k="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",m="visibility:hidden;border:0;",n="style='"+k+"border:5px solid #000;padding:0;'",o=""+"",a=c.createElement("div"),a.style.cssText=m+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(a,r.firstChild),q=c.createElement("div"),a.appendChild(q),q.innerHTML="",l=q.getElementsByTagName("td"),p=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML="",q.style.width=q.style.paddingLeft="1px",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!="undefined"&&(q.style.display="inline",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display="",q.innerHTML="",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position="fixed",e.style.top="20px",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;h=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/\bhover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")};
+f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;le&&i.push({elem:this,matches:d.slice(e)});for(j=0;j0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0)for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/",""],legend:[1,""],thead:[1,""],tr:[2,""],td:[3,""],col:[2,""],area:[1,""],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div","
"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function()
+{for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>$2>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||!bc.test("<"+a.nodeName)?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1>$2>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bq,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bq.test(g)?g.replace(bq,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,b){var c,d,e;b=b.replace(bs,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b)));return c}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bt.test(f)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bD=/%20/g,bE=/\[\]$/,bF=/\r?\n/g,bG=/#.*$/,bH=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\/\//,bM=/\?/,bN=/
+ // 退出
+ onLogout() {
+ this.videoData.forEach((element) => {
+ var szDeviceIdentify = element.ip + "_" + element.port;
+ var iRet = WebVideoCtrl.I_Logout(szDeviceIdentify);
+ if (0 == iRet) {
+ // this.$message({
+ // showClose: true,
+ // message: "退出成功",
+ // type: "success",
+ // });
+ } else {
+ // this.$message({
+ // showClose: true,
+ // message: "退出失败",
+ // type: "error",
+ // });
+ }
+ });
+ },
+ clickStartRealPlay() {
+ console.log("开始预览", this.index);
+ // 开始预览
+ var that = this;
+ that.startPlayLoading = true;
+ var szDeviceIdentify = that.hkvInfo.ip + "_" + that.hkvInfo.port;
+ debugger
+ that.startRealPlay(szDeviceIdentify, this.index, that.hkvInfo.nvrPrechannel);
+ that.startPlayLoading = false;
+ },
+ startRealPlay(szDeviceIdentify, iWndIndex, iChannelID) {
+ var that = this;
+ WebVideoCtrl.I_StartRealPlay(szDeviceIdentify, {
+ iRtspPort: that.iRtspPort,
+ iWndIndex: iWndIndex,
+ iChannelID: iChannelID,
+ bZeroChannel: that.bZeroChannel,
+ iStreamType: 2, //码流类型,2为子码流
+ success: function() {
+ // that.$notify({
+ // title: "成功",
+ // message: "开始预览通道" + iChannelID + "成功",
+ // type: "success",
+ // });
+ },
+ error(status, xmlDoc2) {
+ console.log(xmlDoc2); //不能删除
+ // that.$notify({
+ // title: "失败",
+ // message: "开始预览通道" + iChannelID + "失败",
+ // type: "error",
+ // });
+ if (status === 403) {
+ console.log("szInfo 设备不支持Websocket取流!");
+ } else {
+ console.log("开始预览失败 ", status, xmlDoc2);
+ }
+ },
+ });
+ },
+ videoInitPlugin() {
+ this.$nextTick(() => {
+ var iRet = WebVideoCtrl.I_CheckPluginInstall();
+ if (iRet === -1) {
+ // alert("您还未安装过插件,双击开发包目录里的WebComponentsKit.exe安装");
+ this.myFunction();
+ return;
+ } else {
+ // if (this.ua.match(/msie/) != null || this.ua.match(/trident/) != null) {
+ this.browserType = "IE";
+ this.initPlugin();
+ // } else {
+ // this.$notify({
+ // title: "失败",
+ // message: "请在ie模式下查看摄像头",
+ // type: "error",
+ // });
+ // }
+ }
-
diff --git a/supervise-monitor-ui/src/views/monitor/videos/index2.vue b/supervise-monitor-ui/src/views/monitor/videos/index2.vue
new file mode 100644
index 00000000..5df609a9
--- /dev/null
+++ b/supervise-monitor-ui/src/views/monitor/videos/index2.vue
@@ -0,0 +1,303 @@
+
+
+
+
+
+
diff --git a/yxt-portal-ui/.env.development b/yxt-portal-ui/.env.development
index 8e04a50e..01c78fbe 100644
--- a/yxt-portal-ui/.env.development
+++ b/yxt-portal-ui/.env.development
@@ -5,5 +5,5 @@ ENV = 'development'
VUE_APP_BASE_API = '/api'
## 配置测试和本地开发时的 接口地址
-VUE_APP_URL = "http://192.168.3.20:8112"
+VUE_APP_URL = "http://192.168.3.173:8112"
##VUE_APP_URL = "http://8.130.39.13:8112"