fix(crud): json 定义改为 xls2ui 真实格式

browserfields 必须是对象 {exclouded:[], cwidth:{}},写成数组会让 xls2ui 崩:
AttributeError: 'list' object has no attribute 'alters'
崩溃点之后的表全部不生成 → 页面 500 invalid path。
格式对照 pipeline_core/json/llm.json。
This commit is contained in:
ymq 2026-08-26 15:00:43 +08:00
parent 04b1b19b94
commit 846e2dec0d
4 changed files with 73 additions and 380 deletions

View File

@ -1,70 +1,24 @@
{ {
"tblname": "storres_pricing_map", "tblname": "storres_pricing_map",
"title": "存储规格定价映射",
"params": { "params": {
"title": "存储定价映射", "sortby": "created_at",
"browserfields": [ "browserfields": {
{ "exclouded": [
"field": "spec_id", "id"
"title": "规格ID"
},
{
"field": "meter_mode",
"title": "计量方式"
},
{
"field": "meter_unit",
"title": "计量单位"
},
{
"field": "settle_period",
"title": "结算周期"
},
{
"field": "ppid",
"title": "定价项目ID"
},
{
"field": "is_default",
"title": "缺省方式"
},
{
"field": "status",
"title": "状态"
}
], ],
"editfields": [ "cwidth": {}
{
"field": "spec_id",
"uitype": "Text"
}, },
{ "editexclouded": [
"field": "meter_mode", "id",
"uitype": "Text" "created_at",
}, "updated_at",
{ "created_by"
"field": "meter_unit",
"uitype": "Text"
},
{
"field": "settle_period",
"uitype": "Text"
},
{
"field": "ppid",
"uitype": "Text"
},
{
"field": "is_default",
"uitype": "Text"
},
{
"field": "status",
"uitype": "Text"
}
], ],
"searchfields": [ "editable": {
"spec_id", "new_data_url": "{{entire_url('./add_storres_pricing_map.dspy')}}",
"meter_mode" "update_data_url": "{{entire_url('./update_storres_pricing_map.dspy')}}",
] "delete_data_url": "{{entire_url('./delete_storres_pricing_map.dspy')}}"
}
} }
} }

View File

@ -1,98 +1,24 @@
{ {
"tblname": "storres_sample", "tblname": "storres_sample",
"params": {
"title": "容量采样", "title": "容量采样",
"browserfields": [ "params": {
{ "sortby": "created_at",
"field": "spec_id", "browserfields": {
"title": "规格ID" "exclouded": [
}, "id"
{
"field": "target_type",
"title": "计量对象类型"
},
{
"field": "target_id",
"title": "计量对象ID"
},
{
"field": "sample_date",
"title": "采样日期"
},
{
"field": "used_gb",
"title": "实测容量GB"
},
{
"field": "quota_gb",
"title": "配额容量GB"
},
{
"field": "over_gb",
"title": "超额GB"
},
{
"field": "source",
"title": "采样来源"
}
], ],
"editfields": [ "cwidth": {}
{
"field": "spec_id",
"uitype": "Text"
}, },
{ "editexclouded": [
"field": "subscription_id", "id",
"uitype": "Text" "created_at",
}, "updated_at",
{ "created_by"
"field": "target_type",
"uitype": "Text"
},
{
"field": "target_id",
"uitype": "Text"
},
{
"field": "userid",
"uitype": "Text"
},
{
"field": "userorgid",
"uitype": "Text"
},
{
"field": "sample_date",
"uitype": "Text"
},
{
"field": "sample_time",
"uitype": "Text"
},
{
"field": "used_gb",
"uitype": "Text"
},
{
"field": "quota_gb",
"uitype": "Text"
},
{
"field": "over_gb",
"uitype": "Text"
},
{
"field": "source",
"uitype": "Text"
},
{
"field": "status",
"uitype": "Text"
}
], ],
"searchfields": [ "editable": {
"spec_id", "new_data_url": "{{entire_url('./add_storres_sample.dspy')}}",
"target_type" "update_data_url": "{{entire_url('./update_storres_sample.dspy')}}",
] "delete_data_url": "{{entire_url('./delete_storres_sample.dspy')}}"
}
} }
} }

View File

