소스 검색

修改获取文档id和表格名称

zhou1577692533 1 주 전
부모
커밋
ff94f2eb35
1개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. 4 4
      src/script/service.ts

+ 4 - 4
src/script/service.ts

@@ -149,14 +149,14 @@ function getDocumentInfo() {
   try {
     const base = DingdocsScript.base;
     
-    const uuid = base.getDentryUuid?.() || base.getDocUuid?.() || base.getUuid?.() || '';
+    const uuid = (base as any).getDentryUuid?.() || (base as any).getDocUuid?.() || (base as any).getUuid?.() || '';
     console.log('文档UUID获取结果:', uuid);
     
-    const sheets = base.getSheets?.() || base.getSheetList?.() || [];
+    const sheets = (base as any).getSheets?.() || (base as any).getSheetList?.() || [];
     console.log('表格列表:', sheets);
     
-    const activeSheet = base.getActiveSheet?.() || base.getCurrentSheet?.();
-    const currentSheet = activeSheet?.getName?.() || activeSheet?.name || '无';
+    const activeSheet = (base as any).getActiveSheet?.() || (base as any).getCurrentSheet?.();
+    const currentSheet = (activeSheet as any)?.getName?.() || (activeSheet as any)?.name || '无';
     console.log('当前表格:', currentSheet);
     
     return {