element tree树形结构默认展开全部

背景:

el-tree树形结构,默认展开全部,使用属性default-expand-all【是否默认展开所有节点】;默认展开一级,设置default-expanded-keys【默认展开的节点的 key 的数组】属性值为数组。

因为我这里的数据第一级是四川【省下面的所有市级】,所以只需要把四川的node-key="pid"的值找出,即四川为 51,赋值给default-expanded-keys,那么default-expanded-keys=[51]就实现的下面右图的效果。

效果展示:

左图:默认展开全部,右图:展开一级

核心代码:

//:default-expand-all = "true"默认展开全部
//:default-expanded-keys="[51]"默认展开四川<el-treestyle="max-width: 600px":data="state.ferryPortList":props="state.defaultProps"@node-click="handleNodeClick"node-key="pid":default-expand-all = "true"/>

官网链接:点击跳转

写到这儿变完成了。。。以下是el-tree组件的一些属性说明:

一、el-tree组件的属性

 el-tree的属性及其含义:

:data="state.ferryPortList"

展示数据

 :props="state.defaultProps"

配置选项

defaultProps: {label: "name",value: "pid",},

node-key="pid" 

设置node-key属性,每个树节点用来作为唯一标识的属性,整棵树应该是唯一的。

例如:node-key="id" 或 node-key="pid" 

:default-expand-all = "true"

是否默认展开所有节点

:default-expanded-keys="state.expandedKeys" 

默认展开的节点的 key 的数组

 示例数据:

接口数据结构,一维数组:

