mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-06-07 17:07:19 +08:00
11 lines
3.9 KiB
JavaScript
11 lines
3.9 KiB
JavaScript
var E=Object.defineProperty,O=Object.defineProperties;var q=Object.getOwnPropertyDescriptors;var x=Object.getOwnPropertySymbols;var R=Object.prototype.hasOwnProperty,W=Object.prototype.propertyIsEnumerable;var L=(n,t,e)=>t in n?E(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,f=(n,t)=>{for(var e in t||(t={}))R.call(t,e)&&L(n,e,t[e]);if(x)for(var e of x(t))W.call(t,e)&&L(n,e,t[e]);return n},y=(n,t)=>O(n,q(t));var b=(n,t,e)=>new Promise((d,m)=>{var w=l=>{try{c(e.next(l))}catch(v){m(v)}},u=l=>{try{c(e.throw(l))}catch(v){m(v)}},c=l=>l.done?d(l.value):Promise.resolve(l.value).then(w,u);c((e=e.apply(n,t)).next())});import{aA as G,d as H,a as p,m as J,k as h,g as K,i as s,w as g,u as z,B as C,a3 as k,F as S,j as Q,e as r,A as X,f as _,h as Y,l as Z,b as ee,cW as te,L as ae,y as ne}from"./index-ihsPCFFy.js";import le from"./ListCard-BdLMewy0.js";import{_ as oe}from"./ListDialogForm.vue_vue_type_script_setup_true_lang-8-6DbXea.js";import{u as se}from"./hooks-QKg5d3zA.js";import{A as ie}from"./add-circle-line-Cw_F_RXn.js";import"./more-2-fill-iTOisMwj.js";const re=n=>G.request("post","/get-card-list",{data:n}),ue={class:"w-full flex justify-between mb-4"},ce=`
|
|
<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)"/>
|
|
`,he=H({name:"CardList",__name:"index",setup(n){const t={name:"",status:"",description:"",type:"",mark:""},e=p({current:1,pageSize:12,total:0}),d=p([]),m=p(!0),w=()=>b(this,null,function*(){try{const{data:a}=yield re();d.value=a.list,e.value=y(f({},e.value),{total:a.list.length})}catch(a){}finally{setTimeout(()=>{m.value=!1},500)}});J(()=>{w()});const u=p(!1),c=p(f({},t)),l=p(""),v=a=>{e.value.pageSize=a,e.value.current=1},I=a=>{e.value.current=a},A=a=>{te.confirm(a?`确认删除后${a.name}的所有产品信息将被清空, 且无法恢复`:"","提示",{type:"warning"}).then(()=>{ae("删除成功",{type:"success"})}).catch(()=>{})},V=a=>{u.value=!0,ne(()=>{c.value=y(f({},a),{status:a!=null&&a.isSetup?"1":"0"})})};return(a,i)=>{const D=r("el-button"),B=r("IconifyIconOffline"),M=r("el-icon"),P=r("el-input"),N=r("el-empty"),T=r("el-col"),$=r("el-row"),j=r("el-pagination"),F=X("loading");return _(),h("div",null,[K("div",ue,[s(D,{icon:z(se)(z(ie)),onClick:i[0]||(i[0]=o=>u.value=!0)},{default:g(()=>[Y(" 新建产品 ")]),_:1},8,["icon"]),s(P,{modelValue:l.value,"onUpdate:modelValue":i[1]||(i[1]=o=>l.value=o),style:{width:"300px"},placeholder:"请输入产品名称",clearable:""},{suffix:g(()=>[s(M,{class:"el-input__icon"},{default:g(()=>[C(s(B,{icon:"ri:search-line"},null,512),[[k,l.value.length===0]])]),_:1})]),_:1},8,["modelValue"])]),C((_(),h("div",{"element-loading-svg":ce,"element-loading-svg-view-box":"-10, -10, 50, 50"},[C(s(N,{description:`${l.value} 产品不存在`},null,8,["description"]),[[k,d.value.slice(e.value.pageSize*(e.value.current-1),e.value.pageSize*e.value.current).filter(o=>o.name.toLowerCase().includes(l.value.toLowerCase())).length===0]]),e.value.total>0?(_(),h(S,{key:0},[s($,{gutter:16},{default:g(()=>[(_(!0),h(S,null,Z(d.value.slice(e.value.pageSize*(e.value.current-1),e.value.pageSize*e.value.current).filter(o=>o.name.toLowerCase().includes(l.value.toLowerCase())),(o,U)=>(_(),ee(T,{key:U,xs:24,sm:12,md:8,lg:6,xl:4},{default:g(()=>[s(le,{product:o,onDeleteItem:A,onManageProduct:V},null,8,["product"])]),_:2},1024))),128))]),_:1}),s(j,{currentPage:e.value.current,"onUpdate:currentPage":i[2]||(i[2]=o=>e.value.current=o),class:"float-right","page-size":e.value.pageSize,total:e.value.total,"page-sizes":[12,24,36],background:!0,layout:"total, sizes, prev, pager, next, jumper",onSizeChange:v,onCurrentChange:I},null,8,["currentPage","page-size","total"])],64)):Q("",!0)])),[[F,m.value]]),s(oe,{visible:u.value,"onUpdate:visible":i[3]||(i[3]=o=>u.value=o),data:c.value},null,8,["visible","data"])])}}});export{he as default};
|