|
@@ -148,15 +148,24 @@ async function callApi(apiItem: Record<string, any>): Promise<ApiResponse> {
|
|
|
function getDocumentInfo() {
|
|
function getDocumentInfo() {
|
|
|
try {
|
|
try {
|
|
|
const base = DingdocsScript.base;
|
|
const base = DingdocsScript.base;
|
|
|
- const uuid = base.getDentryUuid();
|
|
|
|
|
- const sheets = base.getSheets();
|
|
|
|
|
|
|
+
|
|
|
|
|
+ const uuid = base.getDentryUuid?.() || base.getDocUuid?.() || base.getUuid?.() || '';
|
|
|
|
|
+ console.log('文档UUID获取结果:', uuid);
|
|
|
|
|
+
|
|
|
|
|
+ const sheets = base.getSheets?.() || base.getSheetList?.() || [];
|
|
|
|
|
+ console.log('表格列表:', sheets);
|
|
|
|
|
+
|
|
|
|
|
+ const activeSheet = base.getActiveSheet?.() || base.getCurrentSheet?.();
|
|
|
|
|
+ const currentSheet = activeSheet?.getName?.() || activeSheet?.name || '无';
|
|
|
|
|
+ console.log('当前表格:', currentSheet);
|
|
|
|
|
|
|
|
return {
|
|
return {
|
|
|
- uuid,
|
|
|
|
|
|
|
+ uuid: uuid || '未知',
|
|
|
sheetsCount: sheets.length,
|
|
sheetsCount: sheets.length,
|
|
|
- currentSheet: base.getActiveSheet()?.getName() || '无'
|
|
|
|
|
|
|
+ currentSheet
|
|
|
};
|
|
};
|
|
|
} catch (error: any) {
|
|
} catch (error: any) {
|
|
|
|
|
+ console.error('获取文档信息失败:', error);
|
|
|
return {
|
|
return {
|
|
|
uuid: '未知',
|
|
uuid: '未知',
|
|
|
sheetsCount: 0,
|
|
sheetsCount: 0,
|