function记录

function记录

—何鹏
随手笔记,如有问题还请大家帮忙指出改正

debugger;为前端断点调试

1、字段联动配置,根据字段数据判断另一个字段的属性
"=function(){return !(SCOPE.base_form.data.字段key==1)}"

2、取父级代码项名称
function(_scope,_model){debugger;if(!!_model.parent_id){dataService.callHcmOpenApi('hcm.model.list',{'model':'common_basic_tree_item_data.专业技术职务名称','filter_dict':{'id':_model.parent_id}}).then(function(_data){debugger;SCOPE.data.要显示的字段ID=_data.list[0].name})}}",

"change": "=function(_scope,_model){debugger;if(!!_scope.options.originObject.parent_id){dataService.callHcmOpenApi('hcm.model.list',{'model':'common_basic_tree_item_data.专业技术职务名称','filter_dict':{'id':_scope.options.originObject.parent_id}}).then(function(_data){debugger;SCOPE.data.要显示的字段=_data.list[0].name})}}"

3、hc-input组件文本框数据联动
失去焦点事件触发"customBlur": "=function(_scope, model){debugger;SCOPE.base_form.data.demo2=model}"

4、根据字段id判断返回结果true 或 false
"=function(){debugger;if (SCOPE.base_form.data.model === xxxx || SCOPE.base_form.data.action_id === xxxx) {return true} else {return false}}"