Skip to content

Commit 2ba7a24

Browse files
fix: Check the option to add segment title as related questions during import, and related questions after modifying the title (#2255)
1 parent 3de5dac commit 2ba7a24

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

ui/src/utils/utils.ts

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { number } from 'echarts'
2-
31
export function toThousands(num: any) {
42
return num?.toString().replace(/\d+/, function (n: any) {
53
return n.replace(/(\d)(?=(?:\d{3})+$)/g, '$1,')

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

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
@change="addProblemHandle"
3232
@blur="isAddProblem = false"
3333
ref="inputRef"
34+
class="mb-8"
3435
/>
3536

3637
<template v-for="(item, index) in detail.problem_list" :key="index">

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

+9
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,15 @@ const next = () => {
7676
7777
const updateContent = (data: any) => {
7878
const new_value = [...props.modelValue]
79+
if (
80+
props.isConnect &&
81+
data.title &&
82+
!data?.problem_list.some((item: any) => item.content === data.title.trim())
83+
) {
84+
data['problem_list'].push({
85+
content: data.title.trim()
86+
})
87+
}
7988
new_value[currentCIndex.value] = cloneDeep(data)
8089
emit('update:modelValue', new_value)
8190
}

0 commit comments

Comments
 (0)