完成签约之后直接添加人员,录入下发凭证
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2276 lines
83 KiB

  1. webpackJsonp([25,67],{
  2. /***/ "1dxu":
  3. /***/ (function(module, exports) {
  4. // removed by extract-text-webpack-plugin
  5. /***/ }),
  6. /***/ "K8oN":
  7. /***/ (function(module, exports) {
  8. // removed by extract-text-webpack-plugin
  9. /***/ }),
  10. /***/ "TTKD":
  11. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12. "use strict";
  13. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  14. // EXTERNAL MODULE: ./node_modules/babel-runtime/helpers/defineProperty.js
  15. var defineProperty = __webpack_require__("bOdI");
  16. var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty);
  17. // EXTERNAL MODULE: ./node_modules/babel-runtime/core-js/promise.js
  18. var promise = __webpack_require__("//Fk");
  19. var promise_default = /*#__PURE__*/__webpack_require__.n(promise);
  20. // EXTERNAL MODULE: ./node_modules/babel-runtime/regenerator/index.js
  21. var regenerator = __webpack_require__("Xxa5");
  22. var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator);
  23. // EXTERNAL MODULE: ./node_modules/babel-runtime/helpers/asyncToGenerator.js
  24. var asyncToGenerator = __webpack_require__("exGp");
  25. var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
  26. // EXTERNAL MODULE: ./node_modules/babel-runtime/core-js/json/stringify.js
  27. var stringify = __webpack_require__("mvHQ");
  28. var stringify_default = /*#__PURE__*/__webpack_require__.n(stringify);
  29. // EXTERNAL MODULE: ./src/api/index.js + 5 modules
  30. var api = __webpack_require__("gyMJ");
  31. // EXTERNAL MODULE: ./src/components/zTree1.vue + 2 modules
  32. var zTree1 = __webpack_require__("6Ljo");
  33. // EXTERNAL MODULE: ./src/components/deviceLi.vue + 2 modules
  34. var deviceLi = __webpack_require__("4qFG");
  35. // EXTERNAL MODULE: ./src/components/UnlockRecord.vue + 2 modules
  36. var UnlockRecord = __webpack_require__("YBqH");
  37. // EXTERNAL MODULE: ./src/components/DeviceFeedbackLog.vue + 2 modules
  38. var DeviceFeedbackLog = __webpack_require__("5skf");
  39. // EXTERNAL MODULE: ./src/views/log/humanMotionSensorLog.vue + 2 modules
  40. var humanMotionSensorLog = __webpack_require__("WbCw");
  41. // EXTERNAL MODULE: ./src/utils/index.js
  42. var utils = __webpack_require__("0xDb");
  43. // EXTERNAL MODULE: ./node_modules/xlsx/xlsx.js
  44. var xlsx = __webpack_require__("uXZL");
  45. var xlsx_default = /*#__PURE__*/__webpack_require__.n(xlsx);
  46. // EXTERNAL MODULE: ./src/utils/util.js
  47. var util = __webpack_require__("oFuF");
  48. // EXTERNAL MODULE: ./src/utils/equipment.js
  49. var equipment = __webpack_require__("ObZk");
  50. // EXTERNAL MODULE: ./node_modules/moment/moment.js
  51. var moment = __webpack_require__("PJh5");
  52. var moment_default = /*#__PURE__*/__webpack_require__.n(moment);
  53. // EXTERNAL MODULE: ./src/api/allFun.js
  54. var allFun = __webpack_require__("mprh");
  55. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./src/views/device/humanMotionSensorDevice.vue
  56. var _methods;
  57. //
  58. //
  59. //
  60. //
  61. //
  62. //
  63. //
  64. //
  65. //
  66. //
  67. //
  68. //
  69. //
  70. //
  71. //
  72. //
  73. //
  74. //
  75. //
  76. //
  77. //
  78. //
  79. //
  80. //
  81. //
  82. //
  83. //
  84. //
  85. //
  86. //
  87. //
  88. //
  89. //
  90. //
  91. //
  92. //
  93. //
  94. //
  95. //
  96. //
  97. //
  98. //
  99. //
  100. //
  101. //
  102. //
  103. //
  104. //
  105. //
  106. //
  107. //
  108. //
  109. //
  110. //
  111. //
  112. //
  113. //
  114. //
  115. //
  116. //
  117. //
  118. //
  119. //
  120. //
  121. //
  122. //
  123. //
  124. //
  125. //
  126. //
  127. //
  128. //
  129. //
  130. //
  131. //
  132. //
  133. //
  134. //
  135. //
  136. //
  137. //
  138. //
  139. //
  140. //
  141. //
  142. //
  143. //
  144. //
  145. //
  146. //
  147. //
  148. //
  149. //
  150. //
  151. //
  152. //
  153. //
  154. //
  155. //
  156. //
  157. //
  158. //
  159. //
  160. //
  161. //
  162. //
  163. //
  164. //
  165. //
  166. //
  167. //
  168. //
  169. //
  170. //
  171. //
  172. //
  173. //
  174. //
  175. //
  176. //
  177. //
  178. //
  179. //
  180. //
  181. //
  182. //
  183. //
  184. //
  185. //
  186. //
  187. //
  188. //
  189. //
  190. //
  191. //
  192. //
  193. //
  194. //
  195. //
  196. //
  197. //
  198. //
  199. //
  200. //
  201. //
  202. //
  203. //
  204. //
  205. //
  206. //
  207. //
  208. //
  209. //
  210. //
  211. //
  212. //
  213. //
  214. //
  215. //
  216. //
  217. //
  218. //
  219. //
  220. //
  221. //
  222. //
  223. //
  224. //
  225. //
  226. //
  227. //
  228. //
  229. //
  230. //
  231. //
  232. //
  233. //
  234. //
  235. //
  236. //
  237. //
  238. //
  239. //
  240. //
  241. //
  242. //
  243. //
  244. //
  245. //
  246. //
  247. //
  248. //
  249. //
  250. //
  251. //
  252. //
  253. //
  254. //
  255. //
  256. //
  257. //
  258. //
  259. //
  260. //
  261. //
  262. //
  263. //
  264. //
  265. //
  266. //
  267. //
  268. //
  269. //
  270. //
  271. //
  272. //
  273. //
  274. //
  275. //
  276. //
  277. //
  278. //
  279. //
  280. //
  281. //
  282. //
  283. //
  284. //
  285. //
  286. //
  287. //
  288. //
  289. //
  290. //
  291. //
  292. //
  293. //
  294. //
  295. //
  296. //
  297. //
  298. //
  299. //
  300. //
  301. //
  302. //
  303. //
  304. //
  305. //
  306. //
  307. //
  308. //
  309. //
  310. //
  311. //
  312. //
  313. //
  314. //
  315. //
  316. //
  317. //
  318. //
  319. //
  320. //
  321. //
  322. //
  323. //
  324. //
  325. //
  326. //
  327. //
  328. //
  329. //
  330. //
  331. //
  332. //
  333. //
  334. //
  335. //
  336. //
  337. //
  338. //
  339. //
  340. //
  341. //
  342. //
  343. //
  344. //
  345. //
  346. //
  347. //
  348. //
  349. //
  350. //
  351. //
  352. //
  353. //
  354. //
  355. //
  356. //
  357. //
  358. //
  359. //
  360. //
  361. //
  362. //
  363. //
  364. //
  365. //
  366. //
  367. //
  368. //
  369. //
  370. //
  371. //
  372. //
  373. //
  374. //
  375. //
  376. //
  377. //
  378. //
  379. //
  380. //
  381. //
  382. //
  383. //
  384. //
  385. //
  386. //
  387. //
  388. //
  389. //
  390. //
  391. //
  392. //
  393. //
  394. //
  395. //
  396. //
  397. //
  398. //
  399. //
  400. //
  401. //
  402. //
  403. //
  404. //
  405. //
  406. //
  407. //
  408. /* harmony default export */ var humanMotionSensorDevice = ({
  409. inject: ['reload'],
  410. name: "doorLock",
  411. data: function data() {
  412. return {
  413. searchRoom: '',
  414. deviceImg: __webpack_require__("It2U"),
  415. selectoption: [],
  416. selectoptionValue: '',
  417. senddeviceNum: '',
  418. sendroomId: '',
  419. commpontentStatus: true,
  420. Emergence: {
  421. EmerPhone: '',
  422. password: '',
  423. device: '',
  424. name: ''
  425. },
  426. defaultProps: {
  427. children: "children",
  428. label: "name"
  429. },
  430. options: [],
  431. drawer: false,
  432. value1: false,
  433. value2: 0,
  434. marks: {
  435. 0: "关",
  436. 50: "中",
  437. 100: "高"
  438. },
  439. switchtext: "关",
  440. activeName: "0",
  441. formInline: {},
  442. platlist: [{
  443. label: "电信",
  444. value: 1
  445. }, {
  446. label: "移动",
  447. value: 2
  448. }, {
  449. label: "联通",
  450. value: 3
  451. }],
  452. manufacturerList: [],
  453. setting: {
  454. edit: {
  455. enable: true,
  456. drag: {
  457. isMove: true
  458. },
  459. showRemoveBtn: false,
  460. showRenameBtn: false
  461. },
  462. check: {
  463. enable: false
  464. },
  465. data: {
  466. simpleData: {
  467. enable: true,
  468. pIdKey: "pid"
  469. }
  470. },
  471. view: {
  472. showIcon: true,
  473. addHoverDom: this.addHoverDom,
  474. removeHoverDom: this.removeHoverDom
  475. }
  476. },
  477. zNodes: [],
  478. bromm: {},
  479. query: {
  480. address: "",
  481. name: "",
  482. pageIndex: 1,
  483. pageSize: 20,
  484. options: []
  485. },
  486. search: {
  487. name: "",
  488. deviceNum: "",
  489. roomname: '',
  490. imei: "",
  491. isOnline: "",
  492. startBattery: '0',
  493. endBattery: '100'
  494. },
  495. tableData: [],
  496. multipleSelection: [],
  497. delList: [],
  498. editVisible: false,
  499. roomVisible: false,
  500. pageTotal: 0,
  501. sumpageTotal: 0,
  502. currentPage4: 1,
  503. form: {
  504. manufacturer: "",
  505. validateCode: ''
  506. },
  507. idx: -1,
  508. id: -1,
  509. abnormal: 0,
  510. online: 0,
  511. treedata: [],
  512. unonline: 0,
  513. Unlocking: false,
  514. Unlockingrow: {},
  515. lockingform: {
  516. password: ""
  517. },
  518. activeiconfont: true,
  519. info: [],
  520. uploadkj: false,
  521. userlist1statu: true,
  522. userlist2: [],
  523. multipleSelection1: [],
  524. batchAccess: "",
  525. getEmergenceStatus: false,
  526. getEmergenceNum: '',
  527. checkNodeId: '',
  528. pageSize: 10,
  529. pageNum: 1,
  530. sendStatus: true,
  531. userInfo: {
  532. type: ''
  533. },
  534. checkNodeId1: '',
  535. gatewayDeviceList: [],
  536. accessPlatform: {}
  537. };
  538. },
  539. components: {
  540. zTree: zTree1["a" /* default */],
  541. deviceLi: deviceLi["a" /* default */],
  542. UnlockRecord: UnlockRecord["a" /* default */],
  543. warningLog: humanMotionSensorLog["default"],
  544. DeviceFeedbackLog: DeviceFeedbackLog["a" /* default */]
  545. },
  546. beforeCreate: function beforeCreate() {},
  547. created: function created() {
  548. this.manufacturerList = this.$MANUFACTURER.MANUFACTURER.humanMotionSensor;
  549. this.accessPlatform = this.$MANUFACTURER.accessPlatform;
  550. this.userInfo = JSON.parse(localStorage.getItem('info'));
  551. this.getdevice();
  552. this.getalllist();
  553. this.info = JSON.parse(localStorage.getItem("info"));
  554. this.$store.commit("increment", 1);
  555. this.getcard();
  556. this.getallTree();
  557. this.getGatewayDeviceList();
  558. },
  559. methods: (_methods = {
  560. // 获取网关设备
  561. getGatewayDeviceList: function getGatewayDeviceList() {
  562. var _this2 = this;
  563. var data = {
  564. q: stringify_default()({
  565. lockType: 99
  566. }),
  567. pageNum: 0,
  568. pageSize: 0
  569. };
  570. Object(api["g" /* httpPost */])(data, this.$api.getDeviceItems).then(function (res) {
  571. if (res.success) {
  572. _this2.gatewayDeviceList = res.data.list;
  573. } else {
  574. _this2.$message.error(res.message);
  575. }
  576. });
  577. },
  578. InputFun: function InputFun(e, name) {
  579. if (name == 'startBattery' || name == 'endBattery') {
  580. if (Number(e) < 0) {
  581. e = 0;
  582. }
  583. if (Number(e) > 100) {
  584. e = 100;
  585. }
  586. }
  587. this.search[name] = e;
  588. },
  589. selectTenantId: function selectTenantId(e) {
  590. localStorage.setItem('tenantId', e);
  591. this.reload();
  592. },
  593. // 重置初始化
  594. resetInitialization: function resetInitialization(row, callback) {
  595. var _this3 = this;
  596. if (row.manufactureId == 201) {
  597. var data3 = {
  598. code: "zg/deleteAllUsers",
  599. data: {
  600. lockerId: row.deviceNum,
  601. imei: row.imei,
  602. order: 6501
  603. }
  604. };
  605. Object(api["g" /* httpPost */])(data3, this.$api.sendCommand).then(function (res) {
  606. if (res.success) {
  607. _this3.$message.success("重置成功");
  608. callback(true);
  609. } else {
  610. callback(false);
  611. }
  612. });
  613. } else if (row.manufactureId == 101) {
  614. var data2 = {
  615. code: "isp/restoreSetting",
  616. data: {
  617. order: 6501,
  618. imei: row.imei,
  619. deviceNum: row.deviceNum,
  620. managerTelephone: "18270949468",
  621. managerPassword: "202108"
  622. }
  623. };
  624. Object(api["g" /* httpPost */])(data2, this.$api.sendCommand).then(function (res2) {
  625. if (res2.success) {
  626. _this3.$message.success("重置成功");
  627. var str = {
  628. deviceNum: row.deviceNum,
  629. imei: row.imei,
  630. order: 6101
  631. };
  632. Object(api["g" /* httpPost */])(str, _this3.$api.getDeviceRegisterManager).then(function (res1) {
  633. var str1 = {
  634. imei: row.imei, //row.imsi,
  635. deviceNum: row.deviceNum, //row.deviceNum,
  636. operateMode: 7,
  637. is: true,
  638. order: 6207,
  639. passwordStartTime: "20210813010101",
  640. passwordEndTime: "20680813010101"
  641. };
  642. Object(api["g" /* httpPost */])(str1, _this3.$api.getDeviceOperateUserInfo).then(function (res2) {});
  643. var str2 = {
  644. imei: row.imei, //row.imsi,
  645. deviceNum: row.deviceNum, //row.deviceNum,
  646. operateMode: 4,
  647. is: true,
  648. order: 6204,
  649. passwordStartTime: "20210813010101",
  650. passwordEndTime: "20680813010101"
  651. };
  652. Object(api["g" /* httpPost */])(str2, _this3.$api.getDeviceOperateUserInfo).then(function (res3) {
  653. if (res3.success) {
  654. _this3.$message.success("初始化成功");
  655. callback(true);
  656. }
  657. });
  658. });
  659. } else {
  660. _this3.$message.error(res2.msg);
  661. callback(false);
  662. }
  663. });
  664. }
  665. },
  666. getPersonCallback: function getPersonCallback(person, alllist, callback) {
  667. var personlist = [];
  668. person.map(function (li) {
  669. var obj = {
  670. person: li,
  671. data: alllist.filter(function (item) {
  672. if (item.deviceNum && item.cardId == li.card) {
  673. return item;
  674. }
  675. })
  676. };
  677. personlist.push(obj);
  678. });
  679. callback(personlist);
  680. },
  681. // 数据同步
  682. dataSynchronization: function dataSynchronization(index, row) {
  683. var _this4 = this;
  684. this.$confirm("是否确认数据同步?", "提示", {
  685. confirmButtonText: "确定",
  686. cancelButtonText: "取消",
  687. type: "warning"
  688. }).then(function () {
  689. _this4.orderDeviceData(row);
  690. });
  691. },
  692. // 获取指定锁所有非703凭证数据
  693. orderDeviceData: function orderDeviceData(row) {
  694. var _this5 = this;
  695. var _this = this;
  696. if (row.roomId) {
  697. var data1 = {
  698. pageNum: 0,
  699. pageSize: 0,
  700. q: {
  701. id: row.roomId
  702. }
  703. };
  704. Object(api["d" /* httpGet */])(data1, this.$api.getSiteTenant).then(function (res) {
  705. if (res.success) {
  706. var person = res.data.list;
  707. var data = {
  708. imei: row.imei
  709. };
  710. Object(api["d" /* httpGet */])(data, _this5.$api.orderDeviceData).then(function (res1) {
  711. if (res1.success) {
  712. var alllist = res1.data;
  713. _this5.getPersonCallback(person, alllist, function (callback) {
  714. var personlist = callback;
  715. _this.resetInitialization(row, function (callback) {
  716. if (row.manufactureId == 101) {
  717. personlist.map(function (lt) {
  718. var endTime = new Date(lt.person.endTime).getTime();
  719. var startTime = new Date(lt.person.startTime).getTime();
  720. var passwordEndTime = moment_default()(endTime).format("YYYYMMDDHHmmss");
  721. var passwordStartTime = moment_default()(startTime).format("YYYYMMDDHHmmss");
  722. var userTelephone = JSON.parse(lt.person.info).userTelephone;
  723. var userPassword = JSON.parse(lt.person.info).userPassword;
  724. var data = {
  725. deviceNum: row.deviceNum,
  726. imei: row.imei,
  727. userTelephone: userTelephone,
  728. userPassword: userPassword,
  729. password: userPassword,
  730. operateMode: 26,
  731. order: 6226,
  732. passwordStartTime: passwordStartTime,
  733. passwordEndTime: passwordEndTime,
  734. cardName: lt.person.name,
  735. roomName: row.roomName
  736. };
  737. equipment["a" /* default */].LDAddUser(data.deviceNum, data.imei, data.userTelephone, data.userPassword, data.password, passwordStartTime, passwordEndTime, data.operateMode, data.order, data.cardName, data.roomName, false, function (callback) {
  738. lt.data.map(function (ll) {
  739. util["a" /* default */].putCarfidAdd(row, ll);
  740. });
  741. });
  742. });
  743. } else if (row.manufactureId == 201) {
  744. personlist.map(function (lt) {
  745. var endTime = new Date(lt.person.endTime).getTime();
  746. var startTime = new Date(lt.person.startTime).getTime();
  747. var passwordEndTime = moment_default()(endTime).format("YYYYMMDDHHmmss");
  748. var passwordStartTime = moment_default()(startTime).format("YYYYMMDDHHmmss");
  749. var userTelephone = JSON.parse(lt.person.info).userTelephone;
  750. var userPassword = JSON.parse(lt.person.info).userPassword;
  751. var data = {
  752. lockerId: row.deviceNum,
  753. imei: row.imei,
  754. lockerUserId: userPassword,
  755. keyId: userPassword,
  756. role: 0,
  757. action: 1,
  758. order: 6226,
  759. cardName: lt.person.name,
  760. roomName: row.roomName
  761. };
  762. equipment["a" /* default */].addUserToLock(data.lockerId, data.imei, data.lockerUserId, data.role, data.action, data.order, data.cardName, data.roomName, function (callback) {
  763. if (callback.success) {
  764. lt.data.map(function (ll) {
  765. util["a" /* default */].putCarfidzgAdd(row, ll);
  766. });
  767. }
  768. });
  769. });
  770. }
  771. });
  772. });
  773. } else {
  774. _this5.$message.error(res1.msg);
  775. }
  776. });
  777. } else {
  778. _this5.$message.error(res.msg);
  779. }
  780. });
  781. } else {
  782. this.$message.error("暂无数据");
  783. }
  784. },
  785. // 从paas同步能对应得上的有效凭证
  786. syncCommands: function syncCommands() {
  787. Object(api["d" /* httpGet */])('', this.$api.syncCommands).then(function (res) {});
  788. },
  789. // 同步刷新
  790. refreshFun: function refreshFun() {
  791. Object(api["d" /* httpGet */])("", this.$api.lockDeviceInfoList).then(function (res) {});
  792. },
  793. // 选择房源
  794. checkNode: function checkNode(e) {
  795. this.checkNodeId = e;
  796. var options = this.options;
  797. var arr = this.getId(options, e[e.length - 1]);
  798. var listarr = [arr[0]];
  799. var obj = this.getNodeId(listarr);
  800. this.checkNodeId = obj;
  801. },
  802. checkNodeOne: function checkNodeOne(e) {
  803. this.checkNodeId1 = e[e.length - 1];
  804. this.checkRoomDevice(e[e.length - 1]);
  805. },
  806. checkRoomDevice: function checkRoomDevice(id) {
  807. var _this6 = this;
  808. var q = {
  809. roomIds: [id],
  810. lockType: 6
  811. };
  812. var data = {
  813. q: stringify_default()(q),
  814. pageNum: 1,
  815. pageSize: this.pageSize
  816. };
  817. Object(api["g" /* httpPost */])(data, this.$api.getDeviceItems).then(function (res) {
  818. if (res.data.list.length > 0) {
  819. _this6.$message.error("该房间已绑定锁,请重新选择");
  820. _this6.checkNodeId1 = '';
  821. }
  822. });
  823. },
  824. getParentId: function getParentId(list, id) {
  825. for (var i in list) {
  826. if (list[i].id == id) {
  827. return [list[i]];
  828. }
  829. if (list[i].children) {
  830. var node = this.getParentId(list[i].children, id);
  831. if (node !== undefined) {
  832. return node.concat(list[i]);
  833. }
  834. }
  835. }
  836. },
  837. getId: function getId(list, id) {
  838. for (var i in list) {
  839. if (list[i].id == id) {
  840. return [list[i]];
  841. }
  842. if (list[i].children) {
  843. var node = this.getParentId(list[i].children, id);
  844. if (node !== undefined) {
  845. return node;
  846. }
  847. }
  848. }
  849. },
  850. getNodeId: function getNodeId(list) {
  851. var newNodeId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  852. for (var i in list) {
  853. newNodeId.push(list[i].id);
  854. if (list[i].children) {
  855. this.getNodeId(list[i].children, newNodeId);
  856. }
  857. }
  858. return newNodeId;
  859. },
  860. getallTree: function getallTree() {
  861. var _this7 = this;
  862. var data = {};
  863. Object(api["d" /* httpGet */])(data, this.$api.getTree).then(function (res) {
  864. var userlist = [];
  865. var temp = {},
  866. arr = [];
  867. res.data.forEach(function (item, index) {
  868. if (!temp[item.id]) {
  869. arr.push(item);
  870. temp[item.id] = true;
  871. }
  872. });
  873. arr.map(function (li) {
  874. if (li.expand) {
  875. if (JSON.parse(li.expand).type == "0") {
  876. userlist.push(li);
  877. }
  878. }
  879. });
  880. var arrdata = Object(utils["o" /* uniqueArray1 */])(res.data, "id");
  881. _this7.options = Object(utils["p" /* ztreeToElementTree */])(arrdata, {});
  882. });
  883. },
  884. // 获取门卡概况
  885. getcard: function getcard() {
  886. var _this8 = this;
  887. allFun["a" /* default */].getAnalysis("", 6, function (callback) {
  888. _this8.sumpageTotal = callback.total;
  889. _this8.online = callback.onlineTotal;
  890. _this8.unonline = callback.offlineTotal;
  891. _this8.abnormal = callback.abnormalTotal;
  892. });
  893. },
  894. // 发送离线密码
  895. sendEmergence: function sendEmergence() {
  896. var _this9 = this;
  897. var re = /^1\d{10}$/;
  898. if (re.test(this.Emergence.EmerPhone)) {
  899. var data = {
  900. code: this.Emergence.password,
  901. phone: this.Emergence.EmerPhone,
  902. device: this.Emergence.device,
  903. name: this.Emergence.name
  904. };
  905. Object(api["g" /* httpPost */])(data, this.$api.sendEmergence).then(function (res) {
  906. if (res.success) {
  907. _this9.$message.success('发送成功');
  908. } else {
  909. _this9.$message.error('发送失败');
  910. }
  911. });
  912. this.getEmergenceStatus = false;
  913. } else {
  914. this.$message.error('请填写正确手机号');
  915. }
  916. },
  917. handleCheckChange: function handleCheckChange(data, checked, node) {
  918. if (checked) {
  919. this.treedata = data;
  920. } else {
  921. if (this.checkedId == data.id) {
  922. this.$refs.tree.setCheckedKeys([data.id]);
  923. }
  924. }
  925. },
  926. // 临时密码
  927. getEmergence: function getEmergence(index, row) {
  928. var _this10 = this;
  929. var data = {
  930. code: "zg/getEmergence",
  931. data: {
  932. lockerId: row.deviceNum
  933. }
  934. };
  935. Object(api["g" /* httpPost */])(data, this.$api.sendCommand).then(function (res) {
  936. if (res.success) {
  937. _this10.$message.success("获取成功");
  938. _this10.Emergence.password = res.data.data;
  939. _this10.Emergence.device = row.deviceNum;
  940. _this10.Emergence.name = row.roomName;
  941. _this10.getEmergenceStatus = true;
  942. } else {
  943. _this10.$message.error("获取失败");
  944. }
  945. });
  946. },
  947. // input视图刷新
  948. changesr: function changesr(e) {
  949. this.$forceUpdate();
  950. },
  951. handleSelectionChange1: function handleSelectionChange1(val) {
  952. this.multipleSelection1 = val;
  953. },
  954. BatchAdd: function BatchAdd() {
  955. this.uploadkj = true;
  956. },
  957. //批量添加确认
  958. batchUploadfun: function batchUploadfun() {
  959. var _this11 = this;
  960. return asyncToGenerator_default()( /*#__PURE__*/regenerator_default.a.mark(function _callee() {
  961. return regenerator_default.a.wrap(function _callee$(_context) {
  962. while (1) {
  963. switch (_context.prev = _context.next) {
  964. case 0:
  965. if (!(_this11.batchAccess == "")) {
  966. _context.next = 4;
  967. break;
  968. }
  969. _this11.$message.error("请选择运营商");
  970. _context.next = 10;
  971. break;
  972. case 4:
  973. if (!(_this11.multipleSelection1.length == 0)) {
  974. _context.next = 8;
  975. break;
  976. }
  977. _this11.$message.error("请勾选要批量添加的设备");
  978. _context.next = 10;
  979. break;
  980. case 8:
  981. _context.next = 10;
  982. return _this11.multipleSelection1.map(function (li, index) {
  983. var str = {
  984. deviceNum: li.deviceNum,
  985. imei: li.imei,
  986. imsi: li.imei, //row.imsi,
  987. order: 5101,
  988. platformId: _this11.batchAccess
  989. };
  990. Object(api["g" /* httpPost */])(str, _this11.$api.DeviceRegisterDevice).then(function (res) {
  991. if (res.data.success) {
  992. // this.$message.success(res.data.msg);
  993. // this.editVisible = false;
  994. // this.getdevice();
  995. _this11.AddAdministrator(index, li);
  996. }
  997. });
  998. }).then(function (res) {
  999. _this11.$message.success("添加成功");
  1000. _this11.editVisible = false;
  1001. _this11.getdevice();
  1002. });
  1003. case 10:
  1004. case "end":
  1005. return _context.stop();
  1006. }
  1007. }
  1008. }, _callee, _this11);
  1009. }))();
  1010. },
  1011. //音量设置
  1012. stepFun: function stepFun(val) {
  1013. var _this12 = this;
  1014. var operate = "00";
  1015. if (val == 0) {
  1016. operate = "00";
  1017. } else if (val == 50) {
  1018. operate = "01";
  1019. } else if (val == 100) {
  1020. operate = "02";
  1021. }
  1022. var data = {
  1023. code: "isp/volumnSetting",
  1024. data: {
  1025. imei: this.formInline.imei,
  1026. operate: operate
  1027. }
  1028. };
  1029. Object(api["g" /* httpPost */])(data, this.$api.sendCommand).then(function (res2) {
  1030. if (res2.data.success) {
  1031. _this12.$message.success("设置成功");
  1032. } else {
  1033. _this12.$message.error(res.msg);
  1034. }
  1035. });
  1036. },
  1037. // 常开设置
  1038. switchFun: function switchFun(e) {
  1039. var _this13 = this;
  1040. var data = {};
  1041. if (e) {
  1042. this.switchtext = "开";
  1043. data = {
  1044. code: "isp/alwaysOpenSetting",
  1045. data: {
  1046. imei: this.formInline.imei,
  1047. operate: 1
  1048. }
  1049. };
  1050. } else {
  1051. this.switchtext = "关";
  1052. data = {
  1053. code: "isp/alwaysOpenSetting",
  1054. data: {
  1055. imei: this.formInline.imei,
  1056. operate: 0
  1057. }
  1058. };
  1059. }
  1060. Object(api["g" /* httpPost */])(data, this.$api.sendCommand).then(function (res2) {
  1061. if (res2.data.success) {
  1062. _this13.$message.success("设置成功");
  1063. } else {
  1064. _this13.$message.error(res.msg);
  1065. }
  1066. });
  1067. },
  1068. // 关闭侧边栏
  1069. handleClose: function handleClose() {
  1070. this.drawer = false;
  1071. },
  1072. // tabs标签页切换
  1073. handleClick: function handleClick(tab, event) {
  1074. this.commpontentStatus = true;
  1075. }
  1076. }, defineProperty_default()(_methods, "handleClose", function handleClose(done) {
  1077. done();
  1078. }), defineProperty_default()(_methods, "detailsFun", function detailsFun(index, row) {
  1079. this.drawer = true;
  1080. this.formInline = row;
  1081. this.sendStatus = false;
  1082. this.$nextTick(function () {
  1083. this.sendroomId = row.deviceNum;
  1084. this.senddeviceNum = row.deviceNum;
  1085. this.sendStatus = true;
  1086. });
  1087. }), defineProperty_default()(_methods, "Reset1", function Reset1(index, row) {
  1088. var data2 = {
  1089. code: "isp/restoreSetting",
  1090. data: {
  1091. order: 6501,
  1092. imei: row.imei,
  1093. deviceNum: row.deviceNum,
  1094. managerTelephone: "18270949468",
  1095. managerPassword: "202108"
  1096. }
  1097. };
  1098. Object(api["g" /* httpPost */])(data2, this.$api.sendCommand).then(function (res2) {
  1099. // if (res2.data.success) {
  1100. // this.$message.success("重置成功");
  1101. // } else {
  1102. // this.$message.error(res.msg);
  1103. // }
  1104. });
  1105. }), defineProperty_default()(_methods, "Reset", function Reset(index, row) {
  1106. var _this14 = this;
  1107. this.$confirm("是否确认重置门锁?", "提示", {
  1108. confirmButtonText: "确定",
  1109. cancelButtonText: "取消",
  1110. type: "warning"
  1111. }).then(function () {
  1112. if (row.manufactureId == 201) {
  1113. var data3 = {
  1114. code: "zg/deleteAllUsers",
  1115. data: {
  1116. lockerId: row.deviceNum,
  1117. imei: row.imei,
  1118. order: 6501,
  1119. cardName: _this14.info.username,
  1120. roomName: row.roomName
  1121. }
  1122. };
  1123. Object(api["g" /* httpPost */])(data3, _this14.$api.sendCommand).then(function (res) {
  1124. if (res.success) {
  1125. _this14.$message.success("重置成功");
  1126. var q = {
  1127. id: row.roomId
  1128. };
  1129. var tenant = {
  1130. q: stringify_default()(q)
  1131. };
  1132. Object(api["d" /* httpGet */])(tenant, _this14.$api.getSiteTenant).then(function (res) {
  1133. promise_default.a.all(res.data.list.map(function (element) {
  1134. return new promise_default.a(function (resolve, reject) {
  1135. resolve(element.card);
  1136. });
  1137. })).then(function (allId) {
  1138. allId.map(function (li) {
  1139. var str = [{
  1140. siteId: row.roomId,
  1141. cardId: li
  1142. }];
  1143. Object(api["g" /* httpPost */])(str, _this14.$api.unbindCard).then(function (res) {});
  1144. });
  1145. });
  1146. });
  1147. } else {
  1148. _this14.$message.success(res.msg);
  1149. }
  1150. });
  1151. } else if (row.manufactureId == 101) {
  1152. var data2 = {
  1153. code: "isp/restoreSetting",
  1154. data: {
  1155. order: 6501,
  1156. imei: row.imei,
  1157. deviceNum: row.deviceNum,
  1158. managerTelephone: "18270949468",
  1159. managerPassword: "202108",
  1160. cardName: _this14.info.username,
  1161. roomName: row.roomName
  1162. }
  1163. };
  1164. Object(api["g" /* httpPost */])(data2, _this14.$api.sendCommand).then(function (res2) {
  1165. if (res2.success) {
  1166. _this14.$message.success("重置成功");
  1167. var q = {
  1168. id: row.roomId
  1169. };
  1170. var tenant = {
  1171. q: stringify_default()(q)
  1172. };
  1173. Object(api["d" /* httpGet */])(tenant, _this14.$api.getSiteTenant).then(function (res) {
  1174. promise_default.a.all(res.data.list.map(function (element) {
  1175. return new promise_default.a(function (resolve, reject) {
  1176. resolve(element.card);
  1177. });
  1178. })).then(function (allId) {
  1179. allId.map(function (li) {
  1180. var str = [{
  1181. siteId: row.roomId,
  1182. cardId: li
  1183. }];
  1184. Object(api["g" /* httpPost */])(str, _this14.$api.unbindCard).then(function (res) {});
  1185. });
  1186. });
  1187. });
  1188. } else {
  1189. _this14.$message.error(res2.msg);
  1190. }
  1191. });
  1192. }
  1193. });
  1194. }), defineProperty_default()(_methods, "activeiconfun", function activeiconfun(t) {
  1195. this.activeiconfont = t;
  1196. }), defineProperty_default()(_methods, "getresult", function getresult() {
  1197. var data = {};
  1198. }), defineProperty_default()(_methods, "Unlockingsave", function Unlockingsave() {}), defineProperty_default()(_methods, "RemoteUnlocking", function RemoteUnlocking(index, row) {
  1199. var _this15 = this;
  1200. var str2 = {
  1201. imei: row.imei,
  1202. roomId: row.roomId,
  1203. openLockType: 2,
  1204. is: true
  1205. };
  1206. Object(api["g" /* httpPost */])(str2, this.$api.openLock).then(function (res3) {
  1207. if (res3.success) {
  1208. _this15.$message.success("开锁成功!");
  1209. _this15.Unlocking = false;
  1210. } else {
  1211. _this15.$message.error("开锁失败!");
  1212. }
  1213. });
  1214. }), defineProperty_default()(_methods, "AddAdministrator", function AddAdministrator(index, row) {
  1215. var _this16 = this;
  1216. var str = {
  1217. deviceNum: row.deviceNum,
  1218. imei: row.imei,
  1219. order: 6101
  1220. };
  1221. Object(api["g" /* httpPost */])(str, this.$api.getDeviceRegisterManager).then(function (res1) {
  1222. var str1 = {
  1223. imei: row.imei, //row.imsi,
  1224. deviceNum: row.deviceNum, //row.deviceNum,
  1225. operateMode: 7,
  1226. is: true,
  1227. order: 6207,
  1228. passwordStartTime: "20210813010101",
  1229. passwordEndTime: "20680813010101"
  1230. };
  1231. Object(api["g" /* httpPost */])(str1, _this16.$api.getDeviceOperateUserInfo).then(function (res2) {});
  1232. var str2 = {
  1233. imei: row.imei, //row.imsi,
  1234. deviceNum: row.deviceNum, //row.deviceNum,
  1235. operateMode: 4,
  1236. is: true,
  1237. order: 6204,
  1238. passwordStartTime: "20210813010101",
  1239. passwordEndTime: "20680813010101"
  1240. };
  1241. Object(api["g" /* httpPost */])(str2, _this16.$api.getDeviceOperateUserInfo).then(function (res3) {
  1242. if (res3.success) {
  1243. _this16.$message.success("初始化成功");
  1244. }
  1245. });
  1246. });
  1247. }), defineProperty_default()(_methods, "initialization", function initialization() {
  1248. var _this17 = this;
  1249. if (this.checkNodeId1 == '') {
  1250. this.$message.error("请选择房间");
  1251. } else {
  1252. if (this.form.manufacturer == 606) {
  1253. if (this.form.deviceNum == "" || this.form.v == "" || this.form.platformId == "") {
  1254. this.$message.error("请填写完整信息");
  1255. } else {
  1256. var data = {};
  1257. var data = {
  1258. deviceNum: this.form.deviceNum,
  1259. imei: this.form.imei,
  1260. imsi: this.form.imei, //row.imsi,
  1261. enterpriseId: this.userInfo.enterpriseId,
  1262. platformId: this.form.platformId,
  1263. manufactureId: this.form.manufacturer
  1264. };
  1265. allFun["a" /* default */].RegisterDevice(data, function (callback) {
  1266. if (callback.success) {
  1267. var data = [{
  1268. siteId: _this17.checkNodeId1,
  1269. deviceId: callback.data.id
  1270. }];
  1271. Object(api["g" /* httpPost */])(data, _this17.$api.bindDeviceSite).then(function (res) {
  1272. if (res.success) {
  1273. _this17.editVisible = false;
  1274. _this17.$message.success("绑定成功");
  1275. }
  1276. }).catch(function (error) {
  1277. _this17.$message.error("\u7ED1\u5B9A\u5931\u8D25");
  1278. });
  1279. _this17.$message.success(res.data.msg);
  1280. _this17.editVisible = false;
  1281. _this17.getdevice();
  1282. } else {
  1283. _this17.$message.error(callback.message);
  1284. }
  1285. });
  1286. }
  1287. } else if (this.form.manufacturer == 706) {
  1288. if (this.form.deviceNum === '' || this.form.gatewayDevice === '' || this.form.manufacturer === '') {
  1289. this.$message.error("请填写完整信息");
  1290. } else {
  1291. var data = {
  1292. deviceNum: this.form.deviceNum,
  1293. gatewayDevice: this.form.gatewayDevice,
  1294. manufactureId: this.form.manufacturer,
  1295. enterpriseId: this.userInfo.enterpriseId
  1296. };
  1297. allFun["a" /* default */].gatewayBindsChildDevic(data, function (callback) {
  1298. if (callback.success) {
  1299. var data = [{
  1300. siteId: _this17.checkNodeId1,
  1301. deviceId: callback.data.id
  1302. }];
  1303. Object(api["g" /* httpPost */])(data, _this17.$api.bindDeviceSite).then(function (res) {
  1304. if (res.success) {
  1305. _this17.editVisible = false;
  1306. _this17.$message.success("绑定成功");
  1307. }
  1308. }).catch(function (error) {
  1309. _this17.$message.error("\u7ED1\u5B9A\u5931\u8D25");
  1310. });
  1311. _this17.$message.success(callback.data.msg);
  1312. _this17.editVisible = false;
  1313. _this17.getdevice();
  1314. } else {
  1315. _this17.$message.error(callback.message);
  1316. }
  1317. });
  1318. }
  1319. }
  1320. }
  1321. }), defineProperty_default()(_methods, "onClick", function onClick(evt, treeId, treeNode) {
  1322. // 点击事件
  1323. this.treedata = treeNode;
  1324. }), defineProperty_default()(_methods, "getalllist", function getalllist() {
  1325. var _this18 = this;
  1326. var data = {};
  1327. Object(api["d" /* httpGet */])(data, this.$api.getTree).then(function (res) {
  1328. var array = Object(utils["n" /* uniqueArray */])(res.data, "id");
  1329. _this18.zNodes = Object(utils["p" /* ztreeToElementTree */])(array, {});
  1330. });
  1331. }), defineProperty_default()(_methods, "getdevice", function getdevice() {
  1332. var _this19 = this;
  1333. var data = {
  1334. pageNum: this.$store.state.currentPage,
  1335. pageSize: 10,
  1336. q: stringify_default()({
  1337. lockType: 6
  1338. })
  1339. };
  1340. Object(api["g" /* httpPost */])(data, this.$api.getDeviceItems).then(function (res) {
  1341. var online = 0,
  1342. unonline = 0,
  1343. devIds = "";
  1344. if (res.data.list.length > 0) {
  1345. res.data.list.map(function (li) {
  1346. var accessPlatform = _this19.accessPlatform.show.filter(function (item) {
  1347. return item.code == li.accessPlatform;
  1348. })[0];
  1349. if (accessPlatform) {
  1350. li['accessPlatformText'] = accessPlatform.desc;
  1351. } else {
  1352. li['accessPlatformText'] = '';
  1353. }
  1354. if (li.isOnline == 1) {
  1355. online++;
  1356. } else if (li.isOnline == 0) {
  1357. unonline++;
  1358. }
  1359. li.createAt = _this19.timestampToTime(li.createAt);
  1360. if (li.lastReportAt) {
  1361. li.lastReportAt = _this19.timestampToTime(li.lastReportAt) || '';
  1362. }
  1363. devIds += li.deviceNum + ",";
  1364. });
  1365. var newArr = Object(utils["n" /* uniqueArray */])(res.data.list, "id");
  1366. _this19.tableData = newArr;
  1367. } else {
  1368. _this19.tableData = [];
  1369. }
  1370. _this19.currentPage4 = 1;
  1371. _this19.pageTotal = res.data.total;
  1372. });
  1373. }), defineProperty_default()(_methods, "timestampToTime", function timestampToTime(cjsj) {
  1374. var date = new Date(cjsj); //时间戳为10位需*1000,时间戳为13位的话不需乘1000
  1375. var Y = date.getFullYear() + "-";
  1376. var M = (date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1) + "-";
  1377. var D = date.getDate() + " ";
  1378. var h = date.getHours() + ":";
  1379. var m = date.getMinutes() + ":";
  1380. var s = date.getSeconds();
  1381. return Y + M + D + h + m + s;
  1382. }), defineProperty_default()(_methods, "handleChange", function handleChange(value) {
  1383. console.log(value);
  1384. }), defineProperty_default()(_methods, "restSearch", function restSearch() {
  1385. this.search = {
  1386. name: "",
  1387. deviceNum: "",
  1388. roomname: '',
  1389. imei: "",
  1390. isOnline: "",
  1391. unBind: '',
  1392. startBattery: '',
  1393. endBattery: ''
  1394. };
  1395. this.checkNodeId = '';
  1396. this.searchRoom = '';
  1397. this.handleSearch();
  1398. }), defineProperty_default()(_methods, "handleSearch", function handleSearch() {
  1399. var _this20 = this;
  1400. var deviceNum = this.search.deviceNum.replace(/\s*/g, "");
  1401. var imei = this.search.imei.replace(/\s*/g, "");
  1402. var q = {
  1403. deviceNum: deviceNum,
  1404. imei: imei,
  1405. isOnline: this.search.isOnline,
  1406. roomName: this.search.roomname,
  1407. roomIds: this.checkNodeId,
  1408. startBattery: this.search.startBattery,
  1409. endBattery: this.search.endBattery,
  1410. lockType: 6,
  1411. unBind: this.search.unBind
  1412. };
  1413. var data = {
  1414. q: stringify_default()(q),
  1415. pageNum: 1,
  1416. pageSize: this.pageSize
  1417. };
  1418. Object(api["g" /* httpPost */])(data, this.$api.getDeviceItems).then(function (res) {
  1419. if (res.data.list.length > 0) {
  1420. res.data.list.map(function (li) {
  1421. var accessPlatform = _this20.accessPlatform.show.filter(function (item) {
  1422. return item.code == li.accessPlatform;
  1423. })[0];
  1424. if (accessPlatform) {
  1425. li['accessPlatformText'] = accessPlatform.desc;
  1426. } else {
  1427. li['accessPlatformText'] = '';
  1428. }
  1429. li.createAt = _this20.timestampToTime(li.createAt);
  1430. if (li.lastReportAt) {
  1431. li.lastReportAt = moment_default()(li.lastReportAt).format("YYYY-MM-DD HH:mm:ss");
  1432. } else {
  1433. li.lastReportAt = '';
  1434. }
  1435. });
  1436. var newArr = Object(utils["n" /* uniqueArray */])(res.data.list, "id");
  1437. _this20.pageTotal = res.data.total;
  1438. _this20.tableData = newArr;
  1439. } else {
  1440. _this20.tableData = [];
  1441. _this20.pageTotal = 0;
  1442. }
  1443. _this20.currentPage4 = 1;
  1444. _this20.$store.commit("increment", 1);
  1445. });
  1446. // this.$set(this.query, "pageIndex", 1);
  1447. }), defineProperty_default()(_methods, "handleDelete", function handleDelete(index) {
  1448. var _this21 = this;
  1449. // 二次确认删除
  1450. this.$confirm("确定要删除吗?", "提示", {
  1451. type: "warning"
  1452. }).then(function () {
  1453. _this21.$message.success("删除成功");
  1454. _this21.tableData.splice(index, 1);
  1455. }).catch(function () {});
  1456. }), defineProperty_default()(_methods, "handleSelectionChange", function handleSelectionChange(val) {
  1457. this.multipleSelection = val;
  1458. }), defineProperty_default()(_methods, "delAllSelection", function delAllSelection() {
  1459. var length = this.multipleSelection.length;
  1460. var str = "";
  1461. this.delList = this.delList.concat(this.multipleSelection);
  1462. for (var i = 0; i < length; i++) {
  1463. str += this.multipleSelection[i].name + " ";
  1464. }
  1465. this.$message.error("\u5220\u9664\u4E86" + str);
  1466. this.multipleSelection = [];
  1467. }), defineProperty_default()(_methods, "deleteLock", function deleteLock(index, row) {
  1468. var _this22 = this;
  1469. this.$confirm("确定要删除吗?", "提示", {
  1470. type: "warning"
  1471. }).then(function () {
  1472. // if (row.manufactureId == 101) {
  1473. if (row.roomId) {
  1474. var data = [{
  1475. siteId: row.roomId,
  1476. deviceId: row.id
  1477. }];
  1478. Object(api["g" /* httpPost */])(data, _this22.$api.unbindDeviceSite).then(function (res) {
  1479. if (res.success) {
  1480. var data = {
  1481. device: row.deviceNum,
  1482. imei: row.imei,
  1483. order: 5102
  1484. };
  1485. allFun["a" /* default */].DeleteDevic(data, row.manufactureId, function (callback) {
  1486. if (callback.success) {
  1487. _this22.getdevice();
  1488. _this22.$message.success('删除成功');
  1489. } else {
  1490. _this22.$message.error(callback.msg);
  1491. }
  1492. });
  1493. }
  1494. }).catch(function (error) {
  1495. _this22.$message.error("\u89E3\u7ED1\u5931\u8D25");
  1496. });
  1497. } else {
  1498. var data = {
  1499. deviceNum: row.deviceNum,
  1500. imei: row.imei,
  1501. order: 5102
  1502. };
  1503. console.log(data, _this22.$RegisterDevice, row.manufactureId);
  1504. allFun["a" /* default */].DeleteDevic(data, row.manufactureId, function (callback) {
  1505. if (callback.success) {
  1506. _this22.getdevice();
  1507. _this22.$message.success('删除成功');
  1508. } else {
  1509. _this22.$message.error(callback.msg);
  1510. }
  1511. });
  1512. }
  1513. }).catch(function () {});
  1514. }), defineProperty_default()(_methods, "bindRoom", function bindRoom(index, row) {
  1515. this.bromm = row;
  1516. this.roomVisible = true;
  1517. this.$refs.tree.setCheckedKeys([]);
  1518. }), defineProperty_default()(_methods, "bindsave", function bindsave() {
  1519. var _this23 = this;
  1520. var treedata = this.treedata;
  1521. this.roomVisible = false;
  1522. var data = [{
  1523. siteId: treedata.id,
  1524. deviceId: this.bromm.id
  1525. }];
  1526. Object(api["g" /* httpPost */])(data, this.$api.bindDeviceSite).then(function (res) {
  1527. if (res.success) {
  1528. _this23.$message.success("绑定成功");
  1529. _this23.getdevice();
  1530. }
  1531. }).catch(function (error) {
  1532. _this23.$message.error("\u7ED1\u5B9A\u5931\u8D25");
  1533. });
  1534. }), defineProperty_default()(_methods, "unbindsave", function unbindsave(index, row) {
  1535. var _this24 = this;
  1536. var data = [{
  1537. siteId: row.roomId,
  1538. deviceId: row.id
  1539. }];
  1540. var q = {
  1541. id: row.roomId
  1542. };
  1543. var tenant = {
  1544. q: stringify_default()(q)
  1545. };
  1546. // 二次确认解绑
  1547. this.$confirm("确定要解绑吗?", "提示", {
  1548. type: "warning"
  1549. }).then(function () {
  1550. // this.Reset(index, row)
  1551. Object(api["d" /* httpGet */])(tenant, _this24.$api.getSiteTenant).then(function (res) {
  1552. promise_default.a.all(res.data.list.map(function (element) {
  1553. return new promise_default.a(function (resolve, reject) {
  1554. resolve(element.card);
  1555. });
  1556. })).then(function (allId) {
  1557. allId.map(function (li) {
  1558. var str = [{
  1559. siteId: row.roomId,
  1560. cardId: li
  1561. }];
  1562. Object(api["g" /* httpPost */])(str, _this24.$api.unbindCard).then(function (res) {});
  1563. });
  1564. Object(api["g" /* httpPost */])(data, _this24.$api.unbindDeviceSite).then(function (res) {
  1565. if (res.success) {
  1566. _this24.$message.success("解绑成功");
  1567. _this24.getdevice();
  1568. } else {
  1569. _this24.$message.error("\u89E3\u7ED1\u5931\u8D25");
  1570. }
  1571. });
  1572. });
  1573. });
  1574. }).catch(function () {});
  1575. }), defineProperty_default()(_methods, "addequipment", function addequipment() {
  1576. this.editVisible = true;
  1577. this.form.customerCode = this.$store.state.customerCode;
  1578. }), defineProperty_default()(_methods, "handleEdit", function handleEdit(index, row) {
  1579. this.idx = index;
  1580. this.form = row;
  1581. this.editVisible = true;
  1582. }), defineProperty_default()(_methods, "saveEdit", function saveEdit() {
  1583. this.editVisible = false;
  1584. this.$message.success("\u4FEE\u6539\u7B2C " + (this.idx + 1) + " \u884C\u6210\u529F");
  1585. this.$set(this.tableData, this.idx, this.form);
  1586. }), defineProperty_default()(_methods, "handleSizeChange", function handleSizeChange(val) {
  1587. console.log("\u6BCF\u9875 " + val + " \u6761");
  1588. this.$router.replace({
  1589. path: this.$route.path,
  1590. query: {
  1591. page: this.$route.query.page ? this.$route.query.page : 1,
  1592. pageSize: val
  1593. }
  1594. });
  1595. this.pageSize = val;
  1596. this.getlistNum(0, val);
  1597. }), defineProperty_default()(_methods, "getlistNum", function getlistNum(val, size) {
  1598. var _this25 = this;
  1599. var deviceNum = this.search.deviceNum.replace(/\s*/g, "");
  1600. var imei = this.search.imei.replace(/\s*/g, "");
  1601. var q = {
  1602. deviceNum: deviceNum,
  1603. imei: imei,
  1604. isOnline: this.search.isOnline,
  1605. roomName: this.search.roomname,
  1606. roomIds: this.checkNodeId,
  1607. startBattery: this.search.startBattery,
  1608. endBattery: this.search.endBattery,
  1609. lockType: 6,
  1610. unBind: this.search.unBind
  1611. };
  1612. var data = {
  1613. q: stringify_default()(q),
  1614. pageNum: val,
  1615. pageSize: size
  1616. };
  1617. Object(api["g" /* httpPost */])(data, this.$api.getDeviceItems).then(function (res) {
  1618. res.data.list.map(function (li) {
  1619. var accessPlatform = _this25.accessPlatform.show.filter(function (item) {
  1620. return item.code == li.accessPlatform;
  1621. })[0];
  1622. if (accessPlatform) {
  1623. li['accessPlatformText'] = accessPlatform.desc;
  1624. } else {
  1625. li['accessPlatformText'] = '';
  1626. }
  1627. li.createAt = _this25.timestampToTime(li.createAt);
  1628. if (li.lastReportAt) {
  1629. li.lastReportAt = moment_default()(li.lastReportAt).format("YYYY-MM-DD HH:mm:ss");
  1630. } else {
  1631. li.lastReportAt = '';
  1632. }
  1633. });
  1634. var newArr = Object(utils["n" /* uniqueArray */])(res.data.list, "id");
  1635. _this25.tableData = newArr;
  1636. _this25.pageTotal = res.data.total;
  1637. });
  1638. }), defineProperty_default()(_methods, "handlePageChange", function handlePageChange(val) {
  1639. var _this26 = this;
  1640. // this.$router.replace({
  1641. // path: this.$route.path,
  1642. // query: {
  1643. // page: this.$route.query.page ? this.$route.query.page : 1,
  1644. // pageSize: val,
  1645. // },
  1646. // });
  1647. this.pageNum = val;
  1648. this.$store.commit("increment", val);
  1649. var q = {
  1650. deviceNum: this.search.deviceNum,
  1651. imei: this.search.imei,
  1652. isOnline: this.search.isOnline,
  1653. roomName: this.search.roomname,
  1654. roomIds: this.checkNodeId,
  1655. startBattery: this.search.startBattery,
  1656. endBattery: this.search.endBattery,
  1657. lockType: 6,
  1658. unBind: this.search.unBind
  1659. };
  1660. var data = {
  1661. q: stringify_default()(q),
  1662. pageNum: val,
  1663. pageSize: this.pageSize
  1664. };
  1665. Object(api["g" /* httpPost */])(data, this.$api.getDeviceItems).then(function (res) {
  1666. res.data.list.map(function (li) {
  1667. var accessPlatform = _this26.accessPlatform.show.filter(function (item) {
  1668. return item.code == li.accessPlatform;
  1669. })[0];
  1670. if (accessPlatform) {
  1671. li['accessPlatformText'] = accessPlatform.desc;
  1672. } else {
  1673. li['accessPlatformText'] = '';
  1674. }
  1675. li.createAt = _this26.timestampToTime(li.createAt);
  1676. if (li.lastReportAt) {
  1677. li.lastReportAt = moment_default()(li.lastReportAt).format("YYYY-MM-DD HH:mm:ss");
  1678. } else {
  1679. li.lastReportAt = '';
  1680. }
  1681. });
  1682. var newArr = Object(utils["n" /* uniqueArray */])(res.data.list, "id");
  1683. _this26.tableData = newArr;
  1684. _this26.pageTotal = res.data.total;
  1685. });
  1686. }), defineProperty_default()(_methods, "btnClick", function btnClick() {
  1687. document.querySelector(".input-file").click();
  1688. }), defineProperty_default()(_methods, "exportData", function exportData(event) {
  1689. if (!event.currentTarget.files.length) {
  1690. return;
  1691. }
  1692. var that = this;
  1693. // 拿取文件对象
  1694. var f = event.currentTarget.files[0];
  1695. // 用FileReader来读取
  1696. var reader = new FileReader();
  1697. // 重写FileReader上的readAsBinaryString方法
  1698. FileReader.prototype.readAsBinaryString = function (f) {
  1699. var binary = "";
  1700. var wb; // 读取完成的数据
  1701. var outdata; // 你需要的数据
  1702. var reader = new FileReader();
  1703. reader.onload = function (e) {
  1704. // 读取成Uint8Array,再转换为Unicode编码(Unicode占两个字节)
  1705. var bytes = new Uint8Array(reader.result);
  1706. var length = bytes.byteLength;
  1707. for (var i = 0; i < length; i++) {
  1708. binary += String.fromCharCode(bytes[i]);
  1709. }
  1710. // 接下来就是xlsx了,具体可看api
  1711. wb = xlsx_default.a.read(binary, {
  1712. type: "binary"
  1713. });
  1714. outdata = xlsx_default.a.utils.sheet_to_json(wb.Sheets[wb.SheetNames[0]]);
  1715. // 自定义方法向父组件传递数据
  1716. var arr1 = [];
  1717. outdata.map(function (li, index) {
  1718. var str = {};
  1719. str.deviceNum = li["设备号"];
  1720. str.imei = li["imei"];
  1721. str.ID = li["序号"];
  1722. arr1.push(str);
  1723. });
  1724. // this.tableData=arr
  1725. that.userlist1statu = false;
  1726. that.$nextTick(function () {
  1727. that.userlist2 = arr1;
  1728. that.userlist1statu = true;
  1729. });
  1730. };
  1731. reader.readAsArrayBuffer(f);
  1732. };
  1733. reader.readAsBinaryString(f);
  1734. }), _methods)
  1735. });
  1736. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/template-compiler?{"id":"data-v-6f1a778a","hasScoped":true,"transformToRequire":{"video":["src","poster"],"source":"src","img":"src","image":"xlink:href"},"buble":{"transforms":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/views/device/humanMotionSensorDevice.vue
  1737. var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('el-row',{staticClass:"elrow",attrs:{"gutter":20}},[_c('el-col',{attrs:{"span":24}},[_c('el-card',{attrs:{"shadow":"hover"}},[_c('el-row',[_c('el-col',{attrs:{"span":6}},[_c('div',{staticClass:"grid-content grid-con-1"},[_c('div',{staticClass:"colposition"},[_c('img',{staticClass:"w100",attrs:{"src":__webpack_require__("xXHN"),"alt":""}}),_vm._v(" "),_c('div',{staticClass:"grid-cont-right"},[_c('div',[_vm._v("人体移动传感器总数")]),_vm._v(" "),_c('div',{staticClass:"grid-num"},[_vm._v(_vm._s(_vm.sumpageTotal))])])])])]),_vm._v(" "),_c('el-col',{attrs:{"span":6}},[_c('div',{staticClass:"grid-content grid-con-2"},[_c('div',{staticClass:"colposition"},[_c('img',{staticClass:"w100",attrs:{"src":__webpack_require__("sFbI"),"alt":""}}),_vm._v(" "),_c('div',{staticClass:"grid-cont-right"},[_c('div',[_vm._v("在线状态")]),_vm._v(" "),_c('div',{staticClass:"grid-num"},[_vm._v(_vm._s(_vm.online))])])])])]),_vm._v(" "),_c('el-col',{attrs:{"span":6}},[_c('div',{staticClass:"grid-content grid-con-2"},[_c('div',{staticClass:"colposition"},[_c('img',{staticClass:"w100",attrs:{"src":__webpack_require__("BpHi"),"alt":""}}),_vm._v(" "),_c('div',{staticClass:"grid-cont-right"},[_c('div',[_vm._v("离线状态")]),_vm._v(" "),_c('div',{staticClass:"grid-num"},[_vm._v(_vm._s(_vm.unonline))])])])])]),_vm._v(" "),_c('el-col',{attrs:{"span":6}},[_c('div',{staticClass:"grid-content grid-con-2"},[_c('div',{staticClass:"colposition"},[_c('img',{staticClass:"w100",attrs:{"src":__webpack_require__("sNnU"),"alt":""}}),_vm._v(" "),_c('div',{staticClass:"grid-cont-right"},[_c('div',[_vm._v("异常状态")]),_vm._v(" "),_c('div',{staticClass:"grid-num"},[_vm._v(_vm._s(_vm.abnormal))])])])])])],1)],1)],1)],1),_vm._v(" "),_c('div',{staticClass:"container"},[_c('div',{staticClass:"handle-box"},[_c('selectoption'),_vm._v(" "),_c('el-cascader',{attrs:{"options":_vm.options,"size":"small","props":{ checkStrictly: true },"placeholder":"请选择房源","clearable":""},on:{"change":_vm.checkNode},model:{value:(_vm.searchRoom),callback:function ($$v) {_vm.searchRoom=$$v},expression:"searchRoom"}}),_vm._v(" "),_c('el-input',{staticClass:"handle-input mr10 width100",attrs:{"size":"small","placeholder":"房间名称","clearable":true},on:{"input":function($event){return _vm.changesr($event)}},model:{value:(_vm.search.roomname),callback:function ($$v) {_vm.$set(_vm.search, "roomname", $$v)},expression:"search.roomname"}}),_vm._v(" "),_c('el-input',{staticClass:"handle-input mr10 width100",attrs:{"size":"small","placeholder":"序列号","clearable":true},on:{"input":function($event){return _vm.changesr($event)}},model:{value:(_vm.search.deviceNum),callback:function ($$v) {_vm.$set(_vm.search, "deviceNum", $$v)},expression:"search.deviceNum"}}),_vm._v(" "),_c('el-input',{staticClass:"handle-input mr10 width100",attrs:{"size":"small","placeholder":"IMEI","clearable":true},on:{"input":function($event){return _vm.changesr($event)}},model:{value:(_vm.search.imei),callback:function ($$v) {_vm.$set(_vm.search, "imei", $$v)},expression:"search.imei"}}),_vm._v(" "),_c('el-select',{staticClass:"handle-select mr10",attrs:{"size":"small","placeholder":"状态","clearable":""},model:{value:(_vm.search.isOnline),callback:function ($$v) {_vm.$set(_vm.search, "isOnline", $$v)},expression:"search.isOnline"}},[_c('el-option',{key:"1",attrs:{"label":"离线","value":"0"}}),_vm._v(" "),_c('el-option',{key:"2",attrs:{"label":"在线","value":"1"}}),_vm._v(" "),_c('el-option',{key:"3",attrs:{"label":"异常","value":"2"}})],1),_vm._v(" "),_c('el-select',{staticClass:"handle-select mr10",attrs:{"size":"small","placeholder":"绑定状态","clearable":true},model:{value:(_vm.search.unBind),callback:function ($$v) {_vm.$set(_vm.search, "unBind", $$v)},expression:"search.unBind"}},[_c('el-option',{key:"0",attrs:{"label":"已绑定","value":"0"}}),_vm._v(" "),_c('el-option',{key:"1",attrs:{"label":"未绑定","value":"1"}})],1),_vm._v(" "),_c('div',{staticClass:"quantity"},[_
  1738. ? 'success'
  1739. : scope.row.isOnline == '0'
  1740. ? 'danger'
  1741. : ''}},[(scope.row.isOnline == 1)?_c('span',[_vm._v("在线")]):_c('span',[_vm._v("离线")])])]}}])}),_vm._v(" "),_c('el-table-column',{attrs:{"label":"绑定房间","width":"200"},scopedSlots:_vm._u([{key:"default",fn:function(scope){return [(scope.row.roomName)?_c('span',{staticClass:"blue"},[_vm._v(_vm._s(scope.row.roomName))]):_c('span',{},[_vm._v("空")])]}}])}),_vm._v(" "),_c('el-table-column',{attrs:{"prop":"firmwareVersion","label":"版本","width":"160"}}),_vm._v(" "),_c('el-table-column',{attrs:{"prop":"createAt","label":"创建时间","width":"160"}}),_vm._v(" "),_c('el-table-column',{attrs:{"label":"操作","width":"400","align":"center","fixed":"right"},scopedSlots:_vm._u([{key:"default",fn:function(scope){return [(scope.row.roomId)?_c('el-button',{staticClass:"red",attrs:{"type":"text"},on:{"click":function($event){return _vm.unbindsave(scope.$index, scope.row)}}},[_vm._v("解绑房间\n ")]):_c('el-button',{attrs:{"type":"text"},on:{"click":function($event){return _vm.bindRoom(scope.$index, scope.row)}}},[_vm._v("绑定房间")]),_vm._v(" "),_c('el-button',{attrs:{"type":"text"},on:{"click":function($event){return _vm.detailsFun(scope.$index, scope.row)}}},[_vm._v("设备详情")])]}}])})],1),_vm._v(" "),_c('div',{staticClass:"pagination"},[_c('el-pagination',{attrs:{"current-page":_vm.$store.state.currentPage,"page-sizes":[10,20,100],"page-size":_vm.pageSize,"layout":"total, sizes, prev, pager, next, jumper","total":_vm.pageTotal},on:{"size-change":_vm.handleSizeChange,"current-change":_vm.handlePageChange}})],1)],1),_vm._v(" "),_c('el-dialog',{attrs:{"title":"绑定房间","visible":_vm.roomVisible,"width":"30%"},on:{"update:visible":function($event){_vm.roomVisible=$event}},scopedSlots:_vm._u([{key:"footer",fn:function(){return [_c('span',{staticClass:"dialog-footer"},[_c('el-button',{on:{"click":function($event){_vm.roomVisible = false}}},[_vm._v("取 消")]),_vm._v(" "),_c('el-button',{attrs:{"type":"primary"},on:{"click":_vm.bindsave}},[_vm._v("确 定")])],1)]},proxy:true}])},[_c('div',{staticClass:"ztree"},[_c('el-tree',{ref:"tree",attrs:{"data":_vm.zNodes,"show-checkbox":"","node-key":"id","props":_vm.defaultProps},on:{"check-change":_vm.handleCheckChange}})],1)]),_vm._v(" "),_c('el-dialog',{attrs:{"title":"远程开锁密码","visible":_vm.Unlocking,"width":"30%"},on:{"update:visible":function($event){_vm.Unlocking=$event}},scopedSlots:_vm._u([{key:"footer",fn:function(){return [_c('span',{staticClass:"dialog-footer"},[_c('el-button',{on:{"click":function($event){_vm.Unlocking = false}}},[_vm._v("取 消")]),_vm._v(" "),_c('el-button',{attrs:{"type":"primary"},on:{"click":_vm.Unlockingsave}},[_vm._v("确 定")])],1)]},proxy:true}])},[_c('div',[_c('el-form',{ref:"locking",attrs:{"model":_vm.lockingform,"label-width":"100px"}},[_c('el-form-item',{attrs:{"label":"管理员密码"}},[_c('el-input',{attrs:{"show-password":"","clearable":true},model:{value:(_vm.lockingform.password),callback:function ($$v) {_vm.$set(_vm.lockingform, "password", $$v)},expression:"lockingform.password"}})],1)],1)],1)]),_vm._v(" "),_c('el-dialog',{attrs:{"title":"编辑","visible":_vm.editVisible,"width":"30%"},on:{"update:visible":function($event){_vm.editVisible=$event}},scopedSlots:_vm._u([{key:"footer",fn:function(){return [_c('span',{staticClass:"dialog-footer"},[_c('el-button',{on:{"click":function($event){_vm.editVisible = false}}},[_vm._v("取 消")]),_vm._v(" "),_c('el-button',{attrs:{"type":"primary"},on:{"click":_vm.initialization}},[_vm._v("确 定")])],1)]},proxy:true}])},[_c('el-form',{ref:"form",attrs:{"model":_vm.form,"label-width":"100px"}},[_c('el-form-item',{attrs:{"label":"型号"}},[_c('el-select',{attrs:{"placeholder":"请选择"},model:{value:(_vm.form.manufacturer),callback:function ($$v) {_vm.$set(_vm.form, "manufacturer", $$v)},expression:"form.manufacturer"}},_vm._l((_vm.manufacturerList),function(item){return _c('el-option',{key:item.value,attrs:{"label":item.label,"value":item.value}})}),1)],1),_vm._v(" "),(_vm.form.manufacturer == 706)?_c('div',[_c('el-form-item',{a
  1742. var staticRenderFns = []
  1743. var esExports = { render: render, staticRenderFns: staticRenderFns }
  1744. /* harmony default export */ var device_humanMotionSensorDevice = (esExports);
  1745. // CONCATENATED MODULE: ./src/views/device/humanMotionSensorDevice.vue
  1746. function injectStyle (ssrContext) {
  1747. __webpack_require__("K8oN")
  1748. }
  1749. var normalizeComponent = __webpack_require__("VU/8")
  1750. /* script */
  1751. /* template */
  1752. /* template functional */
  1753. var __vue_template_functional__ = false
  1754. /* styles */
  1755. var __vue_styles__ = injectStyle
  1756. /* scopeId */
  1757. var __vue_scopeId__ = "data-v-6f1a778a"
  1758. /* moduleIdentifier (server only) */
  1759. var __vue_module_identifier__ = null
  1760. var Component = normalizeComponent(
  1761. humanMotionSensorDevice,
  1762. device_humanMotionSensorDevice,
  1763. __vue_template_functional__,
  1764. __vue_styles__,
  1765. __vue_scopeId__,
  1766. __vue_module_identifier__
  1767. )
  1768. /* harmony default export */ var views_device_humanMotionSensorDevice = __webpack_exports__["default"] = (Component.exports);
  1769. /***/ }),
  1770. /***/ "WbCw":
  1771. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1772. "use strict";
  1773. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  1774. // EXTERNAL MODULE: ./node_modules/babel-runtime/core-js/json/stringify.js
  1775. var stringify = __webpack_require__("mvHQ");
  1776. var stringify_default = /*#__PURE__*/__webpack_require__.n(stringify);
  1777. // EXTERNAL MODULE: ./src/api/index.js + 5 modules
  1778. var api = __webpack_require__("gyMJ");
  1779. // EXTERNAL MODULE: ./src/utils/index.js
  1780. var utils = __webpack_require__("0xDb");
  1781. // EXTERNAL MODULE: ./node_modules/moment/moment.js
  1782. var moment = __webpack_require__("PJh5");
  1783. var moment_default = /*#__PURE__*/__webpack_require__.n(moment);
  1784. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./src/views/log/humanMotionSensorLog.vue
  1785. //
  1786. //
  1787. //
  1788. //
  1789. //
  1790. //
  1791. //
  1792. //
  1793. //
  1794. //
  1795. //
  1796. //
  1797. //
  1798. //
  1799. //
  1800. //
  1801. //
  1802. //
  1803. //
  1804. //
  1805. //
  1806. //
  1807. //
  1808. //
  1809. //
  1810. //
  1811. //
  1812. //
  1813. //
  1814. //
  1815. //
  1816. //
  1817. /* harmony default export */ var humanMotionSensorLog = ({
  1818. name: "warningLog",
  1819. data: function data() {
  1820. return {
  1821. query: {
  1822. operType: "",
  1823. operateName: "",
  1824. operModul: ""
  1825. },
  1826. query1: {
  1827. operType: "",
  1828. operateName: "",
  1829. operModul: ""
  1830. },
  1831. activeName: "first",
  1832. tableData: [],
  1833. tableData1: [],
  1834. multipleSelection: [],
  1835. delList: [],
  1836. editVisible: false,
  1837. pageTotal: 0,
  1838. pageTotal1: 0,
  1839. form: {},
  1840. idx: -1,
  1841. id: -1,
  1842. AboutDevice: [],
  1843. userInfo: {
  1844. type: ''
  1845. },
  1846. alertTypeList: []
  1847. };
  1848. },
  1849. props: ['deviceNum'],
  1850. beforeCreate: function beforeCreate() {},
  1851. created: function created() {
  1852. this.alertTypeList = this.$MANUFACTURER.alertType.humanMotionSensorLog;
  1853. this.userInfo = JSON.parse(localStorage.getItem('info'));
  1854. this.getAboutDevice();
  1855. },
  1856. mounted: function mounted() {},
  1857. methods: {
  1858. selectTenantId: function selectTenantId(e) {
  1859. localStorage.setItem('tenantId', e);
  1860. this.reload();
  1861. },
  1862. restFun: function restFun() {
  1863. var _this = this;
  1864. this.query = {
  1865. operType: "",
  1866. operateName: "",
  1867. operModul: ""
  1868. };
  1869. var q = {};
  1870. if (this.deviceNum != '') {
  1871. q = {
  1872. alertType: this.query.alertType,
  1873. deviceNum: this.deviceNum,
  1874. deviceType: 6
  1875. };
  1876. } else {
  1877. q = {
  1878. alertType: this.query.alertType,
  1879. deviceNum: this.query.deviceName,
  1880. deviceType: 6
  1881. };
  1882. }
  1883. var data = {
  1884. pageNum: 1,
  1885. pageSize: 10,
  1886. q: this.searchParaProcess(q),
  1887. orderBy: "alert_time desc"
  1888. };
  1889. Object(api["d" /* httpGet */])(data, this.$api.getLockAlert).then(function (res) {
  1890. var AboutDevice = _this.AboutDevice;
  1891. res.data.list.map(function (li) {
  1892. li.createAt = _this.time(+new Date(li.createAt));
  1893. li.alertTime = moment_default()(li.alertTime * 1000).format("YYYY-MM-DD HH:mm:ss");
  1894. var resultArr = AboutDevice.filter(function (_item) {
  1895. return _item.deviceNum == li.deviceNum;
  1896. })[0];
  1897. if (resultArr) {
  1898. li.roomId = resultArr.id;
  1899. li.roomName = resultArr.roomName;
  1900. }
  1901. li['alertTypeDesc'] = '';
  1902. var alertTypeDesc = _this.alertTypeList.filter(function (item) {
  1903. return item.code == li.alertType;
  1904. })[0];
  1905. if (alertTypeDesc) {
  1906. li['alertTypeDesc'] = alertTypeDesc.desc;
  1907. }
  1908. });
  1909. _this.$store.commit('increment', 1);
  1910. _this.tableData = res.data.list;
  1911. _this.pageTotal = res.data.total;
  1912. });
  1913. },
  1914. // 查询和房间相关的设备
  1915. getAboutDevice: function getAboutDevice() {
  1916. var _this2 = this;
  1917. var data = {
  1918. pageNum: 0,
  1919. pageSize: 0,
  1920. q: stringify_default()({
  1921. lockType: 6
  1922. })
  1923. };
  1924. Object(api["g" /* httpPost */])(data, this.$api.getDeviceItems).then(function (res) {
  1925. _this2.AboutDevice = res.data.list;
  1926. _this2.getOperates();
  1927. });
  1928. },
  1929. time: function time() {
  1930. var time = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : +new Date();
  1931. var date = new Date(time + 8 * 3600 * 1000); // 增加8小时
  1932. return date.toJSON().substr(0, 19).replace("T", " ");
  1933. },
  1934. // 获取操作日志
  1935. getOperates: function getOperates() {
  1936. var _this3 = this;
  1937. var q = {};
  1938. if (this.deviceNum != '') {
  1939. q = {
  1940. deviceNum: this.deviceNum,
  1941. deviceType: 6
  1942. };
  1943. } else {
  1944. q = {
  1945. deviceNum: this.query.deviceName,
  1946. deviceType: 6
  1947. };
  1948. }
  1949. var data = {
  1950. pageNum: 1,
  1951. pageSize: 10,
  1952. orderBy: "alert_time desc",
  1953. q: stringify_default()(q)
  1954. // orderType:"desc"
  1955. };
  1956. Object(api["d" /* httpGet */])(data, this.$api.getLockAlert).then(function (res) {
  1957. var AboutDevice = _this3.AboutDevice;
  1958. res.data.list.map(function (li) {
  1959. li.createAt = _this3.time(+new Date(li.createAt));
  1960. li.alertTime = moment_default()(li.alertTime * 1000).format("YYYY-MM-DD HH:mm:ss");
  1961. var resultArr = AboutDevice.filter(function (_item) {
  1962. return _item.deviceNum == li.deviceNum;
  1963. })[0];
  1964. if (resultArr) {
  1965. li.roomId = resultArr.id;
  1966. li.roomName = resultArr.roomName;
  1967. }
  1968. li['alertTypeDesc'] = '';
  1969. var alertTypeDesc = _this3.alertTypeList.filter(function (item) {
  1970. return item.code == li.alertType;
  1971. })[0];
  1972. if (alertTypeDesc) {
  1973. li['alertTypeDesc'] = alertTypeDesc.desc;
  1974. }
  1975. });
  1976. _this3.tableData = res.data.list;
  1977. _this3.pageTotal = res.data.total;
  1978. });
  1979. },
  1980. //门锁报警同步刷新
  1981. getlockAlert: function getlockAlert() {
  1982. Object(api["d" /* httpGet */])("", this.$api.getLockAlert1).then(function (res) {});
  1983. },
  1984. searchParaProcess: function searchParaProcess(obj) {
  1985. var myObj;
  1986. if (obj.alertType == "" || obj.alertType == "0") {
  1987. if (obj.deviceNum == "") {
  1988. myObj = {
  1989. deviceType: obj.deviceType
  1990. };
  1991. } else {
  1992. myObj = {
  1993. deviceNum: obj.deviceNum,
  1994. deviceType: obj.deviceType
  1995. };
  1996. }
  1997. } else {
  1998. if (obj.deviceNum == "") {
  1999. myObj = {
  2000. alertType: obj.alertType,
  2001. deviceType: obj.deviceType
  2002. };
  2003. } else {
  2004. myObj = {
  2005. alertType: obj.alertType,
  2006. deviceNum: obj.deviceNum,
  2007. deviceType: obj.deviceType
  2008. };
  2009. }
  2010. }
  2011. return stringify_default()(myObj);
  2012. },
  2013. // 触发搜索按钮
  2014. handleSearch: function handleSearch() {
  2015. var _this4 = this;
  2016. this.getlockAlert();
  2017. var q = {};
  2018. if (this.deviceNum != '') {
  2019. q = {
  2020. alertType: this.query.alertType,
  2021. deviceNum: this.deviceNum,
  2022. deviceType: 6
  2023. };
  2024. } else {
  2025. q = {
  2026. alertType: this.query.alertType,
  2027. deviceNum: this.query.deviceName,
  2028. deviceType: 6
  2029. };
  2030. }
  2031. var data = {
  2032. pageNum: 1,
  2033. pageSize: 10,
  2034. q: this.searchParaProcess(q),
  2035. orderBy: "alert_time desc"
  2036. };
  2037. Object(api["d" /* httpGet */])(data, this.$api.getLockAlert).then(function (res) {
  2038. var AboutDevice = _this4.AboutDevice;
  2039. res.data.list.map(function (li) {
  2040. li.createAt = _this4.time(+new Date(li.createAt));
  2041. li.alertTime = moment_default()(li.alertTime * 1000).format("YYYY-MM-DD HH:mm:ss");
  2042. var resultArr = AboutDevice.filter(function (_item) {
  2043. return _item.deviceNum == li.deviceNum;
  2044. })[0];
  2045. if (resultArr) {
  2046. li.roomId = resultArr.id;
  2047. li.roomName = resultArr.roomName;
  2048. }
  2049. li['alertTypeDesc'] = '';
  2050. var alertTypeDesc = _this4.alertTypeList.filter(function (item) {
  2051. return item.code == li.alertType;
  2052. })[0];
  2053. if (alertTypeDesc) {
  2054. li['alertTypeDesc'] = alertTypeDesc.desc;
  2055. }
  2056. });
  2057. _this4.$store.commit('increment', 1);
  2058. _this4.tableData = res.data.list;
  2059. _this4.pageTotal = res.data.total;
  2060. });
  2061. // this.$set(this.query, "pageIndex", 1);
  2062. },
  2063. // 分页导航
  2064. handlePageChange: function handlePageChange(val) {
  2065. var _this5 = this;
  2066. this.$store.commit('increment', val);
  2067. var q = {};
  2068. if (this.deviceNum != '') {
  2069. q = {
  2070. alertType: this.query.alertType,
  2071. deviceNum: this.deviceNum,
  2072. deviceType: 6
  2073. };
  2074. } else {
  2075. q = {
  2076. alertType: this.query.alertType,
  2077. deviceNum: this.query.deviceName,
  2078. deviceType: 6
  2079. };
  2080. }
  2081. var data = {
  2082. pageNum: val,
  2083. pageSize: 10,
  2084. q: this.searchParaProcess(q),
  2085. orderBy: "alert_time desc"
  2086. };
  2087. Object(api["d" /* httpGet */])(data, this.$api.getLockAlert).then(function (res) {
  2088. var AboutDevice = _this5.AboutDevice;
  2089. res.data.list.map(function (li) {
  2090. li.createAt = _this5.time(+new Date(li.createAt));
  2091. li.alertTime = moment_default()(li.alertTime * 1000).format("YYYY-MM-DD HH:mm:ss");
  2092. var resultArr = AboutDevice.filter(function (_item) {
  2093. return _item.deviceNum == li.deviceNum;
  2094. })[0];
  2095. if (resultArr) {
  2096. li.roomId = resultArr.id;
  2097. li.roomName = resultArr.roomName;
  2098. }
  2099. li['alertTypeDesc'] = '';
  2100. var alertTypeDesc = _this5.alertTypeList.filter(function (item) {
  2101. return item.code == li.alertType;
  2102. })[0];
  2103. if (alertTypeDesc) {
  2104. li['alertTypeDesc'] = alertTypeDesc.desc;
  2105. }
  2106. });
  2107. _this5.tableData = res.data.list;
  2108. _this5.pageTotal = res.data.total;
  2109. });
  2110. }
  2111. }
  2112. });
  2113. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/template-compiler?{"id":"data-v-4c5a757c","hasScoped":true,"transformToRequire":{"video":["src","poster"],"source":"src","img":"src","image":"xlink:href"},"buble":{"transforms":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/views/log/humanMotionSensorLog.vue
  2114. var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('div',{staticClass:"container"},[_c('div',{staticClass:"handle-box"},[_c('selectoption'),_vm._v(" "),_c('el-input',{staticClass:"handle-input mr10",attrs:{"size":"small","placeholder":"设备号","clearable":true},model:{value:(_vm.query.deviceName),callback:function ($$v) {_vm.$set(_vm.query, "deviceName", $$v)},expression:"query.deviceName"}}),_vm._v(" "),_c('el-select',{staticClass:"handle-select mr10",attrs:{"size":"small","clearable":true,"placeholder":"报警类型"},model:{value:(_vm.query.alertType),callback:function ($$v) {_vm.$set(_vm.query, "alertType", $$v)},expression:"query.alertType"}},_vm._l((_vm.alertTypeList),function(item){return _c('el-option',{key:item.code,attrs:{"label":item.desc,"value":item.code}})}),1),_vm._v(" "),_c('el-button',{attrs:{"type":"primary","size":"small","icon":"el-icon-search"},on:{"click":_vm.handleSearch}},[_vm._v("搜索")]),_vm._v(" "),_c('el-button',{attrs:{"type":"primary","size":"small","icon":"el-icon-search"},on:{"click":_vm.restFun}},[_vm._v("重置")])],1),_vm._v(" "),_c('el-table',{ref:"multipleTable",staticClass:"table",attrs:{"data":_vm.tableData,"border":"","header-cell-class-name":"table-header"}},[_c('el-table-column',{attrs:{"prop":"id","label":"ID"}}),_vm._v(" "),_c('el-table-column',{attrs:{"prop":"deviceNum","label":"设备号"}}),_vm._v(" "),_c('el-table-column',{attrs:{"prop":"roomName","label":"房间名称"}}),_vm._v(" "),_c('el-table-column',{attrs:{"prop":"alertTime","label":"报警时间"}}),_vm._v(" "),_c('el-table-column',{attrs:{"label":"报警类型"},scopedSlots:_vm._u([{key:"default",fn:function(scope){return [_c('span',[_vm._v(_vm._s(scope.row.alertTypeDesc))])]}}])})],1),_vm._v(" "),_c('div',{staticClass:"pagination"},[_c('el-pagination',{attrs:{"background":"","layout":"total, prev, pager, next","current-page":_vm.$store.state.currentPage,"page-size":10,"total":_vm.pageTotal},on:{"current-change":_vm.handlePageChange}})],1)],1)])}
  2115. var staticRenderFns = []
  2116. var esExports = { render: render, staticRenderFns: staticRenderFns }
  2117. /* harmony default export */ var log_humanMotionSensorLog = (esExports);
  2118. // CONCATENATED MODULE: ./src/views/log/humanMotionSensorLog.vue
  2119. function injectStyle (ssrContext) {
  2120. __webpack_require__("1dxu")
  2121. }
  2122. var normalizeComponent = __webpack_require__("VU/8")
  2123. /* script */
  2124. /* template */
  2125. /* template functional */
  2126. var __vue_template_functional__ = false
  2127. /* styles */
  2128. var __vue_styles__ = injectStyle
  2129. /* scopeId */
  2130. var __vue_scopeId__ = "data-v-4c5a757c"
  2131. /* moduleIdentifier (server only) */
  2132. var __vue_module_identifier__ = null
  2133. var Component = normalizeComponent(
  2134. humanMotionSensorLog,
  2135. log_humanMotionSensorLog,
  2136. __vue_template_functional__,
  2137. __vue_styles__,
  2138. __vue_scopeId__,
  2139. __vue_module_identifier__
  2140. )
  2141. /* harmony default export */ var views_log_humanMotionSensorLog = __webpack_exports__["default"] = (Component.exports);
  2142. /***/ })
  2143. });