|
|
- webpackJsonp([29],{
-
- /***/ "KDEK":
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
-
- // EXTERNAL MODULE: ./node_modules/babel-runtime/helpers/typeof.js
- var helpers_typeof = __webpack_require__("pFYg");
- var typeof_default = /*#__PURE__*/__webpack_require__.n(helpers_typeof);
-
- // EXTERNAL MODULE: ./node_modules/babel-runtime/core-js/promise.js
- var promise = __webpack_require__("//Fk");
- var promise_default = /*#__PURE__*/__webpack_require__.n(promise);
-
- // 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/components/zTree1.vue + 2 modules
- var zTree1 = __webpack_require__("6Ljo");
-
- // EXTERNAL MODULE: ./src/components/deviceLi.vue + 2 modules
- var deviceLi = __webpack_require__("4qFG");
-
- // EXTERNAL MODULE: ./src/components/UnlockRecord.vue + 2 modules
- var UnlockRecord = __webpack_require__("YBqH");
-
- // EXTERNAL MODULE: ./src/components/DeviceFeedbackLog.vue + 2 modules
- var DeviceFeedbackLog = __webpack_require__("5skf");
-
- // EXTERNAL MODULE: ./src/components/warningLog.vue + 2 modules
- var warningLog = __webpack_require__("+K0N");
-
- // EXTERNAL MODULE: ./src/components/voucherCom.vue + 2 modules
- var voucherCom = __webpack_require__("JoDB");
-
- // 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: ./src/utils/equipment.js
- var equipment = __webpack_require__("ObZk");
-
- // EXTERNAL MODULE: ./node_modules/moment/moment.js
- var moment = __webpack_require__("PJh5");
- var moment_default = /*#__PURE__*/__webpack_require__.n(moment);
-
- // EXTERNAL MODULE: ./src/api/allFun.js
- var allFun = __webpack_require__("mprh");
-
- // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./src/views/doorLock.vue
-
-
-
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- var nowDate = new Date();
- var currentTime = nowDate;
- var endcurrentTime = Object(utils["g" /* getcurrentTime1 */])(1);
- /* harmony default export */ var doorLock = ({
- inject: ['reload'],
- name: "doorLock",
- data: function data() {
- return {
- normallyOpenRecordList: [],
- normallyTotal: 0,
- normallyPageNum: 1,
- normallyPageSzie: 20,
- optionsTime: [{
- value: 1,
- label: '1:00'
- }, {
- value: 2,
- label: '2:00'
- }, {
- value: 3,
- label: '3:00'
- }, {
- value: 4,
- label: '4:00'
- }, {
- value: 5,
- label: '5:00'
- }, {
- value: 6,
- label: '6:00'
- }, {
- value: 7,
- label: '7:00'
- }, {
- value: 8,
- label: '8:00'
- }, {
- value: 9,
- label: '9:00'
- }, {
- value: 10,
- label: '10:00'
- }, {
- value: 11,
- label: '11:00'
- }, {
- value: 12,
- label: '12:00'
- }, {
- value: 13,
- label: '13:00'
- }, {
- value: 14,
- label: '14:00'
- }, {
- value: 15,
- label: '15:00'
- }, {
- value: 16,
- label: '16:00'
- }, {
- value: 17,
- label: '17:00'
- }, {
- value: 18,
- label: '18:00'
- }, {
- value: 19,
- label: '19:00'
- }, {
- value: 20,
- label: '20:00'
- }, {
- value: 21,
- label: '21:00'
- }, {
- value: 22,
- label: '22:00'
- }, {
- value: 23,
- label: '23:00'
- }, {
- value: 24,
- label: '24:00'
- }],
- setopenStatus: false,
- opendTime: [currentTime, endcurrentTime],
- startHour: 1,
- endHour: 24,
- synchroLockNumber: "",
- contentSearchShow: false,
- myLine_option_one: {
- title: {
- text: "信号曲线",
- x: "0",
- y: "20",
- color: "#333"
- },
- tooltip: {
- trigger: "axis"
- },
- legend: {
- orient: "horizontal",
- x: "right",
- y: "top",
- data: ["门锁近期信号曲线"]
- },
- dataZoom: [{
- type: 'inside', //内置滑动,随鼠标滚轮展示
- xAxisIndex: [0],
- start: 0, //初始化时,滑动条宽度开始标度
- end: 100 //初始化时,滑动条宽度结束标度
- }],
- grid: {
- top: "16%",
- left: "0%",
- right: "0%",
- bottom: "0%",
- containLabel: true
- },
- xAxis: {
- name: "时间",
- type: "category",
- data: []
- },
- yAxis: {},
- series: [{
- name: "门锁信号",
- type: "line",
- smooth: true,
- data: [],
- itemStyle: {
- normal: {
- color: "#FFAE00",
- lineStyle: {
- color: "#397FFF"
- }
- }
- },
- areaStyle: {
- normal: {
- color: {
- type: "linear", //设置线性渐变
- x: 0,
- y: 0,
- x2: 0,
- y2: 1,
- colorStops: [{
- offset: 0,
- color: "rgba(57,127,255,.1)" // 0% 处的颜色
- }, {
- offset: 1,
- color: "#fff" // 100% 处的颜色
- }],
- globalCoord: false // 缺省为 false
- }
- }
- }
- }]
- },
- myLine_option_three: {
- title: {
- text: "信号曲线",
- x: "0",
- y: "20",
- color: "#333"
- },
- tooltip: {
- trigger: "axis"
- },
- legend: {
- orient: "horizontal",
- x: "right",
- y: "top",
- data: ["门锁近期信号曲线"]
- },
- dataZoom: [{
- type: 'inside', //内置滑动,随鼠标滚轮展示
- xAxisIndex: [0],
- start: 0, //初始化时,滑动条宽度开始标度
- end: 100 //初始化时,滑动条宽度结束标度
- }],
- grid: {
- top: "16%",
- left: "0%",
- right: "0%",
- bottom: "0%",
- containLabel: true
- },
- xAxis: {
- name: "时间",
- type: "category",
- data: []
- },
- yAxis: {},
- series: [{
- name: "门锁信号",
- type: "line",
- smooth: true,
- data: [],
- itemStyle: {
- normal: {
- color: "#FFAE00",
- lineStyle: {
- color: "#397FFF"
- }
- }
- },
- areaStyle: {
- normal: {
- color: {
- type: "linear", //设置线性渐变
- x: 0,
- y: 0,
- x2: 0,
- y2: 1,
- colorStops: [{
- offset: 0,
- color: "rgba(57,127,255,.1)" // 0% 处的颜色
- }, {
- offset: 1,
- color: "#fff" // 100% 处的颜色
- }],
- globalCoord: false // 缺省为 false
- }
- }
- }
- }]
- },
- myLine_option: {
- title: {
- text: "电量曲线",
- x: "0",
- y: "20"
- },
- tooltip: {
- trigger: "axis"
- },
- legend: {
- orient: "horizontal",
- x: "right",
- y: "top",
- data: ["门锁近期电量曲线"]
- },
- dataZoom: [{
- type: 'inside', //内置滑动,随鼠标滚轮展示
- xAxisIndex: [0],
- start: 0, //初始化时,滑动条宽度开始标度
- end: 100 //初始化时,滑动条宽度结束标度
- }],
- grid: {
- top: "16%",
- left: "0%",
- right: "0%",
- bottom: "0%",
- containLabel: true
- },
- xAxis: {
- name: "时间",
- type: "category",
- data: []
- },
- yAxis: {},
- series: [{
- name: "门锁电量",
- type: "line",
- smooth: true,
- data: [],
- itemStyle: {
- normal: {
- color: "#FFAE00",
- lineStyle: {
- color: "#397FFF"
- }
- }
- },
- areaStyle: {
- /*normal: { origin: 'start', color: 'rgba(57,127,255,.1)', opacity: 1 },*/
- normal: {
- color: {
- type: "linear", //设置线性渐变
- x: 0,
- y: 0,
- x2: 0,
- y2: 1,
- colorStops: [{
- offset: 0,
- color: "rgba(57,127,255,.1)" // 0% 处的颜色
- }, {
- offset: 1,
- color: "#fff" // 100% 处的颜色
- }],
- globalCoord: false // 缺省为 false
- }
- }
- }
- }]
- },
- pickerOptions: {
- shortcuts: [{
- text: '今天',
- onClick: function onClick(picker) {
- var end = new Date();
- picker.$emit('pick', [moment_default()().startOf('day').format("YYYY-MM-DD 00:00:00"), end]);
- }
- }, {
- text: '最近一周',
- onClick: function onClick(picker) {
- var end = new Date();
- var start = new Date();
- start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
- picker.$emit('pick', [start, end]);
- }
- }, {
- text: '本月',
- onClick: function onClick(picker) {
- var end = new Date();
- picker.$emit('pick', [moment_default()().startOf('month').format("YYYY-MM-DD 00:00:00"), end]);
- }
- }, {
- text: '今年至今',
- onClick: function onClick(picker) {
- var end = new Date();
- var start = new Date(new Date().getFullYear(), 0);
- picker.$emit('pick', [start, end]);
- }
- }, {
- text: '最近六个月',
- onClick: function onClick(picker) {
- var end = new Date();
- var start = new Date();
- start.setMonth(start.getMonth() - 6);
- picker.$emit('pick', [start, end]);
- }
- }]
- },
- dateTime: [moment_default()().subtract(3, 'months').format("YYYY-MM-DD 00:00:00"), moment_default()().format("YYYY-MM-DD HH:mm:ss")],
- dateTimeOne: [moment_default()().subtract(3, 'months').format("YYYY-MM-DD 00:00:00"), moment_default()().format("YYYY-MM-DD HH:mm:ss")],
- endDate: moment_default()().format("YYYY-MM-DD HH:mm:ss"),
- startDate: moment_default()().subtract(3, 'months').format("YYYY-MM-DD 00:00:00"),
- endDateOne: moment_default()().format("YYYY-MM-DD HH:mm:ss"),
- startDateOne: moment_default()().subtract(3, 'months').format("YYYY-MM-DD 00:00:00"),
- searchRoom: '',
- deviceImg: __webpack_require__("Dvxw"),
- selectoption: [],
- selectoptionValue: '',
- senddeviceNum: '',
- sendDevice: {
- deviceNum: ''
- },
- sendroomId: '',
- commpontentStatus: true,
- Emergence: {
- EmerPhone: '',
- password: '',
- device: '',
- name: ''
- },
- defaultProps: {
- children: "children",
- label: "name"
- },
- options: [],
- drawer: false,
- value1: false,
- value2: 0,
- marks: {
- 0: "关",
- 50: "中",
- 100: "高"
- },
- switchtext: "关",
- activeName: "0",
- formInline: {},
- platlist: [{
- label: "电信",
- value: 1
- }, {
- label: "移动",
- value: 2
- }, {
- label: "联通",
- value: 3
- }],
- manufacturerList: [],
- setting: {
- edit: {
- enable: true,
- drag: {
- isMove: true
- },
- showRemoveBtn: false,
- showRenameBtn: false
- },
- check: {
- enable: false
- },
- data: {
- simpleData: {
- enable: true,
- pIdKey: "pid"
- }
- },
- view: {
- showIcon: true,
- addHoverDom: this.addHoverDom,
- removeHoverDom: this.removeHoverDom
- }
- },
- zNodes: [],
- bromm: {},
- query: {
- address: "",
- name: "",
- pageIndex: 1,
- pageSize: 20,
- options: []
- },
- search: {
- name: "",
- deviceNum: "",
- roomname: '',
- imei: "",
- isOnline: "",
- startBattery: '',
- endBattery: '',
- firmwareVersion: '',
- operationStatus: '',
- isUsed: '',
- iccid: '',
- rssiStart: '',
- rssiEnd: '',
- createStart: '',
- createEnd: '',
- isAppBind: ''
- },
- tableData: [],
- multipleSelection: [],
- delList: [],
- editVisible: false,
- roomVisible: false,
- pageTotal: 0,
- sumpageTotal: 0,
- currentPage4: 1,
- form: {
- lockerId: '',
- manufacturer: "",
- platformId: '',
- imei: '',
- deviceNum: '',
- authKey: '',
- validateCode: '',
- lockerSuperAdminId: '',
- customerCode: '',
- type: ''
- },
- manufacturer: '',
- idx: -1,
- id: -1,
- abnormal: 0,
- online: 0,
- treedata: [],
- unonline: 0,
- Unlocking: false,
- Unlockingrow: {},
- lockingform: {
- password: ""
- },
- activeiconfont: true,
- info: [],
- uploadkj: false,
- userlist1statu: true,
- userlist2: [],
- multipleSelection1: [],
- batchAccess: "",
- getEmergenceStatus: false,
- getEmergenceNum: '',
- checkNodeId: '',
- pageSize: 10,
- pageNum: 1,
- sendStatus: true,
- userInfo: {
- type: ''
- },
- checkNodeId1: '',
- accessPlatform: {},
- paginationConfig: 'total, sizes, prev, pager, next, jumper',
- colNum_6: 6,
- drawerSize: '90%',
- analysisData: { isAlwaysOpen: 0, notAlwaysOpen: 0, bingSite: 0 }
- };
- },
-
- components: {
- zTree: zTree1["a" /* default */],
- deviceLi: deviceLi["a" /* default */],
- UnlockRecord: UnlockRecord["a" /* default */],
- warningLog: warningLog["a" /* default */],
- DeviceFeedbackLog: DeviceFeedbackLog["a" /* default */],
- voucherCom: voucherCom["a" /* default */]
- },
- beforeCreate: function beforeCreate() {
- // var tenantId = JSON.parse(localStorage.getItem('tenantId'))
- // if (tenantId == 400) {
- // this.$store.commit('defaultsettenantid')
- // }
- },
- created: function created() {
- if (this.$route.params.isOnline) {
- this.search.isOnline = this.$route.params.isOnline;
- }
- if (this.$route.params.endBattery) {
- this.search.startBattery = '0';
- this.search.endBattery = 20;
- }
- this.manufacturerList = this.$MANUFACTURER.MANUFACTURER.lock;
- this.accessPlatform = this.$MANUFACTURER.accessPlatform;
- this.userInfo = JSON.parse(localStorage.getItem('info'));
- if (this.$route.params.isUsed) {
- this.search.isUsed = this.$route.params.isUsed;
- }
- if (document.documentElement.clientWidth < 1080) {
- this.paginationConfig = 'total, prev, pager, next';
- this.colNum_6 = 12;
- this.drawerSize = '100%';
- } else {
- this.paginationConfig = 'total, sizes, prev, pager, next, jumper';
- this.colNum_6 = 6;
- this.drawerSize = '90%';
- }
- },
- mounted: function mounted() {
- this.getdevice();
- // this.getalllist();
- this.$store.commit("increment", 1);
- this.getcard();
- this.getallTree();
- document.addEventListener('keydown', this.keyDown);
- },
-
- methods: {
- // 设备筛选导出结果
- exportDeviceOrderMethods: function exportDeviceOrderMethods() {
- var _this2 = this;
-
- var deviceNum = this.search.deviceNum.replace(/\s*/g, "");
- var imei = this.search.imei.replace(/\s*/g, "");
- if (this.search.isOnline == 2) {
- this.search.isAppBind = 1;
- } else {
- this.search.isAppBind = '';
- }
- var q = {
- deviceNum: deviceNum,
- imei: imei,
- isOnline: this.search.isOnline,
- roomName: this.search.roomname,
- roomIds: this.checkNodeId,
- startBattery: this.search.startBattery,
- endBattery: this.search.endBattery,
- lockType: 1,
- unBind: this.search.unBind,
- firmwareVersion: this.search.firmwareVersion,
- isUsed: this.search.isUsed,
- iccid: this.search.iccid,
- rssiStart: this.search.rssiStart,
- rssiEnd: this.search.rssiEnd,
- createStart: this.search.createStart,
- createEnd: this.search.createEnd,
- isAppBind: this.search.isAppBind
- };
- if (q.isOnline == 2) {
- delete q.isOnline;
- }
- var qObject = util["a" /* default */].validObject(q);
- var data = {
- orderBy: "open_time desc",
- q: stringify_default()(qObject)
- };
- Object(api["g" /* httpPost */])(data, this.$api.exportDeviceOrder).then(function (res) {
- if (res.code == 200) {
- var exportData = [];
- //导出数据结构构造
- res.data.forEach(function (item) {
- exportData.push({
- roomName: item.roomName,
- deviceNum: item.deviceNum,
- imei: item.imei,
- isOnline: item.isOnline == 1 ? '在线' : item.isOnline == 2 ? '异常' : '离线',
- battery: item.battery,
- rssi: item.rssi,
- createAt: moment_default()(item.createAt).format("YYYY-MM-DD HH:mm:ss"),
- lastReportAt: moment_default()(item.lastReportAt).format("YYYY-MM-DD HH:mm:ss")
- });
- });
- //导出表头设计
- var head = {
- roomName: '房间名称',
- deviceNum: '设备号',
- imei: 'IMEI',
- isOnline: '状态',
- battery: '电量',
- rssi: '信号',
- createAt: '注册时间',
- lastReportAt: '上线时间'
- //表头数据切换
- };var list = exportData.map(function (item) {
- var obj = {};
- for (var k in item) {
- if (head[k]) {
- obj[head[k]] = item[k];
- }
- }
- return obj;
- });
- // 创建工作表
- var _data = xlsx_default.a.utils.json_to_sheet(list);
- // 创建工作簿
- var wb = xlsx_default.a.utils.book_new();
- // 将工作表放入工作簿中
- xlsx_default.a.utils.book_append_sheet(wb, _data, 'data');
- // 生成文件并下载
- xlsx_default.a.writeFile(wb, '门锁列表.xlsx');
- } else {
- _this2.$message.error(res.message);
- }
- });
- // downloadPost(data, this.$api.exportDeviceOrder).then((res) => {
- // const link = document.createElement("a");
- // let 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);
- // });
- },
-
- // 获取常开记录
- getAlwaysOpens: function getAlwaysOpens() {
- var _this3 = this;
-
- var data = {
- pageNum: this.normallyPageNum,
- pageSize: this.normallyPageSzie,
- orderType: "desc",
- orderBy: "createTime",
- q: stringify_default()({
- deviceNum: this.formInline.deviceNum
- })
- };
- Object(api["g" /* httpPost */])(data, this.$api.getAlwaysOpensApi).then(function (res) {
- if (res.success) {
- res.data.list.map(function (li) {
- li.createTime = moment_default()(li.createTime).format("YYYY-MM-DD HH:mm:ss");
- var content = JSON.parse(li.content);
- if (content.operate) {
- li.operate = content.operate;
- } else {
- li.operate = '';
- }
- if (content.endTime) {
- li.endTime = content.endTime;
- li.startTime = content.startTime;
- li.startHour = content.openDoorSegmentList[0].startHour;
- li.endHour = content.openDoorSegmentList[0].endHour;
- li.opendDoorType = content.opendDoorType;
- }
- if (li.updateTime) {
- li.updateTime = moment_default()(li.updateTime).format("YYYY-MM-DD HH:mm:ss");
- }
- });
- _this3.normallyOpenRecordList = res.data.list;
- _this3.normallyTotal = res.data.total;
- } else {
- _this3.$message.error(res.message);
- }
- });
- },
-
- // 常开记录分页
- normallyHandleSizeChange: function normallyHandleSizeChange(val) {
- this.normallyPageSzie = val;
- this.getAlwaysOpens();
- },
- normallyHandleCurrentChange: function normallyHandleCurrentChange(val) {
- this.normallyPageNum = val;
- this.getAlwaysOpens();
- },
-
- // 电量图表初始化
- initChart: function initChart() {
- var myLine = this.$echarts.init(document.getElementById("myLine"));
- myLine.setOption(this.myLine_option);
- },
- initChartOne: function initChartOne() {
- var myLine = this.$echarts.init(document.getElementById("myLineOne"));
- myLine.setOption(this.myLine_option_one);
- },
- initChartThree: function initChartThree() {
- var myLine = this.$echarts.init(document.getElementById("myLineThree"));
- myLine.setOption(this.myLine_option_three);
- },
- getElectricity: function getElectricity(e) {
- this.endDate = moment_default()(this.dateTime[1]).format("YYYY-MM-DD HH:mm:ss");
- this.startDate = moment_default()(this.dateTime[0]).format("YYYY-MM-DD HH:mm:ss");
- this.quantityFun();
- this.dateTimeOne = [this.dateTime[0], this.dateTime[1]];
- this.endDateOne = moment_default()(this.dateTime[1]).format("YYYY-MM-DD HH:mm:ss");
- this.startDateOne = moment_default()(this.dateTime[0]).format("YYYY-MM-DD HH:mm:ss");
- this.quantityFunOne();
- },
- getSignal: function getSignal(e) {
- this.endDateOne = moment_default()(this.dateTimeOne[1]).format("YYYY-MM-DD HH:mm:ss");
- this.startDateOne = moment_default()(this.dateTimeOne[0]).format("YYYY-MM-DD HH:mm:ss");
- this.quantityFunOne();
- },
-
- // 电量图表显示
- quantityFun: function quantityFun() {
- var _this4 = this;
-
- var endDate = this.endDate;
- var startDate = this.startDate;
- var data = {
- code: "logHeartbeat/batteryList",
- data: {
- pageNum: 1,
- pageSize: 100000,
- para: {
- deviceNum: this.senddeviceNum,
- startDate: startDate,
- endDate: endDate
- }
- }
- };
- Object(api["g" /* httpPost */])(data, this.$api.sendCommand).then(function (res) {
- if (res.success) {
- var optiondata = [],
- seriesdata = [];
- res.data.list.map(function (li, index) {
- li.createAt = moment_default()(li.createAt).format("YYYY-MM-DD HH:mm:ss");
- });
- var array = _this4.factorial(res.data.list, 0);
- array.map(function (li) {
- optiondata.push(li.createAt);
- seriesdata.push(li.battery);
- });
- _this4.myLine_option.xAxis.data = optiondata;
- _this4.myLine_option.series[0].data = seriesdata;
- _this4.$nextTick(function () {
- _this4.initChart();
- });
- } else {
- _this4.$message.error("数据错误");
- }
- });
- },
- factorial: function factorial(time, index) {
- if (time.length - 1 > index) {
- var date = new Date(time[index + 1].createAt).getTime();
- var date1 = new Date(time[index].createAt).getTime();
- // console.log(parseInt(date),index,parseInt(date1),(parseInt(date)-parseInt(date1)))
- if (parseInt(date) - parseInt(date1) > 8640000) {
- return this.factorial(time, index + 1);
- } else {
- time.splice(index, 1);
- return this.factorial(time, index);
- }
- } else {
- return time;
- }
- },
-
- // 信号图表显示
- quantityFunOne: function quantityFunOne() {
- var _this5 = this;
-
- var endDate = this.endDateOne;
- var startDate = this.startDateOne;
- var data = {
- code: "logHeartbeat/rssiList",
- data: {
- pageNum: 1,
- pageSize: 100000,
- para: {
- deviceNum: this.senddeviceNum,
- startDate: startDate,
- endDate: endDate
- }
- }
- };
- Object(api["g" /* httpPost */])(data, this.$api.sendCommand).then(function (res) {
- if (res.success) {
- var optiondata = [],
- seriesdata = [];
- res.data.list.map(function (li, index) {
- li.createAt = moment_default()(li.createAt).format("YYYY-MM-DD HH:mm:ss");
- });
- var array = _this5.factorial(res.data.list, 0);
- array.map(function (li) {
- optiondata.push(li.createAt);
- seriesdata.push(li.rssi);
- });
- _this5.myLine_option_one.xAxis.data = optiondata;
- _this5.myLine_option_one.series[0].data = seriesdata;
- _this5.$nextTick(function () {
- _this5.initChartOne();
- });
- } else {
- _this5.$message.error("数据错误");
- }
- });
- },
- getTimeDate: function getTimeDate(n) {
- var currentDate = new Date();
- var preDate = new Date(currentDate.getTime() + n * 24 * 3600 * 1000);
- var year = currentDate.getFullYear();
- var mon = currentDate.getMonth() + 1;
- var day = currentDate.getDay();
- var s = year + '-' + (mon < 10 ? '0' + mon : mon) + '-' + (day < 10 ? '0' + day : day);
- return s;
- },
-
- // 信号图表显示
- quantityFunThree: function quantityFunThree() {
- var _this6 = this;
-
- var data = {
- code: "lockOnlineBattery/selectOnline",
- data: {
- deviceNum: this.senddeviceNum
- }
- };
- Object(api["g" /* httpPost */])(data, this.$api.sendCommand).then(function (res) {
- if (res.success) {
- var optiondata = [],
- seriesdata = [];
- for (var i = 0; i < res.data.length; i++) {
- var date = _this6.getTimeDate(i);
- optiondata.push(date);
- seriesdata.push(res.data.online[i]);
- }
- _this6.myLine_option_one.xAxis.data = optiondata;
- _this6.myLine_option_one.series[0].data = seriesdata;
- _this6.$nextTick(function () {
- _this6.initChartThree();
- });
- } else {
- _this6.$message.error("数据错误");
- }
- });
- },
- keyDown: function keyDown(e) {
- //如果是回车则执行登录方法
- if (e.keyCode == 13) {
- if (this.$route.name == 'doorLock') {
- this.handleSearch();
- }
- }
- },
-
- // 解冻
- thawMethods: function thawMethods(index, row) {
- var _this7 = this;
-
- this.$confirm("是否解冻该门锁?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(function () {
- allFun["a" /* default */].freeManageMethods(0, row, function (callback) {
- if (callback.code == 200) {
- _this7.$message.success("解冻指令下发成功");
- } else {
- _this7.$message.error("解冻失败");
- }
- });
- });
- },
-
- // 冻结门锁
- frozenMethods: function frozenMethods(index, row) {
- var _this8 = this;
-
- allFun["a" /* default */].freeManageMethods(1, row, function (callback) {
- if (callback.code == 200) {
- _this8.$message.success("冻结指令下发成功");
- } else {
- _this8.$message.error("冻结失败");
- }
- });
- },
- InputFun: function InputFun(e, name) {
- if (name == 'startBattery' || name == 'endBattery') {
- if (Number(e) < 0) {
- e = 0;
- }
- if (Number(e) > 100) {
- e = 100;
- }
- }
- this.search[name] = e;
- },
- selectTenantId: function selectTenantId(e) {
- localStorage.setItem('tenantId', e);
- this.reload();
- },
-
- // 重置初始化
- resetInitialization: function resetInitialization(row, callback) {
- var _this9 = this;
-
- if (row.manufactureId == 201 || row.manufactureId == 221) {
- var data3 = {
- code: "zg/deleteAllUsers",
- data: {
- lockerId: row.deviceNum,
- imei: row.imei,
- order: 6501
- }
- };
- Object(api["g" /* httpPost */])(data3, this.$api.sendCommand).then(function (res) {
- if (res.success) {
- _this9.$message.success("重置成功");
- callback(true);
- } else {
- callback(false);
- }
- });
- } else if (row.manufactureId == 101) {
- var data2 = {
- code: "isp/restoreSetting",
- data: {
- order: 6501,
- imei: row.imei,
- deviceNum: row.deviceNum,
- managerTelephone: "18270949468",
- managerPassword: "202108"
- }
- };
- Object(api["g" /* httpPost */])(data2, this.$api.sendCommand).then(function (res2) {
- if (res2.success) {
- _this9.$message.success("重置成功");
- var str = {
- deviceNum: row.deviceNum,
- imei: row.imei,
- order: 6101
- };
- Object(api["g" /* httpPost */])(str, _this9.$api.getDeviceRegisterManager).then(function (res1) {
- var str1 = {
- imei: row.imei, //row.imsi,
- deviceNum: row.deviceNum, //row.deviceNum,
- operateMode: 7,
- is: true,
- order: 6207,
- passwordStartTime: "20210813010101",
- passwordEndTime: "20680813010101"
- };
- Object(api["g" /* httpPost */])(str1, _this9.$api.getDeviceOperateUserInfo).then(function (res2) {});
- var str2 = {
- imei: row.imei, //row.imsi,
- deviceNum: row.deviceNum, //row.deviceNum,
- operateMode: 4,
- is: true,
- order: 6204,
- passwordStartTime: "20210813010101",
- passwordEndTime: "20680813010101"
- };
- Object(api["g" /* httpPost */])(str2, _this9.$api.getDeviceOperateUserInfo).then(function (res3) {
- if (res3.success) {
- _this9.$message.success("初始化成功");
- callback(true);
- }
- });
- });
- } else {
- _this9.$message.error(res2.msg);
- callback(false);
- }
- });
- }
- },
- getPersonCallback: function getPersonCallback(person, alllist, callback) {
- var personlist = [];
- person.map(function (li) {
- var obj = {
- person: li,
- data: alllist.filter(function (item) {
- if (item.deviceNum && item.cardId == li.cardId) {
- return item;
- }
- })
- };
- personlist.push(obj);
- });
- callback(personlist);
- },
- setReset: function setReset(row) {
- var _this10 = this;
-
- if (row.manufactureId == 201 || row.manufactureId == 221) {
- var data3 = {
- code: "zg/deleteAllUsers",
- data: {
- lockerId: row.deviceNum,
- imei: row.imei,
- order: 6501,
- cardName: this.userInfo.username,
- roomName: row.roomName
- }
- };
- Object(api["g" /* httpPost */])(data3, this.$api.sendCommand).then(function (res) {
- if (res.success) {
- _this10.$message.success("重置成功");
- var q = {
- id: row.roomId
- };
- var tenant = {
- q: stringify_default()(q)
- };
- Object(api["d" /* httpGet */])(tenant, _this10.$api.getSiteTenant).then(function (res) {
- promise_default.a.all(res.data.list.map(function (element) {
- return new promise_default.a(function (resolve, reject) {
- resolve(element.cardId);
- });
- })).then(function (allId) {
- allId.map(function (li) {
- var str = [{
- siteId: row.roomId,
- cardId: li
- }];
- Object(api["g" /* httpPost */])(str, _this10.$api.unbindCard).then(function (res) {});
- });
- });
- });
- } else {
- _this10.$message.success(res.msg);
- }
- });
- } else if (row.manufactureId == 101) {
- var data2 = {
- code: "isp/restoreSetting",
- data: {
- order: 6501,
- imei: row.imei,
- deviceNum: row.deviceNum,
- managerTelephone: "18270949468",
- managerPassword: "202108",
- cardName: this.userInfo.username,
- roomName: row.roomName
- }
- };
- Object(api["g" /* httpPost */])(data2, this.$api.sendCommand).then(function (res2) {
- if (res2.success) {
- _this10.$message.success("重置成功");
- var q = {
- id: row.roomId
- };
- var tenant = {
- q: stringify_default()(q)
- };
- Object(api["d" /* httpGet */])(tenant, _this10.$api.getSiteTenant).then(function (res) {
- promise_default.a.all(res.data.list.map(function (element) {
- return new promise_default.a(function (resolve, reject) {
- resolve(element.cardId);
- });
- })).then(function (allId) {
- var str = {
- deviceNum: row.deviceNum,
- imei: row.imei,
- order: 6101
- };
- Object(api["g" /* httpPost */])(str, _this10.$api.getDeviceRegisterManager).then(function (res1) {
- var str1 = {
- imei: row.imei, //row.imsi,
- deviceNum: row.deviceNum, //row.deviceNum,
- operateMode: 7,
- is: true,
- order: 6207,
- passwordStartTime: "20210813010101",
- passwordEndTime: "20680813010101"
- };
- Object(api["g" /* httpPost */])(str1, _this10.$api.getDeviceOperateUserInfo).then(function (res2) {});
- var str2 = {
- imei: row.imei, //row.imsi,
- deviceNum: row.deviceNum, //row.deviceNum,
- operateMode: 4,
- is: true,
- order: 6204,
- passwordStartTime: "20210813010101",
- passwordEndTime: "20680813010101"
- };
- Object(api["g" /* httpPost */])(str2, _this10.$api.getDeviceOperateUserInfo).then(function (res3) {
- if (res3.success) {
- _this10.$message.success("初始化成功");
- }
- });
- });
- allId.map(function (li) {
- var str = [{
- siteId: row.roomId,
- cardId: li
- }];
- Object(api["g" /* httpPost */])(str, _this10.$api.unbindCard).then(function (res) {});
- });
- });
- });
- } else {
- _this10.$message.error(res2.msg);
- }
- });
- }
- },
-
- // 数据同步
- dataSynchronization: function dataSynchronization(index, row) {
- var _this11 = this;
-
- console.log(row);
- this.$confirm("是否确认数据同步?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(function () {
- _this11.orderDeviceData(row);
- });
- },
- sendPersonCerf: function sendPersonCerf(row, setPersonList, alllist) {
- var _this12 = this;
-
- setPersonList.forEach(function (li) {
- _this12.getPersonInfo(li, function (callback) {
- if (callback.code == 200) {
- if (callback.data.list.length > 0) {
- var personli = callback.data.list[0];
- if (row.manufactureId == 101) {
- var alllistAll = alllist.filter(function (item) {
- return item.cardId == li;
- });
- var endTime = alllistAll[0].endTime * 1000;
- var startTime = alllistAll[0].startTime * 1000;
- var passwordEndTime = moment_default()(endTime).format("YYYYMMDDHHmmss");
- var passwordStartTime = moment_default()(startTime).format("YYYYMMDDHHmmss");
- var userTelephone = JSON.parse(personli.info).userTelephone;
- var userPassword = JSON.parse(personli.info).userPassword;
- var data = {
- deviceNum: row.deviceNum,
- imei: row.imei,
- userTelephone: userTelephone,
- userPassword: userPassword,
- password: userPassword,
- operateMode: 26,
- order: 6226,
- passwordStartTime: passwordStartTime,
- passwordEndTime: passwordEndTime,
- cardName: personli.name,
- roomName: row.roomName
- };
- 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) {
- alllistAll.map(function (ll) {
- util["a" /* default */].putCarfidAdd(row, ll);
- });
- });
- } else if (row.manufactureId == 201 || row.manufactureId == 221) {
- var alllistAll = alllist.filter(function (item) {
- return item.cardId == li;
- });
- var endTime = alllistAll[0].endTime * 1000;
- var startTime = alllistAll[0].startTime * 1000;
- var passwordEndTime = moment_default()(endTime).format("YYYYMMDDHHmmss");
- var passwordStartTime = moment_default()(startTime).format("YYYYMMDDHHmmss");
- var userTelephone = JSON.parse(personli.info).userTelephone;
- var userPassword = JSON.parse(personli.info).userPassword;
- var data = {
- lockerId: row.deviceNum,
- imei: row.imei,
- lockerUserId: userPassword,
- keyId: userPassword,
- role: 0,
- action: 1,
- order: 6226,
- cardName: personli.name,
- roomName: row.roomName
- };
- equipment["a" /* default */].addUserToLock(data.lockerId, data.imei, data.lockerUserId, data.role, data.action, data.order, data.cardName, data.roomName, function (callback) {
- console.log(callback, 'callback');
- if (callback.success) {
- alllistAll.map(function (ll) {
- util["a" /* default */].putCarfidzgAdd(row, ll);
- });
- }
- });
- }
- }
- }
- });
- });
- },
- getPersonInfo: function getPersonInfo(li, callback) {
- var q = {
- id: li
- };
- var data = {
- pageNum: 1,
- pageSize: 10,
- orderBy: "create_time desc",
- q: stringify_default()(q)
- };
- Object(api["g" /* httpPost */])(data, this.$api.getlistNum).then(function (res1) {
- callback(res1);
- });
- },
-
- // 获取指定锁所有非703凭证数据
- orderDeviceData: function orderDeviceData(row) {
- var _this13 = this;
-
- var _this = this;
- if (row.roomId) {
- var data1 = {
- pageNum: 0,
- pageSize: 0,
- q: {
- id: row.roomId
- }
- };
- Object(api["d" /* httpGet */])(data1, this.$api.getSiteTenant).then(function (res) {
- if (res.success) {
- var person = res.data.list;
- var data = {
- pageNum: 0,
- pageSize: 0,
- orderBy: "create_at desc",
- q: {
- deviceNum: row.deviceNum,
- types: "0,1,2,3,4",
- inStatus: "0,1"
- }
- };
- Object(api["d" /* httpGet */])(data, _this13.$api.getCertificates).then(function (res1) {
- if (res1.success) {
- var alllist = util["a" /* default */].zlib_unzip(res1.data);
- _this13.getPersonCallback(person, alllist, function (callback) {
- console.log(person, alllist, callback);
- var personlist = callback;
- _this.resetInitialization(row, function (callback1) {
- console.log(callback1, row);
- if (row.manufactureId == 101) {
- personlist.map(function (lt) {
- var endTime = new Date(lt.person.endTime).getTime();
- var startTime = new Date(lt.person.startTime).getTime();
- var passwordEndTime = moment_default()(endTime).format("YYYYMMDDHHmmss");
- var passwordStartTime = moment_default()(startTime).format("YYYYMMDDHHmmss");
- var userTelephone = JSON.parse(lt.person.info).userTelephone;
- var userPassword = JSON.parse(lt.person.info).userPassword;
- var data = {
- deviceNum: row.deviceNum,
- imei: row.imei,
- userTelephone: userTelephone,
- userPassword: userPassword,
- password: userPassword,
- operateMode: 26,
- order: 6226,
- passwordStartTime: passwordStartTime,
- passwordEndTime: passwordEndTime,
- cardName: lt.person.name,
- roomName: row.roomName
- };
- 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) {
- lt.data.map(function (ll) {
- util["a" /* default */].putCarfidAdd(row, ll);
- });
- });
- });
- } else if (row.manufactureId == 201 || row.manufactureId == 221) {
- personlist.map(function (lt) {
- var endTime = new Date(lt.person.endTime).getTime();
- var startTime = new Date(lt.person.startTime).getTime();
- var passwordEndTime = moment_default()(endTime).format("YYYYMMDDHHmmss");
- var passwordStartTime = moment_default()(startTime).format("YYYYMMDDHHmmss");
- var userTelephone = JSON.parse(lt.person.info).userTelephone;
- var userPassword = JSON.parse(lt.person.info).userPassword;
- var data = {
- lockerId: row.deviceNum,
- imei: row.imei,
- lockerUserId: userPassword,
- keyId: userPassword,
- role: 0,
- action: 1,
- order: 6226,
- cardName: lt.person.name,
- roomName: row.roomName
- };
- equipment["a" /* default */].addUserToLock(data.lockerId, data.imei, data.lockerUserId, data.role, data.action, data.order, data.cardName, data.roomName, function (callback2) {
- if (callback2.success) {
- lt.data.map(function (ll) {
- util["a" /* default */].putCarfidzgAdd(row, ll);
- });
- }
- });
- });
- }
- });
- });
- } else {
- _this13.$message.error(res1.msg);
- }
- });
- } else {
- _this13.$message.error(res.msg);
- }
- });
- } else {
- this.$message.error("暂无数据");
- }
- },
-
- // 从paas同步能对应得上的有效凭证
- syncCommands: function syncCommands() {
- Object(api["d" /* httpGet */])('', this.$api.syncCommands).then(function (res) {});
- },
-
- // 同步刷新
- refreshFun: function refreshFun() {
- var _this14 = this;
-
- Object(api["d" /* httpGet */])("", this.$api.lockDeviceInfoList).then(function (res) {
- _this14.handleSearch();
- });
- },
-
- // 选择房源
- checkNode: function checkNode(e) {
- this.checkNodeId = e;
- var options = this.options;
- var arr = this.getId(options, e[e.length - 1]);
- console.log(arr);
- var listarr = [arr[0]];
- var obj = this.getNodeId(listarr);
- this.checkNodeId = obj;
- },
- checkNodeOne: function checkNodeOne(e) {
- this.checkNodeId1 = e[e.length - 1];
- this.checkRoomDevice(e[e.length - 1]);
- },
- checkRoomDevice: function checkRoomDevice(id) {
- var _this15 = this;
-
- var q = {
- roomIds: [id],
- lockType: 1
- };
- var data = {
- q: stringify_default()(q),
- pageNum: 1,
- pageSize: this.pageSize
- };
- Object(api["g" /* httpPost */])(data, this.$api.getDeviceItems).then(function (res) {
- if (res.data.list.length > 0) {
- _this15.$message.error("该房间已绑定锁,请重新选择");
- _this15.checkNodeId1 = '';
- }
- });
- },
- 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;
- },
- getallTree: function getallTree() {
- var _this16 = this;
-
- var data = {};
- Object(api["d" /* httpGet */])(data, this.$api.getTree).then(function (res) {
- var userlist = [];
- var temp = {},
- arr = [];
- res.data.forEach(function (item, index) {
- if (!temp[item.id]) {
- arr.push(item);
- temp[item.id] = true;
- }
- });
- arr.map(function (li) {
- if (li.expand) {
- if (JSON.parse(li.expand).type == "0") {
- userlist.push(li);
- }
- }
- });
- var list = res.data.sort(function (pre, cur) {
- return pre.id - cur.id;
- });
- var arrdata = Object(utils["o" /* uniqueArray1 */])(list, "id");
- _this16.options = Object(utils["p" /* ztreeToElementTree */])(arrdata, {});
- _this16.zNodes = _this16.options;
- });
- },
-
- // 获取门卡概况
- getcard: function getcard() {
- var _this17 = this;
-
- allFun["a" /* default */].getAnalysis("", 1, function (callback) {
- _this17.analysisData = callback;
- _this17.sumpageTotal = callback.total;
- _this17.online = callback.onlineTotal;
- _this17.unonline = callback.offlineTotal;
- _this17.abnormal = callback.isAppBind;
- });
- },
-
- // 发送离线密码
- sendEmergence: function sendEmergence() {
- var _this18 = this;
-
- var re = /^1\d{10}$/;
- if (re.test(this.Emergence.EmerPhone)) {
- var data = {
- code: this.Emergence.password,
- phone: this.Emergence.EmerPhone,
- device: this.Emergence.device,
- name: this.Emergence.name
- };
- Object(api["g" /* httpPost */])(data, this.$api.sendEmergence).then(function (res) {
- if (res.success) {
- _this18.$message.success('发送成功');
- } else {
- _this18.$message.error('发送失败');
- }
- });
- this.getEmergenceStatus = false;
- } else {
- this.$message.error('请填写正确手机号');
- }
- },
- handleCheckChange: function handleCheckChange(data, checked, node) {
- if (checked) {
- this.treedata = data;
- } else {
- if (this.checkedId == data.id) {
- this.$refs.tree.setCheckedKeys([data.id]);
- }
- }
- },
-
- // 临时密码
- getEmergence: function getEmergence(index, row) {
- var _this19 = this;
-
- var data = {
- code: "zg/getEmergence",
- data: {
- lockerId: row.deviceNum
- }
- };
- Object(api["g" /* httpPost */])(data, this.$api.sendCommand).then(function (res) {
- if (res.success) {
- _this19.$message.success("获取成功");
- _this19.Emergence.password = res.data.data;
- _this19.Emergence.device = row.deviceNum;
- _this19.Emergence.name = row.roomName;
- _this19.getEmergenceStatus = true;
- } else {
- _this19.$message.error("获取失败");
- }
- });
- },
-
- // input视图刷新
- changesr: function changesr(e) {
- this.$forceUpdate();
- },
- handleSelectionChange1: function handleSelectionChange1(val) {
- this.multipleSelection1 = val;
- },
- BatchAdd: function BatchAdd() {
- this.uploadkj = true;
- },
-
- //批量添加确认
- batchUploadfun: function batchUploadfun() {
- var _this20 = this;
-
- if (this.batchAccess == "") {
- this.$message.error("请选择运营商");
- } else if (this.multipleSelection1.length == 0) {
- this.$message.error("请勾选要批量添加的设备");
- } else {
- this.multipleSelection1.map(function (li, index) {
- var str = {
- deviceNum: li.deviceNum,
- imei: li.imei,
- imsi: li.imei, //row.imsi,
- order: 5101,
- platformId: _this20.batchAccess,
- enterpriseId: _this20.userInfo.enterpriseId,
- manufactureId: _this20.manufacturer
- };
- allFun["a" /* default */].RegisterDevice(str, function (callback) {
- if (callback.success) {
- _this20.$message.success("添加成功");
- _this20.editVisible = false;
- _this20.getdevice();
- } else {
- _this20.$message.error(callback.message);
- }
- });
- });
- }
- },
-
- //音量设置
- stepFun: function stepFun(val) {
- var _this21 = this;
-
- var operate = "00";
- if (val == '0') {
- operate = "00";
- } else if (val == 1) {
- operate = "01";
- } else if (val == 2) {
- operate = "02";
- }
- var data = {
- code: "isp/volumnSetting",
- data: {
- imei: this.formInline.imei,
- deviceNum: this.formInline.deviceNum,
- operate: operate,
- order: 61001
- }
- };
- Object(api["g" /* httpPost */])(data, this.$api.sendCommand).then(function (res2) {
- if (res2.data.success) {
- _this21.$message.success("设置成功");
- } else {
- _this21.$message.error(res.msg);
- }
- });
- },
- batchSetOpenMethods: function batchSetOpenMethods() {
- this.setopenStatus = true;
- },
-
- // 取消常开设置
- UnsetMethods: function UnsetMethods(e) {
- var _this22 = this;
-
- if (this.startHour > 24 || this.startHour < 0) {
- this.$message.error('请选择正确的开始时间段');
- return;
- } else if (this.endHour > 24 || this.endHour < 0) {
- this.$message.error('请选择正确的结束时间段');
- return;
- }
- if (e == 1) {
- var multipleSelection = [];
- multipleSelection.push(this.formInline);
- multipleSelection.map(function (li) {
- var data = {
- code: "zg/longopen/operation",
- data: {
- order: 61101,
- roomName: li.roomName,
- opendDoorType: 0,
- lockerId: li.deviceNum,
- lockerUserId: li.iotId,
- startTime: moment_default()(_this22.opendTime[0]).format('YYYY-MM-DD HH:mm:ss'),
- endTime: moment_default()(_this22.opendTime[1]).format('YYYY-MM-DD HH:mm:ss'),
- openDoorSegmentList: [{
- startHour: _this22.startHour,
- endHour: _this22.endHour
- }]
- }
- };
- Object(api["g" /* httpPost */])(data, _this22.$api.sendCommand).then(function (res2) {
- if (res2.success) {
- _this22.$message.success("取消设置成功");
- } else {
- _this22.$message.error(res2.msg);
- }
- });
- });
- } else if (e == 2) {
- var multipleSelection = this.multipleSelection;
- multipleSelection.map(function (li) {
- var data = {
- code: "zg/longopen/operation",
- data: {
- order: 61101,
- roomName: li.roomName,
- opendDoorType: 0,
- lockerId: li.deviceNum,
- lockerUserId: li.iotId,
- startTime: moment_default()(_this22.opendTime[0]).format('YYYY-MM-DD HH:mm:ss'),
- endTime: moment_default()(_this22.opendTime[1]).format('YYYY-MM-DD HH:mm:ss'),
- openDoorSegmentList: [{
- startHour: _this22.startHour,
- endHour: _this22.endHour
- }]
- }
- };
- Object(api["g" /* httpPost */])(data, _this22.$api.sendCommand).then(function (res2) {
- if (res2.success) {
- _this22.$message.success("取消设置成功");
- } else {
- _this22.$message.error(res2.msg);
- }
- });
- });
- }
- },
- setNormallyOpenMethodsAll: function setNormallyOpenMethodsAll() {
- var _this23 = this;
-
- if (this.startHour > 24 || this.startHour < 0) {
- this.$message.error('请选择正确的开始时间段');
- return;
- } else if (this.endHour > 24 || this.endHour < 0) {
- this.$message.error('请选择正确的结束时间段');
- return;
- }
- if (this.opendTime[0] == '') {
- this.$message.error('请选择开始日期');
- return;
- }
- if (this.opendTime[1] == '') {
- this.$message.error('请选择结束日期');
- return;
- }
- if (this.startHour != '' && this.endHour == '') {
- this.$message.error('请选择结束时间段');
- return;
- }
- if (this.startHour == '' && this.endHour != '') {
- this.$message.error('请选择开始时间段');
- return;
- }
-
- this.multipleSelection.map(function (li) {
- if (li.manufactureId == 201 || li.manufactureId == 221) {
- var data = {
- code: "zg/longopen/operation",
- data: {
- order: 61101,
- roomName: li.roomName,
- opendDoorType: 1,
- lockerId: li.deviceNum,
- lockerUserId: li.iotId,
- startTime: moment_default()(_this23.opendTime[0]).format('YYYY-MM-DD HH:mm:ss'),
- endTime: moment_default()(_this23.opendTime[1]).format('YYYY-MM-DD HH:mm:ss'),
- openDoorSegmentList: [{
- startHour: _this23.startHour,
- endHour: _this23.endHour
- }]
- }
- };
- if (_this23.startHour == '' && _this23.endHour == '') {
- data.data.openDoorSegmentList = [];
- }
- Object(api["g" /* httpPost */])(data, _this23.$api.sendCommand).then(function (res2) {
- if (res2.success) {
- _this23.$message.success("设置成功");
- _this23.getAlwaysOpens();
- } else {
- _this23.$message.error(res2.msg);
- }
- });
- } else {
- _this23.$message.error('该类型锁不支持此设置!');
- }
- });
- setTimeout(function () {
- _this23.setopenStatus = false;
- }, 2000);
- },
-
- // ZH常开
- setNormallyOpenMethods: function setNormallyOpenMethods() {
- var _this24 = this;
-
- if (this.startHour > 24 || this.startHour < 0) {
- this.$message.error('请选择正确的开始时间段');
- return;
- } else if (this.endHour > 24 || this.endHour < 0) {
- this.$message.error('请选择正确的结束时间段');
- return;
- }
- if (this.formInline.manufactureId == 201 || this.formInline.manufactureId == 221) {
- if (this.opendTime[0] == '') {
- this.$message.error('请选择开始日期');
- return;
- }
- if (this.opendTime[1] == '') {
- this.$message.error('请选择结束日期');
- return;
- }
- if (this.startHour != '' && this.endHour == '') {
- this.$message.error('请选择结束时间段');
- return;
- }
- if (this.startHour == '' && this.endHour != '') {
- this.$message.error('请选择开始时间段');
- return;
- }
- var data = {
- code: "zg/longopen/operation",
- data: {
- order: 61101,
- opendDoorType: 1,
- roomName: this.formInline.roomName,
- lockerUserId: this.formInline.iotId,
- lockerId: this.formInline.deviceNum,
- startTime: moment_default()(this.opendTime[0]).format('YYYY-MM-DD HH:mm:ss'),
- endTime: moment_default()(this.opendTime[1]).format('YYYY-MM-DD HH:mm:ss'),
- openDoorSegmentList: [{
- startHour: this.startHour,
- endHour: this.endHour
- }]
- }
- };
- console.log(data);
- if (this.startHour == '' && this.endHour == '') {
- data.data.openDoorSegmentList = [];
- }
- Object(api["g" /* httpPost */])(data, this.$api.sendCommand).then(function (res2) {
- if (res2.success) {
- _this24.$message.success("设置成功");
- _this24.getAlwaysOpens();
- } else {
- _this24.$message.error(res2.msg);
- }
- });
- } else {
- this.$message.error('该类型锁不支持此设置!');
- }
- },
-
- // 常开设置
- switchFun: function switchFun(e) {
- var _this25 = this;
-
- if (this.formInline.manufactureId == 101) {
- var data = {};
- this.formInline.isAlwaysOpenStatus = e;
- if (e) {
- this.switchtext = "开";
- data = {
- code: "isp/alwaysOpenSetting",
- data: {
- imei: this.formInline.imei,
- deviceNum: this.formInline.deviceNum,
- operate: 1,
- roomName: this.formInline.roomName,
- order: 61101
- }
- };
- } else {
- this.switchtext = "关";
- data = {
- code: "isp/alwaysOpenSetting",
- data: {
- imei: this.formInline.imei,
- deviceNum: this.formInline.deviceNum,
- operate: 0,
- roomName: this.formInline.roomName,
- order: 61101
- }
- };
- }
- Object(api["g" /* httpPost */])(data, this.$api.sendCommand).then(function (res2) {
- if (res2.success) {
- _this25.$message.success("设置成功");
- _this25.getAlwaysOpens();
- } else {
- _this25.$message.error(res2.msg);
- }
- });
- } else if (this.formInline.manufactureId == 201 || this.formInline.manufactureId == 221) {
- // this.$message.success("该类型锁请通过蓝牙设置声音");
- }
- },
-
- // 关闭侧边栏
- handleClose: function handleClose() {
- this.drawer = false;
- },
-
- // tabs标签页切换
- handleClick: function handleClick(tab, event) {
- this.commpontentStatus = true;
- },
-
- //查看门锁详情
- detailsFun: function detailsFun(index, row) {
- this.drawer = true;
- if (row.isAlwaysOpen == 0) {
- row.isAlwaysOpenStatus = false;
- } else if (row.isAlwaysOpen == 1) {
- row.isAlwaysOpenStatus = true;
- }
- this.formInline = row;
- this.sendStatus = false;
- this.$nextTick(function () {
- this.sendroomId = row.deviceNum;
- this.senddeviceNum = row.deviceNum;
- this.sendDevice = row;
- this.sendStatus = true;
- this.quantityFun();
- this.quantityFunOne();
- this.getAlwaysOpens();
- // this.quantityFunThree()
- });
- },
- Reset1: function Reset1(index, row) {
- var data2 = {
- code: "isp/restoreSetting",
- data: {
- order: 6501,
- imei: row.imei,
- deviceNum: row.deviceNum,
- managerTelephone: "18270949468",
- managerPassword: "202108"
- }
- };
- Object(api["g" /* httpPost */])(data2, this.$api.sendCommand).then(function (res2) {
- // if (res2.data.success) {
- // this.$message.success("重置成功");
- // } else {
- // this.$message.error(res.msg);
- // }
- });
- },
-
- // 重置门锁
- Reset: function Reset(index, row) {
- var _this26 = this;
-
- this.$confirm("是否确认重置门锁?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(function () {
- if (row.manufactureId == 201 || row.manufactureId == 221) {
- var data3 = {
- code: "zg/deleteAllUsers",
- data: {
- lockerId: row.deviceNum,
- imei: row.imei,
- order: 6501,
- cardName: _this26.userInfo.username,
- roomName: row.roomName
- }
- };
- Object(api["g" /* httpPost */])(data3, _this26.$api.sendCommand).then(function (res) {
- if (res.success) {
- _this26.$message.success("重置成功");
- var q = {
- id: row.roomId
- };
- var tenant = {
- q: stringify_default()(q)
- };
- Object(api["d" /* httpGet */])(tenant, _this26.$api.getSiteTenant).then(function (res) {
- promise_default.a.all(res.data.list.map(function (element) {
- return new promise_default.a(function (resolve, reject) {
- resolve(element.cardId);
- });
- })).then(function (allId) {
- allId.map(function (li) {
- var str = [{
- siteId: row.roomId,
- cardId: li
- }];
- Object(api["g" /* httpPost */])(str, _this26.$api.unbindCard).then(function (res) {});
- });
- });
- });
- } else {
- _this26.$message.success(res.msg);
- }
- });
- } else if (row.manufactureId == 101) {
- var data2 = {
- code: "isp/restoreSetting",
- data: {
- order: 6501,
- imei: row.imei,
- deviceNum: row.deviceNum,
- managerTelephone: "18270949468",
- managerPassword: "202108",
- cardName: _this26.userInfo.username,
- roomName: row.roomName
- }
- };
- Object(api["g" /* httpPost */])(data2, _this26.$api.sendCommand).then(function (res2) {
- if (res2.success) {
- _this26.$message.success("重置成功");
- var q = {
- id: row.roomId
- };
- var tenant = {
- q: stringify_default()(q)
- };
- Object(api["d" /* httpGet */])(tenant, _this26.$api.getSiteTenant).then(function (res) {
- promise_default.a.all(res.data.list.map(function (element) {
- return new promise_default.a(function (resolve, reject) {
- resolve(element.cardId);
- });
- })).then(function (allId) {
- allId.map(function (li) {
- var str = [{
- siteId: row.roomId,
- cardId: li
- }];
- Object(api["g" /* httpPost */])(str, _this26.$api.unbindCard).then(function (res) {});
- });
- });
- });
- } else {
- _this26.$message.error(res2.msg);
- }
- });
- }
- });
- },
- activeiconfun: function activeiconfun(t) {
- this.activeiconfont = t;
- },
-
- // 查询设备电量和信号
- getresult: function getresult() {
- var data = {};
- },
-
- // 输入远程开锁密码确认
- Unlockingsave: function Unlockingsave() {},
-
- // 远程开锁
- RemoteUnlocking: function RemoteUnlocking(index, row) {
- var _this27 = this;
-
- var str2 = {
- imei: row.imei,
- openLockType: 2,
- is: true,
- roomName: row.roomName,
- roomId: row.roomId,
- cardName: this.userInfo.username
- };
- Object(api["g" /* httpPost */])(str2, this.$api.openLock).then(function (res3) {
- if (res3.success) {
- _this27.$message.success("开锁成功!");
- _this27.Unlocking = false;
- } else {
- _this27.$message.error("开锁失败!");
- }
- });
- },
-
- // 批量初始化
- batchInit: function batchInit() {
- var _this28 = this;
-
- if (this.multipleSelection.length == 0) {
- this.$message.error("请选择初始化设备");
- return;
- }
- this.$confirm("确定要批量初始化吗?", "提示", {
- type: "warning"
- }).then(function () {
- _this28.multipleSelection.map(function (row) {
- if (row.manufactureId == 101) {
- var str = {
- deviceNum: row.deviceNum,
- imei: row.imei,
- order: 6101
- };
- Object(api["g" /* httpPost */])(str, _this28.$api.getDeviceRegisterManager).then(function (res1) {
- if (res1.data.success) {
- var str1 = {
- imei: row.imei, //row.imsi,
- deviceNum: row.deviceNum, //row.deviceNum,
- operateMode: 7,
- is: true,
- order: 6207,
- pass: false,
- passwordStartTime: "20210813010101",
- passwordEndTime: "20680813010101"
- };
- Object(api["g" /* httpPost */])(str1, _this28.$api.getDeviceOperateUserInfo).then(function (res2) {});
- var str2 = {
- imei: row.imei, //row.imsi,
- deviceNum: row.deviceNum, //row.deviceNum,
- operateMode: 4,
- is: true,
- order: 6204,
- pass: false,
- passwordStartTime: "20210813010101",
- passwordEndTime: "20680813010101"
- };
- Object(api["g" /* httpPost */])(str2, _this28.$api.getDeviceOperateUserInfo).then(function (res3) {
- if (res3.success) {
- _this28.$message.success("初始化成功");
- }
- });
- } else {
- _this28.$message.error(res1.data.msg);
- }
- });
- }
- });
- });
- },
-
- // 重置添加管理员
- AddAdministrator: function AddAdministrator(index, row) {
- var _this29 = this;
-
- this.$confirm("确定要初始化吗?", "提示", {
- type: "warning"
- }).then(function () {
- var str = {
- deviceNum: row.deviceNum,
- imei: row.imei,
- order: 6101
- };
- Object(api["g" /* httpPost */])(str, _this29.$api.getDeviceRegisterManager).then(function (res1) {
- if (res1.data.success) {
- var str1 = {
- imei: row.imei, //row.imsi,
- deviceNum: row.deviceNum, //row.deviceNum,
- operateMode: 7,
- is: true,
- order: 6207,
- pass: false,
- passwordStartTime: "20210813010101",
- passwordEndTime: "20680813010101"
- };
- Object(api["g" /* httpPost */])(str1, _this29.$api.getDeviceOperateUserInfo).then(function (res2) {});
- var str2 = {
- imei: row.imei, //row.imsi,
- deviceNum: row.deviceNum, //row.deviceNum,
- operateMode: 4,
- is: true,
- order: 6204,
- pass: false,
- passwordStartTime: "20210813010101",
- passwordEndTime: "20680813010101"
- };
- Object(api["g" /* httpPost */])(str2, _this29.$api.getDeviceOperateUserInfo).then(function (res3) {
- if (res3.success) {
- _this29.$message.success("初始化成功");
- }
- });
- } else {
- _this29.$message.error(res1.data.msg);
- }
- });
- });
- },
-
- // 添加设备
- initialization: function initialization() {
- var _this30 = this;
-
- if (this.checkNodeId1 == '') {
- this.$message.error("请选择房间");
- } else {
- if (this.form.manufacturer == 101 || this.form.manufacturer == 1201) {
- if (this.form.deviceNum == "" || this.form.v == "" || this.form.platformId == "") {
- this.$message.error("请填写完整信息");
- } else {
- var data = {};
- var data = {
- deviceNum: this.form.deviceNum,
- imei: this.form.imei,
- imsi: this.form.imei, //row.imsi,
- order: 5101,
- enterpriseId: this.userInfo.enterpriseId,
- platformId: this.form.platformId,
- manufactureId: this.form.manufacturer
- };
- allFun["a" /* default */].RegisterDevice(data, function (callback) {
- if (callback.data.success && callback.success) {
- var data = [{
- siteId: _this30.checkNodeId1,
- deviceId: callback.data.id
- }];
- Object(api["g" /* httpPost */])(data, _this30.$api.bindDeviceSite).then(function (res) {
- if (res.success) {
- _this30.$message.success("绑定成功");
- _this30.editVisible = false;
- _this30.getdevice();
- }
- }).catch(function (error) {
- _this30.$message.error("\u7ED1\u5B9A\u5931\u8D25");
- });
- _this30.$message.success(res.data.msg);
- _this30.editVisible = false;
- _this30.getdevice();
- } else {
- _this30.$message.error(callback.data.msg);
- }
- });
- }
- } else if (this.form.manufacturer == 201 || this.form.manufacturer == 221) {
- var data = {
- lockerId: this.form.lockerId,
- imei: this.form.imei,
- customerCode: this.form.customerCode,
- lockerSuperAdminId: this.form.lockerSuperAdminId,
- authKey: this.form.authKey,
- type: this.form.type,
- manufactureId: this.form.manufacturer,
- enterpriseId: this.userInfo.enterpriseId,
- order: 5101
- };
- allFun["a" /* default */].RegisterDevice(data, function (callback) {
- if (callback.data.success && callback.success) {
- var data = [{
- siteId: _this30.checkNodeId1,
- deviceId: callback.data.id
- }];
- Object(api["g" /* httpPost */])(data, _this30.$api.bindDeviceSite).then(function (res) {
- if (res.success) {
- _this30.$message.success("绑定成功");
-
- _this30.editVisible = falsethis.editVisible = false;
- _this30.getdevice();
- }
- }).catch(function (error) {
- _this30.$message.error("\u7ED1\u5B9A\u5931\u8D25");
- });
- _this30.$message.success("添加成功");
- _this30.editVisible = false;
- _this30.getdevice();
- } else {
- _this30.$message.error(callback.data.msg);
- }
- });
- } else if (this.form.manufacturer == 701) {
- var data = {
- deviceNum: this.form.deviceNum,
- validateCode: this.form.validateCode,
- manufactureId: this.form.manufacturer,
- enterpriseId: this.userInfo.enterpriseId
- };
- allFun["a" /* default */].RegisterDevice(data, function (callback) {
- if (callback.data.success && callback.success) {
- var data = [{
- siteId: _this30.checkNodeId1,
- deviceId: callback.data.id
- }];
- Object(api["g" /* httpPost */])(data, _this30.$api.bindDeviceSite).then(function (res) {
- if (res.success) {
- _this30.$message.success("绑定成功");
- _this30.editVisible = false;
- _this30.getdevice();
- }
- }).catch(function (error) {
- _this30.$message.error("\u7ED1\u5B9A\u5931\u8D25");
- });
- _this30.$message.success("添加成功");
- _this30.editVisible = false;
- _this30.getdevice();
- } else {
- _this30.$message.error(callback.data.msg);
- }
- });
- }
- }
- },
-
- // 选择绑定房间
- onClick: function onClick(evt, treeId, treeNode) {
- // 点击事件
- this.treedata = treeNode;
- },
- // 获取绑定所有房间
- getalllist: function getalllist() {
- var _this31 = this;
-
- var data = {};
- Object(api["d" /* httpGet */])(data, this.$api.getTree).then(function (res) {
- var array = Object(utils["n" /* uniqueArray */])(res.data, "id");
- _this31.zNodes = Object(utils["p" /* ztreeToElementTree */])(array, {});
- });
- },
-
- // 获取设备
- getdevice: function getdevice() {
- var _this32 = this;
-
- var q = {
- isOnline: this.search.isOnline,
- roomName: this.search.roomname,
- roomIds: this.checkNodeId,
- startBattery: this.search.startBattery,
- endBattery: this.search.endBattery,
- lockType: 1,
- unBind: this.search.unBind,
- firmwareVersion: this.search.firmwareVersion,
- isUsed: this.search.isUsed,
- iccid: this.search.iccid,
- rssiStart: this.search.rssiStart,
- rssiEnd: this.search.rssiEnd,
- createStart: this.search.createStart,
- createEnd: this.search.createEnd,
- isAppBind: this.search.isAppBind
- };
- if (q.isOnline == 2) {
- delete q.isOnline;
- }
- var qObject = util["a" /* default */].validObject(q);
- var data = {
- q: stringify_default()(qObject),
- pageNum: 1,
- pageSize: 10
- };
- Object(api["g" /* httpPost */])(data, this.$api.getDeviceItems).then(function (res) {
- var online = 0,
- unonline = 0,
- devIds = "";
- res.data.list.map(function (li) {
- if (li.isOnline == 1) {
- online++;
- } else if (li.isOnline == 0) {
- unonline++;
- }
- var accessPlatform = _this32.accessPlatform.show.filter(function (item) {
- return item.code == li.accessPlatform;
- })[0];
- if (accessPlatform) {
- li['accessPlatformText'] = accessPlatform.desc;
- } else {
- li['accessPlatformText'] = '';
- }
- var deviceType = _this32.accessPlatform.deviceType.filter(function (item) {
- return item.code == li.manufactureId;
- })[0];
- if (deviceType) {
- li['manufactureIdText'] = deviceType.desc;
- } else {
- li['manufactureIdText'] = '';
- }
- li.createAt = moment_default()(li.createAt).format("YYYY-MM-DD HH:mm:ss");
- if (li.lastReportAt) {
- li.lastReportAt = moment_default()(li.lastReportAt).format("YYYY-MM-DD HH:mm:ss");
- } else {
- li['lastReportAt'] = '';
- }
- devIds += li.deviceNum + ",";
- });
- var newArr = Object(utils["n" /* uniqueArray */])(res.data.list, "id");
- _this32.tableData = newArr;
- _this32.currentPage4 = 1;
- _this32.pageTotal = res.data.total;
- });
- },
- timestampToTime: function timestampToTime(cjsj) {
- 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() + " ";
- var h = date.getHours() + ":";
- var m = date.getMinutes() + ":";
- var s = date.getSeconds();
- return Y + M + D + h + m + s;
- },
- handleChange: function handleChange(value) {
- console.log(value);
- },
- restSearch: function restSearch() {
- this.search = {
- name: "",
- deviceNum: "",
- roomname: '',
- imei: "",
- isOnline: "",
- unBind: '',
- startBattery: '',
- endBattery: '',
- firmwareVersion: '',
- operationStatus: ''
- };
- this.checkNodeId = '';
- this.searchRoom = '';
- this.handleSearch();
- },
-
- // 设备状态统计筛选
- screenStatisticsItemsMethods: function screenStatisticsItemsMethods(data) {
- var _this33 = this;
-
- Object(api["g" /* httpPost */])(data, this.$api.screenStatisticsItems).then(function (res) {
- if (res.code == 200) {
- var sumpageTotal = 0,
- online = 0,
- unonline = 0,
- abnormal = 0;
- res.data.map(function (li) {
- if (li.isAppBind == 1) {
- abnormal++;
- }
- if (li.isOnline == '0') {
- unonline++;
- }
- if (li.isOnline == '1') {
- online++;
- }
- });
- _this33.sumpageTotal = res.data.length;
- _this33.online = online;
- _this33.unonline = unonline;
- _this33.abnormal = abnormal;
- }
- });
- },
-
- // 触发搜索按钮
- handleSearch: function handleSearch() {
- var _this34 = this;
-
- var deviceNum = this.search.deviceNum.replace(/\s*/g, "");
- var imei = this.search.imei.replace(/\s*/g, "");
- if (this.search.isOnline == 2) {
- this.search.isAppBind = 1;
- } else {
- this.search.isAppBind = '';
- }
- var q = {
- deviceNum: deviceNum,
- imei: imei,
- isOnline: this.search.isOnline,
- roomName: this.search.roomname,
- roomIds: this.checkNodeId,
- startBattery: this.search.startBattery,
- endBattery: this.search.endBattery,
- lockType: 1,
- unBind: this.search.unBind,
- firmwareVersion: this.search.firmwareVersion,
- isUsed: this.search.isUsed,
- iccid: this.search.iccid,
- rssiStart: this.search.rssiStart,
- rssiEnd: this.search.rssiEnd,
- createStart: this.search.createStart,
- createEnd: this.search.createEnd,
- isAppBind: this.search.isAppBind
- };
- if (q.isOnline == 2) {
- delete q.isOnline;
- }
- var qObject = util["a" /* default */].validObject(q);
- var data = {
- q: stringify_default()(qObject),
- pageNum: 1,
- pageSize: this.pageSize
- };
- this.screenStatisticsItemsMethods(data);
- Object(api["g" /* httpPost */])(data, this.$api.getDeviceItems).then(function (res) {
- if (res.data.list.length > 0) {
- res.data.list.map(function (li) {
- var accessPlatform = _this34.accessPlatform.show.filter(function (item) {
- return item.code == li.accessPlatform;
- })[0];
- if (accessPlatform) {
- li['accessPlatformText'] = accessPlatform.desc;
- } else {
- li['accessPlatformText'] = '';
- }
- var deviceType = _this34.accessPlatform.deviceType.filter(function (item) {
- return item.code == li.manufactureId;
- })[0];
- if (deviceType) {
- li['manufactureIdText'] = deviceType.desc;
- } else {
- li['manufactureIdText'] = '';
- }
- li.createAt = moment_default()(li.createAt).format("YYYY-MM-DD HH:mm:ss");
- if (li.lastReportAt) {
- li.lastReportAt = moment_default()(li.lastReportAt).format("YYYY-MM-DD HH:mm:ss");
- } else {
- li['lastReportAt'] = '';
- }
- });
- var newArr = Object(utils["n" /* uniqueArray */])(res.data.list, "id");
- _this34.pageTotal = res.data.total;
- _this34.tableData = newArr;
- } else {
- _this34.tableData = [];
- _this34.pageTotal = 0;
- }
- _this34.currentPage4 = 1;
- _this34.$store.commit("increment", 1);
- });
- // this.$set(this.query, "pageIndex", 1);
- },
-
- // 删除操作
- handleDelete: function handleDelete(index) {
- var _this35 = this;
-
- // 二次确认删除
- this.$confirm("确定要删除吗?", "提示", {
- type: "warning"
- }).then(function () {
- _this35.$message.success("删除成功");
- _this35.tableData.splice(index, 1);
- }).catch(function () {});
- },
-
- // 多选操作
- handleSelectionChange: function handleSelectionChange(val) {
- this.multipleSelection = val;
- },
-
- // 批量远程开锁
- batchRemoteUnlocking: function batchRemoteUnlocking() {
- var _this36 = this;
-
- this.$confirm("确定要批量远程开锁吗?", "提示", {
- type: "warning"
- }).then(function () {
- _this36.multipleSelection.map(function (li) {
- if (li.manufactureId == 101) {
- var str2 = {
- imei: li.imei,
- openLockType: 2,
- is: true,
- roomName: li.roomName,
- roomId: li.roomId,
- cardName: _this36.userInfo.username
- };
- Object(api["g" /* httpPost */])(str2, _this36.$api.openLock).then(function (res3) {
- if (res3.success) {
- _this36.$message.success("开锁成功!");
- } else {
- _this36.$message.error("开锁失败!");
- }
- });
- }
- });
- });
- },
- delAllSelection: function delAllSelection() {
- var length = this.multipleSelection.length;
- var str = "";
- this.delList = this.delList.concat(this.multipleSelection);
- for (var i = 0; i < length; i++) {
- str += this.multipleSelection[i].name + " ";
- }
- this.$message.error("\u5220\u9664\u4E86" + str);
- this.multipleSelection = [];
- },
-
- // 删除设备
- deleteLock: function deleteLock(index, row) {
- var _this37 = this;
-
- this.$confirm("确定要删除吗?", "提示", {
- type: "warning"
- }).then(function () {
- // if (row.manufactureId == 101) {
- if (row.roomId) {
- var q = {
- id: row.roomId
- };
- var tenant = {
- q: stringify_default()(q)
- };
- Object(api["d" /* httpGet */])(tenant, _this37.$api.getSiteTenant).then(function (res) {
- promise_default.a.all(res.data.list.map(function (element) {
- return new promise_default.a(function (resolve, reject) {
- resolve(element.cardId);
- });
- })).then(function (allId) {
- var str = [];
- allId.map(function (li) {
- var obj = {
- siteId: row.roomId,
- cardId: li
- };
- str.push(obj);
- });
- if (str.length > 0) {
- Object(api["g" /* httpPost */])(str, _this37.$api.unbindCard).then(function (res) {});
- }
- var data1 = [{
- siteId: row.roomId,
- deviceId: row.id
- }];
- Object(api["g" /* httpPost */])(data1, _this37.$api.unbindDeviceSite).then(function (res) {
- if (res.success) {
- _this37.$message.success("解绑成功");
- var data = {
- deviceNum: row.deviceNum,
- imei: row.imei,
- order: 5102
- };
- allFun["a" /* default */].DeleteDevic(data, row.manufactureId, function (callback) {
- if (callback.success) {
- _this37.getdevice();
- _this37.$message.success('删除成功');
- } else {
- _this37.getdevice();
- _this37.$message.error(callback.msg);
- }
- });
- } else {
- _this37.getdevice();
- _this37.$message.error("\u89E3\u7ED1\u5931\u8D25");
- }
- });
- });
- });
- } else {
- var data = {
- deviceNum: row.deviceNum,
- imei: row.imei,
- order: 5102
- };
- allFun["a" /* default */].DeleteDevic(data, row.manufactureId, function (callback) {
- if (callback.success) {
- _this37.$message.success("删除成功");
- _this37.getdevice();
- } else {
- _this37.getdevice();
- _this37.$message.error(callback.msg);
- }
- });
- }
- }).catch(function (err) {
- _this37.getdevice();
- _this37.$message.error(err.msg);
- });
- },
-
- // 绑定房间
- bindRoom: function bindRoom(index, row) {
- this.bromm = row;
- this.roomVisible = true;
- this.$refs.tree.setCheckedKeys([]);
- },
-
- // 确定绑定
- bindsave: function bindsave() {
- var _this38 = this;
-
- var treedata = this.treedata;
- this.roomVisible = false;
- var data = [{
- siteId: treedata.id,
- deviceId: this.bromm.id
- }];
- Object(api["g" /* httpPost */])(data, this.$api.bindDeviceSite).then(function (res) {
- if (res.success) {
- _this38.$message.success("绑定成功");
- _this38.getdevice();
- }
- }).catch(function (error) {
- _this38.$message.error("\u7ED1\u5B9A\u5931\u8D25");
- });
- },
- unbindsave: function unbindsave(index, row) {
- var _this39 = this;
-
- var data = [{
- siteId: row.roomId,
- deviceId: row.id
- }];
- var q = {
- id: row.roomId
- };
- var tenant = {
- q: stringify_default()(q)
- };
- // 二次确认解绑
- this.$confirm("确定要解绑吗?", "提示", {
- type: "warning"
- }).then(function () {
- // this.Reset(index, row)
- Object(api["d" /* httpGet */])(tenant, _this39.$api.getSiteTenant).then(function (res) {
- promise_default.a.all(res.data.list.map(function (element) {
- return new promise_default.a(function (resolve, reject) {
- resolve(element.cardId);
- });
- })).then(function (allId) {
- allId.map(function (li) {
- var str = [{
- siteId: row.roomId,
- cardId: li
- }];
- Object(api["g" /* httpPost */])(str, _this39.$api.unbindCard).then(function (res) {});
- });
- Object(api["g" /* httpPost */])(data, _this39.$api.unbindDeviceSite).then(function (res) {
- if (res.success) {
- _this39.$message.success("解绑成功");
- _this39.getdevice();
- } else {
- _this39.$message.error("\u89E3\u7ED1\u5931\u8D25");
- }
- });
- });
- });
- }).catch(function () {});
- },
- addequipment: function addequipment() {
- this.form.customerCode = this.$store.state.customerCode;
- this.editVisible = true;
- },
-
- // 编辑操作
- handleEdit: function handleEdit(index, row) {
- this.idx = index;
- this.form = row;
- this.editVisible = true;
- },
-
- // 保存编辑
- saveEdit: function saveEdit() {
- this.editVisible = false;
- },
- handleSizeChange: function handleSizeChange(val) {
- console.log("\u6BCF\u9875 " + val + " \u6761");
- this.$router.replace({
- path: this.$route.path,
- query: {
- page: this.$route.query.page ? this.$route.query.page : 1,
- pageSize: val
- }
- });
- this.pageSize = val;
- this.getlistNum(0, val);
- },
- getlistNum: function getlistNum(val, size) {
- var _this40 = this;
-
- var deviceNum = this.search.deviceNum.replace(/\s*/g, "");
- var imei = this.search.imei.replace(/\s*/g, "");
- var q = {
- deviceNum: deviceNum,
- imei: imei,
- isOnline: this.search.isOnline,
- roomName: this.search.roomname,
- roomIds: this.checkNodeId,
- startBattery: this.search.startBattery,
- endBattery: this.search.endBattery,
- lockType: 1,
- unBind: this.search.unBind,
- firmwareVersion: this.search.firmwareVersion,
- isUsed: this.search.isUsed,
- iccid: this.search.iccid,
- rssiStart: this.search.rssiStart,
- rssiEnd: this.search.rssiEnd,
- createStart: this.search.createStart,
- createEnd: this.search.createEnd,
- isAppBind: this.search.isAppBind
- };
- if (q.isOnline == 2) {
- delete q.isOnline;
- }
- var qObject = util["a" /* default */].validObject(q);
- var data = {
- q: stringify_default()(qObject),
- pageNum: val,
- pageSize: size
- };
- Object(api["g" /* httpPost */])(data, this.$api.getDeviceItems).then(function (res) {
- res.data.list.map(function (li) {
- var accessPlatform = _this40.accessPlatform.show.filter(function (item) {
- return item.code == li.accessPlatform;
- })[0];
- if (accessPlatform) {
- li['accessPlatformText'] = accessPlatform.desc;
- } else {
- li['accessPlatformText'] = '';
- }
- var deviceType = _this40.accessPlatform.deviceType.filter(function (item) {
- return item.code == li.manufactureId;
- })[0];
- if (deviceType) {
- li['manufactureIdText'] = deviceType.desc;
- } else {
- li['manufactureIdText'] = '';
- }
- li.createAt = moment_default()(li.createAt).format("YYYY-MM-DD HH:mm:ss");
- if (li.lastReportAt) {
- li.lastReportAt = moment_default()(li.lastReportAt).format("YYYY-MM-DD HH:mm:ss");
- } else {
- li['lastReportAt'] = '';
- }
- });
- var newArr = Object(utils["n" /* uniqueArray */])(res.data.list, "id");
- _this40.tableData = newArr;
- _this40.pageTotal = res.data.total;
- });
- },
-
- // 分页导航
- handlePageChange: function handlePageChange(val) {
- var _this41 = this;
-
- // this.$router.replace({
- // path: this.$route.path,
- // query: {
- // page: this.$route.query.page ? this.$route.query.page : 1,
- // pageSize: val,
- // },
- // });
- this.pageNum = val;
- this.$store.commit("increment", val);
- var q = {
- deviceNum: this.search.deviceNum,
- imei: this.search.imei,
- isOnline: this.search.isOnline,
- roomName: this.search.roomname,
- roomIds: this.checkNodeId,
- startBattery: this.search.startBattery,
- endBattery: this.search.endBattery,
- lockType: 1,
- unBind: this.search.unBind,
- firmwareVersion: this.search.firmwareVersion,
- isUsed: this.search.isUsed,
- iccid: this.search.iccid,
- rssiStart: this.search.rssiStart,
- rssiEnd: this.search.rssiEnd,
- createStart: this.search.createStart,
- createEnd: this.search.createEnd,
- isAppBind: this.search.isAppBind
- };
- if (q.isOnline == 2) {
- delete q.isOnline;
- }
- var qObject = util["a" /* default */].validObject(q);
- var data = {
- q: stringify_default()(qObject),
- pageNum: val,
- pageSize: this.pageSize
- };
- Object(api["g" /* httpPost */])(data, this.$api.getDeviceItems).then(function (res) {
- res.data.list.map(function (li) {
- var accessPlatform = _this41.accessPlatform.show.filter(function (item) {
- return item.code == li.accessPlatform;
- })[0];
- if (accessPlatform) {
- li['accessPlatformText'] = accessPlatform.desc;
- } else {
- li['accessPlatformText'] = '';
- }
- var deviceType = _this41.accessPlatform.deviceType.filter(function (item) {
- return item.code == li.manufactureId;
- })[0];
- if (deviceType) {
- li['manufactureIdText'] = deviceType.desc;
- } else {
- li['manufactureIdText'] = '';
- }
- li.createAt = moment_default()(li.createAt).format("YYYY-MM-DD HH:mm:ss");
- if (li.createAt) {}
- if (li.lastReportAt) {
- li.lastReportAt = moment_default()(li.lastReportAt).format("YYYY-MM-DD HH:mm:ss");
- } else {
- li['lastReportAt'] = '';
- }
- });
- var newArr = Object(utils["n" /* uniqueArray */])(res.data.list, "id");
- _this41.tableData = newArr;
- _this41.pageTotal = res.data.total;
- });
- },
- btnClick: function btnClick() {
- document.querySelector(".input-file").click();
- },
- exportBtn: function exportBtn() {
- this.exportExcel();
- },
- exportExcel: function exportExcel() {
- var sheet1data = [['设备号', 'mac地址', 'sn', 'imei', 'app绑定号', '生产写入号']];
- var sheet1 = xlsx_default.a.utils.json_to_sheet(sheet1data, {
- skipHeader: true
- });
- // 创建一个新的空的workbook
- var wb = xlsx_default.a.utils.book_new();
- xlsx_default.a.utils.book_append_sheet(wb, sheet1, '设备导入模板');
- // XLSX.utils.book_append_sheet(wb, sheet2, '行政部')
- // XLSX.utils.book_append_sheet(wb, sheet3, '前端部')
- var workbookBlob = this.workbook2blob(wb);
- this.openDownloadDialog(workbookBlob, '设备导入模板.xlsx');
- },
-
- // 下载模板
- workbook2blob: function workbook2blob(workbook) {
- // 生成excel的配置项
- var wopts = {
- // 要生成的文件类型
- bookType: 'xlsx',
- // // 是否生成Shared String Table,官方解释是,如果开启生成速度会下降,但在低版本IOS设备上有更好的兼容性
- bookSST: false,
- type: 'binary'
- };
- var wbout = xlsx_default.a.write(workbook, wopts);
- // 将字符串转ArrayBuffer
- function s2ab(s) {
- var buf = new ArrayBuffer(s.length);
- var view = new Uint8Array(buf);
- for (var i = 0; i !== s.length; ++i) {
- view[i] = s.charCodeAt(i) & 0xff;
- }return buf;
- }
- var buf = s2ab(wbout);
- var blob = new Blob([buf], {
- type: 'application/octet-stream'
- });
- return blob;
- },
-
- // 将blob对象 创建bloburl,然后用a标签实现弹出下载框
- openDownloadDialog: function openDownloadDialog(blob, fileName) {
- if ((typeof blob === "undefined" ? "undefined" : typeof_default()(blob)) === 'object' && blob instanceof Blob) {
- blob = URL.createObjectURL(blob); // 创建blob地址
- }
- var aLink = document.createElement('a');
- aLink.href = blob;
- // HTML5新增的属性,指定保存文件名,可以不要后缀,注意,有时候 file:///模式下不会生效
- aLink.download = fileName || '';
- var event;
- if (window.MouseEvent) event = new MouseEvent('click');
- // 移动端
- else {
- event = document.createEvent('MouseEvents');
- event.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
- }
- aLink.dispatchEvent(event);
- },
- exportData: function exportData(event) {
- if (!event.currentTarget.files.length) {
- return;
- }
- var that = this;
- // 拿取文件对象
- var f = event.currentTarget.files[0];
- // 用FileReader来读取
- var reader = new FileReader();
- // 重写FileReader上的readAsBinaryString方法
- FileReader.prototype.readAsBinaryString = function (f) {
- var binary = "";
- var wb; // 读取完成的数据
- var outdata; // 你需要的数据
- var reader = new FileReader();
- reader.onload = function (e) {
- // 读取成Uint8Array,再转换为Unicode编码(Unicode占两个字节)
- var bytes = new Uint8Array(reader.result);
- var length = bytes.byteLength;
- for (var i = 0; i < length; i++) {
- binary += String.fromCharCode(bytes[i]);
- }
- // 接下来就是xlsx了,具体可看api
- wb = xlsx_default.a.read(binary, {
- type: "binary"
- });
- outdata = xlsx_default.a.utils.sheet_to_json(wb.Sheets[wb.SheetNames[0]]);
- // 自定义方法向父组件传递数据
- var arr1 = [];
- outdata.map(function (li, index) {
- var str = {};
- str.deviceNum = li["设备号"];
- str.mac = li["mac地址"];
- str.imei = li["imei"];
- str.app = li["app绑定号"];
- str.write = li["生产写入号"];
- arr1.push(str);
- });
- // this.tableData=arr
- that.userlist1statu = false;
- that.$nextTick(function () {
- that.userlist2 = arr1;
- that.userlist1statu = true;
- });
- };
- reader.readAsArrayBuffer(f);
- };
- reader.readAsBinaryString(f);
- }
- }
- });
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/template-compiler?{"id":"data-v-7e17d244","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/doorLock.vue
- var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{on:{"click":function($event){_vm.contentSearchShow=false}}},[_c('el-row',{staticClass:"elrow",attrs:{"gutter":20}},[_c('el-col',{attrs:{"span":24}},[_c('el-card',{attrs:{"shadow":"hover"}},[_c('el-row',[_c('el-col',{attrs:{"span":_vm.colNum_6}},[_c('div',{staticClass:"grid-content grid-con-2"},[_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":_vm.colNum_6}},[_c('div',{staticClass:"grid-content grid-con-2"},[_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.analysisData.bingSite))])])])])]),_vm._v(" "),_c('el-col',{attrs:{"span":_vm.colNum_6}},[_c('div',{staticClass:"grid-content grid-con-2"},[_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.analysisData.isAlwaysOpen))])])])])]),_vm._v(" "),_c('el-col',{attrs:{"span":_vm.colNum_6}},[_c('div',{staticClass:"grid-content grid-con-2"},[_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("0")])])])])]),_vm._v(" "),_c('el-col',{attrs:{"span":_vm.colNum_6}},[_c('div',{staticClass:"grid-content grid-con-2"},[_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("0")])])])])]),_vm._v(" "),_c('el-col',{attrs:{"span":_vm.colNum_6}},[_c('div',{staticClass:"grid-content grid-con-2"},[_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("0")])])])])]),_vm._v(" "),_c('el-col',{attrs:{"span":_vm.colNum_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":_vm.colNum_6}},[_c('div',{staticClass:"grid-content grid-con-2"},[_c('div',{staticClass:"colposition"},[_c('img',{staticClass:"w100",attrs:{"src":__webpack_require__("sNnU"),"alt":""}}),_vm._v(" "),_c('div',{staticClass:"grid-cont-right"},[_c('div',[_vm._v("异常状态")]),_vm._v(" "),_c('div',{staticClass:"grid-num"},[_vm._v(_vm._s(_vm.abnormal))])])])])])],1)],1)],1)],1),_vm._v(" "),_c('div',{staticClass:"container"},[_c('div',{staticClass:"handle-box"},[_c('selectoption'),_vm._v(" "),_c('el-cascader',{attrs:{"options":_vm.options,"size":"small","props":{ checkStrictly: true },"clearable":true},on:{"change":_vm.checkNode},model:{value:(_vm.searchRoom),callback:function ($$v) {_vm.searchRoom=$$v},expression:"searchRoom"}}),_vm._v(" "),_c('el-input',{staticClass:"handle-input mr10 width100",attrs:{"size":"small","placeholder":"房间名称","clearable":true},on:{"input":function($event){return _vm.changesr($event)}},model:{value:(_vm.search.roomname),callback:fun
- ? 'success'
- : scope.row.isOnline == '0'
- ? 'danger'
- : ''}},[(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:{"prop":"lastReportAt","label":"上线时间","width":"160"}}),_vm._v(" "),_c('el-table-column',{attrs:{"label":"操作","width":"500","align":"center"},scopedSlots:_vm._u([{key:"default",fn:function(scope){return [(scope.row.roomId)?_c('el-button',{staticClass:"red",attrs:{"type":"text"},on:{"click":function($event){return _vm.unbindsave(scope.$index, scope.row)}}},[_vm._v("解绑房间\n ")]):_c('el-button',{attrs:{"type":"text"},on:{"click":function($event){return _vm.bindRoom(scope.$index, scope.row)}}},[_vm._v("绑定房间")]),_vm._v(" "),_c('el-button',{attrs:{"type":"text"},on:{"click":function($event){return _vm.detailsFun(scope.$index, scope.row)}}},[_vm._v("门锁操作")]),_vm._v(" "),(scope.row.manufactureId==101 && _vm.userInfo.type == 0)?_c('el-button',{attrs:{"type":"text"},on:{"click":function($event){return _vm.AddAdministrator(scope.$index, scope.row)}}},[_vm._v("初始化\n ")]):_vm._e(),_vm._v(" "),_c('el-button',{directives:[{name:"show",rawName:"v-show",value:(_vm.userInfo.type == 0),expression:"userInfo.type == 0"}],staticClass:"red",attrs:{"type":"text"},on:{"click":function($event){return _vm.deleteLock(scope.$index, scope.row)}}},[_vm._v("\n 删除")]),_vm._v(" "),_c('el-button',{staticClass:"red",attrs:{"type":"text"},on:{"click":function($event){return _vm.getEmergence(scope.$index, scope.row)}}},[_vm._v("临时密码\n ")]),_vm._v(" "),(scope.row.manufactureId==101)?_c('el-button',{attrs:{"type":"text"},on:{"click":function($event){return _vm.RemoteUnlocking(scope.$index, scope.row)}}},[_vm._v("远程开锁 ")]):_vm._e(),_vm._v(" "),_c('el-button',{attrs:{"type":"text"},on:{"click":function($event){return _vm.Reset(scope.$index, scope.row)}}},[_vm._v("重置门锁")])]}}])})],1),_vm._v(" "),_c('div',{staticClass:"pagination"},[_c('el-pagination',{attrs:{"current-page":_vm.$store.state.currentPage,"page-sizes":[10,20,100],"page-size":_vm.pageSize,"layout":_vm.paginationConfig,"total":_vm.pageTotal},on:{"size-change":_vm.handleSizeChange,"current-change":_vm.handlePageChange}})],1)],1),_vm._v(" "),_c('el-dialog',{attrs:{"title":"绑定房间","visible":_vm.roomVisible,"width":"30%"},on:{"update:visible":function($event){_vm.roomVisible=$event}},scopedSlots:_vm._u([{key:"footer",fn:function(){return [_c('span',{staticClass:"dialog-footer"},[_c('el-button',{on:{"click":function($event){_vm.roomVisible = false}}},[_vm._v("取 消")]),_vm._v(" "),_c('el-button',{attrs:{"type":"primary"},on:{"click":_vm.bindsave}},[_vm._v("确 定")])],1)]},proxy:true}])},[_c('div',{staticClass:"ztree"},[_c('el-tree',{ref:"tree",attrs:{"data":_vm.zNodes,"show-checkbox":"","node-key":"id","props":_vm.defaultProps},on:{"check-change":_vm.handleCheckChange}})],1)]),_vm._v(" "),_c('el-dialog',{attrs:{"title":"远程开锁密码","visible":_vm.Unlocking,"width":"30%"},on:{"update:visible":function($event){_vm.Unlocking=$event}},scopedSlots:_vm._u([{key:"footer",fn:function(){return [_c('span',{staticClass:"dialog-footer"},[_c('el-button',{attrs:{"size":"middle"},on:{"click":function($event){_vm.Unlocking = false}}},[_vm._v("取 消")]),_vm._v(" "),_c('el-button',{attrs:{"type":"primary","size":"middle"},on:{"click":_vm.Unlockingsave}},[_vm._v("确 定")])],1)]},proxy:true}])},[_c('div',[_c('el-form',{ref:"locking",attrs:{"model":_vm.lockingform,"label-width":"100px"}},[_c('el-form-item',{attrs:{"label":"管理员密码"}},[_c('el-input',{attrs:{"show-passwor
- var staticRenderFns = []
- var esExports = { render: render, staticRenderFns: staticRenderFns }
- /* harmony default export */ var views_doorLock = (esExports);
- // CONCATENATED MODULE: ./src/views/doorLock.vue
- function injectStyle (ssrContext) {
- __webpack_require__("xEQD")
- }
- 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-7e17d244"
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = normalizeComponent(
- doorLock,
- views_doorLock,
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
-
- /* harmony default export */ var src_views_doorLock = __webpack_exports__["default"] = (Component.exports);
-
-
- /***/ }),
-
- /***/ "nDyz":
- /***/ (function(module, exports) {
-
- module.exports = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/PjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+PHN2ZyB0PSIxNjc3NzIyNjA2Mzk5IiBjbGFzcz0iaWNvbiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHAtaWQ9IjEwMzQxIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgd2lkdGg9IjEyOCIgaGVpZ2h0PSIxMjgiPjxwYXRoIGQ9Ik01MTIuMyA5OC4yYy0yMjkuMiAwLTQxNSAxODUuOC00MTUgNDE1czE4NS44IDQxNSA0MTUgNDE1IDQxNS0xODUuOCA0MTUtNDE1LTE4NS44LTQxNS00MTUtNDE1eiBtMjI3LjEgNDMzLjVjLTUuOSA5LTE2LjEgMTQuOS0yNy43IDE0LjlIMzc5LjFsODYuNyA4Ni43YzEwLjkgMTAuOSAxMC45IDI4LjYgMCAzOS41LTEwLjkgMTAuOS0yOC42IDEwLjktMzkuNSAwTDI4Ni40IDUzM2MtMTAuOS0xMC45LTEwLjktMjguNiAwLTM5LjVsMTM5LjgtMTM5LjhjMTAuOS0xMC45IDI4LjYtMTAuOSAzOS41IDAgNS41IDUuNSA4LjIgMTIuNiA4LjIgMTkuOCAwIDcuMi0yLjcgMTQuMy04LjIgMTkuOEwzNzkgNDgwaDMzMi42YzExLjYgMCAyMS43IDUuOSAyNy43IDE0LjkgNC4zIDQuOSA3IDExLjQgNyAxOC41IDAgNy0yLjYgMTMuNC02LjkgMTguM3oiIGZpbGw9IiM1OWFkZjciIHAtaWQ9IjEwMzQyIj48L3BhdGg+PC9zdmc+"
-
- /***/ }),
-
- /***/ "xEQD":
- /***/ (function(module, exports) {
-
- // removed by extract-text-webpack-plugin
-
- /***/ })
-
- });
|