vue使用富文本和打印 egg使用ctx.getFileStream进行文件上传

news2024/9/24 19:16:48

vue2使用富文本

安装

npm install vue-quill-editor --save

全局引入(main)

import  VueQuillEditor from 'vue-quill-editor'//调用编辑器
// 样式
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
Vue.use(VueQuillEditor)

vue2 使用打印功能

安装

npm install vue-print-nb --save

全局引入(main)

//引入打印机插件
import Print from 'vue-print-nb'
//注册
Vue.use(Print); //注册

组件应用

<template>
	<div class="bg-white p-5">
			 <!-- 给要打印的区块添加一个id,这时候给点击打印的按钮添加一个指令v-print,指定为要打印的区域id即可 -->
			 <div class="flex justify-end">
			 	<el-button  v-print="printObj" size="mini" type="primary">打印</el-button>
			 </div>
			    <div id="printTest" >
			<h3 style="text-align: center;">虚惊轻微事故调查表</h3>
			
			<div class="mt-5"  >
				<table style="width: 100%;">
					<tr>
						<td class="border p printcolor" style="text-align: center;background-color: #E7F3FC;">事故等级</td>
						<td class="border p" style="text-align: center;">虚惊/轻微</td>
						<td class="border p printcolor" style="text-align: center;background-color: #E7F3FC;">事故类别</td>
						<td class="border p" style="text-align: center;">物体打击</td>
						<td class="border p printcolor" style="text-align: center;background-color: #E7F3FC;">事故时间</td>
						<td class="border p" style="text-align: center;">2023-04-14</td>
						<td class="border p printcolor" style="text-align: center;background-color: #E7F3FC;">事故地点</td>
						<td class="border p" style="text-align: center;">上海</td>
					</tr>
					<tr>
						<td class="border p printcolor" style="text-align: center;background-color: #E7F3FC;">事故所属Bu</td>
						<td class="border p" style="text-align: center;">BU1</td>
						<td class="border p printcolor" style="text-align: center;background-color: #E7F3FC;">事故部门</td>
						<td class="border p" style="text-align: center;"></td>
						<td class="border p printcolor" style="text-align: center;background-color: #E7F3FC;">事故区域负责人</td>
						<td class="border p" style="text-align: center;"></td>
						<td class="border p printcolor" style="text-align: center;background-color: #E7F3FC;">电话</td>
						<td class="border p" style="text-align: center;">19822773234</td>
					</tr>
					<tr>
						<td class="border p printcolor"  colspan="8" style="background-color: #E7F3FC;">1.事故状况描述:(时间、地点、人物、受伤经过)</td>
					</tr>
					<tr>
						<td class="border p" style="height: 100px;"  colspan="8">
							<input type="file" style="display:none;" id="input" @change.prevent="upLoad()"/>
							<quill-editor class="editorimg"    v-model="content"  ref="myQuillEditor"  :options="editorOption"      @change="onEditorChange($event)"       >
							      </quill-editor>
						
							
						</td>
					</tr>
					<tr>
						<td class="border p printcolor"  colspan="8" style="background-color: #E7F3FC;">2.事故图片:</td>
					</tr>
					<tr>
						<td class="border p" style="height: 100px;"  colspan="8">
							
						</td>
					</tr>
					<tr>
						<td class="border p printcolor"  colspan="8" style="background-color: #E7F3FC;">3.事故处理情况(事故现场处理措施与状况、伤员处理情况等)</td>
					</tr>
					<tr>
						<td class="border p" style="height: 100px;"  colspan="8">
							
						</td>
					</tr>
					<tr>
						<td class="border p printcolor"  colspan="8" style="background-color: #E7F3FC;">4、事故直接损失统计</td>
					</tr>
					<tr>
						<td class="border p"  colspan="8">□无损失       □轻微损失(说明):</td>
					</tr>
					<tr>
						<td class="border p printcolor"  colspan="8" style="background-color: #E7F3FC;">5、原因分析与改善方案</td>
					</tr>
					<tr>
						<td class="border p"  colspan="8" style="height: 100px;" >
						
						</td>
					</tr>
					<tr>
						<td class="border p printcolor"  colspan="8" style="background-color: #E7F3FC;">6、预防改善对策:</td>
					</tr>
					<tr style="background-color: #E7F3FC;text-align: center;">
						<td class="border p printcolor"  colspan="3"  >改善对策</td>
						<td class="border p printcolor"   >完成时间</td>
						<td class="border p printcolor"   >佐证资料<el-button @click="drawer3 = true" type="text"  style="margin-left: 16px">描述</el-button></td>
						<td class="border p printcolor"   >责任人</td>
						<td class="border p printcolor"   >核实结果</td>
						<td class="border p printcolor"   >核实人员</td>
					</tr>
					<tr style="text-align: center;height: 30px;">
						<td class="border p"  colspan="3"  ></td>
						<td class="border p"   ></td>
						<td class="border p"   ></td>
						<td class="border p"   ></td>
						<td class="border p"   ></td>
						<td class="border p"   ></td>
					</tr>
					<tr style="text-align: center;height: 30px;">
						<td class="border p"  colspan="3"  ></td>
						<td class="border p"   ></td>
						<td class="border p"   ></td>
						<td class="border p"   ></td>
						<td class="border p"   ></td>
						<td class="border p"   ></td>
					</tr>
				</table>
			</div>
		<el-drawer title="佐证资料" :visible.sync="drawer3" direction="rtl" :close-on-press-escape='false'
			:wrapperClosable='false' destroy-on-close size='50%'>
			<div style="font-size: 10px;  padding: 10px;overflow-y: auto;" :style="{ height: (h + 'px') }" v-html>
				可根据具体对策提供相关佐证资料:<br/>
				改善现场照片、管理培训记录、书面培训教材、培训会议签到表、培训会议照片、制定相关管理要求文件等
				 </div>
		</el-drawer>
	</div>
	</div>
