chore: replace all cn comments of fe to en version by volc api (#320)
This commit is contained in:
@@ -34,23 +34,23 @@ export enum MockDataStatus {
|
||||
export interface MockDataWithStatus {
|
||||
/** key */
|
||||
key: string;
|
||||
/** 字段名称 */
|
||||
/** field name */
|
||||
label: string;
|
||||
/** 字段值 */
|
||||
/** field value */
|
||||
realValue?: string | number | boolean;
|
||||
/** 展示使用 */
|
||||
/** display use */
|
||||
displayValue?: string;
|
||||
/** 描述 */
|
||||
/** describe */
|
||||
description?: string;
|
||||
/** 是否必填 */
|
||||
/** Is it required? */
|
||||
isRequired: boolean;
|
||||
/** 字段数据类型 */
|
||||
/** field data type */
|
||||
type: MockDataValueType;
|
||||
/** for array */
|
||||
childrenType?: MockDataValueType;
|
||||
/** 字段状态 */
|
||||
/** Field Status */
|
||||
status: MockDataStatus;
|
||||
/** 字段子节点 */
|
||||
/** Field sub-node */
|
||||
children?: MockDataWithStatus[];
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import type { JSONSchema7, JSONSchema7TypeName } from 'json-schema';
|
||||
import {
|
||||
TrafficScene,
|
||||
@@ -56,9 +56,9 @@ export const calcStringSize = (str: string) => {
|
||||
const { size } = new Blob([str]);
|
||||
return size;
|
||||
};
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- plugin resp 的类型由用户定义,包含任何可能
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- The type of the plugin resp is user-defined and contains any possible
|
||||
type PluginRespType = any;
|
||||
// 转换 DataWithStatus 格式到 Object 格式
|
||||
// Convert DataWithStatus format to Object format
|
||||
export function transDataWithStatus2Object(
|
||||
data: MockDataWithStatus,
|
||||
excludeRemovedItem?: boolean,
|
||||
@@ -128,7 +128,7 @@ export function getMockValue(
|
||||
}
|
||||
}
|
||||
|
||||
// 由 schema 生成 DataWithStatus 时不同类型的生成逻辑
|
||||
// Different types of generation logic when generating DataWithStatus from schema
|
||||
function getInitialValue(
|
||||
type: MockDataValueType,
|
||||
): [string | number | boolean | undefined, string | undefined] {
|
||||
@@ -144,7 +144,7 @@ function getSchemaType(type?: JSONSchema7TypeName | JSONSchema7TypeName[]) {
|
||||
return val === 'null' ? undefined : (val as MockDataValueType);
|
||||
}
|
||||
|
||||
// 转换 schema 格式到 DataWithStatus 格式(包含初始化逻辑)
|
||||
// Convert schema format to DataWithStatus format (including initialization logic)
|
||||
// eslint-disable-next-line complexity
|
||||
export function transSchema2DataWithStatus(
|
||||
label: string,
|
||||
@@ -223,7 +223,7 @@ export function transSchema2DataWithStatus(
|
||||
return item;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- 内容结构依赖用户定义的 plugin resp 结构,包含任何可能
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- The content structure depends on the user-defined plugin resp structure, including any possible
|
||||
export function stringifyEditorContent(value: any) {
|
||||
return JSON.stringify(value, null, FORMAT_SPACE_SETTING);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user