cnhis-design-vue 3.1.52-beta.29 → 3.1.52-beta.30
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as l,computed as t,watch as n,openBlock as a,createBlock as u,unref as i,withCtx as r,createVNode as c,createCommentVNode as o,withKeys as s,createTextVNode as d,toDisplayString as h,withDirectives as v,vShow as p,createElementBlock as f,Fragment as y,mergeProps as k,createElementVNode as m,renderList as g}from"vue";import{NGrid as _,NGi as b,NSpace as C,NInputGroup as w,NInput as x,NIcon as L,NButton as S,NCheckbox as j,NTree as T}from"naive-ui";import{CloseCircleSharp as N}from"@vicons/ionicons5";import{searchFilterTree as I,getExpandedKeys as F}from"./utils/index.js";import{cloneDeep as O}from"lodash-es";import{SearchTypeConfig as $}from"./types/enums.js";import D from"./SearchMultiple.vue.js";import
|
|
1
|
+
import{defineComponent as e,ref as l,computed as t,watch as n,openBlock as a,createBlock as u,unref as i,withCtx as r,createVNode as c,createCommentVNode as o,withKeys as s,createTextVNode as d,toDisplayString as h,withDirectives as v,vShow as p,createElementBlock as f,Fragment as y,mergeProps as k,createElementVNode as m,renderList as g}from"vue";import{NGrid as _,NGi as b,NSpace as C,NInputGroup as w,NInput as x,NIcon as L,NButton as S,NCheckbox as j,NTree as T}from"naive-ui";import{CloseCircleSharp as N}from"@vicons/ionicons5";import{searchFilterTree as I,getExpandedKeys as F}from"./utils/index.js";import{cloneDeep as O}from"lodash-es";import{SearchTypeConfig as $}from"./types/enums.js";import D from"./SearchMultiple.vue.js";import K from"./SearchOrgAndStaff.vue.js";const q={key:0},A={class:"c-select-person__scroll",style:{height:"342px"}};var B=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},searchInner:{type:Boolean,default:!1},searchFilter:{type:Object,default:()=>({})},treeSetting:{type:Object,default:()=>({})},queryLoadChildData:{type:Function,default:void 0},queryTreeSearch:{type:Function,default:()=>Promise.resolve([])}},emits:["check","checkWithLevel"],setup(e,{expose:B,emit:E}){const P=e,R={isOpen:!1,multiple:!1,customTitles:["联系人","部门"],itemHeight:250},U=l(""),H=l(!1),W=l([]),G=l([]),z=l([]),M=l([]),J=l([]),Q=l(!1),V=O(function e(l){var t;for(let n=0,a=l.length;n<a;n++){const a=l[n];if(null==(t=a.children)?void 0:t.length){const l=se(a.children,[]);a.innerItemsNum=l.length,a.innerLeafs=l,e(a.children)}}return de(l,"")}(P.data));let X=[];const Y=t((()=>!!P.queryLoadChildData)),Z=t((()=>{var e,l;return null!=(l=null==(e=null==P?void 0:P.treeSetting)?void 0:e.checkStrategy)?l:"child"})),ee=t((()=>(null==P?void 0:P.searchFilter)&&Object.keys(null==P?void 0:P.searchFilter).length>0)),le=t((()=>ee.value?{...O(R),...P.searchFilter}:O(R))),te=t((()=>{var e,l;return null!=(l=null==(e=null==P?void 0:P.wordbookChild)?void 0:e.user_expand_keys)?l:[]})),ne=t((()=>{let e=[];return W.value.forEach((l=>{for(let t=0,n=M.value.length;t<n;t++){const n=M.value[t];if(n.key==l){e.push(n);break}}})),e}));function ae(e){e.disabled||e.children||!e.key||X.push(e.key)}function ue(e){e.disabled||e.tempTitle||!e.key||X.push(e.key)}async function ie(e){if(P.queryLoadChildData){const l=await P.queryLoadChildData(e);return l.children&&(l.children=l.children.map((e=>({...e,tempTitle:l.tempTitle?`${l.title}/${l.tempTitle}`:l.title})))),l}return e}function re(e){var l;(null==(l=e.children)?void 0:l.every((e=>e.disabled)))&&(e.disabled=!0)}function ce({option:e}){var l,t;if((null==(l=e.children)?void 0:l.length)||Y.value&&!(null==e?void 0:e.isLeaf)){const l=P.wordbook.user_count_obj&&e[P.wordbook.user_count_obj]||"",t=l?`(${l})`:"";return c("span",null,[`${e.title}${t}`])}{const l=null!=(t=e.title_expand_strs)?t:"";return c("p",{class:"user_item"},[e.title,c("span",{class:"user_item_expand",title:l},[l])])}}function oe(e){return e[P.wordbookChild.user_name_obj]||e[P.wordbook.parent_name_obj]||e.orgName||e.title||""}function se(e,l){var t;for(let n=0,a=e.length;n<a;n++){const a=e[n];(null==(t=a.children)?void 0:t.length)?se(a.children,l):!a.disabled&&l.push(a)}return l}function de(e,l){return e&&0!==e.length?e.map((e=>{var t;const n=oe(e),a=l?`${n}/${l}`:n;return{...e,tempTitle:l,children:(null==(t=e.children)?void 0:t.length)?de(null==e?void 0:e.children,a):[]}})):[]}async function he(){var e,l;const t=null!=(l=null==(e=null==P?void 0:P.wordbook)?void 0:e.filter_key)?l:"keyword";if(Q.value=!!U.value.trim(),Y.value)z.value=await P.queryTreeSearch(U.value);else{const e=function(){const e={[$.SEARCH_ORG_STAFF]:ee.value,[$.SEARCH_ORG]:P.searchInner},l=Object.keys(e).find((l=>e[l]));return null!=l?l:""}();z.value=I(e,V,U.value,t)}G.value=z.value.length&&U.value?F(z.value):[]}function ve(e,l){var t,n;switch(null!=(n=null==(t=null==P?void 0:P.treeSetting)?void 0:t.checkStrategy)?n:"child"){case"child":!function(e,l){for(let t=0,n=e.length;t<n;t++){const n=e[t];if(!n.disabled&&(!n.children||n.isLeaf)&&(l&&!W.value.includes(n.key)&&W.value.push(n.key),!l)){const e=W.value.findIndex((e=>e===n.key));W.value.splice(e,1)}n.children&&ve(n.children,l)}}(e,l);break;case"parent":!function(e,l){W.value=[];for(let t=0,n=e.length;t<n;t++){const n=e[t];if(!n.disabled&&!n.tempTitle&&(l&&!W.value.includes(n.key)&&W.value.push(n.key),!l)){const e=W.value.findIndex((e=>e===n.key));W.value.splice(e,1)}}}(e,l)}}function pe(e){ve(z.value,e)}function fe(e){var l;for(let t=0,n=e.length;t<n;t++){const n=e[t],a=J.value.map((e=>e.key));W.value.includes(n.key)&&!a.includes(n.key)&&M.value.push({key:n.key,name:n.title,parentName:n.tempTitle,innerItemsNum:n.innerItemsNum,innerLeafs:n.innerLeafs,originItem:n}),(null==(l=n.children)?void 0:l.length)&&fe(n.children)}}function ye(e){W.value=e}function ke(){W.value=[]}function me(e){W.value=e}function ge(){U.value="",setTimeout((()=>{he()}))}return function e(l,t){var n,a,u,i;for(let r=0,c=l.length;r<c;r++){const c=l[r];let o=te.value.reduce(((e,l)=>e+(c[l]?`${c[l]},`:"")),"");switch(c.title_expand_strs=o.slice(0,-1),c.title=oe(c),c.label=oe(c),c.parentNode=t,c.key||(c.key=c[P.wordbookChild.user_id_obj]||c[P.wordbook.parent_id_obj]||Date.now()),(null==(n=c.children)?void 0:n.length)?(e(c.children,c),re(c)):0===(null==(a=c.children)?void 0:a.length)&&Reflect.deleteProperty(c,"children"),null!=(i=null==(u=null==P?void 0:P.treeSetting)?void 0:u.checkStrategy)?i:"child"){case"child":ae(c);break;case"parent":ue(c)}}}(V,null),z.value=V,P.defaultList.length>0&&(Y.value?(P.defaultList.forEach((e=>W.value.push(e.key))),M.value=O(P.defaultList),J.value=O(P.defaultList)):(P.defaultList.forEach((e=>W.value.push(e))),fe(V))),n((()=>W),(e=>{M.value=J.value.filter((l=>e.value.includes(l.key))),e.value.length&&fe(Y.value?z.value:V),H.value=X.every((e=>M.value.findIndex((l=>l.key===e))>-1));const l=M.value.filter((l=>e.value.includes(l.key)));E("check",e.value),E("checkWithLevel",l)}),{deep:!0}),n((()=>U.value),(e=>{e||ge()})),B({getCheckWithLevel:function(){const e=W.value,l=M.value.filter((l=>e.includes(l.key)));return null!=l?l:[]}}),(l,t)=>(a(),u(i(_),{cols:2,class:"c-select-person"},{default:r((()=>[c(i(b),null,{default:r((()=>[c(i(C),{vertical:"",style:{"padding-right":"12px","border-right":"1px solid #e8e8e8"}},{default:r((()=>[c(i(w),{style:{"margin-bottom":"12px"}},{default:r((()=>[o(" clearable "),c(i(x),{class:"search-input",value:U.value,"onUpdate:value":t[0]||(t[0]=e=>U.value=e),placeholder:e.searchPlaceholder,onKeyup:s(he,["enter"])},{suffix:r((()=>[U.value?(a(),u(i(L),{key:0,class:"search-clear",component:i(N),size:"16",onClick:ge},null,8,["component"])):o("v-if",!0)])),_:1},8,["value","placeholder","onKeyup"]),c(i(S),{type:"primary",onClick:he},{default:r((()=>[d(h(e.searchButtonText),1)])),_:1})])),_:1}),e.multiple&&!Q.value?v((a(),u(i(j),{key:0,checked:H.value,"onUpdate:checked":[t[1]||(t[1]=e=>H.value=e),pe]},{default:r((()=>[d(" 全选 ")])),_:1},8,["checked"])),[[p,i(X).length<1e3]]):o("v-if",!0),o(" 支持选人 "),e.searchInner&&e.multiple&&Q.value&&"parent"===i(Z)?(a(),u(D,{key:1,treeData:z.value,checkedKeys:W.value,onNotifyCheck:me},null,8,["treeData","checkedKeys"])):i(ee)&&e.multiple&&Q.value&&"parent"===i(Z)?(a(),f(y,{key:2},[o(" 同时兼容选人和选部门 "),c(K,{treeData:z.value,checkedKeys:W.value,searchFilter:i(le),onNotifyCheck:me,onNotifyClear:ge},null,8,["treeData","checkedKeys","searchFilter"])],2112)):(a(),u(i(T),k({key:3,"virtual-scroll":"",class:"c-select-person__scroll","checked-keys":W.value,"expanded-keys":G.value,"onUpdate:expanded-keys":t[2]||(t[2]=e=>G.value=e),checkable:e.multiple,cascade:"","allow-checking-not-loaded":"",selectable:!e.multiple,"selected-keys":W.value,"onUpdate:selected-keys":t[3]||(t[3]=e=>W.value=e),data:z.value,"check-strategy":"child","render-label":ce},e.treeSetting,{"onUpdate:checkedKeys":ye,onLoad:ie}),null,16,["checked-keys","expanded-keys","checkable","selectable","selected-keys","data"]))])),_:1})])),_:1}),c(i(b),null,{default:r((()=>[c(i(C),{vertical:"",style:{"padding-left":"12px"}},{default:r((()=>[c(i(C),{justify:"space-between",style:{"margin-bottom":"20px"}},{default:r((()=>[e.showCount?(a(),f("span",q,"已选择:"+h(i(ne).length),1)):o("v-if",!0),e.showClear?(a(),f("span",{key:1,class:"c-select-person__clear-btn",onClick:ke},"清空")):o("v-if",!0)])),_:1}),m("div",A,[(a(!0),f(y,null,g(i(ne),(e=>(a(),f("span",{class:"c-select-person__tag-item",key:e.key},[d(h(e.name)+" "+h(e.parentName?`(${e.parentName})`:"")+" "+h(e.innerItemsNum?`(${e.innerItemsNum}人)`:"")+" ",1),c(i(L),{class:"tag-close",component:i(N),onClick:l=>function(e){W.value=W.value.filter((l=>l!==e.key))}(e)},null,8,["component","onClick"])])))),128))])])),_:1})])),_:1})])),_:1}))}});export{B as default};
|
|
@@ -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.30",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.30",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.30",
|
|
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": "299301e4a58211fa5cd426aac974fbaf489144d5"
|
|
67
67
|
}
|