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

vue集成mars3d后,basemaps加不上去

首先:

<template>

  <div id="centerDiv" class="mapcontainer">

    <mars-map :url="configUrl" @οnlοad="onMapload" />

  </div>

</template>

<script>

import MarsMap from '../components/mars-work/mars-map.vue'

import * as mars3d from 'mars3d'

//npm install mars3d-echarts --save

import 'mars3d-echarts'

const Cesium = mars3d.Cesium

export default {

  // eslint-disable-next-line vue/multi-word-component-names

  name: 'Index',

  components: {

    MarsMap

  },

  data() {

    const basePathUrl = window.basePathUrl || ''

    return {

      configUrl: basePathUrl + 'config/config.json'

    }

  },

  methods: {

    // 地图构造完成回调

    onMapload(map) {

      // 以下为演示代码

      map.setCameraView({ lat: 30.617828, lng: 116.294045, alt: 44160, heading: 357, pitch: -59 })

      // 创建entity图层

      const graphicLayer = new mars3d.layer.GraphicLayer()

      map.addLayer(graphicLayer)

      const tiles3dLayer = new mars3d.layer.TilesetLayer({

        url: '//data.mars3d.cn/3dtiles/bim-qiaoliang/tileset.json',

        maximumScreenSpaceError: 16,

        position: { lng: 117.096906, lat: 31.851564, alt: 45 },

        rotation: { z: 17.5 },

        flyTo: true

      })

      map.addLayer(tiles3dLayer)

      const poiQueryButton = new PoiQueryButton({

        insertIndex: 0 // 插入的位置顺序

      })

      map.addControl(poiQueryButton)

      // 2.在layer上绑定监听事件

      graphicLayer.on(this.mars3d.EventType.click, function (event) {

        console.log('监听layer,单击了矢量对象', event)

      })

      graphicLayer.on(this.mars3d.EventType.mouseOver, function (event) {

        console.log('监听layer,鼠标移入了矢量对象', event)

      })

      graphicLayer.on(this.mars3d.EventType.mouseOut, function (event) {

        console.log('监听layer,鼠标移出了矢量对象', event)

      })

      // 可在图层上绑定popup,对所有加到这个图层的矢量数据都生效

      graphicLayer.bindPopup('我是layer上绑定的Popup', {

        anchor: [0, -10]

      })

      // 可在图层绑定右键菜单,对所有加到这个图层的矢量数据都生效

      graphicLayer.bindContextMenu([

        {

          text: '删除对象',

          iconCls: 'fa fa-trash-o',

          callback: function (e) {

            const graphic = e.graphic

            if (graphic) {

              graphicLayer.removeGraphic(graphic)

            }

          }

        }

      ])

    },

    addDemoGraphic1: (graphicLayer) => {

      const graphic = new mars3d.graphic.LabelEntity({

        position: new mars3d.LngLatPoint(116.1, 31.0, 1000),

        style: {

          text: '火星科技Mars3D平台',

          font_size: 25,

          font_family: '楷体',

          color: '#003da6',

          outline: true,

          outlineColor: '#bfbfbf',

          outlineWidth: 2,

          horizontalOrigin: Cesium.HorizontalOrigin.CENTER,

          verticalOrigin: Cesium.VerticalOrigin.BOTTOM,

          visibleDepth: false

        },

        attr: { remark: '示例1' }

      })

      graphicLayer.addGraphic(graphic)

    },

    addDemoGraphic2: (graphicLayer) => {

      const graphic = new mars3d.graphic.PointEntity({

        position: [116.2, 31.0, 1000],

        style: {

          color: '#ff0000',

          pixelSize: 10,

          outline: true,

          outlineColor: '#ffffff',

          outlineWidth: 2

        },

        attr: { remark: '示例2' }

      })

      graphicLayer.addGraphic(graphic)

    },

    addDemoGraphic3: (graphicLayer) => {

      const graphic = new mars3d.graphic.BillboardEntity({

        name: '贴地图标',

        position: [116.3, 31.0, 1000],

        style: {

          image: 'img/marker/mark-blue.png',

          scale: 1,

          horizontalOrigin: Cesium.HorizontalOrigin.CENTER,

          verticalOrigin: Cesium.VerticalOrigin.BOTTOM,

          clampToGround: true

        },

        attr: { remark: '示例3' }

      })

      graphicLayer.addGraphic(graphic)

    },

    addDemoGraphic4: (graphicLayer) => {

      const graphic = new mars3d.graphic.PlaneEntity({

        position: new mars3d.LngLatPoint(116.4, 31.0, 1000),

        style: {

          plane: new Cesium.Plane(Cesium.Cartesian3.UNIT_Z, 0.0),

          dimensions: new Cesium.Cartesian2(4000.0, 4000.0),

          materialType: mars3d.MaterialType.Image2,

          materialOptions: {

            image: 'img/textures/poly-rivers.png',

            transparent: true

          }

        },

        attr: { remark: '示例4' }

      })

      graphicLayer.addGraphic(graphic)

    },

    addDemoGraphic5: (graphicLayer) => {

      const graphic = new mars3d.graphic.BoxEntity({

        position: new mars3d.LngLatPoint(116.5, 31.0, 1000),

        style: {

          dimensions: new Cesium.Cartesian3(2000.0, 2000.0, 2000.0),

          fill: true,

          color: '#00ffff',

          opacity: 0.9,

          heading: 45,

          roll: 45,

          pitch: 0

        },

        attr: { remark: '示例5' }

      })

      graphicLayer.addGraphic(graphic)

    },

    addDemoGraphic6: (graphicLayer) => {

      const graphic = new mars3d.graphic.CircleEntity({

        position: [116.1, 30.9, 1000],

        style: {

          radius: 1800.0,

          color: '#00ff00',

          opacity: 0.3,

          outline: true,

          outlineWidth: 3,

          outlineColor: '#ffffff',

          clampToGround: true

        },

        popup: '直接传参的popup',

        attr: { remark: '示例6' }

      })

      graphicLayer.addGraphic(graphic)

    },

    addDemoGraphic7: (graphicLayer) => {

      const graphic = new mars3d.graphic.CylinderEntity({

        position: [116.2, 30.9, 1000],

        style: {

          length: 3000.0,

          topRadius: 0.0,

          bottomRadius: 1300.0,

          color: '#00FFFF',

          opacity: 0.7

        },

        popup: '直接传参的popup',

        attr: { remark: '示例7' }

      })

      graphicLayer.addGraphic(graphic)

    },

    addDemoGraphic8: (graphicLayer) => {

      const graphic = new mars3d.graphic.EllipsoidEntity({

        position: new mars3d.LngLatPoint(116.3, 30.9, 1000),

        style: {

          radii: new Cesium.Cartesian3(1500.0, 1500.0, 1500.0),

          color: 'rgba(255,0,0,0.5)',

          outline: true,

          outlineColor: 'rgba(255,255,255,0.3)'

        },

        attr: { remark: '示例8' }

      })

      graphicLayer.addGraphic(graphic)

    },

    addDemoGraphic9: (graphicLayer) => {

      const graphic = new mars3d.graphic.ModelEntity({

        name: '消防员',

        position: [116.4, 30.9, 1000],

        style: {

          url: '//data.mars3d.cn/gltf/mars/firedrill/xiaofangyuan-run.gltf',

          scale: 16,

          minimumPixelSize: 100

        },

        attr: { remark: '示例9' }

      })

      graphicLayer.addGraphic(graphic)

    },

    addDemoGraphic10: (graphicLayer) => {

      const graphic = new mars3d.graphic.PolylineEntity({

        positions: [

          [116.5, 30.9, 1000],

          [116.52, 30.91, 1000],

          [116.53, 30.89, 1000]

        ],

        style: {

          width: 5,

          color: '#3388ff'

        },

        attr: { remark: '示例10' }

      })

      graphicLayer.addGraphic(graphic) // 还可以另外一种写法: graphic.addTo(graphicLayer)

    },

    addDemoGraphic11: (graphicLayer) => {

      const graphic = new mars3d.graphic.PolylineVolumeEntity({

        positions: [

          [116.1, 30.8, 1000],

          [116.12, 30.81, 1000],

          [116.13, 30.79, 1000]

        ],

        style: {

          shape: 'pipeline',

          radius: 80,

          color: '#3388ff',

          opacity: 0.9

        },

        attr: { remark: '示例11' }

      })

      graphicLayer.addGraphic(graphic) // 还可以另外一种写法: graphic.addTo(graphicLayer)

    },

    addDemoGraphic12: (graphicLayer) => {

      const graphic = new mars3d.graphic.CorridorEntity({

        positions: [

          [116.2, 30.8, 1000],

          [116.22, 30.81, 1000],

          [116.23, 30.79, 1000],

          [116.247328, 30.806077, 610.41]

        ],

        style: {

          width: 500,

          color: '#3388ff'

        },

        attr: { remark: '示例12' }

      })

      graphicLayer.addGraphic(graphic) // 还可以另外一种写法: graphic.addTo(graphicLayer)

    },

    addDemoGraphic13: (graphicLayer) => {

      const graphic = new mars3d.graphic.WallEntity({

        positions: [

          [116.3, 30.8, 1000],

          [116.31, 30.81, 1000],

          [116.334639, 30.800735, 721.39],

          [116.32, 30.79, 1000]

        ],

        style: {

          closure: true,

          diffHeight: 500,

          // 动画线材质

          materialType: mars3d.MaterialType.LineFlow,

          materialOptions: {

            image: 'img/textures/fence.png',

            color: '#00ff00',

            speed: 10,

            axisY: true

          }

        },

        attr: { remark: '示例13' }

      })

      graphicLayer.addGraphic(graphic) // 还可以另外一种写法: graphic.addTo(graphicLayer)

    },

    addDemoGraphic14: (graphicLayer) => {

      const graphic = new mars3d.graphic.RectangleEntity({

        positions: [

          [116.383144, 30.819978, 444.42],

          [116.42216, 30.793431, 1048.07]

        ],

        style: {

          color: '#3388ff',

          opacity: 0.5,

          outline: true,

          outlineWidth: 3,

          outlineColor: '#ffffff'

        },

        attr: { remark: '示例14' }

      })

      graphicLayer.addGraphic(graphic) // 还可以另外一种写法: graphic.addTo(graphicLayer)

    },

    addDemoGraphic15: (graphicLayer) => {

      const graphic = new mars3d.graphic.PolygonEntity({

        positions: [

          [116.510278, 30.834372, 567.29],

          [116.530085, 30.809331, 448.31],

          [116.507367, 30.788551, 98.21],

          [116.472468, 30.823091, 677.39]

        ],

        style: {

          materialType: mars3d.MaterialType.Water,

          materialOptions: {

            normalMap: 'img/textures/waterNormals.jpg', // 水正常扰动的法线图

            frequency: 8000.0, // 控制波数的数字。

            animationSpeed: 0.02, // 控制水的动画速度的数字。

            amplitude: 5.0, // 控制水波振幅的数字。

            specularIntensity: 0.8, // 控制镜面反射强度的数字。

            baseWaterColor: '#006ab4', // rgba颜色对象基础颜色的水。#00ffff,#00baff,#006ab4

            blendColor: '#006ab4' // 从水中混合到非水域时使用的rgba颜色对象。

          }

        },

        attr: { remark: '示例15' }

      })

      graphicLayer.addGraphic(graphic) // 还可以另外一种写法: graphic.addTo(graphicLayer)

    }

  }

}

