Browse Source

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/views/web/camera/index.vue
master
4670101279 2 years ago
parent
commit
1c823d0ac1
  1. 16
      src/views/data/currdata/index.vue
  2. 96
      src/views/statistic/river/river.vue
  3. 2
      src/views/system/user/index.vue
  4. 607
      src/views/web/camera/index.vue

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

@ -49,8 +49,8 @@ @@ -49,8 +49,8 @@
<pagination
v-show="total"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
:page.sync="queryParams.page"
:limit.sync="queryParams.limit"
@pagination="getList"
/>
@ -89,6 +89,7 @@ @@ -89,6 +89,7 @@
<script>
import barChart from "@/components/ChartTimeLineBar";
import {formatDate} from "@/utils/common";
export default {
name: "Currdata",
components:{
@ -119,8 +120,8 @@ export default { @@ -119,8 +120,8 @@ export default {
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
page: 1,
limit: 10,
stnmId: null,
stnm: null,
mainType: null,
@ -141,9 +142,10 @@ export default { @@ -141,9 +142,10 @@ export default {
position: 0,
//
ChartData:{
endTime: new Date().getTime(),
endTime: formatDate(new Date().getTime(),'yyyy-MM-dd hh:mm:ss'),
stnmId: null,
startTime: new Date().getTime()- 3600 * 1000 * 24,
startTime: formatDate(new Date().getTime()- 3600 * 1000 * 24,'yyyy-MM-dd hh:mm:ss'),
dataType: '-1'
},
dataTypes:[
{label: '5分钟',value:'-1'},
@ -216,7 +218,7 @@ export default { @@ -216,7 +218,7 @@ export default {
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.queryParams.page = 1;
this.getList();
},
/** 重置按钮操作 */

96
src/views/statistic/river/river.vue

@ -3,8 +3,8 @@ @@ -3,8 +3,8 @@
<el-container>
<el-header height="60px">
<template>
<el-form :inline="true" :model="queryParams" class="demo-form-inline">
<el-form-item label="时间维度">
<el-form :inline="true" :model="queryParams" :rules="rules" ref="queryParams" class="demo-form-inline">
<el-form-item label="时间维度" prop="dataType">
<el-select v-model="queryParams.dataType" placeholder="时间维度" class="w100">
<el-option
v-for="item in dataTypes"
@ -14,34 +14,38 @@ @@ -14,34 +14,38 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item label="开始时间">
<el-form-item label="开始时间" prop="startTime">
<el-date-picker
v-model="queryParams.startTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择开始时间"
class="w200"
>
</el-date-picker>
</el-form-item>
<el-form-item label="结束时间">
<el-form-item label="结束时间" prop="endTime">
<el-date-picker
v-model="queryParams.endTime"
value-format="yyyy-MM-dd HH:mm:ss"
type="datetime"
placeholder="选择结束时间"
class="w200"
>
</el-date-picker>
</el-form-item>
<el-form-item label="选择站点">
<el-input
v-model="queryParams.stnm"
placeholder="请输入站点名称"
clearable
@keyup.enter.native="handleQuery"
<el-form-item label="选择站点" prop="stnmId">
<el-select v-model="queryParams.stnmId" placeholder="请选择站点" clearable>
<el-option
v-for="dict in stationList"
:key="dict.id"
:label="dict.stnm"
:value="dict.id"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="submitForm">查询</el-button>
<el-button type="primary" @click="submitForm('queryParams')">查询</el-button>
</el-form-item>
</el-form>
</template>
@ -81,6 +85,17 @@ export default { @@ -81,6 +85,17 @@ export default {
},
data() {
return {
rules: {
startTime: [
{ required: true, message: '请选择开始时间', trigger: 'change' }
],
endTime: [
{ required: true, message: '请选择结束时间', trigger: 'change' }
],
stnmId: [
{ required: true, message: '请选择站点', trigger: 'change' }
]
},
//
loading: true,
@ -104,16 +119,15 @@ export default { @@ -104,16 +119,15 @@ export default {
label: ''
}
],
stationList: [],
tableData: [
],
//
queryParams: {
dataType: '',
endTime: '2022-06-10 00:00:00',
startTime: '2022-06-08 00:00:00',
stnm: '鄞州公园',
dataType: '0'
endTime: '2022-07-02 00:00:00',
startTime: '2022-07-01 00:00:00',
stnmId: null,
dataType: '-1'
},
dataTypes:[
{label: '5分钟',value:'-1'},
@ -132,36 +146,50 @@ export default { @@ -132,36 +146,50 @@ export default {
created() {
},
mounted(){
this.getList();
this.$refs.chart.showChart([],[],this.chartYname,this.chartType,0,null,this.fixed);
this.submitForm();
},
methods: {
/** 查询水尺-测站信息列表 */
async getList() {
let res = await this.$axiosGet('/system/info/list',this.queryParams);
if(res.code === 0){
this.stationList = res.data;
}
},
/** 提交按钮 */
submitForm() {
var params = {
endTime: '2022-06-10 00:00:00',
startTime: '2022-06-08 00:00:00',
stnmId: this.queryParams.stnmId,
endTime: this.queryParams.endTime,
startTime: this.queryParams.startTime,
dataType: this.queryParams.dataType
}
if(this.queryParams.dataType == 0){
this.tableTime = params.startTime.substring(0,16) +" 至 "+ params.endTime.substring(0,16);
}else if(this.queryParams.dataType==1){
this.tableTime = params.startTime.substring(0,10) +" 至 "+ params.endTime.substring(0,10);
}else{
this.tableTime = params.startTime.substring(0,10) +" 至 "+ params.endTime.substring(0,10);
}
this.drawChart(params);
this.drawTable(params);
this.$refs['queryParams'].validate((valid) => {
if (valid) {
if(this.queryParams.dataType == -1){
this.tableTime = params.startTime.substring(0,19) +" 至 "+ params.endTime.substring(0,19);
}else if(this.queryParams.dataType==0){
this.tableTime = params.startTime.substring(0,16) +" 至 "+ params.endTime.substring(0,16);
}else{
this.tableTime = params.startTime.substring(0,10) +" 至 "+ params.endTime.substring(0,10);
}
this.drawChart(params);
this.drawTable(params);
}
});
},
drawChart(params) {
let res = {"msg":"操作成功","code":0,"data":{"legend":["鄞州公园"],"series":[{"barMaxWidth":"20","data":[[1654617600000,1.29],[1654617600000,1.29],[1654621200000,1.29],[1654624800000,1.29],[1654628400000,1.29],[1654632000000,1.29],[1654635600000,1.29],[1654639200000,1.29],[1654642800000,1.29],[1654646400000,1.29],[1654650000000,1.28],[1654653600000,1.27],[1654657200000,1.26],[1654660800000,1.26],[1654664400000,1.26],[1654668000000,1.25],[1654671600000,1.24],[1654675200000,1.24],[1654678800000,1.24],[1654682400000,1.24],[1654686000000,1.24],[1654689600000,1.24],[1654692300000,1.23],[1654693200000,1.23],[1654696800000,1.23],[1654700400000,1.23],[1654704000000,1.24],[1654704000000,1.24],[1654707600000,1.24],[1654711200000,1.24],[1654714800000,1.24],[1654718400000,1.24],[1654722000000,1.24],[1654725600000,1.24],[1654729200000,1.24],[1654732800000,1.24],[1654736400000,1.24],[1654740000000,1.24],[1654743600000,1.24],[1654746600000,1.25],[1654747200000,1.24],[1654750800000,1.25],[1654754400000,1.25],[1654758000000,1.25],[1654761600000,1.25],[1654765200000,1.24],[1654768800000,1.25],[1654772400000,1.25],[1654776000000,1.25],[1654779600000,1.24],[1654783200000,1.24],[1654786800000,1.24],[1654790400000,1.24]],"name":"鄞州公园","smooth":false,"stnmId":219,"symbol":"none","type":"line"}]}};
async drawChart(params) {
console.log(params);
let res = await this.$axiosGet('/system/photoinfo/getChart',params);
if(res.code == 0){
this.$refs.chart.showChart(res.data.legend,res.data.series,this.unit,this.chartType,0,null,this.fixed);
}
},
drawTable(params) {
let res = {"msg":"操作成功","code":0,"data":[{"114":"鄞州公园","tm":"时间"},{"114":"1.36","tm":"2022-06-08 00:00:00"},{"114":"1.37","tm":"2022-06-08 01:00:00"},{"114":"1.37","tm":"2022-06-08 02:00:00"},{"114":"1.37","tm":"2022-06-08 03:00:00"},{"114":"1.37","tm":"2022-06-08 04:00:00"},{"114":"1.37","tm":"2022-06-08 05:00:00"},{"114":"1.37","tm":"2022-06-08 06:00:00"},{"114":"1.37","tm":"2022-06-08 07:00:00"},{"114":"1.37","tm":"2022-06-08 08:00:00"},{"114":"1.36","tm":"2022-06-08 09:00:00"},{"114":"1.37","tm":"2022-06-08 10:00:00"},{"114":"1.36","tm":"2022-06-08 11:00:00"},{"114":"1.37","tm":"2022-06-08 12:00:00"},{"114":"1.37","tm":"2022-06-08 13:00:00"},{"114":"1.37","tm":"2022-06-08 14:00:00"},{"114":"1.36","tm":"2022-06-08 15:00:00"},{"114":"1.35","tm":"2022-06-08 16:00:00"},{"114":"1.36","tm":"2022-06-08 17:00:00"},{"114":"1.37","tm":"2022-06-08 18:00:00"},{"114":"1.36","tm":"2022-06-08 19:00:00"},{"114":"1.37","tm":"2022-06-08 20:00:00"},{"114":"1.38","tm":"2022-06-08 21:00:00"},{"114":"1.36","tm":"2022-06-08 22:00:00"},{"114":"1.36","tm":"2022-06-08 23:00:00"},{"114":"1.37","tm":"2022-06-09 00:00:00"},{"114":"1.36","tm":"2022-06-09 01:00:00"},{"114":"1.35","tm":"2022-06-09 02:00:00"},{"114":"1.35","tm":"2022-06-09 03:00:00"},{"114":"1.35","tm":"2022-06-09 04:00:00"},{"114":"1.35","tm":"2022-06-09 05:00:00"},{"114":"1.36","tm":"2022-06-09 06:00:00"},{"114":"1.35","tm":"2022-06-09 07:00:00"},{"114":"1.35","tm":"2022-06-09 08:00:00"},{"114":"1.35","tm":"2022-06-09 09:00:00"},{"114":"1.37","tm":"2022-06-09 10:00:00"},{"114":"1.34","tm":"2022-06-09 11:00:00"},{"114":"1.35","tm":"2022-06-09 12:00:00"},{"114":"1.34","tm":"2022-06-09 13:00:00"},{"114":"1.34","tm":"2022-06-09 14:00:00"},{"114":"1.35","tm":"2022-06-09 15:00:00"},{"114":"1.37","tm":"2022-06-09 16:00:00"},{"114":"1.37","tm":"2022-06-09 17:00:00"},{"114":"1.38","tm":"2022-06-09 18:00:00"},{"114":"1.38","tm":"2022-06-09 19:00:00"},{"114":"1.38","tm":"2022-06-09 20:00:00"},{"114":"1.37","tm":"2022-06-09 21:00:00"},{"114":"1.37","tm":"2022-06-09 22:00:00"},{"114":"1.37","tm":"2022-06-09 23:00:00"},{"114":"1.37","tm":"2022-06-10 00:00:00"}]}; if(res.code == 0){
async drawTable(params) {
let res = await this.$axiosGet('/system/photoinfo/getTableData',params);
if(res.code == 0){
var c1 = res.data[0];
var tableColumn = [];
tableColumn.push({prop: 'tm', label: '时间'});

2
src/views/system/user/index.vue

@ -273,7 +273,7 @@ @@ -273,7 +273,7 @@
<el-select v-model="form.postIds" multiple placeholder="请选择岗位">
<el-option
v-for="item in postOptions"
:key="item.postId"
:key="item.postId"
:label="item.postName"
:value="item.postId"
:disabled="item.status == 1"

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

@ -2,20 +2,10 @@ @@ -2,20 +2,10 @@
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="设备名" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入设备名"
clearable
@keyup.enter.native="handleQuery"
/>
<el-input v-model="queryParams.name" placeholder="请输入设备名" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="序列号" prop="devsn">
<el-input
v-model="queryParams.devsn"
placeholder="请输入设备序列号"
clearable
@keyup.enter.native="handleQuery"
/>
<el-input v-model="queryParams.devsn" placeholder="请输入设备序列号" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
@ -25,35 +15,16 @@ @@ -25,35 +15,16 @@
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['web:camera:remove']"
>删除</el-button>
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
v-hasPermi="['web:camera:remove']">删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['web:camera:export']"
>导出</el-button>
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
v-hasPermi="['web:camera:export']">导出</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-refresh"
size="mini"
@click="register"
v-hasPermi="['web:camera:reboot']"
>重启服务</el-button>
<el-button type="success" plain icon="el-icon-refresh" size="mini" @click="register"
v-hasPermi="['web:camera:reboot']">重启服务</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
@ -61,9 +32,9 @@ @@ -61,9 +32,9 @@
<el-table v-loading="loading" :data="cameraList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column min-width="60" align="center" label="序号">
<template slot-scope="scope">
<span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span>
</template>
<template slot-scope="scope">
<span>{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column label="设备名" align="center" prop="name" />
<el-table-column label="设备ip" align="center" prop="ip" />
@ -73,13 +44,17 @@ @@ -73,13 +44,17 @@
<el-table-column label="4G强度" align="center" prop="rssiLevel" />
<el-table-column label="状态" align="center" prop="status">
<template slot-scope="scope">
<span v-if="scope.row.status == 1"><el-tag type="success">在线</el-tag></span>
<span v-if="scope.row.status == 0"><el-tag type="info">离线</el-tag></span>
<span v-if="scope.row.status == 1">
<el-tag type="success">在线</el-tag>
</span>
<span v-if="scope.row.status == 0">
<el-tag type="info">离线</el-tag>
</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<!-- <el-button
<!-- <el-button
size="mini"
type="text"
icon="el-icon-setting"
@ -93,14 +68,9 @@ @@ -93,14 +68,9 @@
@click="showVideo(scope.row)"
v-hasPermi="['web:camera:remove']"
>查看视频</el-button> -->
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['web:camera:edit']"
>修改</el-button>
<!-- <el-button
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['web:camera:edit']">修改</el-button>
<!-- <el-button
size="mini"
type="text"
icon="el-icon-refresh"
@ -108,46 +78,41 @@ @@ -108,46 +78,41 @@
v-hasPermi="['web:camera:remove']"
v-loading.fullscreen.lock="fullscreenLoading"
>重启</el-button> -->
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['web:camera:remove']"
>删除</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['web:camera:remove']">删除</el-button>
<el-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)" v-hasPermi="['web:camera:remove']">
<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-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="showLog" 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-item command="autocfg" icon="el-icon-refresh" v-hasPermi="['web:camera:remove']">自动重启配置
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="getList" />
<!-- 添加或修改摄像机对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="序列号" prop="devsn">
<el-input v-model="form.devsn" placeholder="" :disabled="true"/>
<el-input v-model="form.devsn" placeholder="" :disabled="true" />
</el-form-item>
<el-form-item label="设备名" prop="name">
<el-input v-model="form.name" placeholder="请输入设备名" />
@ -181,7 +146,7 @@ @@ -181,7 +146,7 @@
<el-input v-model="ftp.form.password"></el-input>
</el-form-item>
<el-form-item label="FTP图片路径">
<el-input v-model="ftp.form.pathRule" type="textarea" :rows="3" ></el-input>
<el-input v-model="ftp.form.pathRule" type="textarea" :rows="3"></el-input>
</el-form-item>
</el-form>
</div>
@ -218,10 +183,67 @@ @@ -218,10 +183,67 @@
<el-button type="primary" @click="ftpConfirm"> </el-button>
</div>
</el-dialog>
<!-- 自动重启配置对话框 -->
<el-dialog title="自动重启配置" :visible.sync="restartcfg.open">
<div class="container">
<!-- 表单 -->
<div class="restartcfgform">
<el-form>
<el-form-item label="启用">
<el-switch v-model="restartcfg.run"></el-switch>
</el-form-item>
<el-select v-model="restartcfg.form.uWeekDay" placeholder="选择星期">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="parseInt(item.value)">
</el-option>
</el-select>
<el-time-select v-model="restartcfg.form.uHour" :picker-options="{
start: '00:00',
step: '01:00',
end: '23:00'
}" placeholder="选择时间">
</el-time-select>
</el-form>
</div>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="restartcfg.open = false"> </el-button>
<el-button type="primary" @click="restartcfgConfirm"> </el-button>
</div>
</el-dialog>
<!-- 日志详情对话框 -->
<el-dialog title="日志查询" :visible.sync="logform.open">
<div >
<!-- 表单 -->
<el-form :model="logform.queryForm" ref="queryForm" size="small" :inline="true" label-width="200px">
<el-date-picker v-model="timeStage" type="datetimerange" range-separator="" start-placeholder="开始日期"
end-placeholder="结束日期" @change="chooseTimeRange" :picker-options="setDateRange">
</el-date-picker>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">查询</el-button>
</el-form-item>
<el-table :data="logInfoList" stripe style="width: 100%">
<el-table-column label="记录时间" align="center" prop="clogTime" />
<el-table-column label="用户名" align="center" prop="coperUserName" />
<el-table-column label="主类型" align="center" prop="cmainType" />
<el-table-column label="次类型" align="center" prop="csubType" />
<el-table-column label="远程IP" align="center" prop="cremoteIP" />
</el-table>
</el-form>
</div>
</el-dialog>
</div>
</template>
<script>
import { formatDate } from "../../../utils/common";
export default {
name: "Camera",
data() {
@ -275,9 +297,85 @@ export default { @@ -275,9 +297,85 @@ export default {
isEnable: '',
devsn: ''
},
run: false,
width: '100px'
}
},
//
restartcfg: {
open: false,
form: {
id: '',
bEnable: '',
uHour: '',
uWeekDay: '',
},
run: false,
},
//
logform: {
open: false,
queryForm: {
id: '',
startTime: '',
endTime: ''
},
run: false,
},
logInfoList: [],
options: [{
value: '0',
label: '星期日'
}, {
value: '1',
label: '星期一'
}, {
value: '2',
label: '星期二'
}, {
value: '3',
label: '星期三'
}, {
value: '4',
label: '星期四'
}, {
value: '5',
label: '星期五'
}, {
value: '6',
label: '星期六'
}],
timeStage: [],
// *** data ***
setDateRange: {
//
onPick: ({
maxDate,
minDate
}) => {
if (minDate) { //
this.choiceDate0 = minDate.getTime();
} else { //
this.choiceDate0 = new Date();
}
if (maxDate) {
this.choiceDate0 = '';
}
},
disabledDate: (time) => {
let choiceDateTime = new Date(this.choiceDate0).getTime(); //
if (this.choiceDate0) {
//1514---
//1414*24*3600*1000=1209600000
return (time.getTime() > (choiceDateTime + 86400000)) || (time.getTime() < (choiceDateTime - 86400000));
}
},
},
};
},
created() {
@ -287,10 +385,10 @@ export default { @@ -287,10 +385,10 @@ export default {
/** 查询摄像机列表 */
async getList() {
this.loading = true;
let res = await this.$axiosGet('/web/camera/list',this.queryParams);
if(res.code === 0){
this.cameraList = res.data;
this.total = res.count;
let res = await this.$axiosGet('/web/camera/list', this.queryParams);
if (res.code === 0) {
this.cameraList = res.data;
this.total = res.count;
}
this.loading = false;
},
@ -316,13 +414,13 @@ export default { @@ -316,13 +414,13 @@ export default {
//
ftpCfgReset() {
this.ftp.form = {
address: '',
port: '',
username: '',
password: '',
pathRule: '',
isEnable: '',
devsn: ''
address: '',
port: '',
username: '',
password: '',
pathRule: '',
isEnable: '',
devsn: ''
};
this.resetForm("form");
},
@ -339,7 +437,7 @@ export default { @@ -339,7 +437,7 @@ export default {
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
@ -360,9 +458,15 @@ export default { @@ -360,9 +458,15 @@ export default {
case "showVideo":
this.showVideo(row);
break;
case "showLog":
this.showLog(row);
break;
case "reboot":
this.reboot(row);
break;
case "autocfg":
this.autocfg(row);
break;
default:
break;
}
@ -371,131 +475,194 @@ export default { @@ -371,131 +475,194 @@ export default {
async handleUpdate(row) {
this.reset();
const id = row.id || this.ids
let res = await this.$axiosGet('/web/camera/info/'+id);
if(res.code === 0){
this.form = res.data;
this.open = true;
this.title = "修改";
let res = await this.$axiosGet('/web/camera/info/' + id);
if (res.code === 0) {
this.form = res.data;
this.open = true;
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 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){
this.ftpCfgReset();
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});
if(res.code === 0){
this.ftp.form = res.data;
this.ftp.run = this.ftp.form.isEnable == 1;
this.ftp.open = true;
}
async openFtpCfg(row) {
this.ftpCfgReset();
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 });
if (res.code === 0) {
this.ftp.form = res.data;
this.ftp.run = this.ftp.form.isEnable == 1;
this.ftp.open = true;
}
},
// ftp
async ftpConfirm() {
this.ftp.form.isEnable = this.ftp.run ? 1 : 0;
let res = await this.$axiosPost('/camera/ftp/editNetCfg',this.ftp.form);
if(res.code === 0){
this.$modal.msgSuccess("修改成功");
this.ftp.open = false;
let res = await this.$axiosPost('/camera/ftp/editNetCfg', this.ftp.form);
if (res.code === 0) {
this.$modal.msgSuccess("修改成功");
this.ftp.open = false;
}
},
//
async autocfg(row) {
this.restartcfg.form.id = row.id;
const status = row.status;
if (status != 1) {
this.$modal.msg("设备未在线");
return;
}
let res = await this.$axiosGet('/web/camera/getautocfg/' + this.restartcfg.form.id);
if (res.code === 0) {
this.restartcfg.form = res.data;
if(this.restartcfg.form.uHour <10){
this.restartcfg.form.uHour="0"+this.restartcfg.form.uHour+":00"
}else{
this.restartcfg.form.uHour+=":00"
}
this.restartcfg.form.id = row.id;
this.restartcfg.run = this.restartcfg.form.bEnable == 1;
this.restartcfg.open = true;
}
},
//
async restartcfgConfirm() {
console.log(this.restartcfg.form)
this.restartcfg.form.bEnable = this.restartcfg.run ? 1 : 0;
this.restartcfg.form.uHour = this.restartcfg.form.uHour.substring(0, 2)
let res = await this.$axiosPost('/web/camera/setautocfg', this.restartcfg.form);
if (res.code === 0) {
this.$modal.msgSuccess("修改成功");
this.restartcfg.open = false;
}
},
reboot(row) {
const id = row.id;
const status = row.status;
if(status != 1){
if (status != 1) {
this.$modal.msg("设备未在线");
return;
}
this.$modal.confirm('是否确认重启?').then(() => {
this.exeReboot(id)
}).catch(() => {});
}).catch(() => { });
},
async exeReboot(id){
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
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);
if(res.code === 0){
// this.fullscreenLoading = false;
loading.close();
this.$modal.msgSuccess("执行成功,请稍等几分钟后继续操作");
this.getList();
let res = await this.$axiosGet('/web/camera/reboot/' + id);
if (res.code === 0) {
// this.fullscreenLoading = false;
loading.close();
this.$modal.msgSuccess("执行成功,请稍等几分钟后继续操作");
this.getList();
}
},
async showVideo(row) {
const id = row.id
const status = row.status;
if(status != 1){
if (status != 1) {
this.$modal.msg("设备未在线");
return;
}
let res = await this.$axiosGet('/web/camera/showVideo/'+id);
if(res.code === 500){
this.$modal.msg(res.msg);
let res = await this.$axiosGet('/web/camera/showVideo/' + id);
if (res.code === 500) {
this.$modal.msg(res.msg);
}
},
async showLog(row) {
this.logform.queryForm.id = row.id
const status = row.status;
if (status != 1) {
this.$modal.msg("设备未在线");
return;
}
this.logform.open = true;
},
chooseTimeRange() {
if (this.timeStage != null) {
this.logform.queryForm.startTime = formatDate(this.timeStage[0], 'yyyy-MM-dd hh:mm:ss');
this.logform.queryForm.endTime = formatDate(this.timeStage[1], 'yyyy-MM-dd hh:mm:ss');
}
},
async handleQuery() {
let res = await this.$axiosGet('/web/camera/getloginfo', this.logform.queryForm);
if (res.code === 0) {
this.logInfoList = res.data;
}
},
async register() {
let res = await this.$axiosGet('/web/camera/register');
if(res.code === 0){
this.$modal.msgSuccess("执行成功");
this.getList();
}
let res = await this.$axiosGet('/web/camera/register');
if (res.code === 0) {
this.$modal.msgSuccess("执行成功");
}
},
async addMethod(){
let res = await this.$axiosPost('/web/camera/add',this.form);
if(res.code === 0){
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
}
async addMethod() {
let res = await this.$axiosPost('/web/camera/add', this.form);
if (res.code === 0) {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
}
},
async editMethod(){
let res = await this.$axiosPost('/web/camera/edit',this.form);
if(res.code === 0){
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
}
async editMethod() {
let res = await this.$axiosPost('/web/camera/edit', this.form);
if (res.code === 0) {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
}
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
this.editMethod();
} else {
this.addMethod();
}
}
});
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
this.editMethod();
} else {
this.addMethod();
}
}
});
},
/** 删除按钮操作 */
async handleDelete(row) {
const ids = row.id || this.ids;
let res = await this.$axiosDelete('/web/camera/delete/'+ids);
if(res.code === 0){
this.$modal.msgSuccess("删除成功");
this.getList();
let res = await this.$axiosDelete('/web/camera/delete/' + ids);
if (res.code === 0) {
this.$modal.msgSuccess("删除成功");
this.getList();
}
},
/** 导出按钮操作 */
@ -509,44 +676,52 @@ export default { @@ -509,44 +676,52 @@ export default {
</script>
<style scoped>
.container {
display: flex;
}
.ftpform {
width: 300px;
margin-right: 50px;
}
.ftpform .el-form {
width: 100%;
}
.table {
flex: 1;
}
.head {
font-size: 24px;
line-height: 36px;
text-align: center;
height: 36px;
margin: 0 auto;
border-radius: 2px;
box-shadow:
1px 1px 2px hsla(200, 88%, 55%, .22),
inset -2px -2px 2px hsla(200, 88%, 55%, .22),
inset 0 0 1px hsla(200, 88%, 55%, .22);
}
.tips {
margin: 10px 0;
}
.tips span {
display: grid;
grid: 1fr/1fr 10px;
}
.notice {
color: #f33;
padding-right: 20px;
display: flex;
}
.notice div:first-child {
width: 80px;
}
.container {
display: flex;
}
.ftpform {
width: 300px;
margin-right: 50px;
}
.ftpform .el-form {
width: 100%;
}
.table {
flex: 1;
}
.head {
font-size: 24px;
line-height: 36px;
text-align: center;
height: 36px;
margin: 0 auto;
border-radius: 2px;
box-shadow:
1px 1px 2px hsla(200, 88%, 55%, .22),
inset -2px -2px 2px hsla(200, 88%, 55%, .22),
inset 0 0 1px hsla(200, 88%, 55%, .22);
}
.tips {
margin: 10px 0;
}
.tips span {
display: grid;
grid: 1fr/1fr 10px;
}
.notice {
color: #f33;
padding-right: 20px;
display: flex;
}
.notice div:first-child {
width: 80px;
}
</style>

Loading…
Cancel
Save