跳转到内容

处理逻辑

可配置实体处理逻辑为脚本代码模式,脚本中返回一个对象数据。脚本代码表为异步脚本,可用来返回模拟数据,或者在脚本中请求自定义接口数据。

参数

名称类型描述
documentDocument当前文档对象
selector(className: string) => HTMLCollectionOf<Element>元素选择器
envIEnvironment当前环境对象
appSessionIApiData当前应用会话对象
contextIApiContext当前视图上下文
viewParamIApiParams当前视图参数
dataIApiData当前数据
appIApiAppHubController当前应用
util{ message: IApiMessageUtil, notification: IApiNotificationUtil,modal: IApiModalUtil,confirm: IApiConfirmUtil,openView: IApiOpenViewUtil}工具集

调用示例

返回模拟数据

ts
const result = {
  age: 18,
  name: '张三',
  sex: '男',
};
return result;

请求实体自定义接口数据

ts
const res = await app.deService.exec(
    'plmweb.work_item_wizard',
    'getwizard',
    context,
    {
        size: 1000,
        n_dynamodelflag_noteq: 0,
    },
);
if (res.ok) {
    return res.data;
}
return {};
未来已来,立即拥抱应用融合的力量
Released under the MIT License.