# Development Quick Reference Manual

The following are commonly used interfaces and data format descriptions in system development

# Target Audience

The target audience for this document is: Developers and implementers of this system

# Field Cascading

For detailed information, please refer to Custom Field Linkage

# Injected Variables

Variable Name Variable Type Description
application grails.core.GrailsApplication Current grails application context
userContext grails.plugin.springsecurity.userdetails.GrailsUser Current operating user information
domainName java.lang.String Current operating object type without the package part
sourceColumn java.lang.String Driving column, changes to this field triggered this customization
destColumn java.lang.String Target column, the return result of customization will act on this column
sourceColumnValue java.lang.String Value of the driving column
object org.grails.web.json.JSONObject Current values of each field on the interface of the object being edited by the user
log Closure<?> Log closure for printing execution logs

# Return Result

return [
  //指定该字段的显示状态:hide 为隐藏、show 为显示且可编辑、readonly 为只读
  //Specify the display status of the field: hide for hidden, show for editable, and readonly for read-only
  display: hide | show | readonly

  // 指定该字段是否必填, true 表示必填,false 表示非必填
  // Specify whether the field is required: true for required, false for non-required
  required: true | false

  // 指定该字段的值,如果是个多选字段,可以使用 [] 的形式来指定多个值
  // Specify the value of the field, if it is a multi-select field, you can use the [] form to specify multiple values
  value: [] 或者 xxx,

  // 如果该字段是个选择类型的字段,如下的返回值指定其备选项,
  // 每个备选项均包括显示给用户看的 Label 属性和实际保存的 value 属性
  // If the field is a select type field, the following return value specifies its options,
  // each option includes the Label attribute displayed to the user and the value attribute actually saved
  options: [
      {
          "value": "ABSTRACT_DATE",
          "label": "Abstract date"
      },
      {
          "value": "ABSTRACT_DATE_TIME",
          "label": "Abstract date with time"
      }
  ]
]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

For detailed information, please refer to Field Quick Search Logic

# Injected Variables

Variable Name Variable Type Description
ownerClass java.lang.Class<?> The object type to which this field belongs
fieldName java.lang.String The field name of the field to be searched in the object
fieldClass java.lang.Class<?> The field type of the field to be searched
keyword java.lang.String Search keyword
userContext grails.plugin.springsecurity.userdetails.GrailsUser Current operating user information
application grails.core.GrailsApplication Current grails application context
log Closure<?> Log closure for printing execution logs

# Return Result

return [
  // 包含且仅包含一个 key 为 result 的数组
  // Contains and only contains an array with a key of result
  'result': [// result 中是一个数组
    // 数组中每个元素都是一个 domain 对象
    // Each element in the array is a domain object
  ]
]
1
2
3
4
5
6
7

# Field Validation

For detailed information, please refer to Custom Field Validation

# Injected Variables

Variable Name Variable Type Description
userContext grails.plugin.springsecurity.userdetails.GrailsUser Current operating user information
application grails.core.GrailsApplication Current grails application context
domainName java.lang.String Name of the current operating object type
destColumn java.lang.String Name of the target column for validation
destColumnValue java.lang.Object Value of the target column
create boolean Whether it's a create operation, if false it indicates an update operation
requestData java.lang.Object JSON serialization of all field values in the front-end form
objectId java.lang.Long ID of the object being validated, for create operations, the value is -1
log Closure<?> Log closure for printing execution logs

# Return Result

// result key 对应的 value 即为系统会传递到前台的默认值
// The value corresponding to the result key is the default value passed to the frontend by the system
return [
  valid: true | false,
  message: "校验失败的界面提示信息 Field validation failure information"
]
1
2
3
4
5

# Field Default Value

For detailed information, please refer to Custom Field Default Value

# Injected Variables

Variable Name Variable Type Description
objectType tech.muyan.DomainClass Current operating object type
userContext grails.plugin.springsecurity.userdetails.GrailsUser Current operating user information
destColumn java.lang.String Target column for setting default value
destColumnType java.lang.String Full type name of the target column
application grails.core.GrailsApplication Current grails application context
log Closure<?> Log closure for printing execution logs

# Return Result

// result key 对应的 value 即为系统会传递到前台的默认值
// The value corresponding to the result key is the default value passed to the frontend by the system
return [result: xxx]
1
2

# Object Creation Hook

For detailed information, please refer to Object Lifecycle Customization

# Injected Variables

Variable Name Variable Type Description
object <? extends GormEntity> Object instance
dynamicFieldValues List<tech.muyan.dynamic.field.DynamicFieldValue> Values of all dynamic fields
userContext grails.plugin.springsecurity.userdetails.GrailsUser Current operating user information
application grails.core.GrailsApplication Current grails application context
log Closure<?> Log closure for printing execution logs
hookType tech.muyan.enums.ObjectHookType Type of the current executing object hook

