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