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

2326 lines
89 KiB

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