Browse Source

youhua

master
4670101279 2 years ago
parent
commit
54da8af39c
  1. 24
      src/views/data/photo/index.vue
  2. 15
      src/views/statistic/river/river.vue
  3. 319
      src/views/web/camera/index.vue

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

@ -45,9 +45,9 @@
<div class="card" v-for="item in currdataList" :key="item.stnmId"> <div class="card" v-for="item in currdataList" :key="item.stnmId">
<!-- <img src="../../../assets/images/water.jpg" @click="show('http://localhost:81/control/static/img/water.8d19122d.jpg')"> --> <!-- <img src="../../../assets/images/water.jpg" @click="show('http://localhost:81/control/static/img/water.8d19122d.jpg')"> -->
<el-image style="width: 300px;" <el-image style="width: 300px;"
src="http://123.207.216.86/test.jpg" src="https://www.huastech.com.cn/test.jpg"
:preview-src-list="srcList" :preview-src-list="srcList"
@click="show('http://123.207.216.86/test.jpg')" @click="show('https://www.huastech.com.cn/test.jpg')"
></el-image> ></el-image>
<div class="info"> <div class="info">
<div class="station"> <div class="station">
@ -85,16 +85,16 @@ export default {
total: 100, total: 100,
// //
currdataList: [ currdataList: [
{stnmId: 1,stnm:'鄞州公园',ip:'123.2.4.1',value:'2.95',tm: '2022-06-08 13:00:00'}, {stnmId: 1,stnm:'鄞州公园',ip:'123.2.4.1',value:'1.37',tm: '2022-06-08 13:00:00'},
{stnmId: 2,stnm:'鄞州公园',ip:'123.2.4.1',value:'2.95',tm: '2022-06-09 12:55:00'}, {stnmId: 2,stnm:'鄞州公园',ip:'123.2.4.1',value:'1.37',tm: '2022-06-08 12:55:00'},
{stnmId: 3,stnm:'鄞州公园',ip:'123.2.4.1',value:'2.95',tm: '2022-06-09 12:50:00'}, {stnmId: 3,stnm:'鄞州公园',ip:'123.2.4.1',value:'1.37',tm: '2022-06-08 12:50:00'},
{stnmId: 4,stnm:'鄞州公园',ip:'123.2.4.1',value:'2.95',tm: '2022-06-09 12:45:00'}, {stnmId: 4,stnm:'鄞州公园',ip:'123.2.4.1',value:'1.37',tm: '2022-06-08 12:45:00'},
{stnmId: 5,stnm:'鄞州公园',ip:'123.2.4.1',value:'2.95',tm: '2022-06-09 12:40:00'}, {stnmId: 5,stnm:'鄞州公园',ip:'123.2.4.1',value:'1.37',tm: '2022-06-08 12:40:00'},
{stnmId: 6,stnm:'鄞州公园',ip:'123.2.4.1',value:'2.95',tm: '2022-06-09 12:35:00'}, {stnmId: 6,stnm:'鄞州公园',ip:'123.2.4.1',value:'1.37',tm: '2022-06-08 12:35:00'},
{stnmId: 7,stnm:'鄞州公园',ip:'123.2.4.1',value:'2.95',tm: '2022-06-09 12:30:00'}, {stnmId: 7,stnm:'鄞州公园',ip:'123.2.4.1',value:'1.37',tm: '2022-06-08 12:30:00'},
{stnmId: 8,stnm:'鄞州公园',ip:'123.2.4.1',value:'2.95',tm: '2022-06-09 12:25:00'}, {stnmId: 8,stnm:'鄞州公园',ip:'123.2.4.1',value:'1.37',tm: '2022-06-08 12:25:00'},
{stnmId: 9,stnm:'鄞州公园',ip:'123.2.4.1',value:'2.95',tm: '2022-06-09 12:20:00'}, {stnmId: 9,stnm:'鄞州公园',ip:'123.2.4.1',value:'1.37',tm: '2022-06-08 12:20:00'},
{stnmId: 10,stnm:'鄞州公园',ip:'123.2.4.1',value:'2.95',tm: '2022-06-09 12:15:00'}, {stnmId: 10,stnm:'鄞州公园',ip:'123.2.4.1',value:'1.37',tm: '2022-06-08 12:15:00'},
], ],
// //
queryParams: { queryParams: {

15
src/views/statistic/river/river.vue

File diff suppressed because one or more lines are too long

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

@ -0,0 +1,319 @@
<template>
<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-form-item>
<el-form-item label="序列号" prop="devsn">
<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>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<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-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-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-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<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>
</el-table-column>
<el-table-column label="设备名" align="center" prop="name" />
<el-table-column label="设备ip" align="center" prop="ip" />
<el-table-column label="设备序列号" align="center" prop="devsn" />
<el-table-column label="首次注册时间" align="center" prop="firstTime" />
<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>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-search"
@click="showVideo(scope.row)"
v-hasPermi="['web:camera:edit']"
>查看视频</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"
@click="reboot(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>
</template>
</el-table-column>
</el-table>
<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-form-item>
<el-form-item label="设备名" prop="name">
<el-input v-model="form.name" placeholder="请输入设备名" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
name: "Camera",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
cameraList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
name: null,
ip: null,
port: null,
username: null,
password: null,
devsn: null,
status: null
},
//
form: {},
//
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询摄像机列表 */
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;
}
this.loading = false;
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
name: null,
ip: null,
port: null,
username: null,
password: null,
devsn: null,
status: "0"
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加摄像机";
},
/** 修改按钮操作 */
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 = "修改";
}
},
async reboot(row) {
const id = row.id;
const status = row.status;
if(status != 1){
this.$modal.msg("设备未在线");
return;
}
let res = await this.$axiosGet('/web/camera/reboot/'+id);
if(res.code === 0){
this.$modal.msgSuccess("执行成功");
this.getList();
}
},
async showVideo(row) {
const id = row.id
const status = row.status;
if(status != 1){
this.$modal.msg("设备未在线");
return;
}
let res = await this.$axiosGet('/web/camera/showVideo/'+id);
},
async register() {
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 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();
}
}
});
},
/** 删除按钮操作 */
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();
}
},
/** 导出按钮操作 */
handleExport() {
this.download('web/camera/export', {
...this.queryParams
}, `camera_${new Date().getTime()}.xlsx`)
}
}
};
</script>
Loading…
Cancel
Save