import{x as T,q as N,h as $}from"./elementPlus.CXoFsoPv.js";import{u as A,a as L}from"./useTableData.YE2EVtgg.js";import{u as j}from"./useResponse.DqThFJSa.js";import{b as R}from"./Columns.D29A1xlB.js";import{_ as F}from"./index.vue_vue_type_script_setup_true_lang.DKtMKa0b.js";import{_ as K}from"./DataTableSlot.vue_vue_type_style_index_0_lang.4Y88kU_R.js";import I from"./EditDrawer.4K5eRzuB.js";import Z from"./NoticeDialog.BWvfidO5.js";import{f as q,h as G}from"./api.D_N-7qEU.js";import{_ as J}from"./CreateDialog.vue_vue_type_script_setup_true_lang.C57jf6uE.js";import Q from"./AttributeManage.BY0CjTPw.js";import{h as W}from"./hasPermission.Dyr7g3RK.js";import{d as X,r as u,Z as Y,E as ee,j as oe,ai as _,o as r,c as te,U as m,aa as ae,a8 as ne,O as l,u as e,K as le,am as re,M as d,D as k,R as C,F as se,B as ie,S as ue}from"./vue.1RczIYhx.js";import{_ as me}from"./_plugin-vue_export-helper.DlAUqK2U.js";import"./MainAttr.d4gsyULH.js";import"./index.fM6cvGYs.js";import"./api.BKSbPohE.js";import"./useTagColor.B-JXlmrE.js";import"./AttributeManageEdit.DueEZTdY.js";import"./AttributeManageCreate.78UPs4vt.js";const de=X({__name:"DataTable",setup(pe,{expose:D}){const s=ie("query-parameter"),{tableOptions:y,handlePageChange:E}=A(i),h=u(),t=Y({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:""}),p=u(!1),f=u(!1),g=u({}),b=u(!1),c=u(!1);ee(()=>{t.pagerConfig.limit=20}),oe(()=>{i()});async function i(n=!1){var w,V;n&&(t.pagerConfig.page=1),t.data=[],t.columns=[];const o={name:s==null?void 0:s.name,status:s==null?void 0:s.status};await L(q,o,t),t&&((w=t.data)!=null&&w.length)&&await h.value.loadColumn(R),t.showHeader=!!((V=t.data)!=null&&V.length)}function v(){i()}function P(n){p.value=!0,g.value=n}function S(n){c.value=!0,g.value=n}function U(){f.value=!0}async function B(n){(await j(G,n)).code===2e3&&($.error({message:"已删除!",plain:!0,icon:"Delete"}),v())}const H={custom({type:n}){n=="confirm"&&i()}};return D({fetchList:i}),(n,o)=>{const w=_("el-icon"),V=_("el-button"),z=_("vxe-pager"),M=_("el-empty"),O=_("vxe-grid");return r(),te(se,null,[m(O,le({ref_key:"gridRef",ref:h},e(t),re(H)),ae({toolbar_buttons:l(()=>[e(W)("SkuKindCreate")?(r(),d(F,{key:0,icon:e(T),plain:"",round:"",type:"primary",onClick:U},{default:l(()=>o[6]||(o[6]=[ue("新 增")])),_:1},8,["icon"])):C("",!0)]),toolbar_tools:l(()=>[m(V,{circle:"",class:"toolbar-btn",onClick:v},{default:l(()=>[m(w,null,{default:l(()=>[m(e(N))]),_:1})]),_:1})]),pager:l(()=>[m(z,{currentPage:e(t).pagerConfig.page,"onUpdate:currentPage":o[0]||(o[0]=a=>e(t).pagerConfig.page=a),pageSize:e(t).pagerConfig.limit,"onUpdate:pageSize":o[1]||(o[1]=a=>e(t).pagerConfig.limit=a),total:e(t).pagerConfig.total,class:"mt-1.5",onPageChange:e(E)},null,8,["currentPage","pageSize","total","onPageChange"])]),empty:l(()=>[m(M,{description:"暂无数据"})]),_:2},[ne(e(R),a=>({name:`${a.field}`,fn:l(({row:x})=>[(r(),d(K,{key:x.id,field:a.field,row:x,onEditRow:P,onHandleDelete:B,onHandleAttribute:S},null,8,["field","row"]))])}))]),1040),e(p)?(r(),d(I,{key:0,modelValue:e(p),"onUpdate:modelValue":o[2]||(o[2]=a=>k(p)?p.value=a:null),"row-data":e(g),onRefresh:v},null,8,["modelValue","row-data"])):C("",!0),e(b)?(r(),d(Z,{key:1,modelValue:e(b),"onUpdate:modelValue":o[3]||(o[3]=a=>k(b)?b.value=a:null),"row-data":e(g)},null,8,["modelValue","row-data"])):C("",!0),e(f)?(r(),d(J,{key:2,modelValue:e(f),"onUpdate:modelValue":o[4]||(o[4]=a=>k(f)?f.value=a:null),onRefresh:i},null,8,["modelValue"])):C("",!0),e(c)?(r(),d(Q,{key:3,modelValue:e(c),"onUpdate:modelValue":o[5]||(o[5]=a=>k(c)?c.value=a:null),"row-data":e(g),onRefresh:v},null,8,["modelValue","row-data"])):C("",!0)],64)}}}),He=me(de,[["__scopeId","data-v-9817ece8"]]);export{He as default};
