style(web): translate the comments in the src/views directory into English
This commit is contained in:
@@ -1,3 +1,15 @@
|
||||
/*
|
||||
* @Author: ZhaoYing
|
||||
* @Date: 2026-02-03 17:46:47
|
||||
* @Last Modified by: ZhaoYing
|
||||
* @Last Modified time: 2026-02-03 17:46:47
|
||||
*/
|
||||
/**
|
||||
* Self Reflection Engine Configuration Page
|
||||
* Configures reflection period, range, baseline, quality assessment, and privacy audit
|
||||
* Supports pilot run with example data
|
||||
*/
|
||||
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { Row, Col, Form, App, Button, Space, Select } from 'antd';
|
||||
import { useParams } from 'react-router-dom';
|
||||
@@ -13,6 +25,7 @@ import Tag from '@/components/Tag'
|
||||
import { useI18n } from '@/store/locale';
|
||||
import SwitchFormItem from '@/components/FormItem/SwitchFormItem'
|
||||
|
||||
/** Configuration list */
|
||||
const configList = [
|
||||
// 启用反思引擎
|
||||
{
|
||||
@@ -88,6 +101,7 @@ const SelfReflectionEngine: React.FC = () => {
|
||||
getConfigData()
|
||||
}, [id])
|
||||
|
||||
/** Fetch configuration data */
|
||||
const getConfigData = () => {
|
||||
if (!id) {
|
||||
return
|
||||
@@ -106,9 +120,11 @@ const SelfReflectionEngine: React.FC = () => {
|
||||
console.error('Failed to load data');
|
||||
})
|
||||
}
|
||||
/** Reset form to saved values */
|
||||
const handleReset = () => {
|
||||
form.setFieldsValue(configData);
|
||||
}
|
||||
/** Save configuration */
|
||||
const handleSave = () => {
|
||||
if (!id) {
|
||||
return
|
||||
@@ -126,6 +142,7 @@ const SelfReflectionEngine: React.FC = () => {
|
||||
setLoading(false)
|
||||
})
|
||||
}
|
||||
/** Run pilot test */
|
||||
const handleRun = () => {
|
||||
if (!id) {
|
||||
return
|
||||
|
||||
@@ -1,4 +1,12 @@
|
||||
// 标签表单数据类型
|
||||
/*
|
||||
* @Author: ZhaoYing
|
||||
* @Date: 2026-02-03 17:46:23
|
||||
* @Last Modified by: ZhaoYing
|
||||
* @Last Modified time: 2026-02-03 17:46:23
|
||||
*/
|
||||
/**
|
||||
* Tag form data type
|
||||
*/
|
||||
export interface TagFormData {
|
||||
tagName: string;
|
||||
type: string;
|
||||
@@ -7,12 +15,14 @@ export interface TagFormData {
|
||||
applicableScope?: string[];
|
||||
semanticExpansion?: string;
|
||||
isActive?: boolean;
|
||||
// 扩展字段用于区分编辑和新增操作
|
||||
/** Distinguish between edit and create operations */
|
||||
isEditing?: boolean;
|
||||
tagId?: string;
|
||||
}
|
||||
|
||||
// 记忆总览数据类型
|
||||
/**
|
||||
* Memory overview record type
|
||||
*/
|
||||
export interface MemoryOverviewRecord {
|
||||
id: number;
|
||||
memoryID: string,
|
||||
@@ -23,12 +33,16 @@ export interface MemoryOverviewRecord {
|
||||
retentionDegree: string;
|
||||
status: string;
|
||||
}
|
||||
// 定义组件暴露的方法接口
|
||||
/**
|
||||
* Component exposed methods interface
|
||||
*/
|
||||
export interface MemoryOverviewFormRef {
|
||||
handleOpen: (memoryOverview?: MemoryOverviewRecord | null) => void;
|
||||
}
|
||||
|
||||
// 遗忘曲线数据类型
|
||||
/**
|
||||
* Forgetting curve data type
|
||||
*/
|
||||
export interface CurveRecord {
|
||||
memoryID: string;
|
||||
type: string;
|
||||
@@ -38,6 +52,9 @@ export interface CurveRecord {
|
||||
reinforcementCount: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reflection engine configuration
|
||||
*/
|
||||
export interface ConfigForm {
|
||||
config_id: number | string;
|
||||
reflection_enabled: boolean;
|
||||
@@ -49,20 +66,32 @@ export interface ConfigForm {
|
||||
quality_assessment: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Quality assessment result
|
||||
*/
|
||||
export interface QualityAssessment {
|
||||
score: number;
|
||||
summary: string;
|
||||
}
|
||||
/**
|
||||
* Memory verification result
|
||||
*/
|
||||
export interface MemoryVerify {
|
||||
has_privacy: boolean;
|
||||
privacy_types: string[];
|
||||
summary: string;
|
||||
}
|
||||
/**
|
||||
* Reflection data
|
||||
*/
|
||||
export interface ReflexionData {
|
||||
reason: string;
|
||||
solution: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reflection engine test result
|
||||
*/
|
||||
export interface Result {
|
||||
baseline: string;
|
||||
source_data: string;
|
||||
|
||||
Reference in New Issue
Block a user