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

2321 lines
87 KiB

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