|
@@ -1,149 +0,0 @@
|
|
|
-<template>
|
|
|
- <div>
|
|
|
- <div class="form">
|
|
|
- <el-button type="primary">编辑首页视频</el-button>
|
|
|
- <div class="form-right">
|
|
|
- <el-form ref="queryFormRef" :model="formState.queryParams" :inline="true">
|
|
|
- <el-form-item label="实景视频" prop="videoType">
|
|
|
- <el-select v-model="formState.queryParams.videoType" placeholder="请选择" clearable>
|
|
|
- <el-option v-for="dict in formState.options" :key="dict.value" :label="dict.label" :value="dict.value" />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item prop="name">
|
|
|
- <el-input v-model="formState.queryParams.name" placeholder="请输入摄像头名称" clearable @keyup.enter="handleQuery" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item>
|
|
|
- <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
|
|
- <el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="video-list">
|
|
|
- <div v-for="(item, index) in formState.listData" :key="index" class="video-box">
|
|
|
- <div class="video-header">
|
|
|
- <span>{{ item.label }}</span>
|
|
|
- <span>{{ item.time }}</span>
|
|
|
- </div>
|
|
|
- <div class="video-content">
|
|
|
- <div v-if="item.checked" class="tip-text">首页展示</div>
|
|
|
- <video :src="item.url" controls muted style="width: 100%; height: 100%;background: #000;" />
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div style="width: 100%;display: flex;justify-content: center;">
|
|
|
- <pagination
|
|
|
- :total="formState.total"
|
|
|
- :page="formState.queryParams.page"
|
|
|
- :limit="formState.queryParams.limit"
|
|
|
- @pagination="getList"
|
|
|
- />
|
|
|
- </div>
|
|
|
- </div>
|
|
|
-</template>
|
|
|
-
|
|
|
-<script lang="ts" setup>
|
|
|
-const queryFormRef = ref<ElFormInstance>();
|
|
|
-const formState = reactive({
|
|
|
- queryParams: {
|
|
|
- videoType: '',
|
|
|
- name: '',
|
|
|
- page: 1,
|
|
|
- limit: 10
|
|
|
- },
|
|
|
- total: 100,
|
|
|
- options: [
|
|
|
- { label: '全景视频', value: '1' },
|
|
|
- { label: '普通视频', value: '2' }
|
|
|
- ],
|
|
|
- listData: [],
|
|
|
- activeIds: []
|
|
|
-});
|
|
|
-
|
|
|
-const getList = () => {
|
|
|
- const listData = [
|
|
|
- { id: 1, label: '摄像头一', img: '', url: 'https://vjs.zencdn.net/v/oceans.mp4', time: '17:14' },
|
|
|
- { id: 2, label: '摄像头二', url: 'https://vjs.zencdn.net/v/oceans.mp4', time: '17:14' },
|
|
|
- { id: 3, label: '摄像头三', url: 'https://vjs.zencdn.net/v/oceans.mp4', time: '17:14' },
|
|
|
- { id: 4, label: '摄像头四', url: 'https://vjs.zencdn.net/v/oceans.mp4', time: '17:14' },
|
|
|
- { id: 5, label: '摄像头五', url: 'https://vjs.zencdn.net/v/oceans.mp4', time: '17:14' },
|
|
|
- { id: 6, label: '摄像头六', url: 'https://vjs.zencdn.net/v/oceans.mp4', time: '17:14' },
|
|
|
- { id: 7, label: '摄像头七', url: 'https://vjs.zencdn.net/v/oceans.mp4', time: '17:14' },
|
|
|
- { id: 8, label: '摄像头八', url: 'https://vjs.zencdn.net/v/oceans.mp4', time: '17:14' },
|
|
|
- { id: 9, label: '摄像头九', url: 'https://vjs.zencdn.net/v/oceans.mp4', time: '17:14' },
|
|
|
- { id: 10, label: '摄像头十', url: 'https://vjs.zencdn.net/v/oceans.mp4', time: '17:14' }
|
|
|
- ];
|
|
|
- formState.activeIds = [1, 2, 3, 4, 6, 7];
|
|
|
- listData.forEach((item) => {
|
|
|
- const index = formState.activeIds.findIndex((item2) => item2 === item.id);
|
|
|
- item.checked = index > -1;
|
|
|
- });
|
|
|
- formState.listData = listData;
|
|
|
-};
|
|
|
-
|
|
|
-const handleQuery = () => {
|
|
|
-
|
|
|
-};
|
|
|
-/** 重置按钮操作 */
|
|
|
-const resetQuery = () => {
|
|
|
- queryFormRef.value?.resetFields();
|
|
|
- handleQuery();
|
|
|
-};
|
|
|
-
|
|
|
-onMounted(() => {
|
|
|
- getList();
|
|
|
-});
|
|
|
-</script>
|
|
|
-
|
|
|
-<style lang="scss" scoped>
|
|
|
-.form {
|
|
|
- display: flex;
|
|
|
- justify-content: space-between;
|
|
|
-}
|
|
|
-.video-list {
|
|
|
- display: flex;
|
|
|
- flex-wrap: wrap;
|
|
|
- .video-box {
|
|
|
- width: 943px;
|
|
|
- margin-right: 46px;
|
|
|
- &:nth-child(1),
|
|
|
- &:nth-child(2),
|
|
|
- &:nth-child(3),
|
|
|
- &:nth-child(4),
|
|
|
- &:nth-child(5) {
|
|
|
- margin-bottom: 15px;
|
|
|
- }
|
|
|
- &:nth-child(5),
|
|
|
- &:nth-child(10) {
|
|
|
- margin-right: 0;
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-.video-box {
|
|
|
- cursor: pointer;
|
|
|
- .video-header {
|
|
|
- background-color: #7f7f7f;
|
|
|
- padding: 0 10px;
|
|
|
- font-size: 30px;
|
|
|
- color: #fff;
|
|
|
- display: flex;
|
|
|
- justify-content: space-between;
|
|
|
- align-items: center;
|
|
|
- }
|
|
|
- .video-content {
|
|
|
- padding: 15px;
|
|
|
- background-color: #ccc;
|
|
|
- height: 600px;
|
|
|
- position: relative;
|
|
|
- .tip-text {
|
|
|
- position: absolute;
|
|
|
- top: 0;
|
|
|
- left: 0;
|
|
|
- background-color: #ec808d;
|
|
|
- color: #fff;
|
|
|
- font-size: 32px;
|
|
|
- padding: 15px 40px;
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-</style>
|