vue项目中实际构建echarts拓扑关系图业务

news2024/10/2 20:36:31

vue项目中实际构建echarts拓扑关系图业务

  • 前言
  • 一、关系拓扑是什么?
  • 二、需求梳理
  • 三、封装关系图组件
    • 1.父组件引用
    • 2.测试数据引入
    • 3.封装关系子组件
    • 4.关系组件完整代码
  • 总结


前言

由于现在echarts的利用率增强,需要用到拓扑图的设计,如果单纯针对echarts文档来看,虽然可以利用API详细了解到功能点,但具体的实际运用与开发场景经验案例还是略有欠缺,下面将针对echarts关系拓扑图进行实例讲解。


一、关系拓扑是什么?

关系拓扑图,顾名思义,是有具体的关系存在的点,具有向量指向特点。那么就要求数据具备sourcetarget的属性。思路是这样的,首先描绘物体(关系点),再者是描绘连接关系点的连线。

二、需求梳理

在这里插入图片描述
简单效果图如上图,共4层类型,同一层为同一个类型,分别是:运维人员、数据库、应用、用户,连接线为起始到终点的指向关系

三、封装关系图组件

1.父组件引用

index.vue

<relation-graph
	:graph-data="relationGraphData"
	:model="graph.FILE_VIEW_MODEL"
/>
<script>
import graph from '@/configs/graph-setting.js';
export default {
	components: {
		RelationGraph,
	},
	data () {
		return {
			graph,
		   // 关系拓扑图数据
			relationGraphData: {
				dotList: []
			},
		}
	}
}
</script>

2.测试数据引入

测试数据relationGraphData

{
              'relationList': [
                {
                  'originName': 'user_172',
                  'endName': 'application_北京政府门户网站'
                },
                {
                  'originName': 'user_172',
                  'endName': 'application_www.huhhot.gov.cn'
                },
                {
                  'originName': 'user_172',
                  'endName': 'application_172.24.'
                },
                {
                  'originName': 'user_172',
                  'endName': 'application_包头'
                },
                {
                  'originName': 'user_172',
                  'endName': 'application_www.cq.gov.cn'
                },
                {
                  'originName': 'user_172222',
                  'endName': 'application_oa.b.360.cn'
                },
                {
                  'originName': 'user_172.2455',
                  'endName': 'application_9197'
                },
                {
                  'originName': 'application_9197',
                  'endName': 'database_test2'
                },
                {
                  'originName': 'application_9197',
                  'endName': 'database_null'
                },
                {
                  'originName': 'maintenance_172.2455',
                  'endName': 'database_MySQL被动147'
                },
                {
                  'originName': 'maintenance_145',
                  'endName': 'database_test2'
                }
              ],
              'dotList': [
                {
                  'raleName': '172.12',
                  'name': 'user_172',
                  'id': 35641,
                  'type': 'user'
                },
                {
                  'name': 'application_北京政府门户网站',
                  'id': 'www.beijing.gov.cn',
                  'type': 'application'
                },
                {
                  'name': 'application_www.huhhot.gov.cn',
                  'id': 'www.huhhot.gov.cn',
                  'type': 'application'
                },
                {
                  'name': 'application_172.24.',
                  'id': '172.212',
                  'type': 'application'
                },
                {
                  'name': 'application_包头',
                  'id': 'czj.baotou.gov.cn',
                  'type': 'application'
                },
                {
                  'name': 'application_www.cq.gov.cn',
                  'id': 'www.cq.gov.cn',
                  'type': 'application'
                },
                {
                  'raleName': '172222',
                  'name': 'user_172222',
                  'id': 111119,
                  'type': 'user'
                },
                {
                  'name': 'application_oa.b.360.cn',
                  'id': 'oa.b.360.cn',
                  'type': 'application'
                },
                {
                  'raleName': '172.2455',
                  'name': 'user_172.2455',
                  'id': 31472,
                  'type': 'user'
                },
                {
                  'name': 'application_9197',
                  'id': '172.24.105.50:9197',
                  'type': 'application'
                },
                {
                  'name': 'database_test2',
                  'id': 103,
                  'type': 'database'
                },
                {
                  'name': 'database_null',
                  'type': 'database'
                },
                {
                  'name': 'maintenance_172.2455',
                  'type': 'maintenance'
                },
                {
                  'name': 'database_MySQL被动147',
                  'id': 102,
                  'type': 'database'
                },
                {
                  'name': 'maintenance_145',
                  'type': 'maintenance'
                }
              ]
            }

