Compare commits

...

2 Commits

3 changed files with 295 additions and 48 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

View File

@ -272,8 +272,16 @@ export default {
const dom13 = document.querySelector('.login-form') const dom13 = document.querySelector('.login-form')
dom13.style.marginLeft = '34vw' dom13.style.marginLeft = '34vw'
break; break;
case '':
document.title = '汉丰湖Vlog短视频应用系统'
this.title = '汉丰湖Vlog短视频应用系统'
loginDom.style.backgroundImage = 'url(/images/vlog.png)'
this.redirect = '/index'
const dom133 = document.querySelector('.login-form')
dom133.style.marginLeft = '34vw'
dom133.style.border = 'none'
break;
default: default:
document.title = '' document.title = ''
loginDom.style.backgroundImage = 'url(/images/gangyin-bg.png)' loginDom.style.backgroundImage = 'url(/images/gangyin-bg.png)'
this.redirect = '/index' this.redirect = '/index'

View File

@ -1,6 +1,13 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<!-- <el-form-item label="设备名称" prop="equipName"> <!-- <el-form-item label="设备名称" prop="equipName">
<el-input <el-input
v-model="queryParams.equipName" v-model="queryParams.equipName"
@ -17,7 +24,10 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item>--> </el-form-item>-->
<el-form-item label="用户名" prop="userName"> <el-form-item
label="用户名"
prop="userName"
>
<el-input <el-input
v-model="queryParams.userName" v-model="queryParams.userName"
placeholder="请输入用户名" placeholder="请输入用户名"
@ -25,7 +35,10 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="用户id" prop="userId"> <el-form-item
label="用户id"
prop="userId"
>
<el-input <el-input
v-model="queryParams.userId" v-model="queryParams.userId"
placeholder="请输入用户id" placeholder="请输入用户id"
@ -42,12 +55,24 @@
/> />
</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
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</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-item>
</el-form> </el-form>
<el-row :gutter="10" class="mb8"> <el-row
:gutter="10"
class="mb8"
>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
type="primary" type="primary"
@ -68,6 +93,7 @@
:disabled="single" :disabled="single"
@click="handleUpdate" @click="handleUpdate"
v-hasPermi="['vlog:video:edit']" v-hasPermi="['vlog:video:edit']"
v-show="false"
>修改 >修改
</el-button> </el-button>
</el-col> </el-col>
@ -93,26 +119,108 @@
v-hasPermi="['vlog:video:export']" v-hasPermi="['vlog:video:export']"
>导出</el-button> >导出</el-button>
</el-col>--> </el-col>-->
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row> </el-row>
<el-table v-loading="loading" :data="videoList" @selection-change="handleSelectionChange" border> <div
<el-table-column type="selection" width="55" align="center"/> class="moving-video-grid"
<el-table-column label="设备名称" align="center" prop="equipName"/> v-loading="loading"
<el-table-column label="设备id" align="center" prop="equipId"/> >
<el-table-column label="用户名" align="center" prop="userName"/> <div
<el-table-column label="用户id" align="center" prop="userId"/> class="moving-video-card"
<el-table-column label="视频名称" align="center" prop="videoName"/> v-for="item, index in videoList"
<el-table-column label="时间" align="center" prop="videoTime" width="150"/> :key="index"
<el-table-column label="视频地址" align="center" prop="fileUrl" show-overflow-tooltip/> >
<video
:src="baseUrl + item.fileUrl"
class="moving-video-img"
controls
/>
<div class="moving-card-info">
<div class="moving-card-title">{{ item.equipName }}</div>
<div class="moving-card-time">
<span style="font-size: 12px;">{{ item.videoTime }}</span>
<el-button
type="text"
icon="el-icon-delete"
style="margin-left: 1rem;"
@click="handleDelete(item)"
v-hasPermi="['vlog:video:remove']"
>删除</el-button>
<el-button
type="text"
icon="el-icon-delete"
style="margin-left: 1rem;"
@click="handleUpdate(item)"
v-hasPermi="['vlog:video:edit']"
>修改</el-button>
</div>
</div>
</div>
</div>
<el-table
v-loading="loading"
:data="videoList"
v-show="false"
@selection-change="handleSelectionChange"
>
<el-table-column
type="selection"
width="55"
align="center"
/>
<el-table-column
label="设备名称"
align="center"
prop="equipName"
/>
<el-table-column
label="设备id"
align="center"
prop="equipId"
/>
<el-table-column
label="用户名"
align="center"
prop="userName"
/>
<el-table-column
label="用户id"
align="center"
prop="userId"
/>
<el-table-column
label="视频名称"
align="center"
prop="videoName"
/>
<el-table-column
label="时间"
align="center"
prop="videoTime"
width="150"
/>
<!-- <el-table-column label="视频地址" align="center" prop="fileUrl" />-->
<!-- <el-table-column label="图片" align="center" prop="phoneInfo" width="100"> <!-- <el-table-column label="图片" align="center" prop="phoneInfo" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<image-preview :src="scope.row.phoneInfo" :width="50" :height="50"/> <image-preview :src="scope.row.phoneInfo" :width="50" :height="50"/>
</template> </template>
</el-table-column>--> </el-table-column>-->
<!-- <el-table-column label="数据类型" align="center" prop="dataType" />--> <!-- <el-table-column label="数据类型" align="center" prop="dataType" />-->
<el-table-column label="备注" align="center" prop="remark"/> <el-table-column
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180"> label="备注"
align="center"
prop="remark"
/>
<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"
@ -150,34 +258,93 @@
/> />
<!-- 添加或修改运动视频管理对话框 --> <!-- 添加或修改运动视频管理对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> :title="title"
<el-form-item label="设备名称" prop="equipName"> :visible.sync="open"
<el-input v-model="form.equipName" placeholder="请输入设备名称"/> width="500px"
append-to-body
>
<el-form
ref="form"
:model="form"
:rules="rules"
label-width="80px"
>
<el-form-item
label="设备名称"
prop="equipName"
>
<el-input
v-model="form.equipName"
placeholder="请输入设备名称"
/>
</el-form-item> </el-form-item>
<el-form-item label="设备id" prop="equipId"> <el-form-item
<el-input v-model="form.equipId" placeholder="请输入设备id"/> label="设备id"
prop="equipId"
>
<el-input
v-model="form.equipId"
placeholder="请输入设备id"
/>
</el-form-item> </el-form-item>
<el-form-item label="用户名" prop="userName"> <el-form-item
<el-input v-model="form.userName" placeholder="请输入用户名"/> label="用户名"
prop="userName"
>
<el-input
v-model="form.userName"
placeholder="请输入用户名"
/>
</el-form-item> </el-form-item>
<el-form-item label="用户id" prop="userId"> <el-form-item
<el-input v-model="form.userId" placeholder="请输入用户id"/> label="用户id"
prop="userId"
>
<el-input
v-model="form.userId"
placeholder="请输入用户id"
/>
</el-form-item> </el-form-item>
<el-form-item label="视频名称" prop="videoName"> <el-form-item
<el-input v-model="form.videoName" placeholder="请输入视频名称"/> label="视频名称"
prop="videoName"
>
<el-input
v-model="form.videoName"
placeholder="请输入视频名称"
/>
</el-form-item> </el-form-item>
<el-form-item label="时间" prop="videoTime"> <el-form-item
<el-date-picker clearable label="视频时间"
prop="videoTime"
>
<el-date-picker
clearable
v-model="form.videoTime" v-model="form.videoTime"
type="datetime" type="datetime"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择时间" placeholder="请选择视频时间"
style="width: 100%"> style="width: 100%"
>
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="视频地址" prop="fileUrl"> <el-form-item
<el-input v-model="form.fileUrl" disabled/> label="视频地址"
prop="fileUrl"
>
<el-input v-model="form.fileUrl" />
</el-form-item>
<el-form-item
label="备注"
prop="remark"
>
<el-input
v-model="form.remark"
placeholder="请输入备注"
/>
</el-form-item>
<el-form-item label="视频上传">
<el-upload <el-upload
class="upload-demo" class="upload-demo"
ref="uploadFile" ref="uploadFile"
@ -189,8 +356,14 @@
:file-list="fileList" :file-list="fileList"
:auto-upload="true" :auto-upload="true"
> >
<el-button size="small" type="primary">上传视频</el-button> <el-button
<div slot="tip" class="el-upload__tip">只能上传mp4文件且不超过50M</div> size="small"
type="primary"
>上传视频</el-button>
<div
slot="tip"
class="el-upload__tip"
>只能上传mp4文件且不超过100M</div>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
@ -203,13 +376,25 @@
<el-input v-model="form.dataType" placeholder="请输入数据类型" /> <el-input v-model="form.dataType" placeholder="请输入数据类型" />
</el-form-item>--> </el-form-item>-->
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div
<el-button type="primary" @click="submitForm"> </el-button> slot="footer"
class="dialog-footer"
>
<el-button
type="primary"
@click="submitForm"
> </el-button>
<el-button @click="cancel"> </el-button> <el-button @click="cancel"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
<el-dialog title :visible="isShow" width="600px" @close="closeDialog" class="videoBox"> <el-dialog
title
:visible="isShow"
width="600px"
@close="closeDialog"
class="videoBox"
>
<video <video
:src="videoUrl" :src="videoUrl"
controls controls
@ -222,8 +407,8 @@
</template> </template>
<script> <script>
import {listVideo, getVideo, delVideo, addVideo, updateVideo} from "@/api/vlog/video"; import { listVideo, getVideo, delVideo, addVideo, updateVideo } from "@/api/vlog/video";
import {getToken} from "@/utils/auth"; import { getToken } from "@/utils/auth";
import request from "@/utils/request"; import request from "@/utils/request";
const dataType = "vlog" const dataType = "vlog"
@ -231,6 +416,7 @@ export default {
name: "Video", name: "Video",
data() { data() {
return { return {
baseUrl: process.env.VUE_APP_BASE_API,
// //
loading: true, loading: true,
// //
@ -271,7 +457,7 @@ export default {
// //
upload: { upload: {
// //
headers: {Authorization: "Bearer " + getToken()}, headers: { Authorization: "Bearer " + getToken() },
url: "/vlog/video/upload/file", url: "/vlog/video/upload/file",
// //
imageUrl: "", imageUrl: "",
@ -470,3 +656,56 @@ export default {
} }
}; };
</script> </script>
<style lang="scss" scoped>
@media screen and (min-width: 800px) {
.moving-video-grid {
grid-template-columns: repeat(2, 1fr);
}
}
@media screen and (min-width: 1200px) {
.moving-video-grid {
grid-template-columns: repeat(4, 1fr);
}
}
@media screen and (min-width: 1600px) {
.moving-video-grid {
grid-template-columns: repeat(6, 1fr);
}
}
@media screen and (min-width: 2000px) {
.moving-video-grid {
grid-template-columns: repeat(6, 1fr);
}
}
@media screen and (min-width: 2400px) {
.moving-video-grid {
grid-template-columns: repeat(8, 1fr);
}
}
@media screen and (min-width: 2800px) {
.moving-video-grid {
grid-template-columns: repeat(8, 1fr);
}
}
.moving-video-grid {
display: grid;
gap: 16px;
.moving-video-card {
border-radius: 8px;
box-shadow: 2px 2px 6px #25252525, -2px -2px 2px #14141414;
.moving-video-img {
width: 100%;
aspect-ratio: 1.7;
object-fit: cover;
}
.moving-card-info {
padding: 12px 16px;
.moving-card-title {
}
.moving-card-time {
margin-top: 10px;
}
}
}
}
</style>