You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
15 KiB
1 lines
15 KiB
import{d as Q,k as d,r as N,l as D,aq as X,h as m,c as _,J as T,ac as W,u as e,a as s,t as p,n as v,e as n,w as a,i as y,m as c,B as u,P as Y,z as Z,F as P,W as ee,b as oe,aH as te,ad as le,ae as ne,G as ae,b9 as de,H as se,O as ie,C as re,E as pe,U as me,ay as ue,D as ce,b7 as ye,L as fe}from"./index-f5d841af.js";/* empty css */import{_ as be}from"./index.vue_vue_type_script_setup_true_lang-30796a48.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./el-tooltip-4ed993c7.js";/* empty css */import"./el-form-item-4ed993c7.js";/* empty css *//* empty css */import{_ as ge}from"./category_default-03996666.js";import{g as _e}from"./goods-8145e37b.js";import{u as Ce}from"./diy-ab8bb185.js";import Se from"./goods-select-popup-7effc7ce.js";const xe={class:"content-wrap"},Ve={class:"edit-attr-item-wrap"},he={class:"mb-[10px]"},ve={class:"flex items-center mb-[18px] rounded overflow-hidden"},we={class:"edit-attr-item-wrap"},ke={class:"mb-[10px]"},Be={class:"flex items-center w-full"},Ue={class:"text-[var(--el-color-primary)]"},Ee=s("span",{class:"iconfont iconxiangyoujiantou"},null,-1),Re={class:"order-2"},Ne={class:"h-[30px]"},Te=s("div",{class:"image-slot"},[s("img",{class:"w-[30px] h-[30px]",src:ge})],-1),Pe={class:"flex items-center justify-end mt-[15px]"},je={class:"edit-attr-item-wrap"},ze={class:"mb-[10px]"},De={class:"flex"},We=["onClick"],Ge=["onClick"],Ie={class:"edit-attr-item-wrap"},$e={class:"mb-[10px]"},Le={class:"style-wrap"},Fe={class:"edit-attr-item-wrap"},Oe={class:"mb-[10px]"},Me=s("div",{class:"mr-[20px]"},null,-1),He={key:0,class:"edit-attr-item-wrap"},qe={class:"mb-[10px]"},Ae=Q({__name:"edit-goods-list",setup(Je,{expose:G}){const o=Ce();o.editComponent.ignore=[],o.editComponent.verify=i=>{const t={code:!0,message:""};return o.value[i].source=="category"?o.value[i].goods_category==""&&(t.code=!1,t.message=d("goodsCategoryPlaceholder")):o.value[i].source=="custom"&&o.value[i].goods_ids.length==0&&(t.code=!1,t.message=d("goodsPlaceholder")),t};const S=N(!1),b=D({loading:!0,data:[]});X(()=>{I()});const B=i=>{w.forEach((t,f,V)=>{t.type=="button"&&(i=="style-3"?t.isShow=!1:t.isShow=!0)}),i=="style-3"?o.editComponent.btnStyle.style=w[1].value:o.editComponent.btnStyle.style=w[0].value,i=="style-3"?(o.editComponent.saleStyle.isShow=!1,o.editComponent.labelStyle.isShow=!1):(o.editComponent.saleStyle.isShow=!0,o.editComponent.labelStyle.isShow=!0),o.editComponent.style=i},w=D([{isShow:!0,type:"button",title:o.editComponent.btnStyle.text,value:"button"},{isShow:!0,type:"icon",title:"nc-icon-jiahaoV6xx",value:"nc-icon-jiahaoV6xx"},{isShow:!0,type:"icon",title:"nc-icon-gouwuche1",value:"nc-icon-gouwuche1"}]),j=i=>{o.editComponent.btnStyle.style=i.value},x=N();let U=null;const I=()=>{b.loading=!0,_e().then(i=>{b.loading=!1,b.data=i.data}).catch(()=>{b.loading=!1})},$=i=>{let t="";i&&(t=i[i.length-1]),i.length>1&&x.value.clearSelection(),t&&x.value.toggleRowSelection(t,!0),U=t},L=()=>{o.editComponent.goods_category=U.category_id,o.editComponent.goods_category_name=U.category_name,S.value=!1},F=()=>{S.value=!0,te(()=>{O()})},E=N([]),O=()=>{E.value=[],b.data.forEach(i=>{o.editComponent.goods_category==i.category_id?x.value.toggleRowSelection(i,!0):i.child_list&&i.child_list.length&&i.child_list.forEach(t=>{o.editComponent.goods_category==t.category_id&&(E.value.push(i.category_id.toString()),x.value.toggleRowSelection(t,!0))})})};return G({}),(i,t)=>{const f=le,V=ne,r=ae,k=de,h=se,R=ie,M=re,z=pe,H=me,C=ue,q=ce,g=ye,A=be,J=fe;return m(),_(P,null,[T(s("div",xe,[s("div",Ve,[s("h3",he,p(e(d)("selectStyle")),1),s("div",ve,[s("span",{class:v(["iconfont iconzuoyoutuwenpc border-[1px] border-solid border-[#eee] cursor-pointer flex-1 flex items-center justify-center py-[5px]",{"border-[var(--el-color-primary)] text-[var(--el-color-primary)]":e(o).editComponent.style=="style-1"}]),onClick:t[0]||(t[0]=l=>B("style-1"))},null,2),s("span",{class:v(["iconfont iconshangxiatuwenpc border-[1px] border-solid border-[#eee] cursor-pointer flex-1 flex items-center justify-center py-[5px]",{"border-[var(--el-color-primary)] text-[var(--el-color-primary)]":e(o).editComponent.style=="style-2"}]),onClick:t[1]||(t[1]=l=>B("style-2"))},null,2),s("span",{class:v(["iconfont iconliebiaopc border-[1px] border-solid border-[#eee] cursor-pointer flex-1 flex items-center justify-center py-[5px]",{"border-[var(--el-color-primary)] text-[var(--el-color-primary)]":e(o).editComponent.style=="style-3"}]),onClick:t[2]||(t[2]=l=>B("style-3"))},null,2)])]),s("div",we,[s("h3",ke,p(e(d)("selectSource")),1),n(h,{"label-width":"80px",class:"px-[10px]"},{default:a(()=>[n(r,{label:e(d)("sortWay")},{default:a(()=>[n(V,{modelValue:e(o).editComponent.sortWay,"onUpdate:modelValue":t[3]||(t[3]=l=>e(o).editComponent.sortWay=l)},{default:a(()=>[n(f,{label:"default"},{default:a(()=>[y(p(e(d)("default")),1)]),_:1}),n(f,{label:"sale_num"},{default:a(()=>[y(p(e(d)("sales")),1)]),_:1}),n(f,{label:"price"},{default:a(()=>[y(p(e(d)("price")),1)]),_:1})]),_:1},8,["modelValue"])]),_:1},8,["label"]),n(r,{label:e(d)("goodsSelectPopupSelectGoodsButton")},{default:a(()=>[n(V,{modelValue:e(o).editComponent.source,"onUpdate:modelValue":t[4]||(t[4]=l=>e(o).editComponent.source=l),title:e(d)("goodsSelectPopupSelectGoodsButton")},{default:a(()=>[n(f,{label:"all"},{default:a(()=>[y(p(e(d)("goodsSelectPopupAllGoods")),1)]),_:1}),n(f,{label:"category"},{default:a(()=>[y(p(e(d)("selectCategory")),1)]),_:1}),n(f,{label:"custom"},{default:a(()=>[y(p(e(d)("manualSelectionSources")),1)]),_:1})]),_:1},8,["modelValue","title"])]),_:1},8,["label"]),e(o).editComponent.source=="category"?(m(),c(r,{key:0,label:e(d)("selectCategory")},{default:a(()=>[s("div",Be,[s("div",{class:"cursor-pointer ml-auto",onClick:F},[s("span",Ue,p(e(o).editComponent.goods_category_name),1),Ee])])]),_:1},8,["label"])):u("",!0),e(o).editComponent.source=="all"||e(o).editComponent.source=="category"?(m(),c(r,{key:1,label:e(d)("goodsNum")},{default:a(()=>[n(k,{class:"goods-list-slider","show-input":"",modelValue:e(o).editComponent.num,"onUpdate:modelValue":t[5]||(t[5]=l=>e(o).editComponent.num=l),min:1,max:"20",size:"small"},null,8,["modelValue"])]),_:1},8,["label"])):u("",!0),e(o).editComponent.source=="custom"?(m(),c(r,{key:2,label:e(d)("customGoods")},{default:a(()=>[n(Se,{ref:"goodsSelectPopupRef",modelValue:e(o).editComponent.goods_ids,"onUpdate:modelValue":t[6]||(t[6]=l=>e(o).editComponent.goods_ids=l),min:1,max:99},null,8,["modelValue"])]),_:1},8,["label"])):u("",!0)]),_:1}),n(H,{modelValue:S.value,"onUpdate:modelValue":t[8]||(t[8]=l=>S.value=l),title:e(d)("goodsCategoryTitle"),width:"750px","close-on-press-escape":!1,"destroy-on-close":!0,"close-on-click-modal":!1},{default:a(()=>[T((m(),c(e(Y),{data:b.data,ref_key:"categoryTableRef",ref:x,size:"large",height:"450px",onSelectionChange:$,"row-key":"category_id","expand-row-keys":E.value,"tree-props":{hasChildren:"hasChildren",children:"child_list"}},{empty:a(()=>[s("span",null,p(b.loading?"":e(d)("emptyData")),1)]),default:a(()=>[n(R,{type:"selection",width:"55"}),n(R,{label:e(d)("categoryName"),"min-width":"120"},{default:a(({row:l})=>[s("span",Re,p(l.category_name),1)]),_:1},8,["label"]),n(R,{label:e(d)("categoryImage"),width:"170",align:"left"},{default:a(({row:l})=>[s("div",Ne,[n(M,{class:"w-[30px] h-[30px]",src:e(Z)(l.image),fit:"contain"},{error:a(()=>[Te]),_:2},1032,["src"])])]),_:1},8,["label"])]),_:1},8,["data","expand-row-keys"])),[[J,b.loading]]),s("div",Pe,[n(z,{type:"primary",onClick:L},{default:a(()=>[y(p(e(d)("confirm")),1)]),_:1}),n(z,{onClick:t[7]||(t[7]=l=>S.value=!1)},{default:a(()=>[y(p(e(d)("cancel")),1)]),_:1})])]),_:1},8,["modelValue","title"])]),s("div",je,[s("h3",ze,p(e(d)("goodsBuyBtn")),1),n(h,{"label-width":"90px",class:"px-[10px]"},{default:a(()=>[n(r,{label:e(d)("goodsBtnIsShow")},{default:a(()=>[n(C,{modelValue:e(o).editComponent.btnStyle.control,"onUpdate:modelValue":t[9]||(t[9]=l=>e(o).editComponent.btnStyle.control=l)},null,8,["modelValue"])]),_:1},8,["label"]),e(o).editComponent.btnStyle.control?(m(),c(r,{key:0,label:e(d)("goodsCartIncident")},{default:a(()=>[n(V,{modelValue:e(o).editComponent.btnStyle.cartEvent,"onUpdate:modelValue":t[10]||(t[10]=l=>e(o).editComponent.btnStyle.cartEvent=l)},{default:a(()=>[n(f,{label:"detail"},{default:a(()=>[y(p(e(d)("goodsDetail")),1)]),_:1})]),_:1},8,["modelValue"])]),_:1},8,["label"])):u("",!0),e(o).editComponent.btnStyle.control?(m(),c(r,{key:1,label:e(d)("goodsBtnStyle"),class:"!items-center"},{default:a(()=>[s("div",De,[(m(!0),_(P,null,ee(w,(l,Ke)=>(m(),_(P,null,[l.isShow==!0?(m(),_("div",{key:0,class:v(["cursor-pointer flex items-center justify-center border-[1px] border-solid border-transparent rounded-[6px] py-[5px] px-[8px] mr-[10px]",{"!border-[var(--el-color-primary)]":e(o).editComponent.btnStyle.style==l.value}])},[l.type=="icon"?(m(),_("div",{key:0,class:v(["nc-iconfont !text-[25px] text-[var(--el-color-primary)]",l.title]),onClick:K=>j(l)},null,10,We)):u("",!0),l.type=="button"?(m(),_("div",{key:1,class:"leading-[1] text-[12px] px-[10px] py-[8px] text-[#fff] rounded-[20px] bg-[var(--el-color-primary)]",onClick:K=>j(l)},p(l.title),9,Ge)):u("",!0)],2)):u("",!0)],64))),256))])]),_:1},8,["label"])):u("",!0),e(o).editComponent.btnStyle.control&&e(o).editComponent.btnStyle.style=="button"?(m(),c(r,{key:2,label:e(d)("goodsBtnText")},{default:a(()=>[n(q,{modelValue:e(o).editComponent.btnStyle.text,"onUpdate:modelValue":t[11]||(t[11]=l=>e(o).editComponent.btnStyle.text=l),modelModifiers:{trim:!0},placeholder:e(d)("goodsBtnTextPlaceholder"),clearable:"",maxlength:"4","show-word-limit":""},null,8,["modelValue","placeholder"])]),_:1},8,["label"])):u("",!0)]),_:1})]),s("div",Ie,[s("h3",$e,p(e(d)("goodsShowContent")),1),n(h,{"label-width":"90px",class:"px-[10px]"},{default:a(()=>[e(o).editComponent.goodsNameStyle.isShow?(m(),c(r,{key:0,label:e(d)("goodsSelectPopupGoodsName")},{default:a(()=>[n(C,{modelValue:e(o).editComponent.goodsNameStyle.control,"onUpdate:modelValue":t[12]||(t[12]=l=>e(o).editComponent.goodsNameStyle.control=l)},null,8,["modelValue"])]),_:1},8,["label"])):u("",!0),e(o).editComponent.priceStyle.isShow?(m(),c(r,{key:1,label:e(d)("goodsPriceColor")},{default:a(()=>[n(C,{modelValue:e(o).editComponent.priceStyle.control,"onUpdate:modelValue":t[13]||(t[13]=l=>e(o).editComponent.priceStyle.control=l)},null,8,["modelValue"])]),_:1},8,["label"])):u("",!0),e(o).editComponent.saleStyle.isShow?(m(),c(r,{key:2,label:e(d)("goodsSaleNum")},{default:a(()=>[n(C,{modelValue:e(o).editComponent.saleStyle.control,"onUpdate:modelValue":t[14]||(t[14]=l=>e(o).editComponent.saleStyle.control=l)},null,8,["modelValue"])]),_:1},8,["label"])):u("",!0),e(o).editComponent.labelStyle.isShow?(m(),c(r,{key:3,label:e(d)("goodsLabel")},{default:a(()=>[n(C,{modelValue:e(o).editComponent.labelStyle.control,"onUpdate:modelValue":t[15]||(t[15]=l=>e(o).editComponent.labelStyle.control=l)},null,8,["modelValue"])]),_:1},8,["label"])):u("",!0)]),_:1})])],512),[[W,e(o).editTab=="content"]]),T(s("div",Le,[s("div",Fe,[s("h3",Oe,p(e(d)("goodsStyle")),1),n(h,{"label-width":"80px",class:"px-[10px]"},{default:a(()=>[n(r,{label:e(d)("goodsBgColor")},{default:a(()=>[n(g,{modelValue:e(o).editComponent.elementBgColor,"onUpdate:modelValue":t[16]||(t[16]=l=>e(o).editComponent.elementBgColor=l),"show-alpha":"",predefine:e(o).predefineColors},null,8,["modelValue","predefine"])]),_:1},8,["label"]),n(r,{label:e(d)("goodsNameColor")},{default:a(()=>[n(g,{modelValue:e(o).editComponent.goodsNameStyle.color,"onUpdate:modelValue":t[17]||(t[17]=l=>e(o).editComponent.goodsNameStyle.color=l),"show-alpha":"",predefine:e(o).predefineColors},null,8,["modelValue","predefine"]),Me,n(V,{modelValue:e(o).editComponent.goodsNameStyle.fontWeight,"onUpdate:modelValue":t[18]||(t[18]=l=>e(o).editComponent.goodsNameStyle.fontWeight=l)},{default:a(()=>[n(f,{label:"normal"},{default:a(()=>[y(p(e(d)("fontWeightNormal")),1)]),_:1}),n(f,{label:"bold"},{default:a(()=>[y(p(e(d)("fontWeightBold")),1)]),_:1})]),_:1},8,["modelValue"])]),_:1},8,["label"]),n(r,{label:e(d)("goodsPriceColor")},{default:a(()=>[n(g,{modelValue:e(o).editComponent.priceStyle.color,"onUpdate:modelValue":t[19]||(t[19]=l=>e(o).editComponent.priceStyle.color=l),"show-alpha":"",predefine:e(o).predefineColors},null,8,["modelValue","predefine"])]),_:1},8,["label"]),n(r,{label:e(d)("goodsSaleColor")},{default:a(()=>[n(g,{modelValue:e(o).editComponent.saleStyle.color,"onUpdate:modelValue":t[20]||(t[20]=l=>e(o).editComponent.saleStyle.color=l),"show-alpha":"",predefine:e(o).predefineColors},null,8,["modelValue","predefine"])]),_:1},8,["label"]),n(r,{label:e(d)("topRounded")},{default:a(()=>[n(k,{modelValue:e(o).editComponent.topElementRounded,"onUpdate:modelValue":t[21]||(t[21]=l=>e(o).editComponent.topElementRounded=l),"show-input":"",size:"small",class:"ml-[10px] diy-nav-slider",max:50},null,8,["modelValue"])]),_:1},8,["label"]),n(r,{label:e(d)("bottomRounded")},{default:a(()=>[n(k,{modelValue:e(o).editComponent.bottomElementRounded,"onUpdate:modelValue":t[22]||(t[22]=l=>e(o).editComponent.bottomElementRounded=l),"show-input":"",size:"small",class:"ml-[10px] diy-nav-slider",max:50},null,8,["modelValue"])]),_:1},8,["label"])]),_:1})]),e(o).editComponent.btnStyle.control?(m(),_("div",He,[s("h3",qe,p(e(d)("goodsBuyBtn")),1),n(h,{"label-width":"80px",class:"px-[10px]"},{default:a(()=>[e(o).editComponent.btnStyle.style=="button"?(m(),c(r,{key:0,label:e(d)("goodsIsBold")},{default:a(()=>[n(C,{modelValue:e(o).editComponent.btnStyle.fontWeight,"onUpdate:modelValue":t[23]||(t[23]=l=>e(o).editComponent.btnStyle.fontWeight=l)},null,8,["modelValue"])]),_:1},8,["label"])):u("",!0),n(r,{label:e(d)("goodsTextColor")},{default:a(()=>[n(g,{modelValue:e(o).editComponent.btnStyle.textColor,"onUpdate:modelValue":t[24]||(t[24]=l=>e(o).editComponent.btnStyle.textColor=l),"show-alpha":"",predefine:e(o).predefineColors},null,8,["modelValue","predefine"])]),_:1},8,["label"]),n(r,{label:e(d)("listFrameColor")},{default:a(()=>[n(g,{modelValue:e(o).editComponent.btnStyle.startBgColor,"onUpdate:modelValue":t[25]||(t[25]=l=>e(o).editComponent.btnStyle.startBgColor=l),"show-alpha":"",predefine:e(o).predefineColors},null,8,["modelValue","predefine"]),n(A,{name:"iconfont iconmap-connect",size:"20px",class:"block !text-gray-400 mx-[5px]"}),n(g,{modelValue:e(o).editComponent.btnStyle.endBgColor,"onUpdate:modelValue":t[26]||(t[26]=l=>e(o).editComponent.btnStyle.endBgColor=l),"show-alpha":"",predefine:e(o).predefineColors},null,8,["modelValue","predefine"])]),_:1},8,["label"]),e(o).editComponent.btnStyle.style=="button"?(m(),c(r,{key:1,label:e(d)("goodsRounded")},{default:a(()=>[n(k,{modelValue:e(o).editComponent.btnStyle.aroundRadius,"onUpdate:modelValue":t[27]||(t[27]=l=>e(o).editComponent.btnStyle.aroundRadius=l),"show-input":"",size:"small",class:"ml-[10px] diy-nav-slider",max:50},null,8,["modelValue"])]),_:1},8,["label"])):u("",!0)]),_:1})])):u("",!0),oe(i.$slots,"style")],512),[[W,e(o).editTab=="style"]])],64)}}});const ho=Object.freeze(Object.defineProperty({__proto__:null,default:Ae},Symbol.toStringTag,{value:"Module"}));export{ho as _};
|
|
|