@/configs/graph-setting.js
其中svgPath为关系点的svg地址,此处可见共有四种类型点

export default {
	FILE_VIEW_MODEL: {
		'maintenance': {
			'nodeName': '运维人员',
			'svgPath': 'M604.021298 968.163776v-61.857074a5.877497 5.877497 0 0 0-3.153779-3.010425l-68.092955-35.049953a91.889652 91.889652 0 0 1-51.965677-81.281486v-181.342292a92.033005 92.033005 0 0 1 51.248909-80.779749l18.99435-9.676367c-7.16768-2.437011-14.335359-4.730668-21.503038-6.737619A264.630728 264.630728 0 1 0 324.911857 508.930549a381.320551 381.320551 0 0 0-108.231961 48.811897l-2.293657 1.505213-10.249782 7.16768c-2.150304 1.576889-4.372285 3.153779-6.594265 4.874022l-0.931798 0.645091-5.304083 4.0139c-3.870547 3.010425-7.741094 6.164204-11.970025 9.676368l-4.085577 3.368809-18.56429 15.912249 0.931798 0.501737A397.017769 397.017769 0 0 0 38.204676 889.319302v24.943524a109.80885 109.80885 0 0 0 109.665497 109.737174h467.332705a117.048207 117.048207 0 0 1-11.18158-55.621193z M961.115093 562.114731l-86.012155-44.439613a37.630318 37.630318 0 0 0-16.629016-3.942224 31.609467 31.609467 0 0 0-33.32971 29.602517v89.309286a9.102953 9.102953 0 0 1-5.017376 7.741094l-62.072105 31.896174a11.539964 11.539964 0 0 1-5.160729 1.146829 13.331884 13.331884 0 0 1-2.365334 0 11.539964 11.539964 0 0 1-2.365334-0.860122l-62.000428-32.182881a8.816246 8.816246 0 0 1-5.017376-7.741094V543.693794a26.950475 26.950475 0 0 0-4.443961-14.765419 35.838398 35.838398 0 0 0-45.443089-10.823196l-81.496516 41.572541a52.897475 52.897475 0 0 0-30.032577 46.231533v181.055585a52.969152 52.969152 0 0 0 30.677668 46.446563l68.379663 35.193307a43.006077 43.006077 0 0 1 24.37011 37.701994V967.662039c0.501738 45.944826 11.468287 54.832748 63.07558 54.832748h93.179834c51.750646 0 63.218933-16.700693 64.079055-55.334486v-61.140306a43.006077 43.006077 0 0 1 24.083404-37.988702l72.823624-37.55864a44.654643 44.654643 0 0 0 25.373585-38.992177V601.393615a44.582967 44.582967 0 0 0-24.656817-39.278884z m-147.869229 243.701104H693.760646c-16.342309 0-30.749345-11.18158-31.107729-25.875323a28.097304 28.097304 0 0 1 29.74587-27.308859h119.413541c16.485663 0 30.749345 11.324934 31.179406 25.875323a28.168981 28.168981 0 0 1-29.74587 27.523889z',
			'zIndex': 3
		},
		'database': {
			'nodeName': '数据库',
			'svgPath': 'M858.2 766.3V616.7c-22.1 19.3-47 35.2-73.7 47.2-86.5 38-180 57.2-274.5 56.3-122 7.1-242.8-27-343.1-96.7v150.7C173.7 840 318.8 912 512.3 912c193.5 0 337.5-72.6 345.9-138.9v-6.8z M858.2 507v-2.8 6.8c-8.4 66.4-152.4 138.9-345.9 138.9-193.5 0-338.6-72-345.4-137.8V361.3C267.2 431.1 388 465.1 510 458c94.5 0.9 188-18.2 274.5-56.3 26.7-12.1 51.6-28 73.7-47.2V507z M762.6 160.5c57.4 25.3 91.7 61.3 91.7 93.4 0 31.5-35.4 66.4-91.7 93.4-80 34-166.2 50.7-253.1 48.9-196.9 0-343.7-74.8-343.7-141.7s147.4-142.3 344.8-142.3c86.5-1.9 172.3 14.6 252 48.3z',
			'zIndex': 2
		},
		'application': {
			'nodeName': '应用',
			'svgPath': 'M358.4 141.1c16.2 0 30.1 5.6 41.7 16.8 11.6 11.2 17.3 24.9 17.3 41.2l0 233.8c0 16.2-5.7 30.1-17.3 41.7-11.6 11.6-25.4 17.3-41.7 17.3L124.6 491.9c-16.2 0-29.9-5.7-41.2-17.3-11.2-11.6-16.8-25.4-16.8-41.7L66.6 199.1c0-16.2 5.6-29.9 16.8-41.2 11.2-11.2 24.9-16.8 41.2-16.8L358.4 141.1 358.4 141.1zM358.4 608.7c16.2 0 30.1 5.6 41.7 16.8 11.6 11.2 17.3 24.9 17.3 41.2l0 234.8c0 16.2-5.7 29.9-17.3 41.2-11.6 11.2-25.4 16.8-41.7 16.8L124.6 959.5c-16.2 0-29.9-5.6-41.2-16.8s-16.8-24.9-16.8-41.2L66.6 666.7c0-16.2 5.6-29.9 16.8-41.2 11.2-11.3 24.9-16.8 41.2-16.8L358.4 608.7zM826.9 608.7c16.2 0 29.9 5.6 41.2 16.8 11.2 11.2 16.8 24.9 16.8 41.2l0 234.8c0 16.2-5.6 29.9-16.8 41.2-11.2 11.2-24.9 16.8-41.2 16.8L593.2 959.5c-16.2 0-30.1-5.6-41.7-16.8-11.6-11.2-17.3-24.9-17.3-41.2L534.2 666.7c0-16.2 5.7-29.9 17.3-41.2 11.6-11.2 25.4-16.8 41.7-16.8L826.9 608.7zM943.1 243.9c12.5 12.5 18.7 27.1 18.7 43.9 0 16.8-6.2 31.2-18.7 43.1l-174 174c-12.5 12.5-26.9 18.7-43.4 18.7s-31-6.2-43.4-18.7l-174-174c-11.9-11.9-17.8-26.2-17.8-43.1 0-16.8 5.9-31.5 17.8-43.9l173.9-173.9c12.5-11.9 26.9-17.8 43.4-17.8s31 5.9 43.4 17.8L943.1 243.9z',
			'zIndex': 1
		},
		'user': {
			'nodeName': '用户',
			'svgPath': 'M815.814506 299.350645c0 165.306834-134.011812 299.350645-299.350645 299.350645s-299.350645-134.011812-299.350645-299.350645c0-165.306834 134.011812-299.350645 299.350645-299.350645s299.350645 134.011812 299.350645 299.350645z M763.52814 612.780851c-69.75782 55.070279-156.219118 85.661323-247.064279 85.661323-91.901128 0-179.1944-31.295022-249.27221-87.421268-184.698228 67.805881-267.19165 304.758476-267.19165 412.979094l1027.711884 0c0-107.260648-83.133402-342.549295-264.183744-411.18715z',
			'zIndex': 0
		}
	}
}

