Commit 2fdc51bf authored by Administrator's avatar Administrator

Merge branch 'master' into develop

parents 7122115c dda13fb2
...@@ -14,8 +14,9 @@ class CreateUserRolesTable extends Migration ...@@ -14,8 +14,9 @@ class CreateUserRolesTable extends Migration
public function up() public function up()
{ {
Schema::create('user_roles', function (Blueprint $table) { Schema::create('user_roles', function (Blueprint $table) {
$table->id(); $table->increments('id')->comment('主键');
$table->string('name')->unique(); $table->string('name')->unique()->comment('角色名称');
$table->tinyInteger('state')->comment('状态:1:启用,2:停用');
$table->timestamps(); $table->timestamps();
}); });
} }
......
...@@ -14,60 +14,51 @@ ...@@ -14,60 +14,51 @@
<el-col :span="6"><el-card shadow="always">设备故障<span style="margin-left: 12px;color: #5d5f5f;">{{ synthesizecount.device_offline }}</span></el-card></el-col> <el-col :span="6"><el-card shadow="always">设备故障<span style="margin-left: 12px;color: #5d5f5f;">{{ synthesizecount.device_offline }}</span></el-card></el-col>
<el-col :span="6"><el-card shadow="always">今天报警次数<span style="margin-left: 12px;color: #F56C6C;">{{ synthesizecount.timedevicepolice }}</span></el-card></el-col> <el-col :span="6"><el-card shadow="always">今天报警次数<span style="margin-left: 12px;color: #F56C6C;">{{ synthesizecount.timedevicepolice }}</span></el-card></el-col>
</el-row> </el-row>
<el-row> <el-row :align="'middle'">
<el-card class="box-card" style="margin-top:12px;height: 200px;"> <el-card class="box-card" style="margin-top:12px;height: 200px;">
<div style="display: inline-block;"> <el-col :span="4" style="text-align: center;">
<el-progress type="dashboard" :percentage="synthesizecount.percent_alarm" color="red"></el-progress> <el-progress type="dashboard" :percentage="synthesizecount.percent_alarm" color="red"></el-progress>
<el-tooltip class="item" effect="red" :content="synthesizecount.percent_alarm + '%'" placement="top-start"> <el-tooltip class="item" effect="red" :content="synthesizecount.percent_alarm + '%'" placement="top-start">
<span style="position: relative;left: -115px;top: 12px;">当前报警率</span> <p>当前报警率</p>
</el-tooltip> </el-tooltip>
</div> </el-col>
<div style="display: inline-block;"> <el-col :span="4" style="text-align: center;">
<el-progress type="dashboard" :percentage="synthesizecount.percent_online" color="green"></el-progress> <el-progress type="dashboard" :percentage="synthesizecount.percent_online" color="green"></el-progress>
<el-tooltip class="item" effect="green" :content="synthesizecount.percent_online + '%'" placement="top-start"> <el-tooltip class="item" effect="green" :content="synthesizecount.percent_online + '%'" placement="top-start">
<span style="position: relative;left: -108px;top: 12px;">设备在线率</span> <p>设备在线率</p>
</el-tooltip> </el-tooltip>
</div> </el-col>
</el-card> <el-col :span="4" style="text-align: center;">
</el-row>
</div>
<!-- 混合统计 -->
<el-card class="box-card" style="margin-top:12px;padding-bottom:24px">
<div class="chart-container" style="position: relative; top: 2px; height: 560px;">
<chart height="100%" width="100%" />
</div>
</el-card>
<!-- 统计 -->
<el-card class="box-card" style="margin-top:12px;height: 200px;">
<div style="display: inline-block;">
<el-progress type="dashboard" :percentage="memory" :color="colors"></el-progress> <el-progress type="dashboard" :percentage="memory" :color="colors"></el-progress>
<el-tooltip class="item" effect="dark" :content="memory + 'MB'" placement="top-start"> <el-tooltip class="item" effect="dark" :content="memory + 'MB'" placement="top-start">
<span style="position: relative;left: -115px;top: 12px;">项目运行速度</span> <p>项目运行速度</p>
</el-tooltip> </el-tooltip>
</div> </el-col>
<div style="display: inline-block;"> <el-col :span="4" style="text-align: center;">
<el-progress type="dashboard" :percentage="base_path" :color="colors"></el-progress> <el-progress type="dashboard" :percentage="base_path" :color="colors"></el-progress>
<el-tooltip class="item" effect="dark" :content="base_path * 10 + 'MB'" placement="top-start"> <el-tooltip class="item" effect="dark" :content="base_path * 10 + 'MB'" placement="top-start">
<span style="position: relative;left: -108px;top: 12px;">项目容量</span> <p>项目容量</p>
</el-tooltip> </el-tooltip>
</div> </el-col>
<div style="display: inline-block;"> <el-col :span="4" style="text-align: center;">
<el-progress type="dashboard" :percentage="end_time" :color="colors"></el-progress> <el-progress type="dashboard" :percentage="end_time" :color="colors"></el-progress>
<el-tooltip class="item" effect="dark" :content="end_time + 'S'" placement="top-start"> <el-tooltip class="item" effect="dark" :content="end_time + 'S'" placement="top-start">
<span style="position: relative;left: -112px;top: 12px;">访问接口速度</span> <p>访问接口速度</p>
</el-tooltip> </el-tooltip>
</div> </el-col>
<div style="display: inline-block; position: relative;left: -36px;"> <el-col :span="4" style="text-align: center;">
<el-progress type="dashboard" :percentage="databas" :color="colors"></el-progress> <el-progress type="dashboard" :percentage="databas" :color="colors"></el-progress>
<el-tooltip class="item" effect="dark" :content="databas + 'S'" placement="top-start"> <el-tooltip class="item" effect="dark" :content="databas + 'S'" placement="top-start">
<span style="position: relative;left: -122px;top: 12px;">访问数据库速度</span> <p>访问数据库速度</p>
</el-tooltip> </el-tooltip>
</el-col>
</el-card>
</el-row>
</div> </div>
<div style="display: inline-block;position: relative;right: -808px;bottom: 127px;"> <!-- 混合统计 -->
<el-progress type="dashboard" :percentage="rand" :color="colors"></el-progress> <el-card class="box-card" style="margin-top:12px;padding-bottom:24px">
<el-tooltip class="item" effect="dark" :content="rand + 'MB'" placement="top-start"> <div class="chart-container" style="position: relative; top: 2px; height: 560px;">
<span style="position: relative;left: -112px;top: 12px;">进程占用情况</span> <chart height="100%" width="100%" />
</el-tooltip>
</div> </div>
</el-card> </el-card>
</el-col> </el-col>
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
:stroke-color="'#ccc'" :stroke-color="'#ccc'"
:stroke-opacity="0.9" :stroke-opacity="0.9"
:events="markerClickEvent(marker)" :events="markerClickEvent(marker)"
:check="playAudio(marker.devicepolice)"
></el-amap-circle-marker> ></el-amap-circle-marker>
<!-- 右上角设备和用户切换按钮 --> <!-- 右上角设备和用户切换按钮 -->
<div class="toolbar"> <div class="toolbar">
...@@ -184,6 +185,8 @@ export default { ...@@ -184,6 +185,8 @@ export default {
data(){ data(){
const _this = this; const _this = this;
return { return {
audio: new Audio('/audio/alarm.wav'),
audio_play: false,
intervalId: null, intervalId: null,
map: {}, map: {},
amapManager: new AMapManager(), amapManager: new AMapManager(),
...@@ -413,6 +416,30 @@ export default { ...@@ -413,6 +416,30 @@ export default {
clearInterval(this.intervalId); // 清除计时器 clearInterval(this.intervalId); // 清除计时器
this.intervalId = null; // 设置为null this.intervalId = null; // 设置为null
}, },
// 播放报警声音
playAudio(state) {
if (this.audio_play === false && (state === 4 || state === 5 || state === 6 || state === 16)) {
const playPromise = this.audio.play();
const that = this;
if (playPromise) {
playPromise.then(() => {
// 音频加载成功
// 音频的播放需要耗时
that.tiemr = setInterval(() => {
that.second--;
if (that.second <= 0) {
this.audio.pause();
this.audio_play = true;
clearInterval(that.tiemr);
}
}, 1000);
}).catch((e) => {
// 音频加载失败
console.error(e);
});
}
}
},
}, },
}; };
</script> </script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment