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

element-ui 图片上传 及 quillEditor富文本(图片视频上传)

<template><div class="card" style="overflow: hidden; padding-bottom: 10px"><div style="padding: 20px 20px 0 20px"><span class="title_top"><span class="top_icon"></span>基本信息</span><el-divider></el-divider></div><div class="box"><div><div class="box_count"><div class="box_l"><FlexLinePI :title="'图文标题'" :dropshow="true"><el-input v-model.trim="ruleForm.title" maxlength="20" show-word-limit type="text" placeholder="请输入标题"v-clear-emoij @input="e => (ruleForm.title = formateText(e))"></el-input></FlexLinePI><FlexLinePI :title="'图文摘要'" :dropshow="true"><el-input style="white-space: pre-wrap;word-break: break-all;"v-model.trim="ruleForm.note" type="textarea" maxlength="150" show-word-limit rows="5"placeholder="请输入正文详情" @input="e => (ruleForm.note = formateText(e))"></el-input></FlexLinePI><FlexLinePI :title="'封面图片'" :dropshow="true"><el-upload class="avatar-uploader" :action="upload" :show-file-list="false":on-success="handleAvatarSuccess" :before-upload="beforeAvatarUpload" :on-progress="onprogress"><img v-if="ruleForm.cover" :src="ruleForm.cover" class="avatar" /><i v-else class="el-icon-plus avatar-uploader-icon"></i><div slot="tip" class="el-upload__tip" style="">( 建议上传图片尺寸100x100px,大小不超过5M )</div></el-upload></FlexLinePI><FlexLinePI :title="'图文描述'" :dropshow="true" :position="false"><div><quill-editor v-model="ruleForm.content" ref="quillEditor" :options="editorOption"></quill-editor><div class="rich-uploader"><!-- 图片上传组件辅助--><el-upload class="rich-uploader2" name="pic" action="" :show-file-list="false" accept=".jpg,.png,jpeg":http-request="httpRequest"></el-upload><AliUpload class="rich-uploader3" :url="videoURL" @deleteVideo="deleteVideo"@beforeupload="beforeupload" @uploadSuccess="uploadVideoSuccess" /><!-- <el-upload class="rich-uploader3" name="pic" action="" :show-file-list="false" accept="video/*":http-request="httpRequestvideo"></el-upload> --></div></div></FlexLinePI><div class="buttom"><el-button type="primary" @click="addandedit(0)" :loading="loadingbtn">{{ loadingbtn == false ? "保存" : "记载中"}}</el-button><el-button type="primary" @click="addandedit(1)" :loading="loadingbtn">{{ loadingbtn == false ? "保存并发布" : "记载中" }}</el-button><!-- <el-button type="primary" @click="look">预览</el-button> --></div></div><div class="box_r" :style="{'background-image': `url(${require('../../../assets/images/phone.png')}`}"><div class="box_r_informationurl"><div class="box_r_inImg"><img src="../../../assets/images/authorlogo.png" alt="" srcset="" style="width: 100%; height: 100%" /></div><div class="box_r_inlanguage" style="width: 180px"><p style="-webkit-line-clamp: 1; font-size: 14px; width: 100%" class="ellipsis">{{ ruleForm.title != "" ? ruleForm.title : "请输入标题" }}</p><div style="display: flex; margin-top: 5px; height: 80px"><div style="flex: 1;-webkit-line-clamp: 6;font-size: 12px;color: #999999;" class="ellipsis">{{ ruleForm.note != "" ? ruleForm.note : "请输入正文详情" }}</div><div class="box_r_inlanguageimg"><img :src="ruleForm.cover != '' ? ruleForm.cover : urlimg" alt="" srcset=""style="width: 100%; height: 100%" /></div></div></div></div></div></div></div></div><!-- 图片视频上传中 --><el-dialog title="" :visible.sync="dialogVisiblevideo" width="160px" :close-on-click-modal="false":close-on-press-escape="false" :show-close="false"><span slot="title"></span><div class="loadding_image" style=""><i class="el-icon-loading" style="font-size: 50px;"></i><div>{{ uptext }}</div><div v-if="videosize != ''">此视频有 {{ videosize }} MB大小,请稍等...</div></div></el-dialog></div>
</template>
<script>
// import step from "@/components/EchartsChart/nextstep.vue";
import { upload, uploadvideo } from "@/api/common.js";
import { quillEditor, Quill } from "vue-quill-editor";
import "quill/dist/quill.core.css";
import "quill/dist/quill.snow.css";
import "quill/dist/quill.bubble.css";
import axios from "axios";
import {detailGraphic,addGraphic,updateGraphic
} from "@/api/material/index.js";
// 引入修改video模块并注册
import video from "@/assets/js/quillVideo.js";
import AliUpload from './component/aliUpload.vue'
Quill.register(video);
export default {name: "AddImageText",components: {quillEditor,AliUpload// , step},computed: {quill() {const { quill } = this.$refs.quillEditor || {};return quill;}},data() {const toolbarOptions = [["bold", "italic", "underline", "strike"], //加粗,斜体,下划线,删除线["blockquote", "code-block"], //引用,代码块[{ header: 1 }, { header: 2 }], // 标题,键值对的形式;1、2表示字体大小[{ list: "ordered" }, { list: "bullet" }], //列表[{ script: "sub" }, { script: "super" }], // 上下标[{ indent: "-1" }, { indent: "+1" }], // 缩进[{ direction: "rtl" }], // 文本方向// [{ size: ["small", false, "large", "huge"] }], // 字体大小[{ header: [1, 2, 3, 4, 5, 6, false] }], //几级标题[{ color: [] }, { background: [] }], // 字体颜色,字体背景颜色[{ font: [] }], //字体[{ align: [] }], //对齐方式["clean"], //清除字体样式["image"], //上传图片["video"] // 视频];return {upload: upload,uploadvideo: uploadvideo,ruleForm: {id: "",title: "",note: "",cover: "",content: ""},// 视频progress: 0,// 富文本editorOption: {placeholder: "请输入内容",theme: "snow",modules: {clipboard: {// 粘贴版,处理粘贴时候带图片matchers: [[Node.ELEMENT_NODE, this.handleCustomMatcher]],},toolbar: {container: toolbarOptions, // 工具栏handlers: {image: function (value) {if (value) {console.log(value);// 触发input框选择图片文件document.querySelector(".rich-uploader2 input").click();} else {this.quill.format("image", false);}},video: function (value) {if (value) {console.log(value);// 触发input框选择图片文件document.querySelector(".rich-uploader3 input").click();} else {this.quill.format("video", false);}}}}}},// 上传图片urlimg: require("../../../assets/images/gift.png"),// 当前idupdateId: "",// 提交loadingbtn: false,dialogVisiblevideo: false,uptext: "",videosize: ""};},mounted() {this.updateId = this.$route.query.idif (this.updateId == undefined) {this.ruleForm = {id: "",title: "",note: "",cover: "",content: ""};} else {// 详情this.getdetail(this.updateId);}// 复制图片到富文本// let quill = this.$refs.quillEditor.quill;// quill.root.addEventListener(//   "paste",//   (evt) => {//     if (//       evt.clipboardData &&//       evt.clipboardData.files &&//       evt.clipboardData.files.length//     ) {//       evt.preventDefault();//       [].forEach.call(evt.clipboardData.files, (file) => {//         if (!file.type.match(/^image\/(gif|jpe?g|a?png|bmp)/i)) {//           return;//         }//         const formdata = new FormData();//         formdata.append("file", file, file.name);//         formdata.append("type", "1");//         // let length = quill.getSelection().index;//         quill.insertEmbed(1, "image", file);//         axios.post(upload, formdata, { header: { "Content-Type": "multipart/form-data" } })//           .then(res => {//             if (res.data.status == 1) {//               // let length = quill.getSelection().index;//               // 插入图片  服务器返回的图片地址//               quill.insertEmbed(1, "image", res.data.data.real_path);//               //       // 调整光标到最后//               quill.setSelection(1 + 1);//             } else {//               _this.$message.warning(res.data.msg || "数据响应过慢,请稍后再试");//             }//           })//           .catch(err => {//             console.log(err);//           });//       });//     }//   },//   false// );},computed: {},methods: {handleCustomMatcher(node, Delta) {console.log(Delta,123)let ops = []Delta.ops.forEach(op => {if (op.insert && typeof op.insert === 'string') {// 如果粘贴了图片,这里会是一个对象,所以可以这样处理ops.push({insert: op.insert,})} else {this.$message({message: '不允许粘贴图片,请手动上传',type: 'warning'})}})Delta.ops = opsreturn Delta},//handleAvatarSuccess(res, file) {if (res.status == 1) {this.dialogVisiblevideo = false;this.ruleForm.cover = res.data.real_path;}},beforeAvatarUpload(file) {let types = ["image/jpeg","image/jpg","image/png"];const isImage = types.includes(file.type);const isLtSize = file.size / 1024 / 1024 < 5;if (!isImage) {this.$message.warning("上传图片只能是 JPG、JPEG、PNG 格式!");return false;}if (!isLtSize) {this.$message.warning("上传图片大小不能超过 5MB!");return false;}return true;},onprogress(event, file, fileList) {console.log(event, file, fileList);// this.dialogVisiblevideo = true;},// 详情getdetail(id) {detailGraphic({id: id}).then(res => {if (res.status == 1) {this.ruleForm = {id: res.data.id,title: res.data.title,note: res.data.note,cover: res.data.cover,content: res.data.content};} else {this.$message.warning(res.msg || "数据响应过慢,请稍后再试");}}).catch(err => {console.log(err);});},//  步骤 2 =====================================================httpRequest(item) {const _this = this;_this.uptext = "图片正在上传中...";_this.videosize = "";let quill = _this.$refs.quillEditor.quill;let formdata = new FormData();formdata.append("file", item.file, item.file.name);formdata.append("type", "1");let length = quill.getSelection().index;quill.insertEmbed(length, "image", item.file);axios.post(upload, formdata, {header: { "Content-Type": "multipart/form-data" }}).then(res => {if (res.data.status == 1) {let length = quill.getSelection().index;// 插入图片  服务器返回的图片地址quill.insertEmbed(length, "image", res.data.data.real_path);//       // 调整光标到最后quill.setSelection(length + 1);} else {_this.$message.warning(res.data.msg || "数据响应过慢,请稍后再试");}}).catch(err => {console.log(err);});},// ==============================================================// 保存编辑addandedit(val) {if (this.ruleForm.title == "") {this.$message.warning("请输入图文标题");return;}if (this.ruleForm.note == "") {this.$message.warning("请输入图文摘要");return;}if (this.ruleForm.cover == "") {this.$message.warning("请上传封面图片");return;}if (this.ruleForm.content == "") {this.$message.warning("请输入图文描述");return;}this.loadingbtn = true;if (this.updateId == undefined) {let tmpParams = {id: "",title: this.ruleForm.title, // 时间note: this.ruleForm.note, // 时间cover: this.ruleForm.cover,content: this.ruleForm.content,is_publish: val};this.sever(tmpParams);} else {let tmpParams = {id: this.updateId,title: this.ruleForm.title, // 时间note: this.ruleForm.note, // 时间cover: this.ruleForm.cover,content: this.ruleForm.content,is_publish: val};this.edit(tmpParams);}},// 保存sever(val) {addGraphic(val).then(res => {if (res.status == 1) {this.loadingbtn = false;this.$router.push({name: "ImageText"});} else {this.$message.warning(res.msg || "数据响应过慢,请稍后再试");}}).catch(err => {console.log(err);});},// 编辑edit(val) {updateGraphic(val).then(res => {if (res.status == 1) {this.loadingbtn = false;this.$router.push({name: "ImageText"});} else {this.$message.warning(res.msg || "数据响应过慢,请稍后再试");}}).catch(err => {console.log(err);});},// 视频上传 =================deleteVideo(val) {console.log(val)},beforeupload(val) {this.dialogVisiblevideo = val.isshow;this.uptext = "视频上传中...";this.videosize = Math.ceil(val.filesize / (1024 * 1024));},uploadVideoSuccess(val) {this.$message.success("上传成功");this.dialogVisiblevideo = val.isshow;let quill = this.$refs.quillEditor.quill;let length = quill.getSelection().index;// 插入图片  服务器返回的图片地址quill.insertEmbed(length, "video", val.videoURL);// 调整光标到最后quill.setSelection(length + 1);},//  ======httpRequestvideo(item) {let chunkSize = 1024 * 1024 * 2; // 每个切片的大小(这里设置为2MB)let totalChunks = Math.ceil(item.file.size / chunkSize); // 总切片数let currentChunk = 1; // 当前切片索引var start = currentChunk * chunkSize;var end = Math.min(totalChunks, start + chunkSize);this.dialogVisiblevideo = true;this.videosize = Math.ceil(item.file.size / (1024 * 1024));this.uptext = "视频上传中...";const uploadNextChunk = () => {const formData = new FormData();formData.append("name", item.file.name);formData.append("data", item.file.slice(start, end));// formData.append("data", item.file);formData.append("total", totalChunks);formData.append("index", currentChunk);formData.append("filename", item.file.name);axios.post(uploadvideo + "?act=upload", formData, {headers: { "Content-Type": "multipart/form-data" },onUploadProgress: progressEvent => {this.progress = Math.round((currentChunk * 100 +progressEvent.loaded / progressEvent.total) /totalChunks);}}).then(res => {currentChunk++;if (currentChunk < totalChunks + 1) {uploadNextChunk();} else {this.progress = 0; // 上传完成后重置进度let date = {name: item.file.name,data: item.file,total: totalChunks,index: currentChunk,filename: item.file.name};this.uploadok(date);}}).catch(error => {this.dialogVisiblevideo = true;console.error("Error uploading file:", error);});};uploadNextChunk();},uploadok(val) {let quill = this.$refs.quillEditor.quill;let formdata = new FormData();formdata.append("name", val.name);formdata.append("data", val.data);formdata.append("total", val.total);formdata.append("index", val.index);formdata.append("filename", val.filename);axios.post(uploadvideo + "?act=join", formdata, {headers: { "Content-Type": "multipart/form-data" }}).then(res => {if (res.data.status == 1) {this.dialogVisiblevideo = false;this.$message.success(res.msg || "完成视频上传");let length = quill.getSelection().index;// 插入图片  服务器返回的图片地址quill.insertEmbed(length, "video", res.data.path);// 调整光标到最后quill.setSelection(length + 1);} else {this.dialogVisiblevideo = false;this.$message.warning(res.data.msg || "数据响应过慢,请稍后再试");}}).catch(error => {this.dialogVisiblevideo = false;console.error("Error uploading file:", error);});}}
};
</script>
<style scoped lang="less">
p {margin: 0;padding: 0;
}.box {width: 90%;// margin: 0 auto;margin-left: 35px;.box_count {display: flex;// justify-content: center;.box_l {width: 50%;}.box_r {width: 320px;height: 580px;margin: 10px 10px 10px 100px;background-size: 100% 100%;// box-shadow: 0 0 10px 0 #ccc;border-radius: 25px;position: relative;.box_r_informationurl {width: 100%;margin-top: 60px;display: flex;padding: 30px;.box_r_inImg {width: 36px;height: 36px;margin-left: 10px;}.box_r_inlanguage {flex: 1;margin: 0 10px;background: #ffffff;padding: 10px;border-radius: 5px;.box_r_inlanguageimg {width: 50px;height: 50px;}}}}}.buttom {display: flex;justify-content: center;margin: 10px 0;}
}/deep/ .ql-container {height: 600px;
}/deep/ .avatar {border-radius: 0;
}/deep/ .el-dialog__header {display: none;
}/deep/ .el-dialog__body {padding: 10px 20px;position: fixed;top: 50%;left: 50%;transform: translate(-50%, -50%);background-color: #ffffff00;color: #ccc;
}.loadding_image {margin: 0 auto;text-align: center;width: 125px;
}
</style>

相关文章:

element-ui 图片上传 及 quillEditor富文本(图片视频上传)

<template><div class"card" style"overflow: hidden; padding-bottom: 10px"><div style"padding: 20px 20px 0 20px"><span class"title_top"><span class"top_icon"></span>基本信息…...

前端技术Vue学习笔记--002

前端技术Vue学习笔记 文章目录 前端技术Vue学习笔记1、指令修饰符2、v-bind对于样式控制的增强2.1、v-bind对于样式控制的增强--class2.2、v-bind对于样式控制的增强--操作style 3、v-model应用于其他表单元素4、计算属性4.1、**computed计算属性 vs methods方法的区别**4.2、计…...

【RabbitMQ(day4)】SpringBoot整合RabbitMQ与MQ应用场景说明

一、SpringBoot 中使用 RabbitMQ 导入对应的依赖 <dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-amqp</artifactId></dependency>配置配置文件 spring:application:name: rabbitmq-springbo…...

想了解好用的翻译pdf的软件吗?

在全球化的时代背景下&#xff0c;跨国贸易越来越普遍&#xff0c;跨语言沟通也越来越频繁。小黄是一家跨国公司的员工&#xff0c;他梦想能在全球各地拓展自己的业务&#xff0c;奈何遇到了一个巨大的挑战&#xff1a;跨语言沟通。在这其中&#xff0c;pdf文件是他经常接收到的…...

docker安装nginx并配置SSL

1、拉取镜像 docker pull nginx2、启动nginx容器&#xff0c;复制一份默认配置文件出来 // 以nginx镜像为基础镜像创建一个名为nginx01的容器 docker run -d -p 80:80 --name nginx01 nginx创建成功后会看到nginx的欢迎页面 3、挂载nginx目录 拷贝nginx的配置信息到主机目录…...

【LeetCode 算法】Reorder List 重排链表

文章目录 Reorder List 重排链表问题描述&#xff1a;分析代码PointerReverseMerge Tag Reorder List 重排链表 问题描述&#xff1a; 给定一个单链表 L 的头节点 head &#xff0c;单链表 L 表示为&#xff1a; L0 → L1 → … → Ln - 1 → Ln 请将其重新排列后变为&#…...

MQ面试题3

1、讲一讲Kafka与RocketMQ中存储设计的异同&#xff1f; Kafka 中文件的布局是以 Topic/partition &#xff0c;每一个分区一个物理文件夹&#xff0c;在分区文件级别实现文件顺序写&#xff0c;如果一个Kafka集群中拥有成百上千个主题&#xff0c;每一个主题拥有上百个分区&am…...

【Linux命令200例】patch 用于将补丁文件应用到源码中

&#x1f3c6;作者简介&#xff0c;黑夜开发者&#xff0c;全栈领域新星创作者✌&#xff0c;阿里云社区专家博主&#xff0c;2023年6月csdn上海赛道top4。 &#x1f3c6;本文已收录于专栏&#xff1a;Linux命令大全。 &#x1f3c6;本专栏我们会通过具体的系统的命令讲解加上鲜…...

一起来学算法(邻接矩阵)

前言&#xff1a; 邻接矩阵是数学和计算机科学中常用的一种表示方式&#xff0c;用来表述有向图或无向图&#xff0c;一张图由一组顶点&#xff08;或结点&#xff09;和一组表组成&#xff0c;用邻接矩阵就能表示这些顶点间存在的边的关系 1.图的概念 对于图而言&#xff0c;…...

hadoop与HDFS交互

一、利用Shell命令与HDFS进行交互 在进行HDFS编程实践前&#xff0c;需要首先启动Hadoop。可以执行如下命令启动Hadoop&#xff1a; cd /usr/local/hadoop ./sbin/start-dfs.sh #启动hadoop Hadoop支持很多Shell命令&#xff0c;其中fs是HDFS最常用的命令&#xff0c;利用fs…...

MYSQL 分区如何指定不同存储路径(多块磁盘)

理论 可以针对分区表的每个分区指定存储路径&#xff0c;对于innodb存储引擎的表只能指定数据路径&#xff0c;因为数据和索引是存储在一个文件当中&#xff0c;对于MYISAM存储引擎可以分别指定数据文件和索引文件&#xff0c;一般也只有RANGE、LIST分区、sub子分区才有可能需要…...

安全加固服务器

根据以下的内容来加固一台Linux服务器的安全。 首先是限制连续密码错误的登录次数&#xff0c;由于RHEL8之后都不再使用pam_tally.so和pam_tally2.so&#xff0c;而是pam_faillock.so 首先进入/usr/lib64/security/中查看有什么模块&#xff0c;确认有pam_faillock.so 因为只…...

Linux 命令学习:

1. PS命令 ps 的aux和-ef区别 1、输出风格不同&#xff0c;展示的格式略有不同 两者的输出结果差别不大&#xff0c;但展示风格不同。aux是BSD风格&#xff0c;-ef是System V风格。 2、aux会截断command列&#xff0c;而-ef不会&#xff0c;当结合grep时这种区别会影响到结果 …...

牛客网Verilog刷题——VL54

牛客网Verilog刷题——VL54 题目答案 题目 实现一个深度为8&#xff0c;位宽为4bit的双端口RAM&#xff0c;数据全部初始化为0000。具有两组端口&#xff0c;分别用于读数据和写数据&#xff0c;读写操作可以同时进行。当读数据指示信号read_en有效时&#xff0c;通过读地址信号…...

学习系统编程No.34【线程同步之信号量】

引言&#xff1a; 北京时间&#xff1a;2023/7/29/16:34&#xff0c;一切尽在不言中&#xff0c;前几天追了几部电视剧&#xff0c;看了几部电影&#xff0c;刷了n个视屏&#xff0c;在前天我们才终于从这快乐的日子里恢复过来&#xff0c;然后看了两节课&#xff0c;也就是上…...

SolidUI社区-Snakemq 通信源码分析

背景 随着文本生成图像的语言模型兴起&#xff0c;SolidUI想帮人们快速构建可视化工具&#xff0c;可视化内容包括2D,3D,3D场景&#xff0c;从而快速构三维数据演示场景。SolidUI 是一个创新的项目&#xff0c;旨在将自然语言处理&#xff08;NLP&#xff09;与计算机图形学相…...

【大数据之Flume】四、Flume进阶之复制和多路复用、负载均衡和故障转移、聚合案例

1 复制和多路复用 &#xff08;1&#xff09;需求&#xff1a;使用 Flume-1 监控文件变动&#xff08;可以用Exec Source或Taildir Source&#xff09;&#xff0c;Flume-1 将变动内容传递给 Flume-2&#xff08;用Avro Sink传&#xff09;&#xff0c;&#xff08;用Avro Sou…...

前端学习--vue2--插槽

写在前面&#xff1a; 这个用法是在使用组件和创建组件中 文章目录 介绍简单使用多个插槽省写默认/后备内容作用域插槽常用实例Element-ui的el-table 废弃用法slot attributeslot-scope attribute 介绍 我们在定义一些组件的时候&#xff0c;由于组件内文字想要自定义&#…...

使用 Docker Compose 部署 Redis Cluster 集群,轻松搭建高可用分布式缓存

Redis Cluster&#xff08;Redis 集群&#xff09;是 Redis 分布式解决方案的一部分&#xff0c;它旨在提供高可用性、高性能和横向扩展的功能。Redis Cluster 能够将多个 Redis 节点组合成一个分布式集群&#xff0c;实现数据分片和负载均衡&#xff0c;从而确保在大规模应用场…...

在Spring Boot框架中集成 Spring Security

在Spring Boot框架中集成 Spring Security 目录 技术介绍SpringSecurity的核心功能&#xff1a;SpringSecurity特点&#xff1a;具体实现 1、集成依赖2、修改spring security实现service.impl.UserDetailsServiceImpl类 代码1具体解释代码2具体解释 实现config.SecurityConfi…...

相机Camera日志实例分析之二:相机Camx【专业模式开启直方图拍照】单帧流程日志详解

【关注我&#xff0c;后续持续新增专题博文&#xff0c;谢谢&#xff01;&#xff01;&#xff01;】 上一篇我们讲了&#xff1a; 这一篇我们开始讲&#xff1a; 目录 一、场景操作步骤 二、日志基础关键字分级如下 三、场景日志如下&#xff1a; 一、场景操作步骤 操作步…...

vscode(仍待补充)

写于2025 6.9 主包将加入vscode这个更权威的圈子 vscode的基本使用 侧边栏 vscode还能连接ssh&#xff1f; debug时使用的launch文件 1.task.json {"tasks": [{"type": "cppbuild","label": "C/C: gcc.exe 生成活动文件"…...

理解 MCP 工作流:使用 Ollama 和 LangChain 构建本地 MCP 客户端

&#x1f31f; 什么是 MCP&#xff1f; 模型控制协议 (MCP) 是一种创新的协议&#xff0c;旨在无缝连接 AI 模型与应用程序。 MCP 是一个开源协议&#xff0c;它标准化了我们的 LLM 应用程序连接所需工具和数据源并与之协作的方式。 可以把它想象成你的 AI 模型 和想要使用它…...

CentOS下的分布式内存计算Spark环境部署

一、Spark 核心架构与应用场景 1.1 分布式计算引擎的核心优势 Spark 是基于内存的分布式计算框架&#xff0c;相比 MapReduce 具有以下核心优势&#xff1a; 内存计算&#xff1a;数据可常驻内存&#xff0c;迭代计算性能提升 10-100 倍&#xff08;文档段落&#xff1a;3-79…...

汽车生产虚拟实训中的技能提升与生产优化​

在制造业蓬勃发展的大背景下&#xff0c;虚拟教学实训宛如一颗璀璨的新星&#xff0c;正发挥着不可或缺且日益凸显的关键作用&#xff0c;源源不断地为企业的稳健前行与创新发展注入磅礴强大的动力。就以汽车制造企业这一极具代表性的行业主体为例&#xff0c;汽车生产线上各类…...

多模态商品数据接口:融合图像、语音与文字的下一代商品详情体验

一、多模态商品数据接口的技术架构 &#xff08;一&#xff09;多模态数据融合引擎 跨模态语义对齐 通过Transformer架构实现图像、语音、文字的语义关联。例如&#xff0c;当用户上传一张“蓝色连衣裙”的图片时&#xff0c;接口可自动提取图像中的颜色&#xff08;RGB值&…...

(转)什么是DockerCompose?它有什么作用?

一、什么是DockerCompose? DockerCompose可以基于Compose文件帮我们快速的部署分布式应用&#xff0c;而无需手动一个个创建和运行容器。 Compose文件是一个文本文件&#xff0c;通过指令定义集群中的每个容器如何运行。 DockerCompose就是把DockerFile转换成指令去运行。 …...

OpenLayers 分屏对比(地图联动)

注&#xff1a;当前使用的是 ol 5.3.0 版本&#xff0c;天地图使用的key请到天地图官网申请&#xff0c;并替换为自己的key 地图分屏对比在WebGIS开发中是很常见的功能&#xff0c;和卷帘图层不一样的是&#xff0c;分屏对比是在各个地图中添加相同或者不同的图层进行对比查看。…...

CVE-2020-17519源码分析与漏洞复现(Flink 任意文件读取)

漏洞概览 漏洞名称&#xff1a;Apache Flink REST API 任意文件读取漏洞CVE编号&#xff1a;CVE-2020-17519CVSS评分&#xff1a;7.5影响版本&#xff1a;Apache Flink 1.11.0、1.11.1、1.11.2修复版本&#xff1a;≥ 1.11.3 或 ≥ 1.12.0漏洞类型&#xff1a;路径遍历&#x…...

如何更改默认 Crontab 编辑器 ?

在 Linux 领域中&#xff0c;crontab 是您可能经常遇到的一个术语。这个实用程序在类 unix 操作系统上可用&#xff0c;用于调度在预定义时间和间隔自动执行的任务。这对管理员和高级用户非常有益&#xff0c;允许他们自动执行各种系统任务。 编辑 Crontab 文件通常使用文本编…...