/* empty css             *//* empty css                   */import{_ as e}from"./index-30b81ccf.js";import{_ as a}from"./index.vue_vue_type_script_setup_true_lang-bc7fd1e2.js";/* empty css                        *//* empty css                    *//* empty css               */import"./el-tooltip-4ed993c7.js";/* empty css                  *//* empty css                     *//* empty css                  *//* empty css                        *//* empty css                  */import{_ as l}from"./search.vue_vue_type_script_setup_true_lang-946854ba.js";/* empty css                 *//* empty css                  *//* empty css                     */import{c as t,o as s,a as o}from"./create-a7579b79.js";import{u as r}from"./useGetList-927e47a1.js";import{o as i}from"./index-1eb7652b.js";/* empty css                 *//* empty css                   */import"./http-aa208300.js";/* empty css                   */import{d as p,m as u,p as n,x as m,an as d,o as c,c as v,e as j,a as f,w as _,f as b,F as y,y as g,l as h,W as x,b as w,a4 as V,aC as k,a2 as C,a3 as B,A as U,B as z,S as D,a7 as T,D as $,ar as F,a8 as L,$ as S}from"./index-2b50ecca.js";/* empty css                  */import"./index-a921dba7.js";/* empty css                      *//* empty css                */import"./myUpload-5c17dffa.js";/* empty css                    */import"./videoList-c3a06816.js";/* empty css                   *//* empty css                 *//* empty css                          *//* empty css                */import"./index-b8a1ff49.js";import"./index-403f799c.js";const q={class:"flex flex-col justify-between w-full sm:flex-row"},A={class:"w-full"},G={class:"table-default"},I={class:"pt-5 pl-2"},M=j("br",null,null,-1),Q=p({__name:"index",setup(p){const Q=u([]),{data:W,query:X,search:Y,reset:Z,loading:E}=r("operation/banner/list",!0),H=n((()=>{var e;return null==(e=W.value)?void 0:e.data})),J=u(!1),K=u({}),N=u(""),O=u(!1);return m((()=>{Y(),i().then((e=>{Q.value=e.data.miniprogramType}))})),(r,i)=>{const p=C,u=B,n=U,m=z,W=l,P=D,R=T,ee=$,ae=F,le=L,te=a,se=e,oe=d("action"),re=S;return c(),v(y,null,[j("div",q,[j("div",A,[f(W,{search:b(Y),reset:b(Z)},{body:_((()=>[f(u,{label:"轮播图名称"},{default:_((()=>[f(p,{modelValue:b(X).title,"onUpdate:modelValue":i[0]||(i[0]=e=>b(X).title=e),size:"default",placeholder:"请输入轮播图名称",clearable:""},null,8,["modelValue"])])),_:1}),f(u,{label:"小程序类型"},{default:_((()=>[f(m,{modelValue:b(X).miniprogram_type,"onUpdate:modelValue":i[1]||(i[1]=e=>b(X).miniprogram_type=e),clearable:"",filterable:"",placeholder:"请选择小程序类型"},{default:_((()=>[(c(!0),v(y,null,g(Q.value,((e,a)=>(c(),h(n,{key:a,label:e.label,value:e.value},null,8,["label","value"])))),128))])),_:1},8,["modelValue"])])),_:1})])),_:1},8,["search","reset"]),j("div",G,[x((c(),v("div",I,[f(P,{type:"primary",size:"default",onClick:i[2]||(i[2]=e=>(N.value="新增",K.value={},void(J.value=!0)))},{default:_((()=>[w("新增")])),_:1})])),[[oe,"operation.Banner.add"]]),x((c(),h(le,{data:H.value,class:"mt-3"},{default:_((()=>[f(R,{label:"轮播图ID",prop:"id"}),f(R,{label:"轮播图名称",prop:"title"}),f(R,{label:"封面",prop:"img_url"},{default:_((e=>[f(ee,{src:e.row.img_url,fit:"fill",lazy:!0},null,8,["src"])])),_:1}),f(R,{label:"排序",prop:"sort"}),f(R,{label:"添加时间",prop:"created_at"}),f(R,{label:"小程序类型",prop:"miniprogram_type_text"}),x((c(),h(R,{label:"状态"},{default:_((e=>[j("div",null,[f(ae,{modelValue:e.row.status,"onUpdate:modelValue":a=>e.row.status=a,onChange:a=>{return l=e.row,void s(l.id,{status:l.status}).then((e=>{V.success(e.message),Y()})).catch((e=>{Y()}));var l},"active-value":1,"inactive-value":0},null,8,["modelValue","onUpdate:modelValue","onChange"])])])),_:1})),[[oe,"operation.Banner.updateStatus"]]),f(R,{label:"操作"},{default:_((e=>[x((c(),h(P,{link:"",type:"primary",size:"small",onClick:a=>{return l=e.row,N.value="编辑",K.value=l,void(J.value=!0);var l}},{default:_((()=>[w("编辑")])),_:2},1032,["onClick"])),[[oe,"operation.Banner.edit"]]),M,x((c(),h(P,{link:"",type:"primary",size:"small",onClick:a=>{return l=e.row,void k.confirm(`确认删除 ${l.title} 吗?`,"提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((()=>{o(l.id).then((e=>{V.success(e.message),Y()}))})).catch((()=>{Y()}));var l}},{default:_((()=>[w("删除")])),_:2},1032,["onClick"])),[[oe,"operation.Banner.del"]])])),_:1})])),_:1},8,["data"])),[[re,b(E)]]),f(te)])])]),f(se,{modelValue:J.value,"onUpdate:modelValue":i[4]||(i[4]=e=>J.value=e),title:N.value,width:"30%","destroy-on-close":""},{default:_((()=>[f(t,{onClose:i[3]||(i[3]=e=>(e=>{switch(e){case"configVisible":O.value=!1;break;case"addVisible":J.value=!1}Y()})("addVisible")),primary:K.value},null,8,["primary"])])),_:1},8,["modelValue","title"])],64)}}});export{Q as default};
