Karsa 11 месяцев назад
Родитель
Сommit
4c9345385c

+ 8 - 3
src/views/chartRelevance_manage/crossVarietyAnalysis/components/tagSetDialog.vue

@@ -34,7 +34,7 @@
             class="input-edit"
             :ref="`inputRef${index}`"
             size="small"
-            @change="editItemHandle(item)"
+            @blur="editItemHandle(item)"
           />
           <span v-else>
             {{ item.label }}
@@ -57,10 +57,10 @@
           v-model="inputValue"
           ref="saveTagInput"
           size="small"
-          @change="addNewTagHandle"
+          @blur="addNewTagHandle"
         >
         </el-input>
-        <el-button v-else size="small" @click="addNewItem">+ 标签</el-button>
+        <el-button v-else size="small" @click="addNewItem">+ {{type==='tag'?'标签':'品种'}}</el-button>
 
       </div>
     </div>
@@ -156,6 +156,11 @@ export default {
 
     /* 编辑标签 */
     async editItemHandle(item) {
+      if(item.label===item.ChartVarietyName || item.label===item.ChartTagName) {
+        item.isEdit = false;
+        return
+      }
+
       let res = this.type==='tag' 
         ? await crossVarietyInterface.tagEdit({ TagName: item.label,ChartTagId:item.id})
         : await crossVarietyInterface.varietyEdit({ VarietyName: item.label,ChartVarietyId:item.id})