# Exception Handling

In the customization logic before an operation, you can directly modify the object instance parameter to implement customization, and modifications to the object instance will be saved to the database.

During the execution of the customization code logic before and after the operation, exceptions can be thrown to interrupt the system's operation process on the object, as detailed below:

  • If an exception of type tech.muyan.exception.CustomLogicInterruptException or its subtype is caught, the object's operation process will be interrupted, the operation will not be saved to the database, and the Message of the exception will be displayed to the user as an error in the frontend.

  • If an exception of type tech.muyan.exception.CustomLogicWarningException or its subtype is caught, the object's operation process will not be interrupted, but the Message of the exception will be displayed to the user as a warning in the frontend.

# Object Update Hook

For detailed information, please refer to Object Lifecycle Customization

# Injected Variables

Variable Name Variable Type Description
oldObject <? extends GormEntity> Copy of the object instance before update
newObject <? extends GormEntity> Updated object instance including dynamic fields
userContext grails.plugin.springsecurity.userdetails.GrailsUser Current operating user information
application grails.core.GrailsApplication Current grails application context
log Closure<?> Log closure for printing execution logs
hookType tech.muyan.enums.ObjectHookType Type of the current executing object hook

# Exception Handling

In the customization logic before an operation, you can directly modify the object instance parameter to implement customization, and modifications to the object instance will be saved to the database.

During the execution of the customization code logic before and after the operation, exceptions can be thrown to interrupt the system's operation process on the object, as detailed below:

  • If an exception of type tech.muyan.exception.CustomLogicInterruptException or its subtype is caught, the object's operation process will be interrupted, the operation will not be saved to the database, and the Message of the exception will be displayed to the user as an error in the frontend.

  • If an exception of type tech.muyan.exception.CustomLogicWarningException or its subtype is caught, the object's operation process will not be interrupted, but the Message of the exception will be displayed to the user as a warning in the frontend.

# Object Deletion Hook

For detailed information, please refer to Object Lifecycle Customization

# Injected Variables

Variable Name Variable Type Description
object <? extends GormEntity> Object to be deleted
userContext grails.plugin.springsecurity.userdetails.GrailsUser Current operating user information
application grails.core.GrailsApplication Current grails application context
log Closure<?> Log closure for printing execution logs
hookType tech.muyan.enums.ObjectHookType Type of the current executing object hook

# Exception Handling

In the customization logic before an operation, you can directly modify the object instance parameter to implement customization, and modifications to the object instance will be saved to the database.

During the execution of the customization code logic before and after the operation, exceptions can be thrown to interrupt the system's operation process on the object, as detailed below:

  • If an exception of type tech.muyan.exception.CustomLogicInterruptException or its subtype is caught, the object's operation process will be interrupted, the operation will not be saved to the database, and the Message of the exception will be displayed to the user as an error in the frontend.

  • If an exception of type tech.muyan.exception.CustomLogicWarningException or its subtype is caught, the object's operation process will not be interrupted, but the Message of the exception will be displayed to the user as a warning in the frontend.

# Object API Return Data

For more information, please refer to Object API Return Data Customization

# Injected Variables

Variable Name Variable Type Description
object <? extends GormEntity> Object instance to be returned by the interface
userContext grails.plugin.springsecurity.userdetails.GrailsUser Current operating user information
application grails.core.GrailsApplication Current grails application context
page tech.muyan.enums.CustomRenderPageType Page calling this render method
log Closure<?> Log closure for printing execution logs
ownerClass java.lang.Class<? extends GormEntity> For search pages, the object owning the search field
fieldName java.lang.String For search pages, the name of the search field
fetchType tech.muyan.enums.FetchType Type of data retrieval

The fetchType parameter selects the range of data to be returned based on different business scenarios on the interface. The current optional values are explained as follows:

Value Description
ONLY_LABEL_FIELD Only retrieve the Label field and id
EXCLUDE_ARRAY_COLUMNS Return values of all fields except one-to-many and many-to-many associated objects
ALL_COLUMNS Return values of all fields

The optional values for the page parameter are as follows:

Value Description
RELATED_SEARCH Related object list page with search conditions
RELATED Related object list page
LIST_SEARCH Main list page with search conditions
LIST Main list page
FINDER Search page
FINDER_SEARCH Search page with search conditions
DETAIL Detail or edit page
SHOW_MULTIPLE Return value of Show multiple API

# Return Result

// 该客制化代码需要返回的结果为一个 Map, key 为 result, value 中为 [返回字段名: 字段值] 的 Map 的格式返回结果
// The result returned by the custom code needs to be a Map, with a key of result and a value of [return field name: field value] in the format of a Map
[
  result: [
    columnName: columnValue,
    // 对象类型的子字段返回一个只包含 id 的子 map
    objectField: [
      id: objectId
    ],
    // 用于 card list view 进行 HTML 渲染的属性
    "@HTML_CONTENT@": ""
  ]
]
// 或者直接为一个 org.grails.datastore.gorm.GormEntity 对象的实例
// Or directly return an instance of an org.grails.datastore.gorm.GormEntity object
return object
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

