cnhis-design-vue 3.1.51-release.4 → 3.1.51

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.
Files changed (47) hide show
  1. package/es/components/annotation-edit/src/type.d.ts +1 -1
  2. package/es/components/base-search/index.d.ts +3 -0
  3. package/es/components/base-search/src/index.vue.d.ts +3 -0
  4. package/es/components/base-search/src/index.vue2.js +1 -1
  5. package/es/components/callback/src/components/render/popupMaps.d.ts +3 -3
  6. package/es/components/card-reader-sdk/src/cardReaderSDK.js +1 -1
  7. package/es/components/field-set/index.d.ts +35 -0
  8. package/es/components/field-set/src/FieldSet.vue.d.ts +36 -1
  9. package/es/components/field-set/src/FieldSet.vue2.js +1 -1
  10. package/es/components/field-set/src/components/Row.vue.d.ts +2 -1
  11. package/es/components/field-set/src/components/Row.vue2.js +1 -1
  12. package/es/components/field-set/src/types/index.d.ts +1 -0
  13. package/es/components/field-set/src/utils/index.d.ts +2 -0
  14. package/es/components/field-set/src/utils/index.js +1 -1
  15. package/es/components/field-set/style/index.css +1 -1
  16. package/es/components/form-render/src/FormRender.vue2.js +1 -1
  17. package/es/components/form-render/src/components/renderer/levelSearchCascader.js +1 -1
  18. package/es/components/form-render/src/types/index.d.ts +1 -0
  19. package/es/components/iho-table/index.d.ts +3 -3
  20. package/es/components/iho-table/src/IhoTable.vue.d.ts +4 -3
  21. package/es/components/iho-table/src/IhoTable.vue2.js +1 -1
  22. package/es/components/iho-table/src/constants/index.d.ts +7 -6
  23. package/es/components/iho-table/src/hooks/useColumnConfigAdaptor.js +1 -1
  24. package/es/components/iho-table/src/plugins/defaultValuePlugin.d.ts +1 -0
  25. package/es/components/iho-table/src/plugins/defaultValuePlugin.js +1 -0
  26. package/es/components/iho-table/src/plugins/filterVisibleEventPlugin.js +1 -1
  27. package/es/components/iho-table/src/plugins/headerPlugin.d.ts +1 -0
  28. package/es/components/iho-table/src/plugins/headerPlugin.js +1 -0
  29. package/es/components/iho-table/src/plugins/index.js +1 -1
  30. package/es/components/iho-table/src/plugins/lowCodeFieldAdaptorPlugin/index.js +1 -1
  31. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/index.js +1 -1
  32. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/index.js +1 -1
  33. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/index.js +1 -1
  34. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/index.js +1 -1
  35. package/es/components/iho-table/src/types/index.d.ts +15 -0
  36. package/es/components/iho-table/src/utils/index.d.ts +1 -1
  37. package/es/components/iho-table/src/utils/index.js +1 -1
  38. package/es/components/index.css +1 -1
  39. package/es/components/quick-search/index.d.ts +3 -0
  40. package/es/components/quick-search/src/index.vue.d.ts +3 -0
  41. package/es/components/quick-search/src/index.vue2.js +1 -1
  42. package/es/components/slider-tree/index.d.ts +16 -9
  43. package/es/components/slider-tree/src/index.vue.d.ts +16 -9
  44. package/es/components/slider-tree/src/index.vue2.js +1 -1
  45. package/es/shared/package.json.js +1 -1
  46. package/es/shared/utils/index.js +1 -1
  47. package/package.json +2 -2
@@ -5,4 +5,4 @@ export declare type AnnotationItem = string | Partial<{
5
5
  date: string;
6
6
  dateLabel: string;
7
7
  footerRender: (item: Exclude<AnnotationItem, string>) => any;
8
- }>;
8
+ }> | null | undefined;
@@ -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 l,watch as i,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 b from"../../table-filter/src/components/render-widget/index.vue.js";import g from"../../table-filter/src/hooks/useMixins.js";import y from"../../table-filter/src/hooks/useAdvanced.js";import k from"../../table-filter/src/hooks/useRenderWidget.js";import{NButton as C,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 q}from"../../table-filter/src/constants/index.js";const R={class:"base-search-block"},F={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:U}){const D=e,{outQuickSearchFn:L}=g(),{isRender:W,getRenderSearchConObj:$,isExistDefValByRenderWidget:z,resetRenderWidgetValue:M}=k(),{transformData:T,transformParams:G}=y(),H=t([]),J=t(!1),K=t([]);a(x,D.filterApiConfig),a(q,K);const X=l((()=>Z("hideQuickSearch"))),Y=l((()=>Z("hideResetBtn")));function Z(e){return 0==D.showSettings[e]}function ee(){U("foldQuickSearch",!0)}function te(e={}){const t=ae()||[];!function(e,t,a=!1,l={}){let i=[];K.value.length>0&&(i=O(K.value));U("onFilterSearch",e,t,a,i,l)}(t,G(t),!0,e)}function ae(){return function(e){if(!Array.isArray(e))return[];let t=[];for(let a=0;a<e.length;a++){let l=e[a];const i=$(l);i&&t.push(i)}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)})),L.handlerInitSearchItem(e)}(K.value),U("handleReset",{targetType:"outQuickSearchReset"})}return i((()=>D.searchFieldList),(e=>{e&&e.length>0&&function(){K.value=[];let e=O(T(D.searchFieldList,{_filterApiConfig:D.filterApiConfig})).filter((e=>1==e.isShowSearch&&1==e.filterExplicit));K.value=e,L.handlerInitSearchItem(K.value),K.value.some((e=>W(e)?z(e):!!e.explicitDefaultVal))}()}),{immediate:!0,deep:!0}),i((()=>D.qqConObjCount),(e=>{const t=H.value.length||0;J.value=t+Number(e)>0&&Y.value}),{immediate:!0}),i((()=>K),(()=>{H.value=ae()||[];const e=G(H.value);J.value=H.value.length+Number(D.qqConObjCount)>0&&Y.value,U("getFilterParam",H.value,e)}),{immediate:!0,deep:!0}),i((()=>D.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=ae()||[];return G(e)},setFilterParams:function(e){const t=e?Object.keys(e):[];t.length>0&&K.value.forEach((a=>{var l;if(W(a)&&t.includes(a.columnName)){const t=e[a.columnName];a.value=Array.isArray(t)&&!1===(null==(l=a.widgetCfg)?void 0:l.multiple)?t[0]:t}}))}}),(t,a)=>(n(),r("div",R,[s("div",F,[s("div",V,[s("ul",Q,[o(" 筛选分类插槽 "),c(t.$slots,"classification"),u(X)?(n(),r("li",N,[f(u(C),{class:"search-default",type:"default",onClick:ee},{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(b,{cfg:e,modelValue:e.value,"onUpdate:modelValue":t=>e.value=t,isAccurate:e.isAccurateSearchVal,"onUpdate:isAccurate":t=>e.isAccurateSearchVal=t,onOutFilterChange:te},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(C),{type:"primary",onClick:te},{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(C),{onClick:le},{default:d((()=>[P,m(" 重置 ")])),_:1})])):o("v-if",!0),o(" 业务按钮插槽 "),c(t.$slots,"buttons")])])])]))}});export{B as default};
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};
@@ -910,7 +910,7 @@ export declare const CallbackMaps: Map<string, {
910
910
  default: () => never[];
911
911
  };
912
912
  annotation: {
913
- type: import("vue").PropType<import("../../../..").AnyObject>;
913
+ type: import("vue").PropType<Record<string, import("../../../../annotation-edit/src/type").AnnotationItem>>;
914
914
  };
