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

VUE实现刻度尺进度条

一、如下图所示效果:

运行后入下图所示效果:

实现原理是用div画图并动态改变进度,

二、div源码

<div style="width: 100%;"><div class="sdg_title" style="height: 35px;"><!--对话组[{{ dialogGroup.index }}]编辑--><div class="sdg_title_btns"><a-button size="mini" @click="deleteCurrentBlock">删除</a-button><div class="sdg_split"></div><a-button size="mini" @click="play" v-if="isPlay != '播放中'">运行</a-button><a-button size="mini" @click="pause" v-if="isPlay == '播放中'">暂停</a-button><a-button size="mini" @click="stop" v-if="isPlay != '未播放'">停止</a-button><div class="sdg_split"></div><div style="box-sizing: border-box; display: flex; justify-content: center; align-items: center;"><span>最小刻度单位:</span><a-radio-group v-model:value="scaleUnit" @change="init"><a-radio-button value="秒">1秒</a-radio-button><a-radio-button value="5秒">5秒</a-radio-button><a-radio-button value="10秒">10秒</a-radio-button></a-radio-group></div><div style="padding-left: 10px;"><span>刻度总时长:</span><a-input-number v-model:value="initData.period" placeholder="请输入任务想定名称"style="width: 80px" @change="maxPeriodChange"></a-input-number></div></div></div><div style="position: relative; width: 100%; display: flex; flex-direction: row;"><!--title--><div style="width: 150px; height: 250px;" class="scroll"><div class="blockTitle">刻度(总时长)</div><div class="blockTitle2">A项</div><div class="blockTitle2">B项</div></div><div style="width: calc(100% - 150px); height: 250px;" class="scroll"><!--刻度表--><div class="timeScaleBlock" :style="{ width: maxWidth + 'px' }"><div v-for="val in maxWidth / 100" :key="val" class="oneScaleUnit"><!--刻度主线--><div class="mainLine"></div><!--长刻度线--><div class="longLine" style="left: -1px"></div><div class="longLine" style="left: 48px"><div class="middleScaleValue" v-if="scaleUnit == '5秒'">{{ formatSecond((val * 10 - 5) * 5) }}</div><div class="middleScaleValue" v-else-if="scaleUnit == '10秒'">{{ formatSecond((val * 10 - 5) * 10) }}</div><div class="middleScaleValue" v-else>{{ formatSecond((val * 10 - 5)) }}</div></div><!--短刻度线--><div class="shortLine" style="left: 9px"></div><div class="shortLine" style="left: 19px"></div><div class="shortLine" style="left: 28px"></div><div class="shortLine" style="left: 38px"></div><div class="shortLine" style="left: 58px"></div><div class="shortLine" style="left: 68px"></div><div class="shortLine" style="left: 78px"></div><div class="shortLine" style="left: 88px"></div></div><div class="leftBorder" v-if="clickBlock" :style="{ left: leftBorderValue }">↑<div class="borderValue">{{ formatSecond(clickBlock.startTime) }}</div></div><div class="leftBorder" v-if="clickBlock" :style="{ left: rightBorderVaule }">↑<div class="borderValue">{{ formatSecond(clickBlock.endTime) }}</div></div><!--播放进度三尖角--><div class="triangleDiv" :style="{ left: triangleDivLeft + 'px' }"><span class="second">{{ formatSecond(startTime) }}</span></div></div><!--背景信号--><div class="stationBlock" id="backgroundTimeLineDiv" v-if="initData" :style="{ width: maxBlockWidth + 'px' }" @mousemove="bgMousemove" @mouseup="bgMouseup" @mouseleave="bgMouseleave"><div :id="item.id"class="tae_base_block1"v-for="(item, index) in initData.backgroundTimeLine" :key="index"@mousedown="dialogueBlockClick(item)":class="{ block_selected1: clickBlock && clickBlock.id == item.id }":style="{ width: item.widthPx, left: item.leftPx }"><div class="blockItem">{{ item.name }}</div><div class="blockItem">{{ item.period }}秒</div></div><!-- 拖拽进入的临时模块 --><div v-if="tempBlockData && tempBlockData.blockType == 'signal'" class="tae_base_block1_temp" :style="{ width: tempBlockData.widthPx, left: tempBlockData.leftPx }"><div class="blockItem">{{ tempBlockData.name }}</div><div class="blockItem">{{ tempBlockData.period }}秒</div></div></div><!--设备部署--><div class="stationBlock" v-if="initData" :style="{ width: maxBlockWidth + 'px' }" @mousemove="bgMousemove" @mouseup="bgMouseup" @mouseleave="bgMouseleave"><div :id="item.id"class="tae_base_block2"v-for="(item, index) in initData.equipmentTimeLine" :key="index"@mousedown="dialogueBlockClick(item)":class="{ block_selected2: clickBlock && clickBlock.id == item.id }":style="{ width: item.widthPx, left: item.leftPx }"><div class="blockItem">{{ item.name }}</div><div class="blockItem">{{ item.period }}秒</div></div><!-- 拖拽进入的临时模块 --><div v-if="tempBlockData && tempBlockData.blockType == 'place'" class="tae_base_block2_temp" :style="{ width: tempBlockData.widthPx, left: tempBlockData.leftPx }"><div class="blockItem">{{ tempBlockData.name }}</div><div class="blockItem">{{ tempBlockData.period }}秒</div></div></div><!--播放背景布--><div v-if="startTime > 0" class="stationPlayBlock" :style="{ width: triangleDivLeft + 6 + 'px'}"></div></div></div></div>

