← Back
Editing: SearchFileContent-legacy-DEpluSBh.js
System.register(["./index-legacy-vUu_c-Bn.js?v=1775100524734","./vue-core-legacy-BYkyrx0G.js?v=1775100524734","./files-legacy-CLB1Zk98.js?v=1775100524734","./FileIcon-legacy-BzQn_-Md.js?v=1775100524734","./naive-ui-legacy-DqFnZ3Ds.js?v=1775100524734","./prismjs-legacy-BN0FEcG9.js?v=1775100524734","./copy-legacy-BrCz1NuO.js?v=1775100524734"],(function(e,l){"use strict";var t,a,n,s,i,c,o,d,r,u,h,p,f,v,m,x,g,y,b,C,k,F,$,_,w,j,M,S,U,O,L,P,R,D,I,T,W,E;return{setters:[e=>{t=e.l,a=e.y,n=e.p,s=e.S,i=e.m,c=e.c},e=>{o=e.k,d=e.R,r=e.i,u=e.r,h=e.$,p=e.a8,f=e.a9,v=e._,m=e.a0,x=e.S,g=e.j,y=e.aa,b=e.ak,C=e.Z,k=e.F,F=e.P,$=e.aj,_=e.X,w=e.a3},e=>{j=e.d},e=>{M=e.W},e=>{S=e.a7,U=e.a1,O=e.au,L=e.b,P=e.B,R=e.am,D=e.a3,I=e.a4,T=e.a0,W=e.aD,E=e.aC},null,null],execute:function(){var H=document.createElement("style");H.textContent='@charset "UTF-8";.modal-footer-btns[data-v-4e566375]{display:flex;align-items:center;flex-direction:row;justify-content:end;gap:10px;padding:10px}.single-line-ellipsis[data-v-4e566375]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.search-wrapper[data-v-4e566375]{padding:20px}.search-wrapper .search-res .top-desc[data-v-4e566375]{display:flex;justify-content:start;align-content:center;margin-bottom:5px}.search-wrapper .search-res .match-list .match-list-item[data-v-4e566375]{display:flex;align-items:center;flex-direction:row;justify-content:start;gap:5px;padding:0 10px 10px}[data-v-4e566375] .n-collapse{border:1px solid var(--color-border)}[data-v-4e566375] .n-collapse .n-collapse-item:first-child>.n-collapse-item__header{padding:10px 15px 10px 5px;background:var(--color-bg-2)}\n/*$vite$:1*/',document.head.appendChild(H);const z={class:"search-wrapper"},A={class:"w-100% flex justify-start gap-6 items-center"},B={class:"w-100% flex justify-between"},X={class:"search-res"},Z={class:"top-desc"},q={class:"mr-5px"},G={class:"match-list"},J={class:"text-font1 fw-bold"},K=["innerHTML"];e("default",c(o({__name:"SearchFileContent",props:{currentPath:{type:String,default:"/"}},setup(e,{expose:c}){const{t:o}=d(),H=r("fileStore"),{currentPath:N,resetSearchFileContentFormData:Q}=H;function V(){Q()}c({open:function(){te.value=!0,le.value.path=N.value},close:V});const{searchStatistics:Y,searchRes:ee,searchFileContentFormData:le}=H,te=u(!1);function ae(){!async function(){const e=i.loading(o("file.searchFileContentModal.searching"));try{const{message:e}=await j(le.value);e&&(ee.value=e,Object.keys(ee.value).length&&(Y.value.files=Object.keys(ee.value).length,Y.value.times=Object.values(ee.value).flat().reduce(((e,l)=>e+Object.values(l).length),0)))}finally{e.close()}}()}function ne(e,l){const t=new RegExp(l,"g");return e.replace(t,`<span style="color:#ff3300">${l}</span>`)}function se(){n({title:o("Component.SelectPath.index_7"),width:750,height:640,footer:!1,data:{path:le.value.path,callback:e=>{le.value.path=e}},component:w((()=>s((()=>l.import("./index-legacy-TYzHgZ0R.js?v=1775100524734")),void 0)))})}return(e,l)=>{const n=L,s=P,i=O,c=U,o=R,d=t,r=I,u=D,w=S,j=T,H=E,Q=W,ie=a;return h(),p(ie,{show:x(te),"onUpdate:show":l[7]||(l[7]=e=>_(te)?te.value=e:null),title:e.$t("file.searchFileContentModal.title"),width:720,onAfterLeave:V},{default:f((()=>[v("div",z,[m(w,{"label-placement":"left","label-width":60,"label-align":"left"},{default:f((()=>[m(c,{label:e.$t("file.searchFileContentModal.search")},{default:f((()=>[m(i,null,{default:f((()=>[m(n,{value:x(le).text,"onUpdate:value":l[0]||(l[0]=e=>x(le).text=e)},null,8,["value"]),m(s,{type:"primary",onClick:ae},{default:f((()=>[g(y(e.$t("file.searchFileContentModal.search")),1)])),_:1})])),_:1})])),_:1},8,["label"]),m(c,{label:e.$t("file.searchFileContentModal.suffix")},{default:f((()=>[m(n,{value:x(le).exts,"onUpdate:value":l[1]||(l[1]=e=>x(le).exts=e)},null,8,["value"])])),_:1},8,["label"]),m(c,{label:e.$t("file.searchFileContentModal.folder")},{default:f((()=>[v("div",A,[m(n,{value:x(le).path,"onUpdate:value":l[3]||(l[3]=e=>x(le).path=e)},{suffix:f((()=>[m(o,{checked:x(le).is_subdir,"onUpdate:checked":l[2]||(l[2]=e=>x(le).is_subdir=e),"checked-value":1,"unchecked-value":0},{default:f((()=>[g(y(e.$t("file.searchFileContentModal.subdir")),1)])),_:1},8,["checked"])])),_:1},8,["value"]),m(d,{name:"file-dir",color:"#000",size:"24",style:{cursor:"pointer"},onClick:se})])])),_:1},8,["label"]),m(c,{label:e.$t("file.searchFileContentModal.mode")},{default:f((()=>[v("div",B,[m(u,{value:x(le).mode,"onUpdate:value":l[4]||(l[4]=e=>x(le).mode=e)},{default:f((()=>[m(r,{value:0},{default:f((()=>[g(y(e.$t("file.searchFileContentModal.words")),1)])),_:1}),m(r,{value:1},{default:f((()=>[g(y(e.$t("file.searchFileContentModal.regex")),1)])),_:1})])),_:1},8,["value"]),v("div",null,[0==x(le).mode?(h(),p(o,{key:0,checked:x(le).isword,"onUpdate:checked":l[5]||(l[5]=e=>x(le).isword=e),label:e.$t("file.searchFileContentModal.matchWholeWord"),class:"mr-5","checked-value":1,"unchecked-value":0},null,8,["checked","label"])):b("",!0),m(o,{checked:x(le).iscase,"onUpdate:checked":l[6]||(l[6]=e=>x(le).iscase=e),label:e.$t("file.searchFileContentModal.matchCase"),"checked-value":1,"unchecked-value":0},null,8,["checked","label"])])])])),_:1},8,["label"])])),_:1}),v("div",X,[v("div",Z,[v("span",q,y(e.$t("file.searchFileContentModal.searchResult")),1),v("span",null,y(x(Y).times)+" "+y(e.$t("file.searchFileContentModal.matchesIn"))+" "+y(x(Y).files)+" "+y(e.$t("file.searchFileContentModal.files")),1)]),m(j,{style:{"margin-bottom":"20px"}}),(h(!0),C(k,null,F(x(ee),((l,t)=>(h(),p(Q,{key:t,class:"mb-10px"},{default:f((()=>[m(H,{title:`${t} (${e.$t("file.searchFileContentModal.match")} ${Object.values(l).length} ${e.$t("file.searchFileContentModal.times")})`,name:"1"},{"header-extra":f((()=>[m(s,{text:"",type:"primary",onClick:$((e=>async function(e){M(e,N.value)}(t)),["stop"])},{default:f((()=>[g(y(e.$t("file.searchFileContentModal.edit")),1)])),_:2},1032,["onClick"])])),default:f((()=>[v("div",G,[(h(!0),C(k,null,F(l,((l,t)=>(h(),C("div",{class:"match-list-item",key:t},[v("div",J,y(e.$t("file.searchFileContentModal.line"))+" "+y(t)+": ",1),v("div",{innerHTML:ne(l,x(le).text)},null,8,K)])))),128))])])),_:2},1032,["title"])])),_:2},1024)))),128))])])])),_:1},8,["show","title"])}}}),[["__scopeId","data-v-4e566375"]]))}}}));
Save File
Cancel