import{d as P,b as C,p as $,r as b,c as i,e as D,f as q,g as s,h as t,i as l,u as a,a1 as K,k as L,q as O,A as R,F as j,m as h,y as B,N as F,E as x,R as Y,S as G,_ as H}from"./index.0308b213.js";import{A as J,g as Q,s as W,d as X}from"./index.d413b847.js";import{A as Z}from"./index.1d26a072.js";import"./index.de7bcb5e.js";import"./install.524ae6f2.js";import"./index.e2f68f5b.js";import"./index.13b267c2.js";import"./index.dfdc0704.js";import"./index.vue_vue_type_style_index_0_scoped_f00ed21d_lang.2c48f49b.js";import"./vuedraggable.umd.405b1bec.js";import"./index.35b8c9ab.js";import"./index.9e8820cd.js";import"./sort_out.2008c10d.js";import"./useAgent.c0cb1751.js";import"./list.5526c7ef.js";const w=p=>(Y("data-v-96d2efa9"),p=p(),G(),p),ee={class:"filter-form"},te=h("\u67E5\u8BE2"),oe={class:"data"},ae={class:"operation-btn",style:{"margin-bottom":"10px"}},ue=h("\u65B0\u589E\u5E95\u90E8\u5BFC\u822A"),le={class:"table"},ne=w(()=>s("div",null,"\u9ED8\u8BA4\u6A21\u677F",-1)),se=w(()=>s("div",{style:{"font-size":"10px",color:"#aaaaaa"}},"\u53EA\u80FD\u8BBE\u7F6E\u4E00\u4E2A\u6A21\u677F",-1)),ie={class:"table-operation-btn"},de={class:"top"},re=h("\u4FEE\u6539"),ce=h("\u5220\u9664"),me={class:"bottom"},pe={class:"pagination"},_e=P({setup(p){let u=C({page:1,limit:10,agentid:"",keyword:""}),r=C({count:0,menus:[]});const c=()=>{Q(u).then(n=>{r.count=n.count,r.menus=n.menus})};c(),$(()=>[u.page,u.limit],()=>{c()});const A=()=>{c()};let _=b(!1),d=b(!1),E=b();const y=()=>{_.value=!0,B(()=>{d.value=!0})},k=n=>{E.value=n,_.value=!0,B(()=>{d.value=!0})},V=()=>{d.value=!1,B(()=>{_.value=!1}),E.value=0,c()},N=n=>{const o=r.menus.findIndex(m=>m.id===n);F.alert("\u786E\u5B9A\u9700\u8981\u8BBE\u7F6E\u4E3A\u9ED8\u8BA4\u6A21\u677F\u5417\uFF1F","\u64CD\u4F5C\u63D0\u793A",{showCancelButton:!0,confirmButtonText:"\u786E\u8BA4",cancelButtonText:"\u53D6\u6D88",closeOnClickModal:!1}).then(()=>{W(n).then(m=>{x.success("\u8BBE\u7F6E\u6210\u529F"),c()})}).catch(()=>{r.menus[o].is_default=0})},T=n=>{F.alert("\u786E\u5B9A\u9700\u8981\u5220\u9664\u9875\u9762\u5417","\u64CD\u4F5C\u63D0\u793A",{showCancelButton:!0,confirmButtonText:"\u786E\u8BA4",cancelButtonText:"\u53D6\u6D88",closeOnClickModal:!1}).then(()=>{X(n).then(o=>{x.success("\u5220\u9664\u6210\u529F"),c()})}).catch(()=>{})};return(n,o)=>{const m=i("el-form-item"),z=i("el-input"),f=i("el-button"),I=i("el-form"),g=i("el-table-column"),U=i("el-switch"),S=i("el-table"),M=i("el-pagination");return D(),q(j,null,[s("div",ee,[t(I,{model:a(u),"label-width":"90px"},{default:l(()=>[t(m,{class:"tn-el-form-item",label:"\u4EE3\u7406\u533A\u57DF"},{default:l(()=>[t(a(Z),{modelValue:a(u).agentid,"onUpdate:modelValue":o[0]||(o[0]=e=>a(u).agentid=e)},null,8,["modelValue"])]),_:1}),t(m,{class:"tn-el-form-item",label:"\u641C\u7D22"},{default:l(()=>[t(z,{modelValue:a(u).keyword,"onUpdate:modelValue":o[1]||(o[1]=e=>a(u).keyword=e),placeholder:"\u8BF7\u8F93\u5165\u8D85\u7EA7\u7EA2\u5305\u6807\u9898\u6216\u5173\u952E\u5B57\u8FDB\u884C\u641C\u7D22",onKeyup:o[2]||(o[2]=K(e=>A(),["enter"]))},null,8,["modelValue"])]),_:1}),t(m,null,{default:l(()=>[t(f,{class:"tn-el-form-item--item tn-button tn-button--blue",onClick:A},{default:l(()=>[te]),_:1})]),_:1})]),_:1},8,["model"])]),s("div",oe,[s("div",ae,[t(f,{class:"btn",type:"primary",onClick:y},{default:l(()=>[ue]),_:1})]),s("div",le,[t(S,{data:a(r).menus},{default:l(()=>[t(g,{label:"\u540D\u79F0",prop:"name"}),t(g,{label:"\u4EE3\u7406\u533A\u57DF",prop:"agent_title"}),t(g,{width:"170px",align:"center"},{header:l(()=>[ne,se]),default:l(e=>[t(U,{modelValue:e.row.is_default,"onUpdate:modelValue":v=>e.row.is_default=v,size:"large",width:60,"inline-prompt":"","active-text":"\u9ED8\u8BA4","inactive-text":"","active-value":1,"inactive-value":0,onChange:v=>N(e.row.id)},null,8,["modelValue","onUpdate:modelValue","onChange"])]),_:1}),t(g,{label:"\u64CD\u4F5C",width:"230px"},{default:l(e=>[s("div",ie,[s("div",de,[t(f,{type:"primary",onClick:v=>k(e.row.id)},{default:l(()=>[re]),_:2},1032,["onClick"]),t(f,{type:"danger",onClick:v=>T(e.row.id)},{default:l(()=>[ce]),_:2},1032,["onClick"])])])]),_:1})]),_:1},8,["data"])])]),s("div",me,[s("div",pe,[t(M,{"current-page":a(u).page,"onUpdate:current-page":o[3]||(o[3]=e=>a(u).page=e),"page-size":a(u).limit,"onUpdate:page-size":o[4]||(o[4]=e=>a(u).limit=e),"page-sizes":[10,20,30,40],layout:"total, sizes, prev, pager, next, jumper",total:a(r).count},null,8,["current-page","page-size","total"])])]),a(_)?(D(),L(J,{key:0,modelValue:a(d),"onUpdate:modelValue":o[5]||(o[5]=e=>O(d)?d.value=e:d=e),id:a(E),onClose:V},null,8,["modelValue","id"])):R("",!0)],64)}}});const Ve=H(_e,[["__scopeId","data-v-96d2efa9"]]);export{Ve as default};