//示例数据结构,对象数组,一维数组[{pid: 0,parentId: -1,name: "全部",type: -1,count: null,visible: null,geom: null,ferryPortAreaVos: [],portShipVoList: null,},{pid: 51,parentId: 0,name: "四川 (24)",type: 0,count: 24,visible: null,geom: "0101000000F7CC920035045A40BE839F3880923E40",ferryPortAreaVos: [],portShipVoList: null,},{pid: 5113,parentId: 51,name: "南充 (24)",type: 1,count: 24,visible: null,geom: "01010000000DE02D90A0845A40CFF753E3A5CB3E40",ferryPortAreaVos: [],portShipVoList: null,},{pid: 511302,parentId: 5113,name: "顺庆",type: 2,count: 0,visible: null,geom: "01010000000DE02D90A0845A40CFF753E3A5CB3E40",ferryPortAreaVos: [],portShipVoList: null,},{pid: 511303,parentId: 5113,name: "高坪",type: 2,count: 0,visible: null,geom: "0101000000B37BF2B050875A40F4FDD478E9C63E40",ferryPortAreaVos: [],portShipVoList: null,},{pid: 511304,parentId: 5113,name: "嘉陵",type: 2,count: 0,visible: null,geom: "0101000000C898BB9690835A40E17A14AE47C13E40",ferryPortAreaVos: [],portShipVoList: null,},{pid: 511321,parentId: 5113,name: "南部 (17)",type: 2,count: 17,visible: null,geom: "0101000000575BB1BFEC825A40643BDF4F8D573F40",ferryPortAreaVos: [{name: "仙家坟渡口",pid: 80,areaId: 511321,type: 100,ferryShipVoList: [],},{name: "太霞三岔河码头",pid: 78,areaId: 511321,type: 100,ferryShipVoList: [],},{name: "太霞乡西河码头",pid: 76,areaId: 511321,type: 100,ferryShipVoList: [],},{name: "富利镇宋家咀渡口(上)",pid: 70,areaId: 511321,type: 100,ferryShipVoList: [],},{name: "富利镇宋家咀渡口(下)",pid: 28,areaId: 511321,type: 100,ferryShipVoList: [{pid: 17,cname: null,name: "西充渡船",mmsi: null,carryPassengersNum: null,status: null,areaId: 511321,type: 101,speakerDto: null,},{pid: 29,cname: null,name: "富利渡船",mmsi: null,carryPassengersNum: null,status: null,areaId: 511321,type: 101,speakerDto: null,},],},{name: "李家岩渡口",pid: 79,areaId: 511321,type: 100,ferryShipVoList: [],},{name: "杨家洞渡口",pid: 74,areaId: 511321,type: 100,ferryShipVoList: [],},{name: "楠木镇泸溪场渡口(上)",pid: 67,areaId: 511321,type: 100,ferryShipVoList: [],},{name: "楠木镇泸溪场渡口(下)",pid: 71,areaId: 511321,type: 100,ferryShipVoList: [],},{name: "江石岭渡口",pid: 85,areaId: 511321,type: 100,ferryShipVoList: [],},{name: "河口上渡口",pid: 83,areaId: 511321,type: 100,ferryShipVoList: [],},{name: "观音岩渡口(上)",pid: 69,areaId: 511321,type: 100,ferryShipVoList: [],},{name: "观音岩渡口(下)",pid: 66,areaId: 511321,type: 100,ferryShipVoList: [],},{name: "金鸡河渡口",pid: 81,areaId: 511321,type: 100,ferryShipVoList: [],},{name: "陈家口渡口",pid: 86,areaId: 511321,type: 100,ferryShipVoList: [],},{name: "鲁家坝渡口",pid: 82,areaId: 511321,type: 100,ferryShipVoList: [],},{name: "麻溪寺渡口",pid: 84,areaId: 511321,type: 100,ferryShipVoList: [],},],portShipVoList: null,},{pid: 511322,parentId: 5113,name: "营山",type: 2,count: 0,visible: null,geom: "01010000002A3A92CB7FA45A403333333333133F40",ferryPortAreaVos: [],portShipVoList: null,},{pid: 511323,parentId: 5113,name: "蓬安 (5)",type: 2,count: 5,visible: null,geom: "010100000048E17A14AE9B5A40BEC1172653053F40",ferryPortAreaVos: [{name: "八字老渡口上",pid: 64,areaId: 511323,type: 100,ferryShipVoList: [{pid: 51,cname: null,name: "川蓬安渡0012",mmsi: null,carryPassengersNum: null,status: null,areaId: 511323,type: 101,speakerDto: null,},{pid: 52,cname: null,name: "川蓬安渡0011",mmsi: null,carryPassengersNum: null,status: null,areaId: 511323,type: 101,speakerDto: null,},],},{name: "八字老渡口下",pid: 63,areaId: 511323,type: 100,ferryShipVoList: [{pid: 51,cname: null,name: "川蓬安渡0012",mmsi: null,carryPassengersNum: null,status: null,areaId: 511323,type: 101,speakerDto: null,},{pid: 52,cname: null,name: "川蓬安渡0011",mmsi: null,carryPassengersNum: null,status: null,areaId: 511323,type: 101,speakerDto: null,},],},{name: "八字老渡口下(对岸)",pid: 68,areaId: 511323,type: 100,ferryShipVoList: [{pid: 51,cname: null,name: "川蓬安渡0012",mmsi: null,carryPassengersNum: null,status: null,areaId: 511323,type: 101,speakerDto: null,},],},{name: "史家坝渡口",pid: 62,areaId: 511323,type: 100,ferryShipVoList: [],},{name: "金坡梁村渡口",pid: 61,areaId: 511323,type: 100,ferryShipVoList: [{pid: 50,cname: null,name: "川蓬安客0050",mmsi: null,carryPassengersNum: null,status: null,areaId: 511323,type: 101,speakerDto: null,},],},],portShipVoList: null,},{pid: 511324,parentId: 5113,name: "仪陇",type: 2,count: 0,visible: null,geom: "01010000000C022B8716995A404A0C022B87863F40",ferryPortAreaVos: [],portShipVoList: null,},{pid: 511325,parentId: 5113,name: "西充",type: 2,count: 0,visible: null,geom: "01010000003108AC1C5A785A408FC2F5285CFF3E40",ferryPortAreaVos: [],portShipVoList: null,},{pid: 511381,parentId: 5113,name: "阆中 (2)",type: 2,count: 2,visible: null,geom: "010100000051DA1B7C617E5A400000000000903F40",ferryPortAreaVos: [{name: "犀牛渡口",pid: 59,areaId: 511381,type: 100,ferryShipVoList: [{pid: 49,cname: null,name: "川阆中渡0020",mmsi: null,carryPassengersNum: null,status: null,areaId: 511381,type: 101,speakerDto: null,},],},{name: "鞍子湾渡口",pid: 58,areaId: 511381,type: 100,ferryShipVoList: [{pid: 49,cname: null,name: "川阆中渡0020",mmsi: null,carryPassengersNum: null,status: null,areaId: 511381,type: 101,speakerDto: null,},],},],portShipVoList: null,},];

