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