【element-ui】表格

效果展示

组件代码

    <el-table class="compTableClass" ref="tableOOOOO"
      :class="('className' in tableConfig)?tableConfig.className:''"
      :data="tableConfig.data" 
      :height="tableConfig.height" 
      style="width: 100%"
      highlight-current-row
      @row-click="tableTRclickFun"
      @selection-change="handleSelectionChange"
    >
        <el-table-column type="selection" width="60" v-if="tableConfig.checkbox"></el-table-column>
        <el-table-column align="center" label="选择" width="100" v-if="('radius' in tableConfig)">
          <template slot-scope="scope">
            <el-radio class="radioOOOClass" :label="scope.row['id']" v-model="tableRadio" @change.native="getCurrentRow(scope.row)"></el-radio>
          </template>
        </el-table-column>
        <el-table-column type="index" align="center" width="60" label="序号" v-if="tableConfig.index"></el-table-column>
        <el-table-column align="center"
          v-for="(item2,index2) in tableConfig.head" :key="index2"
          :label="item2.label"
          :width="('width' in item2)?item2.width:'auto'"
          :min-width="('width' in item2)?item2.width:'auto'"
        >
          <template slot-scope="scope">
            <span v-if="item2.type==61" class="spanIMG">
              <img 
                :src="(scope.row[item2.prop]&&scope.row[item2.prop].length>0)?scope.row[item2.prop]:require('@/assets/images/srchResult/zOtherpp999.png')"
                @error="$commonOpt.errorImageShow($event)"
              />
              <span v-if="('bkKey' in item2)&&(scope.row[item2.bkKey]==1)">已布控</span>
            </span>
            <span v-if="item2.type==6266" class="spanText1_66" :title="scope.row[item2.prop]" :style="('maxWidth' in item2)?{'max-width':item2.maxWidth}:{}">{{ scope.row[item2.prop] }}</span>
            <span v-if="item2.type==62" class="spanText1" :title="scope.row[item2.prop]" :style="('maxWidth' in item2)?{'max-width':item2.maxWidth}:{}">{{ scope.row[item2.prop] }}</span>
            <span v-if="item2.type==63" class="spanText2">{{ scope.row[item2.prop] }}</span>
            <span v-if="item2.type==64" class="spanText3">{{ scope.row[item2.prop] }}</span>
            <span v-if="item2.type==65" class="spanIMG2">
              <img :src="item2.list[scope.row[item2.prop]]['img']"/>
            </span>
            <span v-if="(item2.type==66)&&(item2.list[scope.row[item2.prop]])" class="spanText4">
              <span :style="{'background':item2.list[scope.row[item2.prop]]['bgColor']}">{{ item2.list[scope.row[item2.prop]]['label'] }}</span>
              <span v-if="'prop2' in item2" style="margin-left:5px;">({{scope.row[item2.prop2]}}次)</span>
            </span>
            <span v-if="item2.type==67" class="spanText1">
              {{ scope.row[item2.prop].split(" ")[0] }}
              <br/>
              {{ scope.row[item2.prop].split(" ")[1] }}
            </span>
            <span v-if="(item2.type==68)&&(scope.row[item2.prop].length>0)" class="spanText4">
              <span style="background:#E60012">{{ scope.row[item2.prop] }}</span>
              <span v-if="'prop2' in item2" style="margin-left:5px;">({{scope.row[item2.prop2]}}次)</span>
            </span>
            <span v-if="(item2.type==680)&&(scope.row[item2.prop].length>0)" class="spanText4Root">
              <span class="spanText4" v-for="(tt,ii) in scope.row[item2.prop]" :key="ii">
                <span style="background:#E60012">{{ tt }}</span>
              </span>
            </span>
            <span v-if="(item2.type==88)&&(item2.list[scope.row[item2.prop]])" class="spanText4">
              <span :style="{'background':item2.list[scope.row[item2.prop]]['bgColor']}">{{ item2.list[scope.row[item2.prop]]['label'] }}</span>
            </span>
            <span v-if="item2.type==98" class="spanIMG9">
              <img v-for="(item98,index98) in item2.btns" :key="index98" 
                :title="('tt' in item98)?(item98.list[scope.row[item98.val]]['title']):item98.title"
                :src="('tt' in item98)?(item98.list[scope.row[item98.val]]['img']):item98.img" 
                :style="{'width':item98.wh[0]+'px','height':item98.wh[1]+'px'}"
                v-show="('ss' in item98)?(scope.row[item98['ss']]):true"
                @click.stop="tableEventFun(item2,scope.row,item98)"
              />
            </span>
            <span v-if="item2.type==99" class="spanBtn">
              <span v-for="(item99,index99) in item2.btns" :key="index99"
                v-show="('ss' in item99)?(scope.row[item99['ss']]):true"
                @click.stop="tableEventFun(item2,scope.row,item99)"
              >{{ ('tt' in item99)?(item99.list[scope.row[item99.val]]['text']):item99.text }}</span>
            </span>
          </template>
        </el-table-column>
      </el-table>

