niucloud-admin/niucloud/public/admin/assets/form-spread-popup-7ecb169e.js
全栈小学生 e6c822aa8e up niucloud
2025-06-26 15:07:17 +08:00

2 lines
3.1 KiB
JavaScript

import{d as $,l as k,r as s,av as I,ak as O,Y as C,k as t,h as c,c as f,e as l,w as i,a,t as r,u as o,i as R,B as E,m as z,z as V,ab as M,ac as H,C as Y,E as q,D as A,S as G}from"./index-f99f26c5.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import{b as J}from"./browser-a1ac24ac.js";import{r as K}from"./sys-c0964254.js";import{b as W}from"./diy_form-b86ec360.js";const X={key:0,class:"promote-flex flex"},Z={class:"promote-img flex justify-center items-center bg-[#f8f8f8] w-[150px] h-[150px]"},ee={class:"px-[20px] flex-1"},te={class:"mb-[10px]"},oe=["href"],ae={key:1,class:"promote-flex flex"},se={class:"promote-img flex justify-center items-center bg-[#f8f8f8] w-[150px] h-[150px]"},le={class:"w-[150px] h-[150px] text-[14px] text-center leading-[150px]"},ne={key:1,class:"w-[150px] h-[150px] text-[14px] text-center leading-[150px]"},re={class:"px-[20px] flex-1"},pe=["href"],ce=$({__name:"form-spread-popup",setup(ie,{expose:D}){const v=k({}),d=s(!1),p=s("h5"),h=s("");s("");const x=s(""),m=s(""),g=s(""),_=k({path:""});K().then(e=>{h.value=e.data.wap_url});const S=()=>{m.value=`${h.value}${g.value}`,J.toDataURL(m.value,{errorCorrectionLevel:"L",margin:0,width:120}).then(e=>{x.value=e})},B=e=>{p.value="h5",Object.assign(v,e),g.value=`/app/pages/index/diy_form?form_id=${v.form_id}`,S(),U(),d.value=!0},U=()=>{W({form_id:v.form_id}).then(e=>{e.data&&(_.path=e.data.path)})},{copy:j,isSupported:F,copied:w}=I(),L=e=>{F.value||C({message:t("notSupportCopy"),type:"warning"}),j(e)};return O(w,()=>{w.value&&C({message:t("copySuccess"),type:"success"})}),D({showDialog:d,show:B}),(e,n)=>{const b=M,Q=H,y=Y,N=q,P=A,T=G;return c(),f("div",null,[l(T,{modelValue:d.value,"onUpdate:modelValue":n[2]||(n[2]=u=>d.value=u),title:o(t)("formPromotion"),width:"500px","destroy-on-close":!0},{default:i(()=>[l(Q,{modelValue:p.value,"onUpdate:modelValue":n[0]||(n[0]=u=>p.value=u),class:"mb-[10px]"},{default:i(()=>[l(b,{label:"H5",name:"h5"}),l(b,{label:"微信小程序",name:"weapp"})]),_:1},8,["modelValue"]),p.value=="h5"?(c(),f("div",X,[a("div",Z,[l(y,{src:x.value},null,8,["src"])]),a("div",ee,[a("div",te,r(o(t)("promoteUrl")),1),l(P,{class:"mb-[10px]",readonly:"",value:m.value},{append:i(()=>[l(N,{onClick:n[1]||(n[1]=u=>L(m.value))},{default:i(()=>[R(r(o(t)("copy")),1)]),_:1})]),_:1},8,["value"]),a("a",{class:"text-primary",href:x.value,download:""},r(o(t)("downLoadQRCode")),9,oe)])])):E("",!0),p.value=="weapp"?(c(),f("div",ae,[a("div",se,[_.path?(c(),z(y,{key:0,src:o(V)(_.path),class:"w-[150px] h-[150px]"},{error:i(()=>[a("div",le,r(o(t)("configureFailed")),1)]),_:1},8,["src"])):(c(),f("div",ne,r(o(t)("configureFailed")),1))]),a("div",re,[a("a",{class:"text-primary",href:o(V)(_.path),target:"_blank",download:""},r(o(t)("downLoadQRCode")),9,pe)])])):E("",!0)]),_:1},8,["modelValue","title"])])}}}),ye=Object.freeze(Object.defineProperty({__proto__:null,default:ce},Symbol.toStringTag,{value:"Module"}));export{ye as _};