detail.vue 99 KB

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