Browse Source

优化;摄像机获取4g信号

master
4670101279 2 years ago
parent
commit
37ed6170c3
  1. 4
      src/views/data/currdata/index.vue
  2. 47
      src/views/data/photo/index.vue
  3. 83
      src/views/web/camera/index.vue

4
src/views/data/currdata/index.vue

@ -9,14 +9,14 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="水位计名称" prop="stcd"> <!-- <el-form-item label="水位计名称" prop="stcd">
<el-input <el-input
v-model="queryParams.stcd" v-model="queryParams.stcd"
placeholder="请输入水位计名称" placeholder="请输入水位计名称"
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item> -->
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>

47
src/views/data/photo/index.vue

@ -9,14 +9,14 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="水位计" prop="ip"> <!-- <el-form-item label="水位计" prop="ip">
<el-input <el-input
v-model="queryParams.stcd" v-model="queryParams.stcd"
placeholder="请输入水位计名称" placeholder="请输入水位计名称"
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item> -->
<el-form-item label="开始时间"> <el-form-item label="开始时间">
<el-date-picker <el-date-picker
v-model="queryParams.startTime" v-model="queryParams.startTime"
@ -48,13 +48,13 @@
:src="item.imgName" :src="item.imgName"
:preview-src-list="srcList" :preview-src-list="srcList"
@click="show(item.imgName)" @click="show(item.imgName)"
></el-image> ></el-image>
<div class="info"> <div class="info">
<div class="station"> <div class="station">
<div class="nm">{{item.stnm}}</div> <div class="nm">{{item.stnm}}</div>
<div class="ip">{{item.ip}}</div> <!-- <div class="ip">{{item.ip}}</div> -->
</div> </div>
<div class="data"> <div class="data">
<div class="value">{{item.value}}</div> <div class="value">{{item.value}}</div>
@ -76,9 +76,9 @@
<!-- <img class="show-img" :src="showImg" /> --> <!-- <img class="show-img" :src="showImg" /> -->
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
@ -96,7 +96,7 @@ export default {
// //
currdataList: [], currdataList: [],
imgUrl:'', imgUrl:'',
// //
queryParams: { queryParams: {
endTime: '2022-06-26 10:55:00', endTime: '2022-06-26 10:55:00',
@ -104,31 +104,31 @@ export default {
page: 1, page: 1,
limit: 10, limit: 10,
stnmId: null, stnmId: null,
stnm: '鄞州公园', stnm: null,
stcd: '视频水位计-yzgy', stcd: null,
mainType: null, mainType: null,
type: null, type: null,
deviceTypeId: null, deviceTypeId: null,
stcdTypeId: null, stcdTypeId: null,
latestTm: null, latestTm: null,
latestValue: null, latestValue: null,
}, },
open: false, open: false,
showImg : '', showImg : '',
srcList:[], srcList:[],
} }
}, },
created() { created() {
this.getTime(); this.getTime();
this.getList(); this.getList();
}, },
methods: { methods: {
/** 查询实时数据列表 */ /** 查询实时数据列表 */
getList() { getList() {
this.loading = true; this.loading = true;
@ -141,16 +141,16 @@ export default {
this.total=response.count; this.total=response.count;
this.currdataList.forEach(function(e,index){ this.currdataList.forEach(function(e,index){
if(e.imgName=='' ||e.imgName==null){ if(e.imgName=='' ||e.imgName==null){
e.imgName=errorImg e.imgName=errorImg
}else{ }else{
e.imgName='https://www.huastech.com.cn'+e.imgName e.imgName='https://www.huastech.com.cn'+e.imgName
} }
}) })
this.loading = false; this.loading = false;
}) })
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
@ -173,10 +173,10 @@ export default {
/** 设置初始时间*/ /** 设置初始时间*/
getTime(){ getTime(){
var timestamp = new Date(); var timestamp = new Date();
this.queryParams.endTime=formatDate(timestamp,'yyyy-MM-dd hh:mm:ss') this.queryParams.endTime=formatDate(timestamp,'yyyy-MM-dd hh:mm:ss')
this.queryParams.startTime=formatDate(new Date(timestamp.getTime()-86400*2000),('yyyy-MM-dd hh:mm:ss')); this.queryParams.startTime=formatDate(new Date(timestamp.getTime()-86400*2000),('yyyy-MM-dd hh:mm:ss'));
} }
} }
}; };
@ -211,5 +211,10 @@ export default {
} }
.nm { .nm {
color: #333; color: #333;
margin-top: 10px;
font-size: 20px;
}
.value{
text-align: center;
} }
</style> </style>

83
src/views/web/camera/index.vue

