import{az as m,d as M,b as E,r as h,c as o,e as _,f,g,h as a,i as n,F as x,j as O,k as D,u as s,m as b,t as R,A as F,E as T,_ as G}from"./index.0308b213.js";const J=u=>m.request({url:"addon/spellrice.web.Area/list",params:u}),K=u=>m.post("addon/spellrice.web.Area/Del",{id:u}),Q=u=>m.post("addon/spellrice.web.Area/status",u),W=u=>m.post("addon/spellrice.web.Area/save",{id:u}),X={class:"filter-form"},Y={class:"table"},Z=b("\u6E05\u9664\u5173\u8054\u533A\u57DF"),ee={class:"bottom"},te=b("\u7ED1\u5B9A\u5173\u8054"),ae={key:0,class:"pagination"},le=M({setup(u){const c=E({agentid:6,page:1,limit:10});let d=E({count:0,pages:0,page:0,limit:0,categorys:[],is_agent:0,agents:[]}),y=h([]);const r=()=>{J(c).then(t=>{y.value=t.agents,d.count=t.count,d.categorys=t.categorys})};r();const k=t=>{c.agentid=t,r()},z=()=>{r()},U=()=>{r()},C=h(""),B=t=>{Q({id:t.id,status:t.status}).then(l=>{T({message:"\u72B6\u6001\u4FEE\u6539\u6210\u529F",type:"success"})}).catch(l=>{t.status=t.status===1?0:1})},v=h([]),S=t=>{v.value=[],t.forEach(l=>v.value.push(l.id))},N=t=>{K(t).then(l=>{r()})},P=()=>{W(v.value).then(t=>{r()})};return(t,l)=>{const q=o("el-option"),L=o("el-select"),j=o("el-form-item"),w=o("el-form"),p=o("el-table-column"),V=o("el-input"),$=o("el-switch"),A=o("el-button"),H=o("el-table"),I=o("el-pagination");return _(),f(x,null,[g("div",X,[a(w,{model:s(c),"label-width":"90px"},{default:n(()=>[a(j,{class:"tn-el-form-item",label:"\u9009\u62E9\u4EE3\u7406\u533A\u57DF"},{default:n(()=>[a(L,{modelValue:C.value,"onUpdate:modelValue":l[0]||(l[0]=e=>C.value=e),class:"m-2",placeholder:"\u9009\u62E9\u4EE3\u7406\u533A\u57DF",size:"large",filterable:"",onChange:k},{default:n(()=>[(_(!0),f(x,null,O(s(y),e=>(_(),D(q,{key:e.id,label:e.title,value:e.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model"])]),g("div",Y,[a(H,{data:s(d).categorys,onSelectionChange:S},{default:n(()=>[a(p,{type:"selection",width:"100px"}),a(p,{label:"\u5173\u8054\u533A\u57DF"},{default:n(({row:e})=>[a(V,{type:"text",modelValue:e.title,"onUpdate:modelValue":i=>e.title=i},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),a(p,{label:"\u5173\u8054\u533A\u57DF"},{default:n(({row:e})=>[b(R(e.relevancys),1)]),_:1}),a(p,{label:"\u6392\u5E8F"},{default:n(({row:e})=>[a(V,{type:"text",modelValue:e.displayorder,"onUpdate:modelValue":i=>e.displayorder=i},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),a(p,{label:"\u662F\u5426\u663E\u793A"},{default:n(({row:e})=>[a($,{modelValue:e.status,"onUpdate:modelValue":i=>e.status=i,size:"large","active-text":"Open","inactive-text":"Close","active-value":1,"inactive-value":0,onChange:i=>B(e)},null,8,["modelValue","onUpdate:modelValue","onChange"])]),_:1}),a(p,{label:"\u64CD\u4F5C"},{default:n(({row:e})=>[a(A,{size:"small",type:"danger",onClick:i=>N(e.id)},{default:n(()=>[Z]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])]),g("div",ee,[g("div",null,[s(d).categorys.length>0?(_(),D(A,{key:0,type:"success",onClick:P},{default:n(()=>[te]),_:1})):F("",!0)]),s(d).categorys.length>0?(_(),f("div",ae,[a(I,{currentPage:s(c).page,"onUpdate:currentPage":l[1]||(l[1]=e=>s(c).page=e),"page-size":s(c).limit,"onUpdate:page-size":l[2]||(l[2]=e=>s(c).limit=e),"page-sizes":[10,20,30,40],layout:"total, sizes, prev, pager, next, jumper",total:s(d).count,onSizeChange:z,onCurrentChange:U},null,8,["currentPage","page-size","total"])])):F("",!0)])],64)}}});const oe=G(le,[["__scopeId","data-v-ed222932"]]);export{oe as default};