# Object Detail Access Hook

For more information, please refer to Object Detail Access

# Injected Variables

Variable Name Variable Type Description
object <? extends GormEntity> Object instance
renderedObject <? extends GormEntity> or Map<String, Object> Object instance or Map object containing object data returned by Render API
userContext grails.plugin.springsecurity.userdetails.GrailsUser Current operating user information
application grails.core.GrailsApplication Current grails application context
fetchType tech.muyan.enums.FetchType Type of data retrieval
log Closure<?> Log closure for printing execution logs
hookType tech.muyan.enums.ObjectHookType.ACCESS Type of the current executing object hook

# Dynamic Creation Permission

For detailed information, please refer to Dynamic Creation Permission

# Injected Variables

Variable Name Variable Type Description
objectType Class<?> The current operating object type
userContext grails.plugin.springsecurity.userdetails.GrailsUser The current operating user information
application grails.core.GrailsApplication The current grails application context
log Closure<?> The log closure for printing execution logs

# Return Result

// 本行代码返回允许用户创建该对象
// Allow user to create this object
return ['create': true] 
1
2

# Dynamic Update and Delete Permission

For detailed information, please refer to Dynamic Update and Delete Permission

# Injected Variables

Variable Name Variable Type Description
objectType Class<?> The current operating object type
userContext grails.plugin.springsecurity.userdetails.GrailsUser The current operating user information
objectValue grails.core.GrailsDomainClass Please use the object parameter Deprecated
object grails.core.GrailsDomainClass The current operating object, the type is the current operating object type
application grails.core.GrailsApplication The current grails application context
log Closure<?> The log closure for printing execution logs

# Return Result

//返回允许用户更新该对象,但不允许用户删除该对象 
//Allow user to update this object, but not allow user to delete this object
return [
  result: [
    'update': true,
    'delete': false
  ]
] 
1
2
3
4
5
6
7

# Scheduled Task Enable Logic

For more information, please refer to Scheduled Task Enable Logic

# Injected Variables

# Return Result

// 表示该 action 或 task 或 widget 是否启用
// Indicates whether this action or task or widget is enabled
[result: true | false]
1
2

# Scheduled Task Core Logic

For more information, please refer to Scheduled Task Core Logic

# Injected Variables

Variable Name Variable Type Description
triggerDatetime java.time.LocalDateTime Trigger time of the scheduled task
task tech.muyan.dynamic.task.DynamicTask Instance of the triggered scheduled task
application grails.core.GrailsApplication Current grails application context
log Closure<?> Log closure for printing execution logs

# Return Result

return [
  //执行结果,类型为文本
  //Execution result, type is text
  execResult: 'OK, Result' 
]
1
2
3
4

# Form Field Group Display Logic

For more information, please refer to Field Group Display Logic Customization

# Injected Variables

Variable Name Variable Type Description
application grails.core.GrailsApplication grails application context
userContext grails.plugin.springsecurity.userdetails.GrailsUser Current operating user information
objectType tech.muyan.DomainClass Form-associated Domain object information
formType tech.muyan.enums.FormType Form type, CREATE or UPDATE
objectId java.lang.Long Target domain object id to run
object <? extends DefaultGrailsDomainClass> Target domain object to run
group tech.muyan.dynamic.form.DynamicFormGroup Current field group object to be judged

# Return Result

// 表示该字段组在界面上的显示模式,可编辑, 隐藏或者只读
// Represents the display mode of the field group on the interface, editable, hidden, or read-only
return [result: editable | readonly | hide]
1
2

# Dynamic Action Display Logic

For more information, please refer to Dynamic Action

# Injected Variables

The difference between enable Logic and core Logic injected variables is that coreLogic injects the parameters parameter, while enableLogic does not inject this variable

# Return Result

// 表示该 action 或 task 或 widget 是否启用
// Indicates whether this action or task or widget is enabled
[result: true | false]
1
2

# Dynamic Action Core Logic

# Injected Variables

The difference between enable Logic and core Logic injected variables is that enableLogic injects objectId, while coreLogic does not inject this variable

# Return Result

// execResult 为字符类型
// execResult is of string type
// redirect 为字符类型
// redirect is of string type
[
  execResult: "执行的结果/Execution result",
  redirect: "执行后的跳转页面/Page to redirect to after execution",
  //类型为tech.muyan.storage.StorageFieldValue
  //Type is tech.muyan.storage.StorageFieldValue
  download: "执行后返回前端的文件/File returned to the frontend after execution"
]
1
2
3
4
5
6
7
8
9
10

# Dynamic Action External Command Replacement

# Replacement Variables

# Dynamic Action Return Result

