add a svgicon table

This commit is contained in:
yumoqing 2025-08-06 16:17:09 +08:00
parent 809ef77898
commit 34450ca2f7
4 changed files with 28 additions and 0 deletions

13
json/svgicon.json Normal file
View File

@ -0,0 +1,13 @@
{
"tblname":"svgicon",
"params":{
"title":"图标",
"description":"系统中使用的图标",
"sortby":"id",
"browserfields":{
"exclouded":[],
"alters":{}
},
"editexclouded":[]
}
}

BIN
models/svgicon.xlsx Normal file

Binary file not shown.

8
wwwroot/get_icons.dspy Normal file
View File

@ -0,0 +1,8 @@
db = DBPools()
dbname = get_serverenv('get_module_dbname')('appbase')
async with db.sqlorContext(dbname) as sor:
recs = await sor.R('svgicon', {})
for r in recs:
r.icon = f'<svg>{r.icon}</svg>'
return recs
return []

7
wwwroot/show_icon.dspy Normal file
View File

@ -0,0 +1,7 @@
db = DBPools()
dbname = get_severenv('get_module_dbname')('appbase')
async with db.sqlorContext(dbname) as sor:
recs = await sor.R('svgicon', {'id':params_kw.id})
if len(recs) > 0:
return recs[0].icon
return None