</script>

<style>

.mapcontainer {

  position: relative;

  height: 100%;

  overflow: hidden;

}

</style>

其次:

<template>

  <div :id="`mars3d-container${mapKey}`" class="mars3d-container"></div>

</template>

<script>

import Vue from "vue";

// 使用免费开源版本

// import "mars3d-cesium/Build/Cesium/Widgets/widgets.css";

// import "mars3d/dist/mars3d.css";

// import * as mars3d from "mars3d";

// const Cesium = mars3d.Cesium;

// let mars3d = window.mars3d;

// 导入插件(其他插件类似,插件清单访问:http://mars3d.cn/dev/guide/start/architecture.html)

// echarts插件

// import 'mars3d-echarts'

// 为了方便使用,绑定到原型链,在其他vue文件,直接 this.mars3d 来使用

// Vue.prototype.mars3d = mars3d

// Vue.prototype.Cesium = mars3d.Cesium

export default {

  name: "mars3dViewer",

  props: {

    // 地图唯一性标识

    mapKey: {

      type: String,

      default: "",

    },

    // 初始化配置config.json的地址

    url: String,

    // 自定义参数

    options: Object,

  },

  mounted() {

    window.mars3d.Resource.fetchJson({ url: this.url }).then((data) => {

      // 构建地图

      this.initMars3d({

        ...data.map3d,

        ...this.options,

      });

    });

  },

  beforeDestroy() {

    const map = this[`map${this.mapKey}`];

    if (map) {

      map.destroy();

      delete this[`map${this.mapKey}`];

    }

    console.log(">>>>> 地图卸载完成 >>>>");

  },

  methods: {

    initMars3d(mapOptions) {

      console.log(mapOptions);

      // if (this[`map${this.mapKey}`]) {

      //   this[`map${this.mapKey}`].destroy();

      // }

      // 创建三维地球场景

      var map = new window.mars3d.Map(

        `mars3d-container${this.mapKey}`,

        mapOptions

      );

      this[`map${this.mapKey}`] = map;

      console.log(">>>>> 地图创建成功 >>>>", map);

      // 挂载到全局对象下,所有组件通过 this.map 访问

      // Vue.prototype[`map${this.mapKey}`] = map

      // 绑定对alert的处理,右键弹出信息更美观。

      // window.haoutil = window.haoutil || {}

      // window.haoutil.msg = (msg) => {

      //   this.$message.success(msg)

      // }

      // window.haoutil.alert = (msg) => {

      //   this.$message.success(msg)

      // }

      // 抛出事件

      this.$emit("onload", map);

    },

  },

};

