feat: appcodes/svgicon CRUD alias+api

This commit is contained in:
yumoqing 2026-07-09 17:16:03 +08:00
parent 2acf06e5e5
commit cec6e43397
12 changed files with 122 additions and 56 deletions

View File

@ -1,22 +1,28 @@
{
"tblname":"appcodes",
"title":"代码管理",
"params":{
"sortby":"id",
"browserfields":{
"exclouded":[],
"alters":{}
},
"editexclouded":[],
"subtables":[
{
"title":"代码键值管理",
"subtable":"appcodes_kv",
"params":{
"hierarchy_flg":"${hierarchy_flg}"
},
"field":"parentid"
}
]
}
}
"tblname": "appcodes",
"title": "代码管理",
"params": {
"sortby": "id",
"browserfields": {
"exclouded": [],
"alters": {}
},
"editexclouded": [],
"subtables": [
{
"title": "代码键值管理",
"subtable": "appcodes_kv",
"params": {
"hierarchy_flg": "${hierarchy_flg}"
},
"field": "parentid"
}
],
"editable": {
"new_data_url": "{{entire_url('../api/appcodes_create.dspy')}}",
"update_data_url": "{{entire_url('../api/appcodes_update.dspy')}}",
"delete_data_url": "{{entire_url('../api/appcodes_delete.dspy')}}"
}
},
"alias": "appcodes_list"
}

View File

@ -1,24 +1,39 @@
{
"tblname":"appcodes_kv",
"title":"代码键值管理",
"params":{
"sortby":["k", "v"],
"browserfields":{
"exclouded":["id", "parentid" ],
"alters":{}
},
"editexclouded":["id", "parentid" ],
"subtables_condition":" params_kw.hierarchy_flg == '1' ",
"subtables":[
{
"title":"代码键值管理",
"params":{
"hierarchy_flg":"{{params_kw.hierarchy_flg}}",
"parentid":"${id}"
},
"subtable":"appcodes_kv",
"field":"parentid"
}
]
}
}
"tblname": "appcodes_kv",
"title": "代码键值管理",
"params": {
"sortby": [
"k",
"v"
],
"browserfields": {
"exclouded": [
"id",
"parentid"
],
"alters": {}
},
"editexclouded": [
"id",
"parentid"
],
"subtables_condition": " params_kw.hierarchy_flg == '1' ",
"subtables": [
{
"title": "代码键值管理",
"params": {
"hierarchy_flg": "{{params_kw.hierarchy_flg}}",
"parentid": "${id}"
},
"subtable": "appcodes_kv",
"field": "parentid"
}
],
"editable": {
"new_data_url": "{{entire_url('../api/appcodes_kv_create.dspy')}}",
"update_data_url": "{{entire_url('../api/appcodes_kv_update.dspy')}}",
"delete_data_url": "{{entire_url('../api/appcodes_kv_delete.dspy')}}"
}
},
"alias": "appcodes_kv_list"
}

View File

@ -1,13 +1,19 @@
{
"tblname":"svgicon",
"params":{
"title":"图标",
"description":"系统中使用的图标",
"sortby":"id",
"browserfields":{
"exclouded":[],
"alters":{}
},
"editexclouded":[]
}
}
"tblname": "svgicon",
"params": {
"title": "图标",
"description": "系统中使用的图标",
"sortby": "id",
"browserfields": {
"exclouded": [],
"alters": {}
},
"editexclouded": [],
"editable": {
"new_data_url": "{{entire_url('../api/svgicon_create.dspy')}}",
"update_data_url": "{{entire_url('../api/svgicon_update.dspy')}}",
"delete_data_url": "{{entire_url('../api/svgicon_delete.dspy')}}"
}
},
"alias": "svgicon_list"
}

View File

@ -0,0 +1,5 @@
async with get_sor_context(env, 'appbase') as sor:
ns = dict(params_kw)
ns['id'] = getID()
await sor.C('appcodes', ns)
return json.dumps({'status': 'ok', 'id': ns['id']}, ensure_ascii=False)

View File

@ -0,0 +1,4 @@
async with get_sor_context(env, 'appbase') as sor:
ns = dict(params_kw)
await sor.D('appcodes', ns)
return json.dumps({'status': 'ok'}, ensure_ascii=False)

View File

@ -0,0 +1,5 @@
async with get_sor_context(env, 'appbase') as sor:
ns = dict(params_kw)
ns['id'] = getID()
await sor.C('appcodes_kv', ns)
return json.dumps({'status': 'ok', 'id': ns['id']}, ensure_ascii=False)

View File

@ -0,0 +1,4 @@
async with get_sor_context(env, 'appbase') as sor:
ns = dict(params_kw)
await sor.D('appcodes_kv', ns)
return json.dumps({'status': 'ok'}, ensure_ascii=False)

View File

@ -0,0 +1,4 @@
async with get_sor_context(env, 'appbase') as sor:
ns = dict(params_kw)
await sor.U('appcodes_kv', ns)
return json.dumps({'status': 'ok'}, ensure_ascii=False)

View File

@ -0,0 +1,4 @@
async with get_sor_context(env, 'appbase') as sor:
ns = dict(params_kw)
await sor.U('appcodes', ns)
return json.dumps({'status': 'ok'}, ensure_ascii=False)

View File

@ -0,0 +1,5 @@
async with get_sor_context(env, 'appbase') as sor:
ns = dict(params_kw)
ns['id'] = getID()
await sor.C('svgicon', ns)
return json.dumps({'status': 'ok', 'id': ns['id']}, ensure_ascii=False)

View File

@ -0,0 +1,4 @@
async with get_sor_context(env, 'appbase') as sor:
ns = dict(params_kw)
await sor.D('svgicon', ns)
return json.dumps({'status': 'ok'}, ensure_ascii=False)

View File

@ -0,0 +1,4 @@
async with get_sor_context(env, 'appbase') as sor:
ns = dict(params_kw)
await sor.U('svgicon', ns)
return json.dumps({'status': 'ok'}, ensure_ascii=False)