import{p as k,E as p}from"./index.Df8UJ10K.js";import{F as $}from"./index.DFs5McSn.js";import{a as B,r as w,w as M,aj as m,c as r,o as n,b as o,S as t,K as s,Q as v,J as N,u as y,P as g,M as U,R as z,a9 as E,G as I}from"./vue.D1BjjNmv.js";import{_ as D}from"./_plugin-vue_export-helper.DlAUqK2U.js";const R={class:"test-container"},T={class:"result-display"},j={key:0},G={key:1,class:"no-value"},J={class:"image-preview-test"},K={class:"image-error"},P={key:1,class:"no-image-placeholder"},Q={class:"log-content"},q={class:"log-time"},A={class:"log-message"},H={key:0,class:"no-logs"},O=B({__name:"test",setup(W){const l=w(""),i=w([]),u=(a,e)=>{const _=new Date().toLocaleTimeString();i.value.unshift({time:_,level:a,message:e}),i.value.length>50&&(i.value=i.value.slice(0,50))};M(l,(a,e)=>{a!==e&&u("info",`图片选择变化: ${e||"无"} -> ${a||"无"}`)});const b=()=>{if(!l.value){p.warning("请先选择一张图片"),u("warn","保存测试失败: 未选择图片");return}u("success",`保存测试成功: ${l.value}`),p.success("测试保存成功！")},C=()=>{const a=l.value;l.value="",u("info",`清除选择: ${a} -> 空值`),p.info("已清除选择")},x=()=>{const a=["https://picsum.photos/400/300?random=1","https://picsum.photos/400/300?random=2","https://picsum.photos/400/300?random=3"],e=a[Math.floor(Math.random()*a.length)];l.value=e,u("info",`设置测试网络图片: ${e}`),p.success("已设置测试网络图片")},S=()=>{i.value=[],p.info("已清除测试日志")};return u("info","FileSelector组件测试页面已加载"),(a,e)=>{const c=m("el-form-item"),_=m("el-icon"),V=m("el-image"),f=m("el-button"),F=m("el-form"),h=m("el-card");return n(),r("div",R,[e[10]||(e[10]=o("h2",null,"FileSelector组件集成测试",-1)),t(h,{class:"test-card"},{header:s(()=>e[1]||(e[1]=[o("span",null,"基础功能测试",-1)])),default:s(()=>[t(F,{"label-width":"120px"},{default:s(()=>[t(c,{label:"选择的图片"},{default:s(()=>[o("div",T,[e[2]||(e[2]=o("strong",null,"当前值: ",-1)),l.value?(n(),r("span",j,v(l.value),1)):(n(),r("span",G,"未选择"))])]),_:1}),t(c,{label:"图片选择器"},{default:s(()=>[t($,{modelValue:l.value,"onUpdate:modelValue":e[0]||(e[0]=d=>l.value=d),"input-type":"image","input-size":120,"show-upload-button":!0,"show-net-button":!0,"tabs-show":1e3,"value-key":"url",multiple:!1,selectable:!0},null,8,["modelValue"])]),_:1}),t(c,{label:"图片预览"},{default:s(()=>[o("div",J,[l.value?(n(),N(V,{key:0,src:l.value,fit:"contain",style:{width:"200px",height:"150px",border:"1px solid #ddd"}},{error:s(()=>[o("div",K,[t(_,null,{default:s(()=>[t(y(k))]),_:1}),e[3]||(e[3]=o("span",null,"加载失败",-1))])]),_:1},8,["src"])):(n(),r("div",P,[t(_,null,{default:s(()=>[t(y(k))]),_:1}),e[4]||(e[4]=o("span",null,"请选择图片",-1))]))])]),_:1}),t(c,null,{default:s(()=>[t(f,{type:"primary",onClick:b},{default:s(()=>e[5]||(e[5]=[g("测试保存")])),_:1}),t(f,{onClick:C},{default:s(()=>e[6]||(e[6]=[g("清除选择")])),_:1}),t(f,{onClick:x},{default:s(()=>e[7]||(e[7]=[g("测试网络图片")])),_:1})]),_:1})]),_:1})]),_:1}),t(h,{class:"test-log"},{header:s(()=>[e[9]||(e[9]=o("span",null,"测试日志",-1)),t(f,{size:"small",onClick:S},{default:s(()=>e[8]||(e[8]=[g("清除日志")])),_:1})]),default:s(()=>[o("div",Q,[(n(!0),r(z,null,E(i.value,(d,L)=>(n(),r("div",{key:L,class:"log-item"},[o("span",q,v(d.time),1),o("span",{class:I(["log-level",d.level])},v(d.level.toUpperCase()),3),o("span",A,v(d.message),1)]))),128)),i.value.length===0?(n(),r("div",H," 暂无测试日志 ")):U("",!0)])]),_:1})])}}}),te=D(O,[["__scopeId","data-v-10a5fc1f"]]);export{te as default};
