detail.vue 98 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604
  1. <template>
  2. <BlueHeaderBar />
  3. <svg width="0" height="0" class="aigc-sprite" aria-hidden="true">
  4. <defs>
  5. <symbol id="i-check" viewBox="0 0 24 24"><path d="M5 12.5l4.5 4.5L19 7.5" fill="none" stroke="#fff" stroke-width="3.4" stroke-linecap="round" stroke-linejoin="round"/></symbol>
  6. <symbol id="i-info" viewBox="0 0 24 24"><circle cx="12" cy="12" r="9" fill="none" stroke="currentColor" stroke-width="1.8"/><path d="M12 10.6v5" stroke="currentColor" stroke-width="1.9" stroke-linecap="round"/><circle cx="12" cy="7.6" r="1.15" fill="currentColor"/></symbol>
  7. <symbol id="i-scene" viewBox="0 0 24 24"><rect x="3" y="4.5" width="18" height="15" rx="3" fill="none" stroke="currentColor" stroke-width="1.9"/><circle cx="8.6" cy="9.6" r="1.7" fill="currentColor"/><path d="M5 17.5l4.6-4.6 3.2 3.2 3.4-3.9 3.8 4.4" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linejoin="round"/></symbol>
  8. <symbol id="i-person" viewBox="0 0 24 24"><circle cx="12" cy="8.4" r="3.6" fill="none" stroke="currentColor" stroke-width="1.9"/><path d="M4.8 19.6c1.3-3.6 4-5.3 7.2-5.3s5.9 1.7 7.2 5.3" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round"/></symbol>
  9. <symbol id="i-doc" viewBox="0 0 24 24"><rect x="4.5" y="3" width="15" height="18" rx="3" fill="none" stroke="currentColor" stroke-width="1.9"/><path d="M8.4 8h7.2M8.4 12h7.2M8.4 16h4.6" stroke="currentColor" stroke-width="1.9" stroke-linecap="round"/></symbol>
  10. <symbol id="i-plus" viewBox="0 0 24 24"><rect x="3.5" y="3.5" width="17" height="17" rx="4" fill="none" stroke="currentColor" stroke-width="1.9"/><path d="M12 8.4v7.2M8.4 12h7.2" stroke="currentColor" stroke-width="1.9" stroke-linecap="round"/></symbol>
  11. <symbol id="i-export" viewBox="0 0 24 24"><path d="M9.5 4H6a2.5 2.5 0 0 0-2.5 2.5v11A2.5 2.5 0 0 0 6 20h11a2.5 2.5 0 0 0 2.5-2.5V14" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round"/><path d="M14 4h6v6M20 4l-8.5 8.5" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"/></symbol>
  12. <symbol id="i-book" viewBox="0 0 24 24"><path d="M12 6.2C10.5 4.9 8.3 4.2 5.5 4.2c-.8 0-1.5.06-2 .16V18.6c.5-.1 1.2-.16 2-.16 2.8 0 5 .7 6.5 2 1.5-1.3 3.7-2 6.5-2 .8 0 1.5.06 2 .16V4.36c-.5-.1-1.2-.16-2-.16-2.8 0-5 .7-6.5 2z" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linejoin="round"/><path d="M12 6.2v14" stroke="currentColor" stroke-width="1.9"/></symbol>
  13. <symbol id="i-img" viewBox="0 0 24 24"><rect x="3" y="3.5" width="18" height="17" rx="3.5" fill="none" stroke="currentColor" stroke-width="1.9"/><circle cx="9" cy="9.4" r="1.8" fill="currentColor"/><path d="M4.5 18l5-5 3.4 3.4 3-3.4 3.6 4" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linejoin="round"/></symbol>
  14. <symbol id="i-sheet" viewBox="0 0 24 24"><rect x="3.5" y="3.5" width="17" height="17" rx="3" fill="none" stroke="currentColor" stroke-width="1.9"/><path d="M3.5 9.2h17M9.2 9.2v11.3M3.5 14.8h17" stroke="currentColor" stroke-width="1.9"/></symbol>
  15. <symbol id="i-right" viewBox="0 0 24 24"><path d="M9 5.5l7 6.5-7 6.5" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"/></symbol>
  16. <symbol id="i-left" viewBox="0 0 24 24"><path d="M15 5.5L8 12l7 6.5" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"/></symbol>
  17. <symbol id="i-arrow" viewBox="0 0 24 24"><path d="M4 12h15M13.5 5.5L20 12l-6.5 6.5" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/></symbol>
  18. <symbol id="i-upl" viewBox="0 0 24 24"><path d="M12 15.5V5M7.5 9L12 4.6 16.5 9" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M4.5 15.5v2.4A2.6 2.6 0 0 0 7.1 20.5h9.8a2.6 2.6 0 0 0 2.6-2.6v-2.4" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></symbol>
  19. </defs>
  20. </svg>
  21. <div class="bg-F5F6F7 detail-page">
  22. <div class="aigc-wrap">
  23. <div class="aigc-board">
  24. <!-- 场景图 -->
  25. <section class="fcard" :class="{ off: !isSceneOn }">
  26. <header class="fhead">
  27. <div class="fh-row">
  28. <span class="fico"><svg><use href="#i-scene"/></svg></span>
  29. <div class="fh-text">
  30. <div class="fh-t">场景图生成</div>
  31. <div class="fh-s">自定义场景,文字描述生成</div>
  32. </div>
  33. <span class="toggle">
  34. <span class="swl">{{ isSceneOn ? '生成' : '不生成' }}</span>
  35. <label class="sw">
  36. <input type="checkbox" :checked="isSceneOn" @change="onSwChange('is_product_scene', $event)">
  37. <i></i>
  38. </label>
  39. </span>
  40. </div>
  41. </header>
  42. <div class="fbody">
  43. <SceneCard
  44. v-model="scenePrompt"
  45. v-model:bgPrompt="sceneBgPrompt"
  46. v-model:image="sceneImage"
  47. v-model:mode="sceneMode"
  48. />
  49. </div>
  50. <footer class="ffoot"><svg class="ic"><use href="#i-info"/></svg>未选择则不生成场景图,使用白底图</footer>
  51. </section>
  52. <!-- 模特图 -->
  53. <section class="fcard" :class="{ off: !isModelOn }">
  54. <header class="fhead">
  55. <div class="fh-row">
  56. <span class="fico"><svg><use href="#i-person"/></svg></span>
  57. <div class="fh-text">
  58. <div class="fh-t">模特图生成</div>
  59. <div class="fh-s">多模特可选,支持上传替换</div>
  60. </div>
  61. <span class="toggle">
  62. <span class="swl">{{ isModelOn ? '生成' : '不生成' }}</span>
  63. <label class="sw">
  64. <input type="checkbox" :checked="isModelOn" @change="onSwChange('is_upper_footer', $event)">
  65. <i></i>
  66. </label>
  67. </span>
  68. </div>
  69. </header>
  70. <div class="fbody">
  71. <ModelCard v-model="selectedModels" />
  72. </div>
  73. <footer class="ffoot"><svg class="ic"><use href="#i-info"/></svg>未选择则不生成模特图</footer>
  74. </section>
  75. <!-- 详情页 -->
  76. <section class="fcard fcard-wide" :class="{ off: !isDetailServiceSelected }">
  77. <header class="fhead">
  78. <div class="fh-row">
  79. <span class="fico"><svg><use href="#i-doc"/></svg></span>
  80. <div class="fh-text">
  81. <div class="fh-t">详情页生成</div>
  82. <div class="fh-s">选择详情模板后开始生成</div>
  83. </div>
  84. <span class="toggle">
  85. <span class="swl">{{ isDetailServiceSelected ? '生成' : '不生成' }}</span>
  86. <label class="sw">
  87. <input type="checkbox" :checked="isDetailServiceSelected" @change="onSwChange('is_detail', $event)">
  88. <i></i>
  89. </label>
  90. </span>
  91. </div>
  92. </header>
  93. <div class="fbody">
  94. <div class="tabs-row tabs-row-tools">
  95. <span class="hbtns">
  96. <button class="hbtn" type="button" title="向左" @click="scrollTemplates(-1)"><svg><use href="#i-left"/></svg></button>
  97. <button class="hbtn" type="button" title="向右" @click="scrollTemplates(1)"><svg><use href="#i-right"/></svg></button>
  98. </span>
  99. </div>
  100. <div class="hscroll tpl-hscroll" ref="tplScrollRef">
  101. <figure
  102. v-for="(template, index) in templates"
  103. :key="template.id || index"
  104. class="tpl"
  105. :class="{ sel: form.selectTemplate?.id == template.id }"
  106. @click="handleTemplateItemClick(template)"
  107. v-log="{ describe: { action: '点击选择详情模板', template_name: template.template_name } }"
  108. >
  109. <span class="ck" v-if="form.selectTemplate?.id == template.id">✓</span>
  110. <div
  111. class="template-download-btn"
  112. v-if="isDetailServiceSelected && template.template_type == 1"
  113. @click.stop="downloadTplExcel(template)"
  114. >
  115. 下载EXECL模版
  116. </div>
  117. <div class="tpl-head">
  118. <b>{{ template.template_name }}</b>
  119. </div>
  120. <div class="tpl-img-wrap">
  121. <el-image :src="getTemplateThumbImage(template)" class="tpl-img" />
  122. </div>
  123. <div class="tpl-mini" v-if="isDetailServiceSelected">
  124. <span class="lk" @click.stop="viewTemplate(template)">查看</span>
  125. <span class="lk" v-if="template.template_type == 1" @click.stop="editTemplate(template)">编辑</span>
  126. <span class="lk danger" v-if="template.template_type == 1" @click.stop="deleteTemplate(template)">删除</span>
  127. </div>
  128. </figure>
  129. </div>
  130. <div class="template-tips">
  131. <el-icon><Warning /></el-icon>
  132. <span v-if="!isDetailServiceSelected">请先打开详情页生成,再选择模板</span>
  133. <span v-else>该模版需提供{{ form.selectTemplate?.template_image_order?.split(',').length
  134. || 5}}张标准视角的商品图:{{ form.selectTemplate?.template_image_order ||
  135. '俯视,侧视,后跟,鞋底,内里'}}。请确保图片清晰度高,背景干净。</span>
  136. </div>
  137. </div>
  138. <footer class="ffoot"><svg class="ic"><use href="#i-info"/></svg>未选择则不生成详情页</footer>
  139. </section>
  140. <!-- 右侧栏 -->
  141. <aside class="side">
  142. <div class="scard">
  143. <div class="stitle">工具</div>
  144. <div
  145. v-if="useUserInfoStore.isHLM"
  146. class="trow"
  147. @click="addCustomTemplate"
  148. v-log="{ describe: { action: '点击新增自定义详情页模板', service: '新增自定义详情页模板' } }"
  149. >
  150. <span class="tic"><svg><use href="#i-plus"/></svg></span>
  151. <span>新增自定义详情页模板</span>
  152. <svg class="arr"><use href="#i-right"/></svg>
  153. </div>
  154. <div v-else class="trow disabled" title="功能开发中">
  155. <span class="tic"><svg><use href="#i-plus"/></svg></span>
  156. <span>详情页模板自定义</span>
  157. <svg class="arr"><use href="#i-right"/></svg>
  158. </div>
  159. <div
  160. v-if="useUserInfoStore.userInfo.brand_company_id == 44584"
  161. class="trow"
  162. @click="handleWhiteBgUploadClick"
  163. v-log="{ describe: { action: '点击白底图批量上传', service: '白底图批量上传' } }"
  164. >
  165. <span class="tic"><svg><use href="#i-export"/></svg></span>
  166. <span>白底图批量上传</span>
  167. <svg class="arr"><use href="#i-right"/></svg>
  168. </div>
  169. <div
  170. v-else
  171. class="trow"
  172. @click="handleWhiteBgExportClick"
  173. v-log="{ describe: { action: '点击白底图批量导出', service: '白底图批量导出' } }"
  174. >
  175. <span class="tic"><svg><use href="#i-export"/></svg></span>
  176. <span>白底图批量导出</span>
  177. <svg class="arr"><use href="#i-right"/></svg>
  178. </div>
  179. <div
  180. class="trow"
  181. @click="handleProductAlbumClick"
  182. v-log="{ describe: { action: '点击产品图册生成', service: '产品图册生成' } }"
  183. >
  184. <span class="tic"><svg><use href="#i-book"/></svg></span>
  185. <span>产品图册生成</span>
  186. <svg class="arr"><use href="#i-right"/></svg>
  187. </div>
  188. </div>
  189. <div class="scard">
  190. <div class="stitle">主图LOGO</div>
  191. <div class="logo-upload-area">
  192. <div v-if="!form.logo_path" class="up" :class="{ 'is-error': logoLoadError }"
  193. @click="openLogoUpload">
  194. <span class="uic"><svg><use href="#i-img"/></svg></span>
  195. <span class="t">点击或拖拽上传</span>
  196. <span class="s" v-if="logoLoadError">LOGO指向的文件不存在或加载失败,请重新上传</span>
  197. <span class="s" v-else>支持PNG、JPG格式</span>
  198. </div>
  199. <div v-else class="logo-upload-preview">
  200. <img :src="'file:///' + form.logo_path" alt="LOGO预览" class="logo-preview-image"
  201. @error="handleLogoLoadError" />
  202. <div class="logo-upload-actions">
  203. <span class="logo-action-btn" @click.stop="previewLogo">
  204. <el-icon><ZoomIn /></el-icon>
  205. </span>
  206. <span class="logo-action-btn" @click.stop="removeLogo">
  207. <el-icon><Delete /></el-icon>
  208. </span>
  209. </div>
  210. <div class="logo-upload-footer">
  211. <el-button type="primary" link @click.stop="openLogoUpload">重新上传</el-button>
  212. <el-button type="danger" link @click.stop="removeLogo">删除</el-button>
  213. </div>
  214. </div>
  215. </div>
  216. </div>
  217. <div class="scard right-section data-prep-section">
  218. <div class="stitle">商品资料对接</div>
  219. <div class="data-prep-content">
  220. <div class="data-mode">
  221. <button
  222. type="button"
  223. class="data-mode-btn"
  224. :class="{ on: form.dataType == '1' }"
  225. @click="setDataType('1')"
  226. >Excel导入</button>
  227. <button
  228. type="button"
  229. class="data-mode-btn"
  230. :class="{ on: form.dataType == '2' }"
  231. @click="setDataType('2')"
  232. >系统对接</button>
  233. </div>
  234. <template v-if="form.dataType == '1'">
  235. <button
  236. v-if="!form.excel_path"
  237. class="gbtn"
  238. type="button"
  239. @click="selectExcel"
  240. v-log="{ describe: { action: '点击选择Excel文件' } }"
  241. >
  242. <svg><use href="#i-sheet"/></svg>选择 Excel 文件
  243. </button>
  244. <div v-else class="excel-selected-info">
  245. <div class="excel-file-info">
  246. <div class="excel-icon">
  247. <img src="@/assets/images/detail/file-excel.png" class="tab-icon" />
  248. </div>
  249. <div class="excel-file-text">
  250. <div class="excel-file-label">已选择文件</div>
  251. <div class="excel-file-name" :title="excelFileName">{{ excelFileName }}</div>
  252. </div>
  253. </div>
  254. <el-button type="primary" link class="reupload-btn" @click="selectExcel"
  255. v-log="{ describe: { action: '重新上传Excel文件' } }">
  256. 重新上传
  257. </el-button>
  258. </div>
  259. <button class="lk data-prep-link" type="button" @click="downloadExcel"
  260. title="用于非自定义详情页的商品基础资料模版"
  261. v-log="{ describe: { action: '点击下载Excel模板' } }">
  262. 下载通用商品基础资料模版
  263. </button>
  264. </template>
  265. <div v-else class="sys-hint">
  266. 将从系统自动读取商品资料,无需上传 Excel
  267. </div>
  268. </div>
  269. </div>
  270. <div class="scard right-section publish-section" :class="{ 'publish-section--disabled': !canUsePublishSection }"
  271. v-if="onlineStoreTempList.length || onlineStoreTempListForeign.length">
  272. <div class="stitle">一键上架平台</div>
  273. <div class="frow2">
  274. <div v-if="onlineStoreTempList.length">
  275. <label>国内电商平台:</label>
  276. <el-select v-model="domesticPlatforms" multiple collapse-tags placeholder="请选择" class="publish-select"
  277. :disabled="!canUsePublishSection">
  278. <el-option v-for="store in onlineStoreTempList" :key="store.show_name" :label="store.show_name"
  279. :value="store.online_store_name" :disabled="!store.channel_status" />
  280. </el-select>
  281. </div>
  282. <div v-if="onlineStoreTempListForeign.length">
  283. <label>跨境电商平台:</label>
  284. <el-select v-model="foreignPlatforms" multiple collapse-tags placeholder="请选择" class="publish-select"
  285. :disabled="!canUsePublishSection">
  286. <el-option v-for="store in onlineStoreTempListForeign" :key="store.show_name"
  287. :label="store.show_name" :value="store.online_store_name" :disabled="!store.channel_status" />
  288. </el-select>
  289. </div>
  290. </div>
  291. </div>
  292. <button class="cta" type="button" :disabled="requesting" @click="generate" v-log="{ describe: { action: '点击开始生成详情页' } }">
  293. <b>开始生成<svg><use href="#i-arrow"/></svg></b>
  294. <small>将为本次批量选择的所有商品生成</small>
  295. </button>
  296. </aside>
  297. </div>
  298. <div class="ybar">
  299. <svg class="ic"><use href="#i-info"/></svg>
  300. <span>批量生成说明:本次设置将应用于您勾选的<b>所有商品</b>,<b>未打开的模块将不生成相关内容</b></span>
  301. </div>
  302. </div>
  303. <loading-dialog v-if="loadingDialogVisible" v-model="loadingDialogVisible" :requesting="requesting"
  304. :progress="progress" :message="message" :disabled-button="disabledButton" :use-new-progress="useNewProgress"
  305. :progress-steps="progressSteps" @button-click="handleComplete" :on-open-folder="openOutputDir">
  306. <template v-if="partErrList && partErrList.length > 0" #errList>
  307. <div v-for="(item, idx) in partErrList" :key="idx">
  308. <span v-if="item.goods_art_no">{{ item.goods_art_no }}:</span><span>{{ item.info }}</span>
  309. </div>
  310. </template>
  311. <template #progressMessages>
  312. <div class="progress-messages" v-if="progressMessages.length">
  313. <div class="message-header">
  314. <span>处理进度</span>
  315. <div class="flex right" style="gap:8px; align-items:center;">
  316. <el-button type="text" @click="openOutputDir" v-log="{ describe: { action: '点击打开输出目录' } }">打开目录</el-button>
  317. <el-button type="text" @click="showMessageHistory = !showMessageHistory"
  318. v-log="{ describe: { action: '点击查看进度详情' } }">
  319. {{ showMessageHistory ? '收起' : '查看详情' }}
  320. </el-button>
  321. </div>
  322. </div>
  323. <div class="message-list" v-if="showMessageHistory" ref="messageListRef">
  324. <div v-for="(msg, index) in progressMessages" :key="index" class="message-item flex left">
  325. <div class="message-time">{{ formatTime(msg.timestamp) }}</div>
  326. <div class="message-content mar-left-10" v-if="msg">
  327. <span class="goods-no" v-if="msg.goods_art_nos && msg.goods_art_nos.length > 0">货号{{
  328. msg.goods_art_nos.join(', ') }}:</span>
  329. <span class="message-text">{{ msg.msg }}</span>
  330. </div>
  331. </div>
  332. </div>
  333. </div>
  334. </template>
  335. </loading-dialog>
  336. <el-dialog v-model="dialogVisible">
  337. <img style="width: 100%;" :src="dialogImageUrl" alt="Preview Image" />
  338. </el-dialog>
  339. <!-- LOGO预览弹窗 -->
  340. <el-dialog v-model="logoPreviewVisible" title="LOGO预览">
  341. <img style="width: 100%;" :src="logoPreviewUrl" alt="LOGO Preview" />
  342. </el-dialog>
  343. <!-- 货号选择弹窗 -->
  344. <GoodsSelectDialog
  345. v-model:visible="goodsSelectDialogVisible"
  346. @confirm="handleGoodsSelectionConfirm"
  347. @cancel="handleGoodsSelectionCancel"
  348. />
  349. </div>
  350. </template>
  351. <script lang="ts" setup>
  352. import { getCompanyTemplatesApi } from '@/apis/other'
  353. import tokenInfo from '@/stores/modules/token';
  354. import { useRoute, useRouter } from 'vue-router'
  355. import { clickLog, setLogInfo } from '@/utils/log'
  356. import { ElMessage, ElMessageBox } from 'element-plus'
  357. import BlueHeaderBar from '@/components/header-bar/blue-header.vue'
  358. import { ref, computed, reactive, onMounted, onBeforeUnmount, nextTick, watch } from 'vue';
  359. import { Select, EditPen, ZoomIn, Delete, Picture, Document } from '@element-plus/icons-vue'
  360. // import upload from '@/components/upload' // 不再需要,改为单LOGO上传
  361. import client from "@/stores/modules/client";
  362. import icpList from '@/utils/ipc'
  363. import useUserInfo from "@/stores/modules/user";
  364. const clientStore = client();
  365. import { getRouterUrl } from '@/utils/appfun'
  366. import { useUuidStore } from '@/stores/modules/uuid'
  367. import socket from "@/stores/modules/socket";
  368. const socketStore = socket();
  369. const useUserInfoStore = useUserInfo();
  370. import GoodsSelectDialog from './components/GoodsSelectDialog.vue'
  371. import SceneCard from './components/SceneCard.vue'
  372. import ModelCard from './components/ModelCard.vue'
  373. import { Close, Warning } from '@element-plus/icons-vue'
  374. import LoadingDialog from '@/views/Photography/components/LoadingDialog.vue'
  375. import configInfo from "@/stores/modules/config";
  376. import { deleteCustomerTemplate , downlaodCustomerTemplate} from '@/apis/other'
  377. import { ossResize } from '@/utils/oss'
  378. const useConfigInfoStore = configInfo();
  379. const EXTERNAL_TOOL_EXECUTABLE = '智慧映拍照机辅助工具箱.exe'
  380. import usePhotography from './mixin/usePhotography'
  381. // 从 mixin 中导入必要的函数和状态(已不再使用,保留以防其他地方需要)
  382. const { } = usePhotography()
  383. const launchExternalTool = async (pagePath: string, successMessage: string) => {
  384. if (!clientStore?.ipc || !clientStore.isClient) {
  385. ElMessage.error('当前环境暂不支持外部工具');
  386. return;
  387. }
  388. if (!pagePath) return;
  389. const tokenStore = tokenInfo();
  390. const token = tokenStore?.getToken || '';
  391. const env = (useConfigInfoStore?.appConfig as any)?.env || 'prod';
  392. const argString = `token=${token}&page=${pagePath}&env=${env}`;
  393. try {
  394. const result = await clientStore.ipc.invoke(icpList.utils.runExternalTool, {
  395. exeName: EXTERNAL_TOOL_EXECUTABLE,
  396. args: [argString]
  397. });
  398. if (result?.code === 0) {
  399. ElMessage.success(successMessage);
  400. } else {
  401. throw new Error(result?.msg || '启动外部工具失败');
  402. }
  403. } catch (error: any) {
  404. console.error('launchExternalTool error:', error);
  405. ElMessage.error(error?.message || '打开外部工具失败');
  406. }
  407. }
  408. const handleWhiteBgExportClick = () => launchExternalTool('/copy_800_tool', '白底图批量导出工具已启动')
  409. const handleWhiteBgUploadClick = () => launchExternalTool('/upload_800_tool', '白底图批量上传工具已启动')
  410. const handleProductAlbumClick = () => launchExternalTool('/product_list', '产品图册生成工具已启动')
  411. // 货号选择弹窗相关状态
  412. const goodsSelectDialogVisible = ref(false)
  413. const addCustomTemplate = () => {
  414. goodsSelectDialogVisible.value = true
  415. }
  416. // 处理货号选择确认
  417. const handleGoodsSelectionConfirm = (selectedGoodsArtNo: string) => {
  418. console.log('选中的货号:', selectedGoodsArtNo)
  419. // 跳转到新增模板页(组件内部已经处理了数据存储到 sessionStorage)
  420. router.push({
  421. name: 'addTpl'
  422. })
  423. }
  424. // 处理货号选择取消
  425. const handleGoodsSelectionCancel = () => {
  426. // 取消选择,不做任何操作
  427. }
  428. import { useCheckInfo } from '@/composables/userCheck';
  429. useCheckInfo();
  430. const showTips = ref(true)
  431. const folderPath = ref('') //货号文件夹
  432. // const reportMode = ref('normal') // 抠图模式
  433. const imageOrder = ref('俯视、侧视、后跟、鞋底、内里、组合、组合2、组合3') // 图片顺序
  434. const checkSimilar = ref(false) // 同款检验
  435. const specificPage = ref('') // 可指定页面独修改
  436. // 路由和状态管理初始化
  437. const route = useRoute();
  438. const router = useRouter();
  439. const uuidStore = useUuidStore();
  440. // 完成目录
  441. const completeDirectory = ref('')
  442. const loadingDialogVisible = ref(false)
  443. const progress = ref(0)
  444. const message = ref('正在为您处理,请稍后')
  445. const disabledButton = ref(true)
  446. // 新的进度条相关数据
  447. const useNewProgress = ref(false)
  448. const progressSteps = ref<Array<{
  449. msg_type: string
  450. goods_art_no: string
  451. name: string
  452. status: '等待处理' | '正在处理' | '处理完成' | '处理失败'
  453. current: number
  454. total: number
  455. error: number
  456. }>>([])
  457. // 删除自定义模板
  458. const deleteTemplate = async (template: any) => {
  459. if (!template?.id) return
  460. try {
  461. await ElMessageBox.confirm(
  462. `确定要删除自定义模板「${template.template_name || ''}」吗?`,
  463. '提示',
  464. {
  465. confirmButtonText: '确定',
  466. cancelButtonText: '取消',
  467. type: 'warning',
  468. },
  469. )
  470. const res = await deleteCustomerTemplate({ id: template.id })
  471. const data = res
  472. if (data?.code === 0) {
  473. ElMessage.success('删除成功')
  474. // 从当前模板列表中移除
  475. const idx = templates.value.findIndex((item: any) => item.id === template.id)
  476. if (idx !== -1) {
  477. templates.value.splice(idx, 1)
  478. }
  479. } else {
  480. ElMessage.error(data?.msg || '删除失败')
  481. }
  482. } catch (e: any) {
  483. if (e !== 'cancel' && e !== 'close') {
  484. console.error('删除模板失败:', e)
  485. ElMessage.error(e?.message || '删除失败')
  486. }
  487. }
  488. }
  489. const downloadTplExcel = async (template: any) => {
  490. await downlaodCustomerTemplate({ id: template.id , filename: template.template_name})
  491. // console.log('downlaodCustomerTemplate', data)
  492. }
  493. // 更新进度步骤
  494. const updateProgressStep = (msgType: string, stepData: any) => {
  495. console.log('updateProgressStep called:', msgType, stepData)
  496. const stepIndex = progressSteps.value.findIndex(step => step.msg_type === msgType)
  497. if (stepIndex !== -1) {
  498. // 更新现有步骤 - 使用新数组来确保响应式更新
  499. const newSteps = [...progressSteps.value]
  500. newSteps[stepIndex] = {
  501. ...newSteps[stepIndex],
  502. name: stepData.name, // 保持原有名称或使用新名称
  503. goods_art_no: stepData.goods_art_no,
  504. status: stepData.status,
  505. current: stepData.current || 0,
  506. total: stepData.total || 0,
  507. error: stepData.error || 0,
  508. folder: newSteps[stepIndex].folder || stepData.folder // 保持已有的folder或使用新的
  509. }
  510. progressSteps.value = newSteps
  511. console.log('Updated step:', newSteps[stepIndex])
  512. } else {
  513. // 添加新步骤
  514. progressSteps.value = [...progressSteps.value, {
  515. msg_type: msgType,
  516. name: stepData.name,
  517. goods_art_no: stepData.goods_art_no,
  518. status: stepData.status,
  519. current: stepData.current || 0,
  520. total: stepData.total || 0,
  521. error: stepData.error || 0,
  522. folder: stepData.folder // 添加folder字段
  523. }]
  524. console.log('Added new step:', progressSteps.value[progressSteps.value.length - 1])
  525. }
  526. }
  527. // 获取步骤名称
  528. // 初始化进度步骤 - 从后端数据动态获取
  529. const initProgressSteps = (backendSteps?: any[]) => {
  530. if (backendSteps && backendSteps.length > 0) {
  531. // 使用后端返回的步骤数据
  532. progressSteps.value = backendSteps.map(step => ({
  533. msg_type: step.msg_type,
  534. goods_art_no: step.goods_art_no,
  535. name: step.name,
  536. status: '等待处理',
  537. current: 0,
  538. total: step.total || 0,
  539. error: 0
  540. }))
  541. } else {
  542. // 默认步骤(当后端没有返回步骤数据时使用)
  543. progressSteps.value = []
  544. }
  545. }
  546. // 进度消息队列
  547. const progressMessages = ref<Array<{
  548. goods_no: string
  549. temp_name: string
  550. status: string
  551. goods_art_nos: string[]
  552. msg: string
  553. timestamp: number
  554. }>>([])
  555. const showMessageHistory = ref(true)
  556. const messageListRef = ref<HTMLElement | null>(null)
  557. // 新消息时自动滚动到底部
  558. const scrollMessageListToBottom = () => {
  559. nextTick(() => {
  560. const el = messageListRef.value
  561. if (el) {
  562. el.scrollTop = el.scrollHeight
  563. }
  564. })
  565. }
  566. let templates = ref([])
  567. // let goods_art_nos = ref([])
  568. let partErrList = ref([])
  569. const excel_template_url = ref('')
  570. // 是否正在请求接口
  571. const requesting = ref(false)
  572. const goods_art_nos = computed(() => {
  573. const goods_art_data = route.query.goods_art_nos
  574. return Array.isArray(goods_art_data) ? goods_art_data : [goods_art_data]
  575. })
  576. // 定义一个定时器变量
  577. const INTERVAL = ref<number | NodeJS.Timeout | null>(null);
  578. // 状态变量
  579. const totalPage = ref(0);
  580. const itemsPerPage = 3; // 每页显示的模板数量
  581. const dialogVisible = ref(false);
  582. const dialogImageUrl = ref('');
  583. const queryParams = reactive({ // 分页查询参数
  584. size: 1,
  585. current: 1,
  586. })
  587. const form = reactive({
  588. selectTemplate: {}, //选中的模板
  589. dataType: '1', // 1: 选择excel文件 2: 系统对接
  590. logo_path: '', // 主图LOGO
  591. excel_path: '', // 商品基础资料EXCEL文件选择
  592. services: ['is_detail'], // 勾选服务内容(多选)默认包含详情页生成
  593. })
  594. const excelFileName = computed(() => {
  595. if (!form.excel_path) return ''
  596. const segments = form.excel_path.split(/[/\\]/)
  597. return segments[segments.length - 1] || ''
  598. })
  599. const templatesLoaded = ref(false)
  600. const lastSelectedTemplateId = ref<string | number | null>(null)
  601. const isDetailServiceSelected = computed(() => form.services.includes('is_detail'))
  602. const isSceneOn = computed(() => form.services.includes('is_product_scene'))
  603. const isModelOn = computed(() => form.services.includes('is_upper_footer'))
  604. const tplScrollRef = ref<HTMLElement | null>(null)
  605. function setService(key: string, on: boolean) {
  606. const idx = form.services.indexOf(key)
  607. if (on && idx === -1) form.services.push(key)
  608. if (!on && idx > -1) form.services.splice(idx, 1)
  609. saveServicesToCache(form.services)
  610. }
  611. function onSwChange(key: string, e: Event) {
  612. const target = e.target as HTMLInputElement
  613. setService(key, !!target?.checked)
  614. }
  615. function setDataType(type: string) {
  616. form.dataType = type
  617. saveDataTypeToCache(type)
  618. }
  619. function scrollTemplates(dir: number) {
  620. const el = tplScrollRef.value
  621. if (!el) return
  622. el.scrollBy({ left: el.clientWidth * 0.9 * dir, behavior: 'smooth' })
  623. }
  624. const hasTemplates = computed(() => templates.value.length > 0)
  625. const canUsePublishSection = computed(() => isDetailServiceSelected.value && hasTemplates.value)
  626. onMounted(() => {
  627. // 页面访问埋点
  628. const goods_art_data = route.query.goods_art_nos
  629. goods_art_nos.value = Array.isArray(goods_art_data) ? goods_art_data : [goods_art_data]
  630. getCompanyTemplates()
  631. getLogolist()
  632. loadDetailCache()
  633. // 初始化目录打开状态标记
  634. window.segmentFolderOpened = false;
  635. window.modelOrSceneFolderOpened = false;
  636. // 监听子组件发出的打开目录事件
  637. window.addEventListener('openFolder', handleOpenFolder);
  638. })
  639. // 页面卸载时清理监听器
  640. onBeforeUnmount(() => {
  641. clientStore.ipc.removeAllListeners(icpList.socket.message + '_detail_progress');
  642. clientStore.ipc.removeAllListeners(icpList.socket.message + '_segment_progress');
  643. clientStore.ipc.removeAllListeners(icpList.socket.message + '_upper_footer_progress');
  644. clientStore.ipc.removeAllListeners(icpList.socket.message + '_scene_progress');
  645. clientStore.ipc.removeAllListeners(icpList.socket.message + '_upload_goods_progress');
  646. clientStore.ipc.removeAllListeners(icpList.socket.message + '_detail_result_progress');
  647. clearInterval(INTERVAL.value);
  648. // 移除事件监听器
  649. window.removeEventListener('openFolder', handleOpenFolder);
  650. })
  651. // 计算属性,获取当前页可见的模板
  652. const visibleTemplates = computed(() => {
  653. const startIndex = (queryParams.current - 1) * itemsPerPage;
  654. const data = templates.value.slice(startIndex, startIndex + itemsPerPage);
  655. return data
  656. });
  657. const selectTemplate = (template: any, options: { saveCache?: boolean; ensureVisible?: boolean } = {}) => {
  658. if (!isDetailServiceSelected.value) return
  659. if (!template || !template.id) return
  660. form.selectTemplate = template
  661. lastSelectedTemplateId.value = template.id
  662. if (options.ensureVisible) {
  663. jumpToTemplatePageById(template.id)
  664. }
  665. const shouldSaveCache = options.saveCache !== undefined ? options.saveCache : true
  666. if (shouldSaveCache) {
  667. try {
  668. localStorage.setItem(DETAIL_TEMPLATE_CACHE_KEY, JSON.stringify(template))
  669. console.log('selectTemplate - saved to cache:', template);
  670. } catch { }
  671. }
  672. };
  673. const handleTemplateItemClick = (template: any) => {
  674. if (!isDetailServiceSelected.value) return
  675. selectTemplate(template)
  676. };
  677. const clearTemplateSelection = () => {
  678. form.selectTemplate = {}
  679. };
  680. const findTemplateById = (templateId: string | number | null) => {
  681. if (templateId === null || templateId === undefined) return null
  682. return templates.value.find(template => String(template.id) === String(templateId)) || null
  683. };
  684. const jumpToTemplatePageById = (templateId: string | number | null) => {
  685. if (templateId === null || templateId === undefined) return
  686. const index = templates.value.findIndex(template => String(template.id) === String(templateId))
  687. if (index === -1) return
  688. const targetPage = Math.floor(index / itemsPerPage) + 1
  689. if (queryParams.current !== targetPage) {
  690. queryParams.current = targetPage
  691. }
  692. };
  693. const ensureDefaultTemplateSelection = (options: { ensureVisible?: boolean } = {}) => {
  694. if (!templatesLoaded.value || !isDetailServiceSelected.value || !templates.value.length) {
  695. return
  696. }
  697. if (form.selectTemplate && (form.selectTemplate as any).id) {
  698. if (options.ensureVisible) {
  699. jumpToTemplatePageById((form.selectTemplate as any).id)
  700. }
  701. return
  702. }
  703. const cachedTemplate = findTemplateById(lastSelectedTemplateId.value)
  704. const templateToSelect = cachedTemplate || templates.value[0]
  705. if (templateToSelect) {
  706. selectTemplate(templateToSelect, {
  707. ensureVisible: options.ensureVisible,
  708. saveCache: !cachedTemplate
  709. })
  710. }
  711. };
  712. watch(isDetailServiceSelected, (selected) => {
  713. if (selected) {
  714. ensureDefaultTemplateSelection({ ensureVisible: true })
  715. } else {
  716. clearTemplateSelection()
  717. }
  718. });
  719. // 获取模板展示图(优先 template_preview_image,其次 template_cover_image)
  720. const getTemplateDisplayImage = (template: any) => {
  721. if (!template) return ''
  722. return template.template_preview_image || template.template_cover_image || ''
  723. }
  724. const getTemplateThumbImage = (template: any) => {
  725. const url = getTemplateDisplayImage(template)
  726. if (!url || /^(data:|blob:|file:)/i.test(url)) return url
  727. return ossResize(url, { m: 'lfit', w: 400 })
  728. }
  729. // 查看模板详情
  730. const viewTemplate = (template) => {
  731. // 展示大图,优先 template_preview_image,其次 template_cover_image
  732. dialogVisible.value = true
  733. dialogImageUrl.value = getTemplateDisplayImage(template)
  734. };
  735. // 编辑自定义模版
  736. const editTemplate = async (template: any) => {
  737. if (!template) return
  738. // 将画布 JSON、名称、商品图片等信息通过 sessionStorage 传给编辑页
  739. // const customerTemplateJson = template.template_local_classes|| []
  740. const resp = await fetch(template.template_local_classes)
  741. const json = await resp.json()
  742. const customerTemplateJson = json
  743. const customerTemplateImages = template.customer_template_images || []
  744. const templateImageOrder = template.template_image_order || ''
  745. const templateName = template.template_name || ''
  746. // 将商品文字的 keys 转换为完整的对象结构
  747. const templateExcelHeaders = template.customer_template_excel_headers || []
  748. const defaultGoodsTextFallback = []
  749. const fullTemplateExcelHeaders = template.template_excel_headers || ''
  750. // 使用sessionStorage传递数据,避免URL长度限制
  751. const templateData = {
  752. customer_template_json: customerTemplateJson,
  753. template_name: templateName,
  754. customer_template_images: customerTemplateImages,
  755. template_image_order: templateImageOrder,
  756. template_excel_headers: fullTemplateExcelHeaders, // 传递完整的商品文字数据
  757. timestamp: Date.now() // 添加时间戳用于标识数据
  758. }
  759. sessionStorage.setItem('editTpl_template_data', JSON.stringify(templateData))
  760. router.push({
  761. name: 'editTpl',
  762. params: { id: template.id }
  763. })
  764. };
  765. // 获取模版列表
  766. const getCompanyTemplates = async () => {
  767. const { data } = await getCompanyTemplatesApi()
  768. console.log('getCompanyTemplatesApi', data);
  769. templates.value = data.list || []
  770. // 获取电商平台列表 - 支持新的数据结构
  771. if (data.online_store_temp_list) {
  772. onlineStoreTempList.value = data.online_store_temp_list
  773. }
  774. if (data.online_store_temp_list_foreign) {
  775. onlineStoreTempListForeign.value = data.online_store_temp_list_foreign
  776. }
  777. templatesLoaded.value = true
  778. // 获取模板列表后,尝试从缓存恢复模板选择
  779. loadTemplateFromCache()
  780. excel_template_url.value = data.excel_template_url
  781. // 计算总页数
  782. totalPage.value = Math.ceil(templates.value.length / itemsPerPage);
  783. }
  784. const downloadExcel = () => {
  785. const a = document.createElement('a')
  786. a.href = excel_template_url.value,
  787. a.download = '商品基础资料模版'
  788. document.body.appendChild(a)
  789. a.click()
  790. setTimeout(() => {
  791. document.body.removeChild(a);
  792. }, 1000);
  793. }
  794. // 服务内容切换
  795. const toggleService = (key: string) => {
  796. const idx = form.services.indexOf(key)
  797. if (idx > -1) form.services.splice(idx, 1)
  798. else form.services.push(key)
  799. // 保存服务选择状态到缓存
  800. saveServicesToCache(form.services)
  801. }
  802. // 电商平台多选与一键上架
  803. const domesticPlatforms = ref<string[]>([])
  804. const foreignPlatforms = ref<string[]>([])
  805. const onlineStoreTempList = ref<any[]>([]) // 国内电商平台列表
  806. const onlineStoreTempListForeign = ref<any[]>([]) // 国外电商平台列表
  807. // 模特与场景弹窗
  808. const modelDialogVisible = ref(false)
  809. const modelDialogDefaultTab = ref<'female' | 'male'>('female')
  810. const scenePromptDialogVisible = ref(false)
  811. const selectedModels = ref<{ female: any; male: any; child?: any } | null>({ female: null, male: null, child: null })
  812. const scenePrompt = ref('')
  813. const sceneBgPrompt = ref('')
  814. const sceneImage = ref('')
  815. const sceneMode = ref<'text' | 'upload'>('text')
  816. const DEFAULT_BG_SCENE_PROMPT = '把鞋子融合到背景图中'
  817. // 本地缓存键(与弹窗组件保持一致)
  818. const DETAIL_MODEL_CACHE_KEY = 'model_selection_cache'
  819. const DETAIL_SCENE_PROMPT_CACHE_KEY = 'scene_prompt_cache'
  820. const DETAIL_SCENE_BG_PROMPT_CACHE_KEY = 'scene_bg_prompt_cache'
  821. const DETAIL_SCENE_IMAGE_CACHE_KEY = 'scene_image_cache'
  822. const detail_logo_cache_1_KEY = 'detail_logo_cache_1'
  823. const DETAIL_DATA_TYPE_CACHE_KEY = 'detail_data_type_cache'
  824. const DETAIL_SERVICES_CACHE_KEY = 'detail_services_cache'
  825. const DETAIL_TEMPLATE_CACHE_KEY = 'detail_template_cache'
  826. // 读取本地缓存
  827. const loadDetailCache = () => {
  828. console.log('loadDetailCache');
  829. try {
  830. const m = localStorage.getItem(DETAIL_MODEL_CACHE_KEY)
  831. if (m) {
  832. const parsed = JSON.parse(m)
  833. if (parsed && (parsed.female || parsed.male || parsed.child)) {
  834. selectedModels.value = parsed
  835. console.log('loadDetailCache');
  836. console.log(selectedModels.value);
  837. }
  838. }
  839. } catch { }
  840. try {
  841. const p = localStorage.getItem(DETAIL_SCENE_PROMPT_CACHE_KEY)
  842. if (p) {
  843. console.log('scenePrompt');
  844. scenePrompt.value = p
  845. console.log(scenePrompt.value);
  846. }
  847. } catch { }
  848. try {
  849. const img = localStorage.getItem(DETAIL_SCENE_IMAGE_CACHE_KEY)
  850. if (img) sceneImage.value = img
  851. } catch { }
  852. try {
  853. const bg = localStorage.getItem(DETAIL_SCENE_BG_PROMPT_CACHE_KEY)
  854. if (bg) sceneBgPrompt.value = bg
  855. } catch { }
  856. // 加载LOGO缓存
  857. try {
  858. const logo = localStorage.getItem(detail_logo_cache_1_KEY)
  859. if (logo) {
  860. form.logo_path = logo || ''
  861. console.log(form.logo_path);
  862. console.log('loadDetailCache - logo:', logo);
  863. }
  864. } catch { }
  865. // 加载数据类型缓存
  866. try {
  867. const dataType = localStorage.getItem(DETAIL_DATA_TYPE_CACHE_KEY)
  868. if (dataType) {
  869. form.dataType = dataType
  870. console.log('loadDetailCache - dataType:', dataType);
  871. }
  872. } catch { }
  873. // 模板缓存加载将在获取模板列表后执行
  874. // 加载服务选择状态缓存
  875. try {
  876. const services = localStorage.getItem(DETAIL_SERVICES_CACHE_KEY)
  877. if (services) {
  878. const parsed = JSON.parse(services)
  879. if (Array.isArray(parsed)) {
  880. form.services = parsed
  881. console.log('loadDetailCache - services:', parsed);
  882. }
  883. }
  884. } catch { }
  885. }
  886. // 保存到本地缓存(仅保存必要字段)
  887. const saveModelsToCache = (models: { female: any; male: any }) => {
  888. try {
  889. const payload = {
  890. female: models?.female ? {
  891. id: models.female.id,
  892. name: models.female.name,
  893. image_url: models.female.image_url,
  894. gender: models.female.gender,
  895. keywords: models.female.keywords,
  896. status: models.female.status
  897. } : null,
  898. male: models?.male ? {
  899. id: models.male.id,
  900. name: models.male.name,
  901. image_url: models.male.image_url,
  902. gender: models.male.gender,
  903. keywords: models.male.keywords,
  904. status: models.male.status
  905. } : null,
  906. child: models?.child ? {
  907. id: models.child.id,
  908. name: models.child.name,
  909. image_url: models.child.image_url,
  910. gender: models.child.gender,
  911. keywords: models.child.keywords,
  912. status: models.child.status
  913. } : null
  914. }
  915. localStorage.setItem(DETAIL_MODEL_CACHE_KEY, JSON.stringify(payload))
  916. } catch { }
  917. }
  918. const saveScenePromptToCache = (prompt: string) => {
  919. try {
  920. const v = (prompt || '').trim()
  921. if (v) localStorage.setItem(DETAIL_SCENE_PROMPT_CACHE_KEY, v)
  922. } catch { }
  923. }
  924. const saveSceneImageToCache = (url: string) => {
  925. try {
  926. if (url) localStorage.setItem(DETAIL_SCENE_IMAGE_CACHE_KEY, url)
  927. else localStorage.removeItem(DETAIL_SCENE_IMAGE_CACHE_KEY)
  928. } catch { }
  929. }
  930. const saveSceneBgPromptToCache = (prompt: string) => {
  931. try {
  932. localStorage.setItem(DETAIL_SCENE_BG_PROMPT_CACHE_KEY, prompt || '')
  933. } catch { }
  934. }
  935. // 保存LOGO到缓存
  936. const saveLogoToCache = (logoPath: string) => {
  937. try {
  938. localStorage.setItem(detail_logo_cache_1_KEY, logoPath)
  939. } catch { }
  940. }
  941. // 保存数据类型到缓存
  942. const saveDataTypeToCache = (dataType: string) => {
  943. try {
  944. if (dataType) {
  945. localStorage.setItem(DETAIL_DATA_TYPE_CACHE_KEY, dataType)
  946. console.log('saveDataTypeToCache:', dataType);
  947. }
  948. } catch { }
  949. }
  950. const saveServicesToCache = (services: string[]) => {
  951. try {
  952. localStorage.setItem(DETAIL_SERVICES_CACHE_KEY, JSON.stringify(services))
  953. console.log('saveServicesToCache:', services);
  954. } catch { }
  955. }
  956. watch(scenePrompt, (v) => {
  957. saveScenePromptToCache(v)
  958. })
  959. watch(sceneImage, (v) => {
  960. saveSceneImageToCache(v)
  961. })
  962. watch(sceneBgPrompt, (v) => {
  963. saveSceneBgPromptToCache(v)
  964. })
  965. watch(selectedModels, (v) => {
  966. if (v) saveModelsToCache(v)
  967. }, { deep: true })
  968. // 从缓存加载模板选择
  969. const loadTemplateFromCache = () => {
  970. lastSelectedTemplateId.value = null
  971. try {
  972. const template = localStorage.getItem(DETAIL_TEMPLATE_CACHE_KEY)
  973. if (template) {
  974. const parsed = JSON.parse(template)
  975. if (parsed && parsed.id) {
  976. lastSelectedTemplateId.value = parsed.id
  977. console.log('loadTemplateFromCache - template id:', parsed.id);
  978. }
  979. }
  980. } catch (error) {
  981. console.error('加载模板缓存失败:', error);
  982. }
  983. ensureDefaultTemplateSelection({ ensureVisible: true })
  984. }
  985. // HLM用户判断
  986. const isHLM = computed(() => useUserInfoStore.isHLM)
  987. const openModelDialog = (eventOrDefaultTab?: MouseEvent | 'female' | 'male') => {
  988. modelDialogVisible.value = true
  989. let defaultTab: 'female' | 'male' | undefined
  990. if (typeof eventOrDefaultTab === 'string') {
  991. defaultTab = eventOrDefaultTab
  992. }
  993. if (defaultTab) {
  994. // 传递给子组件的默认标签页
  995. modelDialogDefaultTab.value = defaultTab
  996. } else {
  997. // 重置为默认值
  998. modelDialogDefaultTab.value = 'female'
  999. }
  1000. }
  1001. const openScenePromptDialog = () => {
  1002. scenePromptDialogVisible.value = true
  1003. }
  1004. // 选择LOGO
  1005. // selectLogo 函数已移除,现在只支持单个LOGO上传
  1006. const handleModelSelection = (models: { female: any; male: any }) => {
  1007. selectedModels.value = models
  1008. saveModelsToCache(models)
  1009. modelDialogVisible.value = false
  1010. // ElMessage.success('模特选择完成!')
  1011. }
  1012. const handleScenePromptConfirm = (prompt: string) => {
  1013. scenePrompt.value = prompt
  1014. saveScenePromptToCache(prompt)
  1015. }
  1016. const onCurrentChange = (page) => {
  1017. queryParams.current = page;
  1018. };
  1019. const onSizeChange = (data) => {
  1020. };
  1021. // 格式化时间
  1022. const formatTime = (timestamp: number) => {
  1023. const date = new Date(timestamp)
  1024. return `${date.getHours().toString().padStart(2, '0')}:${date.getMinutes().toString().padStart(2, '0')}:${date.getSeconds().toString().padStart(2, '0')}`
  1025. }
  1026. // 处理进度消息
  1027. const handleProgressMessage = (data: any) => {
  1028. console.log("detail_progress", data);
  1029. if (data.code === 0 && data.msg_type === 'detail_progress') {
  1030. const messageData = {
  1031. goods_no: data.data.goods_no,
  1032. temp_name: data.data.temp_name,
  1033. status: data.data.status,
  1034. goods_art_nos: data.data.goods_art_nos,
  1035. msg: data.msg,
  1036. timestamp: Date.now()
  1037. }
  1038. progressMessages.value.push(messageData)
  1039. // 更新当前显示的消息
  1040. message.value = data.data.goods_art_nos ? `货号${data.data.goods_art_nos.join(', ')}:${data.msg}` : `${data.msg}`
  1041. scrollMessageListToBottom()
  1042. // 更新新的进度条
  1043. if (data.progress) {
  1044. updateProgressStep('detail_progress', data.progress)
  1045. }
  1046. }
  1047. }
  1048. // 处理抠图进度消息
  1049. const handleSegmentProgressMessage = (data: any) => {
  1050. console.log("segment_progress", data);
  1051. if (data.code === 0 && data.msg_type === 'segment_progress') {
  1052. const messageData = {
  1053. goods_no: '',
  1054. temp_name: '',
  1055. status: data.data?.status || '',
  1056. goods_art_nos: data.data?.goods_art_nos || [],
  1057. msg: data.msg,
  1058. timestamp: Date.now()
  1059. }
  1060. progressMessages.value.push(messageData)
  1061. // 更新当前显示的消息
  1062. message.value = data.data.goods_art_nos ? `货号${data.data.goods_art_nos.join(', ')}:${data.msg}` : `${data.msg}`
  1063. scrollMessageListToBottom()
  1064. // 更新新的进度条
  1065. if (data.progress) {
  1066. if (['处理完成', '处理失败'].includes(progressSteps.value[0]?.status)) {
  1067. return;
  1068. }
  1069. updateProgressStep('segment_progress', data.progress)
  1070. if (data.progress?.folder && !window.segmentFolderOpened) {
  1071. window.segmentFolderOpened = true;
  1072. openOutputDir(data.progress?.folder)
  1073. }
  1074. }
  1075. }
  1076. }
  1077. // 处理上脚图进度
  1078. const handleUpperFooterProgressMessage = (data: any) => {
  1079. console.log("upper_footer_progress", data);
  1080. if (data.code === 0 && data.msg_type === 'upper_footer_progress') {
  1081. const messageData = {
  1082. goods_no: '',
  1083. temp_name: '',
  1084. status: data.data?.status || '',
  1085. goods_art_nos: data.data?.goods_art_nos || [],
  1086. msg: data.msg,
  1087. timestamp: Date.now()
  1088. }
  1089. progressMessages.value.push(messageData)
  1090. message.value = data.data.goods_art_nos ? `货号${data.data.goods_art_nos.join(', ')}:${data.msg}` : `${data.msg}`
  1091. scrollMessageListToBottom()
  1092. // 更新新的进度条
  1093. if (data.progress) {
  1094. updateProgressStep('upper_footer_progress', data.progress)
  1095. // 如果是处理完成状态且目录还未打开,则打开目录
  1096. if (data.progress?.folder && !window.modelOrSceneFolderOpened) {
  1097. window.modelOrSceneFolderOpened = true;
  1098. openOutputDir(data.progress?.folder)
  1099. }
  1100. }
  1101. }
  1102. }
  1103. // 处理场景图进度
  1104. const handleSceneProgressMessage = (data: any) => {
  1105. console.log("scene_progress", data);
  1106. if (data.code === 0 && data.msg_type === 'scene_progress') {
  1107. const messageData = {
  1108. goods_no: '',
  1109. temp_name: '',
  1110. status: data.data?.status || '',
  1111. goods_art_nos: data.data?.goods_art_nos || [],
  1112. msg: data.msg,
  1113. timestamp: Date.now()
  1114. }
  1115. progressMessages.value.push(messageData)
  1116. message.value = data.data.goods_art_nos ? `货号${data.data.goods_art_nos.join(', ')}:${data.msg}` : `${data.msg}`
  1117. scrollMessageListToBottom()
  1118. // 更新新的进度条
  1119. if (data.progress) {
  1120. updateProgressStep('scene_progress', data.progress)
  1121. // 如果是处理完成状态且目录还未打开,则打开目录
  1122. if (data.progress?.folder && !window.modelOrSceneFolderOpened) {
  1123. window.modelOrSceneFolderOpened = true;
  1124. openOutputDir(data.progress?.folder)
  1125. }
  1126. }
  1127. }
  1128. }
  1129. // 处理商品上传进度
  1130. const handleUploadGoodsProgressMessage = (data: any) => {
  1131. console.log("upload_goods_progress", data);
  1132. if (data.code === 0 && data.msg_type === 'upload_goods_progress') {
  1133. const messageData = {
  1134. goods_no: '',
  1135. temp_name: '',
  1136. status: data.data?.status || '',
  1137. goods_art_nos: data.data?.goods_art_nos || [],
  1138. msg: data.msg,
  1139. timestamp: Date.now()
  1140. }
  1141. progressMessages.value.push(messageData)
  1142. message.value = data.data.goods_art_nos ? `货号${data.data.goods_art_nos.join(', ')}:${data.msg}` : `${data.msg}`
  1143. scrollMessageListToBottom()
  1144. // 更新新的进度条
  1145. if (data.progress) {
  1146. updateProgressStep('upload_goods_progress', data.progress)
  1147. }
  1148. }
  1149. }
  1150. // 打开输出目录:appConfig.appPath + '/build/extraResources/py/output'
  1151. const openOutputDir = (path) => {
  1152. try {
  1153. let fullPath = ''
  1154. if (path) {
  1155. fullPath = path
  1156. } else {
  1157. const appPath = useConfigInfoStore?.appConfig?.appPath || ''
  1158. if (!appPath) {
  1159. ElMessage.error('未获取到应用目录 appPath')
  1160. return
  1161. }
  1162. fullPath = `${pyPath}\\output`
  1163. }
  1164. clientStore.ipc.removeAllListeners(icpList.utils.shellFun);
  1165. clientStore.ipc.send(icpList.utils.shellFun, {
  1166. action: 'openPath',
  1167. params: fullPath.replace(/\//g, '\\')
  1168. });
  1169. } catch (e) {
  1170. console.error(e)
  1171. ElMessage.error('打开目录失败')
  1172. }
  1173. }
  1174. function buildSceneSubmitParams() {
  1175. if (sceneMode.value === 'upload') {
  1176. return {
  1177. product_scene_image: sceneImage.value || '',
  1178. product_scene_prompt: (sceneBgPrompt.value || '').trim() || DEFAULT_BG_SCENE_PROMPT,
  1179. }
  1180. }
  1181. return {
  1182. product_scene_prompt: scenePrompt.value || '',
  1183. }
  1184. }
  1185. // 检测参数是否有效
  1186. const checkParams = async function () {
  1187. const useConfigInfoStore = configInfo();
  1188. const tokenInfoStore = tokenInfo();
  1189. const token = tokenInfoStore.getToken;
  1190. let temp_list = []
  1191. templates.value.map(item => {
  1192. temp_list.push({
  1193. template_id: item.template_id,
  1194. template_local_classes: item.template_local_classes,
  1195. template_type: item.template_type,
  1196. })
  1197. })
  1198. // 根据选择的服务内容设置参数
  1199. const isDetail = form.services.includes('is_detail') ? 1 : 0
  1200. const isProductScene = form.services.includes('is_product_scene') ? 1 : 0
  1201. const isUpperFooter = form.services.includes('is_upper_footer') ? 1 : 0
  1202. const params = {
  1203. goods_art_no: JSON.parse(JSON.stringify(goods_art_nos.value)),
  1204. logo_path: form.logo_path || '',
  1205. temp_name: form.selectTemplate?.template_id || '',
  1206. excel_path: form.dataType == '1' ? form.excel_path : '',
  1207. template_image_order: form.selectTemplate?.template_image_order,
  1208. temp_list,
  1209. token,
  1210. uuid: uuidStore.getUuid || '',
  1211. // 新增服务参数 - 合并国内和国外平台
  1212. online_stores: [...(domesticPlatforms.value || []), ...(foreignPlatforms.value || [])],
  1213. is_detail: isDetail,
  1214. is_product_scene: isProductScene,
  1215. is_upper_footer: isUpperFooter,
  1216. upper_footer_params: selectedModels.value ? {
  1217. man_id: selectedModels.value.male?.id || "",
  1218. women_id: selectedModels.value.female?.id || "",
  1219. child_id: selectedModels.value.child?.id || ""
  1220. } : {},
  1221. ...buildSceneSubmitParams(),
  1222. is_check: 1 // 仅检测,不生成
  1223. }
  1224. try {
  1225. // 直接调用API进行检测,因为检测模式会直接返回结果
  1226. const response = await clientStore.ipc.invoke(icpList.generate.generatePhotoDetail, params);
  1227. console.log('=======checkParamscheckParamscheckParamscheckParams===========');
  1228. console.log(params);
  1229. console.log(response);
  1230. if (response.code === 0) {
  1231. return response;
  1232. } else {
  1233. throw new Error(response.msg || '检测失败');
  1234. }
  1235. } catch (error) {
  1236. throw new Error(error.message || '检测失败');
  1237. }
  1238. }
  1239. // 开始生成操作
  1240. const generate = async function () {
  1241. if (requesting.value) {
  1242. return
  1243. }
  1244. // 重置目录打开状态
  1245. window.segmentFolderOpened = false;
  1246. window.modelOrSceneFolderOpened = false;
  1247. if (form.services.length == 0) {
  1248. ElMessage.error('请选择服务内容')
  1249. return
  1250. }
  1251. // 必填验证
  1252. if (form.services.includes('is_upper_footer')) {
  1253. const hasMale = selectedModels.value?.male?.id
  1254. const hasFemale = selectedModels.value?.female?.id
  1255. if (!hasMale && !hasFemale) {
  1256. ElMessage.error('请选择男模特和女模特')
  1257. return
  1258. } else if (!hasMale) {
  1259. ElMessage.error('请选择男模特')
  1260. return
  1261. } else if (!hasFemale) {
  1262. ElMessage.error('请选择女模特')
  1263. return
  1264. }
  1265. }
  1266. if (form.services.includes('is_product_scene')) {
  1267. if (sceneMode.value === 'upload') {
  1268. if (!sceneImage.value) {
  1269. ElMessage.error('请上传或选择背景图')
  1270. return
  1271. }
  1272. } else if (!(scenePrompt.value || '').trim()) {
  1273. ElMessage.error('请填写场景描述')
  1274. return
  1275. }
  1276. }
  1277. if (form.services.includes('is_detail') || form.services.includes('is_upper_footer')) {
  1278. if (form.dataType == '1' && !form.excel_path) {
  1279. ElMessage.error('请上传商品基础资料')
  1280. return
  1281. }
  1282. }
  1283. // 埋点:开始生成详情页
  1284. clickLog({
  1285. describe: {
  1286. action: '点击开始生成详情页',
  1287. services: form.services,
  1288. dataType: form.dataType,
  1289. template_name: form.selectTemplate?.template_name,
  1290. goods_count: goods_art_nos.value.length,
  1291. goods_art_nos: goods_art_nos.value
  1292. }
  1293. }, route);
  1294. // 先进行检测
  1295. let checkResult;
  1296. try {
  1297. requesting.value = true
  1298. // ElMessage.info('正在检测参数,请稍候...');
  1299. checkResult = await checkParams();
  1300. // ElMessage.success('检测通过,开始生成...');
  1301. } catch (error) {
  1302. ElMessage.error(error.message || '检测失败,请检查参数');
  1303. requesting.value = false
  1304. return;
  1305. }
  1306. const useConfigInfoStore = configInfo();
  1307. console.log(useConfigInfoStore.appConfig);
  1308. const tokenInfoStore = tokenInfo();
  1309. const token = tokenInfoStore.getToken; // 使用 getToken() 获取 token
  1310. let temp_list = []
  1311. templates.value.map(item => {
  1312. temp_list.push({
  1313. template_id: item.template_id,
  1314. template_local_classes: item.template_local_classes,
  1315. template_type: item.template_type,
  1316. })
  1317. })
  1318. // 根据选择的服务内容设置参数
  1319. const isDetail = form.services.includes('is_detail') ? 1 : 0
  1320. const isProductScene = form.services.includes('is_product_scene') ? 1 : 0
  1321. const isUpperFooter = form.services.includes('is_upper_footer') ? 1 : 0
  1322. const params = {
  1323. goods_art_no: JSON.parse(JSON.stringify(goods_art_nos.value)),
  1324. logo_path: form.logo_path || '',
  1325. temp_name: form.selectTemplate?.template_id || '',
  1326. excel_path: form.dataType == '1' ? form.excel_path : '',
  1327. template_image_order: form.selectTemplate?.template_image_order,
  1328. temp_list,
  1329. token,
  1330. uuid: uuidStore.getUuid || '',
  1331. // 新增服务参数 - 合并国内和国外平台
  1332. online_stores: [...(domesticPlatforms.value || []), ...(foreignPlatforms.value || [])],
  1333. is_detail: isDetail,
  1334. is_product_scene: isProductScene,
  1335. is_upper_footer: isUpperFooter,
  1336. upper_footer_params: selectedModels.value ? {
  1337. man_id: selectedModels.value.male?.id || "",
  1338. women_id: selectedModels.value.female?.id || "",
  1339. child_id: selectedModels.value.child?.id || ""
  1340. } : {},
  1341. ...buildSceneSubmitParams(),
  1342. is_check: 0 // 正式生成
  1343. }
  1344. // 开启进度弹窗
  1345. requesting.value = true
  1346. partErrList.value = []
  1347. message.value = '正在为您处理,请稍后'
  1348. progress.value = 0
  1349. // 清空之前的进度消息
  1350. progressMessages.value = []
  1351. showMessageHistory.value = true
  1352. // 启用新的进度条并初始化步骤
  1353. useNewProgress.value = true
  1354. // 清空之前的进度步骤
  1355. progressSteps.value = []
  1356. // 从检测结果中获取步骤信息
  1357. const backendSteps = checkResult?.data?.progress || []
  1358. initProgressSteps(backendSteps)
  1359. openLoadingDialog(goods_art_nos.value.length * 10)
  1360. clientStore.ipc.removeAllListeners(icpList.socket.message + '_detail_result_progress');
  1361. clientStore.ipc.send(icpList.generate.generatePhotoDetail, params);
  1362. /*
  1363. * detail_result_progress
  1364. *
  1365. * */
  1366. // 监听进度消息
  1367. clientStore.ipc.removeAllListeners(icpList.socket.message + '_detail_progress');
  1368. clientStore.ipc.on(icpList.socket.message + '_detail_progress', (event, data) => {
  1369. console.log('_detail_progress', data);
  1370. handleProgressMessage(data)
  1371. });
  1372. // 监听抠图进度消息
  1373. clientStore.ipc.removeAllListeners(icpList.socket.message + '_segment_progress');
  1374. clientStore.ipc.on(icpList.socket.message + '_segment_progress', (event, data) => {
  1375. console.log('_segment_progress', data);
  1376. handleSegmentProgressMessage(data)
  1377. });
  1378. // 监听上脚图进度消息
  1379. clientStore.ipc.removeAllListeners(icpList.socket.message + '_upper_footer_progress');
  1380. clientStore.ipc.on(icpList.socket.message + '_upper_footer_progress', (event, data) => {
  1381. console.log('_upper_footer_progress', data);
  1382. handleUpperFooterProgressMessage(data)
  1383. });
  1384. // 监听场景图进度消息
  1385. clientStore.ipc.removeAllListeners(icpList.socket.message + '_scene_progress');
  1386. clientStore.ipc.on(icpList.socket.message + '_scene_progress', (event, data) => {
  1387. console.log('_scene_progress', data);
  1388. handleSceneProgressMessage(data)
  1389. });
  1390. // 监听商品上传进度消息
  1391. clientStore.ipc.removeAllListeners(icpList.socket.message + '_upload_goods_progress');
  1392. clientStore.ipc.on(icpList.socket.message + '_upload_goods_progress', (event, data) => {
  1393. console.log('_upload_goods_progress', data);
  1394. handleUploadGoodsProgressMessage(data)
  1395. });
  1396. clientStore.ipc.on(icpList.socket.message + '_detail_result_progress', (event, result) => {
  1397. if (result.code !== 0) {
  1398. if (result.msg) {
  1399. handleFail(result.msg)
  1400. message.value = 'result.msg'
  1401. }
  1402. progress.value = 0
  1403. loadingDialogVisible.value = false
  1404. requesting.value = false
  1405. return;
  1406. }
  1407. console.log('result', result)
  1408. requesting.value = true
  1409. setTimeout(() => {
  1410. clientStore.ipc.removeAllListeners(icpList.socket.message + '_detail_result_progress');
  1411. clientStore.ipc.removeAllListeners(icpList.socket.message + '_detail_progress');
  1412. clientStore.ipc.removeAllListeners(icpList.socket.message + '_segment_progress');
  1413. clientStore.ipc.removeAllListeners(icpList.socket.message + '_upper_footer_progress');
  1414. clientStore.ipc.removeAllListeners(icpList.socket.message + '_scene_progress');
  1415. clientStore.ipc.removeAllListeners(icpList.socket.message + '_upload_goods_progress');
  1416. }, 100)
  1417. clearInterval(INTERVAL.value)
  1418. if (result.code === 0) {
  1419. const { output_folder, list } = result.data
  1420. const allSuccess = list.every(item => item.success);
  1421. const allFailure = list.every(item => !item.success);
  1422. if (allSuccess) {
  1423. console.log("全部成功")
  1424. handleSuccess(output_folder, '全部生成成功')
  1425. } else if (allFailure) {
  1426. console.log("全部失败");
  1427. handleFailure(list)
  1428. } else {
  1429. console.log("部分成功,部分失败");
  1430. handlePartSuccess(output_folder, list)
  1431. }
  1432. } else {
  1433. console.log('code全部生成失败')
  1434. handleFail(result.msg)
  1435. }
  1436. //生成失败 (接口请求失败)
  1437. function handleFail(errorMsg: string) {
  1438. // loadingDialogVisible.value = false
  1439. // disabledButton.value = false
  1440. if (errorMsg) {
  1441. ElMessage.error(errorMsg)
  1442. }
  1443. requesting.value = false // 重置请求状态,允许再次生成
  1444. // 处理完成后停止监听进度消息
  1445. // clientStore.ipc.removeAllListeners(icpList.socket.message + '_detail_progress');
  1446. // clientStore.ipc.removeAllListeners(icpList.socket.message + '_segment_progress');
  1447. }
  1448. // 全部生成成功
  1449. function handleSuccess(href, loadingMsg) {
  1450. // 埋点:生成完成
  1451. setLogInfo(route, { action: '生成完成', output_folder: href, message: loadingMsg });
  1452. completeDirectory.value = href
  1453. progress.value = 100
  1454. disabledButton.value = false
  1455. message.value = loadingMsg
  1456. requesting.value = false // 重置请求状态,允许再次生成
  1457. // handleComplete()
  1458. }
  1459. // 部分成功
  1460. function handlePartSuccess(output_folder: string, partSuccessList) {
  1461. let errorList = []
  1462. partSuccessList.map(item => {
  1463. if (!item.success) {
  1464. errorList.push(item)
  1465. }
  1466. })
  1467. partErrList.value = errorList
  1468. handleSuccess(output_folder, '部分货号生成失败')
  1469. }
  1470. // 全部生成失败
  1471. function handleFailure(partSuccessList) {
  1472. // 埋点:生成失败(携带货号)
  1473. const failedGoods = (partSuccessList || []).map(item => item.goods_art_no).filter(Boolean)
  1474. setLogInfo(route, { action: '生成失败', error_count: partSuccessList.length, goods_art_nos: goods_art_nos.value, failed_goods_art_nos: failedGoods });
  1475. let errorList = []
  1476. partSuccessList.map(item => {
  1477. if (!item.success) {
  1478. errorList.push(item)
  1479. }
  1480. })
  1481. partErrList.value = errorList
  1482. completeDirectory.value = ''
  1483. progress.value = 100
  1484. disabledButton.value = true
  1485. message.value = '全部货号生成失败'
  1486. requesting.value = false // 重置请求状态,允许再次生成
  1487. }
  1488. requesting.value = false
  1489. });
  1490. }
  1491. const openLoadingDialog = (timer: number) => {
  1492. loadingDialogVisible.value = true
  1493. disabledButton.value = true
  1494. // 根据传入的秒数计算每次增加的进度值
  1495. const step = 100 / timer
  1496. INTERVAL.value = setInterval(() => {
  1497. if (progress.value < 50) {
  1498. progress.value = Math.min(progress.value + step, 100)
  1499. } else if (progress.value < 70) {
  1500. progress.value = Math.min(progress.value + step / 2, 100)
  1501. } if (progress.value < 85) {
  1502. progress.value = Math.min(progress.value + step / 5, 100)
  1503. } else if (progress.value < 90) {
  1504. progress.value = Math.min(progress.value + step / 10, 100)
  1505. } else if (progress.value < 95) {
  1506. progress.value = Math.min(progress.value + step / 50, 100)// 新增中间阶段
  1507. } else {
  1508. progress.value = Math.min(progress.value + step / 100, 100)
  1509. }
  1510. }, 1000)
  1511. }
  1512. //logo
  1513. const logoList = ref([])
  1514. const logoLoadError = ref(false)
  1515. const logoPreviewVisible = ref(false)
  1516. const logoPreviewUrl = ref('')
  1517. // 打开LOGO上传
  1518. const handleLogoSelected = (path?: string) => {
  1519. if (!path) return
  1520. form.logo_path = path
  1521. logoLoadError.value = false
  1522. saveLogoToCache(form.logo_path)
  1523. }
  1524. const openLogoUpload = () => {
  1525. clientStore.ipc.removeAllListeners(icpList.utils.openImage);
  1526. clientStore.ipc.send(icpList.utils.openImage);
  1527. clientStore.ipc.on(icpList.utils.openImage, async (event, result) => {
  1528. if (result && result.filePath) {
  1529. handleLogoSelected(result.filePath)
  1530. }
  1531. clientStore.ipc.removeAllListeners(icpList.utils.openImage);
  1532. })
  1533. }
  1534. // 预览LOGO
  1535. const previewLogo = () => {
  1536. if (form.logo_path) {
  1537. logoPreviewUrl.value = 'file:///' + form.logo_path
  1538. logoPreviewVisible.value = true
  1539. }
  1540. }
  1541. // 删除LOGO
  1542. const removeLogo = () => {
  1543. if (form.logo_path) {
  1544. saveLogoToCache('')
  1545. form.logo_path = ''
  1546. /* const currentLogoPath = form.logo_path
  1547. clientStore.ipc.send(icpList.generate.deleteLogo, {
  1548. path: currentLogoPath
  1549. });
  1550. clientStore.ipc.on(icpList.generate.deleteLogo, async (event, result) => {
  1551. console.log('deleteLogo', result);
  1552. form.logo_path = ''
  1553. saveLogoToCache('')
  1554. logoLoadError.value = false
  1555. // 从列表中移除
  1556. const index = logoList.value.indexOf(currentLogoPath)
  1557. if (index > -1) {
  1558. logoList.value.splice(index, 1)
  1559. }
  1560. clientStore.ipc.removeAllListeners(icpList.generate.deleteLogo);
  1561. })*/
  1562. }
  1563. }
  1564. const handleLogoLoadError = () => {
  1565. if (!form.logo_path) return
  1566. if (!logoLoadError.value) {
  1567. logoLoadError.value = true
  1568. form.logo_path = ''
  1569. saveLogoToCache('')
  1570. ElMessage.warning('LOGO加载出错或文件已被删除,请重新上传')
  1571. }
  1572. }
  1573. const getLogolist = async () => {
  1574. clientStore.ipc.send(icpList.generate.getLogoList);
  1575. clientStore.ipc.on(icpList.generate.getLogoList, async (event, result) => {
  1576. // 保持数组格式,兼容老的格式
  1577. logoList.value = result.data || []
  1578. console.log('getLogoList', result.data)
  1579. // 只使用第一个LOGO(如果存在且当前没有选择)
  1580. if (logoList.value.length && !form.logo_path) {
  1581. form.logo_path = logoList.value[0]
  1582. logoLoadError.value = false
  1583. // 保存默认LOGO到缓存
  1584. saveLogoToCache(form.logo_path)
  1585. }
  1586. clientStore.ipc.removeAllListeners(icpList.generate.getLogoList);
  1587. })
  1588. }
  1589. function selectExcel() {
  1590. clientStore.ipc.removeAllListeners(icpList.utils.openFile);
  1591. clientStore.ipc.send(icpList.utils.openFile, {
  1592. filters: [
  1593. { name: '支持xls,xlsx', extensions: ['xlsx', 'xls'] }
  1594. ],
  1595. title: "选择基础文件资料"
  1596. });
  1597. clientStore.ipc.on(icpList.utils.openFile, async (event, result) => {
  1598. form.excel_path = result
  1599. clientStore.ipc.removeAllListeners(icpList.utils.openFile);
  1600. })
  1601. }
  1602. const Router = useRouter()
  1603. //打开主图详情
  1604. function openPhotographySeniorDetail() {
  1605. const { href } = Router.resolve({
  1606. name: 'PhotographySeniorDetail'
  1607. })
  1608. clientStore.ipc.removeAllListeners(icpList.utils.openMain);
  1609. let params = {
  1610. title: '详情高级配置',
  1611. width: 1000,
  1612. height: 630,
  1613. frame: true,
  1614. id: "PhotographySeniorDetail",
  1615. url: getRouterUrl(href)
  1616. }
  1617. clientStore.ipc.send(icpList.utils.openMain, params);
  1618. }
  1619. // 处理打开目录事件
  1620. const handleOpenFolder = (event) => {
  1621. const { folder } = event.detail;
  1622. if (folder) {
  1623. openOutputDir(folder);
  1624. }
  1625. }
  1626. const handleComplete = () => {
  1627. // loadingDialogVisible.value = false
  1628. // 这里可以添加打开目录的逻辑
  1629. if (!completeDirectory.value) {
  1630. openOutputDir()
  1631. return
  1632. }
  1633. clientStore.ipc.removeAllListeners(icpList.utils.shellFun);
  1634. let params = {
  1635. action: 'openPath',
  1636. params: completeDirectory.value?.replace(/\//g, '\\')
  1637. }
  1638. clientStore.ipc.send(icpList.utils.shellFun, params);
  1639. }
  1640. const selectFolder = () => {
  1641. clientStore.ipc.removeAllListeners(icpList.utils.openDirectory);
  1642. clientStore.ipc.send(icpList.utils.openDirectory);
  1643. clientStore.ipc.on(icpList.utils.openDirectory, async (event, result) => {
  1644. folderPath.value = result
  1645. clientStore.ipc.removeAllListeners(icpList.utils.openDirectory);
  1646. })
  1647. }
  1648. </script>
  1649. <style lang="scss" scoped>
  1650. // 服务标签页样式
  1651. .aigc-sprite {
  1652. position: absolute;
  1653. width: 0;
  1654. height: 0;
  1655. overflow: hidden;
  1656. }
  1657. .detail-page {
  1658. height: calc(100vh - 50px);
  1659. overflow: auto;
  1660. background: #F2F5FA;
  1661. display: flex;
  1662. flex-direction: column;
  1663. }
  1664. .aigc-wrap {
  1665. max-width: 1780px;
  1666. width: 100%;
  1667. min-width: 1420px;
  1668. margin: 0 auto;
  1669. padding: 16px 20px 22px;
  1670. box-sizing: border-box;
  1671. flex: 1;
  1672. min-height: 0;
  1673. display: flex;
  1674. flex-direction: column;
  1675. }
  1676. .aigc-board {
  1677. display: grid;
  1678. grid-template-columns: minmax(320px, 0.85fr) minmax(320px, 0.85fr) minmax(400px, 1.5fr) 330px;
  1679. grid-template-rows: minmax(0, 1fr);
  1680. gap: 14px;
  1681. align-items: stretch;
  1682. flex: 1;
  1683. min-height: 0;
  1684. min-width: 1420px;
  1685. }
  1686. .fcard {
  1687. grid-row: 1;
  1688. background: #fff;
  1689. border: 1px solid #e7ebf4;
  1690. border-radius: 16px;
  1691. box-shadow: 0 1px 2px rgba(23, 43, 99, 0.04), 0 10px 30px rgba(23, 43, 99, 0.06);
  1692. display: flex;
  1693. flex-direction: column;
  1694. overflow: hidden;
  1695. min-width: 320px;
  1696. min-height: 0;
  1697. height: 100%;
  1698. max-height: 100%;
  1699. }
  1700. .fcard-wide { min-width: 400px; }
  1701. .fhead {
  1702. display: block;
  1703. padding: 11px 16px 9px;
  1704. border-bottom: 1px solid #e7ebf4;
  1705. text-align: left;
  1706. }
  1707. .fh-row {
  1708. display: flex;
  1709. align-items: flex-start;
  1710. justify-content: flex-start;
  1711. gap: 10px;
  1712. flex-wrap: nowrap;
  1713. text-align: left;
  1714. }
  1715. .fh-text {
  1716. min-width: 0;
  1717. flex: 1;
  1718. display: flex;
  1719. flex-direction: column;
  1720. align-items: flex-start;
  1721. text-align: left;
  1722. }
  1723. .fico {
  1724. flex: none;
  1725. width: 38px;
  1726. height: 38px;
  1727. border-radius: 11px;
  1728. display: grid;
  1729. place-items: center;
  1730. background: linear-gradient(135deg, #eef2ff, #e3e9ff);
  1731. color: #3d63f2;
  1732. svg { width: 20px; height: 20px; display: block; }
  1733. }
  1734. .fh-t {
  1735. font-size: 20px;
  1736. font-weight: 800;
  1737. letter-spacing: 0.3px;
  1738. line-height: 1.25;
  1739. color: #1a2233;
  1740. white-space: nowrap;
  1741. text-align: left;
  1742. align-self: flex-start;
  1743. }
  1744. .fh-s {
  1745. font-size: 12.5px;
  1746. color: #8b95ab;
  1747. margin-top: 4px;
  1748. text-align: left;
  1749. align-self: flex-start;
  1750. white-space: nowrap;
  1751. overflow: hidden;
  1752. text-overflow: ellipsis;
  1753. max-width: 100%;
  1754. }
  1755. .toggle {
  1756. margin-left: auto;
  1757. align-self: center;
  1758. flex: none;
  1759. display: flex;
  1760. align-items: center;
  1761. gap: 7px;
  1762. .swl {
  1763. font-size: 13.5px;
  1764. font-weight: 600;
  1765. color: #8b95ab;
  1766. min-width: 38px;
  1767. text-align: right;
  1768. }
  1769. }
  1770. .sw {
  1771. position: relative;
  1772. display: inline-block;
  1773. width: 46px;
  1774. height: 25px;
  1775. flex: none;
  1776. input {
  1777. position: absolute;
  1778. inset: 0;
  1779. opacity: 0;
  1780. margin: 0;
  1781. cursor: pointer;
  1782. z-index: 2;
  1783. }
  1784. i {
  1785. position: absolute;
  1786. inset: 0;
  1787. border-radius: 13px;
  1788. background: #cbd3e3;
  1789. transition: background 0.18s;
  1790. &::after {
  1791. content: "";
  1792. position: absolute;
  1793. top: 3px;
  1794. left: 3px;
  1795. width: 19px;
  1796. height: 19px;
  1797. border-radius: 50%;
  1798. background: #fff;
  1799. box-shadow: 0 1px 3px rgba(10, 25, 70, 0.3);
  1800. transition: transform 0.18s;
  1801. }
  1802. }
  1803. input:checked + i {
  1804. background: linear-gradient(100deg, #3e7bfa, #7a5af8);
  1805. }
  1806. input:checked + i::after {
  1807. transform: translateX(21px);
  1808. }
  1809. }
  1810. .fbody {
  1811. position: relative;
  1812. padding: 14px 16px 12px;
  1813. display: flex;
  1814. flex-direction: column;
  1815. gap: 12px;
  1816. flex: 1;
  1817. min-width: 0;
  1818. min-height: 0;
  1819. overflow: hidden;
  1820. > :deep(.model-card),
  1821. > :deep(.scene-card) {
  1822. flex: 1 1 0;
  1823. min-height: 0;
  1824. }
  1825. }
  1826. .ffoot {
  1827. margin-top: auto;
  1828. padding: 9px 16px;
  1829. border-top: 1px dashed #d9dfec;
  1830. color: #8b95ab;
  1831. font-size: 13px;
  1832. display: flex;
  1833. gap: 7px;
  1834. align-items: flex-start;
  1835. line-height: 1.5;
  1836. .ic {
  1837. flex: none;
  1838. width: 14px;
  1839. height: 14px;
  1840. transform: translateY(1px);
  1841. display: block;
  1842. }
  1843. }
  1844. .off .ffoot {
  1845. opacity: 0.38;
  1846. pointer-events: none;
  1847. filter: saturate(0.5);
  1848. }
  1849. .off .fbody {
  1850. pointer-events: none;
  1851. }
  1852. .off .fbody::after {
  1853. content: "";
  1854. position: absolute;
  1855. inset: 0;
  1856. background: rgba(255, 255, 255, 0.62);
  1857. z-index: 5;
  1858. }
  1859. .off .fbody :deep(.hbtns) {
  1860. position: relative;
  1861. z-index: 6;
  1862. pointer-events: auto;
  1863. }
  1864. .tabs-row {
  1865. display: flex;
  1866. align-items: flex-end;
  1867. gap: 12px;
  1868. border-bottom: 1.5px solid #e7ebf4;
  1869. }
  1870. .tabs-row-tools {
  1871. justify-content: flex-end;
  1872. border-bottom: 0;
  1873. padding-bottom: 0;
  1874. .hbtns { padding-bottom: 0; }
  1875. }
  1876. .tabs {
  1877. display: flex;
  1878. gap: 16px;
  1879. flex: 1;
  1880. min-width: 0;
  1881. }
  1882. .tab {
  1883. background: none;
  1884. border: 0;
  1885. padding: 2px 1px 10px;
  1886. font-size: 14px;
  1887. font-weight: 700;
  1888. color: #46516a;
  1889. position: relative;
  1890. white-space: nowrap;
  1891. &.on {
  1892. color: #3d63f2;
  1893. &::after {
  1894. content: "";
  1895. position: absolute;
  1896. left: 0;
  1897. right: 0;
  1898. bottom: -1.5px;
  1899. height: 3px;
  1900. border-radius: 3px;
  1901. background: linear-gradient(100deg, #3e7bfa, #7a5af8);
  1902. }
  1903. }
  1904. }
  1905. .hbtns { display: flex; gap: 6px; flex: none; padding-bottom: 7px; }
  1906. .hbtn {
  1907. width: 27px;
  1908. height: 27px;
  1909. border-radius: 50%;
  1910. border: 1.5px solid #d9dfec;
  1911. background: #fff;
  1912. color: #46516a;
  1913. cursor: pointer;
  1914. display: grid;
  1915. place-items: center;
  1916. padding: 0;
  1917. svg { width: 13px; height: 13px; display: block; }
  1918. &:hover {
  1919. border-color: #3d63f2;
  1920. color: #3d63f2;
  1921. background: #f5f8ff;
  1922. }
  1923. }
  1924. .tpl-hscroll {
  1925. display: grid;
  1926. grid-auto-flow: column;
  1927. grid-template-rows: minmax(0, 1fr);
  1928. grid-auto-columns: calc(50% - 20px);
  1929. gap: 11px;
  1930. overflow-x: auto;
  1931. overflow-y: hidden;
  1932. scroll-snap-type: x mandatory;
  1933. padding-bottom: 2px;
  1934. scrollbar-width: none;
  1935. flex: 1;
  1936. min-height: 0;
  1937. &::-webkit-scrollbar { display: none; }
  1938. > * { scroll-snap-align: start; min-width: 0; }
  1939. }
  1940. .tpl {
  1941. position: relative;
  1942. border: 1.5px solid #d9dfec;
  1943. border-radius: 13px;
  1944. overflow: hidden;
  1945. cursor: pointer;
  1946. background: #fff;
  1947. display: flex;
  1948. flex-direction: column;
  1949. height: 100%;
  1950. min-height: 0;
  1951. max-height: 100%;
  1952. margin: 0;
  1953. transition: all 0.15s;
  1954. &:hover {
  1955. transform: translateY(-2px);
  1956. box-shadow: 0 10px 22px rgba(23, 43, 99, 0.14);
  1957. }
  1958. &.sel {
  1959. border: 2px solid #3d63f2;
  1960. box-shadow: 0 8px 22px rgba(61, 99, 242, 0.2);
  1961. }
  1962. .ck {
  1963. position: absolute;
  1964. top: 6px;
  1965. right: 6px;
  1966. width: 21px;
  1967. height: 21px;
  1968. border-radius: 50%;
  1969. background: #3d63f2;
  1970. color: #fff;
  1971. font-size: 12px;
  1972. display: grid;
  1973. place-items: center;
  1974. box-shadow: 0 2px 6px rgba(23, 43, 99, 0.35);
  1975. z-index: 2;
  1976. }
  1977. .template-download-btn {
  1978. position: absolute;
  1979. top: 8px;
  1980. left: 8px;
  1981. z-index: 3;
  1982. color: #3d63f2;
  1983. height: 26px;
  1984. line-height: 26px;
  1985. padding: 0 8px;
  1986. border-radius: 4px;
  1987. background: rgba(255, 255, 255, 0.92);
  1988. font-size: 12px;
  1989. font-weight: 700;
  1990. }
  1991. .tpl-head {
  1992. padding: 11px 14px 8px;
  1993. background: #eef2ff;
  1994. b {
  1995. display: block;
  1996. font-size: 16px;
  1997. font-weight: 800;
  1998. line-height: 1.3;
  1999. color: #1a2233;
  2000. }
  2001. }
  2002. .tpl-img-wrap {
  2003. flex: 1;
  2004. min-height: 0;
  2005. overflow: hidden;
  2006. background: #f5f7fb;
  2007. position: relative;
  2008. }
  2009. .tpl-img {
  2010. width: 100%;
  2011. height: auto;
  2012. display: block;
  2013. :deep(.el-image__inner) {
  2014. width: 100% !important;
  2015. height: auto !important;
  2016. object-fit: cover;
  2017. object-position: top center;
  2018. display: block;
  2019. }
  2020. }
  2021. .tpl-mini {
  2022. display: flex;
  2023. align-items: center;
  2024. gap: 10px;
  2025. padding: 8px 14px 9px;
  2026. background: #eef2ff;
  2027. font-size: 12px;
  2028. .lk {
  2029. color: #3d63f2;
  2030. font-weight: 700;
  2031. cursor: pointer;
  2032. &.danger { color: #ff4c00; }
  2033. }
  2034. }
  2035. }
  2036. .template-tips {
  2037. flex: none;
  2038. display: flex;
  2039. align-items: flex-start;
  2040. justify-content: flex-start;
  2041. gap: 8px;
  2042. height: auto;
  2043. min-height: 36px;
  2044. line-height: 1.55;
  2045. padding: 8px 10px;
  2046. background: #fff6dc;
  2047. border-radius: 10px;
  2048. border: 1px solid #f1e2ac;
  2049. color: #7a5e17;
  2050. font-size: 13px;
  2051. text-align: left;
  2052. .el-icon {
  2053. flex: none;
  2054. margin-top: 2px;
  2055. }
  2056. span {
  2057. flex: 1;
  2058. min-width: 0;
  2059. white-space: normal;
  2060. word-break: break-word;
  2061. text-align: left;
  2062. }
  2063. }
  2064. .side {
  2065. display: flex;
  2066. flex-direction: column;
  2067. gap: 12px;
  2068. min-width: 330px;
  2069. min-height: 0;
  2070. overflow: auto;
  2071. }
  2072. .scard {
  2073. background: #fff;
  2074. border: 1px solid #e7ebf4;
  2075. border-radius: 14px;
  2076. box-shadow: 0 1px 2px rgba(23, 43, 99, 0.04), 0 10px 30px rgba(23, 43, 99, 0.06);
  2077. padding: 11px 15px;
  2078. .stitle {
  2079. font-size: 15.5px;
  2080. font-weight: 800;
  2081. margin-bottom: 9px;
  2082. color: #1a2233;
  2083. }
  2084. }
  2085. .trow {
  2086. display: flex;
  2087. align-items: center;
  2088. gap: 10px;
  2089. padding: 8px 6px;
  2090. border-radius: 9px;
  2091. cursor: pointer;
  2092. font-size: 14px;
  2093. font-weight: 700;
  2094. color: #1a2233;
  2095. & + .trow { border-top: 1px solid #e7ebf4; }
  2096. &:hover { background: #f5f7fe; }
  2097. .tic {
  2098. flex: none;
  2099. width: 30px;
  2100. height: 30px;
  2101. border-radius: 9px;
  2102. background: linear-gradient(135deg, #eef2ff, #e3e9ff);
  2103. color: #3d63f2;
  2104. display: grid;
  2105. place-items: center;
  2106. svg { width: 16px; height: 16px; display: block; }
  2107. }
  2108. .arr {
  2109. margin-left: auto;
  2110. color: #8b95ab;
  2111. width: 15px;
  2112. height: 15px;
  2113. flex: none;
  2114. }
  2115. &.disabled {
  2116. opacity: 0.55;
  2117. cursor: not-allowed;
  2118. }
  2119. }
  2120. .gbtn {
  2121. width: 100%;
  2122. height: 42px;
  2123. border-radius: 11px;
  2124. border: 1.5px solid #3d63f2;
  2125. color: #3d63f2;
  2126. background: #fff;
  2127. font-size: 14.5px;
  2128. font-weight: 800;
  2129. display: flex;
  2130. align-items: center;
  2131. justify-content: center;
  2132. gap: 8px;
  2133. cursor: pointer;
  2134. svg { width: 17px; height: 17px; display: block; }
  2135. &:hover { background: #f3f6ff; }
  2136. }
  2137. .data-mode {
  2138. display: grid;
  2139. grid-template-columns: 1fr 1fr;
  2140. gap: 8px;
  2141. padding: 4px;
  2142. background: #f3f5f6;
  2143. border-radius: 10px;
  2144. }
  2145. .data-mode-btn {
  2146. height: 34px;
  2147. border: 0;
  2148. border-radius: 8px;
  2149. background: transparent;
  2150. color: #46516a;
  2151. font-size: 13.5px;
  2152. font-weight: 700;
  2153. cursor: pointer;
  2154. &.on {
  2155. background: #fff;
  2156. color: #3d63f2;
  2157. box-shadow: 0 1px 3px rgba(23, 43, 99, 0.08);
  2158. }
  2159. }
  2160. .data-prep-link {
  2161. background: none;
  2162. border: 0;
  2163. color: #3d63f2;
  2164. font-size: 13px;
  2165. font-weight: 700;
  2166. padding: 0;
  2167. text-align: left;
  2168. cursor: pointer;
  2169. &:hover { text-decoration: underline; }
  2170. }
  2171. .sys-hint {
  2172. font-size: 13px;
  2173. color: #8b95ab;
  2174. line-height: 1.5;
  2175. text-align: left;
  2176. padding: 8px 2px 0;
  2177. }
  2178. .up {
  2179. border: 1.8px dashed #d9dfec;
  2180. border-radius: 13px;
  2181. background: #fafbfe;
  2182. display: flex;
  2183. flex-direction: column;
  2184. align-items: center;
  2185. justify-content: center;
  2186. gap: 7px;
  2187. padding: 14px 12px;
  2188. text-align: center;
  2189. cursor: pointer;
  2190. &:hover {
  2191. border-color: #3d63f2;
  2192. background: #f5f8ff;
  2193. }
  2194. .uic {
  2195. width: 40px;
  2196. height: 40px;
  2197. border-radius: 11px;
  2198. background: linear-gradient(135deg, #eef2ff, #e3e9ff);
  2199. display: grid;
  2200. place-items: center;
  2201. color: #3d63f2;
  2202. svg { width: 21px; height: 21px; display: block; }
  2203. }
  2204. .t { font-size: 14px; font-weight: 700; color: #46516a; }
  2205. .s { font-size: 12px; color: #8b95ab; }
  2206. &.is-error {
  2207. border-color: #ff4d4f;
  2208. .t, .s { color: #ff4d4f; }
  2209. }
  2210. }
  2211. .frow2 {
  2212. display: grid;
  2213. grid-template-columns: 1fr 1fr;
  2214. gap: 9px;
  2215. label {
  2216. display: block;
  2217. font-size: 13px;
  2218. font-weight: 600;
  2219. color: #46516a;
  2220. margin-bottom: 5px;
  2221. white-space: nowrap;
  2222. }
  2223. .publish-select {
  2224. width: 100%;
  2225. :deep(.el-select__tags) {
  2226. max-width: calc(100% - 32px);
  2227. padding-right: 4px;
  2228. box-sizing: border-box;
  2229. }
  2230. :deep(.el-input__inner) {
  2231. padding-right: 28px;
  2232. }
  2233. :deep(.el-input__suffix) {
  2234. z-index: 2;
  2235. }
  2236. :deep(.el-select__caret) {
  2237. position: relative;
  2238. z-index: 3;
  2239. }
  2240. }
  2241. }
  2242. .cta {
  2243. margin-top: auto;
  2244. flex: none;
  2245. position: sticky;
  2246. bottom: 0;
  2247. z-index: 2;
  2248. border: 0;
  2249. border-radius: 15px;
  2250. padding: 13px;
  2251. background: linear-gradient(100deg, #3e7bfa, #7a5af8);
  2252. color: #fff;
  2253. display: flex;
  2254. flex-direction: column;
  2255. align-items: center;
  2256. gap: 3px;
  2257. box-shadow: 0 12px 28px rgba(84, 98, 246, 0.35);
  2258. cursor: pointer;
  2259. transition: all 0.15s;
  2260. &:hover {
  2261. transform: translateY(-2px);
  2262. box-shadow: 0 16px 34px rgba(84, 98, 246, 0.42);
  2263. }
  2264. &:disabled { opacity: 0.65; cursor: not-allowed; transform: none; }
  2265. b {
  2266. font-size: 18px;
  2267. font-weight: 800;
  2268. letter-spacing: 2px;
  2269. display: flex;
  2270. align-items: center;
  2271. gap: 8px;
  2272. svg { width: 19px; height: 19px; display: block; }
  2273. }
  2274. small { font-size: 12px; opacity: 0.88; letter-spacing: 0.4px; }
  2275. }
  2276. .ybar {
  2277. flex: none;
  2278. margin-top: 14px;
  2279. background: #fff6dc;
  2280. border: 1px solid #f1e2ac;
  2281. border-radius: 12px;
  2282. padding: 10px 16px;
  2283. color: #7a5e17;
  2284. font-size: 13.5px;
  2285. display: flex;
  2286. gap: 8px;
  2287. align-items: flex-start;
  2288. line-height: 1.55;
  2289. b { color: #6b4a08; }
  2290. .ic {
  2291. flex: none;
  2292. width: 15px;
  2293. height: 15px;
  2294. transform: translateY(2px);
  2295. display: block;
  2296. }
  2297. }
  2298. .side .logo-upload-preview {
  2299. height: 110px;
  2300. }
  2301. .side .data-prep-section {
  2302. height: auto;
  2303. }
  2304. @media (max-width: 1220px) {
  2305. .detail-page { overflow: auto; }
  2306. }
  2307. .service-tabs {
  2308. display: flex;
  2309. gap: 10px;
  2310. padding: 20px;
  2311. .service-tab {
  2312. display: flex;
  2313. flex: 1;
  2314. align-items: center;
  2315. justify-content: center;
  2316. gap: 10px;
  2317. padding: 10px 20px;
  2318. border: 1px solid #e8e8e8;
  2319. border-radius: 8px;
  2320. cursor: pointer;
  2321. transition: all 0.3s;
  2322. position: relative;
  2323. background: #fff;
  2324. height: 140px;
  2325. .tab-checkbox {
  2326. margin-right: 0;
  2327. position: absolute;
  2328. left: 10px;
  2329. top: 10px;
  2330. ::v-deep {
  2331. .is-checked .el-checkbox__inner {
  2332. background: #2957FF;
  2333. border-color: #2957FF;
  2334. }
  2335. .el-checkbox__inner {
  2336. border-radius: 18px;
  2337. transform: scale(1.2);
  2338. }
  2339. }
  2340. }
  2341. .tab-img {
  2342. width: 48px;
  2343. height: 48px;
  2344. background: #EFF6FF;
  2345. border-radius: 10px;
  2346. margin: 0 auto 5px;
  2347. }
  2348. .tab-icon {
  2349. width: 24px;
  2350. height: 24px;
  2351. }
  2352. .tab-name {
  2353. font-size: 14px;
  2354. color: #333;
  2355. font-weight: 500;
  2356. }
  2357. &.external-tool {
  2358. cursor: pointer;
  2359. opacity: 1;
  2360. background: #fff;
  2361. }
  2362. .tab-edit-btn {
  2363. position: absolute;
  2364. right: 10px;
  2365. top: 10px;
  2366. width: 24px;
  2367. height: 24px;
  2368. display: flex;
  2369. align-items: center;
  2370. justify-content: center;
  2371. background: rgba(41, 87, 255, 0.1);
  2372. border-radius: 4px;
  2373. opacity: 0;
  2374. transition: opacity 0.3s;
  2375. cursor: pointer;
  2376. .el-icon {
  2377. color: #2957FF;
  2378. font-size: 16px;
  2379. }
  2380. }
  2381. &:hover {
  2382. border-color: #2957FF;
  2383. .tab-edit-btn {
  2384. opacity: 1;
  2385. }
  2386. }
  2387. &.active {
  2388. border-color: #2957FF;
  2389. border-bottom: 4px solid #2957FF;
  2390. .tab-img {
  2391. background: #2957FF;
  2392. }
  2393. }
  2394. &.disabled {
  2395. opacity: 0.8;
  2396. cursor: not-allowed;
  2397. background: #f5f5f5;
  2398. }
  2399. }
  2400. }
  2401. .detail-container {
  2402. background: #F5F6F7;
  2403. padding: 0 20px 20px 20px; // 底部留出空间给固定按钮
  2404. .detail-content {
  2405. max-width: 100%;
  2406. }
  2407. width: 100%;
  2408. min-width: 600px;
  2409. overflow: hidden;
  2410. }
  2411. .service-section {
  2412. margin-bottom: 20px;
  2413. .service-cards {
  2414. display: flex;
  2415. gap: 60px;
  2416. margin-top: 16px;
  2417. }
  2418. .service-card {
  2419. width: 240px;
  2420. height: 140px;
  2421. border-radius: 8px;
  2422. background: #fff;
  2423. border: 1px solid #e0e0e0;
  2424. display: flex;
  2425. align-items: flex-start;
  2426. padding: 12px;
  2427. cursor: pointer;
  2428. transition: all 0.3s ease;
  2429. position: relative;
  2430. &:hover {
  2431. border-color: #2957FF;
  2432. box-shadow: 0 2px 8px rgba(41, 87, 255, 0.1);
  2433. }
  2434. &.active {
  2435. border: 3px solid #2957FF;
  2436. background: #f8f9ff;
  2437. box-shadow: 0 4px 12px rgba(41, 87, 255, 0.25);
  2438. }
  2439. .service-checkbox {
  2440. position: absolute;
  2441. left: -40px;
  2442. top: 10px;
  2443. width: 30px;
  2444. transform: scale(1.5);
  2445. z-index: 10;
  2446. ::v-deep {
  2447. .el-checkbox {
  2448. display: block;
  2449. margin-right: 0;
  2450. }
  2451. .el-checkbox__input {
  2452. cursor: pointer;
  2453. }
  2454. }
  2455. }
  2456. .service-content {
  2457. flex: 1;
  2458. display: flex;
  2459. flex-direction: column;
  2460. align-items: center;
  2461. position: absolute;
  2462. left: 0;
  2463. top: 0;
  2464. right: 0;
  2465. bottom: 0;
  2466. ;
  2467. }
  2468. .service-image {
  2469. position: absolute;
  2470. width: 100%;
  2471. height: 100%;
  2472. img {
  2473. width: 100%;
  2474. height: 100%;
  2475. object-fit: cover;
  2476. border-radius: 4px;
  2477. }
  2478. .service-icon {
  2479. position: absolute;
  2480. top: 10px;
  2481. right: 10px;
  2482. width: 30px;
  2483. height: 30px;
  2484. background: #2957FF;
  2485. border-radius: 50%;
  2486. display: flex;
  2487. align-items: center;
  2488. justify-content: center;
  2489. color: white;
  2490. font-size: 18px;
  2491. }
  2492. }
  2493. .service-name {
  2494. font-size: 14px;
  2495. font-weight: 500;
  2496. text-align: center;
  2497. position: absolute;
  2498. background: rgba(0, 0, 0, .5);
  2499. height: 30px;
  2500. line-height: 30px;
  2501. color: #fff;
  2502. left: 0;
  2503. right: 0;
  2504. bottom: 0px
  2505. }
  2506. }
  2507. }
  2508. .logo-section,
  2509. .template-section,
  2510. .data-prep-section {}
  2511. .template-section {
  2512. background: #fff;
  2513. padding: 10px 20px 20px;
  2514. border-radius: 8px;
  2515. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  2516. .section-header {
  2517. display: flex;
  2518. justify-content: space-between;
  2519. align-items: center;
  2520. }
  2521. .template-tips {
  2522. height: auto;
  2523. min-height: 36px;
  2524. line-height: 1.55;
  2525. padding: 8px 10px;
  2526. background: #FFFBEA;
  2527. border-radius: 10px;
  2528. border: 1px solid #FEEEB0;
  2529. color: #9B4D26;
  2530. }
  2531. }
  2532. .template-section--disabled {
  2533. opacity: 0.8;
  2534. .template-list,
  2535. .template-pagination {
  2536. pointer-events: none;
  2537. }
  2538. }
  2539. .publish-section--disabled {
  2540. opacity: 0.6;
  2541. }
  2542. // 主布局:左右分栏
  2543. .main-layout {
  2544. display: flex;
  2545. gap: 20px;
  2546. align-items: flex-start;
  2547. .left-panel {
  2548. flex: 1;
  2549. min-width: 0;
  2550. }
  2551. .right-panel {
  2552. width: 400px;
  2553. flex-shrink: 0;
  2554. display: flex;
  2555. flex-direction: column;
  2556. gap: 20px;
  2557. }
  2558. }
  2559. .right-section {
  2560. background: #fff;
  2561. padding: 20px;
  2562. border-radius: 8px;
  2563. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  2564. &.data-prep-section {
  2565. height: 225px;
  2566. display: flex;
  2567. flex-direction: column;
  2568. box-sizing: border-box;
  2569. }
  2570. .section-title {
  2571. display: flex;
  2572. align-items: center;
  2573. gap: 10px;
  2574. font-weight: 600;
  2575. font-size: 16px;
  2576. color: #333333;
  2577. margin-bottom: 16px;
  2578. .section-title-line {
  2579. width: 3px;
  2580. height: 16px;
  2581. background: linear-gradient(135deg, #7C3AED 0%, #2957FF 100%);
  2582. border-radius: 2px;
  2583. }
  2584. .section-title-hint {
  2585. font-weight: normal;
  2586. font-size: 14px;
  2587. color: #999;
  2588. }
  2589. }
  2590. .data-prep-content {
  2591. display: flex;
  2592. flex-direction: column;
  2593. gap: 12px;
  2594. flex: 1;
  2595. .data-type-radio {
  2596. padding: 5px;
  2597. background: #F3F5F6;
  2598. border-radius: 10px;
  2599. ::v-deep {
  2600. .el-radio {
  2601. margin-right: 20px;
  2602. }
  2603. .el-radio-button {
  2604. flex: 1;
  2605. box-shadow: none !important;
  2606. .el-radio-button__inner {
  2607. width: 100%;
  2608. background: none !important;
  2609. border: none !important;
  2610. display: flex;
  2611. align-items: center;
  2612. border-radius: 10px !important;
  2613. justify-content: center;
  2614. img {
  2615. height: 14px;
  2616. margin: 0 5px;
  2617. position: relative;
  2618. top: -1px;
  2619. }
  2620. }
  2621. &.is-active {
  2622. background: #F8F9FF;
  2623. .el-radio-button__inner {
  2624. background: #fff !important;
  2625. color: #2957FF !important;
  2626. border-radius: 10px !important;
  2627. box-shadow: none !important;
  2628. }
  2629. }
  2630. }
  2631. }
  2632. }
  2633. .excel-upload-section {
  2634. display: flex;
  2635. flex-direction: column;
  2636. gap: 8px;
  2637. flex: 1;
  2638. .excel-upload-area {
  2639. width: 100%;
  2640. height: 64px;
  2641. border: 1px dashed #D9D9D9;
  2642. border-radius: 8px;
  2643. display: flex;
  2644. align-items: center;
  2645. padding: 0 16px;
  2646. cursor: pointer;
  2647. transition: all 0.3s;
  2648. background: #fff;
  2649. &:hover {
  2650. border-color: #2957FF;
  2651. background: #F8F9FF;
  2652. }
  2653. .excel-icon {
  2654. width: 32px;
  2655. height: 32px;
  2656. margin-right: 10px;
  2657. img {
  2658. width: 32px;
  2659. height: 32px;
  2660. display: block;
  2661. }
  2662. }
  2663. .excel-upload-text {
  2664. font-size: 14px;
  2665. color: #333;
  2666. font-weight: 500;
  2667. }
  2668. }
  2669. .excel-selected-info {
  2670. width: 100%;
  2671. height: 64px;
  2672. border: 1px solid #E5E6EB;
  2673. border-radius: 8px;
  2674. padding: 12px 16px;
  2675. background: #fff;
  2676. display: flex;
  2677. align-items: center;
  2678. justify-content: space-between;
  2679. gap: 16px;
  2680. box-sizing: border-box;
  2681. .excel-file-info {
  2682. display: flex;
  2683. align-items: center;
  2684. flex: 1;
  2685. min-width: 0;
  2686. .excel-icon {
  2687. width: 32px;
  2688. height: 32px;
  2689. margin-right: 10px;
  2690. img {
  2691. width: 32px;
  2692. height: 32px;
  2693. display: block;
  2694. }
  2695. }
  2696. .excel-file-text {
  2697. display: flex;
  2698. flex-direction: column;
  2699. min-width: 0;
  2700. max-width: 100%;
  2701. .excel-file-label {
  2702. font-size: 12px;
  2703. text-align: left;
  2704. color: #888;
  2705. margin-bottom: 4px;
  2706. }
  2707. .excel-file-name {
  2708. font-size: 14px;
  2709. color: #1D2129;
  2710. font-weight: 500;
  2711. white-space: nowrap;
  2712. overflow: hidden;
  2713. text-overflow: ellipsis;
  2714. max-width: 100%;
  2715. }
  2716. }
  2717. }
  2718. .reupload-btn {
  2719. flex-shrink: 0;
  2720. }
  2721. }
  2722. .download-link {
  2723. color: #2957FF;
  2724. text-decoration: underline;
  2725. padding: 0;
  2726. font-size: 14px;
  2727. margin-top: 0;
  2728. justify-content: flex-start;
  2729. }
  2730. }
  2731. }
  2732. .publish-content {
  2733. display: flex;
  2734. flex-direction: column;
  2735. gap: 15px;
  2736. .publish-form-item {
  2737. display: flex;
  2738. align-items: center;
  2739. gap: 8px;
  2740. .publish-label {
  2741. font-size: 14px;
  2742. color: #333;
  2743. margin-bottom: 4px;
  2744. text-align: left;
  2745. }
  2746. .publish-select {
  2747. flex-grow: 1;
  2748. ::v-deep {
  2749. .el-input.is-disabled .el-input__inner {
  2750. background-color: #F5F6F7;
  2751. border-color: #E8E8E8;
  2752. color: #999;
  2753. }
  2754. }
  2755. }
  2756. }
  2757. }
  2758. }
  2759. .logo-template-row {
  2760. display: flex;
  2761. gap: 24px;
  2762. align-items: flex-start;
  2763. .logo-col {
  2764. flex: 2;
  2765. min-width: 300px;
  2766. }
  2767. .template-col {
  2768. flex: 3;
  2769. }
  2770. }
  2771. .logo-section {
  2772. .upload-item {
  2773. border: 2px solid rgba(0, 0, 0, 0);
  2774. }
  2775. .active {
  2776. border: 2px solid #2957FF;
  2777. border-radius: 6px;
  2778. overflow: hidden;
  2779. ;
  2780. }
  2781. &.multi-line {
  2782. flex-direction: row; // 默认横向排列
  2783. flex-wrap: wrap; // 允许换行
  2784. align-items: flex-start; // 对齐方式调整为顶部对齐
  2785. .upload-item {
  2786. margin-bottom: 10px; // 每行之间增加间距
  2787. width: 90px; // 每行显示 4 个元素,减去外边距
  2788. box-sizing: border-box; // 确保宽度计算包含 padding 和 border
  2789. }
  2790. }
  2791. }
  2792. // LOGO上传区域样式
  2793. .logo-upload-area {
  2794. width: 100%;
  2795. }
  2796. .logo-upload-placeholder {
  2797. width: 100%;
  2798. height: 160px;
  2799. border: 1px dashed #D9D9D9;
  2800. border-radius: 10px;
  2801. display: flex;
  2802. flex-direction: column;
  2803. align-items: center;
  2804. justify-content: center;
  2805. cursor: pointer;
  2806. transition: all 0.3s;
  2807. background: #fff;
  2808. &:hover {
  2809. border-color: #2957FF;
  2810. background: #F8F9FF;
  2811. }
  2812. .logo-upload-icon {
  2813. width: 42px;
  2814. height: 42px;
  2815. margin-bottom: 12px;
  2816. display: flex;
  2817. align-items: center;
  2818. justify-content: center;
  2819. background: linear-gradient(135deg, #EFF6FF 0%, #F3E8FF 100%);
  2820. border-radius: 8px;
  2821. color: #2957FF;
  2822. img {
  2823. width: 42px;
  2824. height: 42px;
  2825. }
  2826. }
  2827. .logo-upload-text {
  2828. font-size: 14px;
  2829. color: #333;
  2830. margin-bottom: 8px;
  2831. font-weight: 500;
  2832. }
  2833. .logo-upload-hint {
  2834. font-size: 12px;
  2835. color: #999;
  2836. }
  2837. &.is-error {
  2838. border-color: #FF4D4F;
  2839. background: #FFF2F0;
  2840. .logo-upload-text,
  2841. .logo-upload-hint {
  2842. color: #FF4D4F;
  2843. }
  2844. }
  2845. }
  2846. .logo-upload-preview {
  2847. width: 100%;
  2848. height: 160px;
  2849. border: 1px solid #E8E8E8;
  2850. border-radius: 8px;
  2851. position: relative;
  2852. overflow: hidden;
  2853. background: #F5F5F5;
  2854. cursor: pointer;
  2855. .logo-preview-image {
  2856. width: 100%;
  2857. height: 100%;
  2858. object-fit: contain;
  2859. }
  2860. .logo-upload-actions {
  2861. position: absolute;
  2862. bottom: 0;
  2863. left: 0;
  2864. right: 0;
  2865. height: 40px;
  2866. background: rgba(0, 0, 0, 0.5);
  2867. display: flex;
  2868. align-items: center;
  2869. justify-content: center;
  2870. gap: 20px;
  2871. opacity: 0;
  2872. transition: opacity 0.3s;
  2873. .logo-action-btn {
  2874. width: 32px;
  2875. height: 32px;
  2876. display: flex;
  2877. align-items: center;
  2878. justify-content: center;
  2879. background: rgba(255, 255, 255, 0.2);
  2880. border-radius: 4px;
  2881. cursor: pointer;
  2882. color: #fff;
  2883. transition: background 0.3s;
  2884. &:hover {
  2885. background: rgba(255, 255, 255, 0.3);
  2886. }
  2887. .el-icon {
  2888. font-size: 18px;
  2889. }
  2890. }
  2891. }
  2892. &:hover .logo-upload-actions {
  2893. opacity: 1;
  2894. }
  2895. .logo-upload-footer {
  2896. display: flex;
  2897. justify-content: flex-end;
  2898. gap: 12px;
  2899. padding: 8px 4px 0;
  2900. }
  2901. }
  2902. .logo-upload {
  2903. border: 1px dashed #ccc;
  2904. border-radius: 5px;
  2905. padding: 50px 0;
  2906. text-align: center;
  2907. cursor: pointer;
  2908. }
  2909. .template-pagination {
  2910. background: #EFF3F6;
  2911. padding: 2px 0;
  2912. border-radius: 5px;
  2913. ::v-deep {
  2914. .is-active {
  2915. background: #fff !important;
  2916. color: #2957FF !important;
  2917. font-size: 14px !important;
  2918. font-weight: normal !important;
  2919. border-radius: 2px !important;
  2920. }
  2921. .number {
  2922. margin: 0px !important;
  2923. }
  2924. .btn-prev {
  2925. display: none;
  2926. }
  2927. .btn-next {
  2928. display: none;
  2929. }
  2930. }
  2931. }
  2932. .template-pagination button {
  2933. margin-right: 5px;
  2934. }
  2935. .template-pagination span {
  2936. display: inline-block;
  2937. width: 20px;
  2938. height: 20px;
  2939. line-height: 20px;
  2940. text-align: center;
  2941. border: 1px solid #ccc;
  2942. border-radius: 5px;
  2943. margin-right: 5px;
  2944. cursor: pointer;
  2945. }
  2946. .template-list {
  2947. display: flex;
  2948. flex-wrap: wrap;
  2949. gap: 20px;
  2950. margin-top: 10px;
  2951. .template-item {
  2952. flex: 1;
  2953. max-width: 33%;
  2954. border: 1px solid #ccc;
  2955. border-radius: 10px;
  2956. cursor: pointer;
  2957. background: #f0f0f0;
  2958. position: relative;
  2959. height: 594px;
  2960. overflow: hidden;
  2961. &.active {
  2962. border-color: #1677FF;
  2963. }
  2964. .template-download-btn {
  2965. position: absolute;
  2966. top: 10px;
  2967. right: 10px;
  2968. z-index: 10;
  2969. color: #3366FF;
  2970. height: 30px;
  2971. line-height: 30px;
  2972. padding: 0 10px;
  2973. border-radius: 4px;
  2974. background: rgba(255, 255, 255, 0.9);
  2975. font-size: 14px;
  2976. cursor: pointer;
  2977. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  2978. transition: all 0.3s;
  2979. &:hover {
  2980. background: rgba(255, 255, 255, 1);
  2981. box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  2982. }
  2983. }
  2984. .template-info {
  2985. position: absolute;
  2986. bottom: 0;
  2987. left: 0;
  2988. background: #fff;
  2989. width: 100%;
  2990. height: 40px;
  2991. line-height: 40px;
  2992. color: #333;
  2993. display: flex;
  2994. align-items: center;
  2995. justify-content: space-between;
  2996. .template-view {
  2997. color: #3366FF;
  2998. height: 30px;
  2999. line-height: 30px;
  3000. padding: 0 5px;
  3001. border-radius: 4px;
  3002. font-size: 14px;
  3003. }
  3004. }
  3005. }
  3006. }
  3007. .publish-section {
  3008. .label {
  3009. min-width: 120px;
  3010. margin-right: 12px;
  3011. }
  3012. }
  3013. .excel-upload {
  3014. width: 100%;
  3015. background: #F7F7F7;
  3016. padding: 20px 0;
  3017. }
  3018. .generate-button {
  3019. padding: 10px 20px;
  3020. color: white;
  3021. border: none;
  3022. border-radius: 5px;
  3023. cursor: pointer;
  3024. }
  3025. .select-button {
  3026. background: #DFE2E3 !important;
  3027. color: #3366FF !important;
  3028. height: 30px;
  3029. line-height: 30px;
  3030. padding: 0 10px;
  3031. border-radius: 4px;
  3032. margin-right: 10px;
  3033. font-size: 14px;
  3034. font-weight: 550;
  3035. }
  3036. .select-warp {
  3037. width: 18px;
  3038. height: 18px;
  3039. border-radius: 18px;
  3040. background-color: #fff;
  3041. position: absolute;
  3042. font-size: 12px;
  3043. line-height: 18px;
  3044. display: flex;
  3045. justify-content: center;
  3046. align-items: center;
  3047. top: 10px;
  3048. left: 10px;
  3049. border: 1px solid #efefef;
  3050. &.active {
  3051. background-color: #1677FF;
  3052. }
  3053. }
  3054. .section-title {
  3055. display: flex;
  3056. align-items: center;
  3057. gap: 8px;
  3058. font-weight: bold;
  3059. color: #474747;
  3060. }
  3061. .section {
  3062. margin-bottom: 24px;
  3063. .section-title {
  3064. display: flex;
  3065. align-items: center;
  3066. gap: 8px;
  3067. font-weight: bold;
  3068. margin-bottom: 16px;
  3069. color: #474747;
  3070. }
  3071. .section-content {
  3072. padding-left: 16px;
  3073. }
  3074. }
  3075. .instruction-out {
  3076. background: #EAF3FF;
  3077. border-radius: 4px;
  3078. border: 1px solid #CBE1FF;
  3079. padding: 10px 20px;
  3080. width: 80%;
  3081. position: relative;
  3082. .instruction-list {
  3083. margin: 0px 0 0 10px;
  3084. padding-left: 20px;
  3085. padding-right: 40px;
  3086. width: 100%;
  3087. li {
  3088. margin-bottom: 4px;
  3089. text-align: left;
  3090. font-size: 14px;
  3091. }
  3092. }
  3093. .close-icon {
  3094. position: absolute;
  3095. top: 12px;
  3096. right: 19px;
  3097. }
  3098. }
  3099. .form-item {
  3100. margin: 16px 0;
  3101. display: flex;
  3102. .label {
  3103. min-width: 120px;
  3104. margin-right: 12px;
  3105. }
  3106. .folder-warp {
  3107. width: 100%;
  3108. display: flex;
  3109. flex-direction: column;
  3110. .folder-input {
  3111. flex: 1;
  3112. display: flex;
  3113. align-items: center;
  3114. .check-button {
  3115. background: #DFE2E3;
  3116. border-radius: 6px;
  3117. padding: 6px 12px;
  3118. color: #2957FF;
  3119. margin-left: 20px;
  3120. }
  3121. }
  3122. }
  3123. .hint {
  3124. text-align: left;
  3125. color: #999;
  3126. margin-top: 6px;
  3127. font-size: 14px;
  3128. color: #FF4C00;
  3129. font-style: normal;
  3130. }
  3131. .specific-page-input {
  3132. flex: 1;
  3133. }
  3134. }
  3135. .image-order {
  3136. flex: 1;
  3137. display: flex;
  3138. justify-content: space-between;
  3139. align-items: center;
  3140. }
  3141. .footer {
  3142. display: flex;
  3143. z-index: 100;
  3144. .footer-button {
  3145. padding: 12px 40px;
  3146. font-size: 16px;
  3147. border-radius: 8px;
  3148. display: block;
  3149. width: 100%;
  3150. height: 50px;
  3151. img {
  3152. height: 16px;
  3153. ;
  3154. margin: 0 10px;
  3155. }
  3156. .go {
  3157. opacity: .5;
  3158. }
  3159. }
  3160. }
  3161. .explain-btn {
  3162. padding-left: 20px;
  3163. padding-right: 20px;
  3164. color: #2957FF !important;
  3165. }
  3166. .progress-messages {
  3167. margin-top: 20px;
  3168. border-top: 1px solid #e4e7ed;
  3169. padding-top: 20px;
  3170. width: 100%;
  3171. display: none;
  3172. .message-header {
  3173. display: flex;
  3174. justify-content: space-between;
  3175. align-items: center;
  3176. margin-bottom: 15px;
  3177. font-weight: 500;
  3178. color: #606266;
  3179. }
  3180. .message-list {
  3181. max-height: 200px;
  3182. overflow-y: auto;
  3183. border: 1px solid #e4e7ed;
  3184. border-radius: 4px;
  3185. padding: 10px;
  3186. background: #fafafa;
  3187. .message-item {
  3188. margin-bottom: 12px;
  3189. padding-bottom: 12px;
  3190. border-bottom: 1px solid #f0f0f0;
  3191. &:last-child {
  3192. margin-bottom: 0;
  3193. padding-bottom: 0;
  3194. border-bottom: none;
  3195. }
  3196. .message-time {
  3197. font-size: 12px;
  3198. color: #909399;
  3199. margin-bottom: 4px;
  3200. }
  3201. .message-content {
  3202. font-size: 14px;
  3203. line-height: 1.4;
  3204. .goods-no {
  3205. color: #2957FF;
  3206. font-weight: 500;
  3207. }
  3208. .message-text {
  3209. color: #606266;
  3210. }
  3211. }
  3212. }
  3213. }
  3214. }
  3215. .side .right-section.data-prep-section {
  3216. height: auto;
  3217. }
  3218. .side .right-section {
  3219. padding: 11px 15px;
  3220. }
  3221. </style>