模拟数据

    initTable() {
        let list = [];
        for (let i = 0; i < 20; i++) {
            list.push({
                    id: i,
                    img: "",
                    xm: "***",
                    dz: "河北省石家庄市桥西区红旗大街123号",
                    bfb: "99.9%",
                    hm: "130999999999999999",
                    lx: Math.floor(Math.random() * 2 + 1),
                    lx2: Math.floor(Math.random() * 2 + 1),
                    lx2NN: Math.floor(Math.random() * 99),
                    lal:["类型1","类型2","类型3"],
                    time: "2023-09-06 17:08:30",
                    zt:Math.floor(Math.random() * 2 + 1),
                    noInfo: Math.floor(Math.random() * 2 + 1), //1-有数据;2-无数据
            });
        }
        this.tableConfig.data = this.tableCardList;
    }

配置参数

    【data】
     tableConfig: {
                height: 690,
                index: true,
                checkbox: true,
                head: [
                    { type: 61, prop: "img", label: "照片",width:"200px" },
                    { type: 62, prop: "xm", label: "姓名",width:"200px" },
                    { type: 6266, prop: "dz", label: "地址",maxWidth:"100px" ,width:"200px"},
                    { type: 63, prop: "bfb", label: "相似度",width:"200px" },
                    { type: 64, prop: "hm", label: "证件号码" ,width:"200px"},
                    {
                        type: 65,
                        prop: "lx",
                        label: "类型",
                        width:"200px",
                        list: {
                            1: {
                                img: require("@/assets/images/srchResult/table_td_1_1.png"),
                            },
                            2: {
                                img: require("@/assets/images/srchResult/table_td_1_2.png"),
                            },
                        },
                    },
                    {
                        type: 66,
                        prop: "lx2",
                        prop2: "lx2NN",
                        label: "类型",
                        width:"200px",
                        list: {
                            1: { label: "类型1", bgColor: "#E60012" },
                            2: { label: "类型2", bgColor: "#FA913D" },
                        },
                    },
                    { type: 680, prop: "lal", label: "类型",width:"200px" },
                    { type: 67, prop: "time", label: "结算时间",width:"200px" },
                    {
                        type: 88,
                        prop: "zt",
                        label: "任务状态",
                        width:"200px",
                        list: {
                            1: { label: "进行中", bgColor: "#6aa84f" },
                            2: { label: "已停止", bgColor: "#cccccc" },
                        },
                    },
                    {
                        type: 98,
                        btns: [
                            {
                                mm: 1,
                                title: "画像",
                                img: require("@/assets/images/srchResult/table_1.png"),
                                wh: [20, 20],
                            },
                            {
                                mm: 2,
                                title: "详情",
                                img: require("@/assets/images/srchResult/table_2.png"),
                                wh: [24, 18],
                            },
                            {
                                mm: 3,
                                title: "删除",
                                img: require("@/assets/images/srchResult/table_3.png"),
                                wh: [18, 20],
                            },
                        ],
                        label: "操作",
                        width:"200px",
                    },
                    {
                        type: 99,
                        btns: [{ mm: 1, text: "查看" }],
                        label: "操作",
                        width:"200px",
                    },
                ],
                data: [],
    }

    【回调方法】
    //表格-按钮回调
    tableEventCallback(item, data, item2) {
            if (item2) {
                debugger;
            }
    },

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

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