数据处理后,多维数组:

树形结构绑定的:data是经过处理之后的值,例如以下:

[{"pid": 51,"parentId": 0,"name": "四川 (24)","type": 0,"count": 24,"visible": null,"geom": "0101000000F7CC920035045A40BE839F3880923E40","ferryPortAreaVos": [],"portShipVoList": null,"children": [{"pid": 5113,"parentId": 51,"name": "南充 (24)","type": 1,"count": 24,"visible": null,"geom": "01010000000DE02D90A0845A40CFF753E3A5CB3E40","ferryPortAreaVos": [],"portShipVoList": null,"children": [{"pid": 511302,"parentId": 5113,"name": "顺庆","type": 2,"count": 0,"visible": null,"geom": "01010000000DE02D90A0845A40CFF753E3A5CB3E40","ferryPortAreaVos": [],"portShipVoList": null,"children": []},{"pid": 511303,"parentId": 5113,"name": "高坪","type": 2,"count": 0,"visible": null,"geom": "0101000000B37BF2B050875A40F4FDD478E9C63E40","ferryPortAreaVos": [],"portShipVoList": null,"children": []},{"pid": 511304,"parentId": 5113,"name": "嘉陵","type": 2,"count": 0,"visible": null,"geom": "0101000000C898BB9690835A40E17A14AE47C13E40","ferryPortAreaVos": [],"portShipVoList": null,"children": []},{"pid": 511321,"parentId": 5113,"name": "南部 (17)","type": 2,"count": 17,"visible": null,"geom": "0101000000575BB1BFEC825A40643BDF4F8D573F40","ferryPortAreaVos": [{"name": "仙家坟渡口","pid": 80,"areaId": 511321,"type": 100,"ferryShipVoList": []},{"name": "太霞三岔河码头","pid": 78,"areaId": 511321,"type": 100,"ferryShipVoList": []},{"name": "太霞乡西河码头","pid": 76,"areaId": 511321,"type": 100,"ferryShipVoList": []},{"name": "富利镇宋家咀渡口(上)","pid": 70,"areaId": 511321,"type": 100,"ferryShipVoList": []},{"name": "富利镇宋家咀渡口(下)","pid": 28,"areaId": 511321,"type": 100,"ferryShipVoList": [{"pid": 17,"cname": null,"name": "西充渡船","mmsi": null,"carryPassengersNum": null,"status": null,"areaId": 511321,"type": 101,"speakerDto": null},{"pid": 29,"cname": null,"name": "富利渡船","mmsi": null,"carryPassengersNum": null,"status": null,"areaId": 511321,"type": 101,"speakerDto": null}]},{"name": "李家岩渡口","pid": 79,"areaId": 511321,"type": 100,"ferryShipVoList": []},{"name": "杨家洞渡口","pid": 74,"areaId": 511321,"type": 100,"ferryShipVoList": []},{"name": "楠木镇泸溪场渡口(上)","pid": 67,"areaId": 511321,"type": 100,"ferryShipVoList": []},{"name": "楠木镇泸溪场渡口(下)","pid": 71,"areaId": 511321,"type": 100,"ferryShipVoList": []},{"name": "江石岭渡口","pid": 85,"areaId": 511321,"type": 100,"ferryShipVoList": []},{"name": "河口上渡口","pid": 83,"areaId": 511321,"type": 100,"ferryShipVoList": []},{"name": "观音岩渡口(上)","pid": 69,"areaId": 511321,"type": 100,"ferryShipVoList": []},{"name": "观音岩渡口(下)","pid": 66,"areaId": 511321,"type": 100,"ferryShipVoList": []},{"name": "金鸡河渡口","pid": 81,"areaId": 511321,"type": 100,"ferryShipVoList": []},{"name": "陈家口渡口","pid": 86,"areaId": 511321,"type": 100,"ferryShipVoList": []},{"name": "鲁家坝渡口","pid": 82,"areaId": 511321,"type": 100,"ferryShipVoList": []},{"name": "麻溪寺渡口","pid": 84,"areaId": 511321,"type": 100,"ferryShipVoList": []}],"portShipVoList": null,"children": [{"name": "仙家坟渡口","pid": 80,"areaId": 511321,"type": 100,"ferryShipVoList": []},{"name": "太霞三岔河码头","pid": 78,"areaId": 511321,"type": 100,"ferryShipVoList": []},{"name": "太霞乡西河码头","pid": 76,"areaId": 511321,"type": 100,"ferryShipVoList": []},{"name": "富利镇宋家咀渡口(上)","pid": 70,"areaId": 511321,"type": 100,"ferryShipVoList": []},{"name": "富利镇宋家咀渡口(下)","pid": 28,"areaId": 511321,"type": 100,"ferryShipVoList": [{"pid": 17,"cname": null,"name": "西充渡船","mmsi": null,"carryPassengersNum": null,"status": null,"areaId": 511321,"type": 101,"speakerDto": null},{"pid": 29,"cname": null,"name": "富利渡船","mmsi": null,"carryPassengersNum": null,"status": null,"areaId": 511321,"type": 101,"speakerDto": null}]},{"name": "李家岩渡口","pid": 79,"areaId": 511321,"type": 100,"ferryShipVoList": []},{"name": "杨家洞渡口","pid": 74,"areaId": 511321,"type": 100,"ferryShipVoList": []},{"name": "楠木镇泸溪场渡口(上)","pid": 67,"areaId": 511321,"type": 100,"ferryShipVoList": []},{"name": "楠木镇泸溪场渡口(下)","pid": 71,"areaId": 511321,"type": 100,"ferryShipVoList": []},{"name": "江石岭渡口","pid": 85,"areaId": 511321,"type": 100,"ferryShipVoList": []},{"name": "河口上渡口","pid": 83,"areaId": 511321,"type": 100,"ferryShipVoList": []},{"name": "观音岩渡口(上)","pid": 69,"areaId": 511321,"type": 100,"ferryShipVoList": []},{"name": "观音岩渡口(下)","pid": 66,"areaId": 511321,"type": 100,"ferryShipVoList": []},{"name": "金鸡河渡口","pid": 81,"areaId": 511321,"type": 100,"ferryShipVoList": []},{"name": "陈家口渡口","pid": 86,"areaId": 511321,"type": 100,"ferryShipVoList": []},{"name": "鲁家坝渡口","pid": 82,"areaId": 511321,"type": 100,"ferryShipVoList": []},{"name": "麻溪寺渡口","pid": 84,"areaId": 511321,"type": 100,"ferryShipVoList": []}]},{"pid": 511322,"parentId": 5113,"name": "营山","type": 2,"count": 0,"visible": null,"geom": "01010000002A3A92CB7FA45A403333333333133F40","ferryPortAreaVos": [],"portShipVoList": null,"children": []},{"pid": 511323,"parentId": 5113,"name": "蓬安 (5)","type": 2,"count": 5,"visible": null,"geom": "010100000048E17A14AE9B5A40BEC1172653053F40","ferryPortAreaVos": [{"name": "八字老渡口上","pid": 64,"areaId": 511323,"type": 100,"ferryShipVoList": [{"pid": 51,"cname": null,"name": "川蓬安渡0012","mmsi": null,"carryPassengersNum": null,"status": null,"areaId": 511323,"type": 101,"speakerDto": null},{"pid": 52,"cname": null,"name": "川蓬安渡0011","mmsi": null,"carryPassengersNum": null,"status": null,"areaId": 511323,"type": 101,"speakerDto": null}]},{"name": "八字老渡口下","pid": 63,"areaId": 511323,"type": 100,"ferryShipVoList": [{"pid": 51,"cname": null,"name": "川蓬安渡0012","mmsi": null,"carryPassengersNum": null,"status": null,"areaId": 511323,"type": 101,"speakerDto": null},{"pid": 52,"cname": null,"name": "川蓬安渡0011","mmsi": null,"carryPassengersNum": null,"status": null,"areaId": 511323,"type": 101,"speakerDto": null}]},{"name": "八字老渡口下(对岸)","pid": 68,"areaId": 511323,"type": 100,"ferryShipVoList": [{"pid": 51,"cname": null,"name": "川蓬安渡0012","mmsi": null,"carryPassengersNum": null,"status": null,"areaId": 511323,"type": 101,"speakerDto": null}]},{"name": "史家坝渡口","pid": 62,"areaId": 511323,"type": 100,"ferryShipVoList": []},{"name": "金坡梁村渡口","pid": 61,"areaId": 511323,"type": 100,"ferryShipVoList": [{"pid": 50,"cname": null,"name": "川蓬安客0050","mmsi": null,"carryPassengersNum": null,"status": null,"areaId": 511323,"type": 101,"speakerDto": null}]}],"portShipVoList": null,"children": [{"name": "八字老渡口上","pid": 64,"areaId": 511323,"type": 100,"ferryShipVoList": [{"pid": 51,"cname": null,"name": "川蓬安渡0012","mmsi": null,"carryPassengersNum": null,"status": null,"areaId": 511323,"type": 101,"speakerDto": null},{"pid": 52,"cname": null,"name": "川蓬安渡0011","mmsi": null,"carryPassengersNum": null,"status": null,"areaId": 511323,"type": 101,"speakerDto": null}]},{"name": "八字老渡口下","pid": 63,"areaId": 511323,"type": 100,"ferryShipVoList": [{"pid": 51,"cname": null,"name": "川蓬安渡0012","mmsi": null,"carryPassengersNum": null,"status": null,"areaId": 511323,"type": 101,"speakerDto": null},{"pid": 52,"cname": null,"name": "川蓬安渡0011","mmsi": null,"carryPassengersNum": null,"status": null,"areaId": 511323,"type": 101,"speakerDto": null}]},{"name": "八字老渡口下(对岸)","pid": 68,"areaId": 511323,"type": 100,"ferryShipVoList": [{"pid": 51,"cname": null,"name": "川蓬安渡0012","mmsi": null,"carryPassengersNum": null,"status": null,"areaId": 511323,"type": 101,"speakerDto": null}]},{"name": "史家坝渡口","pid": 62,"areaId": 511323,"type": 100,"ferryShipVoList": []},{"name": "金坡梁村渡口","pid": 61,"areaId": 511323,"type": 100,"ferryShipVoList": [{"pid": 50,"cname": null,"name": "川蓬安客0050","mmsi": null,"carryPassengersNum": null,"status": null,"areaId": 511323,"type": 101,"speakerDto": null}]}]},{"pid": 511324,"parentId": 5113,"name": "仪陇","type": 2,"count": 0,"visible": null,"geom": "01010000000C022B8716995A404A0C022B87863F40","ferryPortAreaVos": [],"portShipVoList": null,"children": []},{"pid": 511325,"parentId": 5113,"name": "西充","type": 2,"count": 0,"visible": null,"geom": "01010000003108AC1C5A785A408FC2F5285CFF3E40","ferryPortAreaVos": [],"portShipVoList": null,"children": []},{"pid": 511381,"parentId": 5113,"name": "阆中 (2)","type": 2,"count": 2,"visible": null,"geom": "010100000051DA1B7C617E5A400000000000903F40","ferryPortAreaVos": [{"name": "犀牛渡口","pid": 59,"areaId": 511381,"type": 100,"ferryShipVoList": [{"pid": 49,"cname": null,"name": "川阆中渡0020","mmsi": null,"carryPassengersNum": null,"status": null,"areaId": 511381,"type": 101,"speakerDto": null}]},{"name": "鞍子湾渡口","pid": 58,"areaId": 511381,"type": 100,"ferryShipVoList": [{"pid": 49,"cname": null,"name": "川阆中渡0020","mmsi": null,"carryPassengersNum": null,"status": null,"areaId": 511381,"type": 101,"speakerDto": null}]}],"portShipVoList": null,"children": [{"name": "犀牛渡口","pid": 59,"areaId": 511381,"type": 100,"ferryShipVoList": [{"pid": 49,"cname": null,"name": "川阆中渡0020","mmsi": null,"carryPassengersNum": null,"status": null,"areaId": 511381,"type": 101,"speakerDto": null}]},{"name": "鞍子湾渡口","pid": 58,"areaId": 511381,"type": 100,"ferryShipVoList": [{"pid": 49,"cname": null,"name": "川阆中渡0020","mmsi": null,"carryPassengersNum": null,"status": null,"areaId": 511381,"type": 101,"speakerDto": null}]}]}]}]}
]

