chore: replace all cn comments of fe to en version by volc api (#320)

This commit is contained in:
tecvan
2025-07-31 10:32:15 +08:00
committed by GitHub
parent 716ec0cba8
commit 71f6245a01
2960 changed files with 15545 additions and 15545 deletions

View File

@@ -85,27 +85,27 @@ export interface VariableGroupsAction {
parentId: string;
channel: VariableChannel;
}) => Variable;
// 更新变量, 根据groupIdvariableId更新
// Update variables, according to groupId and variableId
updateVariable: (newVariable: Variable) => void;
// 更新变量的meta信息
// Update the meta information of the variable
updateMeta: (params: {
variables: Variable[];
level?: number;
parentId?: string;
}) => void;
// 新增根节点变量
// Add root node variable
addRootVariable: (variable: Omit<Variable, 'channel'>) => void;
// 新增子节点变量
// Add sub-node variable
addChildVariable: (variable: Variable) => void;
// 删除变量
// Delete variable
deleteVariable: (variable: Variable) => void;
// 保存后作为历史变量对待
// After being preserved, it is treated as a historical variable
saveHistory: () => void;
// 获取DTO variable
// Get DTO variable
getDtoVariable: (variable: Variable) => ProjectMemory.Variable;
// 获取groups下所有的变量
// Get all the variables under groups
getAllRootVariables: () => Variable[];
// 获取groups下所有的变量
// Get all the variables under groups
getAllVariables: () => Variable[];
transformDto2Vo: (data: ProjectMemory.GroupVariableInfo[]) => VariableGroup[];
initStore: (data: {
@@ -113,7 +113,7 @@ export interface VariableGroupsAction {
canEdit: boolean;
}) => void;
clear: () => void;
// 在变量树中查找变量,并可选地修改或删除
// Locate variables in the variable tree and optionally modify or delete them
findAndModifyVariable: (
groupId: string,
predicate: (variable: Variable) => boolean,
@@ -328,7 +328,7 @@ export const useVariableGroupsStore = create<
},
transformDto2Vo: data => {
const transformedData = getGroupListByDto(data);
// 在数据转换完成后立即更新meta信息
// After the data conversion is completed, update the meta information immediately
transformedData.forEach(group => {
get().updateMeta({ variables: group.varInfoList });
});

View File

@@ -104,7 +104,7 @@ const getSubGroupListByDto = ({
subGroupList?.map(subGroup => ({
...getBaseGroupInfoByDto({
...subGroup,
DefaultChannel: group.DefaultChannel, // 服务端返回的 subGroup 没有 DefaultChannel需要手动设置
DefaultChannel: group.DefaultChannel, // The subGroup returned by the server level has no DefaultChannel and needs to be set manually
}),
groupId,
varInfoList: getGroupVariableListByDto({

View File

@@ -24,7 +24,7 @@ import { type VariableSchemaDTO, VariableTypeDTO } from '../types';
import { type Variable } from '../store';
/**
* 前端变量类型
* Front-end variable type
*/
export enum ViewVariableType {
String = 1,
@@ -32,7 +32,7 @@ export enum ViewVariableType {
Boolean,
Number,
Object = 6,
// 上面是 api 中定义的 InputType。下面是整合后的。从 99 开始,避免和后端定义撞车
// The above is the InputType defined in the api. The following is the integrated one. Start from 99 to avoid collisions with the backend definition.
ArrayString = 99,
ArrayInteger,
ArrayBoolean,
@@ -101,7 +101,7 @@ export const getDtoVariable = (
schema: '',
};
// 处理数组类型
// Working with array types
if (type === VariableTypeDTO.List && arrayItemType) {
if (arrayItemType === VariableTypeDTO.Object) {
schema.schema = {
@@ -118,7 +118,7 @@ export const getDtoVariable = (
}
}
// 处理对象类型
// Handling object types
if (type === VariableTypeDTO.Object) {
schema.schema = viewVariable.children?.map(child => {
const childDTO = getDtoVariable(child);

View File

@@ -34,7 +34,7 @@ export interface VariableSchemaDTO {
}
/**
* 前端变量类型
* Front-end variable type
*/
export enum ViewVariableType {
String = 1,
@@ -42,7 +42,7 @@ export enum ViewVariableType {
Boolean,
Number,
Object = 6,
// 上面是 api 中定义的 InputType。下面是整合后的。从 99 开始,避免和后端定义撞车
// The above is the InputType defined in the api. The following is the integrated one. Start from 99 to avoid collisions with the backend definition.
ArrayString = 99,
ArrayInteger,
ArrayBoolean,
@@ -73,7 +73,7 @@ export const VARIABLE_TYPE_ALIAS_MAP: Record<ViewVariableType, string> = {
// eslint-disable-next-line @typescript-eslint/no-namespace
export namespace ViewVariableType {
/**
* 获取所有变量类型的补集
* Get the complement of all variable types
* @param inputTypes
*/
export function getComplement(inputTypes: ViewVariableType[]) {