ecinc-cloud-moadesktop 9.6.252 → 9.6.254

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.
@@ -241,13 +241,8 @@ module.exports = {
241
241
  __webpack_require__.r(__webpack_exports__);
242
242
  /* harmony import */ var js_cookie__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2215);
243
243
  /* harmony import */ var js_cookie__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(js_cookie__WEBPACK_IMPORTED_MODULE_0__);
244
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
245
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
246
- function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
247
- function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
248
244
 
249
245
  var $parent = '';
250
- var curInterval = null; // 定时任务
251
246
  var timeSpanData = null; // 考勤时段
252
247
  var p1 = null; // 打卡位置经纬度
253
248
  var gpsScope = null;
@@ -315,72 +310,54 @@ function getCurAddress(lng, lat) {
315
310
  });
316
311
  }
317
312
 
318
- /**
319
- *地图定位 获取当前位置
320
- */
321
- function getCurLocation() {
322
- function h5Position(e) {
323
- if (this.getStatus() == 0) {
324
- getDis(e.lnglat.lng, e.lnglat.lat);
325
- getCurAddress(e.lnglat.lng, e.lnglat.lat);
326
- } else {
327
- console.log('Geolocation getCurrentPosition status', lo.getStatus());
328
- $parent.dakaType = dakaType[0];
329
- }
330
- }
331
- var lo = new T.Geolocation();
332
- lo.getCurrentPosition(h5Position);
333
- }
334
313
  // 定位
335
314
  function curLocationAndDis() {
336
315
  var device = js_cookie__WEBPACK_IMPORTED_MODULE_0___default().get('device');
337
- if (curInterval) {
338
- clearInterval(curInterval);
339
- }
340
- if (window.mappType === 'ecinc') {
341
- //APP定位
342
- $parent.$wv.getLocationInformation(function (res) {
343
- if (typeof res === 'string') res = JSON.parse(res);
344
- if (res && res.data) {
345
- getDis(Number(res.data.longitude), Number(res.data.latitude));
346
- getCurAddress(Number(res.data.longitude), Number(res.data.latitude));
347
- } else {
348
- console.log('$wv getCurrentPosition res =', res);
349
- $parent.dakaType = dakaType[0];
350
- }
351
- });
352
- curInterval = setInterval(function () {
316
+ return new Promise(function (resolve) {
317
+ if (window.mappType === 'ecinc') {
318
+ //APP定位
353
319
  $parent.$wv.getLocationInformation(function (res) {
354
320
  if (typeof res === 'string') res = JSON.parse(res);
355
321
  if (res && res.data) {
356
322
  getDis(Number(res.data.longitude), Number(res.data.latitude));
357
323
  getCurAddress(Number(res.data.longitude), Number(res.data.latitude));
324
+ resolve(true);
358
325
  } else {
359
326
  console.log('$wv getCurrentPosition res =', res);
360
- $parent.dakaType = dakaType[0];
327
+ resolve(false);
361
328
  }
362
329
  });
363
- }, 1000 * 30);
364
- } else if (window.isOpenMapLocation === 1) {
365
- // H5地图定位
366
- getCurLocation();
367
- curInterval = setInterval(getCurLocation, 1000 * 30); ////定时刷新定位信息
368
- } else if (device === 'qywx') {
369
- // 企业微信定位
370
- window.wx.getLocation({
371
- type: 'gcj02',
372
- // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
373
- success: function success(resp) {
374
- getDis(resp.longitude, resp.latitude);
375
- getCurAddress(resp.longitude, resp.latitude);
376
-
377
- // var latitude = res.latitude; // 纬度,浮点数,范围为90 ~ -90
378
- // var longitude = res.longitude; // 经度,浮点数,范围为180 ~ -180。
379
- // var speed = res.speed; // 速度,以米/每秒计
380
- // var accuracy = res.accuracy; // 位置精度
381
- }
382
- });
383
- }
330
+ } else if (window.isOpenMapLocation === 1) {
331
+ //H5地图定位
332
+ var h5Position = function h5Position(e) {
333
+ if (this.getStatus() == 0) {
334
+ getDis(e.lnglat.lng, e.lnglat.lat);
335
+ getCurAddress(e.lnglat.lng, e.lnglat.lat);
336
+ resolve(true);
337
+ } else {
338
+ console.log('Geolocation getCurrentPosition status', lo.getStatus());
339
+ resolve(false);
340
+ }
341
+ };
342
+ var lo = new T.Geolocation();
343
+ lo.getCurrentPosition(h5Position);
344
+ } else if (device === 'qywx') {
345
+ // 企业微信定位
346
+ window.wx.getLocation({
347
+ type: 'gcj02',
348
+ // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
349
+ success: function success(resp) {
350
+ getDis(resp.longitude, resp.latitude);
351
+ getCurAddress(resp.longitude, resp.latitude);
352
+ resolve(true);
353
+ },
354
+ fail: function fail(error) {
355
+ resolve(false);
356
+ consloe.log('用户拒绝获取位置信息');
357
+ }
358
+ });
359
+ }
360
+ });
384
361
  }
