Files
zyt/server/public/admin/assets/index-lm7luVQu.js
T
Your NameandClaude Opus 5 (1M context) b8f66e2b00 修复药师菜单缺少「审核签署身份」;处方笺天数栏剂数顶替时单位改为天
- 顶部用户菜单与「已开处方」页会同时请求 esignConfig,请求库会取消先发出的同名请求,
  菜单因此把审核签署判为未启用、不再重试。该只读配置请求改为不参与重复取消
- 药房联 / 处方联「天数」栏在未填用药天数、以剂数顶替时,由「14剂」改为「14 天」(管理后台与桌面端一致)
- 重新构建管理后台

Co-Authored-By: Claude Opus 5 (1M context) <[EMAIL]>
2026-11-27 16:42:30 +08:00

2 lines
7.4 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import{R as B,a0 as T,at as O,M as W,p,ac as H,o as q,q as c,O as I,D as v,s as x,T as y,u as r,r as d,L as m,v as $,K,P as w,F as S,G as J,w as Q,bZ as X,bf as Y}from"./.pnpm-DnXobOVo.js";import{u as ee,aR as te,f as oe,_ as ne}from"./index-MwyIJDGh.js";import{g as se}from"./desktop_workstation-CKMVxy9u.js";function P(e){if(!e||typeof e!="object")return;const t=e,o=[t.approaching_at,t.urgent_at,t.cutoff_at].map(n=>typeof n=="string"&&/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,3})?(?:Z|[+-]\d{2}:\d{2})$/.test(n)?Date.parse(n):NaN);if(!(o.some(n=>!Number.isFinite(n))||o[0]>o[1]||o[1]>o[2])&&!(!Number.isFinite(t.server_time)||t.server_time<=0))return{cutoff_at:t.cutoff_at,approaching_at:t.approaching_at,urgent_at:t.urgent_at,server_time:t.server_time}}function V(e){const t=new Intl.DateTimeFormat("en-GB",{timeZone:"Asia/Shanghai",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hourCycle:"h23"}).formatToParts(new Date(e.cutoff_at)),o=s=>{var i;return((i=t.find(l=>l.type===s))==null?void 0:i.value)||""},n=o("second")==="00"?"":`:${o("second")}`;return`${o("year")}年${o("month")}月${o("day")}日${o("hour")}:${o("minute")}${n}(北京时间)`}function U(e){return`网页端面诊已${e?`于${V(e)}`:""}停用,请医生使用桌面应用进行面诊。`}function re(e,t=Date.now()){if(!e)return{phase:"prepare",type:"info",title:"系统公告:医生桌面应用安装指引",description:"请各位医生提前下载并安装桌面应用,使用当前医生账号登录。",countdown:""};const o=V(e),n=Date.parse(e.cutoff_at)-t,s=Math.floor(n/864e5),i=Math.floor(n/36e5)%24,l=Math.floor(n/6e4)%60,u=n<=0?"":n<6e4?"不足1分钟":`${s>0?`${s}天`:""}${i>0?`${i}小时`:""}${l>0?`${l}分钟`:""}`;return n<=0?{phase:"expired",type:"error",title:"系统公告:医生网页端面诊已停用",description:U(e),countdown:""}:t>=Date.parse(e.urgent_at)?{phase:"last_day",type:"error",title:"系统公告:医生网页端面诊停用最后提醒",description:`请各位医生在${o}前完成桌面应用的安装与登录。届时接诊台、问诊列表的网页端面诊功能将同步停用,请使用桌面应用进行面诊。`,countdown:u}:t>=Date.parse(e.approaching_at)?{phase:"approaching",type:"warning",title:"系统公告:医生网页端面诊即将停用",description:`网页端面诊将于${o}停用。请各位医生尽快下载桌面应用,完成安装并使用当前医生账号登录,接诊台、问诊列表将同步执行此规则。`,countdown:u}:{phase:"prepare",type:"info",title:"系统公告:请提前安装医生桌面应用",description:`请各位医生提前下载并安装桌面应用,使用当前医生账号登录试用。自${o}起,接诊台、问诊列表的网页端面诊功能将停用,请提前做好准备。`,countdown:""}}function Z(e){return Number(e.root)!==1&&Array.isArray(e.role_ids)&&e.role_ids.some(t=>Number(t)===1)}function j(e,t=Date.now()){return!!e&&t>=Date.parse(e.cutoff_at)}function ae(e,t,o=Date.now()){return Z(e)&&j(t,o)}let g,L=0;const ie=60*1e3,A=W(!1);function le(){const e=ee(),t=W(Date.now());let o;const n=()=>{t.value=Date.now()+(e.serverTimeOffsetMs||0)},s=p(()=>P(e.userInfo.web_consultation_policy)),i=(z=!1)=>g||(!z&&L>0&&Date.now()-L<ie?Promise.resolve():(L=Date.now(),g=te().then(G=>{const E=P(G);if(!E)throw new Error("网页面诊时间配置无效");e.userInfo.web_consultation_policy=E,e.serverTimeOffsetMs=E.server_time*1e3-Date.now(),A.value=!1,n()}).catch(()=>{A.value=!0}).finally(()=>{g=void 0}),g)),l=()=>i(!0),u=()=>{n(),l()},k=()=>{document.visibilityState!=="hidden"&&u()};B(()=>e.serverTimeOffsetMs,n,{immediate:!0}),T(()=>{n(),l(),o=setInterval(()=>{n(),i()},1e3),window.addEventListener("focus",u),document.addEventListener("visibilitychange",k)}),O(()=>{clearInterval(o),window.removeEventListener("focus",u),document.removeEventListener("visibilitychange",k)});const D=p(()=>Z(e.userInfo)),a=p(()=>j(s.value,t.value)),_=p(()=>re(s.value,t.value)),b=p(()=>U(s.value)),C=p(()=>ae(e.userInfo,s.value,t.value));return{isDoctor:D,consultationReminder:_,webConsultationExpired:a,webConsultationBlocked:C,webConsultationMessage:b,ensureWebConsultationAllowed:()=>(n(),C.value?(oe.msgWarning(b.value),!1):!0),policyLoadFailed:A,refreshConsultationPolicy:l}}const R=H({version:"",packages:[]}),F=W(!1),M=W(!1);let h,N=0;const ce=5*60*1e3;function ue(e){const t=["windows_x64","macos_arm64","macos_x64"],o=[],n=new Set;for(const s of Array.isArray(e==null?void 0:e.packages)?e.packages:[])if(!(!s||typeof s!="object")&&!(!t.includes(s.platform)||n.has(s.platform)))try{const i=new URL(s.url);if(!["https:","http:"].includes(i.protocol)||i.username||i.password||!/^[a-f\d]{64}$/i.test(s.sha256))continue;o.push({...s,url:i.href}),n.add(s.platform)}catch{}return{version:String((e==null?void 0:e.version)||""),packages:o}}function de(){const e=(o=!1)=>h||(!o&&N>0&&Date.now()-N<ce?Promise.resolve():(F.value=!0,M.value=!1,h=se().then(n=>{R.value=ue(n),N=Date.now()}).catch(()=>{M.value=!0}).finally(()=>{F.value=!1,h=void 0}),h)),t=()=>{e()};return T(()=>{e(),window.addEventListener("focus",t)}),O(()=>window.removeEventListener("focus",t)),{downloads:R,downloadsLoading:F,downloadsFailed:M,loadDownloads:e}}const fe={key:0},pe={key:1,class:"notice-countdown"},me={class:"notice-downloads"},we=["href","download"],_e={key:0},ve={key:2,class:"install-instructions"},ye={key:0},ge={key:3,class:"install-instructions"},he=q({__name:"index",setup(e){const{consultationReminder:t,policyLoadFailed:o,refreshConsultationPolicy:n}=le(),{downloads:s,downloadsLoading:i,downloadsFailed:l,loadDownloads:u}=de(),k=p(()=>s.value.packages.some(D=>D.platform==="windows_x64"));return B(()=>t.value.phase,()=>{u(!0)}),(D,a)=>{const _=K,b=Q,C=Y;return c(),I(C,{class:"doctor-web-consultation-notice",type:r(t).type,closable:!1,"show-icon":"",title:r(t).title},{default:v(()=>[x("p",null,y(r(t).description),1),r(o)?(c(),d("p",fe,[a[4]||(a[4]=m(" 面诊切换时间更新失败,请重新获取最新设置。 ",-1)),$(_,{link:"",type:"primary",onClick:a[0]||(a[0]=f=>r(n)())},{default:v(()=>[...a[3]||(a[3]=[m("刷新切换时间",-1)])]),_:1})])):w("",!0),r(t).countdown?(c(),d("p",pe," 距网页端面诊停用还有 "+y(r(t).countdown)+"(北京时间) ",1)):w("",!0),x("div",me,[(c(!0),d(S,null,J(r(s).packages,f=>(c(),d("a",{key:f.platform,class:"installer-link",href:f.url,download:f.filename||void 0,target:"_blank",rel:"noopener noreferrer"},[$(b,null,{default:v(()=>[$(r(X))]),_:1}),m(" 下载 "+y(f.label)+"安装包 ",1)],8,we))),128)),r(i)&&!r(s).packages.length?(c(),d("span",_e,"正在获取安装包…")):r(s).packages.length?r(l)?(c(),I(_,{key:2,link:"",type:"primary",onClick:a[2]||(a[2]=f=>r(u)(!0))},{default:v(()=>[...a[6]||(a[6]=[m("刷新安装包",-1)])]),_:1})):w("",!0):(c(),d(S,{key:1},[x("span",null,y(r(l)?"安装包加载失败,请重试。":"安装包暂未发布,请联系管理员获取。"),1),$(_,{link:"",type:"primary",onClick:a[1]||(a[1]=f=>r(u)(!0))},{default:v(()=>[...a[5]||(a[5]=[m("重新获取",-1)])]),_:1})],64))]),r(s).packages.length?(c(),d("p",ve,[r(s).version?(c(),d("span",ye,"当前版本 v"+y(r(s).version)+" · ",1)):w("",!0),a[7]||(a[7]=m(" 安装完成后,使用当前医生账号登录桌面应用。 ",-1))])):w("",!0),k.value?(c(),d("p",ge," Windows 安装包适用于 Windows 10 1809 及以上版本、Windows 11(64位)。 ")):w("",!0)]),_:1},8,["type","title"])}}}),Ce=ne(he,[["__scopeId","data-v-4e68a071"]]);export{Ce as D,le as u};