3.封装关系子组件

代码如下(示例):

<template>
  <div class="graph-container">
    <div
      id="echartGraph"
      ref="graph_ref"
      class="graph-chart"
    />
    <div v-show="!hasData" class="noData">
      暂无数据
    </div>
  </div>
</template>

首先针对数据做去重处理,根据数据计算出关系点的坐标,这里的纵坐标间隔是yAxisSpace 320
横向排序坐标是通过去重后数据,按照需要排序的顺序['maintenance', 'database', 'application', 'user']进行排列,通过ZIndex字段0,1,2,3也可以表明层次关系

// 数组根据字段去重
	dotList =  this.deWeight(graphData.dotList, 'name');
	let yAxisLength = (this.deWeight(dotList, 'type')).length;
	let yAxisSpace = parseInt(320);//取间隔距离,默认yAxis max为1000像素
	let xAxisLengthObject = this.getRepeatNum(dotList);//获取节点重复个数
	dotList.sort(function(a, b) {
		// order是规则 list是需要排序的数组
		var order = ['maintenance', 'database', 'application', 'user'];
		return order.indexOf(a.type) - order.indexOf(b.type);
	});

下面就是一套计算坐标的逻辑,让节点数据按照固定顺序匹配遍历,每层重复个数即为要展示的同类型节点。
若是需要关系扩展,相应的增加关系数据

	let maxXlength = this.maxLength;
	
	// 循环动态计算xy横纵轴坐标
	for (let i = 0, k = 0;i < dotList.length;i++, k++) {
		let objectLength = xAxisLengthObject[dotList[i].type];
		if (k < objectLength) {
			dotList[i].x = (parseInt(maxXlength / (objectLength + 1))) * k + 10;
		} else {
			k = 0;
			dotList[i].x = (parseInt(maxXlength / (objectLength + 1))) * k + 10;
		}
		if (this.XMaxData < dotList[i].x) {
			this.XMaxData = dotList[i].x;
		}
		
		let yData = yAxisSpace * (this.model[dotList[i].type].zIndex);
		// 分类相同的y轴相同
		// 对于y坐标值大于900的情况的特殊处理
		if (yData > 900) {
			dotList[i].y = 900;
			if (i !== 0 && dotList[i].type === dotList[i - 1].type) {
				dotList[i].y = dotList[i - 1].y;
			} else {
				//下面如果有数据依次递减300或者等于0
				if (i !== 0 && yData > dotList[i - 1].y && yAxisLength === 2) {
					dotList[i].y = 10;
				} else if (i !== 0 && yData > dotList[i - 1].y) {
					dotList[i].y = dotList[i].y - 300 === 0 ? 10 : dotList[i].y - 300;
				}
			}
		} else {
			dotList[i].y = yAxisSpace * (this.model[dotList[i].type].zIndex);
		}
	
		dotList[i].svgPath = this.model[dotList[i].type].svgPath;
		dotList[i].symbolSize = this.model[dotList[i].type].symbolSize ? this.model[dotList[i].type].symbolSize : '';
	}