</template>

<script>
	import {mapState} from 'vuex'
	const windowHeight = window.innerHeight || document.body.clientHeight

	export default {
	
		

		data() {
			return {
				drawer3: false,
			
				 printObj:{
					id:'printTest',//打印的id
					popTitle:'管理系统平台',//打印的标题
			   },
			 // 富文本编辑器配置
			      editorOption: {
			        modules: {
						toolbar: { // 菜单栏(工具栏),手动配置自己需要的富文本功能
					   container: [
						 ["bold", "italic", "underline", "strike"], //加粗,斜体,下划线,删除线
						 [{ indent: "-1" }, { indent: "+1" }], // 左右缩进
						 [{ color: [] }, { background: [] }], // 字体颜色,字体背景颜色
						 [{ header: 1 }, { header: 2 }], // 标题,键值对的形式;1、2表示字体大小
						 [{ align: [] }], //对齐方式
						 ["image", /*"video"*/], //上传图片、上传视频
					   ],
					   handlers: {
						 'image': function (value) { // 劫持图片上传,自定义图片上传
						   if (value) {
							   // 通过input的type=file唤醒选择弹框,选择之后自定义上传路径
							 document.querySelector('#input').click()
						   }
		 
						 }
					   }
					 },
			        },
			        placeholder: "",
			      },
				content:''
			}
		},
		computed: {
			...mapState({
		
				h: state => {
					let a = windowHeight - 64 - 44 
					return state.screenHeight ? state.screenHeight : a
				}
			}),
		
		
		},
		methods:{
			
			    // 内容改变事件
			    onEditorChange({ quill, html, text }) {
				//一张图片好几万的字符串 
			      this.content = html;
			    },
				upLoad() {
				        let files = window.event.target.files[0];
						console.log(files)
						
						//上传文件
						// 在这里进行一系列的校验
						const formData = new FormData();
						formData.append("withc",'还发快手看');
						formData.append("hegidnh",'和立铠四大皆空福建省');
						formData.append("上传的key值",files);  //formData.append(‘filename’, file) 必须放到最后,否则ctx.getFileStream()取流完成时stream.fields仍然是空的
						
						this.$axios.post('/admin/shuguuploade',formData,{
							'Content-type' : 'multipart/form-data'
						}).then(res=>{
							// 上传成功后的处理
							console.log(res)
						})  
						
					
						
						
						//文件转成blob
						const blob = URL.createObjectURL(files);
						console.log(blob)
						
						//blob转成文件
						const file = new File([blob], '图片', { type: 'image/png', lastModified: Date.now() });
						console.log(file)
						//BLOB(url) 转 base64
						const image = new Image();
						image.src = blob;
						image.onload = () => {
						  // 构建canvas节点
						  const canvas = document.createElement('canvas');
						  canvas.width = image.width;
						  canvas.height = image.height;
						  const context = canvas.getContext('2d');
						  context.drawImage(image, 0, 0, image.width, image.height);
						  // 转换
						  const imgBase64 = canvas.toDataURL();
						 // console.log(imgBase64);
						 //base64 转 BLOB
						 // 分割base64
						 const temp = imgBase64.split(','); 
						 // 获取类型
						 const mime = temp[0].match(/:(.*?);/)[1];
						 // 解码使用 base-64 编码的字符串
						 const raw = window.atob(temp[1]);
						 const rawLength = raw.length;
						 // base64文件数据读取
						 const uInt8Array = new Uint8Array(rawLength);
						 for (let i = 0; i < rawLength; i += 1) {
						   uInt8Array[i] = raw.charCodeAt(i);
						 }
						 const blob1 = new Blob([uInt8Array], { type: mime });
						 console.log(blob1)
						};

		
				        if (files.size / 1024 / 1024 > 2) { // 定义上传的图片的大小
				          this.$message.warning('请上传小于2M的文件');
				          return;
				        }
				        let fileType = ['.jpg', '.png', '.jpeg'];
				        let suffix = files.name.substring(
				          files.name.lastIndexOf('.'),
				          files.name.length
				        );
				        if (fileType.indexOf(suffix) === -1) {
				          this.$message.warning('请上传格式为png、jpg的文件');
				          return;
				        }
				        // 将图片转换成base64
				        let reader=new FileReader()
						reader.readAsDataURL(files)
						reader.onload=(e)=>{
							
							let abs=`<img src='${e.target.result}'/>`
							this.content=this.content+abs
							document.querySelector('#input').value=''
						}
				      },
			upLoad1() {
			        let files = window.event.target.files[0];
			        if (files.size / 1024 / 1024 > 2) { // 定义上传的图片的大小
			          this.$message.warning('请上传小于2M的文件');
			          return;
			        }
			        let fileType = ['.jpg', '.png', '.jpeg'];
			        let suffix = files.name.substring(
			          files.name.lastIndexOf('.'),
			          files.name.length
			        );
			        if (fileType.indexOf(suffix) === -1) {
			          this.$message.warning('请上传格式为png、jpg的文件');
			          return;
			        }
			        // 将图片转换成base64
			        let reader=new FileReader()
					reader.readAsDataURL(files)
					reader.onload=(e)=>{
						
						let abs=`<img src='${e.target.result}'/>`
						this.content=this.content+abs
						document.querySelector('#input').value=''
					}
			      },
		}
	}