// execResult 为字符类型
// execResult is of string type
// redirect 为字符类型
// redirect is of string type
[
  execResult: "执行的结果/Execution result",
  redirect: "执行后的跳转页面/Page to redirect to after execution",
  //类型为tech.muyan.storage.StorageFieldValue
  //Type is tech.muyan.storage.StorageFieldValue
  download: "执行后返回前端的文件/File returned to the frontend after execution"
]
1
2
3
4
5
6
7
8
9
10

# Wizard Processing Logic

For more information about wizard processing logic, please refer to Wizard Definition

# Injected Variables

# Return Result

return [
  // 状态为 warning 或者 error 时,前台显示的警告或者错误信息
  // Warning or error information displayed on the frontend when the status is warning or error
  message: "string",
  //经过逻辑处理之后的表单数据,可以修改之前所有步骤收集的字段值
  //Form data after logic processing, can modify the field values collected in all previous steps
  formValues: [ 
    //如果设置了某个在下一步骤会显示的字段的值,则该值会作为下一步骤表单显示的默认值
    //If the value of a field that will be displayed in the next step is set, 
    //the value will be used as the default value for the form displayed in the next step
    df_<dynamicFieldDefinition1Name>: "xx",
    df_<dynamicFieldDefinition2Name>: 123
  ],
  // 如果需要在下一步骤显示某个字段的下拉选项,可以在此返回,格式如下
  // If you need to display a drop-down option for a field in the next step, 
  // you can return it here, in the format below
  options: [
    {
      fieldName: "xxx",
      options: [
        {
          label: "xxx1",
          value: "xxx1"
        },
        {
          label: "xxx2",
          value: "xxx2"
        },
      ]
    }
  ],
  // 如果需要在下一步骤中渲染某个瞬态字段,可以在此返回,格式如下
  // 生成 meta 可以调用 DomainMetaService.buildFieldMeta 方法
  // If you need to render a transient field in the next step, you can return it here, in the format below
  // Generating meta can call the DomainMetaService.buildFieldMeta method
  metas: [
    {
      title: "yyy",
      dataIndex: "yyy",
      key: "yyy",
      editable: true,
      display: true,
      updatable: true,
    }
  ]
  //下一步骤的 step 名称,
  //前台会根据此返回值,调整步骤之间的跳转逻辑,可返回此参数用来实现决策树
  //The name of the next step,
  //The frontend will adjust the logic between steps based on this return value, 
  //you can return this parameter to implement decision tree
  nextStepName: 'Step 2' 
]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51

# Widget Display Logic

# Injected Variables

Variable Name Variable Type Description
userContext grails.plugin.springsecurity.userdetails.GrailsUser Information of the current operating user
application grails.core.GrailsApplication Current grails application context
widget tech.muyan.dynamic.form.DynamicDashboardWidget Widget object

# Return Result

// 表示该 action 或 task 或 widget 是否启用
// Indicates whether this action or task or widget is enabled
[result: true | false]
1
2

# Widget Core Logic

# Injected Variables

Variable Name Variable Type Description
userContext grails.plugin.springsecurity.userdetails.GrailsUser Information of the current operating user
application grails.core.GrailsApplication Current grails application context
widget tech.muyan.dynamic.form.DynamicDashboardWidget Widget object

# Return Result

The structure of the core logic return result for widgets varies depending on the type of widget,

# Incoming System Integration

For more information, please refer to Incoming Integration

# Injected Variables

Variable Name Variable Type Description
integration tech.muyan.dynamic.integration.DynamicIntegration Current executing integration object definition
headers Map<String, String> Request headers
parameters java.lang.Object Request body or request parameters
requestTime java.time.LocalDateTime Request time
requestUrl java.lang.String Request URL without queryString
userContext grails.plugin.springsecurity.userdetails.GrailsUser Current operating user information
organization tech.muyan.Organization Organization to which the integration object belongs
application grails.core.GrailsApplication Current grails application context
log Closure<?> Log closure for printing execution logs

# Enable Logic Return Result

// 表示该 action 或 task 或 widget 是否启用
// Indicates whether this action or task or widget is enabled
[result: true | false]
1
2

# Core Logic Return Result

After the core logic of the integration definition runs, it should return a result of type Map<String, Object> to the system, which the system will directly JSON-ify and return to the caller.

# Outgoing System Integration

For more information, please refer to Outgoing Integration

# Injected Variables

Variable Name Variable Type Description
integration tech.muyan.dynamic.integration.DynamicIntegration Current executing integration object definition
object <? extends GormEntity> Object instance triggering the integration
oldObject <? extends GormEntity> Object before modification (only modified attributes)
newObject <? extends GormEntity> Object after modification
objectType tech.muyan.DomainClass Type of the current operating object
eventType tech.muyan.enums.OutgoingIntegrationListenEvent Domain CUD event triggering the integration
userContext grails.plugin.springsecurity.userdetails.GrailsUser Current operating user information
organization tech.muyan.Organization Organization to which the integration object belongs
application grails.core.GrailsApplication Current grails application context
log Closure<?> Log closure for printing execution logs

