PageSourceSearch

https://onlineshop.yamakawa.co.jp/build/assets/EditorAssetIndex-JSYU7Od5.js

js yamakawa.co.jp collected 2026-09-24 09:54:14 UTC 7,486 bytes, 1 lines download raw bytes

1import{s as b,W as $,x as l,y as r,B as i,A as o,X as c,Z as I,R as n,Y as W,$ as G,E as D,G as K,I as B,J as d,a6 as O,a4 as q,K as h,a0 as J,P as w,S,ag as X,a2 as u,H as Z,a3 as Q}from"./useAxios-CREc-RjR.js";import{s as A}from"./index-CBo61_8Z.js";import{a as ee,s as te}from"./index-BYlEbkXX.js";import{s as se}from"./index-CsIS_Ibc.js";import{_ as oe}from"./Breadcrumbs-_J-9L3J9.js";import{_ as ie}from"./FunctionalMenu-D3HQ_DEj.js";import ae from"./FilterInput-DZcb5jm8.js";import re from"./PreviewImage-BhTJ7RuF.js";/* empty css                       *//* empty css                                                                    */import"./useAdminMode-BSl08v1L.js";import ne from"./ClickCopy-BERe1Gmq.js";import"./useAdminConsts-BXfWQY0A.js";import"./useAdminAuth-ChC2PabM.js";/* empty css              *//* empty css                                                                           */import"./index-B86H74JF.js";import"./index-CbDQ0c8r.js";import"./index-CIkmome0.js";import"./useAdminPage-sYgQTQ5F.js";import"./index-ChvZQVuh.js";import"./index-B7tz6R4C.js";/* empty css                                                                     */const le={class:"sticky top-0 z-10"},ce={class:"grid gap-6 grid-cols-[repeat(auto-fill,_minmax(20rem,_1fr))]"},pe={class:"pt-2 flex justify-between items-start w-full gap-2"},de={class:"flex items-start gap-1 text-wrap break-all text-sm h-[3rem]"},me={key:0,class:"pi pi-image"},ue={key:1,class:"pi pi-file-pdf"},fe={key:2,class:"pi pi-file-excel"},_e={key:3,class:"pi pi-file-word"},ve={key:4,class:"pi pi-file"},ge={class:"flex justify-between items-start"},xe={key:1,class:"flex flex-col items-center justify-center w-full h-full bg-gray-200 gap-4 p-2 text-wrap"},ye={class:"flex items-center gap-4"},be={class:"text-sm"},he={class:"flex justify-between gap-2"},we={class:"mt-4"},Ke={__name:"EditorAssetIndex",props:{editorAssets:{type:Object,required:!0}},setup(f){const F=b([{label:"コンテンツ管理",disabled:!0},{label:"アップロードファイル管理",url:route("admin.editor-assets.index")}]),E=Q(),_=q(),p=$({keyword:"",per_page:15,page:0}),T=()=>{p.page=0,v()},L=t=>{p.per_page=t.rows,p.page=t.page,v()},v=()=>{p.transform(t=>({...t,page:t.page+1})).get(route("admin.editor-assets.index"),{preserveState:!0,preserveScroll:!0,replace:!0,only:["editorAssets"]})},M=()=>{const t=document.createElement("input");t.setAttribute("type","file"),t.click(),t.onchange=async()=>{const s=t.files[0];if(s){const a=new FormData;a.append("file",s);try{await axios.post(route("api.admin.editor-assets.store"),a,{headers:{"Content-Type":"multipart/form-data"}}),v()}catch(m){throw _.error("ファイルのアップロードに失敗しました。"),m}}}},R=async t=>{if(!await E.dialog("アップロードファイルの削除","選択中のアップロードファイルを削除します。商品情報や各記事だけでなく、他システムやメールから参照されていないことを確認してください。本当に削除してもよろしいですか?",{acceptLabel:"削除実行",acceptClass:"p-button-danger"}))return;$({id:t.id}).delete(route("admin.editor-assets.destroy",{editor_asset:t.filename}),{preserveState:!0,preserveScroll:!0,replace:!0,onSuccess:()=>{_.success("アップロードファイルを削除しました。")},onError:m=>{throw _.error("アップロードファイルの削除中にエラーが発生しました。"),m}})},U=t=>{const s=["B","KB","MB","GB","TB"];let a=0;for(;t>=1024&&a<s.length;)t/=1024,a++;return t.toFixed(1)+""+s[a]},g=b(!1),k=b([]),j=async t=>{const s=await axios.get(route("api.admin.editor-assets.using",{editor_asset:t.filename}));k.value=s.data,g.value=!0},P=t=>{const s=document.createElement("a");s.href=t.url,s.download=t.filename,s.target="_blank",s.click(),s.remove()},z=t=>{window.open(t.url,"_blank")};return(t,s)=>{const a=W,m=se,C=te,V=ee,Y=O,H=A,x=X;return r(),l(D,null,[i(c(I),{title:"アップロードファイル管理"}),i(oe,{items:F.value},null,8,["items"]),o("div",le,[i(ie,{class:"mb-2"},{end:n(()=>[i(ae,{"filter-form":c(p),"onUpdate:filterForm":s[0]||(s[0]=e=>G(p)?p.value=e:null),onExecuteFilter:T},null,8,["filter-form"])]),default:n(()=>[i(a,{icon:"pi pi-plus",label:"新規アップロード",raised:"",rounded:"",size:"small",onClick:M})]),_:1})]),o("div",ce,[(r(!0),l(D,null,K(f.editorAssets.data,(e,N)=>(r(),h(m,{key:N,pt:{header:{class:"px-[1rem] py-2 border-b border-b-1 flex items-center"},content:{class:"w-full h-[20rem]"}}},{header:n(()=>[o("div",pe,[o("div",de,[c(u).startsWith(e.mime,"image/")?(r(),l("i",me)):c(u).includes(["pdf"],e.extension)?(r(),l("i",ue)):c(u).includes(["xls","xlsx","xlsm"],e.extension)?(r(),l("i",fe)):c(u).includes(["doc","docx"],e.extension)?(r(),l("i",_e)):(r(),l("i",ve)),B(" "+d(e.filename),1)]),o("div",ge,[i(ne,{"model-value":e.url,"copied-text":"URLをコピーしました。"},{default:n(()=>[w(i(a,{icon:"pi pi-copy",label:"URL",severity:"secondary",size:"small"},null,512),[[x,"このファイルへのURLをコピーします。",void 0,{bottom:!0}]])]),_:2},1032,["model-value"])])])]),content:n(()=>[c(u).startsWith(e.mime,"image/")?(r(),h(re,{key:0,height:"20rem",width:"100%",src:e.url},null,8,["src"])):(r(),l("div",xe,[o("div",null,d(e.filename),1),o("div",ye,[e.extension==="pdf"?(r(),h(a,{key:0,icon:"pi pi-eye",severity:"secondary",onClick:y=>z(e)},null,8,["onClick"])):Z("",!0),i(a,{icon:"pi pi-download",severity:"secondary",onClick:y=>P(e)},null,8,["onClick"])])]))]),footer:n(()=>[o("div",be,[o("div",null,"アップロード "+d(c(J)(e.created_at).format("YYYY年MM月DD日 HH時mm分")),1),o("div",null,"ファイルサイズ "+d(U(e.filesize)),1),o("div",he,[w(i(a,{icon:"pi pi-search",label:"利用箇所の確認",severity:"secondary",size:"small",disabled:e.encoded_name.length>1e3,onClick:S(y=>j(e),["prevent"])},null,8,["disabled","onClick"]),[[x,e.encoded_name.length>1e3?"元のファイル名が長すぎるため、利用箇所の確認ができません。":"このファイルを参照している可能性のあるこのシステム上のデータを確認します。",void 0,{bottom:!0}]]),w(i(a,{severity:"danger",size:"small",icon:"pi pi-trash",onClick:S(y=>R(e),["prevent"])},null,8,["onClick"]),[[x,"このファイルを削除します。",void 0,{bottom:!0}]])])])]),_:2},1024))),128))]),i(Y,{visible:g.value,"onUpdate:visible":s[1]||(s[1]=e=>g.value=e),header:"このファイルの利用箇所の確認",modal:"",class:"w-[75%]","dismissable-mask":"","close-on-escape":""},{default:n(()=>[i(V,{value:k.value},{empty:n(()=>[...s[2]||(s[2]=[o("div",{class:"text-gray-400"},"参照元が見つかりませんでした。",-1)])]),default:n(()=>[i(C,{field:"index",header:"#"},{body:n(({index:e})=>[B(d(e+1),1)]),_:1}),i(C,{field:"Snippet",header:"使用箇所(HTML抜粋)","body-class":"text-xs"},{body:n(({data:e})=>[o("code",null,d(e.Snippet),1)]),_:1})]),_:1},8,["value"]),s[3]||(s[3]=o("div",{class:"flex items-center text-red-600 text-sm mt-2"},[o("i",{class:"pi pi-exclamation-triangle"}),o("div",{class:"ml-1"}," このファイルを直接参照したり、他システムからリンクしている場合は上記に表示されません。削除する場合は注意してください。 ")],-1))]),_:1},8,["visible"]),o("div",we,[i(H,{"total-records":f.editorAssets.total,rows:f.editorAssets.per_page,"rows-per-page-options":[15,50,100],onPage:L},null,8,["total-records","rows"])])],64)}}};export{Ke as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.