script源码如下

<script>
import { mapState, mapActions } from 'vuex'
import { message } from 'ant-design-vue'
export default {name: 'DialogBlockEditor',components: {},props: {initDefaultData: {type: Object,default: () => {return null}},dialogGroup: {type: Object,default: () => {return null}},},computed: {...mapState(['runningScenario']),leftBorderValue() {let unit = 1if (this.scaleUnit == '5秒') {unit = 5} else if (this.scaleUnit == '10秒') {unit = 10}return (10 * this.clickBlock.startTime) / unit - 7 + 'px'},rightBorderVaule() {let unit = 1if (this.scaleUnit == '5秒') {unit = 5} else if (this.scaleUnit == '10秒') {unit = 10}return (10 * this.clickBlock.endTime) / unit - 7 + 'px'},isPlay() {if (this.startTime == 0 && this.timer == null) {return '未播放'} else if (this.startTime > 0 && this.timer == null) {return '暂停中'} else {return '播放中'}}},data() {return {initData: {startTime: 0,period: 60, // 任务总时长backgroundTimeLine: [{name: '素材1',type: 'signal',period: 10,startTime: 10,},], // 时间线equipmentTimeLine: [{name: '素材1',type: 'place',period: 10,startTime: 10,},], // 时间线},loading: false,maxWidth: 2000,maxBlockWidth: 1000,scaleUnit: '秒',dialogueBlock: null,clickBlock: null,dataList: [],audioSrc: '',triangleDivLeft: -6,timer: null,startTime: 0,tempData: null,tempBlockData: null,clientLeft: 0,}},mounted() {if(this.initDefaultData==null){this.initDefaultData=this.initData}else{this.initData=this.initDefaultData}this.init()setTimeout(() => {let backgroundTimeLineDiv = document.getElementById('backgroundTimeLineDiv')this.clientLeft = backgroundTimeLineDiv.getBoundingClientRect().left}, 2000)},beforeDestroy() {this.stop()},methods: {...mapActions(['runScenario', 'stopScenario']),async init() {if (this.scaleUnit == '5秒') {this.maxWidth = Math.ceil(this.initData.period / 50) * 100this.maxBlockWidth = this.initData.period * 2} else if (this.scaleUnit == '10秒') {this.maxWidth = Math.ceil(this.initData.period / 100) * 100this.maxBlockWidth = this.initData.period} else {this.maxWidth = Math.ceil(this.initData.period / 10) * 100this.maxBlockWidth = this.initData.period * 10}let sortNumber = 0for (let backgroundData of this.initData.backgroundTimeLine) {backgroundData.id = Tool.uuid(8, 32)backgroundData.leftPx = this.timeToPx(backgroundData.startTime - this.initData.startTime)backgroundData.widthPx = this.timeToPx(backgroundData.period)backgroundData.endTime = backgroundData.startTime + backgroundData.periodbackgroundData.blockType = backgroundData.typebackgroundData.sortNumber = sortNumber++// rightPx: this.timeToPx(dialogueDetail[0] - this.initData.startTime + dialogue.period)}sortNumber = 0for (let equipmentData of this.initData.equipmentTimeLine) {equipmentData.id = Tool.uuid(8, 32)equipmentData.leftPx = this.timeToPx(equipmentData.startTime - this.initData.startTime)equipmentData.widthPx = this.timeToPx(equipmentData.period)equipmentData.endTime = equipmentData.startTime + equipmentData.periodequipmentData.blockType = equipmentData.typeequipmentData.sortNumber = sortNumber++// rightPx: this.timeToPx(dialogueDetail[0] - this.initData.startTime + dialogue.period)}this.$nextTick(() => {this.initBlockClickEvent()})},/*** 增加素材到刻度尺* @param data 素材数据* @param type */addBlock(data, type) {if (type == 'signal') {this.initData.backgroundTimeLine.push(data)} else if (type == 'place') {this.initData.equipmentTimeLine.push(data)}this.init()},timeToPx(time) {switch (this.scaleUnit) {case '秒':return time * 10 + 'px'case '5秒':return time * 2 + 'px'case '10秒':return time + 'px'}},pxToTime(px) {switch (this.scaleUnit) {case '秒':return Math.round(px / 10) + this.initData.startTimecase '5秒':return Math.round(px / 2) + this.initData.startTimecase '10秒':return px + this.initData.startTime}},async dataConfirm() {this.$emit('save-scheme-dialog', this.initData)},dialogueBlockClick(block) {this.clickBlock = block},deleteCurrentBlock() {if (this.clickBlock) {if (this.clickBlock.blockType == 'signal') { // 删除的for (let index in this.initData.backgroundTimeLine) {if (this.initData.backgroundTimeLine[index].id == this.clickBlock.id) {this.initData.backgroundTimeLine.splice(index, 1)break}}} else {for (let index in this.initData.equipmentTimeLine) { // 删除的是if (this.initData.equipmentTimeLine[index].id == this.clickBlock.id) {this.initData.equipmentTimeLine.splice(index, 1)break}}}this.clickBlock = nullmessage.success('删除成功')this.init()} else {message.error('未选择台词块!')}},initBlockClickEvent() {for (let dialogueWrapper of this.initData.backgroundTimeLine) {let dom = document.getElementById(dialogueWrapper.id)dom.onmousedown = (e) => {this.onmousedownEvent(e, dialogueWrapper)}}for (let dialogueWrapper of this.initData.equipmentTimeLine) {let dom = document.getElementById(dialogueWrapper.id)dom.onmousedown = (e) => {this.onmousedownEvent(e, dialogueWrapper)}}},maxPeriodChange(){this.init()},onmousedownEvent(event, clickBlock) {let disX = event.clientXlet oldLeftPx = Number.parseFloat(clickBlock.leftPx)document.onmousemove = (me) => {let offsetPx = me.clientX - disXswitch (this.scaleUnit) {case '秒':offsetPx = Math.round(offsetPx / 10) * 10breakcase '5秒':offsetPx = Math.round(offsetPx / 2) * 2breakcase '10秒':break}offsetPx += oldLeftPx// 边界处理let preBlock = null, nextBlock = nullif (clickBlock.blockType == 'signal') { //if (clickBlock.sortNumber > 0) {preBlock = this.initData.backgroundTimeLine[clickBlock.sortNumber - 1]}if (this.initData.backgroundTimeLine[clickBlock.sortNumber + 1]) {nextBlock = this.initData.backgroundTimeLine[clickBlock.sortNumber + 1]}} else { // if (clickBlock.sortNumber > 0) {preBlock = this.initData.equipmentTimeLine[clickBlock.sortNumber - 1]}if (this.initData.equipmentTimeLine[clickBlock.sortNumber + 1]) {nextBlock = this.initData.equipmentTimeLine[clickBlock.sortNumber + 1]}}// 左边重合if (preBlock) {if (offsetPx < Number.parseInt(preBlock.leftPx) + Number.parseInt(preBlock.widthPx)) { // 重合了offsetPx = Number.parseInt(preBlock.leftPx) + Number.parseInt(preBlock.widthPx)}} else {if (offsetPx < 0) {offsetPx = 0}}// 判断右边重合if (nextBlock) {if (offsetPx + Number.parseInt(clickBlock.widthPx) > Number.parseInt(nextBlock.leftPx)) {offsetPx = Number.parseInt(nextBlock.leftPx) - Number.parseInt(clickBlock.widthPx)}}clickBlock.leftPx = offsetPx + 'px'clickBlock.startTime = this.pxToTime(offsetPx)clickBlock.endTime = clickBlock.startTime + clickBlock.period}document.onmouseup = () => {document.onmousemove = nulldocument.onmouseup = null}},closeDialog() {this.$emit('close-dialog')return false},play() {this.timer = setInterval(() => {this.startTime++this.calcTriangleDivLeft()for (let block of this.initData.backgroundTimeLine) {if (!block.status) { // 还未运行if (this.startTime >= block.startTime && this.startTime <= block.endTime) {block.status = 'running'this.runScenario({_this: this,scenario: this.initData,callback: () => {}})break}} else if (block.status == 'running') { // 正在运行if (this.startTime > block.endTime) {block.status = 'ended'break}}}for (let block of this.initData.equipmentTimeLine) {if (!block.status) { // 还未运行if (this.startTime >= block.startTime && this.startTime <= block.endTime) {block.status = 'running'break}} else if (block.status == 'running') { // 正在运行if (this.startTime > block.endTime) {block.status = 'ended'break}}}if (this.startTime >= this.initData.period) { // 播放完成了this.stop()}}, 1000)message.success('开始播放')},pause() {if (this.timer) {try {clearInterval(this.timer)} catch (e) {}}this.timer = nullmessage.success('暂停')},stop() {if (this.timer) {try {clearInterval(this.timer)} catch (e) {}}this.timer = nullthis.startTime = 0this.triangleDivLeft = -6for (let block of this.initData.backgroundTimeLine) {block.status = null}for (let block of this.initData.equipmentTimeLine) {block.status = null}message.success('停止')},calcTriangleDivLeft() {switch (this.scaleUnit) {case '秒':this.triangleDivLeft = this.startTime * 10 - 6breakcase '5秒':this.triangleDivLeft = this.startTime * 2 - 6breakcase '10秒':this.triangleDivLeft = this.startTime - 6breakcase '分':this.triangleDivLeft = this.startTime * 10 / 60 - 6breakcase '5分':this.triangleDivLeft = this.startTime * 10 / 300 - 6breakcase '10分':this.triangleDivLeft = this.startTime * 10 / 600 - 6break}},formatSecond(value) {value = value || 0;let second = parseInt(value, 10); // 秒let minute = 0; // 分let hour = 0; // 小时if (second > 60) {// 当大于60秒时,才需要做转换minute = Math.floor(second / 60);second = Math.floor(second % 60);if (minute > 60) {hour = Math.floor(minute / 60);minute = Math.floor(minute % 60);}} else {// 小于60秒时,直接显示,不需要处理}let result = "" + Tool.PrefixInteger(second, 2) + "";// 拼上分钟result = "" + Tool.PrefixInteger(minute, 2) + ":" + result;// 拼上小时result = "" + Tool.PrefixInteger(hour, 2) + ":" + result;return result},bgMousemove(e) {if (this.tempData) {document.body.style.cursor = 'move'let offsetPx = e.clientX - this.clientLeftswitch (this.scaleUnit) {case '秒':offsetPx = Math.round(offsetPx / 10) * 10breakcase '5秒':offsetPx = Math.round(offsetPx / 2) * 2breakcase '10秒':break}let startTime = this.pxToTime(offsetPx)this.tempBlockData = {id: Tool.uuid(8, 32),name: this.tempData.name,period: this.tempData.period,leftPx: offsetPx + 'px',widthPx: this.timeToPx(this.tempData.period),startTime: startTime,endTime: startTime + this.tempData.period,blockType: this.tempData.type,}// 判断是否重合if (this.judgeBlockCoincidence(this.tempBlockData)) { // 重合了document.body.style.cursor = 'not-allowed'this.tempBlockData.success = false}else { // 没有重合document.body.style.cursor = 'move'this.tempBlockData.success = true}}},bgMouseup(e) {document.body.style.cursor = 'auto'if (this.tempBlockData && this.tempBlockData.success) {let tempData = Tool.deepCopy(this.tempData)tempData.startTime = this.tempBlockData.startTimethis.initData.period+=this.tempBlockData.periodif (this.tempBlockData.blockType == 'signal') {this.initData.backgroundTimeLine.push(tempData)this.initData.backgroundTimeLine.sort((a, b) => a.startTime > b.startTime ? 1 : -1)}else {this.initData.equipmentTimeLine.push(tempData)this.initData.equipmentTimeLine.sort((a, b) => a.startTime > b.startTime ? 1 : -1)}//console.log('规划-鼠标松开1',this.tempData.period)this.init()//console.log('规划-鼠标松开2',this.tempData.period)}this.tempBlockData = nullthis.tempData = null},bgMouseleave(e) {this.tempBlockData = nulldocument.body.style.cursor = 'auto'},// 判断是否有重合judgeBlockCoincidence(blockData) {let list = nullif (blockData.blockType == 'signal') {list = this.initData.backgroundTimeLine} else {list = this.initData.equipmentTimeLine}for (let block of list) {if (blockData.startTime > block.startTime && blockData.startTime < block.endTime) {return true}if (blockData.endTime > block.startTime && blockData.endTime < block.endTime) {return true}}return false},setTempData(tempData) {this.tempData = tempData},updata(tempData){this.initData=tempDatathis.init()}}
}
</script>

运行时如有问题,欢迎讨论

相关文章:

VUE实现刻度尺进度条

一、如下图所示效果&#xff1a; 运行后入下图所示效果&#xff1a; 实现原理是用div画图并动态改变进度&#xff0c; 二、div源码 <div style"width: 100%;"><div class"sdg_title" style"height: 35px;"><!--对话组[{{ dialo…...

ZYNQ FPGA自学笔记~点亮LED

一 ZYNQ FPGA简介 ZYNQ FPGA主要特点是包含了完整的ARM处理系统&#xff0c;内部包含了内存控制器和大量的外设&#xff0c;且可独立于可编程逻辑单元&#xff0c;下图中的ARM内核为 ARM Cortex™-A9&#xff0c;ZYNQ FPGA包含两大功能块&#xff0c;处理系统Processing System…...

攻击者如何在日常网络资源中隐藏恶意软件

近二十年来&#xff0c;安全 Web 网关 (SWG) 一直在监控网络流量&#xff0c;以检测恶意软件、阻止恶意网站并保护企业免受基于 Web 的威胁。 然而&#xff0c;攻击者已经找到了许多绕过这些防御措施的方法&#xff0c;SquareX的安全研究人员对此进行了记录。 最危险的策略之…...

《深度学习》深度学习 框架、流程解析、动态展示及推导

目录 一、深度学习 1、什么是深度学习 2、特点 3、神经网络构造 1&#xff09;单层神经元 • 推导 • 示例 2&#xff09;多层神经网络 3&#xff09;小结 4、感知器 神经网络的本质 5、多层感知器 6、动态图像示例 1&#xff09;一个神经元 相当于下列状态&…...

“中秋快乐”文字横幅的MATLAB代码生成

中秋快乐呀朋友们&#xff01;&#xff01;&#xff01; 给大家带来一个好玩的代码&#xff0c;能够生成“中秋快乐”的横幅文字&#xff0c;比较简单&#xff0c;当然你也可以根据自己的需求去更改文字和背景&#xff0c;废话不多说&#xff0c;直接展示。 文字会一直闪烁&…...

【Node.js】RabbitMQ 延时消息

概述 在 RabbitMQ 中实现延迟消息通常需要借助插件&#xff08;如 RabbitMQ 延迟队列插件&#xff09;&#xff0c;因为 RabbitMQ 本身不原生支持延迟消息。 延迟消息的一个典型场景是&#xff0c;当消息发布到队列后&#xff0c;等待一段时间再由消费者消费。这可以通过配置…...

前后端分离Vue美容店会员信息管理系统o7grs

目录 技术栈介绍具体实现截图系统设计研究方法&#xff1a;设计步骤设计流程核心代码部分展示研究方法详细视频演示试验方案论文大纲源码获取 技术栈介绍 本课题的研究方法和研究步骤基本合理&#xff0c;难度适中&#xff0c;本选题是学生所学专业知识的延续&#xff0c;符合…...

初学Linux(学习笔记)

初学Linux&#xff08;学习笔记&#xff09; 前言 本文跳过了Linux前期的环境准备&#xff0c;直接从知识点和指令开始。 知识点&#xff1a; 1.目录文件夹&#xff08;Windows&#xff09; 2.文件内容属性 3.在Windows当中区分文件类型是通过后缀&#xff0c;而Linux是通过…...

新增的标准流程

同样的新增的话我们也是分成两种&#xff0c; 共同点&#xff1a; 返回值都是只需要一个Result.success就可以了 接受前端的格式都是json格式&#xff0c;所以需要requestbody 1.不需要连接其他表的 传统方法&#xff0c;在service层把各种数据拼接给new出来的employee从…...

WebSocket 协议

原文地址&#xff1a;xupengboo WebSocket WebSocket 是 HTML5 开始提供的一种在单个 TCP 连接上进行全双工通讯的协议。 在 WebSocket API 中&#xff0c;浏览器和服务器只需要完成一次握手&#xff0c;两者之间就直接可以创建持久性的连接&#xff0c;并进行双向数据传输。…...

[mysql]mysql排序和分页

#排序和分页本身是两块内容,因为都比较简单,我们就把它分到通一个内容里. #1排序: SELECT * FROM employees #我们会发现,我们没有做排序操作,但是最后出来的107条结果还是会按顺序发出,而且是每次都一样.这我们就有一个疑惑了,现在我们的数据库是根据什么来排序的,在我们没有进…...

开源 AI 智能名片 S2B2C 商城小程序中的全渠道供应策略

摘要&#xff1a;本文深入探讨在开源 AI 智能名片 S2B2C 商城小程序的情境下&#xff0c;全渠道供应的运行机制。阐述各环节企业相互配合的重要性&#xff0c;重点分析零售企业在其中的关键作用&#xff0c;包括协调工作、信息传递、需求把握等方面&#xff0c;旨在实现高效的全…...

一次渲染十万条数据:前端技术优化(上)

今天看了一篇文章&#xff0c;写的是一次性渲染十万条数据的方法&#xff0c;本文内容是对这篇文章的学习总结&#xff0c;以及知识点补充。 在现代Web应用中&#xff0c;前端经常需要处理大量的数据展示&#xff0c;例如用户评论、商品列表等。直接渲染大量数据会导致浏览器性…...

springboot实训学习笔记(5)(用户登录接口的主逻辑)

接着上篇博客学习。上篇博客是已经基本完成用户模块的注册接口的开发以及注册时的参数合法性校验。具体往回看了解的链接如下。 springboot实训学习笔记&#xff08;4&#xff09;(Spring Validation参数校验框架、全局异常处理器)-CSDN博客文章浏览阅读576次&#xff0c;点赞7…...

python中网络爬虫框架

Python 中有许多强大的网络爬虫框架&#xff0c;它们帮助开发者轻松地抓取和处理网页数据。最常用的 Python 网络爬虫框架有以下几个&#xff1a; 1. Scrapy Scrapy 是 Python 中最受欢迎的网络爬虫框架之一&#xff0c;专为大规模网络爬取和数据提取任务而设计。它功能强大、…...

GEC6818初次连接使用

目录 1.开发板资源接口​编辑​编辑 2.安装 SecureCRT工具 2.1SecureCRT相关问题 3.连接开发板 4.开发板文件传输 4.1串口传输 rx 从电脑下载文件到开发板 sz 从开发板把文件发送到电脑 4.2U盘/SD卡传输 4.3网络传输[重点] 5.运行传到开发板的可执行文件 6.开发板网络…...

解释下不同Gan模型之间的异同点

生成对抗网络&#xff08;GAN, Generative Adversarial Network&#xff09;是一类强大的生成模型。随着时间的推移&#xff0c;研究人员提出了许多不同的 GAN 变体来改善原始模型的性能或针对特定任务进行优化。下面将解释一些常见的 GAN 变体&#xff0c;并讨论它们的异同点。…...

Hadoop的一些高频面试题 --- hdfs、mapreduce以及yarn的面试题

文章目录 一、HDFS1、Hadoop的三大组成部分2、本地模式和伪分布模式的区别是什么3、什么是HDFS4、如何单独启动namenode5、hdfs的写入流程6、hdfs的读取流程7、hdfs为什么不能存储小文件8、secondaryNameNode的运行原理9、hadoop集群启动后离开安全模式的条件10、hdfs集群的开机…...

Day99 代码随想录打卡|动态规划篇--- 01背包问题

题目&#xff08;卡玛网T46&#xff09;&#xff1a; 小明是一位科学家&#xff0c;他需要参加一场重要的国际科学大会&#xff0c;以展示自己的最新研究成果。他需要带一些研究材料&#xff0c;但是他的行李箱空间有限。这些研究材料包括实验设备、文献资料和实验样本等等&am…...

往证是什么意思

“往证”通常是在数学证明中使用的一种方法&#xff0c;尤其是在证明某个结论的相反&#xff08;即否定&#xff09;是错误的情况下。具体来说&#xff0c;就是假设结论不成立&#xff0c;然后通过逻辑推理展示出这种假设导致矛盾&#xff0c;从而得出原结论必然成立。 举例说…...

Android Wi-Fi 连接失败日志分析

1. Android wifi 关键日志总结 (1) Wi-Fi 断开 (CTRL-EVENT-DISCONNECTED reason3) 日志相关部分&#xff1a; 06-05 10:48:40.987 943 943 I wpa_supplicant: wlan0: CTRL-EVENT-DISCONNECTED bssid44:9b:c1:57:a8:90 reason3 locally_generated1解析&#xff1a; CTR…...

R语言AI模型部署方案:精准离线运行详解

R语言AI模型部署方案:精准离线运行详解 一、项目概述 本文将构建一个完整的R语言AI部署解决方案,实现鸢尾花分类模型的训练、保存、离线部署和预测功能。核心特点: 100%离线运行能力自包含环境依赖生产级错误处理跨平台兼容性模型版本管理# 文件结构说明 Iris_AI_Deployme…...

Swift 协议扩展精进之路:解决 CoreData 托管实体子类的类型不匹配问题(下)

概述 在 Swift 开发语言中&#xff0c;各位秃头小码农们可以充分利用语法本身所带来的便利去劈荆斩棘。我们还可以恣意利用泛型、协议关联类型和协议扩展来进一步简化和优化我们复杂的代码需求。 不过&#xff0c;在涉及到多个子类派生于基类进行多态模拟的场景下&#xff0c;…...

零基础设计模式——行为型模式 - 责任链模式

第四部分&#xff1a;行为型模式 - 责任链模式 (Chain of Responsibility Pattern) 欢迎来到行为型模式的学习&#xff01;行为型模式关注对象之间的职责分配、算法封装和对象间的交互。我们将学习的第一个行为型模式是责任链模式。 核心思想&#xff1a;使多个对象都有机会处…...

NFT模式:数字资产确权与链游经济系统构建

NFT模式&#xff1a;数字资产确权与链游经济系统构建 ——从技术架构到可持续生态的范式革命 一、确权技术革新&#xff1a;构建可信数字资产基石 1. 区块链底层架构的进化 跨链互操作协议&#xff1a;基于LayerZero协议实现以太坊、Solana等公链资产互通&#xff0c;通过零知…...

QT: `long long` 类型转换为 `QString` 2025.6.5

在 Qt 中&#xff0c;将 long long 类型转换为 QString 可以通过以下两种常用方法实现&#xff1a; 方法 1&#xff1a;使用 QString::number() 直接调用 QString 的静态方法 number()&#xff0c;将数值转换为字符串&#xff1a; long long value 1234567890123456789LL; …...

selenium学习实战【Python爬虫】

selenium学习实战【Python爬虫】 文章目录 selenium学习实战【Python爬虫】一、声明二、学习目标三、安装依赖3.1 安装selenium库3.2 安装浏览器驱动3.2.1 查看Edge版本3.2.2 驱动安装 四、代码讲解4.1 配置浏览器4.2 加载更多4.3 寻找内容4.4 完整代码 五、报告文件爬取5.1 提…...

rnn判断string中第一次出现a的下标

# coding:utf8 import torch import torch.nn as nn import numpy as np import random import json""" 基于pytorch的网络编写 实现一个RNN网络完成多分类任务 判断字符 a 第一次出现在字符串中的位置 """class TorchModel(nn.Module):def __in…...

智能AI电话机器人系统的识别能力现状与发展水平

一、引言 随着人工智能技术的飞速发展&#xff0c;AI电话机器人系统已经从简单的自动应答工具演变为具备复杂交互能力的智能助手。这类系统结合了语音识别、自然语言处理、情感计算和机器学习等多项前沿技术&#xff0c;在客户服务、营销推广、信息查询等领域发挥着越来越重要…...

Golang——9、反射和文件操作

反射和文件操作 1、反射1.1、reflect.TypeOf()获取任意值的类型对象1.2、reflect.ValueOf()1.3、结构体反射 2、文件操作2.1、os.Open()打开文件2.2、方式一&#xff1a;使用Read()读取文件2.3、方式二&#xff1a;bufio读取文件2.4、方式三&#xff1a;os.ReadFile读取2.5、写…...