/* empty css             *//* empty css                   */import{_ as e}from"./index-9f9af49f.js";import{_ as a}from"./index.vue_vue_type_script_setup_true_lang-66f33117.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-72910575.js";/* empty css                 *//* empty css                  *//* empty css                     */import{c as t,o as s,a as o}from"./create-91d47509.js";import{u as r}from"./useGetList-07470d8e.js";import{o as i}from"./index-1398c031.js";/* empty css                 *//* empty css                   */import"./http-ffb58baa.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 f,w as _,f as b,F as y,y as g,l as h,X as x,b as w,a5 as V,aD as k,a3 as C,a4 as U,A as B,B as z,U as T,a8 as q,D,ar as L,a9 as A,a0 as F}from"./index-0ffeeea6.js";/* empty css                  */import"./index-44ccf907.js";/* empty css                      *//* empty css                */import"./myUpload-552dbfd4.js";/* empty css                    */import"./videoList-6f1e3c4a.js";/* empty css                   *//* empty css                 *//* empty css                          *//* empty css                */import"./index-b8a1ff49.js";import"./index-7475c2a5.js";const G={class:"flex flex-col justify-between w-full sm:flex-row"},I={class:"w-full"},X={class:"table-default"},$={class:"pt-5 pl-2"},E=j("br",null,null,-1),H=p({__name:"index",setup(p){const H=u([]),{data:K,query:N,search:O,reset:S,loading:J}=r("operation/banner/list",!0),M=n((()=>{var e;return null==(e=K.value)?void 0:e.data})),P=u(!1),Q=u({}),R=u(""),W=u(!1);return m((()=>{O(),i().then((e=>{H.value=e.data.miniprogramType}))})),(r,i)=>{const p=C,u=U,n=B,m=z,K=l,Y=T,Z=q,ee=D,ae=L,le=A,te=a,se=e,oe=d("action"),re=F;return c(),v(y,null,[j("div",G,[j("div",I,[f(K,{search:b(O),reset:b(S)},{body:_((()=>[f(u,{label:"轮播图名称"},{default:_((()=>[f(p,{modelValue:b(N).title,"onUpdate:modelValue":i[0]||(i[0]=e=>b(N).title=e),size:"default",placeholder:"请输入轮播图名称",clearable:""},null,8,["modelValue"])])),_:1}),f(u,{label:"小程序类型"},{default:_((()=>[f(m,{modelValue:b(N).miniprogram_type,"onUpdate:modelValue":i[1]||(i[1]=e=>b(N).miniprogram_type=e),clearable:"",filterable:"",placeholder:"请选择小程序类型"},{default:_((()=>[(c(!0),v(y,null,g(H.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",X,[x((c(),v("div",$,[f(Y,{type:"primary",size:"default",onClick:i[2]||(i[2]=e=>(R.value="新增",Q.value={},void(P.value=!0)))},{default:_((()=>[w("新增")])),_:1})])),[[oe,"operation.Banner.add"]]),x((c(),h(le,{data:b(M),class:"mt-3"},{default:_((()=>[f(Z,{label:"轮播图ID",prop:"id"}),f(Z,{label:"轮播图名称",prop:"title"}),f(Z,{label:"封面",prop:"img_url"},{default:_((e=>[f(ee,{src:e.row.img_url,fit:"fill",lazy:!0},null,8,["src"])])),_:1}),f(Z,{label:"排序",prop:"sort"}),f(Z,{label:"添加时间",prop:"created_at"}),f(Z,{label:"小程序类型",prop:"miniprogram_type_text"}),x((c(),h(Z,{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),O()})).catch((e=>{O()}));var l},"active-value":1,"inactive-value":0},null,8,["modelValue","onUpdate:modelValue","onChange"])])])),_:1})),[[oe,"operation.Banner.updateStatus"]]),f(Z,{label:"操作"},{default:_((e=>[x((c(),h(Y,{link:"",type:"primary",size:"small",onClick:a=>{return l=e.row,R.value="编辑",Q.value=l,void(P.value=!0);var l}},{default:_((()=>[w("编辑")])),_:2},1032,["onClick"])),[[oe,"operation.Banner.edit"]]),E,x((c(),h(Y,{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),O()}))})).catch((()=>{O()}));var l}},{default:_((()=>[w("删除")])),_:2},1032,["onClick"])),[[oe,"operation.Banner.del"]])])),_:1})])),_:1},8,["data"])),[[re,b(J)]]),f(te)])])]),f(se,{modelValue:P.value,"onUpdate:modelValue":i[4]||(i[4]=e=>P.value=e),title:R.value,width:"30%","destroy-on-close":""},{default:_((()=>[f(t,{onClose:i[3]||(i[3]=e=>(e=>{switch(e){case"configVisible":W.value=!1;break;case"addVisible":P.value=!1}O()})("addVisible")),primary:Q.value},null,8,["primary"])])),_:1},8,["modelValue","title"])],64)}}});export{H as default};