915
915
  }, {
916
916
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
@@ -927,7 +927,7 @@ export declare const CallbackMaps: Map<string, {
927
927
  default: () => never[];
928
928
  };
929
929
  annotation: {
930
- type: import("vue").PropType<import("../../../..").AnyObject>;
930
+ type: import("vue").PropType<Record<string, import("../../../../annotation-edit/src/type").AnnotationItem>>;
931
931
  };
932
932
  }>> & {
933
933
  onFormChange?: ((...args: any[]) => any) | undefined;
@@ -5548,7 +5548,7 @@ export declare const CallbackMaps: Map<string, {
5548
5548
  default: () => never[];
5549
5549
  };
5550
5550
  annotation: {
5551
- type: import("vue").PropType<import("../../../..").AnyObject>;
5551
+ type: import("vue").PropType<Record<string, import("../../../../annotation-edit/src/type").AnnotationItem>>;
5552
5552
  };
5553
5553
  }>> & {
5554
5554
  onFormChange?: ((...args: any[]) => any) | undefined;
@@ -1 +1 @@
1
- import{isFunction as a}from"lodash-es";import{TRANS_CMD as t}from"./constants/index.js";import e from"./insuranceSDK.js";import{ReadHealthCard as r}from"./utils/readHealthCard.js";let s=null;const n=class{constructor(a){if(this.options=a,this.loading=!1,this.readHealthCardDialog=new r,s)return s;s=this,this.insurance=new e}get basicParamsRes(){return a(this.options.basicParams)?this.options.basicParams():this.options.basicParams}static create(a={}){return new n(a)}static destroy(){null==s||s.destroy(),s=null}destroy(){this.insurance.destroy()}createParams(a,t,e){var r,s;const{operatorname:n,operatorcode:i,...o}=this.basicParamsRes||{};return{transcmd:a,operatorname:null!=(r=t.operatorname)?r:n,operatorcode:null!=(s=t.operatorcode)?s:i,...o,...e}}checkLoading(){if(this.loading)return Promise.reject("请勿重复操作")}async checkResCodeAndLoading(a){try{this.loading=!0;const t=await a;return 3===t.returncode||"3"===t.returncode?Promise.reject(`${t.returnmsg||"操作失败"}`):t.returndata}finally{this.loading=!1}}async readHealthCard(a,t){return await this.checkLoading(),this.readHealthCardDialog.show({instance:a,...t})}async readIdCard(a={}){await this.checkLoading();const e=this.createParams(t.ID_CARD_READ,a,{transtype:"IDCARD",interfaceid:"0",...a,transdata:{readtype:"2",...a.transdata}});return this.checkResCodeAndLoading(this.insurance.getInsuranceInfoPromise(e))}async readMemberCard(a={}){await this.checkLoading();const e=this.createParams(t.MEMBER_CARD_READ,a,{transsystem:"10",transtype:"IDCARD",interfaceid:"0",...a,transdata:{readtype:"1",...a.transdata}});return this.checkResCodeAndLoading(this.insurance.getInsuranceInfoPromise(e))}async writeMemberCard(a={}){await this.checkLoading();const e=this.createParams(t.MEMBER_CARD_WRITE,a,{transsystem:"10",transtype:"IDCARD",interfaceid:"0",...a,transdata:{readtype:"1",...a.transdata}});return this.checkResCodeAndLoading(this.insurance.getInsuranceInfoPromise(e))}async readInsuranceCard(a={}){var e,r;await this.checkLoading();const s=this.createParams(t.NS_GETPERSONALINFO,a,{transchannel:"101",interfaceid:a.interfaceid,transtype:"YB0000",transdata:{...a.transdata,iar1:{...(null==(e=a.transdata)?void 0:e.iar1)||{acf01:"0",iak22:"0"}},personinfo:{...(null==(r=a.transdata)?void 0:r.personinfo)||{location:0,ownpay:"0"}}}});return this.checkResCodeAndLoading(this.insurance.getInsuranceInfoPromise(s))}async generalRequest(a={}){await this.checkLoading();const e=this.createParams(t.NS_GETPERSONALINFO,a);return this.checkResCodeAndLoading(this.insurance.getInsuranceInfoPromise(e))}};let i=n;i.version=1,i.TRANS_CMD=t;export{i as default};
1
+ import{isFunction as a}from"lodash-es";import{TRANS_CMD as t}from"./constants/index.js";import e from"./insuranceSDK.js";import{ReadHealthCard as s}from"./utils/readHealthCard.js";let r=null;const n=class{constructor(a){if(this.options=a,this.loading=!1,this.readHealthCardDialog=new s,r)return r;r=this,this.insurance=new e}get basicParamsRes(){return a(this.options.basicParams)?this.options.basicParams():this.options.basicParams}static create(a={}){return new n(a)}static destroy(){null==r||r.destroy(),r=null}destroy(){this.insurance.destroy()}createParams(a,t){return{transcmd:a,...this.basicParamsRes,...t}}checkLoading(){if(this.loading)return Promise.reject("请勿重复操作")}async checkResCodeAndLoading(a){try{this.loading=!0;const t=await a;return 3===t.returncode||"3"===t.returncode?Promise.reject(`${t.returnmsg||"操作失败"}`):t.returndata}finally{this.loading=!1}}async readHealthCard(a,t){return await this.checkLoading(),this.readHealthCardDialog.show({instance:a,...t})}async readIdCard(a={}){await this.checkLoading();const e=this.createParams(t.ID_CARD_READ,{transtype:"IDCARD",interfaceid:"0",...a,transdata:{readtype:"2",...a.transdata}});return this.checkResCodeAndLoading(this.insurance.getInsuranceInfoPromise(e))}async readMemberCard(a={}){await this.checkLoading();const e=this.createParams(t.MEMBER_CARD_READ,{transsystem:"10",transtype:"IDCARD",interfaceid:"0",...a,transdata:{readtype:"1",...a.transdata}});return this.checkResCodeAndLoading(this.insurance.getInsuranceInfoPromise(e))}async writeMemberCard(a={}){await this.checkLoading();const e=this.createParams(t.MEMBER_CARD_WRITE,{transsystem:"10",transtype:"IDCARD",interfaceid:"0",...a,transdata:{readtype:"1",...a.transdata}});return this.checkResCodeAndLoading(this.insurance.getInsuranceInfoPromise(e))}async readInsuranceCard(a={}){var e,s;await this.checkLoading();const r=this.createParams(t.NS_GETPERSONALINFO,{transchannel:"101",interfaceid:a.interfaceid,transtype:"YB0000",transdata:{...a.transdata,iar1:{acf01:"0",iak22:"0",...null==(e=a.transdata)?void 0:e.iar1},personinfo:{location:0,ownpay:"0",...null==(s=a.transdata)?void 0:s.iar1}}});return this.checkResCodeAndLoading(this.insurance.getInsuranceInfoPromise(r))}async generalRequest(a={}){await this.checkLoading();const e=this.createParams(t.NS_GETPERSONALINFO,a);return this.checkResCodeAndLoading(this.insurance.getInsuranceInfoPromise(e))}};let i=n;i.version=1,i.TRANS_CMD=t;export{i as default};
@@ -57,6 +57,10 @@ declare const FieldSet: SFCWithInstall<import("vue").DefineComponent<{
57
57
  type: BooleanConstructor;
58
58
  default: boolean;
59
59
  };
60
+ showHeadFilter: {
61
+ type: BooleanConstructor;
62
+ default: boolean;
63
+ };
60
64
  }, {
61
65
  fieldsMapping: Record<string, string>;
62
66
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
@@ -115,6 +119,10 @@ declare const FieldSet: SFCWithInstall<import("vue").DefineComponent<{
115
119
  type: BooleanConstructor;
116
120
  default: boolean;
117
121
  };
122
+ showHeadFilter: {
123
+ type: BooleanConstructor;
124
+ default: boolean;
125
+ };
118
126
  }>> & {
119
127
  onReset?: ((...args: any[]) => any) | undefined;
120
128
  onClose?: ((...args: any[]) => any) | undefined;
@@ -132,6 +140,7 @@ declare const FieldSet: SFCWithInstall<import("vue").DefineComponent<{
132
140
  field: string;
133
141
  checkedAll?: boolean | undefined;
134
142
  disabledAll?: boolean | undefined;
143
+ isHeadCheckHide?: boolean | undefined;
135
144
  isShow?: boolean | undefined;
136
145
  }[]>;
137
146
  fieldList: import("vue").ComputedRef<import("../../../es/shared/types").AnyObject[]>;
@@ -142,6 +151,7 @@ declare const FieldSet: SFCWithInstall<import("vue").DefineComponent<{
142
151
  field: string;
143
152
  checkedAll?: boolean | undefined;
144
153
  disabledAll?: boolean | undefined;
154
+ isHeadCheckHide?: boolean | undefined;
145
155
  isShow?: boolean | undefined;
146
156
  }[];
147
157
  fieldList: import("../../../es/shared/types").AnyObject[];
@@ -188,6 +198,7 @@ declare const FieldSet: SFCWithInstall<import("vue").DefineComponent<{
188
198
  }) => void;
189
199
  initColumns: () => void;
190
200
  isNoAllCheck: (field: string) => boolean;
201
+ onMove: (e: any) => boolean;
191
202
  NButton: any;
192
203
  NCheckbox: any;
193
204
  NPopconfirm: any;
@@ -388,6 +399,24 @@ declare const FieldSet: SFCWithInstall<import("vue").DefineComponent<{
388
399
  onUpdateChecked?: ((...args: any[]) => any) | undefined;
389
400
  }>>;
390
401
  emit: (event: "updateChecked", ...args: any[]) => void;
