jinlin
2024-07-22 3a4536445096cdb80d586a67df3c00ab4a0faecb
web/src/views/modules/basicInfo/ProductModelTree.vue
@@ -7,7 +7,7 @@
      size="small"
      clearable
    ></el-input>
    <el-button type="primary" @click="add()" style="margin: 10px 0 0 10px;padding: 9px 18px !important;">新增型号</el-button>
    <el-button v-if="isShow" type="primary" @click="add()" style="margin: 10px 0 0 10px;padding: 9px 18px !important;">新增型号</el-button>
    <el-divider></el-divider>
    <el-tree
      style="height: 90%;overflow: auto"
@@ -34,6 +34,10 @@
    name: 'ProductModelTree',
    props: {
      showXdy: {
        type: Boolean,
        default: true
      },
      isShow: {
        type: Boolean,
        default: true
      },
@@ -80,7 +84,6 @@
        if (this.basic) {
          if (this.productList && this.productList[0].children) {
            this.defaultId = this.productList[0].children[0].id
            console.log(this.defaultId, 'this.defaultID')
            this.$nextTick(() => {
              this.$refs.tree.setCurrentKey(this.defaultId); //一定要加这个选中了否则样式没有出来
            });