detail.vue 96 KB

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