import b from"./Card-ef399688.js";import{b as z}from"./index-5df52834.js";import{m as N}from"./message-5a54ef00.js";import{_ as B}from"./DialogForm.vue_vue_type_script_setup_true_lang-5be03b8d.js";import{u as D}from"./hooks-a73423ff.js";import{S as I}from"./search-4b9e88d3.js";import{A}from"./add-circle-line-5b89a592.js";import"./more-2-fill-7f8ca5b5.js";const E=r=>z.request("post","/getCardList",{data:r}),P={class:"main"},M={class:"w-full flex justify-between mb-4"},T=Vue.defineComponent({name:"ListCard"}),H=Vue.defineComponent({...T,setup(r){const c=`
        <path class="path" d="
          M 30 15
          L 28 17
          M 25.61 25.61
          A 15 15, 0, 0, 1, 15 30
          A 15 15, 0, 1, 1, 27.99 7.5
          L 15 15
        " style="stroke-width: 4px; fill: rgba(0, 0, 0, 0)"/>
      `,V={name:"",status:"",description:"",type:"",mark:""},e=Vue.ref({current:1,pageSize:12,total:0}),u=Vue.ref([]),s=Vue.ref(!0),m=async()=>{try{const{data:t}=await E();u.value=t.list,e.value={...e.value,total:t.list.length}}catch{}finally{setTimeout(()=>{s.value=!1},500)}};Vue.onMounted(()=>{m()});const l=Vue.ref(!1),i=Vue.ref({...V}),a=Vue.ref(""),p=t=>{e.value.pageSize=t,e.value.current=1},v=t=>{e.value.current=t},d=t=>{ElementPlus.ElMessageBox.confirm(t?`确认删除后${t.name}的所有产品信息将被清空, 且无法恢复`:"","提示",{type:"warning"}).then(()=>{N("删除成功",{type:"success"})}).catch(()=>{})},g=t=>{l.value=!0,Vue.nextTick(()=>{i.value={...t,status:t!=null&&t.isSetup?"1":"0"}})};return(t,n)=>{const f=Vue.resolveComponent("el-button"),_=Vue.resolveComponent("IconifyIconOffline"),C=Vue.resolveComponent("el-icon"),h=Vue.resolveComponent("el-input"),w=Vue.resolveComponent("el-empty"),x=Vue.resolveComponent("el-col"),k=Vue.resolveComponent("el-row"),y=Vue.resolveComponent("el-pagination"),L=Vue.resolveDirective("loading");return Vue.openBlock(),Vue.createElementBlock("div",P,[Vue.createElementVNode("div",M,[Vue.createVNode(f,{icon:Vue.unref(D)(Vue.unref(A)),onClick:n[0]||(n[0]=o=>l.value=!0)},{default:Vue.withCtx(()=>[Vue.createTextVNode(" 新建产品 ")]),_:1},8,["icon"]),Vue.createVNode(h,{style:{width:"300px"},modelValue:a.value,"onUpdate:modelValue":n[1]||(n[1]=o=>a.value=o),placeholder:"请输入产品名称",clearable:""},{suffix:Vue.withCtx(()=>[Vue.createVNode(C,{class:"el-input__icon"},{default:Vue.withCtx(()=>[Vue.withDirectives(Vue.createVNode(_,{icon:Vue.unref(I)},null,8,["icon"]),[[Vue.vShow,a.value.length===0]])]),_:1})]),_:1},8,["modelValue"])]),Vue.withDirectives((Vue.openBlock(),Vue.createElementBlock("div",{"element-loading-svg":c,"element-loading-svg-view-box":"-10, -10, 50, 50"},[Vue.withDirectives(Vue.createVNode(w,{description:"暂无数据"},null,512),[[Vue.vShow,u.value.slice(e.value.pageSize*(e.value.current-1),e.value.pageSize*e.value.current).filter(o=>o.name.toLowerCase().includes(a.value.toLowerCase())).length===0]]),e.value.total>0?(Vue.openBlock(),Vue.createElementBlock(Vue.Fragment,{key:0},[Vue.createVNode(k,{gutter:16},{default:Vue.withCtx(()=>[(Vue.openBlock(!0),Vue.createElementBlock(Vue.Fragment,null,Vue.renderList(u.value.slice(e.value.pageSize*(e.value.current-1),e.value.pageSize*e.value.current).filter(o=>o.name.toLowerCase().includes(a.value.toLowerCase())),(o,S)=>(Vue.openBlock(),Vue.createBlock(x,{key:S,xs:24,sm:12,md:8,lg:6,xl:4},{default:Vue.withCtx(()=>[Vue.createVNode(b,{product:o,onDeleteItem:d,onManageProduct:g},null,8,["product"])]),_:2},1024))),128))]),_:1}),Vue.createVNode(y,{class:"float-right",currentPage:e.value.current,"onUpdate:currentPage":n[2]||(n[2]=o=>e.value.current=o),"page-size":e.value.pageSize,total:e.value.total,"page-sizes":[12,24,36],background:!0,layout:"total, sizes, prev, pager, next, jumper",onSizeChange:p,onCurrentChange:v},null,8,["currentPage","page-size","total"])],64)):Vue.createCommentVNode("",!0)])),[[L,s.value]]),Vue.createVNode(B,{visible:l.value,"onUpdate:visible":n[3]||(n[3]=o=>l.value=o),data:i.value},null,8,["visible","data"])])}}});export{H as default};
