table列折行

在这里插入图片描述

这里折叠后少了合同名称,风险进展,预判无法达成金额

在这里插入图片描述

通过按钮的状态,来控制某一列的显示与隐藏,
  <el-tablev-loading="loading"v-if="tableStatus"border:data="tableData":key="tableKey"id="table"class="table-self is-grey":options="modalShow ? [] : ['config']":header-cell-style="{ background: '#2B72D8', color: '#FFFFFF', textAlign: 'center' }"style="width: 100%"element-loading-text="加载中..."element-loading-spinner="el-icon-loading"fit:height="modalShow ? 360 : `calc(100vh - 250px)`":row-class-name="tableRowClassName"show-summary:summary-method="getSummaries"ref="table"@header-dragend="handleDragend"><el-table-columnv-for="(item, index) in columnList":key="item.prop"show-overflow-tooltip:prop="item.prop":type="item.type":min-width="item.minwidth":width="item.width":fixed="item.fixed":align="item.align":label="item.label"header-align="center"><!-- <template slot="header"><div v-if="item.align === 'left'"class="text-align-center">{{'1111'}}</div></template> --><template slot="header">{{item.label}}<i v-if="item.onCollapse":class="`collapse-icon el-icon-arrow-${item.collapse ? 'right' : 'left'}`" @click="() => item.onCollapse()"/></template><template v-if="item.children"><el-table-columnv-for="ite in item.children":key="ite.prop"show-overflow-tooltip:prop="ite.prop":type="ite.type":min-width="ite.minwidth":width="ite.width":fixed="ite.fixed":align="ite.align":label="ite.label"header-align="center"><template slot="header">  //核心处理逻辑{{ite.label}}<i v-if="ite.onCollapse":class="`collapse-icon el-icon-arrow-${ite.collapse ? 'right' : 'left'}`" @click="() => ite.onCollapse()"/></template><template slot-scope="{ row }"><div class="text-overflow">{{ row[ite.prop] }}</div></template></el-table-column></template><template slot-scope="{ row, $index }"><div v-if="item.prop === 'forecastedReturn'" class="text-overflow">{{ row.forecastedPerformanceMoneySum }}</div><div v-if="item.prop === 'index'" class="text-overflow">{{ $index + 1 }}</div><div v-else class="text-overflow">{{ row[item.prop] }}</div></template></el-table-column></el-table>
//data const columnList = [{ type: 'index', label: '序号', prop: 'index', width: 50, align: 'center', fixed: true },{ label: '地区', prop: 'c5Region', width: 60, align: 'center', fixed: true },{ label: '项目名称', prop: 'projectName',minwidth: 120, align: 'left', fixed: true,collapse: false,onCollapse: () => this.onCollapse('projectName', ['contractName'])  //自定义处理事件},{ label: '合同名称', prop: 'contractName', minwidth: 80, align: 'center', fixed: true, show: true },{ label: '内切/外拓', prop: 'businessTypeName', minwidth: 80, align: 'center', fixed: true },{ label: '截止上月底应收款', prop: 'paybackMoney', minwidth: 80, align: 'right', fixed: true },{label: '应收款账龄',minwidth: 110,align: 'center',children: [// { label: '未到期', prop: 'undueMoney', minwidth: 80, align: 'right' },{ label: '1月以内', prop: 'withinOneMonths', minwidth: 80, align: 'right' },{ label: '1至2个月', prop: 'oneToTwoMonths', minwidth: 80, align: 'right' },{ label: '2至6个月', prop: 'twoToSixMonths', minwidth: 80, align: 'right' },{ label: '6个月以上', prop: 'overSixMonths', minwidth: 80, align: 'right' },],},{label: '应收款回款预判',minwidth: 110,align: 'center',children: [{ label: '金额预判', prop: 'forecastedPaybackMoney', minwidth: 110, align: 'right', more: true },{ label: '风险等级',prop: 'riskTypeName',minwidth: 100,align: 'center',            collapse: false,onCollapse: () => this.onCollapse('riskTypeName', ['riskAndProgress', 'unattainableAmount']) },{ label: '风险及进展', prop: 'riskAndProgress', minwidth: 90, align: 'left', show: true },{ label: '预判无法达成金额', prop: 'unattainableAmount', minwidth: 130, align: 'right', show: true },],},];
// methods onCollapse(collapseProp, props) {this.columns = this.columns.map(item => {item.children = item.children?.map(child => {if(props.includes(child.prop)){  // 如果要隐藏的数组包括当前prop 就将show属性取反return { ...child,show: !child.show,collapse: collapseProp === child.prop ? !child.collapse : child.collapse}}return {  // 不包含的直接返回...child,collapse: collapseProp === child.prop ? !child.collapse : child.collapse}})if(props.includes(item.prop)){ //处理第一层return { ...item,show: !item.show,collapse: collapseProp === item.prop ? !item.collapse : item.collapse};}return {...item,          collapse: collapseProp === item.prop ? !item.collapse : item.collapse}})}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.hqwc.cn/news/456772.html

