跳转到内容

项启用逻辑,项显示逻辑,项空输入逻辑

在绘制部件成员时,可配置逻辑来控制部件成员是否禁用、隐藏、必填。脚本逻辑都是单行脚本模式,即返回一行脚本内容,返回值为boolean值。目前支持这些逻辑的有面板项、表单成员。

参数

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

调用示例

基于上下文数据判断当前表单成员是否显示

typescript
!context.is_delete;

基于当前数据判断当前表单成员是否必填

typescript
(data.result_state !== 1 && data.result_state !== 2) || (!!data.curstage_id && data.curstage_id == data.stage_id)

基于当前环境数据判断当前表单成员是否禁用

typescript
context.cur_reviewer_id == context.srfuserid &&
  context.curstage_state == 20 &&
  context.curstage_id == data.stage_id;
未来已来,立即拥抱应用融合的力量
Released under the MIT License.