From fd45194e188c01eda9539f7b1cc33ab8243d31ec Mon Sep 17 00:00:00 2001 From: maxmon <541182180@qq.com> Date: Sat, 24 Apr 2021 10:35:44 +0800 Subject: [PATCH] =?UTF-8?q?v1.2.4=201=E3=80=81=E5=A2=9E=E5=8A=A0/=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E6=A0=87=E6=B3=A8=E5=AE=9E=E6=97=B6=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=EF=BC=9B=202=E3=80=81=E5=AE=9E=E4=BD=93=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=8D=A2=E5=88=B0=E9=A1=B9=E7=9B=AE=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E9=A1=B5=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fe/config/index.js | 2 +- fe/src/components/NER/index.vue | 20 ++- fe/src/components/home/index.vue | 204 +++++++++++++++++++++++++++---- 3 files changed, 192 insertions(+), 34 deletions(-) diff --git a/fe/config/index.js b/fe/config/index.js index 6c25a32..86e3578 100644 --- a/fe/config/index.js +++ b/fe/config/index.js @@ -54,7 +54,7 @@ module.exports = { // Paths assetsRoot: path.resolve(__dirname, '../dist'), assetsSubDirectory: 'static', - assetsPublicPath: '/dw-tool-ner/v1.2.3/', + assetsPublicPath: '/dw-tool-ner/v1.2.4/', /** * Source Maps diff --git a/fe/src/components/NER/index.vue b/fe/src/components/NER/index.vue index 382d4dd..a4f252b 100644 --- a/fe/src/components/NER/index.vue +++ b/fe/src/components/NER/index.vue @@ -29,12 +29,12 @@ @mouseover="setFocus(type)" @mouseleave="setFocus('')" > - + {{ type }} {{ fastTypeKey[type] ? `【${fastTypeKey[type]}】` : '' }} - + - + @@ -81,10 +81,6 @@
-
@@ -154,6 +150,7 @@ export default { name: 'NER', data () { return { + configCanCtlType: false, // 是否支持实体类型的调整 pageNumber: 1, pageSize: 20, inputType: '', @@ -291,6 +288,7 @@ export default { this.$set(this, 'nowType', type) }, delType: function (type, ev) { + if (!this.configCanCtlType) return false const that = this ev && ev.preventDefault() // 取消默认的右键菜单事件 // 右键删除对应的类型 @@ -310,6 +308,7 @@ export default { updateType2Server(that.projectName, that.typeList, that.types) }, checkDelType: function (type, ev) { + if (!this.configCanCtlType) return false ev && ev.stopPropagation() const isDel = window.confirm(`确定删除标签【${type}】么?`) if (isDel) { @@ -387,6 +386,7 @@ export default { ners.splice(i, 1) this.$set(this, 'ners', ners) this.flushWordsType() + this.save() // 删除时实时保存 return true } } @@ -419,6 +419,7 @@ export default { this.$set(this, 'nowNer', undefined) this.flushWordsType() this.startIdx = -1 + this.save() // 添加时实时保存 }, stopPrev: function (event) { event.preventDefault() @@ -557,9 +558,6 @@ export default { } else if (type === 'page-down') { // 快捷下一个 that.changeIdx(+1) - } else if (type === 'save') { - // 保存 - that.save() } else { // 快捷选择类型 const type = that.fastKeyType[key] @@ -817,8 +815,8 @@ export default { pointer-events: none; } .color-icon { + display: block; float: right; - display: inline-block; margin-top: 6px; } .close-icon { diff --git a/fe/src/components/home/index.vue b/fe/src/components/home/index.vue index cc60e28..6355f05 100644 --- a/fe/src/components/home/index.vue +++ b/fe/src/components/home/index.vue @@ -12,8 +12,8 @@
暂无
-

{{project.projectName}}

-

{{project.projectType}}

+

{{project.projectName}}

+

{{project.projectType}}

@@ -22,12 +22,32 @@
-

名称:

+

名称:

类型: -

+
+ 选择标签: +
+
+ + + + {{ type }} + + + + + + +
+

@@ -38,9 +58,29 @@