import{d as V,u as j,r as b,o as q,k as n,w as a,t as A,am as L,p as s,q as P,v as r,h as v,j as d,ad as I,m as f,y,l as i,i as p,L as T,a8 as G,E as x}from"./index-htML_UHV.js";const F={class:"inner-toolbar w-11/12 flex justify-between"},H={class:"toolbar-btns"},J={class:"toolbar-search"},U=V({__name:"roleManage",setup(K){const{t:_}=j(),u=A(),k=P(),c=b(!1),o=b({page_no:1,page_size:10,keyword:"",company_id:u.state.companId}),t=b({}),g=e=>!0,z=e=>{o.value.page_size=e,l()},w=e=>{o.value.page_no=e,l()},M=()=>{k.push({name:"roleManageAdd",query:{id:0}})},$=e=>{k.push({name:"roleManageAdd",query:{id:e.role_id}})},R=e=>{T.confirm(_("del_info"),_("prompt"),{type:"warning"}).then(()=>{G(e.role_id).then(()=>{x.success(_("del_success")),l()})}).catch(()=>{})},E=e=>{o.value.keyword=e,o.value.page_no=1,l()},l=()=>{c.value=!0,L(o.value).then(e=>{c.value=!1,t.value=e}).catch(()=>{c.value=!1})};return q(()=>{l()}),(e,O)=>{const m=s("el-button"),D=s("en-table-search"),h=s("el-table-column"),S=s("el-pagination"),B=s("en-table-layout");return r(),n(B,{tableData:t.value.data,loading:c.value},{toolbar:a(()=>[v("div",F,[v("div",H,[g(["roleManage:add"])&&d(u).state.user.user.founder!==1?(r(),n(m,{key:0,size:"small",type:"primary",icon:d(I),onClick:M},{default:a(()=>[f(y(e.$t("add")),1)]),_:1},8,["icon"])):i("",!0)]),v("div",J,[p(D,{onSearch:E,placeholder:e.$t("search_placeholde")},null,8,["placeholder"])])])]),"table-columns":a(()=>[p(h,{prop:"role_name",label:e.$t("role_names")},null,8,["label"]),p(h,{prop:"role_describe",label:e.$t("role_describe")},null,8,["label"]),p(h,{label:e.$t("operate")},{default:a(C=>[g(["roleManage:edit"])&&d(u).state.user.user.founder!==1?(r(),n(m,{key:0,size:"small",type:"primary",onClick:N=>$(C.row)},{default:a(()=>[f(y(e.$t("edit")),1)]),_:2},1032,["onClick"])):i("",!0),g(["roleManage:del"])&&d(u).state.user.user.founder!==1?(r(),n(m,{key:1,size:"small",type:"danger",onClick:N=>R(C.row)},{default:a(()=>[f(y(e.$t("delete")),1)]),_:2},1032,["onClick"])):i("",!0)]),_:1},8,["label"])]),pagination:a(()=>[t.value?(r(),n(S,{key:0,onSizeChange:z,onCurrentChange:w,"current-page":t.value.page_no,"page-sizes":[10,20,50,100],"page-size":t.value.page_size,layout:"total, sizes, prev, pager, next, jumper",total:t.value.data_total},null,8,["current-page","page-size","total"])):i("",!0)]),_:1},8,["tableData","loading"])}}});export{U as default};