</script>

<style>
	/* 控制富文本的图片大小 */
	.editorimg img{
		max-height: 100px;
	}
	.editorimg{
		max-height: 220px;
		overflow: auto;
	}
	/* 给要打印的背景的元素添加样式 */
	.printcolor{
		-webkit-print-color-adjust: exact;
	}
</style>

eggjs开启流模式

配置 config/config.default.js
eggjs文档

config.multipart = {
  fileSize: '50mb',
  mode: 'stream', //'file' 可以配置文件模式  https://www.eggjs.org/zh-CN/basics/controller  官方文档  'stream' 配置流模式  配置的模式不一样 接收的方法方式就不一样
  fileExtensions: ['.xlsx', '.txt', '.jpg', '.JPG', '.png', '.PNG', '.gif', '.GIF', '.jpeg', '.JPEG','.apk'], // 扩展几种上传的文件格式
};

controller/shigu.js

'use strict';

const Controller = require('egg').Controller;
// 引入
const fs = require('fs');
const path = require('path');
//故名思意 异步二进制 写入流
const awaitWriteStream = require('await-stream-ready').write;
//管道读入一个虫洞。
const sendToWormhole = require('stream-wormhole');
const dayjs = require('dayjs');
class ShiguController extends Controller {
  async shuguuploade() {
    let { ctx, app } = this;
   
    const stream = await ctx.getFileStream();
    
    console.log(stream.fields)
    console.log(stream.filename)
    
    ctx.apiSuccess('ok');
  }
}