name名值对不上,即是默认归为原点位置,连线的数据通过类型lines的data数据传入,节点的数据通过类型为graph的2d效果绘制

4.关系组件完整代码

<script>
import * as echarts from 'echarts';
export default {
  props: {
    graphData: {
      type: Array,
      required: true
    },
    model: {
      type: Object,
      required: true
    }
  },
  data () {
    return {
      chartInstance: null,
      hasData: false,
      XMaxData: 0, //x轴最大坐标轴
      maxXlength:1200
    };
  },
  watch: {
    graphData: {
      deep: true,
      immediate: true,
      handler() {
        this.$nextTick(() => {
          this.initDotInfo();
        });
      }
    }
  },
  mounted() {
    // 获取关系图数据
    this.$nextTick(() => {
      this.initDotInfo();
    });
    window.addEventListener('resize', this.initDotInfo);
  },
  destroyed () {
    // 组件销毁时,清空resize,避免内存泄漏
    window.removeEventListener('resize', this.initDotInfo);
  },
  methods: {
    initDotInfo() {
      this.XMaxData = 0;
      let dotList =  [];
      this.hasData = false;
      let graphData = JSON.parse(JSON.stringify(this.graphData));
      if (graphData) {
        // 空值判断
        if (JSON.stringify(graphData.dotList) != '[]') {
          this.hasData = true;
        }
        // 数组根据字段去重
        dotList =  this.deWeight(graphData.dotList, 'name');
        let yAxisSpace = parseInt(320);//取间隔距离,默认yAxis max为1000像素
        let xAxisLengthObject = this.getRepeatNum(dotList);//获取节点重复个数
        dotList.sort(function(a, b) {
          // order是规则 list是需要排序的数组
          var order = ['maintenance', 'database', 'application', 'user'];
          return order.indexOf(a.type) - order.indexOf(b.type);
        });
        let maxXlength = this.maxLength;

        // 循环动态计算xy横纵轴坐标
        for (let i = 0, k = 0;i < dotList.length;i++, k++) {
          let objectLength = xAxisLengthObject[dotList[i].type];
          if (k < objectLength) {
            dotList[i].x = (parseInt(maxXlength / (objectLength + 1))) * k + 10;
          } else {
            k = 0;
            dotList[i].x = (parseInt(maxXlength / (objectLength + 1))) * k + 10;
          }
          if (this.XMaxData < dotList[i].x) {
            this.XMaxData = dotList[i].x;
          }

          let yData = yAxisSpace * (this.model[dotList[i].type].zIndex);
          // 分类相同的y轴相同
          // 对于y坐标值大于900的情况的特殊处理
          if (yData > 900) {
            dotList[i].y = 900;
            if (i !== 0 && dotList[i].type === dotList[i - 1].type) {
              dotList[i].y = dotList[i - 1].y;
            } else {
              //下面如果有数据依次递减300或者等于0
              if (i !== 0 && yData > dotList[i - 1].y && yAxisLength === 2) {
                dotList[i].y = 10;
              } else if (i !== 0 && yData > dotList[i - 1].y) {
                dotList[i].y = dotList[i].y - 300 === 0 ? 10 : dotList[i].y - 300;
              }
            }
          } else {
            dotList[i].y = yAxisSpace * (this.model[dotList[i].type].zIndex);
          }

          dotList[i].svgPath = this.model[dotList[i].type].svgPath;
          dotList[i].symbolSize = this.model[dotList[i].type].symbolSize ? this.model[dotList[i].type].symbolSize : '';
        }
        // 加载关系连线图数据
        this.initRelationDot(dotList, graphData);
      }
    },

    // 获取关系拓扑图节点数据
    initRelationDot(list, graphData) {
      let relationDotList = this.deWeight(graphData.relationList, 'originName', 'endName');
      let linesDataNodes = [];
      relationDotList.forEach((item)=>{
        let node = [];
        list.find((items, indexs)=>{
          if (item.originName === items.name) {
            node.push([items.x, items.y]);
            return true;
          }
          if (item.originName != items.name && indexs == (list.length - 1)) {
            node.push([0, 0]);
            return true;
          }

        });
        list.find((items, indexs)=>{
          if (item.endName === items.name) {
            node.push([items.x, items.y]);
            return true;
          }
          // 当不匹配点,随机分配到原点
          if (item.endName != items.name && indexs == (list.length - 1)) {
            node.push([0, 0]);
            return true;
          }
        });
        linesDataNodes.push({coords: node});

      });
      this.initChart(list, linesDataNodes);
    },

    // 初始化图表内容
    initChart(nodes, linesDataNodes) {
      let that = this;
      this.chartInstance = echarts.init(this.$refs.graph_ref);
      var charts = {
        nodes: [],
        linesData: linesDataNodes
      };
      for (var j = 0; j < nodes.length; j++) {
        const {
          id,
          name,
          svgPath,
          symbolSize,
          type,
          x,
          y,
        } = nodes[j];
        var node = {
          ids: id,
          name,
          type,
          value: [x, y],
          symbolSize: symbolSize || 30,
          symbol: 'path://' + svgPath,
          itemStyle: {
            color: '#2E6BE6',
          }
        };
        charts.nodes.push(node);
      }
      const initOption = {
        //设置echarts图随滚轮缩放
        dataZoom: [
          {
            type: 'inside'
          }
        ],
        grid: {
          x: 80,
          y: 0,
          x2: 80,
          y2: 100
        },
        backgroundColor: '#fff',
        xAxis: {
          min: 0,
          max: this.XMaxData < 1000 ? 1000 : this.XMaxData,
          show: false,
          type: 'value'
        },
        yAxis: {
          min: 0,
          max: 1000,
          show: false,
          type: 'value'
        },
        tooltip: {
          show: true,
          enterable: true,
          triggerOn: 'click',
          // item 图形触发, axis 坐标轴触发, none 不触发
          trigger: 'item',
          // 浮层隐藏的延迟
          hideDelay: 800
        },
        series: [{
          type: 'graph',
          coordinateSystem: 'cartesian2d',
          z: 3,
          label: {
            show: true,
            position: 'bottom',
            color: '#333333',
            //避免显示name名过长
            formatter: function(item) {
              if (item.data.name.indexOf('_') > -1) {
                let arrIndex = item.data.name.indexOf('_') + 1;
                let arr = item.data.name.substring(arrIndex);
                if (arr.length > 20) {
                  return (arr.substring(0, 20)).concat('...') ;
                }
                return arr;
              }
              return item.data.name;
            }
          },
          data: charts.nodes,
        }, {
          type: 'lines',
          polyline: true,
          coordinateSystem: 'cartesian2d',
          silent: true,
          lineStyle: {
            type: 'dashed',
            width: 1,
            color: '#175064',
            curveness: 0.2

          },
          effect: {
            show: true,
            trailLength: 0,
            symbol: 'arrow',
            color: '#2E6BE6',
            symbolSize: 8
          },
          data: charts.linesData
        }]

      };
      this.chartInstance.setOption(initOption);

    },
    // 数组字段去重
    getArrUnique(arr) {
      const res = new Map();
      return arr.filter((item) => !res.has(item.type) && res.set(item.type, 1));
    },
    getListArrUnique(arr) {
      const res = new Map();
      return arr.filter((item) => (!res.has(item) && res.set(item, 1)));
    },
    getListArrUniqueName(arr) {
      const res = new Map();
      return arr.filter((item) => (!res.has(item.name) && res.set(item.name, 1)));
    },
    //数组内重复字段计数
    getRepeatNum(arr) {
      let arrData = arr;
      let obj = {};
      for (let i = 0; i < arrData.length; i++) {
        var item = arrData[i].type;
        obj[item] = (obj[item] + 1) || 1;
      }
      return obj;
    },
    deWeight(arr, ...arguements) {
      function getBoolean(o, m) {
        let list = arguements.map(x => o[x] == m[x]); //值均为布尔
        return list.every(i => i); //要使这些布尔值都真才能满足条件,因为要求的条件是 并且
      }
      let result = [];//新数组
      //总数组与新数组比较,遍历总数组时用新数组的some方法进行判断
      arr.map(o => !result.some(m => getBoolean(o, m)) ? result.push(o) : '');
      return result;
    }
  }
};
</script>

