Browse Source

fix: blur交互

Karsa 11 months ago
parent
commit
4c9345385c

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

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