import{_ as e,r as a,b as o,s,o as t,d as l,e as r,f as i,g as d,i as m,h as n,w as c,j as p,k as u,n as v,E as f,q as b}from"./index.286e9b79.js";import{v as j}from"./loading.c49775a6.js";import{E as g,a as y}from"./form.ad10dcd5.js";import{E as h,a as x}from"./tab-pane.1cc0f769.js";import"./form-item.9355e6dc.js";import{E as _}from"./input.31de1b37.js";import{_ as V}from"./material.90ee622d.js";import{_ as w}from"./page-header.29890ed0.js";import{g as C,p as E}from"./http.f588794f.js";/* empty css              */import{T as k,E as U}from"./index.esm.68db7469.js";import"./_initCloneObject.fb8fbaea.js";import"./strings.8c60bfae.js";import"./event.776e7e11.js";import"./index.ed3ed02e.js";import"./pagination.22bb50f6.js";import"./select.297a82d5.js";import"./index.27150c7e.js";import"./token.34cb8214.js";import"./isEqual.57d72c4a.js";import"./scroll.a50153b5.js";import"./_baseIteratee.9ead53a1.js";import"./debounce.caafe00b.js";/* empty css            */import"./image-viewer.b538fe01.js";import"./position.1bd00850.js";import"./progress.27d0e11c.js";import"./cloneDeep.15b627aa.js";import"./dialog.ec9503d2.js";import"./overlay.2c1583ac.js";import"./message-box.6a8eb828.js";import"./validator.18338d56.js";import"./divider.948c4b18.js";const q={class:"editor-card"},I={class:"editor-card-box"},K={style:{border:"1px solid #ccc"}},O={class:"tool"},D={class:"tool-box"},F=e({__name:"service",setup(e){let F=a(!1),H=a(!1),L=a("0"),R=a(),T=o({service:{title:"",content:""}});const z=s(),A=a("default"),B={excludeKeys:["group-image","group-video","insertLink"],insertKeys:{index:22,keys:["my-images"]}},G={placeholder:"请输入内容..."};let J=a(!1),M=a(0);const N=e=>{z.value=e,e.on("event-images",(function(){J.value=!0,M.value=1}))},P=e=>{J.value=!1,e.forEach((e=>{z.value.dangerouslyInsertHtml('<p><img src="'+e.photo+'"></p>')}))};t((()=>{const e=z.value;null!=e&&e.destroy()}));const Q=()=>{M.value=0},S=o({title:[{required:!0,message:"请输入名称",trigger:"blur"}]});H.value=!0,C("system.system/service").then((e=>{H.value=!1,e.code&&(T.service=e.data)}));const W=async()=>{R.value&&await R.value.validate(((e,a)=>{H.value=!1,e?(H.value=!0,E("system.system/service",T).then((e=>{H.value=!1,e.code?f.success("操作成功"):f.error(e.msg)})).catch((e=>{f.error(e)}))):f.error("请完善内容")}))};return(e,a)=>{const o=w,s=V,t=_,f=g,C=h,E=x,M=y,X=b,Y=j;return l(),r("div",null,[i(o,{title:"服务协议"}),i(s,{modelValue:d(J),"onUpdate:modelValue":a[0]||(a[0]=e=>m(J)?J.value=e:J=e),onChange:P,onClose:Q},null,8,["modelValue"]),n("div",q,[c((l(),p(M,{model:d(T).service,rules:d(S),ref_key:"ruleFormRef",ref:R},{default:u((()=>[n("div",I,[i(E,{modelValue:d(L),"onUpdate:modelValue":a[3]||(a[3]=e=>m(L)?L.value=e:L=e)},{default:u((()=>[i(C,{label:"基本信息",name:"0"},{default:u((()=>[i(f,{label:"协议名称",prop:"title","label-width":"100px"},{default:u((()=>[i(t,{modelValue:d(T).service.title,"onUpdate:modelValue":a[1]||(a[1]=e=>d(T).service.title=e),"show-word-limit":"",maxlength:"20"},null,8,["modelValue"])])),_:1}),i(f,{label:"内容","label-width":"100px"},{default:u((()=>[n("div",K,[i(d(k),{style:{"border-bottom":"1px solid #ccc"},editor:d(z),defaultConfig:B,mode:d(A)},null,8,["editor","mode"]),i(d(U),{style:{height:"500px","overflow-y":"hidden"},modelValue:d(T).service.content,"onUpdate:modelValue":a[2]||(a[2]=e=>d(T).service.content=e),defaultConfig:G,mode:d(A),onOnCreated:N},null,8,["modelValue","mode"])])])),_:1})])),_:1})])),_:1},8,["modelValue"])])])),_:1},8,["model","rules"])),[[Y,d(F)]])]),n("div",O,[n("div",D,[i(X,{type:"primary",loading:d(H),onClick:W},{default:u((()=>[v("保存")])),_:1},8,["loading"])])])])}}},[["__scopeId","data-v-b89ec0c4"]]);export{F as default};
