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/DocPrt/DocPrt.ts |   80 ++++++++++++++++++++++++++++++++++++++++
 1 files changed, 80 insertions(+), 0 deletions(-)

diff --git a/uiOutput/DocPrt/DocPrt.ts b/uiOutput/DocPrt/DocPrt.ts
new file mode 100644
index 0000000..64cca3c
--- /dev/null
+++ b/uiOutput/DocPrt/DocPrt.ts
@@ -0,0 +1,80 @@
+import { ref, onMounted } from 'vue';
+
+interface PrintItem {
+  id: string;
+  text: string;
+  checked: boolean;
+}
+
+export function useDocPrtLogic() {
+  // --- State Mapped from Delphi UI Components ---
+  
+  const items = ref<PrintItem[]>([]);
+  const selectedIndex = ref<number>(-1);
+
+  // --- Methods ---
+
+  const FormCreate = () => {
+    // PostMessage(Handle,WM_ACTIVATE,WA_CLICKACTIVE,0);
+    console.log('PrintForm created');
+    
+    // Mock data
+    items.value = Array.from({ length: 20 }, (_, i) => ({
+      id: (i + 1).toString(),
+      text: `影像檔 ${i + 1}.jpg`,
+      checked: false
+    }));
+  };
+
+  const SelecAllBtClick = () => {
+    items.value.forEach(item => item.checked = true);
+  };
+
+  const EraseBtClick = () => {
+    items.value.forEach(item => item.checked = false);
+  };
+
+  const ExitBtClick = () => {
+    closeForm('cancel');
+  };
+
+  const PrtBtClick = () => {
+    const selected = items.value.filter(i => i.checked);
+    if (selected.length === 0) {
+      alert('請至少選擇一張影像進行列印');
+      return;
+    }
+    console.log('Printing items:', selected);
+    closeForm('ok');
+  };
+
+  const CheckListBox1Click = (index: number) => {
+    selectedIndex.value = index;
+  };
+
+  const ListBox1Click = (index: number) => {
+    selectedIndex.value = index;
+  };
+
+  const closeForm = (result: string) => {
+    console.log(`PrintForm closing with result: ${result}`);
+  };
+
+  onMounted(() => {
+    FormCreate();
+  });
+
+  return {
+    // State
+    items,
+    selectedIndex,
+    
+    // Actions
+    SelecAllBtClick,
+    EraseBtClick,
+    ExitBtClick,
+    PrtBtClick,
+    CheckListBox1Click,
+    ListBox1Click
+  };
+}

--
Gitblit v1.8.0