1 |
- import{j as g}from"./index-BXL90VpN.js";import{am as ne,_ as se}from"./entry/index-C7JiT1GB.js";import{aE as ie,B as j,aZ as ue,Y as re,W as E,x as de,X as K,a_ as N,a$ as T,b0 as pe,a5 as ce,C as me,b1 as fe,R as V,aT as ve,b2 as ge,M as y,$ as ye,a0 as _e,E as xe,j as c}from"./antd-FjOLgRLC.js";import{d as he,f as s,Z as r,_ as w,k as o,a8 as n,u as l,G as k,a7 as C,F as L,aa as z,a0 as R,$ as u,ab as ke,a2 as Ce,a3 as be}from"./vue-ByATgq5d.js";const S=d=>(Ce("data-v-861ab832"),d=d(),be(),d),Ue={class:"image-list upload-list",id:"items2"},Ie={style:{height:"110px",display:"flex","justify-content":"center","align-items":"center",background:"#ddd"}},we=["title"],Le={style:{margin:"20px 0 0 0","text-align":"center",clear:"both"}},Se={class:"ant-upload-drag-icon"},Be=S(()=>u("p",{class:"ant-upload-text"},"点击或拖拽文件上传",-1)),Oe=S(()=>u("p",{class:"ant-upload-hint"}," Support for a single or bulk upload. Strictly prohibit from uploading company data or other band files ",-1)),$e=S(()=>u("div",{class:"cropperBox"},null,-1)),Me=he({__name:"gallery",props:{type:{type:String,default:"none"},isSelect:{type:Boolean,default:!0}},emits:["change"],setup(d,{emit:Z}){const q=ie.Dragger,A=Z,p=d,H={Authorization:ne()},B=s({type:p.type,group_id:0}),m=s("http://www.xingyousoft.com/"),O=s([-1]),_=s(!1),x=s(!1),$=s(!1),M=s(1),W=()=>{},b=s([]),i=s({}),h=s(void 0),G=s([]),D=s(0),F=s([]),X=()=>{_.value=!0},Y=a=>{a.fullUrl=te(a.path),A("change",a)},J=a=>{a.key!=-1?(i.value=b.value[a.key],h.value=i.value.id,B.value.group_id=h.value):h.value=void 0,f()},Q=a=>{let e=a.file.response;e&&e.error&&(a.fileList.pop(),alert(e.msg))},ee=a=>{},te=a=>{let e="";return m.value.lastIndexOf("/")==-1?e=m.value+a:e=m.value.substring(0,m.value.length-1)+a,e},f=()=>{g("media_list",{type:p.type,group_id:h.value}).then(a=>{G.value=a.list,D.value=a.total}),_.value=!1},U=()=>{g("media_group",{type:p.type}).then(a=>{b.value=a.list,f()})};U();const P=a=>{a&&(i.value=a),x.value=!0},ae=()=>{let a;i.value.mid?a="media_group_edit":a="media_group_add",g(a,{mid:i.value.mid,type:p.type,name:i.value.name}).then(e=>{e.error?c.error(e.msg):(c.success("操作成功!"),U(),x.value=!1)})},le=(a,e)=>{y.confirm({title:"你确定要删除该条信息吗?",onOk:()=>{g("media_group_del",{mid:e.mid,type:p.type}).then(t=>{t.error?c.error(t.msg):(c.success("操作成功!"),U())})}})},oe=(a,e)=>{y.confirm({title:"你确定要删除该条信息吗?",onOk:()=>{g("media_del",{mid:e.mid,type:p.type}).then(t=>{t.error?c.error(t.msg):(c.success("操作成功!"),f())})}})};return(a,e)=>(r(),w(L,null,[o(l(V),null,{default:n(()=>[o(l(j),{type:"primary",style:{"margin-bottom":"15px"},size:"large",onClick:X},{default:n(()=>[o(l(ue)),k(" 上传图片 ")]),_:1}),o(l(re),{gutter:[16,16]},{default:n(()=>[o(l(E),{span:"5"},{default:n(()=>[o(l(de),{selectedKeys:O.value,"onUpdate:selectedKeys":e[0]||(e[0]=t=>O.value=t),mode:"vertical",onClick:J},{default:n(()=>[(r(),C(l(K),{key:-1},{default:n(()=>[k("全部")]),_:1})),(r(!0),w(L,null,z(b.value,(t,v)=>(r(),C(l(K),{key:v},{default:n(()=>[k(R(t.name)+" ",1),o(l(N),{onClick:I=>P(t),style:{"margin-left":"20px"}},null,8,["onClick"]),o(l(T),{onClick:I=>le(v,t),style:{"margin-left":"5px"}},null,8,["onClick"])]),_:2},1024))),128))]),_:1},8,["selectedKeys"]),o(l(j),{type:"primary",onClick:P,style:{"margin-top":"30px"}},{default:n(()=>[k("添加分组")]),_:1})]),_:1}),o(l(E),{span:"19"},{default:n(()=>[u("div",Ue,[o(l(pe),null,{default:n(()=>[(r(!0),w(L,null,z(G.value,(t,v)=>(r(),C(l(V),{key:v,hoverable:"",style:{width:"150px",margin:"10px",display:"inline-block"}},{cover:n(()=>[u("div",Ie,[o(l(ce),{src:m.value+t.path,title:t.filename,style:{"max-height":"100px"}},null,8,["src","title"])])]),actions:n(()=>[d.isSelect?(r(),C(l(me),{key:0,onClick:I=>Y(t)},null,8,["onClick"])):ke("",!0),o(l(N)),o(l(T),{onClick:I=>oe(v,t)},null,8,["onClick"])]),default:n(()=>[o(l(fe),null,{title:n(()=>[u("span",{title:t.filename},R(t.filename),9,we)]),_:2},1024)]),_:2},1024))),128))]),_:1})]),u("div",Le,[o(l(ve),{current:M.value,"onUpdate:current":e[1]||(e[1]=t=>M.value=t),"show-quick-jumper":"",total:D.value,onChange:W},null,8,["current","total"])])]),_:1})]),_:1})]),_:1}),o(l(y),{open:_.value,"onUpdate:open":e[3]||(e[3]=t=>_.value=t),title:"图片上传",onOk:e[4]||(e[4]=t=>f()),onCancel:e[5]||(e[5]=t=>f())},{default:n(()=>[o(l(q),{fileList:F.value,"onUpdate:fileList":e[2]||(e[2]=t=>F.value=t),name:"file",multiple:!0,"max-count":5,"list-type":"picture",action:"/admin/api/uploadImg",data:B.value,headers:H,onChange:Q,onDrop:ee},{default:n(()=>[u("p",Se,[o(l(ge))]),Be,Oe]),_:1},8,["fileList","data"])]),_:1},8,["open"]),o(l(y),{open:x.value,"onUpdate:open":e[7]||(e[7]=t=>x.value=t),title:"分组管理",onOk:ae},{default:n(()=>[o(l(ye),{style:{margin:"20px"}},{default:n(()=>[o(l(_e),{label:"分组名称"},{default:n(()=>[o(l(xe),{value:i.value.name,"onUpdate:value":e[6]||(e[6]=t=>i.value.name=t)},null,8,["value"])]),_:1})]),_:1})]),_:1},8,["open"]),o(l(y),{open:$.value,"onUpdate:open":e[8]||(e[8]=t=>$.value=t),width:"800",title:"图片编辑"},{default:n(()=>[$e]),_:1},8,["open"])],64))}}),je=se(Me,[["__scopeId","data-v-861ab832"]]);export{je as default};
|