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", "tblname": "appcodes",
"title":"代码管理", "title": "代码管理",
"params":{ "params": {
"sortby":"id", "sortby": "id",
"browserfields":{ "browserfields": {
"exclouded":[], "exclouded": [],
"alters":{} "alters": {}
}, },
"editexclouded":[], "editexclouded": [],
"subtables":[ "subtables": [
{ {
"title":"代码键值管理", "title": "代码键值管理",
"subtable":"appcodes_kv", "subtable": "appcodes_kv",
"params":{ "params": {
"hierarchy_flg":"${hierarchy_flg}" "hierarchy_flg": "${hierarchy_flg}"
}, },
"field":"parentid" "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", "tblname": "appcodes_kv",
"title":"代码键值管理", "title": "代码键值管理",
"params":{ "params": {
"sortby":["k", "v"], "sortby": [
"browserfields":{ "k",
"exclouded":["id", "parentid" ], "v"
"alters":{} ],
}, "browserfields": {
"editexclouded":["id", "parentid" ], "exclouded": [
"subtables_condition":" params_kw.hierarchy_flg == '1' ", "id",
"subtables":[ "parentid"
{ ],
"title":"代码键值管理", "alters": {}
"params":{ },
"hierarchy_flg":"{{params_kw.hierarchy_flg}}", "editexclouded": [
"parentid":"${id}" "id",
}, "parentid"
"subtable":"appcodes_kv", ],
"field":"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", "tblname": "svgicon",
"params":{ "params": {
"title":"图标", "title": "图标",
"description":"系统中使用的图标", "description": "系统中使用的图标",
"sortby":"id", "sortby": "id",
"browserfields":{ "browserfields": {
"exclouded":[], "exclouded": [],
"alters":{} "alters": {}
}, },
"editexclouded":[] "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)