import{_ as e}from"./index-7266ee79.js";import{_ as a}from"./index.vue_vue_type_script_setup_true_lang-a66505b9.js";import{_ as l}from"./search.vue_vue_type_script_setup_true_lang-bbdf4bb9.js";import{c as t,o as s,a as r}from"./create-cc038b1e.js";import{u as o}from"./useGetList-4b13a7ea.js";import{o as i}from"./index-981be696.js";/* empty css             *//* empty css                   */import"./http-338d117f.js";import{d as u,k as n,m as d,p,r as m,K as c,o as v,c as f,e as _,a as b,w as y,f as h,F as g,q as j,j as V,J as w,b as x,O as k,$ as C}from"./index-018fb6dd.js";import"./index-765bf96c.js";import"./myUpload-affaeee3.js";import"./videoList-85d0bb30.js";import"./index-b8a1ff49.js";import"./index-a3908905.js";const B={class:"flex flex-col justify-between w-full sm:flex-row"},U={class:"w-full"},z={class:"table-default"},T={class:"pt-5 pl-2"},I=_("br",null,null,-1),J=u({__name:"index",setup(u){const J=n([]),{data:q,query:L,search:S,reset:$,loading:D}=o("operation/banner/list",!0),E=d((()=>{var e;return null==(e=q.value)?void 0:e.data})),F=n(!1),G=n({}),H=n(""),K=n(!1);return p((()=>{S(),i().then((e=>{J.value=e.data.miniprogramType}))})),(o,i)=>{const u=m("el-input"),n=m("el-form-item"),d=m("el-option"),p=m("el-select"),q=l,N=m("el-button"),O=m("el-table-column"),Y=m("el-image"),A=m("el-switch"),M=m("el-table"),P=a,Q=e,R=c("action"),W=c("loading");return v(),f(g,null,[_("div",B,[_("div",U,[b(q,{search:h(S),reset:h($)},{body:y((()=>[b(n,{label:"轮播图名称"},{default:y((()=>[b(u,{modelValue:h(L).title,"onUpdate:modelValue":i[0]||(i[0]=e=>h(L).title=e),size:"default",placeholder:"请输入轮播图名称",clearable:""},null,8,["modelValue"])])),_:1}),b(n,{label:"小程序类型"},{default:y((()=>[b(p,{modelValue:h(L).miniprogram_type,"onUpdate:modelValue":i[1]||(i[1]=e=>h(L).miniprogram_type=e),clearable:"",filterable:"",placeholder:"请选择小程序类型"},{default:y((()=>[(v(!0),f(g,null,j(J.value,((e,a)=>(v(),V(d,{key:a,label:e.label,value:e.value},null,8,["label","value"])))),128))])),_:1},8,["modelValue"])])),_:1})])),_:1},8,["search","reset"]),_("div",z,[w((v(),f("div",T,[b(N,{type:"primary",size:"default",onClick:i[2]||(i[2]=e=>(H.value="新增",G.value={},void(F.value=!0)))},{default:y((()=>[x("新增")])),_:1})])),[[R,"operation.Banner.add"]]),w((v(),V(M,{data:h(E),class:"mt-3"},{default:y((()=>[b(O,{label:"轮播图ID",prop:"id"}),b(O,{label:"轮播图名称",prop:"title"}),b(O,{label:"封面",prop:"img_url"},{default:y((e=>[b(Y,{src:e.row.img_url,fit:"fill",lazy:!0},null,8,["src"])])),_:1}),b(O,{label:"排序",prop:"sort"}),b(O,{label:"添加时间",prop:"created_at"}),b(O,{label:"小程序类型",prop:"miniprogram_type_text"}),w((v(),V(O,{label:"状态"},{default:y((e=>[_("div",null,[b(A,{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=>{k.success(e.message),S()})).catch((e=>{S()}));var l},"active-value":1,"inactive-value":0},null,8,["modelValue","onUpdate:modelValue","onChange"])])])),_:1})),[[R,"operation.Banner.updateStatus"]]),b(O,{label:"操作"},{default:y((e=>[w((v(),V(N,{link:"",type:"primary",size:"small",onClick:a=>{return l=e.row,H.value="编辑",G.value=l,void(F.value=!0);var l}},{default:y((()=>[x("编辑")])),_:2},1032,["onClick"])),[[R,"operation.Banner.edit"]]),I,w((v(),V(N,{link:"",type:"primary",size:"small",onClick:a=>{return l=e.row,void C.confirm(`确认删除 ${l.title} 吗?`,"提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((()=>{r(l.id).then((e=>{k.success(e.message),S()}))})).catch((()=>{S()}));var l}},{default:y((()=>[x("删除")])),_:2},1032,["onClick"])),[[R,"operation.Banner.del"]])])),_:1})])),_:1},8,["data"])),[[W,h(D)]]),b(P)])])]),b(Q,{modelValue:F.value,"onUpdate:modelValue":i[4]||(i[4]=e=>F.value=e),title:H.value,width:"30%","destroy-on-close":""},{default:y((()=>[b(t,{onClose:i[3]||(i[3]=e=>(e=>{switch(e){case"configVisible":K.value=!1;break;case"addVisible":F.value=!1}S()})("addVisible")),primary:G.value},null,8,["primary"])])),_:1},8,["modelValue","title"])],64)}}});export{J as default};
