1 |
- import{l as E,s as D}from"./category.b6612508.js";import{l as S,a as U,s as k,b as L}from"./category.9967ab12.js";import{d as N,a6 as j,r as F,dx as R,E as g,c as y,e as v,k as O,i as m,g as t,h as a,t as P,f as I,j as T,F as $,m as h,R as z,S as M,_ as q}from"./index.76214426.js";const i=d=>(z("data-v-427e2d45"),d=d(),M(),d),G={style:{"background-color":"#f4f4f4","border-radius":"8px",padding:"8px"}},H={class:"center"},J={class:"top-list"},K=i(()=>t("div",{class:"top-list-left"}," \u5206\u7C7B\u540D\u79F0\uFF1A ",-1)),Q={class:"top-list-right"},W={class:"top-list",style:{"margin-top":"10px"}},X=i(()=>t("div",{class:"top-list-left"}," \u5206\u7C7B\u6392\u5E8F\uFF1A ",-1)),Y={class:"top-list-right"},Z={class:"top-list",style:{"margin-top":"10px"}},ee=i(()=>t("div",{class:"top-list-left"}," \u6839\u636E\u6D17\u6DA4\u65B9\u5F0F\u8BBE\u7F6E\u4EF7\u683C\uFF1A ",-1)),te={class:"top-list-right",style:{display:"flex","align-items":"center"}},se=i(()=>t("div",{style:{color:"#b9b9b9","margin-left":"6px"}},"\uFF08 \u4EC5\u63A8\u8350\u8863\u7269\u5206\u7C7B\u6253\u5F00 \uFF09",-1)),oe={class:"top-list",style:{"margin-top":"10px"}},le=i(()=>t("div",{class:"top-list-left"}," \u662F\u5426\u591A\u9009\uFF1A ",-1)),ae={class:"top-list-right"},ie={class:"top-list",style:{"margin-top":"10px"}},ue=i(()=>t("div",{class:"top-list-left"}," \u662F\u5426\u663E\u793A\uFF1A ",-1)),ne={class:"top-list-right",style:{display:"flex","align-items":"center"}},de=i(()=>t("div",{style:{color:"#b9b9b9","margin-left":"6px"}},"\uFF08 \u5173\u95ED\u65F6\u53EF\u5728\u8BE6\u60C5\u754C\u9762\u67E5\u770B \uFF09",-1)),ce={class:"top-list",style:{"margin-top":"10px"}},re=i(()=>t("div",{class:"top-list-left"}," \u662F\u5426\u5FC5\u9009\uFF1A ",-1)),_e={class:"top-list-right",style:{display:"flex","align-items":"center"}},pe=i(()=>t("div",{style:{color:"#b9b9b9","margin-left":"6px"}},null,-1)),ge={class:"center",style:{"margin-top":"8px"}},ye={class:"top-list san"},me={style:{"font-size":"16px"}},fe=h("\u6DFB\u52A0"),ve={class:"top-list",style:{flex:"1"}},he=i(()=>t("div",{class:"top-list-left"}," \u7C7B\u578B\u540D\u79F0\uFF1A ",-1)),Ce={class:"top-list-right"},Fe={class:"top-list",style:{flex:"1"}},Ie=i(()=>t("div",{class:"top-list-left"}," \u7C7B\u578B\u6392\u5E8F\uFF1A ",-1)),Be={class:"top-list-right"},we={style:{"margin-left":"10px"}},Ve=h("\u5220\u9664"),be={class:"center",style:{"margin-top":"8px"}},xe={style:{display:"flex","justify-content":"center"}},Ae=h("\u786E\u8BA4"),Ee=N({props:{selectCategoryInfo:{type:Object,default:()=>({})},openAddCategory:Boolean,selectBrand:Number},emits:["customEvent","fetchCategoryData","getAllSubclassList"],setup(d,{emit:u}){const e=d,{OpPlatform:r}=j(),C=F(!1),B=async()=>{r.value=="shangpu"?await D({id:e.selectCategoryInfo.id,name:e.selectCategoryInfo.name,weigh:e.selectCategoryInfo.weigh,is_clothes:e.selectCategoryInfo.is_clothes,is_multi:e.selectCategoryInfo.is_multi,is_show:e.selectCategoryInfo.is_show,is_must:e.selectCategoryInfo.is_must,degree:1,subcategories:l.value,brand_id:e.selectBrand}).then(n=>{u("fetchCategoryData"),u("customEvent"),u("getAllSubclassList"),l.value=[],g({message:"\u63D0\u4EA4\u6210\u529F",type:"success"})}):r.value=="agent"?await k({id:e.selectCategoryInfo.id,name:e.selectCategoryInfo.name,weigh:e.selectCategoryInfo.weigh,is_clothes:e.selectCategoryInfo.is_clothes,is_multi:e.selectCategoryInfo.is_multi,is_show:e.selectCategoryInfo.is_show,is_must:e.selectCategoryInfo.is_must,degree:1,subcategories:l.value,brand_id:e.selectBrand}).then(n=>{u("fetchCategoryData"),u("customEvent"),u("getAllSubclassList"),l.value=[],g({message:"\u63D0\u4EA4\u6210\u529F",type:"success"})}):await L({id:e.selectCategoryInfo.id,name:e.selectCategoryInfo.name,weigh:e.selectCategoryInfo.weigh,is_clothes:e.selectCategoryInfo.is_clothes,is_multi:e.selectCategoryInfo.is_multi,is_show:e.selectCategoryInfo.is_show,is_must:e.selectCategoryInfo.is_must,degree:1,subcategories:l.value,brand_id:e.selectBrand}).then(n=>{u("fetchCategoryData"),u("customEvent"),u("getAllSubclassList"),l.value=[],g({message:"\u63D0\u4EA4\u6210\u529F",type:"success"})})},l=F([]),w=()=>{l.value.push({id:"",name:"",weigh:""})},V=n=>{l.value.splice(n,1)};R(()=>{e.openAddCategory&&e.selectCategoryInfo.type=="\u7F16\u8F91"?b(e.selectCategoryInfo.id):e.openAddCategory||(l.value=[])});const b=async n=>{try{if(r.value=="shangpu")var s=await E({parent_id:n,degree:2,brand_id:e.selectBrand});else if(r.value=="agent")var s=await S({parent_id:n,degree:2,brand_id:e.selectBrand});else var s=await U({parent_id:n,degree:2,brand_id:e.selectBrand});s.error?g.error(s.error):(l.value=s,console.log("subclassList",l.value))}catch(c){console.error("\u83B7\u53D6\u5206\u7C7B\u5217\u8868\u5931\u8D25:",c)}};return(n,s)=>{const c=y("el-input"),_=y("el-switch"),f=y("el-button"),x=y("el-dialog");return v(),O(x,{modelValue:C.value,"onUpdate:modelValue":s[6]||(s[6]=o=>C.value=o),title:`${d.selectCategoryInfo.type}\u5206\u7C7B`},{default:m(()=>[t("div",G,[t("div",H,[t("div",J,[K,t("div",Q,[a(c,{modelValue:e.selectCategoryInfo.name,"onUpdate:modelValue":s[0]||(s[0]=o=>e.selectCategoryInfo.name=o),placeholder:"\u8BF7\u8F93\u5165\u5206\u7C7B\u540D\u79F0"},null,8,["modelValue"])])]),t("div",W,[X,t("div",Y,[a(c,{type:"Number",modelValue:e.selectCategoryInfo.weigh,"onUpdate:modelValue":s[1]||(s[1]=o=>e.selectCategoryInfo.weigh=o),placeholder:"\u8BF7\u8F93\u5165\u5206\u7C7B\u6392\u5E8F"},null,8,["modelValue"])])]),t("div",Z,[ee,t("div",te,[a(_,{modelValue:e.selectCategoryInfo.is_clothes,"onUpdate:modelValue":s[2]||(s[2]=o=>e.selectCategoryInfo.is_clothes=o),"active-value":1,"inactive-value":0},null,8,["modelValue"]),se])]),t("div",oe,[le,t("div",ae,[a(_,{modelValue:e.selectCategoryInfo.is_multi,"onUpdate:modelValue":s[3]||(s[3]=o=>e.selectCategoryInfo.is_multi=o),"active-value":1,"inactive-value":0},null,8,["modelValue"])])]),t("div",ie,[ue,t("div",ne,[a(_,{modelValue:e.selectCategoryInfo.is_show,"onUpdate:modelValue":s[4]||(s[4]=o=>e.selectCategoryInfo.is_show=o),"active-value":1,"inactive-value":0},null,8,["modelValue"]),de])]),t("div",ce,[re,t("div",_e,[a(_,{modelValue:e.selectCategoryInfo.is_must,"onUpdate:modelValue":s[5]||(s[5]=o=>e.selectCategoryInfo.is_must=o),"active-value":1,"inactive-value":0},null,8,["modelValue"]),pe])])]),t("div",ge,[t("div",ye,[t("div",me,P(e.selectCategoryInfo.name)+"\u7C7B\u578B",1),t("div",null,[a(f,{type:"primary",onClick:w},{default:m(()=>[fe]),_:1})])]),(v(!0),I($,null,T(l.value,(o,A)=>(v(),I("div",{class:"top-list",key:o.id,style:{"margin-top":"10px"}},[t("div",ve,[he,t("div",Ce,[a(c,{modelValue:o.name,"onUpdate:modelValue":p=>o.name=p,style:{width:"95%"},placeholder:"\u8BF7\u8F93\u5165\u5206\u7C7B\u540D\u79F0"},null,8,["modelValue","onUpdate:modelValue"])])]),t("div",Fe,[Ie,t("div",Be,[a(c,{type:"Number",modelValue:o.weigh,"onUpdate:modelValue":p=>o.weigh=p,style:{width:"95%"},placeholder:"\u8BF7\u8F93\u5165\u5206\u7C7B\u6392\u5E8F"},null,8,["modelValue","onUpdate:modelValue"])])]),t("div",we,[a(f,{type:"danger",onClick:p=>V(A)},{default:m(()=>[Ve]),_:2},1032,["onClick"])])]))),128))]),t("div",be,[t("div",xe,[a(f,{type:"primary",style:{width:"200px"},onClick:B},{default:m(()=>[Ae]),_:1})])])])]),_:1},8,["modelValue","title"])}}});const ke=q(Ee,[["__scopeId","data-v-427e2d45"]]);export{ke as default};
|