多维数组,绑定给树结构。。。 

封装方法:

对接口的数据进行处理,把平面数组转树形结构:

/*** 平面数组转树形结构* @param data 平面数组* @param pid 树节点元素的id* @param idKey id字段* @param pidKey pid字段* @param sortKey 可选,排序字段* @returns {*[]}*/
export function arrayToTreeRec({data, pid = 0, idKey = 'id', pidKey = 'parent_id', sortKey = ''}) {const map = {};let tree = [];const d = JSON.parse(JSON.stringify(data))for (const item of d) {map[item[idKey]] = {...item, children: item.ferryPortAreaVos && item.ferryPortAreaVos.length ? item.ferryPortAreaVos : []};}for (const item of Object.values(map)) {if (item[pidKey] === pid) {tree.push(item);} else {map[item[pidKey]].children.push(item);if (sortKey) {map[item[pidKey]].children = map[item[pidKey]].children.sort((a, b) => a[sortKey] - b[sortKey])}}}if (sortKey) tree = tree.sort((a, b) => a[sortKey] - b[sortKey])return tree
}

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

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

相关文章

大数据-spark3.5安装部署之local模式

spark&#xff0c;一个数据处理框架和计算引擎。 下载 local模式即本地模式&#xff0c;就是不需要任何其他节点资源就可以在本地执行spark代码的环境。用于练习演示。 上传解压 使用PortX将文件上传至/opt 进入/opt目录&#xff0c;创建目录module&#xff0c;解压文件至/o…