module.exports = ShiguController;

egg后台打印结果 vue前端 劫持图片上传,自定义图片上传
在这里插入图片描述
注意:
只支持上传一个文件。
上传文件必须在所有其他的 fields 后面,否则在拿到文件流时可能还获取不到 fields。

vue3使用富文本

引入tinymce富文本编辑器

npm i tinymce
npm i @tinymce/tinymce-vue

node_modules/tinymce引入 语音包下载
在这里插入图片描述

中文语言包zh-Hans.js下载地址
在这里插入图片描述
新建组件src/components/Editor.vue

<template>
    <editor v-model="content" tag-name="div" :init="init" />
    <ChooseImage :preview="false" ref="ChooseImageRef" :limit="9" />
</template>
<script setup>
import tinymce from "tinymce/tinymce";
import Editor from "@tinymce/tinymce-vue";
import ChooseImage from '~/components/ChooseImage.vue'
import { ref, watch } from "vue"
import "tinymce/themes/silver/theme"; // 引用主题文件
import "tinymce/icons/default"; // 引用图标文件
import 'tinymce/models/dom'
// tinymce插件可按自己的需要进行导入
// 更多插件参考:https://www.tiny.cloud/docs/plugins/
import "tinymce/plugins/advlist"
import "tinymce/plugins/anchor"
import "tinymce/plugins/autolink"
import "tinymce/plugins/autoresize"
import "tinymce/plugins/autosave"
import "tinymce/plugins/charmap" // 特殊字符
import "tinymce/plugins/code" // 查看源码
import "tinymce/plugins/codesample" // 插入代码
import "tinymce/plugins/directionality"
import "tinymce/plugins/emoticons"
import "tinymce/plugins/fullscreen" //全屏
import "tinymce/plugins/help"
import "tinymce/plugins/image" // 插入上传图片插件
import "tinymce/plugins/importcss" //图片工具
import "tinymce/plugins/insertdatetime" //时间插入
import "tinymce/plugins/link"
import "tinymce/plugins/lists" // 列表插件
import "tinymce/plugins/media" // 插入视频插件
import "tinymce/plugins/nonbreaking"
import "tinymce/plugins/pagebreak" //分页
import "tinymce/plugins/preview" // 预览
import "tinymce/plugins/quickbars"
import "tinymce/plugins/save" // 保存
import "tinymce/plugins/searchreplace" //查询替换
import "tinymce/plugins/table" // 插入表格插件
import "tinymce/plugins/template" //插入模板
import "tinymce/plugins/visualblocks"
import "tinymce/plugins/visualchars"
import "tinymce/plugins/wordcount" // 字数统计插件
// v-model
const props = defineProps({
    modelValue: String,
})
const emit = defineEmits(["update:modelValue"])