385
362
  var defaultMethods = {
386
363
  /**
@@ -391,145 +368,132 @@ var defaultMethods = {
391
368
  $parent = $scope;
392
369
  loginUser = $scope.loginUser;
393
370
  }
394
- var today = new Date();
395
- var y = today.getFullYear();
396
- var m = today.getMonth();
397
- var d = today.getDate();
398
- var h = today.getHours();
399
- var mins = today.getMinutes();
400
- // const sec = today.getSeconds()
401
- occureDate = y + '-' + (m >= 9 ? m + 1 : '0' + (m + 1)) + '-' + (d > 9 ? d : '0' + d) + ' ' + (h > 9 ? h : '0' + h) + ':' + (mins > 9 ? mins : '0' + mins);
402
- tDate = y + '-' + (m >= 9 ? m + 1 : '0' + (m + 1)) + '-' + (d > 9 ? d : '0' + d);
403
- // 获取打卡时段
404
- $parent.$http({
405
- method: 'POST',
406
- url: 'ecykq/timeInterval/getDakaTime',
407
- headers: {
408
- 'Content-Type': 'application/x-www-form-urlencoded'
409
- },
410
- params: {
411
- account: loginUser.personAccount,
412
- occurredDate: tDate,
413
- orgCode: loginUser.orgCode
414
- }
415
- }).then(function (response) {
416
- if (response.code === 'success') {
417
- timeSpanData = JSON.parse(response.body.json);
418
- timeSpanData.dakaType = Number(timeSpanData.dakaType);
419
- // if (!this.isLoad) {
420
- // this.isLoad = true
421
- if (!timeSpanData.mobileSign || !timeSpanData.addressList || timeSpanData.addressList.length === 0) {
422
- $parent.dakaType = dakaType[0];
423
- return $parent.$toast.fail('移动打卡功能异常,请联系管理员开启或设置考勤位置信息!');
424
- }
425
- $parent.dakaType = dakaType[timeSpanData.dakaType];
426
- curLocationAndDis(); // 获取位置信息
427
-
428
- var nowtime = moment(new Date()).format('HH:mm');
429
- if (timeSpanData.timeInterval && (nowtime > timeSpanData.timeInterval.logonStart && nowtime < timeSpanData.timeInterval.logonEnd || nowtime === timeSpanData.timeInterval.logonStart || nowtime === timeSpanData.timeInterval.logonEnd)) {
430
- timeSpanData.timeInterval.showTime = timeSpanData.timeInterval.logonRecordTime ? timeSpanData.timeInterval.logonRecordTime : '未打卡';
431
- timeSpanData.timeInterval.showStatus = timeSpanData.timeInterval.logonRecordTime ? 1 : 3;
432
- } else if (timeSpanData.timeInterval && (nowtime > timeSpanData.timeInterval.logoffStart && nowtime < timeSpanData.timeInterval.logoffEnd || nowtime === timeSpanData.timeInterval.logoffStart || nowtime === timeSpanData.timeInterval.logoffEnd)) {
433
- timeSpanData.timeInterval.showTime = timeSpanData.timeInterval.logoffRecordTime ? timeSpanData.timeInterval.logoffRecordTime : '未打卡';
434
- timeSpanData.timeInterval.showStatus = timeSpanData.timeInterval.logoffRecordTime ? 1 : 3;
435
- } else if (timeSpanData.timeInterval && (nowtime > timeSpanData.timeInterval.logoffStart && nowtime > timeSpanData.timeInterval.logoffEnd || nowtime === timeSpanData.timeInterval.logoffStart || nowtime === timeSpanData.timeInterval.logoffEnd)) {
436
- timeSpanData.timeInterval.showTime = timeSpanData.timeInterval.logoffRecordTime ? timeSpanData.timeInterval.logoffRecordTime : '未打卡';
437
- timeSpanData.timeInterval.showStatus = timeSpanData.timeInterval.logoffRecordTime ? 1 : 3;
371
+ return new Promise(function (resolve) {
372
+ var today = new Date();
373
+ var y = today.getFullYear();
374
+ var m = today.getMonth();
375
+ var d = today.getDate();
376
+ var h = today.getHours();
377
+ var mins = today.getMinutes();
378
+ // const sec = today.getSeconds()
379
+ occureDate = y + '-' + (m >= 9 ? m + 1 : '0' + (m + 1)) + '-' + (d > 9 ? d : '0' + d) + ' ' + (h > 9 ? h : '0' + h) + ':' + (mins > 9 ? mins : '0' + mins);
380
+ tDate = y + '-' + (m >= 9 ? m + 1 : '0' + (m + 1)) + '-' + (d > 9 ? d : '0' + d);
381
+ // 获取打卡时段
382
+ $parent.$http({
383
+ method: 'POST',
384
+ url: 'ecykq/timeInterval/getDakaTime',
385
+ headers: {
386
+ 'Content-Type': 'application/x-www-form-urlencoded'
387
+ },
388
+ params: {
389
+ account: loginUser.personAccount,
390
+ occurredDate: tDate,
391
+ orgCode: loginUser.orgCode
392
+ }
393
+ }).then(function (response) {
394
+ if (response.code === 'success') {
395
+ timeSpanData = JSON.parse(response.body.json);
396
+ timeSpanData.dakaType = Number(timeSpanData.dakaType);
397
+ // if (!this.isLoad) {
398
+ // this.isLoad = true
399
+ if (!timeSpanData.mobileSign || !timeSpanData.addressList || timeSpanData.addressList.length === 0) {
400
+ $parent.dakaType = dakaType[0];
401
+ return $parent.$toast.fail('移动打卡功能异常,请联系管理员开启或设置考勤位置信息!');
402
+ }
403
+ var nowtime = moment(new Date()).format('HH:mm');
404
+ if (timeSpanData.timeInterval && (nowtime > timeSpanData.timeInterval.logonStart && nowtime < timeSpanData.timeInterval.logonEnd || nowtime === timeSpanData.timeInterval.logonStart || nowtime === timeSpanData.timeInterval.logonEnd)) {
405
+ timeSpanData.timeInterval.showTime = timeSpanData.timeInterval.logonRecordTime ? timeSpanData.timeInterval.logonRecordTime : '未打卡';
406
+ timeSpanData.timeInterval.showStatus = timeSpanData.timeInterval.logonRecordTime ? 1 : 3;
407
+ } else if (timeSpanData.timeInterval && (nowtime > timeSpanData.timeInterval.logoffStart && nowtime < timeSpanData.timeInterval.logoffEnd || nowtime === timeSpanData.timeInterval.logoffStart || nowtime === timeSpanData.timeInterval.logoffEnd)) {
408
+ timeSpanData.timeInterval.showTime = timeSpanData.timeInterval.logoffRecordTime ? timeSpanData.timeInterval.logoffRecordTime : '未打卡';
409
+ timeSpanData.timeInterval.showStatus = timeSpanData.timeInterval.logoffRecordTime ? 1 : 3;
410
+ } else if (timeSpanData.timeInterval && (nowtime > timeSpanData.timeInterval.logoffStart && nowtime > timeSpanData.timeInterval.logoffEnd || nowtime === timeSpanData.timeInterval.logoffStart || nowtime === timeSpanData.timeInterval.logoffEnd)) {
411
+ timeSpanData.timeInterval.showTime = timeSpanData.timeInterval.logoffRecordTime ? timeSpanData.timeInterval.logoffRecordTime : '未打卡';
412
+ timeSpanData.timeInterval.showStatus = timeSpanData.timeInterval.logoffRecordTime ? 1 : 3;
413
+ } else {
414
+ timeSpanData.timeInterval = timeSpanData.timeInterval || {};
415
+ timeSpanData.timeInterval.showTime = nowtime;
416
+ timeSpanData.timeInterval.showStatus = 0;
417
+ }
418
+ $parent.timeInterval = timeSpanData.timeInterval;
419
+ $parent.$forceUpdate();
420
+
421
+ // 获取位置信息
422
+ curLocationAndDis().then(function (res) {
423
+ if (!res) {
424
+ $parent.dakaType = dakaType[0];
425
+ }
426
+ if ($parent.dakaType !== dakaType[0]) {
427
+ $parent.dakaType = dakaType[timeSpanData.dakaType];
428
+ }
429
+ resolve(res);
430
+ });
438
431
  } else {
439
- timeSpanData.timeInterval = timeSpanData.timeInterval || {};
440
- timeSpanData.timeInterval.showTime = nowtime;
441
- timeSpanData.timeInterval.showStatus = 0;
432
+ $parent.dakaType = dakaType[0];
433
+ $parent.$toast.fail(response.message);
442
434
  }
443
- $parent.timeInterval = timeSpanData.timeInterval;
444
- $parent.$forceUpdate();
445
- // }
446
- } else {
447
- $parent.$toast.fail(response.message);
448
- }
435
+ });
449
436
  });
450
437
  },
451
438
  // 打卡
452
439
  dkEvent: function dkEvent($scope) {
453
440
  var _this = this;
454
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
455
- var departmentId, departmentName;
456
- return _regeneratorRuntime().wrap(function _callee$(_context) {
457
- while (1) switch (_context.prev = _context.next) {
458
- case 0:
459
- $parent = $scope;
460
- _context.next = 3;
461
- return _this.freshData($scope);
462
- case 3:
463
- if (!(timeSpanData && timeSpanData.mobileSign !== 1)) {
464
- _context.next = 5;
465
- break;
466
- }
467
- return _context.abrupt("return");
468
- case 5:
469
- if (!(!dis || dis === 'undefined' || dis === null)) {
470
- _context.next = 7;
471
- break;
472
- }
473
- return _context.abrupt("return");
474
- case 7:
475
- if (!(dis && dis > gpsScope)) {
476
- _context.next = 9;
477
- break;
478
- }
479
- return _context.abrupt("return", $parent.$toast.fail('当前不在考勤范围内'));
480
- case 9:
481
- departmentId = loginUser.staffList[0].orgFullId.split('-');
482
- departmentName = loginUser.staffList[0].orgFullName.split('-');
483
- departmentId = departmentId[departmentId.length - 1];
484
- departmentName = departmentName[departmentName.length - 1];
485
- if (!canDk) {
486
- _context.next = 17;
487
- break;
488
- }
489
- canDk = false;
490
- _context.next = 18;
491
- break;
492
- case 17:
493
- return _context.abrupt("return");
494
- case 18:
495
- setTimeout(function () {
496
- canDk = true;
497
- }, 800);
498
- $parent.$http({
499
- url: 'ecykq/recordDetail/saveMobileDakaDetail',
500
- method: 'POST',
501
- data: {
502
- account: loginUser.personAccount,
503
- departmentId: departmentId,
504
- departmentName: departmentName,
505
- name: loginUser.personName,
506
- occureDate: occureDate,
507
- orgCode: loginUser.orgCode,
508
- orgName: loginUser.orgName,
509
- personSchId: timeSpanData.personSchId,
510
- timeId: timeSpanData.timeInterval.id,
511
- unitAddress: curAddress
512
- }
513
- }).then(function (response) {
514
- if (response.code === 'success') {
515
- _this.freshData();
516
- if (parseInt(timeSpanData.dakaType) === 1 || parseInt(timeSpanData.dakaType) === 2) {
517
- $parent.$toast('打卡成功!');
518
- } else if (parseInt(timeSpanData.dakaType) === 3) {
519
- $parent.$toast('更新打卡成功!');
520
- }
521
- } else {
522
- $parent.$toast.fail(response.message);
523
- }
524
- }, function (err) {
525
- $parent.$toast.fail(err);
526
- });
527
- case 20:
528
- case "end":
529
- return _context.stop();
441
+ $parent = $scope;
442
+
443
+ // 刷新一次数据
444
+ this.freshData($scope).then(function (res) {
445
+ if (timeSpanData && timeSpanData.mobileSign !== 1) {
446
+ return;
447
+ }
448
+ if (!dis || dis === 'undefined' || dis === null) {
449
+ return;
450
+ }
451
+ if (dis && dis > gpsScope) {
452
+ $parent.dakaType = dakaType[0];
453
+ return $parent.$toast.fail('当前地点不在考勤打卡范围内');
454
+ }
455
+ var departmentId = loginUser.staffList[0].orgFullId.split('-');
456
+ var departmentName = loginUser.staffList[0].orgFullName.split('-');
457
+ departmentId = departmentId[departmentId.length - 1];
458
+ departmentName = departmentName[departmentName.length - 1];
459
+ if (canDk) {
460
+ canDk = false;
461
+ } else {
462
+ return;
463
+ }
464
+ setTimeout(function () {
465
+ canDk = true;
466
+ }, 800);
467
+ $parent.$http({
468
+ url: 'ecykq/recordDetail/saveMobileDakaDetail',
469
+ method: 'POST',
470
+ data: {
471
+ account: loginUser.personAccount,
472
+ departmentId: departmentId,
473
+ departmentName: departmentName,
474
+ name: loginUser.personName,
475
+ occureDate: occureDate,
476
+ orgCode: loginUser.orgCode,
477
+ orgName: loginUser.orgName,
478
+ personSchId: timeSpanData.personSchId,
479
+ timeId: timeSpanData.timeInterval.id,
480
+ unitAddress: curAddress
481
+ }
482
+ }).then(function (response) {
483
+ if (response.code === 'success') {
484
+ _this.freshData();
485
+ if (parseInt(timeSpanData.dakaType) === 1 || parseInt(timeSpanData.dakaType) === 2) {
486
+ $parent.$toast('打卡成功!');
487
+ } else if (parseInt(timeSpanData.dakaType) === 3) {
488
+ $parent.$toast('更新打卡成功!');
489
+ }
490
+ } else {
491
+ $parent.$toast.fail(response.message);
530
492
  }
531
- }, _callee);
532
- }))();
493
+ }, function (err) {
494
+ $parent.$toast.fail(err);
495
+ });
496
+ });
533
497
  }
534
498
  };
535
499
  /* harmony default export */ __webpack_exports__["default"] = (defaultMethods);
@@ -620,7 +584,7 @@ ___CSS_LOADER_EXPORT___.push([module.id, ".no-data[data-v-ef203e2e]{display:-web
620
584
 
621
585
  /***/ }),
622
586
 
623
- /***/ 5470:
587
+ /***/ 4147:
624
588
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
625
589
 
626
590
  "use strict";
@@ -639,7 +603,7 @@ var ___CSS_LOADER_URL_IMPORT_0___ = new URL(/* asset import */ __webpack_require
639
603
  var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
640
604
  var ___CSS_LOADER_URL_REPLACEMENT_0___ = _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_0___);
641
605
  // Module
642
- ___CSS_LOADER_EXPORT___.push([module.id, "[data-v-6c6c5bb3] .van-ellipsis{font-size:18px;color:#fff}[data-v-6c6c5bb3] .van-dropdown-menu__title{color:#fff!important;padding:0 8px 0 0!important}[data-v-6c6c5bb3] .van-dropdown-menu .van-dropdown-menu__bar .van-dropdown-menu__title--active{color:#fff!important}[data-v-6c6c5bb3] .van-dropdown-menu__title:after{border-color:transparent transparent #fff #fff!important;right:0}[data-v-6c6c5bb3] .van-dropdown-menu__bar{background-color:unset!important;-webkit-box-shadow:unset!important;box-shadow:unset!important}[data-v-6c6c5bb3] .van-dropdown-menu__item{-webkit-box-pack:left;-ms-flex-pack:left;justify-content:left}[data-v-6c6c5bb3] .chat_icon .van-info{top:5px!important;right:-4px!important}.work_pageHeader[data-v-6c6c5bb3]{background:url(" + ___CSS_LOADER_URL_REPLACEMENT_0___ + ");padding:0 16px;height:123px;font-size:16px;color:#fff;background-repeat:no-repeat;background-size:cover;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;overflow:hidden;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-transition:height .3s;transition:height .3s}.work_pageHeader[data-v-6c6c5bb3],.work_pageHeader .flex-horizon-bw[data-v-6c6c5bb3]{display:-webkit-box;display:-ms-flexbox;display:flex;width:100%}.work_pageHeader .flex-horizon-bw[data-v-6c6c5bb3]{-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.work_pageHeader .pageHeader_compony[data-v-6c6c5bb3]{font-size:18px;font-weight:500;color:#fff;-webkit-box-flex:1;-ms-flex:1;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-right:10px;height:48px;line-height:48px}.work_pageHeader .pageHeader_name[data-v-6c6c5bb3]{font-size:14px;margin-left:8px}.work_pageHeader .pageHeader_check_work[data-v-6c6c5bb3]{width:122px;border-radius:15px;background:hsla(0,0%,100%,.8);padding:7px 10px;display:-webkit-box;display:-ms-flexbox;display:flex;color:#333;font-size:12px}.work_pageHeader .pageHeader_timer[data-v-6c6c5bb3]{-webkit-box-flex:1;-ms-flex:1;flex:1;text-align:right;color:#fff;font-size:14px;line-height:30px;margin-right:16px}.work_pageHeader .more_compony[data-v-6c6c5bb3]{position:relative;-webkit-transform:rotate(90deg);transform:rotate(90deg);font-size:10px;margin-left:6px}.check_time[data-v-6c6c5bb3]{-webkit-box-flex:1;-ms-flex:1;flex:1;border-right:1px solid #999;text-align:left;font-size:13px;color:#333;position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.check_time img[data-v-6c6c5bb3]{width:14px;height:14px}.check_time span[data-v-6c6c5bb3]{margin-left:5px}.check_button[data-v-6c6c5bb3]{-webkit-box-flex:1;-ms-flex:1;flex:1;text-align:right;line-height:18px}", ""]);
606
+ ___CSS_LOADER_EXPORT___.push([module.id, "[data-v-5bb0f910] .van-ellipsis{font-size:18px;color:#fff}[data-v-5bb0f910] .van-dropdown-menu__title{color:#fff!important;padding:0 8px 0 0!important}[data-v-5bb0f910] .van-dropdown-menu .van-dropdown-menu__bar .van-dropdown-menu__title--active{color:#fff!important}[data-v-5bb0f910] .van-dropdown-menu__title:after{border-color:transparent transparent #fff #fff!important;right:0}[data-v-5bb0f910] .van-dropdown-menu__bar{background-color:unset!important;-webkit-box-shadow:unset!important;box-shadow:unset!important}[data-v-5bb0f910] .van-dropdown-menu__item{-webkit-box-pack:left;-ms-flex-pack:left;justify-content:left}[data-v-5bb0f910] .chat_icon .van-info{top:5px!important;right:-4px!important}.work_pageHeader[data-v-5bb0f910]{background:url(" + ___CSS_LOADER_URL_REPLACEMENT_0___ + ");padding:0 16px;height:123px;font-size:16px;color:#fff;background-repeat:no-repeat;background-size:cover;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;overflow:hidden;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-transition:height .3s;transition:height .3s}.work_pageHeader[data-v-5bb0f910],.work_pageHeader .flex-horizon-bw[data-v-5bb0f910]{display:-webkit-box;display:-ms-flexbox;display:flex;width:100%}.work_pageHeader .flex-horizon-bw[data-v-5bb0f910]{-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.work_pageHeader .pageHeader_compony[data-v-5bb0f910]{font-size:18px;font-weight:500;color:#fff;-webkit-box-flex:1;-ms-flex:1;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-right:10px;height:48px;line-height:48px}.work_pageHeader .pageHeader_name[data-v-5bb0f910]{font-size:14px;margin-left:8px}.work_pageHeader .pageHeader_check_work[data-v-5bb0f910]{width:122px;border-radius:15px;background:hsla(0,0%,100%,.8);padding:7px 10px;display:-webkit-box;display:-ms-flexbox;display:flex;color:#333;font-size:12px}.work_pageHeader .pageHeader_timer[data-v-5bb0f910]{-webkit-box-flex:1;-ms-flex:1;flex:1;text-align:right;color:#fff;font-size:14px;line-height:30px;margin-right:16px}.work_pageHeader .more_compony[data-v-5bb0f910]{position:relative;-webkit-transform:rotate(90deg);transform:rotate(90deg);font-size:10px;margin-left:6px}.check_time[data-v-5bb0f910]{-webkit-box-flex:1;-ms-flex:1;flex:1;border-right:1px solid #999;text-align:left;font-size:13px;color:#333;position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.check_time img[data-v-5bb0f910]{width:14px;height:14px}.check_time span[data-v-5bb0f910]{margin-left:5px}.check_button[data-v-5bb0f910]{-webkit-box-flex:1;-ms-flex:1;flex:1;text-align:right;line-height:18px}", ""]);
643
607
  // Exports
644
608
  /* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
645
609
 
@@ -22667,19 +22631,19 @@ var update = add("b0496ae0", content, true, {"sourceMap":false,"shadowMode":fals
22667
22631
 
22668
22632
  /***/ }),
