import{am as E,d as S,h as X,r as _,e as J,q as T,M as W,o as d,x as y,w as l,z as w,a as e,f as t,g as A,y as n,c as V,a0 as D,G as B,ad as F,ae as I,C as L,bw as N,H as O,K as Q,_ as Y,__tla as Z}from"./index-8dc1e40a.js";import{_ as $,__tla as aa}from"./ContentWrap-0aca5216.js";import{E as ea,__tla as la}from"./el-card-18df90f0.js";import{C as ta,__tla as sa}from"./CardTitle-2f2eb5e8.js";import{u as oa,__tla as na}from"./useMessage-7a27dd80.js";let h,ua=Promise.all([(()=>{try{return Z}catch{}})(),(()=>{try{return aa}catch{}})(),(()=>{try{return la}catch{}})(),(()=>{try{return sa}catch{}})(),(()=>{try{return na}catch{}})()]).then(async()=>{let p,v,b;p={class:"flex items-center justify-between"},v={key:0},b={key:0},h=Y(S({name:"CrmCustomerPoolConfig",__name:"index",setup(ra){const C=oa(),{t:z}=X(),u=_(!1),a=_({enabled:!1,contactExpireDays:void 0,dealExpireDays:void 0,notifyEnabled:!1,notifyDays:void 0}),U=J({enabled:[{required:!0,message:"\u662F\u5426\u542F\u7528\u5BA2\u6237\u516C\u6D77\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}),c=_(),g=async()=>{try{u.value=!0;const r=await(async()=>await E.get({url:"/crm/customer-pool-config/get"}))();if(r===null)return;a.value=r}finally{u.value=!1}},k=async()=>{if(c&&await c.value.validate()){u.value=!0;try{const r=a.value;await(async s=>await E.put({url:"/crm/customer-pool-config/save",data:s}))(r),C.success(z("common.updateSuccess")),await g(),u.value=!1}finally{u.value=!1}}},q=()=>{a.value.enabled||(a.value.contactExpireDays=void 0,a.value.dealExpireDays=void 0,a.value.notifyEnabled=!1,a.value.notifyDays=void 0)},P=()=>{a.value.notifyEnabled||(a.value.notifyDays=void 0)};return T(()=>{g()}),(r,s)=>{const G=B,i=F,x=I,m=L,f=N,H=ea,R=O,j=$,K=W("hasPermi"),M=Q;return d(),y(j,null,{default:l(()=>[w((d(),y(R,{ref_key:"formRef",ref:c,model:e(a),rules:e(U),"label-width":"160px"},{default:l(()=>[t(H,{shadow:"never"},{header:l(()=>[A("div",p,[t(e(ta),{title:"\u5BA2\u6237\u516C\u6D77\u89C4\u5219\u8BBE\u7F6E"}),w((d(),y(G,{type:"primary",onClick:k},{default:l(()=>[n(" \u4FDD\u5B58 ")]),_:1})),[[K,["crm:customer-pool-config:update"]]])])]),default:l(()=>[t(m,{label:"\u5BA2\u6237\u516C\u6D77\u89C4\u5219\u8BBE\u7F6E",prop:"enabled"},{default:l(()=>[t(x,{modelValue:e(a).enabled,"onUpdate:modelValue":s[0]||(s[0]=o=>e(a).enabled=o),onChange:q,class:"ml-4"},{default:l(()=>[t(i,{label:!1,size:"large"},{default:l(()=>[n("\u4E0D\u542F\u7528")]),_:1}),t(i,{label:!0,size:"large"},{default:l(()=>[n("\u542F\u7528")]),_:1})]),_:1},8,["modelValue"])]),_:1}),e(a).enabled?(d(),V("div",v,[t(m,null,{default:l(()=>[t(f,{class:"mr-2",modelValue:e(a).contactExpireDays,"onUpdate:modelValue":s[1]||(s[1]=o=>e(a).contactExpireDays=o)},null,8,["modelValue"]),n(" \u5929\u4E0D\u8DDF\u8FDB\u6216 "),t(f,{class:"mx-2",modelValue:e(a).dealExpireDays,"onUpdate:modelValue":s[2]||(s[2]=o=>e(a).dealExpireDays=o)},null,8,["modelValue"]),n(" \u5929\u672A\u6210\u4EA4 ")]),_:1}),t(m,{label:"\u63D0\u524D\u63D0\u9192\u8BBE\u7F6E",prop:"notifyEnabled"},{default:l(()=>[t(x,{modelValue:e(a).notifyEnabled,"onUpdate:modelValue":s[3]||(s[3]=o=>e(a).notifyEnabled=o),onChange:P,class:"ml-4"},{default:l(()=>[t(i,{label:!1,size:"large"},{default:l(()=>[n("\u4E0D\u63D0\u9192")]),_:1}),t(i,{label:!0,size:"large"},{default:l(()=>[n("\u63D0\u9192")]),_:1})]),_:1},8,["modelValue"])]),_:1}),e(a).notifyEnabled?(d(),V("div",b,[t(m,null,{default:l(()=>[n(" \u63D0\u524D "),t(f,{class:"mx-2",modelValue:e(a).notifyDays,"onUpdate:modelValue":s[4]||(s[4]=o=>e(a).notifyDays=o)},null,8,["modelValue"]),n(" \u5929\u63D0\u9192 ")]),_:1})])):D("",!0)])):D("",!0)]),_:1})]),_:1},8,["model","rules"])),[[M,e(u)]])]),_:1})}}}),[["__file","/Users/RuHu.Xu/Desktop/mall-newfeifan-zx-admin/src/views/crm/customer/poolConfig/index.vue"]])});export{ua as __tla,h as default};
