| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315 |
- <template>
- <BlueHeaderBar />
- <div class="bg-F5F6F7 detail-page">
- <div class="page—wrap max-w-full">
- <!-- 服务标签页 -->
- <div class="service-tabs">
- <div
- class="service-tab"
- :class="{
- 'active': form.services.includes('is_product_scene'),
- 'disabled': false
- }"
- @click="toggleService('is_product_scene')"
- v-log="{ describe: { action: '点击服务标签', service: '场景图生成' } }"
- >
- <el-checkbox
- :model-value="form.services.includes('is_product_scene')"
- @change="toggleService('is_product_scene')"
- @click.stop
- class="tab-checkbox"
- />
- <div class="tab-content">
- <div class="tab-img flex">
- <img v-if="form.services.includes('is_product_scene')" src="@/assets/images/detail/cjt_h.svg" alt="场景图生成" class="tab-icon" />
- <img v-else src="@/assets/images/detail/cjt.svg" alt="场景图生成" class="tab-icon" />
- </div>
- <span class="tab-name">场景图生成</span>
- </div>
- <div class="tab-edit-btn" @click.stop="openScenePromptDialog" v-log="{ describe: { action: '点击编辑场景图', service: '场景图生成-弹窗' } }">
- <el-icon><EditPen /></el-icon>
- </div>
- </div>
- <div
- class="service-tab"
- :class="{
- 'active': form.services.includes('is_upper_footer'),
- 'disabled': false
- }"
- @click="toggleService('is_upper_footer')"
- v-log="{ describe: { action: '点击服务标签', service: '模特图生成' } }"
- >
- <el-checkbox
- :model-value="form.services.includes('is_upper_footer')"
- @change="toggleService('is_upper_footer')"
- @click.stop
- class="tab-checkbox"
- />
- <div class="tab-content">
- <div class="tab-img flex">
- <img v-if="form.services.includes('is_upper_footer')" src="@/assets/images/detail/mtt_h.svg" alt="模特图生成" class="tab-icon" />
- <img v-else src="@/assets/images/detail/mtt.svg" alt="模特图生成" class="tab-icon" />
- </div>
- <span class="tab-name">模特图生成</span>
- </div>
- <div class="tab-edit-btn" @click.stop="openModelDialog" v-log="{ describe: { action: '点击编辑模特图', service: '模特图生成-弹窗' } }">
- <el-icon><EditPen /></el-icon>
- </div>
- </div>
- <div
- class="service-tab"
- :class="{
- 'active': form.services.includes('is_detail'),
- 'disabled': false
- }"
- @click="toggleService('is_detail')"
- v-log="{ describe: { action: '点击服务标签', service: '详情页生成' } }"
- >
- <el-checkbox
- :model-value="form.services.includes('is_detail')"
- @change="toggleService('is_detail')"
- @click.stop
- class="tab-checkbox"
- />
- <div class="tab-content">
- <div class="tab-img flex">
- <img v-if="form.services.includes('is_detail')" src="@/assets/images/detail/xqy_h.svg" alt="详情页生成" class="tab-icon" />
- <img v-else src="@/assets/images/detail/xqy.svg" alt="详情页生成" class="tab-icon" />
- </div>
- <span class="tab-name">详情页生成</span>
- </div>
- </div>
- <!-- 未开发的功能 -->
- <div class="service-tab " title="新增自定义详情页模板"
- @click="addCustomTemplate"
- v-log="{ describe: { action: '点击新增自定义详情页模板', service: '新增自定义详情页模板' } }"
- >
- <div class="tab-content">
- <div class="tab-img flex">
- <img src="@/assets/images/detail/xqmb.svg" alt="详情页模板自定义" class="tab-icon" />
- </div>
- <span class="tab-name">新增自定义详情页模板</span>
- </div>
- </div>
- <div
- class="service-tab external-tool"
- title="白底图批量导出"
- @click="handleWhiteBgExportClick"
- v-log="{ describe: { action: '点击白底图批量导出', service: '白底图批量导出' } }"
- >
- <div class="tab-content">
- <div class="tab-img flex">
- <img src="@/assets/images/detail/bdt.svg" alt="白底图批量导出" class="tab-icon" />
- </div>
- <span class="tab-name">白底图批量导出</span>
- </div>
- </div>
- <div
- class="service-tab external-tool"
- title="产品图册生成"
- @click="handleProductAlbumClick"
- v-log="{ describe: { action: '点击产品图册生成', service: '产品图册生成' } }"
- >
- <div class="tab-content">
- <div class="tab-img flex">
- <img src="@/assets/images/detail/cptc.svg" alt="产品图册生成" class="tab-icon" />
- </div>
- <span class="tab-name">产品图册生成</span>
- </div>
- </div>
- </div>
- <div class="detail-container">
- <div class="detail-content">
- <!-- 主图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>
- -->
- <!-- <!– 图片抠图与货号图生成 –>
- <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 />-->
- <!-- 左右布局 -->
- <div class="main-layout">
- <!-- 左侧:选择详情模板 -->
- <div class="left-panel">
- <div :class="['template-section', { 'template-section--disabled': !isDetailServiceSelected }]">
- <div class="section-header">
- <div class="section-title">
- 选择详情模版
- </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"
- :class="form.selectTemplate?.id == template.id ? 'active' : ''"
- @click="handleTemplateItemClick(template)"
- v-log="{ describe: { action: '点击选择详情模板', template_name: template.template_name } }"
- >
- <el-image :src="template.template_preview_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"
- v-if="isDetailServiceSelected && template.template_type == 0"
- @click.stop="viewTemplate(template)"
- v-log="{ describe: { action: '点击查看模板详情', template_name: template.template_name } }"
- >
- 查看
- </div>
- <div
- class="template-actions flex"
- v-if="isDetailServiceSelected && template.template_type == 1"
- >
- <div
- class="template-view"
- @click.stop="editTemplate(template)"
- v-log="{ describe: { action: '点击编辑模板详情', template_name: template.template_name } }"
- >
- 编辑
- </div>
- <div
- class="template-view template-view-delete"
- @click.stop="deleteTemplate(template)"
- v-log="{ describe: { action: '点击删除自定义模板', template_name: template.template_name } }"
- >
- 删除
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="template-tips c-333 fs-14 line-20 te-l mar-top-20 flex left" >
- <el-icon><Warning /></el-icon>
- <span class="mar-left-10" v-if="!isDetailServiceSelected">请先选中详情页生成,后在选择模板详情</span>
- <span class="mar-left-10" v-else>该模版需提供{{form.selectTemplate?.template_image_order?.split(',').length || 5}}张标准视角的商品图:{{form.selectTemplate?.template_image_order || '俯视,侧视,后跟,鞋底,内里'}}。请确保图片清晰度高,背景干净。</span>
- </div>
- </div>
- </div>
- <!-- 右侧:LOGO、详情资料准备、一键上架 -->
- <div class="right-panel">
- <!-- 主图LOGO -->
- <div class="right-section">
- <div class="section-title">
- <div class="section-title-line"></div>
- 主图LOGO
- </div>
- <div class="logo-upload-area">
- <div
- v-if="!form.logo_path"
- class="logo-upload-placeholder"
- :class="{ 'is-error': logoLoadError }"
- @click="openLogoUpload"
- >
- <div class="logo-upload-icon">
- <img src="@/assets/images/detail/sctp.png" />
- </div>
- <div class="logo-upload-text">点击或拖拽上传</div>
- <div class="logo-upload-hint" v-if="logoLoadError">LOGO指向的文件不存在或加载失败,请重新上传</div>
- <div class="logo-upload-hint" v-else>支持PNG、JPG格式</div>
- </div>
- <div v-else class="logo-upload-preview">
- <img :src="'file:///' + form.logo_path" alt="LOGO预览" class="logo-preview-image" @error="handleLogoLoadError" />
- <div class="logo-upload-actions">
- <span class="logo-action-btn" @click.stop="previewLogo">
- <el-icon><ZoomIn /></el-icon>
- </span>
- <span class="logo-action-btn" @click.stop="removeLogo">
- <el-icon><Delete /></el-icon>
- </span>
- </div>
- <div class="logo-upload-footer">
- <el-button type="primary" link @click.stop="openLogoUpload">重新上传</el-button>
- <el-button type="danger" link @click.stop="removeLogo">删除</el-button>
- </div>
- </div>
- </div>
- </div>
- <!-- 详情资料准备 -->
- <div class="right-section data-prep-section">
- <div class="section-title">
- <div class="section-title-line"></div>
- 详情资料准备
- </div>
- <div class="data-prep-content">
- <el-radio-group v-model="form.dataType" class="data-type-radio">
- <el-radio-button label="1" size="large">
- <img v-if="form.dataType == 1" src="@/assets/images/detail/excel_h.png" />
- <img v-else src="@/assets/images/detail/excel.png" />
- Excel上传</el-radio-button>
- <el-radio-button label="2" size="large">
- <img v-if="form.dataType == 2" src="@/assets/images/detail/xtdj_h.png" />
- <img v-else src="@/assets/images/detail/xtdj.png" />
- 系统对接</el-radio-button>
- </el-radio-group>
- <div v-if="form.dataType == '1'" class="excel-upload-section">
- <div
- v-if="!form.excel_path"
- class="excel-upload-area"
- @click="selectExcel"
- v-log="{ describe: { action: '点击选择Excel文件' } }"
- >
- <div class="excel-icon">
- <img src="@/assets/images/detail/file-excel.png" class="tab-icon" />
- </div>
- <div class="excel-upload-text">点击选择文件</div>
- </div>
- <div v-else class="excel-selected-info">
- <div class="excel-file-info">
- <div class="excel-icon">
- <img src="@/assets/images/detail/file-excel.png" class="tab-icon" />
- </div>
- <div class="excel-file-text">
- <div class="excel-file-label">已选择文件</div>
- <div class="excel-file-name" :title="excelFileName">{{ excelFileName }}</div>
- </div>
- </div>
- <el-button
- type="primary"
- link
- class="reupload-btn"
- @click="selectExcel"
- v-log="{ describe: { action: '重新上传Excel文件' } }"
- >
- 重新上传
- </el-button>
- </div>
- <el-button
- type="text"
- class="download-link"
- @click="downloadExcel"
- v-log="{ describe: { action: '点击下载Excel模板' } }"
- >
- 下载商品基础资料模版
- </el-button>
- </div>
- </div>
- </div>
- <!-- 一键上架平台 -->
- <div
- class="right-section publish-section"
- :class="{ 'publish-section--disabled': !canUsePublishSection }"
- v-if="onlineStoreTempList.length || onlineStoreTempListForeign.length"
- >
- <div class="section-title">
- <div class="section-title-line"></div>
- 一键上架平台
- </div>
- <div class="publish-content">
- <div class="publish-form-item" v-if="onlineStoreTempList.length">
- <div class="publish-label">国内电商平台:</div>
- <el-select
- v-model="domesticPlatforms"
- multiple
- placeholder="请选择"
- class="publish-select"
- :disabled="!canUsePublishSection"
- >
- <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="publish-form-item" v-if="onlineStoreTempListForeign.length">
- <div class="publish-label">跨境电商平台:</div>
- <el-select
- v-model="foreignPlatforms"
- multiple
- placeholder="请选择"
- class="publish-select"
- :disabled="!canUsePublishSection"
- >
- <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 class="footer">
- <el-button
- v-loading="requesting"
- class="button--primary1 footer-button"
- type="primary"
- @click="generate"
- v-log="{ describe: { action: '点击开始生成详情页' } }"
- >
- <img src="@/assets/images/processImage.vue/sc.png" />
- 开始生成
- <img src="@/assets/images/processImage.vue/go.png" class="go"/>
- </el-button>
- </div>
- </div>
- </div>
- <!-- 详情高级配置 -->
- <!-- <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>
- </div>
- </div>
- </div>
- <loading-dialog v-if="loadingDialogVisible" v-model="loadingDialogVisible" :requesting="requesting" :progress="progress" :message="message"
- :disabled-button="disabledButton" :use-new-progress="useNewProgress" :progress-steps="progressSteps" @button-click="handleComplete" :on-open-folder="openOutputDir">
- <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" v-if="msg">
- <span class="goods-no" v-if="msg.goods_art_nos && msg.goods_art_nos.length > 0">货号{{ 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>
- <!-- LOGO预览弹窗 -->
- <el-dialog v-model="logoPreviewVisible" title="LOGO预览">
- <img style="width: 100%;" :src="logoPreviewUrl" alt="LOGO Preview" />
- </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"
- />
- <!-- 货号选择弹窗 -->
- <el-dialog
- v-model="goodsSelectDialogVisible"
- title="请选择一个货号作为自定义商品的模板"
- width="60%"
- :close-on-click-modal="false"
- :close-on-press-escape="false"
- custom-class="goods-select-dialog"
- >
- <div class="goods-select-content">
- <el-radio-group v-model="selectedGoodsArtNo" class="goods-radio-group">
- <div
- v-for="item in filteredGoodsList"
- :key="item.goods_art_no"
- class="goods-item"
- :class="{ 'selected': selectedGoodsArtNo === item.goods_art_no }"
- @click="selectedGoodsArtNo = item.goods_art_no"
- >
-
- <div class="goods-item-header">
- <div class="goods-item-left">
- <el-radio
- :label="item.goods_art_no"
- class="goods-radio"
- @click.stop
- > </el-radio>
-
- </div>
- </div>
- <div class="goods-item-images">
- <div
- v-for="(image, index) in item.items"
- :key="image.action_id || image.action_name"
- class="goods-item_image"
- >
- <span class="tag" v-if="!image.PhotoRecord?.image_path">{{ image.action_name }}</span>
- <el-image
- v-if="image.PhotoRecord?.image_path"
- :src="getFilePath(image.PhotoRecord.image_path)"
- :preview-src-list="getPreviewImageList(item)"
- :initial-index="getPreviewIndex(item, index)"
- class="preview-image"
- fit="contain"
- :preview-teleported="true"
- lazy
- >
- <template #error>
- <div class="image-slot">
- <span class="tag">{{ image.action_name }}</span>
- </div>
- </template>
- </el-image>
- <div v-else class="image-placeholder">
- <span class="tag">{{ image.action_name }}</span>
- </div>
- </div>
- </div>
-
- </div>
- </el-radio-group>
- </div>
- <template #footer>
- <div class="dialog-footer">
- <el-button @click="cancelGoodsSelection">取消</el-button>
- <el-button
- type="primary"
- :loading="goodsGenerateLoading"
- :disabled="goodsGenerateLoading"
- @click="confirmGoodsSelection"
- >
- {{ goodsGenerateLoading ? '正在生成自定义商品模版' : '确定' }}
- </el-button>
- </div>
- </template>
- </el-dialog>
- </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 BlueHeaderBar from '@/components/header-bar/blue-header.vue'
- import { ref, computed, reactive, onMounted, onBeforeUnmount, nextTick, watch } from 'vue';
- import { Select, EditPen, ZoomIn, Delete, Picture, Document } from '@element-plus/icons-vue'
- // import upload from '@/components/upload' // 不再需要,改为单LOGO上传
- 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";
- import { deleteCustomerTemplate } from '@/apis/other'
- const useConfigInfoStore = configInfo();
- const EXTERNAL_TOOL_EXECUTABLE = '智慧映拍照机辅助工具箱.exe'
- import usePhotography from './mixin/usePhotography'
- const {
- loading,
- goodsList,
- getPhotoRecords,
- getTime,
- getFilePath,
- } = usePhotography()
- const launchExternalTool = async (pagePath: string, successMessage: string) => {
- if (!clientStore?.ipc || !clientStore.isClient) {
- ElMessage.error('当前环境暂不支持外部工具');
- return;
- }
- if (!pagePath) return;
- const tokenStore = tokenInfo();
- const token = tokenStore?.getToken || '';
- const env = (useConfigInfoStore?.appConfig as any)?.env || 'prod';
- const argString = `token=${token}&page=${pagePath}&env=${env}`;
- try {
- const result = await clientStore.ipc.invoke(icpList.utils.runExternalTool, {
- exeName: EXTERNAL_TOOL_EXECUTABLE,
- args: [argString]
- });
- if (result?.code === 0) {
- ElMessage.success(successMessage);
- } else {
- throw new Error(result?.msg || '启动外部工具失败');
- }
- } catch (error: any) {
- console.error('launchExternalTool error:', error);
- ElMessage.error(error?.message || '打开外部工具失败');
- }
- }
- const handleWhiteBgExportClick = () => launchExternalTool('/copy_800_tool', '白底图批量导出工具已启动')
- const handleProductAlbumClick = () => launchExternalTool('/product_list', '产品图册生成工具已启动')
- // 货号选择弹窗相关状态
- const goodsSelectDialogVisible = ref(false)
- const filteredGoodsList = ref<any[]>([])
- const selectedGoodsArtNo = ref<string>('')
- const goodsGenerateLoading = ref(false)
- const addCustomTemplate = async() => {
- // 调用获取数据
- getPhotoRecords()
-
- // 处理数据的函数
- const processData = () => {
- // 从 goodsList 中筛选出 goods_art_no 在 goods_art_nos.value 中的对象
- const filteredGoods = goodsList.value.filter((item: any) =>
- goods_art_nos.value.includes(item.goods_art_no)
- )
- console.log('goods_art_nos', goods_art_nos.value)
- console.log('filteredGoods', filteredGoods)
- if (filteredGoods.length > 0) {
- // 若有匹配项,则只展示匹配到的货号
- filteredGoodsList.value = filteredGoods
- selectedGoodsArtNo.value = filteredGoods[0].goods_art_no
- goodsSelectDialogVisible.value = true
- } else if (goodsList.value.length > 0) {
- // 若没有匹配到货号,则展示全部货号列表
- filteredGoodsList.value = goodsList.value
- selectedGoodsArtNo.value = goodsList.value[0].goods_art_no
- goodsSelectDialogVisible.value = true
- } else {
- // 列表本身为空时再提示
- ElMessage.warning('未找到匹配的货号数据')
- }
- }
-
- // 使用 watch 监听 loading 状态,当从 true 变为 false 时,说明数据加载完成
- const stopWatcher = watch(
- () => loading.value,
- (isLoading, wasLoading) => {
- // 当 loading 从 true 变为 false 时,说明数据已经加载完成
- if (wasLoading && !isLoading) {
- processData()
- // 停止监听,避免重复执行
- stopWatcher()
- }
- }
- )
-
- // 如果当前 loading 已经是 false,可能数据已经存在或加载很快完成
- // 使用 nextTick 等待一个 tick,如果 loading 仍然是 false,直接处理
- if (!loading.value) {
- await nextTick()
- // 如果 loading 仍然是 false,可能数据已经存在,直接处理
- if (!loading.value) {
- processData()
- stopWatcher() // 停止监听
- }
- }
- }
- // 根据选中的货号调用后端生成商品模板
- const generateGoodsTemplate = (goodsArtNo: string) => {
- return new Promise<void>((resolve, reject) => {
- try {
- console.log('调用 get_goods_image_json, goods_art_no:', goodsArtNo)
- // 按后端要求带上 token(参考其他生成类接口)
- const tokenStore = tokenInfo();
- const token = (tokenStore as any)?.getToken || '';
- // 先清理监听,避免重复回调
- clientStore.ipc.removeAllListeners(icpList.generate.getGoodsImageJson)
- clientStore.ipc.send(icpList.generate.getGoodsImageJson, {
- goods_art_no: goodsArtNo,
- token,
- })
- clientStore.ipc.on(icpList.generate.getGoodsImageJson, (event, result) => {
- clientStore.ipc.removeAllListeners(icpList.generate.getGoodsImageJson)
- console.log('get_goods_image_json result:', result)
- if (result && result.code === 0) {
- resolve(result.data)
- } else {
- const msg = result?.msg || '商品模板生成失败'
- ElMessage.error(msg)
- reject(new Error(msg))
- }
- })
- } catch (error: any) {
- ElMessage.error(error?.message || '商品模板生成异常')
- reject(error)
- }
- })
- }
- // 确认选择货号
- const confirmGoodsSelection = async () => {
- if (!selectedGoodsArtNo.value) {
- ElMessage.warning('请选择一个货号')
- return
- }
- console.log('选中的货号:', selectedGoodsArtNo.value)
- goodsGenerateLoading.value = true
- try {
- const data = await generateGoodsTemplate(selectedGoodsArtNo.value)
- console.log('商品模版数据', data)
- // 组装 goods_images 数组:[{ key: 模板顺序项, value: 对应图片地址 }, ...]
- const goodsImages: Array<{ key: string; value: string }> = []
- const orderArr = (data?.template_image_order || '')
- .split(',')
- .map((s: string) => s.trim())
- .filter((s: string) => s)
- const imagesArr = Array.isArray(data?.customer_template_images)
- ? data.customer_template_images
- : []
- const len = Math.min(orderArr.length, imagesArr.length)
- for (let i = 0; i < len; i++) {
- goodsImages.push({
- key: orderArr[i],
- value: imagesArr[i],
- })
- }
- // 生成商品模板成功后,跳转到新增模板页,并携带当前选中的货号
- router.push({
- name: 'addTpl',
- query: {
- // 统一用 JSON 字符串传递图片与顺序信息
- customer_template_images: encodeURIComponent(JSON.stringify(goodsImages)),
- template_image_order: data?.template_image_order || '',
- },
- })
- } finally {
- // 无论成功或失败,都关闭弹窗,保留当前选择
- goodsSelectDialogVisible.value = false
- goodsGenerateLoading.value = false
- }
- }
- // 取消选择
- const cancelGoodsSelection = () => {
- goodsSelectDialogVisible.value = false
- selectedGoodsArtNo.value = ''
- filteredGoodsList.value = []
- }
- // 获取预览图片列表(只包含有图片路径的,保持原始顺序)
- const getPreviewImageList = (item: any) => {
- if (!item || !item.items) return []
- return item.items
- .filter((img: any) => img.PhotoRecord?.image_path)
- .map((img: any) => getFilePath(img.PhotoRecord.image_path))
- }
- // 获取当前图片在预览列表中的索引
- const getPreviewIndex = (item: any, currentIndex: number) => {
- if (!item || !item.items) return 0
- // 计算当前图片在过滤后的预览列表中的索引
- let previewIndex = 0
- for (let i = 0; i <= currentIndex; i++) {
- if (item.items[i]?.PhotoRecord?.image_path) {
- if (i === currentIndex) break
- previewIndex++
- }
- }
- return previewIndex
- }
- 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 useNewProgress = ref(false)
- const progressSteps = ref<Array<{
- msg_type: string
- goods_art_no: string
- name: string
- status: '等待处理' | '正在处理' | '处理完成' | '处理失败'
- current: number
- total: number
- error: number
- }>>([])
- // 删除自定义模板
- const deleteTemplate = async (template: any) => {
- if (!template?.id) return
- try {
- await ElMessageBox.confirm(
- `确定要删除自定义模板「${template.template_name || ''}」吗?`,
- '提示',
- {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning',
- },
- )
- const res = await deleteCustomerTemplate({ id: template.id })
- const data = res?.data
- if (data?.code === 0) {
- ElMessage.success('删除成功')
- // 从当前模板列表中移除
- const idx = templates.value.findIndex((item: any) => item.id === template.id)
- if (idx !== -1) {
- templates.value.splice(idx, 1)
- }
- } else {
- ElMessage.error(data?.msg || '删除失败')
- }
- } catch (e: any) {
- if (e !== 'cancel' && e !== 'close') {
- console.error('删除模板失败:', e)
- ElMessage.error(e?.message || '删除失败')
- }
- }
- }
- // 更新进度步骤
- const updateProgressStep = (msgType: string, stepData: any) => {
- console.log('updateProgressStep called:', msgType, stepData)
- const stepIndex = progressSteps.value.findIndex(step => step.msg_type === msgType)
- if (stepIndex !== -1) {
- // 更新现有步骤 - 使用新数组来确保响应式更新
- const newSteps = [...progressSteps.value]
- newSteps[stepIndex] = {
- ...newSteps[stepIndex],
- name: stepData.name, // 保持原有名称或使用新名称
- goods_art_no: stepData.goods_art_no,
- status: stepData.status,
- current: stepData.current || 0,
- total: stepData.total || 0,
- error: stepData.error || 0,
- folder: newSteps[stepIndex].folder || stepData.folder // 保持已有的folder或使用新的
- }
- progressSteps.value = newSteps
- console.log('Updated step:', newSteps[stepIndex])
- } else {
- // 添加新步骤
- progressSteps.value = [...progressSteps.value, {
- msg_type: msgType,
- name: stepData.name,
- goods_art_no: stepData.goods_art_no,
- status: stepData.status,
- current: stepData.current || 0,
- total: stepData.total || 0,
- error: stepData.error || 0,
- folder: stepData.folder // 添加folder字段
- }]
- console.log('Added new step:', progressSteps.value[progressSteps.value.length - 1])
- }
- }
- // 获取步骤名称
- // 初始化进度步骤 - 从后端数据动态获取
- const initProgressSteps = (backendSteps?: any[]) => {
- if (backendSteps && backendSteps.length > 0) {
- // 使用后端返回的步骤数据
- progressSteps.value = backendSteps.map(step => ({
- msg_type: step.msg_type,
- goods_art_no: step.goods_art_no,
- name: step.name,
- status: '等待处理',
- current: 0,
- total: step.total || 0,
- error: 0
- }))
- } else {
- // 默认步骤(当后端没有返回步骤数据时使用)
- progressSteps.value = []
- }
- }
- // 进度消息队列
- 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 goods_art_nos = computed(() => {
- const goods_art_data = route.query.goods_art_nos
- return Array.isArray(goods_art_data) ? goods_art_data : [goods_art_data]
- })
- // 定义一个定时器变量
- const INTERVAL = ref<number | NodeJS.Timeout | null>(null);
- // 状态变量
- const totalPage = ref(0);
- const itemsPerPage = 3; // 每页显示的模板数量
- 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'], // 勾选服务内容(多选)默认包含详情页生成
- })
- const excelFileName = computed(() => {
- if (!form.excel_path) return ''
- const segments = form.excel_path.split(/[/\\]/)
- return segments[segments.length - 1] || ''
- })
- const templatesLoaded = ref(false)
- const lastSelectedTemplateId = ref<string | number | null>(null)
- const isDetailServiceSelected = computed(() => form.services.includes('is_detail'))
- const hasTemplates = computed(() => templates.value.length > 0)
- const canUsePublishSection = computed(() => isDetailServiceSelected.value && hasTemplates.value)
- 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()
- // 初始化目录打开状态标记
- window.segmentFolderOpened = false;
- window.modelOrSceneFolderOpened = false;
- // 监听子组件发出的打开目录事件
- window.addEventListener('openFolder', handleOpenFolder);
- })
- // 页面卸载时清理监听器
- 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);
- // 移除事件监听器
- window.removeEventListener('openFolder', handleOpenFolder);
- })
- // 计算属性,获取当前页可见的模板
- const visibleTemplates = computed(() => {
- const startIndex = (queryParams.current - 1) * itemsPerPage;
- const data = templates.value.slice(startIndex, startIndex + itemsPerPage);
- return data
- });
- const selectTemplate = (template: any, options: { saveCache?: boolean; ensureVisible?: boolean } = {}) => {
- if (!isDetailServiceSelected.value) return
- if (!template || !template.id) return
- form.selectTemplate = template
- lastSelectedTemplateId.value = template.id
- if (options.ensureVisible) {
- jumpToTemplatePageById(template.id)
- }
- const shouldSaveCache = options.saveCache !== undefined ? options.saveCache : true
- if (shouldSaveCache) {
- try {
- localStorage.setItem(DETAIL_TEMPLATE_CACHE_KEY, JSON.stringify(template))
- console.log('selectTemplate - saved to cache:', template);
- } catch {}
- }
- };
- const handleTemplateItemClick = (template: any) => {
- if (!isDetailServiceSelected.value) return
- selectTemplate(template)
- };
- const clearTemplateSelection = () => {
- form.selectTemplate = {}
- };
- const findTemplateById = (templateId: string | number | null) => {
- if (templateId === null || templateId === undefined) return null
- return templates.value.find(template => String(template.id) === String(templateId)) || null
- };
- const jumpToTemplatePageById = (templateId: string | number | null) => {
- if (templateId === null || templateId === undefined) return
- const index = templates.value.findIndex(template => String(template.id) === String(templateId))
- if (index === -1) return
- const targetPage = Math.floor(index / itemsPerPage) + 1
- if (queryParams.current !== targetPage) {
- queryParams.current = targetPage
- }
- };
- const ensureDefaultTemplateSelection = (options: { ensureVisible?: boolean } = {}) => {
- if (!templatesLoaded.value || !isDetailServiceSelected.value || !templates.value.length) {
- return
- }
- if (form.selectTemplate && (form.selectTemplate as any).id) {
- if (options.ensureVisible) {
- jumpToTemplatePageById((form.selectTemplate as any).id)
- }
- return
- }
- const cachedTemplate = findTemplateById(lastSelectedTemplateId.value)
- const templateToSelect = cachedTemplate || templates.value[0]
- if (templateToSelect) {
- selectTemplate(templateToSelect, {
- ensureVisible: options.ensureVisible,
- saveCache: !cachedTemplate
- })
- }
- };
- watch(isDetailServiceSelected, (selected) => {
- if (selected) {
- ensureDefaultTemplateSelection({ ensureVisible: true })
- } else {
- clearTemplateSelection()
- }
- });
- // 查看模板详情
- const viewTemplate = (template) => {
- // 展示大图
- dialogVisible.value = true
- dialogImageUrl.value = template.template_preview_image
- };
- // 编辑自定义模版
- const editTemplate = (template: any) => {
- if (!template) return
- // 将画布 JSON、名称、商品图片等信息通过 query 传给编辑页
- const customerTemplateJson = template.customer_template_json || []
- const customerTemplateImages = template.customer_template_images || []
- const templateImageOrder = template.template_image_order || ''
- const templateName = template.template_name || ''
- router.push({
- name: 'editTpl',
- params: { id: template.id },
- query: {
- customer_template_json: encodeURIComponent(JSON.stringify(customerTemplateJson)),
- template_name: templateName,
- customer_template_images: encodeURIComponent(JSON.stringify(customerTemplateImages)),
- template_image_order: templateImageOrder,
- },
- })
- };
- // 获取模版列表
- const getCompanyTemplates = async () => {
- const { data } = await getCompanyTemplatesApi()
- console.log('getCompanyTemplatesApi' ,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
- }
- templatesLoaded.value = true
- // 获取模板列表后,尝试从缓存恢复模板选择
- loadTemplateFromCache()
- 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_1_KEY = 'detail_logo_cache_1'
- const DETAIL_DATA_TYPE_CACHE_KEY = 'detail_data_type_cache'
- const DETAIL_SERVICES_CACHE_KEY = 'detail_services_cache'
- const DETAIL_TEMPLATE_CACHE_KEY = 'detail_template_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_1_KEY)
- if (logo) {
- form.logo_path = logo || ''
- console.log(form.logo_path);
- 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 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 {
- localStorage.setItem(detail_logo_cache_1_KEY, 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 loadTemplateFromCache = () => {
- lastSelectedTemplateId.value = null
- try {
- const template = localStorage.getItem(DETAIL_TEMPLATE_CACHE_KEY)
- if (template) {
- const parsed = JSON.parse(template)
- if (parsed && parsed.id) {
- lastSelectedTemplateId.value = parsed.id
- console.log('loadTemplateFromCache - template id:', parsed.id);
- }
- }
- } catch (error) {
- console.error('加载模板缓存失败:', error);
- }
- ensureDefaultTemplateSelection({ ensureVisible: true })
- }
- const openModelDialog = () => {
- modelDialogVisible.value = true
- }
- const openScenePromptDialog = () => {
- scenePromptDialogVisible.value = true
- }
- // 选择LOGO
- // selectLogo 函数已移除,现在只支持单个LOGO上传
- 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 ? `货号${data.data.goods_art_nos.join(', ')}:${data.msg}` : `${data.msg}`
- scrollMessageListToBottom()
- // 更新新的进度条
- if (data.progress) {
- updateProgressStep('detail_progress', data.progress)
- }
- }
- }
- // 处理抠图进度消息
- 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 ? `货号${data.data.goods_art_nos.join(', ')}:${data.msg}` : `${data.msg}`
- scrollMessageListToBottom()
- // 更新新的进度条
- if (data.progress) {
- if(['处理完成','处理失败'].includes( progressSteps.value[0]?.status)){
- return;
- }
- updateProgressStep('segment_progress', data.progress)
- if(data.progress?.folder && !window.segmentFolderOpened){
- window.segmentFolderOpened = true;
- openOutputDir(data.progress?.folder)
- }
- }
- }
- }
- // 处理上脚图进度
- 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 ? `货号${data.data.goods_art_nos.join(', ')}:${data.msg}` : `${data.msg}`
- scrollMessageListToBottom()
- // 更新新的进度条
- if (data.progress) {
- updateProgressStep('upper_footer_progress', data.progress)
- // 如果是处理完成状态且目录还未打开,则打开目录
- if(data.progress?.folder && !window.modelOrSceneFolderOpened){
- window.modelOrSceneFolderOpened = true;
- openOutputDir(data.progress?.folder)
- }
- }
- }
- }
- // 处理场景图进度
- 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 ? `货号${data.data.goods_art_nos.join(', ')}:${data.msg}` : `${data.msg}`
- scrollMessageListToBottom()
- // 更新新的进度条
- if (data.progress) {
- updateProgressStep('scene_progress', data.progress)
- // 如果是处理完成状态且目录还未打开,则打开目录
- if(data.progress?.folder && !window.modelOrSceneFolderOpened){
- window.modelOrSceneFolderOpened = true;
- openOutputDir(data.progress?.folder)
- }
- }
- }
- }
- // 处理商品上传进度
- 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 ? `货号${data.data.goods_art_nos.join(', ')}:${data.msg}` : `${data.msg}`
- scrollMessageListToBottom()
- // 更新新的进度条
- if (data.progress) {
- updateProgressStep('upload_goods_progress', data.progress)
- }
- }
- }
- // 打开输出目录:appConfig.appPath + '/build/extraResources/py/output'
- const openOutputDir = (path) => {
- try {
- let fullPath = ''
- if(path){
- fullPath = path
- }else{
- const appPath = useConfigInfoStore?.appConfig?.appPath || ''
- if (!appPath) {
- ElMessage.error('未获取到应用目录 appPath')
- return
- }
- fullPath = `${pyPath}\\output`
- }
- 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 (requesting.value) {
- return
- }
- // 重置目录打开状态
- window.segmentFolderOpened = false;
- window.modelOrSceneFolderOpened = false;
- if(form.services.length == 0){
- ElMessage.error('请选择服务内容')
- return
- }
- // 必填验证
- 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') || form.services.includes('is_upper_footer')){
- if ( form.dataType == '1' && !form.excel_path) {
- 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);
- // 先进行检测
- let checkResult;
- try {
- requesting.value = true
- // ElMessage.info('正在检测参数,请稍候...');
- checkResult = await checkParams();
- // ElMessage.success('检测通过,开始生成...');
- } catch (error) {
- ElMessage.error(error.message || '检测失败,请检查参数');
- requesting.value = false
- 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 = true
- partErrList.value = []
- message.value = '正在为您处理,请稍后'
- progress.value = 0
- // 清空之前的进度消息
- progressMessages.value = []
- showMessageHistory.value = true
- // 启用新的进度条并初始化步骤
- useNewProgress.value = true
- // 清空之前的进度步骤
- progressSteps.value = []
- // 从检测结果中获取步骤信息
- const backendSteps = checkResult?.data?.progress || []
- initProgressSteps(backendSteps)
- 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
- requesting.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)
- }
- requesting.value = false // 重置请求状态,允许再次生成
- // 处理完成后停止监听进度消息
- // 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
- requesting.value = false // 重置请求状态,允许再次生成
- // 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 = '全部货号生成失败'
- requesting.value = false // 重置请求状态,允许再次生成
- }
- requesting.value = false
- });
- }
- 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 logoLoadError = ref(false)
- const logoPreviewVisible = ref(false)
- const logoPreviewUrl = ref('')
- // 打开LOGO上传
- const handleLogoSelected = (path?: string) => {
- if (!path) return
- form.logo_path = path
- logoLoadError.value = false
- saveLogoToCache(form.logo_path)
- }
- const openLogoUpload = () => {
- clientStore.ipc.removeAllListeners(icpList.utils.openImage);
- clientStore.ipc.send(icpList.utils.openImage);
- clientStore.ipc.on(icpList.utils.openImage, async (event, result) => {
- if (result && result.filePath) {
- handleLogoSelected(result.filePath)
- }
- clientStore.ipc.removeAllListeners(icpList.utils.openImage);
- })
- }
- // 预览LOGO
- const previewLogo = () => {
- if (form.logo_path) {
- logoPreviewUrl.value = 'file:///' + form.logo_path
- logoPreviewVisible.value = true
- }
- }
- // 删除LOGO
- const removeLogo = () => {
- if (form.logo_path) {
- saveLogoToCache('')
- form.logo_path = ''
- /* const currentLogoPath = form.logo_path
- clientStore.ipc.send(icpList.generate.deleteLogo, {
- path: currentLogoPath
- });
- clientStore.ipc.on(icpList.generate.deleteLogo, async (event, result) => {
- console.log('deleteLogo', result);
- form.logo_path = ''
- saveLogoToCache('')
- logoLoadError.value = false
- // 从列表中移除
- const index = logoList.value.indexOf(currentLogoPath)
- if (index > -1) {
- logoList.value.splice(index, 1)
- }
- clientStore.ipc.removeAllListeners(icpList.generate.deleteLogo);
- })*/
- }
- }
- const handleLogoLoadError = () => {
- if (!form.logo_path) return
- if (!logoLoadError.value) {
- logoLoadError.value = true
- form.logo_path = ''
- saveLogoToCache('')
- ElMessage.warning('LOGO加载出错或文件已被删除,请重新上传')
- }
- }
- 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', result.data)
- // 只使用第一个LOGO(如果存在且当前没有选择)
- if(logoList.value.length && !form.logo_path){
- form.logo_path = logoList.value[0]
- logoLoadError.value = false
- // 保存默认LOGO到缓存
- saveLogoToCache(form.logo_path)
- }
- clientStore.ipc.removeAllListeners(icpList.generate.getLogoList);
- })
- }
- 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 handleOpenFolder = (event) => {
- const { folder } = event.detail;
- if (folder) {
- openOutputDir(folder);
- }
- }
- 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-page {
- height: calc(100vh - 50px);
- }
- .service-tabs {
- display: flex;
- gap: 10px;
- padding: 20px;
- .service-tab {
- display: flex;
- flex: 1;
- align-items: center;
- justify-content: center;
- gap: 10px;
- padding: 10px 20px;
- border: 1px solid #e8e8e8;
- border-radius: 8px;
- cursor: pointer;
- transition: all 0.3s;
- position: relative;
- background: #fff;
- height: 140px;
- .tab-checkbox {
- margin-right: 0;
- position: absolute;
- left: 10px;
- top:10px;
- ::v-deep {
- .is-checked .el-checkbox__inner {
- background: #2957FF;
- border-color: #2957FF;
- }
- .el-checkbox__inner {
- border-radius: 18px;
- transform: scale(1.2);
- }
- }
- }
- .tab-img {
- width: 48px;
- height: 48px;
- background: #EFF6FF;
- border-radius: 10px;
- margin: 0 auto 5px;
- }
- .tab-icon {
- width: 24px;
- height: 24px;
- }
- .tab-name {
- font-size: 14px;
- color: #333;
- font-weight: 500;
- }
- &.external-tool {
- cursor: pointer;
- opacity: 1;
- background: #fff;
- }
- .tab-edit-btn {
- position: absolute;
- right: 10px;
- top:10px;
- width: 24px;
- height: 24px;
- display: flex;
- align-items: center;
- justify-content: center;
- background: rgba(41, 87, 255, 0.1);
- border-radius: 4px;
- opacity: 0;
- transition: opacity 0.3s;
- cursor: pointer;
- .el-icon {
- color: #2957FF;
- font-size: 16px;
- }
- }
- &:hover {
- border-color: #2957FF;
- .tab-edit-btn {
- opacity: 1;
- }
- }
- &.active {
- border-color: #2957FF;
- border-bottom: 4px solid #2957FF;
- .tab-img {
- background: #2957FF;
- }
- }
- &.disabled {
- opacity: 0.8;
- cursor: not-allowed;
- background: #f5f5f5;
- }
- }
- }
- .detail-container {
- background: #F5F6F7;
- padding: 0 20px 20px 20px; // 底部留出空间给固定按钮
- .detail-content {
- max-width: 100%;
- }
- width: 100%;
- min-width: 600px;
- overflow: hidden;
- }
- .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 {
- }
- .template-section {
- background: #fff;
- padding: 10px 20px 20px;
- border-radius: 8px;
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
- .section-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- }
- .template-tips {
- height: 40px;
- line-height: 40px;
- padding: 0 10px;
- background: #FFFBEA;
- border-radius: 10px;
- border: 1px solid #FEEEB0;
- color: #9B4D26;
- }
- }
- .template-section--disabled {
- opacity: 0.8;
- .template-list,
- .template-pagination {
- pointer-events: none;
- }
- }
- .publish-section--disabled {
- opacity: 0.6;
- }
- // 主布局:左右分栏
- .main-layout {
- display: flex;
- gap: 20px;
- align-items: flex-start;
- .left-panel {
- flex: 1;
- min-width: 0;
- }
- .right-panel {
- width: 400px;
- flex-shrink: 0;
- display: flex;
- flex-direction: column;
- gap: 20px;
- }
- }
- .right-section {
- background: #fff;
- padding: 20px;
- border-radius: 8px;
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
- &.data-prep-section {
- height: 225px;
- display: flex;
- flex-direction: column;
- box-sizing: border-box;
- }
- .section-title {
- display: flex;
- align-items: center;
- gap: 10px;
- font-weight: 600;
- font-size: 16px;
- color: #333333;
- margin-bottom: 16px;
- .section-title-line {
- width: 3px;
- height: 16px;
- background: linear-gradient(135deg, #7C3AED 0%, #2957FF 100%);
- border-radius: 2px;
- }
- .section-title-hint {
- font-weight: normal;
- font-size: 14px;
- color: #999;
- }
- }
- .data-prep-content {
- display: flex;
- flex-direction: column;
- gap: 12px;
- flex: 1;
- .data-type-radio {
- padding:5px;
- background:#F3F5F6;
- border-radius:10px;
- ::v-deep {
- .el-radio {
- margin-right: 20px;
- }
- .el-radio-button {
- flex:1;
- box-shadow:none !important;
- .el-radio-button__inner {
- width: 100%;
- background: none !important;
- border: none !important;
- display: flex;
- align-items: center;
- border-radius:10px !important;
- justify-content: center;
- img {
- height: 14px;
- margin: 0 5px;
- position: relative;
- top:-1px;
- }
- }
- &.is-active {
- background: #F8F9FF;
- .el-radio-button__inner {
- background: #fff !important;
- color: #2957FF !important;
- border-radius: 10px !important;
- box-shadow: none !important;
- }
- }
- }
- }
- }
- .excel-upload-section {
- display: flex;
- flex-direction: column;
- gap: 8px;
- flex: 1;
- .excel-upload-area {
- width: 100%;
- height: 64px;
- border: 1px dashed #D9D9D9;
- border-radius: 8px;
- display: flex;
- align-items: center;
- padding: 0 16px;
- cursor: pointer;
- transition: all 0.3s;
- background: #fff;
- &:hover {
- border-color: #2957FF;
- background: #F8F9FF;
- }
- .excel-icon {
- width: 32px;
- height:32px;
- margin-right: 10px;
- img {
- width: 32px;
- height:32px;
- display: block;
- }
- }
- .excel-upload-text {
- font-size: 14px;
- color: #333;
- font-weight: 500;
- }
- }
- .excel-selected-info {
- width: 100%;
- height: 64px;
- border: 1px solid #E5E6EB;
- border-radius: 8px;
- padding: 12px 16px;
- background: #fff;
- display: flex;
- align-items: center;
- justify-content: space-between;
- gap: 16px;
- box-sizing: border-box;
- .excel-file-info {
- display: flex;
- align-items: center;
- flex: 1;
- min-width: 0;
- .excel-icon {
- width: 32px;
- height: 32px;
- margin-right: 10px;
- img {
- width: 32px;
- height: 32px;
- display: block;
- }
- }
- .excel-file-text {
- display: flex;
- flex-direction: column;
- min-width: 0;
- max-width: 100%;
- .excel-file-label {
- font-size: 12px;
- text-align: left;
- color: #888;
- margin-bottom: 4px;
- }
- .excel-file-name {
- font-size: 14px;
- color: #1D2129;
- font-weight: 500;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- max-width: 100%;
- }
- }
- }
- .reupload-btn {
- flex-shrink: 0;
- }
- }
- .download-link {
- color: #2957FF;
- text-decoration: underline;
- padding: 0;
- font-size: 14px;
- margin-top: 0;
- justify-content: flex-start;
- }
- }
- }
- .publish-content {
- display: flex;
- flex-direction: column;
- gap: 15px;
- .publish-form-item {
- display: flex;
- flex-direction: column;
- gap: 8px;
- .publish-label {
- font-size: 14px;
- color: #333;
- margin-bottom: 4px;
- text-align: left;
- }
- .publish-select {
- width: 100%;
- ::v-deep {
- .el-input.is-disabled .el-input__inner {
- background-color: #F5F6F7;
- border-color: #E8E8E8;
- color: #999;
- }
- }
- }
- }
- }
- }
- .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上传区域样式
- .logo-upload-area {
- width: 100%;
- }
- .logo-upload-placeholder {
- width: 100%;
- height: 160px;
- border: 1px dashed #D9D9D9;
- border-radius: 10px;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- cursor: pointer;
- transition: all 0.3s;
- background: #fff;
- &:hover {
- border-color: #2957FF;
- background: #F8F9FF;
- }
- .logo-upload-icon {
- width: 42px;
- height: 42px;
- margin-bottom: 12px;
- display: flex;
- align-items: center;
- justify-content: center;
- background: linear-gradient(135deg, #EFF6FF 0%, #F3E8FF 100%);
- border-radius: 8px;
- color: #2957FF;
- img {
- width: 42px;
- height: 42px;
- }
- }
- .logo-upload-text {
- font-size: 14px;
- color: #333;
- margin-bottom: 8px;
- font-weight: 500;
- }
- .logo-upload-hint {
- font-size: 12px;
- color: #999;
- }
- &.is-error {
- border-color: #FF4D4F;
- background: #FFF2F0;
- .logo-upload-text,
- .logo-upload-hint {
- color: #FF4D4F;
- }
- }
- }
- .logo-upload-preview {
- width: 100%;
- height: 160px;
- border: 1px solid #E8E8E8;
- border-radius: 8px;
- position: relative;
- overflow: hidden;
- background: #F5F5F5;
- cursor: pointer;
- .logo-preview-image {
- width: 100%;
- height: 100%;
- object-fit: contain;
- }
- .logo-upload-actions {
- position: absolute;
- bottom: 0;
- left: 0;
- right: 0;
- height: 40px;
- background: rgba(0, 0, 0, 0.5);
- display: flex;
- align-items: center;
- justify-content: center;
- gap: 20px;
- opacity: 0;
- transition: opacity 0.3s;
- .logo-action-btn {
- width: 32px;
- height: 32px;
- display: flex;
- align-items: center;
- justify-content: center;
- background: rgba(255, 255, 255, 0.2);
- border-radius: 4px;
- cursor: pointer;
- color: #fff;
- transition: background 0.3s;
- &:hover {
- background: rgba(255, 255, 255, 0.3);
- }
- .el-icon {
- font-size: 18px;
- }
- }
- }
- &:hover .logo-upload-actions {
- opacity: 1;
- }
- .logo-upload-footer {
- display: flex;
- justify-content: flex-end;
- gap: 12px;
- padding: 8px 4px 0;
- }
- }
- .logo-upload {
- border: 1px dashed #ccc;
- border-radius: 5px;
- padding: 50px 0;
- text-align: center;
- cursor: pointer;
- }
- .template-pagination {
- background: #EFF3F6;
- padding:2px 0;
- border-radius:5px;
- ::v-deep {
- .is-active {
- background: #fff !important;
- color: #2957FF !important;
- font-size: 14px !important;
- font-weight: normal !important;
- border-radius: 2px !important;
- }
- .number {
- margin: 0px !important;
- }
- .btn-prev {
- display: none;
- }
- .btn-next {
- display: none;
- }
- }
- }
- .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 {
- flex:1;
- max-width: 33%;
- border: 1px solid #ccc;
- border-radius: 10px;
- cursor: pointer;
- background: #f0f0f0;
- position: relative;
- height: 660px;
- overflow: hidden;
- &.active {
- border-color: #1677FF;
- }
- .template-info {
- position: absolute;
- bottom: 0;
- left: 0;
- background: #fff;
- width: 100%;
- height: 40px;
- line-height: 40px;
- color: #333;
- display: flex;
- align-items: center;
- justify-content: space-between;
- .template-view {
- 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: 18px;
- background-color: #fff;
- position: absolute;
- font-size: 12px;
- line-height: 18px;
- display: flex;
- justify-content: center;
- align-items: center;
- top: 10px;
- left: 10px;
- &.active {
- background-color: #1677FF;
- }
- }
- .section-title {
- display: flex;
- align-items: center;
- gap: 8px;
- font-weight: bold;
- 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;
- z-index: 100;
- .footer-button {
- padding: 12px 40px;
- font-size: 16px;
- border-radius: 8px;
- display: block;
- width: 100%;
- height: 50px;
- img {
- height: 16px;;
- margin: 0 10px;
- }
- .go {
- opacity: .5;
- }
- }
- }
- .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%;
- display: none;
- .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>
- <style lang="scss" scoped>
- // 货号选择弹窗样式(非 scoped,因为弹窗挂载在 body 上)
- .goods-select-dialog {
- max-width: 60vw;
- .el-dialog__body {
- padding: 20px;
- max-height: 70vh;
- overflow-y: auto;
- height: 60vh;
- }
- .goods-select-content {
- .goods-radio-group {
- width: 100%;
- display: flex;
- flex-direction: column;
- gap: 20px;
- }
- .goods-item {
- background: #FFFFFF;
- box-shadow: 0px 2px 4px 0px rgba(23,33,71,0.1);
- border-radius: 10px;
- border: 1px solid #D9DEE6;
- margin-bottom: 20px;
- cursor: pointer;
- transition: all 0.3s;
-
- .goods-radio {
- width: 100%;
- margin: 0;
- padding: 0;
- position: relative;
- .el-radio__input {
- position: absolute;
- top: 14px;
- left: 18px;
- z-index: 10;
- transform: scale(1);
- }
- .el-radio__inner {
- border-width: 2px;
- }
- &.is-checked {
- .el-radio__inner {
- background-color: #409eff;
- border-color: #409eff;
- }
- }
- .el-radio__label {
- width: 100%;
- padding-left: 40px;
- display: none;
- }
- }
- .goods-item-header {
- display: flex;
- justify-content: flex-start;
- align-items: center;
- height: 40px;
- padding: 0 16px;
- background: linear-gradient(90deg, #F4ECFF 0%, #DFEDFF 100%);
- border-radius: 10px 10px 0px 0px;
- .goods-item-left {
- display: flex;
- align-items: center;
- gap: 16px;
- .goods-art-no {
- font-size: 16px;
- font-weight: 500;
- color: #333;
- }
- .goods-item-meta {
- display: flex;
- justify-content: space-between;
- align-items: center;
- font-size: 12px;
- color: #666;
- img {
- height: 14px;
- margin-right: 2px;
- }
- .action-time {
- color: #666;
- }
- .image-count {
- color: #666;
- }
- }
- }
- }
- .goods-item-images {
- display: grid;
- grid-template-columns: repeat(5, 1fr);
- gap: 10px;
- padding: 15px;
- border-top: 1px solid #f0f0f0;
- overflow-x: auto;
- @media (min-width: 1200px) {
- grid-template-columns: repeat(5, 1fr);
- }
- @media (max-width: 768px) {
- grid-template-columns: repeat(3, 1fr);
- }
- }
- .goods-item_image {
- position: relative;
- width: 100%;
- aspect-ratio: 1;
- background: #F7F7F7;
- border-radius: 10px;
- overflow: hidden;
- cursor: pointer;
- border: 1px solid #D9DEE6;
- transition: all 0.3s;
- .tag {
- color: #bbb;
- position: absolute;
- left: 0;
- right: 0;
- top: 50%;
- margin-top: -10px;
- line-height: 20px;
- text-align: center;
- font-size: 12px;
- z-index: 1;
- pointer-events: none;
- }
- .preview-image {
- width: 100%;
- height: 100%;
- .el-image__inner {
- width: 100%;
- height: 100%;
- object-fit: cover;
- }
- }
- .image-placeholder {
- width: 100%;
- height: 100%;
- display: flex;
- align-items: center;
- justify-content: center;
- background: #F7F7F7;
- }
- .image-slot {
- width: 100%;
- height: 100%;
- display: flex;
- align-items: center;
- justify-content: center;
- background: #F7F7F7;
- }
- &:hover {
- border-color: #409eff;
- transform: scale(1.02);
- box-shadow: 0 2px 8px rgba(64, 158, 255, 0.2);
- }
- }
- }
- }
- .dialog-footer {
- display: flex;
- justify-content: flex-end;
- gap: 10px;
- }
- }
- </style>
|