</script>

<style>

.mars3d-container {

  height: 100%;

  overflow: hidden;

}

/**cesium 工具按钮栏*/

.cesium-viewer-toolbar {

  top: auto !important;

  bottom: 35px !important;

  left: 12px !important;

  right: auto !important;

}

.cesium-toolbar-button img {

  height: 100%;

}

.cesium-viewer-toolbar > .cesium-toolbar-button,

.cesium-navigationHelpButton-wrapper,

.cesium-viewer-geocoderContainer {

  margin-bottom: 5px;

  float: left;

  clear: both;

  text-align: center;

}

.cesium-button {

  background-color: #3f4854;

  color: #e6e6e6;

  fill: #e6e6e6;

  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);

  line-height: 32px;

}

/**cesium 底图切换面板*/

.cesium-baseLayerPicker-dropDown {

  bottom: 0;

  left: 40px;

  max-height: 700px;

  margin-bottom: 5px;

}

/**cesium 帮助面板*/

.cesium-navigation-help {

  top: auto;

  bottom: 0;

  left: 40px;

  transform-origin: left bottom;

}

/**cesium 二维三维切换*/

.cesium-sceneModePicker-wrapper {

  width: auto;

}

.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-dropDown-icon {

  float: right;

  margin: 0 3px;

}