22669
22633
 
22670
- /***/ 6244:
22634
+ /***/ 817:
22671
22635
  /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
22672
22636
 
22673
22637
  // style-loader: Adds some css to the DOM by adding a <style> tag
22674
22638
 
22675
22639
  // load the styles
22676
- var content = __webpack_require__(5470);
22640
+ var content = __webpack_require__(4147);
22677
22641
  if(content.__esModule) content = content.default;
22678
22642
  if(typeof content === 'string') content = [[module.id, content, '']];
22679
22643
  if(content.locals) module.exports = content.locals;
22680
22644
  // add the styles to the DOM
22681
22645
  var add = (__webpack_require__(9548)/* ["default"] */ .A)
22682
- var update = add("9a4c44b8", content, true, {"sourceMap":false,"shadowMode":false});
22646
+ var update = add("7ae6780e", content, true, {"sourceMap":false,"shadowMode":false});
22683
22647
 
22684
22648
  /***/ }),
22685
22649
 
@@ -27698,8 +27662,8 @@ var commonApps_component = normalizeComponent(
27698
27662
  )
27699
27663
 
27700
27664
  /* harmony default export */ var commonApps = (commonApps_component.exports);
27701
- ;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[0]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/ecmoa/desktop/src/components/workHead.vue?vue&type=template&id=6c6c5bb3&scoped=true
27702
- var workHeadvue_type_template_id_6c6c5bb3_scoped_true_render = function render() {
27665
+ ;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[0]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/ecmoa/desktop/src/components/workHead.vue?vue&type=template&id=5bb0f910&scoped=true
27666
+ var workHeadvue_type_template_id_5bb0f910_scoped_true_render = function render() {
27703
27667
  var _vm = this,
27704
27668
  _c = _vm._self._c;
27705
27669
  return _c('div', {
@@ -27823,7 +27787,7 @@ var workHeadvue_type_template_id_6c6c5bb3_scoped_true_render = function render()
27823
27787
  staticClass: "pageHeader_timer"
27824
27788
  }, [_c('span', [_vm._v(_vm._s(_vm.nowDay))])])])]);
