Files
kefu/deploy/archive-performance-fix/admin-web/apps/web-antd/dist/js/people-C9U3xpyR.js
T
2026-09-21 10:34:06 +08:00

1 line
9.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{D as e,E as t,On as n,_ as r,b as i,gn as a,k as o,mt as s,o as c,qt as l,tr as u,v as d,vn as f,y as p}from"./runtime-core.esm-bundler-DkysjgTd.js";import{n as m}from"./objectWithoutProperties-BjoYlK0I.js";import{t as h}from"./table-CW2r6lPL.js";import{t as g}from"./form-BzL91_Kw.js";import{t as _}from"./select-B6mbPqz1.js";import{O as v}from"./console-P4IB8M9e.js";import{a as y}from"./config-provider-Dz5iOevd.js";import{t as ee}from"./popconfirm-BszWx6e3.js";import{t as b}from"./drawer-CYBOEueM.js";import{t as x}from"./button-BmeX6K_E.js";import{t as S}from"./tag-EV85tNJT.js";import{t as C}from"./input-CmV6qN-W.js";import{t as w}from"./space-CBX6VIMJ.js";import{t as te}from"./switch-CszVV22m.js";import{d as ne,f as T,g as E,n as D,r as O,t as re,v as ie}from"./use-archive-load-IFGFIhoZ.js";import{t as ae}from"./archive-account-selector-CG1fjypa.js";var oe={class:`p-5`},k={key:1,class:`text-gray-400`},A={class:`text-xs text-gray-400`},j={key:2,class:`mb-0 text-sm text-gray-400`},M=o({__name:`people`,setup(o){let M=re(),N=M.loading,P=f(!1),F=f(!1),I=f(!1),L=f(``),R=f(``),z=f([]),B=f(null),V=f([]),H=f(0),U=f(`self`),W=[{label:`本人`,value:`self`},{label:`家属`,value:`family`},{label:`监护人`,value:`guardian`},{label:`代咨询`,value:`proxy`},{label:`其他`,value:`other`}],G=a({external_id:``,identity_type:`wecom_userid`,scope_id:``,verified:!0});function K(){return q.apply(this,arguments)}function q(){return q=m(function*(){z.value=[],yield M.run(e=>ne(200,L.value,H.value,e),e=>{z.value=e.items})}),q.apply(this,arguments)}function J(e){return Y.apply(this,arguments)}function Y(){return Y=m(function*(e){B.value=(yield T(e.id,H.value)).person,G.external_id=``,R.value=``,V.value=[]}),Y.apply(this,arguments)}function se(){return X.apply(this,arguments)}function X(){return X=m(function*(){if(!B.value||!G.external_id.trim()){y.warning(`请输入企业微信人员 ID`);return}P.value=!0;try{B.value=(yield D(B.value.id,G,H.value)).person,G.external_id=``,y.success(`人员标识已绑定`),yield K()}finally{P.value=!1}}),X.apply(this,arguments)}function ce(){return Z.apply(this,arguments)}function Z(){return Z=m(function*(){if(H.value<=0){y.warning(`请先选择已经登录过桌面软件的客户端账号`);return}if(!R.value.trim()){y.warning(`请输入患者姓名、手机号或患者编号`);return}I.value=!0;try{V.value=(yield E(R.value.trim(),H.value)).items,V.value.length||y.info(`ZYT 中未找到匹配患者`)}finally{I.value=!1}}),Z.apply(this,arguments)}function le(e){return Q.apply(this,arguments)}function Q(){return Q=m(function*(e){if(B.value){F.value=!0;try{B.value=(yield O(B.value.id,{diagnosis_id:e.diagnosis_id,patient_id:e.patient_id,relation_type:U.value},H.value)).person,y.success(`患者关联已保存到客服后台`),yield K()}finally{F.value=!1}}}),Q.apply(this,arguments)}function ue(e){return $.apply(this,arguments)}function $(){return $=m(function*(e){if(B.value){F.value=!0;try{B.value=(yield ie(B.value.id,e,H.value)).person,y.success(`患者关联已解除`),yield K()}finally{F.value=!1}}}),$.apply(this,arguments)}function de(e){var t;return((t=W.find(t=>t.value===e))==null?void 0:t.label)||e}return(a,o)=>{var f;return s(),i(`div`,oe,[e(n(v),{title:`人员唯一标识`},{extra:l(()=>[e(n(w),null,{default:l(()=>[e(ae,{modelValue:H.value,"onUpdate:modelValue":o[0]||(o[0]=e=>H.value=e),onChange:o[1]||(o[1]=()=>{B.value=null,K()})},null,8,[`modelValue`]),e(n(C).Search,{value:L.value,"onUpdate:value":o[2]||(o[2]=e=>L.value=e),"allow-clear":``,placeholder:`姓名`,loading:n(N),onSearch:K},null,8,[`value`,`loading`]),e(n(x),{loading:n(N),onClick:K},{default:l(()=>[...o[10]||(o[10]=[t(`刷新`,-1)])]),_:1},8,[`loading`])]),_:1})]),default:l(()=>[o[12]||(o[12]=r(`p`,{class:`mb-3 text-sm text-gray-500`},` 同一个人可绑定本地 UID、企业微信 userid、微信 external_userid 等多个身份;唯一键由“身份类型 + 企业范围 + 外部 ID”组成。 `,-1)),e(n(h),{"data-source":z.value,"row-key":`id`,size:`small`,loading:n(N),pagination:{pageSize:20},columns:[{title:`显示名称`,dataIndex:`display_name`,key:`display_name`},{title:`真实姓名`,dataIndex:`real_name`,key:`real_name`},{title:`已绑定身份`,dataIndex:`identity_count`,key:`identity_count`,width:110},{title:`关联患者`,key:`patient`,width:180},{title:`会话数`,dataIndex:`conversation_count`,key:`conversation_count`,width:90},{title:`消息数`,dataIndex:`message_count`,key:`message_count`,width:90},{title:`操作`,key:`action`,width:100}]},{bodyCell:l(({column:e,record:r})=>[e.key===`action`?(s(),d(n(x),{key:0,type:`link`,size:`small`,onClick:e=>J(r)},{default:l(()=>[...o[11]||(o[11]=[t(`管理关联`,-1)])]),_:1},8,[`onClick`])):e.key===`patient`?(s(),i(c,{key:1},[r.primary_patient_id?(s(),d(n(S),{key:0,color:`blue`},{default:l(()=>[t(u(r.primary_patient_name||`患者 ${r.primary_patient_id}`),1)]),_:2},1024)):(s(),i(`span`,k,`未关联`))],64)):p(``,!0)]),_:1},8,[`data-source`,`loading`])]),_:1}),e(n(b),{open:!!B.value,title:`人员关联 · ${((f=B.value)==null?void 0:f.display_name)||``}`,width:`680`,onClose:o[9]||(o[9]=e=>B.value=null)},{default:l(()=>{var a;return[e(n(v),{title:`关联 ZYT 患者`,size:`small`,class:`mb-5`},{default:l(()=>{var a;return[(a=B.value)!=null&&(a=a.patient_bindings)!=null&&a.length?(s(),d(n(h),{key:0,class:`mb-4`,"data-source":B.value.patient_bindings,"row-key":`id`,size:`small`,pagination:!1,columns:[{title:`患者`,dataIndex:`patient_name`,key:`patient_name`},{title:`手机号`,dataIndex:`phone_masked`,key:`phone_masked`,width:125},{title:`关系`,dataIndex:`relation_type`,key:`relation_type`,width:85},{title:`状态`,key:`binding_status`,width:75},{title:`操作`,key:`unbind`,width:75}]},{bodyCell:l(({column:a,record:f})=>[a.key===`patient_name`?(s(),i(c,{key:0},[r(`div`,null,u(f.patient_name||`患者 ${f.patient_id}`),1),r(`div`,A,`患者ID:`+u(f.patient_id),1)],64)):a.key===`relation_type`?(s(),i(c,{key:1},[t(u(de(f.relation_type)),1)],64)):a.key===`binding_status`?(s(),d(n(S),{key:2,color:f.is_primary?`green`:`default`},{default:l(()=>[t(u(f.is_primary?`默认`:`关联`),1)]),_:2},1032,[`color`])):a.key===`unbind`?(s(),d(n(ee),{key:3,title:`确认解除这个患者关联?`,onConfirm:e=>ue(f.id)},{default:l(()=>[e(n(x),{type:`link`,danger:``,size:`small`,loading:F.value},{default:l(()=>[...o[13]||(o[13]=[t(`解绑`,-1)])]),_:1},8,[`loading`])]),_:1},8,[`onConfirm`])):p(``,!0)]),_:1},8,[`data-source`])):p(``,!0),e(n(w),{class:`mb-3`,wrap:``},{default:l(()=>[e(n(_),{value:U.value,"onUpdate:value":o[3]||(o[3]=e=>U.value=e),style:{width:`110px`},options:W},null,8,[`value`]),e(n(C).Search,{value:R.value,"onUpdate:value":o[4]||(o[4]=e=>R.value=e),style:{width:`360px`},"allow-clear":``,placeholder:`输入患者姓名、手机号或患者编号`,loading:I.value,onSearch:ce},null,8,[`value`,`loading`])]),_:1}),V.value.length?(s(),d(n(h),{key:1,"data-source":V.value,"row-key":`patient_id`,size:`small`,pagination:!1,columns:[{title:`患者`,dataIndex:`patient_name`,key:`patient_name`},{title:`手机号`,dataIndex:`phone_masked`,key:`phone_masked`,width:125},{title:`患者ID`,dataIndex:`patient_id`,key:`patient_id`,width:95},{title:`操作`,key:`bind_patient`,width:75}]},{bodyCell:l(({column:e,record:r})=>[e.key===`bind_patient`?(s(),d(n(x),{key:0,type:`link`,size:`small`,loading:F.value,onClick:e=>le(r)},{default:l(()=>[...o[14]||(o[14]=[t(` 关联 `,-1)])]),_:1},8,[`loading`,`onClick`])):p(``,!0)]),_:1},8,[`data-source`])):(s(),i(`p`,j,` 从 ZYT 只读查询患者,关联关系仅保存在客服后台,不会修改 ZYT。 `))]}),_:1}),e(n(h),{class:`mb-5`,"data-source":((a=B.value)==null?void 0:a.identities)||[],"row-key":`id`,size:`small`,pagination:!1,columns:[{title:`类型`,dataIndex:`identity_type`,key:`identity_type`,width:140},{title:`企业/范围`,dataIndex:`scope_id`,key:`scope_id`,width:140},{title:`外部 ID`,dataIndex:`external_id`,key:`external_id`},{title:`状态`,dataIndex:`verified`,key:`verified`,width:80}]},{bodyCell:l(({column:e,record:r})=>[e.key===`verified`?(s(),d(n(S),{key:0,color:r.verified?`green`:`default`},{default:l(()=>[t(u(r.verified?`已确认`:`未确认`),1)]),_:2},1032,[`color`])):p(``,!0)]),_:1},8,[`data-source`]),e(n(v),{title:`绑定新标识`,size:`small`},{default:l(()=>[e(n(g),{"label-col":{span:6},"wrapper-col":{span:17}},{default:l(()=>[e(n(g).Item,{label:`身份类型`},{default:l(()=>[e(n(_),{value:G.identity_type,"onUpdate:value":o[5]||(o[5]=e=>G.identity_type=e),options:[{label:`企业微信 userid`,value:`wecom_userid`},{label:`微信 external_userid`,value:`wecom_external_userid`},{label:`本地数据库 UID`,value:`wecom_local_uid`},{label:`企微 open_userid`,value:`wecom_open_userid`}]},null,8,[`value`])]),_:1}),e(n(g).Item,{label:`企业/范围 ID`},{default:l(()=>[e(n(C),{value:G.scope_id,"onUpdate:value":o[6]||(o[6]=e=>G.scope_id=e),placeholder:`建议填写 corp_id;本地 UID 可填账号 ID`},null,8,[`value`])]),_:1}),e(n(g).Item,{label:`外部人员 ID`,required:``},{default:l(()=>[e(n(C),{value:G.external_id,"onUpdate:value":o[7]||(o[7]=e=>G.external_id=e)},null,8,[`value`])]),_:1}),e(n(g).Item,{label:`确认身份`},{default:l(()=>[e(n(te),{checked:G.verified,"onUpdate:checked":o[8]||(o[8]=e=>G.verified=e)},null,8,[`checked`])]),_:1}),e(n(g).Item,{"wrapper-col":{offset:6,span:17}},{default:l(()=>[e(n(x),{type:`primary`,loading:P.value,onClick:se},{default:l(()=>[...o[15]||(o[15]=[t(`确认绑定`,-1)])]),_:1},8,[`loading`])]),_:1})]),_:1})]),_:1})]}),_:1},8,[`open`,`title`])])}}});export{M as default};