cnhis-design-vue 3.1.47-beta.2 → 3.1.47-beta.21

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 (165) hide show
  1. package/README.md +87 -87
  2. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  3. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +1 -0
  4. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +1 -0
  5. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +1 -0
  6. package/es/components/button-print/src/ButtonPrint.vue2.js +1 -1
  7. package/es/components/button-print/src/utils/print.d.ts +10 -8
  8. package/es/components/button-print/src/utils/print.js +1 -1
  9. package/es/components/fabric-chart/index.d.ts +3 -20
  10. package/es/components/fabric-chart/src/FabricChart.vue.d.ts +3 -20
  11. package/es/components/fabric-chart/src/FabricChart.vue2.js +1 -1
  12. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.d.ts +2 -1
  13. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
  14. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.d.ts +2 -18
  15. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.js +1 -1
  16. package/es/components/fabric-chart/src/hooks/index.js +1 -1
  17. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/index.d.ts +2 -0
  18. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/index.js +1 -1
  19. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.d.ts +2 -1
  20. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -1
  21. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useLeft.d.ts +4 -0
  22. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useLeft.js +1 -0
  23. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.d.ts +4 -0
  24. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.js +1 -0
  25. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.d.ts +2 -18
  26. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +1 -1
  27. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.d.ts +2 -1
  28. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.js +1 -1
  29. package/es/components/fabric-chart/src/hooks/temperature/useCenter.d.ts +2 -4
  30. package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
  31. package/es/components/fabric-chart/src/hooks/temperature/useLeft.d.ts +2 -3
  32. package/es/components/fabric-chart/src/hooks/temperature/useLeft.js +1 -1
  33. package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.d.ts +2 -18
  34. package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
  35. package/es/components/fabric-chart/src/hooks/useCommon.d.ts +4 -1
  36. package/es/components/fabric-chart/src/hooks/useCommon.js +1 -1
  37. package/es/components/fabric-chart/src/hooks/useCumputedPoint.js +1 -1
  38. package/es/components/fabric-chart/src/hooks/useDraw.d.ts +12 -0
  39. package/es/components/fabric-chart/src/hooks/useDraw.js +1 -1
  40. package/es/components/fabric-chart/src/interface.d.ts +13 -1
  41. package/es/components/fabric-chart/src/utils/index.d.ts +7 -0
  42. package/es/components/fabric-chart/src/utils/index.js +1 -1
  43. package/es/components/form-config/index.d.ts +9 -9
  44. package/es/components/form-config/src/FormConfig.vue.d.ts +9 -9
  45. package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +1 -1
  46. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +4 -4
  47. package/es/components/form-render/index.d.ts +1 -1
  48. package/es/components/form-render/src/FormRender.vue.d.ts +2 -1
  49. package/es/components/form-render/src/FormRender.vue2.js +1 -1
  50. package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +1 -1
  51. package/es/components/form-render/src/components/renderer/levelSearchCascader.d.ts +2 -2
  52. package/es/components/form-render/src/components/renderer/levelSearchCascader.js +1 -1
  53. package/es/components/form-render/src/components/renderer/radio&checkbox.d.ts +4 -4
  54. package/es/components/form-render/src/components/renderer/select.d.ts +2 -2
  55. package/es/components/form-render/src/hooks/useFormEvent.d.ts +1 -1
  56. package/es/components/form-render/src/hooks/useFormEvent.js +1 -1
  57. package/es/components/form-render/src/hooks/useFormItemDeps.d.ts +1 -0
  58. package/es/components/form-render/src/hooks/useFormItemDeps.js +1 -1
  59. package/es/components/form-render/src/hooks/useFormRenderOptions.js +1 -1
  60. package/es/components/form-render/src/types/fieldItem.d.ts +1 -1
  61. package/es/components/form-render/src/types/index.d.ts +59 -2
  62. package/es/components/form-render/src/utils/index.js +1 -1
  63. package/es/components/iho-table/src/constants/index.d.ts +1 -0
  64. package/es/components/iho-table/src/constants/index.js +1 -1
  65. package/es/components/iho-table/src/hooks/useColumnConfigAdaptor.js +1 -1
  66. package/es/components/iho-table/src/plugins/index.js +1 -1
  67. package/es/components/iho-table/src/plugins/rendererPlugins/widgets/htmlRendererPlugin.d.ts +1 -0
  68. package/es/components/iho-table/src/plugins/rendererPlugins/widgets/htmlRendererPlugin.js +1 -0
  69. package/es/components/iho-table/src/utils/index.js +1 -1
  70. package/es/components/iho-table/style/index.css +1 -1
  71. package/es/components/index.css +1 -1
  72. package/es/components/index.d.ts +2 -1
  73. package/es/components/index.js +1 -1
  74. package/es/components/info-header/index.d.ts +2 -2
  75. package/es/components/info-header/src/InfoHeader.vue.d.ts +2 -2
  76. package/es/components/info-header/src/InfoHeader.vue2.js +1 -1
  77. package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +1 -1
  78. package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +1 -1
  79. package/es/components/info-header/style/index.css +1 -1
  80. package/es/components/insurance-sdk/index.d.ts +2 -1
  81. package/es/components/insurance-sdk/index.js +1 -1
  82. package/es/components/insurance-sdk/src/constants/index.d.ts +158 -154
  83. package/es/components/insurance-sdk/src/constants/index.js +1 -1
  84. package/es/components/insurance-sdk/src/insurance.d.ts +29 -0
  85. package/es/components/insurance-sdk/src/insurance.js +1 -0
  86. package/es/components/insurance-sdk/src/types/index.d.ts +27 -0
  87. package/es/components/insurance-sdk/src/types/index.js +1 -0
  88. package/es/components/insurance-sdk/src/utils/index.d.ts +9 -1
  89. package/es/components/insurance-sdk/src/utils/index.js +1 -1
  90. package/es/components/multi-chat/index.d.ts +1023 -0
  91. package/es/components/multi-chat/index.js +1 -0
  92. package/es/components/multi-chat/src/MultiChat.vue.d.ts +1005 -0
  93. package/es/components/multi-chat/src/MultiChat.vue.js +1 -0
  94. package/es/components/multi-chat/src/MultiChat.vue2.js +1 -0
  95. package/es/components/multi-chat/src/api/index.d.ts +8 -0
  96. package/es/components/multi-chat/src/api/index.js +1 -0
  97. package/es/components/multi-chat/src/components/ChatFooter.vue.d.ts +17 -0
  98. package/es/components/multi-chat/src/components/ChatFooter.vue.js +1 -0
  99. package/es/components/multi-chat/src/components/ChatFooter.vue2.js +1 -0
  100. package/es/components/multi-chat/src/components/ChatHeader.vue.d.ts +7 -0
  101. package/es/components/multi-chat/src/components/ChatHeader.vue.js +1 -0
  102. package/es/components/multi-chat/src/components/ChatHeader.vue2.js +1 -0
  103. package/es/components/multi-chat/src/components/ChatMain.vue.d.ts +13 -0
  104. package/es/components/multi-chat/src/components/ChatMain.vue.js +1 -0
  105. package/es/components/multi-chat/src/components/ChatMain.vue2.js +1 -0
  106. package/es/components/multi-chat/src/components/SiderList.vue.d.ts +41 -0
  107. package/es/components/multi-chat/src/components/SiderList.vue.js +1 -0
  108. package/es/components/multi-chat/src/components/SiderList.vue2.js +1 -0
  109. package/es/components/multi-chat/src/utils/chatSock.d.ts +28 -0
  110. package/es/components/multi-chat/src/utils/chatSock.js +1 -0
  111. package/es/components/multi-chat/style/index.css +1 -0
  112. package/es/components/scale-view/index.d.ts +29 -0
  113. package/es/components/scale-view/src/ScaleView.vue.d.ts +29 -0
  114. package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
  115. package/es/components/scale-view/src/components/AnswerParse.vue2.js +1 -1
  116. package/es/components/scale-view/src/components/formitem/r-datetime.js +1 -1
  117. package/es/components/scale-view/src/components/formitem/r-radio.js +1 -1
  118. package/es/components/scale-view/style/index.css +1 -1
  119. package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
  120. package/es/components/select-person/index.d.ts +4 -0
  121. package/es/components/select-person/src/SearchMultiple.vue.d.ts +0 -6
  122. package/es/components/select-person/src/SelectPerson.vue.d.ts +1 -0
  123. package/es/components/select-person/src/SelectPerson.vue2.js +1 -1
  124. package/es/components/select-person/src/utils/index.d.ts +1 -1
  125. package/es/components/select-person/src/utils/index.js +1 -1
  126. package/es/components/shortcut-provider/src/hooks/useShortcuts.js +1 -1
  127. package/es/components/shortcut-provider/src/types/index.d.ts +2 -1
  128. package/es/components/shortcut-setter/index.d.ts +2 -2
  129. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +2 -2
  130. package/es/components/shortcut-setter/src/ShortcutSetter.vue2.js +1 -1
  131. package/es/components/shortcut-setter/src/ShortcutSetterItem.vue.d.ts +12 -0
  132. package/es/components/shortcut-setter/src/ShortcutSetterItem.vue2.js +1 -1
  133. package/es/components/steps-wheel/index.d.ts +27 -0
  134. package/es/components/steps-wheel/src/StepsWheel.vue.d.ts +27 -0
  135. package/es/components/steps-wheel/src/StepsWheel.vue2.js +1 -1
  136. package/es/components/steps-wheel/src/constants/index.js +1 -1
  137. package/es/components/steps-wheel/style/index.css +1 -1
  138. package/es/components/table-export-field/src/components/ExportModal.vue.d.ts +3 -0
  139. package/es/components/table-filter/src/components/render-widget/components/DateInner.vue2.js +1 -1
  140. package/es/components/table-filter/src/components/render-widget/components/DateRangeInner.vue2.js +1 -1
  141. package/es/components/table-filter/src/components/render-widget/components/SelectDynamic.vue.d.ts +5 -2
  142. package/es/components/table-filter/src/components/render-widget/components/SelectDynamic.vue2.js +1 -1
  143. package/es/components/table-filter/src/components/render-widget/components/index.d.ts +5 -2
  144. package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +5 -2
  145. package/es/components/table-filter/src/hooks/useAdvanced.js +1 -1
  146. package/es/env.d.ts +25 -25
  147. package/es/shared/assets/img/failure.png.js +1 -1
  148. package/es/shared/assets/img/no-permission.png.js +1 -1
  149. package/es/shared/assets/img/nodata.png.js +1 -1
  150. package/es/shared/assets/img/notfound.png.js +1 -1
  151. package/es/shared/assets/img/qr.png.js +1 -1
  152. package/es/shared/assets/img/success.png.js +1 -1
  153. package/es/shared/assets/img/video.png.js +1 -1
  154. package/es/shared/assets/img/video_default_cover.png.js +1 -1
  155. package/es/shared/assets/img/xb_big.png.js +1 -1
  156. package/es/shared/assets/img/xb_small.png.js +1 -1
  157. package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +86 -0
  158. package/es/shared/package.json.js +1 -1
  159. package/es/shared/utils/fabricjs/index.d.ts +6823 -0
  160. package/es/shared/utils/tapable/index.d.ts +139 -0
  161. package/es/shared/utils/tapableLess.d.ts +28 -0
  162. package/es/shared/utils/tapableLess.js +1 -0
  163. package/package.json +4 -2
  164. package/es/components/insurance-sdk/src/utils/insurance.d.ts +0 -260
  165. package/es/components/insurance-sdk/src/utils/insurance.js +0 -1
@@ -27,6 +27,7 @@ declare const SelectPerson: SFCWithInstall<import("vue").DefineComponent<{
27
27
  parent_id_obj: string | number;
28
28
  parent_name_obj: string | number;
29
29
  user_count_obj?: string | number | undefined;
30
+ filter_key?: string | undefined;
30
31
  }>;
31
32
  default: () => {};
32
33
  };
@@ -107,6 +108,7 @@ declare const SelectPerson: SFCWithInstall<import("vue").DefineComponent<{
107
108
  parent_id_obj: string | number;
108
109
  parent_name_obj: string | number;
109
110
  user_count_obj?: string | number | undefined;
111
+ filter_key?: string | undefined;
110
112
  }>;
111
113
  default: () => {};
112
114
  };
@@ -602,6 +604,7 @@ declare const SelectPerson: SFCWithInstall<import("vue").DefineComponent<{
602
604
  parent_id_obj: string | number;
603
605
  parent_name_obj: string | number;
604
606
  user_count_obj?: string | number | undefined;
607
+ filter_key?: string | undefined;
605
608
  }>;
606
609
  default: () => {};
607
610
  };
@@ -665,6 +668,7 @@ declare const SelectPerson: SFCWithInstall<import("vue").DefineComponent<{
665
668
  parent_id_obj: string | number;
666
669
  parent_name_obj: string | number;
667
670
  user_count_obj?: string | number | undefined;
671
+ filter_key?: string | undefined;
668
672
  };
