webpackJsonp([38],{
|
|
|
|
/***/ "2cpK":
|
|
/***/ (function(module, exports) {
|
|
|
|
// removed by extract-text-webpack-plugin
|
|
|
|
/***/ }),
|
|
|
|
/***/ "4SPr":
|
|
/***/ (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/allDevice.vue
|
|
|
|
|
|
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* harmony default export */ var allDevice = ({
|
|
inject: ['reload'],
|
|
name: "allDevice",
|
|
data: function data() {
|
|
return {
|
|
contentSearchShow: false,
|
|
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: '',
|
|
lockType: ''
|
|
},
|
|
tableData: [],
|
|
multipleSelection: [],
|
|
delList: [],
|
|
roomVisible: false,
|
|
pageTotal: 0,
|
|
sumpageTotal: 0,
|
|
currentPage4: 1,
|
|
form: {
|
|
manufacturer: "",
|
|
validateCode: ''
|
|
},
|
|
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: ''
|
|
};
|
|
},
|
|
|
|
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() {
|
|
this.manufacturerList = this.$MANUFACTURER.DEVICETYPE;
|
|
var queryData = this.$route.params;
|
|
if (queryData.isOnline) {
|
|
this.search.isOnline = queryData.isOnline;
|
|
}
|
|
if (queryData.lockType) {
|
|
this.search.lockType = queryData.lockType;
|
|
}
|
|
if (queryData.startBattery) {
|
|
this.search.startBattery = queryData.startBattery;
|
|
} else {
|
|
this.search.startBattery = 0;
|
|
}
|
|
if (queryData.endBattery) {
|
|
this.search.endBattery = queryData.endBattery;
|
|
} else {
|
|
this.search.endBattery = 100;
|
|
}
|
|
this.userInfo = JSON.parse(localStorage.getItem('info'));
|
|
this.getdevice();
|
|
this.getalllist();
|
|
this.info = JSON.parse(localStorage.getItem("info"));
|
|
this.$store.commit("increment", 1);
|
|
// this.getcard()
|
|
this.getallTree();
|
|
},
|
|
|
|
methods: {
|
|
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();
|
|
},
|
|
|
|
// 同步刷新
|
|
refreshFun: function refreshFun() {
|
|
Object(api["d" /* httpGet */])("", this.$api.lockDeviceInfoList).then(function (res) {});
|
|
},
|
|
|
|
// 选择房源
|
|
checkNode: function checkNode(e) {
|
|
this.checkNodeId = e;
|
|
var options = this.options;
|
|
var arr = this.getId(options, e[e.length - 1]);
|
|
var obj = this.getNodeId(arr);
|
|
this.checkNodeId = obj;
|
|
},
|
|
checkNodeOne: function checkNodeOne(e) {
|
|
this.checkNodeId1 = e[e.length - 1];
|
|
this.checkRoomDevice(e[e.length - 1]);
|
|
},
|
|
checkRoomDevice: function checkRoomDevice(id) {
|
|
var _this = this;
|
|
|
|
var q = {
|
|
roomIds: [id],
|
|
lockType: this.search.lockType
|
|
};
|
|
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) {
|
|
_this.$message.error("该房间已绑定锁,请重新选择");
|
|
_this.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 _this2 = 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 arrdata = Object(utils["o" /* uniqueArray1 */])(res.data, "id");
|
|
_this2.options = Object(utils["p" /* ztreeToElementTree */])(arrdata, {});
|
|
});
|
|
},
|
|
|
|
// 获取设备概况
|
|
getcard: function getcard() {
|
|
var _this3 = this;
|
|
|
|
allFun["a" /* default */].getAnalysis("", -1, function (callback) {
|
|
_this3.sumpageTotal = callback.total;
|
|
_this3.online = callback.onlineTotal;
|
|
_this3.unonline = callback.offlineTotal;
|
|
_this3.abnormal = callback.isAppBind;
|
|
});
|
|
},
|
|
handleCheckChange: function handleCheckChange(data, checked, node) {
|
|
if (checked) {
|
|
this.treedata = data;
|
|
} else {
|
|
if (this.checkedId == data.id) {
|
|
this.$refs.tree.setCheckedKeys([data.id]);
|
|
}
|
|
}
|
|
},
|
|
|
|
// input视图刷新
|
|
changesr: function changesr(e) {
|
|
this.$forceUpdate();
|
|
},
|
|
|
|
// 关闭侧边栏
|
|
handleClose: function handleClose() {
|
|
this.drawer = false;
|
|
},
|
|
|
|
// tabs标签页切换
|
|
handleClick: function handleClick(tab, event) {
|
|
this.commpontentStatus = true;
|
|
},
|
|
|
|
//查看门锁详情
|
|
detailsFun: function detailsFun(index, row) {
|
|
this.drawer = true;
|
|
this.formInline = row;
|
|
this.sendStatus = false;
|
|
this.$nextTick(function () {
|
|
this.sendroomId = row.deviceNum;
|
|
this.senddeviceNum = row.deviceNum;
|
|
this.sendDevice = row;
|
|
this.sendStatus = true;
|
|
});
|
|
},
|
|
activeiconfun: function activeiconfun(t) {
|
|
this.activeiconfont = t;
|
|
},
|
|
|
|
// 重置添加管理员
|
|
AddAdministrator: function AddAdministrator(index, row) {
|
|
var _this4 = this;
|
|
|
|
this.$confirm("确定要初始化吗?", "提示", {
|
|
type: "warning"
|
|
}).then(function () {
|
|
var str = {
|
|
deviceNum: row.deviceNum,
|
|
imei: row.imei,
|
|
order: 6101
|
|
};
|
|
Object(api["g" /* httpPost */])(str, _this4.$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, _this4.$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, _this4.$api.getDeviceOperateUserInfo).then(function (res3) {
|
|
if (res3.success) {
|
|
_this4.$message.success("初始化成功");
|
|
}
|
|
});
|
|
});
|
|
});
|
|
},
|
|
|
|
// 选择绑定房间
|
|
onClick: function onClick(evt, treeId, treeNode) {
|
|
// 点击事件
|
|
this.treedata = treeNode;
|
|
},
|
|
// 获取绑定所有房间
|
|
getalllist: function getalllist() {
|
|
var _this5 = this;
|
|
|
|
var data = {};
|
|
Object(api["d" /* httpGet */])(data, this.$api.getTree).then(function (res) {
|
|
var array = Object(utils["n" /* uniqueArray */])(res.data, "id");
|
|
_this5.zNodes = Object(utils["p" /* ztreeToElementTree */])(array, {});
|
|
});
|
|
},
|
|
|
|
// 获取设备
|
|
getdevice: function getdevice() {
|
|
var _this6 = this;
|
|
|
|
var isAppBind = '';
|
|
if (this.search.isOnline == '2') {
|
|
isAppBind = 1;
|
|
} else {
|
|
isAppBind = '';
|
|
}
|
|
var q = {
|
|
lockType: this.search.lockType,
|
|
isOnline: this.search.isOnline,
|
|
startBattery: this.search.startBattery,
|
|
endBattery: this.search.endBattery,
|
|
isAppBind: isAppBind,
|
|
isUsed: this.search.isUsed
|
|
};
|
|
if (q.isOnline == 2) {
|
|
delete q.isOnline;
|
|
}
|
|
var data = {
|
|
q: stringify_default()(q),
|
|
pageNum: 1,
|
|
pageSize: 10
|
|
};
|
|
this.screenStatisticsItemsMethods(data);
|
|
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++;
|
|
}
|
|
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");
|
|
_this6.tableData = newArr;
|
|
_this6.currentPage4 = 1;
|
|
_this6.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: ''
|
|
};
|
|
this.searchRoom = '';
|
|
this.checkNodeId = '';
|
|
this.handleSearch();
|
|
},
|
|
|
|
// 设备状态统计筛选
|
|
screenStatisticsItemsMethods: function screenStatisticsItemsMethods(data) {
|
|
var _this7 = 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++;
|
|
}
|
|
});
|
|
_this7.sumpageTotal = res.data.length;
|
|
_this7.online = online;
|
|
_this7.unonline = unonline;
|
|
_this7.abnormal = abnormal;
|
|
}
|
|
});
|
|
},
|
|
|
|
// 触发搜索按钮
|
|
handleSearch: function handleSearch() {
|
|
var _this8 = this;
|
|
|
|
var deviceNum = this.search.deviceNum.replace(/\s*/g, "");
|
|
var imei = this.search.imei.replace(/\s*/g, "");
|
|
console.log(this.search);
|
|
if (this.search.isOnline == '2') {
|
|
this.search.isAppBind = 1;
|
|
} else {
|
|
this.search.isAppBind = '';
|
|
}
|
|
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: this.search.lockType,
|
|
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 data = {
|
|
q: stringify_default()(q),
|
|
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) {
|
|
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");
|
|
_this8.pageTotal = res.data.total;
|
|
_this8.tableData = newArr;
|
|
} else {
|
|
_this8.tableData = [];
|
|
_this8.pageTotal = 0;
|
|
}
|
|
_this8.currentPage4 = 1;
|
|
_this8.$store.commit("increment", 1);
|
|
});
|
|
// this.$set(this.query, "pageIndex", 1);
|
|
},
|
|
|
|
// 删除操作
|
|
handleDelete: function handleDelete(index) {
|
|
var _this9 = this;
|
|
|
|
// 二次确认删除
|
|
this.$confirm("确定要删除吗?", "提示", {
|
|
type: "warning"
|
|
}).then(function () {
|
|
_this9.$message.success("删除成功");
|
|
_this9.tableData.splice(index, 1);
|
|
}).catch(function () {});
|
|
},
|
|
|
|
// 多选操作
|
|
handleSelectionChange: function handleSelectionChange(val) {
|
|
this.multipleSelection = val;
|
|
},
|
|
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 _this10 = this;
|
|
|
|
this.$confirm("确定要删除吗?", "提示", {
|
|
type: "warning"
|
|
}).then(function () {
|
|
// if (row.manufactureId == 101) {
|
|
if (row.roomId) {
|
|
var data = [{
|
|
siteId: row.roomId,
|
|
deviceId: row.id
|
|
}];
|
|
Object(api["g" /* httpPost */])(data, _this10.$api.unbindDeviceSite).then(function (res) {
|
|
if (res.success) {
|
|
var data = {
|
|
device: row.deviceNum,
|
|
imei: row.imei,
|
|
order: 5102
|
|
};
|
|
allFun["a" /* default */].DeleteDevic(data, row.manufactureId).then(function (res) {
|
|
if (res.success) {
|
|
_this10.getdevice();
|
|
_this10.$message.success('删除成功');
|
|
} else {
|
|
_this10.$message.error(res.msg);
|
|
}
|
|
});
|
|
}
|
|
}).catch(function (error) {
|
|
_this10.$message.error("\u89E3\u7ED1\u5931\u8D25");
|
|
});
|
|
} else {
|
|
var data = {
|
|
deviceNum: row.deviceNum,
|
|
imei: row.imei,
|
|
order: 5102
|
|
};
|
|
allFun["a" /* default */].DeleteDevic(data, row.manufactureId).then(function (res) {
|
|
if (res.success) {
|
|
_this10.$message.success("删除成功");
|
|
_this10.getdevice();
|
|
} else {
|
|
_this10.$message.error(res.msg);
|
|
}
|
|
});
|
|
}
|
|
}).catch(function () {});
|
|
},
|
|
|
|
// 绑定房间
|
|
bindRoom: function bindRoom(index, row) {
|
|
this.bromm = row;
|
|
this.roomVisible = true;
|
|
this.$refs.tree.setCheckedKeys([]);
|
|
},
|
|
|
|
// 确定绑定
|
|
bindsave: function bindsave() {
|
|
var _this11 = 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) {
|
|
_this11.$message.success("绑定成功");
|
|
_this11.getdevice();
|
|
}
|
|
}).catch(function (error) {
|
|
_this11.$message.error("\u7ED1\u5B9A\u5931\u8D25");
|
|
});
|
|
},
|
|
unbindsave: function unbindsave(index, row) {
|
|
var _this12 = 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 () {
|
|
Object(api["d" /* httpGet */])(tenant, _this12.$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.card);
|
|
});
|
|
})).then(function (allId) {
|
|
allId.map(function (li) {
|
|
var str = [{
|
|
siteId: row.roomId,
|
|
cardId: li
|
|
}];
|
|
Object(api["g" /* httpPost */])(str, _this12.$api.unbindCard).then(function (res) {});
|
|
});
|
|
Object(api["g" /* httpPost */])(data, _this12.$api.unbindDeviceSite).then(function (res) {
|
|
if (res.success) {
|
|
_this12.$message.success("解绑成功");
|
|
_this12.getdevice();
|
|
} else {
|
|
_this12.$message.error("\u89E3\u7ED1\u5931\u8D25");
|
|
}
|
|
});
|
|
});
|
|
});
|
|
}).catch(function () {});
|
|
},
|
|
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 _this13 = this;
|
|
|
|
var deviceNum = this.search.deviceNum.replace(/\s*/g, "");
|
|
var imei = this.search.imei.replace(/\s*/g, "");
|
|
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: this.search.lockType,
|
|
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 data = {
|
|
q: stringify_default()(q),
|
|
pageNum: val,
|
|
pageSize: size
|
|
};
|
|
Object(api["g" /* httpPost */])(data, this.$api.getDeviceItems).then(function (res) {
|
|
res.data.list.map(function (li) {
|
|
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");
|
|
_this13.tableData = newArr;
|
|
_this13.pageTotal = res.data.total;
|
|
});
|
|
},
|
|
|
|
// 分页导航
|
|
handlePageChange: function handlePageChange(val) {
|
|
var _this14 = 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: this.search.lockType,
|
|
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 data = {
|
|
q: stringify_default()(q),
|
|
pageNum: val,
|
|
pageSize: this.pageSize
|
|
};
|
|
Object(api["g" /* httpPost */])(data, this.$api.getDeviceItems).then(function (res) {
|
|
res.data.list.map(function (li) {
|
|
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");
|
|
_this14.tableData = newArr;
|
|
_this14.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-cd70f15a","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/allDevice.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":6}},[_c('div',{staticClass:"grid-content grid-con-1"},[_c('div',{staticClass:"colposition"},[_c('img',{staticClass:"w100",attrs:{"src":__webpack_require__("xXHN"),"alt":""}}),_vm._v(" "),_c('div',{staticClass:"grid-cont-right"},[_c('div',[_vm._v("设备总数")]),_vm._v(" "),_c('div',{staticClass:"grid-num"},[_vm._v(_vm._s(_vm.sumpageTotal))])])])])]),_vm._v(" "),_c('el-col',{attrs:{"span":6}},[_c('div',{staticClass:"grid-content grid-con-2"},[_c('div',{staticClass:"colposition"},[_c('img',{staticClass:"w100",attrs:{"src":__webpack_require__("sFbI"),"alt":""}}),_vm._v(" "),_c('div',{staticClass:"grid-cont-right"},[_c('div',[_vm._v("在线状态")]),_vm._v(" "),_c('div',{staticClass:"grid-num"},[_vm._v(_vm._s(_vm.online))])])])])]),_vm._v(" "),_c('el-col',{attrs:{"span":6}},[_c('div',{staticClass:"grid-content grid-con-2"},[_c('div',{staticClass:"colposition"},[_c('img',{staticClass:"w100",attrs:{"src":__webpack_require__("BpHi"),"alt":""}}),_vm._v(" "),_c('div',{staticClass:"grid-cont-right"},[_c('div',[_vm._v("离线状态")]),_vm._v(" "),_c('div',{staticClass:"grid-num"},[_vm._v(_vm._s(_vm.unonline))])])])])]),_vm._v(" "),_c('el-col',{attrs:{"span":6}},[_c('div',{staticClass:"grid-content grid-con-2"},[_c('div',{staticClass:"colposition"},[_c('img',{staticClass:"w100",attrs:{"src":__webpack_require__("sNnU"),"alt":""}}),_vm._v(" "),_c('div',{staticClass:"grid-cont-right"},[_c('div',[_vm._v("异常状态")]),_vm._v(" "),_c('div',{staticClass:"grid-num"},[_vm._v(_vm._s(_vm.abnormal))])])])])])],1)],1)],1)],1),_vm._v(" "),_c('div',{staticClass:"container"},[_c('div',{staticClass:"handle-box"},[_c('selectoption'),_vm._v(" "),_c('el-cascader',{attrs:{"options":_vm.options,"size":"small","props":{ checkStrictly: true },"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:function ($$v) {_vm.$set(_vm.search, "roomname", $$v)},expression:"search.roomname"}}),_vm._v(" "),_c('el-select',{staticClass:"handle-select mr10",attrs:{"size":"small","placeholder":"在线状态","clearable":true},model:{value:(_vm.search.isOnline),callback:function ($$v) {_vm.$set(_vm.search, "isOnline", $$v)},expression:"search.isOnline"}},[_c('el-option',{key:"1",attrs:{"label":"离线","value":"0"}}),_vm._v(" "),_c('el-option',{key:"2",attrs:{"label":"在线","value":"1"}}),_vm._v(" "),_c('el-option',{key:"3",attrs:{"label":"异常","value":"2"}})],1),_vm._v(" "),_c('el-button',{staticClass:"mr10",attrs:{"type":"primary","size":"small","icon":"el-icon-search"},on:{"click":_vm.handleSearch}},[_vm._v("搜索")]),_vm._v(" "),_c('el-button',{staticClass:"mr10",attrs:{"type":"primary","size":"small"},on:{"click":_vm.restSearch}},[_vm._v("重置搜索")]),_vm._v(" "),_c('div',{staticClass:"position-father",on:{"click":function($event){$event.stopPropagation();_vm.contentSearchShow=true}}},[_c('div',{staticClass:"el-button mountClickObject el-button--primary mr10 el-button--small",on:{"click":function($event){$event.stopPropagation();_vm.contentSearchShow=!_vm.contentSearchShow}}},[_vm._v("\n 高级查询")]),_vm._v(" "),(_vm.contentSearchShow)?_c('div',{staticClass:"contentSearch",attrs:{"id":"contentSearch"},on:{"click":function($event){$event.stopPropagation();_vm.contentSearchShow=true}}},[_c('el-input',{staticClass:"handle-input width100",attrs:{"size":"small","placeholder":"序列号","clearable":true},on:{"input":function($event){return _vm.changesr($event)}},model:{value:(_vm.search.deviceNum),callback:function ($$v) {_vm.$set(_vm.search, "deviceNum", $$v)},expression:"search.deviceNum"}}),_vm._v(" "),_c('el-input',{staticClass:"handle-input width100",attrs:{"size":"small","placeholder":"IMEI","clearable":true},on:{"input":function($event){return _vm.changesr($event)}},model:{value:(_vm.search.imei),callback:function ($$v) {_vm.$set(_vm.search, "imei", $$v)},expression:"search.imei"}}),_vm._v(" "),_c('el-select',{staticClass:"width100",attrs:{"size":"small","placeholder":"请选择","clearable":true},model:{value:(_vm.search.isUsed),callback:function ($$v) {_vm.$set(_vm.search, "isUsed", $$v)},expression:"search.isUsed"}},[_c('el-option',{key:"",attrs:{"label":"全部","value":""}}),_vm._v(" "),_c('el-option',{key:"0",attrs:{"label":"未初始化","value":"0"}}),_vm._v(" "),_c('el-option',{key:"1",attrs:{"label":"初始化","value":"1"}})],1),_vm._v(" "),_c('el-select',{staticClass:"handle-select width100",attrs:{"size":"small","placeholder":"绑定状态","clearable":true},model:{value:(_vm.search.unBind),callback:function ($$v) {_vm.$set(_vm.search, "unBind", $$v)},expression:"search.unBind"}},[_c('el-option',{key:"0",attrs:{"label":"已绑定","value":"0"}}),_vm._v(" "),_c('el-option',{key:"1",attrs:{"label":"未绑定","value":"1"}})],1),_vm._v(" "),_c('el-input',{staticClass:"handle-input width100",attrs:{"size":"small","placeholder":"ICCID","clearable":true},on:{"input":function($event){return _vm.changesr($event)}},model:{value:(_vm.search.iccid),callback:function ($$v) {_vm.$set(_vm.search, "iccid", $$v)},expression:"search.iccid"}}),_vm._v(" "),_c('el-input',{staticClass:"handle-input width100",attrs:{"size":"small","placeholder":"版本号","clearable":true},on:{"input":function($event){return _vm.changesr($event)}},model:{value:(_vm.search.firmwareVersion),callback:function ($$v) {_vm.$set(_vm.search, "firmwareVersion", $$v)},expression:"search.firmwareVersion"}}),_vm._v(" "),_c('el-date-picker',{staticClass:"width100",attrs:{"size":"small","type":"datetime","placeholder":"选设备上线开始时间","default-time":"00:00:00"},model:{value:(_vm.search.createStart),callback:function ($$v) {_vm.$set(_vm.search, "createStart", $$v)},expression:"search.createStart"}}),_vm._v(" "),_c('el-date-picker',{staticClass:"width100",attrs:{"size":"small","type":"datetime","placeholder":"选择结束时间","default-time":"00:00:00"},model:{value:(_vm.search.createEnd),callback:function ($$v) {_vm.$set(_vm.search, "createEnd", $$v)},expression:"search.createEnd"}}),_vm._v(" "),_c('div',{staticClass:"quantity width100"},[_vm._v("\n 电量: "),_c('el-input',{staticClass:"w50",attrs:{"placeholder":"","clearable":true,"size":"mini"},on:{"input":function($event){return _vm.InputFun($event,'startBattery')}},model:{value:(_vm.search.startBattery),callback:function ($$v) {_vm.$set(_vm.search, "startBattery", $$v)},expression:"search.startBattery"}},[_c('template',{slot:"append"},[_vm._v("%")])],2),_vm._v(" - "),_c('el-input',{staticClass:"w50",attrs:{"placeholder":"","clearable":true,"size":"mini"},on:{"input":function($event){return _vm.InputFun($event,'endBattery')}},model:{value:(_vm.search.endBattery),callback:function ($$v) {_vm.$set(_vm.search, "endBattery", $$v)},expression:"search.endBattery"}},[_c('template',{slot:"append"},[_vm._v("%")])],2)],1),_vm._v(" "),_c('div',{staticClass:"quantity width100"},[_vm._v("\n 信号: "),_c('el-input',{staticClass:"w50",attrs:{"placeholder":"","clearable":true,"size":"mini"},on:{"input":function($event){return _vm.InputFun($event,'rssiStart')}},model:{value:(_vm.search.rssiStart),callback:function ($$v) {_vm.$set(_vm.search, "rssiStart", $$v)},expression:"search.rssiStart"}},[_c('template',{slot:"append"},[_vm._v("%")])],2),_vm._v(" - "),_c('el-input',{staticClass:"w50",attrs:{"placeholder":"","clearable":true,"size":"mini"},on:{"input":function($event){return _vm.InputFun($event,'rssiEnd')}},model:{value:(_vm.search.rssiEnd),callback:function ($$v) {_vm.$set(_vm.search, "rssiEnd", $$v)},expression:"search.rssiEnd"}},[_c('template',{slot:"append"},[_vm._v("%")])],2)],1),_vm._v(" "),_c('div',{staticClass:"searchbutton"},[_c('el-button',{attrs:{"type":"primary","size":"small"},on:{"click":function($event){$event.stopPropagation();return _vm.handleSearch.apply(null, arguments)}}},[_vm._v("高级搜索")]),_vm._v(" "),_c('el-button',{attrs:{"type":"primary","size":"small"},on:{"click":function($event){$event.stopPropagation();return _vm.restSearch.apply(null, arguments)}}},[_vm._v("重置搜索")])],1)],1):_vm._e()]),_vm._v(" "),_c('el-button',{directives:[{name:"show",rawName:"v-show",value:(_vm.info.type == 0),expression:"info.type == 0"}],attrs:{"type":"primary","size":"small"},on:{"click":_vm.refreshFun}},[_vm._v("同步设备信息")])],1),_vm._v(" "),_c('div',{staticClass:"switchiconfont"},[_c('i',{staticClass:"iconfont httpicon-liebiao1",class:_vm.activeiconfont ? 'active' : '',attrs:{"title":"切换方块展示"},on:{"click":function($event){return _vm.activeiconfun(true)}}}),_vm._v(" "),_c('i',{staticClass:"iconfont httpicon-liebiao",class:_vm.activeiconfont ? '' : 'active',attrs:{"title":"切换表格展示"},on:{"click":function($event){return _vm.activeiconfun(false)}}})]),_vm._v(" "),(_vm.activeiconfont)?_c('div',{staticClass:"roomcontent"},_vm._l((_vm.tableData),function(item,index){return _c('div',{key:index,staticClass:"roomconli"},[_c('deviceLi',{attrs:{"data":item,"src":_vm.deviceImg}}),_vm._v(" "),_c('div',{staticClass:"button-list"},[(item.roomId ? true : false)?_c('div',{on:{"click":function($event){return _vm.unbindsave(index, item)}}},[_vm._v("\n 解绑房间\n ")]):_c('div',{on:{"click":function($event){return _vm.bindRoom(index, item)}}},[_vm._v("绑定房间")]),_vm._v(" "),_c('div',{on:{"click":function($event){return _vm.detailsFun(index, item)}}},[_vm._v("设备详情")]),_vm._v(" "),_c('div',{on:{"click":function($event){return _vm.deleteLock(index, item)}}},[_vm._v("删除")])])],1)}),0):_c('el-table',{ref:"multipleTable",staticClass:"table",attrs:{"data":_vm.tableData,"border":"","stripe":"","header-cell-class-name":"table-header","empty-text":"无"},on:{"selection-change":_vm.handleSelectionChange}},[_c('el-table-column',{attrs:{"prop":"deviceNum","label":"设备号","width":"200"}}),_vm._v(" "),_c('el-table-column',{attrs:{"label":"锁平台"},scopedSlots:_vm._u([{key:"default",fn:function(scope){return [(scope.row.accessPlatform == 0)?_c('span',{},[_vm._v("锁平台")]):_vm._e(),_vm._v(" "),(scope.row.accessPlatform == 1)?_c('span',{},[_vm._v("电信")]):_vm._e(),_vm._v(" "),(scope.row.accessPlatform == 2)?_c('span',{},[_vm._v("移动")]):_vm._e(),_vm._v(" "),(scope.row.accessPlatform == 3)?_c('span',{},[_vm._v("联通")]):_vm._e(),_vm._v(" "),(scope.row.accessPlatform == 4)?_c('span',{},[_vm._v("ZH电信")]):_vm._e(),_vm._v(" "),(scope.row.accessPlatform == 5)?_c('span',{},[_vm._v("ZH移动")]):_vm._e(),_vm._v(" "),(scope.row.accessPlatform == 6)?_c('span',{},[_vm._v("ZHWIFI")]):_vm._e()]}}])}),_vm._v(" "),_c('el-table-column',{attrs:{"prop":"imei","label":"IMEI","width":"150"},scopedSlots:_vm._u([{key:"default",fn:function(scope){return [(scope.row.imei)?_c('span',{},[_vm._v(_vm._s(scope.row.imei))]):_c('span',{},[_vm._v("空")])]}}])}),_vm._v(" "),_c('el-table-column',{attrs:{"prop":"imsi","label":"IMSI","width":"150"},scopedSlots:_vm._u([{key:"default",fn:function(scope){return [(scope.row.imsi)?_c('span',{},[_vm._v(_vm._s(scope.row.imsi))]):_c('span',{},[_vm._v("空")])]}}])}),_vm._v(" "),_c('el-table-column',{attrs:{"prop":"","label":"信号强度","width":"150"},scopedSlots:_vm._u([{key:"default",fn:function(scope){return [(scope.row.rssi <= 10)?_c('i',{staticClass:"iconfont httpicon-xinhao38 red"}):(10 < scope.row.rssi && scope.row.rssi < 20)?_c('i',{staticClass:"iconfont httpicon-xinhao38 orange"}):(20 <= scope.row.rssi && scope.row.rssi <= 100)?_c('i',{staticClass:"iconfont httpicon-xinhao38 green"}):_c('i',{staticClass:"iconfont httpicon-wuxinhao red"}),_c('span',{staticClass:"spanli dling"},[_vm._v("\n "+_vm._s(scope.row.rssi || 0))])]}}])}),_vm._v(" "),_c('el-table-column',{attrs:{"label":"电量"},scopedSlots:_vm._u([{key:"default",fn:function(scope){return [(scope.row.battery <= 20)?_c('i',{staticClass:"iconfont httpicon-dianchi-didianliang red"}):(20 < scope.row.battery && scope.row.battery < 60)?_c('i',{staticClass:"iconfont httpicon-icon-test orange"}):(60 <= scope.row.battery && scope.row.battery <= 100)?_c('i',{staticClass:"iconfont httpicon-icon-test green"}):_c('i',{staticClass:"iconfont httpicon-icon-test red"}),_c('span',{staticClass:"spanli dling"},[_vm._v(" "+_vm._s(scope.row.battery || 0)+"%")])]}}])}),_vm._v(" "),_c('el-table-column',{attrs:{"label":"在线状态","align":"center"},scopedSlots:_vm._u([{key:"default",fn:function(scope){return [_c('el-tag',{attrs:{"type":scope.row.isOnline == '1'
|
|
? '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":"门的状态"},scopedSlots:_vm._u([{key:"default",fn:function(scope){return [(scope.row.lockStatus == 0)?_c('i',{staticClass:"iconfont httpicon-men"}):_vm._e(),_vm._v(" "),(scope.row.lockStatus == 1)?_c('i',{staticClass:"iconfont httpicon-mendoor13"}):_vm._e(),_vm._v(" "),(scope.row.lockStatus == 2)?_c('i',{staticClass:"iconfont httpicon-men",staticStyle:{"color":"red"}}):_vm._e()]}}])}),_vm._v(" "),_c('el-table-column',{attrs:{"label":"绑定房间","width":"200"},scopedSlots:_vm._u([{key:"default",fn:function(scope){return [(scope.row.roomName)?_c('span',{staticClass:"blue"},[_vm._v(_vm._s(scope.row.roomName))]):_c('span',{},[_vm._v("空")])]}}])}),_vm._v(" "),_c('el-table-column',{attrs:{"prop":"firmwareVersion","label":"版本","width":"160"}}),_vm._v(" "),_c('el-table-column',{attrs:{"prop":"createAt","label":"创建时间","width":"160"}}),_vm._v(" "),_c('el-table-column',{attrs:{"label":"操作","width":"400","align":"center","fixed":"right"},scopedSlots:_vm._u([{key:"default",fn:function(scope){return [(scope.row.roomId)?_c('el-button',{staticClass:"red",attrs:{"type":"text"},on:{"click":function($event){return _vm.unbindsave(scope.$index, scope.row)}}},[_vm._v("解绑房间\n ")]):_c('el-button',{attrs:{"type":"text"},on:{"click":function($event){return _vm.bindRoom(scope.$index, scope.row)}}},[_vm._v("绑定房间")]),_vm._v(" "),_c('el-button',{attrs:{"type":"text"},on:{"click":function($event){return _vm.detailsFun(scope.$index, scope.row)}}},[_vm._v("设备详情")])]}}])})],1),_vm._v(" "),_c('div',{staticClass:"pagination"},[_c('el-pagination',{attrs:{"current-page":_vm.$store.state.currentPage,"page-sizes":[10,20,100],"page-size":_vm.pageSize,"layout":"total, sizes, prev, pager, next, jumper","total":_vm.pageTotal},on:{"size-change":_vm.handleSizeChange,"current-change":_vm.handlePageChange}})],1)],1),_vm._v(" "),_c('el-dialog',{attrs:{"title":"绑定房间","visible":_vm.roomVisible,"width":"30%"},on:{"update:visible":function($event){_vm.roomVisible=$event}},scopedSlots:_vm._u([{key:"footer",fn:function(){return [_c('span',{staticClass:"dialog-footer"},[_c('el-button',{on:{"click":function($event){_vm.roomVisible = false}}},[_vm._v("取 消")]),_vm._v(" "),_c('el-button',{attrs:{"type":"primary"},on:{"click":_vm.bindsave}},[_vm._v("确 定")])],1)]},proxy:true}])},[_c('div',{staticClass:"ztree"},[_c('el-tree',{ref:"tree",attrs:{"data":_vm.zNodes,"show-checkbox":"","node-key":"id","props":_vm.defaultProps},on:{"check-change":_vm.handleCheckChange}})],1)]),_vm._v(" "),_c('el-drawer',{attrs:{"title":"设备详情","visible":_vm.drawer,"custom-class":"operationclass","size":"50%","before-close":_vm.handleClose},on:{"update:visible":function($event){_vm.drawer=$event}}},[_c('div',{staticClass:"rltable"},[_c('el-tabs',{attrs:{"border":""},on:{"tab-click":_vm.handleClick},model:{value:(_vm.activeName),callback:function ($$v) {_vm.activeName=$$v},expression:"activeName"}},[_c('el-tab-pane',{attrs:{"label":"门锁详情","name":"0"}},[_c('el-form',{staticClass:"demo-form-inline",attrs:{"inline":true,"model":_vm.formInline}},[_c('el-form-item',{attrs:{"label":"设备号:"}},[_c('span',{staticClass:"half"},[_vm._v(_vm._s(_vm.formInline.deviceNum))])]),_vm._v(" "),_c('el-form-item',{attrs:{"label":"IMEI:"}},[_c('span',{staticClass:"half"},[_vm._v(_vm._s(_vm.formInline.imei))])]),_vm._v(" "),_c('el-form-item',{attrs:{"label":"IMSI:"}},[_c('span',{staticClass:"half"},[_vm._v(_vm._s(_vm.formInline.imsi))])]),_vm._v(" "),_c('el-form-item',{attrs:{"label":"信号强度:"}},[_c('span',{staticClass:"half"},[_vm._v(_vm._s(_vm.formInline.rssi))])]),_vm._v(" "),_c('el-form-item',{attrs:{"label":"电池电量:"}},[_c('span',{staticClass:"half"},[_vm._v(_vm._s(_vm.formInline.battery))])]),_vm._v(" "),_c('el-form-item',{attrs:{"label":"在线状态:"}},[(_vm.formInline.isOnline == 1)?_c('span',{staticClass:"half"},[_vm._v("在线")]):_c('span',{staticClass:"half"},[_vm._v("离线")])]),_vm._v(" "),_c('el-form-item',{attrs:{"label":"绑定房间:"}},[_c('span',{staticClass:"half"},[_vm._v(_vm._s(_vm.formInline.roomName))])]),_vm._v(" "),_c('el-form-item',{attrs:{"label":"注册时间:"}},[_c('span',{staticClass:"half"},[_vm._v(_vm._s(_vm.formInline.createAt))])]),_vm._v(" "),_c('el-form-item',{attrs:{"label":"上线时间:"}},[_c('span',{staticClass:"half"},[_vm._v(_vm._s(_vm.formInline.lastReportAt))])])],1)],1)],1)],1)])],1)}
|
|
var staticRenderFns = []
|
|
var esExports = { render: render, staticRenderFns: staticRenderFns }
|
|
/* harmony default export */ var views_allDevice = (esExports);
|
|
// CONCATENATED MODULE: ./src/views/allDevice.vue
|
|
function injectStyle (ssrContext) {
|
|
__webpack_require__("2cpK")
|
|
}
|
|
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-cd70f15a"
|
|
/* moduleIdentifier (server only) */
|
|
var __vue_module_identifier__ = null
|
|
var Component = normalizeComponent(
|
|
allDevice,
|
|
views_allDevice,
|
|
__vue_template_functional__,
|
|
__vue_styles__,
|
|
__vue_scopeId__,
|
|
__vue_module_identifier__
|
|
)
|
|
|
|
/* harmony default export */ var src_views_allDevice = __webpack_exports__["default"] = (Component.exports);
|
|
|
|
|
|
/***/ })
|
|
|
|
});
|