fix(cockpit): 切换项目后刷新模型下拉——防止把旧项目选中模型静默写入新项目

This commit is contained in:
ymq 2026-08-28 12:39:28 +08:00
parent b2844cdef4
commit 17670c9a10
2 changed files with 2 additions and 2 deletions

File diff suppressed because one or more lines are too long

View File

@ -100,7 +100,7 @@
"event": "changed",
"actiontype": "script",
"target": "self",
"script": "var v=this.getValue();var pid=(v||{}).project_id||'';if(!pid)return;fetch('/pipeline-sdlc/api/cockpit_context_update.dspy',{method:'POST',headers:{'Content-Type':'application/x-www-form-urlencoded'},body:'project_id='+encodeURIComponent(pid)}).then(function(r){return r.json()}).then(function(r){if(r.success){var pl=bricks.getWidgetById('task_btn',bricks.app);if(pl&&pl.text_w)pl.text_w.set_text('任务');}})"
"script": "var v=this.getValue();var pid=(v||{}).project_id||'';if(!pid)return;fetch('/pipeline-sdlc/api/cockpit_context_update.dspy',{method:'POST',headers:{'Content-Type':'application/x-www-form-urlencoded'},body:'project_id='+encodeURIComponent(pid)+'&session_id='+encodeURIComponent(window._sid())}).then(function(r){return r.json()}).then(function(r){if(r.success){var pl=bricks.getWidgetById('task_btn',bricks.app);if(pl&&pl.text_w)pl.text_w.set_text('任务');var io=bricks.getWidgetById('chat_input',bricks.app);var ms=io&&io.inputw&&io.inputw.model_selector;if(ms&&ms.loadData)ms.loadData();}})"
}
]
},