cnhis-design-vue 3.1.42-beta.63 → 3.1.42-beta.64
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 a,openBlock as n,createBlock as u,unref as o,withCtx as i,createVNode as r,withKeys as c,createTextVNode as d,toDisplayString as s,withDirectives as v,vShow as h,createCommentVNode as p,mergeProps as f,createElementBlock as y,createElementVNode as k,Fragment as m,renderList as g}from"vue";import{NGrid as b,NGi as _,NSpace as w,NInputGroup as C,NInput as x,NButton as L,NCheckbox as j,NTree as T,NIcon as $,NTooltip as S}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 U={key:0},N={class:"c-select-person__scroll",style:{height:"342px"}};var K=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},treeSetting:{type:Object,default:()=>({})},queryLoadChildData:{type:Function,default:void 0},queryTreeSearch:{type:Function,default:()=>Promise.resolve([])}},emits:["check","checkWithLevel"],setup(e,{emit:K}){const O=e,A=l(""),E=l(!1),F=l([]),I=l([]),W=l([]),R=l([]),z=l([]),G=l(!0),H=P(function e(l,t){return l&&0!==l.length?l.map((l=>{var a;const n=Y(l),u=t?`${n}/${t}`:n;return{...l,tempTitle:t,children:(null==(a=l.children)?void 0:a.length)?e(null==l?void 0:l.children,u):[]}})):[]}(O.data,""));let J=[];const M=t((()=>!!O.queryLoadChildData));async function Q(e){if(O.queryLoadChildData){const l=await O.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 V(e){var l;(null==(l=e.children)?void 0:l.every((e=>e.disabled)))&&(e.disabled=!0)}function X({option:e}){var l;if((null==(l=e.children)?void 0:l.length)||M.value&&!(null==e?void 0:e.isLeaf)){const l=O.wordbook.user_count_obj&&e[O.wordbook.user_count_obj]||"",t=l?`(${l})`:"";return r("span",null,[`${e.title}${t}`])}return r(S,{trigger:"hover"},{default:()=>r("span",null,[e.title]),trigger:()=>r("span",null,[e.title])})}function Y(e){return e[O.wordbookChild.user_name_obj]||e[O.wordbook.parent_name_obj]||e.orgName||e.title||""}function Z(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)&&Z(a.children),a.disabled||a.children||J.push(a.key)}}async function ee(){G.value=!A.value.trim(),M.value?W.value=await O.queryTreeSearch(A.value):(W.value=B(H,A.value),J=[],Z(W.value),oe()),I.value=W.value.length&&A.value?D(W.value):[]}function le(){setTimeout((()=>{ee()}))}function te(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&&te(a.children,l)}}function ae(e){te(W.value,e)}function ne(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)&&ne(a.children)}}function ue(e){F.value=e}function oe(){E.value=J.every((e=>R.value.findIndex((l=>l.key===e))>-1))}function ie(){F.value=[]}return function e(l){var t,a;for(let n=0,u=l.length;n<u;n++){const u=l[n];u.title=Y(u),u.key||(u.key=u[O.wordbookChild.user_id_obj]||u[O.wordbook.parent_id_obj]||Date.now()),(null==(t=u.children)?void 0:t.length)?(e(u.children),V(u)):0===(null==(a=u.children)?void 0:a.length)&&Reflect.deleteProperty(u,"children"),u.disabled||u.children||J.push(u.key)}}(H),W.value=H,O.defaultList.length>0&&(M.value?(O.defaultList.forEach((e=>F.value.push(e.key))),R.value=P(O.defaultList),z.value=P(O.defaultList)):(O.defaultList.forEach((e=>F.value.push(e))),ne(H))),a((()=>F),(e=>{R.value=z.value.filter((l=>e.value.includes(l.key))),e.value.length&&ne(M.value?W.value:H),oe();const l=R.value.filter((l=>e.value.includes(l.key)));K("check",e.value),K("checkWithLevel",l)}),{deep:!0}),(l,t)=>(n(),u(o(b),{cols:2,class:"c-select-person"},{default:i((()=>[r(o(_),null,{default:i((()=>[r(o(w),{vertical:"",style:{"padding-right":"12px","border-right":"1px solid #e8e8e8"}},{default:i((()=>[r(o(C),{style:{"margin-bottom":"12px"}},{default:i((()=>[r(o(x),{clearable:"",value:A.value,"onUpdate:value":t[0]||(t[0]=e=>A.value=e),placeholder:e.searchPlaceholder,onClear:le,onKeyup:c(ee,["enter"])},null,8,["value","placeholder","onKeyup"]),r(o(L),{type:"primary",onClick:ee},{default:i((()=>[d(s(e.searchButtonText),1)])),_:1})])),_:1}),e.multiple&&G.value?v((n(),u(o(j),{key:0,checked:E.value,"onUpdate:checked":[t[1]||(t[1]=e=>E.value=e),ae]},{default:i((()=>[d(" 全选 ")])),_:1},8,["checked"])),[[h,o(J).length<1e3]]):p("v-if",!0),r(o(T),f({"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:W.value,"check-strategy":"child","render-label":X},e.treeSetting,{"onUpdate:checkedKeys":ue,onLoad:Q}),null,16,["checked-keys","expanded-keys","checkable","selectable","selected-keys","data"])])),_:1})])),_:1}),r(o(_),null,{default:i((()=>[r(o(w),{vertical:"",style:{"padding-left":"12px"}},{default:i((()=>[r(o(w),{justify:"space-between",style:{"margin-bottom":"20px"}},{default:i((()=>[e.showCount?(n(),y("span",U,"已选择:"+s(R.value.length),1)):p("v-if",!0),e.showClear?(n(),y("span",{key:1,class:"c-select-person__clear-btn",onClick:ie},"清空")):p("v-if",!0)])),_:1}),k("div",N,[(n(!0),y(m,null,g(R.value,(e=>(n(),y("span",{class:"c-select-person__tag-item",key:e.key},[d(s(e.name)+" "+s(e.parentName?`(${e.parentName})`:"")+" ",1),r(o($),{class:"tag-close",component:o(q),onClick:l=>function(e){F.value=F.value.filter((l=>l!==e.key))}(e)},null,8,["component","onClick"])])))),128))])])),_:1})])),_:1})])),_:1}))}});export{K as default};
|
|
1
|
+
import{defineComponent as e,ref as l,computed as t,watch as a,openBlock as n,createBlock as u,unref as o,withCtx as i,createVNode as r,withKeys as c,createTextVNode as d,toDisplayString as s,withDirectives as v,vShow as h,createCommentVNode as p,mergeProps as f,createElementBlock as y,createElementVNode as k,Fragment as m,renderList as g}from"vue";import{NGrid as b,NGi as _,NSpace as w,NInputGroup as C,NInput as x,NButton as L,NCheckbox as j,NTree as T,NIcon as $,NTooltip as S}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 U={key:0},N={class:"c-select-person__scroll",style:{height:"342px"}};var K=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},treeSetting:{type:Object,default:()=>({})},queryLoadChildData:{type:Function,default:void 0},queryTreeSearch:{type:Function,default:()=>Promise.resolve([])}},emits:["check","checkWithLevel"],setup(e,{emit:K}){const O=e,A=l(""),E=l(!1),F=l([]),I=l([]),W=l([]),R=l([]),z=l([]),G=l(!0),H=P(function e(l,t){return l&&0!==l.length?l.map((l=>{var a;const n=Y(l),u=t?`${n}/${t}`:n;return{...l,tempTitle:t,children:(null==(a=l.children)?void 0:a.length)?e(null==l?void 0:l.children,u):[]}})):[]}(O.data,""));let J=[];const M=t((()=>!!O.queryLoadChildData));async function Q(e){if(O.queryLoadChildData){const l=await O.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 V(e){var l;(null==(l=e.children)?void 0:l.every((e=>e.disabled)))&&(e.disabled=!0)}function X({option:e}){var l;if((null==(l=e.children)?void 0:l.length)||M.value&&!(null==e?void 0:e.isLeaf)){const l=O.wordbook.user_count_obj&&e[O.wordbook.user_count_obj]||"",t=l?`(${l})`:"";return r("span",null,[`${e.title}${t}`])}return r(S,{trigger:"hover"},{default:()=>r("span",null,[e.title]),trigger:()=>r("span",null,[e.title])})}function Y(e){return e[O.wordbookChild.user_name_obj]||e[O.wordbook.parent_name_obj]||e.orgName||e.title||""}function Z(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)&&Z(a.children),a.disabled||a.children||J.push(a.key)}}async function ee(){G.value=!A.value.trim(),M.value?W.value=await O.queryTreeSearch(A.value):(W.value=B(H,A.value),J=[],Z(W.value),oe()),I.value=W.value.length&&A.value?D(W.value):[]}function le(){setTimeout((()=>{ee()}))}function te(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&&te(a.children,l)}}function ae(e){te(W.value,e)}function ne(e){var l;for(let t=0,a=e.length;t<a;t++){const a=e[t],n=z.value.map((e=>e.key));F.value.includes(a.key)&&!n.includes(a.key)&&R.value.push({key:a.key,name:a.title,parentName:a.tempTitle}),(null==(l=a.children)?void 0:l.length)&&ne(a.children)}}function ue(e){F.value=e}function oe(){E.value=J.every((e=>R.value.findIndex((l=>l.key===e))>-1))}function ie(){F.value=[]}return function e(l){var t,a;for(let n=0,u=l.length;n<u;n++){const u=l[n];u.title=Y(u),u.key||(u.key=u[O.wordbookChild.user_id_obj]||u[O.wordbook.parent_id_obj]||Date.now()),(null==(t=u.children)?void 0:t.length)?(e(u.children),V(u)):0===(null==(a=u.children)?void 0:a.length)&&Reflect.deleteProperty(u,"children"),u.disabled||u.children||J.push(u.key)}}(H),W.value=H,O.defaultList.length>0&&(M.value?(O.defaultList.forEach((e=>F.value.push(e.key))),R.value=P(O.defaultList),z.value=P(O.defaultList)):(O.defaultList.forEach((e=>F.value.push(e))),ne(H))),a((()=>F),(e=>{R.value=z.value.filter((l=>e.value.includes(l.key))),e.value.length&&ne(M.value?W.value:H),oe();const l=R.value.filter((l=>e.value.includes(l.key)));K("check",e.value),K("checkWithLevel",l)}),{deep:!0}),(l,t)=>(n(),u(o(b),{cols:2,class:"c-select-person"},{default:i((()=>[r(o(_),null,{default:i((()=>[r(o(w),{vertical:"",style:{"padding-right":"12px","border-right":"1px solid #e8e8e8"}},{default:i((()=>[r(o(C),{style:{"margin-bottom":"12px"}},{default:i((()=>[r(o(x),{clearable:"",value:A.value,"onUpdate:value":t[0]||(t[0]=e=>A.value=e),placeholder:e.searchPlaceholder,onClear:le,onKeyup:c(ee,["enter"])},null,8,["value","placeholder","onKeyup"]),r(o(L),{type:"primary",onClick:ee},{default:i((()=>[d(s(e.searchButtonText),1)])),_:1})])),_:1}),e.multiple&&G.value?v((n(),u(o(j),{key:0,checked:E.value,"onUpdate:checked":[t[1]||(t[1]=e=>E.value=e),ae]},{default:i((()=>[d(" 全选 ")])),_:1},8,["checked"])),[[h,o(J).length<1e3]]):p("v-if",!0),r(o(T),f({"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:W.value,"check-strategy":"child","render-label":X},e.treeSetting,{"onUpdate:checkedKeys":ue,onLoad:Q}),null,16,["checked-keys","expanded-keys","checkable","selectable","selected-keys","data"])])),_:1})])),_:1}),r(o(_),null,{default:i((()=>[r(o(w),{vertical:"",style:{"padding-left":"12px"}},{default:i((()=>[r(o(w),{justify:"space-between",style:{"margin-bottom":"20px"}},{default:i((()=>[e.showCount?(n(),y("span",U,"已选择:"+s(R.value.length),1)):p("v-if",!0),e.showClear?(n(),y("span",{key:1,class:"c-select-person__clear-btn",onClick:ie},"清空")):p("v-if",!0)])),_:1}),k("div",N,[(n(!0),y(m,null,g(R.value,(e=>(n(),y("span",{class:"c-select-person__tag-item",key:e.key},[d(s(e.name)+" "+s(e.parentName?`(${e.parentName})`:"")+" ",1),r(o($),{class:"tag-close",component:o(q),onClick:l=>function(e){F.value=F.value.filter((l=>l!==e.key))}(e)},null,8,["component","onClick"])])))),128))])])),_:1})])),_:1})])),_:1}))}});export{K as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e="@cnhis-design-vue/shared",i="3.1.42-beta.
|
|
1
|
+
var e="@cnhis-design-vue/shared",i="3.1.42-beta.64",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.42-beta.64",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.42-beta.
|
|
3
|
+
"version": "3.1.42-beta.64",
|
|
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": "80da2ef0015b53ee0cee20ae3f1339b70d1cd5c0"
|
|
65
65
|
}
|