/**cesium POI查询输入框*/

.cesium-viewer-geocoderContainer .search-results {

  left: 0;

  right: 40px;

  width: auto;

  z-index: 9999;

}

.cesium-geocoder-searchButton {

  background-color: #3f4854;

}

.cesium-viewer-geocoderContainer .cesium-geocoder-input {

  background-color: rgba(63, 72, 84, 0.7);

}

.cesium-viewer-geocoderContainer .cesium-geocoder-input:focus {

  background-color: rgba(63, 72, 84, 0.9);

}

.cesium-viewer-geocoderContainer .search-results {

  background-color: #3f4854;

}

/**cesium info信息框*/

.cesium-infoBox {

  top: 50px;

  background: rgba(63, 72, 84, 0.9);

}

.cesium-infoBox-title {

  background-color: #3f4854;

}

/**cesium 任务栏的FPS信息*/

.cesium-performanceDisplay-defaultContainer {

  top: auto;

  bottom: 35px;

  right: 50px;

}

.cesium-performanceDisplay-ms,

.cesium-performanceDisplay-fps {

  color: #fff;

}

/**cesium tileset调试信息面板*/

.cesium-viewer-cesiumInspectorContainer {

  top: 10px;

  left: 10px;

  right: auto;

  background-color: #3f4854;

}

</style>

问题的原因是:

服务有返回东西,使用的就是示例中的配置;数据正常返回了,mock拦截机制的原因,自行处理把mock注释掉就解决了。

 

 

 

相关文章:

vue集成mars3d后,basemaps加不上去

首先&#xff1a; <template> <div id"centerDiv" class"mapcontainer"> <mars-map :url"configUrl" οnlοad"onMapload" /> </div> </template> <script> import MarsMap from ../component…...

油管视频直接生成PPT的AI工具!剖析c.ai和Pi的用户需求;独立创业者的操作指南;广告大佬的三个AI绘画实战 | ShowMeAI日报

&#x1f440;日报&周刊合集 | &#x1f3a1;生产力工具与行业应用大全 | &#x1f9e1; 点赞关注评论拜托啦&#xff01; &#x1f916; 2023 CCF BDCI 数字安全公开赛&#xff0c;大模型安全竞赛等你「码」力全开 网站&#xff1a;https://www.datafountain.cn/special/B…...

WebSocket- 前端篇

官网代码 // 为了浏览器兼容websocketconst WebSocket window.WebSocket || window.MozWebSocket// 创建连接 this.socket new WebSocket(ws://xxx)// 连接成功this.socket.onopen (res)>{console.log(websocket 连接成功)this.socket.send(入参字段) // 传递的参数字段}…...

如何在 Python 中将图像转换为 PDF