27825
27789
  };
27826
- var workHeadvue_type_template_id_6c6c5bb3_scoped_true_staticRenderFns = [];
27790
+ var workHeadvue_type_template_id_5bb0f910_scoped_true_staticRenderFns = [];
27827
27791
 
27828
27792
  ;// CONCATENATED MODULE: ./node_modules/vuex/dist/vuex.esm.js
27829
27793
  /*!
@@ -29014,11 +28978,15 @@ var workClock = __webpack_require__(2396);
29014
28978
  organName: '',
29015
28979
  nowDay: '',
29016
28980
  orgCode: '',
29017
- dakaType: '',
28981
+ dakaType: '正在定位',
29018
28982
  ecykqPath: '',
29019
28983
  canClockIn: false,
29020
28984
  boxHeight: 123,
29021
- timeInterval: {} // 签到校验信息
28985
+ timeInterval: {},
28986
+ // 签到校验信息
28987
+ timer: '',
28988
+ //时钟定时器
28989
+ curInterval: '' // 勤数据更新定时器
29022
28990
  };
29023
28991
  },
29024
28992
  computed: _objectSpread({}, mapGetters({
@@ -29044,6 +29012,8 @@ var workClock = __webpack_require__(2396);
29044
29012
  this.getBgImg();
29045
29013
  },
29046
29014
  beforeDestroy: function beforeDestroy() {
29015
+ if (this.timer) clearInterval(this.timer);
29016
+ if (this.curInterval) clearInterval(this.curInterval);
29047
29017
  this.$bus.off('reduceHeadHeight', this.reduceHeadHeight);
29048
29018
  },
29049
29019
  mounted: function mounted() {
@@ -29051,9 +29021,9 @@ var workClock = __webpack_require__(2396);
29051
29021
  this.loadH5apps();
29052
29022
  this.formatNowDay();
29053
29023
  this.getTime();
29054
- setInterval(function () {
29024
+ this.timer = setInterval(function () {
29055
29025
  _this2.getTime();
29056
- }, 1000 * 60);
29026
+ }, 1000 * 2);
29057
29027
  },
29058
29028
  methods: {
29059
29029
  scan: function scan() {
@@ -29120,7 +29090,7 @@ var workClock = __webpack_require__(2396);
29120
29090
  productCode = window.productCode;
29121
29091
  }
29122
29092
  url = "/apigw" + '/mpp/image/download?nameField=fileName&dataField=image&id=' + res.body.listdata[0].id + '&httpPort=' + location.port + '&productCode=' + productCode;
29123
- document.querySelector('.work_pageHeader').style.background = "url(".concat(url, ")");
29093
+ document.querySelector('.work_pageHeader').style.background = 'url(' + url + ')';
29124
29094
  document.querySelector('.work_pageHeader').style.backgroundSize = 'cover';
29125
29095
  document.querySelector('.work_pageHeader').style.backgroundRepeat = 'no-repeat';
29126
29096
  }
@@ -29203,6 +29173,13 @@ var workClock = __webpack_require__(2396);
29203
29173
  } else if (workClock.default) {
29204
29174
  workClock.default.freshData(_this5);
29205
29175
  }
29176
+ _this5.curInterval = setInterval(function () {
29177
+ if (workClock.freshData) {
29178
+ workClock.freshData(_this5);
29179
+ } else if (workClock.default) {
29180
+ workClock.default.freshData(_this5);
29181
+ }
29182
+ }, 1000 * 60);
29206
29183
  });
29207
29184
  }
29208
29185
  }
@@ -29294,9 +29271,9 @@ var workClock = __webpack_require__(2396);
29294
29271
  });
29295
29272
  ;// CONCATENATED MODULE: ./packages/ecmoa/desktop/src/components/workHead.vue?vue&type=script&lang=js
29296
29273
  /* harmony default export */ var components_workHeadvue_type_script_lang_js = (workHeadvue_type_script_lang_js);
