import{T as A,E as D}from"./style-fcbebc34.js";import{u as T}from"./useFormEdit-3c660b22.js";import{d as R,O as Y,u as I,aE as M,f as N,p as l,az as U,ad as z,r as O,o as H,y as L,i as b,a as j,c as q,j as a,k as i,e as s,a4 as F,n as G,l as J,m as y,v as E,au as K,_ as $}from"./index-deffec86.js";import"./tabs-96386b59.js";const P={id:"editor-main-container"},Q={class:"toolbar-container"},W={id:"content"},X={id:"editor-container"},Z={id:"title-container"},ee={id:"editor-text-area"},te={class:"form-container"},oe={class:"button"},le=R({__name:"wordEdit",props:{value:String},emits:["update:value"],setup(ae,{emit:ne}){const f=Y();I();const{closeCurrent:B,ruleFormRef:re,setTitle:ue}=T(),d=M(),p=N(()=>d.themeConfig),x=()=>{d.setThemeConfig({...p.value,maximize:!0})},v=()=>{d.setThemeConfig({...p.value,maximize:!1})};x();const _=()=>{v(),B()},r=l(""),g=l(""),k=()=>{let e={title:r.value,content:u.value};localStorage.setItem(g.value,JSON.stringify(e)),_()},u=l(""),m=U();l(null),l(null),l(null);const C={};C.excludeKeys=["insertVideo","codeBlock","group-video","fullScreen","insertLink"];const w={scroll:!1,placeholder:"\u8BF7\u8F93\u5165\u5185\u5BB9...",MENU_CONF:{lineHeight:{lineHeightList:["1","1.5","2","2.5"]},uploadImage:{async customUpload(e,t){const o=new FileReader;o.readAsDataURL(e),o.onload=async c=>{const n=new FormData;n.append("image",e);try{const{data:h}=await K(n);t(h.imgUrl)}catch{}}}}}};z(()=>{const e=m.value;e!=null&&(e.destroy(),v())});const V=e=>{m.value=e},S=e=>{};return l([]),l([]),O({type:"",tag_ids:""}),H(async()=>{let e=f.query.title;r.value=e;let t=f.query.type;g.value=t;let o="";switch(t){case"saihuiAdd":o=localStorage.getItem("saihuiContent");break;case"evntAdd":o=localStorage.getItem("evntContent");break;case"noticeAdd":o=localStorage.getItem("noticeContent");break}await L(),u.value=o}),(e,t)=>{const o=b("el-input"),c=b("el-button");return j(),q("div",P,[a("div",Q,[i(s(A),{editor:s(m),defaultConfig:C},null,8,["editor"])]),a("div",W,[a("div",X,[a("div",Z,[i(o,{modelValue:s(r),"onUpdate:modelValue":t[0]||(t[0]=n=>F(r)?r.value=n:null),type:"textarea",class:"textarea",autosize:"",placeholder:"\u8BF7\u8F93\u5165\u6587\u7AE0\u7684\u6807\u9898",maxlength:"50","show-word-limit":""},null,8,["modelValue"])]),a("div",ee,[i(s(D),{modelValue:s(u),"onUpdate:modelValue":t[1]||(t[1]=n=>F(u)?u.value=n:null),defaultConfig:w,onOnCreated:V,onOnChange:S,id:"editor",style:{background:"#ffffff"}},null,8,["modelValue"])]),a("div",te,[G(e.$slots,"default",{},void 0,!0),J(` <el-form ref="form" label-position="left" label-width="120px">\r
						<el-form-item label="\u7C7B\u578B">\r
							<el-select v-model="form.type" placeholder="\u9009\u62E9\u7C7B\u578B" class="w-280">\r
								<el-option v-for="item in options" :key="item.value" :label="item.text" :value="item.value" />\r
							</el-select>\r
						</el-form-item>\r
						<el-form-item label="\u6807\u7B7E">\r
							<el-select v-model="form.tag_ids" placeholder="\u8BF7\u9009\u62E9\u6807\u7B7E" class="w-280">\r
								<el-option v-for="(item, index) in labels" :key="index" :label="item" :value="item" />\r
							</el-select>\r
						</el-form-item>\r
						<el-form-item label="\u7F51\u5740">\r
							<el-input v-model="form.url" placeholder="\u8F93\u5165\u94FE\u63A5\u4EE5\u5F15\u7528\u516C\u4F17\u53F7\u6587\u7AE0,\u542F\u7528\u94FE\u63A5\u5C06\u5BFC\u81F4\u6B63\u6587\u5931\u6548" />\r
						</el-form-item>\r
						<el-form-item label="\u53D1\u5E03\u65F6\u95F4">\r
							<el-date-picker\r
								v-model="form.released_time"\r
								align="right"\r
								type="datetime"\r
								placeholder="\u9009\u62E9\u65E5\u671F"\r
								format="YYYY-MM-DD"\r
								value-format="YYYY-MM-DD"\r
							/>\r
						</el-form-item>\r
				\r
					</el-form> `)])]),a("div",oe,[a("div",null,[i(c,{type:"primary",onClick:k},{default:y(()=>t[2]||(t[2]=[E("\u7ACB\u5373\u521B\u5EFA")])),_:1}),i(c,{onClick:_},{default:y(()=>t[3]||(t[3]=[E("\u8FD4\u56DE")])),_:1})])])])])}}});const ce=$(le,[["__scopeId","data-v-d0e307be"]]);export{ce as default};