669
673
  wordbookChild: {
670
674
  user_id_obj: string | number;
@@ -95,12 +95,6 @@ declare const _default: import("vue").DefineComponent<{
95
95
  };
96
96
  readonly 'onUpdate:value': PropType<import("naive-ui/es/_utils").MaybeArray<(value: (string | number)[], meta: {
97
97
  actionType: "check" | "uncheck";
98
- /**
99
- * 取消勾选树节点
100
- * baseKeys:基准值
101
- * currentTree:当前树节点
102
- * value:树节点的key值
103
- */
104
98
  value: string | number;
105
99
  }) => void>>;
106
100
  readonly onUpdateValue: PropType<import("naive-ui/es/_utils").MaybeArray<(value: (string | number)[], meta: {
@@ -7,6 +7,7 @@ declare type IWordBook<T> = {
7
7
  parent_id_obj: keyof T;
8
8
  parent_name_obj: keyof T;
9
9
  user_count_obj?: keyof T;
10
+ filter_key?: string;
10
11
  };
11
12
  declare type IWordBookChild<T> = {
12
13
  user_id_obj: keyof T;
@@ -1 +1 @@
1
- import{defineComponent as e,ref as l,computed as t,watch as n,openBlock as a,createBlock as u,unref as i,withCtx as r,createVNode as c,createCommentVNode as o,withKeys as s,createTextVNode as d,toDisplayString as h,withDirectives as v,vShow as p,createElementBlock as f,Fragment as y,mergeProps as k,createElementVNode as m,renderList as g}from"vue";import{NGrid as _,NGi as b,NSpace as C,NInputGroup as x,NInput as w,NIcon as L,NButton as S,NCheckbox as j,NTree as T}from"naive-ui";import{CloseCircleSharp as N}from"@vicons/ionicons5";import{searchFilterTree as I,getExpandedKeys as F}from"./utils/index.js";import{cloneDeep as O}from"lodash-es";import{SearchTypeConfig as $}from"./types/enums.js";import D from"./SearchMultiple.vue.js";import E from"./SearchOrgAndStaff.vue.js";const K={key:0},q={class:"c-select-person__scroll",style:{height:"342px"}};var A=e({__name:"SelectPerson",props:{defaultList:{type:Array,default:()=>[]},data:{type:Array,default:()=>[]},searchPlaceholder:{type:String,default:"输入关键字搜索"},searchButtonText:{type:String,default:"搜索"},wordbook:{type:Object,default:()=>({})},wordbookChild:{type:Object,default:()=>({})},showCount:{type:Boolean,default:!0},showClear:{type:Boolean,default:!0},multiple:{type:Boolean,default:!0},searchInner:{type:Boolean,default:!1},searchFilter:{type:Object,default:()=>({})},treeSetting:{type:Object,default:()=>({})},queryLoadChildData:{type:Function,default:void 0},queryTreeSearch:{type:Function,default:()=>Promise.resolve([])}},emits:["check","checkWithLevel"],setup(e,{expose:A,emit:B}){const P=e,R={isOpen:!1,multiple:!1,customTitles:["联系人","部门"],itemHeight:250},U=l(""),H=l(!1),W=l([]),G=l([]),z=l([]),M=l([]),J=l([]),Q=l(!1),V=O(function e(l){return l.forEach((l=>{var t;if(null==(t=l.children)?void 0:t.length){const t=se(l.children,[]);l.innerItemsNum=t.length,l.innerLeafs=t,e(l.children)}})),de(l,"")}(P.data));let X=[];const Y=t((()=>!!P.queryLoadChildData)),Z=t((()=>{var e,l;return null!=(l=null==(e=null==P?void 0:P.treeSetting)?void 0:e.checkStrategy)?l:"child"})),ee=t((()=>(null==P?void 0:P.searchFilter)&&Object.keys(null==P?void 0:P.searchFilter).length>0)),le=t((()=>ee.value?{...O(R),...P.searchFilter}:O(R))),te=t((()=>{var e,l;return null!=(l=null==(e=null==P?void 0:P.wordbookChild)?void 0:e.user_expand_keys)?l:[]})),ne=t((()=>{let e=[];return W.value.forEach((l=>{for(let t=0;t<M.value.length;t++){const n=M.value[t];if(n.key==l){e.push(n);break}}})),e}));function ae(e){e.disabled||e.children||!e.key||X.push(e.key)}function ue(e){e.disabled||e.tempTitle||!e.key||X.push(e.key)}async function ie(e){if(P.queryLoadChildData){const l=await P.queryLoadChildData(e);return l.children&&(l.children=l.children.map((e=>({...e,tempTitle:l.tempTitle?`${l.title}/${l.tempTitle}`:l.title})))),l}return e}function re(e){var l;(null==(l=e.children)?void 0:l.every((e=>e.disabled)))&&(e.disabled=!0)}function ce({option:e}){var l,t;if((null==(l=e.children)?void 0:l.length)||Y.value&&!(null==e?void 0:e.isLeaf)){const l=P.wordbook.user_count_obj&&e[P.wordbook.user_count_obj]||"",t=l?`(${l})`:"";return c("span",null,[`${e.title}${t}`])}{const l=null!=(t=e.title_expand_strs)?t:"";return c("p",{class:"user_item"},[e.title,c("span",{class:"user_item_expand",title:l},[l])])}}function oe(e){return e[P.wordbookChild.user_name_obj]||e[P.wordbook.parent_name_obj]||e.orgName||e.title||""}function se(e,l){return e.forEach((e=>{var t;(null==(t=e.children)?void 0:t.length)?se(e.children,l):!e.disabled&&l.push(e)})),l}function de(e,l){return e&&0!==e.length?e.map((e=>{var t;const n=oe(e),a=l?`${n}/${l}`:n;return{...e,tempTitle:l,children:(null==(t=e.children)?void 0:t.length)?de(null==e?void 0:e.children,a):[]}})):[]}async function he(){if(Q.value=!!U.value.trim(),Y.value)z.value=await P.queryTreeSearch(U.value);else{const e=function(){const e={[$.SEARCH_ORG_STAFF]:ee.value,[$.SEARCH_ORG]:P.searchInner},l=Object.keys(e).find((l=>e[l]));return null!=l?l:""}();z.value=I(e,V,U.value)}G.value=z.value.length&&U.value?F(z.value):[]}function ve(e,l){var t,n;switch(null!=(n=null==(t=null==P?void 0:P.treeSetting)?void 0:t.checkStrategy)?n:"child"){case"child":!function(e,l){for(let t=0,n=e.length;t<n;t++){const n=e[t];if(!n.disabled&&(!n.children||n.isLeaf)&&(l&&!W.value.includes(n.key)&&W.value.push(n.key),!l)){const e=W.value.findIndex((e=>e===n.key));W.value.splice(e,1)}n.children&&ve(n.children,l)}}(e,l);break;case"parent":!function(e,l){W.value=[];for(let t=0,n=e.length;t<n;t++){const n=e[t];if(!n.disabled&&!n.tempTitle&&(l&&!W.value.includes(n.key)&&W.value.push(n.key),!l)){const e=W.value.findIndex((e=>e===n.key));W.value.splice(e,1)}}}(e,l)}}function pe(e){ve(z.value,e)}function fe(e){var l;for(let t=0,n=e.length;t<n;t++){const n=e[t],a=J.value.map((e=>e.key));W.value.includes(n.key)&&!a.includes(n.key)&&M.value.push({key:n.key,name:n.title,parentName:n.tempTitle,innerItemsNum:n.innerItemsNum,innerLeafs:n.innerLeafs}),(null==(l=n.children)?void 0:l.length)&&fe(n.children)}}function ye(e){W.value=e}function ke(){W.value=[]}function me(e){W.value=e}function ge(){U.value="",setTimeout((()=>{he()}))}return function e(l,t){var n,a,u,i;for(let r=0,c=l.length;r<c;r++){const c=l[r];let o=te.value.reduce(((e,l)=>e+(c[l]?`${c[l]},`:"")),"");switch(c.title_expand_strs=o.slice(0,-1),c.title=oe(c),c.label=oe(c),c.parentNode=t,c.key||(c.key=c[P.wordbookChild.user_id_obj]||c[P.wordbook.parent_id_obj]||Date.now()),(null==(n=c.children)?void 0:n.length)?(e(c.children,c),re(c)):0===(null==(a=c.children)?void 0:a.length)&&Reflect.deleteProperty(c,"children"),null!=(i=null==(u=null==P?void 0:P.treeSetting)?void 0:u.checkStrategy)?i:"child"){case"child":ae(c);break;case"parent":ue(c)}}}(V,null),z.value=V,P.defaultList.length>0&&(Y.value?(P.defaultList.forEach((e=>W.value.push(e.key))),M.value=O(P.defaultList),J.value=O(P.defaultList)):(P.defaultList.forEach((e=>W.value.push(e))),fe(V))),n((()=>W),(e=>{M.value=J.value.filter((l=>e.value.includes(l.key))),e.value.length&&fe(Y.value?z.value:V),H.value=X.every((e=>M.value.findIndex((l=>l.key===e))>-1));const l=M.value.filter((l=>e.value.includes(l.key)));B("check",e.value),B("checkWithLevel",l)}),{deep:!0}),n((()=>U.value),(e=>{e||ge()})),A({getCheckWithLevel:function(){const e=W.value,l=M.value.filter((l=>e.includes(l.key)));return null!=l?l:[]}}),(l,t)=>(a(),u(i(_),{cols:2,class:"c-select-person"},{default:r((()=>[c(i(b),null,{default:r((()=>[c(i(C),{vertical:"",style:{"padding-right":"12px","border-right":"1px solid #e8e8e8"}},{default:r((()=>[c(i(x),{style:{"margin-bottom":"12px"}},{default:r((()=>[o(" clearable "),c(i(w),{class:"search-input",value:U.value,"onUpdate:value":t[0]||(t[0]=e=>U.value=e),placeholder:e.searchPlaceholder,onKeyup:s(he,["enter"])},{suffix:r((()=>[U.value?(a(),u(i(L),{key:0,class:"search-clear",component:i(N),size:"16",onClick:ge},null,8,["component"])):o("v-if",!0)])),_:1},8,["value","placeholder","onKeyup"]),c(i(S),{type:"primary",onClick:he},{default:r((()=>[d(h(e.searchButtonText),1)])),_:1})])),_:1}),e.multiple&&!Q.value?v((a(),u(i(j),{key:0,checked:H.value,"onUpdate:checked":[t[1]||(t[1]=e=>H.value=e),pe]},{default:r((()=>[d(" 全选 ")])),_:1},8,["checked"])),[[p,i(X).length<1e3]]):o("v-if",!0),o(" 支持选人 "),e.searchInner&&e.multiple&&Q.value&&"parent"===i(Z)?(a(),u(D,{key:1,treeData:z.value,checkedKeys:W.value,onNotifyCheck:me},null,8,["treeData","checkedKeys"])):i(ee)&&e.multiple&&Q.value&&"parent"===i(Z)?(a(),f(y,{key:2},[o(" 同时兼容选人和选部门 "),c(E,{treeData:z.value,checkedKeys:W.value,searchFilter:i(le),onNotifyCheck:me,onNotifyClear:ge},null,8,["treeData","checkedKeys","searchFilter"])],2112)):(a(),u(i(T),k({key:3,"virtual-scroll":"",class:"c-select-person__scroll","checked-keys":W.value,"expanded-keys":G.value,"onUpdate:expanded-keys":t[2]||(t[2]=e=>G.value=e),checkable:e.multiple,cascade:"","allow-checking-not-loaded":"",selectable:!e.multiple,"selected-keys":W.value,"onUpdate:selected-keys":t[3]||(t[3]=e=>W.value=e),data:z.value,"check-strategy":"child","render-label":ce},e.treeSetting,{"onUpdate:checkedKeys":ye,onLoad:ie}),null,16,["checked-keys","expanded-keys","checkable","selectable","selected-keys","data"]))])),_:1})])),_:1}),c(i(b),null,{default:r((()=>[c(i(C),{vertical:"",style:{"padding-left":"12px"}},{default:r((()=>[c(i(C),{justify:"space-between",style:{"margin-bottom":"20px"}},{default:r((()=>[e.showCount?(a(),f("span",K,"已选择:"+h(i(ne).length),1)):o("v-if",!0),e.showClear?(a(),f("span",{key:1,class:"c-select-person__clear-btn",onClick:ke},"清空")):o("v-if",!0)])),_:1}),m("div",q,[(a(!0),f(y,null,g(i(ne),(e=>(a(),f("span",{class:"c-select-person__tag-item",key:e.key},[d(h(e.name)+" "+h(e.parentName?`(${e.parentName})`:"")+" "+h(e.innerItemsNum?`(${e.innerItemsNum}人)`:"")+" ",1),c(i(L),{class:"tag-close",component:i(N),onClick:l=>function(e){W.value=W.value.filter((l=>l!==e.key))}(e)},null,8,["component","onClick"])])))),128))])])),_:1})])),_:1})])),_:1}))}});export{A as default};
1
+ import{defineComponent as e,ref as l,computed as t,watch as n,openBlock as a,createBlock as u,unref as i,withCtx as r,createVNode as c,createCommentVNode as o,withKeys as s,createTextVNode as d,toDisplayString as h,withDirectives as v,vShow as p,createElementBlock as f,Fragment as y,mergeProps as k,createElementVNode as m,renderList as g}from"vue";import{NGrid as _,NGi as b,NSpace as C,NInputGroup as w,NInput as x,NIcon as L,NButton as S,NCheckbox as j,NTree as T}from"naive-ui";import{CloseCircleSharp as N}from"@vicons/ionicons5";import{searchFilterTree as I,getExpandedKeys as F}from"./utils/index.js";import{cloneDeep as O}from"lodash-es";import{SearchTypeConfig as $}from"./types/enums.js";import D from"./SearchMultiple.vue.js";import E from"./SearchOrgAndStaff.vue.js";const K={key:0},q={class:"c-select-person__scroll",style:{height:"342px"}};var A=e({__name:"SelectPerson",props:{defaultList:{type:Array,default:()=>[]},data:{type:Array,default:()=>[]},searchPlaceholder:{type:String,default:"输入关键字搜索"},searchButtonText:{type:String,default:"搜索"},wordbook:{type:Object,default:()=>({})},wordbookChild:{type:Object,default:()=>({})},showCount:{type:Boolean,default:!0},showClear:{type:Boolean,default:!0},multiple:{type:Boolean,default:!0},searchInner:{type:Boolean,default:!1},searchFilter:{type:Object,default:()=>({})},treeSetting:{type:Object,default:()=>({})},queryLoadChildData:{type:Function,default:void 0},queryTreeSearch:{type:Function,default:()=>Promise.resolve([])}},emits:["check","checkWithLevel"],setup(e,{expose:A,emit:B}){const P=e,R={isOpen:!1,multiple:!1,customTitles:["联系人","部门"],itemHeight:250},U=l(""),H=l(!1),W=l([]),G=l([]),z=l([]),M=l([]),J=l([]),Q=l(!1),V=O(function e(l){return l.forEach((l=>{var t;if(null==(t=l.children)?void 0:t.length){const t=se(l.children,[]);l.innerItemsNum=t.length,l.innerLeafs=t,e(l.children)}})),de(l,"")}(P.data));let X=[];const Y=t((()=>!!P.queryLoadChildData)),Z=t((()=>{var e,l;return null!=(l=null==(e=null==P?void 0:P.treeSetting)?void 0:e.checkStrategy)?l:"child"})),ee=t((()=>(null==P?void 0:P.searchFilter)&&Object.keys(null==P?void 0:P.searchFilter).length>0)),le=t((()=>ee.value?{...O(R),...P.searchFilter}:O(R))),te=t((()=>{var e,l;return null!=(l=null==(e=null==P?void 0:P.wordbookChild)?void 0:e.user_expand_keys)?l:[]})),ne=t((()=>{let e=[];return W.value.forEach((l=>{for(let t=0;t<M.value.length;t++){const n=M.value[t];if(n.key==l){e.push(n);break}}})),e}));function ae(e){e.disabled||e.children||!e.key||X.push(e.key)}function ue(e){e.disabled||e.tempTitle||!e.key||X.push(e.key)}async function ie(e){if(P.queryLoadChildData){const l=await P.queryLoadChildData(e);return l.children&&(l.children=l.children.map((e=>({...e,tempTitle:l.tempTitle?`${l.title}/${l.tempTitle}`:l.title})))),l}return e}function re(e){var l;(null==(l=e.children)?void 0:l.every((e=>e.disabled)))&&(e.disabled=!0)}function ce({option:e}){var l,t;if((null==(l=e.children)?void 0:l.length)||Y.value&&!(null==e?void 0:e.isLeaf)){const l=P.wordbook.user_count_obj&&e[P.wordbook.user_count_obj]||"",t=l?`(${l})`:"";return c("span",null,[`${e.title}${t}`])}{const l=null!=(t=e.title_expand_strs)?t:"";return c("p",{class:"user_item"},[e.title,c("span",{class:"user_item_expand",title:l},[l])])}}function oe(e){return e[P.wordbookChild.user_name_obj]||e[P.wordbook.parent_name_obj]||e.orgName||e.title||""}function se(e,l){return e.forEach((e=>{var t;(null==(t=e.children)?void 0:t.length)?se(e.children,l):!e.disabled&&l.push(e)})),l}function de(e,l){return e&&0!==e.length?e.map((e=>{var t;const n=oe(e),a=l?`${n}/${l}`:n;return{...e,tempTitle:l,children:(null==(t=e.children)?void 0:t.length)?de(null==e?void 0:e.children,a):[]}})):[]}async function he(){var e,l;const t=null!=(l=null==(e=null==P?void 0:P.wordbook)?void 0:e.filter_key)?l:"keyword";if(Q.value=!!U.value.trim(),Y.value)z.value=await P.queryTreeSearch(U.value);else{const e=function(){const e={[$.SEARCH_ORG_STAFF]:ee.value,[$.SEARCH_ORG]:P.searchInner},l=Object.keys(e).find((l=>e[l]));return null!=l?l:""}();z.value=I(e,V,U.value,t)}G.value=z.value.length&&U.value?F(z.value):[]}function ve(e,l){var t,n;switch(null!=(n=null==(t=null==P?void 0:P.treeSetting)?void 0:t.checkStrategy)?n:"child"){case"child":!function(e,l){for(let t=0,n=e.length;t<n;t++){const n=e[t];if(!n.disabled&&(!n.children||n.isLeaf)&&(l&&!W.value.includes(n.key)&&W.value.push(n.key),!l)){const e=W.value.findIndex((e=>e===n.key));W.value.splice(e,1)}n.children&&ve(n.children,l)}}(e,l);break;case"parent":!function(e,l){W.value=[];for(let t=0,n=e.length;t<n;t++){const n=e[t];if(!n.disabled&&!n.tempTitle&&(l&&!W.value.includes(n.key)&&W.value.push(n.key),!l)){const e=W.value.findIndex((e=>e===n.key));W.value.splice(e,1)}}}(e,l)}}function pe(e){ve(z.value,e)}function fe(e){var l;for(let t=0,n=e.length;t<n;t++){const n=e[t],a=J.value.map((e=>e.key));W.value.includes(n.key)&&!a.includes(n.key)&&M.value.push({key:n.key,name:n.title,parentName:n.tempTitle,innerItemsNum:n.innerItemsNum,innerLeafs:n.innerLeafs}),(null==(l=n.children)?void 0:l.length)&&fe(n.children)}}function ye(e){W.value=e}function ke(){W.value=[]}function me(e){W.value=e}function ge(){U.value="",setTimeout((()=>{he()}))}return function e(l,t){var n,a,u,i;for(let r=0,c=l.length;r<c;r++){const c=l[r];let o=te.value.reduce(((e,l)=>e+(c[l]?`${c[l]},`:"")),"");switch(c.title_expand_strs=o.slice(0,-1),c.title=oe(c),c.label=oe(c),c.parentNode=t,c.key||(c.key=c[P.wordbookChild.user_id_obj]||c[P.wordbook.parent_id_obj]||Date.now()),(null==(n=c.children)?void 0:n.length)?(e(c.children,c),re(c)):0===(null==(a=c.children)?void 0:a.length)&&Reflect.deleteProperty(c,"children"),null!=(i=null==(u=null==P?void 0:P.treeSetting)?void 0:u.checkStrategy)?i:"child"){case"child":ae(c);break;case"parent":ue(c)}}}(V,null),z.value=V,P.defaultList.length>0&&(Y.value?(P.defaultList.forEach((e=>W.value.push(e.key))),M.value=O(P.defaultList),J.value=O(P.defaultList)):(P.defaultList.forEach((e=>W.value.push(e))),fe(V))),n((()=>W),(e=>{M.value=J.value.filter((l=>e.value.includes(l.key))),e.value.length&&fe(Y.value?z.value:V),H.value=X.every((e=>M.value.findIndex((l=>l.key===e))>-1));const l=M.value.filter((l=>e.value.includes(l.key)));B("check",e.value),B("checkWithLevel",l)}),{deep:!0}),n((()=>U.value),(e=>{e||ge()})),A({getCheckWithLevel:function(){const e=W.value,l=M.value.filter((l=>e.includes(l.key)));return null!=l?l:[]}}),(l,t)=>(a(),u(i(_),{cols:2,class:"c-select-person"},{default:r((()=>[c(i(b),null,{default:r((()=>[c(i(C),{vertical:"",style:{"padding-right":"12px","border-right":"1px solid #e8e8e8"}},{default:r((()=>[c(i(w),{style:{"margin-bottom":"12px"}},{default:r((()=>[o(" clearable "),c(i(x),{class:"search-input",value:U.value,"onUpdate:value":t[0]||(t[0]=e=>U.value=e),placeholder:e.searchPlaceholder,onKeyup:s(he,["enter"])},{suffix:r((()=>[U.value?(a(),u(i(L),{key:0,class:"search-clear",component:i(N),size:"16",onClick:ge},null,8,["component"])):o("v-if",!0)])),_:1},8,["value","placeholder","onKeyup"]),c(i(S),{type:"primary",onClick:he},{default:r((()=>[d(h(e.searchButtonText),1)])),_:1})])),_:1}),e.multiple&&!Q.value?v((a(),u(i(j),{key:0,checked:H.value,"onUpdate:checked":[t[1]||(t[1]=e=>H.value=e),pe]},{default:r((()=>[d(" 全选 ")])),_:1},8,["checked"])),[[p,i(X).length<1e3]]):o("v-if",!0),o(" 支持选人 "),e.searchInner&&e.multiple&&Q.value&&"parent"===i(Z)?(a(),u(D,{key:1,treeData:z.value,checkedKeys:W.value,onNotifyCheck:me},null,8,["treeData","checkedKeys"])):i(ee)&&e.multiple&&Q.value&&"parent"===i(Z)?(a(),f(y,{key:2},[o(" 同时兼容选人和选部门 "),c(E,{treeData:z.value,checkedKeys:W.value,searchFilter:i(le),onNotifyCheck:me,onNotifyClear:ge},null,8,["treeData","checkedKeys","searchFilter"])],2112)):(a(),u(i(T),k({key:3,"virtual-scroll":"",class:"c-select-person__scroll","checked-keys":W.value,"expanded-keys":G.value,"onUpdate:expanded-keys":t[2]||(t[2]=e=>G.value=e),checkable:e.multiple,cascade:"","allow-checking-not-loaded":"",selectable:!e.multiple,"selected-keys":W.value,"onUpdate:selected-keys":t[3]||(t[3]=e=>W.value=e),data:z.value,"check-strategy":"child","render-label":ce},e.treeSetting,{"onUpdate:checkedKeys":ye,onLoad:ie}),null,16,["checked-keys","expanded-keys","checkable","selectable","selected-keys","data"]))])),_:1})])),_:1}),c(i(b),null,{default:r((()=>[c(i(C),{vertical:"",style:{"padding-left":"12px"}},{default:r((()=>[c(i(C),{justify:"space-between",style:{"margin-bottom":"20px"}},{default:r((()=>[e.showCount?(a(),f("span",K,"已选择:"+h(i(ne).length),1)):o("v-if",!0),e.showClear?(a(),f("span",{key:1,class:"c-select-person__clear-btn",onClick:ke},"清空")):o("v-if",!0)])),_:1}),m("div",q,[(a(!0),f(y,null,g(i(ne),(e=>(a(),f("span",{class:"c-select-person__tag-item",key:e.key},[d(h(e.name)+" "+h(e.parentName?`(${e.parentName})`:"")+" "+h(e.innerItemsNum?`(${e.innerItemsNum}人)`:"")+" ",1),c(i(L),{class:"tag-close",component:i(N),onClick:l=>function(e){W.value=W.value.filter((l=>l!==e.key))}(e)},null,8,["component","onClick"])])))),128))])])),_:1})])),_:1})])),_:1}))}});export{A as default};
@@ -1,3 +1,3 @@
1
1
  import { type TreeOption } from 'naive-ui';
2
- export declare function searchFilterTree(attr: string, data: TreeOption[], keyword: string): any[];
2
+ export declare function searchFilterTree(attr: string, data: TreeOption[], keyword: string, filterKey: string): any[];
3
3
  export declare function getExpandedKeys(tree: TreeOption[]): (string | number)[];
@@ -1 +1 @@
1
- import{cloneDeep as n}from"lodash-es";import{SearchTypeConfig as i}from"../types/enums.js";function e(e,l,u){const o=n(l);if(u.trim()){let n=[];switch(e){case i.SEARCH_ORG_STAFF:n=function(n,i){return c(n,i,[])}(o,u);break;case i.SEARCH_ORG:n=function(n,i){return t(n,[]).filter((n=>{var e;return null==(e=n.title)?void 0:e.includes(i.trim())}))}(o,u);break;default:n=r(o,u)}return n}return r(o,u)}function r(n,i){return l(n,i),o(n)}function l(n,i){n.forEach((n=>{var e,r;if(n.visible=null==(e=n.title)?void 0:e.includes(i.trim()),null==(r=n.children)?void 0:r.length)if(l(n.children,i),n.visible)u(n.children);else{n.children.some((n=>n.visible))&&(n.visible=!0)}}))}function t(n,i){return n.forEach((n=>{var e;(null==(e=n.children)?void 0:e.length)?t(n.children,i):i.push(n)})),i}function c(n,i,e){return n.forEach((n=>{var r,l;(null==(r=n.title)?void 0:r.includes(i.trim()))&&!n.disabled&&e.push(n),(null==(l=n.children)?void 0:l.length)&&c(n.children,i,e)})),e}function u(n){n.forEach((n=>{var i;n.visible=!0,(null==(i=n.children)?void 0:i.length)&&u(n.children)}))}function o(n){return n.filter((n=>{var i;return!!n.visible&&((null==(i=n.children)?void 0:i.length)&&(n.children=o(n.children)),!0)}))}function d(n){const i=[];return function n(e){for(let r=0,l=e.length;r<l;r++){const l=e[r];l.children&&(i.push(l.key),n(l.children))}}(n),i}export{d as getExpandedKeys,e as searchFilterTree};
1
+ import{cloneDeep as n}from"lodash-es";import{SearchTypeConfig as i}from"../types/enums.js";function e(e,l,o,u){const s=n(l);if(o.trim()){let n=[];switch(e){case i.SEARCH_ORG_STAFF:n=function(n,i,e){return c(n,i,[],e)}(s,o,u);break;case i.SEARCH_ORG:n=function(n,i,e){return t(n,[]).filter((n=>(n[e]?n[e].split(","):[n.title]).some((n=>n.includes(i.trim())))))}(s,o,u);break;default:n=r(s,o,u)}return n}return r(s,o,u)}function r(n,i,e){return l(n,i,e),u(n)}function l(n,i,e){n.forEach((n=>{var r;const t=n[e]?n[e].split(","):[n.title];if(n.visible=t.some((n=>n.includes(i.trim()))),null==(r=n.children)?void 0:r.length)if(l(n.children,i,e),n.visible)o(n.children);else{n.children.some((n=>n.visible))&&(n.visible=!0)}}))}function t(n,i){return n.forEach((n=>{var e;(null==(e=n.children)?void 0:e.length)?t(n.children,i):i.push(n)})),i}function c(n,i,e,r){return n.forEach((n=>{var l;(n[r]?n[r].split(","):[n.title]).some((n=>n.includes(i.trim())))&&!n.disabled&&e.push(n),(null==(l=n.children)?void 0:l.length)&&c(n.children,i,e,r)})),e}function o(n){n.forEach((n=>{var i;n.visible=!0,(null==(i=n.children)?void 0:i.length)&&o(n.children)}))}function u(n){return n.filter((n=>{var i;return!!n.visible&&((null==(i=n.children)?void 0:i.length)&&(n.children=u(n.children)),!0)}))}function s(n){const i=[];return function n(e){for(let r=0,l=e.length;r<l;r++){const l=e[r];l.children&&(i.push(l.key),n(l.children))}}(n),i}export{s as getExpandedKeys,e as searchFilterTree};
@@ -1 +1 @@
1
- import{findAncestor as t}from"../../../../shared/utils/index.js";import{useEventListener as e,useDebounceFn as r}from"@vueuse/core";import{once as s,pick as a,omit as n,isFunction as u,isString as c}from"lodash-es";import{reactive as o,ref as i,unref as l,computed as h,getCurrentInstance as d,inject as p,onBeforeUnmount as g,onDeactivated as b,onActivated as v}from"vue";import{ShortcutStatus as f,InjectionShortcutManager as k}from"../constants/index.js";import{normalizeSignatureInfo as y,getKeySignature as C,getDisplaySignature as m,isInvalidSignature as S,isKeyboardEvent as w,isShortcutProvider as E,isInvalidKeyboardEvent as M}from"../utils/index.js";const K=Symbol("Glob"),j=new Map;class ${constructor(t,e=K){this.shortcutCallbackMap=o(new Map),this.shortcutCache=i({}),this.disabled=!1,this.environmentEle=t||window,j.set(e,this)}static log(t,e=!1){const r=`[ShortcutManager] ${t}`;return!e&&console.warn(r),r}get traverse(){return[...Object.values(this.shortcutCache.value)].sort(((t,e)=>(t.order||0)-(e.order||0)))}query(t){return this.shortcutCache.value[t]}async update(t,e){var r,s;const a=null==(r=this.query(t))?void 0:r.currentKeySignature;e&&u(this.shortcutCache,e);const n=this.query(t);function u(t,e){if(a!==C(e)){if(Object.values(t.value).some((t=>t.currentKeySignature===C(e))))throw`重复的快捷键=> ${m(e)}`;if(S(e))throw`非法的快捷键=>${e.key}`}}n&&(await(null==(s=n.onUpdate)?void 0:s.call(n,t,e?y(e):void 0)),u(this.shortcutCache,e),n.currentKeySignature=C(e),n.shortcutSignature=y(e),this.shortcutCallbackMap.set(n.currentKeySignature,this.shortcutCallbackMap.get(a)),this.shortcutCallbackMap.delete(a))}register(t){const e=this.query(t.key);return e?(e.status=f.ACTIVE,this.shortcutCallbackMap.set(e.currentKeySignature,t.callback),Object.assign(e,a(t,["debounce","debounceOption","label","order","key"])),r(e)):(this.shortcutCache.value[t.key]=n(t,["callback"]),this.shortcutCallbackMap.set(t.currentKeySignature,t.callback),r(this.shortcutCache.value[t.key]));function r(t){return{stop:()=>{t.status=f.INACTIVE},start:()=>{t.status=f.ACTIVE},signature:()=>t.currentKeySignature}}}start(){return this.handle?($.log(`请勿重复启动=>${this}`),this):(this.handle=async e=>{if(!w(e)||this.disabled)return;const r=t(e.target,E);if(r&&r!==l(this.environmentEle)||M(e))return;const s=C(e),a=this.shortcutCallbackMap.get(s);if(!a)return;e.preventDefault();const n=Object.values(this.shortcutCache.value).find((t=>t.currentKeySignature===s));n&&n.status===f.ACTIVE&&!n.disabled&&a()},e(this.environmentEle,"keyup",this.handle,{capture:!0}),this)}destroy(){var t;this.handle&&(null==(t=l(this.environmentEle))||t.removeEventListener("keyup",this.handle,{capture:!0})),this.handle=void 0,this.clear()}clear(){this.shortcutCallbackMap.clear(),this.shortcutCache.value={}}}const I=(new $).start(),O=s((()=>$.log("非setup语境下的shortcut将影响全局"))),A=s((()=>$.log("在非setup语境下使用register函数,组件销毁时可能需要手动调用stop函数使快捷键失活")));function T(t){const e=h((()=>{if(l(t)){const e=j.get(l(t));return e||$.log(`不存在的scope=>${t}, 将使用全局快捷键`),e||I}return d()?p(k,I):(O(),I)}));return{register:function(t){const{stop:s,signature:a,start:n}=l(e).register(function(t){return{...t,shortcutSignature:y(t.shortcutSignature),currentKeySignature:C(t.shortcutSignature),key:function(t){const e=t.key||t.label;if(!c(e))throw new Error($.log(`非法的key类型=>${e}`,!0));return e}(t),status:f.ACTIVE,callback:function(t){var e,s;if(!u(t.callback))throw new Error($.log(`非法的callback类型=>${t.callback}`,!0));return t.debounce?r(t.callback,null!=(s=null==(e=t.debounceOption)?void 0:e.duration)?s:300):t.callback}(t)}}(t));return d()?(g(s),b(s),v(n)):A(),{stop:s,signature:a}},traverse:function(){return l(e).traverse},clear:function(){l(e).clear()},update:function(t,r){return l(e).update(t,r)},updateManagerDisabled:function(t){l(e).disabled=!!t}}}export{K as GlobalShortcutProvider,$ as ShortcutManager,T as useShortcuts};
1
+ import{findAncestor as t}from"../../../../shared/utils/index.js";import{useEventListener as e,useDebounceFn as r}from"@vueuse/core";import{once as s,pick as a,omit as n,isFunction as u,isString as c}from"lodash-es";import{reactive as o,ref as i,unref as l,computed as h,getCurrentInstance as d,inject as p,onBeforeUnmount as g,onDeactivated as b,onActivated as v}from"vue";import{ShortcutStatus as f,InjectionShortcutManager as k}from"../constants/index.js";import{normalizeSignatureInfo as y,getKeySignature as C,getDisplaySignature as m,isInvalidSignature as S,isKeyboardEvent as w,isShortcutProvider as E,isInvalidKeyboardEvent as M}from"../utils/index.js";const K=Symbol("Glob"),j=new Map;class ${constructor(t,e=K){this.shortcutCallbackMap=o(new Map),this.shortcutCache=i({}),this.disabled=!1,this.environmentEle=t||window,j.set(e,this)}static log(t,e=!1){const r=`[ShortcutManager] ${t}`;return!e&&console.warn(r),r}get traverse(){return[...Object.values(this.shortcutCache.value)].sort(((t,e)=>(t.order||0)-(e.order||0)))}query(t){return this.shortcutCache.value[t]}async update(t,e){var r,s;const a=null==(r=this.query(t))?void 0:r.currentKeySignature;e&&u(this.shortcutCache,e);const n=this.query(t);function u(t,e){if(a!==C(e)){if(Object.values(t.value).some((t=>t.currentKeySignature===C(e))))throw`重复的快捷键=> ${m(e)}`;if(S(e))throw`非法的快捷键=>${e.key}`}}n&&(await(null==(s=n.onUpdate)?void 0:s.call(n,t,e?y(e):void 0)),u(this.shortcutCache,e),n.currentKeySignature=C(e),n.shortcutSignature=y(e),this.shortcutCallbackMap.set(n.currentKeySignature,this.shortcutCallbackMap.get(a)),this.shortcutCallbackMap.delete(a))}register(t){const e=this.query(t.key);return e?(e.status=f.ACTIVE,this.shortcutCallbackMap.set(e.currentKeySignature,t.callback),Object.assign(e,a(t,["debounce","debounceOption","label","order","key"])),r(e)):(this.shortcutCache.value[t.key]=n(t,["callback"]),this.shortcutCallbackMap.set(t.currentKeySignature,t.callback),r(this.shortcutCache.value[t.key]));function r(t){return{stop:()=>{t.status=f.INACTIVE},start:()=>{t.status=f.ACTIVE},signature:()=>t.currentKeySignature}}}start(){return this.handle?($.log(`请勿重复启动=>${this}`),this):(this.handle=async e=>{if(!w(e)||this.disabled)return;const r=t(e.target,E);if(r&&r!==l(this.environmentEle)||M(e))return;const s=C(e),a=this.shortcutCallbackMap.get(s);if(!a)return;e.preventDefault();const n=Object.values(this.shortcutCache.value).find((t=>t.currentKeySignature===s));n&&n.status===f.ACTIVE&&!n.disabled&&a(e)},e(this.environmentEle,"keyup",this.handle,{capture:!0}),this)}destroy(){var t;this.handle&&(null==(t=l(this.environmentEle))||t.removeEventListener("keyup",this.handle,{capture:!0})),this.handle=void 0,this.clear()}clear(){this.shortcutCallbackMap.clear(),this.shortcutCache.value={}}}const I=(new $).start(),O=s((()=>$.log("非setup语境下的shortcut将影响全局"))),A=s((()=>$.log("在非setup语境下使用register函数,组件销毁时可能需要手动调用stop函数使快捷键失活")));function T(t){const e=h((()=>{if(l(t)){const e=j.get(l(t));return e||$.log(`不存在的scope=>${t}, 将使用全局快捷键`),e||I}return d()?p(k,I):(O(),I)}));return{register:function(t){const{stop:s,signature:a,start:n}=l(e).register(function(t){return{...t,shortcutSignature:y(t.shortcutSignature),currentKeySignature:C(t.shortcutSignature),key:function(t){const e=t.key||t.label;if(!c(e))throw new Error($.log(`非法的key类型=>${e}`,!0));return e}(t),status:f.ACTIVE,callback:function(t){var e,s;if(!u(t.callback))throw new Error($.log(`非法的callback类型=>${t.callback}`,!0));return t.debounce?r(t.callback,null!=(s=null==(e=t.debounceOption)?void 0:e.duration)?s:300):t.callback}(t)}}(t));return d()?(g(s),b(s),v(n)):A(),{stop:s,signature:a}},traverse:function(){return l(e).traverse},clear:function(){l(e).clear()},update:function(t,r){return l(e).update(t,r)},updateManagerDisabled:function(t){l(e).disabled=!!t}}}export{K as GlobalShortcutProvider,$ as ShortcutManager,T as useShortcuts};
@@ -8,7 +8,7 @@ export interface ShortcutSignatureInfo {
8
8
  export declare type ShortcutOption = {
9
9
  label: string;
10
10
  shortcutSignature: ShortcutSignatureInfo;
11
- callback(): void;
11
+ callback(event: KeyboardEvent): void;
12
12
  } & Partial<{
13
13
  /**
14
14
  * @description 更新快捷键回调
@@ -24,6 +24,7 @@ export declare type ShortcutOption = {
24
24
  * 快捷键输入框编辑状态下的展位文本
25
25
  */
26
26
  editPlaceholder: string;
27
+ clearable: boolean;
27
28
  key: string;
28
29
  order: number;
29
30
  disabled: boolean;
@@ -109,7 +109,7 @@ declare const ShortcutSetter: SFCWithInstall<import("vue").DefineComponent<{
109
109
  level_key?: string | undefined;
110
110
  link_key?: string | undefined;
111
111
  link_key_split?: string | undefined;
112
- show_key?: string[] | undefined;
112
+ show_key?: string | string[] | undefined;
113
113
  conObj?: import("../../../es/shared/types").AnyObject[] | undefined;
114
114
  conObjFirstLevel?: import("../../../es/shared/types").AnyObject[] | undefined;
115
115
  setting?: {
@@ -2198,7 +2198,7 @@ declare const ShortcutSetter: SFCWithInstall<import("vue").DefineComponent<{
2198
2198
  validate(path?: string): Promise<void>;
2199
2199
  getFormValues(needCombineExtendKey?: boolean): any;
2200
2200
  setFormValues(values: import("../../../es/shared/types").AnyObject, needSplitExtendKey?: boolean, overwrite?: boolean): void;
2201
- setFieldState(path: string, handler: (field: Partial<Pick<import("@formily/core").Field<any, any, any, any>, import("@formily/core").NonFunctionPropertyNames<{
2201
+ setFieldState(path: string, setter: (field: Partial<Pick<import("@formily/core").Field<any, any, any, any>, import("@formily/core").NonFunctionPropertyNames<{
2202
2202
  match: (pattern: import("@formily/path").Pattern) => boolean;
2203
2203
  validate: (triggerType?: import("@formily/validator").ValidatorTriggerType | undefined) => any;
2204
2204
  data: any;
@@ -111,7 +111,7 @@ declare const _default: import("vue").DefineComponent<{
111
111
  level_key?: string | undefined;
112
112
  link_key?: string | undefined;
113
113
  link_key_split?: string | undefined;
114
- show_key?: string[] | undefined;
114
+ show_key?: string | string[] | undefined;
115
115
  conObj?: import("../../../../es/shared/types").AnyObject[] | undefined;
116
116
  conObjFirstLevel?: import("../../../../es/shared/types").AnyObject[] | undefined;
117
117
  setting?: {
@@ -2200,7 +2200,7 @@ declare const _default: import("vue").DefineComponent<{
2200
2200
  validate(path?: string): Promise<void>;
2201
2201
  getFormValues(needCombineExtendKey?: boolean): any;
2202
2202
  setFormValues(values: import("../../../../es/shared/types").AnyObject, needSplitExtendKey?: boolean, overwrite?: boolean): void;
2203
- setFieldState(path: string, handler: (field: Partial<Pick<import("../../../../es/components/form-render").Field<any, any, any, any>, import("../../../../es/components/form-render").NonFunctionPropertyNames<{
2203
+ setFieldState(path: string, setter: (field: Partial<Pick<import("../../../../es/components/form-render").Field<any, any, any, any>, import("../../../../es/components/form-render").NonFunctionPropertyNames<{
2204
2204
  match: (pattern: import("@formily/path").Pattern) => boolean;
2205
2205
  validate: (triggerType?: import("@formily/validator").ValidatorTriggerType | undefined) => any;
2206
2206
  data: any;
@@ -1 +1 @@
1
- import{defineComponent as e,ref as t,computed as r,watch as o,openBlock as l,createBlock as s,unref as a}from"vue";import{isEqual as i,cloneDeep as u}from"lodash-es";import"../../shortcut-provider/index.js";import{normalizeSignatureInfo as n,isInvalidSignature as p,getDisplaySignature as c}from"../../shortcut-provider/src/utils/index.js";import m from"./ShortcutSetterItem.vue.js";import d from"../../form-render/index.js";import{GlobalShortcutProvider as h,useShortcuts as f}from"../../shortcut-provider/src/hooks/useShortcuts.js";var v=e({__name:"ShortcutSetter",props:{glob:{type:Boolean,default:!1},scope:{type:[String,Symbol]}},emits:["error","update"],setup(e,{expose:v,emit:S}){const y=e,g={SHORTCUT:m},j=t(0),k=r((()=>y.glob?h:y.scope)),b=f(k),x=t([]);let _={};function O(){_={},x.value=b.traverse().map((e=>(_[e.key]=n(e.shortcutSignature),{val_key:e.key,alias:e.label,html_type:"SHORTCUT",componentProps:{scope:k.value,onShortcutChange:T,shortcutKey:e.key,shortcutSignature:e.shortcutSignature,editPlaceholder:e.editPlaceholder,placeholder:e.placeholder,operation:e.operation},elem_width:6}))),j.value++}function T({key:e,info:t,resolve:r,reject:o}){const l=n(t);return p(l)?(S("error",`非法的快捷键组合=> ${c(l)}`),o()):Object.values(_).some((e=>i(e,l)))?(S("error",`重复的快捷键=> ${c(l)}`),o()):(S("update",{key:e,info:l}),_[e]=l,void r())}return o([k,()=>b.traverse()],O,{immediate:!0,deep:!0}),v({loadSignature(){O()},getSignature:()=>u(_),setSignature(){Object.entries(_).forEach((([e,t])=>{b.update(e,t)}))}}),(e,t)=>(l(),s(a(d),{column:12,key:j.value,"label-placement":"left","field-list":x.value,components:g},null,8,["field-list"]))}});export{v as default};
1
+ import{defineComponent as e,ref as t,computed as r,watch as o,openBlock as l,createBlock as a,unref as s}from"vue";import{isEqual as i,cloneDeep as u}from"lodash-es";import"../../shortcut-provider/index.js";import{normalizeSignatureInfo as n,isInvalidSignature as c,getDisplaySignature as p}from"../../shortcut-provider/src/utils/index.js";import m from"./ShortcutSetterItem.vue.js";import d from"../../form-render/index.js";import{GlobalShortcutProvider as h,useShortcuts as f}from"../../shortcut-provider/src/hooks/useShortcuts.js";var v=e({__name:"ShortcutSetter",props:{glob:{type:Boolean,default:!1},scope:{type:[String,Symbol]}},emits:["error","update"],setup(e,{expose:v,emit:S}){const y=e,g={SHORTCUT:m},b=t(0),j=r((()=>y.glob?h:y.scope)),k=f(j),x=t([]);let _={};function O(){_={},x.value=k.traverse().map((e=>(_[e.key]=n(e.shortcutSignature),{val_key:e.key,alias:e.label,html_type:"SHORTCUT",componentProps:{scope:j.value,onShortcutChange:T,shortcutKey:e.key,shortcutSignature:e.shortcutSignature,editPlaceholder:e.editPlaceholder,placeholder:e.placeholder,clearable:e.clearable,operation:e.operation},elem_width:6}))),b.value++}function T({key:e,info:t,resolve:r,reject:o}){const l=n(t);return c(l)?(S("error",`非法的快捷键组合=> ${p(l)}`),o()):Object.values(_).some((e=>i(e,l)))?(S("error",`重复的快捷键=> ${p(l)}`),o()):(S("update",{key:e,info:l}),_[e]=l,void r())}return o([j,()=>k.traverse()],O,{immediate:!0,deep:!0}),v({loadSignature(){O()},getSignature:()=>u(_),setSignature(){Object.entries(_).forEach((([e,t])=>{k.update(e,t)}))}}),(e,t)=>(l(),a(s(d),{column:12,key:b.value,"label-placement":"left","field-list":x.value,components:g},null,8,["field-list"]))}});export{v as default};
@@ -25,6 +25,11 @@ declare const _default: import("vue").DefineComponent<{
25
25
  type: null;
26
26
  required: true;
27
27
  };
28
+ clearable: {
29
+ type: BooleanConstructor;
30
+ required: true;
31
+ default: boolean;
32
+ };
28
33
  placeholder: {
29
34
  type: StringConstructor;
30
35
  required: false;
@@ -42,11 +47,13 @@ declare const _default: import("vue").DefineComponent<{
42
47
  value: unknown;
43
48
  onChange: unknown;
44
49
  onFocus: unknown;
50
+ clearable: boolean;
45
51
  placeholder: string;
46
52
  editPlaceholder: string;
47
53
  };
48
54
  ShortcutInputState: typeof ShortcutInputState;
49
55
  currentSetShortcut: import("vue").Ref<string>;
56
+ onClear: () => void;
50
57
  state: import("vue").Ref<ShortcutInputState>;
51
58
  isEditState: import("vue").ComputedRef<boolean>;
52
59
  currentEditShortcut: import("vue").Ref<string>;
@@ -80,6 +87,11 @@ declare const _default: import("vue").DefineComponent<{
80
87
  type: null;
81
88
  required: true;
82
89
  };
90
+ clearable: {
91
+ type: BooleanConstructor;
92
+ required: true;
93
+ default: boolean;
94
+ };
83
95
  placeholder: {
84
96
  type: StringConstructor;
85
97
  required: false;
@@ -1 +1 @@
1
- import{defineComponent as e,ref as t,computed as u,openBlock as l,createElementBlock as r,createVNode as o,unref as n,withModifiers as a}from"vue";import{NInput as s}from"naive-ui";import{getDisplaySignature as c}from"../../shortcut-provider/src/utils/index.js";const i={class:"shortcut-setter-item__wrapper"};var p=e({__name:"ShortcutSetterItem",props:{shortcutKey:null,shortcutSignature:null,value:null,onChange:null,onFocus:null,placeholder:{default:"点击设置快捷键"},editPlaceholder:{default:"键盘按下要设置的快捷键组合"}},emits:["shortcutChange"],setup(e,{emit:p}){const v=e,h=t(c(v.shortcutSignature)),d=t(0),f=u((()=>0===d.value)),m=t(""),y=u((()=>f.value?h.value:m.value)),K=u((()=>f.value?v.placeholder:v.editPlaceholder));function g(){d.value=1}const w=t();function _(){var e;d.value=0,m.value="",null==(e=w.value)||e.blur()}const S=e=>{m.value=c(e)},C=async e=>{try{if(c(e)===h.value)return;await new Promise(((t,u)=>{p("shortcutChange",{key:v.shortcutKey,info:e,resolve:t,reject:u})})),h.value=c(e)}finally{_(),m.value=""}};return(e,t)=>(l(),r("section",i,[o(n(s),{ref_key:"inputRef",ref:w,"input-props":{class:"shortcut-setter-item"},value:n(y),placeholder:n(K),onFocus:g,onBlur:_,onKeydown:a(S,["prevent","stop"]),onKeyup:a(C,["prevent","stop"])},null,8,["value","placeholder","onKeydown","onKeyup"])]))}});export{p as default};
1
+ import{defineComponent as e,ref as t,computed as l,openBlock as o,createElementBlock as r,createVNode as u,unref as a,withModifiers as n}from"vue";import{noop as s}from"lodash-es";import{NInput as c}from"naive-ui";import{getDisplaySignature as i}from"../../shortcut-provider/src/utils/index.js";const p={class:"shortcut-setter-item__wrapper"};var v=e({__name:"ShortcutSetterItem",props:{shortcutKey:null,shortcutSignature:null,value:null,onChange:null,onFocus:null,clearable:{type:Boolean,default:!1},placeholder:{default:"点击设置快捷键"},editPlaceholder:{default:"键盘按下要设置的快捷键组合"}},emits:["shortcutChange"],setup(e,{emit:v}){const h=e,f=t(i(h.shortcutSignature));function d(){f.value="",v("shortcutChange",{key:h.shortcutKey,info:{key:""},resolve:s,reject:s})}const m=t(0),y=l((()=>0===m.value)),K=t(""),g=l((()=>y.value?f.value:K.value)),b=l((()=>y.value?h.placeholder:h.editPlaceholder));function w(){m.value=1}const C=t();function _(){var e;m.value=0,K.value="",null==(e=C.value)||e.blur()}const k=e=>{K.value=i(e)},S=async e=>{try{if(i(e)===f.value)return;await new Promise(((t,l)=>{v("shortcutChange",{key:h.shortcutKey,info:e,resolve:t,reject:l})})),f.value=i(e)}finally{_(),K.value=""}};return(t,l)=>(o(),r("section",p,[u(a(c),{ref_key:"inputRef",ref:C,"input-props":{class:"shortcut-setter-item"},value:a(g),placeholder:a(b),clearable:e.clearable,onClear:d,onFocus:w,onBlur:_,onKeydown:n(k,["prevent","stop"]),onKeyup:n(S,["prevent","stop"])},null,8,["value","placeholder","clearable","onKeydown","onKeyup"])]))}});export{v as default};
@@ -23,6 +23,14 @@ declare const StepsWheel: SFCWithInstall<import("vue").DefineComponent<{
23
23
  type: BooleanConstructor;
24
24
  default: boolean;
25
25
  };
26
+ lastNodeColor: {
27
+ type: ObjectConstructor;
28
+ default: () => {};
29
+ };
30
+ singleNodeRender: {
31
+ type: ObjectConstructor;
32
+ default: () => {};
33
+ };
26
34
  noDataMsg: {
27
35
  type: StringConstructor;
28
36
  default: string;
@@ -56,6 +64,14 @@ declare const StepsWheel: SFCWithInstall<import("vue").DefineComponent<{
56
64
  type: BooleanConstructor;
57
65
  default: boolean;
58
66
  };
67
+ lastNodeColor: {
68
+ type: ObjectConstructor;
69
+ default: () => {};
70
+ };
71
+ singleNodeRender: {
72
+ type: ObjectConstructor;
73
+ default: () => {};
74
+ };
59
75
  noDataMsg: {
60
76
  type: StringConstructor;
61
77
  default: string;
@@ -86,6 +102,7 @@ declare const StepsWheel: SFCWithInstall<import("vue").DefineComponent<{
86
102
  isLastNode: (index: number) => boolean;
87
103
  handleFinishLastNodeCss: (index: number) => boolean;
88
104
  handleFinishLastNodeLine: (index: number, type?: string | undefined) => boolean;
105
+ handlerActive: (stepItem: any, index: number, position: string) => any;
89
106
  NTooltip: any;
90
107
  NEmpty: any;
91
108
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
@@ -112,6 +129,14 @@ declare const StepsWheel: SFCWithInstall<import("vue").DefineComponent<{
112
129
  type: BooleanConstructor;
113
130
  default: boolean;
114
131
  };
132
+ lastNodeColor: {
133
+ type: ObjectConstructor;
134
+ default: () => {};
135
+ };
136
+ singleNodeRender: {
137
+ type: ObjectConstructor;
138
+ default: () => {};
139
+ };
115
140
  noDataMsg: {
116
141
  type: StringConstructor;
117
142
  default: string;
@@ -127,6 +152,8 @@ declare const StepsWheel: SFCWithInstall<import("vue").DefineComponent<{
127
152
  toolTipShow: boolean;
128
153
  lastNodeRender: boolean;
129
154
  nextNodeRender: boolean;
155
+ lastNodeColor: Record<string, any>;
156
+ singleNodeRender: Record<string, any>;
130
157
  placement: string;
131
158
  }>>;
132
159
  export default StepsWheel;
@@ -22,6 +22,14 @@ declare const _default: import("vue").DefineComponent<{
22
22
  type: BooleanConstructor;
23
23
  default: boolean;
24
24
  };
25
+ lastNodeColor: {
26
+ type: ObjectConstructor;
27
+ default: () => {};
28
+ };
29
+ singleNodeRender: {
30
+ type: ObjectConstructor;
31
+ default: () => {};
32
+ };
25
33
  noDataMsg: {
26
34
  type: StringConstructor;
27
35
  default: string;
@@ -55,6 +63,14 @@ declare const _default: import("vue").DefineComponent<{
55
63
  type: BooleanConstructor;
56
64
  default: boolean;
57
65
  };
66
+ lastNodeColor: {
67
+ type: ObjectConstructor;
68
+ default: () => {};
69
+ };
70
+ singleNodeRender: {
71
+ type: ObjectConstructor;
72
+ default: () => {};
73
+ };
58
74
  noDataMsg: {
59
75
  type: StringConstructor;
60
76
  default: string;
@@ -85,6 +101,7 @@ declare const _default: import("vue").DefineComponent<{
85
101
  isLastNode: (index: number) => boolean;
86
102
  handleFinishLastNodeCss: (index: number) => boolean;
87
103
  handleFinishLastNodeLine: (index: number, type?: string) => boolean;
104
+ handlerActive: (stepItem: any, index: number, position: string) => any;
88
105
  NTooltip: any;
89
106
  NEmpty: any;
90
107
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
@@ -111,6 +128,14 @@ declare const _default: import("vue").DefineComponent<{
111
128
  type: BooleanConstructor;
112
129
  default: boolean;
113
130
  };
131
+ lastNodeColor: {
132
+ type: ObjectConstructor;
133
+ default: () => {};
134
+ };
135
+ singleNodeRender: {
136
+ type: ObjectConstructor;
137
+ default: () => {};
138
+ };
114
139
  noDataMsg: {
115
140
  type: StringConstructor;
116
141
  default: string;
@@ -126,6 +151,8 @@ declare const _default: import("vue").DefineComponent<{
126
151
  toolTipShow: boolean;
127
152
  lastNodeRender: boolean;
128
153
  nextNodeRender: boolean;
154
+ lastNodeColor: Record<string, any>;
155
+ singleNodeRender: Record<string, any>;
129
156
  placement: string;
130
157
  }>;
131
158
  export default _default;
@@ -1 +1 @@
1
- import{defineComponent as e,computed as t,toRefs as l,ref as n,watch as o,openBlock as s,createElementBlock as i,normalizeStyle as r,unref as a,normalizeClass as p,createElementVNode as d,Fragment as u,renderList as c,createCommentVNode as m,withDirectives as f,renderSlot as v,toDisplayString as h,vShow as I,createBlock as g,withCtx as x,createVNode as y}from"vue";import{NTooltip as w,NEmpty as B}from"naive-ui";import{useTheme as S}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import"lodash-es";import{defaultCssVars as T}from"./constants/index.js";const M={class:"stepBox"},b=["title"],k=["onMouseenter","onMouseleave"],_=["onMouseenter","onMouseleave"],C=["title"],R=["title"],N=["title"],$={key:0,style:{height:"48px"}},L={key:1},V={key:1};var j=e({__name:"StepsWheel",props:{stepInfo:{type:Object,default:()=>({list:[],cols:6})},currentStep:{type:Number,default:1},toolTipShow:{type:Boolean,default:!0},lastNodeRender:{type:Boolean,default:!1},nextNodeRender:{type:Boolean,default:!1},noDataMsg:{type:String,default:"暂无节点数据"},placement:{type:String,default:"center"}},setup(e){const j=e,D=S(T,"StepsWheel"),O=t((()=>Math.ceil(q.value.length/j.stepInfo.cols))),A=t((()=>j.lastNodeRender)),{noDataMsg:E,nextNodeRender:P}=l(j),W=n(null),F=t((()=>{var e;let t=72;if(null==(e=null==W?void 0:W.value)?void 0:e.length){let e=W.value[0],l=window.getComputedStyle?window.getComputedStyle(e):e.currentStyle;t=isNaN(parseInt(l["min-width"]))?72:parseInt(l["min-width"])}return`${20+j.stepInfo.cols*t}px`})),q=n([]),z=n([]),G=e=>{e.tipVisible=!0},H=e=>{e.tipVisible=!1},J=e=>{if(z.value.length){if(e.rowIndex===z.value.length)return!0;if(e.rowIndex<z.value.length)return z.value[e.rowIndex].some((e=>null==e?void 0:e.title))}return!1},K=e=>{const{list:t=[]}=j.stepInfo;return e.rowIndex%2==0&&"frist"==e.nodeType&&e.nodeIndex!==t.length},Q=e=>{const{list:t=[]}=j.stepInfo;return e.rowIndex%2!=0&&"last"==e.nodeType&&e.nodeIndex!==t.length},U=(e,t)=>P.value?e.rowIndex%2==0?j.currentStep>=t+(j.stepInfo.cols-2*e.sort)-1:j.currentStep>=t+1:e.rowIndex%2==0?j.currentStep>=t+(j.stepInfo.cols-2*e.sort):j.currentStep>=t+2,X=(e,t)=>{let l=e.length,n=l%t==0?l/t:Math.floor(l/t+1),o=[];for(let l=0;l<n;l++){let n=e.slice(l*t,l*t+t);o.push(n)}return o},Y=e=>{const{cols:t}=j.stepInfo;let l=X(q.value,t),n=l[l.length-1].filter((e=>e));return O.value%2==0?e!=n[n.length-1].nodeIndex-(t-2*n[n.length-1].sort):e!=n[n.length-1].nodeIndex-1},Z=e=>{const{cols:t}=j.stepInfo;let l=X(q.value,t),n=l[l.length-1].filter((e=>e));return O.value%2==0?A.value&&e==n[0].nodeIndex-(t-2*n[0].sort):A.value&&e==n[n.length-1].nodeIndex-1},ee=(e,t)=>{const{cols:l}=j.stepInfo;let n=X(q.value,l),o=n[n.length-1].filter((e=>e));return O.value%2==0?"circle"===t?A.value&&e==o[0].nodeIndex-(l-2*o[0].sort)-l:A.value&&e==o[0].nodeIndex-(l-2*o[0].sort):"circle"===t?A.value&&e==o[o.length-1].nodeIndex-1-l:A.value&&e==o[o.length-1].nodeIndex-2};return o((()=>j.stepInfo),(e=>{var t;(null==(t=null==e?void 0:e.list)?void 0:t.length)&&((e,t)=>{let l=e.length+1,n=Math.ceil(e.length/t),o=!0,s=[];for(var i=0;i<n;i++)s[i]=new Array(t),s[i].fill(null);let r=0,a=0;for(let n=1;n<l;n++)s[r][a]=Object.assign(e[n-1],{nodeIndex:n,rowIndex:r+1}),o?n%t!=0?a++:(o=!o,r++):n%t!=0?a--:(o=!o,r++);let p=[];s.map((e=>{e.map(((e,t)=>{e&&(e.sort=t,!e.hasOwnProperty("tipVisible")&&(e.tipVisible=!1))})),e[0]&&(e[0].nodeType="frist"),e[e.length-1]&&(e[e.length-1].nodeType="last"),p=[...p,...e]})),q.value=p,z.value=s})(e.list,e.cols)}),{immediate:!0,deep:!0}),(t,l)=>(s(),i("div",{class:"step-wheel-box",style:r({minWidth:a(F),...a(D)})},[q.value.length?(s(),i("div",{key:0,class:p(["stepOut",{placementLeft:"left"===e.placement,placementRight:"right"===e.placement}])},[d("ul",M,[(s(!0),i(u,null,c(q.value,((l,n)=>(s(),i("li",{ref_for:!0,ref_key:"stepItemRef",ref:W,key:(null==l?void 0:l.stepId)||n,class:p(["stepItem",{[`stepItem_${n+1}`]:!0,[`${null==l?void 0:l.stepId}`]:!!(null==l?void 0:l.stepId)}])},[l?(s(),i(u,{key:0},[m(" 步骤头部信息 "),f(d("div",{class:p(["stepTopBox",{activeTitle:e.currentStep>=l.nodeIndex,finished:Z(n),stepTopBox_right:"right"===e.placement,stepTopBox_left:"left"===e.placement}])},[v(t.$slots,"stepTopBox",{stepItem:l},(()=>[d("span",{title:l.title},h(l.title),9,b)]))],2),[[I,l.title]]),m(" 步骤条的节点,此处为圆圈 "),e.toolTipShow?(s(),g(a(w),{key:0,placement:"top",delay:0,"show-arrow":!0,show:l.tipVisible,trigger:"manual",style:r({opacity:"0.88"}),onMouseenter:e=>G(l),onMouseleave:e=>H(l)},{trigger:x((()=>[d("div",{class:p(["icon",{active:e.currentStep>=l.nodeIndex,finished:Z(n)}]),onMouseenter:e=>G(l),onMouseleave:e=>H(l)},null,42,k)])),default:x((()=>[v(t.$slots,"nodeTipBox",{stepItem:l,stepId:l.stepId})])),_:2},1032,["show","style","onMouseenter","onMouseleave"])):(s(),i("div",{key:1,class:p(["icon",{active:e.currentStep>=l.nodeIndex,finished:Z(n)}])},null,2)),m(" 步骤条连接线,动态显示 "),"last"!==l.nodeType?f((s(),i("div",{key:2,class:p(["line",{lineActive:U(l,n),finished:ee(n)}])},null,2)),[[I,Y(n)]]):m("v-if",!0),m(" 步骤条弯曲连线,动态渲染 "),K(l)||Q(l)?(s(),i("div",{key:3,class:p({lineCircleActive:a(P)?e.currentStep>=l.nodeIndex:e.currentStep>l.nodeIndex,lineCircleFinished:ee(n,"circle"),lineCircleRight:Q(l),lineCircleLeft:K(l),lineCirclePlacementRight:Q(l)&&"right"===e.placement,lineCirclePlacementLeft:K(l)&&"left"===e.placement})},null,2)):m("v-if",!0),m(" 步骤底部信息 "),d("div",{class:p(["stepBottomBox",{stepBottomBox_right:"right"===e.placement,stepBottomBox_left:"left"===e.placement}]),onMouseenter:e=>G(l),onMouseleave:e=>H(l)},[v(t.$slots,"stepBottomBox",{stepItem:l},(()=>[m(" 步骤名称 "),f(d("p",{class:p(["stepLabel",{labelFinsh:Z(n),stepLabel_right:"right"===e.placement,stepLabel_left:"left"===e.placement}]),title:l.label},h(l.label),11,C),[[I,l.label]]),d("div",{class:p({stepBottomCustomBox:!0,alignItemsEnd:"left"===e.placement,alignItemsStart:"right"===e.placement})},[v(t.$slots,"stepBottomCustomBox",{stepItem:l},(()=>[d("div",{class:p({stepBottomDefaultBox:!0,alignItemsEnd:"left"===e.placement,alignItemsStart:"right"===e.placement}),style:{width:"100%",display:"flex",flexDirection:"column"}},[f(d("p",{class:"stepExtra",title:l.person},h(l.person),9,R),[[I,l.person]]),m(" 步骤时间 "),f(d("p",{class:"statusTime",title:l.statusTime},h(l.statusTime),9,N),[[I,l.statusTime]])],2)]))],2)])),J(l)?(s(),i("div",$)):m("v-if",!0)],42,_)],64)):(s(),i("div",L,[m("null元素占位")]))],2)))),128))])],2)):(s(),i("div",V,[y(a(B),{description:a(E)},null,8,["description"])]))],4))}});export{j as default};
1
+ import{defineComponent as e,computed as t,toRefs as l,ref as o,watch as n,openBlock as s,createElementBlock as r,normalizeStyle as i,unref as a,normalizeClass as d,createElementVNode as c,Fragment as p,renderList as u,createCommentVNode as f,withDirectives as m,renderSlot as g,toDisplayString as h,vShow as v,createBlock as x,withCtx as y,createVNode as I}from"vue";import{NTooltip as b,NEmpty as w}from"naive-ui";import{useTheme as S}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import"lodash-es";import{defaultCssVars as k}from"./constants/index.js";const B={class:"stepBox"},j=["title"],N=["onMouseenter","onMouseleave"],M=["onMouseenter","onMouseleave"],R=["title"],T=["title"],O=["title"],C={key:0,style:{height:"48px"}},_={key:1},L={key:1};var $=e({__name:"StepsWheel",props:{stepInfo:{type:Object,default:()=>({list:[],cols:6})},currentStep:{type:Number,default:1},toolTipShow:{type:Boolean,default:!0},lastNodeRender:{type:Boolean,default:!1},nextNodeRender:{type:Boolean,default:!1},lastNodeColor:{type:Object,default:()=>({})},singleNodeRender:{type:Object,default:()=>({})},noDataMsg:{type:String,default:"暂无节点数据"},placement:{type:String,default:"center"}},setup(e){const $=e;let V=S(k,"StepsWheel");const D=t((()=>Math.ceil(q.value.length/$.stepInfo.cols))),W=t((()=>$.lastNodeRender)),{noDataMsg:E,nextNodeRender:P}=l($),F=o(null),A=t((()=>{var e;let t=72;if(null==(e=null==F?void 0:F.value)?void 0:e.length){let e=F.value[0],l=window.getComputedStyle?window.getComputedStyle(e):e.currentStyle;t=isNaN(parseInt(l["min-width"]))?72:parseInt(l["min-width"])}return`${20+$.stepInfo.cols*t}px`})),q=o([]),z=o([]),G=e=>{e.tipVisible=!0},H=e=>{e.tipVisible=!1},J=e=>{if(z.value.length){if(e.rowIndex===z.value.length)return!0;if(e.rowIndex<z.value.length)return z.value[e.rowIndex].some((e=>null==e?void 0:e.title))}return!1},K=e=>{const{list:t=[]}=$.stepInfo;return e.rowIndex%2==0&&"frist"==e.nodeType&&e.nodeIndex!==t.length},Q=e=>{const{list:t=[]}=$.stepInfo;return e.rowIndex%2!=0&&"last"==e.nodeType&&e.nodeIndex!==t.length},U=(e,t)=>{let l=e.length,o=l%t==0?l/t:Math.floor(l/t+1),n=[];for(let l=0;l<o;l++){let o=e.slice(l*t,l*t+t);n.push(o)}return n},X=e=>{const{cols:t}=$.stepInfo;let l=U(q.value,t),o=l[l.length-1].filter((e=>e));return D.value%2==0?e!=o[o.length-1].nodeIndex-(t-2*o[o.length-1].sort):e!=o[o.length-1].nodeIndex-1},Y=e=>{const{cols:t}=$.stepInfo;let l=U(q.value,t),o=l[l.length-1].filter((e=>e));return D.value%2==0?W.value&&e==o[0].nodeIndex-(t-2*o[0].sort):W.value&&e==o[o.length-1].nodeIndex-1},Z=(e,t)=>{const{cols:l}=$.stepInfo;let o=U(q.value,l),n=o[o.length-1].filter((e=>e));return D.value%2==0?"circle"===t?W.value&&e==n[0].nodeIndex-(l-2*n[0].sort)-l:W.value&&e==n[0].nodeIndex-(l-2*n[0].sort):"circle"===t?W.value&&e==n[n.length-1].nodeIndex-1-l:W.value&&e==n[n.length-1].nodeIndex-2},ee=(e,t,l)=>{var o,n;if((null==(o=$.singleNodeRender)?void 0:o.field)&&(null==(n=$.singleNodeRender)?void 0:n.details)&&"[object Object]"===Object.prototype.toString.call($.singleNodeRender.details)&&Object.keys($.singleNodeRender.details).length){const{details:o,field:n}=$.singleNodeRender;if(o[e[n]]&&"[object Object]"===Object.prototype.toString.call(o[e[n]])&&Object.keys(o[e[n]]).length){let s={};switch(l){case"title":s={color:o[e[n]].color,background:o[e[n]].background};break;case"icon":s={background:o[e[n]].nodeLineColor};break;case"line":s={"border-bottom":`1px solid ${o[e[n]].nodeLineColor}`},$.nextNodeRender?e.rowIndex%2==0&&(s={"border-bottom":`1px solid ${o[q.value[t+1][n]].nodeLineColor}`}):s={};break;case"circle":$.nextNodeRender&&(s={border:`1px solid ${o[e[n]].nodeLineColor}`})}return s}}let s={color:"var(--c-primary-color)",background:"#f1f5fe"};if("icon"===l){if(s={background:"var(--c-primary-color)"},$.currentStep>=e.nodeIndex)return s}else if("circle"===l){if(s={border:"1px solid var(--c-primary-color)"},$.nextNodeRender){if($.currentStep>=e.nodeIndex)return s}else if($.currentStep>e.nodeIndex)return s}else if("line"===l){if(s={"border-bottom":"1px solid var(--c-primary-color)"},((e,t)=>P.value?e.rowIndex%2==0?$.currentStep>=t+($.stepInfo.cols-2*e.sort)-1:$.currentStep>=t+1:e.rowIndex%2==0?$.currentStep>=t+($.stepInfo.cols-2*e.sort):$.currentStep>=t+2)(e,t))return s}else if("title"===l&&$.currentStep>=e.nodeIndex)return s;return{}};return n((()=>$.stepInfo),(e=>{var t;(null==(t=null==e?void 0:e.list)?void 0:t.length)&&((e,t)=>{let l=e.length+1,o=Math.ceil(e.length/t),n=!0,s=[];for(var r=0;r<o;r++)s[r]=new Array(t),s[r].fill(null);let i=0,a=0;for(let o=1;o<l;o++)s[i][a]=Object.assign(e[o-1],{nodeIndex:o,rowIndex:i+1}),n?o%t!=0?a++:(n=!n,i++):o%t!=0?a--:(n=!n,i++);let d=[];s.map((e=>{e.map(((e,t)=>{e&&(e.sort=t,!e.hasOwnProperty("tipVisible")&&(e.tipVisible=!1))})),e[0]&&(e[0].nodeType="frist"),e[e.length-1]&&(e[e.length-1].nodeType="last"),d=[...d,...e]})),q.value=d,z.value=s})(e.list,e.cols)}),{immediate:!0,deep:!0}),n((()=>$.lastNodeColor),(e=>{if(e&&"[object Object]"===Object.prototype.toString.call(e)&&Object.keys(e).length){const t=Object.assign({},k,{"--c-success-color":e.color||"#5dc055","--c-success-title-color":e.background||"#fff"});V=S(t,"StepsWheel")}}),{immediate:!0,deep:!0}),(t,l)=>(s(),r("div",{class:"step-wheel-box",style:i({minWidth:a(A),...a(V)})},[q.value.length?(s(),r("div",{key:0,class:d(["stepOut",{placementLeft:"left"===e.placement,placementRight:"right"===e.placement}])},[c("ul",B,[(s(!0),r(p,null,u(q.value,((l,o)=>(s(),r("li",{ref_for:!0,ref_key:"stepItemRef",ref:F,key:(null==l?void 0:l.stepId)||o,class:d(["stepItem",{[`stepItem_${o+1}`]:!0,[`${null==l?void 0:l.stepId}`]:!!(null==l?void 0:l.stepId)}])},[l?(s(),r(p,{key:0},[f(" 步骤头部信息 "),m(c("div",{class:d(["stepTopBox",{finished:Y(o),stepTopBox_right:"right"===e.placement,stepTopBox_left:"left"===e.placement}]),style:i({...ee(l,o,"title")})},[g(t.$slots,"stepTopBox",{stepItem:l},(()=>[c("span",{title:l.title},h(l.title),9,j)]))],6),[[v,l.title]]),f(" 步骤条的节点,此处为圆圈 "),e.toolTipShow&&l.tipShow?(s(),x(a(b),{key:0,placement:"top",delay:0,"show-arrow":!0,show:l.tipVisible,trigger:"manual",style:i({opacity:"0.88"}),onMouseenter:e=>G(l),onMouseleave:e=>H(l)},{trigger:y((()=>[c("div",{class:d(["icon",{finished:Y(o)}]),style:i({...ee(l,o,"icon")}),onMouseenter:e=>G(l),onMouseleave:e=>H(l)},null,46,N)])),default:y((()=>[g(t.$slots,"nodeTipBox",{stepItem:l,stepId:l.stepId})])),_:2},1032,["show","style","onMouseenter","onMouseleave"])):(s(),r("div",{key:1,class:d(["icon",{finished:Y(o)}]),style:i({...ee(l,o,"icon")})},null,6)),f(" 步骤条连接线,动态显示 "),"last"!==l.nodeType?m((s(),r("div",{key:2,class:d(["line",{finished:Z(o)}]),style:i({...ee(l,o,"line")})},null,6)),[[v,X(o)]]):f("v-if",!0),f(" 步骤条弯曲连线,动态渲染 "),K(l)||Q(l)?(s(),r("div",{key:3,class:d({lineCircleFinished:Z(o,"circle"),lineCircleRight:Q(l),lineCircleLeft:K(l),lineCirclePlacementRight:Q(l)&&"right"===e.placement,lineCirclePlacementLeft:K(l)&&"left"===e.placement}),style:i({...ee(l,o,"circle")})},null,6)):f("v-if",!0),f(" 步骤底部信息 "),c("div",{class:d(["stepBottomBox",{stepBottomBox_right:"right"===e.placement,stepBottomBox_left:"left"===e.placement}]),onMouseenter:e=>G(l),onMouseleave:e=>H(l)},[g(t.$slots,"stepBottomBox",{stepItem:l},(()=>[f(" 步骤名称 "),m(c("p",{class:d(["stepLabel",{labelFinsh:Y(o),stepLabel_right:"right"===e.placement,stepLabel_left:"left"===e.placement}]),title:l.label},h(l.label),11,R),[[v,l.label]]),c("div",{class:d({stepBottomCustomBox:!0,alignItemsEnd:"left"===e.placement,alignItemsStart:"right"===e.placement})},[g(t.$slots,"stepBottomCustomBox",{stepItem:l},(()=>[c("div",{class:d({stepBottomDefaultBox:!0,alignItemsEnd:"left"===e.placement,alignItemsStart:"right"===e.placement}),style:{width:"100%",display:"flex",flexDirection:"column"}},[m(c("p",{class:"stepExtra",title:l.person},h(l.person),9,T),[[v,l.person]]),f(" 步骤时间 "),m(c("p",{class:"statusTime",title:l.statusTime},h(l.statusTime),9,O),[[v,l.statusTime]])],2)]))],2)])),J(l)?(s(),r("div",C)):f("v-if",!0)],42,M)],64)):(s(),r("div",_,[f("null元素占位")]))],2)))),128))])],2)):(s(),r("div",L,[I(a(w),{description:a(E)},null,8,["description"])]))],4))}});export{$ as default};
@@ -1 +1 @@
1
- const c={"--c-primary-color":"#2563f4","--c-success-color":"#5dc055"};export{c as defaultCssVars};
1
+ const c={"--c-primary-color":"#2563f4","--c-success-color":"#fff","--c-success-title-color":"#5dc055"};export{c as defaultCssVars};
@@ -1 +1 @@
1
- .step-wheel-box{font-family:PingFangSC-Medium,PingFang SC;font-size:16px;font-weight:500;height:100%;overflow:hidden;width:100%}.step-wheel-box .stepOut{display:flex;justify-content:center}.step-wheel-box .stepOut .stepBox{display:flex;flex-wrap:wrap;list-style:none;width:100%}.step-wheel-box .stepOut .stepItem{font-family:SimSun;font-size:16px;min-width:73px;position:relative;text-align:center;top:48px;width:15%}.step-wheel-box .stepOut .stepItem .lineCircleRight{border-color:#fff;border-bottom:1px dashed rgba(3,2,2,.4);border-left:0 dashed rgba(3,2,2,.4)!important;border-radius:0 25px 25px 0;border-right:1px dashed rgba(3,2,2,.4);border-top:1px dashed rgba(3,2,2,.4);display:block;height:100%;left:55%;position:absolute;top:6px;width:30%}.step-wheel-box .stepOut .stepItem .lineCirclePlacementRight{width:100%}.step-wheel-box .stepOut .stepItem .lineCircleLeft{border-color:#fff;border-bottom:1px dashed rgba(3,2,2,.4);border-left:1px dashed rgba(3,2,2,.4);border-radius:25px 0 0 25px;border-right:0 dashed rgba(3,2,2,.4)!important;border-top:1px dashed rgba(3,2,2,.4);display:block;height:100%;left:15%;position:absolute;top:6px;width:30%}.step-wheel-box .stepOut .stepItem .lineCirclePlacementLeft{left:-55%;width:100%}.step-wheel-box .stepOut .stepItem .lineCircleActive{border:1px solid var(--c-primary-color)}.step-wheel-box .stepOut .stepItem .lineCircleFinished{border:1px solid var(--c-success-color)}.step-wheel-box .stepOut .stepItem .icon{background:#969696;border-radius:50%;height:13px;margin:0 auto;position:relative;width:13px;z-index:888}.step-wheel-box .stepOut .stepItem .active{background-color:var(--c-primary-color)}.step-wheel-box .stepOut .stepItem .finished{background-color:var(--c-success-color)!important;border-color:var(--c-success-color)!important;color:#fff!important}.step-wheel-box .stepOut .stepItem .labelFinsh{color:var(--c-success-color)!important}.step-wheel-box .stepOut .stepItem .line{border-bottom:1px dashed rgba(3,2,2,.4);left:55%;position:absolute;top:6px;width:90%;z-index:111}.step-wheel-box .stepOut .stepItem .lineActive{border-bottom:1px solid var(--c-primary-color)}.step-wheel-box .stepOut .stepItem .stepTopBox{background:#e6e6e6;border-radius:4px;color:#000;cursor:pointer;height:40px;left:50%;line-height:40px;max-width:70%;min-width:73px;overflow:hidden;padding:0 5px;position:absolute;text-overflow:ellipsis;top:-48px;transform:translateX(-50%);white-space:nowrap}.step-wheel-box .stepOut .stepItem .activeTitle{background:#f1f5fe;color:var(--c-primary-color)}.step-wheel-box .stepOut .stepItem .stepTopBox_right{transform:translateX(-10%)}.step-wheel-box .stepOut .stepItem .stepTopBox_left{transform:translateX(-90%)}.step-wheel-box .stepOut .stepItem .stepBottomBox{align-items:center;cursor:pointer;display:flex;flex-direction:column;margin:8px 0 16px;min-width:73px;overflow:hidden;width:100%}.step-wheel-box .stepOut .stepItem .stepBottomBox .stepBottomCustomBox{align-items:center;display:flex;flex-direction:column;height:calc(100% - 27px);width:100%}.step-wheel-box .stepOut .stepItem .stepBottomBox .stepBottomCustomBox .stepBottomDefaultBox{align-items:center}.step-wheel-box .stepOut .stepItem .stepBottomBox .stepBottomCustomBox .alignItemsEnd{align-items:flex-end;text-align:right}.step-wheel-box .stepOut .stepItem .stepBottomBox .stepBottomCustomBox .alignItemsStart{align-items:flex-start;text-align:left}.step-wheel-box .stepOut .stepItem .stepBottomBox .alignItemsEnd{align-items:flex-end;text-align:right}.step-wheel-box .stepOut .stepItem .stepBottomBox .alignItemsStart{align-items:flex-start;text-align:left}.step-wheel-box .stepOut .stepItem .stepBottomBox_right{align-items:flex-start;left:45%;position:relative}.step-wheel-box .stepOut .stepItem .stepBottomBox_left{align-items:flex-end;left:-45%;position:relative}.step-wheel-box .stepOut .stepItem .stepLabel{color:#212121;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}.step-wheel-box .stepOut .stepItem .stepLabel_right{text-align:left}.step-wheel-box .stepOut .stepItem .stepLabel_left{text-align:right}.step-wheel-box .stepOut .stepItem .stepExtra{border:1px solid #cacaca;border-radius:4px;display:inline-block;margin:0;max-width:90%;overflow:hidden;padding:0 4px;text-overflow:ellipsis;white-space:nowrap;width:auto}.step-wheel-box .stepOut .stepItem .statusTime{color:rgba(0,0,0,.6);font-size:14px;font-weight:400;margin:0;max-width:90%}.placementRight{left:-1%;position:relative}.placementLeft{left:10%;position:relative}.nodeTipContent{margin:0;max-height:200px;max-width:400px;overflow:auto;padding:0;text-align:center}.nodeTipContent li{list-style:none;margin-bottom:5px}.nodeTipContent li p{margin:0}
1
+ .step-wheel-box{font-family:PingFangSC-Medium,PingFang SC;font-size:16px;font-weight:500;height:100%;overflow:hidden;width:100%}.step-wheel-box .stepOut{display:flex;justify-content:center}.step-wheel-box .stepOut .stepBox{display:flex;flex-wrap:wrap;list-style:none;width:100%}.step-wheel-box .stepOut .stepItem{font-family:SimSun;font-size:16px;min-width:73px;position:relative;text-align:center;top:48px;width:15%}.step-wheel-box .stepOut .stepItem .lineCircleRight{border-color:#fff;border-bottom:1px dashed rgba(3,2,2,.4);border-left:0 dashed rgba(3,2,2,.4)!important;border-radius:0 25px 25px 0;border-right:1px dashed rgba(3,2,2,.4);border-top:1px dashed rgba(3,2,2,.4);display:block;height:100%;left:55%;position:absolute;top:6px;width:30%}.step-wheel-box .stepOut .stepItem .lineCirclePlacementRight{width:100%}.step-wheel-box .stepOut .stepItem .lineCircleLeft{border-color:#fff;border-bottom:1px dashed rgba(3,2,2,.4);border-left:1px dashed rgba(3,2,2,.4);border-radius:25px 0 0 25px;border-right:0 dashed rgba(3,2,2,.4)!important;border-top:1px dashed rgba(3,2,2,.4);display:block;height:100%;left:15%;position:absolute;top:6px;width:30%}.step-wheel-box .stepOut .stepItem .lineCirclePlacementLeft{left:-55%;width:100%}.step-wheel-box .stepOut .stepItem .lineCircleActive{border:1px solid var(--c-primary-color)}.step-wheel-box .stepOut .stepItem .lineCircleFinished{border:1px solid var(--c-success-color)}.step-wheel-box .stepOut .stepItem .icon{background:#9a9a9a;border-radius:50%;height:13px;margin:0 auto;position:relative;width:13px;z-index:888}.step-wheel-box .stepOut .stepItem .active{background-color:var(--c-primary-color)}.step-wheel-box .stepOut .stepItem .finished{background-color:var(--c-success-title-color)!important;border-color:var(--c-success-title-color)!important;color:var(--c-success-color)!important}.step-wheel-box .stepOut .stepItem .labelFinsh{color:var(--c-success-title-color)!important}.step-wheel-box .stepOut .stepItem .line{border-bottom:1px dashed rgba(3,2,2,.4);left:55%;position:absolute;top:6px;width:90%;z-index:111}.step-wheel-box .stepOut .stepItem .lineActive{border-bottom:1px solid var(--c-primary-color)}.step-wheel-box .stepOut .stepItem .stepTopBox{background:#e6e6e6;border-radius:4px;color:#000;cursor:pointer;height:40px;left:50%;line-height:40px;max-width:70%;min-width:73px;overflow:hidden;padding:0 5px;position:absolute;text-overflow:ellipsis;top:-48px;transform:translateX(-50%);white-space:nowrap}.step-wheel-box .stepOut .stepItem .activeTitle{background:#f1f5fe;color:var(--c-primary-color)}.step-wheel-box .stepOut .stepItem .stepTopBox_right{transform:translateX(-10%)}.step-wheel-box .stepOut .stepItem .stepTopBox_left{transform:translateX(-90%)}.step-wheel-box .stepOut .stepItem .stepBottomBox{align-items:center;cursor:pointer;display:flex;flex-direction:column;margin:8px 0 16px;min-width:73px;overflow:hidden;width:100%}.step-wheel-box .stepOut .stepItem .stepBottomBox .stepBottomCustomBox{align-items:center;display:flex;flex-direction:column;height:calc(100% - 27px);width:100%}.step-wheel-box .stepOut .stepItem .stepBottomBox .stepBottomCustomBox .stepBottomDefaultBox{align-items:center}.step-wheel-box .stepOut .stepItem .stepBottomBox .stepBottomCustomBox .alignItemsEnd{align-items:flex-end;text-align:right}.step-wheel-box .stepOut .stepItem .stepBottomBox .stepBottomCustomBox .alignItemsStart{align-items:flex-start;text-align:left}.step-wheel-box .stepOut .stepItem .stepBottomBox .alignItemsEnd{align-items:flex-end;text-align:right}.step-wheel-box .stepOut .stepItem .stepBottomBox .alignItemsStart{align-items:flex-start;text-align:left}.step-wheel-box .stepOut .stepItem .stepBottomBox_right{align-items:flex-start;left:45%;position:relative}.step-wheel-box .stepOut .stepItem .stepBottomBox_left{align-items:flex-end;left:-45%;position:relative}.step-wheel-box .stepOut .stepItem .stepLabel{color:#212121;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}.step-wheel-box .stepOut .stepItem .stepLabel_right{text-align:left}.step-wheel-box .stepOut .stepItem .stepLabel_left{text-align:right}.step-wheel-box .stepOut .stepItem .stepExtra{border:1px solid #cacaca;border-radius:4px;display:inline-block;margin:0;max-width:90%;overflow:hidden;padding:0 4px;text-overflow:ellipsis;white-space:nowrap;width:auto}.step-wheel-box .stepOut .stepItem .statusTime{color:rgba(0,0,0,.6);font-size:14px;font-weight:400;margin:0;max-width:90%}.placementRight{left:-1%;position:relative}.placementLeft{left:10%;position:relative}.nodeTipContent{margin:0;max-height:200px;max-width:400px;overflow:auto;padding:0;text-align:center}.nodeTipContent li{list-style:none;margin-bottom:5px}.nodeTipContent li p{margin:0}
@@ -111,6 +111,9 @@ declare const _default: import("vue").DefineComponent<{
111
111
  readonly type: PropType<(string | number)[] | null>;
112
112
  readonly default: null;
113
113
  };
114
+ /**
115
+ * 拖拽完成
116
+ */
114
117
  readonly disabled: {
115
118
  readonly type: PropType<boolean | undefined>;
116
119
  readonly default: undefined;
@@ -1 +1 @@
1
- import{defineComponent as e,ref as t,computed as a,watch as l,openBlock as u,createElementBlock as n,unref as o,createBlock as r,createCommentVNode as i,normalizeClass as d,withCtx as p,createTextVNode as m,toDisplayString as c}from"vue";import{NButton as v}from"naive-ui";import s from"../../../../../date-picker/index.js";import f from"moment";import{isString as y}from"lodash-es";import{WidgetOptionEnums as g}from"../../../types/enums.js";import{dateDisabledCollect as b,setDateDisabled as h,setTimeDisabled as k}from"../helpers/dateDisabled.js";import C from"./DateQuickBtn/index.vue.js";const Y={class:"render-widget-date-range"};var D=e({__name:"DateInner",props:{componentCfg:{type:Object},type:{type:String,default:"date"},clearable:{type:Boolean,default:!1},valueFormat:{type:String,default:"yyyy-MM-dd"},placeholder:{type:String,default:"请输入"},value:{type:String,default:""},unit:{type:String,default:""}},emits:["update:value","update:unit"],setup(e,{emit:D}){const M=e,S=t(),F=t(!1),j=a((()=>{let e="";switch(M.type){case"date":e="YYYY-MM-DD";break;case"datetime":e="YYYY-MM-DD HH:mm:ss"}return e})),T=a((()=>{let e="";switch(M.type){case"date":e="选择日期";break;case"datetime":e="选择时间"}return e})),w=a((()=>M.unit)),_=a((()=>{var e;return null==(e=M.componentCfg)?void 0:e.widgetCfg.optionSetting})),x=a((()=>_.value!==g.SELECT_TIME)),B=a((()=>b.curTime));function E(){x.value&&(F.value=!F.value)}function V(e){D("update:value",e)}function H(e){D("update:unit",e)}function I(e){S.value=e;const t=e?f(e).format(j.value):e;D("update:value",t)}function O(e){return h(e,_.value)}function Q(e){return k(e,_.value)}return l((()=>M.value),(e=>{e&&y(e)?S.value=f(e).valueOf():S.value=null}),{immediate:!0}),x.value||(F.value=!0),(t,a)=>(u(),n("div",Y,[o(x)&&!F.value?(u(),r(C,{key:0,componentCfg:e.componentCfg,type:e.type,dateFormat:o(j),radioValue:o(w),onClickQuickBtn:V,onChangeRadioValue:H},null,8,["componentCfg","type","dateFormat","radioValue"])):i("v-if",!0),o(x)?(u(),r(o(v),{key:1,secondary:"",class:d(F.value?"select-date-right":"select-date-left"),onClick:E},{default:p((()=>[m(c(o(T)),1)])),_:1},8,["class"])):i("v-if",!0),!o(x)||F.value?(u(),r(o(s),{key:2,to:"body",type:e.type,clearable:e.clearable,valueFormat:e.valueFormat,placeholder:e.placeholder,value:S.value,defaultTime:o(B),"is-date-disabled":O,"is-time-disabled":Q,"onUpdate:value":I},null,8,["type","clearable","valueFormat","placeholder","value","defaultTime"])):i("v-if",!0)]))}});export{D as default};
1
+ import{defineComponent as e,ref as t,computed as a,watch as l,openBlock as u,createElementBlock as r,unref as n,createBlock as o,createCommentVNode as i,normalizeClass as d,withCtx as p,createTextVNode as m,toDisplayString as v}from"vue";import{NButton as c}from"naive-ui";import s from"../../../../../date-picker/index.js";import f from"moment";import{isString as y}from"lodash-es";import{WidgetOptionEnums as g}from"../../../types/enums.js";import{dateDisabledCollect as b,setDateDisabled as h,setTimeDisabled as k}from"../helpers/dateDisabled.js";import C from"./DateQuickBtn/index.vue.js";const Y={class:"render-widget-date-range"};var D=e({__name:"DateInner",props:{componentCfg:{type:Object},type:{type:String,default:"date"},clearable:{type:Boolean,default:!1},valueFormat:{type:String,default:"yyyy-MM-dd"},placeholder:{type:String,default:"请输入"},value:{type:String,default:""},unit:{type:String,default:""}},emits:["update:value","update:unit"],setup(e,{emit:D}){const M=e,S=t(),F=t(!1),j=a((()=>{let e="";switch(M.type){case"date":e="YYYY-MM-DD";break;case"datetime":e="YYYY-MM-DD HH:mm:ss"}return e})),T=a((()=>{let e="";switch(M.type){case"date":e="选择日期";break;case"datetime":e="选择时间"}return e})),w=a((()=>M.unit)),_=a((()=>{var e;return null==(e=M.componentCfg)?void 0:e.widgetCfg.optionSetting})),x=a((()=>_.value!==g.SELECT_TIME)),B=a((()=>b.curTime));function E(){x.value&&(F.value=!F.value)}function V(e){D("update:value",e)}function H(e){D("update:unit",e)}function I(e){S.value=e;const t=e?f(e).format(j.value):e;D("update:value",t)}function O(e){return h(e,_.value)}function Q(e){return k(e,_.value)}return l((()=>M.value),(e=>{if(e&&y(e))return w.value||(F.value=!0),void(S.value=f(e).valueOf());S.value=null}),{immediate:!0}),x.value||(F.value=!0),(t,a)=>(u(),r("div",Y,[n(x)&&!F.value?(u(),o(C,{key:0,componentCfg:e.componentCfg,type:e.type,dateFormat:n(j),radioValue:n(w),onClickQuickBtn:V,onChangeRadioValue:H},null,8,["componentCfg","type","dateFormat","radioValue"])):i("v-if",!0),n(x)?(u(),o(n(c),{key:1,secondary:"",class:d(F.value?"select-date-right":"select-date-left"),onClick:E},{default:p((()=>[m(v(n(T)),1)])),_:1},8,["class"])):i("v-if",!0),!n(x)||F.value?(u(),o(n(s),{key:2,to:"body",type:e.type,clearable:e.clearable,valueFormat:e.valueFormat,placeholder:e.placeholder,value:S.value,defaultTime:n(B),"is-date-disabled":O,"is-time-disabled":Q,"onUpdate:value":I},null,8,["type","clearable","valueFormat","placeholder","value","defaultTime"])):i("v-if",!0)]))}});export{D as default};
@@ -1 +1 @@
1
- import{defineComponent as e,ref as a,computed as t,watch as l,openBlock as u,createElementBlock as r,unref as n,createBlock as i,createCommentVNode as d,normalizeClass as o,withCtx as v,createTextVNode as c,toDisplayString as m,createVNode as s,createElementVNode as p}from"vue";import{NButton as f}from"naive-ui";import y from"../../../../../date-picker/index.js";import g from"moment";import{isString as b}from"lodash-es";import{WidgetOptionEnums as h}from"../../../types/enums.js";import{dateDisabledCollect as k,isStartDateRangeDisabled as C,isTimeStartRangeDisabled as F,isEndDateRangeDisabled as M,isTimeEndRangeDisabled as S}from"../helpers/dateDisabled.js";import T from"./DateQuickBtn/index.vue.js";const Y={class:"render-widget-date-range"},D={key:2,class:"date-detail-range"},E=p("span",{class:"divider"},null,-1);var _=e({__name:"DateRangeInner",props:{componentCfg:{type:Object},type:{type:String,default:"date"},clearable:{type:Boolean,default:!1},valueFormat:{type:String,default:"yyyy-MM-dd"},startPlaceholder:{type:String,default:"起始"},endPlaceholder:{type:String,default:"截止"},value:{type:String,default:""},unit:{type:String,default:""}},emits:["update:value","update:unit"],setup(e,{emit:p}){const _=e,j=a(!1),w=a(),P=a(),I=t((()=>_.unit)),U=t((()=>{var e;return null==(e=_.componentCfg)?void 0:e.widgetCfg.optionSetting})),x=t((()=>U.value!==h.SELECT_TIME)),B=t((()=>U.value===h.PAST_TIME)),O=t((()=>U.value===h.FUTURE_TIME)),R=t((()=>{let e="";switch(_.type){case"date":e="YYYY-MM-DD";break;case"datetime":e="YYYY-MM-DD HH:mm:ss"}return e})),V=t((()=>{let e="";switch(_.type){case"date":e="选择日期";break;case"datetime":e="选择时间"}return e})),H=t((()=>O.value?k.curTime:"00:00:00")),Q=t((()=>B.value?k.curTime:"23:59:59"));function $(e){p("update:value",e)}function A(e){p("update:unit",e)}function L(){x.value&&(j.value=!j.value)}function q(e,a){switch(a){case"start":w.value=e;break;case"end":P.value=e}const t=w.value?g(w.value).format(R.value):null,l=P.value?g(P.value).format(R.value):null;p("update:value",t||l?`${null!=t?t:""} ~ ${null!=l?l:""}`:"")}function z(e){return C(e,U.value,P.value)}function G(e){return F(e,U.value,P.value)}function J(e){return M(e,U.value,w.value)}function K(e){return S(e,U.value,w.value)}return l((()=>_.value),(e=>{if(e&&b(e)&&e.includes("~")){const[a,t]=e.split("~");return a.trim()&&(w.value=g(a.trim()).valueOf()),void(t.trim()&&(P.value=g(t.trim()).valueOf()))}w.value=P.value=null,p("update:unit","")}),{immediate:!0}),x.value||(j.value=!0),(a,t)=>(u(),r("div",Y,[n(x)&&!j.value?(u(),i(T,{key:0,componentCfg:e.componentCfg,type:e.type,dateFormat:n(R),radioValue:n(I),onClickQuickBtn:$,onChangeRadioValue:A},null,8,["componentCfg","type","dateFormat","radioValue"])):d("v-if",!0),n(x)?(u(),i(n(f),{key:1,secondary:"",class:o(j.value?"select-date-right":"select-date-left"),onClick:L},{default:v((()=>[c(m(n(V)),1)])),_:1},8,["class"])):d("v-if",!0),d(' default-time="23:59:59" '),!n(x)||j.value?(u(),r("div",D,[s(n(y),{type:e.type,to:"body","default-time":n(H),clearable:e.clearable,valueFormat:e.valueFormat,placeholder:e.startPlaceholder,value:w.value,"is-date-disabled":z,"is-time-disabled":G,"onUpdate:value":t[0]||(t[0]=e=>q(e,"start"))},null,8,["type","default-time","clearable","valueFormat","placeholder","value"]),E,s(n(y),{type:e.type,to:"body","default-time":n(Q),clearable:e.clearable,valueFormat:e.valueFormat,placeholder:e.endPlaceholder,value:P.value,"is-date-disabled":J,"is-time-disabled":K,"onUpdate:value":t[1]||(t[1]=e=>q(e,"end"))},null,8,["type","default-time","clearable","valueFormat","placeholder","value"])])):d("v-if",!0)]))}});export{_ as default};
1
+ import{defineComponent as e,ref as a,computed as t,watch as l,openBlock as u,createElementBlock as r,unref as n,createBlock as i,createCommentVNode as d,normalizeClass as o,withCtx as v,createTextVNode as c,toDisplayString as m,createVNode as s,createElementVNode as p}from"vue";import{NButton as f}from"naive-ui";import y from"../../../../../date-picker/index.js";import g from"moment";import{isString as b}from"lodash-es";import{WidgetOptionEnums as h}from"../../../types/enums.js";import{dateDisabledCollect as k,isStartDateRangeDisabled as C,isTimeStartRangeDisabled as F,isEndDateRangeDisabled as M,isTimeEndRangeDisabled as S}from"../helpers/dateDisabled.js";import T from"./DateQuickBtn/index.vue.js";const Y={class:"render-widget-date-range"},D={key:2,class:"date-detail-range"},E=p("span",{class:"divider"},null,-1);var _=e({__name:"DateRangeInner",props:{componentCfg:{type:Object},type:{type:String,default:"date"},clearable:{type:Boolean,default:!1},valueFormat:{type:String,default:"yyyy-MM-dd"},startPlaceholder:{type:String,default:"起始"},endPlaceholder:{type:String,default:"截止"},value:{type:String,default:""},unit:{type:String,default:""}},emits:["update:value","update:unit"],setup(e,{emit:p}){const _=e,j=a(!1),w=a(),P=a(),I=t((()=>_.unit)),U=t((()=>{var e;return null==(e=_.componentCfg)?void 0:e.widgetCfg.optionSetting})),x=t((()=>U.value!==h.SELECT_TIME)),B=t((()=>U.value===h.PAST_TIME)),O=t((()=>U.value===h.FUTURE_TIME)),R=t((()=>{let e="";switch(_.type){case"date":e="YYYY-MM-DD";break;case"datetime":e="YYYY-MM-DD HH:mm:ss"}return e})),V=t((()=>{let e="";switch(_.type){case"date":e="选择日期";break;case"datetime":e="选择时间"}return e})),H=t((()=>O.value?k.curTime:"00:00:00")),Q=t((()=>B.value?k.curTime:"23:59:59"));function $(e){p("update:value",e)}function A(e){p("update:unit",e)}function L(){x.value&&(j.value=!j.value)}function q(e,a){switch(a){case"start":w.value=e;break;case"end":P.value=e}const t=w.value?g(w.value).format(R.value):null,l=P.value?g(P.value).format(R.value):null;p("update:value",t||l?`${null!=t?t:""} ~ ${null!=l?l:""}`:"")}function z(e){return C(e,U.value,P.value)}function G(e){return F(e,U.value,P.value)}function J(e){return M(e,U.value,w.value)}function K(e){return S(e,U.value,w.value)}return l((()=>_.value),(e=>{if(e&&b(e)&&e.includes("~")){I.value||(j.value=!0);const[a,t]=e.split("~");return a.trim()&&(w.value=g(a.trim()).valueOf()),void(t.trim()&&(P.value=g(t.trim()).valueOf()))}w.value=P.value=null,p("update:unit","")}),{immediate:!0}),x.value||(j.value=!0),(a,t)=>(u(),r("div",Y,[n(x)&&!j.value?(u(),i(T,{key:0,componentCfg:e.componentCfg,type:e.type,dateFormat:n(R),radioValue:n(I),onClickQuickBtn:$,onChangeRadioValue:A},null,8,["componentCfg","type","dateFormat","radioValue"])):d("v-if",!0),n(x)?(u(),i(n(f),{key:1,secondary:"",class:o(j.value?"select-date-right":"select-date-left"),onClick:L},{default:v((()=>[c(m(n(V)),1)])),_:1},8,["class"])):d("v-if",!0),d(' default-time="23:59:59" '),!n(x)||j.value?(u(),r("div",D,[s(n(y),{type:e.type,to:"body","default-time":n(H),clearable:e.clearable,valueFormat:e.valueFormat,placeholder:e.startPlaceholder,value:w.value,"is-date-disabled":z,"is-time-disabled":G,"onUpdate:value":t[0]||(t[0]=e=>q(e,"start"))},null,8,["type","default-time","clearable","valueFormat","placeholder","value"]),E,s(n(y),{type:e.type,to:"body","default-time":n(Q),clearable:e.clearable,valueFormat:e.valueFormat,placeholder:e.endPlaceholder,value:P.value,"is-date-disabled":J,"is-time-disabled":K,"onUpdate:value":t[1]||(t[1]=e=>q(e,"end"))},null,8,["type","default-time","clearable","valueFormat","placeholder","value"])])):d("v-if",!0)]))}});export{_ as default};
@@ -34,11 +34,14 @@ declare const _default: import("vue").DefineComponent<{
34
34
  menuProps: {
35
35
  class: string;
36
36
  };
37
- isMultiple: import("vue").ComputedRef<unknown>;
37
+ isMultiple: import("vue").ComputedRef<any>;
38
38
  dynamicOptionInfos: import("vue").ComputedRef<any>;
39
39
  isShowWhole: import("vue").ComputedRef<any>;
40
40
  isLastPage: import("vue").ComputedRef<boolean>;
41
- valueCp: import("vue").ComputedRef<string | number | any[] | null>;
41
+ valueCp: import("vue").ComputedRef<string | number | unknown[] | {
42
+ label: any;
43
+ value: any;
44
+ } | null>;
42
45
  isForbidRequest: import("vue").ComputedRef<boolean>;
43
46
  setOptionActive: (selectIds: string[]) => void;
44
47
  handleUpdateSelect: (value: string[] | null) => void;
@@ -1 +1 @@
1
- import{defineComponent as e,useAttrs as a,ref as l,inject as t,computed as n,nextTick as u,openBlock as o,createBlock as i,unref as r,mergeProps as s,isRef as v,withCtx as c,createVNode as p,h as f}from"vue";import{useMessage as m,NSelect as d,NTag as y}from"naive-ui";import{useDebounceFn as g}from"@vueuse/core";import h from"../../../hooks/useAsyncData.js";import{judgmentVariable as w}from"../helpers/setDefaultValue.js";import{WholeSelectObj as O}from"../helpers/selectExtraMap.js";import{WidgetValEnums as S}from"../../../types/enums.js";import{InjectionFilterApiConfig as b,InjectionFilterSearchConfig as j}from"../../../constants/index.js";import C from"./SelectDynamicOption/index.vue.js";import{isEqual as N,cloneDeep as A}from"lodash-es";var L=e({__name:"SelectDynamic",props:{value:{type:[Array,String,Number]},componentCfg:{type:Object}},emits:["update:value"],setup(e,{emit:L}){const P=e,k=m(),{getDynamicSelectData:x}=h(),D=a(),J=l(!1),E=t(b),I=t(j),K=l(1),T=l(),U=l([JSON.parse(JSON.stringify(O))]),W=l([]),M=l(),$=l(0),_={class:"select-dynamic-popover"},F=n((()=>D.multiple)),H=n((()=>{const{widgetCfg:e}=P.componentCfg,{dynamicOptionInfo:a={}}=e;return a})),V=n((()=>{const{widgetCfg:e}=P.componentCfg,{showWholeOption:a=!1}=e;return a&&1===K.value})),q=n((()=>$.value>0&&K.value>=$.value)),z=n((()=>{var e;if(Array.isArray(P.value)&&P.value.length>0){const e=P.value;if(G(e),!F.value&&1==e.length){const a=U.value.find((a=>a.value===e[0]));return JSON.stringify(a)}return U.value.filter((a=>e.includes(a.value)))}return G([]),null!=(e=P.value)?e:null})),B=n((()=>{if(Object.keys(H.value).length>0){const{defaultParams:e=[]}=H.value;return w(e)&&!P.value}return!1}));function G(e){U.value.forEach((a=>{a.actived=!1,Array.isArray(e)&&e.includes(a.value)&&(a.actived=!0)}))}function Q(e){const{widgetCfg:a}=P.componentCfg,{linkageFieldKeys:l=[]}=a;N(P.value,e)||(l.forEach((e=>{const a=I.value.find((a=>a.columnName===e));a&&a.value&&(a.value=null)})),L("update:value",e))}async function R(e){K.value=e,await X(M.value,K.value)}async function X(e,a){try{if(Object.keys(H.value).length>0){const{autograph:l,dataSourceId:t,dataSourceType:n,filterKeys:u,defaultParams:o=[],showKeys:i,valueKey:r}=H.value;let s={wordbookId:t,autograph:l,wordbookType:n,fieldKeys:u,page:a};u.length>0&&(s[u[0]]=e),J.value=!0;if(w(o)){const e=o.map((e=>e.value)).filter((e=>e.includes("${")));e.map((e=>e.match(/\$\{(.+?)\}/)[1])).forEach((e=>{const a=I.value.find((a=>a.columnName===e));a&&a.value&&a.value!==S.WHOLE&&(s[e]=a.value)}))}let v=await x(s,E);if(v){const{fieldList:e=[],rows:a=[],total:l=0}=v.map,t=a.map((e=>({...e,label:e[i[0]],value:e[r]}))),n=A(t);V.value&&t.unshift(JSON.parse(JSON.stringify(O))),T.value=null!=e?e:[],U.value=null!=t?t:[],W.value=n,$.value=l}}}catch(e){k.error(`异步数据源下拉框数据请求失败:${e}`),console.log(e)}finally{J.value=!1}}const Y=g((async e=>{await async function(e){M.value=e.trim(),K.value=1,await X(M.value,K.value)}(e)}),300);async function Z(){Object.keys(H.value).length>0&&E&&await X("",K.value)}async function ee(){L("update:value",null),await Z()}function ae(e){e&&Z()}function le({option:e,handleClose:a}){if(F.value){const l=e.value;return f(y,{style:{padding:"0 8px"},closable:!0,onClose:e=>{if(e.stopPropagation(),a(),Array.isArray(P.value)&&P.value.length>0){const e=P.value,a=e.indexOf(l.value);if(a>-1){const l=e.splice(0,a);L("update:value",l.length>0?l:null)}}}},{default:()=>f("div",l.label)})}const l=e.value?JSON.parse(e.value):{label:""};return f("div",l.label)}return u((()=>{B.value||Z()})),(e,a)=>(o(),i(r(d),s(r(D),{value:r(z),"onUpdate:value":a[0]||(a[0]=e=>v(z)?z.value=e:null),remote:"",loading:J.value,"render-tag":le,"menu-props":_,onSearch:r(Y),onClear:ee,"onUpdate:show":ae}),{empty:c((()=>[p(C,s(r(D),{dynamicOptionInfo:r(H),fieldTitleList:T.value,optionList:U.value,isMultiple:r(F),curPage:K.value,isLastPage:r(q),isShowWhole:r(V),onUpdateSelect:Q,onUpdatePage:R}),null,16,["dynamicOptionInfo","fieldTitleList","optionList","isMultiple","curPage","isLastPage","isShowWhole"])])),_:1},16,["value","loading","onSearch"]))}});export{L as default};
1
+ import{defineComponent as e,useAttrs as a,ref as l,inject as t,computed as n,nextTick as u,openBlock as o,createBlock as i,unref as s,mergeProps as r,isRef as c,withCtx as v,createVNode as p,h as f}from"vue";import{useMessage as m,NSelect as d,NTag as y}from"naive-ui";import{useDebounceFn as g}from"@vueuse/core";import h from"../../../hooks/useAsyncData.js";import{judgmentVariable as w}from"../helpers/setDefaultValue.js";import{WholeSelectObj as O}from"../helpers/selectExtraMap.js";import{WidgetValEnums as S}from"../../../types/enums.js";import{InjectionFilterApiConfig as b,InjectionFilterSearchConfig as j}from"../../../constants/index.js";import C from"./SelectDynamicOption/index.vue.js";import{isEqual as N,cloneDeep as A}from"lodash-es";var L=e({__name:"SelectDynamic",props:{value:{type:[Array,String,Number]},componentCfg:{type:Object}},emits:["update:value"],setup(e,{emit:L}){const P=e,k=m(),{getDynamicSelectData:x}=h(),D=a(),J=l(!1),E=t(b),I=t(j),K=l(1),$=l(),T=l([JSON.parse(JSON.stringify(O))]),U=l([]),W=l(),M=l(0),_={class:"select-dynamic-popover"},F=n((()=>D.multiple)),H=n((()=>{const{widgetCfg:e}=P.componentCfg,{dynamicOptionInfo:a={}}=e;return a})),V=n((()=>{const{widgetCfg:e}=P.componentCfg,{showWholeOption:a=!1}=e;return a&&1===K.value})),q=n((()=>M.value>0&&K.value>=M.value)),z=n((()=>{var e;if(Array.isArray(P.value)&&P.value.length>0){const e=P.value;if(G(e),!F.value&&1==e.length){const a=T.value.find((a=>a.value===e[0]));return a?JSON.stringify(a):{label:e[0].includes("&")?e[0].split("&")[0]:e[0],value:e[0]}}const a=T.value.filter((a=>e.includes(a.value))),l=a.map((e=>e.value)),t=e.filter((e=>!l.includes(e))).map((e=>({label:e.includes("&")?e.split("&")[0]:e,value:e})));return[...a,...t]}return G([]),null!=(e=P.value)?e:null})),B=n((()=>{if(Object.keys(H.value).length>0){const{defaultParams:e=[]}=H.value;return w(e)&&!P.value}return!1}));function G(e){T.value.forEach((a=>{a.actived=!1,Array.isArray(e)&&e.includes(a.value)&&(a.actived=!0)}))}function Q(e){const{widgetCfg:a}=P.componentCfg,{linkageFieldKeys:l=[]}=a;N(P.value,e)||(l.forEach((e=>{const a=I.value.find((a=>a.columnName===e));a&&a.value&&(a.value=null)})),L("update:value",e))}async function R(e){K.value=e,await X(W.value,K.value)}async function X(e,a){try{if(Object.keys(H.value).length>0){const{autograph:l,dataSourceId:t,dataSourceType:n,filterKeys:u,defaultParams:o=[],showKeys:i,valueKey:s}=H.value;let r={wordbookId:t,autograph:l,wordbookType:n,fieldKeys:u,page:a};u.length>0&&(r[u[0]]=e),J.value=!0;if(w(o)){const e=o.map((e=>e.value)).filter((e=>e.includes("${")));e.map((e=>e.match(/\$\{(.+?)\}/)[1])).forEach((e=>{const a=I.value.find((a=>a.columnName===e));a&&a.value&&a.value!==S.WHOLE&&(r[e]=a.value)}))}let c=await x(r,E);if(c){const{fieldList:e=[],rows:a=[],total:l=0}=c.map,t=a.map((e=>({...e,label:e[i[0]],value:`${e[i[0]]}&${e[s]}`}))),n=A(t);V.value&&t.unshift(JSON.parse(JSON.stringify(O))),$.value=null!=e?e:[],T.value=null!=t?t:[],U.value=n,M.value=l}}}catch(e){k.error(`异步数据源下拉框数据请求失败:${e}`),console.log(e)}finally{J.value=!1}}const Y=g((async e=>{await async function(e){W.value=e.trim(),K.value=1,await X(W.value,K.value)}(e)}),300);async function Z(){Object.keys(H.value).length>0&&E&&await X("",K.value)}async function ee(){L("update:value",null),await Z()}function ae(e){e&&Z()}function le({option:e,handleClose:a}){if(F.value){const l=e.value;return f(y,{style:{padding:"0 8px"},closable:!0,onClose:e=>{if(e.stopPropagation(),a(),Array.isArray(P.value)&&P.value.length>0){const e=P.value,a=e.indexOf(l.value);if(a>-1){const l=e.splice(0,a);L("update:value",l.length>0?l:null)}}}},{default:()=>f("div",l.label)})}const l=e.value?JSON.parse(e.value):{label:""};return f("div",l.label)}return u((()=>{B.value||Z()})),(e,a)=>(o(),i(s(d),r(s(D),{value:s(z),"onUpdate:value":a[0]||(a[0]=e=>c(z)?z.value=e:null),remote:"",loading:J.value,"render-tag":le,"menu-props":_,onSearch:s(Y),onClear:ee,"onUpdate:show":ae}),{empty:v((()=>[p(C,r(s(D),{dynamicOptionInfo:s(H),fieldTitleList:$.value,optionList:T.value,isMultiple:s(F),curPage:K.value,isLastPage:s(q),isShowWhole:s(V),onUpdateSelect:Q,onUpdatePage:R}),null,16,["dynamicOptionInfo","fieldTitleList","optionList","isMultiple","curPage","isLastPage","isShowWhole"])])),_:1},16,["value","loading","onSearch"]))}});export{L as default};
@@ -1099,11 +1099,14 @@ declare const SelectDynamic: import("vue").DefineComponent<{
1099
1099
  menuProps: {
1100
1100
  class: string;
1101
1101
  };
1102
- isMultiple: import("vue").ComputedRef<unknown>;
1102
+ isMultiple: import("vue").ComputedRef<any>;
1103
1103
  dynamicOptionInfos: import("vue").ComputedRef<any>;
1104
1104
  isShowWhole: import("vue").ComputedRef<any>;
1105
1105
  isLastPage: import("vue").ComputedRef<boolean>;
1106
- valueCp: import("vue").ComputedRef<string | number | any[] | null>;
1106
+ valueCp: import("vue").ComputedRef<string | number | unknown[] | {
1107
+ label: any;
1108
+ value: any;
1109
+ } | null>;
1107
1110
  isForbidRequest: import("vue").ComputedRef<boolean>;
1108
1111
  setOptionActive: (selectIds: string[]) => void;
1109
1112
  handleUpdateSelect: (value: string[] | null) => void;
@@ -107,11 +107,14 @@ export declare const WidgetCfgMaps: Map<string, {
107
107
  menuProps: {
108
108
  class: string;
109
109
  };
110
- isMultiple: import("vue").ComputedRef<unknown>;
110
+ isMultiple: import("vue").ComputedRef<any>;
111
111
  dynamicOptionInfos: import("vue").ComputedRef<any>;
112
112
  isShowWhole: import("vue").ComputedRef<any>;
113
113
  isLastPage: import("vue").ComputedRef<boolean>;
114
- valueCp: import("vue").ComputedRef<string | number | any[] | null>;
114
+ valueCp: import("vue").ComputedRef<string | number | unknown[] | {
115
+ label: any;
116
+ value: any;
117
+ } | null>;
115
118
  isForbidRequest: import("vue").ComputedRef<boolean>;
116
119
  setOptionActive: (selectIds: string[]) => void;
117
120
  handleUpdateSelect: (value: string[] | null) => void;