智慧教务系统 PHP-NiuCloud框架开发
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
13 KiB

import{d as oe,l as N,r as S,k as d,am as te,N as ae,h as g,c as x,J as V,a9 as k,u as e,a as i,t as r,e as o,w as n,i as p,F as z,O as L,n as ne,z as G,m as F,B as de,a0 as ie,b as se,T as re,G as me,D as pe,H as ue,E as ce,V as _e,aa as fe,ab as ge,$ as Ce,C as be,b2 as ye,b4 as xe,L as Ve}from"./index-be67c1b4.js";/* empty css *//* empty css *//* empty css *//* empty css */import"./el-tooltip-4ed993c7.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import{_ as he}from"./index.vue_vue_type_script_setup_true_lang-32bd66c9.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import{_ as ve}from"./index.vue_vue_type_style_index_0_lang-6eda5ff5.js";import we from"./index-660033d8.js";import"./el-form-item-4ed993c7.js";import{_ as Se}from"./category_default-03996666.js";import{g as ke}from"./goods-ee796efd.js";import{u as Ue}from"./diy-bd230451.js";import Te from"./goods-select-popup-959eab94.js";const Re={class:"content-wrap"},Ee={class:"edit-attr-item-wrap"},Be={class:"mb-[10px]"},Ie={class:"flex flex-wrap"},Ne=["onClick"],ze=["src"],De={class:"dialog-footer"},Pe={class:"edit-attr-item-wrap"},$e={class:"mb-[10px]"},Ae={class:"edit-attr-item-wrap"},Le={class:"mb-[10px]"},Ge={ref:"imageBoxRef"},Fe=["onClick"],We={class:"order-2"},je={class:"h-[30px]"},Me=i("div",{class:"image-slot"},[i("img",{class:"w-[30px] h-[30px]",src:Se})],-1),Oe={class:"flex items-center justify-end mt-[15px]"},He={class:"style-wrap"},Je={class:"edit-attr-item-wrap"},qe={class:"mb-[10px]"},Ke={class:"edit-attr-item-wrap"},Qe={class:"mb-[10px]"},Xe={class:"edit-attr-item-wrap"},Ye={class:"mb-[10px]"},Ze={class:"edit-attr-item-wrap"},el={class:"mb-[10px]"},ll=i("div",{class:"mr-[20px]"},null,-1),ol=oe({__name:"edit-single-recommend",setup(tl,{expose:W}){const l=Ue();l.editComponent.ignore=["componentBgUrl"];const u=N({title:l.editComponent.titleStyle.title,value:l.editComponent.titleStyle.value}),C=S(!1),j=()=>{u.title=l.editComponent.titleStyle.title,u.value=l.editComponent.titleStyle.value,C.value=!0},M=m=>{u.title=m.title,u.value=m.value},O=()=>{l.editComponent.titleStyle.title=u.title,l.editComponent.titleStyle.value=u.value,C.value=!1},H=N([{url:"addon/shop/diy/single_recommend/title_style_01.png",title:"风格1",value:"style-1"}]),J=()=>{l.editComponent.list.push({id:l.generateRandom(),imageUrl:"",imgWidth:0,imgHeight:0,link:{name:""}})};l.editComponent.verify=m=>{const t={code:!0,message:""};return l.value[m].source=="custom"&&l.value[m].goods_ids.length==0&&(t.code=!1,t.message=d("goodsPlaceholder")),l.value[m].list.forEach((R,D)=>{if(R.imageUrl==="")return t.code=!1,t.message=d("imageUrlTip"),t}),t};const h=S(!1),c=N({loading:!0,data:[]});te(()=>{q()});const U=S();let T=null;const q=()=>{c.loading=!0,ke().then(m=>{c.loading=!1,c.data=m.data}).catch(()=>{c.loading=!1})},K=m=>{let t="";m&&(t=m[m.length-1]),m.length>1&&U.value.clearSelection(),t&&U.value.toggleRowSelection(t,!0),T=t},Q=()=>{l.editComponent.goods_category=T.category_id,l.editComponent.goods_category_name=T.category_name,h.value=!1},X=S([]);return W({}),(m,t)=>{const R=ae("ArrowRight"),D=re,s=me,P=we,E=ve,Y=pe,_=ue,b=ce,$=_e,v=fe,A=ge,Z=he,B=Ce,ee=be,f=ye,w=xe,le=Ve;return g(),x(z,null,[V(i("div",Re,[i("div",Ee,[i("h3",Be,r(e(d)("titleContent")),1),o(_,{"label-width":"80px",class:"px-[10px]"},{default:n(()=>[o(s,{label:e(d)("selectStyle"),class:"flex"},{default:n(()=>[i("span",{class:"text-primary flex-1 cursor-pointer",onClick:j},r(e(l).editComponent.titleStyle.title),1),o(D,null,{default:n(()=>[o(R)]),_:1})]),_:1},8,["label"]),o(s,{label:e(d)("image")},{default:n(()=>[o(P,{modelValue:e(l).editComponent.textImg,"onUpdate:modelValue":t[0]||(t[0]=a=>e(l).editComponent.textImg=a),limit:1},null,8,["modelValue"])]),_:1},8,["label"]),o(s,{label:e(d)("link")},{default:n(()=>[o(E,{modelValue:e(l).editComponent.textLink,"onUpdate:modelValue":t[1]||(t[1]=a=>e(l).editComponent.textLink=a)},null,8,["modelValue"])]),_:1},8,["label"]),o(s,{label:e(d)("subTitle")},{default:n(()=>[o(Y,{modelValue:e(l).editComponent.subTitle.text,"onUpdate:modelValue":t[2]||(t[2]=a=>e(l).editComponent.subTitle.text=a),modelModifiers:{trim:!0},placeholder:e(d)("subTitlePlaceholder"),clearable:"",maxlength:"8","show-word-limit":""},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),o(s,{label:e(d)("link")},{default:n(()=>[o(E,{modelValue:e(l).editComponent.subTitle.link,"onUpdate:modelValue":t[3]||(t[3]=a=>e(l).editComponent.subTitle.link=a)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1}),o($,{modelValue:C.value,"onUpdate:modelValue":t[5]||(t[5]=a=>C.value=a),title:e(d)("selectStyle"),width:"460px"},{footer:n(()=>[i("span",De,[o(b,{onClick:t[4]||(t[4]=a=>C.value=!1)},{default:n(()=>[p(r(e(d)("cancel")),1)]),_:1}),o(b,{type:"primary",onClick:O},{default:n(()=>[p(r(e(d)("confirm")),1)]),_:1})])]),default:n(()=>[i("div",Ie,[(g(!0),x(z,null,L(H,(a,I)=>(g(),x("div",{key:I,class:ne([{"border-primary":u.value==a.value},"flex items-center justify-center overflow-hidden w-[200px] h-[100px] mr-[12px] mb-[12px] cursor-pointer border bg-[#eee]"]),onClick:y=>M(a)},[i("img",{src:e(G)(a.url)},null,8,ze)],10,Ne))),128))])]),_:1},8,["modelValue","title"])]),i("div",Pe,[i("h3",$e,r(e(d)("selectSource")),1),o(_,{"label-width":"80px",class:"px-[10px]"},{default:n(()=>[o(s,{label:e(d)("goodsSelectPopupSelectGoodsButton")},{default:n(()=>[o(A,{modelValue:e(l).editComponent.source,"onUpdate:modelValue":t[6]||(t[6]=a=>e(l).editComponent.source=a),title:e(d)("goodsSelectPopupSelectGoodsButton")},{default:n(()=>[o(v,{label:"all"},{default:n(()=>[p(r(e(d)("defaultGoodsSelect")),1)]),_:1}),o(v,{label:"custom"},{default:n(()=>[p(r(e(d)("manualSelectionSources")),1)]),_:1})]),_:1},8,["modelValue","title"])]),_:1},8,["label"]),e(l).editComponent.source=="custom"?(g(),F(s,{key:0,label:e(d)("customGoods")},{default:n(()=>[o(Te,{ref:"goodsSelectPopupRef",modelValue:e(l).editComponent.goods_ids,"onUpdate:modelValue":t[7]||(t[7]=a=>e(l).editComponent.goods_ids=a),min:1,max:1},null,8,["modelValue"])]),_:1},8,["label"])):de("",!0)]),_:1})]),i("div",Ae,[i("h3",Le,r(e(d)("imageSet")),1),o(_,{"label-width":"80px",class:"px-[10px]"},{default:n(()=>[i("div",Ge,[(g(!0),x(z,null,L(e(l).editComponent.list,(a,I)=>(g(),x("div",{key:a.id,class:"item-wrap p-[10px] pb-0 relative border border-dashed border-gray-300 mb-[16px]"},[o(s,{label:e(d)("image")},{default:n(()=>[o(P,{modelValue:a.imageUrl,"onUpdate:modelValue":y=>a.imageUrl=y,limit:1},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["label"]),V(i("div",{class:"del absolute cursor-pointer z-[2] top-[-8px] right-[-8px]",onClick:y=>e(l).editComponent.list.splice(I,1)},[o(Z,{name:"element CircleCloseFilled",color:"#bbb",size:"20px"})],8,Fe),[[k,e(l).editComponent.list.length>1]]),o(s,{label:e(d)("link")},{default:n(()=>[o(E,{modelValue:a.link,"onUpdate:modelValue":y=>a.link=y},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["label"])]))),128))],512),V(o(b,{class:"w-full",onClick:J},{default:n(()=>[p(r(e(d)("addImageAd")),1)]),_:1},512),[[k,e(l).editComponent.list.length<10]])]),_:1})]),o($,{modelValue:h.value,"onUpdate:modelValue":t[9]||(t[9]=a=>h.value=a),title:e(d)("goodsCategoryTitle"),width:"750px","close-on-press-escape":!1,"destroy-on-close":!0,"close-on-click-modal":!1},{default:n(()=>[V((g(),F(e(ie),{data:c.data,ref_key:"categoryTableRef",ref:U,size:"large",height:"450px",onSelectionChange:K,"row-key":"category_id","expand-row-keys":X.value,"tree-props":{hasChildren:"hasChildren",children:"child_list"}},{empty:n(()=>[i("span",null,r(c.loading?"":e(d)("emptyData")),1)]),default:n(()=>[o(B,{type:"selection",width:"55"}),o(B,{label:e(d)("categoryName"),"min-width":"120"},{default:n(({row:a})=>[i("span",We,r(a.category_name),1)]),_:1},8,["label"]),o(B,{label:e(d)("categoryImage"),width:"170",align:"left"},{default:n(({row:a})=>[i("div",je,[o(ee,{class:"w-[30px] h-[30px]",src:e(G)(a.image),fit:"contain"},{error:n(()=>[Me]),_:2},1032,["src"])])]),_:1},8,["label"])]),_:1},8,["data","expand-row-keys"])),[[le,c.loading]]),i("div",Oe,[o(b,{type:"primary",onClick:Q},{default:n(()=>[p(r(e(d)("confirm")),1)]),_:1}),o(b,{onClick:t[8]||(t[8]=a=>h.value=!1)},{default:n(()=>[p(r(e(d)("cancel")),1)]),_:1})])]),_:1},8,["modelValue","title"])],512),[[k,e(l).editTab=="content"]]),V(i("div",He,[i("div",Je,[i("h3",qe,r(e(d)("titleStyle")),1),o(_,{"label-width":"90px",class:"px-[10px]"},{default:n(()=>[o(s,{label:e(d)("textColor")},{default:n(()=>[o(f,{modelValue:e(l).editComponent.subTitle.textColor,"onUpdate:modelValue":t[10]||(t[10]=a=>e(l).editComponent.subTitle.textColor=a),"show-alpha":"",predefine:e(l).predefineColors},null,8,["modelValue","predefine"])]),_:1},8,["label"])]),_:1})]),i("div",Ke,[i("h3",Qe,r(e(d)("carouselStyle")),1),o(_,{"label-width":"90px",class:"px-[10px]"},{default:n(()=>[o(s,{label:e(d)("topRounded")},{default:n(()=>[o(w,{modelValue:e(l).editComponent.topCarouselRounded,"onUpdate:modelValue":t[11]||(t[11]=a=>e(l).editComponent.topCarouselRounded=a),"show-input":"",size:"small",class:"ml-[10px] diy-nav-slider",max:50},null,8,["modelValue"])]),_:1},8,["label"]),o(s,{label:e(d)("bottomRounded")},{default:n(()=>[o(w,{modelValue:e(l).editComponent.bottomCarouselRounded,"onUpdate:modelValue":t[12]||(t[12]=a=>e(l).editComponent.bottomCarouselRounded=a),"show-input":"",size:"small",class:"ml-[10px] diy-nav-slider",max:50},null,8,["modelValue"])]),_:1},8,["label"])]),_:1})]),i("div",Xe,[i("h3",Ye,r(e(d)("recommendIndicatorStyle")),1),o(_,{"label-width":"90px",class:"px-[10px]"},{default:n(()=>[o(s,{label:e(d)("recommendIndicatorColor")},{default:n(()=>[o(f,{modelValue:e(l).editComponent.indicatorColor,"onUpdate:modelValue":t[13]||(t[13]=a=>e(l).editComponent.indicatorColor=a),"show-alpha":"",predefine:e(l).predefineColors},null,8,["modelValue","predefine"])]),_:1},8,["label"]),o(s,{label:e(d)("recommendIndicatorActiveColor")},{default:n(()=>[o(f,{modelValue:e(l).editComponent.indicatorActiveColor,"onUpdate:modelValue":t[14]||(t[14]=a=>e(l).editComponent.indicatorActiveColor=a),"show-alpha":"",predefine:e(l).predefineColors},null,8,["modelValue","predefine"])]),_:1},8,["label"])]),_:1})]),i("div",Ze,[i("h3",el,r(e(d)("goodsStyle")),1),o(_,{"label-width":"80px",class:"px-[10px]"},{default:n(()=>[o(s,{label:e(d)("goodsBgColor")},{default:n(()=>[o(f,{modelValue:e(l).editComponent.elementBgColor,"onUpdate:modelValue":t[15]||(t[15]=a=>e(l).editComponent.elementBgColor=a),"show-alpha":"",predefine:e(l).predefineColors},null,8,["modelValue","predefine"])]),_:1},8,["label"]),o(s,{label:e(d)("goodsNameColor")},{default:n(()=>[o(f,{modelValue:e(l).editComponent.goodsNameStyle.color,"onUpdate:modelValue":t[16]||(t[16]=a=>e(l).editComponent.goodsNameStyle.color=a),"show-alpha":"",predefine:e(l).predefineColors},null,8,["modelValue","predefine"]),ll,o(A,{modelValue:e(l).editComponent.goodsNameStyle.fontWeight,"onUpdate:modelValue":t[17]||(t[17]=a=>e(l).editComponent.goodsNameStyle.fontWeight=a)},{default:n(()=>[o(v,{label:"normal"},{default:n(()=>[p(r(e(d)("fontWeightNormal")),1)]),_:1}),o(v,{label:"bold"},{default:n(()=>[p(r(e(d)("fontWeightBold")),1)]),_:1})]),_:1},8,["modelValue"])]),_:1},8,["label"]),o(s,{label:e(d)("goodsPriceColor")},{default:n(()=>[o(f,{modelValue:e(l).editComponent.priceStyle.mainColor,"onUpdate:modelValue":t[18]||(t[18]=a=>e(l).editComponent.priceStyle.mainColor=a),"show-alpha":"",predefine:e(l).predefineColors},null,8,["modelValue","predefine"])]),_:1},8,["label"]),o(s,{label:e(d)("goodsBtnColor")},{default:n(()=>[o(f,{modelValue:e(l).editComponent.saleStyle.color,"onUpdate:modelValue":t[19]||(t[19]=a=>e(l).editComponent.saleStyle.color=a),"show-alpha":"",predefine:e(l).predefineColors},null,8,["modelValue","predefine"])]),_:1},8,["label"]),o(s,{label:e(d)("topRounded")},{default:n(()=>[o(w,{modelValue:e(l).editComponent.topElementRounded,"onUpdate:modelValue":t[20]||(t[20]=a=>e(l).editComponent.topElementRounded=a),"show-input":"",size:"small",class:"ml-[10px] diy-nav-slider",max:50},null,8,["modelValue"])]),_:1},8,["label"]),o(s,{label:e(d)("bottomRounded")},{default:n(()=>[o(w,{modelValue:e(l).editComponent.bottomElementRounded,"onUpdate:modelValue":t[21]||(t[21]=a=>e(l).editComponent.bottomElementRounded=a),"show-input":"",size:"small",class:"ml-[10px] diy-nav-slider",max:50},null,8,["modelValue"])]),_:1},8,["label"])]),_:1})]),se(m.$slots,"style")],512),[[k,e(l).editTab=="style"]])],64)}}}),Bl=Object.freeze(Object.defineProperty({__proto__:null,default:ol},Symbol.toStringTag,{value:"Module"}));export{Bl as _};