import{M as V}from"./index.17037962789732.js";import{_ as G}from"./ValueDetail.vue_vue_type_script_setup_true_lang.1703796278973.js";import{a as r}from"./comm.1703796278973.js";import{d as K,l as Q,k as b,o as l,x as o,D as d,u as e,F as A,z as p,A as H,c as U,B as W}from"./vue.1703796278973.js";import{_ as X}from"./_plugin-vue_export-helper.1703796278973.js";const s=new Map;s.set("txt",r("/running/txt.png"));s.set("doc",r("/running/doc.png"));s.set("xls",r("/running/xls.png"));s.set("ppt",r("/running/ppt.png"));s.set("docx",r("/running/docx.png"));s.set("xlsx",r("/running/xlsx.png"));s.set("pptx",r("/running/pptx.png"));s.set("pdf",r("/running/pdf.png"));s.set("img",r("/running/img.png"));s.set("error",r("/running/error.png"));s.set("video",r("/running/video.png"));s.set("other",r("/running/other.png"));s.set("obj",r("/running/obj.png"));const h=[".jpg",".png",".swf",".tiff"],j=[".m3u8",".flv",".mp4",".rmvb",".mvb"],_=[".txt",".doc",".xls",".pdf",".ppt",".docx",".xlsx",".pptx"],Y=n=>{let i="";return[...h,...j,..._].map(a=>{const v=a.slice(1,a.length);n&&String(n).indexOf(v)!==-1&&(h.includes(a)?i="img":j.includes(a)?i="video":i=v)}),i},Z={class:"value"},ee={key:1},te=["src"],se=["src"],ne=["src"],ae=["src"],le=["src"],oe=["src"],re=["src"],ie=["src"],ue=K({__name:"ValueRender",props:{data:{type:Object,default:()=>{}},value:{type:Object,default:()=>{}},type:{type:String,default:"card"}},setup(n){const i=n,a=Q(()=>i.type==="card"?"cardValue":"otherValue"),v=document.location.protocol==="https:",x=b(""),y=b(!1),T=b(!1),J=g=>{g.target.src=s.get("other")},q=g=>{g.target.src=s.get("error"),T.value=!0},k=g=>{const t=i.value;let m="";g==="img"?v&&(t==null?void 0:t.formatValue.indexOf("http:"))!==-1?V.error("域名为https时，不支持访问http地址"):T.value?V.error("该图片无法访问"):(m=[".jpg",".png"].find(f=>t==null?void 0:t.formatValue.includes(f))||"--",x.value=m,y.value=!0):g==="video"?v&&(t==null?void 0:t.formatValue.indexOf("http:"))!==-1?V.error("域名为https时，不支持访问http地址"):[".rmvb",".mvb"].some(f=>t==null?void 0:t.formatValue.includes(f))?V.error("当前仅支持播放.mp4,.flv,.m3u8格式的视频"):(m=[".m3u8",".flv",".mp4"].find(f=>t==null?void 0:t.formatValue.includes(f))||"--",x.value=m,y.value=!0):g==="obj"&&(m="obj",x.value=m,y.value=!0)};return(g,t)=>{var m,f,C,O,S,B,$,M,E,R,z,D,L,N,w,F,I,P;return l(),o("div",Z,[((m=n.value)==null?void 0:m.formatValue)!==0&&!((f=n.value)!=null&&f.formatValue)?(l(),o("div",{key:0,class:d(e(a))}," -- ",2)):((O=(C=i.data)==null?void 0:C.valueType)==null?void 0:O.type)==="file"?(l(),o("div",ee,[((B=(S=n.data)==null?void 0:S.valueType)==null?void 0:B.fileType)==="base64"?(l(),o(A,{key:0},[e(Y)(($=n.value)==null?void 0:$.formatValue)?(l(),o("div",{key:0,class:d(e(a))},[p("img",{src:e(s).get(g._type),onError:J},null,40,te)],2)):(l(),o("div",{key:1,class:d(e(a))},[p("img",{src:e(s).get("other")},null,8,se)],2))],64)):((E=(M=n.data)==null?void 0:M.valueType)==null?void 0:E.fileType)==="Binary(二进制)"?(l(),o("div",{key:1,class:d(e(a))},[p("img",{src:e(s).get("other")},null,8,ne)],2)):(l(),o(A,{key:2},[e(h).some(u=>{var c;return(c=n.value)==null?void 0:c.formatValue.includes(u)})?(l(),o("div",{key:0,class:d(e(a)),onClick:t[0]||(t[0]=u=>k("img"))},[p("img",{src:(R=n.value)==null?void 0:R.formatValue,onError:q},null,40,ae)],2)):e(j).some(u=>{var c;return(c=n.value)==null?void 0:c.formatValue.includes(u)})?(l(),o("div",{key:1,class:d(e(a)),onClick:t[1]||(t[1]=u=>k("video"))},[p("img",{src:e(s).get("video")},null,8,le)],2)):e(_).some(u=>{var c;return(c=n.value)==null?void 0:c.formatValue.includes(u)})?(l(),o("div",{key:2,class:d(e(a))},[p("img",{src:e(s).get(e(_).find(u=>{var c;return(c=n.value)==null?void 0:c.formatValue.includes(u)}).slice(1))},null,8,oe)],2)):(l(),o("div",{key:3,class:d(e(a))},[p("img",{src:e(s).get("other")},null,8,re)],2))],64))])):((D=(z=i.data)==null?void 0:z.valueType)==null?void 0:D.type)==="object"?(l(),o("div",{key:2,onClick:t[2]||(t[2]=u=>k("obj")),class:d(e(a))},[p("img",{src:e(s).get("obj")},null,8,ie)],2)):((N=(L=i.data)==null?void 0:L.valueType)==null?void 0:N.type)==="geoPoint"||((F=(w=i.data)==null?void 0:w.valueType)==null?void 0:F.type)==="array"?(l(),o("div",{key:3,class:d(e(a))},H(JSON.stringify((I=n.value)==null?void 0:I.formatValue)),3)):(l(),o("div",{key:4,class:d(e(a))},H(String((P=n.value)==null?void 0:P.formatValue)),3)),e(y)?(l(),U(G,{key:5,type:e(x),value:n.value,onClose:t[3]||(t[3]=u=>y.value=!1)},null,8,["type","value"])):W("",!0)])}}});const ce=X(ue,[["__scopeId","data-v-9620ee0b"]]),ve=Object.freeze(Object.defineProperty({__proto__:null,default:ce},Symbol.toStringTag,{value:"Module"}));export{ce as V,ve as a,Y as g};
