SpuSelect-d5e5e91f.js 7.5 KB

1
  1. import{d as ae,ac as P,r as n,q as te,o as S,x as k,w as o,f as a,y as d,a as t,N as le,z as re,J as oe,a0 as M,t as ne,bi as ie,l as se,R as ue,E as _e,D as ce,j as pe,G as me,i as de,I as fe,K as ve,_ as he,__tla as ye}from"./index-62b7dfb7.js";import{_ as ge,__tla as we}from"./Dialog-4b6e4616.js";import{_ as Se,__tla as ke}from"./ContentWrap-0bca3f7d.js";import{_ as be,__tla as xe}from"./index-597960e6.js";import{E as Ve,__tla as Ce}from"./el-image-17267435.js";import{__tla as ze}from"./el-image-viewer-5030a371.js";import{E as Te,__tla as Ue}from"./el-tree-select-bdddf955.js";import{g as De,__tla as Ie}from"./index-b03c4e0d.js";import{d as Re,__tla as Ne}from"./formatTime-2a1cb067.js";import{c as Ye,__tla as Ee}from"./index-a48fef3e.js";import{h as Ke,d as Le}from"./tree-0af4953a.js";import{g as Pe,__tla as Me}from"./category-1f7cf8db.js";import{g as qe,f as He,__tla as je}from"./spu-56bb528d.js";import{u as Be,__tla as Ge}from"./useMessage-727ba3da.js";import Je,{__tla as Ae}from"./SkuList-bab44545.js";import{__tla as Fe}from"./el-card-255c8fa7.js";import{__tla as Oe}from"./index-72b8e79b.js";import{__tla as Qe}from"./SPuUploadImg.vue_vue_type_style_index_0_scoped_ba706063_lang-77c89ab0.js";import{__tla as We}from"./UploadImg-e9e2c1af.js";import{__tla as Xe}from"./UploadImgs.vue_vue_type_style_index_0_scoped_9d666400_lang-0e9051b2.js";import{__tla as Ze}from"./UploadFile.vue_vue_type_style_index_0_scoped_436eca1b_lang-06de7e15.js";let q,$e=Promise.all([(()=>{try{return ye}catch{}})(),(()=>{try{return we}catch{}})(),(()=>{try{return ke}catch{}})(),(()=>{try{return xe}catch{}})(),(()=>{try{return Ce}catch{}})(),(()=>{try{return ze}catch{}})(),(()=>{try{return Ue}catch{}})(),(()=>{try{return Ie}catch{}})(),(()=>{try{return Ne}catch{}})(),(()=>{try{return Ee}catch{}})(),(()=>{try{return Me}catch{}})(),(()=>{try{return je}catch{}})(),(()=>{try{return Ge}catch{}})(),(()=>{try{return Ae}catch{}})(),(()=>{try{return Fe}catch{}})(),(()=>{try{return Oe}catch{}})(),(()=>{try{return Qe}catch{}})(),(()=>{try{return We}catch{}})(),(()=>{try{return Xe}catch{}})(),(()=>{try{return Ze}catch{}})()]).then(async()=>{q=he(ae({name:"PromotionSpuSelect",__name:"SpuSelect",props:{isSelectSku:P.bool.def(!1),radio:P.bool.def(!1)},emits:["confirm"],setup(z,{expose:H,emit:j}){const b=z,f=Be(),T=n(0),U=n([]),x=n(!1),m=n(!1),D=n(""),s=n({pageNo:1,pageSize:10,tabType:0,name:"",categoryId:null,createTime:[]}),V=n([]),C=n(),I=n(),v=n(),h=n(!1),y=n(),u=n(0),p=n([]),B=l=>{var _;const e=(_=I.value)==null?void 0:_.getSkuTableRef();if(u.value===0)return f.warning("\u8BF7\u5148\u9009\u62E9\u5546\u54C1\u518D\u9009\u62E9\u76F8\u5E94\u7684\u89C4\u683C\uFF01\uFF01\uFF01"),void(e==null?void 0:e.clearSelection());if(l.length!==0)if(b.radio){if(p.value=[l.map(i=>i.id)[0]],l.length>1)return e==null||e.clearSelection(),void(e==null?void 0:e.toggleRowSelection(l.pop(),!0))}else p.value=l.map(i=>i.id);else p.value=[]},G=l=>{var e,_;if(l.length!==0){if(u.value=l.map(i=>i.id)[0],p.value.length>0&&(p.value=[]),l.length>1)return(e=C.value)==null||e.clearSelection(),void((_=C.value)==null?void 0:_.toggleRowSelection(l.pop(),!0));R(l[0],l)}else u.value=0},R=async(l,e)=>{var i;if(u.value!==0){if(l.id!==u.value)return f.warning("\u4F60\u5DF2\u9009\u62E9\u5546\u54C1\u8BF7\u5148\u53D6\u6D88"),void(y.value=[u.value]);if(h.value&&((i=v.value)==null?void 0:i.id)===l.id)return}if(v.value={},V.value=[],h.value=!1,(e==null?void 0:e.length)===0)return void(y.value=[]);const _=await qe(l.id);V.value=De(_),v.value=_,h.value=!0,y.value=[l.id]},N=j,J=()=>{u.value!==0?b.isSelectSku&&p.value.length===0?f.warning("\u6CA1\u6709\u9009\u62E9\u4EFB\u4F55\u5546\u54C1\u5C5E\u6027"):(b.isSelectSku?N("confirm",u.value,p.value):N("confirm",u.value),m.value=!1,u.value=0,p.value=[]):f.warning("\u6CA1\u6709\u9009\u62E9\u4EFB\u4F55\u5546\u54C1")};H({open:()=>{D.value="\u5546\u54C1\u9009\u62E9",m.value=!0}});const g=async()=>{x.value=!0;try{const l=await He(s.value);U.value=l.list,T.value=l.total}finally{x.value=!1}},Y=()=>{g()},A=()=>{s.value={pageNo:1,pageSize:10,tabType:0,name:"",categoryId:null,createTime:[]},g()},E=n();return te(async()=>{await g();const l=await Pe({});E.value=Ke(l,"id","parentId")}),(l,e)=>{const _=ue,i=_e,F=Te,O=ce,K=pe,w=me,Q=de,c=fe,W=Ve,X=be,Z=Se,$=ge,ee=ve;return S(),k($,{modelValue:t(m),"onUpdate:modelValue":e[6]||(e[6]=r=>se(m)?m.value=r:null),appendToBody:!0,title:t(D),width:"70%"},{footer:o(()=>[a(w,{type:"primary",onClick:J},{default:o(()=>[d("\u786E \u5B9A")]),_:1}),a(w,{onClick:e[5]||(e[5]=r=>m.value=!1)},{default:o(()=>[d("\u53D6 \u6D88")]),_:1})]),default:o(()=>[a(Z,null,{default:o(()=>[a(Q,{gutter:20,class:"mb-10px"},{default:o(()=>[a(i,{span:6},{default:o(()=>[a(_,{modelValue:t(s).name,"onUpdate:modelValue":e[0]||(e[0]=r=>t(s).name=r),class:"!w-240px",clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1\u540D\u79F0",onKeyup:le(Y,["enter"])},null,8,["modelValue"])]),_:1}),a(i,{span:6},{default:o(()=>[a(F,{modelValue:t(s).categoryId,"onUpdate:modelValue":e[1]||(e[1]=r=>t(s).categoryId=r),data:t(E),props:t(Le),"check-strictly":"",class:"w-1/1","node-key":"id",placeholder:"\u8BF7\u9009\u62E9\u5546\u54C1\u5206\u7C7B"},null,8,["modelValue","data","props"])]),_:1}),a(i,{span:6},{default:o(()=>[a(O,{modelValue:t(s).createTime,"onUpdate:modelValue":e[2]||(e[2]=r=>t(s).createTime=r),"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}),a(i,{span:6},{default:o(()=>[a(w,{onClick:Y},{default:o(()=>[a(K,{class:"mr-5px",icon:"ep:search"}),d(" \u641C\u7D22 ")]),_:1}),a(w,{onClick:A},{default:o(()=>[a(K,{class:"mr-5px",icon:"ep:refresh"}),d(" \u91CD\u7F6E ")]),_:1})]),_:1})]),_:1}),re((S(),k(t(oe),{ref_key:"spuListRef",ref:C,data:t(U),"expand-row-keys":t(y),"row-key":"id",onExpandChange:R,onSelectionChange:G},{default:o(()=>[z.isSelectSku?(S(),k(c,{key:0,type:"expand",width:"30"},{default:o(()=>[t(h)?(S(),k(t(Je),{key:0,ref_key:"skuListRef",ref:I,isComponent:!0,isDetail:!0,"prop-form-data":t(v),"property-list":t(V),onSelectionChange:B},null,8,["prop-form-data","property-list"])):M("",!0)]),_:1})):M("",!0),a(c,{type:"selection",width:"55"}),a(c,{key:"id",align:"center",label:"\u5546\u54C1\u7F16\u53F7",prop:"id"}),a(c,{label:"\u5546\u54C1\u56FE","min-width":"80"},{default:o(({row:r})=>[a(W,{src:r.picUrl,class:"h-30px w-30px",onClick:ea=>{return L=r.picUrl,void Ye({zIndex:99999999,urlList:[L]});var L}},null,8,["src","onClick"])]),_:1}),a(c,{"show-overflow-tooltip":!0,label:"\u5546\u54C1\u540D\u79F0","min-width":"300",prop:"name"}),a(c,{align:"center",label:"\u5546\u54C1\u552E\u4EF7","min-width":"90",prop:"price"},{default:o(({row:r})=>[d(ne(t(ie)(r.price)),1)]),_:1}),a(c,{align:"center",label:"\u9500\u91CF","min-width":"90",prop:"salesCount"}),a(c,{align:"center",label:"\u5E93\u5B58","min-width":"90",prop:"stock"}),a(c,{align:"center",label:"\u6392\u5E8F","min-width":"70",prop:"sort"}),a(c,{formatter:t(Re),align:"center",label:"\u521B\u5EFA\u65F6\u95F4",prop:"createTime",width:"180"},null,8,["formatter"])]),_:1},8,["data","expand-row-keys"])),[[ee,t(x)]]),a(X,{limit:t(s).pageSize,"onUpdate:limit":e[3]||(e[3]=r=>t(s).pageSize=r),page:t(s).pageNo,"onUpdate:page":e[4]||(e[4]=r=>t(s).pageNo=r),total:t(T),onPagination:g},null,8,["limit","page","total"])]),_:1})]),_:1},8,["modelValue","title"])}}}),[["__file","D:/zhongxing/mall-newfeifan-zx-admin/src/views/mall/promotion/components/SpuSelect.vue"]])});export{$e as __tla,q as default};