SpuSelect-af7215f2.js 7.6 KB

1
  1. import{d as ae,ai as Y,r as n,m as te,o as S,x as k,w as o,g as a,q as d,a as t,T as le,y as re,I as oe,R as M,t as ne,at as ie,Q as se,X as ue,E as _e,C as pe,k as ce,D as me,j as de,H as fe,J as ve,_ as he,__tla as ye}from"./index-57157669.js";import{_ as ge,__tla as we}from"./Dialog-f9339461.js";import{_ as Se,__tla as ke}from"./ContentWrap-d41316f0.js";import{_ as be,__tla as xe}from"./index-4d3fe9bb.js";import{E as Ce,__tla as Ve}from"./el-image-fe28d1a2.js";import{__tla as Te}from"./el-image-viewer-80427f3c.js";import{E as Ue,__tla as De}from"./el-tree-select-94986612.js";import{g as Ie,__tla as Re}from"./index-75da6a11.js";import{d as ze,__tla as He}from"./formatTime-5651d340.js";import{c as Ne,__tla as Ee}from"./index-c381319d.js";import{h as Le,d as Pe}from"./tree-0af4953a.js";import{g as Ye,__tla as Me}from"./category-d5200fe6.js";import{g as Xe,h as We,__tla as je}from"./spu-fb7941ab.js";import{u as qe,__tla as Be}from"./useMessage-b0cd8819.js";import Je,{__tla as Ke}from"./SkuList-a8a18f99.js";import{__tla as Qe}from"./ContentWrap.vue_vue_type_script_setup_true_lang-40a8e3e3.js";import{__tla as Ae}from"./el-card-ed044b9d.js";import{__tla as Fe}from"./index-8092cb03.js";import{__tla as Ge}from"./SPuUploadImg.vue_vue_type_style_index_0_scoped_ba706063_lang-21910a2b.js";import{__tla as Oe}from"./UploadImg-fa3ae6ca.js";import{__tla as Ze}from"./UploadImgs.vue_vue_type_style_index_0_scoped_9d666400_lang-a739ce32.js";import{__tla as $e}from"./UploadFile.vue_vue_type_style_index_0_scoped_436eca1b_lang-2f1aa1de.js";let X,ea=Promise.all([(()=>{try{return ye}catch{}})(),(()=>{try{return we}catch{}})(),(()=>{try{return ke}catch{}})(),(()=>{try{return xe}catch{}})(),(()=>{try{return Ve}catch{}})(),(()=>{try{return Te}catch{}})(),(()=>{try{return De}catch{}})(),(()=>{try{return Re}catch{}})(),(()=>{try{return He}catch{}})(),(()=>{try{return Ee}catch{}})(),(()=>{try{return Me}catch{}})(),(()=>{try{return je}catch{}})(),(()=>{try{return Be}catch{}})(),(()=>{try{return Ke}catch{}})(),(()=>{try{return Qe}catch{}})(),(()=>{try{return Ae}catch{}})(),(()=>{try{return Fe}catch{}})(),(()=>{try{return Ge}catch{}})(),(()=>{try{return Oe}catch{}})(),(()=>{try{return Ze}catch{}})(),(()=>{try{return $e}catch{}})()]).then(async()=>{X=he(ae({name:"PromotionSpuSelect",__name:"SpuSelect",props:{isSelectSku:Y.bool.def(!1),radio:Y.bool.def(!1)},emits:["confirm"],setup(T,{expose:W,emit:j}){const b=T,f=qe(),U=n(0),D=n([]),x=n(!1),m=n(!1),I=n(""),s=n({pageNo:1,pageSize:10,tabType:0,name:"",categoryId:null,createTime:[]}),C=n([]),V=n(),R=n(),v=n(),h=n(!1),y=n(),u=n(0),c=n([]),q=l=>{var _;const e=(_=R.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(c.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 c.value=l.map(i=>i.id);else c.value=[]},B=l=>{var e,_;if(l.length!==0){if(u.value=l.map(i=>i.id)[0],c.value.length>0&&(c.value=[]),l.length>1)return(e=V.value)==null||e.clearSelection(),void((_=V.value)==null?void 0:_.toggleRowSelection(l.pop(),!0));z(l[0],l)}else u.value=0},z=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={},C.value=[],h.value=!1,(e==null?void 0:e.length)===0)return void(y.value=[]);const _=await Xe(l.id);C.value=Ie(_),v.value=_,h.value=!0,y.value=[l.id]},H=j,J=()=>{u.value!==0?b.isSelectSku&&c.value.length===0?f.warning("\u6CA1\u6709\u9009\u62E9\u4EFB\u4F55\u5546\u54C1\u5C5E\u6027"):(b.isSelectSku?H("confirm",u.value,c.value):H("confirm",u.value),m.value=!1,u.value=0,c.value=[]):f.warning("\u6CA1\u6709\u9009\u62E9\u4EFB\u4F55\u5546\u54C1")};W({open:()=>{I.value="\u5546\u54C1\u9009\u62E9",m.value=!0}});const g=async()=>{x.value=!0;try{const l=await We(s.value);D.value=l.list,U.value=l.total}finally{x.value=!1}},N=()=>{g()},K=()=>{s.value={pageNo:1,pageSize:10,tabType:0,name:"",categoryId:null,createTime:[]},g()},E=n();return te(async()=>{await g();const l=await Ye({});E.value=Le(l,"id","parentId")}),(l,e)=>{const _=ue,i=_e,Q=Ue,A=pe,L=ce,w=me,F=de,p=fe,G=Ce,O=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(I),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(F,{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(N,["enter"])},null,8,["modelValue"])]),_:1}),a(i,{span:6},{default:o(()=>[a(Q,{modelValue:t(s).categoryId,"onUpdate:modelValue":e[1]||(e[1]=r=>t(s).categoryId=r),data:t(E),props:t(Pe),"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(A,{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:N},{default:o(()=>[a(L,{class:"mr-5px",icon:"ep:search"}),d(" \u641C\u7D22 ")]),_:1}),a(w,{onClick:K},{default:o(()=>[a(L,{class:"mr-5px",icon:"ep:refresh"}),d(" \u91CD\u7F6E ")]),_:1})]),_:1})]),_:1}),re((S(),k(t(oe),{ref_key:"spuListRef",ref:V,data:t(D),"expand-row-keys":t(y),"row-key":"id",onExpandChange:z,onSelectionChange:B},{default:o(()=>[T.isSelectSku?(S(),k(p,{key:0,type:"expand",width:"30"},{default:o(()=>[t(h)?(S(),k(t(Je),{key:0,ref_key:"skuListRef",ref:R,isComponent:!0,isDetail:!0,"prop-form-data":t(v),"property-list":t(C),onSelectionChange:q},null,8,["prop-form-data","property-list"])):M("",!0)]),_:1})):M("",!0),a(p,{type:"selection",width:"55"}),a(p,{key:"id",align:"center",label:"\u5546\u54C1\u7F16\u53F7",prop:"id"}),a(p,{label:"\u5546\u54C1\u56FE","min-width":"80"},{default:o(({row:r})=>[a(G,{src:r.picUrl,class:"h-30px w-30px",onClick:aa=>{return P=r.picUrl,void Ne({zIndex:99999999,urlList:[P]});var P}},null,8,["src","onClick"])]),_:1}),a(p,{"show-overflow-tooltip":!0,label:"\u5546\u54C1\u540D\u79F0","min-width":"300",prop:"name"}),a(p,{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(p,{align:"center",label:"\u9500\u91CF","min-width":"90",prop:"salesCount"}),a(p,{align:"center",label:"\u5E93\u5B58","min-width":"90",prop:"stock"}),a(p,{align:"center",label:"\u6392\u5E8F","min-width":"70",prop:"sort"}),a(p,{formatter:t(ze),align:"center",label:"\u521B\u5EFA\u65F6\u95F4",prop:"createTime",width:"180"},null,8,["formatter"])]),_:1},8,["data","expand-row-keys"])),[[ee,t(x)]]),a(O,{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(U),onPagination:g},null,8,["limit","page","total"])]),_:1})]),_:1},8,["modelValue","title"])}}}),[["__file","/Users/RuHu.Xu/Desktop/mall-newfeifan-zx-business/src/views/mall/promotion/components/SpuSelect.vue"]])});export{ea as __tla,X as default};