页面修改 视频设备
This commit is contained in:
parent
690f8255f0
commit
38e3e63220
494
god-ui/src/views/videoSurveillance/videoEquipment/index.vue
Normal file
494
god-ui/src/views/videoSurveillance/videoEquipment/index.vue
Normal file
@ -0,0 +1,494 @@
|
||||
<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="reserveTwo">
|
||||
<el-input
|
||||
v-model="queryParams.reserveTwo"
|
||||
placeholder="请输入设备编码"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备名称" prop="reserveFour">
|
||||
<el-input
|
||||
v-model="queryParams.reserveFour"
|
||||
placeholder="请输入设备名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备状态" prop="reserveEight">
|
||||
<el-select v-model="queryParams.reserveEight" placeholder="请选择设备状态" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.sys_normal_disable"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="生产厂商" prop="reserveNine">
|
||||
<el-input
|
||||
v-model="queryParams.reserveNine"
|
||||
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="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
>新增
|
||||
</el-button>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">-->
|
||||
<!-- <el-button-->
|
||||
<!-- type="success"-->
|
||||
<!-- plain-->
|
||||
<!-- icon="el-icon-edit"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- :disabled="single"-->
|
||||
<!-- @click="handleUpdate"-->
|
||||
|
||||
<!-- >修改-->
|
||||
<!-- </el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <el-col :span="1.5">-->
|
||||
<!-- <el-button-->
|
||||
<!-- type="danger"-->
|
||||
<!-- plain-->
|
||||
<!-- icon="el-icon-delete"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- :disabled="multiple"-->
|
||||
<!-- @click="handleDelete"-->
|
||||
|
||||
<!-- >删除-->
|
||||
<!-- </el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <el-col :span="1.5">-->
|
||||
<!-- <el-button-->
|
||||
<!-- type="warning"-->
|
||||
<!-- plain-->
|
||||
<!-- icon="el-icon-download"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- @click="handleExport"-->
|
||||
|
||||
<!-- >导出-->
|
||||
<!-- </el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="qyzyWorkRedioList" @selection-change="handleSelectionChange">
|
||||
<!-- <el-table-column type="selection" width="55" align="center"/>-->
|
||||
<el-table-column label="设备编码" align="center" prop="reserveTwo"/>
|
||||
<el-table-column label="设备名称" align="center" prop="reserveFour"/>
|
||||
<el-table-column label="设备类型" align="center" prop="reserveFive">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.device_type_9290" :value="scope.row.reserveFive"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="设备用途" align="center" prop="reserveSix">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.device_use_9290" :value="scope.row.reserveSix"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="设备状态" align="center" prop="reserveEight">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.reserveEight"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="生产厂商" align="center" prop="reserveNine"/>
|
||||
<el-table-column label="生产日期" align="center" prop="reserveThree">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.reserveThree, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="质保日期" align="center" prop="reserveSeven">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.reserveSeven, '{y}-{m}-{d}') }}</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-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
>修改
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
>删除
|
||||
</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"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改AI识别算法开发对话框 -->
|
||||
<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="reserveTwo">
|
||||
<el-input v-model="form.reserveTwo" placeholder="请输入设备编码"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备名称" prop="reserveFour">
|
||||
<el-input v-model="form.reserveFour" placeholder="请输入设备名称"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备类型" prop="reserveFive">
|
||||
<el-select v-model="form.reserveFive" placeholder="请选择设备类型" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.device_type_9290"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备用途" prop="reserveSix">
|
||||
<el-select v-model="form.reserveSix" placeholder="请选择设备用途" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.device_use_9290"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备状态" prop="reserveEight">
|
||||
<el-select v-model="form.reserveEight" placeholder="请选择设备状态" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.sys_normal_disable"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="生产厂商" prop="reserveNine">
|
||||
<el-input v-model="form.reserveNine" placeholder="请输入生产厂商"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="生产日期" prop="reserveThree">
|
||||
<el-date-picker
|
||||
v-model="form.reserveThree"
|
||||
placeholder="请选择生产日期"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="质保日期" prop="reserveSeven">
|
||||
<el-date-picker
|
||||
v-model="form.reserveSeven"
|
||||
placeholder="请选择质保日期"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
>
|
||||
</el-date-picker>
|
||||
</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>
|
||||
import request from '@/utils/request'
|
||||
import { getToken } from '@/utils/auth'
|
||||
import {
|
||||
addGodUniversalElectricMeter,
|
||||
delGodUniversalElectricMeter,
|
||||
getGodUniversalElectricMeter,
|
||||
listGodUniversalElectricMeter,
|
||||
updateGodUniversalElectricMeter
|
||||
} from '@/api/aiRecognition/godUniversalElectricMeter'
|
||||
|
||||
export default {
|
||||
name: 'QyzyWorkRedio',
|
||||
dicts: ['sys_normal_disable', 'device_type_9290', 'device_use_9290'],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 作业监控视频管理表格数据
|
||||
qyzyWorkRedioList: [],
|
||||
// 弹出层标题
|
||||
title: '',
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
reserveOne: null,
|
||||
reserveTwo: null,
|
||||
reserveThree: null,
|
||||
reserveFour: null,
|
||||
reserveFive: null,
|
||||
reserveSix: null,
|
||||
reserveSeven: null,
|
||||
reserveEight: null,
|
||||
reserveNine: null,
|
||||
reserveTen: null,
|
||||
reserveEleven: null,
|
||||
reserveTwelve: null,
|
||||
reserveThirteen: null,
|
||||
reserveFourteen: null,
|
||||
sysType: null,
|
||||
moduleType: 'videoEquipment',
|
||||
dataType: '视频信息'
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
// workName: [
|
||||
// {required: true, message: '作业名称不能为空', trigger: 'blur'}
|
||||
// ]
|
||||
},
|
||||
// 附件信息表格数据
|
||||
fileInfoList: [],
|
||||
fileList: [],
|
||||
//文件上传参数
|
||||
upload: {
|
||||
// 设置上传的请求头部
|
||||
headers: { Authorization: 'Bearer ' + getToken() },
|
||||
// TODO 上传的地址
|
||||
url: '/species/video/upload/file',
|
||||
// 上传的图片地址
|
||||
imageUrl: '',
|
||||
//携带值
|
||||
data: {
|
||||
tableName: '',
|
||||
linkId: '',
|
||||
workId: ''
|
||||
}
|
||||
|
||||
},
|
||||
isShow: false,
|
||||
videoUrl: '',
|
||||
baseUrl: process.env.VUE_APP_BASE_API
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
// 视频播放
|
||||
playVideo(row) {
|
||||
this.isShow = true
|
||||
// 将接受的值赋值给src
|
||||
let url1 = row.reserveThree
|
||||
// this.videoUrl=this.baseUrl+"/profile/upload/2023/10/24/水果_20231024154211A001.mp4";
|
||||
this.videoUrl = this.baseUrl + url1
|
||||
},
|
||||
/**
|
||||
* 关闭视频
|
||||
*/
|
||||
closeDialog() {
|
||||
// 关闭弹框
|
||||
this.isShow = false
|
||||
this.videoUrl = '' // 清空数据 关闭视频播放
|
||||
},
|
||||
//提交上传
|
||||
submit() {
|
||||
this.submitUploadFiles()
|
||||
},
|
||||
handlePreview(file, fileList) {
|
||||
console.log('--->>预览文件', file)
|
||||
},
|
||||
beforeUploadFiles: (file, fileList) => {
|
||||
// 处理文件
|
||||
// 阻止默认上传事件
|
||||
return false
|
||||
},
|
||||
// 删除文件之前的钩子,参数为上传的文件和文件列表,若返回 false 或者返回 Promise 且被 reject,则停止删除。function(file, fileList)
|
||||
handleRemoveFiles(file, fileList) {
|
||||
this.fileList = fileList
|
||||
},
|
||||
handleChangeFiles(file, fileList) {
|
||||
this.fileList = fileList
|
||||
this.submitUploadFiles()
|
||||
},
|
||||
submitUploadFiles() {
|
||||
if (this.fileList.length === 0) {
|
||||
return this.$message.warning('请选取文件后再上传')
|
||||
}
|
||||
// 下面的代码将创建一个空的FormData对象:
|
||||
const formData = new FormData()
|
||||
// 你可以使用FormData.append来添加键/值对到表单里面;
|
||||
this.fileList.forEach((file) => {
|
||||
formData.append('files', file.raw)
|
||||
})
|
||||
|
||||
if (this.form.id && this.form.id !== 'null') {
|
||||
formData.set('workId', this.form.id)
|
||||
}
|
||||
formData.set('dataType', this.form.dataType)
|
||||
request({
|
||||
method: 'POST',
|
||||
url: this.upload.url, //填写自己的接口
|
||||
data: formData //填写包装好的formData对象
|
||||
}).then((res) => {
|
||||
if (res.code === 200) {
|
||||
this.$message.success('上传成功')
|
||||
// this.open = false;
|
||||
// this.getList();
|
||||
console.log('查看上传结果:', res)
|
||||
if (res.data) {
|
||||
this.form.reserveThree = res.data.fileUrl
|
||||
}
|
||||
} else {
|
||||
this.$message.error('上传失败')
|
||||
}
|
||||
//清空fileList
|
||||
this.fileList = []
|
||||
})
|
||||
// this.$refs.uploadFile.submit();
|
||||
},
|
||||
|
||||
/** 查询作业监控视频管理列表 */
|
||||
getList() {
|
||||
this.loading = true
|
||||
listGodUniversalElectricMeter(this.queryParams).then(response => {
|
||||
this.qyzyWorkRedioList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false
|
||||
this.reset()
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
reserveOne: null,
|
||||
reserveTwo: null,
|
||||
reserveThree: null,
|
||||
reserveFour: null,
|
||||
reserveFive: null,
|
||||
reserveSix: null,
|
||||
reserveSeven: null,
|
||||
reserveEight: null,
|
||||
reserveNine: null,
|
||||
reserveTen: null,
|
||||
reserveEleven: null,
|
||||
reserveTwelve: null,
|
||||
reserveThirteen: null,
|
||||
reserveFourteen: null,
|
||||
sysType: null,
|
||||
moduleType: 'videoEquipment',
|
||||
remark: null
|
||||
}
|
||||
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 = '添加视频设备'
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset()
|
||||
const id = row.id || this.ids
|
||||
getGodUniversalElectricMeter(id).then(response => {
|
||||
this.form = response.data
|
||||
this.open = true
|
||||
this.title = '修改视频设备'
|
||||
})
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs['form'].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateGodUniversalElectricMeter(this.form).then(response => {
|
||||
this.$modal.msgSuccess('修改成功')
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
} else {
|
||||
addGodUniversalElectricMeter(this.form).then(response => {
|
||||
this.$modal.msgSuccess('新增成功')
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids
|
||||
this.$modal.confirm('是否确认删除视频设备编号为"' + ids + '"的数据项?').then(function() {
|
||||
return delGodUniversalElectricMeter(ids)
|
||||
}).then(() => {
|
||||
this.getList()
|
||||
this.$modal.msgSuccess('删除成功')
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('aiRecognition/godUniversalElectricMeter/export', {
|
||||
...this.queryParams
|
||||
}, `godUniversalElectricMeter_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
Loading…
Reference in New Issue
Block a user