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

2578 lines
94 KiB

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