feat:完善Collabora组件实现高亮特定文本并跳转页面逻辑
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user