fix:OCR识别书号逻辑改为13位直接用/10位转换/否则生成678开头
This commit is contained in:
parent
3b2f3441e0
commit
2d16446dd7
@ -2792,16 +2792,14 @@ export default {
|
|||||||
}
|
}
|
||||||
if (texts.书号) {
|
if (texts.书号) {
|
||||||
const bookCode = texts.书号.replace(/\D/g, '')
|
const bookCode = texts.书号.replace(/\D/g, '')
|
||||||
if (bookCode.length === 13 && bookCode.startsWith('978')) {
|
if (bookCode.length === 13) {
|
||||||
this.noIsbnIsbn = bookCode
|
this.noIsbnIsbn = bookCode
|
||||||
this.noIsbnUnifyIsbn = ''
|
|
||||||
} else if (bookCode.length === 10 && /^\d{9}[\dXx]$/i.test(bookCode)) {
|
} else if (bookCode.length === 10 && /^\d{9}[\dXx]$/i.test(bookCode)) {
|
||||||
// 10位书号 → 转为13位ISBN
|
|
||||||
this.noIsbnIsbn = this.convertIsbn10To13(bookCode)
|
this.noIsbnIsbn = this.convertIsbn10To13(bookCode)
|
||||||
this.noIsbnUnifyIsbn = ''
|
|
||||||
} else {
|
} else {
|
||||||
this.noIsbnUnifyIsbn = texts.书号
|
this.noIsbnIsbn = '678' + String(Date.now()).slice(-10)
|
||||||
}
|
}
|
||||||
|
this.noIsbnUnifyIsbn = texts.书号
|
||||||
}
|
}
|
||||||
if (texts.字数) this.noIsbnWordCount = this.processNoIsbnWordage(texts.字数)
|
if (texts.字数) this.noIsbnWordCount = this.processNoIsbnWordage(texts.字数)
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user