@@ -43,9 +43,13 @@
< h2 > { { t ( currentSection . labelKey ) } } < / h2 >
< p > { { t ( currentSection . helpKey ) } } < / p >
< / div >
< div class = "workbench-actions" >
< button v-if = "activeTab === 'sources'" type="button" class="secondary-action" @click="openBulkParsingBinding" > {{ t ( ' admin.shippingInventory.bulkBindParsingProfile ' ) }} < / button >
< button v-if = "activeTab === 'sources'" type="button" class="secondary-action" @click="openBatchValidation" > {{ t ( ' admin.shippingInventory.batchValidation ' ) }} < / button >
< button v-if = "isEditableTab" type="button" class="primary-action" @click="createNew" >
{{ t ( ' admin.shippingInventory.createNew ' ) }}
< / button >
< / div >
< / div >
< p
@@ -110,7 +114,7 @@
< aside class = "editor-drawer" role = "dialog" aria -modal = " true " :aria-label = "t(currentEditorSection.labelKey)" >
< header class = "drawer-header" >
< div >
< h3 > { { selectedId ? rowTitle ( currentItems . find ( ( item ) => Number ( item . id ) === selectedId ) || { } ) : t ( 'admin.shippingInventory.createNew' ) } } < / h3 >
< div class = "drawer-title-row" > < h3 > { { selectedId ? rowTitle ( currentItems . find ( ( item ) => Number ( item . id ) === selectedId ) || { } ) : t ( 'admin.shippingInventory.createNew' ) } } < / h3 > < span v-if = "activeTab === 'sources' && selectedId" class="source-run-status" :class="{ enabled: source.enabled }" > {{ source.enabled ? t ( ' admin.shippingInventory.siteEnabled ' ) : t ( ' admin.shippingInventory.siteNotEnabled ' ) }} < / span > < / div >
< p > { { t ( currentEditorSection . helpKey ) } } < / p >
< / div >
< button type = "button" class = "drawer-close" :aria-label = "t('admin.close')" @click ="closeDrawer" > × < / button >
@@ -133,7 +137,7 @@
< label > < span > { { t ( 'admin.shippingInventory.inventorySiteName' ) } } < / span > < input v-model = "source.display_name" required > < / label >
< label > < span > { { t ( 'admin.shippingInventory.connectorType' ) } } < / span > < select v-model = "source.connector_type"><option value="dbs">{{ t('admin.shippingInventory.platform.dbs') }}</option><option value="crane" > {{ t ( ' admin.shippingInventory.platform.crane ' ) }} < / option > < / select > < / label >
< label > < span > { { t ( 'admin.shippingInventory.connection' ) } } < / span > < select v -model .number = " source.rpa_profile_id " required > < option :value = "0" > { { t ( 'admin.shippingInventory.chooseConnection' ) } } < / option > < option v-for = "item in compatibleProfiles" :key="String(item.id)" :value="Number(item.id)" > {{ item.display_name | | item.profile_code }} < / option > < / select > < / label >
< label > < span > { { t ( 'admin.shippingInventory.parsingProfiles' ) } } < / span > < output class = "setup-status" > { { source . parsing _profile _id ? parsingProfileName ( source . parsing _profile _id ) : t ( 'admin.shippingInventory.notGenerat ed' ) } } < / output > < small > { { t ( 'admin.shippingInventory.parsingProfileGeneratedByTest' ) } } < / small > < / label >
< label > < span > { { t ( 'admin.shippingInventory.parsingProfiles' ) } } < / span > < select v -model .number = " source.parsing_profile_id " :disabled = "source.enabled" > < option :value = "0" > { { t ( 'admin.shippingInventory.notConfigur ed' ) } } < / option > < option v-for = "item in parsingProfiles.filter((row) => row.status === 'published')" :key="String(item.id)" :value="Number(item.id)" > {{ item.display_name | | item.profile_code }} V {{ item.version }} < / option > < / select > < / label >
< label > < span > { { t ( 'admin.shippingInventory.excelTemplates' ) } } < / span > < select v -model .number = " source.excel_template_id " > < option :value = "0" > { { t ( 'admin.shippingInventory.notConfigured' ) } } < / option > < option v-for = "item in excelTemplates.filter((row) => row.status === 'published')" :key="String(item.id)" :value="Number(item.id)" > {{ item.display_name | | item.template_code }} < / option > < / select > < / label >
< label > < span > { { t ( 'admin.shippingInventory.warehouseResolution' ) } } < / span > < select v-model = "source.warehouse_resolution_mode"><option value="fixed">{{ t('admin.shippingInventory.fixedWarehouse') }}</option><option value="inventory_match" > {{ t ( ' admin.shippingInventory.inventoryMatch ' ) }} < / option > < / select > < / label >
< label v-if = "source.warehouse_resolution_mode === 'fixed'"><span>{{ t('admin.shippingInventory.warehouse') }}</span><input v-model="source.fixed_warehouse_id" required > < / label >
@@ -142,45 +146,46 @@
< header class = "readiness-heading" >
< div >
< span class = "readiness-kicker" > { { t ( 'admin.shippingInventory.activationStatus' ) } } < / span >
< strong > { { source . enabled ? t ( 'admin.shippingInventory.activationReady' ) : t ( 'admin.shippingInventory.activationDraft' ) } } < / strong >
< strong > { { readinessHeadline } } < / strong >
< p > { { readinessGuidance } } < / p >
< / div >
< span class = "readiness-count" > { { readinessSummary } } < / span >
< / header >
< ol class = "readiness-steps " >
< li v-for = "check in readinessChecks" :key="check.code" :class="`is-${check.status}` " >
< span class = "readiness-marker" aria -hidden = " true " > { { readinessMarker ( check . status ) } } < / span >
< div class = "readiness-copy" >
< b > { { t ( ` admin.shippingInventory.activationRequirement. ${ check . code } ` ) } } < / b >
< small > { { readinessDetail ( check ) } } < / small >
< / div >
< button
v-if = "readinessActionLabel(check) && !source.enabled"
type = "button"
class = "readiness-action"
:disabled = "isReadinessActionBlocked(check)"
: title = "isReadinessActionBlocked(check) ? t('admin.shippingInventory.saveBeforeReadinessAction') : undefined"
@click ="runR eadinessAc tion(check)"
> { { readinessActionLabel ( check ) } } < / button >
< / li >
< / ol >
< p v-if = "!source.enabled" class="readiness-note" > {{ t ( ' admin.shippingInventory.configurationTestHint ' ) }} < / p >
< section class = "readiness-section " >
< div class = "readiness-section-heading " >
< b > { { t ( 'admin.shippingInventory.activationRequiredTitle' ) } } < / b >
< small > { { t ( 'admin.shippingInventory.activationRequiredHint' ) } } < / small >
< / div >
< ol v-if = "firstBlockingCheck && !source.enabled" class="readiness-steps" >
< li :class = "`is-${firstBlockingCheck.status}`" >
< span class = "readiness-marker" aria -hidden = " true " > { { readinessMarker ( firstBlockingCheck . status ) } } < / span >
< div class = "readiness-copy" > < b > { { t ( ` admin.shippingInventory.activationRequirement. ${ firstBlockingCheck . code } ` ) } } < / b > < small > { { readinessDetail ( firstBlockingCheck ) } } < / small > < / div >
< button v-if = "readinessActionLabel(firstBlockingCheck)" type="button" class="readiness-action" :disabled="isReadinessActionBlocked(firstBlockingCheck)" :title="isReadinessActionBlocked(firstBlockingCheck) ? t('admin.shippingInventory.saveBeforeReadinessAction') : undefined" @click="runReadinessAction(firstBlockingCheck)" > {{ readinessActionLabel ( firstBlockingCheck ) }} < / button >
< / li >
< / ol >
< / section >
< details v-if = "optionalReadinessChecks.length" class="r eadiness-op tional" >
< summary > < span > { { t ( 'admin.shippingInventory.activationOptionalTitle' ) } } < / span > < small > { { t ( 'admin.shippingInventory.activationOptionalHint' ) } } < / small > < / summary >
< ol class = "readiness-steps" >
< li v-for = "check in optionalReadinessChecks" :key="check.code" :class="`is-${check.status}`" >
< span class = "readiness-marker" aria -hidden = " true " > { { readinessMarker ( check . status ) } } < / span >
< div class = "readiness-copy" > < b > { { t ( ` admin.shippingInventory.activationRequirement. ${ check . code } ` ) } } < / b > < small > { { readinessDetail ( check ) } } < / small > < / div >
< / li >
< / ol >
< / details >
< template v-if = "configurationTest" >
< p class = "readiness-run" : class = "{ failed: configurationTest.status === 'failed' }" > { { t ( ` admin.shippingInventory.configurationTestStage. ${ configurationTest . stage } ` ) } } < / p >
< dl class = "readiness-audit" >
< div > < dt > { { t ( 'admin.shippingInventory.configurationTestRunNo' ) } } < / dt > < dd > { { configurationTest . run _no } } < / dd > < / div >
< div > < dt > { { t ( 'admin.shippingInventory.configurationTestConfigVersion' ) } } < / dt > < dd > { { configurationTest . source _config _version } } < / dd > < / div >
< div > < dt > { { t ( 'admin.shippingInventory.configurationTestConnectionVersion' ) } } < / dt > < dd > { { configurationTest . rpa _profile _config _version } } < / dd > < / div >
< div > < dt > { { t ( 'admin.shippingInventory.configurationTestUpdatedAt' ) } } < / dt > < dd > { { formatDate ( configurationTest . completed _at || configurationTest . created _at ) } } < / dd > < / div >
< / dl >
< details class = "readiness-audit" > < summary > { { t ( 'admin.shippingInventory.configurationTestRunNo' ) } } { { configurationTest . run _no } } < / summary > < dl > < div > < dt > { { t ( 'admin.shippingInventory.configurationTestConfigVersion' ) } } < / dt > < dd > { { configurationTest . source _config _version } } < / dd > < / div > < div > < dt > { { t ( 'admin.shippingInventory.configurationTestConnectionVersion' ) } } < / dt > < dd > { { configurationTest . rpa _profile _config _version } } < / dd > < / div > < div > < dt > { { t ( 'admin.shippingInventory.configurationTestUpdatedAt' ) } } < / dt > < dd > { { formatDate ( configurationTest . completed _at || configurationTest . created _at ) } } < / dd > < / div > < / dl > < / details >
< p v-if = "configurationTest.error_message" class="form-tip" > {{ configurationTest.error_message }} < / p >
< p v-if = "configurationTest.status === 'completed_empty'" class="form-tip" > {{ t ( ' admin.shippingInventory.configurationTestEmptyResult ' ) }} < / p >
< section v-if = "configurationTest.status === 'completed'" class="recommendation-list" >
< article v-for = "candidate in configurationTest.result?.analysis?.match_result?.candidates || []" :key="candidate.profile_id"><b>{{ candidate.display_name }} V{{ candidate.version }}</b><small>{{ t(`admin.shippingInventory.recommendationLevel.${candidate.level}`) }}</small><button type="button " class="se condary-action" @click="confirmTestProfile(candidate.profile_id)" > {{ t ( ' admin.shippingInventory.confirmTestProfile ' ) }} < / button > < / article >
< p v-if = "!( configurationTest.result?.analysis?.match_result?.candidates || []).length" > {{ t ( ' admin.shippingInventory.configurationTestNoRecommendation ' ) }} < / p >
< p v-if = "configurationTest.result?.current_profile_verified " class="configuration-test-verified" > {{ t ( ` admin.shippingInventory.currentProfileVerified. $ { configurationTest.result.profile_match_level | | ' compatible ' } ` ) }} < / p >
< article v-for = "candidate in configurationTest.result?.analysis?.match_result?.candidates || []" :key="candidate.profile_id" > < b > { { candidate . display _name } } V { { candidate . version } } < / b > < small > { { t ( ` admin.shippingInventory.recommendationLevel. ${ candidate . level } ` ) } } · { { t ( 'admin.shippingInventory.configurationTestCandidateHint' ) } } < / small > < / article >
< p v-if = "!configurationTest.result?.current_profile_verified && !(configurationTest.result?.analysis?.match_result?.candidates || []).length" > {{ t ( ' admin.shippingInventory.configurationTestNoRecommendation ' ) }} < / p >
< / section >
< / template >
< footer class = "readiness-footer" >
< button v-if = "!source.enabled" type="button" class="primary-action" :disabled="!source.activation?.ready || sourceDirty" :title="sourceDirty ? t('admin.shippingInventory.saveBeforeReadinessAction') : undefined" @click="requestSourceA ctivation" > {{ t ( ' admin.shippingInventory.activateSource ' ) }} < / button >
< button v-else type = "button" class = "text-action danger" @click ="requestSourceDeactivation" > {{ t ( ' admin.shippingInventory.deactivateSource ' ) }} < / button >
< footer v-if = "source.enabled" class=" readiness-footer" >
< button type = "button" class = "text-action danger" @click ="requestSourceDea ctivation" > {{ t ( ' admin.shippingInventory.deactivateSource ' ) }} < / button >
< / footer >
< / section >
< div v-if = "!selectedId" class="form-tip full" > {{ t ( ' admin.shippingInventory.sourceSavedDisabledHint ' ) }} < / div >
@@ -201,7 +206,6 @@
< / div >
< button type = "button" class = "secondary-action full" @click ="addParameter" > {{ t ( ' admin.shippingInventory.addParameter ' ) }} < / button >
< / template >
< label class = "full" > < span > { { t ( 'admin.shippingInventory.matchAliases' ) } } < / span > < input : value = "source.match_aliases_json.join(', ')" :placeholder = "t('admin.shippingInventory.aliasHint')" @input ="source.match_aliases_json = splitValues(($event.target as HTMLInputElement).value)" > < / label >
< / template >
< template v-else-if = "activeTab === 'parsing'" >
@@ -333,9 +337,7 @@
< label > < span > { { t ( 'admin.shippingInventory.priority' ) } } < / span > < input v -model .number = " rule.priority " :disabled = "ruleReadOnly" type = "number" > < / label >
< div class = "subsection full" > { { t ( 'admin.shippingInventory.ruleConditions' ) } } < / div >
< div v-for = "(condition, index) in rule.conditions" :key="index" class="condition-row full" >
< select v-model = "condition.source_kin d" :disabled="ruleReadOnly"><option value="order_field">{{ t('admin.shippingInventory.routeConditionSource.order_field') }}</option><option value="system_fact" > {{ t ( ' admin.shippingInventory.routeConditionSource.system_fact ' ) }} < / option > < / select >
< select v-if = "condition.source_kind === 'order_field'" v-model="condition.order_field_id" :disabled="ruleReadOnly" :aria-label="t('admin.shippingInventory.factPath')"><option value="">-</option><option v-for="field in compatibleRoutingFields" :key="field.field_id" :value="field.field_id" > {{ field.display_name }} < / option > < / select >
< select v-else v-model = "condition.system_fact_key" :disabled="ruleReadOnly" :aria-label="t('admin.shippingInventory.factPath')"><option value="">-</option><option v-for="key in systemFacts" :key="key" :value="key" > {{ t ( ` admin.shippingInventory.systemFact. $ { key } ` ) }} < / option > < / select >
< select v-model = "condition.order_field_i d" :disabled="ruleReadOnly" :aria-label="t('admin.shippingInventory.factPath')"><option value="">-</option><option v-for="field in compatibleRoutingFields" :key="field.field_id" :value="field.field_id" > {{ field.display_name }} < / option > < / select >
< select v-model = "condition.operator" :disabled="ruleReadOnly" :aria-label="t('admin.shippingInventory.operator')"><option v-for="item in operators" :key="item.value" :value="item.value" > {{ item.label }} < / option > < / select >
< input v-if = "conditionNeedsExpected(condition)" v-model="condition.expected" :disabled="ruleReadOnly" :placeholder="t('admin.shippingInventory.expectedValue')" >
< span v-else class = "condition-empty" > { { t ( 'admin.shippingInventory.noExpectedValue' ) } } < / span >
@@ -363,6 +365,7 @@
< button v-if = "activeTab === 'rules' && selectedId && selectedRuleStatus === 'published'" type="button" class="secondary-action" @click="retireCurrentRule" > {{ t ( ' admin.shippingInventory.retire ' ) }} < / button >
< button v-if = "activeTab === 'templates' && selectedId && selectedTemplateStatus === 'draft'" type="button" class="secondary-action" @click="publishCurrentTemplate" > {{ t ( ' admin.shippingInventory.publishTemplate ' ) }} < / button >
< button v-if = "activeTab === 'templates' && selectedId && selectedTemplateStatus !== 'draft'" type="button" class="secondary-action" @click="createTemplateVersion" > {{ t ( ' admin.shippingInventory.createTemplateVersion ' ) }} < / button >
< button v-if = "activeTab === 'templates' && selectedId" type="button" class="secondary-action" @click="openTemplateCloneDialog" > {{ t ( ' admin.shippingInventory.cloneTemplate ' ) }} < / button >
< button v-if = "activeTab === 'templates' && selectedId && selectedTemplateStatus === 'published'" type="button" class="text-action danger retire-template-action" @click="retireCurrentTemplate" > {{ t ( ' admin.shippingInventory.retireTemplate ' ) }} < / button >
< button v-if = "activeTab === 'parsing' && selectedId && selectedParsingStatus === 'draft'" type="button" class="secondary-action" @click="publishCurrentParsingProfile" > {{ t ( ' admin.shippingInventory.publishProfile ' ) }} < / button >
< button v-if = "activeTab === 'parsing' && selectedId && selectedParsingStatus === 'published'" type="button" class="text-action danger retire-template-action" @click="retireCurrentParsingProfile" > {{ t ( ' admin.shippingInventory.retireProfile ' ) }} < / button >
@@ -386,6 +389,46 @@
@cancel ="clearConfirmation"
@confirm ="confirmPendingAction"
/ >
< div v-if = "templateClone.visible" class="drawer-mask clone-template-mask" @click.self="closeTemplateCloneDialog" >
< section class = "clone-template-dialog" role = "dialog" aria -modal = " true " :aria-labelledby = "'clone-template-title'" >
< header class = "clone-template-header" >
< div > < h3 id = "clone-template-title" > { { t ( 'admin.shippingInventory.cloneTemplate' ) } } < / h3 > < p > { { t ( 'admin.shippingInventory.cloneTemplateHint' ) } } < / p > < / div >
< button type = "button" class = "drawer-close" :aria-label = "t('admin.close')" @click ="closeTemplateCloneDialog" > × < / button >
< / header >
< form class = "clone-template-form" @submit.prevent ="cloneCurrentTemplate" >
< label > < span > { { t ( 'admin.shippingInventory.templateCode' ) } } < / span > < input v-model = "templateClone.template_code" required pattern="[A-Za-z0-9_-]{2,64}" autocomplete="off" > < small > { { t ( 'admin.shippingInventory.cloneTemplateCodeHint' ) } } < / small > < / label >
< label > < span > { { t ( 'admin.shippingInventory.excelTemplateName' ) } } < / span > < input v-model = "templateClone.display_name" required autocomplete="off" > < / label >
< div class = "clone-template-actions" > < button type = "button" class = "text-action" :disabled = "templateClone.saving" @click ="closeTemplateCloneDialog" > {{ t ( ' admin.cancel ' ) }} < / button > < button type = "submit" class = "primary-action" :disabled = "templateClone.saving" > { { templateClone . saving ? t ( 'admin.shippingInventory.saving' ) : t ( 'admin.shippingInventory.cloneTemplateConfirm' ) } } < / button > < / div >
< / form >
< / section >
< / div >
< div v-if = "bulkBinding.visible" class="drawer-mask clone-template-mask" @click.self="closeBulkParsingBinding" >
< section class = "clone-template-dialog" role = "dialog" aria -modal = " true " aria -labelledby = " bulk -parsing -binding -title " >
< header class = "clone-template-header" > < div > < h3 id = "bulk-parsing-binding-title" > { { t ( 'admin.shippingInventory.bulkBindParsingProfile' ) } } < / h3 > < p > { { t ( 'admin.shippingInventory.bulkBindParsingProfileHint' ) } } < / p > < / div > < button type = "button" class = "drawer-close" :aria-label = "t('admin.close')" @click ="closeBulkParsingBinding" > × < / button > < / header >
< form class = "clone-template-form" @submit.prevent ="submitBulkParsingBinding" >
< label > < span > { { t ( 'admin.shippingInventory.inventorySites' ) } } < / span > < select v-model = "bulkBinding.sourceIds" multiple required><option v-for="item in sources.filter((row) => !row.enabled)" :key="String(item.id)" :value="Number(item.id)" > {{ item.display_name | | item.source_code }} < / option > < / select > < / label >
< label > < span > { { t ( 'admin.shippingInventory.parsingProfiles' ) } } < / span > < select v -model .number = " bulkBinding.profileId " required > < option :value = "0" > { { t ( 'admin.shippingInventory.notConfigured' ) } } < / option > < option v-for = "item in parsingProfiles.filter((row) => row.status === 'published')" :key="String(item.id)" :value="Number(item.id)" > {{ item.display_name | | item.profile_code }} V {{ item.version }} < / option > < / select > < / label >
< div class = "clone-template-actions" > < button type = "button" class = "text-action" :disabled = "bulkBinding.saving" @click ="closeBulkParsingBinding" > {{ t ( ' admin.cancel ' ) }} < / button > < button type = "submit" class = "primary-action" :disabled = "bulkBinding.saving" > { { bulkBinding . saving ? t ( 'admin.shippingInventory.saving' ) : t ( 'admin.shippingInventory.bulkBindParsingProfile' ) } } < / button > < / div >
< / form >
< / section >
< / div >
< div v-if = "batchValidation.visible" class="drawer-mask clone-template-mask" @click.self="closeBatchValidation" >
< section class = "batch-validation-dialog" role = "dialog" aria -modal = " true " aria -labelledby = " batch -validation -title " >
< header class = "clone-template-header" > < div > < h3 id = "batch-validation-title" > { { t ( 'admin.shippingInventory.batchValidation' ) } } < / h3 > < p > { { t ( 'admin.shippingInventory.batchValidationHint' ) } } < / p > < / div > < button type = "button" class = "drawer-close" :aria-label = "t('admin.close')" @click ="closeBatchValidation" > × < / button > < / header >
< form v-if = "!batchValidation.result" class="batch-selection" @submit.prevent="submitBatchValidation" >
< div class = "batch-selection-toolbar" > < label > < span > { { t ( 'admin.shippingInventory.inventorySites' ) } } < / span > < input v-model = "batchValidation.query" :placeholder="t('admin.shippingInventory.batchValidationSearch')"></label><div class="batch-selection-actions"><button type="button" class="text-action" :disabled="!filteredBatchValidationSources.length" @click="toggleFilteredBatchValidationSources" > {{ allFilteredBatchValidationSourcesSelected ? t ( ' admin.shippingInventory.batchValidationClearFiltered ' ) : t ( ' admin.shippingInventory.batchValidationSelectFiltered ' ) }} < / button > < b > { { t ( 'admin.shippingInventory.batchValidationSelected' , { count : batchValidation . sourceIds . length } ) } } < / b > < / div > < / div >
< div class = "batch-source-list" > < label v-for = "item in filteredBatchValidationSources" :key="String(item.id)" class="batch-source-option"><input v-model="batchValidation.sourceIds" type="checkbox" :value="Number(item.id)"><span><b>{{ item.display_name || item.source_code }}</b><small>{{ item.source_code }} · {{ connectionName(item.source_code) }}</small></span></label><p v-if="!filteredBatchValidationSources.length" class="batch-empty" > {{ t ( ' admin.shippingInventory.batchValidationNoSites ' ) }} < / p > < / div >
< div class = "clone-template-actions" > < button type = "button" class = "text-action" :disabled = "batchValidation.saving" @click ="closeBatchValidation" > {{ t ( ' admin.cancel ' ) }} < / button > < button type = "submit" class = "primary-action" : disabled = "batchValidation.saving || !batchValidation.sourceIds.length" > { { batchValidation . saving ? t ( 'admin.shippingInventory.configurationTestRunning' ) : t ( 'admin.shippingInventory.batchValidation' ) } } < / button > < / div >
< / form >
< div v-else class = "batch-progress" >
< div class = "batch-progress-heading" > < div > < span > { { t ( ` admin.shippingInventory.batchValidationStatus. ${ batchValidation . result . status } ` ) } } < / span > < strong > { { t ( 'admin.shippingInventory.batchValidationProgress' , batchValidation . result ) } } < / strong > < / div > < b > { { batchCompletedCount } } / { { batchValidation . result . total _count } } < / b > < / div >
< div class = "batch-progress-bar" role = "progressbar" :aria-valuenow = "batchCompletedCount" :aria-valuemax = "batchValidation.result.total_count" > < i : style = "{ width: `${batchProgressPercent}%` }" > < / i > < / div >
< div class = "batch-stat-grid" > < button type = "button" : class = "{ active: batchValidation.statusFilter === 'all' }" @click ="batchValidation.statusFilter = 'all'" > < b > { { batchValidation . result . total _count } } < / b > < span > { { t ( 'admin.shippingInventory.batchValidationStat.total' ) } } < / span > < / button > < button type = "button" : class = "{ active: batchValidation.statusFilter === 'processing' }" @click ="batchValidation.statusFilter = 'processing'" > < b > { { batchProcessingCount } } < / b > < span > { { t ( 'admin.shippingInventory.batchValidationStat.processing' ) } } < / span > < / button > < button type = "button" : class = "{ active: batchValidation.statusFilter === 'completed' }" @click ="batchValidation.statusFilter = 'completed'" > < b > { { batchValidation . result . success _count } } < / b > < span > { { t ( 'admin.shippingInventory.batchValidationStat.success' ) } } < / span > < / button > < button type = "button" : class = "{ active: batchValidation.statusFilter === 'completed_empty' }" @click ="batchValidation.statusFilter = 'completed_empty'" > < b > { { batchValidation . result . empty _count } } < / b > < span > { { t ( 'admin.shippingInventory.batchValidationStat.empty' ) } } < / span > < / button > < button type = "button" : class = "{ active: batchValidation.statusFilter === 'failed' }" @click ="batchValidation.statusFilter = 'failed'" > < b > { { batchValidation . result . failed _count } } < / b > < span > { { t ( 'admin.shippingInventory.batchValidationStat.failed' ) } } < / span > < / button > < / div >
< div class = "batch-run-list" > < article v-for = "run in filteredBatchValidationRuns" :key="run.run_no" class="batch-run" :class="`is-${run.status}`"><span class="batch-run-marker"></span><div><b>{{ sourceTitleById(run.inventory_source_id) }}</b><small>{{ t(`admin.shippingInventory.configurationTestStage.${run.stage}`) }}</small></div><small v-if="run.error_message" class="batch-run-error">{{ run.error_message }}</small></article><p v-if="!filteredBatchValidationRuns.length" class="batch-empty" > {{ t ( ' admin.shippingInventory.batchValidationNoRuns ' ) }} < / p > < / div >
< div class = "clone-template-actions" > < button v-if = "batchValidation.result.failed_count" type="button" class="secondary-action" @click="retryBatchValidation">{{ t('admin.shippingInventory.retryFailedValidation') }}</button><button type="button" class="primary-action" @click="closeBatchValidation" > {{ t ( ' admin.close ' ) }} < / button > < / div >
< / div >
< / section >
< / div >
< div v-if = "auditDetail" class="drawer-mask" @click.self="auditDetail = null"><aside class="editor-drawer audit-detail" role="dialog" aria-modal="true"><header class="drawer-header"><div><h3>{{ auditDetail.kind === 'snapshot' ? t('admin.shippingInventory.snapshotDetail') : t('admin.shippingInventory.exportDetail') }}</h3><p>{{ auditDetail.item.inventory_file_no || auditDetail.item.rpa_run_no || '-' }}</p></div><button type="button" class="drawer-close" :aria-label="t('admin.close')" @click="auditDetail = null">× </button></header><dl><template v-for="entry in auditDetailEntries" :key="entry.label" > < dt > { { entry . label } } < / dt > < dd > { { entry . value } } < / dd > < / template > < / dl > < / aside > < / div >
< / section >
< / template >
@@ -407,7 +450,6 @@ import {
deleteShippingInventoryParsingProfile ,
deleteShippingInventoryRule ,
deleteShippingInventorySource ,
activateShippingInventorySource ,
deactivateShippingInventorySource ,
deleteShippingRpaProfile ,
getShippingInventoryConfig ,
@@ -416,6 +458,7 @@ import {
getShippingInventoryRoutingFields ,
createShippingExcelTemplate ,
createShippingExcelTemplateVersion ,
cloneShippingExcelTemplate ,
getShippingExcelTemplateLayout ,
createShippingInventoryStructureAnalysis ,
createShippingInventoryParsingDraftFromAnalysis ,
@@ -426,7 +469,10 @@ import {
startShippingInventoryConfigurationTest ,
getShippingInventoryConfigurationTest ,
getLatestShippingInventoryConfigurationTest ,
confirmShippingInventoryConfigurationTestProfile ,
startShippingInventoryValidationBatch ,
getShippingInventoryValidationBatch ,
getLatestActiveShippingInventoryValidationBatch ,
retryFailedShippingInventoryValidationBatch ,
downloadShippingInventorySnapshot ,
updateShippingExcelTemplate ,
publishShippingExcelTemplate ,
@@ -441,14 +487,16 @@ import {
saveShippingInventoryRule ,
saveShippingInventorySource ,
saveShippingRpaProfile ,
bulkBindShippingInventorySourceParsingProfile ,
} from '@/features/admin/api/admin.api' ;
import type { ShippingInventoryConfigurationTest , ShippingInventoryReadinessCheck } from '@/features/admin/api/admin.api' ;
import type { ShippingInventoryConfigurationTest , ShippingInventoryReadinessCheck , ShippingInventoryValidationBatch } from '@/features/admin/api/admin.api' ;
import { isConfigurationTestRunning , needsReadinessAction , readinessMarkerKind } from './shippingInventoryReadiness' ;
import { normaliseInventoryReportPath } from './shippingInventorySourceForm' ;
type TabKey = 'orderSchema' | 'profiles' | 'parsing' | 'inventoryFields' | 'templates' | 'sources' | 'rules' | 'snapshots' | 'exports' | 'mappings' ;
type Item = Record < string , any > ;
type Parameter = { name : string ; mode : 'single' | 'multi_text' | 'multi_select' ; values : string [ ] ; required : boolean ; select _all : boolean ; joiner ? : string } ;
type RuleCondition = { source _kind : 'order_field' | 'system_fact' ; order _field _id : string ; system _fact _key : string ; operator : string ; expected : string } ;
type RuleCondition = { source _kind : 'order_field' ; order _field _id : string ; operator : string ; expected : string } ;
type ParsingFieldMapping = { inventory _field : string ; source _header : string } ;
type ParsingMatchKey = { order _field _id : string ; inventory _field : string } ;
type TemplateMapping = { sheet : string ; row _mode : 'header' | 'line' ; start _row : number ; target _column : number ; source _kind : 'order_field' | 'inventory_field' | 'system_fact' | 'constant' ; source _key : string ; formatter : string } ;
@@ -464,7 +512,7 @@ const orderSchemaPublished = ref(false);
const saving = ref ( false ) ;
const confirmation = reactive ( {
visible : false ,
action : '' as 'delete' | 'retireRule' | 'retireTemplate' | 'retireParsing' | 'retireInventoryField' | 'activateSource' | 'deactivateSource' | 'replaceInventorySample' | '' ,
action : '' as 'delete' | 'retireRule' | 'retireTemplate' | 'retireParsing' | 'retireInventoryField' | 'deactivateSource' | 'replaceInventorySample' | '' ,
title : '' ,
message : '' ,
confirmText : '' ,
@@ -495,7 +543,6 @@ const configurationTest = ref<ShippingInventoryConfigurationTest | null>(null);
const configurationTestLoading = ref ( false ) ;
let configurationTestTimer : number | null = null ;
const routingFields = ref < Array < { field_id : string ; field_code : string ; display_name : string ; description ? : string ; scope : ' header ' | ' line ' } > > ( [ ] ) ;
const systemFacts = ref < string [ ] > ( [ ] ) ;
const templateSystemFacts = ref < string [ ] > ( [ ] ) ;
const templateSourceKinds = ref < Array < TemplateMapping [ ' source_kind ' ] > > ( [ ] ) ;
const templateRowModes = ref < Array < TemplateMapping [ ' row_mode ' ] > > ( [ ] ) ;
@@ -525,9 +572,13 @@ const profile = reactive({ profile_code: '', display_name: '', connector_type: '
const parsing = reactive ( { profile _code : '' , display _name : '' , file _format : 'xlsx' , sheet _name : '' , header _row _index : 1 , field _mappings : [ ] as ParsingFieldMapping [ ] , match _keys : [ ] as ParsingMatchKey [ ] } ) ;
const inventoryField = reactive < InventoryFieldForm > ( { display _name : '' , description : '' , value _type : 'text' , usage _type : 'general' , sort _order : 100 , status : 'active' } ) ;
const excelTemplate = reactive ( { template _code : '' , display _name : '' , filename _pattern : '{business_no}.xlsx' , mappings : [ ] as TemplateMapping [ ] , file : null as File | null } ) ;
const source = reactive ( { source _code : '' , display _name : '' , connector _type : 'dbs' , rpa _profile _id : 0 , parsing _profile _id : 0 , excel _template _id : 0 , warehouse _resolution _mode : 'fixed' , fixed _warehouse _id : '' , snapshot _ttl _seconds : 86400 , report _path _json : { program _group : '' , program _label : '' , report _group : 'Inventory ' , report _name : '' } , query _parameters _json : [ ] as Parameter [ ] , match _aliases _json : [ ] as string [ ] , enabled : false , activation : { ready : false , checks : [ ] as ShippingInventoryReadinessCheck [ ] , missing _requirements : [ ] as string [ ] } as SourceActivation } ) ;
const templateClone = reactive ( { visible : false , template _code : '' , display _name : '' , saving : false } ) ;
const bulkBinding = reactive ( { visible : false , sourceIds : [ ] as number [ ] , profileId : 0 , saving : false } ) ;
const batchValidation = reactive ( { visible : false , sourceIds : [ ] as number [ ] , query : '' , statusFilter : 'all' as 'all' | 'processing' | 'completed' | 'completed_empty' | 'failed' , saving : false , result : null as ShippingInventoryValidationBatch | null } ) ;
let batchValidationTimer : number | null = null ;
const source = reactive ( { source _code : '' , display _name : '' , connector _type : 'dbs' , rpa _profile _id : 0 , parsing _profile _id : 0 , excel _template _id : 0 , warehouse _resolution _mode : 'fixed' , fixed _warehouse _id : '' , snapshot _ttl _seconds : 86400 , report _path _json : { program _group : '' , program _label : '' , report _group : 'Inventory' , report _name : '' } , query _parameters _json : [ ] as Parameter [ ] , enabled : false , activation : { ready : false , checks : [ ] as ShippingInventoryReadinessCheck [ ] , missing _requirements : [ ] as string [ ] } as SourceActivation } ) ;
const sourceBaseline = ref ( '' ) ;
const rule = reactive ( { rule _code : '' , rule _name : '' , scope : 'line' , priority : 100 , conditions : [ { source _kind : 'order_field' , order _field _id : '' , system _fact _key : '' , operator : 'prefix' , expected : '' } ] as RuleCondition [ ] , source _codes : [ ] as string [ ] } ) ;
const rule = reactive ( { rule _code : '' , rule _name : '' , scope : 'line' , priority : 100 , conditions : [ { source _kind : 'order_field' , order _field _id : '' , operator : 'prefix' , expected : '' } ] as RuleCondition [ ] , source _codes : [ ] as string [ ] } ) ;
const mapping = reactive ( { inventory _source _id : 0 , freight _warehouse _id : '' , external _system _code : 'TOPGP' , external _organization _code : '' , external _site _code : '' , external _warehouse _code : '' , external _warehouse _name : '' , enabled : true } ) ;
const compatibleRoutingFields = computed ( ( ) => routingFields . value . filter ( ( item ) => item . scope === ( rule . scope === 'task' ? 'header' : 'line' ) ) ) ;
const activeInventoryFields = computed ( ( ) => inventoryFields . value . filter ( ( item ) => item . status === 'active' ) ) ;
@@ -544,11 +595,24 @@ const canAddParsingMatchKey = computed(() => Boolean(
) ) ;
const sourceDirty = computed ( ( ) => Boolean ( selectedId . value && sourceBaseline . value && sourceBaseline . value !== serialiseSourceInput ( ) ) ) ;
const readinessChecks = computed < ShippingInventoryReadinessCheck [ ] > ( ( ) => source . activation ? . checks || [ ] ) ;
const requiredReadinessChecks = computed ( ( ) => readinessChecks . value . filter ( ( item ) => item . blocking ) ) ;
const firstBlockingCheck = computed ( ( ) => requiredReadinessChecks . value . find ( ( item ) => item . status !== 'passed' ) ) ;
const optionalReadinessChecks = computed ( ( ) => readinessChecks . value . filter ( ( item ) => ! item . blocking ) ) ;
const readinessSummary = computed ( ( ) => {
const total = readinessChecks . value . length ;
const passed = readinessChecks . value . filter ( ( item ) => item . status === 'passed' ) . length ;
const required = requiredReadinessChecks . value ;
const total = required . length ;
const passed = required . filter ( ( item ) => item . status === 'passed' ) . length ;
return t ( 'admin.shippingInventory.readinessProgress' , { passed , total } ) ;
} ) ;
const readinessHeadline = computed ( ( ) => {
if ( source . enabled ) return t ( 'admin.shippingInventory.activationReady' ) ;
return source . activation ? . ready ? t ( 'admin.shippingInventory.activationCanEnable' ) : t ( 'admin.shippingInventory.activationDraft' ) ;
} ) ;
const readinessGuidance = computed ( ( ) => source . enabled
? t ( 'admin.shippingInventory.activationEnabledHint' )
: source . activation ? . ready
? t ( 'admin.shippingInventory.activationCanEnableHint' )
: t ( 'admin.shippingInventory.activationMissingHint' ) ) ;
const sampleReplacementNotice = computed ( ( ) => {
const difference = pendingSampleReplacement . value ? . difference || { } ;
const missing = Array . isArray ( difference . missing _mapped _headers ) ? difference . missing _mapped _headers : [ ] ;
@@ -687,6 +751,31 @@ const auditDetailEntries = computed(() => {
[ '库存源' , sourceName ( item . source _code ) ] , [ '货代仓库' , warehouseName ( item ) ] , [ '运行号' , item . rpa _run _no || t ( 'admin.shippingInventory.historyNotCaptured' ) ] , [ '状态' , auditStatus ( item . export _status || item . snapshot _status ) ] , [ '导出时间' , auditDate ( item . exported _at ) ] , [ '有效至' , auditDate ( item . expires _at ) ] , [ '库存行数' , item . line _count ? t ( 'admin.shippingInventory.lineCountValue' , { count : item . line _count } ) : t ( 'admin.shippingInventory.historyNotCaptured' ) ] , [ '结果说明' , item . error _message || auditResult ( item ) ] ,
] . map ( ( [ label , value ] ) => ( { label , value } ) ) ;
} ) ;
const filteredBatchValidationSources = computed ( ( ) => {
const query = batchValidation . query . trim ( ) . toLowerCase ( ) ;
return sources . value . filter ( ( item ) => ! item . enabled && item . parsing _profile _id && (
! query || [ item . display _name , item . source _code , connectionName ( item . source _code ) ] . some ( ( value ) => String ( value || '' ) . toLowerCase ( ) . includes ( query ) )
) ) ;
} ) ;
const allFilteredBatchValidationSourcesSelected = computed ( ( ) => filteredBatchValidationSources . value . length > 0 && filteredBatchValidationSources . value . every (
( item ) => batchValidation . sourceIds . includes ( Number ( item . id ) ) ,
) ) ;
const batchCompletedCount = computed ( ( ) => {
const result = batchValidation . result ;
return result ? result . success _count + result . empty _count + result . failed _count : 0 ;
} ) ;
const batchProcessingCount = computed ( ( ) => Math . max ( 0 , Number ( batchValidation . result ? . total _count || 0 ) - batchCompletedCount . value ) ) ;
const batchProgressPercent = computed ( ( ) => {
const total = Number ( batchValidation . result ? . total _count || 0 ) ;
return total ? Math . round ( batchCompletedCount . value / total * 100 ) : 0 ;
} ) ;
const filteredBatchValidationRuns = computed ( ( ) => {
const result = batchValidation . result ;
if ( ! result ) return [ ] ;
if ( batchValidation . statusFilter === 'all' ) return result . runs ;
if ( batchValidation . statusFilter === 'processing' ) return result . runs . filter ( ( run ) => [ 'awaiting_rpa' , 'processing' ] . includes ( run . status ) ) ;
return result . runs . filter ( ( run ) => run . status === batchValidation . statusFilter ) ;
} ) ;
/** 加载服务端配置与运行审计投影,页面不保留第二份真相。 */
async function load ( ) : Promise < void > {
@@ -700,12 +789,13 @@ async function load(): Promise<void> {
inventoryFields . value = inventoryFieldRows as Item [ ] ;
excelTemplates . value = templateRows as Item [ ] ;
temporaryInventorySessions . value = temporarySessions as Item [ ] ;
routingFields . value = fieldCatalog . order _fields ; systemFacts . value = fieldCatalog . system _facts ;
routingFields . value = fieldCatalog . order _fields ;
orderSchemaPublished . value = fieldCatalog . order _schema _published && configurationCatalog . order _schema _published ;
templateSystemFacts . value = configurationCatalog . template _system _facts ;
templateSourceKinds . value = configurationCatalog . template _source _kinds ;
templateRowModes . value = configurationCatalog . template _row _modes ;
templateFormatters . value = configurationCatalog . template _formatters ;
await restoreActiveBatchValidation ( ) ;
} catch ( cause ) {
showError ( cause , 'loadFailed' ) ;
}
@@ -737,10 +827,10 @@ function createNew(): void {
templateSheetColumns . value = { } ;
}
if ( activeTab . value === 'sources' ) {
Object . assign ( source , { source _code : '' , display _name : '' , connector _type : 'dbs' , rpa _profile _id : 0 , parsing _profile _id : 0 , excel _template _id : 0 , warehouse _resolution _mode : 'fixed' , fixed _warehouse _id : '' , snapshot _ttl _seconds : 86400 , report _path _json : { program _group : '' , program _label : '' , report _group : 'Inventory' , report _name : '' } , query _parameters _json : [ ] , match _aliases _json : [ ] , enabled : false , activation : { ready : false , checks : [ ] , missing _requirements : [ 'configuration_test' ] } } ) ;
Object . assign ( source , { source _code : '' , display _name : '' , connector _type : 'dbs' , rpa _profile _id : 0 , parsing _profile _id : 0 , excel _template _id : 0 , warehouse _resolution _mode : 'fixed' , fixed _warehouse _id : '' , snapshot _ttl _seconds : 86400 , report _path _json : { program _group : '' , program _label : '' , report _group : 'Inventory' , report _name : '' } , query _parameters _json : [ ] , enabled : false , activation : { ready : false , checks : [ ] , missing _requirements : [ 'configuration_test' ] } } ) ;
sourceBaseline . value = '' ;
}
if ( activeTab . value === 'rules' ) Object . assign ( rule , { rule _code : '' , rule _name : '' , scope : 'line' , priority : 100 , conditions : [ { source _kind : 'order_field' , order _field _id : '' , system _fact _key : '' , operator : 'prefix' , expected : '' } ] , source _codes : [ ] } ) ;
if ( activeTab . value === 'rules' ) Object . assign ( rule , { rule _code : '' , rule _name : '' , scope : 'line' , priority : 100 , conditions : [ { source _kind : 'order_field' , order _field _id : '' , operator : 'prefix' , expected : '' } ] , source _codes : [ ] } ) ;
if ( activeTab . value === 'mappings' ) Object . assign ( mapping , { inventory _source _id : 0 , freight _warehouse _id : '' , external _system _code : 'TOPGP' , external _organization _code : '' , external _site _code : '' , external _warehouse _code : '' , external _warehouse _name : '' , enabled : true } ) ;
drawerOpen . value = true ;
}
@@ -783,15 +873,17 @@ function selectItem(item: Item): void {
void loadTemplateLayout ( selectedId . value ) ;
}
if ( activeTab . value === 'sources' ) {
Object . assign ( source , { ... item , fixed _warehouse _id : item . fixed _warehouse _id || '' , report _path _json : { program _group : '' , program _label : '' , report _group : 'Inventory' , report _name : '' , ... ( item . report _path _json || { } ) } , query _parameters _json : ( item . query _parameters _json || [ ] ) . map ( ( parameter : Parameter ) => ( { ... parameter } ) ) , match _aliases _json : [ ... ( item . match _aliases _json || [ ] ) ] } ) ;
const reportPath = item . connector _type === 'dbs'
? { program _group : '' , program _label : '' , report _group : 'Inventory' , report _name : '' , ... ( item . report _path _json || { } ) }
: item . report _path _json ;
Object . assign ( source , { ... item , fixed _warehouse _id : item . fixed _warehouse _id || '' , report _path _json : normaliseInventoryReportPath ( item . connector _type , reportPath ) , query _parameters _json : ( item . query _parameters _json || [ ] ) . map ( ( parameter : Parameter ) => ( { ... parameter } ) ) } ) ;
sourceBaseline . value = serialiseSourceInput ( ) ;
void restoreConfigurationTest ( Number ( item . id ) ) ;
}
if ( activeTab . value === 'rules' ) Object . assign ( rule , {
rule _code : item . rule _code || '' , rule _name : item . rule _name || '' , scope : item . scope || 'line' , priority : item . priority || 0 ,
conditions : ( item . conditions ? . length ? item . conditions : [ { source _kind : 'order_field' , order _field _id : '' , operator : 'prefix' , expected _value _json : '' } ] ) . map ( ( condition : Record < string , unknown > ) => ( {
source _kind : String ( condition . source _kind || 'order_field' ) as 'order_field' | 'system_fact' ,
order _field _id : String ( condition . order _field _id || '' ) , system _fact _key : String ( condition . system _fact _key || '' ) , operator : String ( condition . operator || '' ) ,
source _kind : 'order_field' , order _field _id : String ( condition . order _field _id || '' ) , operator : String ( condition . operator || '' ) ,
expected : Array . isArray ( condition . expected _value _json ) ? condition . expected _value _json . join ( ', ' ) : String ( condition . expected _value _json || '' ) ,
} ) ) ,
source _codes : item . action _payload _json ? . source _codes || [ ] ,
@@ -800,6 +892,95 @@ function selectItem(item: Item): void {
drawerOpen . value = true ;
}
/** 打开批量绑定对话框;服务端将在提交前全量预检,禁止部分站点成功。 */
function openBulkParsingBinding ( ) : void {
bulkBinding . sourceIds = [ ] ;
bulkBinding . profileId = 0 ;
bulkBinding . visible = true ;
}
function closeBulkParsingBinding ( ) : void {
if ( ! bulkBinding . saving ) bulkBinding . visible = false ;
}
function openBatchValidation ( ) : void {
batchValidation . sourceIds = [ ] ;
batchValidation . query = '' ;
batchValidation . statusFilter = 'all' ;
if ( ! batchValidation . result || ! [ 'queued' , 'running' ] . includes ( batchValidation . result . status ) ) batchValidation . result = null ;
batchValidation . visible = true ;
if ( batchValidation . result && [ 'queued' , 'running' ] . includes ( batchValidation . result . status ) ) void pollBatchValidation ( ) ;
}
/** 搜索后的全选只作用于当前可见站点,避免误把不在筛选范围内的站点加入测试。 */
function toggleFilteredBatchValidationSources ( ) : void {
const ids = filteredBatchValidationSources . value . map ( ( item ) => Number ( item . id ) ) ;
if ( allFilteredBatchValidationSourcesSelected . value ) {
batchValidation . sourceIds = batchValidation . sourceIds . filter ( ( id ) => ! ids . includes ( id ) ) ;
return ;
}
batchValidation . sourceIds = [ ... new Set ( [ ... batchValidation . sourceIds , ... ids ] ) ] ;
}
function closeBatchValidation ( ) : void {
if ( batchValidationTimer !== null ) window . clearTimeout ( batchValidationTimer ) ;
batchValidationTimer = null ;
if ( ! batchValidation . saving ) batchValidation . visible = false ;
}
async function submitBatchValidation ( ) : Promise < void > {
batchValidation . saving = true ;
try {
batchValidation . result = await startShippingInventoryValidationBatch ( batchValidation . sourceIds ) ;
await pollBatchValidation ( ) ;
} catch ( cause ) { showError ( cause , 'configurationTestFailed' ) ; }
finally { batchValidation . saving = false ; }
}
async function pollBatchValidation ( ) : Promise < void > {
const result = batchValidation . result ;
if ( ! result ) return ;
try {
batchValidation . result = await getShippingInventoryValidationBatch ( result . id ) ;
if ( batchValidation . result . status === 'queued' || batchValidation . result . status === 'running' ) {
batchValidationTimer = window . setTimeout ( ( ) => { void pollBatchValidation ( ) ; } , 2000 ) ;
}
} catch ( cause ) { showError ( cause , 'configurationTestFailed' ) ; }
}
/** 页面刷新后从服务端恢复仍在运行的批量验证,并继续轮询真实状态。 */
async function restoreActiveBatchValidation ( ) : Promise < void > {
try {
const active = await getLatestActiveShippingInventoryValidationBatch ( ) ;
if ( ! active ) return ;
batchValidation . result = active ;
batchValidation . visible = true ;
await pollBatchValidation ( ) ;
} catch ( cause ) { showError ( cause , 'configurationTestFailed' ) ; }
}
async function retryBatchValidation ( ) : Promise < void > {
if ( ! batchValidation . result ) return ;
try {
batchValidation . result = await retryFailedShippingInventoryValidationBatch ( batchValidation . result . id ) ;
await pollBatchValidation ( ) ;
} catch ( cause ) { showError ( cause , 'configurationTestFailed' ) ; }
}
/** 原子绑定所选停用站点;任一站点不兼容时由服务端整体拒绝。 */
async function submitBulkParsingBinding ( ) : Promise < void > {
bulkBinding . saving = true ;
try {
await bulkBindShippingInventorySourceParsingProfile ( {
source _ids : bulkBinding . sourceIds , parsing _profile _id : bulkBinding . profileId ,
} ) ;
bulkBinding . visible = false ;
await load ( ) ;
message . success ( t ( 'admin.shippingInventory.bulkParsingProfileBound' ) ) ;
} catch ( cause ) { showError ( cause , 'saveFailed' ) ; }
finally { bulkBinding . saving = false ; }
}
/** 从对象存储读取已保存模板的工作表与栏位,避免编辑旧模板时要求重新上传。 */
async function loadTemplateLayout ( templateId : number | null ) : Promise < void > {
if ( ! templateId || activeTab . value !== 'templates' ) return ;
@@ -870,8 +1051,8 @@ async function saveCurrent(): Promise<void> {
await createShippingExcelTemplate ( form ) ;
}
}
if ( activeTab . value === 'sources' ) await saveShippingInventorySource ( { ... source , enabled : false , fixed _warehouse _id : source . warehouse _resolution _mode === 'fixed' ? source . fixed _warehouse _id : null } , selectedId . value || undefined ) ;
if ( activeTab . value === 'rules' ) await saveShippingInventoryRule ( { rule _code : rule . rule _code , rule _name : rule . rule _name || rule . rule _code , scope : rule . scope , priority : rule . priority , match _mode : 'all' , action _type : 'add_source_candidates' , action _payload _json : { source _codes : splitValues ( rule . source _codes ) } , conditions : rule . conditions . map ( ( condition ) => ( { source _kind : condition . source _kind , order _field _id : condition . source _kind === 'order_field' ? condition . order _field _id : null , system _fact _key : condition . source _kind === 'system_fact' ? condition . system _fact _key : null , operator : condition . operator , expected _value _json : normalizeExpectedValue ( condition ) } ) ) } , selectedId . value || undefined ) ;
if ( activeTab . value === 'sources' ) await saveShippingInventorySource ( { ... source , enabled : false , fixed _warehouse _id : source . warehouse _resolution _mode === 'fixed' ? source . fixed _warehouse _id : null , report _path _json : normaliseInventoryReportPath ( source . connector _type , source . report _path _json ) } , selectedId . value || undefined ) ;
if ( activeTab . value === 'rules' ) await saveShippingInventoryRule ( { rule _code : rule . rule _code , rule _name : rule . rule _name || rule . rule _code , scope : rule . scope , priority : rule . priority , match _mode : 'all' , action _type : 'add_source_candidates' , action _payload _json : { source _codes : splitValues ( rule . source _codes ) } , conditions : rule . conditions . map ( ( condition ) => ( { source _kind : 'order_field' , order _field _id : condition . order _field _id , operator : condition . operator , expected _value _json : normalizeExpectedValue ( condition ) } ) ) } , selectedId . value || undefined ) ;
if ( activeTab . value === 'mappings' ) await saveShippingInventoryExternalMapping ( { ... mapping , freight _warehouse _id : mapping . freight _warehouse _id || null , external _organization _code : mapping . external _organization _code || null , external _site _code : mapping . external _site _code || null } , selectedId . value || undefined ) ;
await load ( ) ;
closeDrawer ( ) ;
@@ -907,6 +1088,29 @@ async function createTemplateVersion(): Promise<void> {
selectItem ( created ) ;
} catch ( cause ) { showError ( cause , 'saveFailed' ) ; }
}
/** 从当前模板版本复制受管文件和配置,作为新编码下独立的 v1 草稿。 */
function openTemplateCloneDialog ( ) : void {
templateClone . template _code = '' ;
templateClone . display _name = ` ${ excelTemplate . display _name || excelTemplate . template _code } ${ t ( 'admin.shippingInventory.copySuffix' ) } ` ;
templateClone . visible = true ;
}
function closeTemplateCloneDialog ( ) : void {
if ( ! templateClone . saving ) templateClone . visible = false ;
}
async function cloneCurrentTemplate ( ) : Promise < void > {
if ( ! selectedId . value ) return ;
templateClone . saving = true ;
try {
const created = await cloneShippingExcelTemplate ( selectedId . value , {
template _code : templateClone . template _code ,
display _name : templateClone . display _name ,
} ) as Item ;
templateClone . visible = false ;
await load ( ) ;
selectItem ( created ) ;
} catch ( cause ) { showError ( cause , 'saveFailed' ) ; }
finally { templateClone . saving = false ; }
}
/** 退役模板前由后端确认没有启用库存源仍在引用。 */
async function retireCurrentTemplate ( ) : Promise < void > { openConfirmation ( 'retireTemplate' , t ( 'admin.shippingInventory.confirmRetireTemplate' ) ) ; }
/** 解析 Profile 仅在没有库存源引用时允许退役。 */
@@ -940,7 +1144,6 @@ async function confirmPendingAction(): Promise<void> {
if ( action === 'retireTemplate' ) await retireShippingExcelTemplate ( selectedId . value ) ;
if ( action === 'retireParsing' ) await retireShippingInventoryParsingProfile ( selectedId . value ) ;
if ( action === 'retireInventoryField' ) await retireShippingInventoryField ( selectedId . value ) ;
if ( action === 'activateSource' ) await activateShippingInventorySource ( selectedId . value ) ;
if ( action === 'deactivateSource' ) await deactivateShippingInventorySource ( selectedId . value ) ;
if ( action === 'replaceInventorySample' ) { sampleReplacementConfirmed . value = true ; await saveCurrent ( ) ; return ; }
if ( action === 'delete' && activeTab . value === 'profiles' ) await deleteShippingRpaProfile ( selectedId . value ) ;
@@ -957,16 +1160,6 @@ async function confirmPendingAction(): Promise<void> {
function clearConfirmation ( ) : void { confirmation . visible = false ; confirmation . action = '' ; }
/** 展示启用前置条件,避免管理员在普通保存时误以为站点已经进入正式运行。 */
function requestSourceActivation ( ) : void {
confirmation . visible = true ;
confirmation . action = 'activateSource' ;
confirmation . title = t ( 'admin.shippingInventory.activateSource' ) ;
confirmation . message = t ( 'admin.shippingInventory.activateSourceConfirm' ) ;
confirmation . confirmText = t ( 'admin.shippingInventory.activateSource' ) ;
confirmation . tone = 'primary' ;
}
/** 停用动作使用平台确认弹窗,防止误将正在运行的库存站点下线。 */
function requestSourceDeactivation ( ) : void {
confirmation . visible = true ;
@@ -1008,20 +1201,19 @@ async function pollConfigurationTest(): Promise<void> {
configurationTest . value = updated ;
if ( isConfigurationTestRunning ( updated ) ) {
configurationTestTimer = window . setTimeout ( ( ) => { void pollConfigurationTest ( ) ; } , 2000 ) ;
} else {
await refreshSelectedSource ( ) ;
}
} catch ( cause ) { showError ( cause , 'configurationTestFailed' ) ; }
}
/** 仅在测试完成后确认候选方案,成功后刷新库存站点以显示新的解析方案绑定 。 */
async function confirmTestProfile ( profileId : number ) : Promise < void > {
if ( ! selectedId . value || ! configurationTest . value ? . run _no ) return ;
try {
await confirmShippingInventoryConfigurationTestProfile ( selectedId . value , String ( configurationTest . value . run _no ) , profileId ) ;
message . success ( t ( 'admin.shippingInventory.configurationTestProfileConfirmed' ) ) ;
await load ( ) ;
const item = sources . value . find ( ( row ) => Number ( row . id ) === selectedId . value ) ;
if ( item ) selectItem ( item ) ;
} catch ( cause ) { showError ( cause , 'configurationTestFailed' ) ; }
/** 测试结束后回读服务端的启用投影,避免抽屉继续展示测试前的过期门禁 。 */
async function refreshSelectedSource ( ) : Promise < void > {
const sourceId = selectedId . value ;
if ( ! sourceId ) return ;
await load ( ) ;
const refreshed = sources . value . find ( ( item ) => Number ( item . id ) === sourceId ) ;
if ( refreshed ) selectItem ( refreshed ) ;
}
/** 新增一行结构化 DBS 查询参数,避免要求管理员编辑 JSON。 */
@@ -1097,7 +1289,7 @@ function applyAnalysisCandidate(): void {
parsing . field _mappings = parsing . field _mappings . filter ( ( item ) => headers . has ( item . source _header ) ) ;
}
function candidateKey ( candidate : Item ) : string { return ` ${ candidate . sheet _name || 'csv' } - ${ candidate . header _row _index } ` ; }
function addRuleCondition ( ) : void { rule . conditions . push ( { source _kind : 'order_field' , order _field _id : '' , system _fact _key : '' , operator : 'prefix' , expected : '' } ) ; }
function addRuleCondition ( ) : void { rule . conditions . push ( { source _kind : 'order_field' , order _field _id : '' , operator : 'prefix' , expected : '' } ) ; }
function removeRuleCondition ( index : number ) : void { if ( rule . conditions . length > 1 ) rule . conditions . splice ( index , 1 ) ; }
function splitValues ( value : string | string [ ] ) : string [ ] { return ( Array . isArray ( value ) ? value : value . split ( ',' ) ) . map ( ( item ) => item . trim ( ) ) . filter ( Boolean ) ; }
function conditionNeedsExpected ( condition : RuleCondition ) : boolean { return ! [ 'is_empty' , 'is_not_empty' ] . includes ( condition . operator ) ; }
@@ -1204,7 +1396,10 @@ function inventoryFieldOptionLabel(field: Item): string {
function formatDate ( value : unknown ) : string { return value ? new Date ( String ( value ) ) . toLocaleString ( ) : '-' ; }
function auditDate ( value : unknown ) : string { return value ? formatDate ( value ) : t ( 'admin.shippingInventory.historyNotCaptured' ) ; }
function sourceName ( sourceCode : unknown ) : string { return String ( sourceCode || t ( 'admin.shippingInventory.historyNotCaptured' ) ) ; }
function parsingProfileName ( profileId : unknown ) : string { const item = parsingProfiles . value . find ( ( row ) => Number ( row . id ) === Number ( profileId ) ) ; return String ( item ? . display _name || item ? . profile _code || t ( 'admin.shippingInventory.notGenerated' ) ) ; }
function sourceTitleById ( sourceId : number ) : string {
const item = sources . value . find ( ( source ) => Number ( source . id ) === Number ( sourceId ) ) ;
return String ( item ? . display _name || item ? . source _code || sourceId ) ;
}
/** 将会影响测试输入的站点字段稳定序列化,用于阻止管理员针对未保存配置运行测试或启用。 */
function serialiseSourceInput ( ) : string {
return JSON . stringify ( {
@@ -1212,8 +1407,7 @@ function serialiseSourceInput(): string {
rpa _profile _id : source . rpa _profile _id , parsing _profile _id : source . parsing _profile _id ,
excel _template _id : source . excel _template _id , warehouse _resolution _mode : source . warehouse _resolution _mode ,
fixed _warehouse _id : source . fixed _warehouse _id , snapshot _ttl _seconds : source . snapshot _ttl _seconds ,
report _path _json : source . report _path _json , query _parameters _json : source . query _parameters _json ,
match _aliases _json : source . match _aliases _json ,
report _path _json : normaliseInventoryReportPath ( source . connector _type , source . report _path _json ) , query _parameters _json : source . query _parameters _json ,
} ) ;
}
@@ -1230,11 +1424,13 @@ function readinessDetail(check: ShippingInventoryReadinessCheck): string {
if ( check . status === 'passed' ) return t ( 'admin.shippingInventory.readinessState.passed' ) ;
if ( check . status === 'stale' ) return t ( 'admin.shippingInventory.readinessState.stale' ) ;
if ( check . status === 'failed' ) return t ( 'admin.shippingInventory.readinessState.failed' ) ;
return check . blocking ? t ( 'admin.shippingInventory.readinessState.required ') : t ( 'admin.shippingInventory.readinessState.waiting ' ) ;
if ( check . status === 'empty ') return t ( 'admin.shippingInventory.readinessState.empty ' ) ;
return check . blocking ? t ( 'admin.shippingInventory.readinessState.required' ) : t ( 'admin.shippingInventory.readinessState.optional' ) ;
}
/** 每项门禁只映射一个推荐动作;已经通过和依赖测试的辅助检查不额外制造操作入口。 */
function readinessActionLabel ( check : ShippingInventoryReadinessCheck ) : string {
if ( ! check . blocking ) return '' ;
if ( ! needsReadinessAction ( check ) ) return '' ;
if ( check . action === 'run_configuration_test' ) return configurationTestLoading . value
? t ( 'admin.shippingInventory.configurationTestRunning' )
@@ -1328,9 +1524,15 @@ onMounted(load);
. status - dot . on { background : # 22 c55e ; }
. status - dot . off { background : # b2bdc9 ; }
. drawer - mask { position : fixed ; z - index : 40 ; inset : 0 ; display : flex ; justify - content : flex - end ; background : rgb ( 15 23 42 / 28 % ) ; }
. workbench - actions { display : flex ; flex - wrap : wrap ; gap : 10 px ; }
. clone - template - mask { z - index : 80 ; align - items : center ; justify - content : center ; padding : 20 px ; }
. clone - template - dialog { width : min ( 480 px , 100 % ) ; border - radius : 10 px ; background : # fff ; box - shadow : 0 18 px 48 px rgb ( 15 23 42 / 25 % ) ; }
. clone - template - header { display : flex ; justify - content : space - between ; gap : 16 px ; border - bottom : 1 px solid # e2e8f0 ; padding : 18 px 20 px ; } . clone - template - header h3 { margin : 0 ; color : # 1 e293b ; font - size : 16 px ; font - weight : 600 ; } . clone - template - header p { margin : 5 px 0 0 ; color : # 64748 b ; font - size : 12 px ; line - height : 1.5 ; }
. clone - template - form { display : grid ; gap : 14 px ; padding : 20 px ; } . clone - template - form label { display : grid ; gap : 6 px ; color : # 64748 b ; font - size : 12 px ; font - weight : 500 ; } . clone - template - form input { min - width : 0 ; border : 1 px solid # d9e2ec ; border - radius : 6 px ; padding : 8 px 9 px ; color : # 334155 ; font : inherit ; font - size : 13 px ; } . clone - template - form small { color : # 94 a3b8 ; font - size : 11 px ; line - height : 1.45 ; } . clone - template - actions { display : flex ; justify - content : flex - end ; gap : 10 px ; border - top : 1 px solid # edf2f7 ; padding - top : 14 px ; }
. batch - validation - dialog { display : grid ; width : min ( 780 px , 100 % ) ; max - height : min ( 720 px , calc ( 100 vh - 40 px ) ) ; grid - template - rows : auto minmax ( 0 , 1 fr ) ; overflow : hidden ; border - radius : 12 px ; background : # fff ; box - shadow : 0 20 px 56 px rgb ( 15 23 42 / 28 % ) ; } . batch - selection , . batch - progress { display : grid ; min - height : 0 ; gap : 14 px ; padding : 18 px 20 px ; } . batch - selection { grid - template - rows : auto minmax ( 0 , 1 fr ) auto ; } . batch - selection - toolbar { display : flex ; align - items : end ; justify - content : space - between ; gap : 14 px ; } . batch - selection - toolbar label { display : grid ; flex : 1 ; gap : 5 px ; color : # 62788 a ; font - size : 11 px ; font - weight : 700 ; } . batch - selection - toolbar input { min - width : 0 ; border : 1 px solid # d8e5ed ; border - radius : 6 px ; padding : 8 px 9 px ; color : # 334155 ; font : inherit ; font - size : 13 px ; } . batch - selection - actions { display : flex ; align - items : center ; gap : 8 px ; } . batch - selection - actions > b { flex : 0 0 auto ; border - radius : 999 px ; background : # e9f7fd ; padding : 6 px 9 px ; color : # 13759 d ; font - size : 11 px ; white - space : nowrap ; } . batch - selection - actions . text - action { padding : 6 px 8 px ; background : # f1f7fa ; color : # 17769 d ; white - space : nowrap ; } . batch - source - list , . batch - run - list { min - height : 0 ; overflow - y : auto ; border : 1 px solid # dce8ef ; border - radius : 8 px ; background : # fbfdfe ; } . batch - source - list { display : grid ; grid - template - columns : repeat ( 2 , minmax ( 0 , 1 fr ) ) ; align - content : start ; gap : 1 px ; background : # e3edf3 ; } . batch - source - option { display : flex ; min - width : 0 ; align - items : flex - start ; gap : 9 px ; background : # fff ; padding : 10 px 11 px ; cursor : pointer ; } . batch - source - option : hover { background : # f4fbfe ; } . batch - source - option input { margin : 3 px 0 0 ; accent - color : # 168 ebc ; } . batch - source - option span { display : grid ; min - width : 0 ; gap : 3 px ; } . batch - source - option b { overflow : hidden ; color : # 344 b60 ; font - size : 12 px ; text - overflow : ellipsis ; white - space : nowrap ; } . batch - source - option small { overflow : hidden ; color : # 8 a9aab ; font - size : 10 px ; text - overflow : ellipsis ; white - space : nowrap ; } . batch - empty { grid - column : 1 / - 1 ; margin : 0 ; padding : 28 px 12 px ; color : # 8797 a7 ; font - size : 12 px ; text - align : center ; } . batch - progress { grid - template - rows : auto auto auto minmax ( 0 , 1 fr ) auto ; } . batch - progress - heading { display : flex ; align - items : end ; justify - content : space - between ; gap : 16 px ; } . batch - progress - heading > div { display : grid ; gap : 3 px ; } . batch - progress - heading span { color : # 16759 f ; font - size : 11 px ; font - weight : 800 ; } . batch - progress - heading strong { color : # 334 c60 ; font - size : 13 px ; } . batch - progress - heading > b { color : # 1 c6f96 ; font - size : 18 px ; font - variant - numeric : tabular - nums ; } . batch - progress - bar { height : 7 px ; overflow : hidden ; border - radius : 999 px ; background : # e8f0f5 ; } . batch - progress - bar i { display : block ; height : 100 % ; border - radius : inherit ; background : linear - gradient ( 90 deg , # 22 a1c7 , # 4 bb8d7 ) ; transition : width .25 s ease ; } . batch - stat - grid { display : grid ; grid - template - columns : repeat ( 5 , minmax ( 0 , 1 fr ) ) ; gap : 6 px ; } . batch - stat - grid button { display : grid ; gap : 2 px ; border : 1 px solid # e0eaf0 ; border - radius : 7 px ; background : # fff ; padding : 8 px ; color : # 708393 ; font : inherit ; text - align : left ; cursor : pointer ; } . batch - stat - grid button : hover , . batch - stat - grid button . active { border - color : # 8 fd0e7 ; background : # eef9fd ; } . batch - stat - grid b { color : # 314 b60 ; font - size : 16 px ; font - variant - numeric : tabular - nums ; } . batch - stat - grid span { overflow : hidden ; font - size : 10 px ; text - overflow : ellipsis ; white - space : nowrap ; } . batch - run - list { display : grid ; align - content : start ; } . batch - run { display : grid ; grid - template - columns : 9 px minmax ( 0 , 1 fr ) minmax ( 0 , .9 fr ) ; align - items : center ; gap : 9 px ; border - bottom : 1 px solid # e8eff3 ; padding : 9 px 11 px ; } . batch - run : last - child { border - bottom : 0 ; } . batch - run - marker { width : 7 px ; height : 7 px ; border - radius : 50 % ; background : # a9b8c5 ; } . batch - run > div { display : grid ; min - width : 0 ; gap : 2 px ; } . batch - run b , . batch - run small { overflow : hidden ; text - overflow : ellipsis ; white - space : nowrap ; } . batch - run b { color : # 385166 ; font - size : 12 px ; } . batch - run > div small { color : # 8 a9baa ; font - size : 10 px ; } . batch - run - error { color : # ae493b ; font - size : 10 px ; } . batch - run . is - completed . batch - run - marker { background : # 32 a665 ; } . batch - run . is - completed _empty . batch - run - marker { background : # e7a628 ; } . batch - run . is - failed . batch - run - marker { background : # db6552 ; }
. editor - drawer { width : min ( 760 px , 100 vw ) ; height : 100 % ; overflow - y : auto ; border - left : 1 px solid # dbe5ed ; background : # fff ; box - shadow : - 12 px 0 32 px rgb ( 15 23 42 / 18 % ) ; }
. drawer - header { position : sticky ; z - index : 1 ; top : 0 ; display : flex ; justify - content : space - between ; gap : 16 px ; border - bottom : 1 px solid # e2e8f0 ; background : # fff ; padding : 18 px 20 px ; }
. drawer - header h3 { margin : 0 ; color : # 1 e293b ; font - size : 16 px ; font - weight : 600 ; }
. drawer - title - row { display : flex ; align - items : center ; gap : 9 px ; } . drawer - header h3 { margin : 0 ; color : # 1 e293b ; font - size : 16 px ; font - weight : 600 ; } . source - run - status { flex : 0 0 auto ; border : 1 px solid # f2d3cd ; border - radius : 999 px ; background : # fff4f1 ; padding : 3 px 7 px ; color : # a53f30 ; font - size : 11 px ; font - weight : 700 ; } . source - run - status . enabled { border - color : # c7e7d0 ; background : # eefaf1 ; color : # 247442 ; }
. drawer - header p { margin : 5 px 0 0 ; color : # 64748 b ; font - size : 12 px ; line - height : 1.5 ; }
. drawer - close { width : 30 px ; height : 30 px ; border : 0 ; border - radius : 6 px ; background : transparent ; color : # 64748 b ; font - size : 24 px ; line - height : 1 ; cursor : pointer ; }
. drawer - close : hover { background : # f1f5f9 ; color : # 334155 ; }
@@ -1349,11 +1551,13 @@ onMounted(load);
. filename - variable - menu { position : absolute ; z - index : 3 ; top : calc ( 100 % + 5 px ) ; left : 0 ; width : min ( 440 px , 100 % ) ; overflow : hidden ; border : 1 px solid # cfdde7 ; border - radius : 7 px ; background : # fff ; box - shadow : 0 10 px 24 px rgb ( 15 23 42 / 14 % ) ; padding : 4 px ; }
. filename - variable - menu button { display : grid ; width : 100 % ; grid - template - columns : 154 px minmax ( 0 , 1 fr ) ; gap : 8 px ; border : 0 ; border - radius : 4 px ; background : transparent ; padding : 7 px 8 px ; color : # 64748 b ; font : inherit ; font - size : 12 px ; text - align : left ; cursor : pointer ; }
. filename - variable - menu button : hover , . filename - variable - menu button . active { background : # eef8f7 ; color : # 145 f5a ; } . filename - variable - menu code { color : # 047 f76 ; font - size : 12 px ; } . filename - variable - menu p { margin : 0 ; padding : 8 px ; color : # 94 a3b8 ; font - size : 12 px ; }
. readiness - card { display : grid ; gap : 13 px ; border : 1 px solid # d9e6ef ; border - radius : 10 px ; background : linear - gradient ( 135 deg , # fbfdff , # f4f9fc ) ; padding : 15 px ; } . readiness - card . ready { border - color : # b7e4c7 ; background : linear - gradient ( 135 deg , # fbfffc , # f2fbf5 ) ; }
. readiness - heading { display : flex ; align - items : flex - start ; justify - content : space - between ; gap : 12 px ; } . readiness - heading > div { display : grid ; gap : 4 px ; } . readiness - kicker { color : # 64748 b ; font - size : 11 px ; font - weight : 700 ; letter - spacing : .05 em ; text - transform : uppercase ; } . readiness - heading strong { color : # 263 b4e ; font - size : 13 px ; line - height : 1.45 ; } . readiness - count { flex : 0 0 auto ; border - radius : 999 px ; background : # eaf4fa ; padding : 4 px 8 px ; color : # 176 f9f ; font - size : 11 px ; font - weight : 700 ; } . readiness - card . ready . readiness - count { background : # e8f7ed ; color : # 19703 a ; }
. readiness - steps { display : grid ; gap : 0 ; margin : 0 ; padding : 0 ; list - style : none ; } . readiness - steps li { display : grid ; grid - template - columns : 24 px minmax ( 0 , 1 fr ) auto ; align - items : center ; gap : 9 px ; min - height : 48 px ; border - top : 1 px solid # e6eef4 ; padding : 8 px 0 ; } . readiness - marker { display : inline - grid ; width : 20 px ; height : 20 px ; place - items : center ; border - radius : 50 % ; background : # e9eef3 ; color : # 6 c7d8d ; font - size : 12 px ; font - weight : 800 ; } . readiness - copy { display : grid ; min - width : 0 ; gap : 2 px ; } . readiness - copy b { overflow : hidden ; color : # 425466 ; font - size : 12 px ; text - overflow : ellipsis ; white - space : nowrap ; } . readiness - copy small { color : # 8190 a0 ; font - size : 11 px ; line - height : 1.35 ; } . readiness - steps . is - passed . readiness - marker { background : # dff6e6 ; color : # 16803 a ; } . readiness - steps . is - passed . readiness - copy b { color : # 2 d6b40 ; } . readiness - steps . is - failed . readiness - marker , . readiness - steps . is - stale . readiness - marker { background : # fff0ed ; color : # bf4a38 ; } . readiness - steps . is - failed . readiness - copy b , . readiness - steps . is - stale . readiness - copy b { color : # 9 d382b ; }
. readiness - action { border : 0 ; border - radius : 5 px ; background : # e8f3f9 ; padding : 6 px 8 px ; color : # 16759 f ; font : inherit ; font - size : 11 px ; font - weight : 700 ; cursor : pointer ; } . readiness - action : hover { background : # d8edf7 ; } . readiness - note , . readiness - run { margin : 0 ; border - left : 3 px solid # 74 b8d8 ; background : # f0f8fc ; padding : 8 px 10 px ; color : # 547185 ; font - size : 11 px ; line - height : 1.5 ; } . readiness - run . failed { border - left - color : # e06a58 ; background : # fff5f3 ; color : # 9 d382b ; } . readiness - audit { display : grid ; grid - template - columns : repeat ( 4 , minmax ( 0 , 1 fr ) ) ; gap : 1 px ; margin : 0 ; overflow : hidden ; border : 1 px solid # dce8ef ; border - radius : 7 px ; background : # dce8ef ; } . readiness - audit > div { min - width : 0 ; background : # fff ; padding : 8 px 9 px ; } . readiness - audit dt { color : # 7 b8998 ; font - size : 10 px ; font - weight : 700 ; letter - spacing : .03 em ; } . readiness - audit dd { overflow : hidden ; margin : 4 px 0 0 ; color : # 3 d5366 ; font - family : ui - monospace , SFMono - Regular , Menlo , monospace ; font - size : 11 px ; font - variant - numeric : tabular - nums ; text - overflow : ellipsis ; white - space : nowrap ; } . readiness - footer { display : flex ; justify - content : flex - end ; border - top : 1 px solid # e6eef4 ; padding - top : 11 px ; }
. readiness - card { display : grid ; gap : 12 px ; border : 1 px solid # cfe2ea ; border - radius : 12 px ; background : # fbfdfe ; padding : 16 px ; } . readiness - card . ready { border - color : # b9dfc4 ; background : # fcfffd ; }
. readiness - heading { display : flex ; align - items : flex - start ; justify - content : space - between ; gap : 16 px ; } . readiness - heading > div { display : grid ; gap : 5 px ; } . readiness - kicker { color : # 5 f798c ; font - size : 11 px ; font - weight : 700 ; letter - spacing : .04 em ; } . readiness - heading strong { color : # 263 b4e ; font - size : 14 px ; line - height : 1.4 ; } . readiness - heading p { margin : 0 ; color : # 6 d8292 ; font - size : 12 px ; line - height : 1.45 ; } . readiness - count { flex : 0 0 auto ; border : 1 px solid # cce7f1 ; border - radius : 999 px ; background : # edf8fc ; padding : 5 px 9 px ; color : # 176 f9f ; font - size : 12 px ; font - weight : 700 ; white - space : nowrap ; } . readiness - card . ready . readiness - count { border - color : # cce8d4 ; background : # eef9f1 ; color : # 19703 a ; }
. readiness - section { border : 1 px solid # e1edf2 ; border - radius : 9 px ; background : # fff ; padding : 0 12 px ; } . readiness - section - heading { display : grid ; gap : 2 px ; padding : 11 px 0 8 px ; } . readiness - section - heading b { color : # 385166 ; font - size : 12 px ; } . readiness - section - heading small { color : # 8192 a0 ; font - size : 11 px ; } . readiness - steps { display : grid ; gap : 0 ; margin : 0 ; padding : 0 ; list - style : none ; } . readiness - steps li { display : grid ; grid - template - columns : 24 px minmax ( 0 , 1 fr ) auto ; align - items : center ; gap : 9 px ; min - height : 46 px ; border - top : 1 px solid # edf2f5 ; padding : 7 px 0 ; } . readiness - marker { display : inline - grid ; width : 20 px ; height : 20 px ; place - items : center ; border - radius : 50 % ; background : # e9eef3 ; color : # 6 c7d8d ; font - size : 12 px ; font - weight : 800 ; } . readiness - copy { display : grid ; min - width : 0 ; gap : 2 px ; } . readiness - copy b { overflow : hidden ; color : # 425466 ; font - size : 12 px ; text - overflow : ellipsis ; white - space : nowrap ; } . readiness - copy small { color : # 8190 a0 ; font - size : 11 px ; line - height : 1.35 ; } . readiness - steps . is - passed . readiness - marker { background : # dff6e6 ; color : # 16803 a ; } . readiness - steps . is - passed . readiness - copy b { color : # 2 d6b40 ; } . readiness - steps . is - failed . readiness - marker , . readiness - steps . is - stale . readiness - marker { background : # fff0ed ; color : # bf4a38 ; } . readiness - steps . is - failed . readiness - copy b , . readiness - steps . is - stale . readiness - copy b { color : # 9 d382b ; }
. readiness - optional { border - top : 1 px solid # e4edf2 ; padding - top : 10 px ; } . readiness - optional summary , . readiness - audit summary { display : flex ; align - items : baseline ; gap : 8 px ; color : # 61798 a ; cursor : pointer ; list - style : none ; } . readiness - optional summary : : - webkit - details - marker , . readiness - audit summary : : - webkit - details - marker { display : none ; } . readiness - optional summary : : before , . readiness - audit summary : : before { color : # 4 d849f ; content : '› ' ; font - size : 16 px ; line - height : .8 ; transition : transform .15 s ; } . readiness - optional [ open ] summary : : before , . readiness - audit [ open ] summary : : before { transform : rotate ( 90 deg ) ; } . readiness - optional summary span { color : # 516 b7d ; font - size : 12 px ; font - weight : 700 ; } . readiness - optional summary small { color : # 8797 a5 ; font - size : 11 px ; } . readiness - optional . readiness - steps { margin - top : 8 px ; }
. readiness - action { border : 0 ; border - radius : 5 px ; background : # e8f3f9 ; padding : 6 px 8 px ; color : # 16759 f ; font : inherit ; font - size : 11 px ; font - weight : 700 ; cursor : pointer ; } . readiness - action : hover { background : # d8edf7 ; } . readiness - run { margin : 0 ; border - left : 3 px solid # 74 b8d8 ; background : # f0f8fc ; padding : 8 px 10 px ; color : # 547185 ; font - size : 11 px ; line - height : 1.5 ; } . readiness - run . failed { border - left - color : # e06a58 ; background : # fff5f3 ; color : # 9 d382b ; } . readiness - audit { margin : 0 ; border - top : 1 px solid # e4edf2 ; padding - top : 10 px ; } . readiness - audit summary { color : # 61798 a ; font - size : 11 px ; font - weight : 700 ; } . readiness - audit dl { display : grid ; grid - template - columns : repeat ( 3 , minmax ( 0 , 1 fr ) ) ; gap : 1 px ; margin : 9 px 0 0 ; overflow : hidden ; border : 1 px solid # dce8ef ; border - radius : 7 px ; background : # dce8ef ; } . readiness - audit dl > div { min - width : 0 ; background : # fff ; padding : 8 px 9 px ; } . readiness - audit dt { color : # 7 b8998 ; font - size : 11 px ; font - weight : 700 ; } . readiness - audit dd { overflow : hidden ; margin : 4 px 0 0 ; color : # 3 d5366 ; font - family : ui - monospace , SFMono - Regular , Menlo , monospace ; font - size : 11 px ; font - variant - numeric : tabular - nums ; text - overflow : ellipsis ; white - space : nowrap ; } . readiness - footer { display : flex ; justify - content : flex - end ; border - top : 1 px solid # e6eef4 ; padding - top : 11 px ; }
. form - tip { border - radius : 8 px ; background : # f1f6fa ; padding : 11 px ; color : # 5 d7084 ; font - size : 12 px ; line - height : 1.55 ; }
. configuration - test - verified { margin : 0 ; border - left : 3 px solid # 34 a56b ; background : # effaf3 ; padding : 9 px 10 px ; color : # 256 b43 ; font - size : 12 px ; font - weight : 600 ; line - height : 1.45 ; }
. sample - evidence - card { display : grid ; gap : 12 px ; border : 1 px solid # d7e3ed ; border - radius : 8 px ; background : # f8fbfd ; padding : 14 px ; }
. sample - evidence - card > div { display : grid ; gap : 3 px ; } . sample - evidence - card strong { color : # 334155 ; font - size : 13 px ; } . sample - evidence - card p , . sample - evidence - card > small { margin : 0 ; color : # 6 b7f91 ; font - size : 12 px ; line - height : 1.55 ; }
. sample - evidence - card dl { display : grid ; grid - template - columns : repeat ( 3 , minmax ( 0 , 1 fr ) ) ; gap : 8 px 16 px ; margin : 0 ; } . sample - evidence - card dl div { min - width : 0 ; } . sample - evidence - card dt { color : # 8190 a0 ; font - size : 11 px ; } . sample - evidence - card dd { margin : 3 px 0 0 ; overflow - wrap : anywhere ; color : # 475569 ; font - size : 12 px ; font - weight : 600 ; }
@@ -1385,7 +1589,7 @@ onMounted(load);
. condition - empty { color : # 8190 a0 ; font - size : 12 px ; }
. inline - check { flex - direction : row ! important ; align - items : center ; gap : 4 px ! important ; white - space : nowrap ; font - size : 11 px ! important ; }
. switch - field { display : flex ; flex - direction : column ; gap : 6 px ; color : # 64748 b ; font - size : 12 px ; font - weight : 500 ; } . status - switch { display : inline - flex ; width : fit - content ; align - items : center ; gap : 7 px ; border : 0 ; background : transparent ; padding : 2 px 0 ; color : # 94 a3b8 ; font : inherit ; font - size : 12 px ; cursor : pointer ; } . status - switch i { position : relative ; width : 34 px ; height : 20 px ; border - radius : 999 px ; background : # cbd5e1 ; transition : background .18 s ; } . status - switch i : : after { position : absolute ; top : 3 px ; left : 3 px ; width : 14 px ; height : 14 px ; border - radius : 50 % ; background : # fff ; box - shadow : 0 1 px 2 px rgb ( 15 23 42 / 25 % ) ; content : '' ; transition : transform .18 s ; } . status - switch . on { color : # 15803 d ; } . status - switch . on i { background : # 22 c55e ; } . status - switch . on i : : after { transform : translateX ( 14 px ) ; } . status - switch b { font - weight : 500 ; }
. form - actions { display : flex ; gap : 10 px ; padding - top : 8 px ; }
. form - actions { position : sticky ; z - index : 2 ; bottom : 0 ; display : flex ; flex - wrap : wrap ; gap : 10 px ; grid - column : 1 / - 1 ; margin : 6 px - 20 px - 20 px ; border - top : 1 px solid # dce6ef ; background : rgb ( 255 255 255 / 96 % ) ; box - shadow : 0 - 8 px 18 px rgb ( 15 23 42 / 7 % ) ; padding : 14 px 20 px ; backdrop - filter : blur ( 8 px ) ; }
. audit - table - wrap { overflow - x : auto ; border : 1 px solid # dce6ef ; border - radius : 10 px ; background : # fff ; }
. audit - table { table - layout : fixed ; border - collapse : collapse ; font - size : 12 px ; }
. audit - table th { position : relative ; overflow : hidden ; padding : 11 px 12 px ; background : # f8fafc ; color : # 64748 b ; font - weight : 600 ; text - align : left ; text - overflow : ellipsis ; white - space : nowrap ; }
@@ -1399,5 +1603,5 @@ onMounted(load);
. object - list . empty - state { grid - column : 1 / - 1 ; display : grid ; min - height : 260 px ; place - items : center ; }
. empty - state { border : 1 px dashed # c9d7e5 ; border - radius : 10 px ; background : # f9fbfd ; padding : 38 px 18 px ; color : # 7 b899a ; font - size : 13 px ; text - align : center ; }
@ media ( max - width : 980 px ) { . console - header { display : block ; } . flow - strip { display : inline - flex ; margin - top : 18 px ; } . console - layout { grid - template - columns : 1 fr ; } . section - nav { flex - direction : row ; gap : 12 px ; overflow - x : auto ; } . nav - group { display : flex ; align - items : center ; gap : 4 px ; } . nav - group > p { display : none ; } . section - nav button { min - width : max - content ; border - bottom : 3 px solid transparent ; border - left : 0 ; } . section - nav button . active { border - bottom - color : # 16877 f ; border - left : 0 ; } . parameter - row , . condition - row , . mapping - row , . template - mapping , . record - card { grid - template - columns : 1 fr 1 fr ; } . mapping - value - row { grid - template - columns : minmax ( 0 , 1.6 fr ) minmax ( 180 px , 1 fr ) ; } . readiness - audit { grid - template - columns : repeat ( 2 , minmax ( 0 , 1 fr ) ) ; } }
@ media ( max - width : 640 px ) { . inventory - console { padding : 18 px ; } . editor - form , . parameter - row , . condition - row , . mapping - row , . template - mapping , . record - card , . mapping - value - row , . parsing - mapping - card , . readonly - mapping - section . parsing - mapping - card , . parsing - summary { grid - template - columns : 1 fr ; } . mapping - arrow { transform : rotate ( 90 deg ) ; } . workbench - heading { display : block ; } . workbench - heading . primary - action { margin - top : 12 px ; } . readiness - heading { display : grid ; } . readiness - count { justify - self : start ; } . readiness - steps li { grid - template - columns : 24 px minmax ( 0 , 1 fr ) ; } . readiness - action { grid - column : 2 ; justify - self : start ; } . readiness - footer { justify - content : stretch ; } . readiness - footer . primary - action { width : 100 % ; } }
@ media ( max - width : 640 px ) { . inventory - console { padding : 18 px ; } . editor - form , . parameter - row , . condition - row , . mapping - row , . template - mapping , . record - card , . mapping - value - row , . parsing - mapping - card , . readonly - mapping - section . parsing - mapping - card , . parsing - summary { grid - template - columns : 1 fr ; } . mapping - arrow { transform : rotate ( 90 deg ) ; } . workbench - heading { display : block ; } . workbench - heading . primary - action { margin - top : 12 px ; } . batch - source - list { grid - template - columns : 1 fr ; } . batch - stat - grid { grid - template - columns : repeat ( 3 , minmax ( 0 , 1 fr ) ) ; } . batch - run { grid - template - columns : 9 px minmax ( 0 , 1 fr ) ; } . batch - run - error { grid - column : 2 ; } . readiness - heading { display : grid ; } . readiness - count { justify - self : start ; } . readiness - steps li { grid - template - columns : 24 px minmax ( 0 , 1 fr ) ; } . readiness - action { grid - column : 2 ; justify - self : start ; } . readiness - footer { justify - content : stretch ; } . readiness - footer . primary - action { width : 100 % ; } }
< / style >