学习笔记|单样本秩和检验|假设检验摘要|Wilcoxon符号检验|规范表达|《小白爱上SPSS》课程:SPSS第十一讲 | 单样本秩和检验如何做?很轻松!

目录 学习目的软件版本原始文档单样本秩和检验一、实战案例二、统计策略三、SPSS操作1、正态性检验2&#xff0e;单样本秩和检验 四、结果解读第一&#xff0c;假设检验摘要第二&#xff0c;Wilcoxon符号检验结果摘要。第三&#xff0c;Wilcoxon符号秩检验图第四&#xff0c;数…

【c++Leetcode】287. Find the Duplicate Number

问题入口 思想&#xff1a;Floyds Tortoise and Hare 这个算法除了可以检测是否有环&#xff08;问题入口&#xff09;&#xff0c;还可以用来检测重复数。当然这还需要一个慢指针才能实现。具体请点击标题跳转到原视频&#xff0c;这里是把内容再梳理一遍。如果有不对的地方…

可以直接在线制作电子画册的网站

​随着互联网技术的发展&#xff0c;越来越多的人开始使用在线工具来制作电子画册。今天&#xff0c;小编就来介绍一款可以直接在线制作电子画册的网站&#xff0c;让你的电子画册更加精美、个性化和实用。 1.首先点击FLBOOK在线制作制作电子杂志平台 2.点击开始制作&#xff0…

【Cargo Therapeutics】申请1亿美元纳斯达克IPO上市

来源&#xff1a;猛兽财经 作者&#xff1a;猛兽财经 猛兽财经获悉&#xff0c;美国生物制药公司【Cargo Therapeutics】近期已向美国证券交易委员会&#xff08;SEC&#xff09;提交招股书&#xff0c;申请在纳斯达克IPO上市&#xff0c;股票代码为(CRGX),Cargo Therapeutics…

社区投稿|解码Big Vector,开启Sui超扩展性的新篇章

* 本文是来自Sui生态项目Typus团队的投稿&#xff0c;文中「我们」均指代该项目团队&#xff0c;转载时修改部分不准确的用词。 本研究报告介绍了Big Vector的概念&#xff0c;这是一种我们用于 Typus V2 的新数据结构&#xff0c;以缓解 Sui 上数组和动态字段(dynamic field)…

spring boot配置ssl(多cer格式)保姆级教程

1. 准备cer格式的证书&#xff1b; 2. 合并cer证书并转化成jks格式的证书 为啥有这一步&#xff0c;因为cer证书配置在spring boot项目中&#xff0c;项目启动不起来。如果有大佬想指导一下可以给我留言&#xff0c;在此先谢过大佬。 1&#xff09;先创建一个jks格式的证…

通过python操作neo4j

在neo4j中创建结点和关系 创建结点 创建电影结点 例如&#xff1a;创建一个Movie结点&#xff0c;这个结点上带有三个属性{title:‘The Matrix’, released:1999, tagline:‘Welcome to the Real World’} CREATE (TheMatrix:Movie {title:The Matrix, released:1999, tagl…

大厂面试题-什么是服务网格?

概述 服务网格这个概念出来很久了&#xff0c;从2017年被提出来&#xff0c;到2018年正式爆发&#xff0c;很多云厂商和互联网企业都在纷纷向服务网格靠拢。像蚂蚁集团、美团、百度、网易等一线互联网公司&#xff0c;都有服务网格的落地应用。 服务网格是微服务架构的更进一…

端到端Scrum敏捷管理流程-

Leangoo领歌是一款永久免费的专业的敏捷开发管理工具&#xff0c;提供端到端敏捷研发管理解决方案&#xff0c;涵盖敏捷需求管理、任务协同、进展跟踪、统计度量等。 Leangoo领歌上手快、实施成本低&#xff0c;可帮助企业快速落地敏捷&#xff0c;提质增效、缩短周期、加速创新…

4.5 Object类

思维导图&#xff1a; 4.5 Object类笔记总结 1. 定义和重要性 Java提供的Object类是所有Java类的根类。直接或间接&#xff0c;所有的Java类都继承自Object类。它被称为超类。 2. 默认行为 当创建一个新的类且没有显式地使用extends关键字指定一个父类时&#xff0c;该类默认…

2023年【熔化焊接与热切割】报名考试及熔化焊接与热切割找解析

