From e6efbe5af9548bea5c61e4797374fc0c2c7818ed Mon Sep 17 00:00:00 2001 From: maxmon <541182180@qq.com> Date: Sat, 16 Apr 2022 20:35:51 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=8E=A5=E5=85=A5=E7=9C=9F=E5=AE=9E?= =?UTF-8?q?=E7=B1=BB=E5=88=AB=E7=9A=84=E9=A2=9C=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fe/src/components/CV/point.vue | 7 ++++++- fe/src/components/NER/index.vue | 17 ++++++++++------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/fe/src/components/CV/point.vue b/fe/src/components/CV/point.vue index d3beea5..13ffc8c 100644 --- a/fe/src/components/CV/point.vue +++ b/fe/src/components/CV/point.vue @@ -5,7 +5,7 @@
@@ -31,6 +31,11 @@ export default ({ default: '1234', required: true }, + types: { + type: Object, + default: () => {}, + required: true + }, save: { type: Function, required: true diff --git a/fe/src/components/NER/index.vue b/fe/src/components/NER/index.vue index 3989387..599f8a2 100644 --- a/fe/src/components/NER/index.vue +++ b/fe/src/components/NER/index.vue @@ -108,7 +108,7 @@
- +
@@ -405,8 +405,7 @@ export default { setType: function (type, ev) { if (this.projectType === '命名实体识别') { this.$set(this, 'nowType', type) - } - if (this.projectType === '文本分类') { + } else if (this.projectType === '文本分类') { let typeIdx = -1 this.ners.some((ner, idx) => { if (ner.type === type) { @@ -421,6 +420,9 @@ export default { } this.$set(this, 'nowType', type) this.save() + } else { + console.log(type) + this.$set(this, 'nowType', type) } }, delType: function (type, ev) { @@ -671,11 +673,12 @@ export default { isTypeSelected (type) { if (this.projectType === '命名实体识别') { return this.nowType === type - } - if (this.projectType === '文本分类') { + } else if (this.projectType === '文本分类') { return this.ners.some((ner) => { return ner.type === type }) + } else { + return this.nowType === type } } }, @@ -714,8 +717,8 @@ export default { return entityType.type }) that.types = types - // 进入命名实体识别时默认选择第一个标签,防止弹出请选择标签的提示 - if (that.typeList && that.typeList[0] && projectType === '命名实体识别') that.nowType = that.typeList[0] + // 除了分类,默认选择第一个标签,防止弹出请选择标签的提示 + if (that.typeList && that.typeList[0] && projectType.indexOf('分类') === -1) that.nowType = that.typeList[0] that.getFiles() } function calcColumnWordCount () {