1 |
- import{d as m,ah as p,ag as f,R as y,r as _,$ as v,m as u,c as t,aj as F,q as s,B,o as i}from"./index.5f7ffb46.js";import{O as I}from"./index.623dc134.js";import{a as U}from"./toolsValidate.4388d7ee.js";import{F as n}from"./index.6438a25f.js";import"./index.36e5ddaf.js";import"./index.4f3f29e9.js";import"./ImagePreview.289405c5.js";import"./index.99e0cf1f.js";import"./index.276a5d68.js";import"./function-call.aca3a7bc.js";import"./index.abd668f7.js";const g="_addInformation_fp5d5_1",k="_title_fp5d5_4",h="_icon_fp5d5_12",O="_icon1_fp5d5_18",T="_icon2_fp5d5_22",V="_icon3_fp5d5_26",w="_icon4_fp5d5_30",A="_upload_fp5d5_34",q="_field_fp5d5_39";var o={addInformation:g,title:k,icon:h,icon1:O,icon2:T,icon3:V,icon4:w,upload:A,field:q},M=m({name:"add-information",props:{selectType:{type:String,default:"add"},selectItem:{type:Object,default:{}}},emits:["close","getList"],setup(N,{emit:C}){const a=p(),c=f(),r=y("\u6DFB\u52A0\u8D44\u8BAF"),e=_({type:"HOT_CONSULTATION",clientType:"SCHOOL",coverImage:null,title:null,linkUrl:"",linkType:"OUT",summary:null}),d=async()=>{if(e.coverImage)if(e.title)if(e.summary)if(e.linkUrl){if(!U(e.linkUrl)){i("\u94FE\u63A5\u8F93\u5165\u6709\u8BEF");return}}else{i("\u8BF7\u8F93\u5165\u94FE\u63A5");return}else{i("\u8BF7\u8F93\u5165\u5185\u5BB9\u7B80\u4ECB");return}else{i("\u8BF7\u8F93\u5165\u8D44\u8BAF\u6807\u9898");return}else{i("\u8BF7\u4E0A\u4F20\u5C01\u9762\u56FE\u7247");return}try{a.query.id?await u.post("/api-school/sysNewsInformation/update",{data:{...e,id:a.query.id}}):await u.post("/api-school/sysNewsInformation/save",{data:{...e}}),c.back()}catch{}};return v(async()=>{if(a.query.id){r.value="\u7F16\u8F91\u8D44\u8BAF";const{data:l}=await u.get("/api-school/sysNewsInformation/detail/"+a.query.id);console.log(l),e.linkUrl=l.linkUrl,e.coverImage=l.coverImage,e.summary=l.summary,e.title=l.title}}),()=>t("div",{class:o.addInformation},[t(F,{title:r.value,desotry:!1},null),t("div",{class:o.title},[t("i",{class:[o.icon,o.icon1]},null),s("\u8BF7\u4E0A\u4F20\u5C01\u9762\u56FE\u7247")]),t(I,{class:o.upload,modelValue:e.coverImage,"onUpdate:modelValue":l=>e.coverImage=l},null),t("div",{class:o.title},[t("i",{class:[o.icon,o.icon2]},null),s("\u8D44\u8BAF\u6807\u9898")]),t(n,{placeholder:"\u8BF7\u8F93\u5165\u8D44\u8BAF\u6807\u9898",class:o.field,modelValue:e.title,"onUpdate:modelValue":l=>e.title=l,autofocus:!1},null),t("div",{class:o.title},[t("i",{class:[o.icon,o.icon3]},null),s("\u5185\u5BB9\u7B80\u4ECB")]),t(n,{placeholder:"\u8BF7\u8F93\u5165\u8D44\u8BAF\u5185\u5BB9\u7B80\u8981\u6982\u8FF0",type:"textarea",rows:2,class:o.field,modelValue:e.summary,"onUpdate:modelValue":l=>e.summary=l,autofocus:!1},null),t("div",{class:o.title},[t("i",{class:[o.icon,o.icon4]},null),s("\u6DFB\u52A0\u94FE\u63A5")]),t(n,{placeholder:"\u8BF7\u8F93\u5165\u94FE\u63A5",class:o.field,modelValue:e.linkUrl,"onUpdate:modelValue":l=>e.linkUrl=l},null),t("div",{class:"btnGroup",style:{marginTop:"24px"}},[t(B,{type:"primary",block:!0,round:!0,onClick:d},{default:()=>[a.query.id?"\u786E\u8BA4\u4FEE\u6539":"\u53D1\u5E03\u8D44\u8BAF"]})])])}});export{M as default};
|