题库来源&#xff1a;安全生产模拟考试一点通公众号小程序 熔化焊接与热切割报名考试根据新熔化焊接与热切割考试大纲要求&#xff0c;安全生产模拟考试一点通将熔化焊接与热切割模拟考试试题进行汇编&#xff0c;组成一套熔化焊接与热切割全真模拟考试试题&#xff0c;学员可…

MacOS安装git

文章目录 通过Xcode Command Lines Tool安装(推荐)终端直接运行git命令根据流程安装先安装Command Lines Tool后再安装git 官网下载二进制文件进行安装官方国外源下载二进制文件(不推荐)国内镜像下载二进制文件(推荐)安装git 通过Xcode Command Lines Tool安装(推荐) 简单来讲C…

MySQL基础教程下

MySQL 约束 约束是作用于表中字段上的规则&#xff0c;用于限制存储在表中的数据。 目的&#xff1a;保证数据库中数据的正确、有效性和完整性。 约束描述关键字非空不能为nullnot null唯一约束唯一unique主键非空唯一primary key默认默认值default检查约束满足一个条件chec…

图像特征Vol.1:计算机视觉特征度量|第二弹:【统计区域度量】

目录 一、前言二、统计区域度量2.1&#xff1a;图像矩特征2.1.1&#xff1a;原始矩/几何矩2.1.2&#xff1a;中心距2.1.3&#xff1a;归一化的中心矩2.1.4&#xff1a;不变矩——Hu矩2.1.5&#xff1a;OpenCv实现矩特征及其应用 2.2&#xff1a;点度量特征2.3&#xff1a;全局直…

【双十一预售】玩得越来越大了...

双十一又又又到了 剁手带来的快乐终究是短暂的 让自己变得更优秀才是长远的快乐 当今大环境 工作难找&#xff0c;钱难赚 只有不断学习与成长 方能应对未来的各种不确定性 知了堂双十一预售 0.11元畅享三大权益 助你快速实现自我提升 突破成长瓶颈 https://appyqk1x…

英飞凌TC3xx-Overlay

目录 1.数据访问重定向 2.寄存器说明 3.Overlay功能配置 3.1 确认用于重定向的CPU 3.2 配置重定向Block大小 3.3 配置目标地址和重定向地址 4.结果验证 5.小结 今天说要开个专栏讲讲XCP标定&#xff0c;但在将标定之前&#xff0c;先把英飞凌专门为标定功能设计overlay…

美国白宫发布总统令:鼓励AI以安全、可靠的方式发展

美国华盛顿时间10月30日&#xff0c;美国白宫官网发布了&#xff0c;关于发展安全、可靠和值得信赖的AI&#xff08;人工智能&#xff09;的拜登总统行政令。 白宫表示&#xff0c;该行政令为AI安全和保障制定了新标准&#xff0c;保护了用户的数据隐私&#xff0c;促进公平和…

垃圾回收GC

为什么要有垃圾回收? JVM之所以要有垃圾回收,是因为它能够自动管理内存,避免内存泄漏和内存溢出的问题,垃圾回收机制会自动检测和清理不再使用的对象,释放内存空间,使得开发者不需要手动管理内存,降低了开发难度和错误风险,同时,垃圾回收还可以优化内存分配,提高程序性能和响…

股神巴菲特靠押注加密获巨额利润?比特币成不确定时代的投资选择!

股神巴菲特(Warren Buffett)以前曾将比特币描述为“老鼠药”&#xff0c;表达了对加密货币发展的悲观看法。然而他却通过持有一家对比特币友好的银行的股票&#xff0c;获得了巨额利润。 据悉&#xff0c;伯克希尔哈撒韦公司在2021年6月向Nu Holdings投资了5亿美元&#xff0c;…

图像特征Vol.1:计算机视觉特征度量|第一弹:【纹理区域特征】

目录 一、前言二、纹理区域度量2.1&#xff1a;边缘特征度量2.2&#xff1a;互相关和自相关特征2.3&#xff1a;频谱方法—傅里叶谱2.4&#xff1a;灰度共生矩阵(GLCM)2.5&#xff1a;Laws纹理特征2.6&#xff1a;局部二值模式&#xff08;LBP&#xff09; 一、前言 &#x1f…
最新文章