Options
All
  • Public
  • Public/Protected
  • All
Menu

Class WebService

前端服务(模块)类

Hierarchy

Index

Constructors

constructor

Properties

Protected Readonly JSON_EXCLUDED_KEYS

JSON_EXCLUDED_KEYS: Set<string>

toJSON 时需要去除的键,为了避免出现 CircularJSON

Readonly _cacheTimestamp

_cacheTimestamp: string = ...

前端记录缓存的时间戳

Protected _mutable

_mutable: boolean = true

可修改标志,内部属性 标记在构造函数结束后是否可修改

Readonly _uuid

_uuid: string = ...

唯一 uuid 目前主要用于前端 Debug 区分两个实例

Readonly api

api: { builtInFunctions: {}; features: {} } = ...

Type declaration

  • builtInFunctions: {}
    • [name: string]: any
  • features: {}
    • [name: string]: boolean

Readonly app

app: App = ...

所在的 App 父级引用,便于在树状结构中查找

Readonly appId

appId: string = ...

App 的 Id

Readonly config

config: string = ...

其他配置

Readonly createdBy

createdBy: string = ...

创建人

Readonly createdTime

createdTime: string = ...

创建时间

Readonly data

data: DataNode = ...

数据节点

Readonly dnsAddr

dnsAddr: string = ...

editable

editable: boolean = true

是否可编辑

editing

editing: boolean = false

是否正在编辑 前端 UI 状态

expanded

expanded: boolean = true

节点是否为展开状态 前端 UI 状态

Readonly icon

icon: string = ...

服务图标

Readonly id

id: string = ...

Service Id

Readonly ideVersion

ideVersion: string = ...

IDE 版本

Readonly interfaces

interfaces: Interface[] = ...

接口列表

isLeaf

isLeaf: boolean = false

是否为叶子节点 前端 UI 状态

Readonly level

level: LEVEL_ENUM = ...

概念类型

loading

loading: boolean = false

是否正在请求 前端 UI 状态

Readonly name

name: string = ...

前端服务标识

Readonly officialType

officialType: "nonofficial" | "official" = ...

是否为官方服务

Readonly packageInfo

packageInfo: { componentDependencies: {}; template: { name: string; version: string }; ui: { name: string; version: string } } = ...

packageJSON 的缩减版

Type declaration

  • componentDependencies: {}
    • [name: string]: string
  • template: { name: string; version: string }
    • name: string
    • version: string
  • ui: { name: string; version: string }
    • name: string
    • version: string

Readonly pages

pages: Page[] = ...

前端页面

Readonly status

status: "UNPUBLISHED" | "PUBLISHED" | "REPOSITORYCREATED" | "FSSTARTED" | "APPINIT" | "CODESYNCED" | "CICDCREATED" = ...

服务状态

Readonly title

title: string = ...

前端服务标题

Readonly type

type: SERVICE_TYPE = ...

服务类型

Readonly updatedBy

updatedBy: string = ...

修改人

Readonly updatedTime

updatedTime: string = ...

修改时间

Methods

Private _onPageTreeChange

  • _onPageTreeChange(): void
  • Returns void

addPage

  • Parameters

    Returns Promise<Page>

assign

  • assign(source: any): void
  • Parameters

    • source: any

    Returns void

deepPick

  • deepPick(source: any, keys?: string[]): void
  • 从对象中深度获取

    example

    比如一般后端返回只是添加了个 id

    this.deepPick(result, ['id'])
    

    Parameters

    • source: any
    • keys: string[] = ...

    Returns void

emit

  • emit(eventName: string, ...args: any[]): void
  • 触发事件

    Parameters

    • eventName: string

      事件名

    • Rest ...args: any[]

      事件参数

    Returns void

emitVertexIdToNameChange

  • emitVertexIdToNameChange(): void

findUsage

  • findUsage(): Promise<any>
  • 查找引用

    Returns Promise<any>

genAllAssetsInfo

  • 根据 packageInfo 的信息生成用于 load 的 assetsInfo 在环境中需要 basic 和 custom 分开 load,否则容易报错

    Parameters

    • prefix: string

    Returns { basic: AssetsInfo; custom?: AssetsInfo }

load

  • Returns Promise<WebService>

loadInterfaces

loadPackageInfo

  • loadPackageInfo(): Promise<void>
  • Returns Promise<void>

loadPages

  • loadPages(): Promise<Page[]>
  • Returns Promise<Page[]>

loadStructures

off

  • 取消监听事件

    Parameters

    Returns void

on

  • 监听事件

    Parameters

    Returns void

once

  • 只监听一次事件

    Parameters

    Returns void

pick

  • pick(source: any, keys?: string[]): void
  • Parameters

    • source: any
    • keys: string[] = ...

    Returns void

plainAssign

  • plainAssign(source: any): void
  • Parameters

    • source: any

    Returns void

savePackageInfo

  • savePackageInfo(): Promise<any>
  • Returns Promise<any>

toJSON

  • toJSON(parentKey?: string, excludedKeys?: string[]): any
  • 去除循环依赖,转为纯 JSON

    Parameters

    • Optional parentKey: string

      外面的 key

    • excludedKeys: string[] = ...

      需要额外排除的 keys

    Returns any

toPlainJSON

  • toPlainJSON(parentKey?: string, excludedKeys?: string[]): any
  • 转为单层的 JSON

    Parameters

    • Optional parentKey: string

      外面的 key

    • excludedKeys: string[] = ...

      需要额外排除的 keys

    Returns any

Static from

  • 从后端 JSON 生成规范的 WebService 对象

    Parameters

    • source: any

      JSON

    • app: App

      父级 App

    Returns WebService

Static getVertexByRef

  • getVertexByRef(ref: string): Vertex

Generated using TypeDoc