一、说明 如何使得图像转化成pdf文件&#xff0c; 想要将一个或多个图像转换为 PDF 文档&#xff1f;看看img2pdf和PyPDF2软件包就是您的最佳选择。 二、需要哪些程序包&#xff1f; 首先&#xff0c;您只需要一个 Python 环境&#xff0c;最好是 3.10 或更高版本。本教程中的代…...

使用python编写脚本测试目标主机的TCP端口连通性

使用Python的Socket模块的connect()函数来尝试连接目标主机的特定端口。如果连接成功&#xff0c;则说明该端口是打开的&#xff1b;否则&#xff0c;该端口是关闭的。 下面是一个示例脚本&#xff0c;可以检测目标IP的22端口是否开启&#xff1a; import socket def check_po…...

华为云云服务器评测|基于华为云云耀云服务器L实例开展性能评测,例如 MySQL、Clickhouse、Elasticsearch等等

在当今云计算时代&#xff0c;越来越多的企业和个人开始选择将应用部署在云服务器上&#xff0c;以便更好地满足高性能、可靠性和可扩展性等需求。而华为云云耀云服务器L实例不仅提供了高性能和可靠性的计算和存储资源&#xff0c;而且具有灵活和高效的成本控制&#xff0c;深受…...

Git分布式版本控制系统与github

第四阶段提升 时 间&#xff1a;2023年8月29日 参加人&#xff1a;全班人员 内 容&#xff1a; Git分布式版本控制系统与github 目录 一、案例概述 二、版本控制系统 &#xff08;一&#xff09; 本地版本控制 &#xff08;二&#xff09;集中化的版本控制系统 &…...

基于Java+SpringBoot+Vue前后端分离中国陕西民俗网设计和实现

博主介绍&#xff1a;✌全网粉丝30W,csdn特邀作者、博客专家、CSDN新星计划导师、Java领域优质创作者,博客之星、掘金/华为云/阿里云/InfoQ等平台优质作者、专注于Java技术领域和毕业项目实战✌ &#x1f345;文末获取源码联系&#x1f345; &#x1f447;&#x1f3fb; 精彩专…...

CSS3D+动画

CSS3D 1.css3D 给父元素设置 perspective:景深:近大远小的效果900-1200px这个范围内 transform-style:是否设置3D环境 flat 2D环境 默认值 perserve-3D环境 3D功能函数 1.位移: translateZ()translate3D(x,y,z) <!DOCTYPE html> <html lang"en"><h…...

list对象中如何根据对象中某个属性去重使用Java8流实现

list对象中如何根据对象中某个属性去重使用Java8流实现? 在 Java 8 的流操作中&#xff0c;可以使用 distinct 方法来对一个对象流进行去重&#xff0c;但是默认情况下它会使用对象的 equals() 方法来判断重复。如果你希望根据对象的某个属性进行去重&#xff0c;则可以使用 …...

2023 在Windows上的安装Faiss-GPU(使用anaconda)

该方法安装完 faiss-gpu 之后&#xff0c;不仅会装这个库&#xff0c;还会装很多依赖库。为了防止自己本地一些同名库的版本被修改&#xff0c;建议新建一个虚拟环境来安装。如果本地库版本修改对自己没影响&#xff0c;也可以忽略。 你好&#xff0c;我是悦创。 登录网站&…...

HTML及CSS入门及精通

前言 HTML&#xff08;超文本标记语言&#xff09;和CSS&#xff08;层叠样式表&#xff09;是构建网页的两个基本技术。HTML用于定义网页的结构和内容&#xff0c;而CSS用于控制网页的样式和布局。本教程将介绍HTML和CSS的入门知识&#xff0c;并逐步引导您掌握更高级的技巧和…...

frp实现二级代理

kali是攻击机 &#xff08;192.168.0.106&#xff09; windows server2012是边界服务器&#xff0c;拥有两个网卡&#xff0c;作为一级代理&#xff0c; &#xff08;192.168.0.108&#xff0c;10.10.10.136&#xff09; ad01是内网机器&#xff0c;不出网 &#xff08;10.10.1…...

Vue组件设置背景色

vh&#xff1a;浏览器视区高度百分值 wh&#xff1a;浏览器视区宽度百分值 min-height&#xff1a;最小高度&#xff0c;其他时候自适应 给组件根标签设置&#xff1a;min-height&#xff1a;100vh&#xff0c;就可以正常添加背景色&#xff0c;而且背景色随内容展开而自适…...

Java+Github+Jenkins部署

Java项目—Jenkins部署笔记 一&#xff0c;准备 一台服务器操作系统&#xff0c;示例为ubuntu 22.0.4 可运行lsb_release -a查看 二&#xff0c;安装 docker 更新软件包列表&#xff1a; sudo apt update安装必要的软件包&#xff0c;以便使用HTTPS通过APT下载软件包&#x…...

