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

HarmonyOS NEXT - Dialog 和完全自定义弹框

demo 地址: https://github.com/iotjin/JhHarmonyDemo
组件对应代码实现地址
代码不定时更新,请前往github查看最新代码

在demo中这些组件和工具类都通过module实现了,具体可以参考HarmonyOS NEXT - 通过 module 模块化引用公共组件和utils

HarmonyOS NEXT - Dialog 和完全自定义弹框

  • 效果图
  • 调用方式
  • JhDialog.ets 完整代码

官方dialog 比较反人类,调用比较麻烦,下面两种还略微好点

  • 通过promptAction.openCustomDialog 实现自定义弹窗。对应官方文档
  • 不依赖UI组件的全局自定义弹出框 (openCustomDialog)(推荐)对应官方文档

在三方库上找了一个弹框库,简单调整样式封装了一层

三方库地址:
@pura/harmony-dialog(V1.0.7)

需要先在项目中导入三方库

 ohpm i @pura/harmony-dialog@1.0.7

OpenHarmony ohpm 环境配置等更多内容,请参考如何安装 OpenHarmony ohpm 包

效果图

在这里插入图片描述

调用方式

需要先全局初始化一次,否则弹框不显示
全局初始化可以放在入口的page处
1.0.8开始需要在在windowStage.loadContent 后执行初始化

