Files
vue-pure-admin/static/js/index-BLfvrcic.js

11 lines
3.9 KiB
JavaScript

var E=Object.defineProperty,O=Object.defineProperties;var q=Object.getOwnPropertyDescriptors;var y=Object.getOwnPropertySymbols;var G=Object.prototype.hasOwnProperty,R=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={}))G.call(t,e)&&z(n,e,t[e]);if(y)for(var e of y(t))R.call(t,e)&&z(n,e,t[e]);return n},h=(n,t)=>O(n,q(t));var L=(n,t,e)=>new Promise((p,v)=>{var C=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?p(l.value):Promise.resolve(l.value).then(C,u);c((e=e.apply(n,t)).next())});import{az as H,d as J,a as d,m as K,b as r,z as Q,k as w,f as g,h as W,A as x,g as i,w as f,j as X,u as b,$ as k,i as Y,F as I,l as Z,e as ee,eG as te,I as ae,x as ne}from"./index-B_cVej0C.js";import le from"./ListCard-Bv3_pQbZ.js";import{_ as oe}from"./ListDialogForm.vue_vue_type_script_setup_true_lang-CkAmYyUO.js";import{u as se}from"./hooks-C4kBTCXq.js";import{A as ie}from"./add-circle-line-BJgyIw1B.js";const re=n=>H.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=J({name:"CardList",__name:"index",setup(n){const t={name:"",status:"",description:"",type:"",mark:""},e=d({current:1,pageSize:12,total:0}),p=d([]),v=d(!0),C=()=>L(null,null,function*(){try{const{code:a,data:o}=yield re();a===0&&(p.value=o.list,e.value=h(_({},e.value),{total:o.list.length}))}catch(a){}finally{setTimeout(()=>{v.value=!1},500)}});K(()=>{C()});const u=d(!1),c=d(_({},t)),l=d(""),m=a=>{e.value.pageSize=a,e.value.current=1},S=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=h(_({},a),{status:a!=null&&a.isSetup?"1":"0"})})};return(a,o)=>{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=Q("loading");return g(),w("div",null,[W("div",ue,[i(D,{icon:b(se)(b(ie)),onClick:o[0]||(o[0]=s=>u.value=!0)},{default:f(()=>[...o[4]||(o[4]=[X(" 新建产品 ",-1)])]),_:1},8,["icon"]),i(B,{modelValue:l.value,"onUpdate:modelValue":o[1]||(o[1]=s=>l.value=s),style:{width:"300px"},placeholder:"请输入产品名称",clearable:""},{suffix:f(()=>[i(P,{class:"el-input__icon"},{default:f(()=>[x(i(M,{icon:"ri/search-line"},null,512),[[k,l.value.length===0]])]),_:1})]),_:1},8,["modelValue"])]),x((g(),w("div",{"element-loading-svg":ce,"element-loading-svg-view-box":"-10, -10, 50, 50"},[x(i(N,{description:`${l.value} 产品不存在`},null,8,["description"]),[[k,p.value.slice(e.value.pageSize*(e.value.current-1),e.value.pageSize*e.value.current).filter(s=>s.name.toLowerCase().includes(l.value.toLowerCase())).length===0]]),e.value.total>0?(g(),w(I,{key:0},[i($,{gutter:16},{default:f(()=>[(g(!0),w(I,null,Z(p.value.slice(e.value.pageSize*(e.value.current-1),e.value.pageSize*e.value.current).filter(s=>s.name.toLowerCase().includes(l.value.toLowerCase())),(s,U)=>(g(),ee(T,{key:U,xs:24,sm:12,md:8,lg:6,xl:4},{default:f(()=>[i(le,{product:s,onDeleteItem:V,onManageProduct:A},null,8,["product"])]),_:2},1024))),128))]),_:1}),i(j,{currentPage:e.value.current,"onUpdate:currentPage":o[2]||(o[2]=s=>e.value.current=s),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:S},null,8,["currentPage","page-size","total"])],64)):Y("",!0)])),[[F,v.value]]),i(oe,{visible:u.value,"onUpdate:visible":o[3]||(o[3]=s=>u.value=s),data:c.value},null,8,["visible","data"])])}}});export{_e as default};