Discuz建站教程之论坛头部logo跳转链接怎么修改?

在修改头部logo跳转链接前&#xff0c;我们需要知道对应代码在哪个文件目录&#xff0c;进入宝塔或是服务器&#xff0c;找到文件&#xff1a;\template\default\common\header.htm&#xff0c;编辑器打开&#xff0c;搜索以下代码&#xff0c;大概在135行 <a href"{i…

【FreeRTOS】FreeRTOS操作系统在嵌入式单片机上裸机移植

目录 一 RTOS概述 二 FreeRTOS移植 三 FreeRTOS使用 四 附录 一 RTOS概述 先了解一些基础概念,以下内容摘自FreeRTOS官网(FreeRTOS™ - FreeRTOS™): 【1】RTOS基础知识 实时操作系统 (RTOS) 是一种体积小巧、确定性强的计算机操作系统。 RTOS 通常用于需要在严格时间限…

编译支持 RKmpp 和 RGA 的 ffmpeg 源码

一、前言 RK3588 支持VPU硬件解码&#xff0c;需要rkmpp进行调用&#xff1b;支持2D图像加速&#xff0c;需要 RGA 进行调用。 这两个库均能通过 ffmpeg-rockchip 进行间接调用&#xff0c;编译时需要开启对应的功能。 二、依赖安装 编译ffmpeg前需要编译 rkmpp 和 RGA&#xf…

