v-for循环<el-form-item>时应用popover

在Element-UI的表单组件中,当使用v-for循环渲染多个包含popover的el-form-item时,可能出现popover失效的情况。通过绑定每个popover的引用(ref)和索引(index),可以确保每个popover正确响应。文章提供了一个代码示例,展示了如何在循环中动态绑定popover并使其正常工作。

element-ui使用v-for循环el-form-item,如果循环的每栏都有popover,v-for 渲染多个 popover,
那么使用指令v-popover指向 Popover 的索引ref的方式触发,popover会失效
解决:

    <el-form ref="form" :model="form" label-width="80px">
      <el-row>
        <el-col
          :span="24"
        >
          固定列
        </el-col>
      </el-row>
      <el-form-item label="config0" >
        <el-input v-model="form.config0"></el-input>
      </el-form-item>
      
      <el-row>
        <el-col
          :span="24"
        >
          循环列
        </el-col>
        <div v-for="(item, index) in form.list" :key="index">
          <el-form-item v-if="item.ishow" :label="item.label">
            <el-input v-model="item.content">
              <i slot="prefix" class="el-input__icon el-icon-s-tools"></i>
              <el-popover
                placement="top-start"
                trigger="hover"
                slot="suffix"
              >
                <div>
                  <div>Edit</div>
                  <div>Add</div>
                  <div>Delete</div>
                </div>
                <i slot="reference" class="el-input__icon el-icon-more"></i>
              </el-popover>
            </el-input>
          </el-form-item>
        </div>
      </el-row>
    </el-form>

	  // 数据
      form: {
        config0: 'test',
        list: [
          {
            label: 'config1',
            content: 'despeic',
            ishow: true
          },
          {
            label: 'config2',
            content: 'scapje',
            ishow: true
          },
          {
            label: 'config3',
            content: 'interstiewn', 
            ishow: true
          }
        ],
      },

效果:
popover可以正常使用
在这里插入图片描述
在这里插入图片描述

在这里插入图片描述