@ -1,94 +1,24 @@
{ {
"tblname": "storres_spec", "tblname": "storres_spec",
"params": {
"title": "存储规格", "title": "存储规格",
"browserfields": [ "params": {
{ "sortby": "created_at",
"field": "spec_code", "browserfields": {
"title": "规格编码" "exclouded": [
}, "id"
{
"field": "spec_name",
"title": "规格名称"
},
{
"field": "storage_class",
"title": "存储类型"
},
{
"field": "min_gb",
"title": "起售容量GB"
},
{
"field": "capacity_total",
"title": "可售总量GB"
},
{
"field": "capacity_used",
"title": "已分配GB"
},
{
"field": "status",
"title": "状态"
}
], ],
"editfields": [ "cwidth": {}
{
"field": "spec_code",
"uitype": "Text"
}, },
{ "editexclouded": [
"field": "spec_name", "id",
"uitype": "Text" "created_at",
}, "updated_at",
{ "created_by"
"field": "storage_class",
"uitype": "Text"
},
{
"field": "description",
"uitype": "Text"
},
{
"field": "min_gb",
"uitype": "Text"
},
{
"field": "max_gb",
"uitype": "Text"
},
{
"field": "step_gb",
"uitype": "Text"
},
{
"field": "capacity_total",
"uitype": "Text"
},
{
"field": "capacity_used",
"uitype": "Text"
},
{
"field": "backup_enabled",
"uitype": "Text"
},
{
"field": "attr_json",
"uitype": "Text"
},
{
"field": "sort_order",
"uitype": "Text"
},
{
"field": "status",
"uitype": "Text"
}
], ],
"searchfields": [ "editable": {
"spec_code", "new_data_url": "{{entire_url('./add_storres_spec.dspy')}}",
"spec_name" "update_data_url": "{{entire_url('./update_storres_spec.dspy')}}",
] "delete_data_url": "{{entire_url('./delete_storres_spec.dspy')}}"
}
} }
} }

View File

@ -1,142 +1,25 @@
{ {
"tblname": "storres_usage", "tblname": "storres_usage",
"title": "存储资源用量",
"params": { "params": {
"title": "存储用量", "sortby": "created_at",
"browserfields": [ "browserfields": {
{ "exclouded": [
"field": "spec_id", "id",
"title": "规格ID" "usages"
},
{
"field": "meter_mode",
"title": "计量方式"
},
{
"field": "userorgid",
"title": "用户机构"
},
{
"field": "period_start",
"title": "计费周期起"
},
{
"field": "period_end",
"title": "计费周期止"
},
{
"field": "billable_gb",
"title": "计费容量GB"
},
{
"field": "amount",
"title": "交易金额"
},
{
"field": "accounting_status",
"title": "记账状态"
}
], ],
"editfields": [ "cwidth": {}
{
"field": "spec_id",
"uitype": "Text"
}, },
{ "editexclouded": [
"field": "meter_mode", "id",
"uitype": "Text" "created_at",
}, "updated_at",
{ "created_by"
"field": "subscription_id",
"uitype": "Text"
},
{
"field": "userid",
"uitype": "Text"
},
{
"field": "userorgid",
"uitype": "Text"
},
{
"field": "use_date",
"uitype": "Text"
},
{
"field": "use_time",
"uitype": "Text"
},
{
"field": "period_start",
"uitype": "Text"
},
{
"field": "period_end",
"uitype": "Text"
},
{
"field": "sample_count",
"uitype": "Text"
},
{
"field": "avg_gb",
"uitype": "Text"
},
{
"field": "max_gb",
"uitype": "Text"
},
{
"field": "billable_gb",
"uitype": "Text"
},
{
"field": "usages",
"uitype": "Text"
},
{
"field": "transno",
"uitype": "Text"
},
{
"field": "amount",
"uitype": "Text"
},
{
"field": "amount_currency",
"uitype": "Text"
},
{
"field": "amount_base",
"uitype": "Text"
},
{
"field": "cost",
"uitype": "Text"
},
{
"field": "cost_currency",
"uitype": "Text"
},
{
"field": "cost_base",
"uitype": "Text"
},
{
"field": "discount_rate",
"uitype": "Text"
},
{
"field": "accounting_status",
"uitype": "Text"
},
{
"field": "status",
"uitype": "Text"
}
], ],
"searchfields": [ "editable": {
"spec_id", "new_data_url": "{{entire_url('./add_storres_usage.dspy')}}",
"meter_mode" "update_data_url": "{{entire_url('./update_storres_usage.dspy')}}",
] "delete_data_url": "{{entire_url('./delete_storres_usage.dspy')}}"
}
} }
} }