cnhis-design-vue 3.1.42-beta.57 → 3.1.42-beta.58
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/iho-table/src/IhoTable.vue.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue.d.ts +1 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue.js +1 -1
- package/es/components/select-person/index.d.ts +15 -7
- package/es/components/select-person/src/SelectPerson.vue.d.ts +9 -5
- package/es/components/select-person/src/SelectPerson.vue2.js +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,computed as t,provide as
|
|
1
|
+
import{defineComponent as e,computed as t,provide as a,ref as o,watch as l,resolveComponent as s,openBlock as n,createElementBlock as i,unref as r,normalizeStyle as u,createBlock as c,resolveDynamicComponent as f,createElementVNode as d,createVNode as m,mergeProps as p,createSlots as v,renderList as b,withCtx as h,createCommentVNode as g,renderSlot as x}from"vue";import{useTheme as k}from"../../../shared/hooks/useTheme.js";import{useDebounceFn as y}from"@vueuse/core";import"date-fns";import{isString as C,isFunction as D}from"lodash-es";import{widthAppend as j,uuidGenerator as $}from"../../../shared/utils/index.js";import{promiseTimeout as _}from"@vueuse/shared";import{VxeTableEventNameList as H,InjectionIhoTableEmits as T,InjectionIhoTableAnnotation as w,InjectionIhoTableUUID as A,InjectionIhoTableInstance as L,InjectionIhoTableConfig as R,InjectionIhoTableFieldList as E,InjectionIhoTableHandler as F}from"./constants/index.js";import{createTableHooks as I,applyTableConfigHooks as O,applyTableFieldHooks as S,createTableEventHandlers as W,createDomInsertComponent as q,createDataTransfer as z}from"./hooks/tapHooks/index.js";import{provideIhoTableEventListener as B}from"./hooks/tapHooks/useEventHooks.js";import{eventName2EventListener as G}from"./utils/index.js";import J from"../../../_virtual/plugin-vue_export-helper.js";const K=["id"];var M=J(e({__name:"IhoTable",props:{tableConfig:{type:Object,default:()=>({})},fieldList:{type:Array,default:()=>[]},tableData:{type:Array,default:()=>[]},annotation:{type:Object}},emits:["formChange","settingClick","formClick","keyboard","rowDrag",...H],setup(e,{expose:H,emit:J}){var M,N;const P=e,Q=k({"--c-border-color":"#e2e2e2","--c-head-bg-color":"#f2f2f2","--c-hover-color":"#f7f7f7"}),U=t((()=>{var e,t;const a=null!=(t=null==(e=P.tableConfig)?void 0:e.height)?t:"100%";return{height:"auto"===a?"100%":C(a)&&(a.includes("calc")||a.endsWith("%"))?a:j(a)}})),V=B(),X=function(e,...t){J(e,...t);const a=r(te)[G(e)];D(a)&&a(...t),V.trigger(e,...t)};a(T,X);const Y=I();a(w,t((()=>P.annotation)));const Z=$();a(A,Z);const ee=o();a(L,ee);const te=o({uuid:null!=(N=null==(M=P.tableConfig)?void 0:M.uuid)?N:Z});a(R,te);const ae=y(oe,10);function oe(){te.value=O(Y,P.tableConfig,{$table:ee,emits:X}),te.value.uuid=Z}const le=o([]);a(E,le);const se=y(ne,10);function ne(){le.value=S(Y,P.fieldList,te.value,{$table:ee,emits:X})}const ie=z(Y,te,ee),re=o([]),ue=y(ce,10);async function ce(){var e;re.value=await ie(P.tableData),null==(e=ee.value)||e.recalculate(!0)}const fe={updateTableDataRef:ue,updateConfigRef:ae,updateFieldListRef:se};a(F,fe);const de=W({hooks:Y,config:te,$table:ee,context:fe,emits:X}),me=t((()=>({...te.value,...de})));l((()=>P.tableConfig),(()=>{ae(),se(),ue()}),{deep:!0}),l((()=>P.fieldList),(()=>{se(),ue()}),{deep:!0}),l([()=>P.tableData,()=>{var e;return null==(e=P.tableData)?void 0:e.length}],(async()=>{var e,t;(null==(e=te.value.treeConfig)?void 0:e.expandAll)&&(await _(11),null==(t=ee.value)||t.setAllTreeExpand(!0))})),l([()=>[...P.tableData],()=>{var e;return null==(e=P.tableData)?void 0:e.length}],ue),oe(),ne(),ce();const{header:pe,footer:ve}=q(Y);return H({$table:ee,async loadData(e){var t;null==(t=ee.value)||t.loadData(await ie(e))},setSort:(e,t)=>({field:e,value:t}),setFilter:(e,t)=>({field:e,value:t}),...Y.exposeHooks.expose.call({},te,{$table:ee,emits:X})}),Y.setupHooks.setup.call(te,le,{$table:ee,emits:X}),(e,t)=>{const a=s("vxe-grid");return n(),i("section",{class:"iho-table",id:r(Z),style:u(r(Q))},[(n(),c(f(r(pe)))),d("section",{style:u(r(U))},[m(a,p({ref_key:"$table",ref:ee},r(me),{columns:le.value,data:re.value}),v({_:2},[b(e.$slots,((t,a)=>({name:a,fn:h((()=>[g(" 实际上所有的vxe-grid插槽都支持 "),x(e.$slots,a)]))})))]),1040,["columns","data"])],4),(n(),c(f(r(ve))))],12,K)}}}),[["__file","IhoTable.vue"]]);export{M as default};
|
|
@@ -45,6 +45,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
45
45
|
emit: (event: "click" | "update:formattedValue", ...args: any[]) => void;
|
|
46
46
|
formRef: import("vue").Ref<HTMLElement | null>;
|
|
47
47
|
isShow: import("vue").Ref<boolean>;
|
|
48
|
+
timePickerRef: import("vue").Ref<any>;
|
|
48
49
|
__formattedValue: import("vue").Ref<string | undefined>;
|
|
49
50
|
oldValue: string | undefined;
|
|
50
51
|
placeholder: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,useAttrs as t,ref as a,openBlock as
|
|
1
|
+
import{defineComponent as e,useAttrs as t,ref as l,watch as a,nextTick as o,openBlock as r,createBlock as u,unref as i,mergeProps as n,withCtx as m,createVNode as f,isRef as d,createElementBlock as c,Fragment as v,renderList as s,createTextVNode as p,toDisplayString as _,createCommentVNode as k}from"vue";import{NPopover as h,NInput as y,NSpace as w,NScrollbar as V,NButton as b}from"naive-ui";import{useIhoTableFormEvent as g}from"../../../../utils/index.js";import{useAutoFocus as j}from"../hooks/useAutoFocus.js";import C from"../../../../../../time-picker/index.js";import{parse as F,isValid as q,format as x}from"date-fns";import R from"../../../../../../../_virtual/plugin-vue_export-helper.js";var S=R(e({__name:"editTime",props:{formattedValue:{type:String,default:void 0},column:{type:Object,required:!0},row:{type:Object,required:!0},rowIndex:{type:Number,required:!0}},emits:["update:formattedValue","click"],setup(e,{emit:R}){const S=e,A=t(),{emitFormChangeWithParams:I}=g(S),{formRef:O,isShow:P}=j(),$=l(),E=l(S.formattedValue);let H=S.formattedValue;const{placeholder:T="请选择",valueFormat:U="HH:mm",shortcutOptions:z=[]}=A,B={placeholder:T,valueFormat:U,format:U};function D(e){E.value=e,H!==e&&(R("update:formattedValue",e),I({oldValue:H}),H=e)}function K(){const e=F(S.formattedValue||"",B.valueFormat.replace(/:/,""),new Date);if(q(e)){D(x(e,B.valueFormat))}}function N(e){var t;const{key:l}=e;"Enter"===l&&(null==(t=O.value)||t.blur(),P.value=!1)}return a((()=>P.value),(async e=>{var t,l,a,r,u;e&&(await o(),null==(u=null==(r=null==(a=null==(l=null==(t=$.value)?void 0:t.$timePicker)?void 0:l.panelInstRef)?void 0:a.$el)?void 0:r.querySelectorAll(".n-time-picker-col"))||u.forEach((e=>{var t,l;return null==(l=null==(t=null==e?void 0:e.querySelector)?void 0:t.call(e,".n-time-picker-col__item--active"))?void 0:l.scrollIntoView()})))})),(t,l)=>(r(),u(i(h),n({show:i(P),trigger:"click",showArrow:!1,placement:"bottom-start",style:{padding:"0"}},t.$attrs,{onClickoutside:l[3]||(l[3]=()=>P.value=!1)}),{trigger:m((()=>[f(i(y),{ref_key:"formRef",ref:O,clearable:"",value:e.formattedValue,"onUpdate:value":l[0]||(l[0]=e=>d(formattedValue)?formattedValue.value=e:null),onClick:l[1]||(l[1]=()=>P.value=!0),onBlur:K,onKeyup:N},null,8,["value"])])),default:m((()=>[f(i(w),null,{default:m((()=>[f(i(C),n({ref_key:"timePickerRef",ref:$,show:"","formatted-value":E.value},i(B),{class:"iho-table__time-picker",to:!1,"onUpdate:formattedValue":D,onConfirm:l[2]||(l[2]=()=>P.value=!1)}),null,16,["formatted-value"]),f(i(V),{class:"iho-table__scrollbar"},{default:m((()=>[i(z).length?(r(),u(i(w),{key:0,vertical:"",wrap:!1},{default:m((()=>[(r(!0),c(v,null,s(i(z),(e=>(r(),u(i(b),{size:"tiny",key:e,onClick:t=>function(e){D(e),P.value=!1}(e)},{default:m((()=>[p(_(e),1)])),_:2},1032,["onClick"])))),128))])),_:1})):k("v-if",!0)])),_:1})])),_:1})])),_:1},16,["show"]))}}),[["__file","editTime.vue"]]);export{S as default};
|
|
@@ -2,6 +2,7 @@ import { SFCWithInstall } from '../../../es/shared/types';
|
|
|
2
2
|
declare const SelectPerson: SFCWithInstall<import("vue").DefineComponent<{
|
|
3
3
|
defaultList: {
|
|
4
4
|
type: import("vue").PropType<((string | number) | {
|
|
5
|
+
[key: string]: any;
|
|
5
6
|
key: string | number;
|
|
6
7
|
name: string;
|
|
7
8
|
})[]>;
|
|
@@ -49,7 +50,7 @@ declare const SelectPerson: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
49
50
|
default: boolean;
|
|
50
51
|
};
|
|
51
52
|
queryLoadChildData: {
|
|
52
|
-
type: import("vue").PropType<(node: import("naive-ui").TreeOption) => Promise<
|
|
53
|
+
type: import("vue").PropType<(node: import("naive-ui").TreeOption) => Promise<import("../../../es/shared/types").AnyObject>>;
|
|
53
54
|
default: undefined;
|
|
54
55
|
};
|
|
55
56
|
queryTreeSearch: {
|
|
@@ -60,6 +61,7 @@ declare const SelectPerson: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
60
61
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
61
62
|
defaultList: {
|
|
62
63
|
type: import("vue").PropType<((string | number) | {
|
|
64
|
+
[key: string]: any;
|
|
63
65
|
key: string | number;
|
|
64
66
|
name: string;
|
|
65
67
|
})[]>;
|
|
@@ -107,7 +109,7 @@ declare const SelectPerson: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
107
109
|
default: boolean;
|
|
108
110
|
};
|
|
109
111
|
queryLoadChildData: {
|
|
110
|
-
type: import("vue").PropType<(node: import("naive-ui").TreeOption) => Promise<
|
|
112
|
+
type: import("vue").PropType<(node: import("naive-ui").TreeOption) => Promise<import("../../../es/shared/types").AnyObject>>;
|
|
111
113
|
default: undefined;
|
|
112
114
|
};
|
|
113
115
|
queryTreeSearch: {
|
|
@@ -134,28 +136,31 @@ declare const SelectPerson: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
134
136
|
suffix?: (() => import("vue").VNodeChild) | undefined;
|
|
135
137
|
}[]>;
|
|
136
138
|
tagData: import("vue").Ref<{
|
|
139
|
+
[x: string]: any;
|
|
137
140
|
key: string | number;
|
|
138
141
|
name: string;
|
|
139
142
|
}[]>;
|
|
140
|
-
temp:
|
|
141
|
-
[k: string]: unknown;
|
|
142
|
-
} & import("../../../es/shared/types").AnyObject)[];
|
|
143
|
+
temp: import("naive-ui").TreeOption[];
|
|
143
144
|
allCheckedKeys: (string | number)[];
|
|
144
145
|
isRemote: import("vue").ComputedRef<boolean>;
|
|
145
146
|
init: () => void;
|
|
147
|
+
queryLoadChildNode: (node: import("naive-ui").TreeOption) => Promise<import("../../../es/shared/types").AnyObject>;
|
|
146
148
|
setDisabled: (data: import("naive-ui").TreeOption) => void;
|
|
147
149
|
renderLabel: ({ option }: {
|
|
148
150
|
option: import("naive-ui").TreeOption;
|
|
149
151
|
}) => JSX.Element;
|
|
150
152
|
getLabelName: (option: import("naive-ui").TreeOption) => unknown;
|
|
153
|
+
transformParentNodeName: (trees: import("naive-ui").TreeOption[], temp: any) => import("naive-ui").TreeOption[];
|
|
151
154
|
setAllCheckedKeys: (tree: import("naive-ui").TreeOption[]) => void;
|
|
152
155
|
onSearch: () => Promise<void>;
|
|
153
156
|
setTreeCheckd: (tree: import("naive-ui").TreeOption[], checked: boolean) => void;
|
|
154
157
|
checkedAllChange: (checked: boolean) => void;
|
|
155
158
|
uniq: (arr: {
|
|
159
|
+
[key: string]: any;
|
|
156
160
|
key: string | number;
|
|
157
161
|
name: string;
|
|
158
162
|
}[]) => {
|
|
163
|
+
[key: string]: any;
|
|
159
164
|
key: string | number;
|
|
160
165
|
name: string;
|
|
161
166
|
}[];
|
|
@@ -164,6 +169,7 @@ declare const SelectPerson: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
164
169
|
setCheckedAll: () => void;
|
|
165
170
|
clearAll: () => void;
|
|
166
171
|
closeTag: (tag: {
|
|
172
|
+
[key: string]: any;
|
|
167
173
|
key: string | number;
|
|
168
174
|
name: string;
|
|
169
175
|
}) => void;
|
|
@@ -239,6 +245,7 @@ declare const SelectPerson: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
239
245
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "check"[], "check", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
240
246
|
defaultList: {
|
|
241
247
|
type: import("vue").PropType<((string | number) | {
|
|
248
|
+
[key: string]: any;
|
|
242
249
|
key: string | number;
|
|
243
250
|
name: string;
|
|
244
251
|
})[]>;
|
|
@@ -286,7 +293,7 @@ declare const SelectPerson: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
286
293
|
default: boolean;
|
|
287
294
|
};
|
|
288
295
|
queryLoadChildData: {
|
|
289
|
-
type: import("vue").PropType<(node: import("naive-ui").TreeOption) => Promise<
|
|
296
|
+
type: import("vue").PropType<(node: import("naive-ui").TreeOption) => Promise<import("../../../es/shared/types").AnyObject>>;
|
|
290
297
|
default: undefined;
|
|
291
298
|
};
|
|
292
299
|
queryTreeSearch: {
|
|
@@ -300,6 +307,7 @@ declare const SelectPerson: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
300
307
|
[k: string]: unknown;
|
|
301
308
|
} & import("../../../es/shared/types").AnyObject)[];
|
|
302
309
|
defaultList: ((string | number) | {
|
|
310
|
+
[key: string]: any;
|
|
303
311
|
key: string | number;
|
|
304
312
|
name: string;
|
|
305
313
|
})[];
|
|
@@ -317,7 +325,7 @@ declare const SelectPerson: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
317
325
|
showCount: boolean;
|
|
318
326
|
showClear: boolean;
|
|
319
327
|
multiple: boolean;
|
|
320
|
-
queryLoadChildData: (node: import("naive-ui").TreeOption) => Promise<
|
|
328
|
+
queryLoadChildData: (node: import("naive-ui").TreeOption) => Promise<import("../../../es/shared/types").AnyObject>;
|
|
321
329
|
queryTreeSearch: (keyWork: string) => Promise<import("../../../es/shared/types").AnyObject[]>;
|
|
322
330
|
}>>;
|
|
323
331
|
export default SelectPerson;
|
|
@@ -15,6 +15,7 @@ declare type IWordBookChild<T> = {
|
|
|
15
15
|
declare type ITag = {
|
|
16
16
|
key: IKey;
|
|
17
17
|
name: string;
|
|
18
|
+
[key: string]: any;
|
|
18
19
|
};
|
|
19
20
|
declare const _default: import("vue").DefineComponent<{
|
|
20
21
|
defaultList: {
|
|
@@ -54,7 +55,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
54
55
|
default: boolean;
|
|
55
56
|
};
|
|
56
57
|
queryLoadChildData: {
|
|
57
|
-
type: PropType<(node: TreeOption) => Promise<
|
|
58
|
+
type: PropType<(node: TreeOption) => Promise<AnyObject>>;
|
|
58
59
|
default: undefined;
|
|
59
60
|
};
|
|
60
61
|
queryTreeSearch: {
|
|
@@ -100,7 +101,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
100
101
|
default: boolean;
|
|
101
102
|
};
|
|
102
103
|
queryLoadChildData: {
|
|
103
|
-
type: PropType<(node: TreeOption) => Promise<
|
|
104
|
+
type: PropType<(node: TreeOption) => Promise<AnyObject>>;
|
|
104
105
|
default: undefined;
|
|
105
106
|
};
|
|
106
107
|
queryTreeSearch: {
|
|
@@ -127,18 +128,21 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
127
128
|
suffix?: (() => import("vue").VNodeChild) | undefined;
|
|
128
129
|
}[]>;
|
|
129
130
|
tagData: import("vue").Ref<{
|
|
131
|
+
[x: string]: any;
|
|
130
132
|
key: IKey;
|
|
131
133
|
name: string;
|
|
132
134
|
}[]>;
|
|
133
|
-
temp:
|
|
135
|
+
temp: TreeOption[];
|
|
134
136
|
allCheckedKeys: IKey[];
|
|
135
137
|
isRemote: import("vue").ComputedRef<boolean>;
|
|
136
138
|
init: () => void;
|
|
139
|
+
queryLoadChildNode: (node: TreeOption) => Promise<AnyObject>;
|
|
137
140
|
setDisabled: (data: TreeOption) => void;
|
|
138
141
|
renderLabel: ({ option }: {
|
|
139
142
|
option: TreeOption;
|
|
140
143
|
}) => JSX.Element;
|
|
141
144
|
getLabelName: (option: TreeOption) => unknown;
|
|
145
|
+
transformParentNodeName: (trees: TreeOption[], temp: any) => TreeOption[];
|
|
142
146
|
setAllCheckedKeys: (tree: TreeOption[]) => void;
|
|
143
147
|
onSearch: () => Promise<void>;
|
|
144
148
|
setTreeCheckd: (tree: TreeOption[], checked: boolean) => void;
|
|
@@ -256,7 +260,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
256
260
|
default: boolean;
|
|
257
261
|
};
|
|
258
262
|
queryLoadChildData: {
|
|
259
|
-
type: PropType<(node: TreeOption) => Promise<
|
|
263
|
+
type: PropType<(node: TreeOption) => Promise<AnyObject>>;
|
|
260
264
|
default: undefined;
|
|
261
265
|
};
|
|
262
266
|
queryTreeSearch: {
|
|
@@ -275,7 +279,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
275
279
|
showCount: boolean;
|
|
276
280
|
showClear: boolean;
|
|
277
281
|
multiple: boolean;
|
|
278
|
-
queryLoadChildData: (node: TreeOption) => Promise<
|
|
282
|
+
queryLoadChildData: (node: TreeOption) => Promise<AnyObject>;
|
|
279
283
|
queryTreeSearch: (keyWork: string) => Promise<Array<AnyObject>>;
|
|
280
284
|
}>;
|
|
281
285
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as l,computed as t,watch as a,openBlock as n,createBlock as o,unref as u,withCtx as
|
|
1
|
+
import{defineComponent as e,ref as l,computed as t,watch as a,openBlock as n,createBlock as o,unref as u,withCtx as r,createVNode as i,withKeys as d,createTextVNode as c,toDisplayString as s,withDirectives as h,vShow as p,createCommentVNode as v,createElementBlock as f,createElementVNode as y,Fragment as k,renderList as m}from"vue";import{NGrid as g,NGi as b,NSpace as _,NInputGroup as w,NInput as x,NButton as C,NCheckbox as L,NTree as j,NIcon as T,NTooltip as $}from"naive-ui";import{CloseCircleSharp as q}from"@vicons/ionicons5";import{filterTree as B,getExpandedKeys as D}from"./utils/index.js";import{cloneDeep as P}from"lodash-es";const S={key:0},U={class:"c-select-person__scroll",style:{height:"342px"}};var N=e({__name:"SelectPerson",props:{defaultList:{type:Array,default:()=>[]},data:{type:Array,default:()=>[]},searchPlaceholder:{type:String,default:"输入关键字搜索"},searchButtonText:{type:String,default:"搜索"},wordbook:{type:Object,default:()=>({})},wordbookChild:{type:Object,default:()=>({})},showCount:{type:Boolean,default:!0},showClear:{type:Boolean,default:!0},multiple:{type:Boolean,default:!0},queryLoadChildData:{type:Function,default:void 0},queryTreeSearch:{type:Function,default:()=>Promise.resolve([])}},emits:["check"],setup(e,{emit:N}){const K=e,A=l(""),E=l(!1),F=l([]),I=l([]),O=l([]),R=l([]),z=P(function e(l,t){return l&&0!==l.length?l.map((l=>{var a;const n=V(l),o=t?`${t}/${n}`:n;return{...l,tempTitle:t,children:(null==(a=l.children)?void 0:a.length)?e(null==l?void 0:l.children,o):[]}})):[]}(K.data,""));let G=[];const H=t((()=>!!K.queryLoadChildData));async function J(e){if(K.queryLoadChildData){const l=await K.queryLoadChildData(e);return l.children&&(l.children=l.children.map((e=>({...e,tempTitle:l.tempTitle?`${l.tempTitle}/${l.title}`:l.title})))),l}return e}function M(e){var l;(null==(l=e.children)?void 0:l.every((e=>e.disabled)))&&(e.disabled=!0)}function Q({option:e}){var l;if((null==(l=e.children)?void 0:l.length)||H.value&&!(null==e?void 0:e.isLeaf)){const l=K.wordbook.user_count_obj&&e[K.wordbook.user_count_obj]||"",t=l?`(${l})`:"";return i("span",null,[`${e.title}${t}`])}return i($,{trigger:"hover"},{default:()=>i("span",null,[e.title]),trigger:()=>i("span",null,[e.title])})}function V(e){return e[K.wordbookChild.user_name_obj]||e[K.wordbook.parent_name_obj]||e.orgName||e.title||""}function W(e){var l;for(let t=0,a=e.length;t<a;t++){const a=e[t];(null==(l=a.children)?void 0:l.length)&&W(a.children),a.disabled||a.children||G.push(a.key)}}async function X(){H.value?O.value=await K.queryTreeSearch(A.value):(O.value=B(z,A.value),G=[],W(O.value),te()),I.value=O.value.length&&A.value?D(O.value):[]}function Y(e,l){for(let t=0,a=e.length;t<a;t++){const a=e[t];if(!a.disabled&&(!a.children||a.isLeaf)&&(l&&!F.value.includes(a.key)&&F.value.push(a.key),!l)){const e=F.value.findIndex((e=>e===a.key));F.value.splice(e,1)}a.children&&Y(a.children,l)}}function Z(e){Y(O.value,e)}function ee(e){var l;for(let t=0,a=e.length;t<a;t++){const a=e[t];F.value.includes(a.key)&&R.value.push({key:a.key,name:a.title,parentName:a.tempTitle}),(null==(l=a.children)?void 0:l.length)&&ee(a.children)}}function le(e){F.value=e}function te(){E.value=G.every((e=>R.value.findIndex((l=>l.key===e))>-1))}function ae(){F.value=[]}return function e(l){var t,a;for(let n=0,o=l.length;n<o;n++){const o=l[n];o.title=V(o),o.key||(o.key=o[K.wordbookChild.user_id_obj]||o[K.wordbook.parent_id_obj]||Date.now()),(null==(t=o.children)?void 0:t.length)?(e(o.children),M(o)):0===(null==(a=o.children)?void 0:a.length)&&Reflect.deleteProperty(o,"children"),o.disabled||o.children||G.push(o.key)}}(z),O.value=z,K.defaultList.length>0&&(H.value?(K.defaultList.forEach((e=>F.value.push(e.key))),R.value=P(K.defaultList)):(K.defaultList.forEach((e=>F.value.push(e))),ee(z))),a((()=>F),(e=>{R.value=[],e.value.length&&ee(H.value?O.value:z),te(),N("check",e.value)}),{deep:!0}),(l,t)=>(n(),o(u(g),{cols:2,class:"c-select-person"},{default:r((()=>[i(u(b),null,{default:r((()=>[i(u(_),{vertical:"",style:{"padding-right":"12px","border-right":"1px solid #e8e8e8"}},{default:r((()=>[i(u(w),{style:{"margin-bottom":"12px"}},{default:r((()=>[i(u(x),{clearable:"",value:A.value,"onUpdate:value":t[0]||(t[0]=e=>A.value=e),placeholder:e.searchPlaceholder,onKeyup:d(X,["enter"])},null,8,["value","placeholder","onKeyup"]),i(u(C),{type:"primary",onClick:X},{default:r((()=>[c(s(e.searchButtonText),1)])),_:1})])),_:1}),e.multiple?h((n(),o(u(L),{key:0,checked:E.value,"onUpdate:checked":[t[1]||(t[1]=e=>E.value=e),Z]},{default:r((()=>[c(" 全选 ")])),_:1},8,["checked"])),[[p,u(G).length<1e3]]):v("v-if",!0),i(u(j),{"virtual-scroll":"",class:"c-select-person__scroll","checked-keys":F.value,"expanded-keys":I.value,"onUpdate:expanded-keys":t[2]||(t[2]=e=>I.value=e),checkable:e.multiple,cascade:"","allow-checking-not-loaded":"",selectable:!e.multiple,"selected-keys":F.value,"onUpdate:selected-keys":t[3]||(t[3]=e=>F.value=e),data:O.value,"check-strategy":"child","render-label":Q,"onUpdate:checkedKeys":le,onLoad:J},null,8,["checked-keys","expanded-keys","checkable","selectable","selected-keys","data"])])),_:1})])),_:1}),i(u(b),null,{default:r((()=>[i(u(_),{vertical:"",style:{"padding-left":"12px"}},{default:r((()=>[i(u(_),{justify:"space-between",style:{"margin-bottom":"20px"}},{default:r((()=>[e.showCount?(n(),f("span",S,"已选择:"+s(R.value.length),1)):v("v-if",!0),e.showClear?(n(),f("span",{key:1,class:"c-select-person__clear-btn",onClick:ae},"清空")):v("v-if",!0)])),_:1}),y("div",U,[(n(!0),f(k,null,m(R.value,(e=>(n(),f("span",{class:"c-select-person__tag-item",key:e.key},[c(s(e.name)+" "+s(e.parentName?`(${e.parentName})`:"")+" ",1),i(u(T),{class:"tag-close",component:u(q),onClick:l=>function(e){F.value=F.value.filter((l=>l!==e.key))}(e)},null,8,["component","onClick"])])))),128))])])),_:1})])),_:1})])),_:1}))}});export{N as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cnhis-design-vue",
|
|
3
|
-
"version": "3.1.42-beta.
|
|
3
|
+
"version": "3.1.42-beta.58",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"module": "./es/components/index.js",
|
|
6
6
|
"main": "./es/components/index.js",
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"iOS 7",
|
|
62
62
|
"last 3 iOS versions"
|
|
63
63
|
],
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "b1be2c611d0bef3999c7de1cba8913094958dd77"
|
|
65
65
|
}
|