fix: standardize summary format to list with primary=id in all models

This commit is contained in:
yumoqing 2026-04-29 14:39:34 +08:00
parent 8c2ffa87d8
commit eab031e502
3 changed files with 288 additions and 263 deletions

View File

@ -1,90 +1,100 @@
{ {
"summary": { "summary": [
"name": "dashboard_config", {
"label": "仪表板配置", "name": "dashboard_config",
"comment": "统一仪表板配置信息" "title": "仪表板配置",
}, "primary": "id",
"fields": [ "catelog": "entity"
{ }
"name": "id", ],
"title": "ID", "fields": [
"type": "str", {
"length": 32, "name": "id",
"nullable": false, "title": "ID",
"comments": "主键UUID" "type": "str",
}, "length": 32,
{ "nullable": false,
"name": "dashboard_name", "comments": "主键UUID"
"title": "仪表板名称", },
"type": "str", {
"length": 100, "name": "dashboard_name",
"nullable": false, "title": "仪表板名称",
"comments": "仪表板显示名称" "type": "str",
}, "length": 100,
{ "nullable": false,
"name": "dashboard_type", "comments": "仪表板显示名称"
"title": "仪表板类型", },
"type": "str", {
"length": 50, "name": "dashboard_type",
"nullable": false, "title": "仪表板类型",
"comments": "sales/finance/customer/executive" "type": "str",
}, "length": 50,
{ "nullable": false,
"name": "config_json", "comments": "sales/finance/customer/executive"
"title": "配置JSON", },
"type": "str", {
"length": 2000, "name": "config_json",
"nullable": false, "title": "配置JSON",
"comments": "仪表板布局和组件配置" "type": "str",
}, "length": 2000,
{ "nullable": false,
"name": "is_default", "comments": "仪表板布局和组件配置"
"title": "是否默认", },
"type": "str", {
"length": 1, "name": "is_default",
"nullable": false, "title": "是否默认",
"comments": "Y/N" "type": "str",
}, "length": 1,
{ "nullable": false,
"name": "org_id", "comments": "Y/N"
"title": "组织ID", },
"type": "str", {
"length": 32, "name": "org_id",
"nullable": false, "title": "组织ID",
"comments": "多租户组织隔离" "type": "str",
}, "length": 32,
{ "nullable": false,
"name": "created_by", "comments": "多租户组织隔离"
"title": "创建人", },
"type": "str", {
"length": 32, "name": "created_by",
"nullable": false, "title": "创建人",
"comments": "创建用户ID" "type": "str",
}, "length": 32,
{ "nullable": false,
"name": "created_at", "comments": "创建用户ID"
"title": "创建时间", },
"type": "timestamp", {
"nullable": false, "name": "created_at",
"comments": "创建时间" "title": "创建时间",
} "type": "timestamp",
], "nullable": false,
"indexes": [ "comments": "创建时间"
{ }
"name": "idx_dashboard_org", ],
"idxtype": "index", "indexes": [
"fields": ["org_id"] {
}, "name": "idx_dashboard_org",
{ "idxtype": "index",
"name": "idx_dashboard_type", "fields": [
"idxtype": "index", "org_id"
"fields": ["dashboard_type"] ]
}, },
{ {
"name": "uk_dashboard_name_org", "name": "idx_dashboard_type",
"idxtype": "unique", "idxtype": "index",
"fields": ["dashboard_name", "org_id"] "fields": [
} "dashboard_type"
], ]
"codes": [] },
{
"name": "uk_dashboard_name_org",
"idxtype": "unique",
"fields": [
"dashboard_name",
"org_id"
]
}
],
"codes": []
} }

View File