vue使用命令npm install 报错 cb() never called!

一.错误说明,npm本身下载就慢&#xff0c;有可能是网络的问题。 二.解决方案,把npm设置成淘宝镜像后,再重新npm install npm config set registry https://registry.npm.taobao.org 三.还是不行&#xff0c;还会出现同样的问题&#xff0c;那接下来先清理一下npm缓存 npm cache…...

什么是LatexEasy及其在数学排版中的作用

LatexEasy是一种强大的排版系统&#xff0c;特别擅长处理数学公式和科技文档。它基于 TeX&#xff0c;是由计算机科学家 Donald Knuth 开发的。LaTeX 可以让你专注于内容&#xff0c;而不必过多关心排版细节&#xff0c;特别适用于数学家、工程师和科学研究者。 什么是 LaTeX&…...

axios 和fetch的取舍,以及比较

废话不多说&#xff0c;直接直捣黄龙&#xff1a; 区别 相同点 都是一种基于promise的异步解决方案。都可以解决回调地狱问题 不同点 axios是一个封装好的库&#xff0c;需要npm进行安装&#xff0c;fetch是es6新增的api 语法&#xff1a; fetch(url, { method: GET, // o…...

K-Means(K-均值)聚类算法理论和实战

目录 K-Means 算法 K-Means 术语 K 值如何确定 K-Means 场景 美国总统大选摇争取摆选民 电商平台用户分层 给亚洲球队做聚类 ​编辑 其他场景 K-Means 工作流程 K-Means 开发流程 K-Means的底层代码实现 K-Means 的评价标准 K-Means 算法 对于 n 个样本点来说&am…...

Python-pyqt不同窗口数据传输【使用静态函数】

文章目录 前言程序1&#xff1a;caogao1.py输入数据界面程序2&#xff1a;caogao2.py接收数据界面 程序3 &#xff1a;将输入数据界面和接收数据界面组合成一个总界面讲解 总结 前言 在编写pyqt 页面时有时候需要不同页面进行数据传输。本文讲解静态函数方法。直接看示例。 程…...

百度垂类离线计算系统发展历程

作者 | 弘远君 导读 本文以百度垂类离线计算系统的演进方向为主线&#xff0c;详细描述搜索垂类离线计算系统发展过程中遇到的问题&#xff0c;以及对应的解决方案。架构演进过程中一直奉行“没有最好的架构&#xff0c;只有最合适的架构”的宗旨&#xff0c;面对不同阶段遇到的…...

ubuntu 安装 指定版本:nodejs

通过 PPA 安装指定或最新版本的 nodejs 那么就需要使用 nodesource 来安装指定版本的 nodejs 了。其需要下载一个脚本&#xff0c;运行此脚本会在 ubuntu 里添加一个 nodejs 源&#xff0c;然后用 apt 就可以下载指定的 nodejs 了。 PPA 的全称为 personal package archive 。要…...

16.CSS菜单悬停特效

效果 源码 <!DOCTYPE html> <html> <head> <title>Creative Menu Item Hover Effects</title> <link rel="stylesheet" type="text/css" href="style.css"> </head> <body><section><…...

恒运资本:市盈率怎么算?

市盈率&#xff08;P/E ratio&#xff09;是判别一家公司股票价格合理性的一个重要目标&#xff0c;也是投资者评估公司股票投资价值的重要参阅目标。市盈率越高&#xff0c;表明相对于公司的收益来说&#xff0c;该公司的股票定价越高。市盈率越低&#xff0c;则表明该股票被低…...

Docker运维中常见错误以及解决方法汇总1

1.报错如下: Another app is currently holding the yum lock; waiting for it to exit... 另一个应用程序是:PackageKit 原因:另一个APP正在锁定yum,等待其退出! 解决:执行指令 rm -f /var/run/yum.pid 2.CentOS7设置静态的IP且可以上网...

Maven - 使用maven-release-plugin规范化版本发布

文章目录 Maven Release plugin – IntroductionMaven Release plugin – Plugin DocumentationMaven Release plugin – Usage实战案例 Maven Release plugin – Introduction Maven Release Plugin&#xff08;Maven 发布插件&#xff09;是一个用于帮助在Maven项目中执行版…...

2023.8.29 关于性能测试

目录 什么是性能测试&#xff1f; 性能测试常见术语及其性能测试衡量指标 并发 用户数 响应时间 事务 点击率 吞吐量 思考时间 资源利用率 性能测试分类 基准性能测试 负载性能测试 压力性能测试 可靠性性能测试 性能测试执行流程 什么是性能测试&#xff1f; 性…...

