import{x as N,q as A,h as L}from"./elementPlus.CSBdF9Zt.js";import{u as j,a as F}from"./useTableData.BPSaK1qx.js";import{u as I}from"./useResponse.DqThFJSa.js";import{A as R}from"./Columns.D29A1xlB.js";import{_ as K}from"./index.vue_vue_type_script_setup_true_lang.Q_8XCONs.js";import{_ as Z}from"./DataTableSlot.vue_vue_type_style_index_0_lang.BYoWHC9R.js";import q from"./EditDrawer.DGU6Zjzg.js";import G from"./NoticeDialog.C6wixsF1.js";import{g as J,d as Q}from"./api.5eYiDM6s.js";import{_ as W}from"./CreateDialog.vue_vue_type_script_setup_true_lang.JuOT4FPM.js";import X from"./index.D9PokgEN.js";import{_ as Y}from"./ShowDetailDrawer.vue_vue_type_script_setup_true_lang.aJfybDXv.js";import{h as ee}from"./hasPermission.BaNF3kc2.js";import{d as ae,r as s,Z as oe,E as te,j as ne,ai as C,o as l,c as le,U as p,aa as re,a8 as ie,O as r,u as e,K as se,am as ue,M as u,D as w,R as f,F as me,B as de,S as pe}from"./vue.1RczIYhx.js";import{_ as fe}from"./_plugin-vue_export-helper.DlAUqK2U.js";import"./api.Dg5Q_G4P.js";import"./index.K_MFulpu.js";import"./api.BjC-yTlR.js";import"./CreateDialog.vue_vue_type_script_setup_true_lang.BGa1THFd.js";import"./EditDrawer._gD85APM.js";import"./ShowEnumDrawer.C1zWLRYG.js";const ge=ae({__name:"DataTable",setup(ce,{expose:E}){const m=de("query-parameter"),{tableOptions:y,handlePageChange:S}=j(d),D=s(),t=oe({id:"product-attribute-table",keepSource:!0,size:"small",border:!1,round:!0,stripe:!0,currentRowHighLight:!0,height:"100%",customConfig:{storage:!0},toolbarConfig:{size:"large",slots:{tools:"toolbar_tools",buttons:"toolbar_buttons"}},rowConfig:{isHover:!0},columnConfig:{},pagerConfig:{total:y.value.total,page:y.value.page,limit:y.value.limit},loading:!1,loadingConfig:{icon:"vxe-icon-indicator roll",text:"正在拼命加载中..."},columns:"",data:""}),g=s(!1),c=s(!1),_=s(!1),v=s(!1),i=s({}),b=s(!1);te(()=>{t.pagerConfig.limit=20}),ne(()=>{d()});async function d(n=!1){var V,k;n&&(t.pagerConfig.page=1),t.data=[],t.columns=[];const a={name:m==null?void 0:m.name,key:m==null?void 0:m.key};await F(J,a,t),t&&((V=t.data)!=null&&V.length)&&await D.value.loadColumn(R),t.showHeader=!!((k=t.data)!=null&&k.length)}function x(){d()}function U(n){g.value=!0,i.value=n}function M(n){_.value=!0,i.value=n}function O(){c.value=!0}function B(n){v.value=!0,i.value=n}async function H(n){(await I(Q,n)).code===2e3&&(L.error({message:"已删除!",plain:!0,icon:"Delete"}),x())}const P={custom({type:n}){n=="confirm"&&d()}};return E({fetchList:d}),(n,a)=>{const V=C("el-icon"),k=C("el-button"),z=C("vxe-pager"),T=C("el-empty"),$=C("vxe-grid");return l(),le(me,null,[p($,se({ref_key:"gridRef",ref:D},e(t),ue(P)),re({toolbar_buttons:r(()=>[e(ee)("SkuAttrCreate")?(l(),u(K,{key:0,icon:e(N),plain:"",round:"",type:"primary",onClick:O},{default:r(()=>a[7]||(a[7]=[pe("新 增")])),_:1},8,["icon"])):f("",!0)]),toolbar_tools:r(()=>[p(k,{circle:"",class:"toolbar-btn",onClick:x},{default:r(()=>[p(V,null,{default:r(()=>[p(e(A))]),_:1})]),_:1})]),pager:r(()=>[p(z,{currentPage:e(t).pagerConfig.page,"onUpdate:currentPage":a[0]||(a[0]=o=>e(t).pagerConfig.page=o),pageSize:e(t).pagerConfig.limit,"onUpdate:pageSize":a[1]||(a[1]=o=>e(t).pagerConfig.limit=o),total:e(t).pagerConfig.total,class:"mt-1.5",onPageChange:e(S)},null,8,["currentPage","pageSize","total","onPageChange"])]),empty:r(()=>[p(T,{description:"暂无数据"})]),_:2},[ie(e(R),o=>({name:`${o.field}`,fn:r(({row:h})=>[(l(),u(Z,{key:h.id,field:o.field,row:h,onEditRow:U,onHandleDelete:H,onHandleManage:M,onShowDetail:B},null,8,["field","row"]))])}))]),1040),e(g)?(l(),u(q,{key:0,modelValue:e(g),"onUpdate:modelValue":a[2]||(a[2]=o=>w(g)?g.value=o:null),"row-data":e(i),onRefresh:x},null,8,["modelValue","row-data"])):f("",!0),e(b)?(l(),u(G,{key:1,modelValue:e(b),"onUpdate:modelValue":a[3]||(a[3]=o=>w(b)?b.value=o:null),"row-data":e(i)},null,8,["modelValue","row-data"])):f("",!0),e(c)?(l(),u(W,{key:2,modelValue:e(c),"onUpdate:modelValue":a[4]||(a[4]=o=>w(c)?c.value=o:null),onRefresh:d},null,8,["modelValue"])):f("",!0),e(_)?(l(),u(X,{key:3,modelValue:e(_),"onUpdate:modelValue":a[5]||(a[5]=o=>w(_)?_.value=o:null),"row-data":e(i)},null,8,["modelValue","row-data"])):f("",!0),e(v)?(l(),u(Y,{key:4,modelValue:e(v),"onUpdate:modelValue":a[6]||(a[6]=o=>w(v)?v.value=o:null),"row-data":e(i)},null,8,["modelValue","row-data"])):f("",!0)],64)}}}),Te=fe(ge,[["__scopeId","data-v-ca819d44"]]);export{Te as default};
