import{u as P}from"./useInstance.233fbdde.js";import{M as q}from"./index.dfdc0704.js";import{a as L}from"./merchant.9d35eb14.js";import{a as S}from"./merchant.1b322e07.js";import{d as R,a6 as j,b as F,r as B,p as I,c as n,e as p,k as g,i as a,h as t,u as e,A as O,f as T,j as $,ba as z,F as G,a2 as H,g as y,m as C,E as J}from"./index.0308b213.js";import{A as K}from"./index.1d26a072.js";import"./index.vue_vue_type_style_index_0_scoped_f00ed21d_lang.2c48f49b.js";import"./vuedraggable.umd.405b1bec.js";import"./index.35b8c9ab.js";import"./index.9e8820cd.js";import"./sort_out.2008c10d.js";import"./install.524ae6f2.js";import"./useAgent.c0cb1751.js";import"./list.5526c7ef.js";const Q=y("div",{class:"tn-form-item__tips"},"\u7C89\u4E1D\u5206\u4EAB\u65F6\u663E\u793A",-1),W=y("div",{class:"tn-form-item__tips"},"\u6570\u5B57\u8D8A\u5927\uFF0C\u8D8A\u9760\u524D",-1),X=C("\u63D0\u4EA4"),Y=C("\u53D6\u6D88"),ce=R({props:{modelValue:{type:Boolean,default:!1},category:null},emits:["update:modelValue","onClose"],setup(i,{emit:V}){const D=i,{OpPlatform:E}=j(),{global:v}=P(),_=F({checkStrictly:!0,emitPath:!1,value:"id",label:"title",children:"child"}),m=B(!1);I(()=>D.modelValue,d=>{m.value=d});const c=B(),o=F({title:"",agentid:"",category1:{parentid:""},category2:{parentid:""},logo:"",content:"",telephone:"",phone_area:"",displayorder:0}),h=F({title:[{required:!0,message:"\u95E8\u5E97\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],telephone:[{required:!0,message:"\u95E8\u5E97\u7535\u8BDD\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}),k=()=>E.value==="agent"?S(o):L(o),U=()=>{var d;(d=c.value)==null||d.validate(u=>{u&&k().then(s=>{J({message:"\u65B0\u589E\u5546\u6237\u6570\u636E\u6210\u529F",type:"success"}),f()})})},f=()=>{V("update:modelValue",!1),V("onClose"),v.$resetForm(c.value,o)};return(d,u)=>{const s=n("el-input"),r=n("el-form-item"),b=n("el-cascader"),x=n("el-option"),w=n("el-select"),M=n("el-input-number"),A=n("el-button"),N=n("el-dialog");return p(),g(N,{modelValue:m.value,"onUpdate:modelValue":u[9]||(u[9]=l=>m.value=l),title:"\u6DFB\u52A0\u95E8\u5E97",width:"50%","destroy-on-close":"",onClose:f},{default:a(()=>[t(e(H),{ref_key:"storeFormRef",ref:c,model:e(o),rules:e(h),"inline-message":!0,"label-width":"80px"},{default:a(()=>[t(r,{prop:"title",label:"\u5E97\u94FA\u540D\u79F0"},{default:a(()=>[t(s,{modelValue:e(o).title,"onUpdate:modelValue":u[0]||(u[0]=l=>e(o).title=l),placeholder:"\u8BF7\u8F93\u5165\u5E97\u94FA\u540D\u79F0"},null,8,["modelValue"])]),_:1}),e(E)==="shangpu"?(p(),g(r,{key:0,prop:"agentid",label:"\u4EE3\u7406\u533A\u57DF"},{default:a(()=>[t(e(K),{modelValue:e(o).agentid,"onUpdate:modelValue":u[1]||(u[1]=l=>e(o).agentid=l)},null,8,["modelValue"])]),_:1})):O("",!0),t(r,{prop:"category1[parentid]",label:"\u4E3B\u8425\u54C1\u7C7B"},{default:a(()=>[t(b,{placeholder:"\u8BF7\u9009\u62E9\u4E3B\u8425\u54C1\u7C7B",filterable:"",modelValue:e(o).category1.parentid,"onUpdate:modelValue":u[2]||(u[2]=l=>e(o).category1.parentid=l),options:i.category,props:e(_),clearable:""},null,8,["modelValue","options","props"])]),_:1}),t(r,{prop:"category2[parentid]",label:"\u8F85\u8425\u54C1\u7C7B"},{default:a(()=>[t(b,{placeholder:"\u8BF7\u9009\u62E9\u4E3B\u8425\u54C1\u7C7B",filterable:"",modelValue:e(o).category2.parentid,"onUpdate:modelValue":u[3]||(u[3]=l=>e(o).category2.parentid=l),options:i.category,props:e(_),clearable:""},null,8,["modelValue","options","props"])]),_:1}),t(r,{prop:"logo",label:"\u95E8\u5E97Logo"},{default:a(()=>[t(q,{modelValue:e(o).logo,"onUpdate:modelValue":u[4]||(u[4]=l=>e(o).logo=l),limit:1},null,8,["modelValue"])]),_:1}),t(r,{prop:"desc",label:"\u5E97\u94FA\u63CF\u8FF0"},{default:a(()=>[t(s,{modelValue:e(o).content,"onUpdate:modelValue":u[5]||(u[5]=l=>e(o).content=l),placeholder:"\u8BF7\u8F93\u5165\u5E97\u94FA\u63CF\u8FF0"},null,8,["modelValue"]),Q]),_:1}),t(r,{prop:"phone",label:"\u5E97\u94FA\u7535\u8BDD"},{default:a(()=>[t(w,{modelValue:e(o).phone_area,"onUpdate:modelValue":u[6]||(u[6]=l=>e(o).phone_area=l),clearable:"",placeholder:"\u8BF7\u9009\u62E9\u533A\u53F7",style:{width:"240px"}},{default:a(()=>[(p(!0),T(G,null,$(e(z),l=>(p(),g(x,{key:l.value,label:l.label,value:l.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),t(s,{modelValue:e(o).telephone,"onUpdate:modelValue":u[7]||(u[7]=l=>e(o).telephone=l),placeholder:"\u8BF7\u8F93\u5165\u5E97\u94FA\u7535\u8BDD",step:"width:240px"},null,8,["modelValue"])]),_:1}),t(r,{prop:"sort",label:"\u6392\u5E8F"},{default:a(()=>[t(M,{modelValue:e(o).displayorder,"onUpdate:modelValue":u[8]||(u[8]=l=>e(o).displayorder=l)},null,8,["modelValue"]),W]),_:1}),t(r,null,{default:a(()=>[t(A,{type:"primary",onClick:U},{default:a(()=>[X]),_:1}),t(A,{onClick:f},{default:a(()=>[Y]),_:1})]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["modelValue"])}}});export{ce as default};
