import{d as P,r as E,G as z,u as K,a as j,a0 as H,b as O,e as r,o as y,f as C,w as t,g as l,h as D,N as f,O as _,p as g,n as F,Z as W,l as d,c as $,L as G,M as J,I as Z,K as A,_ as Q}from"./index-17740f03-1778929502341v=1.0.0.js";import{a as X,u as ee,g as le,b as te}from"./notice-0b4ec155-1778929502341v=1.0.0.js";import{W as ue}from"./index-ea94a5ac-1778929502341v=1.0.0.js";import{b as ae}from"./notice-847dc2d6-1778929502341v=1.0.0.js";import{T as oe,K as se}from"./tabs-07c00c0d-1778929502341v=1.0.0.js";import ie from"./CardContainer-c82d3266-1778929502341v=1.0.0.js";import ne from"./UploadData-2cbd129b-1778929502341v=1.0.0.js";const re={class:"CardContainer"},de={class:"button"},me="\u9009\u586B\uFF0C\u6458\u8981\u4F1A\u5728\u7528\u6237\u7AEF\u901A\u77E5\u3001\u8F6C\u53D1\u94FE\u63A5\u7B49\u6587\u7AE0\u5916\u7684\u573A\u666F\u663E\u9732\uFF0C\u5E2E\u52A9\u8BFB\u8005\u5FEB\u901F\u4E86\u89E3\u5185\u5BB9\uFF0C\u5982\u4E0D\u586B\u5199\u5219\u9ED8\u8BA4\u6293\u53D6\u6B63\u6587\u524D54\u5B57",pe=P({__name:"detail",setup(fe){const m=E({xs:18,sm:18,md:18,lg:18,xl:18}),U=oe(),Y=se(),v=z(),w=K(),M=j(()=>v.query.notice_help_id),u=E({author:"",content:"",title:"",des:"",imgList:[],abstract:"",is_remind:1,is_valid:1,is_top:1,involve_business:"",attachments:[],releaseTime:[]}),x=E(),T=E([]),N=async i=>{if(i!="draft")try{await x.value.validate(),L()}catch(e){console.error("error",e)}else L()},L=async i=>{let e={...u.value};if(e.cover_img=e.imgList.length?e.imgList.map(s=>s.url).join(","):"",e.valid_start_time=e.releaseTime[0],e.valid_end_time=e.releaseTime[1],e.status=1,e.type=1,delete e.releaseTime,delete e.imgList,e.attachments.length){let s=!1,c=!1;if(e.attachments.forEach(n=>{n.file_url||(s=!0),n.name||(c=!0)}),s){A({type:"warning",message:"\u8BF7\u4E0A\u4F20\u6587\u4EF6"});return}if(c){A({type:"warning",message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u540D\u79F0"});return}let V=e.attachments.map(n=>{const{name:b,file_url:B}=n;return{file_url:B,name:b}});e.attachments=JSON.stringify(V)}else e.attachments="";let p=v.query.op,o={};p=="add"?o=await X(e):p=="edit"&&(e.status=2,o=await ee(e)),o.code==200?(A.success("\u4FDD\u5B58\u6210\u529F"),setTimeout(()=>{Y.removeKeepAliveName(v.name),U.removeTabs(v.fullPath),w.push({name:"noticeManageIndex"})},500)):A.error(o.message)},R=async()=>{let i=await le();T.value=i.data.map(e=>({label:e.des,value:e.involve_business}))},h=async i=>{try{let{data:e}=await te({notice_help_id:i});u.value.imgList=e.cover_img?[{url:e.cover_img}]:[],u.value.releaseTime=[e.valid_start_time?e.valid_start_time:"",e.valid_end_time?e.valid_end_time:""],u.value.attachments=(e.attachments||[]).map(p=>({file_url:p.file_url,name:p.name})),u.value={...u.value,...e}}catch{}};return H(()=>M.value,(i,e)=>{i&&i!=e&&h(i)},{immediate:!0}),O(()=>{R()}),(i,e)=>{const p=r("el-input"),o=r("el-form-item"),s=r("FormCol"),c=r("el-option"),V=r("el-select"),n=r("el-radio"),b=r("el-radio-group"),B=r("el-date-picker"),S=r("FormRow"),k=r("el-button"),q=r("el-form");return y(),C(Z,null,{default:t(()=>[l(q,{ref_key:"formRef",ref:x,rules:D(ae),model:u.value,"label-position":"right","label-width":"120px"},{default:t(()=>[l(S,null,{default:t(()=>[l(s,f(_(m.value)),{default:t(()=>[l(o,{label:"\u6807\u9898:",prop:"title"},{default:t(()=>[l(p,{modelValue:u.value.title,"onUpdate:modelValue":e[0]||(e[0]=a=>u.value.title=a),type:"textarea",placeholder:"\u8BF7\u8F93\u5165\u6807\u9898",count:"",maxlength:"64","show-word-limit":""},null,8,["modelValue"])]),_:1})]),_:1},16),g(` <FormCol v-bind="maxLine">\r
					<el-form-item label="\u4F5C\u8005:" prop="author">\r
						<el-input v-model="form.author" placeholder="\u8BF7\u8F93\u5165\u4F5C\u8005" maxlength="15" />\r
					</el-form-item>\r
				</FormCol> `),l(s,f(_(m.value)),{default:t(()=>[l(o,{label:"\u6B63\u6587:",prop:"content"},{default:t(()=>[l(ue,{value:u.value.content,"onUpdate:value":e[1]||(e[1]=a=>u.value.content=a),title:u.value.title,"onUpdate:title":e[2]||(e[2]=a=>u.value.title=a),hideToolBar:!1,showEditorAll:!0,height:"300px",titleLimit:64},null,8,["value","title"])]),_:1})]),_:1},16),l(s,f(_(m.value)),{default:t(()=>[l(o,{label:"\u9644\u4EF6\u4E0A\u4F20:"},{default:t(()=>[F("div",re,[l(ie,{class:"mb20"},{default:t(()=>[l(ne,{ref:"mediaDataRef",value:u.value.attachments,"onUpdate:value":e[3]||(e[3]=a=>u.value.attachments=a),isEdit:D(v).query.op!=="detail"},null,8,["value","isEdit"]),g(' <el-empty v-if="showEmpty(form.attachments)" :image-size="60"></el-empty> ')]),_:1})])]),_:1})]),_:1},16),l(s,f(_(m.value)),{default:t(()=>[l(o,{label:"\u5C01\u9762:",prop:"imgList"},{default:t(()=>[l(W,{limit:1,fileList:u.value.imgList,"onUpdate:fileList":e[4]||(e[4]=a=>u.value.imgList=a),"file-size":5},null,8,["fileList"])]),_:1}),l(o,null,{default:t(()=>e[13]||(e[13]=[F("div",{class:"img_tips"},[F("span",null,[d("\u53EA\u80FD\u4E0A\u4F20.png/.jpg/.gif\u6587\u4EF6,\u4E14\u4E0D\u8D85\u8FC7 "),F("span",{class:"fail"},"5M"),d(" \u3002")])],-1)])),_:1})]),_:1},16),l(s,f(_(m.value)),{default:t(()=>[l(o,{label:"\u6458\u8981:",prop:"abstract"},{default:t(()=>[l(p,{modelValue:u.value.abstract,"onUpdate:modelValue":e[5]||(e[5]=a=>u.value.abstract=a),type:"textarea",placeholder:me,autosize:{minRows:4,maxRows:6},count:"",maxlength:"120","show-word-limit":""},null,8,["modelValue"])]),_:1})]),_:1},16),l(s,null,{default:t(()=>[l(o,{label:"\u6D89\u53CA\u4E1A\u52A1:",prop:"involve_business"},{default:t(()=>[l(V,{modelValue:u.value.involve_business,"onUpdate:modelValue":e[6]||(e[6]=a=>u.value.involve_business=a),placeholder:"\u8BF7\u9009\u62E9\u6D89\u53CA\u4E1A\u52A1",class:"w-280",clearable:""},{default:t(()=>[(y(!0),$(G,null,J(T.value,(a,I)=>(y(),C(c,{key:I,label:a.label,value:a.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l(s,f(_(m.value)),{default:t(()=>[l(o,{label:"\u662F\u5426\u5F39\u7A97\u63D0\u9192:",prop:"is_remind"},{default:t(()=>[l(b,{modelValue:u.value.is_remind,"onUpdate:modelValue":e[7]||(e[7]=a=>u.value.is_remind=a)},{default:t(()=>[l(n,{label:1},{default:t(()=>e[14]||(e[14]=[d("\u662F")])),_:1}),l(n,{label:0},{default:t(()=>e[15]||(e[15]=[d("\u5426")])),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1},16),l(s,null,{default:t(()=>[l(o,{label:"\u751F\u6548\u65E5\u671F:",prop:"releaseTime"},{default:t(()=>[l(B,{modelValue:u.value.releaseTime,"onUpdate:modelValue":e[8]||(e[8]=a=>u.value.releaseTime=a),type:"daterange","range-separator":"\u81F3","start-placeholder":"\u5F00\u59CB\u65E5\u671F","end-placeholder":"\u7ED3\u675F\u65E5\u671F","value-format":"YYYY-MM-DD",format:"YYYY-MM-DD"},null,8,["modelValue"]),g(' value-format="YYYY-MM-DD HH:mm:ss" ')]),_:1})]),_:1}),l(s,f(_(m.value)),{default:t(()=>[l(o,{label:"\u662F\u5426\u751F\u6548:",prop:"is_valid"},{default:t(()=>[l(b,{modelValue:u.value.is_valid,"onUpdate:modelValue":e[9]||(e[9]=a=>u.value.is_valid=a)},{default:t(()=>[l(n,{label:1},{default:t(()=>e[16]||(e[16]=[d("\u662F")])),_:1}),l(n,{label:0},{default:t(()=>e[17]||(e[17]=[d("\u5426")])),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1},16),l(s,f(_(m.value)),{default:t(()=>[l(o,{label:"\u662F\u5426\u7F6E\u9876:",prop:"is_top"},{default:t(()=>[l(b,{modelValue:u.value.is_top,"onUpdate:modelValue":e[10]||(e[10]=a=>u.value.is_top=a)},{default:t(()=>[l(n,{label:1},{default:t(()=>e[18]||(e[18]=[d("\u662F")])),_:1}),l(n,{label:0},{default:t(()=>e[19]||(e[19]=[d("\u5426")])),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1},16)]),_:1}),F("div",de,[F("div",null,[l(k,{onClick:e[11]||(e[11]=a=>D(w).back())},{default:t(()=>e[20]||(e[20]=[d("\u53D6\u6D88")])),_:1}),g(` <el-button v-if="route.query.op !== 'detail'" @click="handleSubmit('draft')">\u4FDD\u5B58\u4E3A\u8349\u7A3F</el-button> `),D(v).query.op!=="detail"?(y(),C(k,{key:0,type:"primary",onClick:e[12]||(e[12]=a=>N("submit"))},{default:t(()=>e[21]||(e[21]=[d("\u63D0\u4EA4")])),_:1})):g("v-if",!0)])])]),_:1},8,["rules","model"])]),_:1})}}});const ye=Q(pe,[["__scopeId","data-v-b9b611e8"]]);export{ye as default};