29297
- // EXTERNAL MODULE: ./node_modules/vue-style-loader/index.js??clonedRuleSet-22.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-22.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[2]!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[3]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-22.use[4]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/ecmoa/desktop/src/components/workHead.vue?vue&type=style&index=0&id=6c6c5bb3&prod&scoped=true&lang=scss
29298
- var workHeadvue_type_style_index_0_id_6c6c5bb3_prod_scoped_true_lang_scss = __webpack_require__(6244);
29299
- ;// CONCATENATED MODULE: ./packages/ecmoa/desktop/src/components/workHead.vue?vue&type=style&index=0&id=6c6c5bb3&prod&scoped=true&lang=scss
29274
+ // EXTERNAL MODULE: ./node_modules/vue-style-loader/index.js??clonedRuleSet-22.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-22.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[2]!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[3]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-22.use[4]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/ecmoa/desktop/src/components/workHead.vue?vue&type=style&index=0&id=5bb0f910&prod&scoped=true&lang=scss
29275
+ var workHeadvue_type_style_index_0_id_5bb0f910_prod_scoped_true_lang_scss = __webpack_require__(817);
29276
+ ;// CONCATENATED MODULE: ./packages/ecmoa/desktop/src/components/workHead.vue?vue&type=style&index=0&id=5bb0f910&prod&scoped=true&lang=scss
29300
29277
 
29301
29278
  ;// CONCATENATED MODULE: ./packages/ecmoa/desktop/src/components/workHead.vue
29302
29279
 
@@ -29309,11 +29286,11 @@ var workHeadvue_type_style_index_0_id_6c6c5bb3_prod_scoped_true_lang_scss = __we
29309
29286
 
29310
29287
  var workHead_component = normalizeComponent(
29311
29288
  components_workHeadvue_type_script_lang_js,
29312
- workHeadvue_type_template_id_6c6c5bb3_scoped_true_render,
29313
- workHeadvue_type_template_id_6c6c5bb3_scoped_true_staticRenderFns,
29289
+ workHeadvue_type_template_id_5bb0f910_scoped_true_render,
29290
+ workHeadvue_type_template_id_5bb0f910_scoped_true_staticRenderFns,
29314
29291
  false,
29315
29292
  null,
29316
- "6c6c5bb3",
29293
+ "5bb0f910",
29317
29294
  null
29318
29295
 
29319
29296
  )