From b4183d74be44bc513d79ecc02fc5a0bdad21bedf Mon Sep 17 00:00:00 2001 From: maxmon <541182180@qq.com> Date: Wed, 9 Jun 2021 01:00:39 +0800 Subject: [PATCH] =?UTF-8?q?+=20=E5=A6=82=E6=9E=9C=E6=9C=AC=E5=9C=B0?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E6=96=87=E6=9C=AC=E4=BF=A1=E6=81=AF=EF=BC=8C?= =?UTF-8?q?=E5=B0=B1=E7=94=A8=E7=BD=91=E7=BB=9C=E8=AF=B7=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fe/src/components/NER/index.vue | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/fe/src/components/NER/index.vue b/fe/src/components/NER/index.vue index 6d875b7..ce4bdc3 100644 --- a/fe/src/components/NER/index.vue +++ b/fe/src/components/NER/index.vue @@ -284,18 +284,22 @@ export default { const hasCache = !!that.nersCache[newFile] that.$set(that, 'ners', that.nersCache[newFile] ? [...that.nersCache[newFile]] : []) that.flushWordsType() - get(`/v1/anno/query?projectName=${that.projectName}&fileName=${newFile}`, function (info) { + if (that.nowText) { delete window.isLoadingNowText - // 如果本地没有缓存,就用线上的标注记录 - if (!hasCache && info.annoDetails) { - that.$set(that, 'ners', JSON.parse(info.annoDetails)) - that.$set(that.nersCache, that.nowFile, [...that.ners]) - that.flushWordsType() - } - // 更新文件的文本信息 - that.$set(that.textDic, newFile, info.fileContent) - that.nowText = that.textDic[newFile] - }) + } else { + get(`/v1/anno/query?projectName=${that.projectName}&fileName=${newFile}`, function (info) { + delete window.isLoadingNowText + // 如果本地没有缓存,就用线上的标注记录 + if (!hasCache && info.annoDetails) { + that.$set(that, 'ners', JSON.parse(info.annoDetails)) + that.$set(that.nersCache, that.nowFile, [...that.ners]) + that.flushWordsType() + } + // 更新文件的文本信息 + that.$set(that.textDic, newFile, info.fileContent) + that.nowText = that.textDic[newFile] + }) + } }, changeIdx: function (d) { const nowIdx = this.files.indexOf(this.nowFile)