diff --git a/json/appcodes.json b/json/appcodes.json index 019286a..b93ae92 100644 --- a/json/appcodes.json +++ b/json/appcodes.json @@ -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" +} \ No newline at end of file diff --git a/json/appcodes_kv.json b/json/appcodes_kv.json index 1d7636c..6880869 100644 --- a/json/appcodes_kv.json +++ b/json/appcodes_kv.json @@ -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" +} \ No newline at end of file diff --git a/json/svgicon.json b/json/svgicon.json index 02ce5dd..1e63c20 100644 --- a/json/svgicon.json +++ b/json/svgicon.json @@ -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" +} \ No newline at end of file diff --git a/wwwroot/api/appcodes_create.dspy b/wwwroot/api/appcodes_create.dspy new file mode 100644 index 0000000..14e2e98 --- /dev/null +++ b/wwwroot/api/appcodes_create.dspy @@ -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) diff --git a/wwwroot/api/appcodes_delete.dspy b/wwwroot/api/appcodes_delete.dspy new file mode 100644 index 0000000..e0378c8 --- /dev/null +++ b/wwwroot/api/appcodes_delete.dspy @@ -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) diff --git a/wwwroot/api/appcodes_kv_create.dspy b/wwwroot/api/appcodes_kv_create.dspy new file mode 100644 index 0000000..31096a0 --- /dev/null +++ b/wwwroot/api/appcodes_kv_create.dspy @@ -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) diff --git a/wwwroot/api/appcodes_kv_delete.dspy b/wwwroot/api/appcodes_kv_delete.dspy new file mode 100644 index 0000000..cde6f70 --- /dev/null +++ b/wwwroot/api/appcodes_kv_delete.dspy @@ -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) diff --git a/wwwroot/api/appcodes_kv_update.dspy b/wwwroot/api/appcodes_kv_update.dspy new file mode 100644 index 0000000..ca82406 --- /dev/null +++ b/wwwroot/api/appcodes_kv_update.dspy @@ -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) diff --git a/wwwroot/api/appcodes_update.dspy b/wwwroot/api/appcodes_update.dspy new file mode 100644 index 0000000..2eb6ce7 --- /dev/null +++ b/wwwroot/api/appcodes_update.dspy @@ -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) diff --git a/wwwroot/api/svgicon_create.dspy b/wwwroot/api/svgicon_create.dspy new file mode 100644 index 0000000..d46e9fa --- /dev/null +++ b/wwwroot/api/svgicon_create.dspy @@ -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) diff --git a/wwwroot/api/svgicon_delete.dspy b/wwwroot/api/svgicon_delete.dspy new file mode 100644 index 0000000..00acaba --- /dev/null +++ b/wwwroot/api/svgicon_delete.dspy @@ -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) diff --git a/wwwroot/api/svgicon_update.dspy b/wwwroot/api/svgicon_update.dspy new file mode 100644 index 0000000..350ba14 --- /dev/null +++ b/wwwroot/api/svgicon_update.dspy @@ -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)