index-D32QFN7Q.js 5.7 KB

1
  1. import{_ as R,r as T,m as b,n as k,i as y,e as D,o as r,w as p,g as n,f as i,j as w,h as c,p as a,E as A,q as x,s as I,t as g,F as v,v as B,x as E,y as O,z as V,A as U,B as f}from"./index-5k_MqT6o.js";const W={class:"icon-container"},G={class:"search-container"},H={key:0,class:"search-count"},N={class:"icon-grid"},q=["onClick"],z={class:"icon-name"},j={key:0,class:"no-result"},$={__name:"index",setup(K){const m={System:["Plus","Minus","CirclePlus","Search","Female","Male","Aim","House","FullScreen","Loading","Link","Service","Pointer","Star","Notification","Connection","ChatDotRound","Setting","Clock","Position","Discount","Odometer","ChatSquare","ChatRound","ChatLineRound","ChatLineSquare","ChatDotSquare","View","Hide","Unlock","Lock","RefreshRight","RefreshLeft","Refresh","Bell","MuteNotification","User","Check","CircleCheck","Warning","CircleClose","Close","PieChart","More","Compass","Filter","Switch","Select","SemiSelect","CloseBold","EditPen","Edit","Message","MessageBox","TurnOff","Finished","Delete","Crop","SwitchButton","Operation","Open","Remove","ZoomOut","ZoomIn","InfoFilled","CircleCheckFilled","SuccessFilled","WarningFilled","CircleCloseFilled","QuestionFilled","WarnTriangleFilled","UserFilled","MoreFilled","Tools","HomeFilled","Menu","UploadFilled","Avatar","HelpFilled","Share","StarFilled","Comment","Histogram","Grid","Promotion","DeleteFilled","RemoveFilled","CirclePlusFilled"],Arrow:["ArrowLeft","ArrowUp","ArrowRight","ArrowDown","ArrowLeftBold","ArrowUpBold","ArrowRightBold","ArrowDownBold","DArrowRight","DArrowLeft","Download","Upload","Top","Bottom","Back","Right","TopRight","TopLeft","BottomRight","BottomLeft","Sort","SortUp","SortDown","Rank","CaretLeft","CaretTop","CaretRight","CaretBottom","DCaret","Expand","Fold"],Document:["DocumentAdd","Document","Notebook","Tickets","Memo","Collection","Postcard","ScaleToOriginal","SetUp","DocumentDelete","DocumentChecked","DataBoard","DataAnalysis","CopyDocument","FolderChecked","Files","Folder","FolderDelete","FolderRemove","FolderOpened","DocumentCopy","DocumentRemove","FolderAdd","FirstAidKit","Reading","DataLine","Management","Checked","Ticket","Failed","TrendCharts","List"],Media:["Microphone","Mute","Mic","VideoPause","VideoCamera","VideoPlay","Headset","Monitor","Film","Camera","Picture","PictureRounded","Iphone","Cellphone","VideoCameraFilled","PictureFilled","Platform","CameraFilled","BellFilled"],Traffic:["Location","LocationInformation","DeleteLocation","Coordinate","Bicycle","OfficeBuilding","School","Guide","AddLocation","MapLocation","Place","LocationFilled","Van"],Food:["Watermelon","Pear","NoSmoking","Smoking","Mug","GobletSquareFull","GobletFull","KnifeFork","Sugar","Bowl","MilkTea","Lollipop","Coffee","Chicken","Dish","IceTea","ColdDrink","CoffeeCup","DishDot","IceDrink","IceCream","Dessert","IceCreamSquare","ForkSpoon","IceCreamRound","Food","HotWater","Grape","Fries","Apple","Burger","Goblet","GobletSquare","Orange","Cherry"],Items:["Printer","Calendar","CreditCard","Box","Money","Refrigerator","Cpu","Football","Brush","Suitcase","SuitcaseLine","Umbrella","AlarmClock","Medal","GoldMedal","Present","Mouse","Watch","QuartzWatch","Magnet","Help","Soccer","ToiletPaper","ReadingLamp","Paperclip","MagicStick","Basketball","Baseball","Coin","Goods","Sell","SoldOut","Key","ShoppingCart","ShoppingCartFull","ShoppingTrolley","Phone","Scissor","Handbag","ShoppingBag","Trophy","TrophyBase","Stopwatch","Timer","CollectionTag","TakeawayBox","PriceTag","Wallet","Opportunity","PhoneFilled","WalletFilled","GoodsFilled","Flag","BrushFilled","Briefcase","Stamp"],Weather:["Sunrise","Sunny","Ship","MostlyCloudy","PartlyCloudy","Sunset","Drizzling","Pouring","Cloudy","Moon","MoonNight","Lightning"],Other:["ChromeFilled","Eleme","ElemeFilled","ElementPlus","Shop","SwitchFilled","WindPower"]},t=T("");Object.keys(b).forEach(o=>{});const _=o=>{const e=`<el-icon><${o} /></el-icon>`;navigator.clipboard&&typeof navigator.clipboard.writeText=="function"?navigator.clipboard.writeText(e).then(()=>{f.success(`已复制: ${e}`)}).catch(l=>{console.error("Clipboard API 复制失败,降级为传统方法:",l),S(e)}):S(e)},S=o=>{const e=document.createElement("textarea");e.value=o,e.style.position="fixed",e.style.left="-9999px",document.body.appendChild(e),e.select(),e.setSelectionRange(0,o.length);try{if(document.execCommand("copy"))f.success(`已复制: ${o}`);else throw new Error("传统复制命令执行失败")}catch(l){console.error("传统复制方法失败:",l),f.error("复制失败,请手动复制图标名称")}finally{document.body.removeChild(e)}},P=()=>{},L=()=>{t.value=""},d=k(()=>{if(!t.value)return m;const o={},e=t.value.toLowerCase();return Object.keys(m).forEach(l=>{const u=m[l].filter(s=>s.toLowerCase().includes(e));u.length>0&&(o[l]=u)}),o}),F=k(()=>t.value?Object.values(d.value).reduce((o,e)=>o+e.length,0):0),M=o=>!t.value||d.value[o]&&d.value[o].length>0;return(o,e)=>{const l=D("el-icon"),u=D("PageContainer");return r(),y(u,null,{default:p(()=>[n("div",W,[e[1]||(e[1]=n("h1",null,"Element Plus Icons",-1)),n("div",G,[c(a(A),{modelValue:a(t),"onUpdate:modelValue":e[0]||(e[0]=s=>x(t)?t.value=s:null),placeholder:"搜索图标名称",clearable:"",onClear:L,onInput:P},{prefix:p(()=>[c(l,null,{default:p(()=>[c(a(I))]),_:1})]),_:1},8,["modelValue"]),a(t)?(r(),i("span",H," 找到 "+g(a(F))+" 个匹配项 ",1)):w("",!0)]),(r(!0),i(v,null,B(a(d),(s,C)=>E((r(),i("div",{key:C,class:"icon-category"},[n("h2",null,g(C),1),n("div",N,[(r(!0),i(v,null,B(s,h=>(r(),i("div",{key:h,class:"icon-item",onClick:Q=>_(h)},[c(l,{size:24},{default:p(()=>[(r(),y(O(h)))]),_:2},1024),n("span",z,g(h),1)],8,q))),128))])])),[[V,M(C)]])),128)),a(t)&&a(F)===0?(r(),i("div",j,[c(a(U),{description:"没有找到匹配的图标"})])):w("",!0)])]),_:1})}}},J=R($,[["__scopeId","data-v-d8b16cb3"]]);export{J as default};