SpuTableSelect-5d181451.js 6.0 KB

1
  1. import{d as le,p as te,r as d,B as oe,o as V,l as x,ct as re,w as r,i as l,j as h,a as t,Q as ue,C as de,y as S,g as ne,t as ie,bS as j,U as se,H as pe,I as me,v as ce,J as _e,K as ve,ab as fe,L as he,ag as ye,M as ge,N as we,_ as be,__tla as Ve}from"./index-afaf388d.js";import{_ as xe,__tla as Ue}from"./Dialog-82c2009c.js";import{_ as ke,__tla as Ce}from"./ContentWrap-abe0694e.js";import{_ as Se,__tla as Te}from"./index-89d02e79.js";import{E as Ie,__tla as Ee}from"./el-image-caa301d0.js";import{__tla as Ne}from"./el-image-viewer-9330e340.js";import{E as ze,__tla as De}from"./el-tree-select-190eecb6.js";import{h as He,d as Me}from"./tree-0af4953a.js";import{g as Ye,__tla as Be}from"./category-f4ef186a.js";import{f as je,__tla as Ke}from"./spu-4d82f8bd.js";import{__tla as Pe}from"./el-card-9c18d881.js";import{__tla as Re}from"./index-0eed91e1.js";let K,qe=Promise.all([(()=>{try{return Ve}catch{}})(),(()=>{try{return Ue}catch{}})(),(()=>{try{return Ce}catch{}})(),(()=>{try{return Te}catch{}})(),(()=>{try{return Ee}catch{}})(),(()=>{try{return Ne}catch{}})(),(()=>{try{return De}catch{}})(),(()=>{try{return Be}catch{}})(),(()=>{try{return Ke}catch{}})(),(()=>{try{return Pe}catch{}})(),(()=>{try{return Re}catch{}})()]).then(async()=>{K=be(le({name:"SpuTableSelect",__name:"SpuTableSelect",props:{multiple:te.bool.def(!1)},emits:["change"],setup(T,{expose:P,emit:R}){const I=d(0),c=d([]),U=d(!1),p=d(!1),u=d({pageNo:1,pageSize:10,tabType:0,name:"",categoryId:null,createTime:[]});P({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,N()}});const y=async()=>{U.value=!0;try{const o=await je(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}},E=()=>{u.value.pageNo=1,y()},N=()=>{u.value={pageNo:1,pageSize:10,tabType:0,name:"",categoryId:null,createTime:[]},y()},s=d(!1),g=d(!1),_=d([]),n=d({}),w=d(),q=()=>{p.value=!1,z(j,[..._.value])},z=R,F=o=>{s.value=o,g.value=!1,c.value.forEach(e=>D(o,e,!1))},D=(o,e,C)=>{if(o)_.value.push(e),n.value[e.id]=!0;else{const m=J(e);m>-1&&(_.value.splice(m,1),n.value[e.id]=!1,s.value=!1)}C&&H()},J=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])},k=d(),M=d();return oe(async()=>{await y(),k.value=await Ye({}),M.value=He(k.value,"id","parentId")}),(o,e)=>{const C=se,m=pe,L=ze,O=me,Y=ce,b=_e,Q=ve,B=fe,v=he,W=ye,X=Ie,A=ge,G=Se,Z=ke,$=xe,ee=we;return V(),x($,{modelValue:t(p),"onUpdate:modelValue":e[8]||(e[8]=a=>S(p)?p.value=a:null),appendToBody:!0,title:"\u9009\u62E9\u5546\u54C1",width:"70%"},re({default:r(()=>[l(Z,null,{default:r(()=>[l(Q,{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(C,{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(E,["enter"])},null,8,["modelValue"])]),_:1}),l(m,{label:"\u5546\u54C1\u5206\u7C7B",prop:"categoryId"},{default:r(()=>[l(L,{modelValue:t(u).categoryId,"onUpdate:modelValue":e[1]||(e[1]=a=>t(u).categoryId=a),data:t(M),props:t(Me),"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(O,{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(b,{onClick:E},{default:r(()=>[l(Y,{class:"mr-5px",icon:"ep:search"}),h(" \u641C\u7D22 ")]),_:1}),l(b,{onClick:N},{default:r(()=>[l(Y,{class:"mr-5px",icon:"ep:refresh"}),h(" \u91CD\u7F6E ")]),_:1})]),_:1})]),_:1},8,["model"]),de((V(),x(A,{data:t(c),"show-overflow-tooltip":""},{default:r(()=>[T.multiple?(V(),x(v,{key:0,width:"55"},{header:r(()=>[l(B,{modelValue:t(s),"onUpdate:modelValue":e[3]||(e[3]=a=>S(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=>D(i,a,!0)},null,8,["modelValue","onUpdate:modelValue","onChange"])]),_:1})):(V(),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=>S(w)?w.value=i:null),onChange:i=>{return z(j,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(X,{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(k))==null?void 0:i.find(ae=>ae.id===a.categoryId))==null?void 0:f.name),1)]}),_:1})]),_:1},8,["data"])),[[ee,t(U)]]),l(G,{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},[T.multiple?{name:"footer",fn:r(()=>[l(b,{type:"primary",onClick:q},{default:r(()=>[h("\u786E \u5B9A")]),_:1}),l(b,{onClick:e[7]||(e[7]=a=>p.value=!1)},{default:r(()=>[h("\u53D6 \u6D88")]),_:1})]),key:"0"}:void 0]),1032,["modelValue"])}}}),[["__file","/Users/RuHu.Xu/Desktop/mall-newfeifan-zx-admin/src/views/mall/product/spu/components/SpuTableSelect.vue"]])});export{qe as __tla,K as default};