<div v-for="(process, index) in formData.processes" :key="index" class="process-row" > <el-row :gutter="20"> <!-- 工序名称 --> <el-col :span="3"> <el-form-item :prop="`processes.${index}.processName`" :rules="rules.processName" label="名称" > <el-input v-model="process.processName" placeholder="工序名称" /> </el-form-item> </el-col> <!-- 英语名称 --> <el-col :span="3"> <el-form-item :prop="`processes.${index}.englishName`" :rules="rules.englishName" label="英文名" > <el-input v-model="process.englishName" placeholder="English Name" /> </el-form-item> </el-col> <!-- 流程卡内容 --> <el-col :span="4"> <el-form-item label="流程卡内容"> <el-input v-model="process.cardContent" type="textarea" :autosize="{ minRows: 1, maxRows: 3}" /> </el-form-item> </el-col> <!-- 间参数组 --> <el-col :span="8"> <el-row :gutter="10"> <el-col :span="6"> <el-form-item label="等待(h)" prop="processWatitime"> <el-input v-model="process.processWatitime" /> </el-form-item> </el-col> <el-col :span="6"> <el-form-item label="运行(H)" prop="machineRuntime"> <el-input v-model="process.machineRuntime" /> </el-form-item> </el-col> <el-col :span="6"> <el-form-item label="set_up"> <el-input v-model="process.setuptime" placeholder="min/pcs" /> </el-form-item> </el-col> <el-col :span="6"> <el-form-item label="人工"> <el-input v-model="process.labortime" placeholder="min/pcs" /> </el-form-item> </el-col> </el-row> </el-col> <!-- 单位/数量 --> <el-col :span="3"> <el-row :gutter="10"> <el-col :span="12"> <el-form-item label="单位"> <el-input v-model="process.routerUnit" /> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="数量"> <el-input v-model="process.quantity" /> </el-form-item> </el-col> </el-row> </el-col> <!-- 状态/代码 --> <el-col :span="3"> <el-row :gutter="10"> <el-col :span="12"> <el-form-item label="状况"> <el-select v-model="process.routerStatus" placeholder="状态"> <el-option v-for="dict in dict.type.router_status" :key="dict.value" :label="dict.label" :value="dict.value" /> </el-select> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="代码"> <el-input v-model="process.processCode" /> </el-form-item> </el-col> </el-row> </el-col> <!-- 操作按钮 --> <el-col :span="1"> <el-button type="danger" icon="el-icon-delete" circle @click="removeProcess(index)" /> </el-col> </el-row> </div>修改布局,描述字段在上方,对应数据在下,而且能显示
最新发布
09-28
<el-upload class="custom-uploader" style="display: inline;float:right; margin-top: 10px" action="#" ref="fileupload" :multiple="true" :on-change="change" :limit="10" :auto-upload="false" accept="application/pdf" :show-file-list="false"> <el-button class="upload-btn" size="medium" type="text" plain>附件更新 <i class="el-icon-upload el-icon--right"></i> </el-button> </el-upload> <b class="levelonetitle">附件</b> <div id="visitexcel"> <div> <!-- 表格 --> <el-table id="el-table" :data="localVisitexcelData" v-loading="loading" element-loading-text="加载中,请稍候..." border max-height="540" :header-cell-class-name="headerRow" :row-style="{height:'40px'}" :cell-style="{padding:'7px 0'}"> <!-- <el-table-column prop="附件文件名" label="附件文件名" width="720" align="center"> </el-table-column> --> <el-table-column v-for="(value, key) in localVisitexcelData[0]" :key="key" prop="fileName" label="文件名" align="center" ></el-table-column> <el-table-column label="操作" align="center"> <template slot-scope="scope"> <el-button size="mini" icon="el-icon-view" @click="handleView(scope.$index, scope.row)"> 查阅 </el-button> <!-- 删除按钮漂浮框 --> <el-popover width="160" :ref="`popover-${scope.$index}`" placement="left"> <p>文件删除后无法恢复,请确认 <span style="color:red">删除?</span> </p> <div style="text-align: right; margin: 0"> <el-button type="text" size="mini" @click="scope._self.$refs[`popover-${scope.$index}`].doClose()"> 取消 </el-button> <el-button type="danger" size="mini" @click="handleDelete(scope)">确定</el-button> </div> <el-button type="danger" size="mini" icon="el-icon-delete" style="margin-left:10px" slot="reference">删除</el-button> </el-popover> </template> </el-table-column> </el-table> </div> change (file, fileList) { //验证文件格式 let fileinfo = fileList.pop(); let name = fileinfo.name; let type = name.substring(name.lastIndexOf('.'), name.length); let size = fileinfo.size / 1024; if (type.toLowerCase() === '.pdf' && size < 20000) { this.loading = true; let param = new FormData(); //form 表单 param.append("file", fileinfo.raw); param.append("fileType", "附件"); param.append("id", this.requirementinfo.id); param.append("requirement", this.requirementinfo.requirement); param.append("department", this.requirementinfo.department); param.append("requirementtime", this.requirementinfo.requirementtime); let config = { //multipart/form-data headers: { 'Content-Type': 'multipart/form-data' }, url: "/requirement/requirementinfo/uploadrequirementfile", method: "post", data: param } request(config).then( res => { this.loading = false; let type = res.data.success ? "success" : "error"; this.$message({ showClose: true, message: res.data.msg, type: type, duration: 12000 }); this.getfilenames(); } ).catch(err => { this.loading = false; this.$message({ showClose: true, message: "发生未知错误,请稍候重试", type: "error", duration: 12000 }); }) } else { this.$message({ showClose: true, message: "请选择PDF文件上传,文件大小20M以内", type: "error" }); } getfilenames () { this.localVisitexcelData = [];//表格内容置空,然后在插入 let param = { id: this.requirementinfo.id, requirement: this.requirementinfo.requirement, filetype: "附件" } // console.log('getfilenames 返回的教师信息1:', this.requirementinfo); let config = { url: "/requirement/requirementinfo/getRequirementFileTableData", method: "get", params: param } request(config).then( res => { let data = res.data; let fileNameList = data.list; for (let i = 0; i < fileNameList.length; i++) { let tempname = { fileName: fileNameList[i] }; this.localVisitexcelData.push(tempname); } console.log('localVisitexcelData信息:', localVisitexcelData); }) }, 以上代码本来是想实现将新上传的PDF文件名加到表格中,但是最终呈现出来的效果是el-table重复加载了好几遍文件名,比如原来el-table中有AAA.PDF,现在上传BBB.PDF和CCC.PDF,结果el-table中显示为AAA.PDF、BBB.PDF、CCC.PDF、AAA.PDF、BBB.PDF、CCC.PDF、AAA.PDF、BBB.PDF、CCC.PDF,明明代码中每change一次localVisitexcelData 都被清空了,为什么会出现这个问题
09-02
<template> <div> <div class="access"> <div class="access-system"> <TitleName text="平台接入系统" width="166px"></TitleName> <div class="access-left flex-right"> <div class="access-left-item" v-for="(v, i) in access" :key="i"> <div class="access-left-text" @click="accessSystem(v.text)">{{ v.data }}</div> <div class="access-left-item-text">{{ v.text }}</div> </div> </div> </div> <div class="access-statistics"> <TitleName text="平台接入统计" width="182px"></TitleName> <div class="access-right flex-left"> <div class="access-left-item" v-for="(v2, i2) in total" :key="i2"> <div :class="v2.text == '单位总计' ? 'access-left-text' : 'access-left-text2'" @click="todevice(v2.text, '')"> {{ v2.data }} </div> <div class="access-left-item-text">{{ v2.text }}</div> </div> </div> </div> </div> <!-- 添加CustomDialog组件 --> <CustomDialog v-model:visible="elevatorVisible" :title="elevatorTitle"> <!-- 电梯监控列表 --> <el-button type="primary" @click="openAddDialog" style="margin-top: -20px">新增</el-button> <el-table :data="elevatorData" v-loading="elevatorloading"> <el-table-column property="name" show-overflow-tooltip label="名称" /> <el-table-column property="deviceCode" show-overflow-tooltip label="设备编号" /> <el-table-column property="status" label="状态" width="60"> <template #default="{ row }"> <!-- <el-icon :color="row.status === 1 ? 'green' : 'red'"> <SuccessFilled v-if="row.status === 1" /> <CircleCloseFilled v-else /> </el-icon> --> {{ row.status === 1 ? '在线' : '离线' }} </template> </el-table-column> <el-table-column property="createTime" :formatter="formatDateTime" label="创建间" /> <el-table-column property="updateTime" :formatter="formatDateTime" label="修改间" /> <el-table-column label="操作" width="200px"> <template #default="{ row }"> <el-button style="margin-left: 5px" size="small" @click="openPlay(row)">播放</el-button> <el-button style="margin-left: 5px" size="small" @click="openEitd(row)">修改</el-button> <el-button style="margin-left: 5px" size="small" @click="openwarning(row)">预警</el-button> <!-- <el-button style="margin-left: 5px" @click="openwarning(row)" size="small">预警</el-button> --> </template> </el-table-column> </el-table> <!-- 分页组件 --> <div class="pagination-container"> <el-pagination v-model:current-page="pagination.currentPage" v-model:page-size="pagination.pageSize" :page-sizes="[5, 10, 20, 30]" :total="pagination.total" layout="total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange" @current-change="handleCurrentChange" /> </div> </CustomDialog> <!-- 新增 --> <CustomDialog v-model:visible="addVisible" :title="addTitle" typeEit="" style="height: 350px; width: 650px"> <el-form label-width="120px" style="max-width: 600px; margin-top: 10px" :model="ruleForm" status-icon class="demo-ruleForm"> <el-form-item label="身份证" prop="id"> <el-input v-model="ruleForm.id" placeholder="请输入身份证号" /> </el-form-item> <el-form-item label="名字" prop="name"> <el-input v-model="ruleForm.name" placeholder="名字" /> </el-form-item> <el-form-item label="设备代码" prop="deviceCode"> <el-input v-model="ruleForm.deviceCode" placeholder="请输入设备代码" /> </el-form-item> <el-form-item label="创建间" prop="createTime"> <el-date-picker style="width: 480px" v-model="ruleForm.createTime" type="datetime" placeholder="请选择" /> </el-form-item> <el-form-item label="更新间" prop="updateTime"> <el-date-picker style="width: 480px" v-model="ruleForm.updateTime" type="datetime" placeholder="请选择" /> </el-form-item> </el-form> <div style="width: 95%; display: flex; justify-content: flex-end"> <el-button type="primary" style="background-color: #153b63" @click="submitForm">确定</el-button> </div> </CustomDialog> <!-- 预警图片展示 --> <CustomDialog v-model:visible="warningVisible" :title="warningTitle" :mountShow="mountShow"> <el-table :data="warningData" v-loading="warningLoading" height="600px"> <el-table-column property="deviceCode" show-overflow-tooltip label="设备编号" /> <el-table-column property="status" label="状态" width="60"> <template #default="{ row }"> {{ row.status === 1 ? '在线' : '离线' }} </template> </el-table-column> <el-table-column prop="img" label="图片"> <template #default="{ row }"> <el-image v-for="(item, idx) in row.img.split(',')" :key="idx" :src="`/img/${item}`" :zoom-rate="1.2" :max-scale="7" :min-scale="0.2" preview-teleported="true" show-progress :preview-src-list="row.img.split(',').map((i: any) => `/img/${i}`)" fit="cover" style="width: 50px; height: 50px" /> </template> </el-table-column> <el-table-column property="createTime" :formatter="formatDateTime" label="创建间" /> </el-table> <div class="pagination-container"> <el-pagination v-model:current-page="warningPage.currentPage" v-model:page-size="warningPage.pageSize" :page-sizes="[5, 10, 20]" :total="warningPage.total" layout="total, sizes, prev, pager, next, jumper" @size-change="warningSizeChange" @current-change="warningCurrentChange" /> </div> </CustomDialog> <div class="center-video" v-if="open"> <vue3videoPlay width="1200px" height="700" v-if="open" style="object-fit: cover" :autoPlay="options.autoPlay" :control="options.control" :loop="options.loop" :muted="options.muted" :src="`http://36.138.229.106:9092/hls/${videoUrl}.m3u8`" type="m3u8" /> <el-button class="close-btn" @click="closePlay">关闭 X</el-button> </div> </div> <!-- @click="todevice('', v2.text)" --> </template> <script lang="ts"> import { defineComponent, ref, defineEmits, onMounted, reactive, nextTick } from 'vue'; import TitleName from './TitleName.vue'; import { ElMessage, ElPopover, ElTooltip } from 'element-plus'; import { statisticsPlatform, statisticsPlatformResDataCurrent, statisticsSystemResDataCurrent } from '@/request/statisticsPlatform'; import { statisticsSystem } from '@/request/statisticsSystem'; import router from '@/router'; import CustomDialog from '@/components/CustomDialog.vue'; import vue3videoPlay from 'vue3-video-play'; // 引入npm i vue3-video-play --save import 'vue3-video-play/dist/style.css'; // 引入css样式 import WarningView from '@/UnitHome/WarningView.vue'; import dayjs from 'dayjs'; export default defineComponent({ components: { TitleName, CustomDialog, vue3videoPlay, }, setup(props, context) { const visible = ref(false); const total = ref<any[]>([]); const access = ref<any[]>([]); const elevatorVisible = ref(false); // 控制弹窗显示 const elevatorTitle = ref('电梯视频监控'); // 弹窗标题 const elevatorData = ref(); //电梯监控表格 const elevatorloading = ref(true); // const addVisible = ref(false); // 控制弹窗显示 const open = ref(false); // 电梯监控视频播放弹窗显示 const addTitle = ref<'新增电梯视频监控' | '修改电梯视频监控'>('新增电梯视频监控'); // 弹窗标题 const dialogType = ref<'add' | 'edit'>('add'); // 默认新增 const videoUrl = ref(''); //视频地址 const warningVisible = ref(false); // 预警弹窗 const warningTitle = ref('预警图片展示'); // 预警弹窗标题 const warningData = ref(); //预警列表 const warningLoading = ref(false); //预警loding const mountShow = ref(false); const videoPlayer = ref<HTMLVideoElement>(); interface VideoOptions { autoPlay: boolean; loop: boolean; control: boolean; muted: boolean; type: string; } const options = ref<VideoOptions>({ type: 'm3u8', //视频类型 autoPlay: true, //是否自动播放 loop: false, //是否循环播放 control: true, //是否显示控制条 muted: true, //静音 }); // 表单字段信息 const ruleForm = ref({ id: '', name: '', deviceCode: '', createTime: '', updateTime: '', }); // 分页参数 const pagination = ref({ currentPage: 1, pageSize: 10, total: 0, }); // 分页参数 const warningPage = ref({ currentPage: 1, pageSize: 10, total: 0, }); const resData = ref<statisticsSystemResDataCurrent>({ electronic: 0, water: 0, wireless: 0, surveillance: 0, fire: 0, elevator: 0, }); const resData2 = ref<statisticsPlatformResDataCurrent>({ unit: 0, sensor: 0, building: 0, surveillance: 0, equipment: 0, camera: 0, }); const iconClick = (v: any) => { console.log(321); }; const popoverData = ref({}); // 初始化数据 const fetchData = async () => { statisticsPlatform().then((res: any) => { resData2.value = res; total.value = [ { text: '单位总计', icon: require('../res/17.png'), data: resData2.value.unit, }, { text: '传感器总计', icon: require('../res/16.png'), data: resData2.value.sensor, }, // { // text: '建筑总计', // icon: require('../res/15.png'), // data: resData2.value.building, // }, { text: '监控点总计', icon: require('../res/14.png'), data: resData2.value.camera, }, { text: '消防设备总计', icon: require('../res/13.png'), data: resData2.value.equipment, }, { text: '视频设备总计', icon: require('../res/12.png'), data: resData2.value.surveillance, }, ]; }); statisticsSystem().then((res: any) => { resData.value = res; access.value = [ { text: '电气火灾系统', icon: require('../res/22.png'), data: resData.value.electronic, }, { text: '消防水源系统', icon: require('../res/21.png'), data: resData.value.water, }, { text: '无线报警系统', icon: require('../res/20.png'), data: resData.value.wireless, }, { text: '视频监控系统', icon: require('../res/19.png'), data: resData.value.surveillance, }, { text: '火灾报警系统', icon: require('../res/18.png'), data: resData.value.fire, }, { text: '电梯视频监控', icon: require('../res/18.png'), data: resData.value.fire, }, ]; }); }; const todevice = (v: string, v2: string) => { if (v.indexOf('总计') != -1 && v != '单位总计') { return; } if (v == '单位总计') { v = ''; } sessionStorage.Record2Id = JSON.stringify({ id: '', type: '', deviceType: v, page: 1, limit: 20, }); sessionStorage.deviceTitle = v2; router.push('/unitdevice'); }; // 获取电梯数据(带分页) const fetchElevatorData = async () => { elevatorloading.value = true; try { const response = await fetch( `http://36.138.229.106:9091/yuShiDevice/getList?pageSize=${pagination.value.pageSize}&pageNo=${pagination.value.currentPage}` ); const res = await response.json(); elevatorData.value = res.data?.records || []; pagination.value.total = res.data?.total || 0; } catch (error) { console.error('获取电梯数据失败:', error); ElMessage.error('获取电梯数据失败'); } finally { elevatorloading.value = false; } }; const handleSizeChange = (val: number) => { pagination.value.pageSize = val; fetchElevatorData(); }; // 当前页改变 const handleCurrentChange = (val: number) => { pagination.value.currentPage = val; fetchElevatorData(); }; // 电梯视频监控数据列表 const accessSystem = (v: string) => { // 如果是电梯视频建监控,显示弹窗而不是跳转 if (v == '电梯视频监控') { elevatorVisible.value = true; // 重置分页参数 pagination.value.currentPage = 1; pagination.value.pageSize = 10; fetchElevatorData(); return; } }; // 事件格式转换 const formatDateTime = (row: any, column: any, cellValue: any) => { if (!cellValue) return '-'; return dayjs(cellValue).format('YYYY-MM-DD HH:mm:ss'); }; // 新增设备弹窗打开 const openAddDialog = () => { dialogType.value = 'add'; ruleForm.value = { // 重置表单 id: '', name: '', deviceCode: '', createTime: '', updateTime: '', }; addVisible.value = true; return; }; // 新增表单 const submitForm = async () => { const data = ruleForm.value; const opt = { id: Number(data?.id), name: data?.name, deviceCode: data?.deviceCode, // createTime: dayjs(data?.createTime).format('YYYY-MM-DD HH:mm:ss'), // updateTime: dayjs(data?.updateTime).format('YYYY-MM-DD HH:mm:ss'), }; if (ruleForm.value && dialogType.value == 'add') { console.log('表单数据:', ruleForm.value); // 新增保存接口 fetch('http://36.138.229.106:9091/yuShiDevice/deviceInset', { method: 'POST', // 指定请求方法 headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ ...opt, }), }) .then((res: any) => { addVisible.value = false; ElMessage.success('新增成功'); fetchElevatorData(); }) .catch((error) => console.error('Error:', error)); } else { // 修改接口 fetch('http://36.138.229.106:9091/yuShiDevice/deviceUpdate', { method: 'POST', // 指定请求方法 headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ ...opt, }), }) .then((res: any) => { addVisible.value = false; ElMessage.success('修改成功'); fetchElevatorData(); }) .catch((error) => console.error('Error:', error)); } }; // 修改设备 const openEitd = (data: any) => { dialogType.value = 'edit'; addTitle.value = '修改电梯视频监控'; addVisible.value = true; ruleForm.value = { ...data }; }; // 视频播放 const openPlay = (row: any) => { fetch(`http://36.138.229.106:9091/yuShiDevice/yuShi?deviceId=${row.deviceCode}&type=${1}`) .then((res: any) => { videoUrl.value = row.deviceCode; open.value = true; }) .catch((error) => { console.error('获取视频数据失败:', error); ElMessage.error('获取视频数据失败'); }); // 错误处理 }; // 删除播放视频 const closePlay = async () => { if (videoUrl.value) { console.log(videoUrl.value, 'deviceCode.value'); open.value = false; try { const response = await fetch(`http://36.138.229.106:9091/yuShiDevice/yuShi?deviceId=${videoUrl.value}&type=${2}`); console.log(response, 'response'); } catch (error) { console.error('删除失败:', error); ElMessage.error('删除视频数据失败'); } } }; const deviceCode = ref(); // // 当前页改变 const warningCurrentChange = (val: number) => { warningPage.value.currentPage = val; fetcWarningData(); }; const warningSizeChange = (val: number) => { warningPage.value.pageSize = val; fetcWarningData(); }; // 获取预警数据 const fetcWarningData = async () => { warningLoading.value = true; try { const response = await fetch( `http://36.138.229.106:9091/yuShiDevice/alarmList?deviceId=${deviceCode.value}&pageSize=${warningPage.value.pageSize}&pageNo=${warningPage.value.currentPage}` ); const res = await response.json(); warningLoading.value = false; warningData.value = res.data?.records || []; warningPage.value.total = res.data?.total || 0; } catch (error) { console.error('获取视频数据失败:', error); ElMessage.error('获取视频数据失败'); } }; // 预警操作 const openwarning = async (row: any) => { warningVisible.value = true; mountShow.value = true; deviceCode.value = row.deviceCode; // 重置分页参数 warningPage.value.currentPage = 1; warningPage.value.pageSize = 10; fetcWarningData(); }; // 组件挂载获取数据 onMounted(fetchData); return { access, total, visible, todevice, accessSystem, elevatorVisible, elevatorTitle, elevatorData, elevatorloading, formatDateTime, pagination, handleSizeChange, handleCurrentChange, openAddDialog, addVisible, addTitle, ruleForm, submitForm, openEitd, dialogType, openPlay, videoPlayer, videoUrl, open, options, closePlay, warningVisible, warningTitle, openwarning, warningData, warningLoading, warningSizeChange, warningCurrentChange, warningPage, mountShow, }; }, }); </script> <style lang="scss" scoped> .access { display: flex; justify-content: space-between; align-items: center; margin-top: 25px; margin-bottom: 10px; width: 356px; box-sizing: border-box; } .access-system, .access-statistics { display: flex; flex-direction: column; // padding-left: 8px; } .access-system { .access-left { display: flex; justify-content: space-around; align-items: center; flex-wrap: wrap; } } .access-left-item { white-space: nowrap; height: 55px; display: flex; flex-direction: column; justify-content: center; align-items: center; .access-left-text { cursor: pointer; color: #00ffff; font-size: 18px; border-bottom: 2px solid #00ffff; } .access-left-text2 { cursor: pointer; color: #00ffff; font-size: 18px; } } .access-left-item-box { width: 37px; height: 37px; border-radius: 50%; display: flex; cursor: pointer; justify-content: center; align-items: center; .access-left-item-icon { width: 37px; height: 37px; border-radius: 50%; } } .access-left-item-text { width: 72px; height: 14px; font-size: 10px; font-family: AlibabaPuHuiTi_2_55_Regular-, AlibabaPuHuiTi_2_55_Regular; font-weight: normal; color: #0283c2; text-align: center; margin-top: 8px; line-height: 12px; } .access-left, .access-right { width: 165px; height: 240px; display: flex; justify-content: space-around; align-items: center; flex-wrap: wrap; background: linear-gradient(180deg, rgba(1, 76, 131, 0.145) 0%, rgba(1, 76, 131, 0.11) 100%); border-radius: 3px 3px 3px 3px; } .flex-left { align-self: flex-start; } .flex-right { align-self: flex-end; } .popover { width: 100px; min-width: 0px !important; position: relative; height: 100px; font-size: 12px; background-color: #081343; color: #ffffff; text-align: center; box-shadow: 1px 1px 8px 2px #00ffff; border-radius: 3px; left: -12px; top: -13px; .popover-hr { height: 1px; width: 100%; background: linear-gradient( 90deg, rgba(1, 76, 131, 0.6) 0%, rgba(1, 76, 131, 0) 0%, rgba(0, 255, 255, 1) 52%, rgba(1, 76, 131, 0) 95%, rgba(1, 76, 131, 0.5) 100% ); } .popover-hr2 { position: absolute; left: 187px; top: 0; height: 190px; width: 1px !important; background: linear-gradient( 180deg, rgba(1, 76, 131, 0.6) 0%, rgba(1, 76, 131, 0) 0%, rgba(0, 255, 255, 1) 52%, rgba(1, 76, 131, 0) 95%, rgba(1, 76, 131, 0.5) 100% ); } .popover-hr3 { position: absolute; right: 187px; top: 0px; height: 190px; width: 1px !important; background: linear-gradient( 180deg, rgba(1, 76, 131, 0.6) 0%, rgba(1, 76, 131, 0) 0%, rgba(0, 255, 255, 1) 52%, rgba(1, 76, 131, 0) 95%, rgba(1, 76, 131, 0.5) 100% ); } > div { display: flex; width: 100px; height: 100px; > div { flex: 1; padding-top: 26px; } } .num { cursor: pointer; font-size: 17px; color: #00ffff; } } </style> <style lang="scss" scoped> /* 确保弹窗的 z-index 足够高 */ :deep(.el-dialog) { z-index: 2000 !important; } /* 确保图片预览的 z-index 高于弹窗 */ :deep(.el-image-viewer__wrapper) { z-index: 3000 !important; } // 视频样式 .center-video { position: fixed; top: 20%; left: 17%; z-index: 999999999; padding: 30px; background: rgba(0, 0, 0, 0.7); /* 可选:添加半透明背景 */ border-radius: 8px; .close-btn { position: absolute; top: 10px; /* 调整与顶部的距离 */ right: 10px; /* 调整与右侧的距离 */ z-index: 99999999999; background: rgba(255, 255, 255, 0.3); border: none; color: white; padding: 5px 10px; border-radius: 4px; cursor: pointer; } .close-btn:hover { background: rgba(255, 255, 255, 0.5); } } /* 添加分页样式 */ .pagination-container { margin-top: 12px; display: flex; justify-content: flex-end; :deep(.el-pager li) { background-color: #081242; color: #014c83; } :deep(.el-pager li.is-active) { color: #00ffff; border: 1px solid; } :deep(.el-pagination button) { background-color: #014c83; color: #279ee0; } :deep(.el-pagination__goto) { // background-color: #014c83; font-size: 12px; color: #279ee0; } :deep(.el-pagination__classifier) { background-color: #014c83; color: #279ee0; } :deep(.el-input__wrapper) { background-color: #014c83; color: #00ffff; } :deep(.el-input__inner) { color: #00ffff; } :deep(.el-input) { --el-input-border-color: #014c83; } } </style> 上面代码vue3+ts优化vue3videoPlay 插件打开链接候服务器上传还没成功有延迟 这种情况怎么解决
06-14
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值