const ChooseImageRef=ref(null)
// 配置
const init = {
    language_url: '/tinymce/langs/zh-Hans.js', // 中文语言包路径
    language: "zh-Hans",
    skin_url: '/tinymce/skins/ui/oxide', // 编辑器皮肤样式
    content_css: "/tinymce/skins/content/default/content.min.css",
    menubar: false, // 隐藏菜单栏
    autoresize_bottom_margin: 50,
    max_height: 500,
    min_height: 400,
    // height: 320,
    toolbar_mode: "none",
    plugins:
        'wordcount visualchars visualblocks template searchreplace save quickbars preview pagebreak nonbreaking media insertdatetime importcss image help fullscreen directionality codesample code charmap link code table lists advlist anchor autolink autoresize autosave',
        //新增自定义按钮 这里需要注册如:imageUpload
    toolbar:
        "formats undo redo fontsizeselect fontselect ltr rtl searchreplace media imageUpload | outdent indent aligncenter alignleft alignright alignjustify lineheight underline quicklink h2 h3 blockquote numlist bullist table removeformat forecolor backcolor bold italic strikethrough hr link preview fullscreen help ",
    content_style: "p {margin: 5px 0; font-size: 14px}",
    fontsize_formats: "12px 14px 16px 18px 24px 36px 48px 56px 72px",
    font_formats: "微软雅黑=Microsoft YaHei,Helvetica Neue,PingFang SC,sans-serif;苹果苹方= PingFang SC, Microsoft YaHei, sans- serif; 宋体 = simsun, serif; 仿宋体 = FangSong, serif; 黑体 = SimHei, sans - serif; Arial = arial, helvetica, sans - serif;Arial Black = arial black, avant garde;Book Antiqua = book antiqua, palatino; ",
    branding: false,
    elementpath: false,
    resize: false, // 禁止改变大小
    statusbar: false, // 隐藏底部状态栏
    setup:(editor)=>{ //插入图片功能 自定义按钮imageUpload
        editor.ui.registry.addButton('imageUpload',{
            tooltip:'插入图片',//文字提示
            icon:'image',//内置图标
            onAction(){
                ChooseImageRef.value.open((data)=>{
                        data.forEach(url=>{
                            //插入内容 图片
                             editor.insertContent(`<img src='${url}' style='width:100%'/>`)
                        })
                })
             
            }
        })
    }
}
tinymce.init; // 初始化
const content = ref(props.modelValue)
watch(props, (newVal) => content.value = newVal.modelValue)
watch(content, (newVal) => emit("update:modelValue", newVal))
</script>
<style>
.tox-tinymce-aux {
    z-index: 9999 !important;
}
</style>


调用content.vue

<template>
    <FormDrawer ref="formDrawerRef" title="设置商品详情" @submit="submit" destroy-on-close>
         <el-form :model="form">
            <el-form-item >
                <Editor v-model="form.content"/>
            </el-form-item>
        </el-form>
    </FormDrawer>
</template>
<script setup>
import { reactive, ref } from 'vue';
import FormDrawer from '~/components/FormDrawer.vue';
import {readGoods,updateGoods} from '~/api/goods.js'
import Editor from '~/components/Editor.vue';
import { toast } from '~/composables/util';
const formDrawerRef=ref(null)
const form=reactive({
    content:''
})
const goodsId=ref(0)
const open=(row)=>{
    goodsId.value=row.id
    row.contentLoading=true
    readGoods(goodsId.value).then(res=>{
       form.content=res.content
        formDrawerRef.value.open()
    }).finally(()=>{
        row.contentLoading=false
    })
   
}
const emit=defineEmits(['reloadData'])

const submit=()=>{
    formDrawerRef.value.showLoading()
    updateGoods(goodsId.value,form)
    .then(res=>{
        toast('设置商品详情成功')
        formDrawerRef.value.close()
        emit('reloadData')
    })
    .finally(()=>{
        formDrawerRef.value.hideLoading()
    })
}
defineExpose({
    open
})
</script>

vue3使用打印功能

npm install vue3-print-nb --save

全局引入(main)

// 1. 全局挂载
import { createApp } from 'vue'
import App from './App.vue'
import print from 'vue3-print-nb'
const app = createApp(App)
app.use(print)
app.mount('#app')

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

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

相关文章

【汽车电子】浅谈LIN总线

目录 1.为何使用LIN总线 2.什么是LIN总线&#xff1f; 3.LIN总线的主从关系 4.LIN的特点 5.LIN报文帧结构 6.LIN总线波形 7.帧类型 8.进度表 9.状态机的实现 10.总结 11.声明 1.为何使用LIN总线 在这里你可能要问“不都有CAN总线了吗&#xff1f;这个LIN总线又是从哪…

【JS笔记】JS操作字符串、对象、数组、时间对象、数值操作、定时器

