SpuTableSelect-573b2ba6.js 6.0 KB

1
  1. import{d as le,ac as te,r as d,q as re,o as b,x,br as oe,w as o,f as l,y as h,a as t,N as ue,z as de,l as T,g as ne,t as ie,cE as j,R as se,C as pe,D as me,j as ce,G as _e,H as ve,a9 as fe,I as he,ad as ye,J as ge,K as we,_ as Ve,__tla as be}from"./index-8dc1e40a.js";import{_ as xe,__tla as Ue}from"./Dialog-41802231.js";import{_ as ke,__tla as Ce}from"./ContentWrap-0aca5216.js";import{_ as Te,__tla as Ie}from"./index-64aeaa78.js";import{E as Se,__tla as Ne}from"./el-image-6a48e9f1.js";import{__tla as ze}from"./el-image-viewer-3b8905e6.js";import{E as De,__tla as Ee}from"./el-tree-select-d82790d8.js";import{h as He,d as Re}from"./tree-0af4953a.js";import{g as Ye,__tla as qe}from"./category-e7433506.js";import{f as je,__tla as Ke}from"./spu-559f5d98.js";import{__tla as Me}from"./el-card-18df90f0.js";import{__tla as Pe}from"./index-803dbf9a.js";let K,Xe=Promise.all([(()=>{try{return be}catch{}})(),(()=>{try{return Ue}catch{}})(),(()=>{try{return Ce}catch{}})(),(()=>{try{return Ie}catch{}})(),(()=>{try{return Ne}catch{}})(),(()=>{try{return ze}catch{}})(),(()=>{try{return Ee}catch{}})(),(()=>{try{return qe}catch{}})(),(()=>{try{return Ke}catch{}})(),(()=>{try{return Me}catch{}})(),(()=>{try{return Pe}catch{}})()]).then(async()=>{K=Ve(le({name:"SpuTableSelect",__name:"SpuTableSelect",props:{multiple:te.bool.def(!1)},emits:["change"],setup(I,{expose:M,emit:P}){const S=d(0),c=d([]),U=d(!1),p=d(!1),u=d({pageNo:1,pageSize:10,tabType:0,name:"",categoryId:null,createTime:[]});M({open:r=>{_.value=[],n.value={},s.value=!1,g.value=!1,r&&r.length>0&&(_.value=[...r],n.value=Object.fromEntries(r.map(e=>[e.id,!0]))),p.value=!0,z()}});const y=async()=>{U.value=!0;try{const r=await je(u.value);c.value=r.list,S.value=r.total,c.value.forEach(e=>n.value[e.id]=n.value[e.id]||!1),H()}finally{U.value=!1}},N=()=>{u.value.pageNo=1,y()},z=()=>{u.value={pageNo:1,pageSize:10,tabType:0,name:"",categoryId:null,createTime:[]},y()},s=d(!1),g=d(!1),_=d([]),n=d({}),w=d(),X=()=>{p.value=!1,D(j,[..._.value])},D=P,B=r=>{s.value=r,g.value=!1,c.value.forEach(e=>E(r,e,!1))},E=(r,e,C)=>{if(r)_.value.push(e),n.value[e.id]=!0;else{const m=F(e);m>-1&&(_.value.splice(m,1),n.value[e.id]=!1,s.value=!1)}C&&H()},F=r=>_.value.findIndex(e=>e.id===r.id),H=()=>{s.value=c.value.every(r=>n.value[r.id]),g.value=!s.value&&c.value.some(r=>n.value[r.id])},k=d(),R=d();return re(async()=>{await y(),k.value=await Ye({}),R.value=He(k.value,"id","parentId")}),(r,e)=>{const C=se,m=pe,G=De,J=me,Y=ce,V=_e,O=ve,q=fe,v=he,A=ye,L=Se,Q=ge,W=Te,Z=ke,$=xe,ee=we;return b(),x($,{modelValue:t(p),"onUpdate:modelValue":e[8]||(e[8]=a=>T(p)?p.value=a:null),appendToBody:!0,title:"\u9009\u62E9\u5546\u54C1",width:"70%"},oe({default:o(()=>[l(Z,null,{default:o(()=>[l(O,{ref:"queryFormRef",inline:!0,model:t(u),class:"-mb-15px","label-width":"68px"},{default:o(()=>[l(m,{label:"\u5546\u54C1\u540D\u79F0",prop:"name"},{default:o(()=>[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(N,["enter"])},null,8,["modelValue"])]),_:1}),l(m,{label:"\u5546\u54C1\u5206\u7C7B",prop:"categoryId"},{default:o(()=>[l(G,{modelValue:t(u).categoryId,"onUpdate:modelValue":e[1]||(e[1]=a=>t(u).categoryId=a),data:t(R),props:t(Re),"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:o(()=>[l(J,{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:o(()=>[l(V,{onClick:N},{default:o(()=>[l(Y,{class:"mr-5px",icon:"ep:search"}),h(" \u641C\u7D22 ")]),_:1}),l(V,{onClick:z},{default:o(()=>[l(Y,{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:o(()=>[I.multiple?(b(),x(v,{key:0,width:"55"},{header:o(()=>[l(q,{modelValue:t(s),"onUpdate:modelValue":e[3]||(e[3]=a=>T(s)?s.value=a:null),indeterminate:t(g),onChange:B},null,8,["modelValue","indeterminate"])]),default:o(({row:a})=>[l(q,{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:o(({row:a})=>[l(A,{label:a.id,modelValue:t(w),"onUpdate:modelValue":e[4]||(e[4]=i=>T(w)?w.value=i:null),onChange:i=>{return D(j,f=a),p.value=!1,void(w.value=f.id);var f}},{default:o(()=>[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:o(({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:o(({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(W,{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(S),onPagination:y},null,8,["limit","page","total"])]),_:1})]),_:2},[I.multiple?{name:"footer",fn:o(()=>[l(V,{type:"primary",onClick:X},{default:o(()=>[h("\u786E \u5B9A")]),_:1}),l(V,{onClick:e[7]||(e[7]=a=>p.value=!1)},{default:o(()=>[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{Xe as __tla,K as default};