refactor: 右键在手机上的操作为长按,所以手机上统一长按为删除
This commit is contained in:
parent
9a002f1df8
commit
600f636819
|
@ -29,7 +29,7 @@
|
|||
}
|
||||
console.log(isPhone?'手机用户':'电脑用户')
|
||||
if (isPhone) {
|
||||
alert('NER中,双击删除实体\n待标注文本需要txt格式的压缩包')
|
||||
alert('NER中,长按删除实体\n待标注文本需要txt格式的压缩包')
|
||||
} else {
|
||||
alert('NER中,鼠标右键删除实体\n待标注文本需要txt格式的压缩包')
|
||||
}
|
||||
|
|
|
@ -97,7 +97,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div v-if="projectType === '命名实体识别'">
|
||||
<span class="word" v-for="(word, idx) in nowText" :key="idx" :id="idx" @contextmenu="stopPrev" @mousedown="startSelect(idx, $event)" @touchstart="startSelect(idx, $event)" @mousemove="pointWord(idx)" @touchmove="pointWordByTouch($event)"
|
||||
<span class="word" v-for="(word, idx) in nowText" :key="idx" :id="idx" @contextmenu="stopPrev" @mousedown="startSelect(idx, $event)" @touchstart="startSelect(idx, $event)" @touchend="stopSelect()" @mousemove="pointWord(idx)" @touchmove="pointWordByTouch($event)"
|
||||
>
|
||||
{{ word }}
|
||||
</span>
|
||||
|
@ -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]
|
||||
|
|
Loading…
Reference in New Issue