| 1 |
- var n=(g,d,l)=>new Promise((h,_)=>{var w=s=>{try{i(l.next(s))}catch(a){_(a)}},y=s=>{try{i(l.throw(s))}catch(a){_(a)}},i=s=>s.done?h(s.value):Promise.resolve(s.value).then(w,y);i((l=l.apply(g,d)).next())});import{L as E}from"./List-8e7ba2e1.js";import{l as O,a as T}from"./index-a4e1ec38.js";import{ak as U,au as Y,_ as L}from"./index.js";import{u as N}from"./index-4f5bc708.js";import{a as V,b as R}from"./medicalDocumentsApi-68d5d6ce.js";import{_ as A}from"./FormModal.vue_vue_type_script_setup_true_lang-3f92dcdc.js";import{l as F,aI as Q,B as Z,av as $,aw as q}from"./antd-f259b82a.js";import{d as G,r as C,o as H,f as m,x as J,Y as D,Z as M,_ as f,l as r,a7 as B,u as v,E as K}from"./vue-aed314e3.js";/* empty css */import"./useWindowSizeFn-6e9d633b.js";import"./useForm-c7f42ee0.js";import"./FormItem.vue_vue_type_script_lang-39d09a3e.js";import"./useFormItem-421691fe.js";import"./uuid-31b8b5a4.js";import"./useSortable-7d2b6665.js";import"./download-2ecc6b15.js";import"./index-7fe9c1e2.js";import"./copyTextToClipboard-328ee3b1.js";import"./index-6811a03f.js";import"./TextEditor-4892fcd0.js";import"./onMountedOrActivated-d9097634.js";const W={class:"flex doc"},X={class:"doc-nav"},ee={class:"my-4 ml-2"},te={class:"flex justify-center px-4 pt-4 grow"},ae={class:"doc-cnt"},ie={class:"my-2 text-right"},se=["id","src"],oe={key:1,class:"doc-cnt doc-cnt--empty"},ne=G({__name:"index",props:{info:{type:Object,default:()=>{}}},setup(g){const d=g,l=C({type:[]}),{createConfirm:h,createMessage:_}=Y(),[w,{openModal:y}]=N();H(()=>n(this,null,function*(){l.type=yield O({dictCode:"md"}),yield I()}));const i=m([]),s=m(""),a=m([]),o=C({size:1,total:1,current:1}),x=m(!0),u=m("");function I(){return n(this,null,function*(){var t;const e=yield V((t=d.info)==null?void 0:t.id);i.value=e.map(c=>({id:c.id,title:U(l.type,c.type,"label"),doctor:c.updatorName,endTime:F(c.updateTime).format("YYYY-MM-DD"),attachment:c.fileCount,patientBasicId:c.patientBasicId,fileIds:c.fileIds})),x.value&&i.value.length&&(s.value=i.value[0].id,o.total=i.value[0].attachment||0,a.value=i.value[0].fileIds,a.value.length&&(yield p(a.value[0])),x.value=!1)})}function b(){var t;const e={patientBasicId:""};e.patientBasicId=(t=d.info)==null?void 0:t.id,y(!0,{isUpdate:!1,record:e})}function P(e){return n(this,null,function*(){yield p(a.value[e-1])})}function p(e){return n(this,null,function*(){if(console.log("🚀 ~ file: index.vue:128 ~ handlePreview ~ id:",e),e==null){u.value="";return}try{const t=yield T(e);u.value=t||"",yield J()}catch(t){u.value=""}})}function k(e){return n(this,null,function*(){console.log("🚀 ~ file: index.vue:141 ~ callItemClick ~ data:",e),s.value=e.id,o.current=1,o.total=e.attachment,a.value=e.fileIds,yield p(a.value[0])})}function z(e){return n(this,null,function*(){var t;e.patientBasicId=(t=d.info)==null?void 0:t.id,y(!0,{isUpdate:!0,record:e})})}function S(e){return n(this,null,function*(){h({content:"你确定要删除?",iconType:"warning",onOk:()=>n(this,null,function*(){yield R([e.id]),_.success("删除成功!"),yield I(),i.value.length?yield k(i.value[0]):yield p(void 0)})})})}function j(c){return n(this,arguments,function*({isUpdate:e,values:t}){console.log("🚀 ~ file: index.vue:166 ~ callSuccess ~ values:",t),e?(s.value=t.id,o.current=1,o.total=t.fileIds.length,a.value=t.fileIds,yield p(a.value[0])):x.value=!0,yield I()})}return(e,t)=>(D(),M("div",W,[f("div",X,[f("div",ee,[r(v(Z),{type:"primary",size:"large",onClick:b},{icon:B(()=>[r(v(Q))]),default:B(()=>[K(" 添加文书 ")]),_:1})]),r(E,{type:"attachment",data:i.value,selected:s.value,width:320,onItemClick:k,onEdit:z,onDelete:S},null,8,["data","selected"])]),f("div",te,[f("div",ae,[f("div",ie,[r(v($),{current:o.current,"onUpdate:current":t[0]||(t[0]=c=>o.current=c),total:o.total,pageSize:o.size,hideOnSinglePage:!0,onChange:P},null,8,["current","total","pageSize"])]),a.value.length&&u.value?(D(),M("iframe",{key:0,id:a.value[o.current-1],class:"doc-iframe",src:u.value},null,8,se)):(D(),M("div",oe,[r(v(q))]))])]),r(A,{onRegister:v(w),onSuccess:j},null,8,["onRegister"])]))}});const ze=L(ne,[["__scopeId","data-v-85fb0652"]]);export{ze as default};
|