<style lang='scss'>
.graph-container {
  width: 100%;
  height: 100%;
  position: relative;

  .graph-chart {
    width: 100%;
    height: 100%;
  }

  .noData {
    height: 100%;
    padding-top: 18%;
    text-align: center;
    color: #999;
    font-size: 14px;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    margin: 0 auto;
  }
}
</style>


总结

关系拓扑图不只是前端构建这块需要掌握技巧,关于传入该组件的数据也需要处理,可参考测试数据内容
echarts的api关于关系拓扑图的属性可以仔细研究,会有不一样的发现
如果觉得有帮助的话,欢迎关注一波

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

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

相关文章

Ubuntu虚拟机安装

文章目录VMware添加虚拟机等待开机&#xff08;需要一些时间安装系统&#xff09;检查网络环境设置 Ubuntu 中文支持一些基础设置VMware添加虚拟机 文件——>新建虚拟机 下一步&#xff1a;安装程序光盘映像文件&#xff08;iso&#xff09; 设置主机名&#xff0c;用户名及…

reportportal 集成 robotframework 自动化执行及结果可视化

最近领导想了个需求&#xff0c;想把目前组内在linux平台上执行的自动化脚本搞成可视化&#xff0c;如果是web站点相关日志可视化倒是简单了&#xff0c;ELK就是不错的选择&#xff0c;大部分可视化项目这种的&#xff0c;可以做的开起来很炫。 我们这边是自己写的脚本&#x…

