Files
qhmes/deploy-qhmes/frontend/js/JSelectDept-DRDVeruW.js

2 lines
11 KiB
Java
Raw Normal View History

2026-05-15 11:34:12 +08:00
var ge=Object.defineProperty,me=Object.defineProperties;var ve=Object.getOwnPropertyDescriptors;var ie=Object.getOwnPropertySymbols;var ke=Object.prototype.hasOwnProperty,Ce=Object.prototype.propertyIsEnumerable;var ue=(e,a,l)=>a in e?ge(e,a,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[a]=l,te=(e,a)=>{for(var l in a||(a={}))ke.call(a,l)&&ue(e,l,a[l]);if(ie)for(var l of ie(a))Ce.call(a,l)&&ue(e,l,a[l]);return e},ce=(e,a)=>me(e,ve(a));var H=(e,a,l)=>new Promise((w,v)=>{var k=r=>{try{u(l.next(r))}catch(s){v(s)}},c=r=>{try{u(l.throw(r))}catch(s){v(s)}},u=r=>r.done?w(r.value):Promise.resolve(r.value).then(k,c);u((l=l.apply(e,a)).next())});import{c as ae,f as h,r as re,e as Se,w as se,u as O,n as ne,d as fe,ah as b,ar as he,as as V,k as K,aG as U,aF as m,aC as N,ag as J,G as P,p as le,h as be,J as de}from"./vue-vendor-C7Zq48Yl.js";import{B as Te}from"./index-Du0A3ksf.js";import{aC as Ke,aD as De,f as we,p as L,ak as Ee,a as ye,aE as Be,aF as Oe,an as Ae,aG as Ie,d as pe,al as Ve}from"./index-BI6CMai0.js";import{t as Le}from"./props-DAezUTeZ.js";import{B as Me}from"./index-CUdllngZ.js";import{ak as $e,o as Re,h as oe}from"./antd-vue-vendor-BPnV8VqP.js";import{T as Pe}from"./TreeIcon-DE4jdeZV.js";import{J as je}from"./JSelectBiz-CnEaVMUF.js";function ze(e,a,l,w,v){const k=ae("selectOptions",h([])),c=ae("selectValues",re({})),u=ae("loadingEcho",h(!1)),r=h([]),s=h([]),y=h([]),D=h(!1),E=h(w.multiple?l.checkStrictly:!0),A=Se(()=>E.value);let I=!0,p=[];const C=h([]),M=l.enableAutoExpand!==!1;se(c,({value:t})=>{if(t&&t.length>0){if($e(t,p))return;p=t,u.value=I,I=!1,j(null,t.join(",")).finally(()=>{u.value=!1})}},{immediate:!0});function g(){const t=O(e);return t||null}function f(t){return H(this,null,function*(){var n;if(!t||t.length===0)return[];try{const o=yield Ke({departId:t.join(","),orgCode:(n=l.params)==null?void 0:n.orgCode});if(o){const i=[];return(o instanceof Map?Array.from(o.values()):Object.values(o)).forEach(S=>{if(S&&S.parentIds&&Array.isArray(S.parentIds)){const z=S.parentIds.filter($=>!t.includes($));i.push(...z)}}),[...new Set(i)]}return[]}catch(o){return[]}})}function B(){ne(()=>{l.defaultExpandLevel&&l.defaultExpandLevel>0&&g().filterByLevel(l.defaultExpandLevel),s.value=c.value,C.value.length>0&&g().setExpandedKeys(C.value)}).then(()=>{C.value.length>0&&setTimeout(()=>{g().setExpandedKeys(C.value)},100)})}function Q(t,n){if(l.checkable==!1){s.value=l.checkStrictly?t.checked:t;const{selectedNodes:o}=n;let i=[];o.forEach(d=>{i.push(d)}),y.value=i}}function W(t,n){if(n&&l.checkable==!0){if(!w.multiple){if(n.checked){s.value=[n.node.eventKey];let d=l.rowKey,S=n.checkedNodes.find(z=>z[d]===n.node.eventKey);y.value=[S]}else s.value=[],y.value=[];return}s.value=E.value?t.checked:t;const{checkedNodes:o}=n;let i=[];o.forEach(d=>{i.push(d)}),y.value=i}}function X(t){return H(this,null,function*(){g().checkAll(t),yield ne(),s.value=g().getCheckedKeys(),t?Y():y.value=[]})}function Y(){let t="";O(s).length>0&&(t=s.value.join(",")),a({ids:t}).then(n=>{y.value=n})}function Z(t){g().expandAll(t)}function j(t,n){return H(this,null,function*(){var z;let o={},i="";t&&(i=t.eventKey,o.pid=t.value),n&&(i="",o.ids=n),(z=l.params)!=null&&z.departIds&&(o.departIds=l.params.departIds);let d=yield a(o),S=d;if(l.onlyShowCompany&&(d=x(d)),l.izOnlySelectDepartPost&&G(d),l.izShowDepartNameAbbr&&(d=_(d)),l.serverTreeData||(d=De(d,l,i),d.length==0&&t&&F(i,r.value)),D.value==!0){if(!t)r.value=d;else return new Promise($=>{if(!t.children){$();return}const R=O(e);R&&(R.updateNodeByKey(t.eventKey,{children:d}),R.setExpandedKeys([t.eventKey,...R.getExpandedKeys()])),$()});B()}else{const $=[];S.forEach(R=>{$.push({label:R[l.labelKey],value:R[l.rowKey]})}),k.value=$}})}function x(t){return t.filter(o=>o.orgCategory&&["1","4"].includes(o.orgCategory))}function _(t){const n=t;return n.forEach(o=>{o.title=o.departNameAbbr||o.title}),n}function F(t,n){if(n&&n.length>0)for(let o of n)if(o.key==t){o.child||(o.isLeaf=!0);break}else F(t,o.children)}function ee(t){const n=[],o=[];y.value.forEach(i=>{n.push({label:i[l.labelKey],value:i[l.rowKey]})}),s.