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

基于el-table的表格点选和框选功能

开篇

本篇文章旨在实现一个基于el-table的表格点选和框选功能,除此之外,还支持多种模式的切换、自定义勾选日期等。且,该表格后续可能还会持续优化!

功能介绍

  • 表格点选和框选功能(没有点击ctrl键的情况下)
  • 表格点选和框选功能的互斥功能,意思是当现在选择了该单元格后,按住ctrl键再次点击,就会取消选择
  • 当前日期高亮
  • 周、双周、月份模式的切换以及自定义日期的选择
  • 对于可点选和框选功能的范围判断(表头和名称不可选择)

代码实现

index.vue

<template><div class="container"><!-- 顶部功能栏区域 --><data class="top-bar"><!-- 切换模式按钮 --><el-button size="mini" type="primary" @click="turnWeek"></el-button><el-button size="mini" type="primary" @click="turnTwoWeeks">两周</el-button><el-button size="mini" type="primary" @click="turnMonth"></el-button><!-- 自定义时间范围选择器 --><div class="time-range-picker"><span class="arrow-icon"><el-icon><ArrowLeftBold /></el-icon></span><!-- 起始日期 --><el-date-pickerclass="time-picker"v-model="dateForm.startDate"type="datetime":shortcuts="shortcuts"@change="(value) => handleDateChange('startDate', value)"/><span style="padding: 0 10px">-</span><!--结束日期 --><el-date-pickerclass="time-picker"v-model="dateForm.endDate"type="datetime":shortcuts="shortcuts"@change="(value) => handleDateChange('endDate', value)"/><span class="arrow-icon"><el-icon><ArrowRightBold /></el-icon></span></div></data><!-- 表格区域 --><div class="table-container"><!-- 月份选择 --><month-schedule-table:table-data="tableData":switch-model="switchModel":dateForm="dateForm":customDateFlag="customDateFlag"@updateDateForm="handleUpdateDateForm":table-width="tableWidth"></month-schedule-table></div></div>
</template><script>
import {defineComponent,onMounted,reactive,toRefs,ref,watchEffect,onUpdated,onUnmounted,nextTick,
} from "vue";
import MonthScheduleTable from "./components/MonthScheduleTable.vue";
export default defineComponent({name: "DepartmentScheduleConfig",components: {MonthScheduleTable,},setup() {const state = reactive({tableData: [],switchModel: "month",// 自定义日期选择相关dateForm: {startDate: "",endDate: "",},customDateFlag: false, // 是否在自定义切换日期的标识});const tableWidth = ref(0);onMounted(() => {// 先初始化一些假数据用着initData();nextTick(() => {getTableWidth();});});const getTableWidth = () => {// 求表格宽度let container = document.querySelector(".container");if (container) {const observer = new ResizeObserver(() => {tableWidth.value = container.clientWidth;});observer.observe(container);// 初始获取一次宽度tableWidth.value = container.clientWidth;}};// 每次更新表格时,也要重新获取表格宽度onUpdated(() => {getTableWidth();});window.addEventListener("resize", getTableWidth);// 页面关闭时,移除事件监听器onUnmounted(() => {window.removeEventListener("resize", getTableWidth);});// 切换成周模式const turnWeek = () => {state.switchModel = "week";state.customDateFlag = false;};// 切换成两周模式const turnTwoWeeks = () => {state.switchModel = "twoWeeks";state.customDateFlag = false;};// 切换成月模式const turnMonth = () => {state.switchModel = "month";state.customDateFlag = false;};// 初始化数据const initData = () => {const obj = {};for (let i = 0; i <= 31; i++) {obj[`date${i}`] = null;}const arr = [];for (let j = 1; j < 10; j++) {const tmpObj = { ...obj };tmpObj.id = j;tmpObj.name = `zzz${j}`;arr.push(tmpObj);}console.log("arr", arr);arr[0].date1 = "X";arr[3].date3 = "Y";state.tableData = arr;};/*** 自定义日期相关*/// 日期选择面板扩展const shortcuts = [{text: "今天",value: new Date(),},{text: "昨天",value: () => {const date = new Date();date.setDate(date.getDate() - 1);return date;},},{text: "一周前",value: () => {const date = new Date();date.setDate(date.getDate() - 7);return date;},},];// 日期change方法const handleDateChange = (key, value) => {state.dateForm[key] = new Date(value);console.log("dateForm", state.dateForm);state.customDateFlag = true;};// 更新日期选择器const handleUpdateDateForm = (val) => {console.log("val", val);state.dateForm["startDate"] = val.startDate;state.dateForm["endDate"] = val.endDate;};return {...toRefs(state),turnWeek,turnTwoWeeks,turnMonth,tableWidth,shortcuts,handleDateChange,handleUpdateDateForm,};},
});
</script><style style="scss" scoped>
.container {width: 100%;.top-bar {display: flex;.time-range-picker {margin-left: 5px;.arrow-icon {cursor: pointer;padding: 8px;}}}.table-container {width: 100%;margin-top: 5px;}
}
</style>

MonthScheduleTable.vue

<template><div class="container"><!-- 表格区域 --><data class="wrap"@mousedown="handleMouseDown"@mousemove="handleMouseMove"@mouseup="handleMouseUp"><!-- 框选矩形 --><div v-if="rectVisible" class="select-rect":style="{ left: rect.left + 'px', top: rect.top + 'px', width: rect.width + 'px', height: rect.height + 'px' }"></div><!-- 表格 --><div class="con"><el-table :data="tableData" border style="width: 100%" :cell-style="CellStyle"@cell-click="handleCellClick"><!-- 姓名 --><el-table-column prop="name" label="姓名" :width="getColumnWidth()"> </el-table-column><!-- 日期 这一块日期应该根据月、周、两周三种模式来动态显示,不应该写死--><el-table-columnclass="headerSelect":label-class-name="isWeekend(item.date, item.day)"v-for="(item, index) in currDateArr" :key="index" :label="item.date"><el-table-column :label-class-name="isWeekend(item.date, item.day)":class-name="isWeekend(item.date, item.day)":prop="getProp(index)" :label="item.day" :class="{'headerSelect': true}":width="getColumnWidth()"><template #default="scope"><div :data-row="scope.row.name" :data-column="getProp(index)" class="cell-content">{{ scope.row[getProp(index)] }}</div></template></el-table-column></el-table-column></el-table></div></data></div>
</template><script>
import { computed } from '@vue/reactivity';
import { defineComponent, onMounted, reactive, toRefs, watchEffect, ref, onUpdated } from 'vue'
export default defineComponent({name: 'MonthScheduleTable',emits: ['updateDateForm'],props: {tableData: {type: Array,default: () => []},switchModel: {type: String,default: 'month'},tableWidth: {type: Number,default: 0},dateForm: {type: Object,default: () => ({})},customDateFlag: {type: Boolean,default: false}},setup(props, { emit }) {const state = reactive({tableData: computed(() => props.tableData), // 数组数据源// 鼠标框选功能相关selectedCells: [], // 选择的单元格rectVisible: false, // 是否显示框选矩形rect: {left: 0, top: 0, width: 0, height: 0}, // 矩形的坐标信息downX: 0, // 鼠标按下时的X坐标downY: 0, // 鼠标按下时的Y坐标upX: 0, // 鼠标松开时的X坐标upY: 0, // 鼠标松开时的Y坐标isMouseDown: false, // 鼠标是否移动isCellClick: false,// 是否是单元格被点击了})// 给当前的单元格分配propconst getProp = idx => {return `date${idx}`}// 判断鼠标是否在可选区域内const isInSelectableArea = event => {const target = event.target;// 查找最近的表头元素(th 或 thead)const headerElement = target.closest('th, thead');// 如果目标元素位于表头中,返回 falseif (headerElement) return false;const headerSelect = document.querySelector('.con')if (!headerSelect) return false;const headerRect = headerSelect.getBoundingClientRect()const isInHeader = event.clientX >= headerRect.left && event.clientX <= headerRect.right &&event.clientY >= headerRect.top && event.clientY <= headerRect.bottom;const cell = target.closest('td, th');const columnIndex = cell ? cell.cellIndex : undefined;return isInHeader && columnIndex > 0; // 从第二列开始}// 判断当前是否只点击了一个单元格// 表格单元格点击事件const handleCellClick = (row, column, cell, event) => {if (!isInSelectableArea(event)) return;state.isCellClick = trueif (event.ctrlKey) { // 判断是否按下了Ctrl键// 当鼠标左键+ctrl同时按下时,实现多选功能/*** 若当前的cell.classList包含highlight类,则移除,并把该单元格的数据移除出数组;* 若不包含,证明之前并未选择过,则添加hightlight类,并把数据push进数组*/if (cell.classList.contains('highlight')) {cell.classList.remove('highlight')// 将该单元格的数据移出数组const index = state.selectedCells.findIndex(item => item.row === row.name && item.column === column.property)if (index > -1) {state.selectedCells.splice(index, 1)}} else {cell.classList.add('highlight')// 将数据加入数组state.selectedCells.push({ row: row.name, column: column.property, value: row[column.property] });}} else {// 普通高亮的逻辑// 清除所有已高亮的单元格const highlightedCells = document.querySelectorAll('.highlight')highlightedCells.forEach(cell => cell.classList.remove('highlight'))// 清空当前已选择的数组state.selectedCells = []// 将当前单元格高亮cell.classList.add('highlight')// 将数据加入数组state.selectedCells.push({ row: row.name, column: column.property, value: row[column.property] });}// 将单元格点击标识和鼠标移动标识置为falsestate.isCellClick = falsestate.isMouseDown = false}// 当鼠标落下时const handleMouseDown = event => {if (!isInSelectableArea(event)) return;// 判断是否在可选区域内state.isMouseDown = true/*** 在鼠标落下时,应当判断是ctrl+鼠标左键触发的事件,还是直接由鼠标左键触发的事件* 若是直接由鼠标左键点击触发的事件,则应该清空当前的selectedCells数组,并移除所有单元格的的高亮*/if (!event.ctrlKey) {const highlightedCells = document.querySelectorAll('.highlight')highlightedCells.forEach(cell => cell.classList.remove('highlight'))state.selectedCells = []}state.rectVisible = truestate.downX = event.clientXstate.downY = event.clientYstate.upX = event.clientXstate.upY = event.clientYstate.rect.left = document.querySelector('.wrap').getBoundingClientRect().leftstate.rect.top = document.querySelector('.wrap').getBoundingClientRect().topstate.rect.width = 0state.rect.height = 0}// 当鼠标移动时const handleMouseMove = event => {if (!state.rectVisible || !isInSelectableArea(event)) return;// 判断是否在可选区域内if (state.rectVisible) {const moveX = event.clientXconst moveY = event.clientY// 计算框选矩形的宽高state.rect.width = Math.abs(moveX - state.downX)state.rect.height = Math.abs(moveY - state.downY)state.rect.left = Math.min(moveX, state.downX) - event.currentTarget.getBoundingClientRect().leftstate.rect.top = Math.min(moveY, state.downY) - event.currentTarget.getBoundingClientRect().top}}// 当鼠标抬起时const handleMouseUp = (event) => {if (!state.rectVisible || !isInSelectableArea(event)) return;// 判断是否在可选区域内if (state.rectVisible) {state.rectVisible = false// 获取所有单元格const cells = document.querySelectorAll('.el-table__body-wrapper td')const rect = state.rect// 判断是否有一些单元格已经高亮let anyHighlighted = false// 用于存放被框选的单元格const selectedCells = []cells.forEach(cell => {const cellRect = cell.getBoundingClientRect()const tableRect = document.querySelector('.wrap').getBoundingClientRect()// 计算相对位置const cellLeft = cellRect.left - tableRect.leftconst cellTop = cellRect.top - tableRect.top// 判断单元格是否在框选区域内const cellInSelection = (cellLeft < rect.left + rect.width &&cellLeft + cellRect.width > rect.left &&cellTop < rect.top + rect.height &&cellTop + cellRect.height > rect.top)if (cellInSelection) {selectedCells.push(cell)}})if (selectedCells.length > 1) {selectedCells.forEach(sltCell => {// 判断单元格是否已经高亮const isHighlighted = sltCell.classList.contains('highlight')if (isHighlighted) {anyHighlighted = true}// 若使用ctrl+鼠标左键if (event.ctrlKey) {// 若被框选的单元格全都没有高亮,则将这些单元格高亮,并将数据push到数组中if (!anyHighlighted) {sltCell.classList.add('highlight')state.selectedCells.push(getCellData(sltCell))} else {/*** 若被框选的单元格中,有已经高亮的单元格,则需要把其中高亮的单元格取消高亮,并把这些被取消高亮* 的单元格的数据从数组中移除* 同时,把没有高亮的单元格高亮,并将数据push到数组中*/if (isHighlighted) {sltCell.classList.remove('highlight')const idxToRemove = state.selectedCells.findIndex(sc => sc.row === getCellData(sltCell).row && sc.column === getCellData(sltCell).column)if (idxToRemove > -1) {state.selectedCells.splice(idxToRemove, 1)}} else {// 若当前没有高亮的,则高亮,并把数据添加到数组中sltCell.classList.add('highlight')state.selectedCells.push(getCellData(sltCell))}}} else {// 普通点击框选事件sltCell.classList.add('highlight')state.selectedCells.push(getCellData(sltCell))}                            })}}}// 获取单元格数据const getCellData = cell => {const cellContent = cell.querySelector('.cell-content')if (cellContent) {const row = cellContent.dataset.rowconst column = cellContent.dataset.columnconst value = cellContent.textContentreturn { row, column, value }}}// 根据当前的模式,动态获取数据const daysOfWeek = ['日', '一', '二', '三', '四', '五', '六' ]// 月份模式const getMonthDays = () => {const days = []let currYear = new Date().getFullYear()let currMonth = new Date().getMonth()// 获取当前月的第一天const startDate  = new Date(currYear, currMonth, 2)startDate.setHours(0, 0, 0, 0)  // 确保是当天的0点// 获取当前月的最后一天const endDate = new Date(currYear, currMonth + 1, 0)endDate.setHours(23, 59, 59, 999)  // 确保是当天的最后一毫秒const date = new Date(new Date(currYear, currMonth, 1))while(date.getMonth() === currMonth) {days.push({day: date.getDate().toString(),date: daysOfWeek[date.getDay()]})date.setDate(date.getDate() + 1)}// 转化为时间选择器可以使用的格式const minDateFormatted = startDate.toISOString().slice(0, 10)const maxDateFormatted = endDate.toISOString().slice(0, 10)emit('updateDateForm', { startDate: minDateFormatted, endDate: maxDateFormatted })return days}// 一周模式const getWeekDays = () => {const days = []const currDay = new Date().getDay()const startDate = new Date(new Date()) // 当选择了这些模式之后,应该把开始日期和结束日期传给父组件,以便父组件上的时间选择器来展示// 找到最小和最大的日期startDate.setDate(new Date().getDate() - currDay + 1) // 获取当前周的周一// 获取当前格式的当前周的周日const endDate = new Date(startDate)endDate.setDate(startDate.getDate() + 6)for (let i = 0; i < 7; i++) {const d = new Date(startDate)d.setDate(startDate.getDate() + i)days.push({day: d.getDate().toString(),date: daysOfWeek[d.getDay()]})}// 转化为时间选择器可以使用的格式const minDateFormatted = startDate.toISOString().slice(0, 10)const maxDateFormatted = endDate.toISOString().slice(0, 10)emit('updateDateForm', { startDate: minDateFormatted, endDate: maxDateFormatted })return days}// 两周模式const getTwoWeeksDays = () => {const days = []const currDay = new Date().getDay()const startDate = new Date(new Date()) startDate.setDate(new Date().getDate() - currDay + 1) // 获取当前周的周一// 获取当前格式的当前周的周日const endDate = new Date(startDate)endDate.setDate(startDate.getDate() + 13)for (let i = 0; i < 14; i++) {const d = new Date(startDate)d.setDate(startDate.getDate() + i)days.push({day: d.getDate().toString(),date: daysOfWeek[d.getDay()]})}// 转化为时间选择器可以使用的格式const minDateFormatted = startDate.toISOString().slice(0, 10)const maxDateFormatted = endDate.toISOString().slice(0, 10)emit('updateDateForm', { startDate: minDateFormatted, endDate: maxDateFormatted })return days}// 自定义选择日期模式const getCustomDateRange = (startDate, endDate) => {const days = []const start = new Date(startDate)const end = new Date(endDate)const date = new Date(start)while (date <= end) {days.push({day: date.getDate().toString(),date: daysOfWeek[date.getDay()]})date.setDate(date.getDate() + 1)}return days}// 获取当前日期const isCrrentDay = () => {let d = new Date().getDate()return d.toString()}// 判断是否是周末const isWeekend = (date, day) => {if (day === isCrrentDay()) return 'currDay';if (date === '六' || date === '日') return 'weekend';else return ''}const headerCellStyle = (row, column, rowIndex, columnIndex) => {// console.log('row', row);}const CellStyle = (row, column) => { // console.log('row', row);if (row.column.className === 'weekend') {return {backgroundColor: 'rgb(116, 107, 230)'}}}const currDateArr = computed(() => {if (!props.customDateFlag && props.switchModel === 'month') {return getMonthDays()} else if (!props.customDateFlag && props.switchModel === 'week') {return getWeekDays()} else if (!props.customDateFlag && props.switchModel === 'twoWeeks') {return getTwoWeeksDays()} else if (props.customDateFlag) {return getCustomDateRange(props.dateForm.startDate, props.dateForm.endDate)}})var currWidth = ref(0)watchEffect(() => {currWidth.value = computed(() => props.tableWidth).value// 根据当前日期,给表头设置背景if (currDateArr.value.length > 0) {const ths = document.querySelectorAll('.el-table__header .el-table__cell')if (ths.length > 0) {// 获取当前日期let date = new Date().getDay()console.log('date', date);}}})onUpdated(() => {// 根据当前日期,给表头设置背景if (currDateArr.value.length > 0) {const ths = document.querySelectorAll('.el-table__header .el-table__cell')if (ths.length > 0) {// 获取当前日期let date = new Date().getDay()}}})// 动态设置列的宽度const getColumnWidth = () => {const containerWidth = currWidth.value // 减去name列的值const columnCount = currDateArr.value.length + 1return `${Math.floor(containerWidth / columnCount)}px`}return {...toRefs(state),handleCellClick,currDateArr,getProp,handleMouseDown,handleMouseMove,handleMouseUp,getColumnWidth,isWeekend,headerCellStyle,CellStyle}}
})
</script><style style="scss" scoped>
/* 当单元格被选择时,高亮 */
::v-deep .el-table td.highlight {background-color: yellow!important;color: red;
}::v-deep .el-table thead th.weekend {background-color: rgb(116, 107, 230)!important;
}::v-deep .el-table th.currDay {background-color: green!important;
}::v-deep .el-table .headerSelect {background-color: green!important;
}.container {width: 100%;.wrap {width: 100%;height: 100vh;position: relative;display: flex;/* 子项超出容器宽度时自动换行 */flex-wrap: wrap;/* 禁止用户复制文本 */user-select: none;.select-rect {position: absolute;border: 1px dashed #999;background-color: rgba(0,0,0,0.1);z-index: 1000;pointer-events: none;}.con {max-width: 100%;}}
}
</style>

效果演示

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

因为此表格还在持续开发中,所以现在代码还有很多有待优化和完善的地方,还请谅解。
希望本文对您能有所帮助!
感谢阅读!

相关文章:

基于el-table的表格点选和框选功能

开篇 本篇文章旨在实现一个基于el-table的表格点选和框选功能&#xff0c;除此之外&#xff0c;还支持多种模式的切换、自定义勾选日期等。且&#xff0c;该表格后续可能还会持续优化&#xff01; 功能介绍 表格点选和框选功能&#xff08;没有点击ctrl键的情况下&#xff09;…...

LabVIEW压电陶瓷阻抗测试系统

开发了一种基于LabVIEW软件与PXI模块化仪器的压电陶瓷阻抗测试系统。该系统能在高电压工作条件下测量压电陶瓷的阻抗特性&#xff0c;包括阻抗模值与阻抗角的频率特性&#xff0c;为压电陶瓷的进一步分析与应用提供了重要参考。 项目背景 现有的阻抗测试仪大多只能在低电压条件…...

电销机器人能大幅度提升效率

1、安全稳定性能好 营销机器人的稳定性非常强&#xff0c;在使用性能方面会有更好的优势&#xff0c;而且用的过程中也可以不断的这些模块更新和功能升级&#xff0c;所以会不断的满足大家更多的使用要求&#xff0c;在操作使用的时候非常简单和方便&#xff0c;直接就可以给客…...

虚拟机能访问网页但ping不通百度

最近遇到了奇怪的问题&#xff0c;虚拟机能访问网页&#xff0c;但ping不通百度&#xff0c;记录一下问题的排查过程。 能访问网页&#xff0c;说明DNS、TCP和HTTP没有问题&#xff0c;ping不通&#xff0c;说明ICMP应该出了问题。 首先通过traceroute追踪报文的转发过程&…...

RK3588开发笔记-buildroot编译配置

目录 前言 一、buildroot简介 二、buildroot配置编译 buildroot config配置 buildroot 编译 buildroot 如何单独编译某个软件包 何时需要完全重建 如何完全重建 总结 前言 Rockchip RK3588 是一款强大的多核处理器,广泛应用于边缘计算、人工智能、嵌入式系统等领域。为了在…...

Java设计模式(适配器模式)

定义 将一个类的接口转换成客户希望的另一个接口。适配器模式让那些接口不兼容的类可以一起工作。 角色 目标抽象类&#xff08;Target&#xff09;&#xff1a;目标抽象类定义客户所需的接口&#xff08;在类适配器中&#xff0c;目标抽象类只能是接口&#xff09;。 适配器类…...

机器学习框架巅峰对决:TensorFlow vs. PyTorch vs. Scikit-Learn实战分析

1.引言 1.1机器学习框架的重要性 在机器学习的黄金时代&#xff0c;框架的选择对于开发高效、可扩展的模型至关重要。合适的框架可以极大地提高开发效率&#xff0c;简化模型的构建和训练过程&#xff0c;并支持大规模的模型部署。因此&#xff0c;了解和选择最合适的机器学习…...

基于STM32的智能窗帘控制系统

目录 引言环境准备工作 硬件准备软件安装与配置系统设计 系统架构硬件连接代码实现 初始化代码控制代码应用场景 家居智能窗帘控制办公室窗帘自动调节常见问题及解决方案 常见问题解决方案结论 1. 引言 智能窗帘控制系统能够通过时间、光照强度或远程控制&#xff0c;实现对…...

【算法】普里姆算法解决修路问题

应用场景——修路问题 1.某地有 7 个村庄&#xff08;A&#xff0c;B&#xff0c;C&#xff0c;D&#xff0c;E&#xff0c;F&#xff0c;G&#xff09;&#xff0c;现在需要修路把 7 个村庄连通 2.各个村庄的距离用边线表示&#xff08;权&#xff09;&#xff0c;比如 A - …...

Python 之Scikit-learn(二) -- Scikit-learn标准化数据

在机器学习中&#xff0c;数据标准化是一项关键的预处理步骤。标准化&#xff08;Standardization&#xff09;是将数据转换为具有均值为0和标准差为1的分布。这样可以确保特征在相同的尺度上&#xff0c;有助于提升某些机器学习算法的性能和稳定性。 Scikit-learn提供了一个简…...

机械学习—零基础学习日志(python编程)

零基础为了学人工智能&#xff0c;正在艰苦的学习 昨天给高等数学的学习按下暂停键&#xff0c;现在开始学习python编程。 我学习的思路是直接去阿里云的AI学习课堂里面学习。 整体感觉&#xff0c;阿里云的AI课堂还是有一些乱&#xff0c;早期课程和新出内容没有更新和归档…...

WEB应用(十三)---RCE

什么是RCE&#xff1f; Remote Command/Code Execute&#xff0c;远程命令或代码执行。通过构造特殊的字符串&#xff0c;将数据提交至Web应用程序&#xff0c;并利用该方式执行外部程序或系统命令实施攻击&#xff0c;类似于SQL注入。 Web应用程序使用了一些可以执行系统命令或…...

【云原生】Service服务暴露详细

Service服务 文章目录 Service服务一、Service介绍1.1、介绍1.2、Kubernetes中的Service 二、Service服务类型2.1、ClusterIP2.2、NodePort2.3、LadBalancer2.4、ExternalName 三、Service玩法3.1、定义Service3.2、端口定义别名3.3、多端口Service 四、Service类型4.1、Cluste…...

实名认证次数限制

在业务层实现实名认证次数限制 这个功能是通过以下步骤实现实名认证的次数限制&#xff1a; 每日失败尝试次数限制&#xff1a;限制用户每天可以尝试失败的次数。失败后的冷却时间&#xff1a;用户在连续失败几次后需要等待一段时间才能再次尝试。成功认证后的限制&#xff1…...

【如何在Python中使用pathlib模块】

在Python中使用pathlib模块主要涉及创建Path对象&#xff0c;并利用这些对象提供的方法来执行文件系统的各种操作。以下是一些详细的步骤和示例&#xff0c;帮助你了解如何在Python中有效地使用pathlib模块。 1. 导入Path类 首先&#xff0c;从pathlib模块中导入Path类。 fr…...

sqli-labs第一关详细解答

首先判断是否有注入点 发现and 11 和 and 12结果一样&#xff0c;所以应该是字符型注入&#xff0c;需要对单引号做闭合 做闭合后发现报错&#xff0c;提示Limit 0,1&#xff0c;那就说明存在注入点&#xff0c;但是要注释掉后面的limit 0,1 使用--注释掉limit 0,1后&#xff…...

分布式事务一站式解决方案-Seata

分布式事务一站式解决方案- 分布式事务一站式解决方案分布式事务产生背景三个概念Seata下载和安装实际业务模拟演示不加 GlobalTransactional 注解&#xff0c;正常操作下单不加 GlobalTransactional 注解&#xff0c;下单过程出异常或者超时了加 GlobalTransactional 注解&…...

openwrt 使用ftace工具追踪协议栈转发流程

开这四个宏 CONFIG_KERNEL_DYNAMIC_FTRACEy CONFIG_KERNEL_FTRACEy CONFIG_KERNEL_FUNCTION_GRAPH_TRACERy CONFIG_KERNEL_FUNCTION_TRACERy 如果/sys/kernel/debug/tracing没有&#xff0c;可以挂载 mount -t debugfs nodev /sys/kernel/debug 挂载报错&#xff1a; mo…...

ElasticSearch优化实战:打造高性能搜索引擎的秘籍

在当今这个大数据时代&#xff0c;信息的海量增长对搜索技术提出了前所未有的挑战。用户不仅需要快速准确地从数以亿计的数据中找到所需信息&#xff0c;还希望搜索引擎能够提供个性化和智能化的搜索体验。ElasticSearch作为市场上领先的搜索引擎&#xff0c;因其强大的全文搜索…...

【STL】| C++ 栈和队列(详解、容器适配器的初步引入)

目录 前言 总代码 容器适配器的引入 栈 stack 队列 queue 栈和队列用法简介 栈 队列 deque简介&#xff08;了解即可&#xff09; 结语 前言 今天我们要讲解的结构是栈和队列 这两个的具体实现相比于前面我们学的string、vector、list都要简单得多&#xff08;因为容…...

SpringBoot-17-MyBatis动态SQL标签之常用标签

文章目录 1 代码1.1 实体User.java1.2 接口UserMapper.java1.3 映射UserMapper.xml1.3.1 标签if1.3.2 标签if和where1.3.3 标签choose和when和otherwise1.4 UserController.java2 常用动态SQL标签2.1 标签set2.1.1 UserMapper.java2.1.2 UserMapper.xml2.1.3 UserController.ja…...

Vim 调用外部命令学习笔记

Vim 外部命令集成完全指南 文章目录 Vim 外部命令集成完全指南核心概念理解命令语法解析语法对比 常用外部命令详解文本排序与去重文本筛选与搜索高级 grep 搜索技巧文本替换与编辑字符处理高级文本处理编程语言处理其他实用命令 范围操作示例指定行范围处理复合命令示例 实用技…...

深度学习在微纳光子学中的应用

深度学习在微纳光子学中的主要应用方向 深度学习与微纳光子学的结合主要集中在以下几个方向&#xff1a; 逆向设计 通过神经网络快速预测微纳结构的光学响应&#xff0c;替代传统耗时的数值模拟方法。例如设计超表面、光子晶体等结构。 特征提取与优化 从复杂的光学数据中自…...

idea大量爆红问题解决

问题描述 在学习和工作中&#xff0c;idea是程序员不可缺少的一个工具&#xff0c;但是突然在有些时候就会出现大量爆红的问题&#xff0c;发现无法跳转&#xff0c;无论是关机重启或者是替换root都无法解决 就是如上所展示的问题&#xff0c;但是程序依然可以启动。 问题解决…...

XCTF-web-easyupload

试了试php&#xff0c;php7&#xff0c;pht&#xff0c;phtml等&#xff0c;都没有用 尝试.user.ini 抓包修改将.user.ini修改为jpg图片 在上传一个123.jpg 用蚁剑连接&#xff0c;得到flag...

springboot 百货中心供应链管理系统小程序

一、前言 随着我国经济迅速发展&#xff0c;人们对手机的需求越来越大&#xff0c;各种手机软件也都在被广泛应用&#xff0c;但是对于手机进行数据信息管理&#xff0c;对于手机的各种软件也是备受用户的喜爱&#xff0c;百货中心供应链管理系统被用户普遍使用&#xff0c;为方…...

调用支付宝接口响应40004 SYSTEM_ERROR问题排查

在对接支付宝API的时候&#xff0c;遇到了一些问题&#xff0c;记录一下排查过程。 Body:{"datadigital_fincloud_generalsaas_face_certify_initialize_response":{"msg":"Business Failed","code":"40004","sub_msg…...

边缘计算医疗风险自查APP开发方案

核心目标:在便携设备(智能手表/家用检测仪)部署轻量化疾病预测模型,实现低延迟、隐私安全的实时健康风险评估。 一、技术架构设计 #mermaid-svg-iuNaeeLK2YoFKfao {font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}#mermaid-svg…...

在rocky linux 9.5上在线安装 docker

前面是指南&#xff0c;后面是日志 sudo dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo sudo dnf install docker-ce docker-ce-cli containerd.io -y docker version sudo systemctl start docker sudo systemctl status docker …...

【ROS】Nav2源码之nav2_behavior_tree-行为树节点列表

1、行为树节点分类 在 Nav2(Navigation2)的行为树框架中,行为树节点插件按照功能分为 Action(动作节点)、Condition(条件节点)、Control(控制节点) 和 Decorator(装饰节点) 四类。 1.1 动作节点 Action 执行具体的机器人操作或任务,直接与硬件、传感器或外部系统…...