SpuTableSelect-5068ec1d.js 6.0 KB

1
  1. import{d as le,ah as te,r as d,l as oe,o as b,x,aR as re,w as r,g as l,n as h,a as t,S as ue,y as de,P as k,h as ne,t as ie,d4 as P,W as se,B as pe,C as me,q as ce,D as _e,G as ve,ae as fe,H as he,ai as ye,I as ge,J as we,_ as Ve,__tla as be}from"./index-3fb48822.js";import{_ as xe,__tla as Ue}from"./Dialog-7d4425a0.js";import{_ as Se,__tla as Te}from"./ContentWrap-afa47a64.js";import{_ as ke,__tla as Ce}from"./index-5771c6d6.js";import{E as Ie,__tla as ze}from"./el-image-27385f7d.js";import{__tla as De}from"./el-image-viewer-ff953702.js";import{E as Ne,__tla as Ee}from"./el-tree-select-60925c12.js";import{h as He,d as Ye}from"./tree-0af4953a.js";import{g as qe,__tla as Be}from"./category-aaa44366.js";import{d as Pe,__tla as Me}from"./spu-94822e38.js";import{__tla as Re}from"./el-card-8960fd94.js";import{__tla as je}from"./index-cf9cdfb4.js";let M,Ae=Promise.all([(()=>{try{return be}catch{}})(),(()=>{try{return Ue}catch{}})(),(()=>{try{return Te}catch{}})(),(()=>{try{return Ce}catch{}})(),(()=>{try{return ze}catch{}})(),(()=>{try{return De}catch{}})(),(()=>{try{return Ee}catch{}})(),(()=>{try{return Be}catch{}})(),(()=>{try{return Me}catch{}})(),(()=>{try{return Re}catch{}})(),(()=>{try{return je}catch{}})()]).then(async()=>{M=Ve(le({name:"SpuTableSelect",__name:"SpuTableSelect",props:{multiple:te.bool.def(!1)},emits:["change"],setup(C,{expose:R,emit:j}){const I=d(0),c=d([]),U=d(!1),p=d(!1),u=d({pageNo:1,pageSize:10,tabType:0,name:"",categoryId:null,createTime:[]});R({open:o=>{_.value=[],n.value={},s.value=!1,g.value=!1,o&&o.length>0&&(_.value=[...o],n.value=Object.fromEntries(o.map(e=>[e.id,!0]))),p.value=!0,D()}});const y=async()=>{U.value=!0;try{const o=await Pe(u.value);c.value=o.list,I.value=o.total,c.value.forEach(e=>n.value[e.id]=n.value[e.id]||!1),H()}finally{U.value=!1}},z=()=>{u.value.pageNo=1,y()},D=()=>{u.value={pageNo:1,pageSize:10,tabType:0,name:"",categoryId:null,createTime:[]},y()},s=d(!1),g=d(!1),_=d([]),n=d({}),w=d(),A=()=>{p.value=!1,N(P,[..._.value])},N=j,F=o=>{s.value=o,g.value=!1,c.value.forEach(e=>E(o,e,!1))},E=(o,e,T)=>{if(o)_.value.push(e),n.value[e.id]=!0;else{const m=G(e);m>-1&&(_.value.splice(m,1),n.value[e.id]=!1,s.value=!1)}T&&H()},G=o=>_.value.findIndex(e=>e.id===o.id),H=()=>{s.value=c.value.every(o=>n.value[o.id]),g.value=!s.value&&c.value.some(o=>n.value[o.id])},S=d(),Y=d();return oe(async()=>{await y(),S.value=await qe({}),Y.value=He(S.value,"id","parentId")}),(o,e)=>{const T=se,m=pe,J=Ne,K=me,q=ce,V=_e,O=ve,B=fe,v=he,W=ye,L=Ie,Q=ge,X=ke,Z=Se,$=xe,ee=we;return b(),x($,{modelValue:t(p),"onUpdate:modelValue":e[8]||(e[8]=a=>k(p)?p.value=a:null),appendToBody:!0,title:"\u9009\u62E9\u5546\u54C1",width:"70%"},re({default:r(()=>[l(Z,null,{default:r(()=>[l(O,{ref:"queryFormRef",inline:!0,model:t(u),class:"-mb-15px","label-width":"68px"},{default:r(()=>[l(m,{label:"\u5546\u54C1\u540D\u79F0",prop:"name"},{default:r(()=>[l(T,{modelValue:t(u).name,"onUpdate:modelValue":e[0]||(e[0]=a=>t(u).name=a),class:"!w-240px",clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1\u540D\u79F0",onKeyup:ue(z,["enter"])},null,8,["modelValue"])]),_:1}),l(m,{label:"\u5546\u54C1\u5206\u7C7B",prop:"categoryId"},{default:r(()=>[l(J,{modelValue:t(u).categoryId,"onUpdate:modelValue":e[1]||(e[1]=a=>t(u).categoryId=a),data:t(Y),props:t(Ye),"check-strictly":"",class:"!w-240px","node-key":"id",placeholder:"\u8BF7\u9009\u62E9\u5546\u54C1\u5206\u7C7B"},null,8,["modelValue","data","props"])]),_:1}),l(m,{label:"\u521B\u5EFA\u65F6\u95F4",prop:"createTime"},{default:r(()=>[l(K,{modelValue:t(u).createTime,"onUpdate:modelValue":e[2]||(e[2]=a=>t(u).createTime=a),"default-time":[new Date("1 00:00:00"),new Date("1 23:59:59")],class:"!w-240px","end-placeholder":"\u7ED3\u675F\u65E5\u671F","start-placeholder":"\u5F00\u59CB\u65E5\u671F",type:"daterange","value-format":"YYYY-MM-DD HH:mm:ss"},null,8,["modelValue","default-time"])]),_:1}),l(m,null,{default:r(()=>[l(V,{onClick:z},{default:r(()=>[l(q,{class:"mr-5px",icon:"ep:search"}),h(" \u641C\u7D22 ")]),_:1}),l(V,{onClick:D},{default:r(()=>[l(q,{class:"mr-5px",icon:"ep:refresh"}),h(" \u91CD\u7F6E ")]),_:1})]),_:1})]),_:1},8,["model"]),de((b(),x(Q,{data:t(c),"show-overflow-tooltip":""},{default:r(()=>[C.multiple?(b(),x(v,{key:0,width:"55"},{header:r(()=>[l(B,{modelValue:t(s),"onUpdate:modelValue":e[3]||(e[3]=a=>k(s)?s.value=a:null),indeterminate:t(g),onChange:F},null,8,["modelValue","indeterminate"])]),default:r(({row:a})=>[l(B,{modelValue:t(n)[a.id],"onUpdate:modelValue":i=>t(n)[a.id]=i,onChange:i=>E(i,a,!0)},null,8,["modelValue","onUpdate:modelValue","onChange"])]),_:1})):(b(),x(v,{key:1,label:"#",width:"55"},{default:r(({row:a})=>[l(W,{label:a.id,modelValue:t(w),"onUpdate:modelValue":e[4]||(e[4]=i=>k(w)?w.value=i:null),onChange:i=>{return N(P,f=a),p.value=!1,void(w.value=f.id);var f}},{default:r(()=>[h(" \xA0 ")]),_:2},1032,["label","modelValue","onChange"])]),_:1})),l(v,{key:"id",align:"center",label:"\u5546\u54C1\u7F16\u53F7",prop:"id","min-width":"60"}),l(v,{label:"\u5546\u54C1\u56FE","min-width":"80"},{default:r(({row:a})=>[l(L,{src:a.picUrl,class:"h-30px w-30px","preview-src-list":[a.picUrl],"preview-teleported":""},null,8,["src","preview-src-list"])]),_:1}),l(v,{label:"\u5546\u54C1\u540D\u79F0","min-width":"200",prop:"name"}),l(v,{label:"\u5546\u54C1\u5206\u7C7B","min-width":"100",prop:"categoryId"},{default:r(({row:a})=>{var i,f;return[ne("span",null,ie((f=(i=t(S))==null?void 0:i.find(ae=>ae.id===a.categoryId))==null?void 0:f.name),1)]}),_:1})]),_:1},8,["data"])),[[ee,t(U)]]),l(X,{limit:t(u).pageSize,"onUpdate:limit":e[5]||(e[5]=a=>t(u).pageSize=a),page:t(u).pageNo,"onUpdate:page":e[6]||(e[6]=a=>t(u).pageNo=a),total:t(I),onPagination:y},null,8,["limit","page","total"])]),_:1})]),_:2},[C.multiple?{name:"footer",fn:r(()=>[l(V,{type:"primary",onClick:A},{default:r(()=>[h("\u786E \u5B9A")]),_:1}),l(V,{onClick:e[7]||(e[7]=a=>p.value=!1)},{default:r(()=>[h("\u53D6 \u6D88")]),_:1})]),key:"0"}:void 0]),1032,["modelValue"])}}}),[["__file","D:/zx/mall-newfeifan-zx-admin/src/views/mall/product/spu/components/SpuTableSelect.vue"]])});export{Ae as __tla,M as default};