Files
qhmes/deploy-qhmes/frontend/js/AiPoster-cL9ZOFTp.js
2026-05-15 11:34:12 +08:00

2 lines
10 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
var x=(C,c,i)=>new Promise((s,l)=>{var _=a=>{try{d(i.next(a))}catch(u){l(u)}},y=a=>{try{d(i.throw(a))}catch(u){l(u)}},d=a=>a.done?s(a.value):Promise.resolve(a.value).then(_,y);d((i=i.apply(C,c)).next())});import{d as B,ah as z,ar as v,as as p,au as t,aC as F,ag as f,F as M,aD as U,at as j,f as h,av as D,k as n,u as m,aF as b,G as k}from"./vue-vendor-C7Zq48Yl.js";import"./index-Di-j2gt4.js";import G from"./ImageViewer-CG7dKb6F.js";import{q as N,M as w,u as R,f as E,d as $}from"./index-BI6CMai0.js";import{u as q}from"./useForm-BZtHZyx2.js";import{B as H}from"./BasicForm-BJnSRkIE.js";import"./componentMap-BBZeqR-K.js";import"./antd-vue-vendor-BPnV8VqP.js";import"./useFormItem-BdW6EoZe.js";import"./index-Du0A3ksf.js";import"./BasicModal-0sAdFEk_.js";import"./ModalHeader-keHdAHWH.js";import"./useTimeout-DDl4l82I.js";import"./vxe-table-vendor-B88kchpX.js";import"./index-DeEq83Ov.js";import"./useWindowSizeFn-PRZSD86C.js";import"./index-pxs5MULf.js";import"./index-BgYCgfME.js";import"./index-f8O7TghW.js";import"./useIntersectionObserver-BMxdTqP3.js";import"./download-UE0L9Rfp.js";import"./base64Conver-24EVOS6V.js";import"./index-CIBZG4nR.js";import"./index-BhQEwnQQ.js";import"./useCountdown-DqnNWBp6.js";import"./useFormItemSingle-BbRhswfn.js";import"./JSelectUser-B71zikzw.js";import"./props-DAezUTeZ.js";import"./JSelectBiz-CnEaVMUF.js";import"./JAddInput-D6qcyZjQ.js";import"./areaDataUtil-CbYCy3Ig.js";import"./index-CNkz_PUv.js";import"./index-CUdllngZ.js";import"./bem-EhXRi4nW.js";import"./props-D4vdsy3J.js";import"./useContextMenu-Cwx1lIOK.js";import"./depart.api-DeMNV8zW.js";import"./TreeIcon-DE4jdeZV.js";import"./JSelectDept-DRDVeruW.js";import"./JPopup-Bva6u6tk.js";import"./usePopBiz-CG0vVpgI.js";import"./useMethods-DVip17X8.js";import"./index-Dg4HCEvo.js";import"./JEllipsis-DqRFTSm0.js";import"./JUpload-Cz9HN61B.js";import"./index-MGIrEF-A.js";import"./index-MREkPhsT.js";import"./JAreaLinkage-BeRUFHSB.js";import"./JCodeEditor-CLVZA7Uj.js";import"./htmlmixed-NhwyF9-q.js";import"./vue-CgbRSACy.js";/* empty css */import"./EasyCronInput-7xfJ3nBh.js";const J=[{field:"drawModelId",label:"模型",component:"JDictSelectTag",required:!0,helpMessage:["1、需要选择在模型中已有的图像模型","2、智普语言模型不支持尺寸设置","3、openAi旧版模型如(dall-e-2)需要选择尺寸,新版模型直接输入'竖版: 9:16即可'","4、当前只有千问万象模型(wanx2.1-imageedit,wan2.5-i2i-preview)支持图生图","5、wan2.5-i2i-preview支持多张图片","6、当前文生图openAi效果最佳"],componentProps:{dictCode:"airag_model where model_type = 'IMAGE' and activate_flag = 1,name,id"}},{field:"content",label:"提示词",component:"InputTextArea",required:!0,componentProps:{rows:10,placeholder:"请输入提示词,例如:一只可爱的猫咪,赛博朋克风格"}},{field:"imageUrl",label:"参考图",component:"JImageUpload",componentProps:{fileMax:2}},{field:"imageSize",label:"图片尺寸",component:"Select",defaultValue:"1024*1024",componentProps:{options:[{label:"1:1 (1024x1024)",value:"1024*1024"},{label:"16:9 (1280x720)",value:"1280*720"},{label:"9:16 (720x1280)",value:"720*1280"},{label:"4:3 (1024x768)",value:"1024*768"},{label:"3:4 (768x1024)",value:"768*1024"}]}}],L={class:"ai-poster-page"},O={class:"content-wrapper"},W={class:"template-panel"},K={class:"template-list"},Q=["onClick"],X={class:"template-cover"},Y=["src"],Z={class:"template-name"},ee={class:"config-panel"},te={class:"form-container"},oe={class:"action-container"},ie={class:"preview-panel"},se={class:"preview-content"},ae={key:0,class:"empty-state"},ne={key:1,class:"loading-state"},le={key:2,class:"result-image-wrapper group"},re=["src"],pe={class:"image-actions"},me=B({__name:"AiPoster",setup(C){const{createMessage:c}=R(),i=h(!1),s=h(""),l=h(!1),_=h(null),y=[{id:1,name:"淡雅政务风",prompt:"淡雅政务风横版海报主色调浅蓝 + 米白 + 淡灰扁平化矢量风格叠加细腻宣纸纹理画面核心元素简约政务办公楼轮廓线条简洁金色钢笔展开的公文册淡蓝色祥云纹样橄榄枝装饰背景是米白渐变 + 浅蓝竖条肌理点缀细金色边框文字设计居中用黑体写政务为民高效规范下方配用心服务务实笃行浅蓝小字整体氛围淡雅庄重专业简洁层次分明光影柔和高清细节竖版 9:16 构图",size:"720*1280",url:"https://minio.jeecg.com/otatest/simple_1767767784521.png"},{id:2,name:"节日海报",prompt:"国潮中国风春节竖版海报,主色调红金 + 暖橙渐变,国潮插画风格,矢量扁平 + 柔和渐变质感,叠加细腻宣纸纹理;画面层次:前景是红色剪纸风梅花、金色福字贴纸、饱满水饺、红色灯笼串,中景是红墙金瓦的传统民居屋檐、飘带式祥云,远景是淡金色烟花绽放 + 暖红色光晕背景;点缀金色铜钱纹、折纸兔子、如意纹样;画面中央偏上用金色书法字体写‘新春大吉’,下方配'万事如意'四字楷书;整体氛围喜庆祥和、团圆温馨,层次分明主次清晰,光影柔和不刺眼,高清细节,竖版 9:16 构图",url:"https://minio.jeecg.com/otatest/image89444392111_1767844276342.png",size:"720*1280"},{id:3,name:"科技宣传",prompt:"未来科技感宣传海报,主色调蓝紫渐变 + 银白金属色,冷光霓虹光效,赛博朋克线条质感;画面核心元素:全息投影的地球数据模型、流动的蓝色数据流、发光的电路板纹理、悬浮的芯片与机械齿轮、未来感建筑轮廓;点缀粒子光效、透明全息界面、霓虹光带;文字设计:居中用未来感无衬线字体写‘科技赋能・智启新程’,下方配‘创新驱动・引领未来’小字,字体带轻微发光描边;整体氛围简洁高级、充满未来感,层次分明,光影锐利,高清细节,横版 16:9 构图",size:"720*1280",url:"https://minio.jeecg.com/otatest/technology_1767765484936.png"},{id:4,name:"优雅复古",prompt:"民国风优雅复古竖版海报,主色调米黄 + 豆沙红 + 墨黑,低饱和度胶片质感,叠加老报纸纹理与轻微颗粒感;画面核心元素:穿月白旗袍的女性侧影(盘发配珍珠发簪)、油纸伞、复古留声机、雕花木质窗棂、缠绕珍珠的藤蔓花纹;背景是模糊的老上海石库门建筑轮廓,点缀淡粉色玉兰花、复古字体排版的诗句(‘岁月静好,温婉如初’);文字设计:上方用民国手写体写‘雅致时光’,下方配衬线字体‘复刻民国风雅’,字体带轻微做旧效果;整体氛围温婉知性、静谧典雅,光影柔和(侧光勾勒人物轮廓),层次分明,高清细节,竖版 9:16 构图",size:"720*1280",url:"https://minio.jeecg.com/otatest/retro_1767765748402.png"},{id:5,name:"赛博朋克",prompt:"国潮赛博朋克横版海报,主色调中国红 + 深空黑 + 鎏金霓虹,传统纹样与科技元素碰撞,叠加红金渐变光效 + 竹简纹理;画面核心元素:龙形霓虹光带(龙身缠绕电路板)、红墙金瓦的赛博风古建筑(屋檐挂霓虹灯笼)、穿汉服改良款的赛博人物(配发光发簪 / 机械袖、全息投影的汉字霓虹灯牌江湖未来点缀祥云数据流、金属质感的传统回纹、悬浮的鎏金元宝状机械装置文字设计上方用金色书法字体写赛博江湖下方配TECH & TRADITION英文字体带红金霓虹发光效果整体氛围大气炫酷、传统与未来交融光影强烈且富有冲击力层次分明高清细节横版 16:9 构图",size:"720*1280",url:"https://minio.jeecg.com/otatest/cyberpunk_1767766076979.png"}],{domainUrl:d}=N(),[a,{validate:u,setFieldsValue:I}]=q({schemas:J,labelWidth:100,actionColOptions:{span:24},showActionButtonGroup:!1});function A(o){_.value=o.id,I({content:o.prompt,imageUrl:o.url,imageSize:o.size}),c.success(`已应用模板:${o.name}`)}function T(){return x(this,null,function*(){try{const o=yield u();i.value=!0,s.value="",setTimeout(()=>{E.post({url:"/airag/chat/genAiPoster",params:o,timeout:300*1e3},{isTransformResponse:!1}).then(e=>{if(e.success){let g=/#\s*{\s*domainURL\s*}/g;e.result=e.result.replace(g,d+"/sys/common/static"),s.value=e.result,c.success("海报生成成功!")}else c.warning("海报生成失败!")}).finally(()=>{i.value=!1})},2e3)}catch(o){}})}function P(){l.value=!0}function S(){if(!s.value)return;const o=document.createElement("a");o.href=s.value,o.download=`ai-poster-${Date.now()}.jpg`,o.target="_blank",o.click()}return(o,e)=>{const g=z("a-button"),V=z("a-spin");return p(),v("div",L,[e[8]||(e[8]=t("div",{class:"page-header"},[t("span",{class:"title"},"AI 海报生成"),t("span",{class:"subtitle"},"输入提示词,快速生成精美海报")],-1)),t("div",O,[t("div",W,[e[1]||(e[1]=t("div",{class:"panel-title"},"模板选择",-1)),t("div",K,[(p(),v(M,null,U(y,r=>t("div",{key:r.id,class:j(["template-item",{active:_.value===r.id}]),onClick:ce=>A(r)},[t("div",X,[t("img",{src:r.url,style:{width:"100%"}},null,8,Y)]),t("div",Z,D(r.name),1)],10,Q)),64))])]),t("div",ee,[e[3]||(e[3]=t("div",{class:"panel-title"},"参数配置",-1)),t("div",te,[n(m(H),{onRegister:m(a)},null,8,["onRegister"])]),t("div",oe,[n(g,{type:"primary",size:"large",block:"",onClick:T,loading:i.value},{default:b(()=>[n(m(w),{icon:"ant-design:thunderbolt-outlined"}),e[2]||(e[2]=k(" 立即生成 ",-1))]),_:1},8,["loading"])])]),t("div",ie,[e[7]||(e[7]=t("div",{class:"panel-title"},"生成结果",-1)),t("div",se,[!s.value&&!i.value?(p(),v("div",ae,[n(m(w),{icon:"ant-design:picture-outlined",size:"64",color:"#ccc"}),e[4]||(e[4]=t("p",null,"在左侧配置参数并点击生成",-1))])):f("",!0),i.value?(p(),v("div",ne,[n(V,{size:"large",tip:"正在绘制海报,请稍候..."})])):f("",!0),s.value?(p(),v("div",le,[t("img",{src:s.value,class:"result-image",alt:"Generated Poster"},null,8,re),t("div",pe,[n(g,{type:"primary",ghost:"",onClick:P},{default:b(()=>[n(m(w),{icon:"ant-design:eye-outlined"}),e[5]||(e[5]=k(" 预览 ",-1))]),_:1}),n(g,{type:"primary",ghost:"",onClick:S},{default:b(()=>[n(m(w),{icon:"ant-design:download-outlined"}),e[6]||(e[6]=k(" 下载 ",-1))]),_:1})])])):f("",!0)])])]),l.value?(p(),F(G,{key:0,imageUrl:s.value,onHide:e[0]||(e[0]=r=>l.value=!1)},null,8,["imageUrl"])):f("",!0)])}}}),dt=$(me,[["__scopeId","data-v-72208acb"]]);export{dt as default};