深度学习基础:线性代数本质2——线性组合、张成的空间与基

目录 一、线性组合 1. 用一个有趣的角度看向量坐标 2. 如果我们选择不同的基向量会怎样&#xff1f; 3. 线性组合 4. 张成的空间 ① 二维向量的张成的空间 ② 三维向量的张成的空间​编辑 5.线性相关 6.线性无关 7. 基的定义 一、线性组合 1. 用一个有趣的角度看向量坐…

openharmony5.0中HDF驱动框架源码梳理-服务管理接口

要想大概了解一个公司&#xff0c;我们可能只需要知道它的运行逻辑即可&#xff0c;例如我们只需要知道它有财务有研发有运营等&#xff0c;财务报销、研发负责产品等即可&#xff0c;但是如果想深入具体的了解的话我们就要了解都有什么部门(对象)、各部门都包含哪些职责(对象方…

Go语言环境搭建并执行第一个Go程序

目录 一、Windows环境搭建 二、vscode安装插件 三、运行第一个go程序 一、Windows环境搭建 下载Go&#xff1a;All releases - The Go Programming Language 这里是Windows搭建&#xff0c;选择的是windows-amd64.msi&#xff0c;也可以选择zip直接解压缩到指定目录 选择msi…

Netty基础—4.NIO的使用简介一

