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

2383 lines
84 KiB

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