|
|
@@ -27,15 +27,15 @@
|
|
|
<div class="step-content">
|
|
|
<div class="step-title">{{ step.name }}</div>
|
|
|
<div class="step-status">
|
|
|
- {{ getStepTitle(step) }}
|
|
|
+ {{ step.status }}
|
|
|
<div v-if="step.status !== STATUS_WAITING" class="step-details">
|
|
|
- {{ tCurrentProgress.value.replace('{current}', step.current).replace('{total}', step.total) }}
|
|
|
+ 第{{ step.current }}/{{ step.total }}款
|
|
|
{{ getCurrentGoodsNo(step) }}
|
|
|
- <span v-if="step.error" style="color: red; margin-left:5px;">{{ tFailedCount.value.replace('{count}', step.error) }}</span>
|
|
|
+ <span v-if="step.error" style="color: red; margin-left:5px;">失败:{{ step.error }}款</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div v-if="step.folder" class="step-actions">
|
|
|
- <span class="view-results" @click="handleViewResults(step)">{{ tViewResults }}</span>
|
|
|
+ <span class="view-results" @click="handleViewResults(step)">查看结果</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
@@ -53,16 +53,15 @@
|
|
|
class="completion-button"
|
|
|
@click="handleComplete"
|
|
|
>
|
|
|
- {{ tProcessComplete }}
|
|
|
+ 处理完毕,点击打开最终图片目录
|
|
|
</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
-import { ref, computed, watch } from 'vue'
|
|
|
+import { ref, watch } from 'vue'
|
|
|
import { Check, Close } from '@element-plus/icons-vue'
|
|
|
-import i18n from '@/locales'
|
|
|
|
|
|
interface StepData {
|
|
|
msg_type: string
|
|
|
@@ -80,7 +79,7 @@ interface Props {
|
|
|
disabledButton?: boolean
|
|
|
useNewProgress?: boolean
|
|
|
onComplete?: () => void
|
|
|
- onOpenFolder?: (folder: string) => void // 添加打开目录的回调函数
|
|
|
+ onOpenFolder?: (folder: string) => void
|
|
|
}
|
|
|
|
|
|
const props = withDefaults(defineProps<Props>(), {
|
|
|
@@ -88,28 +87,13 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
useNewProgress: false,
|
|
|
disabledButton: true,
|
|
|
onComplete: () => {},
|
|
|
- onOpenFolder: () => {} // 默认空函数
|
|
|
+ onOpenFolder: () => {}
|
|
|
})
|
|
|
|
|
|
const emit = defineEmits<{
|
|
|
(e: 'complete'): void
|
|
|
}>()
|
|
|
|
|
|
-// i18n 翻译
|
|
|
-const tWaiting = computed(() => i18n.global.t('loadingDialog.waiting'))
|
|
|
-const tProcessing = computed(() => i18n.global.t('loadingDialog.processing'))
|
|
|
-const tCompleted = computed(() => i18n.global.t('loadingDialog.completed'))
|
|
|
-const tFailed = computed(() => i18n.global.t('loadingDialog.failed'))
|
|
|
-const tViewResults = computed(() => i18n.global.t('loadingDialog.viewResults'))
|
|
|
-const tProcessComplete = computed(() => i18n.global.t('loadingDialog.processComplete'))
|
|
|
-const tCurrentProgress = computed(() => i18n.global.t('loadingDialog.currentProgress'))
|
|
|
-const tFailedCount = computed(() => i18n.global.t('loadingDialog.failedCount'))
|
|
|
-
|
|
|
-// 获取步骤标题
|
|
|
-const getStepTitle = (step: StepData) => {
|
|
|
- return step.status
|
|
|
-}
|
|
|
-
|
|
|
// 后端返回的中文状态值常量
|
|
|
const STATUS_WAITING = '等待处理'
|
|
|
const STATUS_PROCESSING = '正在处理'
|
|
|
@@ -126,24 +110,14 @@ const getStepClass = (step: StepData) => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-// 检查是否所有步骤都完成 - 使用后端返回的中文状态值
|
|
|
-const allStepsCompleted = computed(() => {
|
|
|
- return props.steps.every(step => step.status === STATUS_COMPLETED)
|
|
|
-})
|
|
|
-
|
|
|
-// 获取当前货号(这里需要根据实际数据结构调整)
|
|
|
+// 获取当前货号
|
|
|
const getCurrentGoodsNo = (step: StepData) => {
|
|
|
- // 这里需要根据实际的数据结构来获取当前货号
|
|
|
- console.log('step===================');
|
|
|
- console.log(step);
|
|
|
- // 暂时返回一个示例值
|
|
|
return step.goods_art_no
|
|
|
}
|
|
|
|
|
|
// 处理查看结果
|
|
|
const handleViewResults = (step: StepData) => {
|
|
|
console.log('查看结果:', step)
|
|
|
- // 如果有folder路径,则调用外部传入的打开目录方法
|
|
|
if (step.folder && props.onOpenFolder) {
|
|
|
props.onOpenFolder(step.folder)
|
|
|
}
|