feat:完善Collabora组件实现高亮特定文本并跳转页面逻辑

This commit is contained in:
PingChuan
2025-11-27 19:10:00 +08:00
parent f2714360d3
commit 4b53e214ab
5 changed files with 241 additions and 266 deletions
+15 -1
View File
@@ -85,11 +85,25 @@ export async function callPythonScript(
window.addEventListener('message', handleMessage);
// 关键修复: 将所有参数包装为 PropertyValue 格式
// Collabora 源码中的 JsonUtil::makePropertyValue() 要求:
// { "propertyName": { "type": "string", "value": "actual_value" } }
const wrappedArgs: Record<string, { type: string; value: unknown }> = {};
if (args) {
for (const [key, value] of Object.entries(args)) {
wrappedArgs[key] = {
type: typeof value === 'number' ? 'long' : 'string',
value: value
};
}
}
const message = {
MessageId: 'CallPythonScript',
ScriptFile: scriptFile,
Function: functionName,
Values: args || {},
Values: wrappedArgs,
};
if (verbose) {