点击表格行高亮

  • css中三元表达式
:class="[activeIndex == index ? 'color' : '', 'item']"
  • 点击行高亮
   <div @click="actvied(index)" :class="[activeIndex == index ? 'color' : '', 'item']"v-for="(item, index) in tableData" :key="index">{{ item.datafile }}</div></div>activeIndex: -1,actvied(index) {this.activeIndex = indexconsole.log(this.active);},

完整代码

<template><div style="display: flex;margin: 20px 0px 0px 50px;"><div class="condition"><div class="top">工况名</div><div class="bottom"><div @click="actvied(index)" :class="[activeIndex == index ? 'color' : '', 'item']"v-for="(item, index) in tableData" :key="index">{{ item.datafile }}</div></div></div><div class="test"><div class="top1">测点名</div><div class="bottom1"><div @click="handlePointClick(index)" :class="[selectedPointIndex == index ? 'color1' : '', 'item1']"v-for="(point, index) in pointData" :key="index">{{ point.pointname }}</div></div></div><div ref="chart" style="height: 600px;width:120%;margin-left: 50px;"></div></div>
</template>
<script>
import * as echarts from 'echarts';
import axios from 'axios';
import {GetTestData,GetAllPoint,GetCurve
} from '@/api/satellite-api'
export default {data() {return {activeIndex: -1,selectedPointIndex: -1,selectedRowIndex: -1,selectedRow: null,selectedPoint: null,pointname: '',createTime: '',curveid: '',rowid: '',actvie: '',curveData: [],tableData: [],pointData: [],multipleSelection: []}},mounted() {this.point()this.GetFile()},methods: {actvied(index) {this.activeIndex = indexconsole.log(this.active);},handlePointClick(index) {this.selectedPoint = this.pointData[index];this.selectedPointIndex = index;this.curveid = this.selectedPoint.id;this.createTime = this.selectedPoint.createTime;this.pointname = this.selectedPoint.pointname;this.qux();},// 获取文件async GetFile() {const data = await GetTestData(this.$route.query.id)this.tableData = data.data.data},// 获取测点async point() {if (this.pointData = []) {const data = await GetAllPoint(153)this.pointData = data.data.data} else {const data = await GetAllPoint(this.rowid)this.pointData = data.data.data}},// 获取曲线async qux() {const data = await GetCurve(this.curveid, this.createTime);this.curveData = data.data.data;// 转换数据格式const chartData = this.curveData.map(item => [item.x, item.y]);this.$nextTick(() => {// Initialize myChart variableconst myChart = echarts.init(this.$refs.chart);// 使用echarts方法替换数据myChart.setOption({title: {text: this.pointname,left: '1%'},tooltip: {trigger: 'axis'},grid: {left: '5%',right: '15%',bottom: '10%'},xAxis: {data: chartData.map(function (item) {return item[0];})},yAxis: {axisLabel: {formatter: function (value) {return value.toExponential();}}},toolbox: {right: 10,feature: {dataZoom: {yAxisIndex: 'none'},restore: {},saveAsImage: {}}},dataZoom: [{startValue: '2014-06-01'},{type: 'inside'}],visualMap: {top: 50,right: 10,pieces: [{gt: 0,lte: 50,color: '#93CE07'},{gt: 50,lte: 100,color: '#FBDB0F'},{gt: 100,lte: 150,color: '#FC7D02'},{gt: 150,lte: 200,color: '#FD0100'},{gt: 200,lte: 300,color: '#AA069F'},{gt: 300,color: '#AC3B2A'}],outOfRange: {color: '#999'}},series: {name: this.pointname,type: 'line',data: chartData.map(function (item) {return item[1];}),markLine: {silent: true,lineStyle: {color: '#333'},data: [{yAxis: 50},{yAxis: 100},{yAxis: 150},{yAxis: 200},{yAxis: 300}]}}});});}}
}
</script><style>
.el-table {cursor: pointer;
}
.el-table__header-wrapper {position: sticky;top: 0;z-index: 1;
}
.el-table__body-wrapper {max-height: 621px;overflow-y: scroll;position: relative;
}
.highlight-row {background-color: #fff !important;
}
.condition {background-color: #fff;position: relative;width: 600px;height: 450px;display: flex;flex-direction: column;align-items: center;border: 1px solid #ccc;padding: 0px;border-radius: 5px;.top {width: 100%;height: 40px;line-height: 40px;font-size: 15px;text-align: center;color: #5e5f5f;background-color: #d7e9f9;position: sticky;top: 0;z-index: 1;}.bottom {width: 100%;height: 100%;display: flex;flex-direction: column;align-items: flex-start;}.item {display: flex;justify-content: center;align-items: center;width: 100%;height: 40px;line-height: 40px;font-size: 15px;text-align: center;padding: 5px;cursor: pointer;color: #5e5f5f;border-top: 1px solid #ccc;}.color {width: 100%;height: 40px;border: 1px solid ccc;line-height: 40px;font-size: 15px;text-align: center;background-color: #eaf4ff;}
}
.test {margin-left: 10px;background-color: #fff;position: relative;width: 400px;height: 450px;display: flex;flex-direction: column;align-items: center;border: 1px solid #ccc;padding: 0px;border-radius: 5px;.bottom1 {width: 100%;height: 100%;display: flex;flex-direction: column;align-items: flex-start;overflow-y: scroll;}.top1 {width: 100%;height: 40px;line-height: 40px;font-size: 15px;text-align: center;color: #5e5f5f;background-color: #d7e9f9;position: sticky;top: 0;z-index: 1;}.item1 {display: flex;justify-content: center;align-items: center;width: 100%;height: 40px;line-height: 40px;font-size: 15px;text-align: center;padding: 5px;cursor: pointer;color: #5e5f5f;border-top: 1px solid #ccc;}.color1 {width: 100%;height: 40px;border: 1px solid ccc;line-height: 40px;font-size: 15px;text-align: center;background-color: #eaf4ff;}
}</style>

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

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

相关文章

[Linux]理解文件系统!动静态库详细制作使用!(缓冲区、inode、软硬链接、动静态库)

hello&#xff0c;大家好&#xff0c;这里是bang___bang_&#xff0c;今天来谈谈的文件系统知识&#xff0c;包含有缓冲区、inode、软硬链接、动静态库。本篇旨在分享记录知识&#xff0c;如有需要&#xff0c;希望能有所帮助。 目录 1️⃣缓冲区 &#x1f359;缓冲区的意义 …

Python(六十九)为什么要将元组设计成不可变序列

❤️ 专栏简介&#xff1a;本专栏记录了我个人从零开始学习Python编程的过程。在这个专栏中&#xff0c;我将分享我在学习Python的过程中的学习笔记、学习路线以及各个知识点。 ☀️ 专栏适用人群 &#xff1a;本专栏适用于希望学习Python编程的初学者和有一定编程基础的人。无…

nginx服务

目录 基本介绍 nginx的主要功能 nginx的主要应用场景 nginx常用命令 nginx另外一种安装方式 nginx常用的信号符&#xff1a; nginx配置文件详解 全局配置 event模块 http模块 server模块 location模块&#xff1a; 模块的划分 基本介绍 nginx&#xff1a;高性能、…

06 Ubuntu22.04上的miniconda3安装、深度学习常用环境配置

下载脚本 我依然是在清华镜像当中寻找的脚本。这里找脚本真的十分方便&#xff0c;我十分推荐。 wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-latest-Linux-x86_64.sh 下载十分快速&#xff0c;10秒解决问题 运行miniconda3安装脚本 赋予执…

python数据容器

目录 数据容器 反向索引 list列表 语法 案例 列表的特点 列表的下表索引 list的常用操作 list列表的遍历 while循环遍历 for循环遍历 tuple元组 前言 元组定义 元组特点 获取元组元素 元组的相关操作 元组的遍历 while循环遍历 for循环遍历 字符串 前言…

SpringBoot复习:(19)Condition接口和@Conditional注解

Condition接口代码如下&#xff1a; public interface Condition {boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata);}它是一个函数式接口&#xff0c;只有一个方法matches用来表示条件是否满足。matches方法中的ConditionContext类对象context可以…

OPENCV C++(五)滤波函数+sobel边缘检测+人脸磨皮mask

滤波函数 中值滤波 medianBlur(frame, detectmat, 5); 平均滤波 blur(frame, detectmat, Size(5, 5)); 高斯滤波&#xff08;最后一个是方差 越大越模糊&#xff09; GaussianBlur(frame, detectmat, Size(5, 5),0); sobel的边缘检测函数 Sobel(gray, dx, CV_16S, 1, 0, 3…

图片静态展示

图片静态展示程序&#xff0c;包含选择文件夹路径&#xff0c;旋转&#xff0c;放大缩小&#xff0c;拖动&#xff0c;幻灯片播放&#xff0c;上一张下一张等&#xff0c;程序使用QT实现。 程序下载地址&#xff1a; 图片静态展示&#xff0c;包含选择文件夹路径&#xff0c;…

LeetCode113. 路径总和 II

113. 路径总和 II 文章目录 [113. 路径总和 II](https://leetcode.cn/problems/path-sum-ii/)一、题目二、题解方法一&#xff1a;递归另一种递归版本方法二&#xff1a;迭代 一、题目 给你二叉树的根节点 root 和一个整数目标和 targetSum &#xff0c;找出所有 从根节点到叶…

Golang之路---04 项目管理——编码规范

本文根据个人编码习惯以及网络上的一些文章&#xff0c;整理了一些大家能用上的编码规范&#xff0c;可能是一些主流方案&#xff0c;但不代表官方。 1. 文件命名 由于 Windows平台文件名不区分大小写&#xff0c;所以文件名应一律使用小写 不同单词之间用下划线分词&#xf…

第20周 服务容错-Hystrix

RabbitMQ 安装 1. 首先在Linux上进行一些软件的准备工作&#xff0c;yum下来一些基础的软件包 yum install build-essential openssl openssl-devel unixODBC unixODBC-devel make gcc gcc-c kernel-devel 2. 下载RabbitMQ所需软件包&#xff08;本神在这里使用的是 RabbitM…

java+python企业会议在线办公微信小程序 ia505

一、小程序端功能 该部分内容提供员工注册、员工资料修改、通知公告、部门信息、会议记录等等功能。 二、管理员管理功能 该部分内容包含了首页、个人中心、通知公告管理、员工管理、部门信息管理、职位信息管理、会议记录管理、待办事项管理、工资信息管理、留言板管理、系统管…

二叉树的直径 LeetCode热题100

题目 给你一棵二叉树的根节点&#xff0c;返回该树的 直径 。 二叉树的 直径 是指树中任意两个节点之间最长路径的 长度 。这条路径可能经过也可能不经过根节点 root 。 两节点之间路径的 长度 由它们之间边数表示。 思路 分析二叉树的直径&#xff0c;无非是一个节点加上…

C++ 类型兼容规则

类型兼容规则是指在需要基类对象的任何地方&#xff0c;都可以使用公有派生类的对象来替代。 通过公有继承&#xff0c;派生类得到了基类中除构造函数和析构函数之外的所有成员。这样&#xff0c;公有派生类实际就具备了基类的所有功能&#xff0c;凡是基类能解决的问题&#x…

微信支付官方文档怎么看

博主介绍&#xff1a;✌全网粉丝3W&#xff0c;全栈开发工程师&#xff0c;从事多年软件开发&#xff0c;在大厂呆过。持有软件中级、六级等证书。可提供微服务项目搭建与毕业项目实战&#xff0c;博主也曾写过优秀论文&#xff0c;查重率极低&#xff0c;在这方面有丰富的经验…

Cilium系列-14-Cilium NetworkPolicy 简介

系列文章 Cilium 系列文章 前言 今天我们进入 Cilium 安全相关主题, 介绍 Kubernetes 网络策略以及 CiliumNetworkPolicies 额外支持的内容。 网络策略(NetworkPolicy)的类型 默认情况下&#xff0c;Kubernetes 集群中的所有 pod 都可被其他 pod 和网络端点访问。 网络策…

Kafka3.0.0版本——Broker(Zookeeper服务端存储的Kafka相关信息)

目录 一、启动zookeeper集群及kafka集群服务启动1.1、先启动三台zookeeper集群服务&#xff0c;再启动三台kafka集群服务1.2、使用PrettyZoo连接zookeeper客户端工具 二、在zookeeper服务端存储的Kafka相关信息 一、启动zookeeper集群及kafka集群服务启动 1.1、先启动三台zook…

计算机成下一个土木了吗?

前些年抓住了互联网行业的红利期&#xff0c;进入大厂的员工&#xff0c;基本可以实现在一线城市买房扎根。 但反观现在&#xff0c;“被毕业、逃离互联网、躺平算了...”却成了这个行业的主旋律&#xff0c;不少人在谈论润到国企和外企去了&#xff0c;也放低了对工资的预期&…

LIME(可解释性分析方法)

目录 1.什么是LIME 2.思路 3.LIME在不同任务中的范式&#xff08;待补充&#xff09; 1.什么是LIME 简单理解&#xff1a; 对于分类任务&#xff1a;如下图所示&#xff0c;LIME可以列出分类结果&#xff0c;所依据特征对应给比重。 对于图像分类任务&#xff1a;如下图所示&a…

docker 配置 Mysql主从集群

Docker version 20.10.17, build 100c701 MySQL Image version: 8.0.32 Docker container mysql-master is source. mys ql-replica is replication. master source. replica slave.名称叫法不一样而已。 Choose one of the way&#xff0c;与replica同步数据两种情况&…