机器学习西瓜书-1-2章

学习目标&#xff1a; 概览机器学习西瓜书 1、2章 学习内容&#xff1a; 第一章 绪论 1.1 基本术语 1.2 假设空间 1.3 归纳偏好 1.4 发展历程 第二章 模型评估与选择 2.1 经验误差与过拟合 2.2 评估方法 2.3 性能度量 学习时间&#xff1a; 两天 学习产出&#xff1a; 第…

爱了爱了,20个好用到爆的 Python 函数

大家好&#xff0c;今天分享20个日常工作中必不可少的Python函数&#xff0c;这些函数平时看到的不多&#xff0c;但是它们使用起来倒是非常的方便&#xff0c;它们可以大幅度地提高工作效率。内容较长&#xff0c;欢迎收藏学习&#xff0c;喜欢点赞支持。 文章目录技术提升isi…

你以为的Java面试只是背答案?跳槽涨薪不还是得靠自己的技术

前言 Java面试当然不能只靠背答案&#xff0c;为了应付面试背完答案拿到offer只是进入了这个行业&#xff0c;后面的实操还是得看自己的技术&#xff01;技术的挂钩当然和技术底层也是挂钩的。 这是我在工作、面试中学习并总结到的一些知识点&#xff0c;都是一些比较典型的、…

