zouyu
2023-09-11 44281a4147688e421401231e778f50e947589b40
src/components/view/standard.vue
@@ -52,18 +52,14 @@
              询</span></el-button>
        </div>
        <div v-if="this.typeselect == 0">
        <div class="contentTable" v-if="this.typeselect == 0">
          <technology  :tableType="tableType" :tableData="tableData"></technology>
        </div>
        <div v-if="this.typeselect == 1">
          技术指标
        </div>
        <div v-if="this.typeselect == 1">技术指标</div>
        <div v-if="this.typeselect == 2">
          <material  :tableType="tableType" :tableData="tableData"></material>
        </div>
        <div v-if="this.typeselect == 3">
          生产工艺
        </div>
        <div v-if="this.typeselect == 3">生产工艺</div>
        <!-- <div class="table">
          <technology v-if="tableData.length !== 0" :tableType="tableType" :tableData="tableData"></technology>
        </div> -->
@@ -104,7 +100,6 @@
      checkTreeNode: {},// 点击选中树节点
      tableData: [],
      bomAddModelVisible: false,// 控制bom新增模态框是否显示
      list: [],
      typeselect: 0,
      returntree: {
        id:28,
@@ -184,7 +179,6 @@
    },
    //右侧数据
    selectAll() {
      console.log(this.$axios.get(this.$api.url.selectAll));
      this.$axios.get(this.$api.url.selectAll, {
        params: {
          specificationsId: this.returntree.id,//tree的点击反馈
@@ -192,8 +186,11 @@
          version: this.character,//版本
        }
      }).then(res => {
        console.log(res.data);
        this.tableData = res.data
        let arr = res.data;
        for(var i=0;i<arr.length;i++){
            arr[i].id = "0" + i;
        }
        this.tableData = arr;
      })
    },
    verevent(val) {
@@ -219,8 +216,33 @@
          }
        })
        this.selectDataList()
        // 默认第一个五级节点搜索,新增配置项
        const treeOptions = JSON.parse(JSON.stringify(this.list));
        this.getDefault(treeOptions, 0);
        this.formTypeOptions = treeOptions;
        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 .el-tree-node__children .el-tree-node"
          );
          try {
            firstNode.click();
          } catch (e) {
            //TODO handle the exception
          }
        });
      })
    },
    getDefault(arr, index) {
         for (const item of arr) {
            if (item.children && item.children.length > 0) {
               // 有子节点
               this.getDefault(item.children, index + 1);
               if (index === 2) {
                  item.children = null;
               }
            }
         }
      },
    filterNode(value, data) {
      if (!value) return true;
      return data.label.indexOf(value) !== -1;
@@ -269,6 +291,9 @@
<style scoped>
.standard {}
.standard .contentTable{
}
.standard .title .el-button {
  height: 32px;
  border: 1px solid rgba(190, 190, 190, 0.44);