vue中一周的时间选择多个阶段(手动表格选择)

 先给大家看一下效果图

 源代码

<template><div style="width: 45%"><div style="width: 100%"><div class="time"><div class="timeleft">星期/时间</div><div class="timeright"><div class="timeright_cell"><el-row :gutter="0"><el-col :span="12"><div class="topitem" style="font-size: 12px; font-weight: bold">00:00~12:00</div></el-col><el-col :span="12"><div class="topitem" style="font-size: 12px; font-weight: bold">12:00~24:00</div></el-col></el-row></div><div class="timeright_cell" style="color: #333333"><el-row :gutter="0"><el-col:span="1"v-for="(item, index) in 24":key="item"@click="clicktime(index)"><divclass="topitem":style="{ '--bgColor': bgColor }":class="{ is_selected: isTimeSelected(index) }">{{ index }}</div></el-col></el-row></div></div></div><div class="time"><div style="width: 8.8%"><divclass="timelefts":style="{ '--bgColor': bgColor }":class="{ is_selected: isDaySelected(index) }"v-for="(dayName, index) in ['星期一','星期二','星期三','星期四','星期五','星期六','星期日']":key="dayName"@click="clickDay(index)">{{ dayName }}</div></div><div class="objects" ref="objectsRef" @mousedown="handleMouseDown"><!-- 矩形选择框 --><divclass="mask"ref="maskRef"v-show="maskPosition.show":style="'width:' +maskWidth +'left:' +maskLeft +'height:' +maskHeight +'top:' +maskTop"/><!-- 选择对象内容的目标插槽 --><!-- <slot name="selcetObject" /> --><div class="objects_content"><divv-for="item in weekData":key="item.id"class="select_object":day_index="item.daynum":time_index="item.timenum":object_id="item.id":class="{ is_selected: item.status }":style="{ '--bgColor': bgColor }"><!-- {{ item.id }} --></div></div></div></div><!-- 鼠标画矩形选择对象 --></div><div class="box"><div><div class="dt">已选择时间段</div><!-- 按钮--><el-button v-for="button in buttons" :key="button.text" :type="button.type" link>{{ button.text }}</el-button></div><div class="dtime"><ulv-for="item in weekData.filter((t) => t.status == true).reduce((prev, curr) =>prev.find((t) => t.daynum == curr.daynum) ? prev : [...prev, curr],[])">星期{{convertSum(item.daynum)}}:<span class="dts" v-for="item in tList(item.daynum)">{{ convertTime(item) }}<!--{{ item.timenum - 1 }}:{{ item.id % 2 == 0 ? "30" : "00" }} ~{{ item.timenum - 1 }}:{{ item.id % 1 == 0 ? "30" : "00" }}--></span></ul></div></div></div>
</template><script lang="ts" setup>
import { reactive, toRefs, ref, computed, onMounted, onBeforeMount } from "vue";
//数据格式1:默认0或者1,数据格式2:json字符串(x-(1-7)对应周一到周日), 如timeSet=”{‘1’:‘1,2,3’}”表示周一的0:30-1:00,1:00-1:30,1:30-2:00为播放时间,数据格式3:字符串,xHHmm x为1-7对应周一到周日,HH为小时,mm,00或30  00表示00-30这半小时, 30表示30-00这半小时
// 数据格式2:
// 格式为json字符串,(x-(1-7)对应周一到周日), 如timeSet=”{‘1’:‘1,2,3’}”表示周一的0:30-1:00,1:00-1:30,1:30-2:00为播放时间,
// 数据格式3:
// 格式是字符串,xHHmm     x为1-7对应周一到周日,HH为小时,mm,00或30  00表示00-30这半小时, 30表示30-00这半小时
// 10600,10630,10700,10730,10800,10830,10900,10930,11000,11030,11100,11130,11200,11230,11300,11330,11400,11430,11500,11530,11600,11630,11700,11730,11800,11830,11900,11930,12000,12030,12100,12130,12200,12230,12300,12330,20600,20630,20700,20730,20800,20830,20900,20930,21000,21030,21100,21130,21200,21230,21300
const clientX = ref(0);
const clientY = ref(0);const props = withDefaults(defineProps<{datatype?: number; //数据类型week?: String; //绑定数组objectClassName?: string; // 选择对象的class name,用于定义如何获取对象objectIdName?: string; // 选择对象的id name,用于定义如何获取对象的iduseCtrlSelect?: boolean; // 是否支持按住Ctrl多选bgColor?: string; //选中的背景色}>(),{datatype: 1,objectClassName: "select_object",objectIdName: "object_id",bgColor: "#197afb",useCtrlSelect: false // 默认支持按住Ctrl多选}
);
function findTimeInterval(arr) {if (arr.length === 0) return [];let intervals = [];let startTime = arr[0];let endTime = arr[0];for (let i = 1; i < arr.length; i++) {if (arr[i] === endTime + 1) {endTime = arr[i];} else {intervals.push({ startTime: startTime, endTime: endTime });startTime = arr[i];endTime = arr[i];}}intervals.push({ startTime: startTime, endTime: endTime });return intervals;
}const convertTime = (items) => {let result = "";// 	<!--{{ item.timenum - 1 }}:{{ item.id % 2 == 0 ? "30" : "00" }} ~{{ item.timenum - 1 }}:{{ item.id % 1 == 0 ? "30" : "00" }}-->let list = items.map((el) => el.id);let convertList = findTimeInterval(list);console.log("转换后的", convertList);if (convertList?.length > 0) {convertList.forEach((el) => {let start = items.find((item) => el.startTime == item.id);let end = items.find((item) => el.endTime == item.id);console.log("end", end);if (el.startTime == el.endTime) {let startStr = `${formatNum(start.timenum - 1)} : ${start.id % 2 == 0 ? "30" : "00"} `;let endStr = "";if (end.id % 2 != 0) {endStr = `${formatNum(end.timenum - 1)} : 30`;} else {endStr = `${formatNum(end.timenum)} : 00`;}result += `${startStr} ~ ${endStr}`;} else {// 不一致 的let endStr = "";let startStr = `${formatNum(start.timenum - 1)} : ${start.id % 2 == 0 ? "30" : "00"} `;// 结束时间存在问题, 单个多半个小时if (el.endTime % 2 == 0) {endStr = `${formatNum(end.timenum)} : 00`;} else {endStr = `${formatNum(end.timenum - 1)} : 30`;}result += `${startStr} ~ ${endStr}`;}});}return result;
};const formatNum = (num) => {return num < 10 ? `0${num}` : num;
}/*** 转换星期* @param daynum*/
const convertSum = (daynum) => {switch (daynum) {case 1:return "一";case 2:return "二";case 3:return "三";case 4:return "四";case 5:return "五";case 6:return "六";case 7:return "日";}
};const tempStr = ref([]);
const tempStrComputed = computed(() => {return JSON.stringify(tempStr);
});const tList = (daynum) => {let tArr = [];let tItem = [];let dayList = weekData.value.filter((t) => t.status == true).reduce((prev, curr) => (prev.find((t) => t.daynum == curr.daynum) ? prev : [...prev, curr]),[]);let dayAllDataList = weekData.value.filter((t) => t.daynum == daynum);for (let i = 0; i < dayAllDataList.length; i++) {let item = dayAllDataList[i];if (item.status == false) {if (tItem.length > 0) {tArr.push(new Array(...tItem));tItem.length = 0;}} else tItem.push(item);}if (tItem.length > 0) {tArr.push(new Array(...tItem));tItem.length = 0;}return tArr;
};// const tList = computed(() => {
// 	console.log('tList');
// 	let tArr = [];
// 	let tItem = [];
// 	let dayList = weekData.value.filter(t=>t.status==true).reduce((prev, curr) => prev.find(t=>t.daynum == curr.daynum) ? prev : [...prev, curr], [])
// 	let dayAllDataList = weekData.value.filter(t=>t.daynum==2);
//
// 	for (let i = 0; i < dayAllDataList; i++) {
// 		let item = dayAllDataList[i];
// 		if(item.status==false){
// 			if (tItem.length > 0) {
// 				tArr.push(tItem);
// 				tItem.length = 0;
// 			}
// 		}else
// 			tItem.push(item);
// 	}
// 	return tArr;
// })
const hasHandleObjectIds = ref<number[]>([]); //已处理id数组
// 全局计数器
let uniqueId = 1;
// 初始化 weekData
const weekData = ref([] as any);
// 初始化 weekData 中的 hours
onMounted(() => {for (let i = 0; i < 7; i++) {for (let hour = 0, timenum = 1; hour < 48; hour += 2) {weekData.value.push({ id: uniqueId++, status: false, daynum: i + 1, timenum: timenum });weekData.value.push({ id: uniqueId++, status: false, daynum: i + 1, timenum: timenum });timenum = (timenum % 24) + 1; // 使 timenum 在 1 到 24 之间循环}}if (props.week) {datahandle();}
});//初始化处理数据
const datahandle = () => {let data: any = props.week === undefined ? [] : props.week;if (props.datatype == 1) {for (let i = 0; i < data.length; i++) {if (Number(data[i]) == 1) {weekData.value[i].status = true;}}} else if (props.datatype == 2) {let obj: any = JSON.parse(data);for (const key in obj) {let value = obj[key].split(",");for (let i = 0; i < weekData.value.length; i++) {const element = weekData.value[i];if (element.daynum == key) {if (value.includes(String(i))) {weekData.value[i].status = true;}}}}} else if (props.datatype == 3) {let array = data.split(",");for (let i = 0; i < array.length; i++) {const element = array[i];const dayNum = Number(element.slice(0, 1));const hourNum = Number(element.slice(1, 3).replace(/\b(0+)/gi, ""));const timeNum = element.slice(3, 5);for (let i = 0; i < weekData.value.length; i++) {const element = weekData.value[i];if (element.daynum == dayNum && element.timenum == hourNum) {if (timeNum == "00") {if (i % 2 === 0) {weekData.value[i].status = true;}} else {if (i % 2 !== 0) {weekData.value[i].status = true;}}}}}}
};const isDaySelected = computed(() => {return (index) => {if (weekData.value && weekData.value.length > 0) {return weekData.value.filter((t) => t.daynum === index + 1).every((item) => item.status === true);}return false;};
});const isTimeSelected = computed(() => {return (index) => {if (weekData.value && weekData.value.length > 0) {return weekData.value.filter((t) => t.timenum === index + 1).every((item) => item.status === true);}return false;};
});const objectsRef = ref();
const maskRef = ref();
const emits = defineEmits(["update:week"]);
const state = reactive({maskPosition: {show: false,startX: 0,startY: 0,endX: 0,endY: 0}, // 矩形框位置isPressCtrlKey: false // 是否按下了Ctrl键
});
const { maskPosition, isPressCtrlKey } = toRefs(state);// 若支持按住Ctrl多选,监听Ctrl事件
if (props.useCtrlSelect) {// 释放document.addEventListener("keyup", (event) => {if (event.keyCode === 17) {isPressCtrlKey.value = false;}});// 按下document.addEventListener("keydown", (event) => {if (event.keyCode === 17) {isPressCtrlKey.value = true;}});
}
//点击星期天数的事件
const clickDay = (index) => {// var weekData: Array<any> = [];// weekData = weekData === undefined ? [] : weekData;// const hours = weekData[index].hours;// const allIn = hasHandleObjectIds.value.every(item => weekData.includes(item));const arr = weekData.value.filter((t) => t.daynum == index + 1);const allIn = arr.every((item) => item.status === true);if (allIn) {arr.forEach((e) => {e.status = false;hasHandleObjectIds.value.splice(hasHandleObjectIds.value.findIndex((t) => t == e.id),1);});} else {arr.forEach((e) => {e.status = true;hasHandleObjectIds.value.push(e.id);});}emits("update:week", handlerdata());
};// 点击时间点数
const clicktime = (index) => {const arr = weekData.value.filter((t) => t.timenum == index + 1);const allIn = arr.every((item) => item.status === true);if (allIn) {arr.forEach((e) => {e.status = false;hasHandleObjectIds.value.splice(hasHandleObjectIds.value.findIndex((t) => t == e.id),1);});} else {arr.forEach((e) => {e.status = true;hasHandleObjectIds.value.push(e.id);});}emits("update:week", handlerdata());
};
/** 鼠标按下 */
const handleMouseDown = (event) => {//点下时清空已处理数组hasHandleObjectIds.value.length = 0;var id = Number(event.target.getAttribute(props.objectIdName));// var weekData: Array<any> = [];// weekData = weekData === undefined ? [] : weekData;// const hourItem = weekData.flatMap(day => day.hours).find(item => item.id === id);const index = weekData.value.findIndex((t) => t.id == id);if (index > -1) {weekData.value[index].status = !weekData.value[index].status;}if (!hasHandleObjectIds.value.includes(id)) {hasHandleObjectIds.value.push(id);} else {hasHandleObjectIds.value.splice(hasHandleObjectIds.value.findIndex((t) => t == id),1);}// 展示矩形框,通过坐标位置来画出矩形maskPosition.value.show = true;maskPosition.value.startX = event.clientX;maskPosition.value.startY = event.clientY;maskPosition.value.endX = event.clientX;maskPosition.value.endY = event.clientY;// 监听鼠标移动事件和抬起离开事件objectsRef.value.addEventListener("mousemove", handleMouseMove);objectsRef.value.addEventListener("mouseup", handleMouseUp);
};/** 鼠标移动 */
const handleMouseMove = (event) => {if (clientX.value !== event.clientX || clientY.value !== event.clientY) {clientX.value = event.clientX;clientY.value = event.clientY;maskPosition.value.endX = event.clientX;maskPosition.value.endY = event.clientY;// var weekData: Array<any> = [];// weekData = props.weekData === undefined ? [] : props.weekData;const selectedObjects = objectsRef.value.querySelectorAll(`.${props.objectClassName}`);// 获取鼠标画出的矩形框位置const rectanglePosition = maskRef.value.getClientRects()[0];var rectangleSelObjects: Array<number> = []; //矩形框内的id数组selectedObjects.forEach((item) => {const objectPosition = item.getClientRects()[0];// 这里获取的id的方式定义于父组件的objectIdNameif (compareObjectPosition(objectPosition, rectanglePosition)) {let id = item.getAttribute(props.objectIdName);rectangleSelObjects.push(Number(id));}});let handle = (id: number) => {const index = weekData.value.findIndex((t) => t.id == id);if (index > -1) weekData.value[index].status = !weekData.value[index].status;// let index = tempSelectObjectIds.findIndex(t => t == id);};// 处理存在于 hasHandleObjectIds 中但不在 rectangleSelObjects 中的元素for (let i = hasHandleObjectIds.value.length - 1; i >= 0; i--) {const id = hasHandleObjectIds.value[i];if (!rectangleSelObjects.includes(id)) {handle(id);hasHandleObjectIds.value.splice(i, 1);}}// 处理存在于 rectangleSelObjects 中但不在 hasHandleObjectIds 中的元素for (const id of rectangleSelObjects) {if (!hasHandleObjectIds.value.includes(id)) {handle(id);hasHandleObjectIds.value.push(id);}}// emits("update:weekData", weekData);// emits("update:selectObjectIds", tempSelectObjectIds);}
};/** 鼠标抬起离开 */
const handleMouseUp = () => {// 移除鼠标监听事件objectsRef.value.removeEventListener("mousemove", handleMouseMove);objectsRef.value.removeEventListener("mouseup", handleMouseUp);maskPosition.value.show = false;handleResetMaskPosition();emits("update:week", handlerdata());
};const handlerdata = () => {let arr = weekData.value;tempStr.value.push(Date.now() + "");if (props.datatype == 1) {let array = [] as any;for (let i = 0; i < arr.length; i++) {const element = arr[i];if (element.status) {array.push(1);} else {array.push(0);}}return array.join("");}if (props.datatype == 2) {let obj = {};for (let i = 0; i < arr.length; i++) {const element = arr[i];if (element.status) {if (obj[element.daynum]) {obj[element.daynum].push(i);} else {obj[element.daynum] = [i];}}}for (let key in obj) {if (Array.isArray(obj[key])) {obj[key] = obj[key].join(","); // 使用逗号连接数组中的元素}}// console.log(JSON.stringify(obj));return JSON.stringify(obj);}if (props.datatype == 3) {let array = [] as any;for (let i = 0; i < arr.length; i++) {const element = arr[i];if (element.status) {let day = String(element.daynum);let time = element.timenum < 10 ? "0" + element.timenum : String(element.timenum);let finalStr;if (i % 2 === 0) {finalStr = day + time + "00";} else {finalStr = day + time + "30";}array.push(finalStr);}}return array.toString();}// return arr.filter(item => item.status == true);
};
/*** 判断对象坐标是否在鼠标画出的矩形框坐标位置内* @param objectPosition 对象坐标位置* @param rectanglePosition 鼠标画出的矩形框坐标位置*/
const compareObjectPosition = (objectPosition, rectanglePosition) => {const maxX = Math.max(objectPosition.x + objectPosition.width,rectanglePosition.x + rectanglePosition.width);const maxY = Math.max(objectPosition.y + objectPosition.height,rectanglePosition.y + rectanglePosition.height);const minX = Math.min(objectPosition.x, rectanglePosition.x);const minY = Math.min(objectPosition.y, rectanglePosition.y);return (maxX - minX <= objectPosition.width + rectanglePosition.width &&maxY - minY <= objectPosition.height + rectanglePosition.height);
};/** 重置鼠标位置 */
const handleResetMaskPosition = () => {maskPosition.value.startX = 0;maskPosition.value.startY = 0;maskPosition.value.endX = 0;maskPosition.value.endY = 0;
};/** 通过鼠标位置实时计算矩形框大小 */
const maskWidth = computed(() => {return `${Math.abs(maskPosition.value.endX - maskPosition.value.startX)}px;`;
});
const maskHeight = computed(() => {return `${Math.abs(maskPosition.value.endY - maskPosition.value.startY)}px;`;
});
const maskLeft = computed(() => {return `${Math.min(maskPosition.value.startX, maskPosition.value.endX)}px;`;
});
const maskTop = computed(() => {return `${Math.min(maskPosition.value.startY, maskPosition.value.endY)}px;`;
});const buttons = [{ type: "primary", text: "清空选择" }] as const;
</script><style scoped lang="scss">
.dtime {line-height: 22px;margin-top: 10px;padding: 5px;color: #6c757d;font-size: 12px;transform: translateY(-20px);
}.dt {line-height: 22px;padding: 4px;color: #6c757d;font-size: 13px;display: inline-block;
}.dts {color: #000000;font-size: 12px;padding: 15px;
}.box {width: 100%;border-left: #909399 1px solid;border-bottom: #909399 1px solid;border-right: #909399 1px solid;
}.el-button {justify-content: flex-end;margin-left: 90%;display: inline-block;line-height: 22px;transform: translateY(-28px);
}.time {width: 100%;display: flex;align-items: center;font-size: 10px;color: #222222;// border: #999 1px solid;.timeleft {width: 8.75%;height: 45.8px;display: flex;align-items: center;justify-content: center;background: #f5f7fa;border-bottom: #999 1px solid;border-top: #999 1px solid;border-left: #999 1px solid;box-sizing: border-box;font-size: 10px;}.timeright {height: 44.9px;background: #f5f7fa;width: 100%;border-right: #999 1px solid;box-sizing: border-box;border-top: #999 1px solid;font-size: 10px;.timeright_cell {border-bottom: #999 1px solid;box-sizing: border-box;.topitem {height: 21.5px;display: flex;align-items: center;justify-content: center;border-left: #999 1px solid;text-align: center;box-sizing: border-box;}}}.timelefts {height: 40px;display: flex;align-items: center;justify-content: center;background: #f5f7fa;border-bottom: #999 1px solid;border-left: #999 1px solid;border-right: #999 1px solid;box-sizing: border-box;}.is_selected {background: var(--bgColor);color: #fff;}.objects {height: 100%;width: 100%;// overflow-y: auto;.mask {position: fixed;background: #409eff;opacity: 0;z-index: 100;}.objects_content {user-select: none;display: flex;flex-wrap: wrap;div {display: flex;align-items: center;justify-content: center;width: 2.083%;height: 40px;box-sizing: border-box;border-bottom: #999 1px solid;border-right: #999 1px solid;}}}
}
</style>

 

 

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

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

相关文章

FastAPI是一个现代、快速(高性能)的Web框架

FastAPI是一个现代、快速&#xff08;高性能&#xff09;的Web框架&#xff0c;专门用于构建基于Python的API。以下是对FastAPI的详细介绍&#xff1a; 一、基本概述 定义与用途&#xff1a;FastAPI是一个开源项目&#xff0c;基于Starlette和Pydantic库构建而成&#xff0c;…

奇安信20240513笔试

题目一 解题思路 n转为字符串&#xff0c;如果位数为偶数&#xff0c;取前一半设为x&#xff0c;后一段为y&#xff0c;从x最低位开始&#xff0c;9&#xff0c;9*10&#xff0c;9*10*10。。。 到最高位&#xff0c;加x&#xff0c;如果x大于或等于y&#xff0c;加1. 位数为奇数…

linux固定主机ip

1.查看虚拟网络配置 NAT设置&#xff1a; 2.修改网卡配置文件 vim /etc/sysconfig/network-scripts/ifcfg-ens33 TYPE"Ethernet" PROXY_METHOD"none" BROWSER_ONLY"no" BOOTPROTO"static" DEFROUTE"yes" IPV4_FAILURE_FATAL…

idea导入opencv和mediapipe

1.参考pycharm导入cv2_pycharm import cv2-CSDN博客 2.pip install opencv-python 3. python 3.8导入mediapipe 3.1 pip install mediapipe 导入报错&#xff0c; 3.2离线导入 参考Win10安装mediapipe的步骤_mediapipe安装python版本-CSDN博客 首先安装opencv-contrib-py…

App UI性能测试 - PerfDog使用全教程

App 性能测试指标: 响应、内存、CPU、FPS、GPU渲染、耗电、耗流等。 PerfDog的性能数据更加全面,所以下面以PerfDog来介绍安装使用流程及测试数据的获取与分析。 官网: PerfDog | 全平台性能测试分析专家 第一步,先访问官网进行注册, 注册好账号后,点击下载PerfDog,下…

git 文件没有修改,但一直提示有0行改动,还原也不行

查看文件修改内容 原来是文件的模式(读写可执行权限)发生了变化,内容本是没有变化. 怎么解决 git config --add core.filemode false忽略文件模式

Vue90-Vuex模块化:namespace

一、模块化的目标 当业务很复杂的时候&#xff0c;各个模块中的内容会很多&#xff0c;所以&#xff0c;要将不同业务功能的模块放到不同的位置 二、实现 2-1、模块内容的拆分 将对应的模块的内容&#xff0c;添加到对应的对象中去。 2-2、拆分后模块的使用 1、方式一 2、方…

创建react的脚手架

Create React App 中文文档 (bootcss.com) 网址&#xff1a;creat-react-app.bootcss.com 主流的脚手架&#xff1a;creat-react-app 创建脚手架的方法&#xff1a; 方法一&#xff08;JS默认&#xff09;&#xff1a; 1. npx create-react-app my-app 2. cd my-app 3. …

2024年信息素养大赛图形化编程小低组复赛真题-附答案 6547网

2024年全国青少年信息素养大赛图形化编程小低组复赛真题 题目总数&#xff1a;6 总分数&#xff1a;100 第1部分 第 1 题 问答题 【编程实现】点击小绿旗&#xff0c;实现将鱼的所有造型印到舞台区 【具体要求】 1. 将鱼显示出来 全部擦除所有内容 2. 将鱼的造型设…

python 10个自动化脚本

目录 &#x1f31f; 引言 &#x1f4da; 理论基础 &#x1f6e0;️ 使用场景与代码示例 场景一&#xff1a;批量重命名文件 场景二&#xff1a;自动下载网页内容 场景三&#xff1a;数据清洗 场景四&#xff1a;定时执行任务 场景五&#xff1a;自动化邮件发送 场景六…

极品AI大模型,抓紧收藏!整合包!

近期&#xff0c;科技巨头谷歌终于发布了1个月前在I/O开发者大会上预告过的Gemma 2大模型。据谷歌介绍&#xff0c;与第1代Gemma模型相比&#xff0c;新模型拥有更优的性能&#xff0c;推理效率也更高。我当然是&#xff0c;“无所谓&#xff0c;我会出手.jpg”&#xff0c;给大…

Linux 常见命令使用(超详细版)

文章目录 基本echo关机、重启命令上传下载工具rz/sz<、>、>>ls管道clearcdpwd 文件处理类命令mkdirrmdirtouchcpmv 文件查看类命令catmorelessheadtail 用户管理命令useraddpasswdusermoduserdelgroupaddgroupdel 文件属性类命令chmodchownchgrpln 文件压缩类命令t…

【多模态】40、ConvLLaVA | 使用 ConvNeXt 为 LLaVA 实现更高分辨率的输入

论文&#xff1a;ConvLLaVA: Hierarchical Backbones as Visual Encoder for Large Multimodal Models 代码&#xff1a;https://github.com/alibaba/conv-llava 出处&#xff1a;阿里 | 清华 时间&#xff1a;2024.05 一、背景 LMM 在很多任务上都表现出来很好的效果&…

ROS编译错误: fatal error: test_pkg/test_pkg.h: 没有那个文件

在ROS安装完毕后编译ros工作空间&#xff0c;出现了以下错误: 解决方法: 删除工作空间&#xff0c;重建再重新编译

vue3+ el-tree 展开和折叠,默认展开第一项

默认第一项展开: 展开所有项&#xff1a; 折叠所有项&#xff1a; <template><el-treestyle"max-width: 600px":data"treeData"node-key"id":default-expanded-keys"defaultExpandedKey":props"defaultProps"…

超好用的傲软录屏下载和解锁版安装教程 (专业好用的桌面录屏软件)

录屏系列软件安装目录 一、ZD屏幕录像机解锁版下载及安装教程 (一款小巧的轻量级屏幕录像工具) 二、班迪录屏Bandicam v7解锁版安装教程&#xff08;高清录屏软件&#xff09; 三、Mirillis Action v4 解锁版安装教程(专业高清屏幕录像软件) 四、Aiseesoft Screen Recorder…

支持图片识别语音输入的LobeChat保姆级本地部署流程

文章目录 前言1. LobeChat对我们有哪些帮助?2. 本地安装LobeChat3. 如何使用LobeChat工具4. 安装Cpolar内网穿透5. 实现公网访问LobeChat6. 固定LobeChat公网地址 前言 本文主要介绍如何在Windows系统电脑本地部署LobeChat&#xff0c;一款高颜值的开源AI大模型智能应用&…

Java学习十四—Java8特性之Lambda表达式

一、简介 Java 8 引入了 Lambda 表达式&#xff0c;它是一种更简洁、更便于使用的函数式编程特性。Lambda 表达式允许将函数作为方法的参数&#xff08;函数式接口的实例&#xff09;传递给某个方法&#xff0c;或者将代码像数据一样进行传递。 ‍ lambda是一个匿名函数&#…

LLM之RAG实战(四十一)| 使用LLamaIndex和Gemini构建高级搜索引擎

Retriever 是 RAG&#xff08;Retrieval Augmented Generation&#xff09;管道中最重要的部分。在本文中&#xff0c;我们将使用 LlamaIndex 实现一个结合关键字和向量搜索检索器的自定义检索器&#xff0c;并且使用 Gemini大模型来进行多个文档聊天。 通过本文&#xff0c;我…