feat: add get_search_{fieldname}.dspy for codes fields with 全部 option
- get_search_providerid.dspy: organization list with 全部 as first entry - get_search_upappid.dspy: upapp list with 全部 as first entry - json/llm.json: update alters dataurl to use search scripts - load_path.py: register new RBAC paths
This commit is contained in:
parent
6bfa0cb27c
commit
bb4900f997
@ -39,11 +39,11 @@
|
|||||||
},
|
},
|
||||||
"providerid": {
|
"providerid": {
|
||||||
"uitype": "code",
|
"uitype": "code",
|
||||||
"dataurl": "{{entire_url('../api/get_organizations.dspy')}}"
|
"dataurl": "{{entire_url('../api/get_search_providerid.dspy')}}"
|
||||||
},
|
},
|
||||||
"upappid": {
|
"upappid": {
|
||||||
"uitype": "code",
|
"uitype": "code",
|
||||||
"dataurl": "{{entire_url('../api/get_upapps.dspy')}}"
|
"dataurl": "{{entire_url('../api/get_search_upappid.dspy')}}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -88,6 +88,8 @@ PATHS_LOGINED = [
|
|||||||
f"/{MOD}/api/get_catelogs.dspy",
|
f"/{MOD}/api/get_catelogs.dspy",
|
||||||
f"/{MOD}/api/get_organizations.dspy",
|
f"/{MOD}/api/get_organizations.dspy",
|
||||||
f"/{MOD}/api/get_ppids.dspy",
|
f"/{MOD}/api/get_ppids.dspy",
|
||||||
|
f"/{MOD}/api/get_search_providerid.dspy",
|
||||||
|
f"/{MOD}/api/get_search_upappid.dspy",
|
||||||
f"/{MOD}/api/get_upapps.dspy",
|
f"/{MOD}/api/get_upapps.dspy",
|
||||||
f"/{MOD}/api/llm_api_map_create.dspy",
|
f"/{MOD}/api/llm_api_map_create.dspy",
|
||||||
f"/{MOD}/api/llm_api_map_delete.dspy",
|
f"/{MOD}/api/llm_api_map_delete.dspy",
|
||||||
|
|||||||
15
wwwroot/api/get_search_providerid.dspy
Normal file
15
wwwroot/api/get_search_providerid.dspy
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
result = [{'providerid': '', 'providerid_text': '全部'}]
|
||||||
|
|
||||||
|
try:
|
||||||
|
async with get_sor_context(request._run_ns, 'rbac') as sor:
|
||||||
|
orgs = await sor.sqlExe(
|
||||||
|
"select id, orgname from organization order by orgname",
|
||||||
|
{}
|
||||||
|
)
|
||||||
|
if orgs:
|
||||||
|
for r in orgs:
|
||||||
|
result.append({'providerid': str(r.id), 'providerid_text': r.orgname or ''})
|
||||||
|
except Exception as e:
|
||||||
|
debug(f'get_search_providerid error: {e}')
|
||||||
|
|
||||||
|
return json.dumps(result, ensure_ascii=False)
|
||||||
15
wwwroot/api/get_search_upappid.dspy
Normal file
15
wwwroot/api/get_search_upappid.dspy
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
result = [{'upappid': '', 'upappid_text': '全部'}]
|
||||||
|
|
||||||
|
try:
|
||||||
|
async with get_sor_context(request._run_ns, 'uapi') as sor:
|
||||||
|
apps = await sor.sqlExe(
|
||||||
|
"select id, name from upapp order by name",
|
||||||
|
{}
|
||||||
|
)
|
||||||
|
if apps:
|
||||||
|
for r in apps:
|
||||||
|
result.append({'upappid': str(r.id), 'upappid_text': r.name or ''})
|
||||||
|
except Exception as e:
|
||||||
|
debug(f'get_search_upappid error: {e}')
|
||||||
|
|
||||||
|
return json.dumps(result, ensure_ascii=False)
|
||||||
Loading…
x
Reference in New Issue
Block a user