test_lgq/niucloud/public/admin/assets/form-f191ae42.js

2 lines
7.9 KiB
JavaScript
Raw Normal View History

2024-01-24 17:36:08 +08:00
import{d as I,q as N,n as R,s as A,ax as H,h as m,c,x as U,u as _,F,a as r,R as S,e,I as K,w as o,G as L,B as O,aa as T,r as B,i as V,t as D,N as j,W,X,az as Y,aA as J,as as M,aF as Q,cK as Z,aH as ee,E as te,Y as le,$ as oe}from"./index-4dcc0234.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import{_ as ae}from"./index.vue_vue_type_script_setup_true_lang-d9adee77.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import{_ as ie}from"./index.vue_vue_type_style_index_0_lang-cd8f78e9.js";/* empty css */import{_ as ne}from"./attachment-c69dd9fd.js";import{_ as se}from"./index.vue_vue_type_style_index_0_lang-5c6c00d9.js";import{_ as re}from"./index.vue_vue_type_script_setup_true_lang-9285296e.js";import{_ as de}from"./index-742b412a.js";/* empty css */import"./el-form-item-4ed993c7.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./el-tooltip-4ed993c7.js";/* empty css *//* empty css *//* empty css *//* empty css */import"./sys-8ead7f22.js";/* empty css */const me={class:"flex flex-wrap"},ue={class:"w-full h-full relative flex items-center overflow-hidden rounded"},pe=["src"],ce={class:"absolute z-[1] flex items-center justify-center w-full h-full inset-0 bg-black bg-opacity-60 operation"},_e={class:"w-full h-full flex items-center justify-center flex-col"},fe={class:"w-full h-full relative flex items-center overflow-hidden rounded"},ve=["src"],ge={class:"absolute z-[1] flex items-center justify-center w-full h-full inset-0 bg-black bg-opacity-60 operation"},be={class:"w-full h-full flex items-center justify-center flex-col"},xe=I({__name:"index",props:{modelValue:{type:String,default:""},width:{type:String,default:"200px"},height:{type:String,default:"100px"},limit:{type:Number,default:1}},emits:["update:modelValue"],setup(f,{emit:w}){const v=f,l=N({get(){return v.modelValue},set(s){w("update:modelValue",s)}}),i=R({data:[]});A(()=>l.value,()=>{i.data=[...l.value.split(",").filter(s=>s)],t()});const y=N(()=>({width:v.width,height:v.height})),h=s=>{v.limit==1?(i.data.splice(0,1),s&&i.data.push(s.url)):s.forEach(u=>{i.data.length<v.limit&&i.data.push(u.url)}),t()},g=(s=0)=>{i.data.splice(s,1),t()},t=()=>{l.value=H(i.data).toString()},d=R({visible:!1,src:""}),n=(s=0)=>{d.visible=!0,d.src=S(i.data[s])};return(s,u)=>{const p=re,k=se,E=ne,C=T;return m(),c("div",me,[f.limit==1?(m(),c("div",{key:0,class:"rounded cursor-pointer relative bg-page video-wrap mr-[10px]",style:U(_(y))},[i.data.length?(m(),c(F,{key:0},[r("div",ue,[r("video",{src:_(S)(i.data[0]),class:"w-full"},null,8,pe),r("div",ce,[e(p,{name:"iconfont-icon24gf-playCircle",color:"#fff",size:"25px",onClick:u[0]||(u[0]=b=>n())})])]),e(p,{name:"element-CircleCloseFilled",color:"#bbb",size:"18px",onClick:g,class:"absolute z-[2] top-[-9px] right-[-9px]"})],64)):(m(),K(k,{key:1,limit:f.limit,type:"video",onConfirm:h},{default:o(()=>[r("div",_e,[e(p,{name:"iconfont-icon24gf-playCircle",size:"25px",color:"var(--el-text-color-secondary)"})])]),_:1},8,["limit"]))],4)):(m(),c(F,{key:1},[(m(!0),c(F,null,L(i.data,(b,x)=>(m(),c("div",{class:"rounded cursor-pointer relative bg-page video-wrap mr-[10px]",style:U(_(y)),key:x},[r("div",fe,[r("video",{src:_(S)(b),class:"w-full"},null,8,ve),r("div",ge,[e(p,{name:"iconfont-icon24gf-playCircle",color:"#fff",size:"25px",onClick:z=>n(x)},null,8,["onClick"])])]),e(p,{name:"element-CircleCloseFilled",color:"#bbb",size:"18px",onClick:z=>g(x),class:"absolute z-[2] top-[-9px] right-[-9px]"},null,8,["onClick"])],4))),128)),i.data.length<f.limit?(m(),c("div",{key:0,class:"rounded cursor-pointer relative bg-