效果图:

基础树组件(本人博客里面有)

https://blog.csdn.net/xfy991127/article/details/140346861?spm=1001.2014.3001.5501

下面是工作需求改造后

父组件

<template><div class="go-JJTree" id="tree-scroll" @wheel="handleWheel($event)"><div class="treewrapper"><tree-menuclass="tree":list="treeList":r1Config="r1Config":r2Config="r2Config":r3Config="r3Config":endConfig="endConfig":lineWidth="lineWidth":line="line":line1="line1":gap="gap":tipConfig="tipConfig":unit="unit":num1="num1":num2="num2"></tree-menu></div></div>
</template><script setup lang="ts">
import { ref } from "vue";
import TreeMenu from "../../components/TreeMenu/index.vue";const handleWheel = (e: any) => {e.preventDefault();const treeScroll = document.getElementById("tree-scroll");if (treeScroll) {treeScroll.scrollLeft += e.deltaY;}
};const treeList = ref([{name: "高端装备制造产业",imgPathUrl: require("@/assets/images/tree/treebg.png"),id: "ins-01-02",lastId: "",show: true,rank: 1,isEnd: false,comNum: "",children: [{name: "智能制造装备产业",imgPathUrl: require("@/assets/images/tree/treebg.png"),id: "ins-01-02-01",lastId: "ins-01-02",show: true,rank: 2,isEnd: false,comNum: "",children: [{name: "机器人与增材设备制造",imgPathUrl: require("@/assets/images/tree/treebg.png"),id: "ins-01-02-011",lastId: "ins-01-02-01",show: true,rank: 3,isEnd: false,comNum: "",children: [{name: "工业机器人制造",imgPathUrl: require("@/assets/images/tree/treebg.png"),id: "ins-01-02-0111",lastId: "ins-01-02-011",show: true,rank: 4,isEnd: true,comNum: "",},{name: "特殊作业机器人制造",imgPathUrl: require("@/assets/images/tree/treebg.png"),id: "ins-01-02-0112",lastId: "ins-01-02-011",show: true,rank: 4,isEnd: true,comNum: "",},{name: "增材制造装备制造",imgPathUrl: require("@/assets/images/tree/treebg.png"),id: "ins-01-02-0113",lastId: "ins-01-02-011",show: true,rank: 4,isEnd: true,comNum: "",},{name: "服务消费机器人制造",imgPathUrl: require("@/assets/images/tree/treebg.png"),id: "ins-01-02-0114",lastId: "ins-01-02-011",show: true,rank: 4,isEnd: true,comNum: "",},],},{name: "其他智能设备制造",imgPathUrl: require("@/assets/images/tree/treebg.png"),id: "ins-01-02-014",lastId: "ins-01-02-01",show: true,rank: 3,isEnd: false,comNum: "",children: [{name: "金属表面处理及热处理加工",imgPathUrl: require("@/assets/images/tree/treebg.png"),id: "ins-01-02-0141",lastId: "ins-01-02-014",show: true,rank: 4,isEnd: true,comNum: "",},{name: "其他未列明金属制品制造",imgPathUrl: require("@/assets/images/tree/treebg.png"),id: "ins-01-02-0142",lastId: "ins-01-02-014",show: true,rank: 4,isEnd: true,comNum: "",},{name: "生产专用起重机制造",imgPathUrl: require("@/assets/images/tree/treebg.png"),id: "ins-01-02-0143",lastId: "ins-01-02-014",show: true,rank: 4,isEnd: true,comNum: "",},{name: "生产专用车辆制造",imgPathUrl: require("@/assets/images/tree/treebg.png"),id: "ins-01-02-0144",lastId: "ins-01-02-014",show: true,rank: 4,isEnd: true,comNum: "",},{name: "连续搬运设备制造",imgPathUrl: require("@/assets/images/tree/treebg.png"),id: "ins-01-02-0145",lastId: "ins-01-02-014",show: true,rank: 4,isEnd: true,comNum: "",},{name: "其他物料搬运设备制造",imgPathUrl: require("@/assets/images/tree/treebg.png"),id: "ins-01-02-0146",lastId: "ins-01-02-014",show: true,rank: 4,isEnd: true,comNum: "",},{name: "其他未列明通用设备制造业",imgPathUrl: require("@/assets/images/tree/treebg.png"),id: "ins-01-02-0147",lastId: "ins-01-02-014",show: true,rank: 4,isEnd: true,comNum: "",},{name: "食品、酒、饮料及茶生产专用设备制造",imgPathUrl: require("@/assets/images/tree/treebg.png"),id: "ins-01-02-0148",lastId: "ins-01-02-014",show: true,rank: 4,isEnd: true,comNum: "",},{name: "农副食品加工专用设备制造",imgPathUrl: require("@/assets/images/tree/treebg.png"),id: "ins-01-02-0149",lastId: "ins-01-02-014",show: true,rank: 4,isEnd: true,comNum: "",},{name: "机械化农业及园艺机具制造",imgPathUrl: require("@/assets/images/tree/treebg.png"),id: "ins-01-02-01410",lastId: "ins-01-02-014",show: true,rank: 4,isEnd: true,comNum: "",},{name: "其他农、林、牧、渔业机械制造",imgPathUrl: require("@/assets/images/tree/treebg.png"),id: "ins-01-02-01411",lastId: "ins-01-02-014",show: true,rank: 4,isEnd: true,comNum: "",},],},{name: "智能关键基础零部件制造",imgPathUrl: require("@/assets/images/tree/treebg.png"),id: "ins-01-02-015",lastId: "ins-01-02-01",show: true,rank: 3,isEnd: false,comNum: "",children: [{name: "液压动力机械及元件制造",imgPathUrl: require("@/assets/images/tree/treebg.png"),id: "ins-01-02-0151",lastId: "ins-01-02-015",show: true,rank: 4,isEnd: true,comNum: "",},{name: "液力动力机械及元件制造",imgPathUrl: require("@/assets/images/tree/treebg.png"),id: "ins-01-02-0152",lastId: "ins-01-02-015",show: true,rank: 4,isEnd: true,comNum: "",},{name: "气压动力机械及元件制造",imgPathUrl: require("@/assets/images/tree/treebg.png"),id: "ins-01-02-0153",lastId: "ins-01-02-015",show: true,rank: 4,isEnd: true,comNum: "",},{name: "滚动轴承制造",imgPathUrl: require("@/assets/images/tree/treebg.png"),id: "ins-01-02-0154",lastId: "ins-01-02-015",show: true,rank: 4,isEnd: true,comNum: "",},{name: "齿轮及齿轮减、变速箱制造",imgPathUrl: require("@/assets/images/tree/treebg.png"),id: "ins-01-02-0155",lastId: "ins-01-02-015",show: true,rank: 4,isEnd: true,comNum: "",},{name: "机械零部件加工",imgPathUrl: require("@/assets/images/tree/treebg.png"),id: "ins-01-02-0156",lastId: "ins-01-02-015",show: true,rank: 4,isEnd: true,comNum: "",},{name: "其他通用零部件制造",imgPathUrl: require("@/assets/images/tree/treebg.png"),id: "ins-01-02-0157",lastId: "ins-01-02-015",show: true,rank: 4,isEnd: true,comNum: "",},{name: "其他未列明通用设备制造业",imgPathUrl: require("@/assets/images/tree/treebg.png"),id: "ins-01-02-0158",lastId: "ins-01-02-015",show: true,rank: 4,isEnd: true,comNum: "",},{name: "微特电机及组件制造",imgPathUrl: require("@/assets/images/tree/treebg.png"),id: "ins-01-02-0159",lastId: "ins-01-02-015",show: true,rank: 4,isEnd: true,comNum: "",},{name: "变压器、整流器和电感器制造",imgPathUrl: require("@/assets/images/tree/treebg.png"),id: "ins-01-02-01510",lastId: "ins-01-02-015",show: true,rank: 4,isEnd: true,comNum: "",},],},{name: "智能制造相关服务",imgPathUrl: require("@/assets/images/tree/treebg.png"),id: "ins-01-02-016",lastId: "ins-01-02-01",show: true,rank: 3,isEnd: false,comNum: "",children: [{name: "通用设备修理",imgPathUrl: require("@/assets/images/tree/treebg.png"),id: "ins-01-02-0161",lastId: "ins-01-02-016",show: true,rank: 4,isEnd: true,comNum: "",},{name: "专用设备修理",imgPathUrl: require("@/assets/images/tree/treebg.png"),id: "ins-01-02-0162",lastId: "ins-01-02-016",show: true,rank: 4,isEnd: true,comNum: "",},{name: "仪器仪表修理",imgPathUrl: require("@/assets/images/tree/treebg.png"),id: "ins-01-02-0163",lastId: "ins-01-02-016",show: true,rank: 4,isEnd: true,comNum: "",},],},],},{name: "海洋工程装备产业",imgPathUrl: require("@/assets/images/tree/treebg.png"),id: "ins-01-02-05",lastId: "ins-01-02",show: true,rank: 2,isEnd: false,comNum: "",children: [{name: "海洋工程装备制造",imgPathUrl: require("@/assets/images/tree/treebg.png"),id: "ins-01-02-051",lastId: "ins-01-02-05",show: true,rank: 3,isEnd: false,comNum: "",children: [{name: "金属切割及焊接设备制造",imgPathUrl: require("@/assets/images/tree/treebg.png"),id: "ins-01-02-0511",lastId: "ins-01-02-051",show: true,rank: 4,isEnd: true,comNum: "",},{name: "海洋工程装备制造",imgPathUrl: require("@/assets/images/tree/treebg.png"),id: "ins-01-02-0512",lastId: "ins-01-02-051",show: true,rank: 4,isEnd: true,comNum: "",},],},{name: "深海石油钻探设备制造",imgPathUrl: require("@/assets/images/tree/treebg.png"),id: "ins-01-02-052",lastId: "ins-01-02-05",show: true,rank: 3,isEnd: false,comNum: "",children: [{name: "深海石油钻探设备制造",imgPathUrl: require("@/assets/images/tree/treebg.png"),id: "ins-01-02-0521",lastId: "ins-01-02-052",show: true,rank: 4,isEnd: true,comNum: "",},],},{name: "其他海洋相关设备与产品制造",imgPathUrl: require("@/assets/images/tree/treebg.png"),id: "ins-01-02-053",lastId: "ins-01-02-05",show: true,rank: 3,isEnd: false,comNum: "",children: [{name: "涂料制造",imgPathUrl: require("@/assets/images/tree/treebg.png"),id: "ins-01-02-0531",lastId: "ins-01-02-053",show: true,rank: 4,isEnd: true,comNum: "",},{name: "农副食品加工专用设备制造",imgPathUrl: require("@/assets/images/tree/treebg.png"),id: "ins-01-02-0532",lastId: "ins-01-02-053",show: true,rank: 4,isEnd: true,comNum: "",},{name: "渔业机械制造",imgPathUrl: require("@/assets/images/tree/treebg.png"),id: "ins-01-02-0533",lastId: "ins-01-02-053",show: true,rank: 4,isEnd: true,comNum: "",},{name: "地质勘查专用设备制造",imgPathUrl: require("@/assets/images/tree/treebg.png"),id: "ins-01-02-0534",lastId: "ins-01-02-053",show: true,rank: 4,isEnd: true,comNum: "",},{name: "潜水装备制造",imgPathUrl: require("@/assets/images/tree/treebg.png"),id: "ins-01-02-0535",lastId: "ins-01-02-053",show: true,rank: 4,isEnd: true,comNum: "",},{name: "水下救捞装备制造",imgPathUrl: require("@/assets/images/tree/treebg.png"),id: "ins-01-02-0536",lastId: "ins-01-02-053",show: true,rank: 4,isEnd: true,comNum: "",},{name: "发电机及发电机组制造",imgPathUrl: require("@/assets/images/tree/treebg.png"),id: "ins-01-02-0537",lastId: "ins-01-02-053",show: true,rank: 4,isEnd: true,comNum: "",},{name: "电力电子元器件制造",imgPathUrl: require("@/assets/images/tree/treebg.png"),id: "ins-01-02-0538",lastId: "ins-01-02-053",show: true,rank: 4,isEnd: true,comNum: "",},{name: "通信系统设备制造",imgPathUrl: require("@/assets/images/tree/treebg.png"),id: "ins-01-02-0539",lastId: "ins-01-02-053",show: true,rank: 4,isEnd: true,comNum: "",},],},{name: "海洋环境监测与探测装备制造",imgPathUrl: require("@/assets/images/tree/treebg.png"),id: "ins-01-02-054",lastId: "ins-01-02-05",show: true,rank: 3,isEnd: false,comNum: "",children: [{name: "船用配套设备制造",imgPathUrl: require("@/assets/images/tree/treebg.png"),id: "ins-01-02-0541",lastId: "ins-01-02-054",show: true,rank: 4,isEnd: true,comNum: "",},{name: "雷达及配套设备制造",imgPathUrl: require("@/assets/images/tree/treebg.png"),id: "ins-01-02-0542",lastId: "ins-01-02-054",show: true,rank: 4,isEnd: true,comNum: "",},{name: "环境监测专用仪器仪表制造",imgPathUrl: require("@/assets/images/tree/treebg.png"),id: "ins-01-02-0543",lastId: "ins-01-02-054",show: true,rank: 4,isEnd: true,comNum: "",},{name: "导航、测绘、气象及海洋专用仪器制造",imgPathUrl: require("@/assets/images/tree/treebg.png"),id: "ins-01-02-0544",lastId: "ins-01-02-054",show: true,rank: 4,isEnd: true,comNum: "",},],},{name: "海洋工程建筑及相关服务",imgPathUrl: require("@/assets/images/tree/treebg.png"),id: "ins-01-02-055",lastId: "ins-01-02-05",show: true,rank: 3,isEnd: false,comNum: "",children: [{name: "海洋油气资源开发利用工程建筑",imgPathUrl: require("@/assets/images/tree/treebg.png"),id: "ins-01-02-0551",lastId: "ins-01-02-055",show: true,rank: 4,isEnd: true,comNum: "",},{name: "海洋能源开发利用工程建筑",imgPathUrl: require("@/assets/images/tree/treebg.png"),id: "ins-01-02-0552",lastId: "ins-01-02-055",show: true,rank: 4,isEnd: true,comNum: "",},{name: "财产保险",imgPathUrl: require("@/assets/images/tree/treebg.png"),id: "ins-01-02-0553",lastId: "ins-01-02-055",show: true,rank: 4,isEnd: true,comNum: "",},{name: "律师及相关法律服务",imgPathUrl: require("@/assets/images/tree/treebg.png"),id: "ins-01-02-0554",lastId: "ins-01-02-055",show: true,rank: 4,isEnd: true,comNum: "",},{name: "工程和技术研究和试验发展",imgPathUrl: require("@/assets/images/tree/treebg.png"),id: "ins-01-02-0555",lastId: "ins-01-02-055",show: true,rank: 4,isEnd: true,comNum: "",},{name: "其他海洋服务",imgPathUrl: require("@/assets/images/tree/treebg.png"),id: "ins-01-02-0556",lastId: "ins-01-02-055",show: true,rank: 4,isEnd: true,comNum: "",},{name: "工程管理服务",imgPathUrl: require("@/assets/images/tree/treebg.png"),id: "ins-01-02-0557",lastId: "ins-01-02-055",show: true,rank: 4,isEnd: true,comNum: "",},{name: "工程设计活动",imgPathUrl: require("@/assets/images/tree/treebg.png"),id: "ins-01-02-0558",lastId: "ins-01-02-055",show: true,rank: 4,isEnd: true,comNum: "",},],},],},],},
]);const r1Config = ref({width: 150,height: 80,line: 25,fontSize: 14,fontFamily: "AlibabaPuHuiTi_2_85_Bold",color: "#fff",open: true,
});
const r2Config = ref({width: 150,height: 80,fontSize: 14,fontFamily: "AlibabaPuHuiTi_2_85_Bold",color: "#fff",
});const r3Config = ref({width: 150,height: 80,fontSize: 14,fontFamily: "AlibabaPuHuiTi_2_85_Bold",color: "#fff",
});
const endConfig = ref({width: 130,height: 80,fontSize: 14,fontFamily: "AlibabaPuHuiTi_2_85_Bold",color: "#fff",lateX: 5,
});const tipConfig = {size: 20,lateX: 10,lateY: -10,
};const lineWidth = ref(3);
const line = ref(30);
const line1 = ref(15);
const gap = ref(25);
const unit = ref("家");
const num1 = ref(5);
const num2 = ref(4);
</script><style lang="scss" scoped>
.go-JJTree {overflow: scroll;background-color: #000;height: 1000px;.treewrapper {min-width: 100%;.tree {margin: 0 auto;}}&::-webkit-scrollbar {display: none;}
}
</style>

