hrsass-components 1.7.24 → 1.7.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -65,7 +65,7 @@ var contentStyle = _interopDefault(require('!!raw-loader!tinymce/skins/content/d
65
65
  var SvgPanZoom = _interopDefault(require('svg-pan-zoom'));
66
66
  var saveSvgAsPng = require('save-svg-as-png');
67
67
 
68
- var version = "1.7.24";
68
+ var version = "1.7.25";
69
69
 
70
70
  /**
71
71
  * 版本号
@@ -1955,6 +1955,18 @@ function Photograph () {
1955
1955
  ws.binaryType = "arraybuffer";
1956
1956
 
1957
1957
  ws.onmessage = function (event) {
1958
+ if (typeof event.data == "string") {
1959
+ if (event.data.indexOf("GetPicBase64:") >= 0) {
1960
+ var strTemp = event.data.substr(13);
1961
+ InfoTextCallback(5, strTemp);
1962
+ } else if (event.data.indexOf("GetPic2Base64:") >= 0) {
1963
+ var strTemp = event.data.substr(14);
1964
+ InfoTextCallback(21, strTemp);
1965
+ }
1966
+
1967
+ return;
1968
+ }
1969
+
1958
1970
  var aDataArray = new Uint8Array(event.data);
1959
1971
 
1960
1972
  if (aDataArray.length > 0) {
@@ -2382,6 +2394,7 @@ function Photograph () {
2382
2394
 
2383
2395
  ws.onopen = function (event) {
2384
2396
  if (enableCanvas) {
2397
+ sendSendStrBase64();
2385
2398
  sendMsgGetMainCameraID();
2386
2399
  sendMsgRefreshDev();
2387
2400
  initParameter(orignalCanvasW, orignalCanvasH, orignalCanvasW2, orignalCanvasH2);
@@ -3040,6 +3053,15 @@ function Photograph () {
3040
3053
  ws.send(aDataArray.buffer);
3041
3054
  }
3042
3055
 
3056
+ function sendSendStrBase64() {
3057
+ var aDataArray = new Uint8Array(4);
3058
+ aDataArray[0] = 0xef;
3059
+ aDataArray[1] = 0xb2;
3060
+ aDataArray[2] = 0x01;
3061
+ aDataArray[3] = 0x01;
3062
+ ws.send(aDataArray.buffer);
3063
+ }
3064
+
3043
3065
  function GetFaceZuobiao(Xdis, Ydis) {
3044
3066
  if (isFaceOpen) {
3045
3067
  for (var j = 0; j < faceNum; j++) {
@@ -3170,20 +3192,23 @@ var HrPhotograph = {
3170
3192
  },
3171
3193
  computed: {
3172
3194
  loading: function loading() {
3173
- return this.connNum < this.deviceNum || this.deviceNum === 0 || this.capturing;
3195
+ return this.connNum < 1 || this.deviceNum === 0 || this.capturing;
3174
3196
  }
3175
3197
  },
3176
3198
  methods: {
3177
3199
  changeDevice: function changeDevice(device) {
3178
3200
  this.activeDevice = device;
3201
+ this.connNum = 0;
3202
+ device === '2' ? (this.photograph.closeMain(), this.photograph.openSub()) : (this.photograph.closeSub(), this.photograph.openMain());
3179
3203
  },
3180
3204
  open: function open() {
3181
3205
  var _this = this;
3182
3206
 
3183
3207
  this.visible = true;
3184
- this.photograph.open();
3185
3208
  this.$nextTick(function () {
3186
3209
  _this.initPhotograph();
3210
+
3211
+ _this.photograph.open();
3187
3212
  });
3188
3213
  },
3189
3214
  close: function close() {
@@ -3230,7 +3255,8 @@ var HrPhotograph = {
3230
3255
  created: function created() {
3231
3256
  var _this2 = this;
3232
3257
 
3233
- var WsUtil;
3258
+ var WsUtil,
3259
+ $this = this;
3234
3260
  var photograph = {
3235
3261
  ratioW: null,
3236
3262
  ratioH: null,
@@ -3251,11 +3277,7 @@ var HrPhotograph = {
3251
3277
  WsUtil.sendMsgStartVideo2(WsUtil.camidSub, this.subRatioW, this.subRatioH);
3252
3278
  },
3253
3279
  open: function open() {
3254
- this.openMain();
3255
-
3256
- if (this.isSecondDev) {
3257
- this.openSub();
3258
- }
3280
+ $this.changeDevice('1');
3259
3281
  },
3260
3282
  closeMain: function closeMain() {
3261
3283
  WsUtil.sendMsgCloseVideo();
@@ -3366,7 +3388,7 @@ var HrPhotograph = {
3366
3388
  canvasSub.height = 375;
3367
3389
  this.canvasMain = canvasMain;
3368
3390
  this.canvasSub = canvasSub;
3369
- this.WsUtil.WsInit(510, 375, 505, 375, true, this.canvasMain, this.canvasSub);
3391
+ this.WsUtil.WsInit(510, 375, 505, 375, true, this.canvasMain, this.canvasSub, '');
3370
3392
 
3371
3393
  window.onmousewheel = document.onmousewheel = function (e) {
3372
3394
  return _this2.onmousewheel(e);