From 0756bf12d10cf1b7f78c571de0a9ad69cbaeb7ca Mon Sep 17 00:00:00 2001
From: curtis <curtis@i-mps.com>
Date: 星期一, 30 三月 2026 14:24:17 +0800
Subject: [PATCH] fix: 更新內部引用方法參照

---
 uiOutput/OldCaseInfo/OldCaseInfo.ts |  116 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 116 insertions(+), 0 deletions(-)

diff --git a/uiOutput/OldCaseInfo/OldCaseInfo.ts b/uiOutput/OldCaseInfo/OldCaseInfo.ts
new file mode 100644
index 0000000..42ae667
--- /dev/null
+++ b/uiOutput/OldCaseInfo/OldCaseInfo.ts
@@ -0,0 +1,116 @@
+import { ref, onMounted } from 'vue';
+
+interface OldCase {
+  id: string;
+  year: string;
+  type: string;
+  isOld: string;
+}
+
+interface DocGroup {
+  text: string;
+  checked: boolean;
+  pages: string[];
+}
+
+export function useOldCaseInfoLogic() {
+  // --- State Mapped from Delphi UI Components ---
+  
+  const currentPage = ref<'CaseInfo' | 'View'>('CaseInfo');
+  const oldCases = ref<OldCase[]>([]);
+  const selectedCaseIndex = ref<number>(-1);
+  
+  const docGroups = ref<DocGroup[]>([]);
+  const selectedGroupIndex = ref<number>(-1);
+  
+  const previewImage = ref<string>('');
+
+  // --- Methods ---
+
+  const FormCreate = () => {
+    console.log('OldCaseInfoForm created');
+    // Mock data for OldCaseLV
+    oldCases.value = [
+      { id: 'CASE2023001', year: '2023', type: 'HLN', isOld: 'Y' },
+      { id: 'CASE2022045', year: '2022', type: 'HLN', isOld: 'Y' },
+      { id: 'CASE2024012', year: '2024', type: 'NORMAL', isOld: 'N' }
+    ];
+  };
+
+  const LoadBtClick = () => {
+    if (selectedCaseIndex.value === -1) {
+      alert('請先選擇一個案件編號');
+      return;
+    }
+    
+    console.log('Loading case:', oldCases.value[selectedCaseIndex.value].id);
+    currentPage.value = 'View';
+    
+    // Mock doc groups loading
+    docGroups.value = [
+      { text: '身份證{正本}-1', checked: false, pages: ['assets/DocList.png'] },
+      { text: '申請書{複本}-2', checked: false, pages: ['assets/CB_IMGPSScanImp.png', 'assets/DocPrt.png'] },
+      { text: '財力證明{附件}-1', checked: false, pages: ['assets/ErrList.png'] }
+    ];
+  };
+
+  const ImportBtClick = () => {
+    const selected = docGroups.value.filter(g => g.checked);
+    if (selected.length === 0) {
+      alert('請至少選擇一個要引用之文件');
+      return;
+    }
+    console.log('Importing groups:', selected);
+    closeForm('ok');
+  };
+
+  const ExitBtClick = () => {
+    currentPage.value = 'CaseInfo';
+  };
+
+  const OldExitBtClick = () => {
+    closeForm('cancel');
+  };
+
+  const CheckListBox1Click = (index: number) => {
+    selectedGroupIndex.value = index;
+    if (docGroups.value[index].pages.length > 0) {
+      previewImage.value = docGroups.value[index].pages[0];
+    }
+  };
+
+  const selectCase = (index: number) => {
+    selectedCaseIndex.value = index;
+  };
+
+  const setThumbnailAsPreview = (url: string) => {
+    previewImage.value = url;
+  };
+
+  const closeForm = (result: string) => {
+    console.log(`OldCaseInfoForm closing with result: ${result}`);
+  };
+
+  onMounted(() => {
+    FormCreate();
+  });
+
+  return {
+    // State
+    currentPage,
+    oldCases,
+    selectedCaseIndex,
+    docGroups,
+    selectedGroupIndex,
+    previewImage,
+    
+    // Actions
+    LoadBtClick,
+    ImportBtClick,
+    ExitBtClick,
+    OldExitBtClick,
+    CheckListBox1Click,
+    selectCase,
+    setThumbnailAsPreview
+  };
+}

--
Gitblit v1.8.0