子组件 

<template><div class="treeBox" v-if="obj" :style="treeBoxStyle"><divv-for="(item, index) in obj":key="item.id":class="getNodeClass(index)"><div class="nodeBgname"><divclass="tip"v-show="!item.isEnd"@click="toggleNode(item)":style="{...getTipStyle,get backgroundImage() {return `url(${item.show? require('@/assets/images/tree/open.png'): require('@/assets/images/tree/colse.png')})`;},}"></div><divclass="bg":class="{ xia: shouldShowBottomLine(item), shang: shang2 }"@click="toggleNode(item)"><div@click.stop="handleClick(item)":class="getNodeContentClass(item)":style="getNodeContentStyle(item)">{{ handleStr(item) }}</div></div></div><div v-if="item.show"><divclass="group"v-if="shouldShowGroupLayout(item)":style="getGroupStyle(item)"><divv-for="child in item.children":key="child.id"class="end2"@click="handleClick(child)":style="getEndNodeStyle(child)">{{ handleStr(child) }}</div></div><divv-else-if="shouldShowGridLayout(item)":style="getGridLayoutStyle(item)"><div class="line" :style="getGridLineStyle(item)"></div><divv-for="child in item.children":key="child.id"class="end1"@click="handleClick(child)":style="getEndNodeStyle(child)">{{ handleStr(child) }}</div></div><divv-else-if="shouldShowRegularLayout(item)":style="getRegularLayoutStyle(item)"><div class="line" :style="getRegularLineStyle(item)"></div><divv-for="child in item.children":key="child.id"class="end"@click="handleClick(child)":style="getEndNodeStyle(child)">{{ handleStr(child) }}</div></div><div v-else><tree-menu:list="item.children":shang2="true":num="item.children?.length || 0":r1Config="r1Config":r2Config="r2Config":r3Config="r3Config":endConfig="endConfig":lineWidth="lineWidth":line="line":line1="line1":gap="gap":unit="unit":num1="num1":num2="num2":tipConfig="tipConfig"@treeclick="handleClick"/></div></div></div></div>
</template><script setup lang="ts">
import { ref, watch, reactive, computed } from "vue";
import TreeMenu from "./index.vue";const props = defineProps({list: {type: Array,default: () => [],},shang2: {type: Boolean,default: false,},num: {type: Number,default: 0,},r1Config: {type: Object,default: () => ({}),},r2Config: {type: Object,default: () => ({}),},r3Config: {type: Object,default: () => ({}),},endConfig: {type: Object,default: () => ({}),},tipConfig: {type: Object,default: () => ({}),},lineWidth: {type: Number,default: 3,},line: {type: Number,default: 25,},line1: {type: Number,default: 25,},gap: {type: Number,default: 20,},unit: {type: String,default: "家",},num1: {type: Number,default: 5,},num2: {type: Number,default: 4,},
});const emit = defineEmits(["treeclick"]);const obj = ref<any[]>([]);// 计算属性
const treeBoxStyle = computed(() => {return {bottom: obj.value.length === 1 ? `${-props.line + 10}px` : undefined,};
});// 方法定义
const getNodeClass = (index: number) => {return {heng: !(index === props.num - 1) && props.num,zou: index > 0,};
};// 折叠展开样式
const getTipStyle = computed(() => {return {position: "absolute",top: "50%",right: "-10px",width: `${props.tipConfig.size}px`,height: `${props.tipConfig.size}px`,transform: `translate(${props.tipConfig.lateX}px, ${props.tipConfig.lateY}px)`,backgroundRepeat: "no-repeat",backgroundSize: "100% 100%",};
});const getNodeContentClass = (item: any) => {return {r1: item.rank === 1,r2: item.rank === 2,r3: item.rank >= 3,};
};const getNodeContentStyle = (item: any) => {return {display: "flex",justifyContent: "center",alignItems: "center",backgroundRepeat: "no-repeat",backgroundSize: "100% 100%",backgroundImage: `url(${item.imgPathUrl})`,zIndex: "-1",textAlign: "center",};
};const getEndNodeStyle = (item: any) => {return {position: "relative",display: "flex",justifyContent: "center",alignItems: "center",backgroundRepeat: "no-repeat",backgroundSize: "100% 100%",backgroundImage: `url(${item.imgPathUrl})`,marginTop: "10px",textAlign: "center",};
};// 布局判断方法
const shouldShowGroupLayout = (item: any) => {if (!item.children) return false;const allEnd =item.children.filter((c: any) => c.isEnd).length === item.children.length;return allEnd && item.children.length > props.num1 * 2;
};const shouldShowGridLayout = (item: any) => {if (!item.children) return false;const allEnd =item.children.filter((c: any) => c.isEnd).length === item.children.length;return allEnd && item.children.length > props.num1;
};const shouldShowRegularLayout = (item: any) => {if (!item.children) return false;const allEnd =item.children.filter((c: any) => c.isEnd).length === item.children.length;return allEnd && item.children.length > 1;
};// 样式计算方法
const getGroupStyle = (item: any) => {return {display: "grid",width: `${props.endConfig.width * Math.ceil(item.children.length / props.num2) +15 * Math.floor(item.children.length / props.num2)}px`,gridTemplateColumns: `repeat(${Math.ceil(item.children.length / props.num2)}, ${props.endConfig.width}px)`,gap: "15px",border: "3px solid #1b63a6",padding: "10px",transform: `translateY(${props.line - 13}px)`,};
};const getGridLayoutStyle = (item: any) => {return {display: "grid",width: `${props.endConfig.width * 2 + 10}px`,gridTemplateColumns: `${props.endConfig.width}px ${props.endConfig.width}px`,gap: "10px",overflow: "hidden",transform: "translateY(-10px)",};
};const getGridLineStyle = (item: any) => {return {width: "3px",height: "3000px",position: "absolute",backgroundColor: "#1b63a6",left: "50%",bottom: `${props.endConfig.height - 40}px`,transform: "translateX(-50%)",};
};const getRegularLayoutStyle = (item: any) => {return {zIndex: 100,padding: "10px 5%",position: "relative",overflow: "hidden",transform: `translateX(${props.endConfig.lateX}px)`,bottom: getBottomPosition(item.rank),};
};const getRegularLineStyle = (item: any) => {return {width: "3px",height: "3000px",position: "absolute",backgroundColor: "#1b63a6",left: "0px",bottom: `${props.endConfig.height - 30}px`,};
};const getBottomPosition = (rank: number) => {switch (rank) {case 1:return `${props.line * 3 - props.r1Config.height}px`;case 2:return `${props.line * 3 - props.r2Config.height}px`;case 3:return `${props.line * 3 - props.r3Config.height}px`;default:return undefined;}
};// 业务逻辑方法
const shouldShowBottomLine = (item: any) => {// 如果没有子节点,不显示下划线if (!item.children || item.children.length === 0) return false;// 如果所有子节点都是末端节点,不显示下划线const allChildrenAreEnd =item.children.filter((c: any) => c.isEnd).length === item.children.length;if (allChildrenAreEnd) return false;// 如果子节点未展开,不显示下划线if (!item.show) return false;// 显示下划线的条件:有子节点、子节点处于展开状态、且有非末端节点return item.children.length > 0;
};const toggleNode = (item: any) => {if (item.children) {item.show = !item.show;}
};const handleStr = (item: any) => {const reg = /.{8}|.+$/g;return (item.name.match(reg).join("\n") + "\n" + `(${item.comNum + props.unit})`);
};const handleClick = (item: any) => {emit("treeclick", item);
};watch(() => props.list,(newList) => {if (newList) {const arr = newList.map((item) => {if (typeof item === "object" && item !== null) {return { ...item };}return item;});obj.value = arr;}},{ immediate: true, deep: true }
);
</script><style lang="scss" scoped>
* {margin: 0;padding: 0;
}.r1 {width: calc(max(1px, v-bind("r1Config.width || 100") * 1px));height: calc(max(1px, v-bind("r1Config.height || 30") * 1px));font-size: calc(max(1px, v-bind("r1Config.fontSize || 12") * 1px));color: v-bind("r1Config.color || '#fff'");font-family: v-bind("r1Config.fontFamily || 'sans-serif'");
}.r2 {width: calc(max(1px, v-bind("r2Config.width || 80") * 1px));height: calc(max(1px, v-bind("r2Config.height || 25") * 1px));font-size: calc(max(1px, v-bind("r2Config.fontSize || 11") * 1px));color: v-bind("r2Config.color || '#fff'");font-family: v-bind("r2Config.fontFamily || 'sans-serif'");
}.r3 {width: calc(max(1px, v-bind("r3Config.width || 60") * 1px));height: calc(max(1px, v-bind("r3Config.height || 20") * 1px));font-size: calc(max(1px, v-bind("r3Config.fontSize || 10") * 1px));color: v-bind("r3Config.color || '#fff'");font-family: v-bind("r3Config.fontFamily || 'sans-serif'");margin: 0 0;
}.end,
.end1,
.end2 {width: calc(max(1px, v-bind("endConfig.width || 50") * 1px));height: calc(max(1px, v-bind("endConfig.height || 20") * 1px));font-size: calc(max(1px, v-bind("endConfig.fontSize || 10") * 1px));color: v-bind("endConfig.color || '#fff'");font-family: v-bind("endConfig.fontFamily || 'sans-serif'");
}.end {&::before {content: "";width: calc(max(1px, v-bind("line1 || 25") * 1px));height: calc(max(1px, v-bind("lineWidth || 3") * 1px));position: absolute;bottom: 50%;left: 0%;transform: translateX(-50%);background-color: #1b63a6;z-index: -1;}
}.end1 {&:nth-of-type(odd)::before {content: "";width: calc(max(1px, v-bind("line1 || 25") * 1px));height: calc(max(1px, v-bind("lineWidth || 3") * 1px));position: absolute;bottom: 50%;left: 0%;transform: translateX(-50%);background-color: #1b63a6;z-index: -1;}&:nth-of-type(even)::before {content: "";width: calc(max(1px, v-bind("line1 || 25") * 1px));height: calc(max(1px, v-bind("lineWidth || 3") * 1px));position: absolute;bottom: 50%;left: 100%;transform: translateX(-50%);background-color: #1b63a6;z-index: -1;}
}.treeBox {display: flex;color: #fff;width: fit-content;
}.nodeBgname {width: 150px;height: calc(max(1px, (v-bind("line || 25") * 3) * 1px));display: flex;margin: 0 auto;img {width: 100%;height: 100%;}
}.bg {margin: 0 auto;position: absolute;left: 50%;transform: translateX(-50%);
}div {position: relative;word-break: break-all;white-space: pre-line;
}/* 下线条 */
.xia::after {content: "";width: calc(max(1px, v-bind("lineWidth || 3") * 1px));height: calc(max(1px, v-bind("line || 25") * 1px));position: absolute;left: 50%;top: 100%;transform: translateX(-50%);background-color: #1b63a6;z-index: -1;
}/* 上线条 */
.shang::before {content: "";width: calc(max(1px, v-bind("lineWidth || 3") * 1px));height: calc(max(1px, v-bind("line || 25") * 1px));position: absolute;top: calc(max(-1000px, v-bind("line || 25") * -1px));left: 50%;transform: translateX(-50%);background-color: #1b63a6;z-index: -1;
}.group::before {content: "";width: calc(max(1px, v-bind("lineWidth || 3") * 1px));height: calc(max(1px, v-bind("line || 25") * 1px));position: absolute;top: calc(max(-1000px, v-bind("line || 25") * -1px));left: 50%;transform: translateX(-50%);background-color: #1b63a6;
}.heng,
.zou {padding: 0 calc(max(1px, v-bind("gap || 20") * 1px));top: 50px;
}/* 横线条 */
.heng::after {content: "";width: 50%;height: calc(max(1px, v-bind("lineWidth || 3") * 1px));position: absolute;left: 50%;top: calc(max(-1000px, v-bind("line || 25") * -1px));background-color: #1b63a6;
}.zou::before {content: "";width: 50%;height: calc(max(1px, v-bind("lineWidth || 3") * 1px));position: absolute;left: 0;top: calc(max(-1000px, v-bind("line || 25") * -1px));background-color: #1b63a6;
}
</style>

直接复制可以使用~~~

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

如若内容造成侵权/违法违规/事实不符,请联系英文站点网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

百度智能云x中科大脑:「城市智能体」如何让城市更会思考

近日&#xff0c;2025中关村论坛系列活动——中关村人工智能与未来城市论坛在中关村国家自主创新示范区展示中心举办。论坛上&#xff0c;发布了应用范式创新升级成果、智能体产品、可信数据空间成果等。 中科大脑联合百度智能云等伙伴共同打造并发布21个智能体产品&#xff0c…

在职老D渗透日记day16:sqli-labs靶场通关(第24关)二次注入 sqlmap自动注入没跑出来。。。

5.24.2.sqlmap自动注入第一个&#xff1a;登录页面&#xff08;1&#xff09;pb抓取http头POST /sqli-labs/Less-24/login.php HTTP/1.1 Host: 192.168.10.106 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:141.0) Gecko/20100101 Firefox/141.0 Accept: text/ht…

Fanuc机器人EtherCAT通讯配置详解

1、EtherCAT简介EtherCAT&#xff0c;这一基于以太网的现场总线系统&#xff0c;以其开放架构和高速性能著称。CAT代表的是控制自动化技术&#xff08;Control Automation Technology&#xff09;的缩写&#xff0c;彰显了其在工业自动化领域的核心地位。作为确定性的工业以太网…

超酷炫的Three.js示例

今天写一个超级酷炫的Three.js示例&#xff0c;以下是文件源代码&#xff1a; <!DOCTYPE html> <html lang"en"> <head><meta charset"UTF-8" /><meta name"viewport" content"widthdevice-width, initial-sca…

从零开始大模型之实现GPT模型

从零开始大模型之从头实现GPT模型1.大语言模型整体架构2 大语言的Transformer模块2.1 层归一化2.2 GELU激活函数2.3 前馈神经网络2.4 快捷连接3 附录3.1 anacondapython环境搭建1.数据预处理&#xff1a;原始数据进行词元化&#xff0c;以及通过&#xff0c;依据词汇表生成ID编…

[1Prompt1Story] 滑动窗口机制 | 图像生成管线 | VAE变分自编码器 | UNet去噪神经网络

链接&#xff1a;https://github.com/byliutao/1Prompt1Story 这个项目是一个基于单个提示生成一致文本到图像的模型。它在ICLR 2025会议上获得了聚焦论文的地位。该项目提供了生成一致图像的代码、Gradio演示代码以及基准测试代码。 主要功能点: 使用单个提示生成一致的文本…

【GitHub开源AI精选】Sitcom-Crafter:北航联合港中文等高校打造的剧情驱动3D动作生成系统

系列篇章&#x1f4a5; No.文章1【GitHub开源AI精选】LLM 驱动的影视解说工具&#xff1a;Narrato AI 一站式高效创作实践2【GitHub开源AI精选】德国比勒费尔德大学TryOffDiff——高保真服装重建的虚拟试穿技术新突破3【GitHub开源AI精选】哈工大&#xff08;深圳&#xff09;…

智和信通全栈式运维平台落地深圳某学院,赋能运维管理提质提效

深圳某学院校园内信息化设备众多&#xff0c;网络环境复杂&#xff0c;使得网络管理工作面临着诸多难题与挑战。为保障校园网络能够稳定、高效地运行&#xff0c;学院亟须构建一套集高效、智能、协同于一体的网络运维平台。 对运维平台的期望包括&#xff1a; 实现校园内教学…

开疆智能Ethernet转ModbusTCP网关连接测联无纸记录仪配置案例

本案例是通过Ethernet转ModbusTCP网关将记录仪数据传送到欧姆龙PLC&#xff0c;具体操作过程如下。欧姆龙PLC配置首先打开主站组态软件“Sysmac Studio”并新建项目。设置PLC的IP地址点击工具-Ethernet/IP连接设置&#xff0c;在弹出的选个框内选择显示EDS库添加网关eds文件开始…

Eureka故障处理大汇总

#作者&#xff1a;Unstopabler 文章目录1. Eureka 服务启动故障处理1.1 端口占用导致启动失败1.2 配置文件错误导致启动失败1.3 依赖冲突与类加载错误2. 服务注册与发现异常2.1 服务无法注册到 Eureka2.2 Eureka 控制台看不到注册的服务2.3 服务注册后立即被剔除3. Eureka 集群…

基于Transformer的机器翻译——模型篇

1.模型结构 本案例整体采用transformer论文中提出的结构&#xff0c;部分设置做了调整。transformer网络结构介绍可参考博客——入门级别的Transformer模型介绍&#xff0c;这里着重介绍其代码实现。 模型的整体结构&#xff0c;包括词嵌入层&#xff0c;位置编码&#xff0c;…

上位机TCP/IP通信协议层常见问题汇总

以太网 TCP 通信是上位机开发中常用的通信方式&#xff0c;西门子 S7 通信、三菱 MC 通信以及 MQTT、OPC UA、Modbus TCP 等都是其典型应用。为帮助大家更好地理解 TCP 通信&#xff0c;我整理了一套常见问题汇总。一、OSI参考模型与TCP/IP参考模型基于TCP/IP的参考模型将协议分…

搭建ktg-mes

项目地址 该安装事项&#xff0c;基于当前最新版 2025年8月16日 之前的版本 下载地址&#xff1a; 后端JAVA 前端VUE 后端安装&#xff1a; 还原数据表 路径&#xff1a;根目录/sql/ry_20210908.sql、根目录/sql/quartz.sql、根目录/doc/实施文档/ktgmes-202505180846.sql.g…

uniapp纯前端绘制商品分享图

效果如图// useMpCustomShareImage.ts interface MpCustomShareImageData {canvasId: stringprice: stringlinePrice: stringgoodsSpecFirmName: stringimage: string }const CANVAS_WIDTH 500 const CANVAS_HEIGHT 400 const BG_IMAGE https://public-scjuchuang.oss-cn-ch…

醋酸镧:看不见的科技助力

虽然我们每天都在使用各种科技产品&#xff0c;但有些关键的化学物质却鲜为人知。醋酸镧&#xff0c;就是这样一种默默为科技进步贡献力量的“幕后英雄”。它不仅是稀土元素镧的一种化合物&#xff0c;还在许多高科技领域中发挥着重要作用。今天&#xff0c;让我们一起来了解这…

苍穹外卖日记

day 1 windows系统启动nginx报错: The system cannot find the path specified 在启动nginx的时候报错&#xff1a; /temp/client_body_temp" failed (3: The system cannot find the path specified) 解决办法&#xff1a; 1.检查nginx的目录是否存在中文 &#xff0c;路…

楼宇自控系统赋能建筑全维度管理,实现环境、安全与能耗全面监管

随着城市化进程加速和绿色建筑理念普及&#xff0c;现代楼宇管理正经历从粗放式运营向精细化管控的转型。楼宇自控系统&#xff08;BAS&#xff09;作为建筑智能化的核心载体&#xff0c;通过物联网、大数据和人工智能技术的深度融合&#xff0c;正在重构建筑管理的全维度框架&…

【HarmonyOS】Window11家庭中文版开启鸿蒙模拟器失败提示未开启Hyoer-V

【HarmonyOS】Window11家庭中文版开启鸿蒙模拟器失败提示未开启Hyoer-V一、问题背景 当鸿蒙模拟器启动时&#xff0c;提示如下图所示&#xff1a;因为Hyper-V 仅在 Windows 11 专业版、企业版和教育版中作为预装功能提供&#xff0c;而家庭版&#xff08;包括中文版&#xff09…

vscode远程服务器出现一直卡在正在打开远程和连接超时解决办法

项目场景&#xff1a; 使用ssh命令或者各种软件进行远程服务器之后&#xff0c;结果等到几分钟之后自动断开连接问题解决。vscode远程服务器一直卡在正在打开远程状态问题解决。问题描述 1.连接超时 2.vscode远程一直卡在正在打开远程...原因分析&#xff1a;需要修改设置超时断…

Maven下载和配置-IDEA使用

目录 一 MAVEN 二 三个仓库 1. 本地仓库&#xff08;Local Repository&#xff09; 2. 私有仓库&#xff08;Private Repository&#xff0c;公司内部仓库&#xff09; 3. 远程仓库&#xff08;Remote Repository&#xff09; 依赖查找流程&#xff08;优先级&#xff09…