›R3

    R3

    • R3 START
    • R3 API
    • R3 Route Policy
    • R3 CustomPage Configuration Rules
    • R3 CustomTab Policy
    • R3 Form Config
    • R3 System Configuration URL JumpRules
    • R3 Store
    • Extention Configuration
    • R3 Mixin
    • R3 Update
    • R3-components Update

    项目级自定义扩展属性配置

    获取框架默认配置项

    前端开发者,可以利用burgeon-r3提供的以下方法获得框架默认配置项

      import R3 from 'burgeon-r3';
    
      // 获取“字段”默认扩展属性
      const defaultExConfForColumn = R3.config.extentionForColumn;
      
      // 获取“表”默认扩展属性
      const defaultExConfForTable = R3.config.extentionForTable;
    

    传入项目自定义配置项

    由于不同的项目需要应对的业务场景各有不同,框架支持自定义配置。前端开发者可以在启动项目时传入指定配置,替换框架默认配置。

      import R3 from 'burgeon-r3';
      
      // To Do
      // Your Code For Sth.
      
      // 启动
      R3.launchApplication({
    
        ...  // other configuration
    
        extentionForTable: [...], // 项目自定义“表”扩展属性列表
    
        extentionForColumn: [...], // 项目自定义“字段”扩展属性列表
    
        ... // other configuration
    
      });
    

    配置规则说明

    配置信息格式为对象数组JSON Array [{}, ..., {}],数组内每个item的配置如下。

    目前只支持四类配置类型,分别为:radio、input、object-group、input-group

    radio 类型

    keyisRequiredDescription
    nameYes配置界面显示的名称
    keyYes传导给服务端的键值key
    typeYes扩展属性类型,radio
    enumerateValueYes枚举值(Array)
    descriptionfalse配置界面显示的描述信息
    {
        name: '是否加密',
        key: 'ispassword',
        type: 'radio',
        enumerateValue: [{ text: '是', value: true }, { text: '否', value: false }],
        description: '加密后字段值即显示***',
        supportType: ['byPage']
      }
    

    input 类型

    keyisRequiredDescription
    nameYes配置界面显示的名称
    keyYes传导给服务端的键值key
    typeYes扩展属性类型,input
    outputValueTypefalse输出类型[String, Array, JSON]
    descriptionfalse配置界面显示的描述信息
     {
        name: '前端自定义参数',
        key: 'webconf',
        type: 'input',
        outputValueType: 'JSON', // 默认为String类型,表示其输出格式应该为字符串。其他可选值:outputValueType: 'Array', 表示其输出格式为数组, outputValueType: 'JSON',表示其输出格式为JSON对象。请开发者自行配置后以体验不同效果。
        description: '自定义参数格式及内容',
      }
    

    object-group 类型

    keyisRequiredDescription
    nameYes配置界面显示的名称
    keyYes传导给服务端的键值key
    typeYes扩展属性类型,object-group
    showLabelfalse界面是否显示label信息
    enableIncreasefalse是否可动态添加组
    objectInfoYesJSON Array,详见下文示例
    descriptionfalse配置界面显示的描述信息
      {
        name: '列表默认排序',
        key: 'orderby',
        type: 'object-group',
        showLabel: false,
        enableIncrease: true,
        // objectInfo: 是一个嵌套类型,目前只允许嵌套type为input、radio的类型,具体效果请自行配置体验。用法如下:
        objectInfo: [
          {
            name: '字段名称',
            key: 'column',
            type: 'input'
          },
          {
            name: '升序',
            key: 'asc',
            type: 'radio',
            enumerateValue: [{ text: '是', value: true }, { text: '否', value: false }],
          }
        ],
        description: '进入列表界面之后,列表中的数据默认排序方式配置'
      },
    
    

    input-group 类型

    keyisRequiredDescription
    nameYes配置界面显示的名称
    keyYes传导给服务端的键值key
    typeYes扩展属性类型,input-group
    inputListsYesJSON Array,详见下文示例
    descriptionfalse配置界面显示的描述信息
      {
        name: '外键下拉列表',
        key: 'fkdrplist',
        type: 'input-group',
        // inputLists: 是一个嵌套类型,目前只允许嵌套type为input、radio、object-group的类型,具体效果请自行配置体验。用法如下:
        inputLists: [
          {
            name: '排序信息',
            key: 'orderby',
            type: 'object-group',
            showLabel: true,
            enableIncrease: true,
            objectInfo: [
              {
                name: '字段名称',
                key: 'column',
                type: 'input'
              },
              {
                name: '升序',
                key: 'asc',
                type: 'radio',
                enumerateValue: [{ text: '是', value: true }, { text: '否', value: false }],
              }
            ]
          },
          {
            name: '下拉列表显示列',
            key: 'searchcols',
            type: 'input',
            outputValueType: 'Array'
          },
          {
            name: 'xxx',
            key: 'asc',
            type: 'radio',
            enumerateValue: [{ text: 'xxx', value: 'xxx' }, { text: 'xxx', value: 'xxx' }],
          }
        ],
        description: '外键关联字段,下拉窗口,指定显示的列、指定用于数据排序的列'
      }
    

    配置结构示例

    [ 
        { 
            name:'列表默认排序',
            key:'orderby',
            type:'object-group',
            showLabel:false,
            enableIncrease:true,
            objectInfo:[ 
                { 
                    name:'字段名称',
                    key:'column',
                    type:'input'
                },
                { 
                    name:'升序',
                    key:'asc',
                    type:'radio',
                    enumerateValue:[ 
                        { 
                            text:'是',
                            value:true
                        },
                        { 
                            text:'否',
                            value:false
                        }
                    ],
    
                }
            ],
            description:'进入列表界面之后,列表中的数据默认排序方式配置'
        },
        { 
            name:'模糊匹配',
            key:'fuzzyQuery',
            type:'object-group',
            enableIncrease:true,
            objectInfo:[ 
                { 
                    name:'字段名称',
                    key:'colName',
                    type:'input'
                },
                { 
                    name:'模糊匹配方式',
                    key:'matchType',
                    type:'radio',
                    enumerateValue:[ 
                        { 
                            text:'全模糊',
                            value:'%X%'
                        },
                        { 
                            text:'右模糊',
                            value:'X%'
                        },
                        { 
                            text:'左模糊',
                            value:'%X'
                        }
                    ],
    
                }
            ],
            description:'用户手工输入进行模糊匹配,模糊匹配的列按照顺序配置'
        },
        { 
            name:'输入键查询字段',
            key:'ak2',
            type:'input',
            description:'指定为AK2的字段可用于在列名界面进行查询'
        },
        { 
            name:'明细表不显示导出按钮',
            key:'DisableEXPORT',
            type:'radio',
            enumerateValue:[ 
                { 
                    text:'是',
                    value:true
                },
                { 
                    text:'否',
                    value:false
                }
            ],
            description:'表的数据由定制服务查询写入,而非标准的数据,不支持导出,则可隐藏导出按钮'
        }
    ]
    
    ← R3 StoreR3 Mixin →
    • 获取框架默认配置项
    • 传入项目自定义配置项
    • 配置规则说明
      • radio 类型
      • input 类型
      • object-group 类型
      • input-group 类型
    • 配置结构示例
    相关资源
    ARK Share
    - 前端组件资源共享平台
    Ark Cli
    - 前端开发工具
    ARK Dingtalk
    - 基于钉钉E应用的移动端组件库
    ARK Design
    - 服务于企业级产品的设计语言
    应用项目
    Burgeon R3JFlow
    更多信息
    Copyright © 2020 syman reserved.
    友情链接
    快递查询