这篇文章&#xff0c;主要介绍JS操作字符串、对象、数组、时间对象、数值操作、定时器。 目录 一、字符串 1.1、定义字符串 1.2、字符串方法 1.3、模板字符串 1.4、JSON字符串 二、对象操作 2.1、定义对象 2.2、对象方法 三、数组操作 3.1、定义数组 3.2、数组方法 …

【Docker_windows】安装Docker桌面版

现在如果问什么行业最火&#xff0c;很多人第一反应肯定就是IT。的确&#xff0c;这些年随着互联网的不断发展&#xff0c;IT热门众所周知。那么就一起来说说&#xff0c;IT行业里&#xff0c;哪些技术更热门。 What&#xff1f; Docker Desktop&#xff1f; Docker Desktop是…

SpringBoot快速回顾(分别使用注解和xml方式去声明Bean,获取Bean)

SpringBoot快速回顾&#xff08;configuration注解&#xff09; 1. 使用xml声明Bean1.1 创建测试实体类1.2 创建xml文件&#xff08;目的&#xff1a;将实体类声明成Bean&#xff09;1.3 测试 2. 使用注解configuration声明Bean2.1 已经声明过实体类Student2.2 定义配置类2.3 测…

Lim测试平台变量使用规则介绍

一、Lim测试平台简介 Lim测试平台是一款轻量级的接口测试平台&#xff0c;也是为数不多使用python作为后端接口建设的语言。 正如它的名字我们希望在开展接口测试时能够“四两拨千斤”&#xff01;让用户操作更少但开展建设的效率更高。因此我们做了许多交互细节上的优化和创新…

Elasticsearch:人类语言到 ElasticSearch 查询 DSL

Elasticsearch 为开发者提供了强大的搜索功能。Elasticsearch 使用 DSL 来进行查询。对于很多从关系数据库过来的人&#xff0c;这个很显然不很适应。虽然我们可以使用 SQL 来进行查询&#xff0c;但是我们必须通过一些命令来进行转换。我们可以通过阅读文章&#xff1a; Elast…

SpringBoot统一功能处理(统⼀⽤户登录权限验证、统⼀异常处理、统⼀数据格式封装)

统⼀⽤户登录权限验证 1、最初的用户登录效验:在每个方法里面获取session和 session 中的用户信息&#xff0c;如果存在用户&#xff0c;那么就认为登录成功了&#xff0c;否则就登录失败了。 2、第二版用户登录效验:提供了统一的方法&#xff0c;在每个需要验证的方法中调用…

神经网络模型压缩技术—剪枝

目录 1.模型压缩定义 2.模型压缩必要性及可行性 3.模型压缩分类 3.1 主流分类 3.2 前端和后端 4.剪枝 4.1 剪枝定义 4.2 剪枝分类 4.2.1 基于粒度 4.2.2 基于是否结构化 4.2.3 基于目标 5. 结构化剪枝和非结构化剪枝 5.1 非结构化剪枝&#xff08;移除单个权重或神…

【Python习题集1】Python 语言基础知识

python习题 一、实验内容二、实验总结 一、实验内容 1、运用输入输出函数编写程序&#xff0c;将华氏温度转换成摄氏温度。换算公式&#xff1a;C(F-32)*5/9,其中C为摄氏温度&#xff0c;F为华氏温度。 &#xff08;1&#xff09;源代码&#xff1a; ffloat(input(输入华氏温…

swift 技术 监听电话中断

一直觉得自己写的不是技术&#xff0c;而是情怀&#xff0c;一个个的教程是自己这一路走来的痕迹。靠专业技能的成功是最具可复制性的&#xff0c;希望我的这条路能让你们少走弯路&#xff0c;希望我能帮你们抹去知识的蒙尘&#xff0c;希望我能帮你们理清知识的脉络&#xff0…

做好FP独立站有6大要点,注意!

跨境电商做FP独立站已经见怪不怪了&#xff0c;但要注意哪些要点才能做好一个成功的FP独立站呢&#xff0c;今天就跟大家聊一聊。 做好FP独立站有6个要点 1.选品 独立站运营选择产品的方向往往是抓住非主流、新奇等特征。不推荐在成熟平台上销售受欢迎的普通商品&#xff0c;…

