mirror of
https://gitee.com/niucloud-team/niucloud-admin.git
synced 2026-01-21 02:28:10 +00:00
2 lines
7.9 KiB
JavaScript
2 lines
7.9 KiB
JavaScript
import{d as ee,f as te,v as ae,l as D,X as le,k as a,r as y,bf as oe,h as p,c as _,e as o,w as s,a as v,t as i,u as l,i as m,B as x,F as j,T as q,m as g,J as se,z as ne,bg as re,a4 as ie,E as pe,aE as de,D as ue,G as me,a3 as ce,ah as fe,H as ye,L as _e,a5 as ge,ab as ve,a6 as he,a7 as be,S as ke,M as Pe}from"./index-9f163f98.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./el-tooltip-4ed993c7.js";/* empty css *//* empty css *//* empty css */import"./el-form-item-4ed993c7.js";/* empty css *//* empty css */import{c as we,d as xe,m as Ce,f as Te,h as Ve,b as Ee,j as De}from"./poster-abd73d91.js";const Fe={class:"main-container"},$e={class:"flex justify-between items-center"},Ne={class:"text-page-title"},Be={key:0,class:"mt-[20px]"},Ue=v("span",{class:"!text-[14px]"},"检测到PHP未安装ImageMagick扩展,需安装后才能使用海报功能",-1),Re={key:0,class:"text-primary"},Se={key:1},ze={class:"mt-[16px] flex justify-end"},Ie={class:"dialog-footer"},Le={key:0},Me=["src"],mt=ee({__name:"list",setup(je){const F=te(),H=ae().meta.title,b=D({}),c=D({name:"",type:""}),A=le(()=>({name:[{required:!0,message:a("posterNamePlaceholder"),trigger:"blur"}],type:[{required:!0,message:a("posterTypePlaceholder"),trigger:"blur"}]})),$=y(),k=y(!1),G=async r=>{r&&await r.validate(async e=>{if(e){const u={type:c.type,name:c.name},V=F.resolve({path:"/poster/edit",query:u});window.open(V.href),k.value=!1,c.name="",c.type=""}})};(()=>{we({}).then(r=>{for(const e in b)delete b[e];for(const e in r.data)b[e]=r.data[e]})})();const n=D({page:1,limit:10,total:0,loading:!0,data:[],searchParam:{name:"",type:""}}),N=y(),f=(r=1)=>{n.loading=!0,n.page=r,xe({page:n.page,limit:n.limit,...n.searchParam}).then(e=>{n.loading=!1,n.data=e.data.data,n.total=e.data.total,re(n.page,n.limit,n.searchParam)}).catch(()=>{n.loading=!1})};f(oe(n.searchParam).page);const J=r=>{const e=F.resolve({path:"/poster/edit",query:{id:r.id}});window.open(e.href)},d=y(!1),B=(r,e)=>{d.value||(d.value=!0,Ce({id:r,status:e}).then(u=>{f(),d.value=!1}))},O=r=>{d.value||(d.value=!0,Te({id:r}).then(e=>{f(),d.value=!1}))},X=r=>{ie.confirm(a("diyPosterDeleteTips"),a("warning"),{confirmButtonText:a("confirm"),cancelButtonText:a("cancel"),type:"warning"}).then(()=>{d.value||(d.value=!0,Ve(r).then(()=>{f(),d.value=!1}).catch(()=>{d.value=!1}))})},C=y(!1),T=y(""),K=r=>{d.value||(d.value=!0,Ee({id:r.id,type:r.type}).then(e=>{e.data&&(T.value=e.data,C.value=!0),d.value=!1}))},Q=r=>{r&&(r.resetFields(),f())},U=y(!1);return(()=>{De().then(r=>{console.log(r),U.value=r.data})})(),(r,e)=>{const u=pe,V=de,R=ue,P=me,E=ce,S=fe,z=ye,I=_e,h=ge,L=ve,W=he,Y=be,M=ke,Z=Pe;return p(),_("div",Fe,[o(I,{class:"box-card !border-none",shadow:"never"},{default:s(()=>[v("div",$e,[v("span",Ne,i(l(H)),1),o(u,{type:"primary",class:"w-[100px]",onClick:e[0]||(e[0]=t=>k.value=!0)},{default:s(()=>[m(i(l(a)("添加海报")),1)]),_:1})]),U.value?x("",!0):(p(),_("div",Be,[o(V,{type:"warning","show-icon":"",closable:!1},{title:s(()=>[Ue]),_:1})])),o(I,{class:"box-card !border-none my-[10px] table-search-wrap",shadow:"never"},{default:s(()=>[o(z,{inline:!0,model:n.searchParam,ref_key:"searchFormDiyPosterRef",ref:N},{default:s(()=>[o(P,{label:l(a)("posterName"),prop:"name"},{default:s(()=>[o(R,{modelValue:n.searchParam.name,"onUpdate:modelValue":e[1]||(e[1]=t=>n.searchParam.name=t),modelModifiers:{trim:!0},placeholder:l(a)("posterNamePlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),o(P,{label:l(a)("posterType"),prop:"type"},{default:s(()=>[o(S,{modelValue:n.searchParam.type,"onUpdate:modelValue":e[2]||(e[2]=t=>n.searchParam.type=t),placeholder:l(a)("posterTypePlaceholder")},{default:s(()=>[o(E,{label:l(a)("all"),value:""},null,8,["label"]),(p(!0),_(j,null,q(b,t=>(p(),g(E,{label:t.name,value:t.type,key:t.type},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"]),o(P,null,{default:s(()=>[o(u,{type:"primary",onClick:e[3]||(e[3]=t=>f())},{default:s(()=>[m(i(l(a)("search")),1)]),_:1}),o(u,{onClick:e[4]||(e[4]=t=>Q(N.value))},{default:s(()=>[m(i(l(a)("reset")),1)]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),se((p(),g(W,{data:n.data,size:"large"},{empty:s(()=>[v("span",null,i(n.loading?"":l(a)("emptyData")),1)]),default:s(()=>[o(h,{prop:"name",label:l(a)("posterName"),"min-width":"120"},null,8,["label"]),o(h,{prop:"type_name",label:l(a)("posterType"),"min-width":"80"},null,8,["label"]),o(h,{label:l(a)("status"),"min-width":"80"},{default:s(({row:t})=>[t.status==1?(p(),g(L,{key:0,type:"success",onClick:w=>B(t.id,0),class:"cursor-pointer"},{default:s(()=>[m(i(l(a)("启用")),1)]),_:2},1032,["onClick"])):(p(),g(L,{key:1,type:"info",onClick:w=>B(t.id,1),class:"cursor-pointer"},{default:s(()=>[m(i(l(a)("未启用")),1)]),_:2},1032,["onClick"]))]),_:1},8,["label"]),o(h,{label:l(a)("isDefault"),"min-width":"80"},{default:s(({row:t})=>[t.is_default==1?(p(),_("span",Re,i(l(a)("defaultPoster")),1)):(p(),_("span",Se,i(l(a)("noDefault")),1))]),_:1},8,["label"]),o(h,{prop:"update_time",label:l(a)("updateTime"),"min-width":"120"},null,8,["label"]),o(h,{label:l(a)("operation"),fixed:"right",align:"right","min-width":"160"},{default:s(({row:t})=>[o(u,{type:"primary",link:"",onClick:w=>K(t)},{default:s(()=>[m(i(l(a)("preview")),1)]),_:2},1032,["onClick"]),t.is_default==0?(p(),g(u,{key:0,type:"primary",link:"",onClick:w=>O(t.id)},{default:s(()=>[m(i(l(a)("modifyDefault")),1)]),_:2},1032,["onClick"])):x("",!0),o(u,{type:"primary",link:"",onClick:w=>J(t)},{default:s(()=>[m(i(l(a)("edit")),1)]),_:2},1032,["onClick"]),t.is_default==0?(p(),g(u,{key:1,type:"primary",link:"",onClick:w=>X(t.id)},{default:s(()=>[m(i(l(a)("delete")),1)]),_:2},1032,["onClick"])):x("",!0)]),_:1},8,["label"])]),_:1},8,["data"])),[[Z,n.loading]]),v("div",ze,[o(Y,{"current-page":n.page,"onUpdate:current-page":e[5]||(e[5]=t=>n.page=t),"page-size":n.limit,"onUpdate:page-size":e[6]||(e[6]=t=>n.limit=t),layout:"total, sizes, prev, pager, next, jumper",total:n.total,onSizeChange:e[7]||(e[7]=t=>f()),onCurrentChange:f},null,8,["current-page","page-size","total"])])]),_:1}),o(M,{modelValue:k.value,"onUpdate:modelValue":e[12]||(e[12]=t=>k.value=t),title:l(a)("addPosterTitle"),width:"350px","destroy-on-close":"true"},{footer:s(()=>[v("span",Ie,[o(u,{onClick:e[10]||(e[10]=t=>k.value=!1)},{default:s(()=>[m(i(l(a)("cancel")),1)]),_:1}),o(u,{type:"primary",onClick:e[11]||(e[11]=t=>G($.value))},{default:s(()=>[m(i(l(a)("confirm")),1)]),_:1})])]),default:s(()=>[o(z,{model:c,"label-width":"90px",ref_key:"formRef",ref:$,rules:l(A)},{default:s(()=>[o(P,{label:l(a)("posterName"),prop:"name"},{default:s(()=>[o(R,{modelValue:c.name,"onUpdate:modelValue":e[8]||(e[8]=t=>c.name=t),modelModifiers:{trim:!0},placeholder:l(a)("posterNamePlaceholder"),clearable:"",maxlength:"12","show-word-limit":"",class:"w-full"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),o(P,{label:l(a)("posterType"),prop:"type"},{default:s(()=>[o(S,{modelValue:c.type,"onUpdate:modelValue":e[9]||(e[9]=t=>c.type=t),placeholder:l(a)("posterTypePlaceholder"),class:"!w-full"},{default:s(()=>[(p(!0),_(j,null,q(b,t=>(p(),g(E,{label:t.name,value:t.type,key:t.type},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"])]),_:1},8,["model","rules"])]),_:1},8,["modelValue","title"]),o(M,{modelValue:C.value,"onUpdate:modelValue":e[13]||(e[13]=t=>C.value=t),title:l(a)("previewDialogTitle"),width:"400px",height:"640px"},{default:s(()=>[T.value?(p(),_("div",Le,[v("img",{src:l(ne)(T.value),class:"w-[360px] h-[640px]"},null,8,Me)])):x("",!0)]),_:1},8,["modelValue","title"])])}}});export{mt as default};
|