基于ElementUI封装的下拉树选择可搜索单选多选清空功能
效果:

组件代码
/*** 树形下拉选择组件,下拉框展示树形结构,提供选择某节点功能,方便其他模块调用* @author wy* @date 2024-01-03 * 调用示例:* <tree-select * :height="400" // 下拉框中树形高度* :width="200" // 下拉框中树形宽度* :isFilter="true" //是否出现树结构搜索过滤* size="small" // 输入框的尺寸: medium/small/mini* :data="data" // 树结构的数据* :defaultProps="defaultProps" // 树结构的props* multiple // 多选* :inputWidth='250' //输入框的长度 Number* clearable // 可清空选择* collapseTags // 多选时将选中值按文字的形式展示* checkStrictly // 多选时,严格遵循父子不互相关联* :nodeKey="nodeKey" // 绑定nodeKey,默认绑定'id'* :checkedKeys="defaultCheckedKeys" // 传递默认选中的节点key组成的数组* @popoverHide="popoverHide"> // 事件有两个参数:第一个是所有选中的节点ID,第二个是所有选中的节点数据* </tree-select>
*/
<template><div><divv-show="isShowSelect"class="mask"@click="isShowSelect = !isShowSelect"/><el-popoverv-model="isShowSelect"placement="bottom-start":width="width"trigger="manual"style="padding: 12px 0"@hide="popoverHide"><el-input v-if="isFilter" placeholder="输入关键字进行过滤" size="mini" v-model="filterText"></el-input><el-treeref="tree"class="common-tree":style="style":data="data":props="defaultProps":show-checkbox="multiple":node-key="nodeKey":check-strictly="checkStrictly"default-expand-all:filter-node-method="filterNode":expand-on-click-node="false":check-on-click-node="multiple":highlight-current="true"@node-click="handleNodeClick"@check-change="handleCheckChange"/><el-selectslot="reference"ref="select"v-model="selectedData":style="selectStyle":size="size":multiple="multiple":clearable="clearable":collapse-tags="collapseTags"class="tree-select"@click.native="isShowSelect = !isShowSelect"@remove-tag="removeSelectedNodes"@clear="removeSelectedNode"@change="changeSelectedNodes"><el-optionv-for="item in options":key="item.value":label="item.label":value="item.value"/></el-select></el-popover></div>
</template><script>
export default {props: {// 树结构数据data: {type: Array,default() {return [];},},defaultProps: {type: Object,default() {return {children: "children",label: "name",};},},// 配置是否可多选multiple: {type: Boolean,default() {return false;},},// 配置是否可清空选择clearable: {type: Boolean,default() {return false;},},// 配置多选时是否将选中值按文字的形式展示collapseTags: {type: Boolean,default() {return false;},},//唯一key值nodeKey: {type: String,default() {return "id";},},// 显示复选框情况下,是否严格遵循父子不互相关联checkStrictly: {type: Boolean,default() {return false;},},// 默认选中的节点key数组checkedKeys: {type: Array,default() {return [];},},// 输入框的尺寸size: {type: String,default() {return "medium";},},// 总体宽度width: {type: Number,default() {return 250;},},// 输入框的宽度inputWidth: {type: Number,default() {return 150;},},// 下拉框的高度height: {type: Number,default() {return 300;},},// 是否具有过滤搜索功能isFilter: {type: Boolean,default() {return true;},},},data() {return {filterText: "", //树搜索isShowSelect: false, // 是否显示树状选择器options: [],selectedData: [], // 选中的节点style: "width:" + this.width + "px;" + "height:" + this.height + "px;",selectStyle: "width:" + this.inputWidth + "px;",checkedIds: [],checkedData: [],};},watch: {filterText(val) {this.$refs.tree.filter(val);},// eslint-disable-next-line no-unused-varsisShowSelect(val) {// 隐藏select自带的下拉框this.$refs.select.blur();},checkedKeys(val) {console.log("checkedKeys", val);if (!val) return;// eslint-disable-next-line vue/no-mutating-propsthis.checkedKeys = val;this.initCheckedData();},},mounted() {this.initCheckedData();},methods: {//过滤函数filterNode(value, data) {if (!value) return true;return data[this.defaultProps.label].indexOf(value) !== -1;},// 单选时点击tree节点,设置select选项setSelectOption(node) {// console.log("~~~~~",node)const tmpMap = {};tmpMap.value = node.key;tmpMap.label = node.label;this.options = [];this.options.push(tmpMap);this.selectedData = node.key;},// 单选,选中传进来的节点checkSelectedNode(checkedKeys) {var item = checkedKeys[0];this.$refs.tree.setCurrentKey(item);var node = this.$refs.tree.getNode(item);// console.log("checkSelectedNode",this.$refs.tree)this.setSelectOption(node);},// 多选,勾选上传进来的节点checkSelectedNodes(checkedKeys) {// this.$refs.tree.setCheckedKeys(checkedKeys)// console.log("checkSelectedNodes-checkedKeys",checkedKeys)// 优化select回显显示 有个延迟的效果const that = this;setTimeout(function () {that.$refs.tree.setCheckedKeys(checkedKeys);}, 10);this.$forceUpdate();// console.log('checkSelectedNodes', this.selectedData)},// 单选,清空选中clearSelectedNode() {this.selectedData = [];this.$refs.tree.setCurrentKey(null);},// 多选,清空所有勾选clearSelectedNodes() {var checkedKeys = this.$refs.tree.getCheckedKeys(); // 所有被选中的节点的 key 所组成的数组数据for (let i = 0; i < checkedKeys.length; i++) {this.$refs.tree.setChecked(checkedKeys[i], false);}},// 在组件初始化时,根据传递的默认选中节点信息,设置树形结构中的节点的选中状态。initCheckedData() {if (this.multiple) {// 多选// console.log(this.checkedKeys.length)if (this.checkedKeys.length > 0) {this.checkSelectedNodes(this.checkedKeys);} else {this.clearSelectedNodes();}} else {// 单选if (this.checkedKeys.length > 0) {this.checkSelectedNode(this.checkedKeys);} else {this.clearSelectedNode();}}},popoverHide() {if (this.multiple) {this.checkedIds = this.$refs.tree.getCheckedKeys(); // 所有被选中的节点的 key 所组成的数组数据this.checkedData = this.$refs.tree.getCheckedNodes(); // 所有被选中的节点所组成的数组数据} else {this.checkedIds = this.$refs.tree.getCurrentKey();this.checkedData = this.$refs.tree.getCurrentNode();}this.$emit("popoverHide", this.checkedIds, this.checkedData);},// 单选,节点被点击时的回调,返回被点击的节点数据handleNodeClick(data, node) {if (!this.multiple) {this.setSelectOption(node);this.isShowSelect = !this.isShowSelect;this.$emit("change", this.selectedData);}},// 多选,节点勾选状态发生变化时的回调handleCheckChange() {var checkedKeys = this.$refs.tree.getCheckedKeys(); // 所有被选中的节点的 key 所组成的数组数据this.options = checkedKeys.map((item) => {var node = this.$refs.tree.getNode(item); // 所有被选中的节点对应的nodeconst tmpMap = {};tmpMap.value = node.key;tmpMap.label = node.label;return tmpMap;});this.selectedData = this.options.map((item) => {return item.value;});this.$emit("change", this.selectedData);},// 多选,删除任一select选项的回调removeSelectedNodes(val) {this.$refs.tree.setChecked(val, false);var node = this.$refs.tree.getNode(val);if (!this.checkStrictly && node.childNodes.length > 0) {this.treeToList(node).map((item) => {if (item.childNodes.length <= 0) {this.$refs.tree.setChecked(item, false);}});this.handleCheckChange();}this.$emit("change", this.selectedData);},treeToList(tree) {var queen = [];var out = [];queen = queen.concat(tree);while (queen.length) {var first = queen.shift();if (first.childNodes) {queen = queen.concat(first.childNodes);}out.push(first);}return out;},// 单选,清空select输入框的回调removeSelectedNode() {this.clearSelectedNode();this.$emit("change", this.selectedData);},// 选中的select选项改变的回调changeSelectedNodes(selectedData) {// 多选,清空select输入框时,清除树勾选if (this.multiple && selectedData.length <= 0) {this.clearSelectedNodes();}this.$emit("change", this.selectedData);},},
};
</script>
<style scoped>
.mask {width: 100%;height: 100%;position: fixed;top: 0;left: 0;opacity: 0;z-index: 11;
}.common-tree {overflow: auto;
}.tree-select {z-index: 111;
}
</style>
参数方法说明
| 属性 | 说明 |
|---|---|
| height | 下拉框中树形高度 height=“400” |
| width | 下拉框中树形宽度 width =“400” |
| isFilter | 是否出现树结构搜索过滤 默认为true |
| size | 输入框的尺寸: medium/small/mini |
| data | 树结构的数据 |
| defaultProps | 树结构的props,树结构说明 |
| multiple | 是否多选 |
| inputWidth | 输入框的长度 Number |
| clearable | 是否可清空选择 |
| collapseTags | 多选时将选中值按文字的形式展示 |
| checkStrictly | 多选时,严格遵循父子不互相关联 |
| nodeKey | 绑定nodeKey,默认绑定’id’ |
| checkedKeys | 传递默认选中的节点key组成的数组 |
| @popoverHide=“popoverHide” | 事件有两个参数:第一个是所有选中的节点ID,第二个是所有选中的节点数据 |
| @change=“clearKey” | 当选项改变时触发 |
组件使用包含模拟数据
<template><div><HSKselectev-model="workName":inputWidth="250":data="treeData"v-show="dialogFormVisible"style="'width: 100%'":checkedKeys="defaultCheckedKeys"@change="clearKey":isFilter="isFilter"clearable:multiple="multiple"@popoverHide="onCateSelect"></HSKselecte></div>
</template>
<script>
// import selectTree from "@/package/hsk-treeSelect/index.vue";
import HSKselecte from "../package/hsk-treeSelect/index.vue";
export default {data() {return {isFilter:true,multiple:true,radio1:'',workName:'',dialogFormVisible: true,selectType: "sigle",defaultCheckedKeys: [],defaultExpandedKeys: [],checkedKeys: [],treeData: [{id: "platform-1651478710725455875",parentId: null,name: "基础信息",identification: null,url: null,sortNo: null,menuType: "0",permissionGroupId: null,checkFlag: null,platformId: null,children: [{id: "1",parentId: "0",name: "生产单位管理",identification: null,url: "/workUnit",sortNo: "1",menuType: "1",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [{id: "6",parentId: "1",name: "生产单位",identification: null,url: "workUnit",sortNo: "1",menuType: "2",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [{id: "pagInfo-1",parentId: "6",name: "车间管理",identification: null,url: null,sortNo: null,menuType: "3",permissionGroupId: null,checkFlag: null,platformId: null,children: [{id: "17",parentId: "pagInfo-1",name: "新增",identification:"basic:productionUnitManagement:productionUnit:addworkshop",url: null,sortNo: "1",menuType: "4",permissionGroupId: "1",checkFlag: true,platformId: "1651478710725455875",children: [],},{id: "18",parentId: "pagInfo-1",name: "修改",identification:"basic:productionUnitManagement:productionUnit:editshop",url: null,sortNo: "2",menuType: "4",permissionGroupId: "1",checkFlag: true,platformId: "1651478710725455875",children: [],},{id: "19",parentId: "pagInfo-1",name: "删除",identification:"basic:productionUnitManagement:productionUnit:deleteshop",url: null,sortNo: "3",menuType: "4",permissionGroupId: "1",checkFlag: true,platformId: "1651478710725455875",children: [],},{id: "20",parentId: "pagInfo-1",name: "设置状态",identification:"basic:productionUnitManagement:productionUnit:editshopstatus",url: null,sortNo: "4",menuType: "4",permissionGroupId: "1",checkFlag: true,platformId: "1651478710725455875",children: [],},],},{id: "pagInfo-2",parentId: "6",name: "工作中心管理",identification: null,url: null,sortNo: null,menuType: "3",permissionGroupId: null,checkFlag: null,platformId: null,children: [{id: "21",parentId: "pagInfo-2",name: "新增",identification:"basic:productionUnitManagement:productionUnit:addworkcenter",url: null,sortNo: "5",menuType: "4",permissionGroupId: "2",checkFlag: true,platformId: "1651478710725455875",children: [],},{id: "22",parentId: "pagInfo-2",name: "修改",identification:"basic:productionUnitManagement:productionUnit:editworkcenter",url: null,sortNo: "6",menuType: "4",permissionGroupId: "2",checkFlag: true,platformId: "1651478710725455875",children: [],},{id: "23",parentId: "pagInfo-2",name: "删除",identification:"basic:productionUnitManagement:productionUnit:deleteworkcenter",url: null,sortNo: "7",menuType: "4",permissionGroupId: "2",checkFlag: true,platformId: "1651478710725455875",children: [],},{id: "24",parentId: "pagInfo-2",name: "设置状态",identification:"basic:productionUnitManagement:productionUnit:editworkcenterstatus",url: null,sortNo: "8",menuType: "4",permissionGroupId: "2",checkFlag: true,platformId: "1651478710725455875",children: [],},],},{id: "pagInfo-3",parentId: "6",name: "产线管理",identification: null,url: null,sortNo: null,menuType: "3",permissionGroupId: null,checkFlag: null,platformId: null,children: [{id: "25",parentId: "pagInfo-3",name: "新增",identification:"basic:productionUnitManagement:productionUnit:addproductionline",url: null,sortNo: "9",menuType: "4",permissionGroupId: "3",checkFlag: true,platformId: "1651478710725455875",children: [],},{id: "26",parentId: "pagInfo-3",name: "修改",identification:"basic:productionUnitManagement:productionUnit:editproductionline",url: null,sortNo: "10",menuType: "4",permissionGroupId: "3",checkFlag: true,platformId: "1651478710725455875",children: [],},{id: "27",parentId: "pagInfo-3",name: "删除",identification:"basic:productionUnitManagement:productionUnit:deleteproductionline",url: null,sortNo: "11",menuType: "4",permissionGroupId: "3",checkFlag: true,platformId: "1651478710725455875",children: [],},{id: "28",parentId: "pagInfo-3",name: "设置状态",identification:"basic:productionUnitManagement:productionUnit:editproductionlinestatus",url: null,sortNo: "12",menuType: "4",permissionGroupId: "3",checkFlag: true,platformId: "1651478710725455875",children: [],},],},{id: "pagInfo-4",parentId: "6",name: "设备管理",identification: null,url: null,sortNo: null,menuType: "3",permissionGroupId: null,checkFlag: null,platformId: null,children: [{id: "29",parentId: "pagInfo-4",name: "绑定",identification:"basic:productionUnitManagement:productionUnit:bindequipment",url: null,sortNo: "13",menuType: "4",permissionGroupId: "4",checkFlag: true,platformId: "1651478710725455875",children: [],},{id: "30",parentId: "pagInfo-4",name: "解绑",identification:"basic:productionUnitManagement:productionUnit:unbindequipment",url: null,sortNo: "14",menuType: "4",permissionGroupId: "4",checkFlag: true,platformId: "1651478710725455875",children: [],},],},],},{id: "7",parentId: "1",name: "设备保养计划",identification: null,url: "maintenancePlan",sortNo: "2",menuType: "2",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [{id: "31",parentId: "7",name: "新增",identification:"basic:productionUnitManagement:maintenancePlan:addPlan",url: null,sortNo: "1",menuType: "4",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [],},{id: "32",parentId: "7",name: "修改",identification:"basic:productionUnitManagement:maintenancePlan:editPlan",url: null,sortNo: "2",menuType: "4",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [],},{id: "33",parentId: "7",name: "删除",identification:"basic:productionUnitManagement:maintenancePlan:deletePlan",url: null,sortNo: "3",menuType: "4",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [],},{id: "39",parentId: "7",name: "导入模板",identification:"basic:productionUnitManagement:maintenancePlan:importPlan",url: null,sortNo: "5",menuType: "4",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [],},{id: "97",parentId: "7",name: "查看详情",identification:"basic:productionUnitManagement:maintenancePlan:detailPlan",url: null,sortNo: "6",menuType: "4",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [],},],},{id: "8",parentId: "1",name: "设备管理",identification: null,url: "equipment",sortNo: "3",menuType: "2",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [{id: "34",parentId: "8",name: "新增",identification:"basic:productionUnitManagement:equipmentUnit:addequipment",url: null,sortNo: "1",menuType: "4",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [],},{id: "35",parentId: "8",name: "修改",identification:"basic:productionUnitManagement:equipmentUnit:editequipment",url: null,sortNo: "2",menuType: "4",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [],},{id: "36",parentId: "8",name: "删除",identification:"basic:productionUnitManagement:equipmentUnit:deleteequipment",url: null,sortNo: "3",menuType: "4",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [],},{id: "37",parentId: "8",name: "设置状态",identification:"basic:productionUnitManagement:equipmentUnit:editequipmentstatus",url: null,sortNo: "4",menuType: "4",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [],},{id: "41",parentId: "8",name: "导入模板",identification:"basic:productionUnitManagement:equipmentUnit:importtemplate",url: null,sortNo: "6",menuType: "4",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [],},],},],},{id: "2",parentId: "0",name: "用户权限管理",identification: null,url: "/user",sortNo: "2",menuType: "1",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [{id: "9",parentId: "2",name: "用户管理",identification: null,url: "user",sortNo: "1",menuType: "2",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [{id: "pagInfo-5",parentId: "9",name: "部门管理",identification: null,url: null,sortNo: null,menuType: "3",permissionGroupId: null,checkFlag: null,platformId: null,children: [{id: "42",parentId: "pagInfo-5",name: "新增",identification: "basic:userManage:depart:addDept",url: null,sortNo: "1",menuType: "4",permissionGroupId: "5",checkFlag: true,platformId: "1651478710725455875",children: [],},{id: "43",parentId: "pagInfo-5",name: "修改",identification: "basic:userManage:depart:editDept",url: null,sortNo: "2",menuType: "4",permissionGroupId: "5",checkFlag: true,platformId: "1651478710725455875",children: [],},{id: "44",parentId: "pagInfo-5",name: "删除",identification: "basic:userManage:depart:deleteDept",url: null,sortNo: "3",menuType: "4",permissionGroupId: "5",checkFlag: true,platformId: "1651478710725455875",children: [],},],},{id: "pagInfo-6",parentId: "9",name: "用户管理",identification: null,url: null,sortNo: null,menuType: "3",permissionGroupId: null,checkFlag: null,platformId: null,children: [{id: "45",parentId: "pagInfo-6",name: "新增",identification: "basic:userManage:user:adduser",url: null,sortNo: "4",menuType: "4",permissionGroupId: "6",checkFlag: true,platformId: "1651478710725455875",children: [],},{id: "46",parentId: "pagInfo-6",name: "修改",identification: "basic:userManage:user:edituser",url: null,sortNo: "5",menuType: "4",permissionGroupId: "6",checkFlag: true,platformId: "1651478710725455875",children: [],},{id: "47",parentId: "pagInfo-6",name: "删除",identification: "basic:userManage:user:deleteuser",url: null,sortNo: "6",menuType: "4",permissionGroupId: "6",checkFlag: true,platformId: "1651478710725455875",children: [],},{id: "48",parentId: "pagInfo-6",name: "设置状态",identification:"basic:userManage:user:edituserstatus",url: null,sortNo: "7",menuType: "4",permissionGroupId: "6",checkFlag: true,platformId: "1651478710725455875",children: [],},{id: "49",parentId: "pagInfo-6",name: "分配角色",identification: "basic:userManage:user:assignroles",url: null,sortNo: "8",menuType: "4",permissionGroupId: "6",checkFlag: true,platformId: "1651478710725455875",children: [],},{id: "50",parentId: "pagInfo-6",name: "重置密码",identification: "basic:userManage:user:userrepaw",url: null,sortNo: "9",menuType: "4",permissionGroupId: "6",checkFlag: true,platformId: "1651478710725455875",children: [],},{id: "52",parentId: "pagInfo-6",name: "导入模板",identification:"basic:userManage:user:importtemplate",url: null,sortNo: "11",menuType: "4",permissionGroupId: "6",checkFlag: true,platformId: "1651478710725455875",children: [],},],},],},{id: "10",parentId: "2",name: "角色管理",identification: null,url: "role",sortNo: "2",menuType: "2",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [{id: "53",parentId: "10",name: "分配权限",identification: "basic:roleManage:role:assignauthority",url: null,sortNo: "1",menuType: "4",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [],},{id: "54",parentId: "10",name: "新增",identification: "basic:roleManage:role:addrole",url: null,sortNo: "2",menuType: "4",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [],},{id: "55",parentId: "10",name: "修改",identification: "basic:roleManage:role:editrole",url: null,sortNo: "3",menuType: "4",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [],},{id: "56",parentId: "10",name: "删除",identification: "basic:roleManage:role:deleterole",url: null,sortNo: "4",menuType: "4",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [],},],},],},{id: "3",parentId: "0",name: "生产物料管理",identification: null,url: "/material",sortNo: "3",menuType: "1",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [{id: "11",parentId: "3",name: "物料管理",identification: null,url: "material",sortNo: "1",menuType: "2",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [{id: "57",parentId: "11",name: "新增",identification:"basic:materialUnitManagement:materialUnit:addmaterial",url: null,sortNo: "1",menuType: "4",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [],},{id: "58",parentId: "11",name: "修改",identification:"basic:materialUnitManagement:materialUnit:editmaterial",url: null,sortNo: "2",menuType: "4",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [],},{id: "59",parentId: "11",name: "删除",identification:"basic:materialUnitManagement:materialUnit:deletematerial",url: null,sortNo: "3",menuType: "4",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [],},{id: "61",parentId: "11",name: "导入模板",identification:"basic:materialUnitManagement:materialUnit:importmaterial",url: null,sortNo: "5",menuType: "4",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [],},{id: "62",parentId: "11",name: "导出",identification:"basic:materialUnitManagement:materialUnit:exportmaterial",url: null,sortNo: "6",menuType: "4",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [],},{id: "98",parentId: "11",name: "新增bom",identification:"basic:materialUnitManagement:bomUnit:addbom",url: null,sortNo: "7",menuType: "4",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [],},{id: "99",parentId: "11",name: "修改bom",identification:"basic:materialUnitManagement:bomUnit:editbom",url: null,sortNo: "8",menuType: "4",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [],},{id: "100",parentId: "11",name: "新增工艺路线",identification:"basic:materialUnitManagement:processrouteUnit:addprocessroute",url: null,sortNo: "9",menuType: "4",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [],},{id: "101",parentId: "11",name: "修改工艺路线",identification:"basic:materialUnitManagement:processrouteUnit:editprocessroute",url: null,sortNo: "10",menuType: "4",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [],},],},{id: "12",parentId: "3",name: "BOM管理",identification: null,url: "bom",sortNo: "2",menuType: "2",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [{id: "63",parentId: "12",name: "新增",identification:"basic:materialUnitManagement:bomUnit:addbom",url: null,sortNo: "1",menuType: "4",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [],},{id: "64",parentId: "12",name: "修改",identification:"basic:materialUnitManagement:bomUnit:editbom",url: null,sortNo: "2",menuType: "4",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [],},{id: "65",parentId: "12",name: "删除",identification:"basic:materialUnitManagement:bomUnit:deletebom",url: null,sortNo: "3",menuType: "4",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [],},{id: "67",parentId: "12",name: "导入模板",identification:"basic:materialUnitManagement:bomUnit:importbom",url: null,sortNo: "5",menuType: "4",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [],},{id: "68",parentId: "12",name: "设置状态",identification:"basic:materialUnitManagement:bomUnit:editbomstatus",url: null,sortNo: "6",menuType: "4",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [],},],},{id: "13",parentId: "3",name: "工艺路线管理",identification: null,url: "processRoute",sortNo: "3",menuType: "2",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [{id: "69",parentId: "13",name: "新增",identification:"basic:materialUnitManagement:processrouteUnit:addprocessroute",url: null,sortNo: "1",menuType: "4",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [],},{id: "70",parentId: "13",name: "修改",identification:"basic:materialUnitManagement:processrouteUnit:editprocessroute",url: null,sortNo: "2",menuType: "4",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [],},{id: "71",parentId: "13",name: "删除",identification:"basic:materialUnitManagement:processrouteUnit:deleteprocessroute",url: null,sortNo: "3",menuType: "4",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [],},{id: "72",parentId: "13",name: "设置状态",identification:"basic:materialUnitManagement:processrouteUnit:editprocessroutestatus",url: null,sortNo: "4",menuType: "4",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [],},{id: "74",parentId: "13",name: "导入模板",identification:"basic:materialUnitManagement:processrouteUnit:importprocessroute",url: null,sortNo: "6",menuType: "4",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [],},],},{id: "14",parentId: "3",name: "工艺管理",identification: null,url: "technology",sortNo: "4",menuType: "2",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [{id: "75",parentId: "14",name: "新增",identification: "basic:technologyManage:technology:add",url: null,sortNo: "1",menuType: "4",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [],},{id: "76",parentId: "14",name: "修改",identification: "basic:technologyManage:technology:edit",url: null,sortNo: "2",menuType: "4",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [],},{id: "77",parentId: "14",name: "删除",identification:"basic:technologyManage:technology:delete",url: null,sortNo: "3",menuType: "4",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [],},{id: "78",parentId: "14",name: "设置状态",identification:"basic:technologyManage:technology:edittechnologystatus",url: null,sortNo: "4",menuType: "4",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [],},{id: "80",parentId: "14",name: "导入模板",identification:"basic:technologyManage:technology:importtemplate",url: null,sortNo: "6",menuType: "4",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [],},],},],},{id: "4",parentId: "0",name: "生产日历管理",identification: null,url: "/calendar",sortNo: "4",menuType: "1",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [{id: "15",parentId: "4",name: "工作日历",identification: null,url: "calendar",sortNo: "1",menuType: "2",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [{id: "81",parentId: "15",name: "新增",identification:"basic:calendarUnitManagement:calendarUnit:addcalendar",url: null,sortNo: "1",menuType: "4",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [],},{id: "82",parentId: "15",name: "修改",identification:"basic:calendarUnitManagement:calendarUnit:editcalendar",url: null,sortNo: "2",menuType: "4",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [],},{id: "83",parentId: "15",name: "删除",identification:"basic:calendarUnitManagement:calendarUnit:deletecalendar",url: null,sortNo: "3",menuType: "4",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [],},{id: "84",parentId: "15",name: "配置班次",identification:"basic:calendarUnitManagement:calendarUnit:configclassforcalendar",url: null,sortNo: "4",menuType: "4",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [],},],},{id: "16",parentId: "4",name: "班次管理",identification: null,url: "scheduling",sortNo: "2",menuType: "2",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [{id: "85",parentId: "16",name: "新增",identification:"basic:calendarUnitManagement:scheduleUnit:addschedule",url: null,sortNo: "1",menuType: "4",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [],},{id: "86",parentId: "16",name: "修改",identification:"basic:calendarUnitManagement:scheduleUnit:editschedule",url: null,sortNo: "2",menuType: "4",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [],},{id: "87",parentId: "16",name: "删除",identification:"basic:calendarUnitManagement:scheduleUnit:deleteschedule",url: null,sortNo: "3",menuType: "4",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [],},{id: "88",parentId: "16",name: "设置状态",identification:"basic:calendarUnitManagement:scheduleUnit:editschedulestatus",url: null,sortNo: "4",menuType: "4",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [],},],},],},{id: "5",parentId: "0",name: "系统信息",identification: null,url: "/bmgl",sortNo: "5",menuType: "1",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [{id: "89",parentId: "5",name: "编码管理",identification: null,url: "bmgl",sortNo: "1",menuType: "2",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [{id: "90",parentId: "89",name: "修改",identification: "basic:codeManage:code:edit",url: null,sortNo: "1",menuType: "4",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [],},{id: "91",parentId: "89",name: "设置状态",identification: "basic:codeManage:code:editcodestatus",url: null,sortNo: "2",menuType: "4",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [],},],},{id: "92",parentId: "5",name: "操作日志",identification: null,url: "operateLog",sortNo: "2",menuType: "2",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [],},{id: "93",parentId: "5",name: "信息导入",identification: null,url: "informationImport",sortNo: "3",menuType: "2",permissionGroupId: null,checkFlag: true,platformId: "1651478710725455875",children: [{id: "pagInfo-7",parentId: "93",name: "数据导入",identification: null,url: null,sortNo: null,menuType: "3",permissionGroupId: null,checkFlag: null,platformId: null,children: [{id: "94",parentId: "pagInfo-7",name: "模板下载",identification:"basic:Infoimport:import:downloadtemplate",url: null,sortNo: "1",menuType: "4",permissionGroupId: "7",checkFlag: true,platformId: "1651478710725455875",children: [],},{id: "95",parentId: "pagInfo-7",name: "数据导入",identification:"basic:Infoimport:import:importtemplate",url: null,sortNo: "2",menuType: "4",permissionGroupId: "7",checkFlag: true,platformId: "1651478710725455875",children: [],},],},{id: "pagInfo-8",parentId: "93",name: "导入记录",identification: null,url: null,sortNo: null,menuType: "3",permissionGroupId: null,checkFlag: null,platformId: null,children: [{id: "96",parentId: "pagInfo-8",name: "错误数据下载",identification:"basic:Infoimport:import:downloaderrdata",url: null,sortNo: "3",menuType: "4",permissionGroupId: "8",checkFlag: true,platformId: "1651478710725455875",children: [],},],},],},],},],},],};},components: {// selectTree,HSKselecte,},props: {},watch: {},created() {},mounted() {},methods: {onCateSelect(a,b){console.log("onCateSelect",a,b)},clearKey(a){console.log(a)},//获取勾选数据getdetail(val) {this.defaultKey = [];this.defaultKey.push(val);// this.form.workGroupId = val.workGroupId;},changeTreeItem(res) {console.log(res);},getGroupSequence() {return this.treeData;},},
};
</script>
<style scoped>
.flex1 {flex: 1;
}
</style>相关文章:
基于ElementUI封装的下拉树选择可搜索单选多选清空功能
效果: 组件代码 /*** 树形下拉选择组件,下拉框展示树形结构,提供选择某节点功能,方便其他模块调用* author wy* date 2024-01-03 * 调用示例:* <tree-select * :height"400" // 下拉框中树形高度* …...
计算机网络-各层协议
大家在搞嵌入式开发的时候基本都了解过七层网络协议、五层网络协议、四层网络协议,那么今天让我们更加的深入了解一下: 历史发展介绍 OSI七层模型由ISO国际标准化组织提出的通信标准。TCP/IP四层模型是OSI七层模型的简化版,OSI在它被官方完…...
LeetCode 84:柱状图中的最大矩形
一、题目描述 给定 n 个非负整数,用来表示柱状图中各个柱子的高度。每个柱子彼此相邻,且宽度为 1 。 求在该柱状图中,能够勾勒出来的矩形的最大面积。 示例 1: 输入:heights [2,1,5,6,2,3] 输出:10 解释:…...
老生重谈:大模型的「幻觉」问题
一、什么是大模型「幻觉」 大模型的幻觉问题通常指的是模型在处理输入时可能会产生一些看似合理但实际上是错误的输出,这可能是因为模型在训练时过度拟合了训练数据,导致对噪声或特定样本的过度敏感。 "大数据幻觉"指的是在处理大规模数据时…...
golang实现skiplist 跳表
跳表 package mainimport ("errors""math""math/rand" )func main() {// 双向链表///**先理解查找过程Level 3: 1 6Level 2: 1 3 6Level 1: 1 2 3 4 6比如 查找2 ; 从高层往下找;如果查找的值比当前值小 说明没有可查找的值2比1大 往当前…...
尝试OmniverseFarm的最基础操作
目标 尝试OmniverseFarm的最基础操作。本地机器作为Queue和Agent,同时在本地提交任务。 主要参考了官方文档: Farm Queue — Omniverse Farm latest documentation Farm Agent — Omniverse Farm latest documentation Farm Examples — Omniverse Far…...
第28关 k8s监控实战之Prometheus(二)
------> 课程视频同步分享在今日头条和B站 大家好,我是博哥爱运维。 这节课我们用prometheus-operator来安装整套prometheus服务 https://github.com/prometheus-operator/kube-prometheus/releases 开始安装 1. 解压下载的代码包 wget https://github.com/…...
基于 SpringBoot + magic-api + Vue3 + Element Plus + amis3.0 快速开发管理系统
Tansci-Boot 基于 SpringBoot2 magic-api Vue3 Element Plus amis3.0 快速开发管理系统 Tansci-Boot 是一个前后端分离后台管理系统, 前端集成 amis 低代码前端框架,后端集成 magic-api 的接口快速开发框架。包含基础权限、安全认证、以及常用的一…...
Kafka(四)Broker
目录 1 配置Broker1.1 Broker的配置broker.id0listererszookeeper.connectlog.dirslog.dir/tmp/kafka-logsnum.recovery.threads.per.data.dir1auto.create.topics.enabletrueauto.leader.rebalance.enabletrue, leader.imbalance.check.interval.seconds300, leader.imbalance…...
代码随想录第五十二天——最长递增子序列,最长连续递增序列,最长重复子数组
leetcode 300. 最长递增子序列 题目链接:最长递增子序列 dp数组及下标的含义 dp[i]表示i之前包括i的以nums[i]结尾的最长递增子序列的长度递推公式 位置i的最长升序子序列等于j从0到i-1各个位置的最长升序子序列 1 的最大值 所以if (nums[i] > nums[j]) dp[i]…...
【大数据架构】OLAP实时分析引擎选型
OLAP引擎面临的挑战 常见OLAP引擎对比 OLAP分析场景中,一般认为QPS达到1000就算高并发,而不是像电商、抢红包等业务场景中,10W以上才算高并发,毕竟数据分析场景,数据海量,计算复杂,QPS能够达到1…...
代码随想录刷题题Day29
刷题的第二十九天,希望自己能够不断坚持下去,迎来蜕变。😀😀😀 刷题语言:C Day29 任务 ● 01背包问题,你该了解这些! ● 01背包问题,你该了解这些! 滚动数组 …...
CVE-2023-51385 OpenSSH ProxyCommand命令注入漏洞
一、背景介绍 ProxyCommand 是 OpenSSH ssh_config 文件中的一个配置选项,它允许通过代理服务器建立 SSH 连接,从而在没有直接网络访问权限的情况下访问目标服务器。这对于需要经过跳板机、堡垒机或代理服务器才能访问的目标主机非常有用。 二、漏洞简…...
如何寻找到相对完整的真正的游戏的源码 用来学习?
在游戏开发的学习之路上,理论与实践是并重的两个方面。对于许多热衷于游戏开发的学习者来说,能够接触到真实的、完整的游戏源码无疑是一个极好的学习机会。但问题来了:我们该如何寻找到这些珍贵的资源呢? 开源游戏项目 GitHub:地…...
数模学习day11-系统聚类法
本文参考辽宁石油化工大学于晶贤教授的演示文档聚类分析之系统聚类法及其SPSS实现。 目录 1.样品与样品间的距离 2.指标和指标间的“距离” 相关系数 夹角余弦 3.类与类间的距离 (1)类间距离 (2)类间距离定义方式 1.最短…...
SpringBoot+Redis实现接口防刷功能
场景描述: 在实际开发中,当前端请求后台时,如果后端处理比较慢,但是用户是不知情的,此时后端仍在处理,但是前端用户以为没点到,那么再次点击又发起请求,就会导致在短时间内有很多请求…...
TensorRT加速推理入门-1:Pytorch转ONNX
这篇文章,用于记录将TransReID的pytorch模型转换为onnx的学习过程,期间参考和学习了许多大佬编写的博客,在参考文章这一章节中都已列出,非常感谢。 1. 在pytorch下使用ONNX主要步骤 1.1. 环境准备 安装onnxruntime包 安装教程可…...
springboot常用扩展点
当涉及到Spring Boot的扩展和自定义时,Spring Boot提供了一些扩展点,使开发人员可以根据自己的需求轻松地扩展和定制Spring Boot的行为。本篇博客将介绍几个常用的Spring Boot扩展点,并提供相应的代码示例。 1. 自定义Starter(面试常问) Sp…...
19道ElasticSearch面试题(很全)
点击下载《19道ElasticSearch面试题(很全)》 1. elasticsearch的一些调优手段 1、设计阶段调优 (1)根据业务增量需求,采取基于日期模板创建索引,通过 roll over API 滚动索引; (…...
向爬虫而生---Redis 拓宽篇3 <GEO模块>
前言: 继上一章: 向爬虫而生---Redis 拓宽篇2 <Pub/Sub发布订阅>-CSDN博客 这一章的用处其实不是特别大,主要是针对一些地图和距离业务的;就是Redis的GEO模块。 GEO模块是Redis提供的一种高效的地理位置数据管理方案,它允许我们存储和查询…...
应用升级/灾备测试时使用guarantee 闪回点迅速回退
1.场景 应用要升级,当升级失败时,数据库回退到升级前. 要测试系统,测试完成后,数据库要回退到测试前。 相对于RMAN恢复需要很长时间, 数据库闪回只需要几分钟。 2.技术实现 数据库设置 2个db_recovery参数 创建guarantee闪回点,不需要开启数据库闪回。…...
基于uniapp+WebSocket实现聊天对话、消息监听、消息推送、聊天室等功能,多端兼容
基于 UniApp + WebSocket实现多端兼容的实时通讯系统,涵盖WebSocket连接建立、消息收发机制、多端兼容性配置、消息实时监听等功能,适配微信小程序、H5、Android、iOS等终端 目录 技术选型分析WebSocket协议优势UniApp跨平台特性WebSocket 基础实现连接管理消息收发连接…...
iPhone密码忘记了办?iPhoneUnlocker,iPhone解锁工具Aiseesoft iPhone Unlocker 高级注册版分享
平时用 iPhone 的时候,难免会碰到解锁的麻烦事。比如密码忘了、人脸识别 / 指纹识别突然不灵,或者买了二手 iPhone 却被原来的 iCloud 账号锁住,这时候就需要靠谱的解锁工具来帮忙了。Aiseesoft iPhone Unlocker 就是专门解决这些问题的软件&…...
爬虫基础学习day2
# 爬虫设计领域 工商:企查查、天眼查短视频:抖音、快手、西瓜 ---> 飞瓜电商:京东、淘宝、聚美优品、亚马逊 ---> 分析店铺经营决策标题、排名航空:抓取所有航空公司价格 ---> 去哪儿自媒体:采集自媒体数据进…...
全面解析各类VPN技术:GRE、IPsec、L2TP、SSL与MPLS VPN对比
目录 引言 VPN技术概述 GRE VPN 3.1 GRE封装结构 3.2 GRE的应用场景 GRE over IPsec 4.1 GRE over IPsec封装结构 4.2 为什么使用GRE over IPsec? IPsec VPN 5.1 IPsec传输模式(Transport Mode) 5.2 IPsec隧道模式(Tunne…...
项目部署到Linux上时遇到的错误(Redis,MySQL,无法正确连接,地址占用问题)
Redis无法正确连接 在运行jar包时出现了这样的错误 查询得知问题核心在于Redis连接失败,具体原因是客户端发送了密码认证请求,但Redis服务器未设置密码 1.为Redis设置密码(匹配客户端配置) 步骤: 1).修…...
SQL慢可能是触发了ring buffer
简介 最近在进行 postgresql 性能排查的时候,发现 PG 在某一个时间并行执行的 SQL 变得特别慢。最后通过监控监观察到并行发起得时间 buffers_alloc 就急速上升,且低水位伴随在整个慢 SQL,一直是 buferIO 的等待事件,此时也没有其他会话的争抢。SQL 虽然不是高效 SQL ,但…...
C++ 设计模式 《小明的奶茶加料风波》
👨🎓 模式名称:装饰器模式(Decorator Pattern) 👦 小明最近上线了校园奶茶配送功能,业务火爆,大家都在加料: 有的同学要加波霸 🟤,有的要加椰果…...
MySQL:分区的基本使用
目录 一、什么是分区二、有什么作用三、分类四、创建分区五、删除分区 一、什么是分区 MySQL 分区(Partitioning)是一种将单张表的数据逻辑上拆分成多个物理部分的技术。这些物理部分(分区)可以独立存储、管理和优化,…...
pikachu靶场通关笔记19 SQL注入02-字符型注入(GET)
目录 一、SQL注入 二、字符型SQL注入 三、字符型注入与数字型注入 四、源码分析 五、渗透实战 1、渗透准备 2、SQL注入探测 (1)输入单引号 (2)万能注入语句 3、获取回显列orderby 4、获取数据库名database 5、获取表名…...
