Commit 4ddb678a by wuwx

线上问题修复-用户管理导入数据

1 parent 567d07b0
......@@ -273,13 +273,29 @@ export default {
// 离线率
let n = [];
// console.log('obj.offlineRate', this.accSub(100, obj.offlineRate));
n.push({ value: 100 - obj.offlineRate, name: "" });
n.push({ value: obj.offlineRate, name: "" });
this.createBindChart("offlineChart", n);
});
},
accSub(arg1, arg2) {
let r1, r2, m, n
try {
r1 = arg1.toString().split('.')[1].length
} catch (e) {
r1 = 0
}
try {
r2 = arg2.toString().split('.')[1].length
} catch (e) {
r2 = 0
}
m = Math.pow(10, Math.max(r1, r2))
n = r1 >= r2 ? r1 : r2
return ((arg1 * m - arg2 * m) / m).toFixed(n)
},
// 获取警情统计
getAlarm() {
GET_HOME_ALARMNUMBER().then((res) => {
......
......@@ -35,6 +35,7 @@ export default {
activeTabs: "1",
userId: "",
randomKey: "",
monitorFlags: false
};
},
watch: {
......@@ -62,6 +63,7 @@ export default {
return false;
}
this.$refs.importVehicleCom.saveInfo();
this.monitorFlags = this.$refs.importVehicleCom.monitorFlag;
},
},
};
......
......@@ -67,6 +67,7 @@ export default {
uploadResult: {},
acceptFile: ".xlsx,.xls",
fileList: [],
monitorFlag: false
};
},
mounted() {
......@@ -97,6 +98,7 @@ export default {
// 文件上传前
beforeUpload() {
this.uploadResult = {};
this.monitorFlag = false;
},
// 文件上传失败
......@@ -107,6 +109,7 @@ export default {
// 监听文件上传成功
onSuccess(response, file, fileList) {
console.log(response);
this.monitorFlag = true;
let _this = this;
broadcast("cancel-loading");
_this.$refs.uploadBox.clearFiles();
......@@ -131,7 +134,6 @@ export default {
showToast({
message: "请选择文件",
});
console.log("7777777777777");
broadcast("cancel-loading");
return false;
}
......
......@@ -737,6 +737,9 @@ export default {
saveInfo() {
this.loading = true;
this.$refs.assignInfo.saveInfo();
if(this.$refs.assignInfo.monitorFlags) {
this.loading = false;
}
},
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!