cnhis-design-vue 3.1.52-beta.5 → 3.1.52-beta.6
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.
- package/es/components/callback/src/components/render/popupMaps.d.ts +1 -1
- package/es/components/form-config/index.d.ts +2 -2
- package/es/components/form-config/src/FormConfig.vue.d.ts +2 -2
- package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +1 -1
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +1 -1
- package/es/components/form-render/index.d.ts +1 -1
- package/es/components/form-render/src/FormRender.vue.d.ts +1 -1
- package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +1 -1
- package/es/components/form-render/src/hooks/useFormEvent.d.ts +2 -2
- package/es/components/form-render/src/hooks/useFormEvent.js +1 -1
- package/es/components/form-render/src/types/index.d.ts +2 -2
- package/es/components/info-header/index.d.ts +2 -2
- package/es/components/info-header/src/InfoHeader.vue.d.ts +2 -2
- package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +1 -1
- package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +1 -1
- package/es/components/select-person/src/SearchOrgAndStaff.vue2.js +1 -1
- package/es/components/shortcut-setter/index.d.ts +1 -1
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +1 -1
- package/es/shared/package.json.js +1 -1
- package/package.json +2 -2
|
@@ -560,7 +560,7 @@ export declare const CallbackMaps: Map<string, {
|
|
|
560
560
|
onKeydown: (event: KeyboardEvent) => Promise<void>;
|
|
561
561
|
clearSpan: (uuid: string) => void;
|
|
562
562
|
exposeEvent: {
|
|
563
|
-
validate(path?: string, { force }?: {
|
|
563
|
+
validate(path?: string | ((field: import("../../../../../../es/components/form-render").Field<any, any, any, any>) => boolean), { force }?: {
|
|
564
564
|
force?: boolean | undefined;
|
|
565
565
|
}): Promise<void>;
|
|
566
566
|
getFormValues(needCombineExtendKey?: boolean): any;
|
|
@@ -7846,7 +7846,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
7846
7846
|
onKeydown: (event: KeyboardEvent) => Promise<void>;
|
|
7847
7847
|
clearSpan: (uuid: string) => void;
|
|
7848
7848
|
exposeEvent: {
|
|
7849
|
-
validate(path?: string, { force }?: {
|
|
7849
|
+
validate(path?: string | ((field: import("@formily/core").Field<any, any, any, any>) => boolean), { force }?: {
|
|
7850
7850
|
force?: boolean | undefined;
|
|
7851
7851
|
}): Promise<void>;
|
|
7852
7852
|
getFormValues(needCombineExtendKey?: boolean): any;
|
|
@@ -14236,7 +14236,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
14236
14236
|
onKeydown: (event: KeyboardEvent) => Promise<void>;
|
|
14237
14237
|
clearSpan: (uuid: string) => void;
|
|
14238
14238
|
exposeEvent: {
|
|
14239
|
-
validate(path?: string, { force }?: {
|
|
14239
|
+
validate(path?: string | ((field: import("@formily/core").Field<any, any, any, any>) => boolean), { force }?: {
|
|
14240
14240
|
force?: boolean | undefined;
|
|
14241
14241
|
}): Promise<void>;
|
|
14242
14242
|
getFormValues(needCombineExtendKey?: boolean): any;
|
|
@@ -7848,7 +7848,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
7848
7848
|
onKeydown: (event: KeyboardEvent) => Promise<void>;
|
|
7849
7849
|
clearSpan: (uuid: string) => void;
|
|
7850
7850
|
exposeEvent: {
|
|
7851
|
-
validate(path?: string, { force }?: {
|
|
7851
|
+
validate(path?: string | ((field: import("../../../../es/components/form-render").Field<any, any, any, any>) => boolean), { force }?: {
|
|
7852
7852
|
force?: boolean | undefined;
|
|
7853
7853
|
}): Promise<void>;
|
|
7854
7854
|
getFormValues(needCombineExtendKey?: boolean): any;
|
|
@@ -14238,7 +14238,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
14238
14238
|
onKeydown: (event: KeyboardEvent) => Promise<void>;
|
|
14239
14239
|
clearSpan: (uuid: string) => void;
|
|
14240
14240
|
exposeEvent: {
|
|
14241
|
-
validate(path?: string, { force }?: {
|
|
14241
|
+
validate(path?: string | ((field: import("../../../../es/components/form-render").Field<any, any, any, any>) => boolean), { force }?: {
|
|
14242
14242
|
force?: boolean | undefined;
|
|
14243
14243
|
}): Promise<void>;
|
|
14244
14244
|
getFormValues(needCombineExtendKey?: boolean): any;
|
|
@@ -576,7 +576,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
576
576
|
onKeydown: (event: KeyboardEvent) => Promise<void>;
|
|
577
577
|
clearSpan: (uuid: string) => void;
|
|
578
578
|
exposeEvent: {
|
|
579
|
-
validate(path?: string, { force }?: {
|
|
579
|
+
validate(path?: string | ((field: import("../../../../../es/components/form-render").Field<any, any, any, any>) => boolean), { force }?: {
|
|
580
580
|
force?: boolean | undefined;
|
|
581
581
|
}): Promise<void>;
|
|
582
582
|
getFormValues(needCombineExtendKey?: boolean): any;
|
|
@@ -5951,7 +5951,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
5951
5951
|
onKeydown: (event: KeyboardEvent) => Promise<void>;
|
|
5952
5952
|
clearSpan: (uuid: string) => void;
|
|
5953
5953
|
exposeEvent: {
|
|
5954
|
-
validate(path?: string, { force }?: {
|
|
5954
|
+
validate(path?: string | ((field: import("../../../../../es/components/form-render").Field<any, any, any, any>) => boolean), { force }?: {
|
|
5955
5955
|
force?: boolean | undefined;
|
|
5956
5956
|
}): Promise<void>;
|
|
5957
5957
|
getFormValues(needCombineExtendKey?: boolean): any;
|
|
@@ -563,7 +563,7 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{}, {
|
|
|
563
563
|
onKeydown: (event: KeyboardEvent) => Promise<void>;
|
|
564
564
|
clearSpan: (uuid: string) => void;
|
|
565
565
|
exposeEvent: {
|
|
566
|
-
validate(path?: string, { force }?: {
|
|
566
|
+
validate(path?: string | ((field: import("@formily/core/esm/models/Field").Field<any, any, any, any>) => boolean), { force }?: {
|
|
567
567
|
force?: boolean | undefined;
|
|
568
568
|
}): Promise<void>;
|
|
569
569
|
getFormValues(needCombineExtendKey?: boolean): any;
|
|
@@ -558,7 +558,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
558
558
|
onKeydown: (event: KeyboardEvent) => Promise<void>;
|
|
559
559
|
clearSpan: (uuid: string) => void;
|
|
560
560
|
exposeEvent: {
|
|
561
|
-
validate(path?: string, { force }?: {
|
|
561
|
+
validate(path?: string | ((field: Field<any, any, any, any>) => boolean), { force }?: {
|
|
562
562
|
force?: boolean | undefined;
|
|
563
563
|
}): Promise<void>;
|
|
564
564
|
getFormValues(needCombineExtendKey?: boolean): any;
|
|
@@ -561,7 +561,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
561
561
|
onKeydown: (event: KeyboardEvent) => Promise<void>;
|
|
562
562
|
clearSpan: (uuid: string) => void;
|
|
563
563
|
exposeEvent: {
|
|
564
|
-
validate(path?: string, { force }?: {
|
|
564
|
+
validate(path?: string | ((field: import("../../../../es/components/form-render").Field<any, any, any, any>) => boolean), { force }?: {
|
|
565
565
|
force?: boolean | undefined;
|
|
566
566
|
}): Promise<void>;
|
|
567
567
|
getFormValues(needCombineExtendKey?: boolean): any;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AnyObject } from '../../../../../es/shared/types';
|
|
2
|
-
import { Form, IFieldState } from '@formily/core';
|
|
2
|
+
import { Field, Form, IFieldState } from '@formily/core';
|
|
3
3
|
import { Ref } from 'vue';
|
|
4
4
|
import { FieldItem, FormItemDepsCollector, FormRenderProps } from '../../../../../es/components/form-render';
|
|
5
5
|
export declare function useFormExposeEvent({ formModel, formRenderRef, formUUID, getFieldList, formItemDepsCollector }: {
|
|
@@ -9,7 +9,7 @@ export declare function useFormExposeEvent({ formModel, formRenderRef, formUUID,
|
|
|
9
9
|
getFieldList: () => FieldItem[];
|
|
10
10
|
formItemDepsCollector: FormItemDepsCollector;
|
|
11
11
|
}): {
|
|
12
|
-
validate(path?: string, { force }?: {
|
|
12
|
+
validate(path?: string | ((field: Field) => boolean), { force }?: {
|
|
13
13
|
force?: boolean | undefined;
|
|
14
14
|
}): Promise<void>;
|
|
15
15
|
getFormValues(needCombineExtendKey?: boolean): any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{arrayed as e,findAncestor as t}from"../../../../shared/utils/index.js";import{isField as r}from"@formily/core";import{Path as o}from"@formily/path";import{isObject as i}from"@vue/shared";import{promiseTimeout as n}from"@vueuse/shared";import{
|
|
1
|
+
import{arrayed as e,findAncestor as t}from"../../../../shared/utils/index.js";import{isField as r}from"@formily/core";import{Path as o}from"@formily/path";import{isObject as i}from"@vue/shared";import{promiseTimeout as n}from"@vueuse/shared";import{isFunction as s,isArray as a,isString as f}from"lodash-es";import{nextTick as m}from"vue";import"../../index.js";import{FormItemLineBarDepKeyPrepend as l,NESTED_FORM_ITEM_TYPE as u}from"../constants/index.js";import{queryDecoratorByAddress as d,queryInput as c,queryDecoratorByFieldKey as p,findNextWidget as g}from"../utils/dom.js";import{validateMessageParser as h,combineExtendKey as v,splitExtendKey as y}from"../utils/index.js";import{getParentLinebar as x}from"../utils/schema.js";function I({formModel:t,formRenderRef:n,formUUID:u,getFieldList:g,formItemDepsCollector:I}){return{validate(o="*",{force:m}={}){if(s(o)){const e=Object.entries(t.fields).reduce(((e,[t,r])=>(o(r)&&e.push(t),e)),[]);if(!e.length)return Promise.resolve();o=e.length?`*(${e.join(",")})`:"*"}const l=[];m&&t.setFieldState(o,(e=>{"visible"===e.display&&"editable"!==e.pattern&&r(e)&&(l.push({pattern:e.pattern,state:e}),e.pattern="editable")}));const p=t.validate(o).catch((e=>Promise.reject(Array.isArray(e)?e.reduce(g,[]):e)));return m&&l.forEach((({pattern:e,state:t})=>t.pattern=e)),p;function g(t,r){if(!i(r))return t;let o=!1;return a(r.messages)&&r.messages.forEach((r=>{i(r)&&(t.push(...e(r).map(v)),o=!0)})),!o&&t.push(v(r)),t}function v(e){if(e.decoratorElement)return e;const r=t.query(e.path),o=r.get("title"),s=e.messages.map((e=>function(e,t){if(!t||!i(t.fieldItem))return e;const r=t.fieldItem.defined_error_msg;return h(r&&f(r)?r:e,t.fieldItem)}(e,r.get("decoratorProps")))),a=d(e.address,n.value,u);return{...e,messages:s,title:o,decoratorElement:a,...c(a)}}},getFormValues(e=!0){let r=t.getFormState().values;return e&&(r=v(g(),r)),r},setFormValues(e,i=!0,n=!0){i&&(e=y(g(),e)),t.setFieldState("*",(t=>{r(t)&&(n||o.existIn(e,t.path))&&(t.value=o.getIn(e,t.path))}))},setFieldState(e,r){t.setFieldState(e,r)},resetFields:(e="*")=>t.reset(e),queryWidget:async e=>n.value?await async function(e,t,r){if(!n.value)return s();const o=p(e,t,u);if(o)return s(o);const i=x(e,r);return i?(I.trigger(l+i,!0),await m(),s(p(e,t,u))):s();function s(e){return{decoratorElement:e,...c(e)}}}(e,n.value,g()):null}}function j({props:e,formRenderRef:r,formModel:o}){return{onKeydown:async function i(a){var f;if(e.enterToNextWidget&&a.target){if("TEXTAREA"===a.target.tagName&&!a.ctrlKey)return;a.preventDefault()}if(await n(0),Reflect.get(a,"stopCapture")||!e.enterToNextWidget||!r.value)return;const m=t(a.target,(e=>e.classList.contains("form-render__formItem")));if(!m)return;const l=`.form-render__formItem${u.map((e=>`:not([widget-type=${e}])`)).join("")}`,d=Array.from(r.value.querySelectorAll(l)),c=d.findIndex((e=>e.id===m.id));if(!~c)return;const{widget:p,field:h}=g(d,c,a.target);if(p)if(s(e.enterToNextWidget)){const t=h&&o.query(h).take();!t||e.enterToNextWidget(null==(f=t.decoratorProps)?void 0:f.fieldItem)?v():i({target:p})}else v();async function v(){await n(0),p.focus()}}}}export{j as useFormDomEvent,I as useFormExposeEvent};
|
|
@@ -31,11 +31,11 @@ export declare type FormRenderExpose = {
|
|
|
31
31
|
formModel: Form;
|
|
32
32
|
/**
|
|
33
33
|
* @desc 触发表单校验
|
|
34
|
-
* @param {string} path 目标路径, 支持Path语法
|
|
34
|
+
* @param {string|((field:Field)=>boolean)} path 目标路径, 支持Path语法
|
|
35
35
|
* @param {{force?:boolean}} options 校验选项, force代表强制校验不可编辑项
|
|
36
36
|
* @return {void | Promise<Object[]>}
|
|
37
37
|
*/
|
|
38
|
-
validate(path?: string, options?: {
|
|
38
|
+
validate(path?: string | ((field: Field) => boolean), options?: {
|
|
39
39
|
force?: boolean;
|
|
40
40
|
}): Promise<unknown>;
|
|
41
41
|
/**
|
|
@@ -3130,7 +3130,7 @@ declare const InfoHeader: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
3130
3130
|
onKeydown: (event: KeyboardEvent) => Promise<void>;
|
|
3131
3131
|
clearSpan: (uuid: string) => void;
|
|
3132
3132
|
exposeEvent: {
|
|
3133
|
-
validate(path?: string, { force }?: {
|
|
3133
|
+
validate(path?: string | ((field: import("@formily/core").Field<any, any, any, any>) => boolean), { force }?: {
|
|
3134
3134
|
force?: boolean | undefined;
|
|
3135
3135
|
}): Promise<void>;
|
|
3136
3136
|
getFormValues(needCombineExtendKey?: boolean): any;
|
|
@@ -4136,7 +4136,7 @@ declare const InfoHeader: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
4136
4136
|
onKeydown: (event: KeyboardEvent) => Promise<void>;
|
|
4137
4137
|
clearSpan: (uuid: string) => void;
|
|
4138
4138
|
exposeEvent: {
|
|
4139
|
-
validate(path?: string, { force }?: {
|
|
4139
|
+
validate(path?: string | ((field: import("@formily/core").Field<any, any, any, any>) => boolean), { force }?: {
|
|
4140
4140
|
force?: boolean | undefined;
|
|
4141
4141
|
}): Promise<void>;
|
|
4142
4142
|
getFormValues(needCombineExtendKey?: boolean): any;
|
|
@@ -3124,7 +3124,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
3124
3124
|
onKeydown: (event: KeyboardEvent) => Promise<void>;
|
|
3125
3125
|
clearSpan: (uuid: string) => void;
|
|
3126
3126
|
exposeEvent: {
|
|
3127
|
-
validate(path?: string, { force }?: {
|
|
3127
|
+
validate(path?: string | ((field: import("../../../../es/components/form-render").Field<any, any, any, any>) => boolean), { force }?: {
|
|
3128
3128
|
force?: boolean | undefined;
|
|
3129
3129
|
}): Promise<void>;
|
|
3130
3130
|
getFormValues(needCombineExtendKey?: boolean): any;
|
|
@@ -4130,7 +4130,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
4130
4130
|
onKeydown: (event: KeyboardEvent) => Promise<void>;
|
|
4131
4131
|
clearSpan: (uuid: string) => void;
|
|
4132
4132
|
exposeEvent: {
|
|
4133
|
-
validate(path?: string, { force }?: {
|
|
4133
|
+
validate(path?: string | ((field: import("../../../../es/components/form-render").Field<any, any, any, any>) => boolean), { force }?: {
|
|
4134
4134
|
force?: boolean | undefined;
|
|
4135
4135
|
}): Promise<void>;
|
|
4136
4136
|
getFormValues(needCombineExtendKey?: boolean): any;
|
|
@@ -2683,7 +2683,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2683
2683
|
onKeydown: (event: KeyboardEvent) => Promise<void>;
|
|
2684
2684
|
clearSpan: (uuid: string) => void;
|
|
2685
2685
|
exposeEvent: {
|
|
2686
|
-
validate(path?: string, { force }?: {
|
|
2686
|
+
validate(path?: string | ((field: import("../../../../../../es/components/form-render").Field<any, any, any, any>) => boolean), { force }?: {
|
|
2687
2687
|
force?: boolean | undefined;
|
|
2688
2688
|
}): Promise<void>;
|
|
2689
2689
|
getFormValues(needCombineExtendKey?: boolean): any;
|
|
@@ -609,7 +609,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
609
609
|
onKeydown: (event: KeyboardEvent) => Promise<void>;
|
|
610
610
|
clearSpan: (uuid: string) => void;
|
|
611
611
|
exposeEvent: {
|
|
612
|
-
validate(path?: string, { force }?: {
|
|
612
|
+
validate(path?: string | ((field: import("../../../../../../es/components/form-render").Field<any, any, any, any>) => boolean), { force }?: {
|
|
613
613
|
force?: boolean | undefined;
|
|
614
614
|
}): Promise<void>;
|
|
615
615
|
getFormValues(needCombineExtendKey?: boolean): any;
|
|
@@ -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 h,createTextVNode as p,createCommentVNode as f,createBlock as v}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:()=>({})}},emits:["notifyCheck","notifyClear"],setup(e,{emit:K}){var P;const w=e,E=y(),H=t((()=>{var e;return null!=(e=w.searchFilter.itemHeight)?e:300})),W=t((()=>Math.floor(H.value/50))),j=null!=(P=t((()=>w.treeData.filter((e=>!e.children)))))?P:[],{list:I,containerProps:M,wrapperProps:q}=_(j,{itemHeight:50,overscan:W.value}),z=t((()=>({...M.style,height:`${H.value}px`}))),B=t((()=>w.treeData.filter((e=>e.children&&e.children.length>0)))),{list:G,containerProps:J,wrapperProps:L}=_(B,{itemHeight:50,overscan:W.value}),Q=t((()=>({...J.style,height:`${H.value}px`}))),R=l(w.checkedKeys),U=l([]);function V(e){var t;if(R.value.find((t=>t===e.key)))return void E.info(`${e.title}已被选择`);if(e.disabled)return void E.info(`${e.title}已被禁用`);switch((null==(t=e.children)?void 0:t.length)>0?"org":"staff"){case"org":!function(e,t,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==w?void 0:w.searchFilter.multiple)||K("notifyClear")}function X(e,t,l){var a;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,E.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=w.checkedKeys;return!!e&&(l.includes(e.key)?(U.value.push(t),!1):void ee(e.parentNode,t))}return a((()=>w.treeData),(e=>{e&&e.length>0&&(U.value=[],e.forEach((e=>{ee(e,e.key)})))}),{deep:!0,immediate:!0}),a((()=>w.checkedKeys),((e,t)=>{k(e,t)||w.treeData.length>0&&(U.value=[],R.value=e,w.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(j).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(M).ref,style:d(s(I).length>s(W)?s(z):{}),onScroll:l[0]||(l[0]=(...e)=>s(M).onScroll&&s(M).onScroll(...e))},[c("section",{style:d(s(q).style)},[(r(!0),i(n,null,u(s(I),(e=>(r(),i("div",{class:"select-person__multiple-search",key:e.data.key},[c("div",{class:h(["search_item user_item",e.data.disabled?"search_disabled":""]),onClick:t=>V(e.data)},[c("span",b,[p(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("
|
|
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 h,createTextVNode as p,createCommentVNode as f,createBlock as v}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:()=>({})}},emits:["notifyCheck","notifyClear"],setup(e,{emit:K}){var P;const w=e,E=y(),H=t((()=>{var e;return null!=(e=w.searchFilter.itemHeight)?e:300})),W=t((()=>Math.floor(H.value/50))),j=null!=(P=t((()=>w.treeData.filter((e=>!e.children)))))?P:[],{list:I,containerProps:M,wrapperProps:q}=_(j,{itemHeight:50,overscan:W.value}),z=t((()=>({...M.style,height:`${H.value}px`}))),B=t((()=>w.treeData.filter((e=>e.children&&e.children.length>0)))),{list:G,containerProps:J,wrapperProps:L}=_(B,{itemHeight:50,overscan:W.value}),Q=t((()=>({...J.style,height:`${H.value}px`}))),R=l(w.checkedKeys),U=l([]);function V(e){var t;if(R.value.find((t=>t===e.key)))return void E.info(`${e.title}已被选择`);if(e.disabled)return void E.info(`${e.title}已被禁用`);switch((null==(t=e.children)?void 0:t.length)>0?"org":"staff"){case"org":!function(e,t,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==w?void 0:w.searchFilter.multiple)||K("notifyClear")}function X(e,t,l){var a;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,E.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=w.checkedKeys;return!!e&&(l.includes(e.key)?(U.value.push(t),!1):void ee(e.parentNode,t))}return a((()=>w.treeData),(e=>{e&&e.length>0&&(U.value=[],e.forEach((e=>{ee(e,e.key)})))}),{deep:!0,immediate:!0}),a((()=>w.checkedKeys),((e,t)=>{k(e,t)||w.treeData.length>0&&(U.value=[],R.value=e,w.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(j).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(M).ref,style:d(s(I).length>s(W)?s(z):{}),onScroll:l[0]||(l[0]=(...e)=>s(M).onScroll&&s(M).onScroll(...e))},[c("section",{style:d(s(q).style)},[(r(!0),i(n,null,u(s(I),(e=>(r(),i("div",{class:"select-person__multiple-search",key:e.data.key},[c("div",{class:h(["search_item user_item",e.data.disabled?"search_disabled":""]),onClick:t=>V(e.data)},[c("span",b,[p(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)])):f("v-if",!0),s(B).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(W)?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:h(["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)])):f("v-if",!0)],64)):(r(),v(s(m),{key:1,description:"暂无数据"}))])}}});export{K as default};
|
|
@@ -2320,7 +2320,7 @@ declare const ShortcutSetter: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
2320
2320
|
onKeydown: (event: KeyboardEvent) => Promise<void>;
|
|
2321
2321
|
clearSpan: (uuid: string) => void;
|
|
2322
2322
|
exposeEvent: {
|
|
2323
|
-
validate(path?: string, { force }?: {
|
|
2323
|
+
validate(path?: string | ((field: import("@formily/core").Field<any, any, any, any>) => boolean), { force }?: {
|
|
2324
2324
|
force?: boolean | undefined;
|
|
2325
2325
|
}): Promise<void>;
|
|
2326
2326
|
getFormValues(needCombineExtendKey?: boolean): any;
|
|
@@ -2322,7 +2322,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2322
2322
|
onKeydown: (event: KeyboardEvent) => Promise<void>;
|
|
2323
2323
|
clearSpan: (uuid: string) => void;
|
|
2324
2324
|
exposeEvent: {
|
|
2325
|
-
validate(path?: string, { force }?: {
|
|
2325
|
+
validate(path?: string | ((field: import("../../../../es/components/form-render").Field<any, any, any, any>) => boolean), { force }?: {
|
|
2326
2326
|
force?: boolean | undefined;
|
|
2327
2327
|
}): Promise<void>;
|
|
2328
2328
|
getFormValues(needCombineExtendKey?: boolean): any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e="@cnhis-design-vue/shared",i="3.1.52-beta.
|
|
1
|
+
var e="@cnhis-design-vue/shared",i="3.1.52-beta.6",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.1.52-beta.6",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.1.52-beta.
|
|
3
|
+
"version": "3.1.52-beta.6",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"module": "./es/components/index.js",
|
|
6
6
|
"main": "./es/components/index.js",
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
"iOS 7",
|
|
64
64
|
"last 3 iOS versions"
|
|
65
65
|
],
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "e1b8f3376a122918872dea4333eda6bcf8a55d1d"
|
|
67
67
|
}
|