Elasticsearch详解

文章目录 概览使用与ES交互索引创建索引查询索引删除文档创建修改文档局部修改文档查询文档删除全查询 整合SpringBootpom依赖application.ymlElasticsearchAutoConfigurationElasticsearchPropertiesElasticsearchConstantPersonSearchPageHelperPersonServiceBaseElasticsear…

zabbix 使用自定义命令做监控项

环境&#xff1a;Linux zabbix6 问题&#xff1a;某个监控项的值为linux终端的shell命令输出&#xff0c;需要做一个zabbix自定义监控项 解决办法&#xff1a;参考官方文档使用userparameters方法 背景&#xff1a;我需要监控Linux某个文件夹的文件数量&#xff0c;并设置阈值…

详解c++---stack和dequeue的介绍

目录标题 stack介绍stack的定义stack的数据插入stack中数据的个数stack数据删除stack中数据的查看判断stack对象是否为空stack对象的数据交换queue的介绍queue的定义queue的数据插入frontbackqueue的元素个数queue中元素的删除emptyqueue的数据交换 stack介绍 首先stack是一个…

windows kafka mq 安装和使用介绍 及踩坑记录 及集群架构kafka实现架构 各自运行机制 一次性看明白

目录 介绍 安装集群 简单介绍按照步骤 zookeeper 安装 kafka安装 基础配置3个节点 在配置三个启动bat 重点 常见问题 内存不够配置文件中增加如下 java.io.IOException: Map failed 基础使用 创建主题 查看创建 生产者 消费者 应用场景 kafka一些原理和特点 …

让自动化测试秒杀繁琐操作?试试PO模式设计框架

目录&#xff1a;导读 引言 po模式 优势&#xff1a; 目录解释&#xff1a; 页面对象设计模式&#xff1a; base基础层&#xff1a; page对象层&#xff1a; test:测试层 data数据层&#xff1a; common层&#xff1a; untils: config层&#xff1a; run层&#xff1a;…

救生衣、划船背心、救生圈、U 形救生圈和投掷式浮垫等个人漂浮设备 (PFD)UL报告标准要求

个人漂浮设备 (PFD) 个人漂浮设备 (PFD) 是帮助人们在水中保持漂浮状态的装备。个人漂浮设备是一个范围较大的商品分类&#xff0c;其中包括救生衣、划船背心、救生圈、U 形救生圈和投掷式浮垫 救生衣 救生衣是一种在使用者正确穿戴时可为其提供支持的服装或设备&#xff0c;由…

Redis【性能 01】Redis 5.x 6.x 7.x 共5个不同版本延迟及性能测试对比分析(单机版默认配置)

延迟及性能测试比对分析过程 1.环境说明2.测试结果Version 5.0.3【待优化版本】Version 5.0.7【云服务器使用的版本】Version 5.0.14【5.x最终版】Version 6.2.12【6.x最终版】Version 7.2-rc1【当前最新的发布候选版】 3.汇总分析3.1 延迟测试结果汇总3.1 性能测试结果汇总 4.…

今天 国际青年节 “International Youth Day “

《劝学》孟郊 击石乃有火&#xff0c;不击元无烟。 人学始知道&#xff0c;不学非自然。 万事须己运&#xff0c;他得非我贤。 青春须早为&#xff0c;岂能长少年。 Strike stones to make it burn; No smoke unless you strike. Youre crude if you dont learn; And you…

Syncthing文件同步 - 免费搭建开源的文件自动同步服务器并公网远程访问【私人云盘】

文章目录 1. 前言2. Syncthing网站搭建2.1 Syncthing下载和安装2.2 Syncthing网页测试2.3 注册安装cpolar内网穿透 3. 本地网页发布3.1 Cpolar云端设置3.2 Cpolar本地设置 4. 公网访问测试5. 结语 1. 前言 在数据爆炸的当下&#xff0c;每天都会产生海量的数据&#xff0c;这些…