diff --git a/fe/dist/index.html b/fe/dist/index.html index 649b387..300d63f 100644 --- a/fe/dist/index.html +++ b/fe/dist/index.html @@ -29,7 +29,7 @@ } console.log(isPhone?'手机用户':'电脑用户') if (isPhone) { - alert('NER中,双击删除实体\n待标注文本需要txt格式的压缩包') + alert('NER中,长按删除实体\n待标注文本需要txt格式的压缩包') } else { alert('NER中,鼠标右键删除实体\n待标注文本需要txt格式的压缩包') } diff --git a/fe/src/components/NER/index.vue b/fe/src/components/NER/index.vue index f57068d..c588494 100644 --- a/fe/src/components/NER/index.vue +++ b/fe/src/components/NER/index.vue @@ -97,7 +97,7 @@
- {{ word }} @@ -532,13 +532,17 @@ export default { }, startSelect: function (idx, event) { if (this.projectType !== '命名实体识别') return + let that = this let isNeedDel = false if (event.touches) { - // 手机双击删除 - if (this.startSelectTouchTs && Date.now() - this.startSelectTouchTs < 300) { - isNeedDel = true - } - this.startSelectTouchTs = Date.now() + // 手机长按删除 + setTimeout(() => { + if (window.delMarkIdx === idx) { + delete window.delMarkIdx + that.delIdx(idx) + } + }, 300) + window.delMarkIdx = idx } if (event.which === 3) { // 电脑右键删除 @@ -556,6 +560,9 @@ export default { this.endIdx = idx this.pointWord(idx, {isDefaultClick: true}) }, + stopSelect: function () { + delete window.delMarkIdx + }, checkIsRepeat: function (tarNer) { for (let i = 0; i < this.ners.length; i += 1) { const ner = this.ners[i]