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

vue el-table表格中每行上传文件(上传简历)操作

1、HTML中

 <el-table :data="formInfo.userListDto" border stripe max-height="400"><el-table-column type="index" label="序号" width="50"> </el-table-column><el-table-column prop="realName" label="姓名" show-overflow-tooltip></el-table-column><el-table-column prop="birthday" label="出生年月" show-overflow-tooltip></el-table-column><el-table-column prop="orgName" label="所在单位" show-overflow-tooltip></el-table-column><el-table-column prop="postName" label="职务" show-overflow-tooltip></el-table-column><el-table-column prop="jobRankName" label="职级" show-overflow-tooltip></el-table-column><el-table-column prop="jobExpertiseName" label="工作专长" show-overflow-tooltip></el-table-column><el-table-column prop="" label="操作" width="700"><template slot-scope="scope"><el-uploadref="upload"class="upload-demo"action="#":on-change="(file, fileList) => {handleChange(file, fileList, scope)}":on-remove="(file, fileList) => {handleRemove(file, fileList, scope)}":limit="1":on-exceed="handleExceed":auto-upload="false"><span class="opera-img">上传简历</span></el-upload></template></el-table-column>
</el-table>

在这里插入图片描述

2、JS中

 //监控上传文件列表
handleChange(file, fileList, scope) {this.formInfo.userListDto[scope.$index].fileIdList.push(file.name)
},
handleRemove(file, fileList, scope) {this.formInfo.userListDto[scope.$index].fileIdList = []
},
handleExceed() {this.$tips.tipWarning(`个人简历只能上传一个文件`)
},

3、注意点

1、通过scope把上传的文件和表格中的行一一对应
2、上传后要把返回的数据push到表格数组中,删除后要把表格数组中的数据删除

展示:
在这里插入图片描述

http://www.lryc.cn/news/251531.html

相关文章:

  • Python批量图像处理--图片重命名、图片旋转
  • 第五天 用Python批量处理Excel文件,实现自动化办公
  • mybatis整合(手动添加jar包方式)
  • leetcode - 矩阵区域和
  • 头歌JUnit单元测试相关实验进阶
  • 【kafka实践】11|消费位移提交
  • Mac卸载、安装Python
  • 算法——滑动窗口
  • 带头双向循环链表:一种高效的数据结构
  • C++基础 -34- 输入输出运算符重载
  • MimicGen论文分析与资料汇总
  • JAVA-每一页PDF转图片
  • VS安装QT VS Tools编译无法通过
  • 【C语言之 CJson】学CJson看这一篇就够了
  • 使用Java语言实现字母之间的大小写转换
  • Docker的数据持久化;Docker网络;Dockerfile编写
  • OpenHarmony亮相MTSC 2023 | 质量效率共进,赋能应用生态发展
  • windows11 调整鼠标灵敏度方法
  • 贪心算法个人见解
  • Win中Redis部署与配置
  • vue el-button 封装及使用
  • QT之QMediaPlayer的用法
  • TCP_报文格式解读
  • C语言面试之旅:掌握基础,探索深度(面试实战之c语言关键词下篇)
  • Java学习第十三天
  • 【Delphi】实现彩色日志显示框(TRichEdit Helper)
  • Elasticsearch 优化查询中获取字段内容的方式,性能提升5倍!
  • 图像批量设计软件Retrobatch Pro mac中文版功能特色
  • python第3天之函数
  • SQL Server 数据库,为products表添加数据