cnhis-design-vue 3.1.51-beta.21 → 3.1.51-beta.23
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/base-search/index.d.ts +3 -0
- package/es/components/base-search/src/index.vue.d.ts +3 -0
- package/es/components/base-search/src/index.vue2.js +1 -1
- package/es/components/form-render/src/FormRender.vue2.js +1 -1
- package/es/components/form-render/src/types/index.d.ts +1 -0
- package/es/components/iho-table/src/IhoTable.vue2.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/index.js +1 -1
- package/es/components/quick-search/index.d.ts +3 -0
- package/es/components/quick-search/src/index.vue.d.ts +3 -0
- package/es/components/quick-search/src/index.vue2.js +1 -1
- package/es/components/slider-tree/index.d.ts +16 -9
- package/es/components/slider-tree/src/index.vue.d.ts +16 -9
- package/es/components/slider-tree/src/index.vue2.js +1 -1
- package/es/shared/package.json.js +1 -1
- package/package.json +2 -2
|
@@ -137,6 +137,7 @@ declare const CBaseSearch: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
137
137
|
accurateSearch?: any;
|
|
138
138
|
isAccurateSearchVal?: boolean | undefined;
|
|
139
139
|
}[]>;
|
|
140
|
+
filterChangeFnList: import("vue").Ref<any[]>;
|
|
140
141
|
showQuickSearch: import("vue").ComputedRef<boolean>;
|
|
141
142
|
showResetBtn: import("vue").ComputedRef<boolean>;
|
|
142
143
|
initOutSearchFieldList: () => void;
|
|
@@ -150,6 +151,8 @@ declare const CBaseSearch: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
150
151
|
resetFunc: (arr: import("..").ISearchType[]) => void;
|
|
151
152
|
getFilterParams: () => {};
|
|
152
153
|
setFilterParams: (params?: any) => void;
|
|
154
|
+
getOriginalConfig: () => import("..").IApiServerType[];
|
|
155
|
+
onFilterChange: (fn: any) => void;
|
|
153
156
|
RenderWidget: import("vue").DefineComponent<{
|
|
154
157
|
cfg: {
|
|
155
158
|
type: ObjectConstructor;
|
|
@@ -138,6 +138,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
138
138
|
accurateSearch?: any;
|
|
139
139
|
isAccurateSearchVal?: boolean | undefined;
|
|
140
140
|
}[]>;
|
|
141
|
+
filterChangeFnList: import("vue").Ref<any[]>;
|
|
141
142
|
showQuickSearch: import("vue").ComputedRef<boolean>;
|
|
142
143
|
showResetBtn: import("vue").ComputedRef<boolean>;
|
|
143
144
|
initOutSearchFieldList: () => void;
|
|
@@ -151,6 +152,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
151
152
|
resetFunc: (arr: ISearchType[]) => void;
|
|
152
153
|
getFilterParams: () => {};
|
|
153
154
|
setFilterParams: (params?: any) => void;
|
|
155
|
+
getOriginalConfig: () => IApiServerType[];
|
|
156
|
+
onFilterChange: (fn: any) => void;
|
|
154
157
|
RenderWidget: import("vue").DefineComponent<{
|
|
155
158
|
cfg: {
|
|
156
159
|
type: ObjectConstructor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as t,provide as a,computed as
|
|
1
|
+
import{defineComponent as e,ref as t,provide as a,computed as i,watch as l,openBlock as n,createElementBlock as r,createElementVNode as s,createCommentVNode as o,renderSlot as c,unref as u,createVNode as f,withCtx as d,createTextVNode as m,toDisplayString as h,Fragment as p,renderList as v}from"vue";import g from"../../table-filter/src/components/render-widget/index.vue.js";import b from"../../table-filter/src/hooks/useMixins.js";import y from"../../table-filter/src/hooks/useAdvanced.js";import C from"../../table-filter/src/hooks/useRenderWidget.js";import{NButton as k,NIcon as j}from"naive-ui";import{Search as A}from"@vicons/ionicons5";import{isObject as S,cloneDeep as O}from"lodash-es";import{InjectionFilterApiConfig as x,InjectionFilterSearchConfig as F}from"../../table-filter/src/constants/index.js";const q={class:"base-search-block"},R={class:"base-container"},V={class:"bease-left"},Q={class:"base-ul"},N={key:0,class:"baseli showQuickBtn"},_=s("i",{class:"iconfont-table-filter icon-table-filter-shaixuan",style:{color:"inherit","margin-right":"6px"}},null,-1),w={key:0,class:"qqConObjCount"},E={key:1,class:"baseli"},I={key:2,class:"baseli"},P=s("i",{class:"iconfont-table-filter icon-table-filter-reset",style:{"margin-right":"6px"}},null,-1);var B=e({__name:"index",props:{showSettings:{type:Object,default:()=>({hideQuickSearch:0,hideResetBtn:0})},searchFieldList:{type:Array,default:()=>[]},qqConObjCount:{type:Number,default:0},filterApiConfig:{type:Object},appendValueConfig:{type:Object,default:()=>({})}},emits:["foldQuickSearch","onFilterSearch","handleReset","getFilterParam"],setup(e,{expose:B,emit:L}){const U=e,{outQuickSearchFn:D}=b(),{isRender:W,getRenderSearchConObj:$,isExistDefValByRenderWidget:z,resetRenderWidgetValue:M}=C(),{transformData:T,transformParams:G}=y(),H=t([]),J=t(!1),K=t([]),X=t([]);a(x,U.filterApiConfig),a(F,K);const Y=i((()=>ee("hideQuickSearch"))),Z=i((()=>ee("hideResetBtn")));function ee(e){return 0==U.showSettings[e]}function te(){L("foldQuickSearch",!0)}function ae(e={}){const t=ie()||[];!function(e,t,a=!1,i={}){let l=[];K.value.length>0&&(l=O(K.value));L("onFilterSearch",e,t,a,l,i)}(t,G(t),!0,e)}function ie(){return function(e){if(!Array.isArray(e))return[];let t=[];for(let a=0;a<e.length;a++){let i=e[a];const l=$(i);l&&t.push(l)}return t.filter((e=>e.value||Object.keys(e).includes("isAccurateSearch")))}(K.value)}function le(){!function(e){if(!Array.isArray(e))return;e.forEach((e=>{M(e)})),D.handlerInitSearchItem(e)}(K.value),L("handleReset",{targetType:"outQuickSearchReset"})}return l((()=>U.searchFieldList),(e=>{e&&e.length>0&&function(){K.value=[];let e=O(T(U.searchFieldList,{_filterApiConfig:U.filterApiConfig})).filter((e=>1==e.isShowSearch&&1==e.filterExplicit));K.value=e,D.handlerInitSearchItem(K.value),K.value.some((e=>W(e)?z(e):!!e.explicitDefaultVal))}()}),{immediate:!0,deep:!0}),l((()=>U.qqConObjCount),(e=>{const t=H.value.length||0;J.value=t+Number(e)>0&&Z.value}),{immediate:!0}),l((()=>K),(()=>{H.value=ie()||[];const e=G(H.value);J.value=H.value.length+Number(U.qqConObjCount)>0&&Z.value,L("getFilterParam",H.value,e),X.value.forEach((t=>t(e)))}),{immediate:!0,deep:!0}),l((()=>U.appendValueConfig),(e=>{if(S(e)&&Object.keys(e).length>0){const t=Object.keys(e);K.value.forEach((a=>{t.includes(a.columnName)&&(a.value=e[a.columnName])}))}}),{immediate:!0,deep:!0}),B({handleReset:le,getFilterParams:function(){const e=ie()||[];return G(e)},setFilterParams:function(e){const t=e?Object.keys(e):[];t.length>0&&K.value.forEach((a=>{var i;if(W(a)&&t.includes(a.columnName)){const t=e[a.columnName];a.value=Array.isArray(t)&&!1===(null==(i=a.widgetCfg)?void 0:i.multiple)?t[0]:t}}))},getOriginalConfig:function(){return U.searchFieldList},onFilterChange:function(e){X.value.push(e)}}),(t,a)=>(n(),r("div",q,[s("div",R,[s("div",V,[s("ul",Q,[o(" 筛选分类插槽 "),c(t.$slots,"classification"),u(Y)?(n(),r("li",N,[f(u(k),{class:"search-default",type:"default",onClick:te},{default:d((()=>[_,m(" 筛选"),e.qqConObjCount?(n(),r("span",w,"("+h(e.qqConObjCount)+")",1)):o("v-if",!0)])),_:1})])):o("v-if",!0),o(" start--筛选外显--start "),(n(!0),r(p,null,v(K.value,(e=>(n(),r(p,null,[e.isRender?(n(),r("li",{class:"baseli outQuickSearch-li",key:e._frontId},[f(g,{cfg:e,modelValue:e.value,"onUpdate:modelValue":t=>e.value=t,isAccurate:e.isAccurateSearchVal,"onUpdate:isAccurate":t=>e.isAccurateSearchVal=t,onOutFilterChange:ae},null,8,["cfg","modelValue","onUpdate:modelValue","isAccurate","onUpdate:isAccurate"])])):o("v-if",!0)],64)))),256)),o(" end--筛选外显--end "),o(" 查询按钮 "),K.value&&K.value.length>0?(n(),r("li",E,[f(u(k),{type:"primary",onClick:ae},{default:d((()=>[f(u(j),{component:u(A),size:"16",style:{"margin-right":"6px"}},null,8,["component"]),m(" 查询 ")])),_:1})])):o("v-if",!0),o(" 重置按钮 "),J.value?(n(),r("li",I,[f(u(k),{onClick:le},{default:d((()=>[P,m(" 重置 ")])),_:1})])):o("v-if",!0),o(" 业务按钮插槽 "),c(t.$slots,"buttons")])])])]))}});export{B as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as o,computed as t,provide as r,onMounted as s,onUnmounted as a,nextTick as i,openBlock as l,createBlock as n,unref as m,normalizeClass as d,normalizeStyle as p,withCtx as u,createElementBlock as c,createVNode as f,isRef as h,Fragment as y,renderList as g,createCommentVNode as j,createElementVNode as b,withKeys as
|
|
1
|
+
import{defineComponent as e,ref as o,computed as t,provide as r,onMounted as s,onUnmounted as a,nextTick as i,openBlock as l,createBlock as n,unref as m,normalizeClass as d,normalizeStyle as p,withCtx as u,createElementBlock as c,createVNode as f,isRef as h,Fragment as y,renderList as g,createCommentVNode as j,createElementVNode as b,withKeys as v,toDisplayString as k,renderSlot as F}from"vue";import{useTheme as C}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{isNumber as S,cloneDeep as H,isObject as x,isBoolean as A}from"lodash-es";import{createForm as L,onFormMount as O,onFieldValueChange as B,onFieldMount as R,onFieldUnmount as w,onFieldReact as _}from"@formily/core";import{Path as D}from"@formily/path";import{FormProvider as V,FormConsumer as I}from"@formily/vue";import{NForm as N,NTabs as q,NTabPane as W,NConfigProvider as E}from"naive-ui";import{InjectionFormLifeCycleCaller as K,InjectionFormGraph as T}from"./constants/index.js";import{useAutoHidden as U}from"./hooks/useAutoHidden.js";import{useComplexOptionsSpan as G}from"./hooks/useComplexOptions.js";import{useFormDomEvent as M,useFormExposeEvent as P}from"./hooks/useFormEvent.js";import{useFormGraph as J}from"./hooks/useFormGraph.js";import{useFormRenderLifeCycle as $}from"./hooks/useFormRenderLifeCycle.js";import{useLowCodeEvent as z}from"./hooks/useLowCodeEvent.js";import{useLowCodeReactions as Q}from"./hooks/useLowCodeReactions.js";import{useNuiThemeOverrides as X}from"./hooks/useNuiThemeOverrides.js";import{useOperationalForm as Y}from"./hooks/useOperationalForm.js";import{useWordbookSetting as Z}from"./hooks/useWordbookSetting.js";import"../../../shared/utils/index.js";import"@vicons/ionicons5";import"@vue/shared";import"../index.js";import{createObjSchema as ee}from"./utils/schema.js";import{useFieldListAdaptor as oe}from"./hooks/useFieldListAdaptor.js";import{useFieldVisitor as te}from"./hooks/useFieldVisitor.js";import"../../../shared/utils/tapable/SyncHook.js";import"../../../shared/utils/tapable/SyncBailHook.js";import"../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../shared/utils/tapable/SyncLoopHook.js";import"../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import{validateMessageLocale as re}from"./hooks/useFormValidator.js";import{useAnchor as se}from"./hooks/useAnchor.js";import{useFormContext as ae}from"./hooks/useFormContext.js";import"./hooks/useFormRenderOptions.js";const ie={key:0,style:{height:"54px"}},le={style:{"white-space":"pre"}};var ne=e({__name:"FormRender",props:{fieldList:{type:Array},initialData:{type:Object,default:()=>({})},fieldVisitor:{type:Object},column:{type:Number,default:24},maxHeight:{type:[Number,String],default:""},anchor:{type:Boolean,default:!1},parallelism:{type:Number,default:3},businessFormatter:{type:Function},schema:{type:Object},components:{type:Object,default:()=>({})},scope:{type:Object,default:()=>({})},annotation:{type:Object},consumer:{type:Boolean,default:!1},uuid:{type:String},lifeCycle:{type:Object},requestInstance:{type:Object},enterToNextWidget:{type:[Boolean,Function],default:!0},lowCodeReactions:{type:Array},operationalForm:{type:Object},linebarAutoHidden:{type:Boolean},bordered:{type:[Boolean,String],default:!0},outBordered:{type:Boolean,default:!1},uniqueCacheData:{type:Boolean,default:!1},forceClearable:Boolean},emits:["formChange","annotationChange","scroll"],setup(e,{expose:ne,emit:me}){const de=e,pe=C(),{nuiThemeOverrides:ue}=X();re();const ce=o(),fe=t((()=>S(de.maxHeight)?de.maxHeight+"px":de.maxHeight)),{SchemaField:he,businessCollector:ye,formItemDepsCollector:ge,changeContextCollector:je,formUUID:be}=ae(de,me),{anchorBarRef:ve,currentAnchor:ke,updateAnchorList:Fe,anchorIdList:Ce,onScroll:Se}=se(de,me,ce,ge),{callLifeCycle:He}=$(de);r(K,He),He("onSetup");const{trigger:xe}=U(),{observeFormGraph:Ae,setGraph:Le,removeGraph:Oe}=J();r(T,Ae);const{lowCodeEventTrigger:Be}=z(),Re=L({initialValues:de.initialData,effects(e){const o={};O((()=>{Object.assign(o,H(e.values))})),B("*",(t=>{const r=D.getIn(o,t.path);D.setIn(o,t.path,t.value);const s=t.props.name.toString();ye.trigger(e,s),ge.trigger(s),me("formChange",{fieldInstance:t,fieldKey:s,oldValue:r,fieldName:t.title,value:t.value,context:je.getContext(s,t.value)}),Be(t),we(s),De(s),Ie(s,t.value)})),R("*",Le),w("*",Oe),de.linebarAutoHidden&&(_("*",xe),O((e=>e.query("*").forEach(xe)))),de.anchor&&_("*",Fe)}}),{lowCodeReactionsHandler:we,triggerAllReactionsHandler:_e}=Q(t((()=>de.lowCodeReactions)),Re),{operationalFormHandler:De,triggerAllOperationalFormHandler:Ve}=Y(t((()=>de.operationalForm)),Re),{wordbookSettingHandler:Ie}=Z(Re,je);s(_e),s(Ve);const{schemaAdaptor:Ne}=oe(ye);let qe=de.fieldList||[];const We=t((()=>de.schema?de.schema:de.fieldList?(qe=te().traverse(H(de.fieldList),de.fieldVisitor),ee(Ne(qe,de))):ee({}))),{onKeydown:Ee}=M({formModel:Re,formRenderRef:ce,props:de}),{clearSpan:Ke}=G();a((()=>Ke(be)));const Te=P({formModel:Re,formRenderRef:ce,formItemDepsCollector:ge,getFieldList:()=>qe,formUUID:be});return ne({formModel:Re,validate:(e="*",o={})=>Te.validate(e,o),getFormValues:(e=!0)=>Te.getFormValues(e),async setFormValues(e,o={},t=!1,r=!0){var s,a,l,n;let m=!0,d=!0;x(o)?(d=null==(s=o.needSplitExtendKey)||s,m=null==(a=o.avoidDependKeyConnection)||a,t=null!=(l=o.avoidBusinessConnection)&&l,r=null==(n=o.overwrite)||n):A(o)&&(d=o),t&&(ye.triggerLock=!0),m&&(ge.triggerDisabled=!0),Te.setFormValues(e,d,r),await i(),ye.triggerLock=!1,ge.triggerDisabled=!1},setFieldState(e,o){Te.setFieldState(e,o)},resetFields(e="*"){Te.resetFields(e)},queryWidget:async e=>Te.queryWidget(e),getFieldList:()=>qe,async reload(){console.error("reload function is abstract,it should be overwrite!")}}),(o,t)=>(l(),n(m(N),{class:d(["form-render",{"form-render--out-border":e.outBordered}]),"require-mark-placement":"left",style:p(m(pe))},{default:u((()=>[e.anchor?(l(),c("section",ie,[f(m(q),{value:m(ke),"onUpdate:value":t[0]||(t[0]=e=>h(ke)?ke.value=e:null),type:"line",ref_key:"anchorBarRef",ref:ve},{default:u((()=>[(l(!0),c(y,null,g(m(Ce),(e=>(l(),n(m(W),{name:e.name,tab:e.title,key:e.name},null,8,["name","tab"])))),128))])),_:1},8,["value"])])):j("v-if",!0),f(m(E),{"theme-overrides":m(ue)},{default:u((()=>[b("section",{class:"form-render__wrapper",style:p({"--column":e.column,"--form-height":m(fe)}),ref_key:"formRenderRef",ref:ce,onScroll:t[1]||(t[1]=(...e)=>m(Se)&&m(Se)(...e)),onKeydownCapture:t[2]||(t[2]=v(((...e)=>m(Ee)&&m(Ee)(...e)),["enter"]))},[f(m(V),{form:m(Re)},{default:u((()=>[f(m(he),{schema:m(We)},null,8,["schema"]),e.consumer?(l(),n(m(I),{key:0},{default:u((({form:e})=>[b("div",le,k(JSON.stringify(e.values,null,2)),1)])),_:1})):j("v-if",!0),F(o.$slots,"default")])),_:3},8,["form"])],36)])),_:3},8,["theme-overrides"])])),_:3},8,["class","style"]))}});export{ne as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,computed as t,provide as a,ref as o,
|
|
1
|
+
import{defineComponent as e,computed as t,provide as a,ref as o,toRaw as l,watch as n,resolveComponent as r,openBlock as s,createElementBlock as i,unref as u,normalizeStyle as d,createBlock as c,resolveDynamicComponent as f,createElementVNode as v,createVNode as m,mergeProps as p,createSlots as b,renderList as g,withCtx as h,createCommentVNode as x,renderSlot as k,normalizeProps as y,guardReactiveProps as D}from"vue";import{useTheme as C}from"../../../shared/hooks/useTheme.js";import{useDebounceFn as $}from"@vueuse/core";import"date-fns";import{isString as j,isEqualWith as w,isFunction as I,pick as H}from"lodash-es";import{widthAppend as T,uuidGenerator as _}from"../../../shared/utils/index.js";import{promiseTimeout as A}from"@vueuse/shared";import{VxeTableEventNameList as L,InjectionIhoTableEmits as R,InjectionIhoTableAnnotation as S,InjectionIhoTableUUID as E,InjectionIhoTableInstance as F,InjectionIhoTableConfig as O,InjectionIhoTableFieldList as B,InjectionIhoTableHandler as W}from"./constants/index.js";import{createTableHooks as q,applyTableConfigHooks as z,applyTableFieldHooks as G,createTableEventHandlers as J,createDomInsertComponent as K,createDataTransfer as M}from"./hooks/tapHooks/index.js";import{provideIhoTableEventListener as N}from"./hooks/tapHooks/useEventHooks.js";import{eventName2EventListener as P}from"./utils/index.js";const Q=["id"];var U=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",...L],setup(e,{expose:L,emit:U}){var V,X;const Y=e,Z=C({"--c-border-color":"#e2e2e2","--c-head-bg-color":"#f2f2f2","--c-hover-color":"#f7f7f7"}),ee=t((()=>{var e,t;const a=null!=(t=null==(e=Y.tableConfig)?void 0:e.height)?t:"100%";return{height:"auto"===a?"100%":j(a)&&(a.includes("calc")||a.endsWith("%"))?a:T(a)}})),te=N(),ae=function(e,...t){U(e,...t);const a=u(re)[P(e)];I(a)&&a(...t),te.trigger(e,...t)};a(R,ae);const oe=q();a(S,t((()=>Y.annotation)));const le=_();a(E,le);const ne=o();a(F,ne);const re=o({uuid:null!=(X=null==(V=Y.tableConfig)?void 0:V.uuid)?X:le});a(O,re);const se=$(ie,10);function ie(){re.value=z(oe,Y.tableConfig,{$table:ne,emits:ae}),re.value.uuid=le}const ue=o([]);a(B,ue);const de=$(ce,10);function ce(){const e=G(oe,Y.fieldList,re.value,{$table:ne,emits:ae});w(e,l(ue.value),((e,t)=>{if(I(e)&&I(t))return e.toString()===t.toString()}))||(ue.value=e)}const fe=M(oe,re,ne),ve=o([]);async function me(){var e,t;const a=await fe(Y.tableData),o=null==(e=ne.value)?void 0:e.getTableData().fullData;if(o){let e=0;if(!(o.some((t=>{var o;if(!(null==(o=ne.value)?void 0:o.isInsertByRow(t))){if(t!==a[e])return!0;e++}}))||e!==a.length))return}ve.value=a,null==(t=ne.value)||t.recalculate(!0)}const pe={updateTableDataRef:$(me,10),updateConfigRef:se,updateFieldListRef:de};a(W,pe);const be=J({hooks:oe,config:re,$table:ne,context:pe,emits:ae}),ge=t((()=>({...re.value,...be})));let he=!1,xe=!1,ke=!1;const ye=$((()=>{he&&ie(),xe&&ce(),ke&&me(),he=!1,xe=!1,ke=!1}),10);n((()=>Y.tableConfig),(()=>{he=!0,xe=!0,ke=!0,ye()}),{deep:!0}),n((()=>Y.fieldList),(()=>{xe=!0,ke=!0,ye()}),{deep:!0}),n([()=>[...Y.tableData],()=>{var e;return null==(e=Y.tableData)?void 0:e.length}],(()=>{ke=!0,ye()})),n([()=>Y.tableData,()=>{var e;return null==(e=Y.tableData)?void 0:e.length}],(async()=>{var e,t;(null==(e=re.value.treeConfig)?void 0:e.expandAll)&&(await A(11),null==(t=ne.value)||t.setAllTreeExpand(!0))})),ie(),ce(),me();const{header:De,footer:Ce}=K(oe);function $e(e){return H(e,["row","rowIndex","$rowIndex","column","columnIndex","$columnIndex","_columnIndex","checked","disabled","indeterminate"])}return L({$table:ne,async loadData(e){var t;null==(t=ne.value)||t.loadData(await fe(e))},setSort:(e,t)=>({field:e,value:t}),setFilter:(e,t)=>({field:e,value:t}),reload(){var e,t;null==(e=ne.value)||e.loadColumn([]),null==(t=ne.value)||t.loadData([]),ie(),ce(),me()},...oe.exposeHooks.expose.call({},re,{$table:ne,emits:ae})}),oe.setupHooks.setup.call(re,ue,{$table:ne,emits:ae}),(e,t)=>{const a=r("vxe-grid");return s(),i("section",{class:"iho-table",id:u(le),style:d(u(Z))},[(s(),c(f(u(De)))),v("section",{style:d(u(ee))},[m(a,p({ref_key:"$table",ref:ne},u(ge),{columns:ue.value,data:ve.value}),b({_:2},[g(e.$slots,((t,a)=>({name:a,fn:h((t=>[x(" 实际上所有的vxe-grid插槽都支持 "),k(e.$slots,a,y(D($e(t))))]))})))]),1040,["columns","data"])],4),(s(),c(f(u(Ce))))],12,Q)}}});export{U as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{reactive as e,inject as t,createVNode as a,toRaw as o,h as r,onBeforeUnmount as n}from"vue";import{traverse as i,arrayed as
|
|
1
|
+
import{reactive as e,inject as t,createVNode as a,toRaw as o,h as r,onBeforeUnmount as n}from"vue";import{traverse as i,arrayed as u}from"../../../../../../../shared/utils/index.js";import{isFunction as l,isObject as s,isArray as d,compact as p,range as c,uniq as f,flatten as _}from"lodash-es";import{NInput as m}from"naive-ui";import"../../../../../index.js";import{EDITABLE_WIDGET_TYPE as E,InjectionIhoTableUUID as A,InjectionIhoTableHandler as h}from"../../../../constants/index.js";import{useAutoFocus as v}from"../hooks/useAutoFocus.js";import{createIhoTableClearActivedInterceptor as R,getLowCodeFieldFromField as g,IhoTableRenderHelper as T,getRowHeight as D,getColumnRenderWidth as w,parseMergeField as b}from"../../../../utils/index.js";import P from"./editSeparate.vue.js";import{contentSeparate as $,getLengthDiffArray as x,getColumnInfoMaxLength as C,generateSeparateRowData as S,isSeparateColumn as k}from"./separateUtils.js";import{getSeparateInfo as H,setSeparateInfo as j,deleteSeparateInfo as M}from"../../../../utils/separateMap.js";import{defineTablePlugin as O}from"../../../../hooks/useTablePlugin.js";function I(){const I="separateRendererPlugins",F=e(new Map);return O({name:I,vxe(e){e.interceptor.add("event.clearActived",R(E.SEPARATE,(e=>e.classList.contains("v-binder-follower-content")))),e.renderer.add(E.SEPARATE,{renderCell(e,{column:o,row:r}){var n,i;const u=t(A),l=null!=(i=null==(n=H(u,r))?void 0:n.separateData)?i:{},s=g(o),d=(null==s?void 0:s.separateFormatter)?s.separateFormatter(l[o.field]):l[o.field];return a("section",{class:"iho-table__ellipsis",title:d},[d])},renderEdit:T.createRenderEdit((({fieldItem:e,column:n,row:i,emitFormClick:u})=>{var d,p;const c=t(A),f=H(c,i),_=D(),E={};let v=null!=(p=null==(d=e.componentProps)?void 0:d.separateSlot)?p:e.separateSlot;return v&&(v=o(v),E.menu=l(v)?v:s(v)?e=>r(v,e):void 0),e.separateRowEdit?function(){if(!f)return[];if(f.ihoTableHandler=t(h),f.separateData["__"+n.field]=f.separateData["__"+n.field]||f.separateData[n.field],E.menu){const e=E.menu;return a(e,{column:n,col:n,row:i,value:f.separateData["__"+n.field],"onUpdate:value":e=>f.separateData["__"+n.field]=e},null)}return a(m,{value:f.separateData["__"+n.field],"onUpdate:value":e=>f.separateData["__"+n.field]=e},null)}():[a(P,{value:i[n.field],"onUpdate:value":e=>i[n.field]=e,"row-index":null==f?void 0:f.index,height:_,column:n,row:i,"display-content":null==(R=null==f?void 0:f.separateData)?void 0:R[n.field],onClick:u},E)];var R}))})},apply(e){function t(e){return(...t)=>{var a;return!(null==(a=t[0].row)?void 0:a.$__SEPARATE)&&(!l(e)||e(...t))}}v(e).bindAutoFocusConfig(I,E.SEPARATE,".iho-table__separateText"),e.eventHooks.onEditClosed.tap(I,(({row:e,column:t,$table:a},o,{emits:r})=>{if(!e.$__uuid)return;const n=g(t);if(!n||!n.separateRowEdit)return;const i=H(e.$__uuid,e);if(!i)return;const{separateData:u,originalData:l,ihoTableHandler:s,index:p}=i,{field:c}=t;if(u["__"+c]&&u["__"+c]!==u[c]&&d(l.$__SEPARATE_DATA)){const e=l.$__SEPARATE_DATA.map((e=>{var t;return null!=(t=e["__"+c])?t:e[c]})),o=l[c];l[c]=d(l[c])?e:e.join(""),r("formChange",{value:l[c],oldValue:o,row:l,column:t,index:p,$table:a}),null==s||s.updateTableDataRef()}})),e.fieldHooks.fieldList.tap(I,((e,{uuid:t})=>(t&&F.set(t,e.reduce(((e,t)=>(i(t,(t=>{k(t)&&(e.push(o(t)),t.showOverflow="ellipsis")})),e)),[])),e))),e.dataHooks.data.tapPromise(I,(async(e,t,{insertAfter:a,index:o,$table:r})=>{var n;if(!t.uuid)return;const i=F.get(t.uuid);if(!i||!i.length)return;const l=[];for(const t of i){if(!t.field)continue;const a=await w(t,r),o={field:t.field,column:t,data:$(b(e,t),t,a,null==(n=g(t))?void 0:n.separateDeep)};l.push(o)}function s(e){return l.find((t=>t.field===e))}l.forEach((e=>{const{column:t}=e,a=g(t);if(!a)return;if(!a.separateDeep||!a.separateBinder)return;const o=p(u(a.separateBinder).map(s));if(!o.length)return;const r=o.concat(e),n=Math.max(...r.map((e=>e.data.length)));c(n).forEach((e=>{const t=r.map((t=>({item:t.data[e],data:t.data}))),a=t.map((({item:e})=>n(e)));if(1===f(a).length)return;const o=Math.max(...a);function n(e){return d(e)?e.length:1}t.forEach((({item:t,data:a})=>{const r=n(t);r!==o&&(d(t)?t.push(...x(o,r)):a[e]=c(o).map(((e,a)=>0===a?t:"")))}))}))})),l.forEach((e=>{e.data=_(e.data)})),c(C(l)).forEach(((r,n,i)=>{var u;const s=S(l,n),d={index:o,originalData:e,separateData:s,separateIndex:n,separateLength:i.length,isOriginRow:0===n,isLastRow:n===i.length-1};if(0===n)return e.$__SEPARATE_DATA=[s],e.$__SEPARATE_ROW_CACHE=e.$__SEPARATE_ROW_CACHE||[],e.$__uuid=t.uuid,void j(t.uuid,e,d);const p=null!=(u=e.$__SEPARATE_ROW_CACHE[n-1])?u:e.$__SEPARATE_ROW_CACHE[n-1]={$__SEPARATE:!0,$__uuid:t.uuid,$__SEPARATE_INDEX:n};p.$__ORIGIN_INDEX=o,j(t.uuid,p,d),e.$__SEPARATE_DATA.push(s),a(p)}))})),e.eventHooks.onResizableChange.tap(I,(async({column:e},t,a)=>{k(e)&&a.updateTableDataRef()})),e.configHooks.editConfig.tap(I,((e={},t)=>{const a=e.beforeEditMethod;return e.beforeEditMethod=(...e)=>{var o;if(!t.uuid)return c();const r=F.get(t.uuid);if(!r||!r.length)return c();const{row:n,column:i}=e[0],u=H(t.uuid,n);if(!u)return c();const s=null==(o=i.editRender)?void 0:o.props;if(!s||s.separateRowEdit)return c();const{isOriginRow:d,isLastRow:p}=u;return("bottom"===s.separatePlacement?p:d)&&c();function c(){return!l(a)||a(...e)}},e})),e.configHooks.checkboxConfig.tap(I,((e={},a)=>(e.checkMethod=t(e.checkMethod),e.visibleMethod=t(e.visibleMethod),e))),e.setupHooks.setup.tap(I,(e=>{n((()=>{e.value.uuid&&(F.delete(e.value.uuid),M(e.value.uuid))}))}))}})}export{I as separateRendererPlugins};
|
|
@@ -135,6 +135,7 @@ declare const CQuickSearch: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
135
135
|
}[]>;
|
|
136
136
|
showAdd: import("vue").Ref<boolean>;
|
|
137
137
|
addVal: import("vue").Ref<string>;
|
|
138
|
+
filterChangeFnList: import("vue").Ref<any[]>;
|
|
138
139
|
parentNamesHasAdd: import("vue").ComputedRef<boolean>;
|
|
139
140
|
handleName: import("vue").ComputedRef<(item: import("..").ISearchType, key?: string) => any>;
|
|
140
141
|
init: () => void;
|
|
@@ -186,6 +187,8 @@ declare const CQuickSearch: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
186
187
|
setDefaultCon: (widgetArr: import("..").ISearchParamsType[]) => void;
|
|
187
188
|
getFilterParams: () => {};
|
|
188
189
|
setFilterParams: (params?: any) => void;
|
|
190
|
+
getOriginalConfig: () => import("..").IApiServerType[];
|
|
191
|
+
onFilterChange: (fn: any) => void;
|
|
189
192
|
NForm: any;
|
|
190
193
|
NFormItem: import("vue").DefineComponent<{
|
|
191
194
|
readonly label: StringConstructor;
|
|
@@ -137,6 +137,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
137
137
|
}[]>;
|
|
138
138
|
showAdd: import("vue").Ref<boolean>;
|
|
139
139
|
addVal: import("vue").Ref<string>;
|
|
140
|
+
filterChangeFnList: import("vue").Ref<any[]>;
|
|
140
141
|
parentNamesHasAdd: import("vue").ComputedRef<boolean>;
|
|
141
142
|
handleName: import("vue").ComputedRef<(item: ISearchType, key?: string) => any>;
|
|
142
143
|
init: () => void;
|
|
@@ -188,6 +189,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
188
189
|
setDefaultCon: (widgetArr: ISearchParamsType[]) => void;
|
|
189
190
|
getFilterParams: () => {};
|
|
190
191
|
setFilterParams: (params?: any) => void;
|
|
192
|
+
getOriginalConfig: () => IApiServerType[];
|
|
193
|
+
onFilterChange: (fn: any) => void;
|
|
191
194
|
NForm: any;
|
|
192
195
|
NFormItem: import("vue").DefineComponent<{
|
|
193
196
|
readonly label: StringConstructor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as l,provide as t,computed as a,watch as i,onMounted as n,openBlock as o,createElementBlock as r,createElementVNode as s,Fragment as u,renderList as c,unref as d,normalizeClass as f,createCommentVNode as v,createVNode as m,withCtx as p,createTextVNode as h,toDisplayString as g,createBlock as k,withDirectives as b,vShow as y,isRef as C}from"vue";import{useMessage as S,NPopover as x,NModal as A,NCard as _,NIcon as
|
|
1
|
+
import{defineComponent as e,ref as l,provide as t,computed as a,watch as i,onMounted as n,openBlock as o,createElementBlock as r,createElementVNode as s,Fragment as u,renderList as c,unref as d,normalizeClass as f,createCommentVNode as v,createVNode as m,withCtx as p,createTextVNode as h,toDisplayString as g,createBlock as k,withDirectives as b,vShow as y,isRef as C}from"vue";import{useMessage as S,NPopover as x,NModal as A,NCard as _,NIcon as F,NButton as q,NForm as w,NFormItem as j,NInput as E}from"naive-ui";import{CloseOutline as U,AddOutline as I}from"@vicons/ionicons5";import L from"../../table-filter/src/hooks/useMixins.js";import N from"../../table-filter/src/hooks/useRenderWidget.js";import O from"../../table-filter/src/hooks/useAdvanced.js";import P from"../../table-filter/src/components/render-widget/index.vue.js";import"moment/locale/zh-cn";import{cloneDeep as R}from"lodash-es";import{InjectionFilterApiConfig as V,InjectionFilterSearchConfig as z}from"../../table-filter/src/constants/index.js";const D={class:"quick-search-block quick-search-table"},T={class:"quick-row"},B={class:"quick-item-title"},Q={class:"quick-item-col"},M={class:"svg-wrap"},W={class:"flex_right"},G={class:"class-filter-content"},J={class:"quickSearch-content"},H=s("span",{class:"label"},"父类名称:",-1),K=["onDblclick","onClick"],X={key:0,class:"s-content"};var Y=e({__name:"index",props:{searchFieldList:{type:Array,default:()=>[]},quickSearchConfig:{type:Array,default:()=>[]},tableId:{type:String,default:""},filterApiConfig:{type:Object}},emits:["getFilterParam","onFilterSearch","clearQuickSearchConfig"],setup(e,{expose:Y,emit:Z}){const $=e,ee={classname:{required:!0,message:"请输入分类名称",trigger:["input","blur"]}},le=S(),{handleGetConfigApi:te,outQuickSearchFn:ae}=L(),{getRenderSearchConObj:ie,resetRenderWidgetValue:ne,isRender:oe}=N(),{transformData:re,getCacheDef:se,transformParams:ue}=O(),ce=l(null),de=l({classname:""});let fe=l(!1),ve=l([]),me=l([]),pe=l(!1),he=l("");const ge=l([]);t(V,$.filterApiConfig),t(z,ve);let ke=a((()=>!!me.value.length&&me.value.some((e=>e.isAdd)))),be=a((()=>(e,l="name")=>e.alias||e[l]));function ye(){return function(e){if(!Array.isArray(e))return[];let l=[];for(let t=0;t<e.length;t++){let a=e[t];const i=ie(a);!l.find((e=>e.field_key===i.field_key))&&i&&l.push(i)}return l.filter((e=>e.value))}(ve.value)||[]}function Ce(){var e;null==(e=ce.value)||e.validate((e=>{var l;if(e)return;let t=ye();t.length||(t=[]);let a=null==(l=me.value.filter((e=>e.selected))[0])?void 0:l.value;!async function(e){var l;try{if(!await te(e,"requestSaveTableCondiTion",{},$.filterApiConfig))return;fe.value=!1,null==(l=ce.value)||l.restoreValidation(),de.value.classname="",me.value=[],Fe()}catch(e){console.log(e)}}({tableId:$.tableId||"",setting:JSON.stringify({displayCategory:a,name:de.value.classname,conObj:t}),conditionList:"[]"})}))}function Se(e){var l;const t=null==(l=null==e?void 0:e.target)?void 0:l.nextElementSibling;setTimeout((()=>{t&&t.focus()})),pe.value=!0}function xe(){pe.value=!1,he.value&&(me.value.forEach((e=>e.selected=!1)),me.value.push({disabled:!0,value:he.value,selected:!0,isAdd:!0}),he.value="")}function Ae(e){!function(e){me.value.splice(e,1)}(e)}function _e(){fe.value=!1}function Fe(){qe(ve.value),Z("clearQuickSearchConfig")}function qe(e){Array.isArray(e)&&(e.forEach((e=>{ne(e)})),ae.handlerInitSearchItem(ve.value))}return i((()=>$.searchFieldList),(e=>{e&&e.length>0&&function(){let e=R(re($.searchFieldList,{_filterApiConfig:$.filterApiConfig})).filter((e=>1==e.isShowSearch&&1!=e.filterExplicit))||[];ve.value=e||[],ae.handlerInitSearchItem(ve.value)}()}),{immediate:!0,deep:!0}),i((()=>ve),(()=>{const e=ye()||[],l=ue(e);Z("getFilterParam",e,l),ge.value.forEach((e=>e(l)))}),{deep:!0}),n((()=>{const e=$.quickSearchConfig;if(e&&e.length>0)return l=e,void ve.value.forEach((e=>{var t,a;if(oe(e)){const i=l.find((l=>l.field_key===e.columnName));i&&(null==(t=i.value)?void 0:t.length)>0&&(e.value=se(e,i.value),e.unit=null!=(a=i.unit)?a:"")}}));var l;qe(ve.value)})),Y({openSaveToCalss:function(){let e=ye();e&&(e.length>0?fe.value=!0:le.warning("请设置搜索条件"))},clearData:Fe,onFilterSearch:function(){let e=ye()||[];const l=ue(e);return Z("onFilterSearch",e,l,!1),ve.value},getFilterParams:function(){const e=ye()||[];return ue(e)},setFilterParams:function(e){const l=e?Object.keys(e):[];l.length>0&&ve.value.forEach((t=>{var a;if(oe(t)&&l.includes(t.columnName)){const l=e[t.columnName];t.value=Array.isArray(l)&&!1===(null==(a=t.widgetCfg)?void 0:a.multiple)?l[0]:l}}))},getOriginalConfig:function(){return $.searchFieldList},onFilterChange:function(e){ge.value.push(e)}}),(e,l)=>(o(),r("div",null,[s("div",D,[(o(!0),r(u,null,c(d(ve),(e=>(o(),r("div",{class:f(["quick-item",{"quick-block":e._isBlock}]),key:e.sid||e.columnName},[s("div",T,[v(" title "),s("div",B,[m(d(x),{trigger:"hover"},{trigger:p((()=>[h(g(d(be)(e,"title")),1)])),default:p((()=>[s("span",null,g(d(be)(e,"title")),1)])),_:2},1024)]),v(" content "),s("div",Q,[v(" 直接渲染组件 "),e.isRender?(o(),k(P,{key:0,cfg:e,modelValue:e.value,"onUpdate:modelValue":l=>e.value=l,unit:e.unit,"onUpdate:unit":l=>e.unit=l},null,8,["cfg","modelValue","onUpdate:modelValue","unit","onUpdate:unit"])):v("v-if",!0)])])],2)))),128))]),v(" 保存到分类的弹窗 "),m(d(A),{show:d(fe),maskClosable:!1,"positive-text":"确认","negative-text":"取消",onPositiveClick:Ce,onNegativeClick:_e,class:"classification-modal-block"},{default:p((()=>[m(d(_),{title:"设置筛选分类",style:{width:"520px"},bordered:!1,size:"huge",role:"dialog","aria-modal":"true"},{"header-extra":p((()=>[s("div",M,[m(d(F),{component:d(U),size:"24",onClick:_e},null,8,["component"])])])),footer:p((()=>[s("div",W,[m(d(q),{onClick:_e},{default:p((()=>[h("取消")])),_:1}),m(d(q),{type:"info",onClick:Ce},{default:p((()=>[h("确认")])),_:1})])])),default:p((()=>[s("div",G,[m(d(w),{ref_key:"formRef",ref:ce,"label-placement":"left",rules:ee,model:de.value},{default:p((()=>[m(d(j),{label:"筛选集名称",path:"classname"},{default:p((()=>[m(d(E),{value:de.value.classname,"onUpdate:value":l[0]||(l[0]=e=>de.value.classname=e),placeholder:"请输入分类名称",clearable:""},null,8,["value"])])),_:1})])),_:1},8,["model"]),s("div",J,[H,(o(!0),r(u,null,c(d(me),((e,l)=>(o(),r("div",{class:f(["edit-tag",{"edit-tag-select":e.selected&&e.disabled}]),key:l,onDblclick:l=>function(e,l){l.disabled=!1,setTimeout((()=>{var l;null==(l=e.target)||l.focus()}),0)}(l,e),onClick:t=>function(e,l){e.disabled&&(me.value.forEach(((e,t)=>{t!==l&&(e.selected=!1)})),e.selected=!e.selected)}(e,l)},[e.disabled?(o(),r("div",X,[s("span",null,g(e.value),1)])):(o(),k(d(E),{key:1,style:{width:"100px"},value:e.value,"onUpdate:value":l=>e.value=l,disabled:e.disabled,onBlur:()=>e.disabled=!0,maxLength:10},null,8,["value","onUpdate:value","disabled","onBlur"])),m(d(F),{component:d(U),class:"anticon-close",size:"20",onClick:e=>Ae(l)},null,8,["component","onClick"])],42,K)))),128)),d(ke)?v("v-if",!0):(o(),r(u,{key:0},[b(m(d(q),{dashed:"",icon:"plus",class:"ant-btn",onClick:Se},{default:p((()=>[m(d(F),{component:d(I),size:"20"},null,8,["component"]),h("添加分类 ")])),_:1},512),[[y,!d(pe)]]),b(m(d(E),{style:{width:"100px"},class:"edit-tag",value:d(he),"onUpdate:value":l[1]||(l[1]=e=>C(he)?he.value=e:he=e),valueModifiers:{trim:!0},onBlur:xe,maxLength:10},null,8,["value"]),[[y,d(pe)]])],64))])])])),_:1})])),_:1},8,["show"])]))}});export{Y as default};
|
|
@@ -10,13 +10,11 @@ declare const CSliderTree: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
10
10
|
default: () => {};
|
|
11
11
|
};
|
|
12
12
|
}, {
|
|
13
|
-
$message: import("naive-ui").MessageApi;
|
|
14
13
|
$attr: {
|
|
15
14
|
[x: string]: unknown;
|
|
16
15
|
};
|
|
17
16
|
getChildrenByOrgPartenId: (params: any, filterApiConfig: any) => Promise<any>;
|
|
18
17
|
searchEmpTreeData: (params: any, filterApiConfig: any) => Promise<any>;
|
|
19
|
-
updateDeptSort: (params: any, filterApiConfig: any) => Promise<any>;
|
|
20
18
|
getDeptList: (params: any, filterApiConfig: any) => Promise<any>;
|
|
21
19
|
isMatchFn: (node: any, keyword: string) => boolean;
|
|
22
20
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -29,24 +27,33 @@ declare const CSliderTree: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
29
27
|
default: () => {};
|
|
30
28
|
};
|
|
31
29
|
}>> & {
|
|
32
|
-
|
|
30
|
+
onSelectNode?: ((...args: any[]) => any) | undefined;
|
|
33
31
|
onSaveWidth?: ((...args: any[]) => any) | undefined;
|
|
34
32
|
}>>;
|
|
35
|
-
emit: (event: "
|
|
33
|
+
emit: (event: "selectNode" | "saveWidth", ...args: any[]) => void;
|
|
36
34
|
flexWidth: import("vue").Ref<number>;
|
|
37
35
|
searchValue: import("vue").Ref<string>;
|
|
38
36
|
treeData: import("vue").Ref<any[]>;
|
|
39
37
|
expandedKeys: import("vue").Ref<string[]>;
|
|
40
38
|
selectedKeys: import("vue").Ref<string[]>;
|
|
41
39
|
selectNode: import("vue").Ref<{}>;
|
|
42
|
-
|
|
40
|
+
treeProperty: import("vue").ComputedRef<{
|
|
41
|
+
virtualScroll: boolean;
|
|
42
|
+
selectable: boolean;
|
|
43
|
+
data: any[];
|
|
44
|
+
expandedKeys: string[];
|
|
45
|
+
selectedKeys: string[];
|
|
46
|
+
renderLabel: ({ option }: any) => any;
|
|
47
|
+
onUpdateExpandedKeys: (expandedKeyVals: string[]) => void;
|
|
48
|
+
onUpdateSelectedKeys: (selectedKeyVals: never[] | undefined, [node]: any[]) => void;
|
|
49
|
+
onLoad: (treeNode: any) => any;
|
|
50
|
+
}>;
|
|
43
51
|
handleRenderLabel: ({ option }: any) => any;
|
|
44
52
|
init: () => Promise<void>;
|
|
45
53
|
onExpand: (expandedKeyVals: string[]) => void;
|
|
46
54
|
onNodeSelect: (selectedKeyVals: never[] | undefined, [node]: any[]) => void;
|
|
47
55
|
onSearch: () => Promise<void>;
|
|
48
|
-
|
|
49
|
-
onDrop: (info: any) => Promise<void>;
|
|
56
|
+
refreshNode: (selectOrgId?: string | undefined) => Promise<void>;
|
|
50
57
|
getDeptData: (orgId: string) => Promise<any>;
|
|
51
58
|
getChildrenByOrgPartenIdFn: () => Promise<void>;
|
|
52
59
|
onLoadData: (treeNode: any) => any;
|
|
@@ -60,7 +67,7 @@ declare const CSliderTree: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
60
67
|
mounted(el: any, { value }: any): void;
|
|
61
68
|
beforeUnmount(el: any): void;
|
|
62
69
|
};
|
|
63
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("
|
|
70
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("selectNode" | "saveWidth")[], "selectNode" | "saveWidth", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
64
71
|
sliderInitialWidth: {
|
|
65
72
|
type: NumberConstructor;
|
|
66
73
|
default: number;
|
|
@@ -70,7 +77,7 @@ declare const CSliderTree: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
70
77
|
default: () => {};
|
|
71
78
|
};
|
|
72
79
|
}>> & {
|
|
73
|
-
|
|
80
|
+
onSelectNode?: ((...args: any[]) => any) | undefined;
|
|
74
81
|
onSaveWidth?: ((...args: any[]) => any) | undefined;
|
|
75
82
|
}, {
|
|
76
83
|
sliderInitialWidth: number;
|
|
@@ -8,13 +8,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
8
8
|
default: () => {};
|
|
9
9
|
};
|
|
10
10
|
}, {
|
|
11
|
-
$message: import("naive-ui").MessageApi;
|
|
12
11
|
$attr: {
|
|
13
12
|
[x: string]: unknown;
|
|
14
13
|
};
|
|
15
14
|
getChildrenByOrgPartenId: (params: any, filterApiConfig: any) => Promise<any>;
|
|
16
15
|
searchEmpTreeData: (params: any, filterApiConfig: any) => Promise<any>;
|
|
17
|
-
updateDeptSort: (params: any, filterApiConfig: any) => Promise<any>;
|
|
18
16
|
getDeptList: (params: any, filterApiConfig: any) => Promise<any>;
|
|
19
17
|
isMatchFn: (node: any, keyword: string) => boolean;
|
|
20
18
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -27,24 +25,33 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
27
25
|
default: () => {};
|
|
28
26
|
};
|
|
29
27
|
}>> & {
|
|
30
|
-
|
|
28
|
+
onSelectNode?: ((...args: any[]) => any) | undefined;
|
|
31
29
|
onSaveWidth?: ((...args: any[]) => any) | undefined;
|
|
32
30
|
}>>;
|
|
33
|
-
emit: (event: "
|
|
31
|
+
emit: (event: "selectNode" | "saveWidth", ...args: any[]) => void;
|
|
34
32
|
flexWidth: import("vue").Ref<number>;
|
|
35
33
|
searchValue: import("vue").Ref<string>;
|
|
36
34
|
treeData: import("vue").Ref<any[]>;
|
|
37
35
|
expandedKeys: import("vue").Ref<string[]>;
|
|
38
36
|
selectedKeys: import("vue").Ref<string[]>;
|
|
39
37
|
selectNode: import("vue").Ref<{}>;
|
|
40
|
-
|
|
38
|
+
treeProperty: import("vue").ComputedRef<{
|
|
39
|
+
virtualScroll: boolean;
|
|
40
|
+
selectable: boolean;
|
|
41
|
+
data: any[];
|
|
42
|
+
expandedKeys: string[];
|
|
43
|
+
selectedKeys: string[];
|
|
44
|
+
renderLabel: ({ option }: any) => any;
|
|
45
|
+
onUpdateExpandedKeys: (expandedKeyVals: string[]) => void;
|
|
46
|
+
onUpdateSelectedKeys: (selectedKeyVals: never[] | undefined, [node]: any[]) => void;
|
|
47
|
+
onLoad: (treeNode: any) => any;
|
|
48
|
+
}>;
|
|
41
49
|
handleRenderLabel: ({ option }: any) => any;
|
|
42
50
|
init: () => Promise<void>;
|
|
43
51
|
onExpand: (expandedKeyVals: string[]) => void;
|
|
44
52
|
onNodeSelect: (selectedKeyVals: never[] | undefined, [node]: any[]) => void;
|
|
45
53
|
onSearch: () => Promise<void>;
|
|
46
|
-
|
|
47
|
-
onDrop: (info: any) => Promise<void>;
|
|
54
|
+
refreshNode: (selectOrgId?: string) => Promise<void>;
|
|
48
55
|
getDeptData: (orgId: string) => Promise<any>;
|
|
49
56
|
getChildrenByOrgPartenIdFn: () => Promise<void>;
|
|
50
57
|
onLoadData: (treeNode: any) => any;
|
|
@@ -58,7 +65,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
58
65
|
mounted(el: any, { value }: any): void;
|
|
59
66
|
beforeUnmount(el: any): void;
|
|
60
67
|
};
|
|
61
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("
|
|
68
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("selectNode" | "saveWidth")[], "selectNode" | "saveWidth", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
62
69
|
sliderInitialWidth: {
|
|
63
70
|
type: NumberConstructor;
|
|
64
71
|
default: number;
|
|
@@ -68,7 +75,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
68
75
|
default: () => {};
|
|
69
76
|
};
|
|
70
77
|
}>> & {
|
|
71
|
-
|
|
78
|
+
onSelectNode?: ((...args: any[]) => any) | undefined;
|
|
72
79
|
onSaveWidth?: ((...args: any[]) => any) | undefined;
|
|
73
80
|
}, {
|
|
74
81
|
sliderInitialWidth: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,useAttrs as t,ref as a,onMounted as
|
|
1
|
+
import{defineComponent as e,useAttrs as t,ref as a,computed as l,onMounted as n,h as s,withDirectives as o,openBlock as r,createElementBlock as i,normalizeStyle as u,createElementVNode as c,createVNode as d,unref as v,createCommentVNode as f,renderSlot as p,createBlock as m,normalizeProps as h,mergeProps as y}from"vue";import{NInput as g,NTree as b,NEmpty as w}from"naive-ui";import{vFlexibleResize as x}from"../../../shared/directive/flexibleResize.js";import O from"./hooks/useAsyncData.js";import{traversalData as C}from"./utils/tool.js";import{useDebounceFn as S}from"@vueuse/core";const I={class:"search-groups"},L={class:"tree-wrap"},k={key:1,class:"empty-container"},N={class:"table-footer-wrap"};var A=e({__name:"index",props:{sliderInitialWidth:{type:Number,default:300},treeSearchApiConfig:{type:Object,default:()=>({})}},emits:["selectNode","saveWidth"],setup(e,{expose:A,emit:j}){const K=e,U=t(),{getChildrenByOrgPartenId:W,searchEmpTreeData:D,getDeptList:E}=O(),M=(e,t)=>{var a,l;t=null==t?void 0:t.toLowerCase();let{label:n="",abbrp:s="",abbrw:o="",key:r,filterSearch:i=[]}=e;const u=(null==(a=null==n?void 0:n.toLowerCase())?void 0:a.indexOf(t))>-1,c=(null==(l=null==r?void 0:r.toLowerCase())?void 0:l.indexOf(t))>-1,d=i.some((e=>e.toLowerCase().indexOf(t)>-1));return!!(u||c||d)},R=a(K.sliderInitialWidth),$=a(""),J=a([]),P=a([]),_=a([]),z=a({}),B=l((()=>{let e={};for(let t in U)e[t]=U[t];return{virtualScroll:!0,selectable:!0,data:J.value,expandedKeys:P.value,selectedKeys:_.value,renderLabel:F,onUpdateExpandedKeys:T,onUpdateSelectedKeys:V,onLoad:X,...e}}));function F({option:e}){const t=e.label;if(t.includes($.value.trim())){const e=t.substr(0,t.indexOf($.value.trim())),a=t.substr(t.indexOf($.value.trim())+$.value.trim().length);return s("div",[s("span",{style:{marginRight:e?"2px":"0px"}},e),s("span",{style:{color:"#2563F4"}},$.value.trim()),s("span",{style:{marginLeft:a?"2px":"0px"}},a)])}return t}function T(e){P.value=e}function V(e=[],[t]){_.value=e,j("selectNode",t),z.value=t}n((()=>{!async function(){await Q(),J.value.length>0&&(P.value=[J.value[0].key],_.value=[J.value[0].key],z.value=J.value[0],j("selectNode",JSON.parse(JSON.stringify(J.value[0]))))}()}));const q=S((async()=>{const e=$.value.trim();if(e){const{data:t,success:a}=await D({search:e},K.treeSearchApiConfig);a&&(J.value=t,P.value=function(e){const t=[];for(const a of C(e,"children")){let e=!1;for(const t of C(a.children,"children"))M(t,$.value)&&(e=!0);e&&t.push(a.key)}return t}(t))}else G()}),800);async function G(e){await Q();let t=J.value[0].orgId;e&&(t=e);const a=await H(t);if(a){const e=J.value.map((e=>e.orgId===t?a:e));J.value=e}}async function H(e){const{data:t,success:a}=await E({orgId:e},K.treeSearchApiConfig);if(a){const a=J.value.find((t=>t.orgId===e));return a.children=t,a}}async function Q(){const{success:e,data:t}=await W(null,K.treeSearchApiConfig);e&&(J.value=t)}function X(e){return new Promise((async t=>{e.isOrg&&!e.children&&(await H(e.orgId),t(!0)),t(!0)}))}function Y({distance:e}){const t=R.value+e;R.value=Math.min(Math.max(t,50),1e3)}function Z(){j("saveWidth",R.value)}return A({refreshNode:G}),(e,t)=>o((r(),i("div",{class:"left-tree-wrap",ref:"left",style:u({width:R.value+"px"})},[c("div",I,[d(v(g),{clearable:"",placeholder:"搜索关键字",value:$.value,"onUpdate:value":[t[0]||(t[0]=e=>$.value=e),v(q)]},null,8,["value","onUpdate:value"]),f(" 按钮插槽 "),p(e.$slots,"buttons")]),f(" 标签tab插槽 "),p(e.$slots,"tabs"),c("div",L,[J.value.length>0?(r(),m(v(b),h(y({key:0},v(B))),null,16)):(r(),i("div",k,[d(v(w),{description:"暂无数据"})]))]),c("div",N,[f(" 导出数据插槽 "),p(e.$slots,"output")])],4)),[[v(x),{mode:"VR",onMove:Y,onEnd:Z}]])}});export{A as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e="@cnhis-design-vue/shared",i="3.1.51-beta.
|
|
1
|
+
var e="@cnhis-design-vue/shared",i="3.1.51-beta.23",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.51-beta.23",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.51-beta.
|
|
3
|
+
"version": "3.1.51-beta.23",
|
|
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": "4de78eb82319e59a692b6a00651de15a8e702a9d"
|
|
67
67
|
}
|