import{d as D,r as y,b as V,c as s,e as S,f as T,g as d,h as t,i as o,u as a,a1 as N,q as $,F as q,m as g,E as C,_ as I}from"./index.0308b213.js";import{c as K,d as L,f as j}from"./index.c52b1b09.js";import{_ as M}from"./EditDialog.vue_vue_type_script_setup_true_lang.162b603d.js";import"./useInstance.233fbdde.js";const O={class:"filter-form"},R=g("\u7B5B\u9009"),G={class:"data"},H={class:"operation-btn",style:{"margin-bottom":"10px"}},J=g("\u65B0\u589E\u94FE\u63A5"),P={class:"table"},Q={class:"table-operation-btn"},W=g("\u7F16\u8F91"),X=g("\u5220\u9664"),Y={class:"bottom"},Z={class:"pagination"},ee=D({setup(te){let r=y(!1);const i=V({page:1,limit:10,keyword:""});let m=V({count:0,list:[]});const c=()=>{K(i).then(u=>{m.list=u.lists,m.count=u.count})};c();let p=y(0);const w=()=>{p.value=0,c()},F=()=>{p.value=0,r.value=!0},B=u=>{p.value=u,r.value=!0},k=(u,l)=>{L({id:l,status}).then(v=>{C({message:"\u66F4\u65B0\u72B6\u6001\u6210\u529F",type:"success"})})},E=u=>{j({id:u}).then(l=>{C.success("\u5220\u9664\u6210\u529F"),c()})};return(u,l)=>{const v=s("el-input"),h=s("el-form-item"),f=s("el-button"),x=s("el-form"),_=s("el-table-column"),b=s("el-color-picker"),U=s("el-switch"),A=s("el-table"),z=s("el-pagination");return S(),T(q,null,[d("div",O,[t(x,{"label-width":"120px"},{default:o(()=>[t(h,{class:"tn-el-form-item",label:"\u641C\u7D22"},{default:o(()=>[t(v,{modelValue:a(i).keyword,"onUpdate:modelValue":l[0]||(l[0]=e=>a(i).keyword=e),placeholder:"\u8BF7\u8F93\u5165\u4E3B\u9898\u989C\u8272",onKeyup:l[1]||(l[1]=N(e=>c(),["enter"]))},null,8,["modelValue"])]),_:1}),t(h,null,{default:o(()=>[t(f,{type:"primary",onClick:c},{default:o(()=>[R]),_:1})]),_:1})]),_:1})]),d("div",G,[d("div",H,[t(f,{class:"btn",type:"primary",onClick:F},{default:o(()=>[J]),_:1})]),d("div",P,[t(A,{data:a(m).list},{default:o(()=>[t(_,{label:"ID",prop:"id"}),t(_,{label:"\u6807\u9898",prop:"name"}),t(_,{label:"\u81EA\u5B9A\u4E49\u4E3B\u9898\u989C\u8272"},{default:o(e=>[t(b,{modelValue:e.row.theme_color,"onUpdate:modelValue":n=>e.row.theme_color=n},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),t(_,{label:"\u81EA\u5B9A\u4E49\u5B57\u4F53\u989C\u8272"},{default:o(e=>[t(b,{modelValue:e.row.font_color,"onUpdate:modelValue":n=>e.row.font_color=n},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),t(_,{label:"\u542F\u7528/\u7981\u7528"},{default:o(e=>[t(U,{modelValue:e.row.status,"onUpdate:modelValue":n=>e.row.status=n,size:"large",width:60,"inline-prompt":"","active-text":"\u542F\u7528","inactive-text":"\u7981\u7528","active-value":1,"inactive-value":0,onChange:n=>k(n,e.row.id)},null,8,["modelValue","onUpdate:modelValue","onChange"])]),_:1}),t(_,{label:"\u64CD\u4F5C"},{default:o(e=>[d("div",Q,[t(f,{type:"primary",size:"small",onClick:n=>B(e.row.id)},{default:o(()=>[W]),_:2},1032,["onClick"]),t(f,{type:"danger",size:"small",onClick:n=>E(e.row.id)},{default:o(()=>[X]),_:2},1032,["onClick"])])]),_:1})]),_:1},8,["data"])])]),d("div",Y,[d("div",Z,[t(z,{"current-page":a(i).page,"onUpdate:current-page":l[2]||(l[2]=e=>a(i).page=e),"page-size":a(i).limit,"onUpdate:page-size":l[3]||(l[3]=e=>a(i).limit=e),"page-sizes":[10,20,30,40],layout:"total, sizes, prev, pager, next, jumper",total:a(m).count},null,8,["current-page","page-size","total"])]),t(M,{modelValue:a(r),"onUpdate:modelValue":l[4]||(l[4]=e=>$(r)?r.value=e:r=e),id:a(p),onOnClose:w},null,8,["modelValue","id"])])],64)}}});const se=I(ee,[["__scopeId","data-v-243dd1cd"]]);export{se as default};