@ -70,6 +70,7 @@
<el-table-column label="设备序列号" align="center" prop="devsn" /> <el-table-column label="设备序列号" align="center" prop="devsn" />
<el-table-column label="首次注册时间" align="center" prop="firstTime" /> <el-table-column label="首次注册时间" align="center" prop="firstTime" />
<el-table-column label="心跳时间" align="center" prop="updateTime" /> <el-table-column label="心跳时间" align="center" prop="updateTime" />
<el-table-column label="4G强度" align="center" prop="rssiLevel" />
<el-table-column label="状态" align="center" prop="status"> <el-table-column label="状态" align="center" prop="status">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.status == 1"><el-tag type="success">在线</el-tag></span> <span v-if="scope.row.status == 1"><el-tag type="success">在线</el-tag></span>
@ -78,7 +79,7 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <!-- <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-setting" icon="el-icon-setting"
@ -91,7 +92,7 @@
icon="el-icon-search" icon="el-icon-search"
@click="showVideo(scope.row)" @click="showVideo(scope.row)"
v-hasPermi="['web:camera:remove']" v-hasPermi="['web:camera:remove']"
>查看视频</el-button> >查看视频</el-button> -->
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
@ -99,13 +100,14 @@
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['web:camera:edit']" v-hasPermi="['web:camera:edit']"
>修改</el-button> >修改</el-button>
<el-button <!-- <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-refresh" icon="el-icon-refresh"
@click="reboot(scope.row)" @click="reboot(scope.row)"
v-hasPermi="['web:camera:remove']" v-hasPermi="['web:camera:remove']"
>重启</el-button> v-loading.fullscreen.lock="fullscreenLoading"
>重启</el-button> -->
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
@ -113,6 +115,22 @@
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-hasPermi="['web:camera:remove']" v-hasPermi="['web:camera:remove']"
>删除</el-button> >删除</el-button>
<el-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)" v-hasPermi="['web:camera:remove']">
<span class="el-dropdown-link">
<i class="el-icon-d-arrow-right el-icon--right"></i>更多
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="refreshRssi" icon="el-icon-s-operation"
v-hasPermi="['web:camera:remove']">刷新4G信号</el-dropdown-item>
<el-dropdown-item command="openFtpCfg" icon="el-icon-setting"
v-hasPermi="['web:camera:remove']">FTP配置</el-dropdown-item>
<el-dropdown-item command="showVideo" icon="el-icon-view"
v-hasPermi="['web:camera:remove']">查看视频</el-dropdown-item>
<el-dropdown-item command="reboot" icon="el-icon-refresh"
v-hasPermi="['web:camera:remove']">重启</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -210,6 +228,8 @@ export default {
return { return {
// //
loading: true, loading: true,
fullscreenLoading: false,
// //
ids: [], ids: [],
// //
@ -328,6 +348,25 @@ export default {
this.open = true; this.open = true;
this.title = "添加摄像机"; this.title = "添加摄像机";
}, },
//
handleCommand(command, row) {
switch (command) {
case "refreshRssi":
this.refreshRssi(row);
break;
case "openFtpCfg":
this.openFtpCfg(row);
break;
case "showVideo":
this.showVideo(row);
break;
case "reboot":
this.reboot(row);
break;
default:
break;
}
},
/** 修改按钮操作 */ /** 修改按钮操作 */
async handleUpdate(row) { async handleUpdate(row) {
this.reset(); this.reset();
@ -339,9 +378,27 @@ export default {
this.title = "修改"; this.title = "修改";
} }
}, },
async refreshRssi(row){
const id = row.id;
const status = row.status;
if(status != 1){
this.$modal.msg("设备未在线");
return;
}
let res = await this.$axiosGet('/web/camera/refreshRssi/'+id);
if(res.code === 0){
this.$modal.msgSuccess("执行成功");
this.getList();
}
},
async openFtpCfg(row){ async openFtpCfg(row){
this.ftpCfgReset(); this.ftpCfgReset();
const id = row.id; const id = row.id;
const status = row.status;
if(status != 1){
this.$modal.msg("设备未在线");
return;
}
let res = await this.$axiosGet('/camera/ftp/getNetCfg',{'cameraId': id}); let res = await this.$axiosGet('/camera/ftp/getNetCfg',{'cameraId': id});
if(res.code === 0){ if(res.code === 0){
this.ftp.form = res.data; this.ftp.form = res.data;
@ -358,16 +415,30 @@ export default {
this.ftp.open = false; this.ftp.open = false;
} }
}, },
async reboot(row) { reboot(row) {
const id = row.id; const id = row.id;
const status = row.status; const status = row.status;
if(status != 1){ if(status != 1){
this.$modal.msg("设备未在线"); this.$modal.msg("设备未在线");
return; return;
} }
this.$modal.confirm('是否确认重启?').then(() => {
this.exeReboot(id)
}).catch(() => {});
},
async exeReboot(id){
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
// this.fullscreenLoading = true;
let res = await this.$axiosGet('/web/camera/reboot/'+id); let res = await this.$axiosGet('/web/camera/reboot/'+id);
if(res.code === 0){ if(res.code === 0){
this.$modal.msgSuccess("执行成功"); // this.fullscreenLoading = false;
loading.close();
this.$modal.msgSuccess("执行成功,请稍等几分钟后继续操作");
this.getList(); this.getList();
} }
}, },

Loading…
Cancel
Save