01.导入导出按钮

"actions": [{
            "key": "import",
            "label": "导入",
            "action": "COMMON_IMPORT",
            "roles": ["cm-org-emp"]
        },
        {

            "default": true,
            "action": "COMMON_EXPORT",
            "label": "导出",
            "key": "common_export",
            "roles": ["cm-org-emp"],
            "left": true

        }
    ]

02.批量删除按钮

{
        "action": "DELETE_BATCH",
        "key": "delete_batch",
        "condition": "MULTI_ITEM",
        "label": "批量删除"
}

03.根据列表某一字段的值进行按钮的隐藏显示

{
             "condition": ["ITEM"],
             "label": "提交",
             "key": "submit",
             "hide": "=function(){if(ITEM()==null){return true} else { return ITEM().state!=1?false:true}}",
             "func": "=function(){var data=ITEM();if (data.state==1){SCOPE.show_warning('该数据已提交');return;};SCOPE.show_warning('正在处理,不要重复点击');SCOPE.dynamicAction('submit',{'data':data}).then(function(data){SCOPE.fetchData();});SCOPE.fetchData();}"
         
}

04.点击按钮弹出另一个模型卡片


{
             "action": "DYNAMIC_INFO",
             "key": "dialog",
             "label": "编辑",
             "params": {
                 "async": true,
                 "model": "recruitment_plan_year",
                 "state": "single_view",
                 "mode": "edit",  #new|edit|view
                 "data": "=function(){return dataService.callHcmOpenApi('hcm.model.get',{'model':'recruitment_plan_year','id_':ITEM().id}) }"
             }
}

05.根据列表某一字段控制按钮显示隐藏

{
  "actions": [
    {
      "condition": ["ITEM"],
      "label": "数据拆分",
      "key": "split",
      "hide": "=function(){if(ITEM()==null){return true} else { return ITEM().split==0?false:true}}",
      "func": "=function(){var data=ITEM();if (data.split==1){SCOPE.show_warning('该数据已拆分');return;};SCOPE.show_warning('正在处理,不要重复点击');SCOPE.dynamicAction('split',{'data':data}).then(function(data){SCOPE.fetchData();});SCOPE.fetchData();}"
    },
  {
      "condition": ["ITEM"],
      "label": "提交",
      "key": "submit",
      "hide": "=function(){if(ITEM()==null){return true} else { return ITEM().state!=1?false:true}}",
      "func": "=function(){var data=ITEM();if (data.state==1){SCOPE.show_warning('该数据已提交');return;};SCOPE.show_warning('正在处理,不要重复点击');SCOPE.dynamicAction('submit',{'data':data}).then(function(data){SCOPE.fetchData();});SCOPE.fetchData();}"
    },{
      "condition": ["ITEM"],
      "label": "取消提交",
      "key": "cancel",
      "hide": "=function(){if(ITEM()==null){return true} else { return ITEM().state==1?false:true}}",
      "func": "=function(){var data=ITEM();if (data.state!=1){SCOPE.show_warning('该数据未提交');return;};SCOPE.show_warning('正在处理,不要重复点击');SCOPE.dynamicAction('cancel',{'data':data}).then(function(data){SCOPE.fetchData();});SCOPE.fetchData();}"
    }],
   "list_config": {
         "operate_default": "=function(item){if(item.state!=1){SCOPE.editItem(item);}else{SCOPE.show_warning('该单据已提交不能修改')}}"
     }
}




  • 无标签