Commit c17e8d7a by linjinhong

Merge remote-tracking branch 'origin/dev'

parents 1c7462bf 20829a72
......@@ -1547,6 +1547,16 @@
{{ row.finishTime?.replace('T', ' ') }}
</div>
</template>
<template #automaticComposing="{ row }">
<div style="white-space: pre-line">
{{ row.automaticComposing ? '是' : '否' }}
</div>
</template>
<template #composingParam="{ row }">
<div style="white-space: pre-line">
{{ row.composingParam?.split(';').join('\n') }}
</div>
</template>
<template #failTime="{ row }">
<div style="white-space: pre-line">
{{ row.failTime?.replace('T', ' ') }}
......@@ -1562,15 +1572,15 @@
>
<span class="operate-item">
<ElButton
:disabled="!row.url"
:disabled="!row.url && !row.tiffUrl"
link
type="primary"
@click="handleDownload(row, 'png')"
@click="handleDownload(row)"
>
PNG下载
下载
</ElButton>
</span>
<span class="operate-item">
<!-- <span class="operate-item">
<ElButton
:disabled="!row.tiffUrl"
link
......@@ -1579,7 +1589,7 @@
>
TIF下载
</ElButton>
</span>
</span> -->
<span class="operate-item">
<ElButton
link
......@@ -2469,22 +2479,47 @@
width="500px"
:close-on-click-modal="false"
>
<el-form :model="typesettingForm" label-width="100px">
<el-form-item label="排版类型:" prop="type">
<el-checkbox-group v-model="typesettingForm.typeArr">
<el-checkbox label="tiff">tiff排版</el-checkbox>
<el-checkbox label="png">png排版</el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item label="排版宽度:" prop="type">
<el-radio-group v-model="typesettingForm.templateWidth">
<el-radio :value="40">40cm</el-radio>
<el-radio :value="60">60cm</el-radio>
</el-radio-group>
<el-form :model="typesettingForm">
<el-form-item
label="自动排版 (烫画工艺推荐自动排版)"
prop="bool"
v-if="typesettingType == 2"
>
<el-switch
v-model="isAuto"
class="ml-2"
style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"
inline-prompt
active-text="是"
inactive-text="否"
@change="changeSwitch"
/>
</el-form-item>
<div v-if="isAuto">
<el-form-item label="排版类型:" prop="type">
<el-radio-group v-model="typesettingForm.type">
<el-radio label="tiff">tiff排版</el-radio>
<el-radio label="png">png排版</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="排版宽度:" prop="type">
<el-radio-group v-model="typesettingForm.templateWidth">
<el-radio :value="40">40cm</el-radio>
<el-radio :value="60">60cm</el-radio>
</el-radio-group>
</el-form-item>
</div>
</el-form>
<template #footer>
<el-button @click="typesettingVisible = false">取消</el-button>
<el-button
@click="
() => {
isAuto = true
typesettingVisible = false
}
"
>取消</el-button
>
<el-button type="primary" @click="submitTypesetting">确认</el-button>
</template>
</ElDialog>
......@@ -2628,7 +2663,7 @@ declare global {
}
}
const tabsNav = ref<Tab[]>()
const isAuto = ref(true)
const countryList = ref([])
const currentRow = ref<AddressInfo>({
receiverName: '',
......@@ -2914,7 +2949,7 @@ const handleUpdateAddress = async (row: PodUsOrderListData, type: 1 | 2) => {
updateAddressType.value = type
}
// 批量下载 下载
const handleDownload = async (row: PodUsOrderListData, type: string) => {
const handleDownload = async (row: PodUsOrderListData) => {
try {
await showConfirm('确定下载吗?', {
confirmButtonText: '确认',
......@@ -2929,6 +2964,8 @@ const handleDownload = async (row: PodUsOrderListData, type: string) => {
text: '操作中...',
background: 'rgba(0, 0, 0, 0.3)',
})
const type = row.url && row.tiffUrl ? 'tiff' : row.url ? 'png' : 'tiff'
try {
const url =
type === 'png'
......@@ -3011,10 +3048,10 @@ const handleReComposingDesign = async () => {
} = {
id: row.id,
}
const { templateWidth, typeArr } = typesettingForm.value
if (templateWidth && typeArr?.length) {
const { templateWidth, type } = typesettingForm.value
if (templateWidth && type) {
params.templateWidth = templateWidth
params.type = typeArr.join(',')
params.type = type
}
try {
const res = await batchDownloadRecomposingApi(params)
......@@ -3037,31 +3074,31 @@ const tableColumns = computed(() => {
{
label: '批次号',
prop: 'batchArrangeNum',
width: 150,
width: 120,
align: 'center',
},
{
label: '下载状态',
slot: 'downloadStatus',
width: 100,
width: 90,
prop: 'downloadStatus',
align: 'center',
},
{
label: '订单数量',
prop: 'productNum',
width: 90,
width: 85,
align: 'center',
},
{
label: '素材数量',
width: 90,
width: 85,
prop: 'materialNum',
align: 'center',
},
{
label: '创建人',
width: 100,
width: 85,
prop: 'employeeAccount',
align: 'center',
},
......@@ -3086,17 +3123,24 @@ const tableColumns = computed(() => {
slot: 'finishTime',
align: 'center',
},
// {
// label: '失败时间',
// width: 250,
// prop: 'failTime',
// slot: 'failTime',
// align: 'center',
// },
{
label: '自动下载',
width: 85,
prop: 'automaticComposing',
slot: 'automaticComposing',
align: 'center',
},
{
label: '排版参数',
width: 140,
prop: 'composingParam',
slot: 'composingParam',
align: 'center',
},
{
label: '操作',
slot: 'operate',
width: 450,
width: 350,
align: 'center',
fixed: 'right',
prop: 'operate',
......@@ -3697,23 +3741,22 @@ const downloadTifItem = async () => {
})
try {
const { templateWidth, typeArr } = typesettingForm.value
const type = typeArr?.join(',') || ''
const { templateWidth, type } = typesettingForm.value
typesettingVisible.value = false
// 处理下载逻辑
if ((typeArr as string[]).length > 1) {
// 并行处理多个类型
await Promise.allSettled(
(typeArr as string[]).map((el) =>
downloadSingleType(row.id, el, templateWidth),
),
)
} else {
// 处理单个类型
await downloadSingleType(row.id, type, templateWidth)
}
// // 处理下载逻辑
// if ((type as string[]).length > 1) {
// // 并行处理多个类型
// await Promise.allSettled(
// (type as string[]).map((el) =>
// downloadSingleType(row.id, el, templateWidth),
// ),
// )
// } else {
// 处理单个类型
await downloadSingleType(row.id, type as string, templateWidth)
// }
} catch (error) {
console.error('下载过程中出错:', error)
} finally {
......@@ -4397,10 +4440,10 @@ const arrangeFinish = async () => {
} = {
productIdList: selectedIds,
}
const { templateWidth, typeArr } = typesettingForm.value
if (templateWidth && typeArr?.length) {
const { templateWidth, type } = typesettingForm.value
if (templateWidth && type) {
params.templateWidth = templateWidth
params.type = typeArr.join(',')
params.type = type
}
console.log(4233, params)
......@@ -4419,18 +4462,18 @@ const arrangeFinish = async () => {
}
const submitTypesetting = () => {
const { templateWidth, typeArr } = typesettingForm.value
if (templateWidth && !typeArr?.length) {
const { templateWidth, type } = typesettingForm.value
if (templateWidth && !type) {
return ElMessage.warning('请选择排版类型')
} else if (!templateWidth && typeArr?.length) {
} else if (!templateWidth && type) {
return ElMessage.warning('请选择排版宽度')
}
if (typesettingType.value == 3) {
if (!templateWidth && !typeArr?.length) {
if (!templateWidth && !type) {
return ElMessage.warning('排版类型和排版宽度为必选项')
}
}
isAuto.value = true
return typesettingType.value == 1
? handleReComposingDesign()
: typesettingType.value == 2
......@@ -4438,6 +4481,10 @@ const submitTypesetting = () => {
: downloadTifItem()
}
const changeSwitch = () => {
typesettingForm.value = {}
}
interface timeLineType {
time_iso?: string
time_utc?: string
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment