PageSourceSearch

https://portal.igpublish.com.cn/assets/Highlights-fOjEHh_f.js

js igpublish.com.cn collected 2026-10-08 03:07:24 UTC 6,205 bytes, 1 lines download raw bytes

1import{t as J,p as K,o as j,E as M,Y as q,d as G,a as Q}from"./element-plus-Bywy5oHq.js";import{aC as V,aF as m}from"./vendor-C0Uurid2.js";import{M as W,L as X,S as k,bb as H,_ as E,bc as Z,bd as ee}from"./index-C5pP5APy.js";import{z as B,f as _,w as te,A as b,B as v,C as n,aa as g,y as d,I as o,a1 as w,N as ae,O as se,h as le,K as ne,v as oe,J as ie,ab as re,as as de}from"./vue-vendor-L-FQkbel.js";import"./utils-DEfGBLaJ.js";const ce={class:"banner-card"},pe={class:"banner-header"},ue={for:"highlight-publish-switch",class:"sr-only"},he={id:"highlight-publish-label",class:"sr-only"},ge={class:"accessible-dropdown-trigger link",style:{"font-weight":"bold",cursor:"pointer",padding:"4px"},role:"button","aria-expanded":"false","aria-label":"more options"},me={style:{color:"#CE5151"}},_e={style:{padding:"10px 10px"}},be={class:"banner-footer",role:"button","aria-label":"Select expiration date"},fe={class:"display-text"},xe={key:1,style:{display:"flex","align-items":"center"}},ve={class:"display-text"},ye=B({__name:"HightlightCard",props:{id:{},contents:{default:""},publish:{type:Boolean,default:!1},expirationDate:{default:""}},emits:["update:description","update:contents","update:publish","update:expirationDate","delete"],setup(C,{emit:c}){const{t}=V(),Y=_(!1),i=C,r=c,f=_(i.publish),x=_(i.contents),p=_(i.expirationDate?new Date(i.expirationDate):null),e=_(!i.expirationDate),a=_(!1);te(f,l=>{s(),r("update:publish",l)});const y=()=>{s(),r("update:contents",x.value),Y.value=!1},s=()=>{const l={id:i.id||"",contents:x.value,publish:f.value,expirationDate:e.value?null:p.value?m(p.value).format("YYYY-MM-DD"):null};H(l).then(h=>{M({type:"success",message:h.msg})})},u=le(()=>e.value?t("preference.home-bg-display-always"):p.value?m(p.value).format("MMM DD, YYYY"):t("preference.home-bg-display-always")),I=()=>{a.value=!0},U=l=>{l||(a.value=!1)},S=l=>{l?(e.value=!1,s(),r("update:expirationDate",m(l).format("YYYY-MM-DD"))):(e.value=!0,s(),r("update:expirationDate",null))},$=l=>l.getDate()<new Date().getDate(),A=[{text:t("preference.home-bg-display-always"),value:()=>(e.value=!0,r("update:expirationDate",null),null)},{text:t("preference.home-bg-display-x-days",7),value:()=>(e.value=!1,m(new Date).add(7,"days").toDate())},{text:t("preference.home-bg-display-x-days",30),value:()=>(e.value=!1,m(new Date).add(30,"days").toDate())},{text:t("preference.home-bg-display-x-years",1),value:()=>(e.value=!1,m(new Date).add(1,"year").toDate())}],N=l=>{l==="edit"?Y.value=!0:l==="archive"?console.log("archive"):l==="delete"&&r("delete")};return(l,h)=>{const O=J,P=ne("more-filled"),z=K,T=X,F=W,L=j,R=q;return b(),v("div",ce,[n("div",pe,[n("label",ue,g(d(t)("message.publish")),1),o(O,{id:"highlight-publish-switch",class:"no-high-contrast",modelValue:f.value,"onUpdate:modelValue":h[0]||(h[0]=D=>f.value=D),disabled:!i.contents,"active-text":d(t)("message.publish"),"inactive-text":"",size:"small","aria-labelledby":"highlight-publish-label"},null,8,["modelValue","disabled","active-text"]),n("span",he,g(d(t)("message.publish")),1),o(F,{onCommand:N},{trigger:w(()=>[n("span",ge,[o(z,{class:"el-icon--right",style:{"vertical-align":"top"},"aria-hidden":"true"},{default:w(()=>[o(P)]),_:1})])]),items:w(()=>[o(T,{command:"delete",role:"menuitem"},{default:w(()=>[n("span",me,g(d(t)("message.delete")),1)]),_:1})]),_:1})]),n("div",_e,[o(L,{modelValue:x.value,"onUpdate:modelValue":h[1]||(h[1]=D=>x.value=D),autosize:{minRows:4,maxRows:20},placeholder:d(t)("message.please-input"),"show-word-limit":"",type:"textarea",onBlur:y},null,8,["modelValue","placeholder"])]),n("div",be,[a.value?(b(),v("div",xe,[o(k,{name:"calendar",style:{width:"14px",height:"14px",color:"var(--color-text-blue)","margin-right":"5px"},"aria-hidden":"true"}),n("span",ve,g(d(t)("preference.home-bg-display-date"))+": ",1)])):(b(),v("div",{key:0,onClick:I,style:{cursor:"pointer",display:"flex","align-items":"center"},tabindex:"0"},[o(k,{name:"calendar",style:{width:"14px",height:"14px",color:"var(--color-text-blue)","margin-right":"5px"},"aria-hidden":"true"}),n("span",fe,g(d(t)("preference.home-bg-display-date"))+": "+g(u.value),1)])),a.value?(b(),ae(R,{key:2,modelValue:p.value,"onUpdate:modelValue":h[2]||(h[2]=D=>p.value=D),type:"date",editable:!1,"disabled-date":$,format:"MMM DD, YYYY",shortcuts:A,"popper-class":"date-picker-popper text-date-picker",onChange:S,onVisibleChange:U,"aria-label":"Highlight expiration date picker"},null,8,["modelValue"])):se("",!0)])])}}}),De=E(ye,[["__scopeId","data-v-b7d0606d"]]),we={class:"section",role:"region","aria-label":"Highlights Section"},Ye={class:"section-title",role:"heading","aria-level":"1"},Ce={style:{flex:"1","text-align":"right"}},ke={class:"section-content",role:"list","aria-label":"Highlights list"},Me=B({__name:"Highlights",setup(C){const{t:c}=V(),t=_([]),Y=()=>{H({id:"",contents:"",publish:!1,isNew:!0}).then(a=>{r()})},i=e=>{Q.confirm(c("message.confirm-delete"),c("message.confirm"),{confirmButtonText:c("message.delete"),cancelButtonText:c("message.cancel"),type:"warning"}).then(()=>{ee(e.id).then(a=>{const y=t.value.findIndex(s=>s.id===e.id);t.value.splice(y,1),M({type:"success",message:a.msg})})}).catch(()=>{})},r=()=>{Z({}).then(e=>{t.value=e.data,t.value.forEach(a=>
1{a.expirationDate&&(a.expirationDate=m(a.expirationDate).format("YYYY-MM-DD"))})})},f=(e,a)=>{e.contents=a},x=(e,a)=>{e.publish=a},p=(e,a)=>{e.expirationDate=a};return oe(()=>{r()}),(e,a)=>{const y=G;return b(),v("div",we,[n("h1",Ye,g(d(c)("home.sections-highlight")),1),n("div",Ce,[o(y,{type:"primary",round:"",icon:"plus",onClick:Y,"aria-label":"Add new highlight"},{default:w(()=>[de(g(d(c)("message.add")),1)]),_:1})]),n("div",ke,[(b(!0),v(ie,null,re(t.value,s=>(b(),v("div",{key:s.id||"new-"+Math.random(),style:{"margin-top":"20px"},role:"listitem"},[o(De,{id:s.id,contents:s.contents,publish:s.publish,"expiration-date":s.expirationDate,onDelete:u=>i(s),"onUpdate:contents":u=>f(s,u),"onUpdate:publish":u=>x(s,u),"onUpdate:expirationDate":u=>p(s,u)},null,8,["id","contents","publish","expiration-date","onDelete","onUpdate:contents","onUpdate:publish","onUpdate:expirationDate"])]))),128))])])}}}),Ue=E(Me,[["__scopeId","data-v-4e81e7b1"]]);export{Ue as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.