Commit 4ddb678a by wuwx

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

1 parent 567d07b0
...@@ -273,13 +273,29 @@ export default { ...@@ -273,13 +273,29 @@ export default {
// 离线率 // 离线率
let n = []; let n = [];
// console.log('obj.offlineRate', this.accSub(100, obj.offlineRate));
n.push({ value: 100 - obj.offlineRate, name: "" }); n.push({ value: 100 - obj.offlineRate, name: "" });
n.push({ value: obj.offlineRate, name: "" }); n.push({ value: obj.offlineRate, name: "" });
this.createBindChart("offlineChart", n); 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() { getAlarm() {
GET_HOME_ALARMNUMBER().then((res) => { GET_HOME_ALARMNUMBER().then((res) => {
......
...@@ -35,6 +35,7 @@ export default { ...@@ -35,6 +35,7 @@ export default {
activeTabs: "1", activeTabs: "1",
userId: "", userId: "",
randomKey: "", randomKey: "",
monitorFlags: false
}; };
}, },
watch: { watch: {
...@@ -62,6 +63,7 @@ export default { ...@@ -62,6 +63,7 @@ export default {
return false; return false;
} }
this.$refs.importVehicleCom.saveInfo(); this.$refs.importVehicleCom.saveInfo();
this.monitorFlags = this.$refs.importVehicleCom.monitorFlag;
}, },
}, },
}; };
......
...@@ -67,6 +67,7 @@ export default { ...@@ -67,6 +67,7 @@ export default {
uploadResult: {}, uploadResult: {},
acceptFile: ".xlsx,.xls", acceptFile: ".xlsx,.xls",
fileList: [], fileList: [],
monitorFlag: false
}; };
}, },
mounted() { mounted() {
...@@ -97,6 +98,7 @@ export default { ...@@ -97,6 +98,7 @@ export default {
// 文件上传前 // 文件上传前
beforeUpload() { beforeUpload() {
this.uploadResult = {}; this.uploadResult = {};
this.monitorFlag = false;
}, },
// 文件上传失败 // 文件上传失败
...@@ -107,6 +109,7 @@ export default { ...@@ -107,6 +109,7 @@ export default {
// 监听文件上传成功 // 监听文件上传成功
onSuccess(response, file, fileList) { onSuccess(response, file, fileList) {
console.log(response); console.log(response);
this.monitorFlag = true;
let _this = this; let _this = this;
broadcast("cancel-loading"); broadcast("cancel-loading");
_this.$refs.uploadBox.clearFiles(); _this.$refs.uploadBox.clearFiles();
...@@ -131,7 +134,6 @@ export default { ...@@ -131,7 +134,6 @@ export default {
showToast({ showToast({
message: "请选择文件", message: "请选择文件",
}); });
console.log("7777777777777");
broadcast("cancel-loading"); broadcast("cancel-loading");
return false; return false;
} }
......
...@@ -737,6 +737,9 @@ export default { ...@@ -737,6 +737,9 @@ export default {
saveInfo() { saveInfo() {
this.loading = true; this.loading = true;
this.$refs.assignInfo.saveInfo(); 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!