1 |
- import{d as ea,as as H,r as n,b as ta,o as S,C as k,A as o,f as e,D as d,a as t,a5 as la,k as ra,Y as oa,a3 as M,E as na,aC as ia,a2 as sa,a9 as ua,H as _a,I as ca,Q as pa,J as ma,K as da,X as fa,Z as va,_ as ha,__tla as ya}from"./index-f6fb8e95.js";import{_ as ga,__tla as wa}from"./Dialog-ac2b0e4e.js";import{_ as Sa,__tla as ka}from"./ContentWrap-96bb70ec.js";import{_ as ba,__tla as xa}from"./index-58a94653.js";import{E as Ca,__tla as Va}from"./el-image-fefb4b54.js";import{__tla as Ta}from"./el-image-viewer-cfdb08a7.js";import{E as Da,__tla as Ua}from"./el-tree-select-25b2ed74.js";import{g as za,__tla as Ia}from"./index-8bf65b8f.js";import{d as Ra,__tla as Ea}from"./formatTime-ddd96ac8.js";import{c as Na,__tla as Ya}from"./index-b76b57e5.js";import{h as La,d as Ba}from"./tree-0af4953a.js";import{g as Ha,__tla as Ma}from"./category-4baa8823.js";import{g as Pa,c as Ka,__tla as Aa}from"./spu-a7f31871.js";import{u as Fa,__tla as Ja}from"./useMessage-3b767a67.js";import Qa,{__tla as Xa}from"./SkuList-d402df2e.js";import{__tla as Za}from"./el-card-8db16709.js";import{__tla as ja}from"./index-07a2f7ed.js";import{__tla as qa}from"./SPuUploadImg.vue_vue_type_style_index_0_scoped_ba706063_lang-8b438c45.js";import{__tla as Ga}from"./UploadImg-76a51b31.js";import{__tla as Oa}from"./UploadImgs.vue_vue_type_style_index_0_scoped_9d666400_lang-1b59ad7e.js";import{__tla as Wa}from"./UploadFile.vue_vue_type_style_index_0_scoped_436eca1b_lang-3d49d983.js";let P,$a=Promise.all([(()=>{try{return ya}catch{}})(),(()=>{try{return wa}catch{}})(),(()=>{try{return ka}catch{}})(),(()=>{try{return xa}catch{}})(),(()=>{try{return Va}catch{}})(),(()=>{try{return Ta}catch{}})(),(()=>{try{return Ua}catch{}})(),(()=>{try{return Ia}catch{}})(),(()=>{try{return Ea}catch{}})(),(()=>{try{return Ya}catch{}})(),(()=>{try{return Ma}catch{}})(),(()=>{try{return Aa}catch{}})(),(()=>{try{return Ja}catch{}})(),(()=>{try{return Xa}catch{}})(),(()=>{try{return Za}catch{}})(),(()=>{try{return ja}catch{}})(),(()=>{try{return qa}catch{}})(),(()=>{try{return Ga}catch{}})(),(()=>{try{return Oa}catch{}})(),(()=>{try{return Wa}catch{}})()]).then(async()=>{P=ha(ea({name:"PromotionSpuSelect",__name:"SpuSelect",props:{isSelectSku:H.bool.def(!1),radio:H.bool.def(!1)},emits:["confirm"],setup(T,{expose:K,emit:A}){const b=T,f=Fa(),D=n(0),U=n([]),x=n(!1),m=n(!1),z=n(""),s=n({pageNo:1,pageSize:10,tabType:0,name:"",categoryId:null,createTime:[]}),C=n([]),V=n(),I=n(),v=n(),h=n(!1),y=n(),u=n(0),p=n([]),F=l=>{var _;const a=(_=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(a==null?void 0:a.clearSelection());if(l.length!==0)if(b.radio){if(p.value=[l.map(i=>i.id)[0]],l.length>1)return a==null||a.clearSelection(),void(a==null?void 0:a.toggleRowSelection(l.pop(),!0))}else p.value=l.map(i=>i.id);else p.value=[]},J=l=>{var a,_;if(l.length!==0){if(u.value=l.map(i=>i.id)[0],p.value.length>0&&(p.value=[]),l.length>1)return(a=V.value)==null||a.clearSelection(),void((_=V.value)==null?void 0:_.toggleRowSelection(l.pop(),!0));R(l[0],l)}else u.value=0},R=async(l,a)=>{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={},C.value=[],h.value=!1,(a==null?void 0:a.length)===0)return void(y.value=[]);const _=await Pa(l.id);C.value=za(_),v.value=_,h.value=!0,y.value=[l.id]},E=A,Q=()=>{u.value!==0?b.isSelectSku&&p.value.length===0?f.warning("\u6CA1\u6709\u9009\u62E9\u4EFB\u4F55\u5546\u54C1\u5C5E\u6027"):(b.isSelectSku?E("confirm",u.value,p.value):E("confirm",u.value),m.value=!1,u.value=0,p.value=[]):f.warning("\u6CA1\u6709\u9009\u62E9\u4EFB\u4F55\u5546\u54C1")};K({open:()=>{z.value="\u5546\u54C1\u9009\u62E9",m.value=!0}});const g=async()=>{x.value=!0;try{const l=await Ka(s.value);U.value=l.list,D.value=l.total}finally{x.value=!1}},N=()=>{g()},X=()=>{s.value={pageNo:1,pageSize:10,tabType:0,name:"",categoryId:null,createTime:[]},g()},Y=n();return ta(async()=>{await g();const l=await Ha({});Y.value=La(l,"id","parentId")}),(l,a)=>{const _=ua,i=_a,Z=Da,j=ca,L=pa,w=ma,q=da,c=fa,G=Ca,O=ba,W=Sa,$=ga,aa=va;return S(),k($,{modelValue:t(m),"onUpdate:modelValue":a[6]||(a[6]=r=>sa(m)?m.value=r:null),appendToBody:!0,title:t(z),width:"70%"},{footer:o(()=>[e(w,{type:"primary",onClick:Q},{default:o(()=>[d("\u786E \u5B9A")]),_:1}),e(w,{onClick:a[5]||(a[5]=r=>m.value=!1)},{default:o(()=>[d("\u53D6 \u6D88")]),_:1})]),default:o(()=>[e(W,null,{default:o(()=>[e(q,{gutter:20,class:"mb-10px"},{default:o(()=>[e(i,{span:6},{default:o(()=>[e(_,{modelValue:t(s).name,"onUpdate:modelValue":a[0]||(a[0]=r=>t(s).name=r),class:"!w-240px",clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1\u540D\u79F0",onKeyup:la(N,["enter"])},null,8,["modelValue"])]),_:1}),e(i,{span:6},{default:o(()=>[e(Z,{modelValue:t(s).categoryId,"onUpdate:modelValue":a[1]||(a[1]=r=>t(s).categoryId=r),data:t(Y),props:t(Ba),"check-strictly":"",class:"w-1/1","node-key":"id",placeholder:"\u8BF7\u9009\u62E9\u5546\u54C1\u5206\u7C7B"},null,8,["modelValue","data","props"])]),_:1}),e(i,{span:6},{default:o(()=>[e(j,{modelValue:t(s).createTime,"onUpdate:modelValue":a[2]||(a[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}),e(i,{span:6},{default:o(()=>[e(w,{onClick:N},{default:o(()=>[e(L,{class:"mr-5px",icon:"ep:search"}),d(" \u641C\u7D22 ")]),_:1}),e(w,{onClick:X},{default:o(()=>[e(L,{class:"mr-5px",icon:"ep:refresh"}),d(" \u91CD\u7F6E ")]),_:1})]),_:1})]),_:1}),ra((S(),k(t(oa),{ref_key:"spuListRef",ref:V,data:t(U),"expand-row-keys":t(y),"row-key":"id",onExpandChange:R,onSelectionChange:J},{default:o(()=>[T.isSelectSku?(S(),k(c,{key:0,type:"expand",width:"30"},{default:o(()=>[t(h)?(S(),k(t(Qa),{key:0,ref_key:"skuListRef",ref:I,isComponent:!0,isDetail:!0,"prop-form-data":t(v),"property-list":t(C),onSelectionChange:F},null,8,["prop-form-data","property-list"])):M("",!0)]),_:1})):M("",!0),e(c,{type:"selection",width:"55"}),e(c,{key:"id",align:"center",label:"\u5546\u54C1\u7F16\u53F7",prop:"id"}),e(c,{label:"\u5546\u54C1\u56FE","min-width":"80"},{default:o(({row:r})=>[e(G,{src:r.picUrl,class:"h-30px w-30px",onClick:ae=>{return B=r.picUrl,void Na({zIndex:99999999,urlList:[B]});var B}},null,8,["src","onClick"])]),_:1}),e(c,{"show-overflow-tooltip":!0,label:"\u5546\u54C1\u540D\u79F0","min-width":"300",prop:"name"}),e(c,{align:"center",label:"\u5546\u54C1\u552E\u4EF7","min-width":"90",prop:"price"},{default:o(({row:r})=>[d(na(t(ia)(r.price)),1)]),_:1}),e(c,{align:"center",label:"\u9500\u91CF","min-width":"90",prop:"salesCount"}),e(c,{align:"center",label:"\u5E93\u5B58","min-width":"90",prop:"stock"}),e(c,{align:"center",label:"\u6392\u5E8F","min-width":"70",prop:"sort"}),e(c,{formatter:t(Ra),align:"center",label:"\u521B\u5EFA\u65F6\u95F4",prop:"createTime",width:"180"},null,8,["formatter"])]),_:1},8,["data","expand-row-keys"])),[[aa,t(x)]]),e(O,{limit:t(s).pageSize,"onUpdate:limit":a[3]||(a[3]=r=>t(s).pageSize=r),page:t(s).pageNo,"onUpdate:page":a[4]||(a[4]=r=>t(s).pageNo=r),total:t(D),onPagination:g},null,8,["limit","page","total"])]),_:1})]),_:1},8,["modelValue","title"])}}}),[["__file","D:/zx/mall-newfeifan-zx-admin/src/views/mall/promotion/components/SpuSelect.vue"]])});export{$a as __tla,P as default};
|