|
|
- webpackJsonp([41],{
-
- /***/ "JF1I":
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
-
- // EXTERNAL MODULE: ./node_modules/babel-runtime/core-js/json/stringify.js
- var stringify = __webpack_require__("mvHQ");
- var stringify_default = /*#__PURE__*/__webpack_require__.n(stringify);
-
- // EXTERNAL MODULE: ./src/api/index.js + 5 modules
- var api = __webpack_require__("gyMJ");
-
- // EXTERNAL MODULE: ./src/utils/index.js
- var utils = __webpack_require__("0xDb");
-
- // EXTERNAL MODULE: ./node_modules/xlsx/xlsx.js
- var xlsx = __webpack_require__("uXZL");
- var xlsx_default = /*#__PURE__*/__webpack_require__.n(xlsx);
-
- // EXTERNAL MODULE: ./src/utils/util.js
- var util = __webpack_require__("oFuF");
-
- // EXTERNAL MODULE: ./node_modules/moment/moment.js
- var moment = __webpack_require__("PJh5");
- var moment_default = /*#__PURE__*/__webpack_require__.n(moment);
-
- // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./src/views/UnlockRecord.vue
-
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
-
-
-
-
-
-
- /* harmony default export */ var UnlockRecord = ({
- inject: ['reload'],
- name: "UnlockRecord",
- data: function data() {
- return {
- pageSize: 20,
- pageNum: 1,
- defaultProps: {
- children: "children",
- label: "name"
- },
- config: {
- header: ["设备号", "开锁方式", "开锁时间"],
- data: [["", "", "", ""]],
- rowNum: 7, //表格行数
- headerHeight: 35,
- headerBGC: "#0f1325", //表头
- oddRowBGC: "#0f1325", //奇数行
- evenRowBGC: "#171c33", //偶数行
- index: false,
- columnWidth: [200, 200, 200, 200],
- align: ["center"]
- },
- query: {
- openType: "",
- operateName: "",
- operModul: "",
- datePicker: ['', ''],
- name: ''
- },
- query1: {
- openType: "",
- operateName: "",
- operModul: ""
- },
- activeName: "first",
- tableData: [],
- tableData1: [],
- multipleSelection: [],
- delList: [],
- editVisible: false,
- pageTotal: 0,
- pageTotal1: 0,
- form: {},
- idx: -1,
- id: -1,
- logList: [],
- options: [],
- selectRoomId: "",
- openRoom: false,
- selectkey: [],
- userInfo: {
- type: ''
- },
- checkNodeId: []
- };
- },
- beforeCreate: function beforeCreate() {
- // var tenantId = JSON.parse(localStorage.getItem('tenantId'))
- // if (tenantId == 400) {
- // this.$store.commit('defaultsettenantid')
- // }
- },
- created: function created() {
- var _this = this;
-
- if (this.$route.params.datePicker) {
- this.query.datePicker = this.$route.params.datePicker;
- }
- if (this.$route.params.type) {
- this.query.openType = JSON.parse(this.$route.params.type);
- }
- this.userInfo = JSON.parse(localStorage.getItem('info'));
- var data = {
- package: 1,
- q: stringify_default()({
- lockType: 1
- })
- };
- Object(api["g" /* httpPost */])(data, this.$api.getDeviceItems).then(function (res) {
- _this.$store.commit("deviceFun", res.data.list);
- });
- this.getalllist();
- // this.selectoption=JSON.parse(localStorage.getItem('selectoption'))
- // this.selectoptionValue=localStorage.getItem('tenantId')
- },
- mounted: function mounted() {
- // this.getlockAlert();
- document.addEventListener('keydown', this.keyDown);
- this.getcard();
- },
-
- methods: {
- keyDown: function keyDown(e) {
- //如果是回车则执行登录方法
- if (e.keyCode == 13) {
- if (this.$route.name == 'UnlockRecord') {
- if (!this.drawer) {
- this.handleSearch();
- }
- }
- }
- },
-
- // 选择房源
- checkNode: function checkNode(e) {
- console.log(e);
- // this.checkNodeId = e[e.length-1]
- if (e.length > 0) {
- var options = this.options;
- var arr = this.getId(options, e[e.length - 1]);
- var listarr = [arr[0]];
- var obj = this.getNodeId(listarr);
- this.checkNodeId = obj;
- } else {
- this.checkNodeId = [];
- }
- },
- getParentId: function getParentId(list, id) {
- for (var i in list) {
- if (list[i].id == id) {
- return [list[i]];
- }
- if (list[i].children) {
- var node = this.getParentId(list[i].children, id);
- if (node !== undefined) {
- return node.concat(list[i]);
- }
- }
- }
- },
- getId: function getId(list, id) {
- for (var i in list) {
- if (list[i].id == id) {
- return [list[i]];
- }
- if (list[i].children) {
- var node = this.getParentId(list[i].children, id);
- if (node !== undefined) {
- return node;
- }
- }
- }
- },
- getNodeId: function getNodeId(list) {
- var newNodeId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
-
- for (var i in list) {
- newNodeId.push(list[i].id);
- if (list[i].children) {
- this.getNodeId(list[i].children, newNodeId);
- }
- }
- return newNodeId;
- },
- resetAll: function resetAll() {
- this.query = {
- openType: "",
- operateName: "",
- operModul: "",
- datePicker: ['', ''],
- name: ""
- };
- this.checkNodeId = [];
- this.handleSearch();
- },
- exportFun: function exportFun() {
- var data = {
- orderBy: "open_time desc",
- q: this.searchParaProcess({
- roomIds: this.checkNodeId,
- openType: this.query.openType,
- startTime: moment_default()(this.query.datePicker[0]).format("X"),
- endTime: moment_default()(this.query.datePicker[1]).format("X"),
- name: this.query.name
- })
- };
- if (data.q == '{}') delete data.q;
- Object(api["b" /* downloadPost */])(data, this.$api.export).then(function (res) {
- var link = document.createElement("a");
- var blob = new Blob([res], {
- type: "application/vnd.ms-excel"
- });
- var objectUrl = URL.createObjectURL(blob);
- link.href = objectUrl;
- link.download = "开锁记录.xlsx";
- link.click();
- URL.revokeObjectURL(objectUrl);
- });
- },
- handleCheckChange: function handleCheckChange(data, checked, node) {
- if (checked) {
- this.selectRoomId = data.id;
- this.query.operateName = data.name;
- this.$refs.tree.setCheckedKeys([data.id]);
- } else {
- if (this.checkedId == data.id) {
- this.$refs.tree.setCheckedKeys([data.id]);
- }
- }
- },
- handleClose: function handleClose(done) {
- this.openRoom = false;
- },
-
- // 打开房间选择列表
- openRoomlist: function openRoomlist() {
- this.openRoom = true;
- },
- handleChange: function handleChange(value) {
- console.log(value);
- this.selectRoomId = value[value.length - 1];
- },
-
- //获取房源筛选列表
- getalllist: function getalllist() {
- var _this2 = this;
-
- var data = {};
- Object(api["d" /* httpGet */])(data, this.$api.getTree).then(function (res) {
- var list = res.data.sort(function (pre, cur) {
- return pre.id - cur.id;
- });
- var array = Object(utils["n" /* uniqueArray */])(list, "id");
- _this2.options = Object(utils["p" /* ztreeToElementTree */])(array, {});
- });
- },
- timestampToTime: function timestampToTime(cjsj) {
- if (cjsj.toString().length == 10) {
- cjsj = cjsj * 1000;
- }
- var date = new Date(cjsj); //时间戳为10位需*1000,时间戳为13位的话不需乘1000
- var Y = date.getFullYear() + "-";
- var M = (date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1) + "-";
- var D = (date.getDate() < 10 ? "0" + date.getDate() : date.getDate()) + " ";
- var h = (date.getHours() < 10 ? "0" + date.getHours() : date.getHours()) + ":";
- var m = (date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes()) + ":";
- var s = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
- return Y + M + D + h + m + s;
- },
- getOpenType: function getOpenType(openType) {
- var str = "";
- switch (openType) {
- case 1:
- str = "指纹开锁";
- break;
- case 2:
- str = "数字键盘开锁";
- break;
- case 3:
- str = "NFC开锁";
- break;
- case 4:
- str = "机械钥匙开锁";
- break;
- case 5:
- str = "蓝牙开锁";
- break;
- case 6:
- str = "NB开锁";
- break;
- case 7:
- str = "身份证";
- break;
- case 8:
- str = "无线钥匙开锁";
- break;
- case 9:
- str = "人脸开锁";
- break;
- case 10:
- str = "离线卡开锁";
- break;
- default:
- str = "其它开锁";
- break;
- }
- return str;
- },
- getcard: function getcard() {
- var _this3 = this;
-
- var data1 = {
- pageNum: this.pageNum,
- pageSize: this.pageSize,
- orderBy: "open_time desc",
- q: this.searchParaProcess({
- roomIds: this.checkNodeId,
- openType: this.query.openType,
- startTime: moment_default()(this.query.datePicker[0]).format("X"),
- endTime: moment_default()(this.query.datePicker[1]).format("X"),
- name: this.query.name
- })
- };
- Object(api["g" /* httpPost */])(data1, this.$api.getOpenRecord).then(function (res) {
- var data = [];
- res.data.list.map(function (li, index) {
- var str = _this3.getOpenType(li.openType);
- var compli = _this3.comparison(li.deviceNum);
- var name = util["a" /* default */].findIndexArray(_this3.options, li.roomId, []);
- var path = '';
- if (name) {
- path = name.join('/');
- li.roomName = path;
- }
- li.roomId = li.roomId;
- li.openTime = _this3.timestampToTime(li.openTime);
- var str = [li.deviceNum, str, li.openTime];
- data.push(str);
- });
- _this3.devicestatus = false;
- _this3.pageTotal = res.data.total;
- _this3.$nextTick(function () {
- _this3.config.data = data;
- _this3.logList = res.data.list;
- _this3.devicestatus = true;
- });
- });
- },
- comparison: function comparison(deviceNum) {
- var deviceList = this.$store.state.deviceList;
- deviceList.some(function (item, index) {
- if (item.deviceNum == deviceNum) {
- return item;
- }
- });
- },
-
- //门锁报警同步刷新
- getlockAlert: function getlockAlert() {
- Object(api["d" /* httpGet */])("", this.$api.getOpenRecordList).then(function (res) {});
- },
- searchParaProcess: function searchParaProcess(obj) {
- var myObj = new Object();
- for (var key in obj) {
- if (obj[key] != "" && obj[key] != 'Invalid date' && obj[key] != []) {
- myObj[key] = obj[key];
- }
- }
- return stringify_default()(myObj);
- },
-
- // 触发搜索按钮
- handleSearch: function handleSearch() {
- var _this4 = this;
-
- this.pageNum = 1;
- this.openRoom = false;
- var data = {
- pageNum: 1,
- pageSize: this.pageSize,
- orderBy: "open_time desc",
- q: this.searchParaProcess({
- roomIds: this.checkNodeId,
- openType: this.query.openType,
- startTime: moment_default()(this.query.datePicker[0]).format("X"),
- endTime: moment_default()(this.query.datePicker[1]).format("X"),
- name: this.query.name
- })
- };
- Object(api["g" /* httpPost */])(data, this.$api.getOpenRecord).then(function (res) {
- var data = [];
- res.data.list.map(function (li, index) {
- var str = _this4.getOpenType(li.openType);
- var compli = _this4.comparison(li.deviceNum);
- var name = util["a" /* default */].findIndexArray(_this4.options, li.roomId, []);
- var path = '';
- if (name) {
- path = name.join('/');
- li.roomName = path;
- }
- li.roomId = li.roomId;
- li.openTime = _this4.timestampToTime(li.openTime);
- var str = [li.deviceNum, str, li.openTime];
- data.push(str);
- });
- _this4.devicestatus = false;
- _this4.pageTotal = res.data.total;
- _this4.$store.commit("increment", 1);
- _this4.$nextTick(function () {
- _this4.config.data = data;
- _this4.logList = res.data.list;
- _this4.devicestatus = true;
- });
- });
- },
-
- // 分页导航
- handlePageChange: function handlePageChange(val) {
- this.pageNum = val;
- this.getcard();
- },
- handleSizeChange: function handleSizeChange(val) {
- this.pageSize = val;
- this.getcard();
- }
- }
- });
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/template-compiler?{"id":"data-v-acb12472","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/UnlockRecord.vue
- 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-cascader',{attrs:{"options":_vm.options,"size":"small","props":{ checkStrictly: true },"clearable":true},on:{"change":_vm.checkNode},model:{value:(_vm.query.operateName),callback:function ($$v) {_vm.$set(_vm.query, "operateName", $$v)},expression:"query.operateName"}}),_vm._v(" "),_c('el-input',{staticClass:"handle-input mr10 wRem3",attrs:{"size":"small","placeholder":"姓名","clearable":true},model:{value:(_vm.query.name),callback:function ($$v) {_vm.$set(_vm.query, "name", $$v)},expression:"query.name"}}),_vm._v(" "),_c('el-date-picker',{staticClass:"wRem3",attrs:{"size":"small","type":"datetime","clearable":"","placeholder":"选择开始日期时间","default-time":"00:00:00"},model:{value:(_vm.query.datePicker[0]),callback:function ($$v) {_vm.$set(_vm.query.datePicker, 0, $$v)},expression:"query.datePicker[0]"}}),_vm._v(" "),_c('el-date-picker',{staticClass:"wRem3",attrs:{"size":"small","type":"datetime","clearable":"","placeholder":"选择结束日期时间","default-time":"00:00:00"},model:{value:(_vm.query.datePicker[1]),callback:function ($$v) {_vm.$set(_vm.query.datePicker, 1, $$v)},expression:"query.datePicker[1]"}}),_vm._v(" "),_c('el-select',{staticClass:"handle-select mr10",attrs:{"size":"small","placeholder":"开门方式","clearable":""},model:{value:(_vm.query.openType),callback:function ($$v) {_vm.$set(_vm.query, "openType", $$v)},expression:"query.openType"}},[_c('el-option',{key:"0",attrs:{"label":"全部","value":0}}),_vm._v(" "),_c('el-option',{key:"1",attrs:{"label":"指纹开锁","value":1}}),_vm._v(" "),_c('el-option',{key:"2",attrs:{"label":"数字键盘开锁","value":2}}),_vm._v(" "),_c('el-option',{key:"3",attrs:{"label":"NFC开锁","value":3}}),_vm._v(" "),_c('el-option',{key:"4",attrs:{"label":"机械钥匙开锁","value":4}}),_vm._v(" "),_c('el-option',{key:"6",attrs:{"label":"NB开锁","value":6}}),_vm._v(" "),_c('el-option',{key:"7",attrs:{"label":"身份证","value":7}}),_vm._v(" "),_c('el-option',{key:"8",attrs:{"label":"无线钥匙开锁","value":8}}),_vm._v(" "),_c('el-option',{key:"9",attrs:{"label":"人脸开锁","value":9}}),_vm._v(" "),_c('el-option',{key:"10",attrs:{"label":"离线卡开锁","value":10}}),_vm._v(" "),_c('el-option',{key:"11",attrs:{"label":"离线密码开锁","value":11}}),_vm._v(" "),_c('el-option',{key:"12",attrs:{"label":"门卡试错开锁","value":12}}),_vm._v(" "),_c('el-option',{key:"100",attrs:{"label":"其它开锁","value":100}})],1),_vm._v(" "),_c('el-button',{staticStyle:{"background":"#FA8E00","border":"none"},attrs:{"size":"small","type":"primary","icon":"el-icon-search"},on:{"click":_vm.handleSearch}},[_vm._v("搜索")]),_vm._v(" "),_c('el-button',{staticStyle:{"background":"#FA8E00","border":"none"},attrs:{"size":"small","type":"primary","icon":"el-icon-search"},on:{"click":_vm.resetAll}},[_vm._v("重置")]),_vm._v(" "),_c('el-button',{staticStyle:{"background":"#FA8E00","border":"none"},attrs:{"size":"small","type":"primary","icon":"el-icon-download"},on:{"click":_vm.exportFun}},[_vm._v("导出")]),_vm._v(" "),(_vm.userInfo.type==0)?_c('el-button',{attrs:{"size":"small"},on:{"click":_vm.getlockAlert}},[_vm._v("同步更新")]):_vm._e()],1),_vm._v(" "),_c('el-table',{staticStyle:{"width":"100%"},attrs:{"data":_vm.logList,"stripe":"","height":"500"}},[_c('el-table-column',{attrs:{"prop":"deviceNum","label":"设备号","width":"250"}}),_vm._v(" "),_c('el-table-column',{attrs:{"prop":"name","label":"姓名","width":"180"}}),_vm._v(" "),_c('el-table-column',{attrs:{"prop":"userTelephone","label":"账号","width":"180"}}),_vm._v(" "),_c('el-table-column',{attrs:{"prop":"roomName","label":"房间号"}}),_vm._v(" "),_c('el-table-column',{attrs:{"label":"开锁方式"},scopedSlots:_vm._u([{key:"default",fn:function(scope){return [(scope.row.openType == 1)?_c('span',[_vm._v("指纹开锁")]):_vm._e(),_vm._v(" "),(scope.row.openType == 2)?_
- var staticRenderFns = []
- var esExports = { render: render, staticRenderFns: staticRenderFns }
- /* harmony default export */ var views_UnlockRecord = (esExports);
- // CONCATENATED MODULE: ./src/views/UnlockRecord.vue
- function injectStyle (ssrContext) {
- __webpack_require__("cuyk")
- }
- var normalizeComponent = __webpack_require__("VU/8")
- /* script */
-
-
- /* template */
-
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = injectStyle
- /* scopeId */
- var __vue_scopeId__ = "data-v-acb12472"
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = normalizeComponent(
- UnlockRecord,
- views_UnlockRecord,
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
-
- /* harmony default export */ var src_views_UnlockRecord = __webpack_exports__["default"] = (Component.exports);
-
-
- /***/ }),
-
- /***/ "cuyk":
- /***/ (function(module, exports) {
-
- // removed by extract-text-webpack-plugin
-
- /***/ })
-
- });
|