视图建模文件为model/view/**/*.yml
,其中中间的/**/
目录,为模块层次,文件名则对应视图名,针对不同的视图模块,参数不尽相同,具体请参见模块的建模参数描述,其中主要的共性参数为:
配置项 | 配置说明 |
label | 视图的标签描述 |
model | 视图展现模板,针对不同的视图展现风格,会有不同的视图展现模块。 |
view | 视图的附加属性,具体的属性和用法,由视图模块开发方约定。 |
components | 视图中的组件,一个视图是由一个到多个组件来组成,每个组件绑定一个数据表或一个服务。 |
components.type | 组件类型,一般用来标识同一个视图中不同组件的类型,具体的组件类型名称,由视图模块开发方约定。 |
components.tableName | 组件绑定的数据表,数据表是在 |
components.view | 组件的附加属性,具体的属性和用法,由视图模块开发方约定。 |
components.fields | 组件项下的域列表 |
components.fields.name | 域名,参见组件绑定数据表项下中的域列表 |
components.fields.view | 域的附加属性,具体的属性和用法,由视图模块开发方约定 |
components.actions | 组件项下的动作列表 |
components.actions.type | 动作类型 |
components.actions.label | 动作标签描述 |
components.actions.icon | 动作图标 |
数据建模文件样例(model/view/crm/customer-list-1.yml
):
#标签label: 客户列表#视图展现模块model: LIST-1#查询条件域列表components:#视图类型:查询条件组件- type: QUERY#相关数据表tableName: customer#视图扩展属性view:fields:#域名- name: cust_no#视图扩展属性view:#提示信息placeholder: 输入客户编号#查询条件类型: EQ GE LE LIKE BETWEENqueryType: EQ#跨度span: 6#域名- name: cust_nameview:#提示信息placeholder: 输入客户名称#查询条件类型: EQ GE LE LIKE BETWEENqueryType: EQ#跨度span: 6actions:#视图类型:数据列表组件- type: LIST#相关数据表tableName: customer#视图扩展属性view:modalView: /crm/CustomerFormModal1fields:#域名- name: cust_no- name: cust_name- name: cust_region- name: cust_address- name: cust_registered_capital#按钮动作actions:#动作类型- type: LIST-OPEN-VIEWlabel: 查看icon: readparams:view: /crm/CustomerForm1query: "{mda_id: record.custNo}"- type: LIST-DO-SERVICElabel: 删除服务icon: deleteparams:method: deleteurl: /crm/customer/deletedata: "{id: record.custNo}"confirm: true- type: LIST-DELETElabel: 删除icon: delete- type: LIST-EDIT-WITH-MODAL- type: ADD-WITH-MODAL- type: BATCH-DELETE- type: OPEN-VIEWlabel: 打开视图icon: folder-open"params:view: /crm/CustomerForm1confirm: true- type: DO-SERVICElabel: 执行服务icon: interationparams:method: deleteurl: /crm/customer/delete- type: EXPORT-EXCELlabel: 导出icon: download- type: IMPORT-EXCELlabel: 导入icon: import