基于MATLAB的径向基函数插值(RBF插值)(一维、二维、三维)

基于MATLAB的径向基函数插值&#xff08;RBF插值&#xff09;&#xff08;一维、二维、三维&#xff09; 0 前言1 RBF思路2 1维RBF函数2.1 参数说明2.1.1 核函数选择2.1.2 作用半径2.1.3 多项式拟合2.1.4 误差项&#xff08;光滑项&#xff09; 3 2维RBF函数4 3维RBF函数 惯例声…...

flume拦截器

flume拦截器代码 1.依赖 <?xml version"1.0" encoding"UTF-8"?> <project xmlns"http://maven.apache.org/POM/4.0.0"xmlns:xsi"http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation"http://maven.apach…...

vue、elementui控制前一级选择后,后一级才会有数据

<el-form-item label"废物类型&#xff1a;"><el-select clearable v-model"queryForm.hswCateType" placeholder"请选择" change"industryCategoryChange" focus"industryCategoryFocus"><el-option v-for&…...

亲测influxdb安装为window后台服务

InfluxDB 安装 64bit&#xff1a;https://dl.influxdata.com/influxdb/releases/influxdb-1.7.4_windows_amd64.zip 解压安装包 修改配置文件 [meta]# Where the metadata/raft database is storeddir "D:/influxdb/meta"...[data]# The directory where the TSM…...

【LeetCode - 每日一题】823. 带因子的二叉树 (2023.08.29)

823. 带因子的二叉树 题意 元素都大于1&#xff0c;元素不重复。计数满足要求的二叉树&#xff08;每个非叶结点的值应等于它的两个子结点的值的乘积&#xff09;的数量。元素可以重复使用。 代码 自上而下动态规划。 所有元素大于1&#xff0c;所以不会有 自己自己自己 的…...

flutter 上传图片并裁剪

1.首先在pubspec.yaml文件中新增依赖pub.dev image_picker: ^0.8.75 image_cropper: ^4.0.1 2.在Android的AndroidManifest.xml文件里面添加权限 <activityandroid:name"com.yalantis.ucrop.UCropActivity"android:screenOrientation"portrait"andro…...

一台服务器上部署 Redis 伪集群

哈喽大家好&#xff0c;我是咸鱼 今天这篇文章介绍如何在一台服务器&#xff08;以 CentOS 7.9 为例&#xff09;上通过 redis-trib.rb 工具搭建 Redis cluster &#xff08;三主三从&#xff09; redis-trib.rb 是一个基于 Ruby 编写的脚本&#xff0c;其功能涵盖了创建、管…...

ealtek高清晰音频管理器(realtek高清晰音频管理器怎么设置win10)

本文为大家介绍realtek高清晰音频管理器(realtek高清晰音频管理器怎么设置win10)&#xff0c;下面和小编一起看看详细内容吧。 我们都使用电脑来听音乐、看电影或者进行其他操作&#xff0c;但是如果我们觉得电脑产生的音效不够立体&#xff0c;我们就会想要去Realtek来设置音…...

微信小程序 scroll-view 组件的 bindscroll 不触发不生效

使用微信小程序基础组件中的scroll-view&#xff0c;但是滑动的时候 bindscroll 一直不生效。 <view class"container log-list"><scroll-view scroll-y style"height:100%;white-space:nowrap;" scroll-into-view"{{toView}}" enable…...

datax 删除分区数据,再写入MySQL脚本

#! /bin/bashDATAX_HOME/opt/module/datax#1、判断参数是否传入 if [ $# -lt 1 ] thenecho "必须传入all/表名..."exit fi #2、判断日期是否传入 [ "$2" ] && datestr$2 || datestr$(date -d -1 day %F)#DataX导出路径不允许存在空文件&#xff0c…...

hyperf 十四 国际化

一 安装 composer require hyperf/translation:v2.2.33 二 配置 1、设置语言文件 文件结构&#xff1a; /storage/languages/en/messages.php /storage/languages/zh_CH/messages.php // storage/languages/en/messages.php return [welcome > Welcome to our applicat…...

C语言_初识C语言指针

文章目录 前言一、指针 ... 一个内存单元多大比较合适&#xff1f;二、地址或者编号如何产生&#xff1f;三、指针变量的大小 前言 内存是电脑上特别重要的存储器&#xff0c;计算机中程序的运行都是在内存中进行的。 所以为了有效的使用内存&#xff0c;就把内存划分成一个个…...

EMQX启用双向SSL/TLS安全连接以及java连接

