| | |
| | | <div class="standard-library-main"> |
| | | <div class="content-main"> |
| | | <div class="library-bom" style="width: 300px"> |
| | | <el-input v-model="filterText" placeholder="输入关键字进行过滤" /> |
| | | <el-input |
| | | v-model="filterText" |
| | | placeholder="输入关键字进行过滤" |
| | | ></el-input> |
| | | <el-button type="text">全部</el-button> |
| | | <el-tree |
| | | ref="tree" |
| | |
| | | }, |
| | | // 获取bom树的标准数据 |
| | | async getStandardTree() { |
| | | console.log(`output->执行力`, "执行力"); |
| | | const { data } = await getMaterialList(); |
| | | this.standardTree = data.map((item) => { |
| | | let name = null; |
| | |
| | | const treeOptions = JSON.parse(JSON.stringify(this.standardTree)); |
| | | this.getDefault(treeOptions, 0); |
| | | this.formTypeOptions = treeOptions; |
| | | console.log(`output->===========`, "==========="); |
| | | this.$nextTick().then(() => { |
| | | const firstNode = document.querySelector( |
| | | ".el-tree-node .el-tree-node__children .el-tree-node .el-tree-node__children .el-tree-node .el-tree-node__children .el-tree-node" |
| | | ); |
| | | console.log(`output->firstNode`, firstNode); |
| | | firstNode.click(); |
| | | // console.log(firstNode); |
| | | }); |
| | |
| | | // 是子节点 |
| | | if (node.level === 4) { |
| | | this.getParentData(node.parent, node.data.name); |
| | | console.log(`output->this.msg`, this.msg); |
| | | // 存下选中节点 |
| | | this.selectData = data; |
| | | // eslint-disable-next-line prefer-const |
| | |
| | | }, |
| | | async subAddTreeForm() { |
| | | this.addTreeFormVisible = false; |
| | | console.log(this.addTreeForm.addTypeArr.length); |
| | | let res = null; |
| | | try { |
| | | switch (this.addTreeForm.addTypeArr.length) { |
| | |
| | | |
| | | console.log(res); |
| | | this.$message.success("添加成功"); |
| | | this.addTreeForm = {}; |
| | | this.addTreeForm = { |
| | | addTypeArr: [], |
| | | }; |
| | | this.getStandardTree(); |
| | | this.getTableByClick(this.selectData); |
| | | }, |
| | | changeCascader(data) { |
| | | console.log(data); |
| | | console.log(`output->----------`, data); |
| | | this.addTreeForm.addTypeArr = data; |
| | | }, |
| | | closeAddTreeForm() { |