402
+ isCheckboxShow: (item: Partial<{
403
+ [key: string]: any;
404
+ id: string;
405
+ name: string;
406
+ show: boolean;
407
+ sort: boolean;
408
+ sortDirection: "NONE" | "ASC" | "DESC";
409
+ title: string;
410
+ alias: string;
411
+ fixedShow: boolean;
412
+ fixedWay: "NONE" | "LEFT" | "RIGHT";
413
+ columnWidth: number | null;
414
+ editable: boolean;
415
+ editableDisable: boolean;
416
+ required: boolean;
417
+ requiredDisable: boolean;
418
+ hide: boolean;
419
+ }>, key: string) => any;
391
420
  getSortPriorityOptions: () => {
392
421
  label: string;
393
422
  value: number;
@@ -513,6 +542,7 @@ declare const FieldSet: SFCWithInstall<import("vue").DefineComponent<{
513
542
  <T>(value?: any): value is any[];
514
543
  };
515
544
  setStyle: typeof import("./src/utils").setStyle;
545
+ isDraggableItem: typeof import("./src/utils").isDraggableItem;
516
546
  HelpCircleSharp: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
517
547
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("close" | "save" | "reset")[], "close" | "save" | "reset", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
518
548
  fields: {
@@ -570,6 +600,10 @@ declare const FieldSet: SFCWithInstall<import("vue").DefineComponent<{
570
600
  type: BooleanConstructor;
571
601
  default: boolean;
572
602
  };
603
+ showHeadFilter: {
604
+ type: BooleanConstructor;
605
+ default: boolean;
606
+ };
573
607
  }>> & {
574
608
  onReset?: ((...args: any[]) => any) | undefined;
575
609
  onClose?: ((...args: any[]) => any) | undefined;
@@ -600,5 +634,6 @@ declare const FieldSet: SFCWithInstall<import("vue").DefineComponent<{
600
634
  customColumns: import("./src/types").FieldSetColumnItem[];
601
635
  showSearch: boolean;
602
636
  showSortPriority: boolean;
637
+ showHeadFilter: boolean;
603
638
  }>>;
604
639
  export default FieldSet;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="lodash" />
2
2
  import { PropType } from 'vue';
3
- import { setStyle, isDisable } from './utils';
3
+ import { setStyle, isDisable, isDraggableItem } from './utils';
4
4
  import { FieldSetItem, FieldSetColumnName, FieldSetColumnItem } from '../../../../es/components/field-set/src/types';
5
5
  import { AnyObject } from '../../../../es/shared/types';
6
6
  declare const _default: import("vue").DefineComponent<{
@@ -59,6 +59,10 @@ declare const _default: import("vue").DefineComponent<{
59
59
  type: BooleanConstructor;
60
60
  default: boolean;
61
61
  };
62
+ showHeadFilter: {
63
+ type: BooleanConstructor;
64
+ default: boolean;
65
+ };
62
66
  }, {
63
67
  fieldsMapping: Record<string, string>;
64
68
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
@@ -117,6 +121,10 @@ declare const _default: import("vue").DefineComponent<{
117
121
  type: BooleanConstructor;
118
122
  default: boolean;
119
123
  };
124
+ showHeadFilter: {
125
+ type: BooleanConstructor;
126
+ default: boolean;
127
+ };
120
128
  }>> & {
121
129
  onReset?: ((...args: any[]) => any) | undefined;
122
130
  onClose?: ((...args: any[]) => any) | undefined;
@@ -134,6 +142,7 @@ declare const _default: import("vue").DefineComponent<{
134
142
  field: string;
135
143
  checkedAll?: boolean | undefined;
136
144
  disabledAll?: boolean | undefined;
145
+ isHeadCheckHide?: boolean | undefined;
137
146
  isShow?: boolean | undefined;
138
147
  }[]>;
139
148
  fieldList: import("vue").ComputedRef<AnyObject[]>;
@@ -144,6 +153,7 @@ declare const _default: import("vue").DefineComponent<{
144
153
  field: string;
145
154
  checkedAll?: boolean | undefined;
146
155
  disabledAll?: boolean | undefined;
156
+ isHeadCheckHide?: boolean | undefined;
147
157
  isShow?: boolean | undefined;
148
158
  }[];
149
159
  fieldList: AnyObject[];
@@ -173,6 +183,7 @@ declare const _default: import("vue").DefineComponent<{
173
183
  }) => void;
174
184
  initColumns: () => void;
175
185
  isNoAllCheck: (field: string) => boolean;
186
+ onMove: (e: any) => boolean;
176
187
  NButton: any;
177
188
  NCheckbox: any;
178
189
  NPopconfirm: any;
@@ -373,6 +384,24 @@ declare const _default: import("vue").DefineComponent<{
373
384
  onUpdateChecked?: ((...args: any[]) => any) | undefined;
374
385
  }>>;
375
386
  emit: (event: "updateChecked", ...args: any[]) => void;
387
+ isCheckboxShow: (item: Partial<{
388
+ [key: string]: any;
389
+ id: string;
390
+ name: string;
391
+ show: boolean;
392
+ sort: boolean;
393
+ sortDirection: "NONE" | "ASC" | "DESC";
394
+ title: string;
395
+ alias: string;
396
+ fixedShow: boolean;
397
+ fixedWay: "NONE" | "LEFT" | "RIGHT";
398
+ columnWidth: number | null;
399
+ editable: boolean;
400
+ editableDisable: boolean;
401
+ required: boolean;
402
+ requiredDisable: boolean;
403
+ hide: boolean;
404
+ }>, key: string) => any;
376
405
  getSortPriorityOptions: () => {
377
406
  label: string;
378
407
  value: number;
@@ -498,6 +527,7 @@ declare const _default: import("vue").DefineComponent<{
498
527
  <T>(value?: any): value is any[];
499
528
  };
500
529
  setStyle: typeof setStyle;
530
+ isDraggableItem: typeof isDraggableItem;
501
531
  HelpCircleSharp: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
502
532
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("close" | "save" | "reset")[], "close" | "save" | "reset", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
503
533
  fields: {
@@ -555,6 +585,10 @@ declare const _default: import("vue").DefineComponent<{
555
585
  type: BooleanConstructor;
556
586
  default: boolean;
557
587
  };
588
+ showHeadFilter: {
589
+ type: BooleanConstructor;
590
+ default: boolean;
591
+ };
558
592
  }>> & {
559
593
  onReset?: ((...args: any[]) => any) | undefined;
560
594
  onClose?: ((...args: any[]) => any) | undefined;
@@ -585,5 +619,6 @@ declare const _default: import("vue").DefineComponent<{
585
619
  customColumns: FieldSetColumnItem[];
586
620
  showSearch: boolean;
587
621
  showSortPriority: boolean;
622
+ showHeadFilter: boolean;
588
623
  }>;
589
624
  export default _default;
@@ -1 +1 @@
1
- import{defineComponent as e,ref as l,computed as t,reactive as i,watch as o,openBlock as d,createElementBlock as a,normalizeStyle as r,createBlock as s,unref as n,withKeys as u,withModifiers as c,createCommentVNode as f,createElementVNode as h,Fragment as p,renderList as m,withCtx as y,createTextVNode as v,toDisplayString as b,createVNode as k,mergeProps as g,renderSlot as x}from"vue";import{useThemeVars as w,NInput as A,NCheckbox as _,NTooltip as S,NIcon as C,NPopconfirm as W,NButton as E}from"naive-ui";import P from"../../../shared/components/VueDraggable/src/vuedraggable.js";import q from"./components/Row.vue.js";import{isArray as F,cloneDeep as N,isString as R,omit as j}from"lodash-es";import{isDisable as B,setStyle as I,getGroupTree as U}from"./utils/index.js";import{uuidGenerator as D}from"../../../shared/utils/index.js";import{HelpCircleSharp as O}from"@vicons/ionicons5";const T={class:"c-field-set__table-header"},V=h("span",null,"数值越小,优先级越高",-1),K=["tabindex"],L={key:1,class:"c-field-set__table-footer"};var G=e({__name:"FieldSet",props:{fields:{type:Array,default:()=>[]},footerFlag:{type:Boolean,default:!0},type:{type:String,default:"old"},isEdit:{type:Boolean,default:!1},showColumnNames:{type:Array},groupSetting:{type:Object},customColumns:{type:Array,default:()=>[]},showSeq:{type:Boolean,default:!1},showSearch:{type:Boolean,default:!1},showSortPriority:{type:Boolean,default:!1}},emits:["save","close","reset"],setup(e,{expose:G,emit:H}){const M=e,$={sid:"id",columnName:"name",isShow:"show",isSort:"sort",isFixed:"fixedWay",colWidth:"columnWidth"},z=l(w().value.primaryColor),J=l(""),Q=l(),X=l([]),Y=l([{title:"所有字段",type:"text",field:"title"},{title:"显示",type:"checkbox",checkedAll:!1,disabledAll:!1,field:"show"},{title:"编辑",type:"checkbox",checkedAll:!1,disabledAll:!1,field:"editable"},{title:"必填",type:"checkbox",checkedAll:!1,disabledAll:!1,field:"required"},{title:"排序",type:"checkbox",checkedAll:!1,disabledAll:!1,field:"sort"},{title:"加粗",type:"checkbox",checkedAll:!1,disabledAll:!1,field:"bold"},{title:"默认排序",type:"select",field:"sortDirection"},{title:"排序优先级",type:"select",field:"sortPriority"},{title:"固定",type:"select",field:"fixedWay"},{title:"自定义标题",type:"input",field:"alias"},{title:"列宽",type:"inputNumber",field:"columnWidth"}]),Z=t((()=>X.value.flat())),ee=i({columns:Y,fieldList:Z,onUpdateChecked:function({checked:e,column:l}){const t=!e||ue(l.field);l.checkedAll=!t}}),le={keyword:J.value,idx:0,startIdx:0},te=()=>{H("save",{tableFields:ae()})},ie=()=>{H("close")};function oe(){X.value=de(),ne(),H("reset")}function de(){const e=N(M.fields).map((e=>({...e,uuid:D()})));return Object.keys($).forEach((l=>{e.forEach((e=>{"old"==M.type&&Reflect.has(e,l)&&("isFixed"==l?e.fixedWay=1==e[l]?"LEFT":2==e[l]?"RIGHT":"NONE":["isShow","isSort"].includes(l)&&"boolean"!=typeof l?e[$[l]]=1==e[l]:e[$[l]]=e[l],Reflect.deleteProperty(e,l)),e.columnWidth=+e.columnWidth||null,Reflect.has(e,"alias")||(e.alias=""),Reflect.has(e,"bold")||(e.bold=!1)}))})),function(e){if(M.groupSetting){return U(M.groupSetting,e).reduce(((t,i)=>{const o=R(i)?e.find((e=>e.name===i)):l(i.children);return o&&t.push(o),t}),[])}return e;function l(t){const i=[];return t.forEach((t=>{if(t.children)i.push(...l(t.children));else{const l=e.find((e=>e.name===t));l&&i.push(l)}})),i}}(e)}function ae(){let e=[];return e="old"==M.type?Z.value.map(((e,l)=>({id:e.id,field:e.name,visible:e.show,sequence:l,sortable:e.sort,title:e.alias,fixed:e.fixedWay,minWidth:e.columnWidth,bold:e.bold,sortDirection:e.sortDirection,sortPriority:e.sortPriority,...M.isEdit?{required:e.required,editable:e.editable}:{}}))):Z.value,e.map((e=>j(e,["uuid"])))}function re(){const e=le.keyword!==J.value;let l=J.value?Z.value.findIndex(((l,t)=>{var i;if(null==(i=l.title)?void 0:i.includes(J.value))return!!e||t>le.idx})):0;-1!==l||e||(l=le.startIdx),Q.value.scrollTop=52*l,Object.assign(le,{keyword:J.value,idx:l},e?{startIdx:l}:{})}function se(e){var l;return!!J.value&&(null==(l=e.title)?void 0:l.includes(J.value))}function ne(){var e,l;(null==(e=M.showColumnNames)?void 0:e.length)&&(Y.value=Y.value.filter((e=>{var l,t;return"title"===e.field||(null==(t=null==(l=M.showColumnNames)?void 0:l.includes)?void 0:t.call(l,e.field))}))),(null==(l=M.customColumns)?void 0:l.length)&&Y.value.push(...M.customColumns),M.showSeq&&Y.value.splice(1,0,{title:"排序",type:"text",field:"seq"}),Y.value.forEach((e=>{if(e.isShow=function(e){return!(["editable","required"].includes(e.field)&&!M.isEdit||"sortPriority"===e.field&&!M.showSortPriority)}(e),"checkbox"===e.type){const l=X.value.flat().every((l=>!Reflect.has(l,e.field)));e.checkedAll=!ue(e.field)&&!l}}))}function ue(e){return X.value.flat().some((l=>!B(l,e)&&!l[e]&&"0001"!=l.id))}return o([()=>M.fields,()=>{var e;return null==(e=M.showColumnNames)?void 0:e.length}],(([e,l])=>{e.length>0&&(X.value=de(),ne())}),{immediate:!0,deep:!0}),G({getTableFields:ae}),(l,t)=>(d(),a("div",{class:"c-field-set",style:r({"--row-height":"52px","--primary-color":z.value})},[e.showSearch?(d(),s(n(A),{key:0,class:"c-field-set__search-wrapper",value:J.value,"onUpdate:value":t[0]||(t[0]=e=>J.value=e),valueModifiers:{trim:!0},placeholder:"请输入字段标题",onKeydown:u(c(re,["prevent"]),["enter"])},null,8,["value","onKeydown"])):f("v-if",!0),h("div",T,[(d(!0),a(p,null,m(Y.value,((e,l)=>(d(),a(p,{key:l},[e.isShow?(d(),a("span",{key:0,class:"table-cell",style:r(n(I)(e))},["checkbox"===e.type?(d(),s(n(_),{key:0,checked:e.checkedAll,"onUpdate:checked":[l=>e.checkedAll=l,l=>{return t=l,i=e.field,void Z.value.forEach((e=>{B(e,i)||(e[i]=t)}));var t,i}],disabled:e.disabledAll},{default:y((()=>[v(b(e.title),1)])),_:2},1032,["checked","onUpdate:checked","disabled"])):f("v-if",!0),v(" "+b("checkbox"!==e.type?e.title:"")+" ",1),"sortPriority"===e.field?(d(),s(n(S),{key:1,trigger:"hover"},{trigger:y((()=>[k(n(C),{component:n(O),style:{top:"2px"}},null,8,["component"])])),default:y((()=>[V])),_:1})):f("v-if",!0)],4)):f("v-if",!0)],64)))),128))]),h("div",{class:"c-field-set__table-body",ref_key:"tableBodyRef",ref:Q},[k(n(P),{modelValue:X.value,"onUpdate:modelValue":t[1]||(t[1]=e=>X.value=e),animation:"150","item-key":"id",draggable:".item"},{item:y((({element:e,index:l})=>[e.hide?f("v-if",!0):(d(),a("div",{key:0,class:"item",tabindex:l},[n(F)(e)?(d(!0),a(p,{key:0},m(e,((e,t)=>(d(),s(q,g(ee,{key:t,element:e,idx:l+1,"is-highlight":se(e)}),null,16,["element","idx","is-highlight"])))),128)):(d(),s(q,g({key:1},ee,{element:e,idx:l+1,"is-highlight":se(e)}),null,16,["element","idx","is-highlight"]))],8,K))])),_:1},8,["modelValue"])],512),e.footerFlag?(d(),a("div",L,[f(" 底部按钮插槽 "),x(l.$slots,"footer",{},(()=>[k(n(W),{onPositiveClick:oe},{trigger:y((()=>[k(n(E),{style:{"margin-right":"8px"}},{default:y((()=>[v("恢复默认设置")])),_:1})])),default:y((()=>[v(" 确认要恢复系统默认设置吗? ")])),_:1}),k(n(E),{style:{"margin-right":"8px"},onClick:ie},{default:y((()=>[v("取消")])),_:1}),k(n(E),{type:"primary",onClick:te},{default:y((()=>[v("保存")])),_:1})]))])):f("v-if",!0)],4))}});export{G as default};
1
+ import{defineComponent as e,ref as l,computed as t,reactive as i,watch as o,openBlock as d,createElementBlock as a,normalizeStyle as r,createBlock as s,unref as n,withKeys as u,withModifiers as c,createCommentVNode as f,createElementVNode as h,Fragment as p,renderList as m,withCtx as y,createTextVNode as v,toDisplayString as b,createVNode as k,normalizeClass as g,mergeProps as x,renderSlot as w}from"vue";import{useThemeVars as S,NInput as A,NCheckbox as _,NTooltip as C,NIcon as F,NPopconfirm as W,NButton as E}from"naive-ui";import H from"../../../shared/components/VueDraggable/src/vuedraggable.js";import P from"./components/Row.vue.js";import{isArray as q,cloneDeep as N,isString as R,omit as j}from"lodash-es";import{isDisable as B,setStyle as I,isDraggableItem as U,isDraggable as D,getGroupTree as O}from"./utils/index.js";import{uuidGenerator as T}from"../../../shared/utils/index.js";import{HelpCircleSharp as V}from"@vicons/ionicons5";const K={class:"c-field-set__table-header"},L=h("span",null,"数值越小,优先级越高",-1),G=["tabindex"],M={key:1,class:"c-field-set__table-footer"};var $=e({__name:"FieldSet",props:{fields:{type:Array,default:()=>[]},footerFlag:{type:Boolean,default:!0},type:{type:String,default:"old"},isEdit:{type:Boolean,default:!1},showColumnNames:{type:Array},groupSetting:{type:Object},customColumns:{type:Array,default:()=>[]},showSeq:{type:Boolean,default:!1},showSearch:{type:Boolean,default:!1},showSortPriority:{type:Boolean,default:!1},showHeadFilter:{type:Boolean,default:!1}},emits:["save","close","reset"],setup(e,{expose:$,emit:z}){const J=e,Q={sid:"id",columnName:"name",isShow:"show",isSort:"sort",isFixed:"fixedWay",colWidth:"columnWidth"},X=l(S().value.primaryColor),Y=l(""),Z=l(),ee=l([]),le=l([{title:"所有字段",type:"text",field:"title"},{title:"显示",type:"checkbox",checkedAll:!1,disabledAll:!1,field:"show"},{title:"编辑",type:"checkbox",checkedAll:!1,disabledAll:!1,field:"editable"},{title:"必填",type:"checkbox",checkedAll:!1,disabledAll:!1,field:"required"},{title:"排序",type:"checkbox",checkedAll:!1,disabledAll:!1,field:"sort"},{title:"加粗",type:"checkbox",checkedAll:!1,disabledAll:!1,field:"bold"},{title:"默认排序",type:"select",field:"sortDirection"},{title:"排序优先级",type:"select",field:"sortPriority"},{title:"固定",type:"select",field:"fixedWay"},{title:"自定义标题",type:"input",field:"alias"},{title:"列宽",type:"inputNumber",field:"columnWidth"},{title:"表头筛选",type:"checkbox",isHeadCheckHide:!0,field:"isShowHeaderFilter"}]),te=t((()=>ee.value.flat())),ie=i({columns:le,fieldList:te,onUpdateChecked:function({checked:e,column:l}){const t=!e||he(l.field);l.checkedAll=!t}}),oe={keyword:Y.value,idx:0,startIdx:0},de=()=>{z("save",{tableFields:ne()})},ae=()=>{z("close")};function re(){ee.value=se(),fe(),z("reset")}function se(){const e=N(J.fields).map((e=>({...e,uuid:T()})));return Object.keys(Q).forEach((l=>{e.forEach((e=>{"old"==J.type&&Reflect.has(e,l)&&("isFixed"==l?e.fixedWay=1==e[l]?"LEFT":2==e[l]?"RIGHT":"NONE":["isShow","isSort"].includes(l)&&"boolean"!=typeof l?e[Q[l]]=1==e[l]:e[Q[l]]=e[l],Reflect.deleteProperty(e,l)),e.columnWidth=+e.columnWidth||null,Reflect.has(e,"alias")||(e.alias=""),Reflect.has(e,"bold")||(e.bold=!1),e.draggable=!!D(e)}))})),function(e){if(J.groupSetting){return O(J.groupSetting,e).reduce(((t,i)=>{const o=R(i)?e.find((e=>e.name===i)):l(i.children);return o&&t.push(o),t}),[])}return e;function l(t){const i=[];return t.forEach((t=>{if(t.children)i.push(...l(t.children));else{const l=e.find((e=>e.name===t));l&&i.push(l)}})),i}}(e)}function ne(){let e=[];return e="old"==J.type?te.value.map(((e,l)=>({id:e.id,field:e.name,visible:e.show,sequence:l,sortable:e.sort,title:e.alias,fixed:e.fixedWay,minWidth:e.columnWidth,bold:e.bold,sortDirection:e.sortDirection,sortPriority:e.sortPriority,...J.isEdit?{required:e.required,editable:e.editable}:{}}))):te.value,e.map((e=>j(e,["uuid"])))}function ue(){const e=oe.keyword!==Y.value;let l=Y.value?te.value.findIndex(((l,t)=>{var i;if(null==(i=l.title)?void 0:i.includes(Y.value))return!!e||t>oe.idx})):0;-1!==l||e||(l=oe.startIdx),Z.value.scrollTop=52*l,Object.assign(oe,{keyword:Y.value,idx:l},e?{startIdx:l}:{})}function ce(e){var l;return!!Y.value&&(null==(l=e.title)?void 0:l.includes(Y.value))}function fe(){var e,l;(null==(e=J.showColumnNames)?void 0:e.length)&&(le.value=le.value.filter((e=>{var l,t;return"title"===e.field||(null==(t=null==(l=J.showColumnNames)?void 0:l.includes)?void 0:t.call(l,e.field))}))),(null==(l=J.customColumns)?void 0:l.length)&&le.value.push(...J.customColumns),J.showSeq&&le.value.splice(1,0,{title:"排序",type:"text",field:"seq"}),le.value.forEach((e=>{if(e.isShow=function(e){return!(["editable","required"].includes(e.field)&&!J.isEdit||"sortPriority"===e.field&&!J.showSortPriority||"isShowHeaderFilter"===e.field&&!J.showHeadFilter)}(e),"checkbox"===e.type){const l=ee.value.flat().every((l=>!Reflect.has(l,e.field)));e.checkedAll=!he(e.field)&&!l}}))}function he(e){return ee.value.flat().some((l=>!B(l,e)&&!l[e]&&"0001"!=l.id))}function pe(e){return!!U(e.relatedContext.element)}return o([()=>J.fields,()=>{var e;return null==(e=J.showColumnNames)?void 0:e.length}],(([e,l])=>{e.length>0&&(ee.value=se(),fe())}),{immediate:!0,deep:!0}),$({getTableFields:ne}),(l,t)=>(d(),a("div",{class:"c-field-set",style:r({"--row-height":"52px","--primary-color":X.value})},[e.showSearch?(d(),s(n(A),{key:0,class:"c-field-set__search-wrapper",value:Y.value,"onUpdate:value":t[0]||(t[0]=e=>Y.value=e),valueModifiers:{trim:!0},placeholder:"请输入字段标题",onKeydown:u(c(ue,["prevent"]),["enter"])},null,8,["value","onKeydown"])):f("v-if",!0),h("div",K,[(d(!0),a(p,null,m(le.value,((e,l)=>(d(),a(p,{key:l},[e.isShow?(d(),a("span",{key:0,class:"table-cell",style:r(n(I)(e))},["checkbox"!==e.type||e.isHeadCheckHide?(d(),a(p,{key:1},[v(b(e.title),1)],64)):(d(),s(n(_),{key:0,checked:e.checkedAll,"onUpdate:checked":[l=>e.checkedAll=l,l=>{return t=l,i=e.field,void te.value.forEach((e=>{B(e,i)||(e[i]=t)}));var t,i}],disabled:e.disabledAll},{default:y((()=>[v(b(e.title),1)])),_:2},1032,["checked","onUpdate:checked","disabled"])),"sortPriority"===e.field?(d(),s(n(C),{key:2,trigger:"hover"},{trigger:y((()=>[k(n(F),{component:n(V),style:{top:"2px"}},null,8,["component"])])),default:y((()=>[L])),_:1})):f("v-if",!0)],4)):f("v-if",!0)],64)))),128))]),h("div",{class:"c-field-set__table-body",ref_key:"tableBodyRef",ref:Z},[k(n(H),{modelValue:ee.value,"onUpdate:modelValue":t[1]||(t[1]=e=>ee.value=e),animation:"150","item-key":"id",filter:".disabled",draggable:".item",move:pe},{item:y((({element:e,index:l})=>[e.hide?f("v-if",!0):(d(),a("div",{key:0,class:g(["item",n(U)(e)?"":"disabled"]),tabindex:l},[n(q)(e)?(d(!0),a(p,{key:0},m(e,((e,t)=>(d(),s(P,x(ie,{key:t,element:e,idx:l+1,"is-highlight":ce(e)}),null,16,["element","idx","is-highlight"])))),128)):(d(),s(P,x({key:1},ie,{element:e,idx:l+1,"is-highlight":ce(e)}),null,16,["element","idx","is-highlight"]))],10,G))])),_:1},8,["modelValue"])],512),e.footerFlag?(d(),a("div",M,[f(" 底部按钮插槽 "),w(l.$slots,"footer",{},(()=>[k(n(W),{onPositiveClick:re},{trigger:y((()=>[k(n(E),{style:{"margin-right":"8px"}},{default:y((()=>[v("恢复默认设置")])),_:1})])),default:y((()=>[v(" 确认要恢复系统默认设置吗? ")])),_:1}),k(n(E),{style:{"margin-right":"8px"},onClick:ae},{default:y((()=>[v("取消")])),_:1}),k(n(E),{type:"primary",onClick:de},{default:y((()=>[v("保存")])),_:1})]))])):f("v-if",!0)],4))}});export{$ as default};
@@ -1,6 +1,6 @@
1
1
  import { PropType } from 'vue';
2
2
  import { AnyObject } from '../../../../../es/shared/types';
3
- import { FieldSetColumnItem } from '../../../../../es/components/field-set';
3
+ import { FieldSetItem, FieldSetColumnItem } from '../../../../../es/components/field-set';
4
4
  import { setStyle, isDisable } from '../utils';
5
5
  declare const _default: import("vue").DefineComponent<{
6
6
  element: {
@@ -123,6 +123,7 @@ declare const _default: import("vue").DefineComponent<{
123
123
  onUpdateChecked?: ((...args: any[]) => any) | undefined;
124
124
  }>>;
125
125
  emit: (event: "updateChecked", ...args: any[]) => void;
126
+ isCheckboxShow: (item: FieldSetItem, key: string) => any;
126
127
  getSortPriorityOptions: () => {
127
128
  label: string;
128
129
  value: number;
@@ -1 +1 @@
1
- import{defineComponent as e,openBlock as l,createElementBlock as t,Fragment as i,renderList as n,normalizeStyle as a,unref as o,createBlock as r,withCtx as u,createVNode as d,createCommentVNode as s,createElementVNode as f,normalizeClass as c,toDisplayString as p,withDirectives as m,vShow as v}from"vue";import{NTooltip as y,NIcon as h,NCheckbox as b,NSelect as k,NInput as g,NInputNumber as x}from"naive-ui";import{setStyle as N,isDisable as U}from"../utils/index.js";import{ReorderTwoOutline as E}from"@vicons/ionicons5";import{range as O}from"lodash-es";const P={class:"row"},w=["title"],C=f("span",null,"拖拽调整顺序",-1);var D=e({__name:"Row",props:{element:{type:Object,default:()=>({})},columns:{type:Array,default:()=>[]},idx:{type:Number,default:1},fieldList:{type:Array,default:()=>[]},isHighlight:{type:Boolean}},emits:["updateChecked"],setup(e,{emit:D}){const L=e,S=[{label:"不固定",value:"NONE"},{label:"左固定",value:"LEFT"},{label:"右固定",value:"RIGHT"}],A=[{label:"不排序",value:"NONE"},{label:"升序",value:"ASC"},{label:"降序",value:"DESC"}];function H(e){switch(e.field){case"fixedWay":return S;case"sortDirection":return A;case"sortPriority":return function(){const e=O(1,L.fieldList.length+1).map((e=>({label:e.toString(),value:e}))),l=L.fieldList.filter((e=>!!e.sortPriority&&e.uuid!==L.element.uuid)).map((e=>e.sortPriority));return e.filter((e=>!l.includes(e.value)))}();default:return[]}}function _(e){if("sortPriority"!==e.field)return!1;const{sortDirection:l}=L.element;return!l||"NONE"===l}return(O,S)=>(l(),t("div",P,[(l(!0),t(i,null,n(e.columns,((n,O)=>(l(),t(i,{key:O},[n.isShow?(l(),t("span",{key:0,class:"table-cell",title:e.element[n.field],style:a(o(N)(n))},["text"===n.type?(l(),t(i,{key:0},[0===O?(l(),r(o(y),{key:0,trigger:"hover"},{trigger:u((()=>[d(o(h),{style:{"margin-right":"5px",top:"2px"},component:o(E)},null,8,["component"])])),default:u((()=>[C])),_:1})):s("v-if",!0),f("span",{class:c([e.isHighlight&&"title"===n.field?"highlight":""])},p("seq"===n.field?e.idx:e.element[n.field]),3)],64)):s("v-if",!0),"checkbox"===n.type?m((l(),r(o(b),{key:1,disabled:o(U)(e.element,n.field),checked:e.element[n.field],"onUpdate:checked":[l=>e.element[n.field]=l,e=>function(e,l){D("updateChecked",{checked:e,column:l})}(e,n)]},null,8,["disabled","checked","onUpdate:checked"])),[[v,"0001"!=e.element.id]]):s("v-if",!0),"select"===n.type?m((l(),r(o(k),{key:2,clearable:"",disabled:_(n),value:e.element[n.field],"onUpdate:value":[l=>e.element[n.field]=l,e=>function(e,l){"sortDirection"===l.field&&"NONE"===e&&(L.element.sortPriority=null)}(e,n)],options:H(n)},null,8,["disabled","value","onUpdate:value","options"])),[[v,"fixedWay"===n.field||"0001"!=e.element.id]]):s("v-if",!0),"input"===n.type?m((l(),r(o(g),{key:3,value:e.element[n.field],"onUpdate:value":l=>e.element[n.field]=l,clearable:""},null,8,["value","onUpdate:value"])),[[v,"0001"!=e.element.id]]):s("v-if",!0),"inputNumber"===n.type?(l(),r(o(x),{key:4,value:e.element[n.field],"onUpdate:value":l=>e.element[n.field]=l},null,8,["value","onUpdate:value"])):s("v-if",!0)],12,w)):s("v-if",!0)],64)))),128))]))}});export{D as default};
1
+ import{defineComponent as e,openBlock as l,createElementBlock as t,Fragment as i,renderList as n,normalizeStyle as a,unref as r,createBlock as o,withCtx as d,createVNode as u,createCommentVNode as s,createElementVNode as f,normalizeClass as c,toDisplayString as m,withDirectives as p,vShow as v}from"vue";import{NTooltip as y,NIcon as h,NCheckbox as b,NSelect as k,NInput as g,NInputNumber as x}from"naive-ui";import{setStyle as N,isDisable as U}from"../utils/index.js";import{ReorderTwoOutline as E}from"@vicons/ionicons5";import{range as w}from"lodash-es";const C={class:"row"},H=["title"],O=f("span",null,"拖拽调整顺序",-1);var P=e({__name:"Row",props:{element:{type:Object,default:()=>({})},columns:{type:Array,default:()=>[]},idx:{type:Number,default:1},fieldList:{type:Array,default:()=>[]},isHighlight:{type:Boolean}},emits:["updateChecked"],setup(e,{emit:P}){const S=e,D=[{label:"不固定",value:"NONE"},{label:"左固定",value:"LEFT"},{label:"右固定",value:"RIGHT"}],L=[{label:"不排序",value:"NONE"},{label:"升序",value:"ASC"},{label:"降序",value:"DESC"}];function A(e){switch(e.field){case"fixedWay":return D;case"sortDirection":return L;case"sortPriority":return function(){const e=w(1,S.fieldList.length+1).map((e=>({label:e.toString(),value:e}))),l=S.fieldList.filter((e=>!!e.sortPriority&&e.uuid!==S.element.uuid)).map((e=>e.sortPriority));return e.filter((e=>!l.includes(e.value)))}();default:return[]}}function F(e){if("sortPriority"!==e.field)return!1;const{sortDirection:l}=S.element;return!l||"NONE"===l}return(w,D)=>(l(),t("div",C,[(l(!0),t(i,null,n(e.columns,((n,w)=>{return l(),t(i,{key:w},[n.isShow?(l(),t("span",{key:0,class:"table-cell",title:e.element[n.field],style:a(r(N)(n))},["text"===n.type?(l(),t(i,{key:0},[0===w?(l(),o(r(y),{key:0,trigger:"hover"},{trigger:d((()=>[u(r(h),{style:{"margin-right":"5px",top:"2px"},component:r(E)},null,8,["component"])])),default:d((()=>[O])),_:1})):s("v-if",!0),f("span",{class:c([e.isHighlight&&"title"===n.field?"highlight":""])},m("seq"===n.field?e.idx:e.element[n.field]),3)],64)):s("v-if",!0),"checkbox"===n.type?p((l(),o(r(b),{key:1,disabled:r(U)(e.element,n.field),checked:e.element[n.field],"onUpdate:checked":[l=>e.element[n.field]=l,e=>function(e,l){P("updateChecked",{checked:e,column:l})}(e,n)]},null,8,["disabled","checked","onUpdate:checked"])),[[v,(C=e.element,D=n.field,"isShowHeaderFilter"===D?C.isConfiguredHeaderFilter&&"0001"!=S.element.id:"0001"!=S.element.id)]]):s("v-if",!0),"select"===n.type?p((l(),o(r(k),{key:2,clearable:"",disabled:F(n),value:e.element[n.field],"onUpdate:value":[l=>e.element[n.field]=l,e=>function(e,l){"sortDirection"===l.field&&"NONE"===e&&(S.element.sortPriority=null)}(e,n)],options:A(n)},null,8,["disabled","value","onUpdate:value","options"])),[[v,"fixedWay"===n.field||"0001"!=e.element.id]]):s("v-if",!0),"input"===n.type?p((l(),o(r(g),{key:3,value:e.element[n.field],"onUpdate:value":l=>e.element[n.field]=l,clearable:""},null,8,["value","onUpdate:value"])),[[v,"0001"!=e.element.id]]):s("v-if",!0),"inputNumber"===n.type?(l(),o(r(x),{key:4,value:e.element[n.field],"onUpdate:value":l=>e.element[n.field]=l},null,8,["value","onUpdate:value"])):s("v-if",!0)],12,H)):s("v-if",!0)],64);var C,D})),128))]))}});export{P as default};
@@ -23,5 +23,6 @@ export declare type FieldSetColumnItem = {
23
23
  field: string;
24
24
  checkedAll?: boolean;
25
25
  disabledAll?: boolean;
26
+ isHeadCheckHide?: boolean;
26
27
  isShow?: boolean;
27
28
  };
@@ -5,3 +5,5 @@ import { IhoTableConfig } from '../../../../../es/components/iho-table';
5
5
  export declare function setStyle(column: AnyObject): CSSProperties;
6
6
  export declare function isDisable(item: FieldSetItem, key: string): any;
7
7
  export declare function getGroupTree(rowGroupSetting: NonNullable<IhoTableConfig['rowGroupSetting']>, fieldList: FieldSetItem[], getKey?: (field: FieldSetItem) => string): Array<AnyObject | string>;
8
+ export declare function isDraggable(fieldItem: AnyObject): any;
9
+ export declare function isDraggableItem(item: AnyObject | AnyObject[]): any;
@@ -1 +1 @@
1
- import{isArray as e,isObject as t}from"lodash-es";import{IhoTableRowGroupSequence as i}from"../../../iho-table/src/constants/index.js";function n(e){const t={flex:"1 1 90px"};switch(e.type){case"text":"title"===e.field&&Object.assign(t,{flex:"0 0 120px",overflow:"hidden","text-overflow":"ellipsis","white-space":"nowrap"}),"seq"===e.field&&(t.flex="1 1 40px");break;case"checkbox":t.flex="1 1 60px";break;case"select":t.flex="1 1 80px";break;case"input":t.flex="1 1 100px"}return t}function s(e,t){return["editable","required"].includes(t)&&e[`${t}Disable`]||["sort"].includes(t)&&1==e.notParticipatingSort}function l(n,s,l=(e=>e.name)){const r=s.map((e=>l(e)));return i.some((i=>{const s=n[i];if(!e(s))return!0;s.forEach((i=>{if(!e(i.list)||!i.list.length)return;const n=[];let s=null;i.list.forEach(((e,l)=>{const c=function(e,i,n){return i.findIndex((i=>i!==n&&(t(i)?i.fieldName:i)===e))}(e,r,s);~c&&(n.push(r[c]),0===l?r.splice(c,1,s={fieldName:i.title,children:n}):r.splice(c,1))}))}))})),r}export{l as getGroupTree,s as isDisable,n as setStyle};
1
+ import{isArray as e,isObject as t}from"lodash-es";import{IhoTableRowGroupSequence as i}from"../../../iho-table/src/constants/index.js";function n(e){const t={flex:"1 1 90px"};switch(e.type){case"text":"title"===e.field&&Object.assign(t,{flex:"0 0 120px",overflow:"hidden","text-overflow":"ellipsis","white-space":"nowrap"}),"seq"===e.field&&(t.flex="1 1 40px");break;case"checkbox":t.flex="1 1 60px";break;case"select":t.flex="1 1 80px";break;case"input":t.flex="1 1 100px"}return t}function r(e,t){return["editable","required"].includes(t)&&e[`${t}Disable`]||["sort"].includes(t)&&(1==e.notParticipatingSort||e.sortDisabled)}function l(n,r,l=(e=>e.name)){const s=r.map((e=>l(e)));return i.some((i=>{const r=n[i];if(!e(r))return!0;r.forEach((i=>{if(!e(i.list)||!i.list.length)return;const n=[];let r=null;i.list.forEach(((e,l)=>{const o=function(e,i,n){return i.findIndex((i=>i!==n&&(t(i)?i.fieldName:i)===e))}(e,s,r);~o&&(n.push(s[o]),0===l?s.splice(o,1,r={fieldName:i.title,children:n}):s.splice(o,1))}))}))})),s}function s(e){return void 0===e.draggable||e.draggable}function o(t){return e(t)?!t.some((e=>!e.draggable)):t.draggable}export{l as getGroupTree,r as isDisable,s as isDraggable,o as isDraggableItem,n as setStyle};
@@ -1 +1 @@
1
- .c-field-set{display:flex;flex-flow:column nowrap;height:100%;width:100%}.c-field-set__search-wrapper.n-input{margin-bottom:12px;width:50%}.c-field-set .item{background:#fff}.c-field-set .item:active{background:#f2f2f2;box-shadow:0 0 10px 0 #d5d5d5}.c-field-set .item:focus{background-color:#f2f2f2}.c-field-set .item .row{align-items:center;border-bottom:1px solid #e8e8e8;display:flex;height:var(--row-height);padding:5px 0}.c-field-set .table-cell{box-sizing:border-box;color:inherit;display:inline-block;padding:0 5px}.c-field-set .table-cell .highlight{background-color:var(--primary-color);color:#fff}.c-field-set__table-header{align-items:center;background:#f2f2f4;border:1px solid #f2f2f2;display:flex;height:52px}.c-field-set__table-body{flex:1;overflow-y:scroll}.c-field-set__table-footer{border-top:1px solid #d5d5d5;padding:12px 0}
1
+ .c-field-set{display:flex;flex-flow:column nowrap;height:100%;width:100%}.c-field-set__search-wrapper.n-input{margin-bottom:12px;width:50%}.c-field-set .item{background:#fff}.c-field-set .item:active{background:#f2f2f2;box-shadow:0 0 10px 0 #d5d5d5}.c-field-set .item:focus{background-color:#f2f2f2}.c-field-set .item.disabled{cursor:not-allowed}.c-field-set .item .row{align-items:center;border-bottom:1px solid #e8e8e8;display:flex;height:var(--row-height);padding:5px 0}.c-field-set .table-cell{box-sizing:border-box;color:inherit;display:inline-block;padding:0 5px}.c-field-set .table-cell .highlight{background-color:var(--primary-color);color:#fff}.c-field-set__table-header{align-items:center;background:#f2f2f4;border:1px solid #f2f2f2;display:flex;height:52px}.c-field-set__table-body{flex:1;overflow-y:scroll}.c-field-set__table-footer{border-top:1px solid #d5d5d5;padding:12px 0}
@@ -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 k,toDisplayString as v,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,onFieldValueChange as B,onFieldMount as O,onFieldUnmount as R,onFieldReact as w,onFormMount as _}from"@formily/core";import{FormProvider as D,FormConsumer as V}from"@formily/vue";import{NForm as I,NTabs as N,NTabPane as q,NConfigProvider as W}from"naive-ui";import{InjectionFormLifeCycleCaller as E,InjectionFormGraph as K}from"./constants/index.js";import{useAutoHidden as T}from"./hooks/useAutoHidden.js";import{useComplexOptionsSpan as U}from"./hooks/useComplexOptions.js";import{useFormDomEvent as G,useFormExposeEvent as M}from"./hooks/useFormEvent.js";import{useFormGraph as P}from"./hooks/useFormGraph.js";import{useFormRenderLifeCycle as J}from"./hooks/useFormRenderLifeCycle.js";import{useLowCodeEvent as $}from"./hooks/useLowCodeEvent.js";import{useLowCodeReactions as z}from"./hooks/useLowCodeReactions.js";import{useNuiThemeOverrides as Q}from"./hooks/useNuiThemeOverrides.js";import{useOperationalForm as X}from"./hooks/useOperationalForm.js";import{useWordbookSetting as Y}from"./hooks/useWordbookSetting.js";import"../../../shared/utils/index.js";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"../index.js";import{createObjSchema as Z}from"./utils/schema.js";import{useFieldListAdaptor as ee}from"./hooks/useFieldListAdaptor.js";import{useFieldVisitor as oe}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 te}from"./hooks/useFormValidator.js";import{useAnchor as re}from"./hooks/useAnchor.js";import{useFormContext as se}from"./hooks/useFormContext.js";import"./hooks/useFormRenderOptions.js";const ae={key:0,style:{height:"54px"}},ie={style:{"white-space":"pre"}};var le=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:le,emit:ne}){const me=e,de=C(),{nuiThemeOverrides:pe}=Q();te();const ue=o(),ce=t((()=>S(me.maxHeight)?me.maxHeight+"px":me.maxHeight)),{SchemaField:fe,businessCollector:he,formItemDepsCollector:ye,changeContextCollector:ge,formUUID:je}=se(me,ne),{anchorBarRef:be,currentAnchor:ke,updateAnchorList:ve,anchorIdList:Fe,onScroll:Ce}=re(me,ne,ue,ye),{callLifeCycle:Se}=J(me);r(E,Se),Se("onSetup");const{trigger:He}=T(),{observeFormGraph:xe,setGraph:Ae,removeGraph:Le}=P();r(K,xe);const{lowCodeEventTrigger:Be}=$(),Oe=L({initialValues:me.initialData,effects(e){B("*",(o=>{const t=o.props.name.toString();he.trigger(e,t),ye.trigger(t),ne("formChange",{fieldInstance:o,fieldKey:t,fieldName:o.title,value:o.value,context:ge.getContext(t,o.value)}),Be(o),Re(t),_e(t),Ve(t,o.value)})),O("*",Ae),R("*",Le),me.linebarAutoHidden&&(w("*",He),_((e=>e.query("*").forEach(He)))),me.anchor&&w("*",ve)}}),{lowCodeReactionsHandler:Re,triggerAllReactionsHandler:we}=z(t((()=>me.lowCodeReactions)),Oe),{operationalFormHandler:_e,triggerAllOperationalFormHandler:De}=X(t((()=>me.operationalForm)),Oe),{wordbookSettingHandler:Ve}=Y(Oe,ge);s(we),s(De);const{schemaAdaptor:Ie}=ee(he);let Ne=me.fieldList||[];const qe=t((()=>me.schema?me.schema:me.fieldList?(Ne=oe().traverse(H(me.fieldList),me.fieldVisitor),Z(Ie(Ne,me))):Z({}))),{onKeydown:We}=G({formModel:Oe,formRenderRef:ue,props:me}),{clearSpan:Ee}=U();a((()=>Ee(je)));const Ke=M({formModel:Oe,formRenderRef:ue,formItemDepsCollector:ye,getFieldList:()=>Ne,formUUID:je});return le({formModel:Oe,validate:(e="*",o={})=>Ke.validate(e,o),getFormValues:(e=!0)=>Ke.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&&(he.triggerLock=!0),m&&(ye.triggerDisabled=!0),Ke.setFormValues(e,d,r),await i(),he.triggerLock=!1,ye.triggerDisabled=!1},setFieldState(e,o){Ke.setFieldState(e,o)},resetFields(e="*"){Ke.resetFields(e)},queryWidget:async e=>Ke.queryWidget(e),getFieldList:()=>Ne,async reload(){console.error("reload function is abstract,it should be overwrite!")}}),(o,t)=>(l(),n(m(I),{class:d(["form-render",{"form-render--out-border":e.outBordered}]),"require-mark-placement":"left",style:p(m(de))},{default:u((()=>[e.anchor?(l(),c("section",ae,[f(m(N),{value:m(ke),"onUpdate:value":t[0]||(t[0]=e=>h(ke)?ke.value=e:null),type:"line",ref_key:"anchorBarRef",ref:be},{default:u((()=>[(l(!0),c(y,null,g(m(Fe),(e=>(l(),n(m(q),{name:e.name,tab:e.title,key:e.name},null,8,["name","tab"])))),128))])),_:1},8,["value"])])):j("v-if",!0),f(m(W),{"theme-overrides":m(pe)},{default:u((()=>[b("section",{class:"form-render__wrapper",style:p({"--column":e.column,"--form-height":m(ce)}),ref_key:"formRenderRef",ref:ue,onScroll:t[1]||(t[1]=(...e)=>m(Ce)&&m(Ce)(...e)),onKeydownCapture:t[2]||(t[2]=k(((...e)=>m(We)&&m(We)(...e)),["enter"]))},[f(m(D),{form:m(Oe)},{default:u((()=>[f(m(fe),{schema:m(qe)},null,8,["schema"]),e.consumer?(l(),n(m(V),{key:0},{default:u((({form:e})=>[b("div",ie,v(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{le as default};
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,ref as r,computed as t,inject as a,watch as o,createVNode as l}from"vue";import{useVModel as n}from"@vueuse/core";import{isEqual as u,isArray as i,isString as s,isNumber as c,isEmpty as v,isFunction as d,omit as p,cloneDeep as f}from"lodash-es";import"../../../index.js";import{InjectionAsyncQueue as y}from"../../constants/index.js";import{useCommonInjection as m}from"../../hooks/useCommonInjection.js";import{formRenderLog as h}from"../../utils/index.js";import{connect as k,mapProps as j}from"@formily/vue";import g from"../../../../search-cascader/index.js";import w from"../../../../../shared/components/no-data/NoData.vue.js";import{assignUpdateValue as _}from"../../utils/schema.js";import{useFormField as b}from"../../hooks/useFormField.js";import{useFormRequest as K}from"../../hooks/useFormRequest.js";const F=k(e({name:"FormSearchCascade",props:{options:{type:Array,default:()=>[]},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},autograph:{type:String,required:!0},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},wordbook:{type:Object,required:!0},onChange:{},value:{type:[String,Array]}},emits:["update:value"],setup(e,{emit:k}){const j=n(e,"value",k),_=r(!1),F=r([]),{field:O,fieldKey:q}=b(),S=t((()=>{var r,t,a;return null!=(a=null==(t=null==(r=e.wordbook)?void 0:r.show_key)?void 0:t[0])?a:e.labelField})),C=t((()=>{var r,t;return null!=(t=null==(r=e.wordbook)?void 0:r.value_key)?t:e.valueField})),x=t((()=>{var r,t;return null==(t=null==(r=e.wordbook)?void 0:r.render_key)?void 0:t[0]})),L=t((()=>{var r;return(null==(r=e.wordbook)?void 0:r.level_num)||1/0})),V=a(y),{getSearchRequestInfo:A}=K(),I=r(150),P=r();async function R(r,t){var a,o,l;if(I.value=t&&(null==(a=P.value)?void 0:a.getWidth())||150,i(e.value)&&e.value.length&&e.value.every((e=>e[C.value]))&&!r&&!t){const[r,t]=function(e){if(!e.length)return[];const r=[(e=f(e))[0]];let t=e[0];for(let r=1;r<e.length;r++){const a=e[r];a&&(t.children=[a],a.parent=t,t=a)}return[e,r]}(e.value);F.value=t;const a=r[Math.max(0,r.length-2)];return await R(a),a}try{if(r&&!r.__keyword&&r.isLeaf)return n(r);if(null==r?void 0:r.__keyword){if(!s(r.id_link))return Promise.reject();const t=r.id_link.split("_").filter((e=>e));c(L.value)&&L.value!==1/0&&t.splice(L.value);const a=await async function(r){if(!A().primaryKeyUrl)return[];try{return await V.addAsync(t(e.wordbook,e.autograph,r,q.value))}catch(e){s(e)&&h(e)}function t(r,t,a,o){const l=A();return{key:o,params:{autograph:t,tableId:r.id,primaryKeyValue:a.join(","),page:1},...l,url:l.primaryKeyUrl,cache:e.requestCache,payload:{field:O.value,labelKey:S.value,valueKey:C.value}}}}(t);if(!a)return Promise.reject();const{lastOption:o,options:n}=function(e,r){let t=e[0];return{options:r.reduce(((r,o,l)=>{const n=a(e,o);return 0===l?(t=n,[n]):(Object.assign(n,{parent:t,isLeaf:l+1>=L.value}),t.children=[n],t=n,r)}),[]),lastOption:t};function a(e,r){return e.find((e=>e[C.value]===r))}}(a,t);return n.length<L.value&&(await R(o),v(o.children))?(j.value=function(e,r){return r.map((r=>e.find((e=>e[C.value]===r))))}(a,t),_.value=!1,Promise.reject()):(F.value=n,null==(l=P.value)||l.setCursor(o),o)}{const a=await V.addAsync(function(r,a,o,l,n){const u={autograph:()=>a,wordbookId:"id",wordbookType:"type",fieldKeys:()=>r.search_key?JSON.stringify(r.search_key):void 0,conObj:()=>JSON.stringify(function(e,r,t){return r?e.conObj||[]:t?[{con:"EQ",is_compare_field:!1,field_key:e.level_key,value:t[C.value]}]:e.conObjFirstLevel||[]}(r,t,l)),primaryKey:"primary_key",levelKey:"level_key",keyword:()=>t,page:()=>1},i=Object.entries(u).reduce(((e,[t,a])=>(e[t]=s(a)?r[a]:d(a)?a():void 0,e)),{});return{...A(),params:i,key:n,cache:e.requestCache}}(e.wordbook,e.autograph,O.value,r,q.value));if(r){if(!a.length)return n(r);r.children=a.map((e=>function(e,r,t){return{...e,parent:r,isLeaf:u(r)+1>=t}}(e,r,L.value)))}else F.value=a.map((e=>function(e,r){e.__keyword=!!r,e.isLeaf=!!r,r&&(e[S.value]=e[x.value||S.value]||e[S.value]);return e}(e,t))),t&&(null==(o=P.value)||o.setCursor(F.value[0]))}}catch(e){s(e)&&h(e)}function n(e){return j.value=function(e){const r=[];let t=e;for(;t;)r.unshift(p(t,["parent","isLeaf","__keyword","children"])),t=t.parent;return r}(e),_.value=!1,Promise.reject()}function u(e){let r=1,t=e.parent;for(;t;)r++,t=t.parent;return r}}function U(){I.value=150}o((()=>e.wordbook),((r,t)=>{u(r,t)||(F.value=[],r&&(j.value||!e.lazyRequest)&&R())}),{immediate:!0});const{injectValueValidate:B,injectValueWatchFromEmpty:N,injectValueBindKey:W}=m();N(j,R),B(j);const z=W(j);return()=>l(g,{ref:P,value:j.value,"onUpdate:value":e=>j.value=e,show:_.value,"onUpdate:show":e=>_.value=e,options:F.value,key:z.value,labelKey:S.value,valueKey:C.value,search:R,onFocus:U,menuWidth:I.value},{empty:()=>l(w,null,null)})}}),j({dataSource:"options"},_));export{F as LEVEL_SEARCH_CASCADER};
1
+ import{defineComponent as e,computed as r,ref as t,inject as a,watch as l,createVNode as o}from"vue";import{isEqual as n,isArray as u,isEmpty as i,isString as s,isNumber as v,isFunction as d,omit as c,cloneDeep as p}from"lodash-es";import"../../../index.js";import{InjectionAsyncQueue as f}from"../../constants/index.js";import{useCommonInjection as y}from"../../hooks/useCommonInjection.js";import{formRenderLog as m}from"../../utils/index.js";import{connect as h,mapProps as k}from"@formily/vue";import g from"../../../../search-cascader/index.js";import j from"../../../../../shared/components/no-data/NoData.vue.js";import{assignUpdateValue as w}from"../../utils/schema.js";import{useFormField as _}from"../../hooks/useFormField.js";import{useFormRequest as b}from"../../hooks/useFormRequest.js";const K=h(e({name:"FormSearchCascade",props:{options:{type:Array,default:()=>[]},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},autograph:{type:String,required:!0},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},wordbook:{type:Object,required:!0},onChange:{},value:{type:[String,Array]}},emits:["update:value"],setup(e,{emit:h}){const k=r({get:()=>e.value,set(r){n(r,e.value)||h("update:value",r)}}),w=t(!1),K=t([]),{field:F,fieldKey:O}=_(),q=r((()=>{var r,t,a;return null!=(a=null==(t=null==(r=e.wordbook)?void 0:r.show_key)?void 0:t[0])?a:e.labelField})),S=r((()=>{var r,t;return null!=(t=null==(r=e.wordbook)?void 0:r.value_key)?t:e.valueField})),x=r((()=>{var r,t;return null==(t=null==(r=e.wordbook)?void 0:r.render_key)?void 0:t[0]})),C=r((()=>{var r;return(null==(r=e.wordbook)?void 0:r.level_num)||1/0})),L=a(f),{getSearchRequestInfo:P}=b(),A=t(150),I=t();async function R(r,t,a=!0){var l,o,n,f;if(A.value=t&&(null==(l=I.value)?void 0:l.getWidth())||150,u(e.value)&&!i(e.value)&&e.value.every((e=>e[S.value]))&&!r&&!t){const r=1===e.value.length,t=null==(o=K.value)?void 0:o.length,[a,l]=function(e){if(!e.length)return[];const r=[(e=p(e))[0]];let t=e[0];for(let r=1;r<e.length;r++){const a=e[r];a&&(t.children=[a],a.parent=t,t=a)}return[e,r]}(e.value),n=a[Math.max(0,a.length-2)];if(!r){K.value=l;const e=a[Math.max(0,a.length-2)];return await R(e,void 0),e}if(t)return n}try{if(r&&!r.__keyword&&r.isLeaf)return y(r);if(!(null==r?void 0:r.__keyword)){const l=await L.addAsync(function(r,a,l,o,n){const u={autograph:()=>a,wordbookId:"id",wordbookType:"type",fieldKeys:()=>r.search_key?JSON.stringify(r.search_key):void 0,conObj:()=>JSON.stringify(function(e,r,t){return r?e.conObj||[]:t?[{con:"EQ",is_compare_field:!1,field_key:e.level_key,value:t[S.value]}]:e.conObjFirstLevel||[]}(r,t,o)),primaryKey:"primary_key",levelKey:"level_key",keyword:()=>t,page:()=>1},i=Object.entries(u).reduce(((e,[t,a])=>(e[t]=s(a)?r[a]:d(a)?a():void 0,e)),{});return{...P(),params:i,key:n,cache:e.requestCache}}(e.wordbook,e.autograph,F.value,r,O.value));if(r){if(!l.length)return a?y(r):Promise.reject();r.children=l.map((e=>function(e,r,t){return{...e,parent:r,isLeaf:h(r)+1>=t}}(e,r,C.value)))}else K.value=l.map((e=>function(e,r){e.__keyword=!!r,e.isLeaf=!!r,r&&(e[q.value]=e[x.value||q.value]||e[q.value]);return e}(e,t))),t&&(null==(n=I.value)||n.setCursor(K.value[0]));return}if(!s(r.id_link))return Promise.reject();const l=r.id_link.split("_").filter((e=>e));v(C.value)&&C.value!==1/0&&l.splice(C.value);const o=await async function(r){if(!P().primaryKeyUrl)return[];try{return await L.addAsync(t(e.wordbook,e.autograph,r,O.value))}catch(e){s(e)&&m(e)}function t(r,t,a,l){const o=P();return{key:l,params:{autograph:t,tableId:r.id,primaryKeyValue:a.join(","),page:1},...o,url:o.primaryKeyUrl,cache:e.requestCache,payload:{field:F.value,labelKey:q.value,valueKey:S.value}}}}(l);if(!o)return Promise.reject();const{lastOption:u,options:c}=function(e,r){let t=e[0];return{options:r.reduce(((r,l,o)=>{const n=a(e,l);return 0===o?(t=n,[n]):(Object.assign(n,{parent:t,isLeaf:o+1>=C.value}),t.children=[n],t=n,r)}),[]),lastOption:t};function a(e,r){return e.find((e=>e[S.value]===r))}}(o,l);return c.length<C.value&&(await R(u),i(u.children))?(k.value=function(e,r){return r.map((r=>e.find((e=>e[S.value]===r))))}(o,l),w.value=!1,Promise.reject()):(K.value=c,null==(f=I.value)||f.setCursor(u),u)}catch(e){s(e)&&m(e)}function y(e){return k.value=function(e){const r=[];let t=e;for(;t;)r.unshift(c(t,["parent","isLeaf","__keyword","children"])),t=t.parent;return r}(e),w.value=!1,Promise.reject()}function h(e){let r=1,t=e.parent;for(;t;)r++,t=t.parent;return r}}function U(){A.value=150}l((()=>e.wordbook),((r,t)=>{n(r,t)||(K.value=[],r&&(k.value||!e.lazyRequest)&&R())}),{immediate:!0});const{injectValueValidate:V,injectValueBindKey:B}=y();V(k);const N=B(k);return()=>o(g,{ref:I,value:k.value,"onUpdate:value":e=>k.value=e,show:w.value,"onUpdate:show":e=>w.value=e,options:K.value,key:N.value,labelKey:q.value,valueKey:S.value,search:R,onFocus:U,menuWidth:A.value},{empty:()=>o(j,null,null)})}}),k({dataSource:"options"},w));export{K as LEVEL_SEARCH_CASCADER};
@@ -107,6 +107,7 @@ export declare type FormChangeContext = Partial<{
107
107
  }>;
108
108
  export declare type FormChangePayload = {
109
109
  value: any;
110
+ oldValue: any;
110
111
  fieldKey: string;
111
112
  fieldName: string;
112
113
  fieldInstance: DataField;
@@ -17,7 +17,7 @@ declare const IhoTable: SFCWithInstall<import("vue").DefineComponent<{
17
17
  default: () => never[];
18
18
  };
19
19
  annotation: {
20
- type: import("vue").PropType<import("../../../es/shared/types").AnyObject>;
20
+ type: import("vue").PropType<Record<string, import("../annotation-edit/src/type").AnnotationItem>>;
21
21
  };
22
22
  }, {
23
23
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
@@ -34,7 +34,7 @@ declare const IhoTable: SFCWithInstall<import("vue").DefineComponent<{
34
34
  default: () => never[];
35
35
  };
36
36
  annotation: {
37
- type: import("vue").PropType<import("../../../es/shared/types").AnyObject>;
37
+ type: import("vue").PropType<Record<string, import("../annotation-edit/src/type").AnnotationItem>>;
38
38
  };
39
39
  }>> & {
40
40
  onFormChange?: ((...args: any[]) => any) | undefined;
@@ -4655,7 +4655,7 @@ declare const IhoTable: SFCWithInstall<import("vue").DefineComponent<{
4655
4655
  default: () => never[];
4656
4656
  };
4657
4657
  annotation: {
4658
- type: import("vue").PropType<import("../../../es/shared/types").AnyObject>;
4658
+ type: import("vue").PropType<Record<string, import("../annotation-edit/src/type").AnnotationItem>>;
4659
4659
  };
4660
4660
  }>> & {
4661
4661
  onFormChange?: ((...args: any[]) => any) | undefined;
@@ -1,6 +1,7 @@
1
1
  import { AnyObject } from '../../../../es/shared/types';
2
2
  import { PropType } from 'vue';
3
3
  import { VxeTableInstance } from 'vxe-table';
4
+ import { AnnotationItem } from '../../../../es/components/annotation-edit/src/type';
4
5
  import { IhoTableConfig, IhoTableHandler, LowCodeTableFieldItem } from '../../../../es/components/iho-table/src/types';
5
6
  declare const _default: import("vue").DefineComponent<{
6
7
  tableConfig: {
@@ -16,7 +17,7 @@ declare const _default: import("vue").DefineComponent<{
16
17
  default: () => never[];
17
18
  };
18
19
  annotation: {
19
- type: PropType<AnyObject>;
20
+ type: PropType<Record<string, AnnotationItem>>;
20
21
  };
21
22
  }, {
22
23
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
@@ -33,7 +34,7 @@ declare const _default: import("vue").DefineComponent<{
33
34
  default: () => never[];
34
35
  };
35
36
  annotation: {
36
- type: PropType<AnyObject>;
37
+ type: PropType<Record<string, AnnotationItem>>;
37
38
  };
38
39
  }>> & {
39
40
  onFormChange?: ((...args: any[]) => any) | undefined;
@@ -4654,7 +4655,7 @@ declare const _default: import("vue").DefineComponent<{
4654
4655
  default: () => never[];
4655
4656
  };
4656
4657
  annotation: {
4657
- type: PropType<AnyObject>;
4658
+ type: PropType<Record<string, AnnotationItem>>;
4658
4659
  };
4659
4660
  }>> & {
4660
4661
  onFormChange?: ((...args: any[]) => any) | undefined;