以下是在第一个page的aboutToAppear方法初始化的

  aboutToAppear() {// 初始化Loadinglet uiContext: UIContext = this.getUIContext();JhDialog.initConfig(uiContext)}
  • 标题内容
     JhDialog.show({title: '提示',message: '您确定要退出登录吗',onCancel: () => {console.log(`点击了取消按钮`)},onConfirm: () => {console.log(`点击了确认按钮`)},});
  • 修改按钮文字
  JhDialog.show({title: '提示',message: '您需要同意相关协议才能使用!',leftText: '不同意',rightText: '同意',onCancel: () => {console.log(`点击了取消按钮`)},onConfirm: () => {console.log(`点击了确认按钮`)},});
  • 点击按钮弹框不消失
   JhDialog.show({title: '提示',message: '点击取消按钮弹框消失,点击确认按钮延时3秒后弹框消失',clickBtnClose: false,onCancel: (action, dialogId, content) => {console.log(`点击了取消按钮`)JhDialog.hide(dialogId)},onConfirm: (action, dialogId, content) => {console.log(`点击了确认按钮`)setTimeout(() => {JhDialog.hide(dialogId)}, 3000)},});
  • 录入框(数字类型,正整数,最大三位)
    JhDialog.showInputDialog({title: '提示',placeholder: "请输入年龄",inputType: InputType.Number,maxLength: 3,inputFilter: {value: "[0-9]",error: (value) => {console.error("inputFilter: " + value);}},onCancel: (action, dialogId, content) => {console.log(`点击了取消按钮`)JhProgressHUD.showText(`点击了取消按钮`)},onConfirm: (action, dialogId, content) => {console.log(`点击了确认按钮, 此时录入的文字为: ${content}}`)JhDialog.hide(dialogId)JhProgressHUD.showText(`点击了确认按钮`)},});
  • 多行录入框
  JhDialog.showTextAreaDialog({title: '提示',onCancel: (action, dialogId, content) => {console.log(`点击了取消按钮`)JhProgressHUD.showText(`点击了取消按钮`)},onConfirm: (action, dialogId, content) => {console.log(`点击了确认按钮, 此时录入的文字为: ${content}}`)JhDialog.hide(dialogId)JhProgressHUD.showText(`点击了确认按钮`)},});
  • 自定义内容
  JhDialog.showCustomDialog({title: '',contentAreaPadding: {top: 0,bottom: 0,left: 0,right: 0},contentBuilder: () => {this.customBuilder()},onCancel: () => {console.log(`点击了取消按钮`)},onConfirm: () => {console.log(`点击了确认按钮`)},});@BuildercustomBuilder() {Column() {}.width('100%').height(200).backgroundColor(Color.Red)}
  • 底部完全自定义
  let custom: JhCustomOptions = {height: 360,alignment: DialogAlignment.Bottom,offset: { dx: 0, dy: 0 },transition: AnimationHelper.transitionInDown(0),autoCancel: true, // 点击遮障层时,是否关闭弹窗,true表示关闭弹窗。backCancel: false, // 点击返回键或手势返回时,是否关闭弹窗;实现onWillDismiss函数时,该参数不起作用。};JhDialog.showBottomAllCustomDialog(wrapBuilder(AllCustomBuilder))// JhDialog.showBottomAllCustomDialog(wrapBuilder(AllCustomBuilder), custom)
  • 完全自定义-顶部弹出
   let custom: JhCustomOptions = {height: 360,alignment: DialogAlignment.Top,offset: { dx: 0, dy: 0 },transition: AnimationHelper.transitionInDown(0),autoCancel: true, // 点击遮障层时,是否关闭弹窗,true表示关闭弹窗。backCancel: false, // 点击返回键或手势返回时,是否关闭弹窗;实现onWillDismiss函数时,该参数不起作用。};JhDialog.showAllCustomDialog(wrapBuilder(AllCustomBuilder), custom)
  • 完全自定义-左侧弹出
  let custom: JhCustomOptions = {width: 260,height: '100%',alignment: DialogAlignment.CenterStart,offset: { dx: 0, dy: 0 },transition: AnimationHelper.transitionInLeft(200),autoCancel: true, // 点击遮障层时,是否关闭弹窗,true表示关闭弹窗。backCancel: false, // 点击返回键或手势返回时,是否关闭弹窗;实现onWillDismiss函数时,该参数不起作用。};JhDialog.showAllCustomDialog(wrapBuilder(AllCustomBuilder), custom)

JhDialog.ets 完整代码

///  JhDialog.ets
///
///  Created by iotjin on 2024/11/26.
///  description:  @pura/harmony-dialog 封装。JhDialog和JhToast共用同一默认配置import { ActionCallBack, AnimationHelper, BaseDialogOptions, DialogAction, DialogHelper } from '@pura/harmony-dialog';
import { InputFilter } from '@pura/harmony-dialog/src/main/ets/model/InputFilter';
import { KColors } from '../configs/Colors';const _loadingBgColor = '#CC000000'
const _closeTime = 1500
const _radius = 5.0
const _fontSize = 16.0// Dialog 、Toast显示位置
const _alignment: Alignment = Alignment.Center
const _offset: Offset = { dx: 0.0, dy: 0.0 }// Dialog 按钮文字颜色
const _cancelTextColor = '#999999'
const _confirmTextColor = KColors.kThemeColor
const _dialogBgColor = KColors.kAlertBgColor
const _dialogRadius = 8
const _title = '提示'
const _placeholder = '请输入'
const _cancelText = '取消'
const _confirmText = '确认'
const _btnStyle = ButtonStyleMode.TEXTUALexport interface JhDialogOptions {title: ResourceStrmessage?: ResourceStrcontentBuilder?: () => void // 自定义弹框内容contentAreaPadding?: Padding // 自定义弹框内容区内边距leftText?: ResourceStrrightText?: ResourceStrhiddenCancel?: boolean // 默认falseclickBtnClose?: boolean // 点击确认按钮是否弹框消失,默认true// onCancel?: () => void// onConfirm?: (value: ResourceStr) => voidonCancel?: ActionCallBack // 按钮的CallBack事件onConfirm?: ActionCallBack // 按钮的CallBack事件
}export interface JhDialogInputOptions extends JhDialogOptions {inputText?: ResourceStrplaceholder?: ResourceStrinputType?: InputTypetextAreaType?: TextAreaTypefontColor?: ResourceColor; //字体颜色fontSize?: Length; //字体大小placeholderColor ?: ResourceColor //设置placeholder文本颜色。inputBackgroundColor?: ResourceColor; //输入框背景inputBorder?: BorderOptions; //输入框BorderinputHeight?: Length; //输入框高度defaultFocus?: boolean //设置弹框默认获得焦点,打开弹窗同时弹出输入法maxLength?: number; //文本的最大输入字符数。  默认值:Infinity,可以无限输入。controller?: TextInputController; //TextInput组件的控制器inputFilter?: InputFilter; //通过正则表达式设置输入过滤器。
}export interface JhCustomOptions extends BaseDialogOptions {width?: Dimension | Length; //宽度height?: Dimension | Length //高度alignment?: DialogAlignmentoffset?: Offset //弹窗相对alignment所在位置的偏移量。默认值:{ dx: 0, dy: 0 }transition?: TransitionEffect; //设置弹窗显示和退出的过渡效果。 AnimationHelper.transitionInDown(0)autoCancel?: boolean, // //点击遮障层时,是否关闭弹窗,true表示关闭弹窗。false表示不关闭弹backCancel?: boolean, // 点击返回键或手势返回时,是否关闭弹窗
}export class JhDialog {/*** 设置默认统一样式* 初始化Dialog(在全局入口 page 处挂载)* 注:JhDialog、JhToast共用此默认配置*/public static initConfig(context: UIContext) {DialogHelper.setDefaultConfig((config) => {config.uiContext = contextconfig.autoCancel = false; //点击遮障层时,是否关闭弹窗,true表示关闭弹窗。false表示不关闭弹窗。默认值:trueconfig.backCancel = false; //点击返回键或手势返回时,是否关闭弹窗;实现onWillDismiss函数时,该参数不起作用。true表示关闭弹窗。false表示不关闭弹窗。默认值:true。config.actionCancel = true; //点击操作按钮时,是否关闭弹窗。false表示不关闭弹窗。默认值:true。config.alignment = DialogAlignment.Center; //弹窗的对齐方式。config.offset = _offset; //弹窗相对alignment所在位置的偏移量。默认值:{ dx: 0, dy: 0 }config.maskColor = 0x11000000; //自定义蒙层颜色。默认值 0x33000000config.backgroundColor = _dialogBgColor; //弹窗背板颜色。默认值:Color.Whiteconfig.backgroundBlurStyle = BlurStyle.COMPONENT_ULTRA_THICK; //弹窗背板模糊材质config.cornerRadius = _dialogRadius; //设置背板的圆角半径。可分别设置4个圆角的半径config.title = _title; //弹框标题config.primaryButton = _cancelText; //弹框左侧按钮。config.secondaryButton = _confirmText; //弹框右侧按钮。config.imageRes = undefined; //TipsDialog用到,展示的图片。config.imageSize = { width: '64vp', height: '64vp' }; //TipsDialog用到,自定义图片尺寸。默认值:64*64vpconfig.loading_loadSize = 60; //加载动画或进度条的大小config.loading_loadColor = Color.White; //加载动画或进度条的颜色config.loading_content = ''; //加载动画的提示文字config.loading_fontSize = _fontSize; //文字大小config.loading_fontColor = Color.White; //文字颜色config.loading_backgroundColor = _loadingBgColor; //背景颜色,八位色值前两位为透明度config.loading_borderRadius = _radius; //背景圆角// toastconfig.toast_fontSize = _fontSize; //文字大小config.toast_fontColor = Color.White; //文字颜色config.toast_backgroundColor = _loadingBgColor; //背景颜色,建议八位色值前两位为透明度config.toast_borderRadius = _radius; //背景圆角config.toast_padding = {top: 16,bottom: 16,left: 24,right: 24,}; //Paddingconfig.toast_imageSize = { width: 30, height: 30 }; //Tip图片尺寸。默认值:45*45vpconfig.toast_duration = _closeTime; //显示时长(1500ms-10000ms)config.toast_durationLong = 5000; //显示时长});}/*** 关闭弹框* @param dialogId 目前弹框id*/public static hide(dialogId: string) {DialogHelper.closeDialog(dialogId)}/*** 中间弹框* @param options*/public static show(options: JhDialogOptions) {DialogHelper.showAlertDialog({title: options.title ?? _title,content: options.message ?? '',autoCancel: false, // 点击遮障层时,是否关闭弹窗,true表示关闭弹窗。backCancel: false, // 点击返回键或手势返回时,是否关闭弹窗;实现onWillDismiss函数时,该参数不起作用。actionCancel: options.clickBtnClose ?? true, // 点击操作按钮时,是否关闭弹窗。false表示不关闭弹窗。primaryButton: options.hiddenCancel ? null : {value: options.leftText ?? _cancelText,fontColor: _cancelTextColor,buttonStyle: _btnStyle},secondaryButton: {value: options.rightText ?? _confirmText,fontColor: _confirmTextColor,buttonStyle: _btnStyle},onAction: (action, dialogId, content) => {if (action == DialogAction.ONE) {options.onCancel?.(action, dialogId, content)} else {options.onConfirm?.(action, dialogId, content)}}})}/*** 中间录入弹框 - 单行* @param options*/public static showInputDialog(options: JhDialogInputOptions) {DialogHelper.showTextInputDialog({title: options.title ?? _title,text: options.inputText as string,maxLength: options.maxLength,inputFilter: options.inputFilter,controller: options.controller,placeholder: options.placeholder ?? _placeholder,placeholderColor: options.placeholderColor,inputType: options.inputType ?? InputType.Normal,inputBorder: options.inputBorder ?? { radius: 8 },inputHeight: options.inputHeight,defaultFocus: true,alignment: DialogAlignment.Center,offset: _offset,contentAreaPadding: {top: 12,bottom: 16,left: 15,right: 15},onChange: (text) => {// console.log("onChange: " + text);},autoCancel: false, // 点击遮障层时,是否关闭弹窗,true表示关闭弹窗。backCancel: false, // 点击返回键或手势返回时,是否关闭弹窗;实现onWillDismiss函数时,该参数不起作用。actionCancel: options.clickBtnClose ?? true, // 点击操作按钮时,是否关闭弹窗。false表示不关闭弹窗。buttons: [options.hiddenCancel ? null : {value: options.leftText ?? _cancelText,fontColor: _cancelTextColor,buttonStyle: _btnStyle},{value: options.rightText ?? _confirmText,fontColor: _confirmTextColor,buttonStyle: _btnStyle},],onAction: (action, dialogId, content) => {if (action == DialogAction.ONE) {options.onCancel?.(action, dialogId, content)} else {options.onConfirm?.(action, dialogId, content)}}})}/*** 中间录入弹框 - 多行* @param options*/public static showTextAreaDialog(options: JhDialogInputOptions) {DialogHelper.showTextAreaDialog({title: options.title ?? _title,text: options.inputText as string,maxLength: options.maxLength,inputFilter: options.inputFilter,controller: options.controller,placeholder: options.placeholder ?? _placeholder,placeholderColor: options.placeholderColor,inputType: options.textAreaType ?? TextAreaType.NORMAL,inputBorder: options.inputBorder ?? { radius: 8 },inputHeight: options.inputHeight,defaultFocus: true,alignment: DialogAlignment.Center,offset: _offset,contentAreaPadding: {top: 12,bottom: 16,left: 15,right: 15},onChange: (text) => {// console.log("onChange: " + text);},autoCancel: false, // 点击遮障层时,是否关闭弹窗,true表示关闭弹窗。backCancel: false, // 点击返回键或手势返回时,是否关闭弹窗;实现onWillDismiss函数时,该参数不起作用。actionCancel: options.clickBtnClose ?? true, // 点击操作按钮时,是否关闭弹窗。false表示不关闭弹窗。buttons: [options.hiddenCancel ? null : {value: options.leftText ?? _cancelText,fontColor: _cancelTextColor,buttonStyle: _btnStyle},{value: options.rightText ?? _confirmText,fontColor: _confirmTextColor,buttonStyle: _btnStyle},],onAction: (action, dialogId, content) => {if (action == DialogAction.ONE) {options.onCancel?.(action, dialogId, content)} else {options.onConfirm?.(action, dialogId, content)}}})}/*** 中间自定义弹框* @param options*/public static showCustomDialog(options: JhDialogOptions) {DialogHelper.showCustomContentDialog({title: options.title ?? _title,contentBuilder: options.contentBuilder,contentAreaPadding: options.contentAreaPadding,autoCancel: false, // 点击遮障层时,是否关闭弹窗,true表示关闭弹窗。backCancel: false, // 点击返回键或手势返回时,是否关闭弹窗;实现onWillDismiss函数时,该参数不起作用。actionCancel: options.clickBtnClose ?? true, // 点击操作按钮时,是否关闭弹窗。false表示不关闭弹窗。buttons: [options.hiddenCancel ? null : {value: options.leftText ?? _cancelText,fontColor: _cancelTextColor,buttonStyle: _btnStyle},{value: options.rightText ?? _confirmText,fontColor: _confirmTextColor,buttonStyle: _btnStyle},],onAction: (action, dialogId, content) => {if (action == DialogAction.ONE) {options.onCancel?.(action, dialogId, content)} else {options.onConfirm?.(action, dialogId, content)}}})}/*** 底部完全自定义弹框,默认高度260* @param builder* @param options 可不传*/public static showBottomAllCustomDialog(builder: WrappedBuilder<[JhCustomOptions]>, options?: JhCustomOptions): string {let custom: JhCustomOptions = {height: options?.height ?? 260,alignment: options?.alignment ?? DialogAlignment.Bottom,offset: options?.offset ?? { dx: 0, dy: 0 },transition: options?.transition ?? AnimationHelper.transitionInDown(0),autoCancel: options?.autoCancel ?? true, // 点击遮障层时,是否关闭弹窗,true表示关闭弹窗。默认关闭backCancel: options?.backCancel ?? false, // 点击返回键或手势返回时,是否关闭弹窗;实现onWillDismiss函数时,该参数不起作用。默认不关闭};return JhDialog.showAllCustomDialog(builder, custom);}/*** 完全自定义弹框,默认底部弹出,高度260* @param builder* @param options 可不传* @returns*/public static showAllCustomDialog(builder: WrappedBuilder<[JhCustomOptions]>, options?: JhCustomOptions): string {let custom: JhCustomOptions = {width: options?.width ?? '100%',height: options?.height ?? 260,alignment: options?.alignment ?? DialogAlignment.Bottom,offset: options?.offset ?? { dx: 0, dy: 0 },transition: options?.transition ?? AnimationHelper.transitionInDown(0),autoCancel: options?.autoCancel ?? true, // 点击遮障层时,是否关闭弹窗,true表示关闭弹窗。默认关闭backCancel: options?.backCancel ?? false, // 点击返回键或手势返回时,是否关闭弹窗;实现onWillDismiss函数时,该参数不起作用。默认不关闭};return DialogHelper.showCustomDialog(builder, custom);}/*** 完全自定义弹框2* @param builder* @param options* @returns*/public static showAllCustomDialog2<T extends BaseDialogOptions>(builder: WrappedBuilder<[T]>, options: T): string {return DialogHelper.showCustomDialog(builder, options)}
}

相关文章:

HarmonyOS NEXT - Dialog 和完全自定义弹框

demo 地址: https://github.com/iotjin/JhHarmonyDemo 组件对应代码实现地址 代码不定时更新&#xff0c;请前往github查看最新代码 在demo中这些组件和工具类都通过module实现了&#xff0c;具体可以参考HarmonyOS NEXT - 通过 module 模块化引用公共组件和utils HarmonyOS NE…...

内容与资讯API优质清单

作为开发者&#xff0c;拥有一套API合集是必不可少的。这个开发者必备的API合集汇集了各种实用的API资源&#xff0c;为你的开发工作提供了强大的支持&#xff01;无论你是在构建网站、开发应用还是进行数据分析&#xff0c;这个合集都能满足你的需求。你可以通过这些免费API获…...

开源 JS PDF 库比较

原文查看&#xff1a;开源JavaScript PDF Library对比 对于需要高性能、复杂功能或强大支持处理复杂 PDF 的项目&#xff0c;建议选择商业​​ PDF 库, 如ComPDFKit for Web。但是&#xff0c;如果您的目标只是在 Web 应用程序中显示 PDF&#xff0c;则可以使用几个可靠的开源…...

AnaPico信号源在通信测试中的应用案例

AnaPico信号源在通信测试中的应用案例广泛&#xff0c;涉及多种通信技术和测试需求。以下是一些具体的应用实例&#xff1a; 1. APPH系列信号源分析仪&#xff08;相位噪声分析仪&#xff09; APPH系列是一款高性能相位噪声分析仪和VCO测试仪&#xff0c;其不同型号的频率范围…...

《智启新材:人工智能重塑分子结构设计蓝图》

在当今科技飞速发展的时代&#xff0c;新材料的研发宛如一场激烈的竞赛&#xff0c;而人工智能&#xff08;AI&#xff09;作为一匹黑马&#xff0c;正以前所未有的速度和力量驰骋于这片赛场&#xff0c;为新材料的分子结构设计带来了革命性的突破&#xff0c;成为推动行业发展…...

进阶岛-L2G5000

茴香豆&#xff1a;企业级知识库问答工具 茴香豆本地标准版搭建 环境搭建 安装茴香豆 知识库创建 测试知识助手 Gradio UI 界面测试...

单点登录平台Casdoor搭建与使用,集成gitlab同步创建删除账号

一&#xff0c;简介 一般来说&#xff0c;公司有很多系统使用&#xff0c;为了实现统一的用户名管理和登录所有系统&#xff08;如 GitLab、Harbor 等&#xff09;&#xff0c;并在员工离职时只需删除一个主账号即可实现权限清除&#xff0c;可以采用 单点登录 (SSO) 和 集中式…...

PaddlePaddle飞桨Linux系统Docker版安装

PaddlePaddle飞桨Linux系统Docker版安装 最近学习和了解PP飞桨&#xff0c;一切从安装开始。官网的安装教程很详细&#xff1a; https://www.paddlepaddle.org.cn/install/quick?docurl/documentation/docs/zh/install/docker/linux-docker.html 记录我在安装过程中遇到的问题…...

一款基于.NET开发的简易高效的文件转换器

前言 今天大姚给大家分享一款基于.NET开发的免费&#xff08;GPL-3.0 license&#xff09;、简易、高效的文件转换器&#xff0c;允许用户通过Windows资源管理器的上下文菜单来转换和压缩一个或多个文件&#xff1a;FileConverter。 使用技术栈 ffmpeg&#xff1a;作为文件转换…...

Spring Boot教程之三十一:入门 Web

Spring Boot – 入门 Web 如今&#xff0c;大多数应用程序都需要模型-视图-控制器(MVC) 架构来满足各种需求&#xff0c;例如处理用户数据、提高应用程序效率、为应用程序提供动态特性。它主要用于构建桌面图形用户界面 (GUI)&#xff0c;但现在越来越流行用于构建基于 Web 的…...

青少年编程与数学 02-004 Go语言Web编程 20课题、单元测试

青少年编程与数学 02-004 Go语言Web编程 20课题、单元测试 一、单元测试&#xff08;Unit Testing&#xff09;二、集成测试&#xff08;Integration Testing&#xff09;三、区别四、Go Web单元测试使用testing包使用testify框架使用GoConvey框架 五、应用示例步骤 1: 创建HTT…...

概率论 期末 笔记

第一章 随机事件及其概率 利用“四大公式”求事件概率 全概率公式与贝叶斯公式 伯努利概型求概率 习题 推导 一维随机变量及其分布 离散型随机变量&#xff08;R.V&#xff09;求分布律 利用常见离散型分布求概率 连续型R.V相关计算 利用常见连续型分布的计算 均匀分布 正态…...

Typesense:开源的高速搜索引擎

在当今数据驱动的世界中&#xff0c;高效、快速且智能的搜索能力是任何应用程序和网站成功的关键因素之一。无论是电商平台、内容管理系统还是社交媒体&#xff0c;用户都希望能够迅速找到所需信息。Typesense&#xff0c;作为一款优秀的开源搜索引擎&#xff0c;旨在通过其卓越…...

【vue】圆环呼吸灯闪烁效果(模拟扭蛋机出口处灯光)

效果图先发&#xff1a; 页面部分&#xff1a; <div ref"round" class"round"><div class"light" ref"light"/><div class"box"></div></div>js部分(控制圆环生成&#xff09;; setRound…...

飞牛 fnos 使用docker部署 Watchtower 自动更新 Docker 容器

Watchtower 简介 Watchtower 是一款开源的 Docker 容器管理工具&#xff0c;主要功能为自动更新运行中的 Docker 容器&#xff0c;支持自动拉取镜像并更新容器、配置邮件通知以及定时执行容器更新任务。 用 compose 搭建 Watchtower 的步骤 新建文件夹&#xff1a;在任意位置…...

《信管通低代码信息管理系统开发平台》Linux环境安装说明

1 简介 信管通低代码信息管理系统应用平台提供多环境软件产品开发服务&#xff0c;包括单机、局域网和互联网。我们专注于适用国产硬件和操作系统应用软件开发应用。为事业单位和企业提供行业软件定制开发&#xff0c;满足其独特需求。无论是简单的应用还是复杂的系统&#xff…...

基于物联网的车辆定位和防盗报警系统(论文+源码)

1 系统概述 本文的主要内容是设计一个基于物联网的车辆定位和防盗报警系统&#xff0c;主要是利用STC89C52单片机来作为整体的核心控制元件&#xff0c;主要的核心控制模块主要由GSM通信模块&#xff0c;GPS定位模块&#xff0c;热释电红外检测模块&#xff0c;报警模块以及其他…...

京东零售数据可视化平台产品实践与思考

导读 本次分享题目为京东零售数据可视化平台产品实践与思考。 主要包括以下四个部分&#xff1a; 1. 平台产品能力介绍 2. 业务赋能案例分享 3. 平台建设挑战与展望 作者&#xff1a;梁臣 京东 数据产品架构师 01平台产品能力介绍 1. 产品矩阵 数据可视化产品是一种利用…...

Vue中使用a标签下载静态资源文件(比如excel、pdf等),纯前端操作

第一步&#xff0c;public文件夹下新建static文件夹存放静态资源 我存放了一个 .docx文件&#xff0c;当然&#xff0c;你可以存放pdf/word 等文件都可以。 第二步&#xff0c;模拟a标签下载 //html部分<el-button type"primary" plain click"download&quo…...

ensp 基于EASY IP的公司出口链路配置

Easy IP Easy IP技术是NAPT的一种简化情况。Easy IP无须建立公网IP地址资源池&#xff0c;因为Easy IP只会用到一个公网IP地址&#xff0c;该IP地址就是路由器R连接公网的出口IP地址。Easy IP也会建立并维护一张动态地址及端口映射表&#xff0c;并且Easy IP会将这张表中的公网…...

方正畅享全媒体采编系统reportCenter.do接口SQL注入漏洞复现 [附POC]

文章目录 方正畅享全媒体采编系统reportCenter.do接口SQL注入漏洞复现 [附POC]0x01 前言0x02 漏洞描述0x03 影响版本0x04 漏洞环境0x05 漏洞复现1.访问漏洞环境2.构造POC3.复现方正畅享全媒体采编系统reportCenter.do接口SQL注入漏洞复现 [附POC] 0x01 前言 免责声明:请勿利…...

零知识证明:区块链隐私保护的变革力量

&#x1f9d1; 博主简介&#xff1a;CSDN博客专家&#xff0c;历代文学网&#xff08;PC端可以访问&#xff1a;https://literature.sinhy.com/#/literature?__c1000&#xff0c;移动端可微信小程序搜索“历代文学”&#xff09;总架构师&#xff0c;15年工作经验&#xff0c;…...

解决:el-select可输入时失焦会失去输入框中值

1、展示部分 <template><el-select v-model"addForm.companyName" filterable placeholder"请输入/选择公司名称" :loading"loading":filter-method"(value) > dataFilter(value)" change"selectCompany">&…...

ollama-webui - Ollama的ChatGPT 风格的 Web 界面

更多AI开源软件&#xff1a; 发现分享好用的AI工具、AI开源软件、AI模型、AI变现 - &#xff1a;发现分享好用的AI工具、AI开源软件、AI模型。收录了AI搜索引擎&#xff0c;AI绘画工具、AI对话聊天、AI音频工具、AI图片工具、AI视频工具、AI内容检测、AI法律助手、AI高考、AI志…...

「下载」智慧产业园区-数字孪生建设解决方案:重构产业全景图,打造虚实结合的园区数字化底座

数字孪生技术作为一种创新的管理工具&#xff0c;正逐步展现出其在智慧园区建设中的重要意义。以下将从几个方面详细阐述数字孪生在智慧园区建设中的关键作用。 一、提升园区运营管理的智能化水平 数字孪生技术通过构建园区的虚拟镜像&#xff0c;实现了对园区物理世界的全面…...

使用Grafana中按钮插件实现收发HTTP请求

最近项目中需要监控分布式集群的各项指标信息&#xff0c;需要用到PrometheusGrafana的技术栈实现对分布式集群的各个节点状态进行可视化显示&#xff0c;但是要求前端需要提供一个易用的接口让用户可以触发一些操作&#xff0c;例如负载高时进行负载均衡或弹性伸缩。网上找到的…...

【附源码】Electron Windows桌面壁纸开发中的 CommonJS 和 ES Module 引入问题以及 Webpack 如何处理这种兼容

背景 在尝试让 ChatGPT 自动开发一个桌面壁纸更改的功能时&#xff0c;发现引入了一个 wallpaper 库&#xff0c;这个库的入口文件是 index.js&#xff0c;但是 package.json 文件下的 type:"module"&#xff0c;这样造成了无论你使用 import from 还是 require&…...

Elasticsearch介绍及安装部署

Elasticsearch介绍 Elasticsearch 是一个分布式搜索引擎&#xff0c;底层基于 Lucene 实现。Elasticsearch 屏蔽了 Lucene 的底层细节&#xff0c;提供了分布式特性&#xff0c;同时对外提供了 Restful API。Elasticsearch 以其易用性迅速赢得了许多用户&#xff0c;被用在网站…...

物理层知识要点

文章目录 物理层接口的四大特性通信基础编码和调制&#xff08;1&#xff09;数字数据编码为数字信号&#xff08;2&#xff09;模拟数据编码为数字信号&#xff08;3&#xff09;常见调制方式&#xff08;3&#xff09;信道的极限容量 多路复用技术数据传输方式物理层下的传输…...

SpringBoot 自动装配原理及源码解析

目录 一、引言 二、什么是 Spring Boot 的自动装配 三、自动装配的核心注解解析 3.1 SpringBootApplication 注解 &#xff08;1&#xff09;SpringBootConfiguration&#xff1a; &#xff08;2&#xff09;EnableAutoConfiguration&#xff1a; &#xff08;3&#xf…...