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