fix: 修复关联问题为空时导入报错(#432)

fix: 修复关联问题为空时导入报错(#432)
This commit is contained in:
wangdan-fit2cloud 2024-05-15 10:58:31 +08:00 committed by GitHub
commit 84a770e689
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 6 deletions

View File

@ -95,9 +95,9 @@ function delProblemHandle(item: any, index: number) {
detail.value.problem_list.splice(index, 1) detail.value.problem_list.splice(index, 1)
} }
function addProblemHandle() { function addProblemHandle() {
if (problemValue.value) { if (problemValue.value.trim()) {
detail.value?.problem_list?.push({ detail.value?.problem_list?.push({
content: problemValue.value content: problemValue.value.trim()
}) })
problemValue.value = '' problemValue.value = ''
isAddProblem.value = false isAddProblem.value = false

View File

@ -136,10 +136,10 @@ function changeHandle(val: boolean) {
const list = paragraphList.value const list = paragraphList.value
list.map((item: any) => { list.map((item: any) => {
item.content.map((v: any) => { item.content.map((v: any) => {
v['problem_list'] = v.title v['problem_list'] = v.title.trim()
? [ ? [
{ {
content: v.title content: v.title.trim()
} }
] ]
: [] : []
@ -173,10 +173,10 @@ function splitDocument() {
if (checkedConnect.value) { if (checkedConnect.value) {
list.map((item: any) => { list.map((item: any) => {
item.content.map((v: any) => { item.content.map((v: any) => {
v['problem_list'] = v.title v['problem_list'] = v.title.trim()
? [ ? [
{ {
content: v.title content: v.title.trim()
} }
] ]
: [] : []