/* empty css             *//* empty css                   */import{_ as e}from"./index-e025ca33.js";import{_ as a}from"./index.vue_vue_type_script_setup_true_lang-e74be938.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-8edf6ccf.js";/* empty css                 *//* empty css                  *//* empty css                     */import{c as t,o as s,a as o}from"./create-a6e827c0.js";import{u as r}from"./useGetList-d550ec92.js";import{o as i}from"./index-456e0c66.js";/* empty css                   */import"./http-e55ef919.js";/* empty css                   */import{d as p,m as u,p as n,x as m,ao as d,o as c,c as v,e as j,a as _,w as f,f as b,F as y,y as g,l as h,Z as V,b as x,a7 as w,aA as k,a5 as C,a6 as U,A as B,B as z,W as T,aa as D,D as W,as as q,ab as A,a2 as L}from"./index-41bf27b7.js";/* empty css                  */import"./index-2a89b0c2.js";/* empty css                */import"./myUpload-1ee851ce.js";/* empty css                    */import"./videoList-ba058a4a.js";/* empty css                   *//* empty css                 *//* empty css                          *//* empty css                */import"./index-b8a1ff49.js";import"./index-f69c28c3.js";const S={class:"flex flex-col justify-between w-full sm:flex-row"},X={class:"w-full"},$={class:"table-default"},F={class:"pt-5 pl-2"},G=j("br",null,null,-1),I=p({__name:"index",setup(p){const I=u([]),{data:Q,query:R,search:Y,reset:Z,loading:E}=r("operation/banner/list",!0),H=n((()=>{var e;return null==(e=Q.value)?void 0:e.data})),J=u(!1),K=u({}),M=u(""),N=u(!1);return m((()=>{Y(),i().then((e=>{I.value=e.data.miniprogramType}))})),(r,i)=>{const p=C,u=U,n=B,m=z,Q=l,O=T,P=D,ee=W,ae=q,le=A,te=a,se=e,oe=d("action"),re=L;return c(),v(y,null,[j("div",S,[j("div",X,[_(Q,{search:b(Y),reset:b(Z)},{body:f((()=>[_(u,{label:"轮播图名称"},{default:f((()=>[_(p,{modelValue:b(R).title,"onUpdate:modelValue":i[0]||(i[0]=e=>b(R).title=e),size:"default",placeholder:"请输入轮播图名称",clearable:""},null,8,["modelValue"])])),_:1}),_(u,{label:"小程序类型"},{default:f((()=>[_(m,{modelValue:b(R).miniprogram_type,"onUpdate:modelValue":i[1]||(i[1]=e=>b(R).miniprogram_type=e),clearable:"",filterable:"",placeholder:"请选择小程序类型"},{default:f((()=>[(c(!0),v(y,null,g(I.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",$,[V((c(),v("div",F,[_(O,{type:"primary",size:"default",onClick:i[2]||(i[2]=e=>(M.value="新增",K.value={},void(J.value=!0)))},{default:f((()=>[x("新增")])),_:1})])),[[oe,"operation.Banner.add"]]),V((c(),h(le,{data:b(H),class:"mt-3"},{default:f((()=>[_(P,{label:"轮播图ID",prop:"id"}),_(P,{label:"轮播图名称",prop:"title"}),_(P,{label:"封面",prop:"img_url"},{default:f((e=>[_(ee,{src:e.row.img_url,fit:"fill",lazy:!0},null,8,["src"])])),_:1}),_(P,{label:"排序",prop:"sort"}),_(P,{label:"添加时间",prop:"created_at"}),_(P,{label:"小程序类型",prop:"miniprogram_type_text"}),V((c(),h(P,{label:"状态"},{default:f((e=>[j("div",null,[_(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=>{w.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"]]),_(P,{label:"操作"},{default:f((e=>[V((c(),h(O,{link:"",type:"primary",size:"small",onClick:a=>{return l=e.row,M.value="编辑",K.value=l,void(J.value=!0);var l}},{default:f((()=>[x("编辑")])),_:2},1032,["onClick"])),[[oe,"operation.Banner.edit"]]),G,V((c(),h(O,{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=>{w.success(e.message),Y()}))})).catch((()=>{Y()}));var l}},{default:f((()=>[x("删除")])),_:2},1032,["onClick"])),[[oe,"operation.Banner.del"]])])),_:1})])),_:1},8,["data"])),[[re,b(E)]]),_(te)])])]),_(se,{modelValue:J.value,"onUpdate:modelValue":i[4]||(i[4]=e=>J.value=e),title:M.value,width:"30%","destroy-on-close":""},{default:f((()=>[_(t,{onClose:i[3]||(i[3]=e=>(e=>{switch(e){case"configVisible":N.value=!1;break;case"addVisible":J.value=!1}Y()})("addVisible")),primary:K.value},null,8,["primary"])])),_:1},8,["modelValue","title"])],64)}}});export{I as default};
