+ 如果本地没有文本信息,就用网络请求
This commit is contained in:
parent
ee087fee55
commit
b4183d74be
|
@ -284,18 +284,22 @@ export default {
|
||||||
const hasCache = !!that.nersCache[newFile]
|
const hasCache = !!that.nersCache[newFile]
|
||||||
that.$set(that, 'ners', that.nersCache[newFile] ? [...that.nersCache[newFile]] : [])
|
that.$set(that, 'ners', that.nersCache[newFile] ? [...that.nersCache[newFile]] : [])
|
||||||
that.flushWordsType()
|
that.flushWordsType()
|
||||||
get(`/v1/anno/query?projectName=${that.projectName}&fileName=${newFile}`, function (info) {
|
if (that.nowText) {
|
||||||
delete window.isLoadingNowText
|
delete window.isLoadingNowText
|
||||||
// 如果本地没有缓存,就用线上的标注记录
|
} else {
|
||||||
if (!hasCache && info.annoDetails) {
|
get(`/v1/anno/query?projectName=${that.projectName}&fileName=${newFile}`, function (info) {
|
||||||
that.$set(that, 'ners', JSON.parse(info.annoDetails))
|
delete window.isLoadingNowText
|
||||||
that.$set(that.nersCache, that.nowFile, [...that.ners])
|
// 如果本地没有缓存,就用线上的标注记录
|
||||||
that.flushWordsType()
|
if (!hasCache && info.annoDetails) {
|
||||||
}
|
that.$set(that, 'ners', JSON.parse(info.annoDetails))
|
||||||
// 更新文件的文本信息
|
that.$set(that.nersCache, that.nowFile, [...that.ners])
|
||||||
that.$set(that.textDic, newFile, info.fileContent)
|
that.flushWordsType()
|
||||||
that.nowText = that.textDic[newFile]
|
}
|
||||||
})
|
// 更新文件的文本信息
|
||||||
|
that.$set(that.textDic, newFile, info.fileContent)
|
||||||
|
that.nowText = that.textDic[newFile]
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
changeIdx: function (d) {
|
changeIdx: function (d) {
|
||||||
const nowIdx = this.files.indexOf(this.nowFile)
|
const nowIdx = this.files.indexOf(this.nowFile)
|
||||||
|
|
Loading…
Reference in New Issue