Options
All
  • Public
  • Public/Protected
  • All
Menu

Module data/dataTypeUtils

Index

Functions

convert2RefType

  • 会改变原来的结构,最好自己做深拷贝

    example

    RefType - 用于前端界面的类型描述 { asset: { type: 'object', propertyList: [ { name: 'id', $ref: '#/basicType/Long' }, { name: 'name', $ref: '#/basicType/String' }, ], }, assetType: { type: 'enum', enumItemList: [ { value: 'COMPUTER', label: '台式机' }, { value: 'TABLET', label: '平板电脑' }, { value: 'MOBILE', label: '移动电话' }, }, }, assets: { isArray: true, $ref: '#/xxxx/entity/asset' }, test: { $ref: '#/basicType/Date' } }

    Parameters

    Returns Schema

convert2SchemaType

  • convert2SchemaType(schema: Schema, options?: { enum?: string }): Schema
  • 会改变原来的结构,最好自己做深拷贝

    example

    SchemaType - 非标准的 JSON Schema 结构 { asset: { type: 'object', propertyList: [ { type: 'int', format: 'long' }, { type: 'string' }, ], }, assetType: { type: 'enum', enumItemList: [ { value: 'COMPUTER', label: '台式机' }, { value: 'TABLET', label: '平板电脑' }, { value: 'MOBILE', label: '移动电话' }, }, }, assets: { isArray: true, items: { $ref: '#/xxxx/entity/asset' } }, test: { type: 'string', format: 'date' } }

    Parameters

    • schema: Schema
    • options: { enum?: string } = ...
      • Optional enum?: string

    Returns Schema

genFullRefSchemaChildren

  • genFullRefSchemaChildren(schema: Schema, code: string, usedSchemaRefs?: {}): any[]
  • 根据 Ref Schema 生成子节点

    Parameters

    • schema: Schema
    • code: string
    • usedSchemaRefs: {} = ...
      • [name: string]: boolean

    Returns any[]

genInitData

  • genInitData(schema: Schema, relationship?: string, usedSchemaRefs?: {}): any
  • Parameters

    • schema: Schema
    • relationship: string = 'None'
    • usedSchemaRefs: {} = ...
      • [name: string]: boolean

    Returns any

genRefSchemaChildren

  • genRefSchemaChildren(schema: Schema, code: string, usedSchemaRefs?: {}): any[]
  • 根据 Ref Schema 生成子节点

    Parameters

    • schema: Schema
    • code: string
    • usedSchemaRefs: {} = ...
      • [name: string]: boolean

    Returns any[]

genSchemaChildren

  • genSchemaChildren(schema: Schema, code?: string, usedSchemaRefs?: {}): any[]
  • 根据 Ref Schema 生成子节点

    Parameters

    • schema: Schema
    • code: string = ''
    • usedSchemaRefs: {} = ...
      • [name: string]: boolean

    Returns any[]

Generated using TypeDoc