Skip to content

Commit 2c23c32

Browse files
committed
APIAuto:避免误删标签,完善新增/移除标签提示
1 parent 4289b81 commit 2c23c32

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

  • APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api

‎APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/index.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@
242242
<li style="margin: 0px; padding: 2px; border: #DDD 1px solid; border-radius: 2px " v-for="(tag, ind) in item.Chain.tagList" :id="'tag' + index" >
243243
<a href="javascript:void(0)" style="position: relative; min-width: 6px; width: auto; height: 30px; " @click="removeChainTag(ind, tag, index, item)" >{{ tag }}</a>
244244
</li>
245-
</ul><button class="hint--left" data-hint="点底部标签来添加,或分组标签来移除" style="position: absolute; right: 60px; top: 6px;" href="javascript:void(0)" @click="addChainTag(index, item)"> + </button><a style="right: 0px; position: absolute; z-index: 100; width: fit-content; background-color: white; margin-right: 24px" class="hint--left" :data-hint="item.Chain.groupName">{{' (' + (item.Chain.count - 1) + ') '}}</a>
245+
</ul><button class="hint--left" data-hint="新增标签" style="position: absolute; right: 60px; top: 6px;" href="javascript:void(0)" @click="changeChainTag(index, item)"> + </button><a style="right: 0px; position: absolute; z-index: 100; width: fit-content; background-color: white; margin-right: 24px" class="hint--left" :data-hint="item.Chain.groupName">{{' (' + (item.Chain.count - 1) + ') '}}</a>
246246
<svg class="icon" @click="remove(item, index, true, false, false, true)" style="background-color: white; width: 27px; height: 18px; right: -2px; top: 10px; padding-left: 3px; padding-right: 4px; padding-top: 2px; padding-bottom: 2px;" >
247247
<use xlink:href="svg/icon.svg#trash"></use>
248248
</svg>

‎APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/js/main.js‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4871,12 +4871,18 @@ https://github.com/Tencent/APIJSON/issues
48714871
return this.chainShowType != 2 || (this.chainGroups.length <= 0 && this.chainPaths.length > 0)
48724872
},
48734873
removeChainTag: function (ind, tag, index, item) {
4874+
if (! this.isCaseGroupEditable) {
4875+
this.isCaseGroupEditable = true
4876+
this.changeChainTag(index, item)
4877+
return
4878+
}
4879+
48744880
var chain = (item || {}).Chain || {}
48754881
var tagList = chain.tagList || [];
48764882
tagList.splice(ind, 1)
48774883
this.setChainTag(index, chain, tagList)
48784884
},
4879-
addChainTag: function (index, group) {
4885+
changeChainTag: function (index, group) {
48804886
this.isCaseGroupEditable = true
48814887
this.currentChainGroupIndex = index
48824888
var chain = (group || {}).Chain || {}
@@ -4909,6 +4915,7 @@ https://github.com/Tencent/APIJSON/issues
49094915
}
49104916

49114917
this.chainTags = chainTags
4918+
alert('已进入编辑模式,点击底部标签即可添加/移除,点列表项标签也可移除')
49124919
},
49134920
setChainTag(index, item, tagList, isAdd) {
49144921
var chain = item || {} // (item || {}).Chain || {}
@@ -4963,7 +4970,7 @@ https://github.com/Tencent/APIJSON/issues
49634970
}
49644971
}
49654972

4966-
this.setChainTag(groupIndex, chain, tagList, true)
4973+
this.setChainTag(groupIndex, chain, tagList, tag.selected)
49674974
},
49684975
selectChainGroup: function (index, group) {
49694976
this.currentChainGroupIndex = index

0 commit comments

Comments
 (0)