liding
2 天以前 8d24d963f8b82163685c34b816998a904f08234d
src/views/standard/standardLibrary/index.vue
@@ -8,12 +8,11 @@
            <div class="head-container addButton">
              <el-input v-model="search" clearable placeholder="输入关键字进行搜索" size="small" style="margin-bottom: 5px"
                        suffix-icon="el-icon-search" @keydown.enter.native="searchFilter" @blur="searchFilter" @clear="searchFilter"></el-input>
              <el-button circle icon="el-icon-plus" size="mini" type="primary" @click="openAddDia"></el-button>
            </div>
            <div class="head-container">
              <el-tree ref="tree" v-loading="treeLoad" :data="list"
                       :default-expanded-keys="expandedKeys" :filter-node-method="filterNode"
                       :props="{ children: 'children', label: 'label' }" highlight-current node-key="label"
                       :props="{ children: 'children', label: 'label' }" highlight-current node-key="id"
                       style="
                        height: calc(100vh - 173px);
                        overflow-y: scroll;
@@ -31,22 +30,6 @@
                  }`"></i>
                {{ data.label }}
              </span>
                    </el-col>
                    <el-col v-if="
              checkPermi(['standard:standardLibrary:delStandardTree']) &&
              isLeaf(node.data)
            " :span="2" style="text-align: right">
                      <el-button size="mini" type="text" @click.stop="editTreeName(node)">
                        <i class="el-icon-edit"></i>
                      </el-button>
                    </el-col>
                    <el-col v-if="
              checkPermi(['standard:standardLibrary:delStandardTree']) &&
              isLeaf(node.data)
            " :span="2" style="text-align: right">
                      <el-button size="mini" type="text" @click.stop="remove(node, data)">
                        <i class="el-icon-delete"></i>
                      </el-button>
                    </el-col>
                  </el-row>
                </div>
@@ -585,7 +568,14 @@
    selectStandardTreeList() {
      this.treeLoad = true;
      selectStandardTreeList().then((res) => {
        this.list = res.data;
        this.list = (res.data || []).map(industry => ({
          ...industry,
          children: (industry.children || []).map(standard => ({
            ...standard,
            // 二级节点只展示标准编号;兼容尚未重启的旧后端返回格式。
            label: standard.standardCode || String(standard.label || '').split(' - ')[0],
          })),
        }));
        this.expandedKeys = [];
        this.list.forEach((a) => {
          this.expandedKeys.push(a.label);