# Enable Logic Return Result

// 表示该 action 或 task 或 widget 是否启用
// Indicates whether this action or task or widget is enabled
[result: true | false]
1
2

# Core Logic Return Result

[
  //是否需要平台调用集成的目标 Http 接口
  //Whether to call the target Http interface of the integrated platform
  requestNeeded? : true | false 
  //如需平台调用集成的目标 Http 接口,使用的请求头列表
  //The list of request headers used if let platform to call the target Http API
  headers? : Map<String, String> 
  //如需平台调用集成的目标 Http 接口,使用的请求体或请求参数及值列表
  //The list of request bodies or request parameters and values used if let platform to call the target Http API
  body? : Map<String, Object> 
]
1
2
3
4
5
6
7
8
9
10

# Dynamic Service

For more information, please refer to Dynamic Service Customization

# Injected Variables

Variable Name Variable Type Description
name String Unique service name
logic tech.muyan.dynamic.DynamicLogic Service execution logic
active Boolean Whether it's active

# Dynamic Filter Condition Definition

The condition definition format for dynamic filtering is shown below, For more information, please refer to Dynamic Filter Definition

// 下面的动态过滤条件的说明:
// 1. 状态字段等于 SUCCESS
// 2. type 是 FINDER, UPDATE 中的一个
// Below is the description of the dynamic filter conditions:
// 1. The status field is equal to SUCCESS
// 2. type is one of FINDER, UPDATE
{
  // key 是列名称: status 
  // key is the column name: status 
  "status": {  
    // 过滤的目标列
    // The target column to filter
    "columnKey": "status", 
    // 匹配规则:等于
    // Match rule: equal
    "matchMode": "=",      
    // 匹配的目标值: SUCCESS
    // Matching target value: SUCCESS
    "value": "SUCCESS",   
  },
  "type": { // key 是列名称: type
    // 过滤的目标列, 与上一行的 key 相同
    // The target column to filter, same as the key in the previous line
    "columnKey": "type",           
    // 过滤的匹配规则:isOneOf (是其中某一个)
    // Filter matching rule: isOneOf (is one of them)
    // 过滤的目标值: [FINDER, UPDATE]
    // Matching target value: [FINDER, UPDATE]
    "value": ["FINDER", "UPDATE"]  
  }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30

# Dynamic Matching Condition List

The following lists the matching conditions that can be used in dynamic filtering and are dynamically rendered at runtime, For more information, please refer to Dynamic Matching Conditions

# Get Dynamic Configuration

For more detailed information, please refer to Get Dynamic Configuration

# Frontend Configuration Retrieval

For more information, please refer to Frontend Configuration Retrieval API

import { useConfig } from "@utils/hooks";
// 举例如下: 获取系统配置中,key 为 register.self_register 的配置值
// 备注: 对于系统内置配置,前台会自动转换配置值的类型,如上述代码调用
// `useConfig` 返回的 `registerEnable` 变量,其类型为 `boolean`。
// Example: Get the configuration value of the key register.self_register in the system configuration
// Note: For system built-in configurations, the frontend will automatically convert the type of the configuration value, 
// as shown in the above code call
// The type of the registerEnable variable returned by `useConfig` is `boolean`.
const { value: registerEnable } = useConfig('register.self_register');
1
2
3
4
5
6
7
8

# Backend Configuration Retrieval

For more information, please refer to Backend Configuration Retrieval API

# Global Configuration or Data Sharing

For detailed information, please refer to Sharing Global Configuration, Connections, or Data Caching Between Dynamic Logic Executions

The current system provides the tech.muyan.helper.RegistryHelper class for managing globally shared data, which can be accessed through:

  • RegistryHelper.memoryGet(key) to retrieve cached data,
  • RegistryHelper.memoryPut(key, value) to set cached data and return the currently saved data,
  • RegistryHelper.memoryRemove(key) to remove cached data.
Note The global data shared by the above methods is stored in memory, so it only supports data sharing within a single server instance and does not support data sharing between multiple server instances.

# Available extInfo List

TIP

In the detailed configuration, xxx?: where ? indicates that the configuration is optional. If not configured, the default value will be used. The extInfo field content should not include the ? character.

# In DomainClass Definition

{
  // 用户快捷搜索时,使用 name 和 label 两个字段进行搜索匹配
  // When users perform quick search, use the name and label fields for search matching
  "inlineSearchColumns": ['name', 'label'],
  // 界面上显示 Object 控件时,显示其 label 字段的值作为标识
  // When displaying Object controls on the interface, show the value of its label field as identifier
  "labelField": 'label',
  // 导入 CSV 数据时,当前 Domain 会在 DynamicLogic 和 DynamicFieldDefinition 之后加载
  // When importing CSV data, the current Domain will be loaded after DynamicLogic and DynamicFieldDefinition
  "loadAfter": ['DynamicLogic', 'DynamicFieldDefinition'],
}
1
2
3
4
5
6
7
8
9
10

For more information, please refer to Available extInfo List for DomainClass

# In DomainClassField Definition

{
  // 适用于 Decimal 类型的字段,设置小数位数为 2
  // Applicable to Decimal type fields, set the number of decimal places to 2
  "scale": 2,
  // 适用于 Decimal 类型的字段,设置精度为 10
  // Applicable to Decimal type fields, set the precision to 10
  "precision": 10
  // 指定 ENUM 类型的字段的 Java 枚举类型定义
  // Specify the Java enum type definition of the ENUM type field
  // 该枚举类的定义可以放在动态插件中
  // The enum class definition can be in a dynamic plugin
  "enumClass": "tech.muyan.mes.enums.WorkTaskStatusEnum"
}
1
2
3
4
5
6
7
8
9
10
11
12

For more information, please refer to extInfo in Domain Model Field Property Definition

# In Dynamic Action Definition

For more information, please refer to Available extInfo List for DynamicAction

{
  /** 前台是否显示该 Action 的 label, 默认为 true, 如果只希望显示 Action 图标,可设置 displayLabel 为 false */
  /** Whether to display the label of this Action in the frontend, default is true. If you only want to display the Action icon, you can set displayLabel to false */
  "displayLabel"?: true | false,
  /** 是否在执行该 Action 后,刷新当前页面, 默认为 true, 如果 action 执行不更新显示数据,可以无需刷新页面 */
  /** Whether to refresh the current page after executing this Action, default is true. If the action execution does not update display data, you can choose not to refresh the page */
  "refreshPage"?: true | false
}
1
2
3
4
5
6
7

# In Dynamic Form Definition

# Common Properties

For more detailed information, please refer to Form extInfo Support

{
    /** form 默认的隐含过滤条件, 该过滤条件不会在界面上显示, 用户不可见 */
    /** Default implicit filter conditions for the form, these conditions are not displayed on the interface and are invisible to users */
    "conditions": {
        "fieldName": {
            /** 匹配的值 */
            /** Matching value */
            "value": xxxx,
            /** 匹配的字段名称, 支持 dot(.) 方式引用关联字段的某字段 */
            /** Matching field name, supports referencing associated fields using dot (.) notation */
            /** 如 organization.name 引用 organization 字段的 name */
            /** For example, organization.name refers to the name field of the organization */
            "columnKey": "xxx",
            /** 匹配规则 */
            /** Matching rule */
            "matchMode": matchMode
        }
    },
    /** 列表类型表单的表头中显示的 domain 标题,如果不想显示 domainTitle, 将其设置为空字符串即可 */
    /** Domain title displayed in the header of list-type forms. If you don't want to display domainTitle, set it to an empty string */
    "domainTitle"?: string;
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

# List Form Properties

{
    /** 是否支持 realtime 实时刷新数据模式,当前为 beta 功能,只支持在列表页面启用 */
    /** Whether to support realtime data refresh mode, currently a beta feature, only supported on list pages */
    /** 默认的显示模式,realtime: 默认实时模式,manual: 手动刷新模式,不支持实时模式(默认模式) */
    /** Default display mode, realtime: default real-time mode, manual: manual refresh mode, does not support real-time mode (default mode) */
    /** auto 默认手动刷新模式,可切换为实时模式,disable: 禁用,等同不设置 */
    /** auto: default manual refresh mode, can switch to real-time mode, disable: disabled, equivalent to not setting */
    "dataRefreshMode"?: "auto" | "realtime" | "manual" | "disable";

    /** 默认显示模式 */
    /** Default display mode */
    "defaultTableMode"?: "table-list" | "card-list";

    /** card Form 每行的显示条数 */
    /** Number of records displayed per row in card form */
    "defaultRecordsPerRow"?: number;

    /** 指定在该表单显示页面上方点击创建按钮使用的创建表单名称 */
    /** Specify the name of the creation form used when clicking the create button at the top of this form display page */
    "createFormName"?: string;
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

# MasterDetail Form Properties

{
  /** 对于 master detail 类型的 form, 其detail 部分的组件 form 类型 */
  /** For master-detail type forms, the form type of the detail component */
  /** 当前经测试可正常工作的可选值为 INLINE_DISPLAY | FULL_TEXT_SEARCH_LIST | Update */
  /** Currently tested and working optional values are INLINE_DISPLAY | FULL_TEXT_SEARCH_LIST | Update */
  "detailFormType": formType;
  /** 对于 master detail 类型的 form, 其 detail 部分的组件对应的字段的名称*/
  /** For master-detail type forms, the name of the field corresponding to the detail component */
  "detailField"?: string;
  /** 对于 master detail 类型的 form, 其 detail 部分的组件是否显示为可编辑组件 */
  /** For master-detail type forms, whether the detail component is displayed as an editable component */
  "detailUpdatable"?: boolean;
}
1
2
3
4
5
6
7
8
9
10
11
12

# Dashboard Form Properties

{
  /** dashboard的自动刷新间隔 */
  /** Auto-refresh interval for the dashboard */
  "refreshInterval"?: number;
}
1
2
3
4

# Gantt Form Properties

{
  /** 甘特图相关配置 */
  /** Gantt chart related configuration */
  "gantt"?: {
    /** 默认显示的甘特图中的开始时间, ISO8601 和 GB/T 7408-2005格式,例如 2023-05-22T00:00:00+08:00 */
    /** Default start time displayed in the Gantt chart, ISO8601 and GB/T 7408-2005 format, e.g., 2023-05-22T00:00:00+08:00 */
    "viewDateStart"?: string;
    /** 默认显示的甘特图的时间长度, ISO8601 和 GB/T 7408-2005 格式,例如 P5D */
    /** Default duration displayed in the Gantt chart, ISO8601 and GB/T 7408-2005 format, e.g., P5D */
    "viewDuration"?: string;
    /** 左侧行列表展示字段,默认显示 gantt 表单关联领域模型的所有字段 */
    /** Fields displayed in the left row list, by default shows all fields of the domain model associated with the Gantt form */
    "rowListDisplayColumns"?: [{
      // 字段名
      // Field name
      "key": string,
      // 显示名
      // Display name
      "title": string,
    }];
    /** 任务展示字段,默认显示被 hover 的 task 领域模型的所有字段 */
    /** Task display fields, by default shows all fields of the hovered task domain model */
    "tooltipDisplayColumns"?: [{
      // 字段名
      // Field name
      "key": string,
      // 显示名
      // Display name
      "title": string,
    }];
    /** 任务组字段 */
    /** Task group field */
    "taskGroupColumnKey"?: string;
    /** 任务是否可以更新, Since version 0.29 */
    /** Whether tasks can be updated, Since version 0.29 */
    "taskUpdatable"?: boolean;
  };
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37

# In Dynamic Form Field Definition

The available extInfo for Dynamic Form Fields is associated with the field type. Detailed by type as follows:

For more detailed information, please refer to Form Field extInfo Support

# Common Properties

The following extended properties can be used in the extInfo for all types of fields

{
  // 设定本字段是否显示右边的 detailPanel,
  // Determines whether to display the detailPanel on the right for this field
  // 无该属性时,值为 false, 本属性为 true 时,
  // When this property is absent, the value is false. When this property is true,
  // 需要对应字段控件实现了右边详情面板的显示控件
  // the corresponding field control needs to implement the display control for the right detail panel
  "hasDetailPanel"?: true | false;

  // 设置某字段支持按需显示,此处的设置值是支持按需显示的字段在全部内容未显示前,显示的概要信息
  // Sets a field to support on-demand display. The value set here is the summary information displayed for fields that support on-demand display before all content is shown
  // 对于设置了该属性的表单字段,如果从后端返回的数据中,此处所设置的字段的值为 null, 则在前端针对该对象,不启用按需显示
  // For form fields with this property set, if the value of the field set here is null in the data returned from the backend, on-demand display is not enabled for this object in the frontend
  // 举例如下:
  // Example:
  // 如对于文章对象,其内容 (content) 字段可能非常长,为了前端的用户体验考虑,考虑针对该字段启用按需显示,
  // For an article object, its content field might be very long. For better frontend user experience, consider enabling on-demand display for this field.
  // 此时可以在 content 表单字段的 extInfo 中设置如下:
  // In this case, you can set the following in the extInfo of the content form field:
  // "summayField": "summaryContent"
  // 表示使用名为 summaryContent 的字段作为 content 字段显示全部内容前的摘要字段,此时:
  // This indicates using a field named summaryContent as the summary field for the content field before displaying all content. In this case:
  // 1. 如果后端返回的数据中,summaryContent 字段的值不为 null, 则在前端默认不显示全部 content 字段的内容,
  //    If the value of the summaryContent field in the data returned from the backend is not null, the frontend by default does not display the full content of the content field,
  //    只显示 summaryContent 字段,用户可点击界面控件,以查看 content 字段的内容
  //    only displays the summaryContent field. Users can click on the interface control to view the content of the content field
  // 2. 如果后端返回的数据中,summaryContent 字段的值为 null, 则在前端不启用按需显示,
  //    If the value of the summaryContent field in the data returned from the backend is null, on-demand display is not enabled in the frontend,
  //    直接显示 content 字段的内容
  //    and the content of the content field is displayed directly
  "summayField"?: string;

  // meta 用于覆盖系统自动生成的表单字段的元数据,或者补充某一些属性,如 title, dataIndex, editable, updatable, elementType 等
  // meta is used to override the metadata of automatically generated form fields or to supplement certain properties such as title, dataIndex, editable, updatable, elementType, etc.
  // 在运行时,系统会将 meta 中的属性覆盖或者补充到系统自动生成的表单字段的元数据中
  // At runtime, the system will override or supplement the metadata of automatically generated form fields with the properties in meta
  "meta"?: {
      // 字段名
      // Field name
      "key": string;
      // 字段显示名
      // Field display name
      "title": string;
      // 字段在表单中的名字,应该和 key 一致
      // The name of the field in the form, should be the same as key
      "dataIndex": string;
      // 可编辑
      // Editable
      "editable"?: boolean;
      // 可更新
      // Updatable
      "updatable"?: boolean;
      ...
   }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54

# file Field

When the type is file or tech_muyan_storage_StorageFieldValue, the following JSON can be used to set the related properties of the control

{
  /** 接受的附件类型, 可参考 https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#accept  */
  /** Accepted attachment types, refer to https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#accept */
  "accept"?: string;
  /** 单个的最大文件大小, 单位 MB */
  /** Maximum size for a single file, in MB */
  "maxSizeMB"?: number;
  /** multiple 为 true 时, 单个字段中, 可上传的最大文件数量, 如果没有设置,默认为 20 */
  /** When multiple is true, the maximum number of files that can be uploaded in a single field. If not set, the default is 20 */
  /** multiple 根据关联关系的类型或者动态字段定义 (Dynamic Field Instance) 中的 multiple 属性确定 */
  /** multiple is determined by the type of association or the multiple property in the Dynamic Field Instance */
  "maxCount"?: number;
  /** 总的文件大小, 单位 MB */
  /** Total file size, in MB */
  "totalMaxSizeMB"?: number;
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

# code Field

When the type is code, the following extInfo can be used to set the syntax highlighting

{
  /** 代码编辑器控件显示时的高亮语法 */
  /** Syntax highlighting when displaying the code editor control */
  "codeLanguage"?: "css" | "javascript" | "markdown" | "groovy" .....,
  /** 是否在图标后,同时显示代码开始的 20 个字符 */
  /** Whether to display the first 20 characters of the code after the icon */
  "showBrief"?: boolean;
}
1
2
3
4
5
6
7

# object Field

For object selection controls, the following extInfo definition can be used to set the default options in the selection control

{
    /** 默认显示的 options 的过滤条件
     * 系统打开页面时, 系统会使用该查询条件查询对象列表并作为对象选择控件的默认选项
     */
    /** Default filter conditions for displayed options
     * When the system opens the page, it will use this query condition to query the object list and use it as the default option for the object selection control
     */
    "defaultOptionsCondition"?: {
        "fieldName" : {
            /** 匹配的值 */
            /** Matching value */
            "value": xxxx,
            /** 匹配的字段名称, 支持 dot(.) 方式引用关联字段的某字段
             * 如 organization.name 引用 organization 字段的 name
             */
            /** Matching field name, supports referencing associated fields using dot (.) notation
             * For example, organization.name refers to the name field of the organization
             */
            "columnKey": "xxx",
            /** 匹配规则 */
            /** Matching rule */
            "matchMode": matchMode
        }
    },
    /** 是否禁用对象搜索功能, Since version 0.29 */
    /** Whether to disable object search functionality, Since version 0.29 */
    "disableObjectSearch"?: boolean
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

# One-to-Many Object Field

When the type is array (one-to-many object field), the following extInfo definition can be used to set the display of the associated list

{
  /** 在弹出抽屉中显示的关联对象列表中,显示时所使用的 form 名称 */
  /** The name of the form used to display the list of associated objects in the pop-up drawer */
  "displayForm"?: "Form used to display the list of objects"
}
1
2
3
4

# Subtable Field

{
  /** 子表中的显示字段定义的表单名 */
  /** Name of the form defining the display fields in the sub-table */
  /**  Name of the form defining the display fields in the sub-table */
  "displayForm"?: "Form used to display the list of objects",
  /** 子表控件的相关属性 */
  /**  Related properties of the sub-table control */
  "subTable"?: {
    /** 子表中是否可创建、编辑、删除、搜索现有行 */
    /**  Whether rows in the sub-table can be created, edited, deleted, or searched */
    "updatable"?: true | false,
    "creatable"?: true | false,
    "deletable"?: true | false,
    "searchModal"?: true | false,
    /** 子表中的排序字段,默认为 displaySequence, 可以设置为其他字段 */
    /** Sorting field in the sub-table, default is displaySequence, can be set to other fields */
    "sortBy"?: "排序字段的 key" // Key of the sorting field
  }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Last Updated: 9/29/2024, 2:33:14 AM