大纲 1.Buffer缓冲区 2.Channel通道 3.BIO编程 4.伪异步IO编程 5.改造程序以支持长连接 6.NIO三大核心组件 7.NIO服务端的创建流程 8.NIO客户端的创建流程 9.NIO优点总结 10.NIO问题总结 1.Buffer缓冲区 (1)Buffer缓冲区的作用 (2)Buffer缓冲区的4个核心概念 (3)使…

linux 命令 tail

tail 是 Linux 中用于查看文件末尾内容的命令&#xff0c;常用于日志监控和大文件快速浏览。以下是其核心用法及常见选项&#xff1a; 基本语法 tail [选项] 文件名 常用选项 显示末尾行数 -n <行数> 或 --lines<行数> 指定显示文件的最后若干行&#xff08;…

网络华为HCIA+HCIP数据链路层协议-以太网协议

以太网协议 以太网是当今现有局域网(Local Area Network,LAN)采用的最通用的通信协议标准&#xff0c;该标准定义了在局域网中采用的电缆类型和信号处理方法。以太网是建立在CSMA/CD(Carrier Sense Multiple Access/Collision Detection,载波监听多路访问/冲突检测)机制上的广…

缓存id路由页面返回,历史路由栈

功能需求 网页端需要做页面数据缓存&#xff08;vue动态路由数据缓存&#xff09;&#xff0c;可根据id值打开多个编辑详情页&#xff0c;需要在页面操作返回时关闭面包屑页签 隐藏问题 1.页面缓存会有初始化和组件激活访问生命周期调用数据接口过多&#xff0c;有性能损耗 2.使…

