fix: resolve TypeScript errors in frontend build
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, computed, watch } from 'vue'
|
||||
import type { DocumentReasoning, ReasoningStep } from '@/types'
|
||||
import type { DocumentReasoning } from '@/types'
|
||||
import Button from '@/components/common/Button.vue'
|
||||
|
||||
const props = defineProps<{
|
||||
@@ -50,7 +50,11 @@ function updateConfidence(value: string) {
|
||||
|
||||
function updateStep(index: number, field: 'thought' | 'conclusion', value: string) {
|
||||
if (!localReasoning.value) return
|
||||
localReasoning.value.reasoning_steps[index][field] = value || null
|
||||
if (field === 'conclusion') {
|
||||
localReasoning.value.reasoning_steps[index].conclusion = value || null
|
||||
} else {
|
||||
localReasoning.value.reasoning_steps[index].thought = value
|
||||
}
|
||||
emitUpdate()
|
||||
}
|
||||
|
||||
@@ -97,7 +101,7 @@ function getConfidenceColor(confidence: number | null): string {
|
||||
|
||||
<div v-if="!hasReasoning" class="reasoning-panel__empty">
|
||||
<p>No reasoning data for this document.</p>
|
||||
<Button variant="secondary" size="small" @click="openAddStep">
|
||||
<Button variant="secondary" size="sm" @click="openAddStep">
|
||||
Add Reasoning
|
||||
</Button>
|
||||
</div>
|
||||
@@ -167,7 +171,7 @@ function getConfidenceColor(confidence: number | null): string {
|
||||
<div class="reasoning-panel__steps">
|
||||
<div class="reasoning-panel__steps-header">
|
||||
<label class="reasoning-panel__label">Steps</label>
|
||||
<Button v-if="editable" variant="secondary" size="small" @click="openAddStep">
|
||||
<Button v-if="editable" variant="secondary" size="sm" @click="openAddStep">
|
||||
+ Add
|
||||
</Button>
|
||||
</div>
|
||||
@@ -246,8 +250,8 @@ function getConfidenceColor(confidence: number | null): string {
|
||||
></textarea>
|
||||
</div>
|
||||
<div class="reasoning-panel__modal-actions">
|
||||
<Button variant="secondary" size="small" @click="showAddStep = false">Cancel</Button>
|
||||
<Button variant="primary" size="small" @click="submitAddStep">Add Step</Button>
|
||||
<Button variant="secondary" size="sm" @click="showAddStep = false">Cancel</Button>
|
||||
<Button variant="primary" size="sm" @click="submitAddStep">Add Step</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -43,7 +43,7 @@ const editor = useEditor({
|
||||
watch(() => props.modelValue, (newValue) => {
|
||||
if (!editor.value) return
|
||||
if (JSON.stringify(editor.value.getJSON()) !== JSON.stringify(newValue)) {
|
||||
editor.value.commands.setContent(newValue || '', false)
|
||||
editor.value.commands.setContent(newValue || '', { emitUpdate: false })
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user