Kafka 消息过期策略(时间相关参数)

Kafka 消息过期策略&#xff08;时间相关参数&#xff09; 标记delete时效 (CDH配置项)log.retention.ms &#xff08;Kafka offset配置&#xff09;retention.ms 标记delete的真删底层文件 delete.delay.ms log.segmetn.delete 背景&#xff1a;在不需要重启kafka的情况下&a…

QA特辑|剪得断,理不乱,一场直播解开关联网络与反团伙欺诈谜团

11月 10 日下午15:00 第九期《关联网络技术在业务安全中的应用》正式开讲。顶象数据科学家翼龙详尽的介绍了关联网络在反团伙欺诈中的作用&#xff0c;深度剖析了关联网络的技术框架、关联网络的图谱构建以及关联网络的复杂算法&#xff0c;为反团伙欺诈提供了重要的参考。 直播…

6.jeecg的pom结构

1.父pom parent为springboot 1.子模块部分 包括base-core、demo、system三个 air为自己新建 2.maven仓库部分 3.dependencies 这个是主动引入的依赖&#xff0c;子pom会继承 4.dependencyManagement 这个有点多&#xff0c;主要作用是先把依赖添加进来&#xff0c;但是…

python安装 learn2learn库 || 在线安装方式或者本地安装

文章目录1. 去github下载完整安装包&#xff08;或本文的百度网盘&#xff09;2. 安装C依赖库3 本地安装4 在线安装&#xff08;不想本地安装 看这儿&#xff01;&#xff09;1. 去github下载完整安装包&#xff08;或本文的百度网盘&#xff09; github连接 https://github.c…

死磕宠物食品安全,京东你凭什么?