作为基于现代密码学公钥算法的安全协议&#xff0c;TLS/SSL 能在计算机通讯网络上保证传输安全&#xff0c;EMQX 内置对 TLS/SSL 的支持&#xff0c;包括支持单/双向认证、X.509 证书、负载均衡 SSL 等多种安全认证。你可以为 EMQX 支持的所有协议启用 SSL/TLS&#xff0c;也可…...

4399面试总结C/C++游戏开发

主要流程 首先询问了C/C知识点 然后询问操作系统&#xff0c;计算机组成&#xff0c;数据结构&#xff0c;计算机网络哪两门熟悉 涉及的相关问题 多态的概念 tcp,udp&#xff1f; tcp,udp区别 tcp可靠&#xff0c;udp不可靠 tcp这个链接的过程? 一个TCP连接必须要经过三次“…...

hashlib 模块学习

hashlib 是 Python 标准库中用于散列和摘要算法的模块。散列算法将输入数据转换为固定长度的散列值&#xff08;也称为摘要&#xff09;&#xff0c;并且对于相同的输入始终生成相同的散列值。这对于存储密码、数字签名、数据完整性验证等领域非常有用。以下是对 hashlib 模块的…...

大模型开发05:PDF 翻译工具开发实战

大模型开发实战05:PDF 翻译工具开发实战 PDF-Translator 机器翻译是最广泛和基础的 NLP 任务 PDF-Translator PDF 翻译器是一个使用 AI 大模型技术将英文 PDF 书籍翻译成中文的工具。这个工具使用了大型语言模型 (LLMs),如 ChatGLM 和 OpenAI 的 GPT-3 以及 GPT-3.5 Turbo 来…...

LeetCode 43题:字符串相乘

题目 给定两个以字符串形式表示的非负整数 num1 和 num2&#xff0c;返回 num1 和 num2 的乘积&#xff0c;它们的乘积也表示为字符串形式。 注意&#xff1a;不能使用任何内置的 BigInteger 库或直接将输入转换为整数。 示例 1: 输入: num1 "2", num2 "3&…...

基于java Swing 和 mysql实现的飞机订票系统(源码+数据库+ppt+ER图+流程图+架构说明+论文+运行视频指导)

一、项目简介 本项目是一套基于java Swing 和 mysql实现的飞机订票系统&#xff0c;主要针对计算机相关专业的正在做毕设的学生与需要项目实战练习的Java学习者。 包含&#xff1a;项目源码、项目文档、数据库脚本等&#xff0c;该项目附带全部源码可作为毕设使用。 项目都经过…...

Jmeter性能综合实战 —— 签到及批量签到

提取性能测试的三个方面&#xff1a;核心、高频、基础功能 签 到 请 求 步 骤 1、准备工作&#xff1a; 签到线程组n HTTP请求默认值n HTTP cookie 管理器n 首页访问请求n 登录请求n 查看结果树n 调试取样器l HTTP代理服务器 &#xff08;1&#xff09;创建线程组 &#xf…...

燃气管网监测系统,提升城市燃气安全防控能力

燃气是我们日常生活中不可或缺的能源&#xff0c;但其具有易燃易爆特性&#xff0c;燃气安全使用、泄漏监测尤为重要。当前全国燃气安全事故仍呈现多发频发态势&#xff0c;从公共安全的视角来看&#xff0c;燃气已成为城市安全的重大隐忧&#xff01;因此&#xff0c;建立一个…...

【SQL】1731. 每位经理的下属员工数量 ( 新思想:确定左表,依次添加后续字段)

leetcode题目链接 注意点 确定左表&#xff08;即&#xff0c;确定result表中的主键)&#xff0c;依次添加后续字段。注意&#xff1a;主键可能是一个字段&#xff0c;也可能是多个字段COUNT(DISTINCT())&#xff0c;一般为了防止重复&#xff0c;使用COUNT计数时&#xff0c…...

AMD Radeon RX 7000/6000系列显卡安装ROCm 调用CUDA

A卡用户画图炼丹、跑大模型甚至是跑机器学习、深度学习的有福了~ 注意&#xff1a;ROCm目前仅限在Linux系统下可用&#xff0c;Windows暂不支持 1. 安装ROCm RX6000系列及以下显卡使用ROCm 5.4.2稳定版本命令 【支持包括桌面级AMD Radeon RX6950XT、RX6900XT、RX6800XT、RX6…...

钉钉小程序引用阿里巴巴图标

2.打开的界面如图&#xff0c;先建一个iconfont.acss文件&#xff0c;全选浏览器打开的样式代码&#xff0c;复制粘贴进新建的iconfont.acss文件中 3.使用...