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" ],
}, "cwidth": {}
{ },
"field": "meter_mode", "editexclouded": [
"title": "计量方式" "id",
}, "created_at",
{ "updated_at",
"field": "meter_unit", "created_by"
"title": "计量单位"
},
{
"field": "settle_period",
"title": "结算周期"
},
{
"field": "ppid",
"title": "定价项目ID"
},
{
"field": "is_default",
"title": "缺省方式"
},
{
"field": "status",
"title": "状态"
}
], ],
"editfields": [ "editable": {
{ "new_data_url": "{{entire_url('./add_storres_pricing_map.dspy')}}",
"field": "spec_id", "update_data_url": "{{entire_url('./update_storres_pricing_map.dspy')}}",
"uitype": "Text" "delete_data_url": "{{entire_url('./delete_storres_pricing_map.dspy')}}"
}, }
{
"field": "meter_mode",
"uitype": "Text"
},
{
"field": "meter_unit",
"uitype": "Text"
},
{
"field": "settle_period",
"uitype": "Text"
},
{
"field": "ppid",
"uitype": "Text"
},
{
"field": "is_default",
"uitype": "Text"
},
{
"field": "status",
"uitype": "Text"
}
],
"searchfields": [
"spec_id",
"meter_mode"
]
} }
} }

View File

@ -1,98 +1,24 @@
{ {
"tblname": "storres_sample", "tblname": "storres_sample",
"title": "容量采样",
"params": { "params": {
"title": "容量采样", "sortby": "created_at",
"browserfields": [ "browserfields": {
{ "exclouded": [
"field": "spec_id", "id"
"title": "规格ID" ],
}, "cwidth": {}
{ },
"field": "target_type", "editexclouded": [
"title": "计量对象类型" "id",
}, "created_at",
{ "updated_at",
"field": "target_id", "created_by"
"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": [ "editable": {
{ "new_data_url": "{{entire_url('./add_storres_sample.dspy')}}",
"field": "spec_id", "update_data_url": "{{entire_url('./update_storres_sample.dspy')}}",
"uitype": "Text" "delete_data_url": "{{entire_url('./delete_storres_sample.dspy')}}"
}, }
{
"field": "subscription_id",
"uitype": "Text"
},
{
"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": [
"spec_id",
"target_type"
]
} }
} }

View File

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

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"
}, ],
{ "cwidth": {}
"field": "meter_mode", },
"title": "计量方式" "editexclouded": [
}, "id",
{ "created_at",
"field": "userorgid", "updated_at",
"title": "用户机构" "created_by"
},
{
"field": "period_start",
"title": "计费周期起"
},
{
"field": "period_end",
"title": "计费周期止"
},
{
"field": "billable_gb",
"title": "计费容量GB"
},
{
"field": "amount",
"title": "交易金额"
},
{
"field": "accounting_status",
"title": "记账状态"
}
], ],
"editfields": [ "editable": {
{ "new_data_url": "{{entire_url('./add_storres_usage.dspy')}}",
"field": "spec_id", "update_data_url": "{{entire_url('./update_storres_usage.dspy')}}",
"uitype": "Text" "delete_data_url": "{{entire_url('./delete_storres_usage.dspy')}}"
}, }
{
"field": "meter_mode",
"uitype": "Text"
},
{
"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": [
"spec_id",
"meter_mode"
]
} }
} }