如若内容造成侵权/违法违规/事实不符,请联系编程知识网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

【MATLAB】使用梯度提升树在回归预测任务中进行特征选择(深度学习的数据集处理)

1.梯度提升树在神经网络的应用 使用梯度提升树进行特征选择的好处在于可以得到特征的重要性分数&#xff0c;从而识别出对目标变量预测最具影响力的特征。这有助于简化模型并提高其泛化能力&#xff0c;减少过拟合的风险&#xff0c;并且可以加快模型训练和推理速度。此外&…

C#,河豚算法(Blowfish Algorithm)的加密、解密源代码

Bruce Schneier 1 河豚算法&#xff08;Blowfish Algorithm&#xff09; 河豚算法&#xff08;Blowfish Algorithm&#xff09;是1993年11月由Bruce Schneier设计的一个完全开源的算法。 Blowfish算法是一个分组长度为64位、密钥长度可变的对称分组密码算法。 Blowfish算法具…

docker复习笔记01(小滴课堂)安装+部署mysql

查看内核版本。 关闭防火墙&#xff1a; 查看docker版本&#xff1a; 下载阿里yum源&#xff1a; 再看一下yum版本都有哪些&#xff1a; 我们可以看的docker-ce了。 安装它&#xff1a; 设置docker服务开机启动&#xff1a; 更新日志文件&#xff1a; 启动docker&#xff1a; …

【云原生之kubernetes系列】--HPA自动伸缩

HPA自动伸缩 HorizontalPodAutoscaler&#xff08;简称 HPA &#xff09;自动更新工作负载资源&#xff08;例如Deployment或者Statefulset)&#xff0c;目的是让pod可以自动扩缩工作负载以满足业务需求。 水平扩缩意味着对增加的负载的响应是部署更多的Pod。这与“垂直&…

【零基础入门TypeScript】Union

目录 语法&#xff1a;Union文字 示例&#xff1a;Union类型变量 示例&#xff1a;Union 类型和函数参数 Union类型和数组 示例&#xff1a;Union类型和数组 TypeScript 1.4 使程序能够组合一种或两种类型。Union类型是表达可以是多种类型之一的值的强大方法。使用管道符号…

某公司遭遇AI换脸诈骗,被骗走两个亿!

大家好我是二狗。 这年头&#xff0c;AI换脸不是个新鲜事了。 但是你敢信香港一公司因此被骗了两亿港元&#xff1f; 事情究竟是怎么一回事呢&#xff1f; 据香港文区报2月4日报道&#xff0c;香港警方披露首宗多人换脸AI诈骗案&#xff0c;一家总部在英国的跨国公司的香港…

(五)elasticsearch 源码之查询流程分析

https://www.cnblogs.com/darcy-yuan/p/17039526.html 1.概述 上文我们讨论了es&#xff08;elasticsearch&#xff0c;下同&#xff09;索引流程&#xff0c;本文讨论es查询流程&#xff0c;以下是基本流程图 2.查询流程 为了方便调试代码&#xff0c;笔者在电脑上启动了了…

单片机学习笔记---串口通信(1)

目录 通信的基本概念 通信的方式 1.按照数据传送的方式&#xff0c;可分为串行通信和并行通信。 1.1串行通信 1.2并行通信 2.按照通信的数据同步方式&#xff0c;又可以分为异步通信和同步通信。 2.1 异步通信 2.2同步通信 3.按照数据的传输方向&#xff0c;又可以分为…

DBNet详解及训练ICDAR2015数据集

论文地址&#xff1a;https://arxiv.org/pdf/1911.08947.pdf 开源代码pytorch版本&#xff1a;GitHub - WenmuZhou/DBNet.pytorch: A pytorch re-implementation of Real-time Scene Text Detection with Differentiable Binarization 前言 在这篇论文之前&#xff0c;文字检…

PKI - 01 散列(Hash)函数

文章目录 PKI概述散列日产生活中的指纹的工作原理散列函数的工作原理散列函数的四大特点使用散列函数验证数据的完整性 PKI概述 PKI&#xff08;Public Key Infrastructure&#xff0c;公钥基础设施&#xff09;证书系统是一种用于保护网络通信安全的技术。它基于非对称加密算法…

【Unity优化(一)】音频优化

整理资教程&#xff1a;https://learn.u3d.cn/tutorial/unity-optimization-metaverse 1.音频优化 音频一般不会成为性能瓶颈&#xff0c;是为了节省内存和优化包体大小。 1.0 文件格式和压缩格式 原始音频资源尽量采用WAV格式。 移动平台音频尽量采用Vorbis压缩格式&#x…

Elasticsearch:BM25 及 使用 Elasticsearch 和 LangChain 的自查询检索器

本工作簿演示了 Elasticsearch 的自查询检索器将非结构化查询转换为结构化查询的示例&#xff0c;我们将其用于 BM25 示例。 在这个例子中&#xff1a; 我们将摄取 LangChain 之外的电影样本数据集自定义 ElasticsearchStore 中的检索策略以仅使用 BM25使用自查询检索将问题转…