niucloud-admin/niucloud/public/admin/assets/edit-goods-list-8f232221.js
2023-11-15 15:57:04 +08:00

2 lines
7.5 KiB
JavaScript

/* empty css *//* empty css */import{E as L}from"./el-overlay-08181e74.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import{a as $,E as A}from"./el-form-item-1b16c9fc.js";/* empty css *//* empty css *//* empty css */import"./el-tooltip-4ed993c7.js";/* empty css *//* empty css *//* empty css */import{v as V}from"./event-f85d77b0.js";import{_ as M}from"./category_default-9a714445.js";import{g as O}from"./goods-6a4de1f3.js";import{t as a}from"./index-0ca94763.js";import{c as H}from"./common-c3be41fd.js";import{u as q}from"./diy-56ab8023.js";import J from"./goods-select-popup-b6ef8d67.js";import{E as K,a as Q}from"./index-fe3867fe.js";import{E as W,b as X}from"./index-ba04db70.js";import{E as Y}from"./index-680a3029.js";import{E as Z}from"./index-888853cf.js";import{E as ee}from"./index-c5914bde.js";import{v as oe}from"./directive-64fb15dc.js";import{d as te,r as v,O as le,o as re,e as c,f as ae,M as S,u as e,g as t,B as n,n as k,y as s,x as r,A as u,v as x,H as w,i as T,h as ie,F as se}from"./plugin-vue_export-helper-85a4d40b.js";import"./index-313cd2ce.js";import"./index-cf9a2dd7.js";import"./focus-trap-64c402c5.js";import"./index-1ad115d7.js";import"./index-de1d3b53.js";import"./index-bcd7a424.js";import"./_baseClone-3dbf39d6.js";import"./index-7eafba5f.js";import"./vue-router-48fdc1e3.js";import"./index-e513479b.js";import"./el-main-86eb724f.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./index-b9e5f5cb.js";import"./index-d469ae66.js";import"./index-e27c3bb0.js";import"./index-4d8f36c6.js";import"./index-ebc73046.js";import"./cloneDeep-eeb37e90.js";import"./index-ee5275c6.js";import"./aria-adfa05c5.js";import"./validator-bcf701e4.js";/* empty css *//* empty css *//* empty css *//* empty css */import"./goods_default-3802d665.js";import"./index-4601cf3b.js";import"./index-99b65a15.js";import"./strings-53351eda.js";import"./isEqual-0b9509fd.js";import"./debounce-6c3123a6.js";import"./index-bd04154b.js";import"./index-b0e6b9c8.js";import"./index-95b00894.js";import"./flatten-749195f8.js";import"./rand-14326ce1.js";import"./arrays-e667dc24.js";import"./index-21f38393.js";import"./_isIterateeCall-47526406.js";import"./index-dbeb412e.js";import"./index-6c0acd90.js";import"./index-344f0086.js";import"./position-37364850.js";const ne={class:"content-wrap"},me={class:"edit-attr-item-wrap"},pe={class:"mb-[10px]"},de={class:"flex items-center mb-[18px] rounded overflow-hidden"},ce={class:"edit-attr-item-wrap"},ue={class:"mb-[10px]"},_e={class:"flex items-center w-full ml-[5px]"},fe={class:"ml-[15px]"},ge={class:"flex items-center w-full"},ye={class:"text-[var(--el-color-primary)]"},xe=t("span",{class:"iconfont iconxiangyoujiantou"},null,-1),he={class:"order-2"},Ce={class:"h-[30px]"},be=t("div",{class:"image-slot"},[t("img",{class:"w-[30px] h-[30px]",src:M})],-1),ve={class:"flex items-center justify-end mt-[15px]"},Se={class:"style-wrap"},qo=te({__name:"edit-goods-list",setup(we,{expose:B}){const l=q();l.editComponent.ignore=[];let m=v(!1);const p=le({loading:!0,data:[],searchParam:{category_name:""}});re(()=>{D()});const _=v();let f=null;const D=()=>{p.loading=!0,O({...p.searchParam}).then(d=>{p.loading=!1,p.data=d.data,l.editComponent.source=="category"&&p.data.forEach((o,g)=>{l.editComponent.goods_category==o.category_id&&(C.value=o.category_name,f=o)})}).catch(()=>{p.loading=!1})};let h={},C=v("请选择");const R=d=>{let o="";d&&(o=d[d.length-1]),d.length>1&&_.value.clearSelection(),o&&_.value.toggleRowSelection(o,!0),f=o,h=o},N=()=>{l.editComponent.goods_category=h.category_id,C.value=h.category_name,m.value=!1},P=()=>{m.value=!0,f&&setTimeout(()=>{_.value.toggleRowSelection(f,!0)},200)};return B({}),(d,o)=>{const g=W,G=X,y=$,j=Y,z=A,b=Q,F=Z,E=ee,I=L,U=oe;return c(),ae(se,null,[S(t("div",ne,[t("div",me,[t("h3",pe,n(e(a)("selectStyle")),1),t("div",de,[t("span",{class:k(["iconfont icongudingzhanshi 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(l).editComponent.style=="style1"}]),onClick:o[0]||(o[0]=i=>e(l).editComponent.style="style1")},null,2),t("span",{class:k(["iconfont icontuwendaohang3 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(l).editComponent.style=="style2"}]),onClick:o[1]||(o[1]=i=>e(l).editComponent.style="style2")},null,2)])]),t("div",ce,[t("h3",ue,n(e(a)("selectSource")),1),s(z,{"label-width":"80px",class:"px-[10px]"},{default:r(()=>[s(y,{label:e(a)("goodsSelectPopupSelectGoodsButton")},{default:r(()=>[s(G,{modelValue:e(l).editComponent.source,"onUpdate:modelValue":o[2]||(o[2]=i=>e(l).editComponent.source=i),title:e(a)("goodsSelectPopupSelectGoodsButton"),class:"mb-[18px]"},{default:r(()=>[s(g,{label:"all"},{default:r(()=>[u(n(e(a)("goodsSelectPopupAllGoods")),1)]),_:1}),s(g,{label:"category"},{default:r(()=>[u(n(e(a)("selectCategory")),1)]),_:1}),s(g,{label:"custom"},{default:r(()=>[u(n(e(a)("manualSelectionSources")),1)]),_:1})]),_:1},8,["modelValue","title"])]),_:1},8,["label"]),e(l).editComponent.source=="all"?(c(),x(y,{key:0,label:e(a)("goodsNum")},{default:r(()=>[t("div",_e,[s(j,{class:"flex-1",modelValue:e(l).editComponent.num,"onUpdate:modelValue":o[3]||(o[3]=i=>e(l).editComponent.num=i),max:"20",size:"small"},null,8,["modelValue"]),t("span",fe,n(e(l).editComponent.num),1)])]),_:1},8,["label"])):w("",!0),e(l).editComponent.source=="category"?(c(),x(y,{key:1,label:e(a)("selectCategory")},{default:r(()=>[t("div",ge,[t("div",{class:"cursor-pointer ml-auto",onClick:P},[t("span",ye,n(e(C)),1),xe])])]),_:1},8,["label"])):w("",!0),e(l).editComponent.source=="custom"?(c(),x(y,{key:2,label:e(a)("customGoods")},{default:r(()=>[s(J,{ref:"goodsSelectPopupRef",modelValue:e(l).editComponent.goods_ids,"onUpdate:modelValue":o[4]||(o[4]=i=>e(l).editComponent.goods_ids=i),min:"1",max:"99"},null,8,["modelValue"])]),_:1},8,["label"])):w("",!0)]),_:1}),s(I,{modelValue:e(m),"onUpdate:modelValue":o[6]||(o[6]=i=>T(m)?m.value=i:m=i),title:e(a)("goodsCategoryTitle"),width:"1000px","close-on-press-escape":!1,"destroy-on-close":!0,"close-on-click-modal":!1},{default:r(()=>[S((c(),x(e(K),{data:p.data,ref_key:"categoryTableRef",ref:_,size:"large",height:"490px",onSelectionChange:R,"row-key":"category_id","tree-props":{hasChildren:"hasChildren",children:"child_list"}},{empty:r(()=>[t("span",null,n(p.loading?"":e(a)("emptyData")),1)]),default:r(()=>[s(b,{type:"selection",width:"55"}),s(b,{label:e(a)("categoryName"),"min-width":"120"},{default:r(({row:i})=>[t("span",he,n(i.category_name),1)]),_:1},8,["label"]),s(b,{label:e(a)("categoryImage"),width:"170",align:"left"},{default:r(({row:i})=>[t("div",Ce,[s(F,{class:"w-[30px] h-[30px]",src:e(H)(i.image),fit:"contain"},{error:r(()=>[be]),_:2},1032,["src"])])]),_:1},8,["label"])]),_:1},8,["data"])),[[U,p.loading]]),t("div",ve,[s(E,{type:"primary",onClick:N},{default:r(()=>[u(n(e(a)("confirm")),1)]),_:1}),s(E,{onClick:o[5]||(o[5]=i=>T(m)?m.value=!1:m=!1)},{default:r(()=>[u(n(e(a)("cancel")),1)]),_:1})])]),_:1},8,["modelValue","title"])])],512),[[V,e(l).editTab=="content"]]),S(t("div",Se,[ie(d.$slots,"style")],512),[[V,e(l).editTab=="style"]])],64)}}});export{qo as default};