zouyu
2023-08-23 0503db82345547e24dc5dc19fcf39a30b2c9a6bc
src/views/standardLibrary/index.vue
@@ -2,7 +2,10 @@
  <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"
@@ -202,6 +205,7 @@
    },
    // 获取bom树的标准数据
    async getStandardTree() {
      console.log(`output->执行力`, "执行力");
      const { data } = await getMaterialList();
      this.standardTree = data.map((item) => {
        let name = null;
@@ -224,10 +228,12 @@
      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);
      });
@@ -248,6 +254,7 @@
      // 是子节点
      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
@@ -316,7 +323,6 @@
    },
    async subAddTreeForm() {
      this.addTreeFormVisible = false;
      console.log(this.addTreeForm.addTypeArr.length);
      let res = null;
      try {
        switch (this.addTreeForm.addTypeArr.length) {
@@ -348,12 +354,14 @@
      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() {