cnhis-design-vue 3.2.5-beta.10 → 3.2.5-beta.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -520,7 +520,7 @@ declare const _default: import("vue").DefineComponent<{
520
520
  onConfirm?: ((...args: any[]) => any) | undefined;
521
521
  "onUpdate:visible"?: ((...args: any[]) => any) | undefined;
522
522
  }>>;
523
- emit: (event: "confirm" | "update:visible", ...args: any[]) => void;
523
+ emit: (event: "update:visible" | "confirm", ...args: any[]) => void;
524
524
  formRef: import("vue").Ref<any>;
525
525
  conditionRef: import("vue").Ref<any>;
526
526
  filterVisible: import("vue").Ref<boolean>;
@@ -1392,7 +1392,7 @@ declare const _default: import("vue").DefineComponent<{
1392
1392
  onConfirm?: ((...args: any[]) => any) | undefined;
1393
1393
  "onUpdate:visible"?: ((...args: any[]) => any) | undefined;
1394
1394
  }>>;
1395
- emit: (event: "confirm" | "update:visible", ...args: any[]) => void;
1395
+ emit: (event: "update:visible" | "confirm", ...args: any[]) => void;
1396
1396
  conditionRef: import("vue").Ref<any>;
1397
1397
  onConfirm: () => void;
1398
1398
  onClose: () => void;
@@ -1638,7 +1638,7 @@ declare const _default: import("vue").DefineComponent<{
1638
1638
  }>>, {
1639
1639
  data: AnyObject;
1640
1640
  }>;
