完成签约之后直接添加人员,录入下发凭证
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.

1919 lines
74 KiB

  1. webpackJsonp([45],{
  2. /***/ "I88j":
  3. /***/ (function(module, exports) {
  4. // removed by extract-text-webpack-plugin
  5. /***/ }),
  6. /***/ "WF02":
  7. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8. "use strict";
  9. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  10. // EXTERNAL MODULE: ./node_modules/babel-runtime/helpers/defineProperty.js
  11. var defineProperty = __webpack_require__("bOdI");
  12. var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty);
  13. // EXTERNAL MODULE: ./node_modules/babel-runtime/core-js/promise.js
  14. var promise = __webpack_require__("//Fk");
  15. var promise_default = /*#__PURE__*/__webpack_require__.n(promise);
  16. // EXTERNAL MODULE: ./node_modules/babel-runtime/regenerator/index.js
  17. var regenerator = __webpack_require__("Xxa5");
  18. var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator);
  19. // EXTERNAL MODULE: ./node_modules/babel-runtime/helpers/asyncToGenerator.js
  20. var asyncToGenerator = __webpack_require__("exGp");
  21. var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
  22. // EXTERNAL MODULE: ./node_modules/babel-runtime/core-js/json/stringify.js
  23. var stringify = __webpack_require__("mvHQ");
  24. var stringify_default = /*#__PURE__*/__webpack_require__.n(stringify);
  25. // EXTERNAL MODULE: ./src/api/index.js + 5 modules
  26. var api = __webpack_require__("gyMJ");
  27. // EXTERNAL MODULE: ./src/components/zTree1.vue + 2 modules
  28. var zTree1 = __webpack_require__("6Ljo");
  29. // EXTERNAL MODULE: ./src/components/deviceLi.vue + 2 modules
  30. var deviceLi = __webpack_require__("4qFG");
  31. // EXTERNAL MODULE: ./src/components/UnlockRecord.vue + 2 modules
  32. var UnlockRecord = __webpack_require__("YBqH");
  33. // EXTERNAL MODULE: ./src/components/DeviceFeedbackLog.vue + 2 modules
  34. var DeviceFeedbackLog = __webpack_require__("5skf");
  35. // EXTERNAL MODULE: ./src/components/warningLog.vue + 2 modules
  36. var warningLog = __webpack_require__("+K0N");
  37. // EXTERNAL MODULE: ./src/utils/index.js
  38. var utils = __webpack_require__("0xDb");
  39. // EXTERNAL MODULE: ./node_modules/xlsx/xlsx.js
  40. var xlsx = __webpack_require__("uXZL");
  41. var xlsx_default = /*#__PURE__*/__webpack_require__.n(xlsx);
  42. // EXTERNAL MODULE: ./src/utils/util.js
  43. var util = __webpack_require__("oFuF");
  44. // EXTERNAL MODULE: ./src/utils/equipment.js
  45. var equipment = __webpack_require__("ObZk");
  46. // EXTERNAL MODULE: ./node_modules/moment/moment.js
  47. var moment = __webpack_require__("PJh5");
  48. var moment_default = /*#__PURE__*/__webpack_require__.n(moment);
  49. // EXTERNAL MODULE: ./src/api/allFun.js
  50. var allFun = __webpack_require__("mprh");
  51. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./src/views/device/AirCleaningDevice.vue
  52. var _methods;
  53. //
  54. //
  55. //
  56. //
  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. //
  409. //
  410. //
  411. //
  412. //
  413. //
  414. //
  415. //
  416. //
  417. //
  418. //
  419. //
  420. //
  421. //
  422. //
  423. //
  424. //
  425. //
  426. //
  427. //
  428. //
  429. //
  430. //
  431. //
  432. //
  433. //
  434. //
  435. //
  436. //
  437. //
  438. //
  439. //
  440. //
  441. //
  442. //
  443. //
  444. //
  445. //
  446. //
  447. //
  448. //
  449. /* harmony default export */ var AirCleaningDevice = ({
  450. inject: ['reload'],
  451. name: "doorLock",
  452. data: function data() {
  453. return {
  454. searchRoom: '',
  455. deviceImg: __webpack_require__("It2U"),
  456. selectoption: [],
  457. selectoptionValue: '',
  458. senddeviceNum: '',
  459. sendroomId: '',
  460. commpontentStatus: true,
  461. Emergence: {
  462. EmerPhone: '',
  463. password: '',
  464. device: '',
  465. name: ''
  466. },
  467. defaultProps: {
  468. children: "children",
  469. label: "name"
  470. },
  471. options: [],
  472. drawer: false,
  473. value1: false,
  474. value2: 0,
  475. marks: {
  476. 0: "关",
  477. 50: "中",
  478. 100: "高"
  479. },
  480. switchtext: "关",
  481. activeName: "0",
  482. formInline: {},
  483. platlist: [{
  484. label: "电信",
  485. value: 1
  486. }, {
  487. label: "移动",
  488. value: 2
  489. }, {
  490. label: "联通",
  491. value: 3
  492. }],
  493. manufacturerList: [],
  494. setting: {
  495. edit: {
  496. enable: true,
  497. drag: {
  498. isMove: true
  499. },
  500. showRemoveBtn: false,
  501. showRenameBtn: false
  502. },
  503. check: {
  504. enable: false
  505. },
  506. data: {
  507. simpleData: {
  508. enable: true,
  509. pIdKey: "pid"
  510. }
  511. },
  512. view: {
  513. showIcon: true,
  514. addHoverDom: this.addHoverDom,
  515. removeHoverDom: this.removeHoverDom
  516. }
  517. },
  518. zNodes: [],
  519. bromm: {},
  520. query: {
  521. address: "",
  522. name: "",
  523. pageIndex: 1,
  524. pageSize: 20,
  525. options: []
  526. },
  527. search: {
  528. name: "",
  529. deviceNum: "",
  530. roomname: '',
  531. imei: "",
  532. isOnline: "",
  533. startBattery: '0',
  534. endBattery: '100'
  535. },
  536. tableData: [],
  537. multipleSelection: [],
  538. delList: [],
  539. editVisible: false,
  540. roomVisible: false,
  541. pageTotal: 0,
  542. sumpageTotal: 0,
  543. currentPage4: 1,
  544. form: {
  545. manufacturer: "",
  546. validateCode: ''
  547. },
  548. idx: -1,
  549. id: -1,
  550. abnormal: 0,
  551. online: 0,
  552. treedata: [],
  553. unonline: 0,
  554. Unlocking: false,
  555. Unlockingrow: {},
  556. lockingform: {
  557. password: ""
  558. },
  559. activeiconfont: true,
  560. info: [],
  561. uploadkj: false,
  562. userlist1statu: true,
  563. userlist2: [],
  564. multipleSelection1: [],
  565. batchAccess: "",
  566. getEmergenceStatus: false,
  567. getEmergenceNum: '',
  568. checkNodeId: '',
  569. pageSize: 10,
  570. pageNum: 1,
  571. sendStatus: true,
  572. userInfo: {
  573. type: ''
  574. },
  575. checkNodeId1: '',
  576. accessPlatform: {}
  577. };
  578. },
  579. components: {
  580. zTree: zTree1["a" /* default */],
  581. deviceLi: deviceLi["a" /* default */],
  582. UnlockRecord: UnlockRecord["a" /* default */],
  583. warningLog: warningLog["a" /* default */],
  584. DeviceFeedbackLog: DeviceFeedbackLog["a" /* default */]
  585. },
  586. beforeCreate: function beforeCreate() {},
  587. created: function created() {
  588. this.manufacturerList = this.$MANUFACTURER.MANUFACTURER.AirCleaning;
  589. this.accessPlatform = this.$MANUFACTURER.accessPlatform;
  590. this.userInfo = JSON.parse(localStorage.getItem('info'));
  591. this.getdevice();
  592. this.getalllist();
  593. this.info = JSON.parse(localStorage.getItem("info"));
  594. this.$store.commit("increment", 1);
  595. this.getcard();
  596. this.getallTree();
  597. },
  598. methods: (_methods = {
  599. InputFun: function InputFun(e, name) {
  600. if (name == 'startBattery' || name == 'endBattery') {
  601. if (Number(e) < 0) {
  602. e = 0;
  603. }
  604. if (Number(e) > 100) {
  605. e = 100;
  606. }
  607. }
  608. this.search[name] = e;
  609. },
  610. selectTenantId: function selectTenantId(e) {
  611. localStorage.setItem('tenantId', e);
  612. this.reload();
  613. },
  614. // 重置初始化
  615. resetInitialization: function resetInitialization(row, callback) {
  616. var _this2 = this;
  617. if (row.manufactureId == 201) {
  618. var data3 = {
  619. code: "zg/deleteAllUsers",
  620. data: {
  621. lockerId: row.deviceNum,
  622. imei: row.imei,
  623. order: 6501
  624. }
  625. };
  626. Object(api["g" /* httpPost */])(data3, this.$api.sendCommand).then(function (res) {
  627. if (res.success) {
  628. _this2.$message.success("重置成功");
  629. callback(true);
  630. } else {
  631. callback(false);
  632. }
  633. });
  634. } else if (row.manufactureId == 101) {
  635. var data2 = {
  636. code: "isp/restoreSetting",
  637. data: {
  638. order: 6501,
  639. imei: row.imei,
  640. deviceNum: row.deviceNum,
  641. managerTelephone: "18270949468",
  642. managerPassword: "202108"
  643. }
  644. };
  645. Object(api["g" /* httpPost */])(data2, this.$api.sendCommand).then(function (res2) {
  646. if (res2.success) {
  647. _this2.$message.success("重置成功");
  648. var str = {
  649. deviceNum: row.deviceNum,
  650. imei: row.imei,
  651. order: 6101
  652. };
  653. Object(api["g" /* httpPost */])(str, _this2.$api.getDeviceRegisterManager).then(function (res1) {
  654. var str1 = {
  655. imei: row.imei, //row.imsi,
  656. deviceNum: row.deviceNum, //row.deviceNum,
  657. operateMode: 7,
  658. is: true,
  659. order: 6207,
  660. passwordStartTime: "20210813010101",
  661. passwordEndTime: "20680813010101"
  662. };
  663. Object(api["g" /* httpPost */])(str1, _this2.$api.getDeviceOperateUserInfo).then(function (res2) {});
  664. var str2 = {
  665. imei: row.imei, //row.imsi,
  666. deviceNum: row.deviceNum, //row.deviceNum,
  667. operateMode: 4,
  668. is: true,
  669. order: 6204,
  670. passwordStartTime: "20210813010101",
  671. passwordEndTime: "20680813010101"
  672. };
  673. Object(api["g" /* httpPost */])(str2, _this2.$api.getDeviceOperateUserInfo).then(function (res3) {
  674. if (res3.success) {
  675. _this2.$message.success("初始化成功");
  676. callback(true);
  677. }
  678. });
  679. });
  680. } else {
  681. _this2.$message.error(res2.msg);
  682. callback(false);
  683. }
  684. });
  685. }
  686. },
  687. getPersonCallback: function getPersonCallback(person, alllist, callback) {
  688. var personlist = [];
  689. person.map(function (li) {
  690. var obj = {
  691. person: li,
  692. data: alllist.filter(function (item) {
  693. if (item.deviceNum && item.cardId == li.card) {
  694. return item;
  695. }
  696. })
  697. };
  698. personlist.push(obj);
  699. });
  700. callback(personlist);
  701. },
  702. // 数据同步
  703. dataSynchronization: function dataSynchronization(index, row) {
  704. var _this3 = this;
  705. this.$confirm("是否确认数据同步?", "提示", {
  706. confirmButtonText: "确定",
  707. cancelButtonText: "取消",
  708. type: "warning"
  709. }).then(function () {
  710. _this3.orderDeviceData(row);
  711. });
  712. },
  713. // 获取指定锁所有非703凭证数据
  714. orderDeviceData: function orderDeviceData(row) {
  715. var _this4 = this;
  716. var _this = this;
  717. if (row.roomId) {
  718. var data1 = {
  719. pageNum: 0,
  720. pageSize: 0,
  721. q: {
  722. id: row.roomId
  723. }
  724. };
  725. Object(api["d" /* httpGet */])(data1, this.$api.getSiteTenant).then(function (res) {
  726. if (res.success) {
  727. var person = res.data.list;
  728. var data = {
  729. imei: row.imei
  730. };
  731. Object(api["d" /* httpGet */])(data, _this4.$api.orderDeviceData).then(function (res1) {
  732. if (res1.success) {
  733. var alllist = res1.data;
  734. _this4.getPersonCallback(person, alllist, function (callback) {
  735. var personlist = callback;
  736. _this.resetInitialization(row, function (callback) {
  737. if (row.manufactureId == 101) {
  738. personlist.map(function (lt) {
  739. var endTime = new Date(lt.person.endTime).getTime();
  740. var startTime = new Date(lt.person.startTime).getTime();
  741. var passwordEndTime = moment_default()(endTime).format("YYYYMMDDHHmmss");
  742. var passwordStartTime = moment_default()(startTime).format("YYYYMMDDHHmmss");
  743. var userTelephone = JSON.parse(lt.person.info).userTelephone;
  744. var userPassword = JSON.parse(lt.person.info).userPassword;
  745. var data = {
  746. deviceNum: row.deviceNum,
  747. imei: row.imei,
  748. userTelephone: userTelephone,
  749. userPassword: userPassword,
  750. password: userPassword,
  751. operateMode: 26,
  752. order: 6226,
  753. passwordStartTime: passwordStartTime,
  754. passwordEndTime: passwordEndTime,
  755. cardName: lt.person.name,
  756. roomName: row.roomName
  757. };
  758. 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) {
  759. lt.data.map(function (ll) {
  760. util["a" /* default */].putCarfidAdd(row, ll);
  761. });
  762. });
  763. });
  764. } else if (row.manufactureId == 201) {
  765. personlist.map(function (lt) {
  766. var endTime = new Date(lt.person.endTime).getTime();
  767. var startTime = new Date(lt.person.startTime).getTime();
  768. var passwordEndTime = moment_default()(endTime).format("YYYYMMDDHHmmss");
  769. var passwordStartTime = moment_default()(startTime).format("YYYYMMDDHHmmss");
  770. var userTelephone = JSON.parse(lt.person.info).userTelephone;
  771. var userPassword = JSON.parse(lt.person.info).userPassword;
  772. var data = {
  773. lockerId: row.deviceNum,
  774. imei: row.imei,
  775. lockerUserId: userPassword,
  776. keyId: userPassword,
  777. role: 0,
  778. action: 1,
  779. order: 6226,
  780. cardName: lt.person.name,
  781. roomName: row.roomName
  782. };
  783. equipment["a" /* default */].addUserToLock(data.lockerId, data.imei, data.lockerUserId, data.role, data.action, data.order, data.cardName, data.roomName, function (callback) {
  784. if (callback.success) {
  785. lt.data.map(function (ll) {
  786. util["a" /* default */].putCarfidzgAdd(row, ll);
  787. });
  788. }
  789. });
  790. });
  791. }
  792. });
  793. });
  794. } else {
  795. _this4.$message.error(res1.msg);
  796. }
  797. });
  798. } else {
  799. _this4.$message.error(res.msg);
  800. }
  801. });
  802. } else {
  803. this.$message.error("暂无数据");
  804. }
  805. },
  806. // 从paas同步能对应得上的有效凭证
  807. syncCommands: function syncCommands() {
  808. Object(api["d" /* httpGet */])('', this.$api.syncCommands).then(function (res) {});
  809. },
  810. // 同步刷新
  811. refreshFun: function refreshFun() {
  812. Object(api["d" /* httpGet */])("", this.$api.lockDeviceInfoList).then(function (res) {});
  813. },
  814. // 选择房源
  815. checkNode: function checkNode(e) {
  816. this.checkNodeId = e;
  817. var options = this.options;
  818. var arr = this.getId(options, e[e.length - 1]);
  819. var listarr = [arr[0]];
  820. var obj = this.getNodeId(listarr);
  821. this.checkNodeId = obj;
  822. },
  823. checkNodeOne: function checkNodeOne(e) {
  824. this.checkNodeId1 = e[e.length - 1];
  825. this.checkRoomDevice(e[e.length - 1]);
  826. },
  827. checkRoomDevice: function checkRoomDevice(id) {
  828. var _this5 = this;
  829. var q = {
  830. roomIds: [id],
  831. lockType: 5
  832. };
  833. var data = {
  834. q: stringify_default()(q),
  835. pageNum: 1,
  836. pageSize: this.pageSize
  837. };
  838. Object(api["g" /* httpPost */])(data, this.$api.getDeviceItems).then(function (res) {
  839. if (res.data.list.length > 0) {
  840. _this5.$message.error("该房间已绑定锁,请重新选择");
  841. _this5.checkNodeId1 = '';
  842. }
  843. });
  844. },
  845. getParentId: function getParentId(list, id) {
  846. for (var i in list) {
  847. if (list[i].id == id) {
  848. return [list[i]];
  849. }
  850. if (list[i].children) {
  851. var node = this.getParentId(list[i].children, id);
  852. if (node !== undefined) {
  853. return node.concat(list[i]);
  854. }
  855. }
  856. }
  857. },
  858. getId: function getId(list, id) {
  859. for (var i in list) {
  860. if (list[i].id == id) {
  861. return [list[i]];
  862. }
  863. if (list[i].children) {
  864. var node = this.getParentId(list[i].children, id);
  865. if (node !== undefined) {
  866. return node;
  867. }
  868. }
  869. }
  870. },
  871. getNodeId: function getNodeId(list) {
  872. var newNodeId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  873. for (var i in list) {
  874. newNodeId.push(list[i].id);
  875. if (list[i].children) {
  876. this.getNodeId(list[i].children, newNodeId);
  877. }
  878. }
  879. return newNodeId;
  880. },
  881. getallTree: function getallTree() {
  882. var _this6 = this;
  883. var data = {};
  884. Object(api["d" /* httpGet */])(data, this.$api.getTree).then(function (res) {
  885. var userlist = [];
  886. var temp = {},
  887. arr = [];
  888. res.data.forEach(function (item, index) {
  889. if (!temp[item.id]) {
  890. arr.push(item);
  891. temp[item.id] = true;
  892. }
  893. });
  894. arr.map(function (li) {
  895. if (li.expand) {
  896. if (JSON.parse(li.expand).type == "0") {
  897. userlist.push(li);
  898. }
  899. }
  900. });
  901. var arrdata = Object(utils["o" /* uniqueArray1 */])(res.data, "id");
  902. _this6.options = Object(utils["p" /* ztreeToElementTree */])(arrdata, {});
  903. });
  904. },
  905. // 获取门卡概况
  906. getcard: function getcard() {
  907. var _this7 = this;
  908. allFun["a" /* default */].getAnalysis("", 5, function (callback) {
  909. _this7.sumpageTotal = callback.total;
  910. _this7.online = callback.onlineTotal;
  911. _this7.unonline = callback.offlineTotal;
  912. _this7.abnormal = callback.abnormalTotal;
  913. });
  914. },
  915. // 发送离线密码
  916. sendEmergence: function sendEmergence() {
  917. var _this8 = this;
  918. var re = /^1\d{10}$/;
  919. if (re.test(this.Emergence.EmerPhone)) {
  920. var data = {
  921. code: this.Emergence.password,
  922. phone: this.Emergence.EmerPhone,
  923. device: this.Emergence.device,
  924. name: this.Emergence.name
  925. };
  926. Object(api["g" /* httpPost */])(data, this.$api.sendEmergence).then(function (res) {
  927. if (res.success) {
  928. _this8.$message.success('发送成功');
  929. } else {
  930. _this8.$message.error('发送失败');
  931. }
  932. });
  933. this.getEmergenceStatus = false;
  934. } else {
  935. this.$message.error('请填写正确手机号');
  936. }
  937. },
  938. handleCheckChange: function handleCheckChange(data, checked, node) {
  939. if (checked) {
  940. this.treedata = data;
  941. } else {
  942. if (this.checkedId == data.id) {
  943. this.$refs.tree.setCheckedKeys([data.id]);
  944. }
  945. }
  946. },
  947. // 临时密码
  948. getEmergence: function getEmergence(index, row) {
  949. var _this9 = this;
  950. var data = {
  951. code: "zg/getEmergence",
  952. data: {
  953. lockerId: row.deviceNum
  954. }
  955. };
  956. Object(api["g" /* httpPost */])(data, this.$api.sendCommand).then(function (res) {
  957. if (res.success) {
  958. _this9.$message.success("获取成功");
  959. _this9.Emergence.password = res.data.data;
  960. _this9.Emergence.device = row.deviceNum;
  961. _this9.Emergence.name = row.roomName;
  962. _this9.getEmergenceStatus = true;
  963. } else {
  964. _this9.$message.error("获取失败");
  965. }
  966. });
  967. },
  968. // input视图刷新
  969. changesr: function changesr(e) {
  970. this.$forceUpdate();
  971. },
  972. handleSelectionChange1: function handleSelectionChange1(val) {
  973. this.multipleSelection1 = val;
  974. },
  975. BatchAdd: function BatchAdd() {
  976. this.uploadkj = true;
  977. },
  978. //批量添加确认
  979. batchUploadfun: function batchUploadfun() {
  980. var _this10 = this;
  981. return asyncToGenerator_default()( /*#__PURE__*/regenerator_default.a.mark(function _callee() {
  982. return regenerator_default.a.wrap(function _callee$(_context) {
  983. while (1) {
  984. switch (_context.prev = _context.next) {
  985. case 0:
  986. if (!(_this10.batchAccess == "")) {
  987. _context.next = 4;
  988. break;
  989. }
  990. _this10.$message.error("请选择运营商");
  991. _context.next = 10;
  992. break;
  993. case 4:
  994. if (!(_this10.multipleSelection1.length == 0)) {
  995. _context.next = 8;
  996. break;
  997. }
  998. _this10.$message.error("请勾选要批量添加的设备");
  999. _context.next = 10;
  1000. break;
  1001. case 8:
  1002. _context.next = 10;
  1003. return _this10.multipleSelection1.map(function (li, index) {
  1004. var str = {
  1005. deviceNum: li.deviceNum,
  1006. imei: li.imei,
  1007. imsi: li.imei, //row.imsi,
  1008. order: 5101,
  1009. platformId: _this10.batchAccess
  1010. };
  1011. Object(api["g" /* httpPost */])(str, _this10.$api.DeviceRegisterDevice).then(function (res) {
  1012. if (res.data.success) {
  1013. // this.$message.success(res.data.msg);
  1014. // this.editVisible = false;
  1015. // this.getdevice();
  1016. _this10.AddAdministrator(index, li);
  1017. }
  1018. });
  1019. }).then(function (res) {
  1020. _this10.$message.success("添加成功");
  1021. _this10.editVisible = false;
  1022. _this10.getdevice();
  1023. });
  1024. case 10:
  1025. case "end":
  1026. return _context.stop();
  1027. }
  1028. }
  1029. }, _callee, _this10);
  1030. }))();
  1031. },
  1032. //音量设置
  1033. stepFun: function stepFun(val) {
  1034. var _this11 = this;
  1035. var operate = "00";
  1036. if (val == 0) {
  1037. operate = "00";
  1038. } else if (val == 50) {
  1039. operate = "01";
  1040. } else if (val == 100) {
  1041. operate = "02";
  1042. }
  1043. var data = {
  1044. code: "isp/volumnSetting",
  1045. data: {
  1046. imei: this.formInline.imei,
  1047. operate: operate
  1048. }
  1049. };
  1050. Object(api["g" /* httpPost */])(data, this.$api.sendCommand).then(function (res2) {
  1051. if (res2.data.success) {
  1052. _this11.$message.success("设置成功");
  1053. } else {
  1054. _this11.$message.error(res.msg);
  1055. }
  1056. });
  1057. },
  1058. // 常开设置
  1059. switchFun: function switchFun(e) {
  1060. var _this12 = this;
  1061. var data = {};
  1062. if (e) {
  1063. this.switchtext = "开";
  1064. data = {
  1065. code: "isp/alwaysOpenSetting",
  1066. data: {
  1067. imei: this.formInline.imei,
  1068. operate: 1
  1069. }
  1070. };
  1071. } else {
  1072. this.switchtext = "关";
  1073. data = {
  1074. code: "isp/alwaysOpenSetting",
  1075. data: {
  1076. imei: this.formInline.imei,
  1077. operate: 0
  1078. }
  1079. };
  1080. }
  1081. Object(api["g" /* httpPost */])(data, this.$api.sendCommand).then(function (res2) {
  1082. if (res2.data.success) {
  1083. _this12.$message.success("设置成功");
  1084. } else {
  1085. _this12.$message.error(res.msg);
  1086. }
  1087. });
  1088. },
  1089. // 关闭侧边栏
  1090. handleClose: function handleClose() {
  1091. this.drawer = false;
  1092. },
  1093. // tabs标签页切换
  1094. handleClick: function handleClick(tab, event) {
  1095. this.commpontentStatus = true;
  1096. }
  1097. }, defineProperty_default()(_methods, "handleClose", function handleClose(done) {
  1098. done();
  1099. }), defineProperty_default()(_methods, "detailsFun", function detailsFun(index, row) {
  1100. this.drawer = true;
  1101. this.formInline = row;
  1102. this.sendStatus = false;
  1103. this.$nextTick(function () {
  1104. this.sendroomId = row.deviceNum;
  1105. this.senddeviceNum = row.deviceNum;
  1106. this.sendStatus = true;
  1107. });
  1108. }), defineProperty_default()(_methods, "Reset1", function Reset1(index, row) {
  1109. var data2 = {
  1110. code: "isp/restoreSetting",
  1111. data: {
  1112. order: 6501,
  1113. imei: row.imei,
  1114. deviceNum: row.deviceNum,
  1115. managerTelephone: "18270949468",
  1116. managerPassword: "202108"
  1117. }
  1118. };
  1119. Object(api["g" /* httpPost */])(data2, this.$api.sendCommand).then(function (res2) {
  1120. // if (res2.data.success) {
  1121. // this.$message.success("重置成功");
  1122. // } else {
  1123. // this.$message.error(res.msg);
  1124. // }
  1125. });
  1126. }), defineProperty_default()(_methods, "Reset", function Reset(index, row) {
  1127. var _this13 = this;
  1128. this.$confirm("是否确认重置门锁?", "提示", {
  1129. confirmButtonText: "确定",
  1130. cancelButtonText: "取消",
  1131. type: "warning"
  1132. }).then(function () {
  1133. if (row.manufactureId == 201) {
  1134. var data3 = {
  1135. code: "zg/deleteAllUsers",
  1136. data: {
  1137. lockerId: row.deviceNum,
  1138. imei: row.imei,
  1139. order: 6501,
  1140. cardName: _this13.info.username,
  1141. roomName: row.roomName
  1142. }
  1143. };
  1144. Object(api["g" /* httpPost */])(data3, _this13.$api.sendCommand).then(function (res) {
  1145. if (res.success) {
  1146. _this13.$message.success("重置成功");
  1147. var q = {
  1148. id: row.roomId
  1149. };
  1150. var tenant = {
  1151. q: stringify_default()(q)
  1152. };
  1153. Object(api["d" /* httpGet */])(tenant, _this13.$api.getSiteTenant).then(function (res) {
  1154. promise_default.a.all(res.data.list.map(function (element) {
  1155. return new promise_default.a(function (resolve, reject) {
  1156. resolve(element.card);
  1157. });
  1158. })).then(function (allId) {
  1159. allId.map(function (li) {
  1160. var str = [{
  1161. siteId: row.roomId,
  1162. cardId: li
  1163. }];
  1164. Object(api["g" /* httpPost */])(str, _this13.$api.unbindCard).then(function (res) {});
  1165. });
  1166. });
  1167. });
  1168. } else {
  1169. _this13.$message.success(res.msg);
  1170. }
  1171. });
  1172. } else if (row.manufactureId == 101) {
  1173. var data2 = {
  1174. code: "isp/restoreSetting",
  1175. data: {
  1176. order: 6501,
  1177. imei: row.imei,
  1178. deviceNum: row.deviceNum,
  1179. managerTelephone: "18270949468",
  1180. managerPassword: "202108",
  1181. cardName: _this13.info.username,
  1182. roomName: row.roomName
  1183. }
  1184. };
  1185. Object(api["g" /* httpPost */])(data2, _this13.$api.sendCommand).then(function (res2) {
  1186. if (res2.success) {
  1187. _this13.$message.success("重置成功");
  1188. var q = {
  1189. id: row.roomId
  1190. };
  1191. var tenant = {
  1192. q: stringify_default()(q)
  1193. };
  1194. Object(api["d" /* httpGet */])(tenant, _this13.$api.getSiteTenant).then(function (res) {
  1195. promise_default.a.all(res.data.list.map(function (element) {
  1196. return new promise_default.a(function (resolve, reject) {
  1197. resolve(element.card);
  1198. });
  1199. })).then(function (allId) {
  1200. allId.map(function (li) {
  1201. var str = [{
  1202. siteId: row.roomId,
  1203. cardId: li
  1204. }];
  1205. Object(api["g" /* httpPost */])(str, _this13.$api.unbindCard).then(function (res) {});
  1206. });
  1207. });
  1208. });
  1209. } else {
  1210. _this13.$message.error(res2.msg);
  1211. }
  1212. });
  1213. }
  1214. });
  1215. }), defineProperty_default()(_methods, "activeiconfun", function activeiconfun(t) {
  1216. this.activeiconfont = t;
  1217. }), defineProperty_default()(_methods, "getresult", function getresult() {
  1218. var data = {};
  1219. }), defineProperty_default()(_methods, "Unlockingsave", function Unlockingsave() {}), defineProperty_default()(_methods, "RemoteUnlocking", function RemoteUnlocking(index, row) {
  1220. var _this14 = this;
  1221. var str2 = {
  1222. imei: row.imei,
  1223. roomId: row.roomId,
  1224. openLockType: 2,
  1225. is: true
  1226. };
  1227. Object(api["g" /* httpPost */])(str2, this.$api.openLock).then(function (res3) {
  1228. if (res3.success) {
  1229. _this14.$message.success("开锁成功!");
  1230. _this14.Unlocking = false;
  1231. } else {
  1232. _this14.$message.error("开锁失败!");
  1233. }
  1234. });
  1235. }), defineProperty_default()(_methods, "AddAdministrator", function AddAdministrator(index, row) {
  1236. var _this15 = this;
  1237. var str = {
  1238. deviceNum: row.deviceNum,
  1239. imei: row.imei,
  1240. order: 6101
  1241. };
  1242. Object(api["g" /* httpPost */])(str, this.$api.getDeviceRegisterManager).then(function (res1) {
  1243. var str1 = {
  1244. imei: row.imei, //row.imsi,
  1245. deviceNum: row.deviceNum, //row.deviceNum,
  1246. operateMode: 7,
  1247. is: true,
  1248. order: 6207,
  1249. passwordStartTime: "20210813010101",
  1250. passwordEndTime: "20680813010101"
  1251. };
  1252. Object(api["g" /* httpPost */])(str1, _this15.$api.getDeviceOperateUserInfo).then(function (res2) {});
  1253. var str2 = {
  1254. imei: row.imei, //row.imsi,
  1255. deviceNum: row.deviceNum, //row.deviceNum,
  1256. operateMode: 4,
  1257. is: true,
  1258. order: 6204,
  1259. passwordStartTime: "20210813010101",
  1260. passwordEndTime: "20680813010101"
  1261. };
  1262. Object(api["g" /* httpPost */])(str2, _this15.$api.getDeviceOperateUserInfo).then(function (res3) {
  1263. if (res3.success) {
  1264. _this15.$message.success("初始化成功");
  1265. }
  1266. });
  1267. });
  1268. }), defineProperty_default()(_methods, "initialization", function initialization() {
  1269. var _this16 = this;
  1270. if (this.checkNodeId1 == '') {
  1271. this.$message.error("请选择房间");
  1272. } else {
  1273. if (this.form.manufacturer == 101) {
  1274. if (this.form.deviceNum == "" || this.form.v == "" || this.form.platformId == "") {
  1275. this.$message.error("请填写完整信息");
  1276. } else {
  1277. var data = {};
  1278. var data = {
  1279. deviceNum: this.form.deviceNum,
  1280. imei: this.form.imei,
  1281. imsi: this.form.imei, //row.imsi,
  1282. order: 5101,
  1283. enterpriseId: this.userInfo.enterpriseId,
  1284. platformId: this.form.platformId,
  1285. manufactureId: this.form.manufacturer
  1286. };
  1287. allFun["a" /* default */].RegisterDevice(data, function (callback) {
  1288. if (callback.success) {
  1289. var data = [{
  1290. siteId: _this16.checkNodeId1,
  1291. deviceId: callback.data.id
  1292. }];
  1293. Object(api["g" /* httpPost */])(data, _this16.$api.bindDeviceSite).then(function (res) {
  1294. if (res.success) {
  1295. _this16.editVisible = false;
  1296. _this16.$message.success("绑定成功");
  1297. }
  1298. }).catch(function (error) {
  1299. _this16.$message.error("\u7ED1\u5B9A\u5931\u8D25");
  1300. });
  1301. _this16.$message.success(res.data.msg);
  1302. _this16.editVisible = false;
  1303. _this16.getdevice();
  1304. } else {
  1305. _this16.$message.error(callback.message);
  1306. }
  1307. });
  1308. }
  1309. } else if (this.form.manufacturer == 201) {
  1310. var data = {
  1311. lockerId: this.form.lockerId,
  1312. imei: this.form.imei,
  1313. customerCode: this.form.customerCode,
  1314. lockerSuperAdminId: this.form.lockerSuperAdminId,
  1315. authKey: this.form.authKey,
  1316. type: this.form.type,
  1317. manufactureId: this.form.manufacturer,
  1318. enterpriseId: this.userInfo.enterpriseId,
  1319. order: 5101
  1320. };
  1321. allFun["a" /* default */].RegisterDevice(data, function (callback) {
  1322. if (callback.success) {
  1323. var data = [{
  1324. siteId: _this16.checkNodeId1,
  1325. deviceId: callback.data.id
  1326. }];
  1327. Object(api["g" /* httpPost */])(data, _this16.$api.bindDeviceSite).then(function (res) {
  1328. if (res.success) {
  1329. _this16.editVisible = false;
  1330. _this16.$message.success("绑定成功");
  1331. }
  1332. }).catch(function (error) {
  1333. _this16.$message.error("\u7ED1\u5B9A\u5931\u8D25");
  1334. });
  1335. _this16.$message.success(res.data.msg);
  1336. _this16.editVisible = false;
  1337. _this16.getdevice();
  1338. } else {
  1339. _this16.$message.error(callback.message);
  1340. }
  1341. });
  1342. } else if (this.form.manufacturer == 701) {
  1343. var data = {
  1344. deviceNum: this.form.deviceNum,
  1345. validateCode: this.form.validateCode,
  1346. manufactureId: this.form.manufacturer
  1347. };
  1348. allFun["a" /* default */].RegisterDevice(data, function (callback) {
  1349. if (callback.success) {
  1350. var data = [{
  1351. siteId: _this16.checkNodeId1,
  1352. deviceId: callback.data.id
  1353. }];
  1354. Object(api["g" /* httpPost */])(data, _this16.$api.bindDeviceSite).then(function (res) {
  1355. if (res.success) {
  1356. _this16.editVisible = false;
  1357. _this16.$message.success("绑定成功");
  1358. }
  1359. }).catch(function (error) {
  1360. _this16.$message.error("\u7ED1\u5B9A\u5931\u8D25");
  1361. });
  1362. _this16.$message.success(res.data.msg);
  1363. _this16.editVisible = false;
  1364. _this16.getdevice();
  1365. } else {
  1366. _this16.$message.error(callback.message);
  1367. }
  1368. });
  1369. }
  1370. }
  1371. }), defineProperty_default()(_methods, "onClick", function onClick(evt, treeId, treeNode) {
  1372. // 点击事件
  1373. this.treedata = treeNode;
  1374. }), defineProperty_default()(_methods, "getalllist", function getalllist() {
  1375. var _this17 = this;
  1376. var data = {};
  1377. Object(api["d" /* httpGet */])(data, this.$api.getTree).then(function (res) {
  1378. var array = Object(utils["n" /* uniqueArray */])(res.data, "id");
  1379. _this17.zNodes = Object(utils["p" /* ztreeToElementTree */])(array, {});
  1380. });
  1381. }), defineProperty_default()(_methods, "getdevice", function getdevice() {
  1382. var _this18 = this;
  1383. var data = {
  1384. pageNum: this.$store.state.currentPage,
  1385. pageSize: 10,
  1386. q: stringify_default()({
  1387. lockType: 5
  1388. })
  1389. };
  1390. Object(api["g" /* httpPost */])(data, this.$api.getDeviceItems).then(function (res) {
  1391. var online = 0,
  1392. unonline = 0,
  1393. devIds = "";
  1394. if (res.data.list.length > 0) {
  1395. res.data.list.map(function (li) {
  1396. var accessPlatform = _this18.accessPlatform.show.filter(function (item) {
  1397. return item.code == li.accessPlatform;
  1398. })[0];
  1399. if (accessPlatform) {
  1400. li['accessPlatformText'] = accessPlatform.desc;
  1401. } else {
  1402. li['accessPlatformText'] = '';
  1403. }
  1404. if (li.isOnline == 1) {
  1405. online++;
  1406. } else if (li.isOnline == 0) {
  1407. unonline++;
  1408. }
  1409. li.createAt = _this18.timestampToTime(li.createAt);
  1410. if (li.lastReportAt) {
  1411. li.lastReportAt = moment_default()(li.lastReportAt).format("YYYY-MM-DD HH:mm:ss");
  1412. } else {
  1413. li.lastReportAt = '';
  1414. }
  1415. devIds += li.deviceNum + ",";
  1416. });
  1417. var newArr = Object(utils["n" /* uniqueArray */])(res.data.list, "id");
  1418. _this18.tableData = newArr;
  1419. } else {
  1420. _this18.tableData = [];
  1421. }
  1422. _this18.currentPage4 = 1;
  1423. _this18.pageTotal = res.data.total;
  1424. });
  1425. }), defineProperty_default()(_methods, "timestampToTime", function timestampToTime(cjsj) {
  1426. var date = new Date(cjsj); //时间戳为10位需*1000,时间戳为13位的话不需乘1000
  1427. var Y = date.getFullYear() + "-";
  1428. var M = (date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1) + "-";
  1429. var D = date.getDate() + " ";
  1430. var h = date.getHours() + ":";
  1431. var m = date.getMinutes() + ":";
  1432. var s = date.getSeconds();
  1433. return Y + M + D + h + m + s;
  1434. }), defineProperty_default()(_methods, "handleChange", function handleChange(value) {
  1435. console.log(value);
  1436. }), defineProperty_default()(_methods, "restSearch", function restSearch() {
  1437. this.search = {
  1438. name: "",
  1439. deviceNum: "",
  1440. roomname: '',
  1441. imei: "",
  1442. isOnline: "",
  1443. unBind: '',
  1444. startBattery: '',
  1445. endBattery: ''
  1446. };
  1447. this.checkNodeId = '';
  1448. this.searchRoom = "";
  1449. this.handleSearch();
  1450. }), defineProperty_default()(_methods, "handleSearch", function handleSearch() {
  1451. var _this19 = this;
  1452. var deviceNum = this.search.deviceNum.replace(/\s*/g, "");
  1453. var imei = this.search.imei.replace(/\s*/g, "");
  1454. var q = {
  1455. deviceNum: deviceNum,
  1456. imei: imei,
  1457. isOnline: this.search.isOnline,
  1458. roomName: this.search.roomname,
  1459. roomIds: this.checkNodeId,
  1460. startBattery: this.search.startBattery,
  1461. endBattery: this.search.endBattery,
  1462. lockType: 5,
  1463. unBind: this.search.unBind
  1464. };
  1465. var data = {
  1466. q: stringify_default()(q),
  1467. pageNum: 1,
  1468. pageSize: this.pageSize
  1469. };
  1470. Object(api["g" /* httpPost */])(data, this.$api.getDeviceItems).then(function (res) {
  1471. if (res.data.list.length > 0) {
  1472. res.data.list.map(function (li) {
  1473. var accessPlatform = _this19.accessPlatform.show.filter(function (item) {
  1474. return item.code == li.accessPlatform;
  1475. })[0];
  1476. if (accessPlatform) {
  1477. li['accessPlatformText'] = accessPlatform.desc;
  1478. } else {
  1479. li['accessPlatformText'] = '';
  1480. }
  1481. li.createAt = _this19.timestampToTime(li.createAt);
  1482. if (li.lastReportAt) {
  1483. li.lastReportAt = moment_default()(li.lastReportAt).format("YYYY-MM-DD HH:mm:ss");
  1484. } else {
  1485. li.lastReportAt = '';
  1486. }
  1487. });
  1488. var newArr = Object(utils["n" /* uniqueArray */])(res.data.list, "id");
  1489. _this19.pageTotal = res.data.total;
  1490. _this19.tableData = newArr;
  1491. } else {
  1492. _this19.tableData = [];
  1493. _this19.pageTotal = 0;
  1494. }
  1495. _this19.currentPage4 = 1;
  1496. _this19.$store.commit("increment", 1);
  1497. });
  1498. // this.$set(this.query, "pageIndex", 1);
  1499. }), defineProperty_default()(_methods, "handleDelete", function handleDelete(index) {
  1500. var _this20 = this;
  1501. // 二次确认删除
  1502. this.$confirm("确定要删除吗?", "提示", {
  1503. type: "warning"
  1504. }).then(function () {
  1505. _this20.$message.success("删除成功");
  1506. _this20.tableData.splice(index, 1);
  1507. }).catch(function () {});
  1508. }), defineProperty_default()(_methods, "handleSelectionChange", function handleSelectionChange(val) {
  1509. this.multipleSelection = val;
  1510. }), defineProperty_default()(_methods, "delAllSelection", function delAllSelection() {
  1511. var length = this.multipleSelection.length;
  1512. var str = "";
  1513. this.delList = this.delList.concat(this.multipleSelection);
  1514. for (var i = 0; i < length; i++) {
  1515. str += this.multipleSelection[i].name + " ";
  1516. }
  1517. this.$message.error("\u5220\u9664\u4E86" + str);
  1518. this.multipleSelection = [];
  1519. }), defineProperty_default()(_methods, "deleteLock", function deleteLock(index, row) {
  1520. var _this21 = this;
  1521. this.$confirm("确定要删除吗?", "提示", {
  1522. type: "warning"
  1523. }).then(function () {
  1524. // if (row.manufactureId == 101) {
  1525. if (row.roomId) {
  1526. var data = [{
  1527. siteId: row.roomId,
  1528. deviceId: row.id
  1529. }];
  1530. Object(api["g" /* httpPost */])(data, _this21.$api.unbindDeviceSite).then(function (res) {
  1531. if (res.success) {
  1532. var data = {
  1533. device: row.deviceNum,
  1534. imei: row.imei,
  1535. order: 5102
  1536. };
  1537. allFun["a" /* default */].DeleteDevic(data, row.manufactureId, function (callback) {
  1538. if (callback.success) {
  1539. _this21.getdevice();
  1540. _this21.$message.success('删除成功');
  1541. } else {
  1542. _this21.$message.error(callback.msg);
  1543. }
  1544. });
  1545. }
  1546. }).catch(function (error) {
  1547. _this21.$message.error("\u89E3\u7ED1\u5931\u8D25");
  1548. });
  1549. } else {
  1550. var data = {
  1551. deviceNum: row.deviceNum,
  1552. imei: row.imei,
  1553. order: 5102
  1554. };
  1555. console.log(data, _this21.$RegisterDevice, row.manufactureId);
  1556. allFun["a" /* default */].DeleteDevic(data, row.manufactureId, function (callback) {
  1557. if (callback.success) {
  1558. _this21.getdevice();
  1559. _this21.$message.success('删除成功');
  1560. } else {
  1561. _this21.$message.error(callback.msg);
  1562. }
  1563. });
  1564. }
  1565. }).catch(function () {});
  1566. }), defineProperty_default()(_methods, "bindRoom", function bindRoom(index, row) {
  1567. this.bromm = row;
  1568. this.roomVisible = true;
  1569. this.$refs.tree.setCheckedKeys([]);
  1570. }), defineProperty_default()(_methods, "bindsave", function bindsave() {
  1571. var _this22 = this;
  1572. var treedata = this.treedata;
  1573. this.roomVisible = false;
  1574. var data = [{
  1575. siteId: treedata.id,
  1576. deviceId: this.bromm.id
  1577. }];
  1578. Object(api["g" /* httpPost */])(data, this.$api.bindDeviceSite).then(function (res) {
  1579. if (res.success) {
  1580. _this22.$message.success("绑定成功");
  1581. _this22.getdevice();
  1582. }
  1583. }).catch(function (error) {
  1584. _this22.$message.error("\u7ED1\u5B9A\u5931\u8D25");
  1585. });
  1586. }), defineProperty_default()(_methods, "unbindsave", function unbindsave(index, row) {
  1587. var _this23 = this;
  1588. var data = [{
  1589. siteId: row.roomId,
  1590. deviceId: row.id
  1591. }];
  1592. var q = {
  1593. id: row.roomId
  1594. };
  1595. var tenant = {
  1596. q: stringify_default()(q)
  1597. };
  1598. // 二次确认解绑
  1599. this.$confirm("确定要解绑吗?", "提示", {
  1600. type: "warning"
  1601. }).then(function () {
  1602. // this.Reset(index, row)
  1603. Object(api["d" /* httpGet */])(tenant, _this23.$api.getSiteTenant).then(function (res) {
  1604. promise_default.a.all(res.data.list.map(function (element) {
  1605. return new promise_default.a(function (resolve, reject) {
  1606. resolve(element.card);
  1607. });
  1608. })).then(function (allId) {
  1609. allId.map(function (li) {
  1610. var str = [{
  1611. siteId: row.roomId,
  1612. cardId: li
  1613. }];
  1614. Object(api["g" /* httpPost */])(str, _this23.$api.unbindCard).then(function (res) {});
  1615. });
  1616. Object(api["g" /* httpPost */])(data, _this23.$api.unbindDeviceSite).then(function (res) {
  1617. if (res.success) {
  1618. _this23.$message.success("解绑成功");
  1619. _this23.getdevice();
  1620. } else {
  1621. _this23.$message.error("\u89E3\u7ED1\u5931\u8D25");
  1622. }
  1623. });
  1624. });
  1625. });
  1626. }).catch(function () {});
  1627. }), defineProperty_default()(_methods, "addequipment", function addequipment() {
  1628. this.editVisible = true;
  1629. this.form.customerCode = this.$store.state.customerCode;
  1630. }), defineProperty_default()(_methods, "handleEdit", function handleEdit(index, row) {
  1631. this.idx = index;
  1632. this.form = row;
  1633. this.editVisible = true;
  1634. }), defineProperty_default()(_methods, "saveEdit", function saveEdit() {
  1635. this.editVisible = false;
  1636. this.$message.success("\u4FEE\u6539\u7B2C " + (this.idx + 1) + " \u884C\u6210\u529F");
  1637. this.$set(this.tableData, this.idx, this.form);
  1638. }), defineProperty_default()(_methods, "handleSizeChange", function handleSizeChange(val) {
  1639. console.log("\u6BCF\u9875 " + val + " \u6761");
  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.pageSize = val;
  1648. this.getlistNum(0, val);
  1649. }), defineProperty_default()(_methods, "getlistNum", function getlistNum(val, size) {
  1650. var _this24 = this;
  1651. var deviceNum = this.search.deviceNum.replace(/\s*/g, "");
  1652. var imei = this.search.imei.replace(/\s*/g, "");
  1653. var q = {
  1654. deviceNum: deviceNum,
  1655. imei: imei,
  1656. isOnline: this.search.isOnline,
  1657. roomName: this.search.roomname,
  1658. roomIds: this.checkNodeId,
  1659. startBattery: this.search.startBattery,
  1660. endBattery: this.search.endBattery,
  1661. lockType: 5,
  1662. unBind: this.search.unBind
  1663. };
  1664. var data = {
  1665. q: stringify_default()(q),
  1666. pageNum: val,
  1667. pageSize: size
  1668. };
  1669. Object(api["g" /* httpPost */])(data, this.$api.getDeviceItems).then(function (res) {
  1670. res.data.list.map(function (li) {
  1671. var accessPlatform = _this24.accessPlatform.show.filter(function (item) {
  1672. return item.code == li.accessPlatform;
  1673. })[0];
  1674. if (accessPlatform) {
  1675. li['accessPlatformText'] = accessPlatform.desc;
  1676. } else {
  1677. li['accessPlatformText'] = '';
  1678. }
  1679. li.createAt = _this24.timestampToTime(li.createAt);
  1680. if (li.lastReportAt) {
  1681. li.lastReportAt = moment_default()(li.lastReportAt).format("YYYY-MM-DD HH:mm:ss");
  1682. } else {
  1683. li.lastReportAt = '';
  1684. }
  1685. });
  1686. var newArr = Object(utils["n" /* uniqueArray */])(res.data.list, "id");
  1687. _this24.tableData = newArr;
  1688. _this24.pageTotal = res.data.total;
  1689. });
  1690. }), defineProperty_default()(_methods, "handlePageChange", function handlePageChange(val) {
  1691. var _this25 = this;
  1692. // this.$router.replace({
  1693. // path: this.$route.path,
  1694. // query: {
  1695. // page: this.$route.query.page ? this.$route.query.page : 1,
  1696. // pageSize: val,
  1697. // },
  1698. // });
  1699. this.pageNum = val;
  1700. this.$store.commit("increment", val);
  1701. var q = {
  1702. deviceNum: this.search.deviceNum,
  1703. imei: this.search.imei,
  1704. isOnline: this.search.isOnline,
  1705. roomName: this.search.roomname,
  1706. roomIds: this.checkNodeId,
  1707. startBattery: this.search.startBattery,
  1708. endBattery: this.search.endBattery,
  1709. lockType: 5,
  1710. unBind: this.search.unBind
  1711. };
  1712. var data = {
  1713. q: stringify_default()(q),
  1714. pageNum: val,
  1715. pageSize: this.pageSize
  1716. };
  1717. Object(api["g" /* httpPost */])(data, this.$api.getDeviceItems).then(function (res) {
  1718. res.data.list.map(function (li) {
  1719. var accessPlatform = _this25.accessPlatform.show.filter(function (item) {
  1720. return item.code == li.accessPlatform;
  1721. })[0];
  1722. if (accessPlatform) {
  1723. li['accessPlatformText'] = accessPlatform.desc;
  1724. } else {
  1725. li['accessPlatformText'] = '';
  1726. }
  1727. li.createAt = _this25.timestampToTime(li.createAt);
  1728. if (li.lastReportAt) {
  1729. li.lastReportAt = moment_default()(li.lastReportAt).format("YYYY-MM-DD HH:mm:ss");
  1730. } else {
  1731. li.lastReportAt = '';
  1732. }
  1733. });
  1734. var newArr = Object(utils["n" /* uniqueArray */])(res.data.list, "id");
  1735. _this25.tableData = newArr;
  1736. _this25.pageTotal = res.data.total;
  1737. });
  1738. }), defineProperty_default()(_methods, "btnClick", function btnClick() {
  1739. document.querySelector(".input-file").click();
  1740. }), defineProperty_default()(_methods, "exportData", function exportData(event) {
  1741. if (!event.currentTarget.files.length) {
  1742. return;
  1743. }
  1744. var that = this;
  1745. // 拿取文件对象
  1746. var f = event.currentTarget.files[0];
  1747. // 用FileReader来读取
  1748. var reader = new FileReader();
  1749. // 重写FileReader上的readAsBinaryString方法
  1750. FileReader.prototype.readAsBinaryString = function (f) {
  1751. var binary = "";
  1752. var wb; // 读取完成的数据
  1753. var outdata; // 你需要的数据
  1754. var reader = new FileReader();
  1755. reader.onload = function (e) {
  1756. // 读取成Uint8Array,再转换为Unicode编码(Unicode占两个字节)
  1757. var bytes = new Uint8Array(reader.result);
  1758. var length = bytes.byteLength;
  1759. for (var i = 0; i < length; i++) {
  1760. binary += String.fromCharCode(bytes[i]);
  1761. }
  1762. // 接下来就是xlsx了,具体可看api
  1763. wb = xlsx_default.a.read(binary, {
  1764. type: "binary"
  1765. });
  1766. outdata = xlsx_default.a.utils.sheet_to_json(wb.Sheets[wb.SheetNames[0]]);
  1767. // 自定义方法向父组件传递数据
  1768. var arr1 = [];
  1769. outdata.map(function (li, index) {
  1770. var str = {};
  1771. str.deviceNum = li["设备号"];
  1772. str.imei = li["imei"];
  1773. str.ID = li["序号"];
  1774. arr1.push(str);
  1775. });
  1776. // this.tableData=arr
  1777. that.userlist1statu = false;
  1778. that.$nextTick(function () {
  1779. that.userlist2 = arr1;
  1780. that.userlist1statu = true;
  1781. });
  1782. };
  1783. reader.readAsArrayBuffer(f);
  1784. };
  1785. reader.readAsBinaryString(f);
  1786. }), _methods)
  1787. });
  1788. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/template-compiler?{"id":"data-v-863bc77e","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/AirCleaningDevice.vue
  1789. 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"},[_vm._v("\n
  1790. ? 'success'
  1791. : scope.row.isOnline == '0'
  1792. ? 'danger'
  1793. : ''}},[(scope.row.isOnline == 1)?_c('span',[_vm._v("在线")]):_c('span',[_vm._v("离线")])])]}}])}),_vm._v(" "),_c('el-table-column',{attrs:{"label":"门的状态"},scopedSlots:_vm._u([{key:"default",fn:function(scope){return [(scope.row.lockStatus == 0)?_c('i',{staticClass:"iconfont httpicon-men"}):_vm._e(),_vm._v(" "),(scope.row.lockStatus == 1)?_c('i',{staticClass:"iconfont httpicon-mendoor13"}):_vm._e(),_vm._v(" "),(scope.row.lockStatus == 2)?_c('i',{staticClass:"iconfont httpicon-men",staticStyle:{"color":"red"}}):_vm._e()]}}])}),_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('
  1794. var staticRenderFns = []
  1795. var esExports = { render: render, staticRenderFns: staticRenderFns }
  1796. /* harmony default export */ var device_AirCleaningDevice = (esExports);
  1797. // CONCATENATED MODULE: ./src/views/device/AirCleaningDevice.vue
  1798. function injectStyle (ssrContext) {
  1799. __webpack_require__("I88j")
  1800. }
  1801. var normalizeComponent = __webpack_require__("VU/8")
  1802. /* script */
  1803. /* template */
  1804. /* template functional */
  1805. var __vue_template_functional__ = false
  1806. /* styles */
  1807. var __vue_styles__ = injectStyle
  1808. /* scopeId */
  1809. var __vue_scopeId__ = "data-v-863bc77e"
  1810. /* moduleIdentifier (server only) */
  1811. var __vue_module_identifier__ = null
  1812. var Component = normalizeComponent(
  1813. AirCleaningDevice,
  1814. device_AirCleaningDevice,
  1815. __vue_template_functional__,
  1816. __vue_styles__,
  1817. __vue_scopeId__,
  1818. __vue_module_identifier__
  1819. )
  1820. /* harmony default export */ var views_device_AirCleaningDevice = __webpack_exports__["default"] = (Component.exports);
  1821. /***/ })
  1822. });