出品| 大力财经 文 | 魏力 京东第一个站出来&#xff0c;破局宠物食品行业乱象。 济南女孩刘小姐很在乎宠物的饮食安全&#xff0c;每次换的新狗粮或者买的新零食&#xff0c;她都要先尝一尝&#xff0c;鉴定一下是否符合自家狗狗食用。随着家人式养宠的到来&#xff0c;宠物…

deb包格式实例详解

本文简介及包格式部分内容节选自&#xff1a; deb_百度百科 一、简介 DEB是Debian软件包格式的文件扩展名&#xff0c;跟Debian的命名一样&#xff0c;DEB也是因Debra Murdock而得名&#xff0c;她是Debian创始人Ian Murdock的太太。 Debian包是Unixar的标准归档&#xff0…

LeetCode第 91 场双周赛题解

目录2465. 不同的平均值数目2466. 统计构造好字符串的方案数2467. 树上最大得分和路径2468. 根据限制分割消息2465. 不同的平均值数目 模拟一下即可 class Solution { public:int distinctAverages(vector<int>& nums) {set<double>st;sort(nums.begin(),nums…

Intellij各个功能小件的样子

文章目录资料ControlsButtonBuilt-in buttonSplit buttonCheckboxCombo boxDescription textDrop-down listGot It tooltipGroup headerInput fieldLinkNotificationsBallonBannerProgress indicatorsLoaderProgress barProgress textRadio buttonScrollbarSearch fieldTableTa…

CSAPP实验记录(2)--------- Bomb

实验简介 本实验需要拆除一个“二进制炸弹”&#xff0c;“二进制炸弹”是一个可执行目标程序。运行时&#xff0c;它会提示用户键入6个不同的字符串。如果其中任何一个错误&#xff0c;炸弹就会“爆炸”。必须通过逆向工程和汇编语言知识&#xff0c;推导出六个字符串分别是什…

Linux权限管理

修改权限-chmod 通过chmod指令&#xff0c;可以修改文件或者目录的权限 第一种方式 - 变更权限 u:所有者 g:所有组 o:其他人 a:所有人 chmod urwx,grx,ox 文件目录名 chmod ow …

条件随机场CRF(持续更新ing...)

诸神缄默不语-个人CSDN博文目录 本文是作者学习CRF后的笔记。 最近更新时间&#xff1a;2022.11.15 最早更新时间&#xff1a;2022.11.15 条件随机场CRF是适宜于顺序预测任务的判别模型&#xff0c;可用于命名实体识别、词性标注等。 文章目录1. linear-chain CRF2. CRF目标…

使用TensorRT量化ResNet50网络(PTQ)

深度学习正在彻底改变行业提供产品和服务的方式。 这些服务包括用于计算机视觉的对象检测、分类和分割&#xff0c;以及用于基于语言的应用程序的文本提取、分类和摘要。 这些应用程序必须实时运行。 大多数模型都采用浮点 32 位算法进行训练&#xff0c;以利用更大的动态范…

python代码规范工具

文章目录一&#xff1a;Pycharm 创建文件自动头部二&#xff1a;代码门禁三 : 附录一&#xff1a;Pycharm 创建文件自动头部 Pycham —> Preferences —> 编辑器 —> 文件和代码模版 —> 文件 —> Python Script —> 填写头部 #!/usr/bin/env python # -*- c…

详解clickhouse分区目录的合并过程

数据存储底层分布 目录名类型说明202103_1_10_2目录分区目录一个或多个&#xff0c;由于分区LSM生成的detached目录通过DETACH语句卸载后的表分区存放位置format_version.txt文本文件纯文本&#xff0c;记录存储的格式 columns.txt&#xff1a;该文件是一个文本文件&#xff0c…

vue 生成二维码的两种方式

方式一&#xff1a;qrcode&#xff08;无 icon 图标&#xff09; npm i qrcodejs2 --save 完整代码 <template><div class"flex-box"><div>qrcode&#xff08;无 icon 图标&#xff09;</div><div class"qr-code" ref"…