mingw工具源码编译

ming-w64 mingw编译生成的库&#xff0c;需要mingw的lib文件支持。 https://github.com/mingw-w64/mingw-w64 使用msys2的bash git checkout v8.0.3 ./configure --disable-dependency-tracking --targetx86_64-w64-mingw32 mingw32-make.exe -j4 修改makefile中的make 改成mi…

使用OpenCV和MediaPipe库——抽烟检测(姿态监控)

目录 抽烟检测的运用 1. 安全监控 (1) 公共场所禁烟监管 (2) 工业安全 2. 智能城市与执法 (1) 城市违章吸烟检测 (2) 无人值守管理 3. 健康管理与医疗 (1) 吸烟习惯分析 (2) 远程监护 4. AI 监控与商业分析 (1) 保险行业 (2) 商场营销 5. 技术实现 (1) 计算机视…

大数据学习(66)- CDH管理平台

&#x1f34b;&#x1f34b;大数据学习&#x1f34b;&#x1f34b; &#x1f525;系列专栏&#xff1a; &#x1f451;哲学语录: 用力所能及&#xff0c;改变世界。 &#x1f496;如果觉得博主的文章还不错的话&#xff0c;请点赞&#x1f44d;收藏⭐️留言&#x1f4dd;支持一…

Python字符串高效优化策略:特定编码 -> Unicode码点 -> UTF-8(可自定义)

Python利用唯一uni-pot中介打理&#xff0c;任意制式输出&#xff08;首选uyf-8&#xff09;。 笔记模板由python脚本于2025-03-14 23:37:04创建&#xff0c;本篇笔记适合喜欢探究字符串编码细节的coder翻阅。 【学习的细节是欢悦的历程】 博客的核心价值&#xff1a;在于输出思…

Linux自动化构建工具—make/makeflie

目录 1、为什么我们需要make和makefile 2、makefile文件的基本语法 makefile文件的语法和make指令的用法 定义变量 3、PHONY关键字 .PHONY 的语法 为什么需要.PHONY&#xff1f; 1、为什么我们需要make和makefile make 和 Makefile 是软件开发中用于自动化构建和管理代…

使用DeepSeek完成一个简单嵌入式开发

开启DeepSeek对话 请帮我使用Altium Designer设计原理图、PCB&#xff0c;使用keil完成代码编写&#xff1b;要求&#xff1a;使用stm32F103RCT6为主控芯片&#xff0c;控制3个流水灯的原理图 这里需要注意&#xff0c;每次DeepSeek的回答都不太一样。 DeepSeek回答 以下是使…

OSPF-2 邻接建立关系

上一期我们说了OSPF的邻居建立关系以及OSPF邻居关系建立中建立失败的因素以及相关实验案例 这一期我们来说说OSPF的邻接关系建立时需要交互哪些报文以及失败因素及原因和相关实验案例 一、概述 在运行了OSPF的网络当中为了交互链路状态信息和路由信息,互相之间需要建立邻接关…

app.config.globalProperties

目录 一:基础使用 1、简介 2、使用 3、打印结果: 二:封装 1、创建一个.ts文件(utils/msg.ts) 2、在main.ts中全局注册 3、在页面中使用 4、打印结果 一:基础使用 1、简介 app.config.globalProperties 是 Vue 3 应用实例&#xff08;app&#xff09;的一个配置属性&…

初探大模型开发:使用 LangChain 和 DeepSeek 构建简单 Demo

最近&#xff0c;我开始接触大模型开发&#xff0c;并尝试使用 LangChain 和 DeepSeek 构建了一个简单的 Demo。通过这个 Demo&#xff0c;我不仅加深了对大模型的理解&#xff0c;还体验到了 LangChain 和 DeepSeek 的强大功能。下面&#xff0c;我将分享我的开发过程以及一些…