ymq c7a82dc570 fix(popup): 弹窗居中显示 archor:cc + 修 height:auto 导致的 NaN 位置
Popup 位置计算(height→h)只支持 px/百分比/cheight,不支持 auto:
height:'auto' → parseFloat('auto')=NaN → t=(rect.height-NaN)/2=NaN → top='NaNpx'
浏览器忽略无效值 → 弹窗跑到顶部,表现像 archor:'tc'。
改为 height:'60%' + 显式 archor:'cc'(默认本就是 cc,显式写清居中意图)。
2026-08-25 17:01:25 +08:00

97 lines
3.4 KiB
XML

{
"widgettype": "VBox",
"options": {
"width": "100%",
"padding": "16px",
"spacing": "16px"
},
"subwidgets": [
{
"widgettype": "HBox",
"options": {
"width": "100%",
"justifyContent": "space-between",
"alignItems": "center"
},
"subwidgets": [
{
"widgettype": "Text",
"options": {
"text": "知识库",
"cfontsize": 22,
"fontWeight": "bold",
"color": "#333"
}
},
{
"widgettype": "HBox",
"options": {
"spacing": "8px"
},
"subwidgets": [
{
"widgettype": "Button",
"options": {
"label": "🔍 检索知识",
"bgcolor": "#10b981",
"color": "#fff"
},
"binds": [
{
"wid": "self",
"event": "click",
"actiontype": "urlwidget",
"target": "app.rag_main_content",
"mode": "replace",
"options": {
"url": "./search.ui"
}
}
]
},
{
"widgettype": "Button",
"options": {
"label": "+ 新建知识库",
"bgcolor": "#4a90d9",
"color": "#fff"
},
"binds": [
{
"wid": "self",
"event": "click",
"actiontype": "urlwidget",
"target": "Popup",
"popup_options": {
"auto_dismiss": false,
"dismiss_events": ["cancel", "submited"],
"movable": true,
"archor": "cc",
"width": "34%",
"height": "60%"
},
"options": {
"url": "{{entire_url('./new_kb_form.ui')}}"
}
}
]
}
]
}
]
},
{
"widgettype": "urlwidget",
"options": {
"url": "{{entire_url('./storage_stats.dspy')}}"
}
},
{
"widgettype": "urlwidget",
"options": {
"url": "{{entire_url('./kb_list.dspy')}}"
}
}
]
}