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{_ as t}from"./create.vue_vue_type_script_setup_true_lang-7bcedb20.js";import s from"./config-38042866.js";import{u as o}from"./useGetList-4b13a7ea.js";import{b as r,c as i}from"./index-dd579723.js";import{o as u}from"./index-981be696.js";/* empty css             */import"./http-338d117f.js";/* empty css                   */import{d,k as n,m as p,p as m,r as c,K as v,o as _,c as f,e as b,a as y,w as g,f as h,F as w,q as V,j,J as x,b as k,s as C,$ as U,O as F}from"./index-018fb6dd.js";import"./index-765bf96c.js";import"./videoList-577963e4.js";import"./index-b8a1ff49.js";import"./index-a3908905.js";const P={class:"flex flex-col justify-between w-full sm:flex-row"},T={class:"w-full"},z={class:"m-3"},B={class:"table-default"},q={class:"pt-5 pl-2"},E=b("br",null,null,-1),G=d({__name:"index",setup(d){const G=n([{name:"本周精选",value:1},{name:"优选好剧",value:2}]),I=n([]),{data:J,query:L,search:S,reset:D,loading:H}=o("operationManage/firstPage/list",!0),K=p((()=>{var e;return null==(e=J.value)?void 0:e.data})),M=n(!1),N=n({}),O=n(!1),Y=e=>{switch(e){case"configVisible":O.value=!1;break;case"addVisible":M.value=!1}S()};return m((()=>{S(),u().then((e=>{I.value=e.data.miniprogramType}))})),(o,u)=>{const d=c("el-option"),n=c("el-select"),p=c("el-form-item"),m=l,J=c("el-alert"),$=c("el-button"),A=c("el-table-column"),Q=c("el-switch"),R=c("el-table"),W=a,X=c("el-card"),Z=e,ee=v("action"),ae=v("loading");return _(),f(w,null,[b("div",P,[b("div",T,[y(m,{search:h(S),reset:h(D)},{body:g((()=>[y(p,{label:"列表名称"},{default:g((()=>[y(n,{modelValue:h(L).type,"onUpdate:modelValue":u[0]||(u[0]=e=>h(L).type=e),clearable:"",filterable:"",placeholder:"请选择列表名称"},{default:g((()=>[(_(!0),f(w,null,V(G.value,((e,a)=>(_(),j(d,{key:a,label:e.name,value:e.value},null,8,["label","value"])))),128))])),_:1},8,["modelValue"])])),_:1}),y(p,{label:"小程序类型"},{default:g((()=>[y(n,{modelValue:h(L).miniprogram_type,"onUpdate:modelValue":u[1]||(u[1]=e=>h(L).miniprogram_type=e),clearable:"",filterable:"",placeholder:"请选择小程序类型"},{default:g((()=>[(_(!0),f(w,null,V(I.value,((e,a)=>(_(),j(d,{key:a,label:e.label,value:e.value},null,8,["label","value"])))),128))])),_:1},8,["modelValue"])])),_:1})])),_:1},8,["search","reset"]),y(X,{shadow:"always",class:"mt-3","body-style":{padding:"20px"}},{default:g((()=>[b("div",z,[y(J,{title:"启用状态后，最新开启的记录排序在上面",type:"warning",closable:!1})]),b("div",B,[x((_(),f("div",q,[y($,{type:"primary",size:"default",onClick:u[2]||(u[2]=e=>{M.value=!0})},{default:g((()=>[k("新增")])),_:1})])),[[ee,"operation.FirstPage.add"]]),x((_(),j(R,{data:h(K),class:"mt-3"},{default:g((()=>[y(A,{label:"ID",prop:"id"}),y(A,{label:"列表名称",prop:"type_str"}),y(A,{label:"添加时间",prop:"created_at"}),y(A,{label:"小程序类型",prop:"miniprogram_type_str"}),x((_(),j(A,{label:"状态"},{default:g((e=>[b("div",null,[y(Q,{modelValue:e.row.status,"onUpdate:modelValue":a=>e.row.status=a,disabled:Boolean(e.row.status),onChange:a=>{return l=e.row,void i({id:l.id}).then((e=>{F.success(e.message),S()})).catch((e=>{S()}));var l},"active-value":1,"inactive-value":0},null,8,["modelValue","onUpdate:modelValue","disabled","onChange"])])])),_:1})),[[ee,"operation.FirstPage.enableStatus"]]),y(A,{label:"操作"},{default:g((e=>[x((_(),j($,{link:"",type:"primary",size:"small",onClick:a=>{return l=e.row,N.value=l,void(O.value=!0);var l}},{default:g((()=>[k("配置")])),_:2},1032,["onClick"])),[[ee,"operation.FirstPage.setConfig"]]),E,e.row.status?C("",!0):x((_(),j($,{key:0,link:"",type:"primary",size:"small",onClick:a=>{return l=e.row,void U.confirm("确认删除此列表吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((()=>{r({id:l.id}).then((e=>{F.success(e.message),S()}))})).catch((()=>{S()}));var l}},{default:g((()=>[k("删除")])),_:2},1032,["onClick"])),[[ee,"operation.FirstPage.delete"]])])),_:1})])),_:1},8,["data"])),[[ae,h(H)]]),y(W)])])),_:1})])]),y(Z,{modelValue:O.value,"onUpdate:modelValue":u[4]||(u[4]=e=>O.value=e),title:"配置",width:"50%","destroy-on-close":""},{default:g((()=>[y(s,{onClose:u[3]||(u[3]=e=>Y("configVisible")),primary:N.value},null,8,["primary"])])),_:1},8,["modelValue"]),y(Z,{modelValue:M.value,"onUpdate:modelValue":u[6]||(u[6]=e=>M.value=e),title:"新增",width:"30%","destroy-on-close":""},{default:g((()=>[y(t,{onClose:u[5]||(u[5]=e=>Y("addVisible"))})])),_:1},8,["modelValue"])],64)}}});export{G as default};
