当前位置: 首页 > news >正文

input改造文件上传,el-table的改造,点击上传,拖拽上传,多选上传

第一个input标签效果

第二个input标签的效果

el-table的改造效果

<template><div class="outerBox"><div class="analyze" v-if="status"><div class="unFile"><div class="mainBox"><img class="picture" src="../../static/images/upload.png" /><div class="title">上传.log文件进行解析</div><div class="clickBtn"><div class='notisfyWord'>上传内容</div><inputtype="file"id="fileInput"@change="handleFileChange"accept=".log"style="width:100%;height:100%;cursor: pointer;opacity:0"/></div></div></div></div><div class="fileBox" v-if="!status"><div class="upload"><div>上传.log文件进行解析<inputtype="file"id="fileInput"@change="handleFileChange"accept=".log"style="width:100%;height:100%;opacity:0;cursor:pointer;position:absolute;top:0;left:0;"/></div><div class="fileName">{{ fileName }}</div></div><div class="tableStyle"><el-table:data="tableData"height="70vh"style="width: 100%":header-row-style="{color: 'white',}":row-style="{color: 'white',}":cell-style="{textAlign: 'center',border: '1px solid #0a1641',}":header-cell-style="{textAlign: 'center',background: '#222d54',border: '1px solid #222d54',}":row-class-name="tableRowClassName"v-loading="loading"><el-table-column prop="sourceTime" label="时间" width="180"></el-table-column><el-table-column prop="item" label="事项" width="150"></el-table-column><!-- <el-table-column prop="msg" label="描述"> </el-table-column> --><el-table-column prop="source" label="来源" width="100"></el-table-column><el-table-column prop="subsystem" label="子系统"> </el-table-column><el-table-column prop="level" label="严重等级"> </el-table-column><el-table-column prop="value" label="值"> </el-table-column></el-table><!-- <el-paginationclass="pagination"@size-change="handleSizeChange"@current-change="handleCurrentChange":current-page.sync="currentPage1":page-size="100"layout="total, prev, pager, next":total="1000"></el-pagination> --></div></div></div>
</template><script>
export default {data() {return {loading: true,tableData: [],fileName: "",status: true,tableTotal:'',pageSize:100,midTableData: [],test:[{item:'qqqqq',unusual:'1'},{item:'qqqqq',unusual:'0'},{item:'qqqqq',unusual:'0'},{item:'qqqqq',unusual:'1'},]};},mounted() {this.tableRowClassName;},methods: {clickBtn() {document.getElementById("fileInput").click();},handleFileChange(event) {const file = event.target.files[0];const fileType = file.name.split('.').pop();if(fileType != 'log'){this.$message.error('请上传.log文件');return}if(file.size >  50 * 1024){this.$message.error('最小上传文件大小为50k');return}this.fileName = file.name;this.status = false;// 模拟异步setTimeout(()=>{this.loading = falsethis.tableData = this.test;},2000)},tableRowClassName({ row, rowIndex }) {if (row.unusual === '0') {return "selected-row";} else {return "selected-rows";}},handleCurrentChange(val) {const start = val * 100const end = (val + 1) * 100},},
};
</script><style scoped>
::v-deep .selected-row {background-color: #e4d33d !important;
}
::v-deep .selected-rows {background-color: #0a1641 !important;
}
.outerBox {background: linear-gradient(180deg, #eaf4ff 0%, #042f61 100%);
}
.analyze {width: 100%;height: 100%;padding: 0 !important;display: flex;justify-content: center;
}.upload {margin-top: 10px;line-height: 40px;display: flex;justify-content: center;align-items: center;color: white;font-size: 15px;background-color: #045fcb;border-radius: 7px;margin-bottom: 10px;position: relative;cursor: pointer;
}.selected-row {background-color: #e4d33d !important;
}.tableStyle {width: 100%;/* background-color: #094b97; */
}.el-button {color: white !important;background: linear-gradient(180deg, #82dde1 0%, #4bb8c0 100%) !important;
}.exportBtn {position: absolute;right: 10px;bottom: 10px;
}.unFile {width: 50%;height: 40%;display: flex;justify-content: center;align-items: center;margin-top: 15%;background-color: #094b97;border-radius: 10px;border: 3px dashed #d4e1f3;overflow: hidden;
}.picture {width: 150px;
}.mainBox {display: flex;flex-direction: column;align-items: center;
}.title {color: white;font-size: 15px;display: flex;justify-content: center;
}.clickBtn {overflow: hidden;opacity:1;color: white;border-radius: 5px;background-color: #2188ff;width:150px;height:50px;font-size: 15px;cursor: pointer;position: relative;
}
.notisfyWord{cursor: pointer;position: absolute;left:50%;top:50%;transform: translate(-50%,-50%);
}
.fileBox {background-color: #0a1642;padding: 10px;
}
.fileName {margin-left: 10px;
}
.pagination {display: flex;justify-content: right;
}
::v-deep .el-table--enable-row-hover .el-table__body tr:hover > td {color: black !important;background-color: #0460cb !important;
}::v-deep .el-table__empty-text {color: white !important;
}
::v-deep .el-table__body-wrapper {background-color: #0a1641 !important;
}
::v-deep .el-table::before {background-color: #0a1642;
}
::v-deep .el-table .el-table__cell.gutter {background-color: #0a1642;
}
</style>

input支持拖拽上传但要设置opcity为0,不能设置diaplay:none或者visiables

  如果不使用拖拽上传的话,只点击上传可使用如下

          <divclass="clickBtn"@click="clickBtn">上传内容</div><inputtype="file"id="fileInput"@change="handleFileChange"style="display: none"/>clickBtn(){console.log("clickFackBtn");document.getElementById('fileInput').click()},handleFileChange(event) {const file = event.target.files[0];console.log(file);},

input同时也支持多选文件上传<input mutilple/>

相关文章:

input改造文件上传,el-table的改造,点击上传,拖拽上传,多选上传

第一个input标签效果 第二个input标签的效果 el-table的改造效果 <template><div class"outerBox"><div class"analyze" v-if"status"><div class"unFile"><div class"mainBox"><img clas…...

申请实用新型专利需要的时间

1、咨询 确定发明创造的内容是否属于可以申请专利的内容&#xff1b;对此咨询&#xff0c;建议多咨询几家专利代理机构后对比确定正确的结论。因为当前很多的专利代理机构的资讯接待员是的工资都是提成制的&#xff0c;为了业务量&#xff0c;有时对咨询会有不恰当的回复。确定…...

Redis 主从复制和哨兵监控,实现Redis高可用配置

文章目录 一、概述二、主从复制模拟说明三、准备配置文件四、启动Redis实例五、主从复制配置5.1 命令方式启用和取消主从复制5.2 配置文件方式启用和取消主从复制5.3 测试主从复制5.4 有其主从复制的其他参数配置 六、Sentinel 配置6.1 Sentinel 的作用6.2 Sentinel 监控说明6.…...

虹科直播 | CDS网络与数据安全专题技术直播重磅来袭,11.2起与您精彩相约

文章来源&#xff1a;虹科网络安全 阅读原文&#xff1a;https://mp.weixin.qq.com/s/T-CgU28hmYy4YV5SV9QGhg 虹科数据加密解决方案 虹科终端安全防护方案 虹科是在各细分专业技术领域内的资源整合及技术服务落地供应商&#xff0c;虹科网络安全事业部的宗旨是&#xff1a;让…...

nginx加权轮询,upstream,Keepalive,负载均衡实现案例

1. nginx 加权轮询, weight是权重配置。 #配置上游服务器 upstream tomcats {server 192.168.1.173:8080 weight=1;server 192.168.1.174:8080 weight=2;server 192.168.1.175:8080 weight=5; } server{liste...

java代理示例

以上代码通过Apache HttpComponents库&#xff0c;使用Java其中&#xff0c;proxy_host参数为代理服务器的主机名&#xff0c;proxy_port参数为服务器的端口号。程序首先创建了一个HttpGet对象&#xff0c;然后创建了一个HttpClient对象。接着&#xff0c;设置了HttpGet对象的U…...

51单片机汽车胎压大气气压测量仪仿真设计_数码管显示(代码+仿真+设计报告+讲解)

51单片机汽车胎压大气气压测量仪仿真设计_数码管显示 (代码仿真设计报告讲解) 仿真原版本&#xff1a;proteus 7.8 程序编译器&#xff1a;keil 4/keil 5 编程语言&#xff1a;C语言 设计编号&#xff1a;S0018 目录 51单片机汽车胎压大气气压测量仪仿真设计_数码管显示功…...

mac idea 解决0% classes 0% lines covered不显示,非快捷键办法

问题如下 网上说了一堆快捷键&#xff0c;冲突了用不了&#xff0c;页面按下面这样点就可以了点击no coverage就行了...

Fabric.js 复制粘贴元素

本文简介 点赞 关注 收藏 学会了 当你要复制一个 fabric 的元素时&#xff0c;你考虑到的是什么&#xff1f;是深拷贝当前选中对象再添加到画布中&#xff1f; 其实&#xff0c;fabric.js 提供了一个克隆方法&#xff0c;在 fabric.js 官网的案例里也有这个demo&#xff1a…...

rstudio server 服务器卡死了怎么办

欢迎关注weixin:生信小博士 #rstudio 卡死了怎么办 cd ~/.local/share/ ls rm -fr rstudio.old mv ~/.rstudio ~/.rstudio.oldcd ~/.config/ rm -fr .rstudio.old mv ~/.config/rstudio/ ~/.config/rstudio.oldps -ef|grep t040413 |grep rsession |awk {print $2}| xarg…...

贪心算法学习——加油站

目录 一&#xff0c;题目 二&#xff0c;题目接口 三&#xff0c;解题思路及其代码 一&#xff0c;题目 在一条环路上有 n 个加油站&#xff0c;其中第 i 个加油站有汽油 gas[i] 升。 你有一辆油箱容量无限的的汽车&#xff0c;从第 i 个加油站开往第 i1 个加油站需要消耗汽油…...

Android 字符串工具类

Java基础大佬勿喷&#xff0c;小白专属&#xff01; public class StringUtils {// 判断字符串是否为空public static boolean isEmpty(String str) {return str null || str.trim().isEmpty();}// 判断字符串是否为非空public static boolean isNotEmpty(String str) {retur…...

有了InheritableThreadLocal为啥还需要TransmittableThreadLocal?

有了InheritableThreadLocal为啥还需要TransmittableThreadLocal&#xff1f; 典型回答 InheritableThreadLocal是用于主子线程之间参数传递的&#xff0c;但是&#xff0c;这种方式有一个问题&#xff0c;那就是必须要是在主线程中手动创建的子线程才可以&#xff0c;而现在池…...

结构伪类选择器

伪类选择器&#xff1a;用来描述一个元素的特殊状态&#xff01;比如第一个元素、某个元素的子元素、鼠标点击的元素 1 first-child/last-child /*ul的第一个子元素*/ ul li:first-child{ background: #0f35ad; } /*ul的最后一个子元素*/ ul li:last-child{ background: #0f3…...

java-- 静态数组

1.静态初始化数组 定义数组的时候直接给数组赋值。 2.静态初始化数组的格式&#xff1a; 注意&#xff1a; 1."数据类型[] 数组名"也可以写成"数据类型 数组名[]"。 2.什么类型的数组只能存放什么类型的数据 3.数组在计算机中的基本原理 当计算机遇到…...

世界经济论坛:ChatGPT等生成式AI,对全球23%岗位产生巨大影响

世界经济论坛与全球最大上市咨询公司之一埃森哲合作&#xff0c;联合发布了《未来工作&#xff1a;大语言模型与就业》白皮书。 世界经济论坛表示&#xff0c;随着ChatGPT、Midjourney、Github Copilot等生成式AI的飞速发展&#xff0c;对全球经济和劳动市场产生巨大影响。未来…...

myTracks for Mac:GPS轨迹记录器的强大与便捷

你是否曾经在户外活动或旅行中&#xff0c;希望能够记录下你的移动轨迹&#xff1f;或者在工作中&#xff0c;需要跟踪你的行程路线&#xff1f;myTracks for Mac 是一款强大的 GPS 轨迹记录器&#xff0c;它可以帮助你实现这些愿望。 myTracks 是一款专门为 Mac 设计的 GPS 轨…...

Macos视频增强修复工具:Topaz Video AI for mac

Topaz Video AI是一款使用人工智能技术对视频进行增强和修复的软件。它可以自动降噪、去除锐化、减少压缩失真、提高清晰度等等。Topaz Video AI可以处理各种类型的视频&#xff0c;包括低分辨率视频、老旧影片、手机录制的视频等等。 使用Topaz Video AI非常简单&#xff0c;…...

如何在IDEA中配置指定JDK版本?轻松解决!!!

有时候我们在导入项目&#xff0c;如果手动在IDEA中指定jdk版本&#xff0c;往往启动项目会报错误。 因此当我们新引入项目启动不了时可以检查一下自己IDEA中的jdk版本是否正确。 下面以配置jdk版本为11显示步骤&#xff1a; 1、配置 Project Structure 1.1、通过快捷键&qu…...

思维导图软件 ConceptDraw MINDMAP mac中文特色介绍

ConceptDraw MINDMAP mac是一款思维导图绘制软件&#xff0c;它可以帮助用户快速创建各种类型的思维导图&#xff0c;如组织结构图、流程图、概念图和UML图等。该软件具有直观的界面和简单易用的操作方式&#xff0c;使得用户能够轻松地创建复杂的思维导图。此外&#xff0c;它…...

【根据当天日期输出明天的日期(需对闰年做判定)。】2022-5-15

缘由根据当天日期输出明天的日期(需对闰年做判定)。日期类型结构体如下&#xff1a; struct data{ int year; int month; int day;};-编程语言-CSDN问答 struct mdata{ int year; int month; int day; }mdata; int 天数(int year, int month) {switch (month){case 1: case 3:…...

ES6从入门到精通:前言

ES6简介 ES6&#xff08;ECMAScript 2015&#xff09;是JavaScript语言的重大更新&#xff0c;引入了许多新特性&#xff0c;包括语法糖、新数据类型、模块化支持等&#xff0c;显著提升了开发效率和代码可维护性。 核心知识点概览 变量声明 let 和 const 取代 var&#xf…...

中南大学无人机智能体的全面评估!BEDI:用于评估无人机上具身智能体的综合性基准测试

作者&#xff1a;Mingning Guo, Mengwei Wu, Jiarun He, Shaoxian Li, Haifeng Li, Chao Tao单位&#xff1a;中南大学地球科学与信息物理学院论文标题&#xff1a;BEDI: A Comprehensive Benchmark for Evaluating Embodied Agents on UAVs论文链接&#xff1a;https://arxiv.…...

MySQL用户和授权

开放MySQL白名单 可以通过iptables-save命令确认对应客户端ip是否可以访问MySQL服务&#xff1a; test: # iptables-save | grep 3306 -A mp_srv_whitelist -s 172.16.14.102/32 -p tcp -m tcp --dport 3306 -j ACCEPT -A mp_srv_whitelist -s 172.16.4.16/32 -p tcp -m tcp -…...

AI书签管理工具开发全记录(十九):嵌入资源处理

1.前言 &#x1f4dd; 在上一篇文章中&#xff0c;我们完成了书签的导入导出功能。本篇文章我们研究如何处理嵌入资源&#xff0c;方便后续将资源打包到一个可执行文件中。 2.embed介绍 &#x1f3af; Go 1.16 引入了革命性的 embed 包&#xff0c;彻底改变了静态资源管理的…...

docker 部署发现spring.profiles.active 问题

报错&#xff1a; org.springframework.boot.context.config.InvalidConfigDataPropertyException: Property spring.profiles.active imported from location class path resource [application-test.yml] is invalid in a profile specific resource [origin: class path re…...

Pinocchio 库详解及其在足式机器人上的应用

Pinocchio 库详解及其在足式机器人上的应用 Pinocchio (Pinocchio is not only a nose) 是一个开源的 C 库&#xff0c;专门用于快速计算机器人模型的正向运动学、逆向运动学、雅可比矩阵、动力学和动力学导数。它主要关注效率和准确性&#xff0c;并提供了一个通用的框架&…...

ubuntu系统文件误删(/lib/x86_64-linux-gnu/libc.so.6)修复方案 [成功解决]

报错信息&#xff1a;libc.so.6: cannot open shared object file: No such file or directory&#xff1a; #ls, ln, sudo...命令都不能用 error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory重启后报错信息&…...

2.3 物理层设备

在这个视频中&#xff0c;我们要学习工作在物理层的两种网络设备&#xff0c;分别是中继器和集线器。首先来看中继器。在计算机网络中两个节点之间&#xff0c;需要通过物理传输媒体或者说物理传输介质进行连接。像同轴电缆、双绞线就是典型的传输介质&#xff0c;假设A节点要给…...

边缘计算网关提升水产养殖尾水处理的远程运维效率

一、项目背景 随着水产养殖行业的快速发展&#xff0c;养殖尾水的处理成为了一个亟待解决的环保问题。传统的尾水处理方式不仅效率低下&#xff0c;而且难以实现精准监控和管理。为了提升尾水处理的效果和效率&#xff0c;同时降低人力成本&#xff0c;某大型水产养殖企业决定…...