| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762 |
- <template>
- <headerBar title="主图与详情生成" />
- <div class="detail-container">
- <div>
- <!-- 顶部:勾选服务内容(多选) -->
- <div class="service-section flex between top">
- <div class="section-title">
- <img src="@/assets/images/Photography/zhuangshi.png" style="width: 32px; height: 32px;" />
- 勾选服务内容(多选):
- </div>
- <div class="service-cards">
- <div class="service-card" :class="{ active: form.services.includes('is_product_scene') }" @click="toggleService('is_product_scene')" v-log="{ describe: { action: '点击服务卡片', service: '场景图生成' } }">
- <div class="service-checkbox" @click.stop>
- <el-checkbox size="large" :model-value="form.services.includes('is_product_scene')" @change="toggleService('is_product_scene')" />
- </div>
- <div class="service-content">
- <div class="service-image">
- <img src="@/assets/images/Photography/cj.png" alt="场景图生成" />
- <div class="service-icon" @click.stop="openScenePromptDialog" v-log="{ describe: { action: '点击服务卡片图标', service: '场景图生成-弹窗' } }">
- <el-icon><EditPen /></el-icon>
- </div>
- </div>
- <div class="service-name">场景图生成</div>
- </div>
- </div>
- <div class="service-card" :class="{ active: form.services.includes('is_upper_footer') }" @click="toggleService('is_upper_footer')" v-log="{ describe: { action: '点击服务卡片', service: '模特图生成' } }">
- <div class="service-checkbox" @click.stop>
- <el-checkbox size="large" :model-value="form.services.includes('is_upper_footer')" @change="toggleService('is_upper_footer')" />
- </div>
- <div class="service-content">
- <div class="service-image">
- <img src="@/assets/images/Photography/mt.png" alt="模特图生成" />
- <div class="service-icon" @click.stop="openModelDialog" v-log="{ describe: { action: '点击服务卡片图标', service: '模特图生成-弹窗' } }">
- <el-icon><EditPen /></el-icon>
- </div>
- </div>
- <div class="service-name">模特图生成</div>
- </div>
- </div>
- <div class="service-card" :class="{ active: form.services.includes('is_detail') }" @click="toggleService('is_detail')" v-log="{ describe: { action: '点击服务卡片', service: '详情页生成' } }">
- <div class="service-checkbox" @click.stop>
- <el-checkbox size="large" :model-value="form.services.includes('is_detail')" @change="toggleService('is_detail')" />
- </div>
- <div class="service-content">
- <div class="service-image">
- <img src="@/assets/images/Photography/xq.png" alt="详情页生成" />
- </div>
- <div class="service-name">详情页生成</div>
- </div>
- </div>
- </div>
- </div>
- <!-- 主图LOGO部分 -->
- <!--
- <div class="logo-section flex left top" >
- <div class="section-title" style="margin-bottom: 0px;">
- <img src="@/assets/images/Photography/zhuangshi.png" style="width: 32px; height: 32px;" />
- 主图LOGO 与 选择详情模板:
- </div>
- </div>
- <div class="logo-section flex left top multi-line">
- <upload v-for="item,index in logoList" :value="item" :key="item"
- v-show="item"
- @input="onRemove(index)"
- class="mar-right-10 upload-item"
- :class="{
- active: item === form.logo_path
- }"
- @click.native="form.logo_path = item"
- ></upload>
- <upload @input="onInput"></upload>
- </div>
- -->
- <el-divider />
- <!-- <!– 图片抠图与货号图生成 –>
- <div class="section">
- <div class="section-title">
- <img src="@/assets/images/Photography/zhuangshi.png" style="width: 32px; height: 32px;" />
- 图片抠图与货号图生成
- </div>
- <div class="section-content">
- <div v-if="showTips" class="instruction-out flex top left">
- <img style="fill: #000" src="@/assets/images/xinxi.svg" />
- <ol class="instruction-list">
- <li>请在下方确认图片拍摄过程中的顺序,确保所有拍摄的图片的顺序一致。</li>
- <li>使用中英文语号分隔。</li>
- <li>图片的名称不能随意修改,否则无法正常生成详情页。</li>
- <li>现有图片名称有:俯视、侧视、后视、鞋底、内里</li>
- </ol>
- <el-icon @click="showTips = false" class="close-icon">
- <Close />
- </el-icon>
- </div>
- <!– 货号文件夹 –>
- <!– <div class="form-item">
- <div class="label">货号文件夹:</div>
- <div class="folder-warp">
- <div class="folder-input">
- <el-input style="width: 60%;" v-model="folderPath" type="textarea" :rows="2" readonly
- placeholder="请选择货号文件夹" />
- <el-button class="check-button" type="primary" @click="selectFolder">
- <img src="@/assets/images/Photography/wenjian.png" style="width: 14px; " />
- 选择目标文件夹</el-button>
- </div>
- <div class="hint">
- <el-icon>
- <Warning />
- </el-icon> <text>选择货号的上级文件夹</text>
- </div>
- </div>
- </div>
- –>
- </div>
- </div>
- <el-divider />-->
- <!-- 主图LOGO 与 选择详情模板:左右布局 -->
- <div class="logo-template-row">
- <!-- 左:主图LOGO -->
- <div class="logo-col">
- <div class="logo-section flex left top" >
- <div class="section-title" style="margin-bottom: 0px;">
- <img src="@/assets/images/Photography/zhuangshi.png" style="width: 32px; height: 32px;" />
- 主图LOGO:
- </div>
- </div>
- <div class="logo-section flex left top multi-line">
- <upload v-for="item,index in logoList" :value="item" :key="item"
- v-show="item"
- @input="onRemove(index)"
- class="mar-right-10 upload-item"
- :class="{
- active: item === form.logo_path
- }"
- @click.native="selectLogo(item)"
- ></upload>
- <upload @input="onInput"></upload>
- </div>
- </div>
- <!-- 右:选择详情模板 -->
- <div class="template-col">
- <div class="template-section ">
- <div class="flex between">
- <div class="section-title">
- <img src="@/assets/images/Photography/zhuangshi.png" style="width: 32px; height: 32px;" />
- 选择详情模版
- </div>
- <div class="template-pagination">
- <el-pagination background layout="prev, pager, next" v-model:current-page="queryParams.current"
- v-model:page-size.sync="queryParams.size" :total="totalPage" @current-change="onCurrentChange"
- @size-change="onSizeChange" />
- </div>
- </div>
- <div class="template-list">
- <div v-for="(template, index) in visibleTemplates" :key="index" class="template-item"
- @click="selectTemplate(template)" v-log="{ describe: { action: '点击选择详情模板', template_name: template.template_name } }">
- <el-image :src="template.template_cover_image" fit="contain" class="cur-p"
- style="width: 100%; display: block;" />
- <div class="select-warp" :class="form.selectTemplate?.id == template.id ? 'active' : ''">
- <el-icon color="#FFFFFF">
- <Select />
- </el-icon>
- </div>
- <div class="template-info">
- <span class="mar-left-10 chaochu_1">{{ template.template_name }}</span>
- <div class="template-view" @click="viewTemplate(template)" v-log="{ describe: { action: '点击查看模板详情', template_name: template.template_name } }">查看</div>
- </div>
- </div>
- </div>
- <div class="template-tips c-333 fs-14 line-20 te-l mar-top-20 flex left">
- <el-icon><WarningFilled /></el-icon>
- <span class="mar-left-10">该模版要求拍摄图片:{{form.selectTemplate?.template_image_order}}
- <template v-if="form.selectTemplate?.template_image_order">,共{{form.selectTemplate?.template_image_order.split(',').length}}张。</template>
- </span>
- </div>
- <!-- 模板下:一键上架 和 电商平台(多选) -->
- <div class="publish-section flex left" v-if="onlineStoreTempList.length || onlineStoreTempListForeign.length">
- <div class="form-item flex left">
- <div class="fw-b">一键上架:</div>
- </div>
- <div class="form-item flex left mar-top-10" style="margin-right: 10px !important;" v-if="onlineStoreTempList.length">
- <div class="label">国内电商平台:</div>
- <el-select v-model="domesticPlatforms" multiple placeholder="请选择平台" style="min-width: 200px;">
- <el-option
- v-for="store in onlineStoreTempList"
- :key="store.show_name"
- :label="store.show_name"
- :value="store.online_store_name"
- :disabled="!store.channel_status"
- />
- </el-select>
- </div>
- <div class="form-item flex left mar-top-10" v-if="onlineStoreTempListForeign.length">
- <div class="label">国外电商平台:</div>
- <el-select v-model="foreignPlatforms" multiple placeholder="请选择平台" style="min-width: 200px;">
- <el-option
- v-for="store in onlineStoreTempListForeign"
- :key="store.show_name"
- :label="store.show_name"
- :value="store.online_store_name"
- :disabled="!store.channel_status"
- />
- </el-select>
- </div>
- </div>
- </div>
- </div>
- </div>
- <el-divider />
- <!-- 详情高级配置 -->
- <!-- <div class="section">
- <div class="section-title">
- <img src="@/assets/images/Photography/zhuangshi.png" style="width: 32px; height: 32px;" />
- 详情高级配置
- </div>
- <div class="section-content">
- <!– 图片顺序 –>
- <div class="form-item">
- <div class="label">图片顺序:</div>
- <el-input v-model="imageOrder" placeholder="请输入图片顺序" class="specific-page-input">
- <template #append>
- <el-button class="explain-btn" link type="primary">说明</el-button>
- </template>
- </el-input>
- </div>
- <!– 同款检验 –>
- <!– <div class="form-item">
- <div class="label">同款检验:</div>
- <el-checkbox v-model="checkSimilar">同款下货号必须齐全</el-checkbox>
- </div>
- –>
- <!– 可指定页面独修改 –>
- <!– <div class="form-item">
- <div class="label">可指定页面独修改:</div>
- <el-input v-model="specificPage" placeholder="请输入入需要单独修改的页面,示例:4:1 (需修改模版的编号:第一张)"
- class="specific-page-input">
- <template #append>
- <el-button class="explain-btn" link type="primary">说明</el-button>
- </template>
- </el-input>
- </div>
- –>
- </div>
- </div>
- <el-divider />-->
- <!-- 详情资料准备部分 -->
- <div class="data-prep-section">
- <div class="flex-item left">
- <div class="section-title">
- <img src="@/assets/images/Photography/zhuangshi.png" style="width: 32px; height: 32px;" />
- 详情资料准备 (2选1)
- <el-button v-if="form.dataType == '1'" type="text" class="mar-left-10 fs-16" @click="downloadExcel" v-log="{ describe: { action: '点击下载Excel模板' } }">下载商品基础资料模版</el-button>
- </div>
- </div>
- <div class="flex-item left">
- <el-radio-group v-model="form.dataType" class="ml-4">
- <el-radio label="1" size="large">EXCEL文件选择</el-radio>
- <el-radio label="2" size="large">系统对接(和业务员联系)</el-radio>
- </el-radio-group>
- </div>
- <div v-if="form.dataType == '1'" class="excel-upload">
- <div class="flex bottom between">
- <div style="max-width: 160px;" class="mar-left-20">商品基础资料EXCEL文件选择:</div>
- <div class="flex bottom mar-left-20" style="flex-grow: 1;">
- <el-input type="textarea" v-model="form.excel_path" />
- </div>
- <el-button class="select-button button--primary1 mar-left-20" type="primary" @click="selectExcel" v-log="{ describe: { action: '点击选择Excel文件' } }">
- <img src="@/assets/images/Photography/wenjian.png" style="width: 16px; margin-right: 4px;" />
- 选择</el-button>
- </div>
- </div>
- </div>
- </div>
- <!-- 底部按钮 -->
- <div class="footer">
- <!-- <el-button class="button--primary1 footer-button" type="primary" @click="saveConfig">保存配置</el-button> -->
- <!-- <el-button class="button--primary1 footer-button" type="primary" @click="startProcess">开始处理</el-button> -->
- <el-button class="button--primary1 footer-button" type="primary" @click="generate" v-log="{ describe: { action: '点击开始生成详情页' } }">开始生成</el-button>
- </div>
- </div>
- <loading-dialog v-if="loadingDialogVisible" v-model="loadingDialogVisible" :requesting="requesting" :progress="progress" :message="message"
- :disabled-button="disabledButton" @button-click="handleComplete">
- <template v-if="partErrList && partErrList.length > 0" #errList>
- <div v-for="(item, idx) in partErrList" :key="idx">
- <span v-if="item.goods_art_no">{{ item.goods_art_no }}:</span><span>{{ item.info }}</span>
- </div>
- </template>
- <template #progressMessages>
- <div class="progress-messages" v-if="progressMessages.length">
- <div class="message-header">
- <span>处理进度</span>
- <div class="flex right" style="gap:8px; align-items:center;">
- <el-button type="text" @click="openOutputDir" v-log="{ describe: { action: '点击打开输出目录' } }">打开目录</el-button>
- <el-button type="text" @click="showMessageHistory = !showMessageHistory" v-log="{ describe: { action: '点击查看进度详情' } }">
- {{ showMessageHistory ? '收起' : '查看详情' }}
- </el-button>
- </div>
- </div>
- <div class="message-list" v-if="showMessageHistory" ref="messageListRef">
- <div v-for="(msg, index) in progressMessages" :key="index" class="message-item flex left">
- <div class="message-time">{{ formatTime(msg.timestamp) }}</div>
- <div class="message-content mar-left-10">
- <span class="goods-no">货号{{ msg.goods_art_nos.join(', ') }}:</span>
- <span class="message-text">{{ msg.msg }}</span>
- </div>
- </div>
- </div>
- </div>
- </template>
- </loading-dialog>
- <el-dialog v-model="dialogVisible">
- <img style="width: 100%;" :src="dialogImageUrl" alt="Preview Image" />
- </el-dialog>
- <!-- 模特生成弹窗 -->
- <ModelGenerationDialog
- v-model="modelDialogVisible"
- :initial-models="selectedModels"
- @confirm="handleModelSelection"
- @cancel="modelDialogVisible = false"
- />
- <!-- 场景提示词弹窗 -->
- <ScenePromptDialog
- v-model="scenePromptDialogVisible"
- :initial-prompt="scenePrompt"
- @confirm="handleScenePromptConfirm"
- @cancel="scenePromptDialogVisible = false"
- />
- </template>
- <script lang="ts" setup>
- import { getCompanyTemplatesApi } from '@/apis/other'
- import tokenInfo from '@/stores/modules/token';
- import useUserInfo from "@/stores/modules/user";
- import { useRoute, useRouter } from 'vue-router'
- import { clickLog, setLogInfo } from '@/utils/log'
- import { ElMessage, ElMessageBox } from 'element-plus'
- import headerBar from '@/components/header-bar/index.vue'
- import { ref, computed, reactive, onMounted, onBeforeUnmount, nextTick, watch } from 'vue';
- import { Select, EditPen } from '@element-plus/icons-vue'
- import upload from '@/components/upload'
- import client from "@/stores/modules/client";
- import icpList from '@/utils/ipc'
- const clientStore = client();
- import { getRouterUrl } from '@/utils/appfun'
- import { useUuidStore } from '@/stores/modules/uuid'
- import socket from "@/stores/modules/socket";
- const socketStore = socket();
- import ModelGenerationDialog from '@/components/ModelGeneration/index.vue'
- import ScenePromptDialog from '@/components/ScenePromptDialog/index.vue'
- import { Close, Warning } from '@element-plus/icons-vue'
- import LoadingDialog from '@/views/Photography/components/LoadingDialog.vue'
- import configInfo from "@/stores/modules/config";
- const useConfigInfoStore = configInfo();
- import { useCheckInfo } from '@/composables/userCheck';
- useCheckInfo();
- const showTips = ref(true)
- const folderPath = ref('') //货号文件夹
- // const reportMode = ref('normal') // 抠图模式
- const imageOrder = ref('俯视、侧视、后跟、鞋底、内里、组合、组合2、组合3') // 图片顺序
- const checkSimilar = ref(false) // 同款检验
- const specificPage = ref('') // 可指定页面独修改
- // 路由和状态管理初始化
- const route = useRoute();
- const router = useRouter();
- const uuidStore = useUuidStore();
- // 完成目录
- const completeDirectory = ref('')
- const loadingDialogVisible = ref(false)
- const progress = ref(0)
- const message = ref('正在为您处理,请稍后')
- const disabledButton = ref(true)
- // 进度消息队列
- const progressMessages = ref<Array<{
- goods_no: string
- temp_name: string
- status: string
- goods_art_nos: string[]
- msg: string
- timestamp: number
- }>>([])
- const showMessageHistory = ref(true)
- const messageListRef = ref<HTMLElement | null>(null)
- // 新消息时自动滚动到底部
- const scrollMessageListToBottom = () => {
- nextTick(() => {
- const el = messageListRef.value
- if (el) {
- el.scrollTop = el.scrollHeight
- }
- })
- }
- let templates = ref([])
- let goods_art_nos = ref([])
- let partErrList = ref([])
- const excel_template_url = ref('')
- // 是否正在请求接口
- const requesting = ref(false)
- // 定义一个定时器变量
- const INTERVAL = ref<number | NodeJS.Timeout | null>(null);
- // 状态变量
- const totalPage = ref(0);
- const itemsPerPage = 4; // 每页显示的模板数量
- const dialogVisible = ref(false);
- const dialogImageUrl = ref('');
- const queryParams = reactive({ // 分页查询参数
- size: 1,
- current: 1,
- })
- const form = reactive({
- selectTemplate: {}, //选中的模板
- dataType: '1', // 1: 选择excel文件 2: 系统对接
- logo_path: '', // 主图LOGO
- excel_path: '', // 商品基础资料EXCEL文件选择
- services: ['is_detail'], // 勾选服务内容(多选)默认包含详情页生成
- })
- onMounted(() => {
- // 页面访问埋点
- const goods_art_data = route.query.goods_art_nos
- goods_art_nos.value = Array.isArray(goods_art_data) ? goods_art_data : [goods_art_data]
- getCompanyTemplates()
- getLogolist()
- loadDetailCache()
- })
- // 监听数据类型变化,自动保存到缓存
- watch(() => form.dataType, (newValue) => {
- if (newValue) {
- saveDataTypeToCache(newValue)
- }
- })
- // 页面卸载时清理监听器
- onBeforeUnmount(() => {
- clientStore.ipc.removeAllListeners(icpList.socket.message + '_detail_progress');
- clientStore.ipc.removeAllListeners(icpList.socket.message + '_segment_progress');
- clientStore.ipc.removeAllListeners(icpList.socket.message + '_upper_footer_progress');
- clientStore.ipc.removeAllListeners(icpList.socket.message + '_scene_progress');
- clientStore.ipc.removeAllListeners(icpList.socket.message + '_upload_goods_progress');
- clientStore.ipc.removeAllListeners(icpList.socket.message + '_detail_result_progress');
- clearInterval(INTERVAL.value);
- })
- // 计算属性,获取当前页可见的模板
- const visibleTemplates = computed(() => {
- const startIndex = (queryParams.current - 1) * itemsPerPage;
- const data = templates.value.slice(startIndex, startIndex + itemsPerPage);
- return data
- });
- // 查看模板详情
- const viewTemplate = (template) => {
- // 展示大图
- dialogVisible.value = true
- dialogImageUrl.value = template.template_preview_image
- };
- // 获取模版列表
- const getCompanyTemplates = async () => {
- const { data } = await getCompanyTemplatesApi()
- console.log(data);
- templates.value = data.list
- // 获取电商平台列表 - 支持新的数据结构
- if (data.online_store_temp_list) {
- onlineStoreTempList.value = data.online_store_temp_list
- }
- if (data.online_store_temp_list_foreign) {
- onlineStoreTempListForeign.value = data.online_store_temp_list_foreign
- }
- // 默认选中第一个模板
- if (templates.value.length > 0) {
- form.selectTemplate = templates.value[0]
- }
- excel_template_url.value = data.excel_template_url
- // 计算总页数
- totalPage.value = Math.ceil(templates.value.length / itemsPerPage);
- }
- const downloadExcel = () => {
- const a = document.createElement('a')
- a.href = excel_template_url.value,
- a.download = '商品基础资料模版'
- document.body.appendChild(a)
- a.click()
- setTimeout(() => {
- document.body.removeChild(a);
- }, 1000);
- }
- // 服务内容切换
- const toggleService = (key: string) => {
- const idx = form.services.indexOf(key)
- if (idx > -1) form.services.splice(idx, 1)
- else form.services.push(key)
- // 保存服务选择状态到缓存
- saveServicesToCache(form.services)
- }
- // 电商平台多选与一键上架
- const domesticPlatforms = ref<string[]>([])
- const foreignPlatforms = ref<string[]>([])
- const onlineStoreTempList = ref<any[]>([]) // 国内电商平台列表
- const onlineStoreTempListForeign = ref<any[]>([]) // 国外电商平台列表
- // 模特与场景弹窗
- const modelDialogVisible = ref(false)
- const scenePromptDialogVisible = ref(false)
- const selectedModels = ref<{ female: any; male: any } | null>(null)
- const scenePrompt = ref('')
- // 本地缓存键(与弹窗组件保持一致)
- const DETAIL_MODEL_CACHE_KEY = 'model_selection_cache'
- const DETAIL_SCENE_PROMPT_CACHE_KEY = 'scene_prompt_cache'
- const DETAIL_LOGO_CACHE_KEY = 'detail_logo_cache'
- const DETAIL_DATA_TYPE_CACHE_KEY = 'detail_data_type_cache'
- const DETAIL_SERVICES_CACHE_KEY = 'detail_services_cache'
- // 读取本地缓存
- const loadDetailCache = () => {
- console.log('loadDetailCache');
- try {
- const m = localStorage.getItem(DETAIL_MODEL_CACHE_KEY)
- if (m) {
- const parsed = JSON.parse(m)
- if (parsed && (parsed.female || parsed.male)) {
- selectedModels.value = parsed
- console.log('loadDetailCache');
- console.log(selectedModels.value);
- }
- }
- } catch {}
- try {
- const p = localStorage.getItem(DETAIL_SCENE_PROMPT_CACHE_KEY)
- if (p) {
- console.log('scenePrompt');
- scenePrompt.value = p
- console.log(scenePrompt.value);
- }
- } catch {}
- // 加载LOGO缓存
- try {
- const logo = localStorage.getItem(DETAIL_LOGO_CACHE_KEY)
- if (logo) {
- form.logo_path = logo
- console.log('loadDetailCache - logo:', logo);
- }
- } catch {}
- // 加载数据类型缓存
- try {
- const dataType = localStorage.getItem(DETAIL_DATA_TYPE_CACHE_KEY)
- if (dataType) {
- form.dataType = dataType
- console.log('loadDetailCache - dataType:', dataType);
- }
- } catch {}
- // 加载模板缓存
- try {
- const template = localStorage.getItem('detail_template_cache')
- if (template) {
- const parsed = JSON.parse(template)
- if (parsed && parsed.id) {
- form.selectTemplate = parsed
- console.log('loadDetailCache - template:', parsed);
- }
- }
- } catch {}
- // 加载服务选择状态缓存
- try {
- const services = localStorage.getItem(DETAIL_SERVICES_CACHE_KEY)
- if (services) {
- const parsed = JSON.parse(services)
- if (Array.isArray(parsed)) {
- form.services = parsed
- console.log('loadDetailCache - services:', parsed);
- }
- }
- } catch {}
- }
- // 保存到本地缓存(仅保存必要字段)
- const saveModelsToCache = (models: { female: any; male: any }) => {
- try {
- const payload = {
- female: models?.female ? {
- id: models.female.id,
- name: models.female.name,
- image_url: models.female.image_url,
- gender: models.female.gender,
- keywords: models.female.keywords,
- status: models.female.status
- } : null,
- male: models?.male ? {
- id: models.male.id,
- name: models.male.name,
- image_url: models.male.image_url,
- gender: models.male.gender,
- keywords: models.male.keywords,
- status: models.male.status
- } : null
- }
- localStorage.setItem(DETAIL_MODEL_CACHE_KEY, JSON.stringify(payload))
- } catch {}
- }
- const saveScenePromptToCache = (prompt: string) => {
- try {
- const v = (prompt || '').trim()
- if (v) localStorage.setItem(DETAIL_SCENE_PROMPT_CACHE_KEY, v)
- } catch {}
- }
- // 保存LOGO到缓存
- const saveLogoToCache = (logoPath: string) => {
- try {
- if (logoPath) {
- localStorage.setItem(DETAIL_LOGO_CACHE_KEY, logoPath)
- console.log('saveLogoToCache:', logoPath);
- }
- } catch {}
- }
- // 保存数据类型到缓存
- const saveDataTypeToCache = (dataType: string) => {
- try {
- if (dataType) {
- localStorage.setItem(DETAIL_DATA_TYPE_CACHE_KEY, dataType)
- console.log('saveDataTypeToCache:', dataType);
- }
- } catch {}
- }
- const saveServicesToCache = (services: string[]) => {
- try {
- localStorage.setItem(DETAIL_SERVICES_CACHE_KEY, JSON.stringify(services))
- console.log('saveServicesToCache:', services);
- } catch {}
- }
- const openModelDialog = () => {
- modelDialogVisible.value = true
- }
- const openScenePromptDialog = () => {
- scenePromptDialogVisible.value = true
- }
- // 选择模板
- const selectTemplate = (template: any) => {
- form.selectTemplate = template
- // 保存模板选择到缓存
- try {
- localStorage.setItem('detail_template_cache', JSON.stringify(template))
- console.log('selectTemplate - saved to cache:', template);
- } catch {}
- }
- // 选择LOGO
- const selectLogo = (logoPath: string) => {
- form.logo_path = logoPath
- // 保存LOGO选择到缓存
- saveLogoToCache(logoPath)
- }
- const handleModelSelection = (models: { female: any; male: any }) => {
- selectedModels.value = models
- saveModelsToCache(models)
- modelDialogVisible.value = false
- ElMessage.success('模特选择完成!')
- }
- const handleScenePromptConfirm = (prompt: string) => {
- scenePrompt.value = prompt
- saveScenePromptToCache(prompt)
- }
- const onCurrentChange = (page) => {
- queryParams.current = page;
- };
- const onSizeChange = (data) => {
- };
- // 格式化时间
- const formatTime = (timestamp: number) => {
- const date = new Date(timestamp)
- return `${date.getHours().toString().padStart(2, '0')}:${date.getMinutes().toString().padStart(2, '0')}:${date.getSeconds().toString().padStart(2, '0')}`
- }
- // 处理进度消息
- const handleProgressMessage = (data: any) => {
- console.log("detail_progress", data);
- if (data.code === 0 && data.msg_type === 'detail_progress') {
- const messageData = {
- goods_no: data.data.goods_no,
- temp_name: data.data.temp_name,
- status: data.data.status,
- goods_art_nos: data.data.goods_art_nos,
- msg: data.msg,
- timestamp: Date.now()
- }
- progressMessages.value.push(messageData)
- // 更新当前显示的消息
- message.value = `货号${data.data.goods_art_nos.join(', ')}:${data.msg}`
- scrollMessageListToBottom()
- }
- }
- // 处理抠图进度消息
- const handleSegmentProgressMessage = (data: any) => {
- console.log("segment_progress", data);
- if (data.code === 0 && data.msg_type === 'segment_progress') {
- const messageData = {
- goods_no: '',
- temp_name: '',
- status: data.data.status,
- goods_art_nos: data.data.goods_art_nos,
- msg: data.msg,
- timestamp: Date.now()
- }
- progressMessages.value.push(messageData)
- // 更新当前显示的消息
- message.value = `货号${data.data.goods_art_nos.join(', ')}:${data.msg}`
- scrollMessageListToBottom()
- }
- }
- // 处理上脚图进度
- const handleUpperFooterProgressMessage = (data: any) => {
- console.log("upper_footer_progress", data);
- if (data.code === 0 && data.msg_type === 'upper_footer_progress') {
- const messageData = {
- goods_no: '',
- temp_name: '',
- status: data.data?.status || '',
- goods_art_nos: data.data?.goods_art_nos || [],
- msg: data.msg,
- timestamp: Date.now()
- }
- progressMessages.value.push(messageData)
- message.value = `货号${(data.data?.goods_art_nos || []).join(', ')}:${data.msg}`
- scrollMessageListToBottom()
- }
- }
- // 处理场景图进度
- const handleSceneProgressMessage = (data: any) => {
- console.log("scene_progress", data);
- if (data.code === 0 && data.msg_type === 'scene_progress') {
- const messageData = {
- goods_no: '',
- temp_name: '',
- status: data.data?.status || '',
- goods_art_nos: data.data?.goods_art_nos || [],
- msg: data.msg,
- timestamp: Date.now()
- }
- progressMessages.value.push(messageData)
- message.value = `货号${(data.data?.goods_art_nos || []).join(', ')}:${data.msg}`
- scrollMessageListToBottom()
- }
- }
- // 处理商品上传进度
- const handleUploadGoodsProgressMessage = (data: any) => {
- console.log("upload_goods_progress", data);
- if (data.code === 0 && data.msg_type === 'upload_goods_progress') {
- const messageData = {
- goods_no: '',
- temp_name: '',
- status: data.data?.status || '',
- goods_art_nos: data.data?.goods_art_nos || [],
- msg: data.msg,
- timestamp: Date.now()
- }
- progressMessages.value.push(messageData)
- message.value = `货号${(data.data?.goods_art_nos || []).join(', ')}:${data.msg}`
- scrollMessageListToBottom()
- }
- }
- // 打开输出目录:appConfig.appPath + '/build/extraResources/py/output'
- const openOutputDir = () => {
- try {
- const pyPath = useConfigInfoStore?.appConfig?.pyPath || ''
- if (!pyPath) {
- ElMessage.error('未获取到应用目录 appPath')
- return
- }
- console.log(pyPath);
- const fullPath = `${pyPath}\\output`
- console.log(fullPath);
- clientStore.ipc.removeAllListeners(icpList.utils.shellFun);
- clientStore.ipc.send(icpList.utils.shellFun, {
- action: 'openPath',
- params: fullPath.replace(/\//g, '\\')
- });
- } catch (e) {
- console.error(e)
- ElMessage.error('打开目录失败')
- }
- }
- // 检测参数是否有效
- const checkParams = async function () {
- const useConfigInfoStore = configInfo();
- const tokenInfoStore = tokenInfo();
- const token = tokenInfoStore.getToken;
- let temp_list = []
- templates.value.map(item => {
- temp_list.push({
- template_id: item.template_id,
- template_local_classes: item.template_local_classes,
- })
- })
- // 根据选择的服务内容设置参数
- const isDetail = form.services.includes('is_detail') ? 1 : 0
- const isProductScene = form.services.includes('is_product_scene') ? 1 : 0
- const isUpperFooter = form.services.includes('is_upper_footer') ? 1 : 0
- const params = {
- goods_art_no: JSON.parse(JSON.stringify(goods_art_nos.value)),
- logo_path: form.logo_path || '',
- temp_name: form.selectTemplate?.template_id || '',
- excel_path: form.dataType == '1' ? form.excel_path : '',
- template_image_order: form.selectTemplate?.template_image_order,
- temp_list,
- token,
- uuid: uuidStore.getUuid || '',
- // 新增服务参数 - 合并国内和国外平台
- online_stores: [...(domesticPlatforms.value || []), ...(foreignPlatforms.value || [])],
- is_detail: isDetail,
- is_product_scene: isProductScene,
- is_upper_footer: isUpperFooter,
- upper_footer_params: selectedModels.value ? {
- man_id: selectedModels.value.male?.id || "",
- women_id: selectedModels.value.female?.id || ""
- } : {},
- product_scene_prompt: scenePrompt.value || '',
- is_check: 1 // 仅检测,不生成
- }
- try {
- // 直接调用API进行检测,因为检测模式会直接返回结果
- const response = await clientStore.ipc.invoke(icpList.generate.generatePhotoDetail, params);
- console.log('=======checkParamscheckParamscheckParamscheckParams===========');
- console.log(params);
- console.log(response);
- if (response.code === 0) {
- return response;
- } else {
- throw new Error(response.msg || '检测失败');
- }
- } catch (error) {
- throw new Error(error.message || '检测失败');
- }
- }
- // 开始生成操作
- const generate = async function () {
- if(form.services.length == 0){
- ElMessage.error('请选择服务内容')
- return
- }
- // 埋点:开始生成详情页
- clickLog({
- describe: {
- action: '点击开始生成详情页',
- services: form.services,
- dataType: form.dataType,
- template_name: form.selectTemplate?.template_name,
- goods_count: goods_art_nos.value.length,
- goods_art_nos: goods_art_nos.value
- }
- }, route);
- // 必填验证
- if (form.services.includes('is_upper_footer') && !( selectedModels.value && selectedModels.value.male?.id && selectedModels.value.female?.id)) {
- openModelDialog();
- setTimeout(()=>{
- ElMessage.error('请选择模特')
- },200)
- return
- }
- if (form.services.includes('is_product_scene') && !scenePrompt.value) {
- openScenePromptDialog();
- setTimeout(()=>{
- ElMessage.error('请设置场景提示词')
- },200)
- return
- }
- if(form.services.includes('is_detail')){
- if ( form.dataType == '1' && !form.excel_path) {
- ElMessage.error('请上传商品基础资料')
- return
- }
- }
- // 先进行检测
- try {
- // ElMessage.info('正在检测参数,请稍候...');
- await checkParams();
- // ElMessage.success('检测通过,开始生成...');
- } catch (error) {
- ElMessage.error(error.message || '检测失败,请检查参数');
- return;
- }
- const useConfigInfoStore = configInfo();
- console.log(useConfigInfoStore.appConfig);
- const tokenInfoStore = tokenInfo();
- const token = tokenInfoStore.getToken; // 使用 getToken() 获取 token
- let temp_list = []
- templates.value.map(item => {
- temp_list.push({
- template_id: item.template_id,
- template_local_classes: item.template_local_classes,
- })
- })
- // 根据选择的服务内容设置参数
- const isDetail = form.services.includes('is_detail') ? 1 : 0
- const isProductScene = form.services.includes('is_product_scene') ? 1 : 0
- const isUpperFooter = form.services.includes('is_upper_footer') ? 1 : 0
- const params = {
- goods_art_no: JSON.parse(JSON.stringify(goods_art_nos.value)),
- logo_path: form.logo_path || '',
- temp_name: form.selectTemplate?.template_id || '',
- excel_path: form.dataType == '1' ? form.excel_path : '',
- template_image_order: form.selectTemplate?.template_image_order,
- temp_list,
- token,
- uuid: uuidStore.getUuid || '',
- // 新增服务参数 - 合并国内和国外平台
- online_stores: [...(domesticPlatforms.value || []), ...(foreignPlatforms.value || [])],
- is_detail: isDetail,
- is_product_scene: isProductScene,
- is_upper_footer: isUpperFooter,
- upper_footer_params: selectedModels.value ? {
- man_id: selectedModels.value.male?.id || "",
- women_id: selectedModels.value.female?.id || ""
- } : {},
- product_scene_prompt: scenePrompt.value || '',
- is_check: 0 // 正式生成
- }
- console.log(params)
- // 开启进度弹窗
- requesting.value = false
- partErrList.value = []
- message.value = '正在为您处理,请稍后'
- progress.value = 0
- // 清空之前的进度消息
- progressMessages.value = []
- showMessageHistory.value = true
- openLoadingDialog(goods_art_nos.value.length * 10)
- clientStore.ipc.removeAllListeners(icpList.socket.message + '_detail_result_progress');
- clientStore.ipc.send(icpList.generate.generatePhotoDetail, params);
- /*
- * detail_result_progress
- *
- * */
- // 监听进度消息
- clientStore.ipc.removeAllListeners(icpList.socket.message + '_detail_progress');
- clientStore.ipc.on(icpList.socket.message + '_detail_progress', (event, data) => {
- console.log('_detail_progress',data);
- handleProgressMessage(data)
- });
- // 监听抠图进度消息
- clientStore.ipc.removeAllListeners(icpList.socket.message + '_segment_progress');
- clientStore.ipc.on(icpList.socket.message + '_segment_progress', (event, data) => {
- console.log('_segment_progress',data);
- handleSegmentProgressMessage(data)
- });
- // 监听上脚图进度消息
- clientStore.ipc.removeAllListeners(icpList.socket.message + '_upper_footer_progress');
- clientStore.ipc.on(icpList.socket.message + '_upper_footer_progress', (event, data) => {
- console.log('_upper_footer_progress',data);
- handleUpperFooterProgressMessage(data)
- });
- // 监听场景图进度消息
- clientStore.ipc.removeAllListeners(icpList.socket.message + '_scene_progress');
- clientStore.ipc.on(icpList.socket.message + '_scene_progress', (event, data) => {
- console.log('_scene_progress',data);
- handleSceneProgressMessage(data)
- });
- // 监听商品上传进度消息
- clientStore.ipc.removeAllListeners(icpList.socket.message + '_upload_goods_progress');
- clientStore.ipc.on(icpList.socket.message + '_upload_goods_progress', (event, data) => {
- console.log('_upload_goods_progress',data);
- handleUploadGoodsProgressMessage(data)
- });
- clientStore.ipc.on(icpList.socket.message + '_detail_result_progress', (event, result) => {
- if(result.code !== 0 ){
- if(result.msg){
- handleFail(result.msg)
- message.value = 'result.msg'
- }
- progress.value = 0
- loadingDialogVisible.value = false
- return;
- }
- console.log('result', result)
- requesting.value = true
- setTimeout(() => {
- clientStore.ipc.removeAllListeners(icpList.socket.message + '_detail_result_progress');
- clientStore.ipc.removeAllListeners(icpList.socket.message + '_detail_progress');
- clientStore.ipc.removeAllListeners(icpList.socket.message + '_segment_progress');
- clientStore.ipc.removeAllListeners(icpList.socket.message + '_upper_footer_progress');
- clientStore.ipc.removeAllListeners(icpList.socket.message + '_scene_progress');
- clientStore.ipc.removeAllListeners(icpList.socket.message + '_upload_goods_progress');
- }, 100)
- clearInterval(INTERVAL.value)
- if (result.code === 0) {
- const { output_folder, list } = result.data
- const allSuccess = list.every(item => item.success);
- const allFailure = list.every(item => !item.success);
- if (allSuccess) {
- console.log("全部成功")
- handleSuccess(output_folder, '全部生成成功')
- } else if (allFailure) {
- console.log("全部失败");
- handleFailure(list)
- } else {
- console.log("部分成功,部分失败");
- handlePartSuccess(output_folder, list)
- }
- } else {
- console.log('code全部生成失败')
- handleFail(result.msg)
- }
- //生成失败 (接口请求失败)
- function handleFail(errorMsg: string) {
- // loadingDialogVisible.value = false
- // disabledButton.value = false
- if (errorMsg) {
- ElMessage.error(errorMsg)
- }
- // 处理完成后停止监听进度消息
- // clientStore.ipc.removeAllListeners(icpList.socket.message + '_detail_progress');
- // clientStore.ipc.removeAllListeners(icpList.socket.message + '_segment_progress');
- }
- // 全部生成成功
- function handleSuccess(href, loadingMsg) {
- // 埋点:生成完成
- setLogInfo(route, { action: '生成完成', output_folder: href, message: loadingMsg });
- completeDirectory.value = href
- progress.value = 100
- disabledButton.value = false
- message.value = loadingMsg
- handleComplete()
- }
- // 部分成功
- function handlePartSuccess(output_folder: string, partSuccessList) {
- let errorList = []
- partSuccessList.map(item => {
- if (!item.success) {
- errorList.push(item)
- }
- })
- partErrList.value = errorList
- handleSuccess(output_folder, '部分货号生成失败')
- }
- // 全部生成失败
- function handleFailure(partSuccessList) {
- // 埋点:生成失败(携带货号)
- const failedGoods = (partSuccessList || []).map(item => item.goods_art_no).filter(Boolean)
- setLogInfo(route, { action: '生成失败', error_count: partSuccessList.length, goods_art_nos: goods_art_nos.value, failed_goods_art_nos: failedGoods });
- let errorList = []
- partSuccessList.map(item => {
- if (!item.success) {
- errorList.push(item)
- }
- })
- partErrList.value = errorList
- completeDirectory.value = ''
- progress.value = 100
- disabledButton.value = true
- message.value = '全部货号生成失败'
- }
- });
- }
- const openLoadingDialog = (timer: number) => {
- loadingDialogVisible.value = true
- disabledButton.value = true
- // 根据传入的秒数计算每次增加的进度值
- const step = 100 / timer
- INTERVAL.value = setInterval(() => {
- if (progress.value < 50) {
- progress.value = Math.min(progress.value + step, 100)
- } else if (progress.value < 70) {
- progress.value = Math.min(progress.value + step / 2, 100)
- } if (progress.value < 85) {
- progress.value = Math.min(progress.value + step / 5, 100)
- } else if (progress.value < 90) {
- progress.value = Math.min(progress.value + step / 10, 100)
- } else if (progress.value < 95) {
- progress.value = Math.min(progress.value + step / 50, 100)// 新增中间阶段
- } else {
- progress.value = Math.min(progress.value + step / 100, 100)
- }
- }, 1000)
- }
- //logo
- const logoList = ref([])
- const onInput = (value) => {
- addLogo(value)
- }
- const onRemove = (index) => {
- if(logoList.value[index] === form.logo_path){
- form.logo_path = ''
- }
- clientStore.ipc.send(icpList.generate.deleteLogo,{
- path:logoList.value[index]
- });
- logoList.value.splice(index, 1)
- clientStore.ipc.on(icpList.generate.deleteLogo, async (event, result) => {
- console.log('deleteLogo');
- console.log(result);
- clientStore.ipc.removeAllListeners(icpList.generate.deleteLogo);
- })
- }
- const getLogolist = async () => {
- clientStore.ipc.send(icpList.generate.getLogoList);
- clientStore.ipc.on(icpList.generate.getLogoList, async (event, result) => {
- logoList.value = result.data || []
- console.log('getLogoList')
- console.log(result.data)
- if(logoList.value.length && !form.logo_path){
- form.logo_path = logoList.value[0]
- // 保存默认LOGO到缓存
- saveLogoToCache(form.logo_path)
- }
- clientStore.ipc.removeAllListeners(icpList.generate.getLogoList);
- })
- }
- const addLogo = async (path) => {
- console.log(path);
- clientStore.ipc.send(icpList.generate.addLogo,{
- logo_path:path
- });
- clientStore.ipc.on(icpList.generate.addLogo, async (event, result) => {
- console.log(result);
- if (result.code === 0) {
- console.log("添加成功")
- console.log(result)
- if(result.data.logo){
- form.logo_path = result.data.logo
- // 保存新添加的LOGO到缓存
- saveLogoToCache(form.logo_path)
- if(logoList.value.indexOf(result.data.logo) <0){
- logoList.value.push(result.data.logo)
- }
- }
- }
- clientStore.ipc.removeAllListeners(icpList.generate.addLogo);
- })
- }
- function selectExcel() {
- clientStore.ipc.removeAllListeners(icpList.utils.openFile);
- clientStore.ipc.send(icpList.utils.openFile, {
- filters: [
- { name: '支持xls,xlsx', extensions: ['xlsx', 'xls'] }
- ],
- title: "选择基础文件资料"
- });
- clientStore.ipc.on(icpList.utils.openFile, async (event, result) => {
- form.excel_path = result
- clientStore.ipc.removeAllListeners(icpList.utils.openFile);
- })
- }
- const Router = useRouter()
- //打开主图详情
- function openPhotographySeniorDetail() {
- const { href } = Router.resolve({
- name: 'PhotographySeniorDetail'
- })
- clientStore.ipc.removeAllListeners(icpList.utils.openMain);
- let params = {
- title: '详情高级配置',
- width: 1000,
- height: 630,
- frame: true,
- id: "PhotographySeniorDetail",
- url: getRouterUrl(href)
- }
- clientStore.ipc.send(icpList.utils.openMain, params);
- }
- const handleComplete = () => {
- // loadingDialogVisible.value = false
- // 这里可以添加打开目录的逻辑
- if(!completeDirectory.value){
- openOutputDir()
- return
- }
- clientStore.ipc.removeAllListeners(icpList.utils.shellFun);
- let params = {
- action: 'openPath',
- params: completeDirectory.value?.replace(/\//g, '\\')
- }
- clientStore.ipc.send(icpList.utils.shellFun, params);
- }
- const selectFolder = () => {
- clientStore.ipc.removeAllListeners(icpList.utils.openDirectory);
- clientStore.ipc.send(icpList.utils.openDirectory);
- clientStore.ipc.on(icpList.utils.openDirectory, async (event, result) => {
- folderPath.value = result
- clientStore.ipc.removeAllListeners(icpList.utils.openDirectory);
- })
- }
- </script>
- <style lang="scss" scoped>
- .detail-container {
- background-color: #EAECED;
- width: 100%;
- min-width: 600px;
- padding: 20px;
- overflow: hidden;
- min-height: calc(100vh - 30px);
- }
- .service-section {
- margin-bottom: 20px;
- .service-cards {
- display: flex;
- gap: 60px;
- margin-top: 16px;
- }
- .service-card {
- width: 240px;
- height: 140px;
- border-radius: 8px;
- background: #fff;
- border: 1px solid #e0e0e0;
- display: flex;
- align-items: flex-start;
- padding: 12px;
- cursor: pointer;
- transition: all 0.3s ease;
- position: relative;
- &:hover {
- border-color: #2957FF;
- box-shadow: 0 2px 8px rgba(41, 87, 255, 0.1);
- }
- &.active {
- border: 3px solid #2957FF;
- background: #f8f9ff;
- box-shadow: 0 4px 12px rgba(41, 87, 255, 0.25);
- }
- .service-checkbox {
- position: absolute;
- left: -40px;
- top: 10px;
- width: 30px;
- transform: scale(1.5);
- z-index: 10;
- ::v-deep{
- .el-checkbox {
- display: block;
- margin-right: 0;
- }
- .el-checkbox__input {
- cursor: pointer;
- }
- }
- }
- .service-content {
- flex: 1;
- display: flex;
- flex-direction: column;
- align-items: center;
- position: absolute;
- left: 0;
- top: 0;
- right: 0;
- bottom: 0;;
- }
- .service-image {
- position: absolute;
- width: 100%;
- height: 100%;
- img {
- width: 100%;
- height: 100%;
- object-fit: cover;
- border-radius: 4px;
- }
- .service-icon {
- position: absolute;
- top: 10px;
- right: 10px;
- width: 30px;
- height: 30px;
- background: #2957FF;
- border-radius: 50%;
- display: flex;
- align-items: center;
- justify-content: center;
- color: white;
- font-size: 18px;
- }
- }
- .service-name {
- font-size: 14px;
- font-weight: 500;
- text-align: center;
- position: absolute;
- background: rgba(0,0,0,.5);
- height: 30px;
- line-height: 30px;
- color: #fff;
- left: 0;
- right: 0;
- bottom:0px
- }
- }
- }
- .logo-section,
- .template-section,
- .data-prep-section {
- margin-bottom: 20px;
- }
- .logo-template-row {
- display: flex;
- gap: 24px;
- align-items: flex-start;
- .logo-col { flex: 2; min-width: 300px; }
- .template-col { flex: 3; }
- }
- .logo-section {
- .upload-item {
- border: 2px solid rgba(0,0,0,0);
- }
- .active {
- border: 2px solid #2957FF;
- border-radius: 6px;
- overflow: hidden;;
- }
- &.multi-line {
- flex-direction: row; // 默认横向排列
- flex-wrap: wrap; // 允许换行
- align-items: flex-start; // 对齐方式调整为顶部对齐
- .upload-item {
- margin-bottom: 10px; // 每行之间增加间距
- width: 90px; // 每行显示 4 个元素,减去外边距
- box-sizing: border-box; // 确保宽度计算包含 padding 和 border
- }
- }
- }
- .logo-upload {
- border: 1px dashed #ccc;
- border-radius: 5px;
- padding: 50px 0;
- text-align: center;
- cursor: pointer;
- }
- .template-pagination button {
- margin-right: 5px;
- }
- .template-pagination span {
- display: inline-block;
- width: 20px;
- height: 20px;
- line-height: 20px;
- text-align: center;
- border: 1px solid #ccc;
- border-radius: 5px;
- margin-right: 5px;
- cursor: pointer;
- }
- .template-list {
- display: flex;
- flex-wrap: wrap;
- gap: 20px;
- margin-top: 10px;
- .template-item {
- width: calc(25% - 18px);
- border: 1px solid #ccc;
- border-radius: 10px;
- cursor: pointer;
- background: #f0f0f0;
- position: relative;
- overflow: hidden;
- .template-info {
- position: absolute;
- bottom: 0;
- left: 0;
- background: rgba($color: #000000, $alpha: .3);
- width: 100%;
- height: 36px;
- line-height: 36px;
- color: #eee;
- display: flex;
- align-items: center;
- justify-content: space-between;
- .template-view {
- background: #DFE2E3;
- color: #3366FF;
- height: 30px;
- line-height: 30px;
- padding: 0 10px;
- border-radius: 4px;
- margin-right: 10px;
- font-size: 14px;
- }
- }
- }
- }
- .publish-section {
- .label {
- min-width: 120px;
- margin-right: 12px;
- }
- }
- .excel-upload {
- width: 100%;
- background: #F7F7F7;
- padding: 20px 0;
- }
- .generate-button {
- padding: 10px 20px;
- color: white;
- border: none;
- border-radius: 5px;
- cursor: pointer;
- }
- .select-button {
- background: #DFE2E3 !important;
- color: #3366FF !important;
- height: 30px;
- line-height: 30px;
- padding: 0 10px;
- border-radius: 4px;
- margin-right: 10px;
- font-size: 14px;
- font-weight: 550;
- }
- .select-warp {
- width: 18px;
- height: 18px;
- border-radius: 4px;
- background-color: #fff;
- position: absolute;
- top: 10px;
- left: 10px;
- &.active {
- background-color: #1677FF;
- }
- }
- .section-title {
- display: flex;
- align-items: center;
- gap: 8px;
- font-weight: bold;
- margin-bottom: 16px;
- color: #474747;
- }
- .section {
- margin-bottom: 24px;
- .section-title {
- display: flex;
- align-items: center;
- gap: 8px;
- font-weight: bold;
- margin-bottom: 16px;
- color: #474747;
- }
- .section-content {
- padding-left: 16px;
- }
- }
- .instruction-out {
- background: #EAF3FF;
- border-radius: 4px;
- border: 1px solid #CBE1FF;
- padding: 10px 20px;
- width: 80%;
- position: relative;
- .instruction-list {
- margin: 0px 0 0 10px;
- padding-left: 20px;
- padding-right: 40px;
- width: 100%;
- li {
- margin-bottom: 4px;
- text-align: left;
- font-size: 14px;
- }
- }
- .close-icon {
- position: absolute;
- top: 12px;
- right: 19px;
- }
- }
- .form-item {
- margin: 16px 0;
- display: flex;
- .label {
- min-width: 120px;
- margin-right: 12px;
- }
- .folder-warp {
- width: 100%;
- display: flex;
- flex-direction: column;
- .folder-input {
- flex: 1;
- display: flex;
- align-items: center;
- .check-button {
- background: #DFE2E3;
- border-radius: 6px;
- padding: 6px 12px;
- color: #2957FF;
- margin-left: 20px;
- }
- }
- }
- .hint {
- text-align: left;
- color: #999;
- margin-top: 6px;
- font-size: 14px;
- color: #FF4C00;
- font-style: normal;
- }
- .specific-page-input {
- flex: 1;
- }
- }
- .image-order {
- flex: 1;
- display: flex;
- justify-content: space-between;
- align-items: center;
- }
- .footer {
- display: flex;
- justify-content: center;
- margin-top: 24px;
- .footer-button {
- padding: 10px 20px;
- }
- }
- .explain-btn {
- padding-left: 20px;
- padding-right: 20px;
- color: #2957FF !important;
- }
- .progress-messages {
- margin-top: 20px;
- border-top: 1px solid #e4e7ed;
- padding-top: 20px;
- width: 100%;
- .message-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 15px;
- font-weight: 500;
- color: #606266;
- }
- .message-list {
- max-height: 200px;
- overflow-y: auto;
- border: 1px solid #e4e7ed;
- border-radius: 4px;
- padding: 10px;
- background: #fafafa;
- .message-item {
- margin-bottom: 12px;
- padding-bottom: 12px;
- border-bottom: 1px solid #f0f0f0;
- &:last-child {
- margin-bottom: 0;
- padding-bottom: 0;
- border-bottom: none;
- }
- .message-time {
- font-size: 12px;
- color: #909399;
- margin-bottom: 4px;
- }
- .message-content {
- font-size: 14px;
- line-height: 1.4;
- .goods-no {
- color: #2957FF;
- font-weight: 500;
- }
- .message-text {
- color: #606266;
- }
- }
- }
- }
- }
- </style>
|