1 |
- import{a as p}from"./objectUtil.ec24ceed.js";import{c as f}from"./constant.d4a76877.js";const g=(a,t)=>{if(t=="PLATFORM")return"--";let n="";if(a){const e=a.applicationName;if(t=="ORG"){const o=a.organizationRole?"-"+a.organizationRole:"";n+=e+o}else if(t=="PERSON"){a!=null&&a.userName&&(n=a.userName);let o=p(a.clientType,new Map(Object.entries(f)));o=o?"-"+o:"",n+=" ("+e+o+")"}}return n},m=(a,t)=>{const n=t.toString();let e=document.querySelector("#copy-input");e||(e=document.createElement("input"),e.id="copy-input",e.readOnly=!0,e.style.position="fixed",e.style.left="-1000px",e.style.zIndex="-1000",document.body.appendChild(e)),e.value=n,o(e,0,n.length),document.execCommand("copy")&&(document.execCommand("copy"),a.success("\u590D\u5236\u6210\u529F")),e.blur();function o(r,l,i){if(r.createTextRange){const c=r.createTextRange();c.collapse(!0),c.moveStart("character",l),c.moveEnd("character",i-l),c.select()}else r.setSelectionRange(l,i),r.focus()}};export{m as c,g};
|