import{d as e,I as a,a5 as l,r as t,o as s,ak as o,c as r,w as n,L as c,u,i,h as p,j as f,k as d,m,a as v,b as g,q as h,am as _,aV as y,v as x,f as b,K as C,C as k,t as w,p as I,a8 as S,D as V,T as z,z as H,au as M,_ as N}from"./index-CY26MUkV.js";import{u as T,r as $}from"./popup.Dnln7fgr.js";const j=N(e({__name:"index",setup(e){a();const{styles:N,topContainerColor:j}=l(),A=T(),D=t(),L=t(!0),B=t(""),K=t([]),q=t(!0),E=t(600);s(()=>{Q()});const Q=()=>{const e=o().windowHeight||600;E.value=e-170},R=(e,a)=>{if(!a)return e;const l=new RegExp(a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"gi");return e.replace(l,e=>`<span style="color:red;font-weight:500;font-size:16px">${e}</span>`)},U=()=>{var e;if(!B.value)return z.info("请输入关键字，在进行查询");null==(e=D.value)||e.scrollTo(0),q.value=!1,M(()=>{q.value=!0}),F()},F=async()=>{let e={MethodName:A.methodName,Value:B.value||"",Items:A.search||["parameter2"]},a=await H("/api/services/app/AppSerachInput/QueryAppSerachInputDataSource",e).catch(e=>z.error("查询失败，请稍后重试"));if(!a)return z.error("查询失败，请稍后重试");if(!a.success)return z.error("查询失败，请稍后重试");L.value=!1;let l=(a.result||[]).map((e,a)=>({...e,no:a,precise:e[A.textName||"parameter2"]===B.value})).slice(0,A.visibleCount||25);K.value=[...l]};return(e,a)=>{const l=p(d("up-navbar"),f),t=m("m-icon"),s=_,o=x,z=i,H=m("m-virtual-scroll"),M=m("m-blank"),T=m("m-toast-app");return v(),r(z,{class:"page-container",style:c({...u(N)})},{default:n(()=>[g(l,{title:u(A).title??e.$t("SearchMangmentView"),border:"",bgColor:u(h).bgColor,leftIconColor:u(h).leftIconColor,titleStyle:"color:"+u(h).titleColor,autoBack:!0},null,8,["title","bgColor","leftIconColor","titleStyle"]),g(z,{class:"serach-container",style:c([{backgroundColor:u(j)},{padding:"10px","background-color":"transparent",width:"auto"}])},{default:n(()=>[g(z,{class:"search"},{default:n(()=>[g(z,{class:"item"},{default:n(()=>[g(t,{name:"yo-icon-sousuo1",color:"rgb(209,213,219)",size:28,class:"item-icon"}),g(s,{modelValue:B.value,"onUpdate:modelValue":a[0]||(a[0]=e=>B.value=e),type:"text",class:"item-text",focus:q.value,placeholder:"请输入要查询的内容",onKeydown:y(U,["enter"])},null,8,["modelValue","focus"]),g(o,{type:"button",class:"item-btn",onClick:U},{default:n(()=>[b("搜索")]),_:1})]),_:1})]),_:1}),g(z,{class:"content"},{default:n(()=>[L.value?(v(),r(z,{key:0,class:"not-info"},{default:n(()=>[g(t,{class:"info-icon",name:"yo-icon-sousuo1",color:"#e5e7eb",size:60}),g(z,{class:"text last"},{default:n(()=>[b("输入关键词查找信息")]),_:1})]),_:1})):C("",!0),L.value?C("",!0):(v(),r(z,{key:1,class:"list-view"},{default:n(()=>[k(g(z,null,{default:n(()=>[g(z,{class:"search-info"},{default:n(()=>[b("找到 "+w(K.value.length)+" 个搜索相关结果",1)]),_:1}),g(H,{ref_key:"scrollDom",ref:D,list:K.value,class:"list-container",height:E.value,itemHeight:60,marginBottom:0,style:{"margin-top":"5px","background-color":"#fff"}},{default:n(({item:e,index:a})=>[g(z,{class:"card-item-info",onClick:a=>(e=>{$(e)})(e)},{default:n(()=>[I("span",{class:"no"},[b(" [ "),I("span",{style:{color:"#5385f3"}},w(e.no+1),1),b(" ] ")]),g(z,{style:{"margin-left":"10px","margin-right":"5px",flex:"1"}},{default:n(()=>[I("span",{class:"info-text"},[I("span",{innerHTML:R(e[u(A).textName||"parameter2"],B.value)},null,8,["innerHTML"])]),g(z,{class:S(["desc",[e.precise?"precise":""]])},{default:n(()=>[b(" 匹配结果 · "+w(e.precise?"精准":"可用"),1)]),_:2},1032,["class"])]),_:2},1024)]),_:2},1032,["onClick"])]),_:1},8,["list","height"])]),_:1},512),[[V,K.value.length]]),k(g(z,null,{default:n(()=>[g(M,{class:"page-blank"})]),_:1},512),[[V,!K.value.length]])]),_:1}))]),_:1})]),_:1},8,["style"]),g(T)]),_:1},8,["style"])}}}),[["__scopeId","data-v-fc9ac43f"]]);export{j as default};
