OpenCV Pipeline für Scan Korrekturen ergänzen
This commit is contained in:
@@ -29,7 +29,9 @@ const scanForm = reactive({
|
||||
format: "pdf",
|
||||
resolution: 300,
|
||||
mode: "Color",
|
||||
source: "ADF Duplex"
|
||||
source: "ADF Duplex",
|
||||
postprocess: true,
|
||||
postprocessProfile: "receipt"
|
||||
})
|
||||
|
||||
const activeAgents = computed(() =>
|
||||
@@ -60,6 +62,8 @@ const applyAgentDefaults = (agent) => {
|
||||
scanForm.resolution = Number(agent.scanDefaults?.resolution || 300)
|
||||
scanForm.mode = agent.scanDefaults?.mode || "Color"
|
||||
scanForm.source = agent.scanDefaults?.source || "ADF Duplex"
|
||||
scanForm.postprocess = agent.scanDefaults?.postprocess !== false
|
||||
scanForm.postprocessProfile = agent.scanDefaults?.postprocessProfile || "receipt"
|
||||
|
||||
if (!scanForm.filename || scanForm.filename.startsWith("scan-")) {
|
||||
scanForm.filename = `scan-${new Date().toISOString().slice(0, 10)}.${scanForm.format || "pdf"}`
|
||||
@@ -128,7 +132,9 @@ const startScan = async () => {
|
||||
format: scanForm.format || "pdf",
|
||||
resolution: Number(scanForm.resolution || 300),
|
||||
mode: scanForm.mode || "Color",
|
||||
source: scanForm.source || null
|
||||
source: scanForm.source || null,
|
||||
postprocess: scanForm.postprocess,
|
||||
postprocessProfile: scanForm.postprocessProfile
|
||||
},
|
||||
target: {
|
||||
folder: props.scanData.folder || null,
|
||||
@@ -268,6 +274,27 @@ loadAgents()
|
||||
</UFormField>
|
||||
</div>
|
||||
|
||||
<div class="grid gap-3 sm:grid-cols-[auto_minmax(0,1fr)]">
|
||||
<UCheckbox
|
||||
v-model="scanForm.postprocess"
|
||||
label="OpenCV-Korrektur"
|
||||
:disabled="scanInProgress"
|
||||
/>
|
||||
<UFormField label="Profil">
|
||||
<USelectMenu
|
||||
v-model="scanForm.postprocessProfile"
|
||||
:items="[
|
||||
{ label: 'Bon', value: 'receipt' },
|
||||
{ label: 'Dokument', value: 'document' },
|
||||
{ label: 'Rohscan', value: 'raw' }
|
||||
]"
|
||||
value-key="value"
|
||||
label-key="label"
|
||||
:disabled="scanInProgress || !scanForm.postprocess"
|
||||
/>
|
||||
</UFormField>
|
||||
</div>
|
||||
|
||||
<UAlert
|
||||
v-if="statusMessage"
|
||||
color="info"
|
||||
|
||||
@@ -27,6 +27,8 @@ const editState = reactive({
|
||||
resolution: 300,
|
||||
mode: "Color",
|
||||
source: "",
|
||||
postprocess: false,
|
||||
postprocessProfile: "document",
|
||||
})
|
||||
|
||||
const selectedAgent = computed(() =>
|
||||
@@ -62,6 +64,8 @@ const applyAgentToForm = (agent: InstanceAgent | null) => {
|
||||
editState.resolution = Number(agent.scanDefaults?.resolution || 300)
|
||||
editState.mode = agent.scanDefaults?.mode || "Color"
|
||||
editState.source = agent.scanDefaults?.source || ""
|
||||
editState.postprocess = Boolean(agent.scanDefaults?.postprocess)
|
||||
editState.postprocessProfile = agent.scanDefaults?.postprocessProfile || "document"
|
||||
}
|
||||
|
||||
watch(selectedAgent, (agent) => applyAgentToForm(agent), { immediate: true })
|
||||
@@ -140,6 +144,8 @@ const saveAgent = async () => {
|
||||
resolution: Number(editState.resolution || 300),
|
||||
mode: editState.mode,
|
||||
source: editState.source || null,
|
||||
postprocess: editState.postprocess,
|
||||
postprocessProfile: editState.postprocessProfile,
|
||||
},
|
||||
})
|
||||
|
||||
@@ -335,6 +341,23 @@ onMounted(async () => {
|
||||
<UInput v-model="editState.source" placeholder="ADF Duplex" />
|
||||
</UFormField>
|
||||
</div>
|
||||
|
||||
<div class="grid gap-3 sm:grid-cols-[auto_minmax(0,1fr)]">
|
||||
<UCheckbox v-model="editState.postprocess" label="OpenCV-Nachbearbeitung" />
|
||||
<UFormField label="Profil">
|
||||
<USelectMenu
|
||||
v-model="editState.postprocessProfile"
|
||||
:items="[
|
||||
{ label: 'Dokument', value: 'document' },
|
||||
{ label: 'Bon', value: 'receipt' },
|
||||
{ label: 'Rohscan', value: 'raw' },
|
||||
]"
|
||||
value-key="value"
|
||||
label-key="label"
|
||||
:disabled="!editState.postprocess"
|
||||
/>
|
||||
</UFormField>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user