SpuTableSelect-29b907ec.js 6.0 KB

1
  1. import{d as le,as as te,r as d,b as oe,o as b,C as x,aY as re,A as r,f as l,D as h,a as t,a5 as ue,k as de,a2 as T,B as ne,E as ie,cF as M,a9 as se,V as pe,I as me,Q as ce,J as _e,W as ve,ap as fe,X as he,at as ye,Y as ge,Z as we,_ as Ve,__tla as be}from"./index-0b2503c4.js";import{_ as xe,__tla as Ue}from"./Dialog-3207cd36.js";import{_ as ke,__tla as Ie}from"./ContentWrap-b5913fb6.js";import{_ as Te,__tla as Ce}from"./index-40a9fc0c.js";import{E as Se,__tla as Ye}from"./el-image-9584005f.js";import{__tla as ze}from"./el-image-viewer-45bae442.js";import{E as De,__tla as Ee}from"./el-tree-select-c7d8cebf.js";import{h as Ne,d as Be}from"./tree-0af4953a.js";import{g as Fe,__tla as He}from"./category-8910d9c1.js";import{c as Me,__tla as Pe}from"./spu-c0fdff18.js";import{__tla as Re}from"./el-card-fa060bc4.js";import{__tla as je}from"./index-2c2ac611.js";let P,qe=Promise.all([(()=>{try{return be}catch{}})(),(()=>{try{return Ue}catch{}})(),(()=>{try{return Ie}catch{}})(),(()=>{try{return Ce}catch{}})(),(()=>{try{return Ye}catch{}})(),(()=>{try{return ze}catch{}})(),(()=>{try{return Ee}catch{}})(),(()=>{try{return He}catch{}})(),(()=>{try{return Pe}catch{}})(),(()=>{try{return Re}catch{}})(),(()=>{try{return je}catch{}})()]).then(async()=>{P=Ve(le({name:"SpuTableSelect",__name:"SpuTableSelect",props:{multiple:te.bool.def(!1)},emits:["change"],setup(C,{expose:R,emit:j}){const S=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,z()}});const y=async()=>{U.value=!0;try{const o=await Me(u.value);c.value=o.list,S.value=o.total,c.value.forEach(e=>n.value[e.id]=n.value[e.id]||!1),N()}finally{U.value=!1}},Y=()=>{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(),q=()=>{p.value=!1,D(M,[..._.value])},D=j,A=o=>{s.value=o,g.value=!1,c.value.forEach(e=>E(o,e,!1))},E=(o,e,I)=>{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)}I&&N()},J=o=>_.value.findIndex(e=>e.id===o.id),N=()=>{s.value=c.value.every(o=>n.value[o.id]),g.value=!s.value&&c.value.some(o=>n.value[o.id])},k=d(),B=d();return oe(async()=>{await y(),k.value=await Fe({}),B.value=Ne(k.value,"id","parentId")}),(o,e)=>{const I=se,m=pe,K=De,O=me,F=ce,V=_e,Q=ve,H=fe,v=he,W=ye,X=Se,Z=ge,G=Te,L=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%"},re({default:r(()=>[l(L,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(I,{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(Y,["enter"])},null,8,["modelValue"])]),_:1}),l(m,{label:"\u5546\u54C1\u5206\u7C7B",prop:"categoryId"},{default:r(()=>[l(K,{modelValue:t(u).categoryId,"onUpdate:modelValue":e[1]||(e[1]=a=>t(u).categoryId=a),data:t(B),props:t(Be),"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(V,{onClick:Y},{default:r(()=>[l(F,{class:"mr-5px",icon:"ep:search"}),h(" \u641C\u7D22 ")]),_:1}),l(V,{onClick:z},{default:r(()=>[l(F,{class:"mr-5px",icon:"ep:refresh"}),h(" \u91CD\u7F6E ")]),_:1})]),_:1})]),_:1},8,["model"]),de((b(),x(Z,{data:t(c),"show-overflow-tooltip":""},{default:r(()=>[C.multiple?(b(),x(v,{key:0,width:"55"},{header:r(()=>[l(H,{modelValue:t(s),"onUpdate:modelValue":e[3]||(e[3]=a=>T(s)?s.value=a:null),indeterminate:t(g),onChange:A},null,8,["modelValue","indeterminate"])]),default:r(({row:a})=>[l(H,{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=>T(w)?w.value=i:null),onChange:i=>{return D(M,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(S),onPagination:y},null,8,["limit","page","total"])]),_:1})]),_:2},[C.multiple?{name:"footer",fn:r(()=>[l(V,{type:"primary",onClick:q},{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{qe as __tla,P as default};