Skip to content

Commit 84a770e

Browse files
fix: 修复关联问题为空时导入报错(#432)
fix: 修复关联问题为空时导入报错(#432)
2 parents 36f477d + afbba72 commit 84a770e

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

ui/src/views/dataset/component/EditParagraphDialog.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ function delProblemHandle(item: any, index: number) {
9595
detail.value.problem_list.splice(index, 1)
9696
}
9797
function addProblemHandle() {
98-
if (problemValue.value) {
98+
if (problemValue.value.trim()) {
9999
detail.value?.problem_list?.push({
100-
content: problemValue.value
100+
content: problemValue.value.trim()
101101
})
102102
problemValue.value = ''
103103
isAddProblem.value = false

ui/src/views/dataset/step/StepSecond.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,10 @@ function changeHandle(val: boolean) {
136136
const list = paragraphList.value
137137
list.map((item: any) => {
138138
item.content.map((v: any) => {
139-
v['problem_list'] = v.title
139+
v['problem_list'] = v.title.trim()
140140
? [
141141
{
142-
content: v.title
142+
content: v.title.trim()
143143
}
144144
]
145145
: []
@@ -173,10 +173,10 @@ function splitDocument() {
173173
if (checkedConnect.value) {
174174
list.map((item: any) => {
175175
item.content.map((v: any) => {
176-
v['problem_list'] = v.title
176+
v['problem_list'] = v.title.trim()
177177
? [
178178
{
179-
content: v.title
179+
content: v.title.trim()
180180
}
181181
]
182182
: []

0 commit comments

Comments
 (0)