1641
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("confirm" | "update:visible")[], "confirm" | "update:visible", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
1641
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:visible" | "confirm")[], "confirm" | "update:visible", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
1642
1642
  visible: {
1643
1643
  type: BooleanConstructor;
1644
1644
  default: boolean;
@@ -1654,7 +1654,7 @@ declare const _default: import("vue").DefineComponent<{
1654
1654
  visible: boolean;
1655
1655
  model: AnyObject;
1656
1656
  }>;
1657
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("confirm" | "update:visible")[], "confirm" | "update:visible", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
1657
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:visible" | "confirm")[], "confirm" | "update:visible", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
1658
1658
  visible: {
1659
1659
  type: BooleanConstructor;
1660
1660
  default: boolean;
@@ -40,7 +40,7 @@ declare const _default: import("vue").DefineComponent<{
40
40
  onConfirm?: ((...args: any[]) => any) | undefined;
41
41
  "onUpdate:visible"?: ((...args: any[]) => any) | undefined;
42
42
  }>>;
43
- emit: (event: "confirm" | "update:visible", ...args: any[]) => void;
43
+ emit: (event: "update:visible" | "confirm", ...args: any[]) => void;
44
44
  formRef: import("vue").Ref<any>;
45
45
  conditionRef: import("vue").Ref<any>;
46
46
  filterVisible: import("vue").Ref<boolean>;
@@ -912,7 +912,7 @@ declare const _default: import("vue").DefineComponent<{
912
912
  onConfirm?: ((...args: any[]) => any) | undefined;
913
913
  "onUpdate:visible"?: ((...args: any[]) => any) | undefined;
914
914
  }>>;
915
- emit: (event: "confirm" | "update:visible", ...args: any[]) => void;
915
+ emit: (event: "update:visible" | "confirm", ...args: any[]) => void;
916
916
  conditionRef: import("vue").Ref<any>;
917
917
  onConfirm: () => void;
918
918
  onClose: () => void;
@@ -1158,7 +1158,7 @@ declare const _default: import("vue").DefineComponent<{
1158
1158
  }>>, {
1159
1159
  data: AnyObject;
1160
1160
  }>;
1161
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("confirm" | "update:visible")[], "confirm" | "update:visible", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
1161
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:visible" | "confirm")[], "confirm" | "update:visible", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
1162
1162
  visible: {
1163
1163
  type: BooleanConstructor;
1164
1164
  default: boolean;
@@ -1174,7 +1174,7 @@ declare const _default: import("vue").DefineComponent<{
1174
1174
  visible: boolean;
1175
1175
  model: AnyObject;
1176
1176
  }>;
1177
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("confirm" | "update:visible")[], "confirm" | "update:visible", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
1177
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:visible" | "confirm")[], "confirm" | "update:visible", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
1178
1178
  visible: {
1179
1179
  type: BooleanConstructor;
1180
1180
  default: boolean;
@@ -23,7 +23,7 @@ declare const _default: import("vue").DefineComponent<{
23
23
  onConfirm?: ((...args: any[]) => any) | undefined;
24
24
  "onUpdate:visible"?: ((...args: any[]) => any) | undefined;
25
25
  }>>;
26
- emit: (event: "confirm" | "update:visible", ...args: any[]) => void;
26
+ emit: (event: "update:visible" | "confirm", ...args: any[]) => void;
27
27
  conditionRef: import("vue").Ref<any>;
28
28
  onConfirm: () => void;
29
29
  onClose: () => void;
@@ -269,7 +269,7 @@ declare const _default: import("vue").DefineComponent<{
269
269
  }>>, {
270
270
  data: AnyObject;
271
271
  }>;
272
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("confirm" | "update:visible")[], "confirm" | "update:visible", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
272
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:visible" | "confirm")[], "confirm" | "update:visible", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
273
273
  visible: {
274
274
  type: BooleanConstructor;
275
275
  default: boolean;
@@ -1 +1 @@
1
- import{onBeforeUnmount as e,createVNode as l,defineComponent as t,inject as i,computed as r,watch as u,onMounted as o}from"vue";import{traverse as d}from"../../../../shared/utils/index.js";import{promiseTimeout as n}from"@vueuse/shared";import{last as s,first as a}from"lodash-es";import"../../index.js";import{LOWEST_PRIORITY as f,InjectionIhoTableConfig as h,InjectionIhoTableXeInstance as c}from"../constants/index.js";import{mergeVxeStyle as v,useUUIDMap as g,mergeVxeClass as m}from"../utils/index.js";import{defineTablePlugin as x}from"../hooks/useTablePlugin.js";function p(){const p="stickyFixedPlugin";return x({name:p,apply(x){x.configHooks.config.tap(p,((e,{$table:l})=>{var t;if(null==(t=e.stickyFixedConfig)?void 0:t.enable){const t=e=>{if(!l.value)return{left:0,right:0};return{left:l.value.getColumns().slice(0,e).reduce(((e,l)=>e+(l.resizeWidth||l.renderWidth)),0),right:l.value.getColumns().slice(e+1).reduce(((e,l)=>e+(l.resizeWidth||l.renderWidth)),0)}};e.cellStyle=v((({_columnIndex:e})=>({"--iho-table-fixed-left":t(e).left,"--iho-table-fixed-right":t(e).right})),e.cellStyle),e.headerCellStyle=v((({_columnIndex:e})=>({"--iho-table-fixed-left":t(e).left,"--iho-table-fixed-right":t(e).right})),e.headerCellStyle)}return e}));const{getItemFromUUID:b,removeItemFromUUID:y}=g((()=>({tableBody:null,left:[],noFixed:[],right:[],leftEle:null,leftBorderEle:null,rightEle:null,rightBorderEle:null})));function E(e,l){const{leftEle:t,rightEle:i}=e;t&&(l.scrollLeft>0?t.classList.add("scrolling--middle"):null==t||t.classList.remove("scrolling--middle")),i&&(Math.ceil(l.scrollLeft)<l.scrollWidth-l.clientWidth?i.classList.add("scrolling--middle"):null==i||i.classList.remove("scrolling--middle"))}x.fieldHooks.fieldList.tap({name:p,stage:f},((e,l)=>{var t;if(!(null==(t=l.stickyFixedConfig)?void 0:t.enable)||!l.uuid)return e;const i=b(l.uuid);return i.left=[],i.noFixed=[],i.right=[],d(e,(e=>{e.fixed?(i[e.fixed].push(e),e.className=m(e.className,`iho-table--fixed-${e.fixed}`),e.headerClassName=m(e.headerClassName,`iho-table--fixed-${e.fixed}`)):i.noFixed.push(e),e.fixed=void 0})),[...i.left||[],...i.noFixed||[],...i.right||[]]})),x.setupHooks.setup.tap(p,(l=>{e((()=>{var e;(null==(e=l.value)?void 0:e.uuid)&&y(l.value.uuid)}))})),x.eventHooks.onScroll.tap(p,(({isX:e,$event:l},t)=>{var i;if(!e||!(null==(i=t.stickyFixedConfig)?void 0:i.enable)||!t.uuid)return;const r=l.target;if(!r)return;E(b(t.uuid),r)})),x.eventHooks.onResizableChange.tap(p,((e,l)=>{var t;if(!(null==(t=l.stickyFixedConfig)?void 0:t.enable)||!l.uuid)return;const i=b(l.uuid);E(i,i.tableBody)}));const k=t({setup(){const e=i(h),t=i(c),d=r((()=>{const l=b(e.value.uuid);return!(!l.left||!l.left.length)})),f=r((()=>{const l=b(e.value.uuid);return!(!l.right||!l.right.length)})),v=l=>{b(e.value.uuid).leftEle=l},g=l=>{b(e.value.uuid).leftBorderEle=l},m=l=>{b(e.value.uuid).rightEle=l},x=l=>{b(e.value.uuid).rightBorderEle=l};function p(){var l,i;if(!t.value||!e.value.uuid)return;const{refTableBody:r,refTableHeader:u}=t.value.getRefMaps();if(!r.value)return;const o=b(e.value.uuid);if(o.tableBody=r.value.$el,E(o,r.value.$el),!u.value)return;const{leftEle:d,rightBorderEle:n,rightEle:f,leftBorderEle:h}=o;if(d){const e=s(null==(l=u.value.$el)?void 0:l.querySelectorAll("th.iho-table--fixed-left"));e&&(d.style.width=e.offsetLeft+e.clientWidth+"px",h.style.width=d.style.width)}if(f){const e=a(null==(i=u.value.$el)?void 0:i.querySelectorAll("th.iho-table--fixed-right"));e&&(f.style.width=u.value.$el.clientWidth-e.offsetLeft-10+"px",n.style.width=f.style.width)}}return u([()=>b(e.value.uuid).left,()=>b(e.value.uuid).right],p),o((async()=>{await n(100),p()})),()=>[d.value?[l("div",{class:"iho-table__fixedLeftWrapper",ref:v},null),l("div",{class:"iho-table__fixedLeftTopBorder",ref:g},null)]:null,f.value?[l("div",{class:"iho-table__fixedRightWrapper",ref:m},null),l("div",{class:"iho-table__fixedRightTopBorder",ref:x},null)]:null]}}),B=t({setup(){const e=i(h);return()=>{var t,i;return(null==(i=null==(t=e.value)?void 0:t.stickyFixedConfig)?void 0:i.enable)?l(k,null,null):null}}});x.domInsertHooks.header.tap(p,(e=>(e.push(l(B,null,null)),e)))}})}export{p as stickyFixedPlugin};
1
+ import{onBeforeUnmount as e,createVNode as l,defineComponent as t,inject as i,computed as r,watch as u,onMounted as d}from"vue";import{traverse as o}from"../../../../shared/utils/index.js";import{promiseTimeout as a}from"@vueuse/shared";import{last as n,first as s}from"lodash-es";import"../../index.js";import{LOWEST_PRIORITY as f,InjectionIhoTableConfig as c,InjectionIhoTableXeInstance as h}from"../constants/index.js";import{mergeVxeStyle as v,useUUIDMap as g,mergeVxeClass as x}from"../utils/index.js";import{defineTablePlugin as b}from"../hooks/useTablePlugin.js";function m(){const m="stickyFixedPlugin";return b({name:m,apply(b){b.configHooks.config.tap(m,((e,{$table:l})=>{var t;if(null==(t=e.stickyFixedConfig)?void 0:t.enable){const t=e=>{if(!l.value)return{left:0,right:0};return{left:l.value.getColumns().slice(0,e).reduce(((e,l)=>e+(l.resizeWidth||l.renderWidth)),0),right:l.value.getColumns().slice(e+1).reduce(((e,l)=>e+(l.resizeWidth||l.renderWidth)),0)}};e.cellStyle=v((({_columnIndex:e})=>({"--iho-table-fixed-left":t(e).left,"--iho-table-fixed-right":t(e).right})),e.cellStyle),e.headerCellStyle=v((({_columnIndex:e})=>({"--iho-table-fixed-left":t(e).left,"--iho-table-fixed-right":t(e).right})),e.headerCellStyle)}return e}));const{getItemFromUUID:p,removeItemFromUUID:y}=g((()=>({tableBody:null,tableHeader:null,$xeTable:null,left:[],noFixed:[],right:[],leftEle:null,leftBorderEle:null,rightEle:null,rightBorderEle:null})));function B(e,l){const{leftEle:t,rightEle:i}=e;t&&(l.scrollLeft>0?t.classList.add("scrolling--middle"):null==t||t.classList.remove("scrolling--middle")),i&&(Math.ceil(l.scrollLeft)<l.scrollWidth-l.clientWidth?i.classList.add("scrolling--middle"):null==i||i.classList.remove("scrolling--middle"))}function H(e){var l,t;if(!e.tableBody||!e.tableHeader)return;const{leftEle:i,rightBorderEle:r,rightEle:u,leftBorderEle:d,tableHeader:o,$xeTable:a}=e;if(i){const t=n(null==(l=e.tableHeader)?void 0:l.querySelectorAll("th.iho-table--fixed-left"));t&&(i.style.width=t.offsetLeft+t.clientWidth+"px",d.style.width=i.style.width)}if(u){const l=s(null==(t=e.tableHeader)?void 0:t.querySelectorAll("th.iho-table--fixed-right"));if(l){const t=e.tableBody.scrollHeight>e.tableBody.clientHeight;u.style.width=e.tableBody.clientWidth-l.offsetLeft-(t?0:10)+"px",r.style.width=u.style.width}}}b.fieldHooks.fieldList.tap({name:m,stage:f},((e,l)=>{var t;if(!(null==(t=l.stickyFixedConfig)?void 0:t.enable)||!l.uuid)return e;const i=p(l.uuid);return i.left=[],i.noFixed=[],i.right=[],o(e,(e=>{e.fixed?(i[e.fixed].push(e),e.className=x(e.className,`iho-table--fixed-${e.fixed}`),e.headerClassName=x(e.headerClassName,`iho-table--fixed-${e.fixed}`)):i.noFixed.push(e),e.fixed=void 0})),[...i.left||[],...i.noFixed||[],...i.right||[]]})),b.setupHooks.setup.tap(m,(l=>{e((()=>{var e;(null==(e=l.value)?void 0:e.uuid)&&y(l.value.uuid)}))})),b.dataHooks.dataEnd.tap(m,(async e=>{var l;if(!(null==(l=e.stickyFixedConfig)?void 0:l.enable)||!e.uuid)return;const t=p(e.uuid);await a(100),H(t)})),b.eventHooks.onScroll.tap(m,(({isX:e,$event:l},t)=>{var i;if(!e||!(null==(i=t.stickyFixedConfig)?void 0:i.enable)||!t.uuid)return;const r=l.target;if(!r)return;B(p(t.uuid),r)})),b.eventHooks.onResizableChange.tap(m,((e,l)=>{var t;if(!(null==(t=l.stickyFixedConfig)?void 0:t.enable)||!l.uuid)return;const i=p(l.uuid);B(i,i.tableBody)}));const k=t({setup(){const e=i(c),t=i(h),o=r((()=>{const l=p(e.value.uuid);return!(!l.left||!l.left.length)})),n=r((()=>{const l=p(e.value.uuid);return!(!l.right||!l.right.length)})),s=l=>{p(e.value.uuid).leftEle=l},f=l=>{p(e.value.uuid).leftBorderEle=l},v=l=>{p(e.value.uuid).rightEle=l},g=l=>{p(e.value.uuid).rightBorderEle=l};function x(){if(!t.value||!e.value.uuid)return;const{refTableBody:l,refTableHeader:i}=t.value.getRefMaps();if(!l.value)return;const r=p(e.value.uuid);r.tableBody=l.value.$el,r.tableHeader=i.value.$el,r.$xeTable=t.value,B(r,l.value.$el),H(r)}return u([()=>p(e.value.uuid).left,()=>p(e.value.uuid).right],x),d((async()=>{await a(100),x()})),()=>[o.value?[l("div",{class:"iho-table__fixedLeftWrapper",ref:s},null),l("div",{class:"iho-table__fixedLeftTopBorder",ref:f},null)]:null,n.value?[l("div",{class:"iho-table__fixedRightWrapper",ref:v},null),l("div",{class:"iho-table__fixedRightTopBorder",ref:g},null)]:null]}}),E=t({setup(){const e=i(c);return()=>{var t,i;return(null==(i=null==(t=e.value)?void 0:t.stickyFixedConfig)?void 0:i.enable)?l(k,null,null):null}}});b.domInsertHooks.header.tap(m,(e=>(e.push(l(E,null,null)),e)))}})}export{m as stickyFixedPlugin};
@@ -1 +1 @@
1
- import{defineComponent as e,computed as t,ref as l,watch as a,openBlock as r,createElementBlock as i,Fragment as n,unref as s,createElementVNode as c,toDisplayString as o,normalizeStyle as d,renderList as u,normalizeClass as p,createTextVNode as h,createCommentVNode as v,createBlock as f}from"vue";import{useMessage as y,NEmpty as m}from"naive-ui";import{isEqual as k}from"lodash-es";import{useVirtualList as _}from"@vueuse/core";const g={class:"searchOrgAndStaff"},N={key:0,class:"searchOption"},S={class:"search_title"},C=["onClick"],b={class:"title"},x=["title"],D={class:"desc"},O={key:1,class:"SearchOption"},$={class:"search_title"},F=["onClick"],T={class:"title"},A={class:"desc"};var K=e({__name:"SearchOrgAndStaff",props:{treeData:{type:Array,default:()=>[]},checkedKeys:{type:Array,default:()=>[]},searchFilter:{type:Object,default:()=>({})},isMultiple:{type:Boolean,default:!0}},emits:["notifyCheck","notifyClear"],setup(e,{emit:K}){var M;const P=e,w=y(),E=t((()=>{var e;return null!=(e=P.searchFilter.itemHeight)?e:300})),H=t((()=>Math.floor(E.value/50))),W=null!=(M=t((()=>P.treeData.filter((e=>!e.children)))))?M:[],{list:j,containerProps:B,wrapperProps:I}=_(W,{itemHeight:50,overscan:H.value}),q=t((()=>({...B.style,height:`${E.value}px`}))),z=t((()=>P.treeData.filter((e=>e.children&&e.children.length>0)))),{list:G,containerProps:J,wrapperProps:L}=_(z,{itemHeight:50,overscan:H.value}),Q=t((()=>({...J.style,height:`${E.value}px`}))),R=l(P.checkedKeys),U=l([]);function V(e){var t;if(R.value.find((t=>t===e.key)))return void w.info(`${e.title}已被选择`);if(e.disabled)return void w.info(`${e.title}已被禁用`);switch((null==(t=e.children)?void 0:t.length)>0?"org":"staff"){case"org":!function(e,t,l){if(!P.isMultiple)return void(R.value=[l]);t.children.length>0&&Z(t.children);X(e,t,l)}(R.value,e,e.key);break;case"staff":X(R.value,e,e.key)}K("notifyCheck",R.value),(null==P?void 0:P.searchFilter.multiple)||K("notifyClear")}function X(e,t,l){var a;if(!P.isMultiple)return void(R.value=[l]);if(!(null==t?void 0:t.parentNode))return R.value=[...e,l],!1;const r=null==(a=t.parentNode)?void 0:a.key;if(e.includes(r))return R.value=e,w.info(`${t.title}已存在于${t.tempTitle}中`),!1;if(t.parentNode.children){const a=t.parentNode.children.every((t=>[...e,l].includes(t.key)));if(a){const l=null==t?void 0:t.parentNode.children.map((e=>e.key)),r=e.filter((e=>!l.includes(e)));return a&&Y(r,t.parentNode),!1}}X(e,t.parentNode,l)}function Y(e,t){if(!t.parentNode||t.parentNode.children.length>1)return R.value=[...e,t.key],!1;Y(e,t.parentNode)}function Z(e){e.forEach((e=>{var t;if(R.value.includes(e.key)){const t=R.value.indexOf(e.key);R.value.splice(t,1)}(null==(t=e.children)?void 0:t.length)>0&&Z(e.children)}))}function ee(e,t){const l=P.checkedKeys;return!!e&&(l.includes(e.key)?(U.value.push(t),!1):void ee(e.parentNode,t))}return a((()=>P.treeData),(e=>{e&&e.length>0&&(U.value=[],e.forEach((e=>{ee(e,e.key)})))}),{deep:!0,immediate:!0}),a((()=>P.checkedKeys),((e,t)=>{k(e,t)||P.treeData.length>0&&(U.value=[],R.value=e,P.treeData.forEach((e=>{ee(e,e.key)})))}),{immediate:!0}),(t,l)=>{var a,y;return r(),i("div",g,[e.treeData.length>0?(r(),i(n,{key:0},[s(W).length>0?(r(),i("div",N,[c("h4",S,o(null==(a=e.searchFilter)?void 0:a.customTitles[0]),1),c("section",{class:"select-person__multipleWrapper",ref:s(B).ref,style:d(s(j).length>s(H)?s(q):{}),onScroll:l[0]||(l[0]=(...e)=>s(B).onScroll&&s(B).onScroll(...e))},[c("section",{style:d(s(I).style)},[(r(!0),i(n,null,u(s(j),(e=>(r(),i("div",{class:"select-person__multiple-search",key:e.data.key},[c("div",{class:p(["search_item user_item",e.data.disabled?"search_disabled":""]),onClick:t=>V(e.data)},[c("span",b,[h(o(e.data.title)+" ",1),c("span",{class:"user_item_expand",title:e.data.title_expand_strs},o(e.data.title_expand_strs),9,x)]),c("span",D,o(e.data.tempTitle),1)],10,C)])))),128))],4)],36)])):v("v-if",!0),s(z).length>0?(r(),i("div",O,[c("h4",$,o(null==(y=e.searchFilter)?void 0:y.customTitles[1]),1),c("section",{class:"person__OrgWrapper",ref:s(J).ref,style:d(s(G).length>s(H)?s(Q):{}),onScroll:l[1]||(l[1]=(...e)=>s(J).onScroll&&s(J).onScroll(...e))},[c("section",{style:d(s(L).style)},[(r(!0),i(n,null,u(s(G),(e=>(r(),i("div",{class:"select-person__multiple-search",key:e.data.key},[c("div",{class:p(["search_item",e.data.disabled?"search_disabled":""]),onClick:t=>V(e.data)},[c("span",T,o(e.data.title)+"("+o(e.data.innerItemsNum)+"人)",1),c("span",A,o(e.data.tempTitle),1)],10,F)])))),128))],4)],36)])):v("v-if",!0)],64)):(r(),f(s(m),{key:1,description:"暂无数据"}))])}}});export{K as default};
1
+ import{defineComponent as e,computed as t,ref as l,watch as a,openBlock as r,createElementBlock as i,Fragment as n,unref as s,createElementVNode as c,toDisplayString as o,normalizeStyle as d,renderList as u,normalizeClass as p,createTextVNode as h,createCommentVNode as v,createBlock as f}from"vue";import{useMessage as y,NEmpty as m}from"naive-ui";import{isEqual as k}from"lodash-es";import{useVirtualList as g}from"@vueuse/core";const _={class:"searchOrgAndStaff"},N={key:0,class:"searchOption"},S={class:"search_title"},x=["onClick"],C={class:"title"},b=["title"],D={class:"desc"},O={key:1,class:"SearchOption"},$={class:"search_title"},F=["onClick"],T={class:"title"},A={class:"desc"};var K=e({__name:"SearchOrgAndStaff",props:{treeData:{type:Array,default:()=>[]},checkedKeys:{type:Array,default:()=>[]},searchFilter:{type:Object,default:()=>({})},isMultiple:{type:Boolean,default:!0}},emits:["notifyCheck","notifyClear"],setup(e,{emit:K}){var M;const P=e,w=y(),E=t((()=>{var e;return null!=(e=P.searchFilter.itemHeight)?e:300})),H=t((()=>Math.floor(E.value/50))),W=null!=(M=t((()=>P.treeData.filter((e=>!e.children)))))?M:[],{list:j,containerProps:B,wrapperProps:I}=g(W,{itemHeight:50,overscan:H.value}),q=t((()=>{var e;return{...B.style,height:(null==(e=G.value)?void 0:e.length)>0?`${E.value}px`:2*E.value+"px"}})),z=t((()=>P.treeData.filter((e=>e.children&&e.children.length>0)))),{list:G,containerProps:J,wrapperProps:L}=g(z,{itemHeight:50,overscan:H.value}),Q=t((()=>{var e;return{...J.style,height:(null==(e=j.value)?void 0:e.length)>0?`${E.value}px`:2*E.value+"px"}})),R=l(P.checkedKeys),U=l([]);function V(e){var t;if(R.value.find((t=>t===e.key)))return void w.info(`${e.title}已被选择`);if(e.disabled)return void w.info(`${e.title}已被禁用`);switch((null==(t=e.children)?void 0:t.length)>0?"org":"staff"){case"org":!function(e,t,l){if(!P.isMultiple)return void(R.value=[l]);t.children.length>0&&Z(t.children);X(e,t,l)}(R.value,e,e.key);break;case"staff":X(R.value,e,e.key)}K("notifyCheck",R.value),(null==P?void 0:P.searchFilter.multiple)||K("notifyClear")}function X(e,t,l){var a;if(!P.isMultiple)return void(R.value=[l]);if(!(null==t?void 0:t.parentNode))return R.value=[...e,l],!1;const r=null==(a=t.parentNode)?void 0:a.key;if(e.includes(r))return R.value=e,w.info(`${t.title}已存在于${t.tempTitle}中`),!1;if(t.parentNode.children){const a=t.parentNode.children.every((t=>[...e,l].includes(t.key)));if(a){const l=null==t?void 0:t.parentNode.children.map((e=>e.key)),r=e.filter((e=>!l.includes(e)));return a&&Y(r,t.parentNode),!1}}X(e,t.parentNode,l)}function Y(e,t){if(!t.parentNode||t.parentNode.children.length>1)return R.value=[...e,t.key],!1;Y(e,t.parentNode)}function Z(e){e.forEach((e=>{var t;if(R.value.includes(e.key)){const t=R.value.indexOf(e.key);R.value.splice(t,1)}(null==(t=e.children)?void 0:t.length)>0&&Z(e.children)}))}function ee(e,t){const l=P.checkedKeys;return!!e&&(l.includes(e.key)?(U.value.push(t),!1):void ee(e.parentNode,t))}return a((()=>P.treeData),(e=>{e&&e.length>0&&(U.value=[],e.forEach((e=>{ee(e,e.key)})))}),{deep:!0,immediate:!0}),a((()=>P.checkedKeys),((e,t)=>{k(e,t)||P.treeData.length>0&&(U.value=[],R.value=e,P.treeData.forEach((e=>{ee(e,e.key)})))}),{immediate:!0}),(t,l)=>{var a,y;return r(),i("div",_,[e.treeData.length>0?(r(),i(n,{key:0},[s(W).length>0?(r(),i("div",N,[c("h4",S,o(null==(a=e.searchFilter)?void 0:a.customTitles[0]),1),c("section",{class:"select-person__multipleWrapper",ref:s(B).ref,style:d(s(j).length>s(H)?s(q):{}),onScroll:l[0]||(l[0]=(...e)=>s(B).onScroll&&s(B).onScroll(...e))},[c("section",{style:d(s(I).style)},[(r(!0),i(n,null,u(s(j),(e=>(r(),i("div",{class:"select-person__multiple-search",key:e.data.key},[c("div",{class:p(["search_item user_item",e.data.disabled?"search_disabled":""]),onClick:t=>V(e.data)},[c("span",C,[h(o(e.data.title)+" ",1),c("span",{class:"user_item_expand",title:e.data.title_expand_strs},o(e.data.title_expand_strs),9,b)]),c("span",D,o(e.data.tempTitle),1)],10,x)])))),128))],4)],36)])):v("v-if",!0),s(z).length>0?(r(),i("div",O,[c("h4",$,o(null==(y=e.searchFilter)?void 0:y.customTitles[1]),1),c("section",{class:"person__OrgWrapper",ref:s(J).ref,style:d(s(G).length>s(H)?s(Q):{}),onScroll:l[1]||(l[1]=(...e)=>s(J).onScroll&&s(J).onScroll(...e))},[c("section",{style:d(s(L).style)},[(r(!0),i(n,null,u(s(G),(e=>(r(),i("div",{class:"select-person__multiple-search",key:e.data.key},[c("div",{class:p(["search_item",e.data.disabled?"search_disabled":""]),onClick:t=>V(e.data)},[c("span",T,o(e.data.title)+"("+o(e.data.innerItemsNum)+"人)",1),c("span",A,o(e.data.tempTitle),1)],10,F)])))),128))],4)],36)])):v("v-if",!0)],64)):(r(),f(s(m),{key:1,description:"暂无数据"}))])}}});export{K as default};
@@ -1 +1 @@
1
- var e="@cnhis-design-vue/shared",i="3.2.5-beta.10",s="index.ts",n={"naive-ui":"^2.30.0",vue:"^3.2.0"},a={"@vicons/ionicons5":"^0.12.0","lodash-es":"^4.17.21",moment:"^2.29.1","video.js":"^7.19.2","videojs-contrib-hls":"^5.15.0",viewerjs:"^1.10.5","xe-utils":"^3.5.4"},d={name:e,version:"3.2.5-beta.10",private:!0,main:"index.ts",peerDependencies:n,dependencies:a};export{d as default,a as dependencies,s as main,e as name,n as peerDependencies,i as version};
1
+ var e="@cnhis-design-vue/shared",i="3.2.5-beta.11",s="index.ts",n={"naive-ui":"^2.30.0",vue:"^3.2.0"},a={"@vicons/ionicons5":"^0.12.0","lodash-es":"^4.17.21",moment:"^2.29.1","video.js":"^7.19.2","videojs-contrib-hls":"^5.15.0",viewerjs:"^1.10.5","xe-utils":"^3.5.4"},d={name:e,version:"3.2.5-beta.11",private:!0,main:"index.ts",peerDependencies:n,dependencies:a};export{d as default,a as dependencies,s as main,e as name,n as peerDependencies,i as version};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cnhis-design-vue",
3
- "version": "3.2.5-beta.10",
3
+ "version": "3.2.5-beta.11",
4
4
  "license": "ISC",
5
5
  "module": "./es/components/index.js",
6
6
  "main": "./es/components/index.js",
@@ -71,5 +71,5 @@
71
71
  "iOS 7",
72
72
  "last 3 iOS versions"
73
73
  ],
74
- "gitHead": "8608bbfc8f8273af160171d5f3b105559efd3463"
74
+ "gitHead": "c51c8280a3630c9195a05f17a03c9e280f505304"
75
75
  }