@ -1,109 +1,116 @@
{ {
"summary": { "summary": [
"name": "report_template", {
"label": "报表模板", "name": "report_template",
"comment": "统一报表模板定义" "title": "报表模板",
}, "primary": "id",
"fields": [ "catelog": "entity"
{ }
"name": "id", ],
"title": "ID", "fields": [
"type": "str", {
"length": 32, "name": "id",
"nullable": false, "title": "ID",
"comments": "主键UUID" "type": "str",
}, "length": 32,
{ "nullable": false,
"name": "template_name", "comments": "主键UUID"
"title": "模板名称", },
"type": "str", {
"length": 100, "name": "template_name",
"nullable": false, "title": "模板名称",
"comments": "报表模板名称" "type": "str",
}, "length": 100,
{ "nullable": false,
"name": "report_type", "comments": "报表模板名称"
"title": "报表类型", },
"type": "str", {
"length": 50, "name": "report_type",
"nullable": false, "title": "报表类型",
"comments": "sales/finance/customer/contract" "type": "str",
}, "length": 50,
{ "nullable": false,
"name": "sql_query", "comments": "sales/finance/customer/contract"
"title": "SQL查询", },
"type": "str", {
"length": 2000, "name": "sql_query",
"nullable": false, "title": "SQL查询",
"comments": "报表数据查询SQL" "type": "str",
}, "length": 2000,
{ "nullable": false,
"name": "columns_config", "comments": "报表数据查询SQL"
"title": "列配置", },
"type": "str", {
"length": 1000, "name": "columns_config",
"nullable": true, "title": "列配置",
"comments": "JSON格式的列配置" "type": "str",
}, "length": 1000,
{ "nullable": true,
"name": "filters_config", "comments": "JSON格式的列配置"
"title": "过滤器配置", },
"type": "str", {
"length": 1000, "name": "filters_config",
"nullable": true, "title": "过滤器配置",
"comments": "JSON格式的过滤器配置" "type": "str",
}, "length": 1000,
{ "nullable": true,
"name": "chart_config", "comments": "JSON格式的过滤器配置"
"title": "图表配置", },
"type": "str", {
"length": 1000, "name": "chart_config",
"nullable": true, "title": "图表配置",
"comments": "JSON格式的图表配置" "type": "str",
}, "length": 1000,
{ "nullable": true,
"name": "org_id", "comments": "JSON格式的图表配置"
"title": "组织ID", },
"type": "str", {
"length": 32, "name": "org_id",
"nullable": false, "title": "组织ID",
"comments": "多租户组织隔离" "type": "str",
}, "length": 32,
{ "nullable": false,
"name": "created_by", "comments": "多租户组织隔离"
"title": "创建人", },
"type": "str", {
"length": 32, "name": "created_by",
"nullable": false, "title": "创建人",
"comments": "创建用户ID" "type": "str",
}, "length": 32,
{ "nullable": false,
"name": "created_at", "comments": "创建用户ID"
"title": "创建时间", },
"type": "timestamp", {
"nullable": false, "name": "created_at",
"comments": "创建时间" "title": "创建时间",
}, "type": "timestamp",
{ "nullable": false,
"name": "is_active", "comments": "创建时间"
"title": "是否激活", },
"type": "str", {
"length": 1, "name": "is_active",
"nullable": false, "title": "是否激活",
"comments": "Y/N" "type": "str",
} "length": 1,
], "nullable": false,
"indexes": [ "comments": "Y/N"
{ }
"name": "idx_template_org", ],
"idxtype": "index", "indexes": [
"fields": ["org_id"] {
}, "name": "idx_template_org",
{ "idxtype": "index",
"name": "idx_template_type", "fields": [
"idxtype": "index", "org_id"
"fields": ["report_type"] ]
} },
], {
"codes": [] "name": "idx_template_type",
"idxtype": "index",
"fields": [
"report_type"
]
}
],
"codes": []
} }

View File

@ -1,70 +1,78 @@
{ {
"summary": { "summary": [
"name": "user_dashboard", {
"label": "用户仪表板", "name": "user_dashboard",
"comment": "用户个性化仪表板配置" "title": "用户仪表板",
}, "primary": "id",
"fields": [ "catelog": "entity"
{ }
"name": "id", ],
"title": "ID", "fields": [
"type": "str", {
"length": 32, "name": "id",
"nullable": false, "title": "ID",
"comments": "主键UUID" "type": "str",
}, "length": 32,
{ "nullable": false,
"name": "user_id", "comments": "主键UUID"
"title": "用户ID", },
"type": "str", {
"length": 32, "name": "user_id",
"nullable": false, "title": "用户ID",
"comments": "关联用户" "type": "str",
}, "length": 32,
{ "nullable": false,
"name": "dashboard_config_id", "comments": "关联用户"
"title": "仪表板配置ID", },
"type": "str", {
"length": 32, "name": "dashboard_config_id",
"nullable": false, "title": "仪表板配置ID",
"comments": "关联的仪表板配置" "type": "str",
}, "length": 32,
{ "nullable": false,
"name": "layout_json", "comments": "关联的仪表板配置"
"title": "布局JSON", },
"type": "str", {
"length": 2000, "name": "layout_json",
"nullable": true, "title": "布局JSON",
"comments": "用户自定义布局" "type": "str",
}, "length": 2000,
{ "nullable": true,
"name": "is_favorite", "comments": "用户自定义布局"
"title": "是否收藏", },
"type": "str", {
"length": 1, "name": "is_favorite",
"nullable": false, "title": "是否收藏",
"comments": "Y/N" "type": "str",
}, "length": 1,
{ "nullable": false,
"name": "org_id", "comments": "Y/N"
"title": "组织ID", },
"type": "str", {
"length": 32, "name": "org_id",
"nullable": false, "title": "组织ID",
"comments": "多租户组织隔离" "type": "str",
} "length": 32,
], "nullable": false,
"indexes": [ "comments": "多租户组织隔离"
{ }
"name": "idx_user_dashboard_user", ],
"idxtype": "unique", "indexes": [
"fields": ["user_id", "dashboard_config_id"] {
}, "name": "idx_user_dashboard_user",
{ "idxtype": "unique",
"name": "idx_user_dashboard_org", "fields": [
"idxtype": "index", "user_id",
"fields": ["org_id"] "dashboard_config_id"
} ]
], },
"codes": [] {
"name": "idx_user_dashboard_org",
"idxtype": "index",
"fields": [
"org_id"
]
}
],
"codes": []
} }