PageSourceSearch

https://portal.igpublish.com.cn/assets/Notifications-Bsv7CUho.js

js igpublish.com.cn collected 2026-10-08 03:07:26 UTC 15,761 bytes, 1 lines download raw bytes

1import{E as M,p as me,d as ie,u as le,o as ce,w as re,a6 as he,a7 as ge,f as be,U as we}from"./element-plus-Bywy5oHq.js";import{aC as de,aF as j}from"./vendor-C0Uurid2.js";import{z as ue,f as g,B as p,C as o,aa as a,y as n,I as l,a1 as c,O as h,a8 as F,Q as O,K as oe,A as r,as as b,J as L,ab as U,N as I,v as ke,w as xe,P as ae,M as Ce}from"./vue-vendor-L-FQkbel.js";import{bp as pe,_ as fe,b as $e,bq as Ne,S as se,br as Te}from"./index-C5pP5APy.js";import{A as Ve}from"./AccessiblePagination-N2YGDvuA.js";import"./utils-DEfGBLaJ.js";const Ee={style:{"max-width":"700px","margin-bottom":"40px"}},ze={class:"section"},Me={class:"section-title",style:{display:"flex","align-items":"center"}},Se={key:0,style:{"white-space":"nowrap",overflow:"hidden","text-overflow":"ellipsis",display:"inline-block","max-width":"100%"}},He={style:{"font-weight":"bold","font-size":"calc(var(--base-font-size) * 1.25)","margin-left":"10px"}},De={style:{flex:"1","text-align":"right","margin-top":"10px"}},Fe={class:"section"},Oe={class:"sub-section-title section-required"},Ae={class:"section-content"},Be={for:"notification-type-select",class:"sr-only"},Le={class:"section"},Ie={class:"sub-section-title section-required"},Pe={class:"section-content"},Ue={class:"section"},qe={class:"sub-section-title section-required"},Ke={class:"section-content"},Re={style:{flex:"1","text-align":"right","margin-top":"40px"}},Ye=ue({__name:"NotificationEdit",props:{notification:{}},emits:["cancelClicked","saveClicked"],setup(J,{emit:t}){const{t:u}=de(),q=J,A=t,v=g({...q.notification}),y=g(!1),V=g([{value:"transaction",label:u("notification.type-transaction")},{value:"event-notification",label:u("notification.type-event-notification")},{value:"system-notification",label:u("notification.type-system-notification")},{value:"service",label:u("notification.type-service")}]),E=w=>{const i=w.getModule("keyboard");i&&(delete i.bindings[9],i.addBinding({key:9,handler:function(z,C){return!0}}));const k=w.root;k&&k.setAttribute("tabindex","0")},S=()=>{A("cancelClicked")},$=async w=>{if(!y.value&&w==="sent"){if(!v.value.title){M.error(u("message.cannot-be-empty",[u("notification.title")]));return}if(!v.value.contents){M.error(u("message.cannot-be-empty",[u("notification.content")]));return}y.value=!0;try{const i={...v.value};i.status=w;const k=await pe(i);M.success(k.msg),A("saveClicked"),A("cancelClicked")}catch(i){console.error("Save notification error:",i)}finally{y.value=!1}}};return(w,i)=>{const k=oe("ArrowRightBold"),z=me,C=ie,H=re,K=le,T=ce,D=oe("quill-editor");return r(),p("div",Ee,[o("div",ze,[o("div",Me,[o("button",{class:"section-title-hover text-button3",onClick:S,style:{"white-space":"nowrap"}},a(n(u)("notification.notifications")),1),v.value.title?(r(),p("span",Se,[l(z,{size:"12",style:{color:"var(--color-text-7)"}},{default:c(()=>[l(k)]),_:1}),o("span",He,a(v.value.title),1)])):h("",!0)]),o("div",De,[l(C,{style:{width:"80px"},round:"",onClick:S},{default:c(()=>[b(a(n(u)("message.cancel")),1)]),_:1}),l(C,{style:{"min-width":"80px"},type:"primary",round:"",plain:"",onClick:i[0]||(i[0]=f=>$("draft")),loading:y.value},{default:c(()=>[b(a(n(u)("notification.save-as-draft")),1)]),_:1},8,["loading"]),l(C,{style:{"min-width":"80px"},type:"primary",round:"",plain:"",onClick:i[1]||(i[1]=f=>$("sent")),loading:y.value},{default:c(()=>[b(a(n(u)("notification.action-send")),1)]),_:1},8,["loading"])])]),o("div",Fe,[o("div",Oe,a(n(u)("notification.type")),1),o("div",Ae,[o("label",Be,a(n(u)("message.please-select")),1),l(K,{modelValue:v.value.type,"onUpdate:modelValue":i[2]||(i[2]=f=>v.value.type=f),placeholder:n(u)("message.please-select"),style:{width:"200px"},"aria-label":"Notification type",onKeydown:[i[3]||(i[3]=F(O(f=>f.target.click(),["prevent"]),["enter"])),i[4]||(i[4]=F(O(f=>f.target.click(),["prevent"]),["space"]))]},{default:c(()=>[(r(!0),p(L,null,U(V.value,f=>(r(),I(H,{label:f.label,value:f.value,key:f.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])]),o("div",Le,[o("div",Ie,a(n(u)("notification.title")),1),o("div",Pe,[l(T,{modelValue:v.value.title,"onUpdate:modelValue":i[5]||(i[5]=f=>v.value.title=f),style:{width:"100%"},maxlength:"100",placeholder:n(u)("message.please-input")},null,8,["modelValue","placeholder"])])]),o("div",Ue,[o("div",qe,a(n(u)("notification.content")),1),o("div",Ke,[l(D,{class:"my-ql-editor",theme:"snow",contentType:"html",toolbar:"essential",placeholder:n(u)("message.please-input"),content:v.value.contents,"onUpdate:content":i[6]||(i[6]=f=>v.value.contents=f),onReady:E},null,8,["placeholder","content"])])]),o("div",Re,[l(C,{style:{width:"80px"},round:"",onClick:S},{default:c(()=>[b(a(n(u)("message.cancel")),1)]),_:1}),l(C,{style:{"min-width":"80px"},type:"primary",round:"",plain:"",onClick:i[7]||(i[7]=f=>
1$("draft")),loading:y.value},{default:c(()=>[b(a(n(u)("notification.save-as-draft")),1)]),_:1},8,["loading"]),l(C,{style:{"min-width":"80px"},type:"primary",round:"",plain:"",onClick:i[8]||(i[8]=f=>$("sent")),loading:y.value},{default:c(()=>[b(a(n(u)("notification.action-send")),1)]),_:1},8,["loading"])])])}}}),Qe=fe(Ye,[["__scopeId","data-v-565cf3e4"]]),je={key:0,class:"section"},Je={key:0},Ge={style:{display:"flex"}},We={class:"section-title"},Xe={style:{flex:"1","text-align":"right"}},Ze={style:{display:"flex","align-items":"center",margin:"10px 0 10px 0",gap:"20px"}},et={style:{flex:"1"}},tt=["innerHTML"],nt={style:{"text-align":"right","padding-right":"10px"}},ot={for:"notification-type-filter",class:"sr-only"},at=["innerHTML"],st=["onClick"],it={style:{"font-size":"calc(var(--base-font-size) * 0.875)",color:"var(--color-text-4)","line-height":"1.4"}},lt={key:0},ct={class:"text-button"},rt={key:1},dt={class:"text-button"},ut={key:2},pt=["onClick"],ft={key:3},vt={key:1},_t={class:"visually-hidden"},yt={class:"mobile-header"},mt=["innerHTML"],ht={class:"mobile-search-filter"},gt={for:"notification-type-filter",class:"sr-only"},bt={class:"mobile-notifications"},wt={class:"notification-main"},kt={class:"notification-title"},xt={class:"notification-type"},Ct={class:"notification-content"},$t=["innerHTML"],Nt=["onClick"],Tt={class:"notification-footer"},Vt={class:"notification-meta"},Et={class:"notification-date"},zt={class:"notification-time"},Mt={class:"notification-actions"},St=["onClick"],Ht=["onClick"],Dt=["onClick"],Ft={key:0,class:"notification-divider"},Ot={style:{margin:"20px 0","padding-top":"40px",display:"flex","justify-content":"center"}},At=ue({__name:"Notifications",setup(J){const{t,d:u,locale:q}=de(),A=$e(),v=g(!1),y=g({}),V=g(""),E=g(1),S=g(10),$=g(0),w=g(""),i=g(!1),k=g([{value:"transaction",label:t("notification.type-transaction")},{value:"event-notification",label:t("notification.type-event-notification")},{value:"system-notification",label:t("notification.type-system-notification")},{value:"service",label:t("notification.type-service")}]),z=g([]);let C=null;const H=()=>{C&&clearTimeout(C),C=setTimeout(()=>{T()},300)},K=async d=>{const s=E.value;E.value=d;try{await T()}catch(m){E.value=s,console.error("分页请求失败,已恢复原页码:",m)}},T=async()=>{i.value=!0;try{const d={pageNum:E.value,pageSize:S.value,keywords:V.value,type:w.value},s=await Ne(d),{rows:m}=s;m.forEach(_=>{switch(_.status){case"draft":_.statusName=t("notification.status-draft"),_.statusType="default";break;case"sent":_.statusName=t("notification.status-sent"),_.statusType="success";break;case"scheduled":_.statusName=t("notification.status-scheduled"),_.statusType="warning";break;case"withdrawn":_.statusName=t("notification.status-withdrawn"),_.statusType="danger";break}switch(_.type){case"transaction":_.iconColor="#409EFF";break;case"event-notification":_.iconColor="#FCAF3F";break;case"system-notification":_.iconColor="#3A7DCB";break;case"service":_.iconColor="#EAF0F7";break}}),z.value=m,$.value=s.total||0}catch(d){throw console.error("获取通知列表失败:",d),d}finally{i.value=!1}i.value=!1};ke(()=>{T()});const D=(d,s)=>{y.value={...d},f(s)},f=async d=>{const s={...y.value};if(d==="sent"){if(!s.title){M.error(t("message.cannot-be-empty",[t("notification.title")]));return}if(!s.contents){M.error(t("message.cannot-be-empty",[t("notification.content")]));return}}s.status=d;const m=await pe(s);M.success(m.msg),await T()},G=async d=>{const s=await Te(d);M.success(s.msg),await T()},R=g({}),Y=d=>{if(d.hasOverflow>-1)return d.hasOverflow===1;const s=R.value[d.id];if(!s)return!1;const m=s.scrollHeight>s.clientHeight;return d.hasOverflow=m?1:0,m},W=()=>{y.value={id:"",type:"event-notification",typeName:t("notification.type-event-notification"),status:"draft",statusName:t("notification.status-draft"),title:"",contents:"",recipients:"All users",sentDate:"",scheduled:!1},v.value=!0},X=d=>{d.expanded=!d.expanded},Z=d=>{y.value={...d},v.value=!0},ve=()=>{v.value=!1,y.value={}},_e=()=>{T()};return xe(q,d=>{k.value=[{value:"transaction",label:t("notification.type-transaction")},{value:"event-notification",label:t("notification.type-event-notification")},{value:"system-notification",label:t("notification.type-system-notification")},{value:"service",label:t("notification.type-service")}]}),(d,s)=>{const m=ie,_=ce,ee=re,te=le,B=ge,ne=be,Q=we,ye=he;return r(),p(L,null,[v.value?h("",!0):(r(),p("div",je,[n(A).isMobileDevice?(r(
1),p("div",vt,[o("h1",_t,a(n(t)("notification.notifications")),1),o("div",yt,[o("span",{class:"mobile-total",innerHTML:n(t)("message.total-count-bold",[$.value])},null,8,mt),l(m,{type:"primary",round:"",icon:"plus",onClick:W},{default:c(()=>[b(a(n(t)("message.add")),1)]),_:1})]),o("div",ht,[l(_,{class:"search-in",modelValue:V.value,"onUpdate:modelValue":s[4]||(s[4]=e=>V.value=e),onInput:H,"aria-label":"search notifications"},{prefix:c(()=>[l(se,{name:"search",style:{width:"14px",height:"14px",color:"#7F8695"}})]),_:1},8,["modelValue"]),o("label",gt,a(n(t)("news.by-category")),1),l(te,{modelValue:w.value,"onUpdate:modelValue":s[5]||(s[5]=e=>w.value=e),onChange:H,placeholder:n(t)("news.by-category"),clearable:"",onKeydown:[s[6]||(s[6]=F(O(e=>e.target.click(),["prevent"]),["enter"])),s[7]||(s[7]=F(O(e=>e.target.click(),["prevent"]),["space"]))]},{default:c(()=>[(r(!0),p(L,null,U(k.value,e=>(r(),I(ee,{key:e.value,label:e.label,value:e.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),o("div",bt,[(r(!0),p(L,null,U(z.value,(e,x)=>{var P;return r(),p("div",{key:e.id,class:"notification-item"},[o("div",wt,[o("h3",kt,a(e.title),1),o("div",xt,a((P=k.value.find(N=>N.value===e.type))==null?void 0:P.label),1),o("div",Ct,[o("div",{class:ae(["content-text",{expanded:e.expanded}]),ref_for:!0,ref:N=>{N&&(R.value[e.id]=N)},innerHTML:e.contents},null,10,$t),Y(e)?(r(),p("button",{key:0,onClick:N=>X(e),class:"show-more-btn"},a(e.expanded?n(t)("message.show-less"):n(t)("message.show-more")),9,Nt)):h("",!0)]),o("div",Tt,[o("div",Vt,[l(ne,{class:"mx-1",type:e.statusType},{default:c(()=>[b(a(e.statusName),1)]),_:2},1032,["type"]),o("div",Et,a(n(j)(e.updateDate).format("MMM DD YYYY")),1),o("div",zt,a(n(j)(e.updateDate).format("HH:mm")),1)]),o("div",Mt,[e.status==="sent"?(r(),p("button",{key:0,class:"text-button",size:"small",onClick:N=>D(e,"withdrawn")},a(n(t)("notification.action-withdraw")),9,St)):h("",!0),e.status==="draft"?(r(),p("button",{key:1,class:"text-button",size:"small",onClick:N=>D(e,"sent")},a(n(t)("notification.action-send")),9,Ht)):h("",!0),e.status==="draft"||e.status==="scheduled"?(r(),p("button",{key:2,class:"text-button",size:"small",onClick:N=>Z(e)},a(n(t)("notification.action-edit")),9,Dt)):h("",!0),e.status==="draft"?(r(),I(m,{key:3,link:"",type:"danger",size:"small",onClick:N=>G(e.id)},{default:c(()=>[b(a(n(t)("message.delete")),1)]),_:1},8,["onClick"])):h("",!0)])])]),x<z.value.length-1?(r(),p("div",Ft)):h("",!0)])}),128))])])):(r(),p("div",Je,[o("div",Ge,[o("h1",We,a(n(t)("notification.notifications")),1),o("div",Xe,[l(m,{type:"primary",round:"",icon:"plus",onClick:W},{default:c(()=>[b(a(n(t)("message.add")),1)]),_:1})])]),o("div",Ze,[o("div",et,[o("span",{style:{"font-size":"calc(var(--base-font-size) * 1.25)"},innerHTML:n(t)("message.total-count-bold",[$.value])},null,8,tt),l(_,{class:"search-in",modelValue:V.value,"onUpdate:modelValue":s[0]||(s[0]=e=>V.value=e),onInput:H,style:{width:"200px","margin-left":"20px"},placeholder:"","aria-label":"search notifications"},{prefix:c(()=>[l(se,{name:"search",style:{width:"14px",height:"14px",color:"#7F8695"}})]),_:1},8,["modelValue"])]),o("div",nt,[o("label",ot,a(n(t)("news.by-category")),1),l(te,{id:"notification-type-filter",modelValue:w.value,"onUpdate:modelValue":s[1]||(s[1]=e=>w.value=e),onChange:H,style:{width:"150px","margin-left":"15px"},placeholder:n(t)("news.by-category"),clearable:"",onKeydown:[s[2]||(s[2]=F(O(e=>e.target.click(),["prevent"]),["enter"])),s[3]||(s[3]=F(O(e=>e.target.click(),["prevent"]),["space"]))]},{default:c(()=>[(r(!0),p(L,null,U(k.value,e=>(r(),I(ee,{key:e.value,label:e.label,value:e.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])]),l(ye,{data:z.value,"row-class-name":"notification-sections-row","header-row-class-name":"notification-sections-header",style:{"background-color":"transparent"}},{default:c(()=>[l(B,{prop:"typeName",label:n(t)("notification.type")},{default:c(e=>{var x;return[b(a((x=k.value.find(P=>P.value===e.row.type))==null?void 0:x.label),1)]}),_:1},8,["label"]),l(B,{prop:"title",label:n(t)("notification.title")},{default:c(e=>[b(a(e.row.title),1)]),_:1},8,["label"]),l(B,{prop:"content",label:n(t)("notification.content"),"min-width":"200"},{default:c(e=>[o("div",{class:"content-cell",style:Ce(Y(e.row)?"padding-bottom: 20px;  /* 为按钮留出空间 */":"")},[o("div",{class:ae(["content-text",{expanded:e.row.expanded}]),ref:x=>{x&&(R.value[e.row.id]=x)},innerHTML:e.row.contents},null,10,at),Y(e.row)?(r(),p("button",{key:0,onClick:x=>X(e.row),class:"show-more-btn"},a(e.row.expanded?n(t)("message.show-less"):n(t)("message.show-more")),9,st)):h("",!0)],4)]),_:1},8,["label"]),l(B,{prop:"status",label:n(t)("notification.status"),width:"120"},{default:c(e=>[o("div",null,[l(ne,{class:"mx-1",type:e.row.statusType},{default:c(()=>[b(a(e.row.statusName),1)]),_:2},1032,["type"])]),o("div",it,a(n(u)(n(j)(e.row.updateDate).toDate(),"long")),1)]),_:1},8,["label"]),l(B,{label:n(t)("notification.action"),"min-width":"100",align:"center"},{default:c(e=>[e.row.status==="sent"?(r(),p("div",lt,[l(Q,{width:"300",onConfirm:x=>D(e.row,"withdrawn"),title:n(t)("message.sure-to-do")},{reference:c(()=>[o("button",ct,a(n(t)("notification.action-withdraw")),1)]),_:1},8,["onConfirm","title"])])):h("",!0),e.row.status==="draft"?(r(),p("div",rt,[l(Q,{width:"300",onConfirm:x=>D(e.row,"sent"),title:n(t)("message.sure-to-do")},{reference:c(()=>[o("button",dt,a(n(t)("notification.action-send")),1)]),_:1},8,["onConfirm","title"])])):h("",!0),e.row.status==="draft"||e.row.status==="scheduled"?(r(),p("div",ut,[o("button",{class:"text-button",onClick:x=>Z(e.row)},a(n(t)("notification.action-edit")),9,pt)])):h("",!0),e.row.status==="draft"?(r(),p("div",ft,[l(Q,{width:"300",onConfirm:x=>G(e.row.id),title:n(t)("message.sure-to-delete")},{reference:c(()=>[l(m,{link:"",type:"danger"},{default:c(()=>[b(a(n(t)("message.delete")),1)]),_:1})]),_:1},8,["onConfirm","title"])])):h("",!0)]),_:1},8,["label"])]),_:1},8,["data"])])),o("div",Ot,[l(Ve,{layout:"prev, pager, next",total:$.value,"current-page":E.value,"page-size":S.value,loading:i.value,background:!0,"aria-label":"Pagination",onCurrentChange:K},null,8,["total","current-page","page-size","loading"])])])),v.value?(r(),I(Qe,{key:1,notification:y.value,onCancelClicked:ve,onSaveClicked:_e},null,8,["notification"])):h("",!0)],64)}}}),Kt=fe(At,[["__scopeId","data-v-57cee6df"]]);export{Kt 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.