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

2423 lines
87 KiB

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