Commit 10e08f65 by 前端

Merge branch 'develop' into 'master'

Develop

See merge request !40
2 parents 567d07b0 0626e9f7
...@@ -2,9 +2,25 @@ ...@@ -2,9 +2,25 @@
width: 100%; width: 100%;
height: 100px; height: 100px;
} }
.c_canvass {
width: 100px;
height: 134px;
}
.static_list_box { .static_list_box {
display: flex; display: flex;
align-items: center; align-items: center;
position: relative;
.mask {
position: absolute;
width: 100%;
height: 234px;
background-color: #fbfbfb;
top: 0;
z-index: 2;
display: flex;
align-items: center;
justify-content: center;
}
.cell_box { .cell_box {
flex: 1; flex: 1;
margin: 0 10px 0 0; margin: 0 10px 0 0;
...@@ -42,6 +58,17 @@ ...@@ -42,6 +58,17 @@
padding: 10px 0; padding: 10px 0;
border-top: 2px solid #eee; border-top: 2px solid #eee;
font-size: 13px; font-size: 13px;
display: flex;
.footer-box {
flex: 1;
}
}
.equipment_box {
display: flex;
.equipment_boxs {
display: flex;
flex: 1;
}
} }
} }
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<!-- 数据列表 开始 --> <!-- 数据列表 开始 -->
<div class="static_list_box"> <div class="static_list_box">
<div class="mask" v-show="maskFlag"><i class="el-icon-loading" style="font-size: 20px;"></i>loading...</div>
<!-- 总绑定数 开始 --> <!-- 总绑定数 开始 -->
<div class="cell_box"> <div class="cell_box">
<!-- 表头 开始 --> <!-- 表头 开始 -->
...@@ -58,82 +58,104 @@ ...@@ -58,82 +58,104 @@
</div> </div>
<!-- 总激活数 end --> <!-- 总激活数 end -->
<!-- 设备在线数 开始 --> <!-- 设备数 开始 -->
<div class="cell_box"> <div class="cell_box" style="flex: 2;">
<!-- 表头 开始 --> <!-- 表头 开始 -->
<div class="head"> <div class="head">
<span>设备在线数</span> <span>设备数</span>
<el-tooltip class="item" effect="dark" placement="right-start">
<div slot="content">
<p>在线数 = 有线设备在线数 + 无线设备在线数</p>
<p>有线设备在线数:</p>
<p>
统计该账号权限下,在统计当日所有设备在线率情况,
<span>3天内(72小时内)</span>连接服务器即认为在线;
</p>
<p>无线设备在线数:</p>
<p>
统计该账号权限下,在统计当日所有设备在线率情况,
<span>3天内(72小时内)</span>连接服务器即认为在线;
</p>
<p>在线率 = 在线数 / 总激活数;</p>
<p>在线率只保留整数,四舍五入</p>
</div>
<i class="el-icon-question"></i>
</el-tooltip>
</div> </div>
<!-- 表头 end --> <!-- 表头 end -->
<!-- 数据 开始 --> <!-- 数据 开始 -->
<div class="info_box"> <div class="info_box">
<div class="title">{{staticInfo.onlineNumber}}</div> <div class="equipment_box">
<div id="onlineChart" class="c_canvas"></div> <!-- 设备在线数 -->
<div class="footer"> <div class="equipment_boxs">
设备在线率:{{staticInfo.onlineRate}}% <div>
</div> <span>设备在线数</span>
</div> <el-tooltip class="item" effect="dark" placement="right-start">
<!-- 数据 end --> <div slot="content">
</div> <p>{{hasPermission('data_doard_offLine') ? '在线数 = 总在线数 + 假性离线数' : '在线数 = 有线设备在线数 + 无线设备在线数'}}</p>
<!-- 设备在线数 end --> <p>{{hasPermission('data_doard_offLine') ? '总在线数:' : '有线设备在线数:'}}</p>
<p>
<!-- 设备离线数 开始 --> 统计该账号权限下,在统计当日所有设备在线率情况,
<div class="cell_box"> <span>3天内(72小时内)</span>连接服务器即认为在线;
<!-- 表头 开始 --> </p>
<div class="head"> <p v-show="!hasPermission('data_doard_offLine')">无线设备在线数:</p>
<span>设备离线数</span> <p v-show="!hasPermission('data_doard_offLine')">
<el-tooltip class="item" effect="dark" placement="right-start"> 统计该账号权限下,在统计当日所有设备在线率情况,
<div slot="content"> <span>3天内(72小时内)</span>连接服务器即认为在线;
<p>离线数 = 有线设备离线数 + 无线设备离线数</p> </p>
<p>有线设备离线数:</p> <p v-show="hasPermission('data_doard_offLine')">假性离线数:</p>
<p> <p v-show="hasPermission('data_doard_offLine')">
统计该账号权限下,在统计当日所有设备在线率情况, 统计该账号权限下,在统计当日所有设备假性离线情况,
<span>3天内(72小时内)</span> <span>若满足对应条件则判定为假性离线,即在线;</span>
无连接服务器即认为离线; </p>
</p> <p>{{hasPermission('data_doard_offLine') ? '总在线率 = (设备在线数 + 假性离线数)/ 总激活数;' : '在线率 = 在线数 / 总激活数;'}}</p>
<p>无线设备离线数:</p> <p>{{hasPermission('data_doard_offLine') ? '总在线率保留百分位,四舍五入' : '在线率保留百分位,四舍五入'}}</p>
<p> </div>
统计该账号权限下,在统计当日所有设备在线率情况, <i class="el-icon-question"></i>
<span>3天内(72小时内)</span> </el-tooltip>
无连接服务器即认为离线; <div class="title" style="margin-top: 10px;">{{staticInfo.onlineNumber}}</div>
</p>
<p>离线率 = 离线数 / 总激活数;</p>
<p>离线率只保留整数,四舍五入</p>
<p v-if="isZhongli && staticInfo.offlineSnNum>0">确认{{staticInfo.offlineSnNum}}台设备加入白名单,不予统计</p>
</div> </div>
<i class="el-icon-question"></i> <div id="onlineChart" class="c_canvass"></div>
</el-tooltip> </div>
</div> <!-- 假性离线数 -->
<!-- 表头 end --> <div class="equipment_boxs" v-show="hasPermission('data_doard_offLine')">
<!-- 数据 开始 --> <div>
<div class="info_box"> <span>假性离线数</span>
<div class="title">{{staticInfo.offlineNumber}}</div> <div class="title" style="margin-top: 10px;">{{staticInfo.fakeOfflineNumber}}</div>
<div id="offlineChart" class="c_canvas"></div> </div>
<div id="fakeOfflineChart" class="c_canvass"></div>
</div>
<!-- 设备离线数 -->
<div class="equipment_boxs">
<div>
<span>设备离线数</span>
<el-tooltip class="item" effect="dark" placement="right-start">
<div slot="content">
<p>{{hasPermission('data_doard_offLine') ? '离线数 = 总离线数 - 假性离线数' : '离线数 = 有线设备离线数 + 无线设备离线数'}}</p>
<p>{{hasPermission('data_doard_offLine') ? '总离线数:' : '有线设备离线数:'}}</p>
<p>
统计该账号权限下,在统计当日所有设备在线率情况,
<span>3天内(72小时内)</span>
无连接服务器即认为离线;
</p>
<p v-show="!hasPermission('data_doard_offLine')">无线设备离线数:</p>
<p v-show="!hasPermission('data_doard_offLine')">
统计该账号权限下,在统计当日所有设备在线率情况,
<span>3天内(72小时内)</span>
无连接服务器即认为离线;
</p>
<p v-show="hasPermission('data_doard_offLine')">假性离线数:</p>
<p v-show="hasPermission('data_doard_offLine')">
统计该账号权限下,在统计当日所有设备假性离线情况,若满足对应条件则判定为假性离线,即在线,并从离线率中剔除;
</p>
<p>{{hasPermission('data_doard_offLine') ? '离线率 = (总离线数 - 假性离线数)/ 总激活数;' : '离线率 = 离线数 / 总激活数;'}}</p>
<p>离线率保留百分位,四舍五入</p>
<p v-if="isZhongli && staticInfo.offlineSnNum>0">确认{{staticInfo.offlineSnNum}}台设备加入白名单,不予统计</p>
</div>
<i class="el-icon-question"></i>
</el-tooltip>
<div class="title" style="margin-top: 10px;">{{hasPermission('data_doard_offLine') ? staticInfo.offlineNumber - staticInfo.fakeOfflineNumber : staticInfo.offlineNumber}}</div>
</div>
<div id="offlineChart" class="c_canvass"></div>
</div>
</div>
<div class="footer"> <div class="footer">
设备离线率:{{staticInfo.offlineRate}}% <div class="footer-box">
<span style="color: #0196FA;">{{hasPermission('data_doard_offLine') ? '设备总在线率:' : '设备在线率:'}}</span>
<span style="color: #0196FA;">{{hasPermission('data_doard_offLine') ? addSub(staticInfo.onlineRate, staticInfo.fakeOfflineRate) : staticInfo.onlineRate}}%</span>
</div>
<div class="footer-box" v-show="hasPermission('data_doard_offLine')"></div>
<div class="footer-box">
<span style="color: #F47F13;">设备离线率:{{hasPermission('data_doard_offLine') ? accSub(staticInfo.offlineRate, staticInfo.fakeOfflineRate) : staticInfo.offlineRate}}%</span>
</div>
</div> </div>
</div> </div>
<!-- 数据 end --> <!-- 数据 end -->
</div> </div>
<!-- 设备离线数 end --> <!-- 设备数 end -->
</div> </div>
<!-- 数据列表 end --> <!-- 数据列表 end -->
...@@ -240,10 +262,10 @@ export default { ...@@ -240,10 +262,10 @@ export default {
staticInfo: {}, staticInfo: {},
alarmInfo: {}, alarmInfo: {},
isZhongli: false, isZhongli: false,
maskFlag: true
}; };
}, },
mounted() { mounted() {
this.getStatic();
this.getAlarm(); this.getAlarm();
this.getActived(this.createActivedLineChart); this.getActived(this.createActivedLineChart);
this.getActived(this.createAllActivedLineChart, 11); this.getActived(this.createAllActivedLineChart, 11);
...@@ -251,7 +273,20 @@ export default { ...@@ -251,7 +273,20 @@ export default {
//GET_HOME_AUTHUSERORG().then((res) => {}); //GET_HOME_AUTHUSERORG().then((res) => {});
this.getRoles(); this.getRoles();
}, },
activated() {
this.getStatic();
},
methods: { methods: {
// 是否有权限
hasPermission(id) {
let list = this.$root.parentCommon.getAuthData();
let idx = list.findIndex((k) => k.origin.permissionTag == id);
if (idx < 0) {
return false;
} else {
return true;
}
},
// 切换日期 // 切换日期
linkEvent(row) { linkEvent(row) {
this.active = row.id; this.active = row.id;
...@@ -266,20 +301,48 @@ export default { ...@@ -266,20 +301,48 @@ export default {
// 在线率 // 在线率
let m = []; let m = [];
m.push({ value: 100 - obj.onlineRate, name: "" }); m.push({ value: this.accSub(100, obj.onlineRate), name: "" });
m.push({ value: obj.onlineRate, name: "" }); m.push({ value: obj.onlineRate, name: "" });
this.createBindChart("onlineChart", m); this.createBindChart("onlineChart", m);
// 离线率 // 离线率
let n = []; let n = [];
n.push({ value: 100 - obj.offlineRate, name: "" });
n.push({ value: obj.offlineRate, name: "" }); n.push({ value: obj.offlineRate, name: "" });
n.push({ value: this.accSub(100, obj.offlineRate), name: "" });
this.createBindChart("offlineChart", n); if (this.hasPermission('data_doard_offLine')) {
n = []
const b = this.accSub(100, obj.offlineRate)
n.push({ value: this.accSub(obj.offlineRate, obj.fakeOfflineRate), name: "" });
n.push({ value: this.addSub(b, obj.fakeOfflineRate), name: "" });
}
this.createChart("offlineChart", n);
// 假性离线率
let x = []
if (this.hasPermission('data_doard_offLine')) {
x.push({ value: this.accSub(100, obj.fakeOfflineRate), name: "" });
x.push({ value: obj.fakeOfflineRate, name: "" });
}
this.createBindChart("fakeOfflineChart", x);
this.maskFlag = false
}); });
}, },
// 减法计算函数
accSub(arg1, arg2) {
let a = arg1 - arg2
a = Math.round((a) * 100) / 100
a.toFixed(2)
return a
},
// 加法计算函数
addSub(arg1, arg2) {
let b = Number(arg1) + Number(arg2)
b = Math.round((b) * 100) / 100
b.toFixed(2)
return b
},
// 获取警情统计 // 获取警情统计
getAlarm() { getAlarm() {
GET_HOME_ALARMNUMBER().then((res) => { GET_HOME_ALARMNUMBER().then((res) => {
...@@ -367,11 +430,44 @@ export default { ...@@ -367,11 +430,44 @@ export default {
show: false, show: false,
}, },
data: data, data: data,
minAngle: 11
},
],
});
},
// 离线率环形图表
createChart(id, data) {
var aChart = echarts.init(document.getElementById(id));
aChart.setOption({
tooltip: {
show: true,
formatter: "{c0}%",
},
legendHoverLink: false,
color: [
"#F6B06F",
"#c0c0c0",
"#fac858",
"#ee6666",
"#73c0de",
"#3ba272",
"#fc8452",
"#9a60b4",
"#ea7ccc",
],
series: [
{
type: "pie",
radius: ["40%", "70%"],
labelLine: {
show: false,
},
data: data,
minAngle: 11
}, },
], ],
}); });
}, },
// 页面跳转 // 页面跳转
linkToPage(path, start, end) { linkToPage(path, start, end) {
let row = { alarmStatus: 1 }; let row = { alarmStatus: 1 };
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<select-info ref="selectInfoCom" :id="id" :key="id"></select-info> <select-info ref="selectInfoCom" :id="id" :key="id"></select-info>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="导入数据" name="2"> <el-tab-pane label="导入数据" name="2">
<import-vehicle ref="importVehicleCom" :id="id" :key="id"></import-vehicle> <import-vehicle ref="importVehicleCom" :id="id" :key="id" @monitorFlag="monitorFlag" @monitorChangeFlag="monitorChangeFlag"></import-vehicle>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="按组织授权" name="3"> <el-tab-pane label="按组织授权" name="3">
<authorization-info ref="authorizationInfoCom" :id="id" :key="id"></authorization-info> <authorization-info ref="authorizationInfoCom" :id="id" :key="id"></authorization-info>
...@@ -35,6 +35,8 @@ export default { ...@@ -35,6 +35,8 @@ export default {
activeTabs: "1", activeTabs: "1",
userId: "", userId: "",
randomKey: "", randomKey: "",
monitorFlags: false,
showBtnFlag: true
}; };
}, },
watch: { watch: {
...@@ -63,6 +65,19 @@ export default { ...@@ -63,6 +65,19 @@ export default {
} }
this.$refs.importVehicleCom.saveInfo(); this.$refs.importVehicleCom.saveInfo();
}, },
monitorFlag(val) {
this.monitorFlags = val
},
monitorChangeFlag(val) {
if (val && !this.monitorFlags) {
this.showBtnFlag = true
}
if (this.monitorFlags) {
this.showBtnFlag = false
this.monitorFlags = !this.monitorFlags
}
this.$emit('showBtnFlags', this.showBtnFlag)
}
}, },
}; };
</script> </script>
......
...@@ -66,7 +66,7 @@ export default { ...@@ -66,7 +66,7 @@ export default {
uploadParams: {}, uploadParams: {},
uploadResult: {}, uploadResult: {},
acceptFile: ".xlsx,.xls", acceptFile: ".xlsx,.xls",
fileList: [], fileList: []
}; };
}, },
mounted() { mounted() {
...@@ -86,6 +86,7 @@ export default { ...@@ -86,6 +86,7 @@ export default {
this.uploadFile = file; this.uploadFile = file;
this.fileList = [file]; this.fileList = [file];
} }
this.$emit('monitorChangeFlag', true)
}, },
// 下载失败文件 // 下载失败文件
...@@ -107,6 +108,7 @@ export default { ...@@ -107,6 +108,7 @@ export default {
// 监听文件上传成功 // 监听文件上传成功
onSuccess(response, file, fileList) { onSuccess(response, file, fileList) {
console.log(response); console.log(response);
this.$emit('monitorFlag', true)
let _this = this; let _this = this;
broadcast("cancel-loading"); broadcast("cancel-loading");
_this.$refs.uploadBox.clearFiles(); _this.$refs.uploadBox.clearFiles();
...@@ -131,7 +133,6 @@ export default { ...@@ -131,7 +133,6 @@ export default {
showToast({ showToast({
message: "请选择文件", message: "请选择文件",
}); });
console.log("7777777777777");
broadcast("cancel-loading"); broadcast("cancel-loading");
return false; return false;
} }
......
...@@ -59,11 +59,11 @@ ...@@ -59,11 +59,11 @@
<!-- 指定数据弹框 开始 --> <!-- 指定数据弹框 开始 -->
<glsx-dialog :show="showDialog" title="指定数据" @close="closeDialog()" width="900px"> <glsx-dialog :show="showDialog" title="指定数据" @close="closeDialog()" width="900px">
<div> <div>
<assign-info ref="assignInfo" v-if="showDialog" :id="currentUserId"></assign-info> <assign-info ref="assignInfo" v-if="showDialog" :id="currentUserId" @showBtnFlags="showBtnFlags"></assign-info>
</div> </div>
<template slot="footer"> <template slot="footer">
<el-button type="default" size="small" @click="closeDialog">取消</el-button> <el-button type="default" size="small" @click="closeDialog">取消</el-button>
<el-button type="primary" size="small" :loading="loading" @click="saveInfo">确定</el-button> <el-button type="primary" size="small" :loading="loading" @click="saveInfo" v-show="showFlags">确定</el-button>
</template> </template>
</glsx-dialog> </glsx-dialog>
<!-- 指定数据弹框 end --> <!-- 指定数据弹框 end -->
...@@ -314,6 +314,7 @@ export default { ...@@ -314,6 +314,7 @@ export default {
showDialog: false, showDialog: false,
loading: false, loading: false,
currentUserId: "", currentUserId: "",
showFlags: true
}; };
}, },
watch: { watch: {
...@@ -336,6 +337,9 @@ export default { ...@@ -336,6 +337,9 @@ export default {
this.init(); this.init();
}, },
methods: { methods: {
showBtnFlags(val) {
this.showFlags = val
},
init() { init() {
this.getTreeOrg(); this.getTreeOrg();
// this.getRoleList(); // this.getRoleList();
...@@ -731,6 +735,7 @@ export default { ...@@ -731,6 +735,7 @@ export default {
// 关闭弹框 // 关闭弹框
closeDialog() { closeDialog() {
this.showDialog = false; this.showDialog = false;
this.showFlags = true;
}, },
// 保存数据 // 保存数据
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!