cnhis-design-vue 3.1.44-release.3 → 3.1.44-release.5

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 (225) hide show
  1. package/es/components/base-search/index.d.ts +1 -0
  2. package/es/components/base-search/src/index.vue.d.ts +1 -0
  3. package/es/components/base-search/src/index.vue.js +1 -1
  4. package/es/components/base-search/src/index.vue2.js +1 -0
  5. package/es/components/base-search/style/index.css +1 -1
  6. package/es/components/big-table/src/BigTable.vue.js +1 -1
  7. package/es/components/big-table/src/components/NoData.vue.js +1 -1
  8. package/es/components/big-table/src/components/NoData.vue2.js +1 -0
  9. package/es/components/big-table/src/components/edit-form/edit-separate.vue.js +1 -1
  10. package/es/components/big-table/src/components/edit-form/edit-separate.vue2.js +1 -0
  11. package/es/components/big-table/src/components/input-button.vue.js +1 -1
  12. package/es/components/big-table/src/components/input-button.vue2.js +1 -0
  13. package/es/components/big-table/src/components/separate.vue.js +1 -1
  14. package/es/components/big-table/src/components/separate.vue2.js +1 -0
  15. package/es/components/bpmn-workflow/src/BpmnWorkflow.vue.js +1 -1
  16. package/es/components/bpmn-workflow/src/BpmnWorkflow.vue2.js +1 -0
  17. package/es/components/button-print/src/ButtonPrint.vue.js +1 -1
  18. package/es/components/button-print/src/components/EditFormat.vue.js +1 -1
  19. package/es/components/button-print/src/components/EditFormat.vue2.js +1 -0
  20. package/es/components/button-print/src/components/IdentityVerification.vue.js +1 -1
  21. package/es/components/button-print/src/components/IdentityVerification.vue2.js +1 -0
  22. package/es/components/button-print/src/components/Preview.vue.js +1 -1
  23. package/es/components/classification/index.d.ts +2 -0
  24. package/es/components/classification/src/components/search-filter/index.vue.d.ts +2 -0
  25. package/es/components/classification/src/components/search-filter/index.vue.js +1 -1
  26. package/es/components/classification/src/components/search-filter/index.vue2.js +1 -0
  27. package/es/components/classification/src/components/set-classification/index.vue.d.ts +2 -0
  28. package/es/components/classification/src/components/set-classification/index.vue.js +1 -1
  29. package/es/components/classification/src/components/set-classification/index.vue2.js +1 -0
  30. package/es/components/classification/src/components/table-modal/index.vue.js +1 -1
  31. package/es/components/classification/src/components/table-modal/index.vue2.js +1 -0
  32. package/es/components/classification/src/index.vue.d.ts +2 -0
  33. package/es/components/classification/src/index.vue.js +1 -1
  34. package/es/components/classification/src/index.vue2.js +1 -0
  35. package/es/components/date-picker/src/DatePicker.vue.js +1 -1
  36. package/es/components/date-picker/src/DatePicker.vue2.js +1 -0
  37. package/es/components/fabric-chart/src/FabricChart.vue.js +1 -1
  38. package/es/components/fabric-chart/src/FabricChart.vue2.js +1 -0
  39. package/es/components/fabric-chart/src/components/PopupTip.vue.js +1 -1
  40. package/es/components/fabric-chart/src/components/PopupTip.vue2.js +1 -0
  41. package/es/components/fabric-chart/src/utils/utils.js +1 -1
  42. package/es/components/field-set/src/FieldSet.vue.js +1 -1
  43. package/es/components/field-set/src/FieldSet.vue2.js +1 -0
  44. package/es/components/form-config/src/FormConfig.vue.js +1 -1
  45. package/es/components/form-config/src/FormConfig.vue2.js +1 -0
  46. package/es/components/form-config/src/components/FormConfigCreator.vue.js +1 -1
  47. package/es/components/form-config/src/components/FormConfigCreator.vue2.js +1 -0
  48. package/es/components/form-config/src/components/FormConfigDragDisplay.vue.js +1 -1
  49. package/es/components/form-config/src/components/FormConfigDragDisplay.vue2.js +1 -0
  50. package/es/components/form-config/src/components/FormConfigEdit.vue.js +1 -1
  51. package/es/components/form-config/src/components/FormConfigEdit.vue2.js +1 -0
  52. package/es/components/form-config/src/components/renderer/CloseButton.vue.js +1 -1
  53. package/es/components/form-config/src/components/renderer/CloseButton.vue2.js +1 -0
  54. package/es/components/form-config/src/components/renderer/ComplexNode.vue.js +1 -1
  55. package/es/components/form-config/src/components/renderer/ComplexNode.vue2.js +1 -0
  56. package/es/components/form-config/src/components/renderer/DefaultNode.vue.js +1 -1
  57. package/es/components/form-config/src/components/renderer/DefaultNode.vue2.js +1 -0
  58. package/es/components/form-render/src/FormRender.vue.js +1 -1
  59. package/es/components/form-render/src/FormRender.vue2.js +1 -0
  60. package/es/components/form-render/src/FormRenderWrapper.vue.js +1 -1
  61. package/es/components/form-render/src/FormRenderWrapper.vue2.js +1 -0
  62. package/es/components/form-render/src/components/renderer/combination.js +1 -1
  63. package/es/components/form-render/src/components/renderer/formItem.js +1 -1
  64. package/es/components/form-render/src/components/renderer/levelSearchCascader.js +1 -1
  65. package/es/components/form-render/src/components/renderer/lineBar/FormCollapse.vue.js +1 -1
  66. package/es/components/form-render/src/components/renderer/lineBar/FormCollapse.vue2.js +1 -0
  67. package/es/components/form-render/src/components/renderer/remoteSearch.js +1 -1
  68. package/es/components/form-render/src/components/renderer/searchCascade.js +1 -1
  69. package/es/components/form-render/src/components/renderer/select.js +1 -1
  70. package/es/components/form-render/src/components/tooltipMessage.vue.js +1 -1
  71. package/es/components/form-render/src/components/tooltipMessage.vue2.js +1 -0
  72. package/es/components/form-render/src/hooks/useComplexOptions.js +1 -1
  73. package/es/components/guide/src/renderer.js +1 -1
  74. package/es/components/iho-select-label/index.d.ts +5 -0
  75. package/es/components/iho-select-label/src/LabelFormContent.vue.js +1 -1
  76. package/es/components/iho-select-label/src/LabelFormContent.vue2.js +1 -0
  77. package/es/components/iho-select-label/src/SelectLabel.vue.d.ts +5 -0
  78. package/es/components/iho-select-label/src/SelectLabel.vue.js +1 -1
  79. package/es/components/iho-select-label/src/SelectLabel.vue2.js +1 -0
  80. package/es/components/iho-select-label/src/components/label-classify.vue.js +1 -1
  81. package/es/components/iho-select-label/src/components/label-classify.vue2.js +1 -0
  82. package/es/components/iho-select-label/style/index.css +1 -1
  83. package/es/components/iho-table/index.d.ts +2 -0
  84. package/es/components/iho-table/src/IhoTable.vue.d.ts +2 -0
  85. package/es/components/iho-table/src/IhoTable.vue.js +1 -1
  86. package/es/components/iho-table/src/IhoTable.vue2.js +1 -0
  87. package/es/components/iho-table/src/plugins/defaultConfigPlugin/index.js +1 -1
  88. package/es/components/iho-table/src/plugins/filterDaterangeRenderPlugin/filter.vue.js +1 -1
  89. package/es/components/iho-table/src/plugins/filterDaterangeRenderPlugin/filter.vue2.js +1 -0
  90. package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue.js +1 -1
  91. package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue2.js +1 -0
  92. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue.js +1 -1
  93. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue2.js +1 -0
  94. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/numberRendererPlugin.js +1 -1
  95. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/editSeparate.vue.js +1 -1
  96. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/editSeparate.vue2.js +1 -0
  97. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue.js +1 -1
  98. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue2.js +1 -0
  99. package/es/components/iho-table/src/plugins/rendererPlugins/widgets/pictureRendererPlugin.js +1 -1
  100. package/es/components/iho-table/src/plugins/varialbleHeightPlugin/index.js +1 -1
  101. package/es/components/iho-table/src/types/index.d.ts +2 -0
  102. package/es/components/iho-table/src/utils/index.js +1 -1
  103. package/es/components/index.css +1 -1
  104. package/es/components/info-header/src/InfoHeader.vue.js +1 -1
  105. package/es/components/info-header/src/InfoHeader.vue2.js +1 -0
  106. package/es/components/info-header/src/components/infoDescription/DescriptionItem.vue.js +1 -1
  107. package/es/components/info-header/src/components/infoDescription/DescriptionItem.vue2.js +1 -0
  108. package/es/components/info-header/src/components/infoDescription/DescriptionList.vue.js +1 -1
  109. package/es/components/info-header/src/components/infoDescription/DescriptionList.vue2.js +1 -0
  110. package/es/components/info-header/src/components/infoDescription/HiddenContent.vue.js +1 -1
  111. package/es/components/info-header/src/components/infoDescription/HiddenContent.vue2.js +1 -0
  112. package/es/components/info-header/src/components/infoDescription/InfoEllipsis.vue.js +1 -1
  113. package/es/components/info-header/src/components/infoDescription/InfoEllipsis.vue2.js +1 -0
  114. package/es/components/info-header/src/components/infoDescription/index.vue.js +1 -1
  115. package/es/components/info-header/src/components/infoDescription/index.vue2.js +1 -0
  116. package/es/components/info-header/src/components/patientInfo/index.vue.js +1 -1
  117. package/es/components/info-header/src/components/patientInfo/index.vue2.js +1 -0
  118. package/es/components/keyboard/src/Keyboard.vue.js +1 -1
  119. package/es/components/keyboard/src/Keyboard.vue2.js +1 -0
  120. package/es/components/keyboard/src/components/InputNumber.vue.js +1 -1
  121. package/es/components/keyboard/src/components/InputNumber.vue2.js +1 -0
  122. package/es/components/keyboard/src/components/NumberPanel.vue.js +1 -1
  123. package/es/components/keyboard/src/components/NumberPanel.vue2.js +1 -0
  124. package/es/components/map/src/Map.vue.js +1 -1
  125. package/es/components/map/src/Map.vue2.js +1 -0
  126. package/es/components/quick-search/index.d.ts +1 -0
  127. package/es/components/quick-search/src/index.vue.d.ts +1 -0
  128. package/es/components/quick-search/src/index.vue.js +1 -1
  129. package/es/components/quick-search/src/index.vue2.js +1 -0
  130. package/es/components/quick-search/style/index.css +1 -1
  131. package/es/components/recommend-search/src/RecommendSearch.vue.js +1 -1
  132. package/es/components/recommend-search/src/RecommendSearch.vue2.js +1 -0
  133. package/es/components/recommend-search/src/components/RecommendInput.vue.js +1 -1
  134. package/es/components/recommend-search/src/components/RecommendInput.vue2.js +1 -0
  135. package/es/components/recommend-search/src/components/RecommendMenu.vue.js +1 -1
  136. package/es/components/recommend-search/src/components/RecommendMenu.vue2.js +1 -0
  137. package/es/components/recommend-search/src/components/RecommendSelect.vue.js +1 -1
  138. package/es/components/recommend-search/src/components/RecommendSelect.vue2.js +1 -0
  139. package/es/components/scale-view/src/ScaleView.vue.js +1 -1
  140. package/es/components/scale-view/src/ScaleView.vue2.js +1 -0
  141. package/es/components/scale-view/src/components/AnswerParse.vue.js +1 -1
  142. package/es/components/scale-view/src/components/AnswerParse.vue2.js +1 -0
  143. package/es/components/scale-view/src/components/EvaluateCountdown.vue.js +1 -1
  144. package/es/components/scale-view/src/components/EvaluateCountdown.vue2.js +1 -0
  145. package/es/components/scale-view/src/components/EvaluatePage.vue.js +1 -1
  146. package/es/components/scale-view/src/components/EvaluatePage.vue2.js +1 -0
  147. package/es/components/scale-view/src/components/LoadingCom.vue.js +1 -1
  148. package/es/components/scale-view/src/components/NoData.vue.js +1 -1
  149. package/es/components/scale-view/src/components/NoData.vue2.js +1 -0
  150. package/es/components/search-cascader/src/SearchCascader.vue.js +1 -1
  151. package/es/components/search-cascader/src/SearchCascader.vue2.js +1 -0
  152. package/es/components/search-cascader/src/components/SearchMenu.js +1 -1
  153. package/es/components/select-label/src/LabelFormContent.vue.js +1 -1
  154. package/es/components/select-label/src/LabelFormContent.vue2.js +1 -0
  155. package/es/components/select-label/src/SelectLabel.vue.js +1 -1
  156. package/es/components/select-label/src/components/label-classify.vue.js +1 -1
  157. package/es/components/select-label/src/components/label-classify.vue2.js +1 -0
  158. package/es/components/select-person/src/SearchMultiple.vue.js +1 -1
  159. package/es/components/select-person/src/SelectPerson.vue.js +1 -1
  160. package/es/components/shortcut-provider/src/ShortcutProvider.vue.js +1 -1
  161. package/es/components/shortcut-provider/src/ShortcutProvider.vue2.js +1 -0
  162. package/es/components/shortcut-setter/src/ShortcutSetter.vue.js +1 -1
  163. package/es/components/shortcut-setter/src/ShortcutSetter.vue2.js +1 -0
  164. package/es/components/shortcut-setter/src/ShortcutSetterItem.vue.js +1 -1
  165. package/es/components/shortcut-setter/src/ShortcutSetterItem.vue2.js +1 -0
  166. package/es/components/steps-wheel/src/StepsWheel.vue.js +1 -1
  167. package/es/components/steps-wheel/src/StepsWheel.vue2.js +1 -0
  168. package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue.d.ts +2 -0
  169. package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue.js +1 -1
  170. package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue2.js +1 -0
  171. package/es/components/table-filter/src/components/classify-filter/index.vue.d.ts +2 -0
  172. package/es/components/table-filter/src/components/classify-filter/index.vue.js +1 -1
  173. package/es/components/table-filter/src/components/classify-filter/index.vue2.js +1 -0
  174. package/es/components/table-filter/src/components/render-widget/components/CheckboxGroup.vue.js +1 -1
  175. package/es/components/table-filter/src/components/render-widget/components/CheckboxGroup.vue2.js +1 -0
  176. package/es/components/table-filter/src/components/render-widget/components/Date.vue.js +1 -1
  177. package/es/components/table-filter/src/components/render-widget/components/Date.vue2.js +1 -0
  178. package/es/components/table-filter/src/components/render-widget/components/DateRangeInner.vue.js +1 -1
  179. package/es/components/table-filter/src/components/render-widget/components/DateRangeInner.vue2.js +1 -0
  180. package/es/components/table-filter/src/components/render-widget/components/DateRangeOut.vue.js +1 -1
  181. package/es/components/table-filter/src/components/render-widget/components/DateRangeOut.vue2.js +1 -0
  182. package/es/components/table-filter/src/components/render-widget/components/InputNumberGroup.vue.js +1 -1
  183. package/es/components/table-filter/src/components/render-widget/components/InputNumberGroup.vue2.js +1 -0
  184. package/es/components/table-filter/src/components/render-widget/components/Label.vue.d.ts +70 -0
  185. package/es/components/table-filter/src/components/render-widget/components/Label.vue.js +1 -0
  186. package/es/components/table-filter/src/components/render-widget/components/Label.vue2.js +1 -0
  187. package/es/components/table-filter/src/components/render-widget/components/Select.vue.js +1 -1
  188. package/es/components/table-filter/src/components/render-widget/components/Select.vue2.js +1 -0
  189. package/es/components/table-filter/src/components/render-widget/components/SelectLabel.vue.d.ts +56 -0
  190. package/es/components/table-filter/src/components/render-widget/components/SelectLabel.vue.js +1 -0
  191. package/es/components/table-filter/src/components/render-widget/components/SelectLabel.vue2.js +1 -0
  192. package/es/components/table-filter/src/components/render-widget/components/index.d.ts +3 -1
  193. package/es/components/table-filter/src/components/render-widget/components/index.js +1 -1
  194. package/es/components/table-filter/src/components/render-widget/index.vue.js +1 -1
  195. package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +145 -0
  196. package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.js +1 -1
  197. package/es/components/table-filter/src/directive/resize.d.ts +4 -0
  198. package/es/components/table-filter/src/directive/resize.js +1 -0
  199. package/es/components/table-filter/src/hooks/useAdvanced.d.ts +1 -0
  200. package/es/components/table-filter/src/hooks/useAdvanced.js +1 -1
  201. package/es/components/table-filter/src/hooks/useRenderWidget.js +1 -1
  202. package/es/components/table-filter/src/tool/resizeSensor.d.ts +16 -0
  203. package/es/components/table-filter/src/tool/resizeSensor.js +1 -0
  204. package/es/components/table-filter/src/types/enums.d.ts +2 -0
  205. package/es/components/table-filter/src/types/enums.js +1 -1
  206. package/es/components/table-filter/src/types/index.d.ts +14 -0
  207. package/es/components/time-line/src/TimeLine.vue.js +1 -1
  208. package/es/components/time-line/src/TimeLine.vue2.js +1 -0
  209. package/es/components/time-picker/src/TimePicker.vue.js +1 -1
  210. package/es/components/time-picker/src/TimePicker.vue2.js +1 -0
  211. package/es/components/vod-chunk-upload/src/chunk-upload-new.vue.js +1 -1
  212. package/es/components/vod-chunk-upload/src/chunk-upload-new.vue2.js +1 -0
  213. package/es/components/vod-chunk-upload/src/vod-chunk-upload/vod-chunk-upload.vue.js +1 -1
  214. package/es/components/vod-chunk-upload/src/vod-chunk-upload/vod-chunk-upload.vue2.js +1 -0
  215. package/es/shared/components/SelectPage/SelectPage.vue.js +1 -1
  216. package/es/shared/components/SelectPage/SelectPage.vue2.js +1 -0
  217. package/es/shared/components/SvgIcon/SvgIcon.vue.js +1 -1
  218. package/es/shared/components/SvgIcon/SvgIcon.vue2.js +1 -0
  219. package/es/shared/components/TextOverTooltip/TextOverTooltip.vue.js +1 -1
  220. package/es/shared/components/TextOverTooltip/TextOverTooltip.vue2.js +1 -0
  221. package/es/shared/components/no-data/NoData.vue.js +1 -1
  222. package/es/shared/components/no-data/NoData.vue2.js +1 -0
  223. package/es/shared/package.json.js +1 -1
  224. package/package.json +2 -2
  225. /package/es/_virtual/{plugin-vue_export-helper.js → _plugin-vue_export-helper.js} +0 -0
@@ -0,0 +1 @@
1
+ import{defineComponent as e,ref as o,provide as r,toRaw as t,openBlock as i,createElementBlock as a,normalizeStyle as n,unref as s,createElementVNode as m,createVNode as l,mergeProps as f,withCtx as c,createTextVNode as u}from"vue";import{useTheme as d}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{cloneDeep as p,isArray as g,isFunction as h}from"lodash-es";import{uuidGenerator as v}from"../../../shared/utils/index.js";import _ from"../../../shared/components/VueDraggable/src/vuedraggable.js";import C from"./components/FormConfigCreator.vue.js";import j from"./components/FormConfigDragDisplay.vue.js";import y from"./components/FormConfigEdit.vue.js";import x from"./components/FormConfigMaterialItem.js";import{useDataNormalize as F}from"./hooks/useDataNormalize.js";import{InjectionFieldList as V,InjectionMaterialList as b,InjectionActiveFieldItem as k,FORM_CONFIG_GROUP as D}from"./constants/index.js";import"@vicons/ionicons5";import"naive-ui";import"./utils/index.js";import{useSortableConfig as R}from"./hooks/useSortalbeConfig.js";import"./hooks/useConfigurationField.js";const E=["id"],H={class:"form-config__material"},I=m("header",{class:"form-config__materialHeader"},"物料区",-1),L={class:"form-config__displayWrapper"},N={class:"form-config__displayHeader"},O={class:"form-config__config"},S=m("header",{class:"form-config__configHeader"},"配置区",-1),T={class:"form-config__configContent"};var A=e({__name:"FormConfig",props:{maxHeight:{type:String},fieldVisitor:{type:Object},textFormatter:{type:Function},formRenderRef:{type:Object}},setup(e,{expose:A}){const B=e,M=v(),U=d(),{getCommonConfig:w}=R(),z=o([]);r(V,z);const W=o([]);function q(e){z.value.some((o=>o.key===e.key))||z.value.push(e)}r(b,W);const G=(e,o)=>h(B.textFormatter)?B.textFormatter(e,o):o,J=o();r(k,J);const K=o(),{transform:P,inverseTransform:Q}=F(B);return A({loadData({fieldList:e}){let o=[],r=[];e.forEach((e=>function(e){"LINE_BAR"===e.type&&(e.children=[]);!1===e.show?r.push(e):o.push(e),"COMBINATION"===e.type&&g(e.children)&&e.children.length&&e.children.forEach((e=>{e.__isCombinationChild=!0}))}(p(t(e))))),z.value=P(o),W.value=r,J.value=void 0},validate(){var e;return null==(e=K.value)?void 0:e.validate()},getData:()=>({fieldList:Q(p(t(z.value))),materialList:Q(p(t(W.value)))})}),(o,r)=>(i(),a("section",{class:"form-config",style:n({"--max-height":e.maxHeight,...s(U)}),id:s(M)},[m("section",H,[I,l(s(_),f(s(w)(),{class:"form-config__materialContent",modelValue:W.value,"onUpdate:modelValue":r[0]||(r[0]=e=>W.value=e)}),{item:c((({element:e})=>[l(s(x),{"form-config-item":e,"text-formatter":G},null,8,["form-config-item"])])),_:1},16,["modelValue"])]),m("section",L,[m("header",N,[u(" 布局区 "),l(C,{onSubmit:q})]),l(j,{class:"form-config__displayContent",group:s(D),"text-formatter":G,modelValue:z.value,"onUpdate:modelValue":r[1]||(r[1]=e=>z.value=e)},null,8,["group","modelValue"])]),m("section",O,[S,m("section",T,[l(y,{ref_key:"formConfigEditRef",ref:K,uuid:s(M),"form-render-ref":e.formRenderRef},null,8,["uuid","form-render-ref"])])])],12,E))}});export{A as default};
@@ -1 +1 @@
1
- import{defineComponent as e,ref as i,openBlock as t,createBlock as l,unref as o,withCtx as a,createVNode as r,createTextVNode as n}from"vue";import{pick as s}from"lodash-es";import{NButtonGroup as u,NPopconfirm as m,NButton as f}from"naive-ui";import{EditAbleField as d}from"../constants/index.js";import{useConfigurationField as _}from"../hooks/useConfigurationField.js";import"../../../index.js";import p from"../../../../_virtual/plugin-vue_export-helper.js";import L from"../../../form-render/index.js";var c=p(e({__name:"FormConfigCreator",emits:{submit:e=>e},setup(e,{emit:p}){const c=_().generateFieldListByKeys([d.NAME,d.LAYOUT_WIDTH_ENUM,d.NOTES,d.DEFAULT_EXPAND,d.FOLD]),h=i(),E=i(),w={defaultExpand:!0,fold:!0,layoutWidthEnum:"ALL_LINE"};async function v(e,i){if(!i)return;await i.validate();const t=i.getFormValues();p("submit",{layoutWidthEnum:"ALL_LINE",...t,type:e,key:t.name,__new:!0})}return(e,i)=>(t(),l(o(u),{size:"small"},{default:a((()=>[r(o(m),{width:"200px","show-icon":!1,"show-arrow":!1,onPositiveClick:i[0]||(i[0]=e=>v("NEWLINE",E.value))},{trigger:a((()=>[r(o(f),null,{default:a((()=>[n("新建分行符")])),_:1})])),default:a((()=>[r(o(L),{column:12,ref_key:"lineBreakFormRef",ref:E,"initial-data":o(s)(w,["layoutWidthEnum"]),size:"small","label-width":"auto","label-placement":"left",fieldList:o(c).slice(0,2)},null,8,["initial-data","fieldList"])])),_:1}),r(o(m),{width:"300px","show-icon":!1,"show-arrow":!1,onPositiveClick:i[1]||(i[1]=e=>v("LINE_BAR",h.value))},{trigger:a((()=>[r(o(f),null,{default:a((()=>[n("新建分线栏")])),_:1})])),default:a((()=>[r(o(L),{column:12,ref_key:"linebarFormRef",ref:h,"initial-data":w,size:"small","label-width":"auto","label-placement":"left",fieldList:o(c)},null,8,["fieldList"])])),_:1})])),_:1}))}}),[["__file","FormConfigCreator.vue"]]);export{c as default};
1
+ import r from"./FormConfigCreator.vue2.js";import o from"../../../../_virtual/_plugin-vue_export-helper.js";var e=o(r,[["__file","FormConfigCreator.vue"]]);export{e as default};
@@ -0,0 +1 @@
1
+ import{defineComponent as e,ref as i,openBlock as t,createBlock as l,unref as a,withCtx as o,createVNode as r,createTextVNode as n}from"vue";import{pick as s}from"lodash-es";import{NButtonGroup as m,NPopconfirm as u,NButton as d}from"naive-ui";import{EditAbleField as f}from"../constants/index.js";import{useConfigurationField as _}from"../hooks/useConfigurationField.js";import"../../../index.js";import L from"../../../form-render/index.js";var p=e({__name:"FormConfigCreator",emits:{submit:e=>e},setup(e,{emit:p}){const c=_().generateFieldListByKeys([f.NAME,f.LAYOUT_WIDTH_ENUM,f.NOTES,f.DEFAULT_EXPAND,f.FOLD]),E=i(),h=i(),w={defaultExpand:!0,fold:!0,layoutWidthEnum:"ALL_LINE"};async function y(e,i){if(!i)return;await i.validate();const t=i.getFormValues();p("submit",{layoutWidthEnum:"ALL_LINE",...t,type:e,key:t.name,__new:!0})}return(e,i)=>(t(),l(a(m),{size:"small"},{default:o((()=>[r(a(u),{width:"200px","show-icon":!1,"show-arrow":!1,onPositiveClick:i[0]||(i[0]=e=>y("NEWLINE",h.value))},{trigger:o((()=>[r(a(d),null,{default:o((()=>[n("新建分行符")])),_:1})])),default:o((()=>[r(a(L),{column:12,ref_key:"lineBreakFormRef",ref:h,"initial-data":a(s)(w,["layoutWidthEnum"]),size:"small","label-width":"auto","label-placement":"left",fieldList:a(c).slice(0,2)},null,8,["initial-data","fieldList"])])),_:1}),r(a(u),{width:"300px","show-icon":!1,"show-arrow":!1,onPositiveClick:i[1]||(i[1]=e=>y("LINE_BAR",E.value))},{trigger:o((()=>[r(a(d),null,{default:o((()=>[n("新建分线栏")])),_:1})])),default:o((()=>[r(a(L),{column:12,ref_key:"linebarFormRef",ref:E,"initial-data":w,size:"small","label-width":"auto","label-placement":"left",fieldList:a(c)},null,8,["fieldList"])])),_:1})])),_:1}))}});export{p as default};
@@ -1 +1 @@
1
- import{defineComponent as e,openBlock as t,createBlock as r,unref as o,mergeProps as i,withCtx as m,createElementVNode as n,normalizeStyle as a,resolveDynamicComponent as s}from"vue";import f from"../../../../shared/components/VueDraggable/src/vuedraggable.js";import{usePresetRenderer as u}from"../hooks/usePresetRenderer.js";import{useSortableConfig as p}from"../hooks/useSortalbeConfig.js";import"../hooks/useConfigurationField.js";import{layoutWidthEnum2Column as l}from"../utils/index.js";import g from"../../../../_virtual/plugin-vue_export-helper.js";const d=["data-type","data-required"];var c=g(e({__name:"FormConfigDragDisplay",props:{formConfigItem:{type:Object},textFormatter:{type:Function,required:!0}},setup(e){function g(e){return{"--item-column":e?l(e.layoutWidthEnum):24}}const{getRenderer:c}=u(),{getCommonConfig:y}=p();return(u,p)=>(t(),r(o(f),i(o(y)(e.formConfigItem),{style:g(e.formConfigItem)}),{item:m((({element:i})=>[n("div",{class:"form-config__displayContentItem","data-type":i.type,"data-required":i.required,style:a(g(i))},[(t(),r(s(o(c)(i)),{"form-config-item":i,textFormatter:e.textFormatter},null,8,["form-config-item","textFormatter"]))],12,d)])),_:1},16,["style"]))}}),[["__file","FormConfigDragDisplay.vue"]]);export{c as default};
1
+ import r from"./FormConfigDragDisplay.vue2.js";import o from"../../../../_virtual/_plugin-vue_export-helper.js";var e=o(r,[["__file","FormConfigDragDisplay.vue"]]);export{e as default};
@@ -0,0 +1 @@
1
+ import{defineComponent as e,openBlock as t,createBlock as o,unref as r,mergeProps as m,withCtx as i,createElementVNode as n,normalizeStyle as a,resolveDynamicComponent as s}from"vue";import f from"../../../../shared/components/VueDraggable/src/vuedraggable.js";import{usePresetRenderer as u}from"../hooks/usePresetRenderer.js";import{useSortableConfig as d}from"../hooks/useSortalbeConfig.js";import"../hooks/useConfigurationField.js";import{layoutWidthEnum2Column as p}from"../utils/index.js";const g=["data-type","data-required"];var l=e({__name:"FormConfigDragDisplay",props:{formConfigItem:{type:Object},textFormatter:{type:Function,required:!0}},setup(e){function l(e){return{"--item-column":e?p(e.layoutWidthEnum):24}}const{getRenderer:c}=u(),{getCommonConfig:y}=d();return(u,d)=>(t(),o(r(f),m(r(y)(e.formConfigItem),{style:l(e.formConfigItem)}),{item:i((({element:m})=>[n("div",{class:"form-config__displayContentItem","data-type":m.type,"data-required":m.required,style:a(l(m))},[(t(),o(s(r(c)(m)),{"form-config-item":m,textFormatter:e.textFormatter},null,8,["form-config-item","textFormatter"]))],12,g)])),_:1},16,["style"]))}});export{l as default};
@@ -1 +1 @@
1
- import{defineComponent as e,computed as o,ref as i,inject as l,watch as t,toRaw as a,openBlock as r,createElementBlock as n,Fragment as u,createVNode as s,unref as m,nextTick as d}from"vue";import{cloneDeep as v}from"lodash-es";import{InjectionActiveFieldItem as f}from"../constants/index.js";import"../../../../shared/components/VueDraggable/src/vuedraggable.js";import{findFieldItemByKey as p}from"../utils/index.js";import c from"../../../../_virtual/plugin-vue_export-helper.js";import"@vicons/ionicons5";import{NModal as g}from"naive-ui";import"../../../../shared/utils/index.js";import{useConfigurationField as h}from"../hooks/useConfigurationField.js";import"../../../index.js";import j from"../../../form-render/index.js";var x=c(e({__name:"FormConfigEdit",props:{uuid:{type:String,required:!0},formRenderRef:{type:Object}},setup(e,{expose:c}){const x=e,y=o((()=>`#${x.uuid} .form-config__config`)),_=i(),F=l(f),b=i([]),w=i({}),{generateFieldListByFormConfigItem:C}=h(),R=i(!1);async function k(){var e;F.value=P,await d(),null==(e=_.value)||e.validate()}let P=null;function E({fieldKey:e,value:o}){F.value&&(F.value[e]=o)}return t(F,(async(e,o)=>{var i,l,t;if(!e)return b.value=[];if(o&&e!==P)try{await(null==(i=_.value)?void 0:i.validate())}catch(e){return R.value=!0}P=e,w.value={editable:!0,show:!0,...v(a(e))};const r=null==(l=x.formRenderRef)?void 0:l.getFieldList();b.value=C(e,p(r,e.key)).map((e=>({...e,componentProps:{...e.componentProps,to:y.value}}))),null==(t=_.value)||t.reload()}),{immediate:!0}),c({validate(){var e;return null==(e=_.value)?void 0:e.validate()}}),(e,o)=>(r(),n(u,null,[s(m(j),{column:12,ref_key:"formRenderRef",ref:_,size:"small",onFormChange:E,"field-list":b.value,"initial-data":w.value},null,8,["field-list","initial-data"]),s(m(g),{show:R.value,"onUpdate:show":o[0]||(o[0]=e=>R.value=e),preset:"dialog",to:m(y),"close-on-esc":!1,"mask-closable":!1,closable:!1,title:"存在填写错误的字段","positive-text":"继续编辑",onPositiveClick:k},null,8,["show","to"])],64))}}),[["__file","FormConfigEdit.vue"]]);export{x as default};
1
+ import r from"./FormConfigEdit.vue2.js";import o from"../../../../_virtual/_plugin-vue_export-helper.js";var e=o(r,[["__file","FormConfigEdit.vue"]]);export{e as default};
@@ -0,0 +1 @@
1
+ import{defineComponent as e,computed as o,ref as i,inject as l,watch as t,toRaw as a,openBlock as r,createElementBlock as n,Fragment as s,createVNode as u,unref as d,nextTick as m}from"vue";import{cloneDeep as v}from"lodash-es";import{InjectionActiveFieldItem as f}from"../constants/index.js";import"../../../../shared/components/VueDraggable/src/vuedraggable.js";import{findFieldItemByKey as p}from"../utils/index.js";import"@vicons/ionicons5";import{NModal as c}from"naive-ui";import"../../../../shared/utils/index.js";import{useConfigurationField as g}from"../hooks/useConfigurationField.js";import"../../../index.js";import h from"../../../form-render/index.js";var y=e({__name:"FormConfigEdit",props:{uuid:{type:String,required:!0},formRenderRef:{type:Object}},setup(e,{expose:y}){const j=e,x=o((()=>`#${j.uuid} .form-config__config`)),b=i(),w=l(f),F=i([]),R=i({}),{generateFieldListByFormConfigItem:k}=g(),C=i(!1);async function _(){var e;w.value=P,await m(),null==(e=b.value)||e.validate()}let P=null;function L({fieldKey:e,value:o}){w.value&&(w.value[e]=o)}return t(w,(async(e,o)=>{var i,l,t;if(!e)return F.value=[];if(o&&e!==P)try{await(null==(i=b.value)?void 0:i.validate())}catch(e){return C.value=!0}P=e,R.value={editable:!0,show:!0,...v(a(e))};const r=null==(l=j.formRenderRef)?void 0:l.getFieldList();F.value=k(e,p(r,e.key)).map((e=>({...e,componentProps:{...e.componentProps,to:x.value}}))),null==(t=b.value)||t.reload()}),{immediate:!0}),y({validate(){var e;return null==(e=b.value)?void 0:e.validate()}}),(e,o)=>(r(),n(s,null,[u(d(h),{column:12,ref_key:"formRenderRef",ref:b,size:"small",onFormChange:L,"field-list":F.value,"initial-data":R.value},null,8,["field-list","initial-data"]),u(d(c),{show:C.value,"onUpdate:show":o[0]||(o[0]=e=>C.value=e),preset:"dialog",to:d(x),"close-on-esc":!1,"mask-closable":!1,closable:!1,title:"存在填写错误的字段","positive-text":"继续编辑",onPositiveClick:_},null,8,["show","to"])],64))}});export{y as default};
@@ -1 +1 @@
1
- import{defineComponent as o,inject as e,openBlock as t,createBlock as r,unref as n,withModifiers as i,withCtx as m,createVNode as s}from"vue";import{CloseCircle as l}from"@vicons/ionicons5";import{isArray as p}from"lodash-es";import{NButton as u,NIcon as c}from"naive-ui";import{InjectionFieldList as f,InjectionMaterialList as a}from"../../constants/index.js";import _ from"../../../../../_virtual/plugin-vue_export-helper.js";var v=_(o({__name:"CloseButton",props:{formConfigItem:{type:Object,required:!0}},setup(o){const _=o,v=e(f),d=e(a),C=()=>{!function o(e){return p(e)&&e.some(((e,t,r)=>e!==_.formConfigItem?o(e.children):(!e.__new&&d.value.push(e),r.splice(t,1))))}(v.value)};return(o,e)=>(t(),r(n(u),{text:"",class:"form-config__renderer--closeButton","text-color":"#a5a5a5",onClick:i(C,["stop"])},{icon:m((()=>[s(n(c),{component:n(l)},null,8,["component"])])),_:1},8,["onClick"]))}}),[["__file","CloseButton.vue"]]);export{v as default};
1
+ import e from"./CloseButton.vue2.js";import o from"../../../../../_virtual/_plugin-vue_export-helper.js";var t=o(e,[["__file","CloseButton.vue"]]);export{t as default};
@@ -0,0 +1 @@
1
+ import{defineComponent as o,inject as e,openBlock as n,createBlock as t,unref as r,withModifiers as i,withCtx as m,createVNode as s}from"vue";import{CloseCircle as c}from"@vicons/ionicons5";import{isArray as p}from"lodash-es";import{NButton as l,NIcon as u}from"naive-ui";import{InjectionFieldList as a,InjectionMaterialList as f}from"../../constants/index.js";var _=o({__name:"CloseButton",props:{formConfigItem:{type:Object,required:!0}},setup(o){const _=o,d=e(a),v=e(f),C=()=>{!function o(e){return p(e)&&e.some(((e,n,t)=>e!==_.formConfigItem?o(e.children):(!e.__new&&v.value.push(e),t.splice(n,1))))}(d.value)};return(o,e)=>(n(),t(r(l),{text:"",class:"form-config__renderer--closeButton","text-color":"#a5a5a5",onClick:i(C,["stop"])},{icon:m((()=>[s(r(u),{component:r(c)},null,8,["component"])])),_:1},8,["onClick"]))}});export{_ as default};
@@ -1 +1 @@
1
- import{defineComponent as e,inject as o,computed as r,openBlock as m,createElementBlock as n,createElementVNode as t,mergeProps as i,unref as f,withModifiers as l,createTextVNode as s,toDisplayString as c,createVNode as p}from"vue";import u from"../FormConfigDragDisplay.vue.js";import a from"./CloseButton.vue.js";import{InjectionActiveFieldItem as d}from"../../constants/index.js";import{bindHover as g}from"../../utils/index.js";import C from"../../../../../_virtual/plugin-vue_export-helper.js";const _={class:"form-config__renderer--complex form-config__renderer"},v=["onClick"];var x=C(e({__name:"ComplexNode",props:{formConfigItem:{type:Object,required:!0},textFormatter:{type:Function,required:!0}},setup(e){const C=e,x=o(d);function I(){x.value=C.formConfigItem}const j=r((()=>[{"is-active":x.value===C.formConfigItem},"form-config__renderer--complexHeader"]));return(o,r)=>(m(),n("section",_,[t("header",i(f(g)(e.formConfigItem),{class:f(j),onClick:l(I,["stop"])}),[s(c(C.formConfigItem.name)+" ",1),p(a,{"form-config-item":e.formConfigItem},null,8,["form-config-item"])],16,v),p(u,i(o.$props,{modelValue:e.formConfigItem.children,"onUpdate:modelValue":r[0]||(r[0]=o=>e.formConfigItem.children=o),class:"form-config__renderer--complex--grid"}),null,16,["modelValue"])]))}}),[["__file","ComplexNode.vue"]]);export{x as default};
1
+ import e from"./ComplexNode.vue2.js";import o from"../../../../../_virtual/_plugin-vue_export-helper.js";var r=o(e,[["__file","ComplexNode.vue"]]);export{r as default};
@@ -0,0 +1 @@
1
+ import{defineComponent as e,inject as o,computed as r,openBlock as m,createElementBlock as n,createElementVNode as t,mergeProps as i,unref as f,withModifiers as l,createTextVNode as c,toDisplayString as s,createVNode as a}from"vue";import p from"../FormConfigDragDisplay.vue.js";import d from"./CloseButton.vue.js";import{InjectionActiveFieldItem as u}from"../../constants/index.js";import{bindHover as g}from"../../utils/index.js";const C={class:"form-config__renderer--complex form-config__renderer"},_=["onClick"];var x=e({__name:"ComplexNode",props:{formConfigItem:{type:Object,required:!0},textFormatter:{type:Function,required:!0}},setup(e){const x=e,I=o(u);function v(){I.value=x.formConfigItem}const j=r((()=>[{"is-active":I.value===x.formConfigItem},"form-config__renderer--complexHeader"]));return(o,r)=>(m(),n("section",C,[t("header",i(f(g)(e.formConfigItem),{class:f(j),onClick:l(v,["stop"])}),[c(s(x.formConfigItem.name)+" ",1),a(d,{"form-config-item":e.formConfigItem},null,8,["form-config-item"])],16,_),a(p,i(o.$props,{modelValue:e.formConfigItem.children,"onUpdate:modelValue":r[0]||(r[0]=o=>e.formConfigItem.children=o),class:"form-config__renderer--complex--grid"}),null,16,["modelValue"])]))}});export{x as default};
@@ -1 +1 @@
1
- import{defineComponent as e,inject as o,computed as t,openBlock as r,createElementBlock as i,mergeProps as f,unref as m,withModifiers as n,createVNode as l,normalizeClass as a,withCtx as u,createTextVNode as s,toDisplayString as d,createBlock as p,createCommentVNode as C}from"vue";import{NEllipsis as c}from"naive-ui";import g from"./CloseButton.vue.js";import{InjectionActiveFieldItem as _,WidgetTextMap as v}from"../../constants/index.js";import{bindHover as I}from"../../utils/index.js";import y from"../../../../../_virtual/plugin-vue_export-helper.js";const x=["onClick","data-type"];var j=y(e({__name:"DefaultNode",props:{formConfigItem:{type:Object,required:!0},textFormatter:{type:Function,required:!0},showCloseButton:{type:Boolean,default:!0},allowClick:{type:Boolean,default:!0}},setup(e){const y=e,j=o(_);function k(){y.allowClick&&(j.value=y.formConfigItem)}const q=t((()=>["form-config__renderer--default",{"is-required":y.formConfigItem.required}])),B=t((()=>[{"is-active":j.value===y.formConfigItem,"is-disabled":b.value},"form-config__renderer","form-config__renderer--defaultWrapper"])),b=t((()=>!1===y.formConfigItem.editable)),h=t((()=>{const e=v.get(y.formConfigItem.type);return y.textFormatter(y.formConfigItem,`${y.formConfigItem.name}${e?`(${e})`:""}`)}));return(o,t)=>(r(),i("div",f(m(I)(e.formConfigItem),{onClick:n(k,["stop"]),class:m(B),"data-type":e.formConfigItem.type}),[l(m(c),{class:a(m(q))},{default:u((()=>[s(d(m(h)),1)])),_:1},8,["class"]),!e.showCloseButton||e.formConfigItem.required||e.formConfigItem.__isCombinationChild?C("v-if",!0):(r(),p(g,{key:0,"form-config-item":e.formConfigItem},null,8,["form-config-item"]))],16,x))}}),[["__file","DefaultNode.vue"]]);export{j as default};
1
+ import e from"./DefaultNode.vue2.js";import r from"../../../../../_virtual/_plugin-vue_export-helper.js";var o=r(e,[["__file","DefaultNode.vue"]]);export{o as default};
@@ -0,0 +1 @@
1
+ import{defineComponent as e,inject as o,computed as t,openBlock as r,createElementBlock as i,mergeProps as f,unref as m,withModifiers as n,createVNode as a,normalizeClass as l,withCtx as s,createTextVNode as u,toDisplayString as d,createBlock as C,createCommentVNode as c}from"vue";import{NEllipsis as p}from"naive-ui";import g from"./CloseButton.vue.js";import{InjectionActiveFieldItem as I,WidgetTextMap as _}from"../../constants/index.js";import{bindHover as v}from"../../utils/index.js";const y=["onClick","data-type"];var k=e({__name:"DefaultNode",props:{formConfigItem:{type:Object,required:!0},textFormatter:{type:Function,required:!0},showCloseButton:{type:Boolean,default:!0},allowClick:{type:Boolean,default:!0}},setup(e){const k=e,q=o(I);function x(){k.allowClick&&(q.value=k.formConfigItem)}const B=t((()=>["form-config__renderer--default",{"is-required":k.formConfigItem.required}])),b=t((()=>[{"is-active":q.value===k.formConfigItem,"is-disabled":j.value},"form-config__renderer","form-config__renderer--defaultWrapper"])),j=t((()=>!1===k.formConfigItem.editable)),w=t((()=>{const e=_.get(k.formConfigItem.type);return k.textFormatter(k.formConfigItem,`${k.formConfigItem.name}${e?`(${e})`:""}`)}));return(o,t)=>(r(),i("div",f(m(v)(e.formConfigItem),{onClick:n(x,["stop"]),class:m(b),"data-type":e.formConfigItem.type}),[a(m(p),{class:l(m(B))},{default:s((()=>[u(d(m(w)),1)])),_:1},8,["class"]),!e.showCloseButton||e.formConfigItem.required||e.formConfigItem.__isCombinationChild?c("v-if",!0):(r(),C(g,{key:0,"form-config-item":e.formConfigItem},null,8,["form-config-item"]))],16,y))}});export{k as default};
@@ -1 +1 @@
1
- import{defineComponent as e,ref as o,computed as t,provide as r,onMounted as s,onUnmounted as a,nextTick as i,openBlock as l,createBlock as n,unref as m,normalizeClass as d,normalizeStyle as p,withCtx as u,createElementBlock as c,createVNode as f,isRef as h,Fragment as y,renderList as g,createCommentVNode as j,createElementVNode as b,withKeys as v,withModifiers as k,toDisplayString as F,renderSlot as C}from"vue";import{useTheme as S}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{isNumber as x,cloneDeep as H}from"lodash-es";import{createForm as A,onFieldValueChange as L,onFieldMount as R,onFieldUnmount as _,onFieldReact as O,onFormMount as w}from"@formily/core";import{FormProvider as B,FormConsumer as V}from"@formily/vue";import{NForm as I,NTabs as N,NTabPane as D,NConfigProvider as q}from"naive-ui";import{InjectionFormGraph as T}from"./constants/index.js";import{useAutoHidden as U}from"./hooks/useAutoHidden.js";import{useComplexOptionsSpan as W}from"./hooks/useComplexOptions.js";import{useFormDomEvent as E,useFormExposeEvent as G}from"./hooks/useFormEvent.js";import{useFormGraph as K}from"./hooks/useFormGraph.js";import{useFormRenderLifeCycle as M}from"./hooks/useFormRenderLifeCycle.js";import{useLowCodeEvent as P}from"./hooks/useLowCodeEvent.js";import{useLowCodeReactions as J}from"./hooks/useLowCodeReactions.js";import{useNuiThemeOverrides as $}from"./hooks/useNuiThemeOverrides.js";import"./utils/index.js";import{useFieldListAdaptor as z}from"./hooks/useFieldListAdaptor.js";import"../../../shared/utils/index.js";import"../index.js";import{useFieldVisitor as Q}from"./hooks/useFieldVisitor.js";import"../../../shared/utils/tapable/SyncHook.js";import"../../../shared/utils/tapable/SyncBailHook.js";import"../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../shared/utils/tapable/SyncLoopHook.js";import"../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import{validateMessageLocale as X}from"./hooks/useFormValidator.js";import{useAnchor as Y}from"./hooks/useAnchor.js";import{useFormContext as Z}from"./hooks/useFormContext.js";import"./hooks/useFormRenderOptions.js";import ee from"../../../_virtual/plugin-vue_export-helper.js";import{createObjSchema as oe}from"./utils/schema.js";const te={key:0,style:{height:"54px"}},re={style:{"white-space":"pre"}};var se=ee(e({__name:"FormRender",props:{fieldList:{type:Array},initialData:{type:Object,default:()=>({})},fieldVisitor:{type:Object},column:{type:Number,default:24},maxHeight:{type:[Number,String],default:""},anchor:{type:Boolean,default:!1},parallelism:{type:Number,default:3},businessFormatter:{type:Function},schema:{type:Object},components:{type:Object,default:()=>({})},scope:{type:Object,default:()=>({})},annotation:{type:Object},consumer:{type:Boolean,default:!1},uuid:{type:String},lifeCycle:{type:Object},requestInstance:{type:Object},enterToNextWidget:{type:[Boolean,Function],default:!0},lowCodeReactions:{type:Array},linebarAutoHidden:{type:Boolean},bordered:{type:[Boolean,String],default:!0}},emits:["formChange","annotationChange","scroll"],setup(e,{expose:ee,emit:se}){const ae=e,ie=S(),{nuiThemeOverrides:le}=$();X();const ne=o(),me=t((()=>x(ae.maxHeight)?ae.maxHeight+"px":ae.maxHeight)),{SchemaField:de,businessCollector:pe,formItemDepsCollector:ue,changeContextCollector:ce,formUUID:fe}=Z(ae,se),{anchorBarRef:he,currentAnchor:ye,generateAnchorList:ge,updateAnchorList:je,anchorIdList:be,onScroll:ve}=Y(ae,se,ne,ue);M(ae).callLifeCycle("onSetup");const{trigger:ke}=U(),{observeFormGraph:Fe,setGraph:Ce,removeGraph:Se}=K();r(T,Fe);const{lowCodeEventTrigger:xe}=P(),He=A({initialValues:ae.initialData,effects(e){L("*",(o=>{const t=o.props.name.toString();pe.trigger(e,t),ue.trigger(t),se("formChange",{fieldInstance:o,fieldKey:t,fieldName:o.title,value:o.value,context:ce.getContext(t,o.value)}),xe(o),Ae(t,o.value)})),R("*",Ce),_("*",Se),ae.linebarAutoHidden&&(O("*",ke),w((e=>e.query("*").forEach(ke)))),ae.anchor&&O("*",je)}}),{lowCodeReactionsHandler:Ae,triggerAllReactionsHandler:Le}=J(t((()=>ae.lowCodeReactions)),He);s(Le);const{schemaAdaptor:Re}=z(pe);let _e=ae.fieldList||[];const Oe=t((()=>ae.schema?ae.schema:ae.fieldList?(_e=Q().traverse(H(ae.fieldList),ae.fieldVisitor),oe(Re(_e))):oe({}))),{onKeydown:we}=E({formModel:He,formRenderRef:ne,props:ae}),{clearSpan:Be}=W();a((()=>Be(fe)));const Ve=G({formModel:He,formRenderRef:ne,formItemDepsCollector:ue,getFieldList:()=>_e,formUUID:fe});return ee({formModel:He,validate:(e="*")=>Ve.validate(e),getFormValues:(e=!0)=>Ve.getFormValues(e),async setFormValues(e,o=!0,t=!1,r=!0){t&&(pe.triggerLock=!0),Ve.setFormValues(e,o,r),await i(),pe.triggerLock=!1},setFieldState(e,o){Ve.setFieldState(e,o)},resetFields(e="*"){Ve.resetFields(e)},queryWidget:async e=>Ve.queryWidget(e),getFieldList:()=>_e,async reload(){console.error("reload function is abstract,it should be overwrite!")}}),(o,t)=>(l(),n(m(I),{class:d(["form-render",{"form-render--no-border":!e.bordered,"form-render--underline":"underline"===e.bordered}]),"require-mark-placement":"left",style:p(m(ie))},{default:u((()=>[e.anchor?(l(),c("section",te,[f(m(N),{value:m(ye),"onUpdate:value":t[0]||(t[0]=e=>h(ye)?ye.value=e:null),type:"line",ref_key:"anchorBarRef",ref:he},{default:u((()=>[(l(!0),c(y,null,g(m(be),(e=>(l(),n(m(D),{name:e.name,tab:e.title,key:e.name},null,8,["name","tab"])))),128))])),_:1},8,["value"])])):j("v-if",!0),f(m(q),{"theme-overrides":m(le)},{default:u((()=>[b("section",{class:"form-render__wrapper",style:p({"--column":e.column,"--form-height":m(me)}),ref_key:"formRenderRef",ref:ne,onScroll:t[1]||(t[1]=(...e)=>m(ve)&&m(ve)(...e)),onKeydownCapture:t[2]||(t[2]=v(k(((...e)=>m(we)&&m(we)(...e)),["prevent"]),["enter"]))},[f(m(B),{form:m(He)},{default:u((()=>[f(m(de),{schema:m(Oe)},null,8,["schema"]),e.consumer?(l(),n(m(V),{key:0},{default:u((({form:e})=>[b("div",re,F(JSON.stringify(e.values,null,2)),1)])),_:1})):j("v-if",!0),C(o.$slots,"default")])),_:3},8,["form"])],36)])),_:3},8,["theme-overrides"])])),_:3},8,["class","style"]))}}),[["__file","FormRender.vue"]]);export{se as default};
1
+ import e from"./FormRender.vue2.js";import r from"../../../_virtual/_plugin-vue_export-helper.js";var o=r(e,[["__file","FormRender.vue"]]);export{o as default};
@@ -0,0 +1 @@
1
+ import{defineComponent as e,ref as o,computed as t,provide as r,onMounted as s,onUnmounted as a,nextTick as i,openBlock as l,createBlock as n,unref as m,normalizeClass as d,normalizeStyle as p,withCtx as u,createElementBlock as c,createVNode as f,isRef as h,Fragment as y,renderList as g,createCommentVNode as j,createElementVNode as b,withKeys as k,withModifiers as v,toDisplayString as F,renderSlot as C}from"vue";import{useTheme as S}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{isNumber as H,cloneDeep as x}from"lodash-es";import{createForm as A,onFieldValueChange as L,onFieldMount as R,onFieldUnmount as O,onFieldReact as w,onFormMount as _}from"@formily/core";import{FormProvider as B,FormConsumer as V}from"@formily/vue";import{NForm as I,NTabs as N,NTabPane as D,NConfigProvider as q}from"naive-ui";import{InjectionFormGraph as T}from"./constants/index.js";import{useAutoHidden as U}from"./hooks/useAutoHidden.js";import{useComplexOptionsSpan as W}from"./hooks/useComplexOptions.js";import{useFormDomEvent as E,useFormExposeEvent as G}from"./hooks/useFormEvent.js";import{useFormGraph as K}from"./hooks/useFormGraph.js";import{useFormRenderLifeCycle as M}from"./hooks/useFormRenderLifeCycle.js";import{useLowCodeEvent as P}from"./hooks/useLowCodeEvent.js";import{useLowCodeReactions as J}from"./hooks/useLowCodeReactions.js";import{useNuiThemeOverrides as $}from"./hooks/useNuiThemeOverrides.js";import"./utils/index.js";import{useFieldListAdaptor as z}from"./hooks/useFieldListAdaptor.js";import"../../../shared/utils/index.js";import"../index.js";import{useFieldVisitor as Q}from"./hooks/useFieldVisitor.js";import"../../../shared/utils/tapable/SyncHook.js";import"../../../shared/utils/tapable/SyncBailHook.js";import"../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../shared/utils/tapable/SyncLoopHook.js";import"../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import{validateMessageLocale as X}from"./hooks/useFormValidator.js";import{useAnchor as Y}from"./hooks/useAnchor.js";import{useFormContext as Z}from"./hooks/useFormContext.js";import"./hooks/useFormRenderOptions.js";import{createObjSchema as ee}from"./utils/schema.js";const oe={key:0,style:{height:"54px"}},te={style:{"white-space":"pre"}};var re=e({__name:"FormRender",props:{fieldList:{type:Array},initialData:{type:Object,default:()=>({})},fieldVisitor:{type:Object},column:{type:Number,default:24},maxHeight:{type:[Number,String],default:""},anchor:{type:Boolean,default:!1},parallelism:{type:Number,default:3},businessFormatter:{type:Function},schema:{type:Object},components:{type:Object,default:()=>({})},scope:{type:Object,default:()=>({})},annotation:{type:Object},consumer:{type:Boolean,default:!1},uuid:{type:String},lifeCycle:{type:Object},requestInstance:{type:Object},enterToNextWidget:{type:[Boolean,Function],default:!0},lowCodeReactions:{type:Array},linebarAutoHidden:{type:Boolean},bordered:{type:[Boolean,String],default:!0}},emits:["formChange","annotationChange","scroll"],setup(e,{expose:re,emit:se}){const ae=e,ie=S(),{nuiThemeOverrides:le}=$();X();const ne=o(),me=t((()=>H(ae.maxHeight)?ae.maxHeight+"px":ae.maxHeight)),{SchemaField:de,businessCollector:pe,formItemDepsCollector:ue,changeContextCollector:ce,formUUID:fe}=Z(ae,se),{anchorBarRef:he,currentAnchor:ye,generateAnchorList:ge,updateAnchorList:je,anchorIdList:be,onScroll:ke}=Y(ae,se,ne,ue);M(ae).callLifeCycle("onSetup");const{trigger:ve}=U(),{observeFormGraph:Fe,setGraph:Ce,removeGraph:Se}=K();r(T,Fe);const{lowCodeEventTrigger:He}=P(),xe=A({initialValues:ae.initialData,effects(e){L("*",(o=>{const t=o.props.name.toString();pe.trigger(e,t),ue.trigger(t),se("formChange",{fieldInstance:o,fieldKey:t,fieldName:o.title,value:o.value,context:ce.getContext(t,o.value)}),He(o),Ae(t,o.value)})),R("*",Ce),O("*",Se),ae.linebarAutoHidden&&(w("*",ve),_((e=>e.query("*").forEach(ve)))),ae.anchor&&w("*",je)}}),{lowCodeReactionsHandler:Ae,triggerAllReactionsHandler:Le}=J(t((()=>ae.lowCodeReactions)),xe);s(Le);const{schemaAdaptor:Re}=z(pe);let Oe=ae.fieldList||[];const we=t((()=>ae.schema?ae.schema:ae.fieldList?(Oe=Q().traverse(x(ae.fieldList),ae.fieldVisitor),ee(Re(Oe))):ee({}))),{onKeydown:_e}=E({formModel:xe,formRenderRef:ne,props:ae}),{clearSpan:Be}=W();a((()=>Be(fe)));const Ve=G({formModel:xe,formRenderRef:ne,formItemDepsCollector:ue,getFieldList:()=>Oe,formUUID:fe});return re({formModel:xe,validate:(e="*")=>Ve.validate(e),getFormValues:(e=!0)=>Ve.getFormValues(e),async setFormValues(e,o=!0,t=!1,r=!0){t&&(pe.triggerLock=!0),Ve.setFormValues(e,o,r),await i(),pe.triggerLock=!1},setFieldState(e,o){Ve.setFieldState(e,o)},resetFields(e="*"){Ve.resetFields(e)},queryWidget:async e=>Ve.queryWidget(e),getFieldList:()=>Oe,async reload(){console.error("reload function is abstract,it should be overwrite!")}}),(o,t)=>(l(),n(m(I),{class:d(["form-render",{"form-render--no-border":!e.bordered,"form-render--underline":"underline"===e.bordered}]),"require-mark-placement":"left",style:p(m(ie))},{default:u((()=>[e.anchor?(l(),c("section",oe,[f(m(N),{value:m(ye),"onUpdate:value":t[0]||(t[0]=e=>h(ye)?ye.value=e:null),type:"line",ref_key:"anchorBarRef",ref:he},{default:u((()=>[(l(!0),c(y,null,g(m(be),(e=>(l(),n(m(D),{name:e.name,tab:e.title,key:e.name},null,8,["name","tab"])))),128))])),_:1},8,["value"])])):j("v-if",!0),f(m(q),{"theme-overrides":m(le)},{default:u((()=>[b("section",{class:"form-render__wrapper",style:p({"--column":e.column,"--form-height":m(me)}),ref_key:"formRenderRef",ref:ne,onScroll:t[1]||(t[1]=(...e)=>m(ke)&&m(ke)(...e)),onKeydownCapture:t[2]||(t[2]=k(v(((...e)=>m(_e)&&m(_e)(...e)),["prevent"]),["enter"]))},[f(m(B),{form:m(xe)},{default:u((()=>[f(m(de),{schema:m(we)},null,8,["schema"]),e.consumer?(l(),n(m(V),{key:0},{default:u((({form:e})=>[b("div",te,F(JSON.stringify(e.values,null,2)),1)])),_:1})):j("v-if",!0),C(o.$slots,"default")])),_:3},8,["form"])],36)])),_:3},8,["theme-overrides"])])),_:3},8,["class","style"]))}});export{re as default};
@@ -1 +1 @@
1
- import{defineComponent as e,ref as r,computed as l,openBlock as t,createBlock as a,withCtx as o,renderSlot as u,nextTick as d}from"vue";import i from"./FormRender.vue.js";import s from"../../../_virtual/plugin-vue_export-helper.js";var m=s(e({__name:"FormRenderWrapper",setup(e,{expose:s}){const m=r(),n=r(0);return s({...["validate","getFormValues","setFormValues","setFieldState","resetFields","queryWidget","getFieldList"].reduce(((e,r)=>(e[r]=(...e)=>{var l;return(null==(l=m.value)?void 0:l[r]).call(l,...e)},e)),{}),formModel:l((()=>{var e;return null==(e=m.value)?void 0:e.formModel})),reload:async function(){n.value++,await d()}}),(e,r)=>(t(),a(i,{key:n.value,ref_key:"formRenderRef",ref:m},{default:o((()=>[u(e.$slots,"default")])),_:3}))}}),[["__file","FormRenderWrapper.vue"]]);export{m as default};
1
+ import r from"./FormRenderWrapper.vue2.js";import e from"../../../_virtual/_plugin-vue_export-helper.js";var p=e(r,[["__file","FormRenderWrapper.vue"]]);export{p as default};
@@ -0,0 +1 @@
1
+ import{defineComponent as e,ref as r,computed as t,openBlock as a,createBlock as l,withCtx as o,renderSlot as u,nextTick as d}from"vue";import s from"./FormRender.vue.js";var n=e({__name:"FormRenderWrapper",setup(e,{expose:n}){const f=r(),i=r(0);return n({...["validate","getFormValues","setFormValues","setFieldState","resetFields","queryWidget","getFieldList"].reduce(((e,r)=>(e[r]=(...e)=>{var t;return(null==(t=f.value)?void 0:t[r]).call(t,...e)},e)),{}),formModel:t((()=>{var e;return null==(e=f.value)?void 0:e.formModel})),reload:async function(){i.value++,await d()}}),(e,r)=>(a(),l(s,{key:i.value,ref_key:"formRenderRef",ref:f},{default:o((()=>[u(e.$slots,"default")])),_:3}))}});export{n as default};
@@ -1 +1 @@
1
- import{defineComponent as e,ref as o,computed as t,watch as a,inject as i,onBeforeUnmount as r,createVNode as n}from"vue";import{isObjectField as m}from"@formily/core";import{autorun as l}from"@formily/reactive";import{RecursionField as u,connect as s}from"@formily/vue";import{AddCircleOutline as c,RemoveCircle as p}from"@vicons/ionicons5";import{isNumber as d,isArray as f,isFunction as v,range as b}from"lodash-es";import{NButton as y,NIcon as x}from"naive-ui";import"../../../index.js";import{InjectionBusinessCollector as h}from"../../constants/index.js";import"../../utils/index.js";import{useFormField as _}from"../../hooks/useFormField.js";import{useFieldListAdaptor as j}from"../../hooks/useFieldListAdaptor.js";import{createObjSchema as C}from"../../utils/schema.js";const F=s(e({name:"FormCombination",props:{title:{type:String,default:""},value:{type:Array},maxGroupNum:{type:Number},disabled:{type:Boolean},getProperties:{type:Function,default:()=>[]},combinationItemDeletable:{type:[Boolean,Function],default:!0},onInput:{},onBlur:{},onChange:{}},emits:["update:value"],setup(e){const{field:s,fieldKey:F}=_(),g=o(1),k=t((()=>d(e.maxGroupNum)?e.maxGroupNum<1?0:~~e.maxGroupNum:1/0));function I(){g.value++}a((()=>e.value),(e=>{f(e)&&(g.value=Math.min(Math.max(e.length,1),k.value))}),{immediate:!0});const N=i(h),{schemaAdaptor:D}=j(N),G=o([]);return r(l((()=>{f(s.value.value)&&(G.value=s.value.value.map(((o,t)=>v(e.combinationItemDeletable)?e.combinationItemDeletable(o||{},t):e.combinationItemDeletable)))}))),()=>n("section",{class:"form-render__combination"},[n("header",{class:"form-render__combinationHeader"},[n("div",{class:"form-render__combinationHeaderText"},[e.title]),n(y,{onClick:I,text:!0,style:{"--n-text-color":"var(--c-primary-color)"},disabled:g.value>=k.value||e.disabled},{icon:()=>n(x,{component:c},null),default:()=>"新增"})]),b(g.value).map(((o,t)=>n("section",{class:"form-render__combinationContent"},[n(u,{schema:C(D(e.getProperties())),name:t},null),n(y,{text:!0,disabled:!G.value[t],type:"error",class:"form-render__combinationClose",onClick:()=>async function(e){if(g.value>1)g.value--,await s.value.remove(e);else{const o=s.value.query(`${F.value}.${e}`).take();if(!o||!m(o))return;await o.reset()}}(t)},{icon:()=>n(x,{component:p},null)})])))])}}));export{F as COMBINATION};
1
+ import{defineComponent as e,ref as o,computed as t,watch as a,inject as i,onBeforeUnmount as r,createVNode as n}from"vue";import{isObjectField as m}from"@formily/core";import{autorun as l}from"@formily/reactive";import{connect as u,RecursionField as s}from"@formily/vue";import{AddCircleOutline as c,RemoveCircle as p}from"@vicons/ionicons5";import{isNumber as d,isArray as f,isFunction as v,range as b}from"lodash-es";import{NButton as y,NIcon as x}from"naive-ui";import"../../../index.js";import{InjectionBusinessCollector as h}from"../../constants/index.js";import"../../utils/index.js";import{useFormField as _}from"../../hooks/useFormField.js";import{useFieldListAdaptor as j}from"../../hooks/useFieldListAdaptor.js";import{createObjSchema as C}from"../../utils/schema.js";const F=u(e({name:"FormCombination",props:{title:{type:String,default:""},value:{type:Array},maxGroupNum:{type:Number},disabled:{type:Boolean},getProperties:{type:Function,default:()=>[]},combinationItemDeletable:{type:[Boolean,Function],default:!0},onInput:{},onBlur:{},onChange:{}},emits:["update:value"],setup(e){const{field:u,fieldKey:F}=_(),g=o(1),k=t((()=>d(e.maxGroupNum)?e.maxGroupNum<1?0:~~e.maxGroupNum:1/0));function I(){g.value++}a((()=>e.value),(e=>{f(e)&&(g.value=Math.min(Math.max(e.length,1),k.value))}),{immediate:!0});const N=i(h),{schemaAdaptor:D}=j(N),G=o([]);return r(l((()=>{f(u.value.value)&&(G.value=u.value.value.map(((o,t)=>v(e.combinationItemDeletable)?e.combinationItemDeletable(o||{},t):e.combinationItemDeletable)))}))),()=>n("section",{class:"form-render__combination"},[n("header",{class:"form-render__combinationHeader"},[n("div",{class:"form-render__combinationHeaderText"},[e.title]),n(y,{onClick:I,text:!0,style:{"--n-text-color":"var(--c-primary-color)"},disabled:g.value>=k.value||e.disabled},{icon:()=>n(x,{component:c},null),default:()=>"新增"})]),b(g.value).map(((o,t)=>n("section",{class:"form-render__combinationContent"},[n(s,{schema:C(D(e.getProperties())),name:t},null),n(y,{text:!0,disabled:!G.value[t],type:"error",class:"form-render__combinationClose",onClick:()=>async function(e){if(g.value>1)g.value--,await u.value.remove(e);else{const o=u.value.query(`${F.value}.${e}`).take();if(!o||!m(o))return;await o.reset()}}(t)},{icon:()=>n(x,{component:p},null)})])))])}}));export{F as COMBINATION};
@@ -1 +1 @@
1
- import{defineComponent as e,inject as r,computed as o,ref as l,onUnmounted as t,createVNode as i,mergeProps as a}from"vue";import{arrayed as s,widthAppend as n}from"../../../../../shared/utils/index.js";import{isVoidField as m}from"@formily/core";import{observe as u,autorun as d}from"@formily/reactive";import{connect as f,mapProps as p}from"@formily/vue";import{useDebounceFn as v}from"@vueuse/core";import{isArray as c,isString as y,isFunction as _}from"lodash-es";import{NFormItem as b}from"naive-ui";import g from"../../../../annotation-edit/index.js";import"../../../index.js";import x from"../tooltipMessage.vue.js";import{InjectionFormUUID as j,InjectionFormGraph as I,InjectionAnnotation as k}from"../../constants/index.js";import{useComplexOptionsSpan as F}from"../../hooks/useComplexOptions.js";import{dotEscape as h}from"../../utils/schema.js";import{useFormField as R}from"../../hooks/useFormField.js";import{validateMessageParser as L}from"../../utils/index.js";const q=f(e({name:"FormRenderItem",props:{label:String,propertyKey:String,remark:String,span:{type:Number,default:6},suffixFields:{type:Array},labelRender:Function,annotation:{},fieldItem:{}},setup(e,{slots:s}){const{field:f,fieldKey:p,fieldAddress:y}=R(),L=r(j),q=o((()=>h(`${L}-${y.value}`))),K=l(!1);if(m(f.value)&&c(e.suffixFields)){const o=r(I);t(u(o,v((()=>{m(f.value)&&c(e.suffixFields)&&(K.value=e.suffixFields.some((e=>{const r=f.value.form.query(e).take();return r&&Reflect.get(r,"required")})))}),100)))}else t(d((()=>{K.value=Reflect.get(f.value,"required")})));const S=r(k),A=o({get(){var r,o;return null!=(o=null==(r=S.value)?void 0:r[e.propertyKey])?o:""},set(r){S.value={property:e.propertyKey,value:r}}});const E=o((()=>S.value&&!1!==e.annotation)),V=o((()=>e.label&&" "!==e.label)),$=o((()=>{let r=0;return E.value&&(r+=18),e.remark&&(r+=18),r}));function w(){return V.value?i("section",{class:"form-render__formItemLabel"},[i("span",{class:"form-render__formItemLabel--text",style:{marginRight:n($.value)}},[_(e.labelRender)?e.labelRender(e.label):e.label]),$.value?i("section",{class:"form-render__formItemLabel--operation"},[e.remark?i("div",{class:"form-render__formItemLabel--tooltip"},[i(x,{message:e.remark},null)]):null,E.value?i(g,{class:"form-render__formItemLabel--annotation",modelValue:A.value,"onUpdate:modelValue":e=>A.value=e},null):null]):null]):null}const{getSpan:C}=F();return()=>i(b,a({class:"form-render__formItem",style:{"--form-item-column":C(L,f.value.address,!1)+e.span}},{id:q.value,uuid:L,"widget-type":f.value.componentType,"field-key":h(p.value),"field-address":h(y.value),required:K.value}),{...s,label:w})}}),p({title:"label"},((e,r)=>{const o=m(r)?void 0:s(r.selfErrors).length?function(e,r){if(!y(r.defined_error_msg)||!r.defined_error_msg)return e.map((e=>L(e,r))).join(",");return L(r.defined_error_msg,r)}(s(r.selfErrors),e.fieldItem):void 0;return{...e,fieldItem:void 0,feedback:o,"validation-status":o?"error":void 0}})));export{q as FORM_ITEM};
1
+ import{defineComponent as e,inject as r,computed as o,ref as l,onUnmounted as t,createVNode as i,mergeProps as a}from"vue";import{arrayed as s,widthAppend as n}from"../../../../../shared/utils/index.js";import{isVoidField as m}from"@formily/core";import{observe as u,autorun as d}from"@formily/reactive";import{connect as f,mapProps as p}from"@formily/vue";import{useDebounceFn as v}from"@vueuse/core";import{isString as c,isArray as y,isFunction as _}from"lodash-es";import{NFormItem as b}from"naive-ui";import g from"../../../../annotation-edit/index.js";import"../../../index.js";import x from"../tooltipMessage.vue.js";import{InjectionFormUUID as j,InjectionFormGraph as I,InjectionAnnotation as k}from"../../constants/index.js";import{useComplexOptionsSpan as F}from"../../hooks/useComplexOptions.js";import{dotEscape as h}from"../../utils/schema.js";import{validateMessageParser as R}from"../../utils/index.js";import{useFormField as L}from"../../hooks/useFormField.js";const q=f(e({name:"FormRenderItem",props:{label:String,propertyKey:String,remark:String,span:{type:Number,default:6},suffixFields:{type:Array},labelRender:Function,annotation:{},fieldItem:{}},setup(e,{slots:s}){const{field:f,fieldKey:p,fieldAddress:c}=L(),R=r(j),q=o((()=>h(`${R}-${c.value}`))),K=l(!1);if(m(f.value)&&y(e.suffixFields)){const o=r(I);t(u(o,v((()=>{m(f.value)&&y(e.suffixFields)&&(K.value=e.suffixFields.some((e=>{const r=f.value.form.query(e).take();return r&&Reflect.get(r,"required")})))}),100)))}else t(d((()=>{K.value=Reflect.get(f.value,"required")})));const S=r(k),A=o({get(){var r,o;return null!=(o=null==(r=S.value)?void 0:r[e.propertyKey])?o:""},set(r){S.value={property:e.propertyKey,value:r}}});const E=o((()=>S.value&&!1!==e.annotation)),V=o((()=>e.label&&" "!==e.label)),$=o((()=>{let r=0;return E.value&&(r+=18),e.remark&&(r+=18),r}));function w(){return V.value?i("section",{class:"form-render__formItemLabel"},[i("span",{class:"form-render__formItemLabel--text",style:{marginRight:n($.value)}},[_(e.labelRender)?e.labelRender(e.label):e.label]),$.value?i("section",{class:"form-render__formItemLabel--operation"},[e.remark?i("div",{class:"form-render__formItemLabel--tooltip"},[i(x,{message:e.remark},null)]):null,E.value?i(g,{class:"form-render__formItemLabel--annotation",modelValue:A.value,"onUpdate:modelValue":e=>A.value=e},null):null]):null]):null}const{getSpan:C}=F();return()=>i(b,a({class:"form-render__formItem",style:{"--form-item-column":C(R,f.value.address,!1)+e.span}},{id:q.value,uuid:R,"widget-type":f.value.componentType,"field-key":h(p.value),"field-address":h(c.value),required:K.value}),{...s,label:w})}}),p({title:"label"},((e,r)=>{const o=m(r)?void 0:s(r.selfErrors).length?function(e,r){if(!c(r.defined_error_msg)||!r.defined_error_msg)return e.map((e=>R(e,r))).join(",");return R(r.defined_error_msg,r)}(s(r.selfErrors),e.fieldItem):void 0;return{...e,fieldItem:void 0,feedback:o,"validation-status":o?"error":void 0}})));export{q as FORM_ITEM};
@@ -1 +1 @@
1
- import{defineComponent as e,ref as r,computed as t,inject as o,watch as a,createVNode as n}from"vue";import{useVModel as u}from"@vueuse/core";import{isEqual as i,isString as l,isEmpty as s,isFunction as c,omit as d}from"lodash-es";import"../../../index.js";import{InjectionAsyncQueue as p}from"../../constants/index.js";import{useCommonInjection as v}from"../../hooks/useCommonInjection.js";import{formRenderLog as f}from"../../utils/index.js";import{connect as m,mapProps as y}from"@formily/vue";import h from"../../../../search-cascader/index.js";import k from"../../../../../shared/components/no-data/NoData.vue.js";import{createVisitedSetter as j,assignUpdateValue as _}from"../../utils/schema.js";import{useFormField as w}from"../../hooks/useFormField.js";import{useFormRequest as b}from"../../hooks/useFormRequest.js";const g=m(e({name:"FormSearchCascade",props:{options:{type:Array,default:()=>[]},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},autograph:{type:String,required:!0},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},wordbook:{type:Object,required:!0},onChange:{},value:{type:[String,Array]}},emits:["update:value"],setup(e,{emit:m}){const y=u(e,"value",m),_=r(!1),g=r([]),{field:F,fieldKey:K}=w(),O=t((()=>{var r,t,o;return null!=(o=null==(t=null==(r=e.wordbook)?void 0:r.show_key)?void 0:t[0])?o:e.labelField})),q=t((()=>{var r,t;return null!=(t=null==(r=e.wordbook)?void 0:r.value_key)?t:e.valueField})),S=t((()=>{var r,t;return null==(t=null==(r=e.wordbook)?void 0:r.render_key)?void 0:t[0]})),x=t((()=>{var r;return(null==(r=e.wordbook)?void 0:r.level_num)||1/0})),C=o(p),{getSearchRequestInfo:L}=b();async function V(r,t){try{if(r&&!r.__keyword&&r.isLeaf)return o(r);if(null==r?void 0:r.__keyword){if(!l(r.id_link))return Promise.reject();const t=r.id_link.split("_").filter((e=>e)),o=await async function(r){if(!L().primaryKeyUrl)return[];try{return await C.addAsync(t(e.wordbook,e.autograph,r,K.value))}catch(e){l(e)&&f(e)}function t(r,t,o,a){const n=L();return{key:a,params:{autograph:t,tableId:r.id,primaryKeyValue:o.join(","),page:1},...n,url:n.primaryKeyUrl,cache:e.requestCache}}}(t);if(!o)return Promise.reject();const{lastOption:a,options:n}=function(e,r){let t=e[0];return{options:r.reduce(((r,a,n)=>{const u=o(e,a);return 0===n?(t=u,[u]):(Object.assign(u,{parent:t,isLeaf:n+1>=x.value}),t.children=[u],t=u,r)}),[]),lastOption:t};function o(e,r){return e.find((e=>e[q.value]===r))}}(o,t);return await V(a),s(a.children)?(y.value=function(e,r){return r.map((r=>e.find((e=>e[q.value]===r))))}(o,t),_.value=!1,Promise.reject()):(g.value=n,a)}{const n=await C.addAsync(function(r,o,a,n,u){const i={autograph:()=>o,wordbookId:"id",wordbookType:"type",fieldKeys:()=>r.search_key?JSON.stringify(r.search_key):void 0,conObj:()=>JSON.stringify(function(e,r,t){return r?e.conObj||[]:t?[{con:"EQ",is_compare_field:!1,field_key:e.level_key,value:t[q.value]}]:e.conObjFirstLevel||[]}(r,t,n)),primaryKey:"primary_key",levelKey:"level_key",keyword:()=>t,page:()=>1},s=Object.entries(i).reduce(((e,[t,o])=>(e[t]=l(o)?r[o]:c(o)?o():void 0,e)),{});return{...L(),params:s,key:u,cache:e.requestCache}}(e.wordbook,e.autograph,F.value,r,K.value));if(r){if(!n.length)return o(r);r.children=n.map((e=>function(e,r,t){return{...e,parent:r,isLeaf:a(r)+1>=t}}(e,r,x.value)))}else g.value=n.map((e=>function(e,r){e.__keyword=!!r,e.isLeaf=!!r,r&&(e[O.value]=e[S.value||O.value]||e[O.value]);return e}(e,t)))}}catch(e){l(e)&&f(e)}function o(e){return y.value=function(e){const r=[];let t=e;for(;t;)r.unshift(d(t,["parent","isLeaf","__keyword","children"])),t=t.parent;return r}(e),_.value=!1,Promise.reject()}function a(e){let r=1,t=e.parent;for(;t;)r++,t=t.parent;return r}}a((()=>e.wordbook),((r,t)=>{i(r,t)||(g.value=[],r&&(y.value||!e.lazyRequest)&&V())}),{immediate:!0});const{injectValueValidate:A,injectValueWatchFromEmpty:I,injectValueBindKey:P}=v();I(y,V),A(y);const R=P(y);return()=>n(h,{value:y.value,"onUpdate:value":e=>y.value=e,show:_.value,"onUpdate:show":e=>_.value=e,options:g.value,key:R.value,labelKey:O.value,valueKey:q.value,search:V,onFocus:j(F)},{empty:()=>n(k,null,null)})}}),y({dataSource:"options"},_));export{g as LEVEL_SEARCH_CASCADER};
1
+ import{defineComponent as e,ref as r,computed as t,inject as o,watch as a,createVNode as n}from"vue";import{useVModel as u}from"@vueuse/core";import{isEqual as i,isString as l,isEmpty as s,isFunction as c,omit as d}from"lodash-es";import"../../../index.js";import{InjectionAsyncQueue as p}from"../../constants/index.js";import{useCommonInjection as v}from"../../hooks/useCommonInjection.js";import{formRenderLog as f}from"../../utils/index.js";import{connect as m,mapProps as y}from"@formily/vue";import h from"../../../../search-cascader/index.js";import k from"../../../../../shared/components/no-data/NoData.vue.js";import{assignUpdateValue as j,createVisitedSetter as _}from"../../utils/schema.js";import{useFormField as w}from"../../hooks/useFormField.js";import{useFormRequest as b}from"../../hooks/useFormRequest.js";const g=m(e({name:"FormSearchCascade",props:{options:{type:Array,default:()=>[]},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},autograph:{type:String,required:!0},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},wordbook:{type:Object,required:!0},onChange:{},value:{type:[String,Array]}},emits:["update:value"],setup(e,{emit:m}){const y=u(e,"value",m),j=r(!1),g=r([]),{field:F,fieldKey:K}=w(),O=t((()=>{var r,t,o;return null!=(o=null==(t=null==(r=e.wordbook)?void 0:r.show_key)?void 0:t[0])?o:e.labelField})),q=t((()=>{var r,t;return null!=(t=null==(r=e.wordbook)?void 0:r.value_key)?t:e.valueField})),S=t((()=>{var r,t;return null==(t=null==(r=e.wordbook)?void 0:r.render_key)?void 0:t[0]})),x=t((()=>{var r;return(null==(r=e.wordbook)?void 0:r.level_num)||1/0})),C=o(p),{getSearchRequestInfo:L}=b();async function V(r,t){try{if(r&&!r.__keyword&&r.isLeaf)return o(r);if(null==r?void 0:r.__keyword){if(!l(r.id_link))return Promise.reject();const t=r.id_link.split("_").filter((e=>e)),o=await async function(r){if(!L().primaryKeyUrl)return[];try{return await C.addAsync(t(e.wordbook,e.autograph,r,K.value))}catch(e){l(e)&&f(e)}function t(r,t,o,a){const n=L();return{key:a,params:{autograph:t,tableId:r.id,primaryKeyValue:o.join(","),page:1},...n,url:n.primaryKeyUrl,cache:e.requestCache}}}(t);if(!o)return Promise.reject();const{lastOption:a,options:n}=function(e,r){let t=e[0];return{options:r.reduce(((r,a,n)=>{const u=o(e,a);return 0===n?(t=u,[u]):(Object.assign(u,{parent:t,isLeaf:n+1>=x.value}),t.children=[u],t=u,r)}),[]),lastOption:t};function o(e,r){return e.find((e=>e[q.value]===r))}}(o,t);return await V(a),s(a.children)?(y.value=function(e,r){return r.map((r=>e.find((e=>e[q.value]===r))))}(o,t),j.value=!1,Promise.reject()):(g.value=n,a)}{const n=await C.addAsync(function(r,o,a,n,u){const i={autograph:()=>o,wordbookId:"id",wordbookType:"type",fieldKeys:()=>r.search_key?JSON.stringify(r.search_key):void 0,conObj:()=>JSON.stringify(function(e,r,t){return r?e.conObj||[]:t?[{con:"EQ",is_compare_field:!1,field_key:e.level_key,value:t[q.value]}]:e.conObjFirstLevel||[]}(r,t,n)),primaryKey:"primary_key",levelKey:"level_key",keyword:()=>t,page:()=>1},s=Object.entries(i).reduce(((e,[t,o])=>(e[t]=l(o)?r[o]:c(o)?o():void 0,e)),{});return{...L(),params:s,key:u,cache:e.requestCache}}(e.wordbook,e.autograph,F.value,r,K.value));if(r){if(!n.length)return o(r);r.children=n.map((e=>function(e,r,t){return{...e,parent:r,isLeaf:a(r)+1>=t}}(e,r,x.value)))}else g.value=n.map((e=>function(e,r){e.__keyword=!!r,e.isLeaf=!!r,r&&(e[O.value]=e[S.value||O.value]||e[O.value]);return e}(e,t)))}}catch(e){l(e)&&f(e)}function o(e){return y.value=function(e){const r=[];let t=e;for(;t;)r.unshift(d(t,["parent","isLeaf","__keyword","children"])),t=t.parent;return r}(e),j.value=!1,Promise.reject()}function a(e){let r=1,t=e.parent;for(;t;)r++,t=t.parent;return r}}a((()=>e.wordbook),((r,t)=>{i(r,t)||(g.value=[],r&&(y.value||!e.lazyRequest)&&V())}),{immediate:!0});const{injectValueValidate:A,injectValueWatchFromEmpty:I,injectValueBindKey:P}=v();I(y,V),A(y);const R=P(y);return()=>n(h,{value:y.value,"onUpdate:value":e=>y.value=e,show:j.value,"onUpdate:show":e=>j.value=e,options:g.value,key:R.value,labelKey:O.value,valueKey:q.value,search:V,onFocus:_(F)},{empty:()=>n(k,null,null)})}}),y({dataSource:"options"},j));export{g as LEVEL_SEARCH_CASCADER};
@@ -1 +1 @@
1
- import{defineComponent as e,ref as r,computed as o,inject as a,openBlock as l,createElementBlock as s,createElementVNode as t,normalizeClass as i,unref as n,createTextVNode as d,toDisplayString as m,createBlock as u,createCommentVNode as f,Fragment as p,createVNode as v,withCtx as _,renderSlot as c}from"vue";import"../../../../index.js";import b from"../../tooltipMessage.vue.js";import{InjectionFormItemDepsCollector as k,FormItemLineBarDepKeyPrepend as h}from"../../../constants/index.js";import{ChevronDown as y,ChevronUp as g}from"@vicons/ionicons5";import{NCollapseTransition as j}from"naive-ui";import w from"../../../../../../_virtual/plugin-vue_export-helper.js";import{useFormField as x}from"../../../hooks/useFormField.js";const F={class:"form-render__linebar","anchor-target":""},C={class:"form-render__linebarHeaderTitle"};var H=w(e({__name:"FormCollapse",props:{show:{type:Boolean,default:!0},title:{type:String,default:""},remark:String,disabled:{type:Boolean,default:!1}},setup(e){const w=e,H=r(w.show);function B(){w.disabled||(H.value=!H.value)}const S=o((()=>["form-render__linebarHeader",{"form-render__linebarHeader--disabled":!!w.disabled}])),{fieldKey:D}=x();return a(k).setDeps(D.value,h+D.value,((e=!0)=>{H.value=e})),(r,o)=>(l(),s("section",F,[t("header",{class:i(n(S)),onClick:B},[t("div",C,[d(m(e.title)+" ",1),e.remark?(l(),u(b,{key:0,message:e.remark},null,8,["message"])):f("v-if",!0)]),e.disabled?f("v-if",!0):(l(),s(p,{key:0},[H.value?(l(),u(n(y),{key:0})):(l(),u(n(g),{key:1}))],64))],2),v(n(j),{class:"form-render__linebarItem",show:H.value},{default:_((()=>[c(r.$slots,"default")])),_:3},8,["show"])]))}}),[["__file","FormCollapse.vue"]]);export{H as default};
1
+ import e from"./FormCollapse.vue2.js";import r from"../../../../../../_virtual/_plugin-vue_export-helper.js";var o=r(e,[["__file","FormCollapse.vue"]]);export{o as default};
@@ -0,0 +1 @@
1
+ import{defineComponent as e,ref as r,computed as a,inject as o,openBlock as s,createElementBlock as l,createElementVNode as t,normalizeClass as i,unref as n,createTextVNode as d,toDisplayString as m,createBlock as f,createCommentVNode as u,Fragment as p,createVNode as v,withCtx as c,renderSlot as _}from"vue";import"../../../../index.js";import b from"../../tooltipMessage.vue.js";import{InjectionFormItemDepsCollector as k,FormItemLineBarDepKeyPrepend as y}from"../../../constants/index.js";import{ChevronDown as h,ChevronUp as g}from"@vicons/ionicons5";import{NCollapseTransition as j}from"naive-ui";import{useFormField as w}from"../../../hooks/useFormField.js";const x={class:"form-render__linebar","anchor-target":""},F={class:"form-render__linebarHeaderTitle"};var H=e({__name:"FormCollapse",props:{show:{type:Boolean,default:!0},title:{type:String,default:""},remark:String,disabled:{type:Boolean,default:!1}},setup(e){const H=e,B=r(H.show);function C(){H.disabled||(B.value=!B.value)}const S=a((()=>["form-render__linebarHeader",{"form-render__linebarHeader--disabled":!!H.disabled}])),{fieldKey:D}=w();return o(k).setDeps(D.value,y+D.value,((e=!0)=>{B.value=e})),(r,a)=>(s(),l("section",x,[t("header",{class:i(n(S)),onClick:C},[t("div",F,[d(m(e.title)+" ",1),e.remark?(s(),f(b,{key:0,message:e.remark},null,8,["message"])):u("v-if",!0)]),e.disabled?u("v-if",!0):(s(),l(p,{key:0},[B.value?(s(),f(n(h),{key:0})):(s(),f(n(g),{key:1}))],64))],2),v(n(j),{class:"form-render__linebarItem",show:B.value},{default:c((()=>[_(r.$slots,"default")])),_:3},8,["show"])]))}});export{H as default};
@@ -1 +1 @@
1
- import{defineComponent as e,ref as l,computed as u,inject as a,watch as o,createVNode as t}from"vue";import{connect as n,mapProps as r}from"@formily/vue";import{useVModel as i,useDebounceFn as s}from"@vueuse/core";import{isString as v,isArray as m,cloneDeep as p,isEqual as d}from"lodash-es";import{NSelect as f}from"naive-ui";import"../../../index.js";import{InjectionAsyncQueue as c,InjectionChangeContextCollector as y,InjectionFormItemDepsCollector as g}from"../../constants/index.js";import{createUrlConfigParams as h,formRenderLog as C}from"../../utils/index.js";import{useCommonInjection as j,useSelectOptionProps as F}from"../../hooks/useCommonInjection.js";import{useFormField as x}from"../../hooks/useFormField.js";import{createVisitedSetter as b,assignUpdateValue as K,assignClearBindVisited as S}from"../../utils/schema.js";const k=n(e({name:"FormRemoteSearch",props:{value:{type:String},requestCache:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},urlConfig:{type:Object},onChange:{}},emits:["update:value"],setup(e,{slots:n,emit:r}){const K=i(e,"value",r),{field:S,fieldKey:k}=x(),w=l(null),V=u((()=>{var l,u,a;return null!=(a=null!=(u=null==(l=e.urlConfig)?void 0:l.nameKey)?u:e.labelField)?a:"text"})),q=u((()=>{var l,u,a;return null!=(a=null!=(u=null==(l=e.urlConfig)?void 0:l.valueKey)?u:e.valueField)?a:"value"})),A=a(c),B=s((async(l="",u="label")=>{if(!e.urlConfig)return w.value=null;try{w.value=await A.addAsync(await h({config:{...e.urlConfig,params:{...e.urlConfig.params,["value"===u?q.value:"keyword"]:l}},cache:e.requestCache,field:S.value}))}catch(e){v(e)&&C(e)}})),O=u((()=>m(w.value)?w.value:m(e.options)?e.options:[])),{injectValueValidate:P,injectValueBindKey:U}=j();P(K);const D=U(K);o(K,(e=>{if(e&&!O.value.find((l=>l[q.value]===e)))return B(e,"value")}));a(y).setContext(k.value,(e=>{return{currentOption:p((l=e,O.value.find((e=>e[q.value]===l))))};var l}));const I=a(g);o((()=>e.urlConfig),((e,l)=>{d(e,l)||(w.value=null,e&&(I.setDeps(k.value,e.dependKey||[],(async()=>{w.value=null,K.value=null})),K.value&&B(K.value,"value")))}),{immediate:!0});const{menuProps:R,nodeProps:z}=F();return()=>t(f,{remote:!0,filterable:!0,key:D.value,value:K.value,"onUpdate:value":e=>K.value=e,labelField:V.value,valueField:q.value,"menu-props":R,"node-props":z,onSearch:B,"onUpdate:show":e=>e&&B(),options:O.value,onFocus:b(S)},n)}}),r(K,S));export{k as REMOTE_SEARCH};
1
+ import{defineComponent as e,ref as l,computed as u,inject as a,watch as o,createVNode as t}from"vue";import{connect as n,mapProps as r}from"@formily/vue";import{useVModel as i,useDebounceFn as s}from"@vueuse/core";import{isString as v,isArray as m,cloneDeep as p,isEqual as d}from"lodash-es";import{NSelect as f}from"naive-ui";import"../../../index.js";import{InjectionAsyncQueue as c,InjectionChangeContextCollector as y,InjectionFormItemDepsCollector as g}from"../../constants/index.js";import{createUrlConfigParams as h,formRenderLog as C}from"../../utils/index.js";import{useCommonInjection as j,useSelectOptionProps as F}from"../../hooks/useCommonInjection.js";import{assignUpdateValue as x,assignClearBindVisited as b,createVisitedSetter as K}from"../../utils/schema.js";import{useFormField as S}from"../../hooks/useFormField.js";const k=n(e({name:"FormRemoteSearch",props:{value:{type:String},requestCache:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},urlConfig:{type:Object},onChange:{}},emits:["update:value"],setup(e,{slots:n,emit:r}){const x=i(e,"value",r),{field:b,fieldKey:k}=S(),w=l(null),V=u((()=>{var l,u,a;return null!=(a=null!=(u=null==(l=e.urlConfig)?void 0:l.nameKey)?u:e.labelField)?a:"text"})),q=u((()=>{var l,u,a;return null!=(a=null!=(u=null==(l=e.urlConfig)?void 0:l.valueKey)?u:e.valueField)?a:"value"})),A=a(c),B=s((async(l="",u="label")=>{if(!e.urlConfig)return w.value=null;try{w.value=await A.addAsync(await h({config:{...e.urlConfig,params:{...e.urlConfig.params,["value"===u?q.value:"keyword"]:l}},cache:e.requestCache,field:b.value}))}catch(e){v(e)&&C(e)}})),O=u((()=>m(w.value)?w.value:m(e.options)?e.options:[])),{injectValueValidate:P,injectValueBindKey:U}=j();P(x);const D=U(x);o(x,(e=>{if(e&&!O.value.find((l=>l[q.value]===e)))return B(e,"value")}));a(y).setContext(k.value,(e=>{return{currentOption:p((l=e,O.value.find((e=>e[q.value]===l))))};var l}));const I=a(g);o((()=>e.urlConfig),((e,l)=>{d(e,l)||(w.value=null,e&&(I.setDeps(k.value,e.dependKey||[],(async()=>{w.value=null,x.value=null})),x.value&&B(x.value,"value")))}),{immediate:!0});const{menuProps:R,nodeProps:z}=F();return()=>t(f,{remote:!0,filterable:!0,key:D.value,value:x.value,"onUpdate:value":e=>x.value=e,labelField:V.value,valueField:q.value,"menu-props":R,"node-props":z,onSearch:B,"onUpdate:show":e=>e&&B(),options:O.value,onFocus:K(b)},n)}}),r(x,b));export{k as REMOTE_SEARCH};
@@ -1 +1 @@
1
- import{defineComponent as e,ref as t,computed as a,inject as l,watch as r,createVNode as n,nextTick as o}from"vue";import{isEqual as u,isArray as i,isString as s}from"lodash-es";import"../../../index.js";import{useCommonInjection as c}from"../../hooks/useCommonInjection.js";import{InjectionAsyncQueue as p,InjectionFormUUID as d}from"../../constants/index.js";import"../../../../../shared/utils/index.js";import"../../utils/index.js";import{useFormField as m}from"../../hooks/useFormField.js";import{NCascader as v}from"naive-ui";import"@vueuse/core";import"date-fns";import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/SyncBailHook.js";import"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/SyncLoopHook.js";import"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import"../../hooks/useFormValidator.js";import"@formily/core";import{connect as f,mapProps as y}from"@formily/vue";import"@vue/shared";import"./index.js";import"../../hooks/useFormRenderOptions.js";import{createVisitedSetter as h,assignUpdateValue as j,traverseDependKey as k}from"../../utils/schema.js";const g=f(e({name:"FormCascader",props:{options:{type:Array,default:()=>[]},depth:{type:[Number,String]},urlConfig:{type:Object},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},onFocus:{type:Function},filterable:{type:Boolean,default:!1},checkStrategy:{type:String,default:"child"},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},onChange:{},value:{}},emits:["update:value"],setup(e,{slots:f,emit:y}){const j=t(),{field:g,title:b}=m(),S=t(1),C=t(!0);const w=a((()=>{var t,a,l;return null!=(l=null!=(a=null==(t=e.urlConfig)?void 0:t.nameKey)?a:e.labelField)?l:"text"})),F=a((()=>{var t,a,l;return null!=(l=null!=(a=null==(t=e.urlConfig)?void 0:t.valueKey)?a:e.valueField)?l:"value"})),A=a((()=>{try{const t=Array.isArray(e.value)?e.value:JSON.parse(e.value||"");if(!Array.isArray(t)||!t.length)return null;const a=t.map((e=>e[F.value])).slice(-1).join(""),l=t.map((e=>e[w.value])).join(" / ");return a||l}catch(e){return null}}));function H(e,t,a){y("update:value",i(a)?a.map((function(e){return{...e,label:e[w.value],children:void 0,parent:void 0,mergeItemValue:void 0}})):null)}const x=l(p);async function q(t){e.filterable?await async function(){if(!e.urlConfig||j.value&&e.requestCache)return;const t=await x.addAsync({...e.urlConfig,params:{lvlnr:"1"},key:b.value,cache:e.requestCache});function a(e,t,r){const n=[...r,...l(e)],o={[w.value]:e[w.value],[F.value]:e[F.value],depth:t+1,isLeaf:!0,keyword:e.keyword,mergeItemValue:n};return i(e.children)&&(o.children=e.children.map((e=>a(e,t+1,n))),o.isLeaf=!e.children.length),S.value=Math.max(S.value,t+1),o}function l(e){let t=[];if(s(e[w.value])&&(t=[...t,e[w.value]]),s(e.keyword)&&e.keyword.length>0){const a=e.keyword.split(",");t=[...t,...a]}return t}j.value=t.map((e=>a(e,0,[])))}():await async function(t){if(r(e,t))return;const a=await x.addAsync(n(s(t),i(e),b.value,t));if(!a.length&&t)return t.isLeaf=!0,H(0,0,o(t)),void(O.value=!1);const l=a.map((e=>u(e,s(t))));function r(e,t){return!i(e)||!t&&j.value&&e.requestCache||s(t)>=s(e)-1}function n(t,a,l,r){const n={lvlnr:t+1+""};return r&&a.dependKey&&k(a.dependKey,((e,t)=>{n[t]=r[e]})),{params:n,...a,key:l,cache:e.requestCache}}function o(e){let t=e;const a=[e];for(;t.parent;)a.unshift(t.parent),t=t.parent;return a}function u(a,l){return{[w.value]:a[w.value],[F.value]:a[F.value],depth:l+1,parent:t,isLeaf:l+2>=s(e)}}function i(e){return e.urlConfig}function s(e){var t;return null!=(t=null==e?void 0:e.depth)?t:-1}t?t.children=l:j.value=l}(t),await B()}const V=`form-render__cascade--menu-${l(d)}`;async function B(){await o();const e=document.querySelector(`.${V} .v-vl`);e&&e.dispatchEvent(new CustomEvent("scroll"))}function L(t,a){if(!t||!a)return!1;const{mergeItemValue:l}=a;if(e.checkStrategy.includes("child")&&a.depth<S.value)return!1;return l.length>0&&l.some((e=>e.includes(t.trim())))}const{injectValueValidate:K,injectValueWatchFromEmpty:I,injectValueBindKey:E}=c();I((()=>e.value),q),K((()=>e.value)),r((()=>e.urlConfig),(async(t,a)=>{u(t,a)||(j.value=null,C.value?e.lazyRequest||(q(),C.value=!C.value):await q())}),{immediate:!0});const O=t(!1);function R(e){O.value=!!e,e&&q()}const W=a((()=>j.value||e.options||[])),z=a((()=>!e.filterable)),N=E(A);return()=>n(v,{key:N.value,remote:z.value,filterable:e.filterable,"menu-props":{class:V,onClick:B},"check-strategy":e.checkStrategy,show:!!O.value,"onUpdate:show":R,value:A.value,filter:L,"onUpdate:value":H,labelField:w.value,valueField:F.value,options:W.value,onLoad:q,onFocus:h(g)},f)}}),y({dataSource:"options"},j));export{g as SEARCH_CASCADER};
1
+ import{defineComponent as e,ref as t,computed as a,inject as l,watch as r,createVNode as n,nextTick as o}from"vue";import{isEqual as u,isArray as i,isString as s}from"lodash-es";import"../../../index.js";import{useCommonInjection as c}from"../../hooks/useCommonInjection.js";import{InjectionAsyncQueue as p,InjectionFormUUID as d}from"../../constants/index.js";import"../../../../../shared/utils/index.js";import"../../utils/index.js";import{useFormField as m}from"../../hooks/useFormField.js";import{NCascader as v}from"naive-ui";import"@vueuse/core";import"date-fns";import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/SyncBailHook.js";import"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/SyncLoopHook.js";import"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import"../../hooks/useFormValidator.js";import"@formily/core";import{connect as f,mapProps as y}from"@formily/vue";import"@vue/shared";import"./index.js";import"../../hooks/useFormRenderOptions.js";import{assignUpdateValue as h,createVisitedSetter as j,traverseDependKey as k}from"../../utils/schema.js";const g=f(e({name:"FormCascader",props:{options:{type:Array,default:()=>[]},depth:{type:[Number,String]},urlConfig:{type:Object},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},onFocus:{type:Function},filterable:{type:Boolean,default:!1},checkStrategy:{type:String,default:"child"},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},onChange:{},value:{}},emits:["update:value"],setup(e,{slots:f,emit:y}){const h=t(),{field:g,title:b}=m(),S=t(1),C=t(!0);const w=a((()=>{var t,a,l;return null!=(l=null!=(a=null==(t=e.urlConfig)?void 0:t.nameKey)?a:e.labelField)?l:"text"})),F=a((()=>{var t,a,l;return null!=(l=null!=(a=null==(t=e.urlConfig)?void 0:t.valueKey)?a:e.valueField)?l:"value"})),A=a((()=>{try{const t=Array.isArray(e.value)?e.value:JSON.parse(e.value||"");if(!Array.isArray(t)||!t.length)return null;const a=t.map((e=>e[F.value])).slice(-1).join(""),l=t.map((e=>e[w.value])).join(" / ");return a||l}catch(e){return null}}));function H(e,t,a){y("update:value",i(a)?a.map((function(e){return{...e,label:e[w.value],children:void 0,parent:void 0,mergeItemValue:void 0}})):null)}const x=l(p);async function q(t){e.filterable?await async function(){if(!e.urlConfig||h.value&&e.requestCache)return;const t=await x.addAsync({...e.urlConfig,params:{lvlnr:"1"},key:b.value,cache:e.requestCache});function a(e,t,r){const n=[...r,...l(e)],o={[w.value]:e[w.value],[F.value]:e[F.value],depth:t+1,isLeaf:!0,keyword:e.keyword,mergeItemValue:n};return i(e.children)&&(o.children=e.children.map((e=>a(e,t+1,n))),o.isLeaf=!e.children.length),S.value=Math.max(S.value,t+1),o}function l(e){let t=[];if(s(e[w.value])&&(t=[...t,e[w.value]]),s(e.keyword)&&e.keyword.length>0){const a=e.keyword.split(",");t=[...t,...a]}return t}h.value=t.map((e=>a(e,0,[])))}():await async function(t){if(r(e,t))return;const a=await x.addAsync(n(s(t),i(e),b.value,t));if(!a.length&&t)return t.isLeaf=!0,H(0,0,o(t)),void(O.value=!1);const l=a.map((e=>u(e,s(t))));function r(e,t){return!i(e)||!t&&h.value&&e.requestCache||s(t)>=s(e)-1}function n(t,a,l,r){const n={lvlnr:t+1+""};return r&&a.dependKey&&k(a.dependKey,((e,t)=>{n[t]=r[e]})),{params:n,...a,key:l,cache:e.requestCache}}function o(e){let t=e;const a=[e];for(;t.parent;)a.unshift(t.parent),t=t.parent;return a}function u(a,l){return{[w.value]:a[w.value],[F.value]:a[F.value],depth:l+1,parent:t,isLeaf:l+2>=s(e)}}function i(e){return e.urlConfig}function s(e){var t;return null!=(t=null==e?void 0:e.depth)?t:-1}t?t.children=l:h.value=l}(t),await B()}const V=`form-render__cascade--menu-${l(d)}`;async function B(){await o();const e=document.querySelector(`.${V} .v-vl`);e&&e.dispatchEvent(new CustomEvent("scroll"))}function L(t,a){if(!t||!a)return!1;const{mergeItemValue:l}=a;if(e.checkStrategy.includes("child")&&a.depth<S.value)return!1;return l.length>0&&l.some((e=>e.includes(t.trim())))}const{injectValueValidate:K,injectValueWatchFromEmpty:I,injectValueBindKey:E}=c();I((()=>e.value),q),K((()=>e.value)),r((()=>e.urlConfig),(async(t,a)=>{u(t,a)||(h.value=null,C.value?e.lazyRequest||(q(),C.value=!C.value):await q())}),{immediate:!0});const O=t(!1);function R(e){O.value=!!e,e&&q()}const W=a((()=>h.value||e.options||[])),z=a((()=>!e.filterable)),N=E(A);return()=>n(v,{key:N.value,remote:z.value,filterable:e.filterable,"menu-props":{class:V,onClick:B},"check-strategy":e.checkStrategy,show:!!O.value,"onUpdate:show":R,value:A.value,filter:L,"onUpdate:value":H,labelField:w.value,valueField:F.value,options:W.value,onLoad:q,onFocus:j(g)},f)}}),y({dataSource:"options"},h));export{g as SEARCH_CASCADER};
@@ -1 +1 @@
1
- import{defineComponent as e,computed as o,inject as t,ref as a,createVNode as l}from"vue";import{useDebounceFn as r}from"@vueuse/core";import{cloneDeep as s,isArray as n,isString as i}from"lodash-es";import{useCommonInjection as u,useSelectOptionProps as p}from"../../hooks/useCommonInjection.js";import{InjectionChangeContextCollector as m}from"../../constants/index.js";import"../../../../../shared/utils/index.js";import"../../../index.js";import"../../utils/index.js";import{useFormField as c}from"../../hooks/useFormField.js";import{NSelect as d}from"naive-ui";import"date-fns";import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/SyncBailHook.js";import"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/SyncLoopHook.js";import"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import"../../hooks/useFormValidator.js";import"@formily/core";import{connect as y,mapProps as v}from"@formily/vue";import"@vue/shared";import"./index.js";import{useUrlConfigOptions as f,useAutographOptions as h,useRecommendOptions as j,searchContentMatcher as b}from"../../hooks/useFormRenderOptions.js";import{createVisitedSetter as k,assignUpdateValue as S,assignClearBindVisited as g}from"../../utils/schema.js";const F=y(e({name:"FormSelect",props:{value:{type:[String,Array,Number]},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},onChange:{},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},allowCreate:Boolean,urlConfig:{type:Object},autograph:{type:String},wordbook:{type:Object},recommend:{type:Boolean,default:!1},commonList:{type:Array},recentList:{type:Array},getRecommendInfo:{type:Function},commonNum:{type:Number,default:10},recentNum:{type:Number,default:10},recommendCache:{type:Boolean,default:!1}},emits:["update:value","postRecommend"],setup(e,{slots:y,emit:v}){const S=o({get:()=>e.value,async set(e){v("update:value",e),C(e)}}),{labelKey:g,valueKey:F,fetchData:A,fullOptions:H,filterOptions:x}=e.urlConfig?f(e,S):h(e,S),{getRecommend:B,postRecommend:C,sortedOptions:O}=j(e,x,v,g,F),{field:R,fieldKey:L}=c();t(m).setContext(L.value,(e=>{return{currentOption:s((o=e,n(o)?function(e){const o=H.value.reduce(((e,o)=>(e[o[F.value]]=o,e)),{});return e.map((e=>o[e]))}(o):(t=o,H.value.find((e=>e[F.value]===t)))))};var o,t}));const N=a(""),V=r((async(e="")=>{N.value=e,A(e),B(e)}),300),{injectValueValidate:w,injectValueWatchFromEmpty:K,injectValueBindKey:P}=u();K(S,V),w(S);const W=P(S),{menuProps:q,nodeProps:I}=p();function U(e){const o=e[g.value];if(!o||!i(o))return"";const t=b(N.value,o);return t?l("section",null,[t.map(((e,o)=>0!==o&&e?l("span",{style:{color:o%2==0?"var(--n-option-text-color-active)":""}},[e]):null))]):o}const z=o((()=>O.value.length||!e.allowCreate?O.value:N.value?[{[g.value]:N.value,[F.value]:N.value},...O.value]:O.value));return()=>l(d,{key:W.value,remote:!0,filterable:!0,value:S.value,"onUpdate:value":e=>S.value=e,"menu-props":q,"node-props":I,labelField:g.value,valueField:F.value,options:z.value,onSearch:V,"onUpdate:show":e=>e&&V(),onFocus:k(R),renderLabel:U},y)}}),v({dataSource:"options"},S,g));export{F as SELECT};
1
+ import{defineComponent as e,computed as o,inject as t,ref as a,createVNode as l}from"vue";import{useDebounceFn as r}from"@vueuse/core";import{cloneDeep as s,isArray as n,isString as i}from"lodash-es";import{useCommonInjection as u,useSelectOptionProps as p}from"../../hooks/useCommonInjection.js";import{InjectionChangeContextCollector as m}from"../../constants/index.js";import"../../../../../shared/utils/index.js";import"../../../index.js";import"../../utils/index.js";import{useFormField as c}from"../../hooks/useFormField.js";import{NSelect as d}from"naive-ui";import"date-fns";import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/SyncBailHook.js";import"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/SyncLoopHook.js";import"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import"../../hooks/useFormValidator.js";import"@formily/core";import{connect as y,mapProps as v}from"@formily/vue";import"@vue/shared";import"./index.js";import{useUrlConfigOptions as f,useAutographOptions as h,useRecommendOptions as j,searchContentMatcher as b}from"../../hooks/useFormRenderOptions.js";import{assignUpdateValue as k,assignClearBindVisited as S,createVisitedSetter as g}from"../../utils/schema.js";const F=y(e({name:"FormSelect",props:{value:{type:[String,Array,Number]},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},onChange:{},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},allowCreate:Boolean,urlConfig:{type:Object},autograph:{type:String},wordbook:{type:Object},recommend:{type:Boolean,default:!1},commonList:{type:Array},recentList:{type:Array},getRecommendInfo:{type:Function},commonNum:{type:Number,default:10},recentNum:{type:Number,default:10},recommendCache:{type:Boolean,default:!1}},emits:["update:value","postRecommend"],setup(e,{slots:y,emit:v}){const k=o({get:()=>e.value,async set(e){v("update:value",e),C(e)}}),{labelKey:S,valueKey:F,fetchData:A,fullOptions:H,filterOptions:x}=e.urlConfig?f(e,k):h(e,k),{getRecommend:B,postRecommend:C,sortedOptions:O}=j(e,x,v,S,F),{field:R,fieldKey:L}=c();t(m).setContext(L.value,(e=>{return{currentOption:s((o=e,n(o)?function(e){const o=H.value.reduce(((e,o)=>(e[o[F.value]]=o,e)),{});return e.map((e=>o[e]))}(o):(t=o,H.value.find((e=>e[F.value]===t)))))};var o,t}));const N=a(""),V=r((async(e="")=>{N.value=e,A(e),B(e)}),300),{injectValueValidate:w,injectValueWatchFromEmpty:K,injectValueBindKey:P}=u();K(k,V),w(k);const W=P(k),{menuProps:q,nodeProps:I}=p();function U(e){const o=e[S.value];if(!o||!i(o))return"";const t=b(N.value,o);return t?l("section",null,[t.map(((e,o)=>0!==o&&e?l("span",{style:{color:o%2==0?"var(--n-option-text-color-active)":""}},[e]):null))]):o}const z=o((()=>O.value.length||!e.allowCreate?O.value:N.value?[{[S.value]:N.value,[F.value]:N.value},...O.value]:O.value));return()=>l(d,{key:W.value,remote:!0,filterable:!0,value:k.value,"onUpdate:value":e=>k.value=e,"menu-props":q,"node-props":I,labelField:S.value,valueField:F.value,options:z.value,onSearch:V,"onUpdate:show":e=>e&&V(),onFocus:g(R),renderLabel:U},y)}}),v({dataSource:"options"},k,S));export{F as SELECT};
@@ -1 +1 @@
1
- import{defineComponent as e,computed as o,openBlock as r,createBlock as i,unref as s,withCtx as t,createVNode as l,createElementVNode as n,createElementBlock as p,Fragment as a,renderList as m,toDisplayString as u}from"vue";import{HelpCircleOutline as g}from"@vicons/ionicons5";import{isString as f}from"lodash-es";import{NTooltip as v}from"naive-ui";import c from"../../../../_virtual/plugin-vue_export-helper.js";const _={style:{display:"inline-flex","flex-direction":"column"}};var d=c(e({__name:"tooltipMessage",props:{message:String},setup(e){const c=e,d=o((()=>f(c.message)?c.message.split("<br>"):[]));return(e,o)=>(r(),i(s(v),{trigger:"hover"},{trigger:t((()=>[l(s(g))])),default:t((()=>[n("section",_,[(r(!0),p(a,null,m(s(d),(e=>(r(),p("span",{key:e},u(e),1)))),128))])])),_:1}))}}),[["__file","tooltipMessage.vue"]]);export{d as default};
1
+ import e from"./tooltipMessage.vue2.js";import o from"../../../../_virtual/_plugin-vue_export-helper.js";var t=o(e,[["__file","tooltipMessage.vue"]]);export{t as default};
@@ -0,0 +1 @@
1
+ import{defineComponent as e,computed as o,openBlock as s,createBlock as r,unref as i,withCtx as t,createVNode as n,createElementVNode as a,createElementBlock as l,Fragment as m,renderList as p,toDisplayString as g}from"vue";import{HelpCircleOutline as f}from"@vicons/ionicons5";import{isString as u}from"lodash-es";import{NTooltip as c}from"naive-ui";const d={style:{display:"inline-flex","flex-direction":"column"}};var v=e({__name:"tooltipMessage",props:{message:String},setup(e){const v=e,x=o((()=>u(v.message)?v.message.split("<br>"):[]));return(e,o)=>(s(),r(i(c),{trigger:"hover"},{trigger:t((()=>[n(i(f))])),default:t((()=>[a("section",d,[(s(!0),l(m,null,p(i(x),(e=>(s(),l("span",{key:e},g(e),1)))),128))])])),_:1}))}});export{v as default};
@@ -1 +1 @@
1
- import{reactive as e,defineComponent as t,inject as r,provide as n,computed as l,watch as o,onUnmounted as a,onMounted as i,withModifiers as s,createVNode as c,mergeProps as u}from"vue";import{checkInSetupEnv as d}from"../../../../shared/utils/index.js";import{useField as p,useForm as m,RecursionField as f}from"@formily/vue";import{noop as v,isArray as h,isNumber as y}from"lodash-es";import"../../index.js";import{InjectionFormUUID as g,InjectionBusinessCollector as b}from"../constants/index.js";import{useFieldListAdaptor as F}from"./useFieldListAdaptor.js";import{createObjSchema as x}from"../utils/schema.js";const S=e(new Map);function j(e,t,r=0){S.set(e,S.get(e)||{});S.get(e)[t+""]=r}function O(e,t,r=!0){const n=S.get(e);return n?Object.entries(n).reduce(((e,[n,l])=>r&&n===`${t}`||n.startsWith(`${t}.`)?e+l:e),0):0}function $(e,t){const r=S.get(e);r&&Reflect.deleteProperty(r,t+"")}function k(e){S.delete(e)}const E=t({props:{fieldItems:{type:Array,default:()=>[]},childFieldStrategy:{type:String,default:"checked"},name:{type:String,required:!0}},setup(e){const t=r(g),d=r(b),h=p(),y=r(t+"_virtualParent",""),S=`${y?y+".":""}${h.value.address}`;function k(e){return`${S}.${e}`}n(t+"_virtualParent",S);const{schemaAdaptor:E}=F(d);function K(t){var r,n;return Object.assign(t,{"x-decorator-props":{...t["x-decorator-props"],labelPlacement:"left",showFeedback:!1,showLabel:!!t.title},"x-component-props":{...t["x-component-props"],childFieldStrategy:null!=(n=null==(r=t["x-component-props"])?void 0:r.childFieldStrategy)?n:e.childFieldStrategy,size:"small"}})}const P=l((()=>{const t=E(e.fieldItems);return Object.values(t).forEach(K),x(t)}));o(P,(()=>{return e=P.value,void Object.values(e.properties||{}).forEach((e=>{var r;j(t,k(e.name),null==(r=null==e?void 0:e["x-decorator-props"])?void 0:r.span)}));var e}),{immediate:!0});const _=m();function w(){return e.fieldItems.map((e=>_.value.query(e.val_key).take()))}a((()=>{var e;w().forEach((e=>{e&&(e.display="none")})),e=P.value,Object.values(e.properties||{}).forEach((e=>{$(t,k(e.name))}))})),i((()=>{w().forEach((e=>{e&&(e.display="visible")}))}));const I=s(v,["stop"]),A=["onClick","onKeydown","onKeyup","onKeypress"].reduce(((e,t)=>(e[t]=I,e)),{});return()=>{return c("section",u({class:"form-render__labelField",style:{"--column":(e=P.value,Object.values(e.properties||{}).reduce(((e,r)=>e+O(t,k(r.name))),0))}},A),[c(f,{basePath:".",schema:P.value},null)]);var e}}});function K(e,t){d();const r=l((()=>e.options.some((e=>h(e.childrenFields)&&e.childrenFields.length))));function n(e,t,r="value"){if(h(e)?e.includes(t[r]):e===t[r])return h(t.childrenFields)&&t.childrenFields.length}return{renderComplexOption:function({value:e,option:t,valueKey:l="value",labelKey:o="label",childFieldStrategy:a}){return[t[o],r.value&&("all"===a||n(e,t,l))?c(E,{fieldItems:t.childrenFields,name:t[l],childFieldStrategy:a},null):null]},valueRef:l({get(){return t=e.value,y(t)?t+"":t;var t},set(e){t("update:value",e)}}),hasComplexOption:r}}function P(){return{getSpan:O,setSpan:j,deleteSpan:$,clearSpan:k}}export{K as useComplexOptions,P as useComplexOptionsSpan};
1
+ import{reactive as e,computed as t,createVNode as r,defineComponent as n,inject as l,provide as o,watch as a,onUnmounted as i,onMounted as s,withModifiers as c,mergeProps as u}from"vue";import{checkInSetupEnv as d}from"../../../../shared/utils/index.js";import{useField as p,useForm as m,RecursionField as f}from"@formily/vue";import{isArray as v,isNumber as h,noop as y}from"lodash-es";import"../../index.js";import{InjectionFormUUID as g,InjectionBusinessCollector as b}from"../constants/index.js";import{useFieldListAdaptor as F}from"./useFieldListAdaptor.js";import{createObjSchema as x}from"../utils/schema.js";const S=e(new Map);function j(e,t,r=0){S.set(e,S.get(e)||{});S.get(e)[t+""]=r}function O(e,t,r=!0){const n=S.get(e);return n?Object.entries(n).reduce(((e,[n,l])=>r&&n===`${t}`||n.startsWith(`${t}.`)?e+l:e),0):0}function $(e,t){const r=S.get(e);r&&Reflect.deleteProperty(r,t+"")}function k(e){S.delete(e)}const E=n({props:{fieldItems:{type:Array,default:()=>[]},childFieldStrategy:{type:String,default:"checked"},name:{type:String,required:!0}},setup(e){const n=l(g),d=l(b),v=p(),h=l(n+"_virtualParent",""),S=`${h?h+".":""}${v.value.address}`;function k(e){return`${S}.${e}`}o(n+"_virtualParent",S);const{schemaAdaptor:E}=F(d);function K(t){var r,n;return Object.assign(t,{"x-decorator-props":{...t["x-decorator-props"],labelPlacement:"left",showFeedback:!1,showLabel:!!t.title},"x-component-props":{...t["x-component-props"],childFieldStrategy:null!=(n=null==(r=t["x-component-props"])?void 0:r.childFieldStrategy)?n:e.childFieldStrategy,size:"small"}})}const P=t((()=>{const t=E(e.fieldItems);return Object.values(t).forEach(K),x(t)}));a(P,(()=>{return e=P.value,void Object.values(e.properties||{}).forEach((e=>{var t;j(n,k(e.name),null==(t=null==e?void 0:e["x-decorator-props"])?void 0:t.span)}));var e}),{immediate:!0});const _=m();function w(){return e.fieldItems.map((e=>_.value.query(e.val_key).take()))}i((()=>{var e;w().forEach((e=>{e&&(e.display="none")})),e=P.value,Object.values(e.properties||{}).forEach((e=>{$(n,k(e.name))}))})),s((()=>{w().forEach((e=>{e&&(e.display="visible")}))}));const I=c(y,["stop"]),A=["onClick","onKeydown","onKeyup","onKeypress"].reduce(((e,t)=>(e[t]=I,e)),{});return()=>{return r("section",u({class:"form-render__labelField",style:{"--column":(e=P.value,Object.values(e.properties||{}).reduce(((e,t)=>e+O(n,k(t.name))),0))}},A),[r(f,{basePath:".",schema:P.value},null)]);var e}}});function K(e,n){d();const l=t((()=>e.options.some((e=>v(e.childrenFields)&&e.childrenFields.length))));function o(e,t,r="value"){if(v(e)?e.includes(t[r]):e===t[r])return v(t.childrenFields)&&t.childrenFields.length}return{renderComplexOption:function({value:e,option:t,valueKey:n="value",labelKey:a="label",childFieldStrategy:i}){return[t[a],l.value&&("all"===i||o(e,t,n))?r(E,{fieldItems:t.childrenFields,name:t[n],childFieldStrategy:i},null):null]},valueRef:t({get(){return t=e.value,h(t)?t+"":t;var t},set(e){n("update:value",e)}}),hasComplexOption:l}}function P(){return{getSpan:O,setSpan:j,deleteSpan:$,clearSpan:k}}export{K as useComplexOptions,P as useComplexOptionsSpan};
@@ -1 +1 @@
1
- import{defineComponent as e,createVNode as t,provide as r}from"vue";import{useTheme as s}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{isFunction as n,range as i}from"lodash-es";import{widthAppend as o}from"../../../shared/utils/index.js";import{NSpace as l,NButton as u}from"naive-ui";const d=e({props:{config:{type:Object,required:!0,default:()=>({})},index:{type:Number,required:!0},length:{type:Number,required:!0}},emits:["cancel","next","toNext"],setup(e,{emit:r,slots:d}){const p=s();function a(e,{skippable:s=!0,skipText:o="跳过",nextText:d="下一步",endText:p="结束引导"},a,c){var f;return t("footer",{class:"guide__stepFooter"},[null!=(f=n(e)?e():null)?f:t(l,{justify:"end",wrapItem:!1},{default:()=>[m(),s?t(u,{ghost:!0,bordered:!1,class:"guide__stepSkipBtn",textColor:"#c5c5c5",onClick:()=>r("cancel")},{default:()=>o}):null,t(u,{type:"primary",class:"guide__stepNextBtn",onClick:()=>r("next")},{default:()=>a===c-1?p:d})]})]);function m(){return t(l,{justify:"start",style:"flex:1"},{default:function(){return i(c).map((e=>t(u,{class:"guide__stepToBtn",bordered:!1,onClick:()=>r("toNext",e)},{default:()=>t("i",{class:["guide__stepToBtnContent",{guide__stepActiveBtn:e===a}]},null)})))}})}}return()=>{const{minWidth:r=240,maxWidth:s=300,pointer:i=!0}=e.config;return t("section",{class:"guide__stepContentWrapper",style:{minWidth:o(r),maxWidth:o(s),...p.value}},[i?t("div",{class:"guide__stepPointerWrapper"},[t("div",{class:"guide__stepPointer"},null),t("div",{class:"guide__stepPointerLine"},null)]):null,(u=d.header,t("header",{class:"guide__stepHeader"},[n(u)?u():null])),(l=d.body,t("section",{class:"guide__stepBody"},[n(l)?l():null])),a(d.footer,e.config,e.index,e.length)]);var l,u}}});function p(s){return s?e({setup(e,{attrs:n,slots:i}){const o=[];let l=(null==s?void 0:s.parent)&&Reflect.get(s.parent,"provides");for(;l;)Object.entries(l).forEach((([e,t])=>{o.includes(e)||(o.push(e),r(e,t))})),l=Object.getPrototypeOf(l);return()=>t(d,n,i)}}):d}export{p as createGuideStep};
1
+ import{defineComponent as e,provide as t,createVNode as r}from"vue";import{useTheme as s}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{isFunction as n,range as i}from"lodash-es";import{widthAppend as o}from"../../../shared/utils/index.js";import{NSpace as l,NButton as u}from"naive-ui";const d=e({props:{config:{type:Object,required:!0,default:()=>({})},index:{type:Number,required:!0},length:{type:Number,required:!0}},emits:["cancel","next","toNext"],setup(e,{emit:t,slots:d}){const p=s();function a(e,{skippable:s=!0,skipText:o="跳过",nextText:d="下一步",endText:p="结束引导"},a,c){var f;return r("footer",{class:"guide__stepFooter"},[null!=(f=n(e)?e():null)?f:r(l,{justify:"end",wrapItem:!1},{default:()=>[m(),s?r(u,{ghost:!0,bordered:!1,class:"guide__stepSkipBtn",textColor:"#c5c5c5",onClick:()=>t("cancel")},{default:()=>o}):null,r(u,{type:"primary",class:"guide__stepNextBtn",onClick:()=>t("next")},{default:()=>a===c-1?p:d})]})]);function m(){return r(l,{justify:"start",style:"flex:1"},{default:function(){return i(c).map((e=>r(u,{class:"guide__stepToBtn",bordered:!1,onClick:()=>t("toNext",e)},{default:()=>r("i",{class:["guide__stepToBtnContent",{guide__stepActiveBtn:e===a}]},null)})))}})}}return()=>{const{minWidth:t=240,maxWidth:s=300,pointer:i=!0}=e.config;return r("section",{class:"guide__stepContentWrapper",style:{minWidth:o(t),maxWidth:o(s),...p.value}},[i?r("div",{class:"guide__stepPointerWrapper"},[r("div",{class:"guide__stepPointer"},null),r("div",{class:"guide__stepPointerLine"},null)]):null,(u=d.header,r("header",{class:"guide__stepHeader"},[n(u)?u():null])),(l=d.body,r("section",{class:"guide__stepBody"},[n(l)?l():null])),a(d.footer,e.config,e.index,e.length)]);var l,u}}});function p(s){return s?e({setup(e,{attrs:n,slots:i}){const o=[];let l=(null==s?void 0:s.parent)&&Reflect.get(s.parent,"provides");for(;l;)Object.entries(l).forEach((([e,r])=>{o.includes(e)||(o.push(e),t(e,r))})),l=Object.getPrototypeOf(l);return()=>r(d,n,i)}}):d}export{p as createGuideStep};
@@ -41,6 +41,11 @@ declare const IhoSelectLabel: SFCWithInstall<import("vue").DefineComponent<{
41
41
  maxHeight: string;
42
42
  };
43
43
  closeTag: (selectItem: import("./src/types").ISelectLabelItemType) => void;
44
+ formatActiveStyle: (activeItem: import("./src/types").ISelectLabelItemType) => {
45
+ background: string;
46
+ color: string;
47
+ borderColor: string;
48
+ };
44
49
  handleEditLabel: () => void;
45
50
  handleLabelCancel: () => void;
46
51
  changeModalWindow: () => void;
@@ -1 +1 @@
1
- import{defineComponent as e,ref as l,watch as a,openBlock as t,createElementBlock as s,createCommentVNode as i,withDirectives as r,createElementVNode as o,normalizeClass as c,createVNode as n,unref as d,withCtx as f,Fragment as p,renderList as y,createBlock as u,createTextVNode as b,toDisplayString as m,vShow as v}from"vue";import{NAnchor as g,NAnchorLink as h}from"naive-ui";import C from"./components/label-classify.vue.js";import L from"../../../_virtual/plugin-vue_export-helper.js";const w={key:0,class:"label-disable-wrap"},x=[o("p",{class:"label-disable-title"},"无可选标签",-1),o("p",{class:"label-disable-desc"},"请联系管理员进行标签管理设置",-1)],I={style:{height:"100%"}},k={class:"label-wrap"},N=["id"];var _=L(e({__name:"LabelFormContent",props:{selectedList:{type:Array,default:()=>[]},categoryList:{type:Array,default:()=>[]},isChangeWindow:{type:Boolean,default:!1},explicit:{type:Boolean,default:!1}},emits:["explicitOnChange"],setup(e,{expose:L,emit:_}){const S=e,A=l(),F=l(null),O=()=>{var e;return null==(e=F.value)?void 0:e.querySelector(".right-label-wrap")},$=e=>{e.preventDefault()},W=(e,l,a)=>{let t=A.value||[];if(e)t.push({classifyId:a.classifyId,classifyName:a.classifyName,labelCode:l.labelCode,labelShowText:l.labelShowText,backgroundColor:l.backgroundColor});else{const e=t.findIndex((e=>e.classifyId===a.classifyId&&e.labelCode===l.labelCode));e>-1&&t.splice(e,1)}A.value=t,S.explicit&&_("explicitOnChange",t)};return a((()=>S.selectedList),(e=>{if(e){let l=Array.isArray(e)?e:[];A.value=JSON.parse(JSON.stringify(l))}}),{immediate:!0,deep:!0}),L({handleLabelForm:e=>{e([...A.value||[]])}}),(l,a)=>(t(),s("div",{class:"c-iho-label-form-content",ref_key:"labelFormContent",ref:F},[e.categoryList.length?i("v-if",!0):(t(),s("div",w,x)),r(o("div",I,[o("div",k,[o("div",{class:c(["left-label-wrap",{"total-left-label-wrap":e.isChangeWindow}])},[n(d(g),{"offset-target":O,type:"block",onClick:$},{default:f((()=>[(t(!0),s(p,null,y(e.categoryList,(e=>(t(),u(d(h),{key:e.classifyId,href:`#${e.classifyId}-${e.classifyName}`,title:e.classifyName},null,8,["href","title"])))),128))])),_:1})],2),o("div",{class:c(["right-label-wrap",{"total-right-label-wrap":e.isChangeWindow}])},[(t(!0),s(p,null,y(e.categoryList,((e,l)=>(t(),s("div",{key:l,class:"edit-label-content"},[o("div",{class:"edit-label",id:`${e.classifyId}-${e.classifyName}`},[b(m(e.classifyName),1),i(" <span class=\"edit-label-type\">({{ v.multipleChoice == 2 ? '单' : '多' }}选)</span> ")],8,N),n(C,{categoryItem:e,selectedList:A.value,handleLabelChange:W},null,8,["categoryItem","selectedList"])])))),128))],2)])],512),[[v,e.categoryList.length>0]])],512))}}),[["__file","LabelFormContent.vue"]]);export{_ as default};
1
+ import e from"./LabelFormContent.vue2.js";import r from"../../../_virtual/_plugin-vue_export-helper.js";var o=r(e,[["__file","LabelFormContent.vue"]]);export{o as default};
@@ -0,0 +1 @@
1
+ import{defineComponent as e,ref as l,watch as a,openBlock as t,createElementBlock as s,createCommentVNode as i,withDirectives as o,createElementVNode as r,normalizeClass as c,createVNode as d,unref as n,withCtx as f,Fragment as y,renderList as p,createBlock as b,createTextVNode as u,toDisplayString as m,vShow as g}from"vue";import{NAnchor as v,NAnchorLink as h}from"naive-ui";import C from"./components/label-classify.vue.js";const w={key:0,class:"label-disable-wrap"},L=[r("p",{class:"label-disable-title"},"无可选标签",-1),r("p",{class:"label-disable-desc"},"请联系管理员进行标签管理设置",-1)],I={style:{height:"100%"}},x={class:"label-wrap"},k=["id"];var N=e({__name:"LabelFormContent",props:{selectedList:{type:Array,default:()=>[]},categoryList:{type:Array,default:()=>[]},isChangeWindow:{type:Boolean,default:!1},explicit:{type:Boolean,default:!1}},emits:["explicitOnChange"],setup(e,{expose:N,emit:S}){const A=e,O=l(),$=l(null),_=()=>{var e;return null==(e=$.value)?void 0:e.querySelector(".right-label-wrap")},F=e=>{e.preventDefault()},W=(e,l,a)=>{let t=O.value||[];if(e)t.push({classifyId:a.classifyId,classifyName:a.classifyName,labelCode:l.labelCode,labelShowText:l.labelShowText,backgroundColor:l.backgroundColor});else{const e=t.findIndex((e=>e.classifyId===a.classifyId&&e.labelCode===l.labelCode));e>-1&&t.splice(e,1)}O.value=t,A.explicit&&S("explicitOnChange",t)};return a((()=>A.selectedList),(e=>{if(e){let l=Array.isArray(e)?e:[];O.value=JSON.parse(JSON.stringify(l))}}),{immediate:!0,deep:!0}),N({handleLabelForm:e=>{e([...O.value||[]])}}),(l,a)=>(t(),s("div",{class:"c-iho-label-form-content",ref_key:"labelFormContent",ref:$},[e.categoryList.length?i("v-if",!0):(t(),s("div",w,L)),o(r("div",I,[r("div",x,[r("div",{class:c(["left-label-wrap",{"total-left-label-wrap":e.isChangeWindow}])},[d(n(v),{"offset-target":_,type:"block",onClick:F},{default:f((()=>[(t(!0),s(y,null,p(e.categoryList,(e=>(t(),b(n(h),{key:e.classifyId,href:`#${e.classifyId}-${e.classifyName}`,title:e.classifyName},null,8,["href","title"])))),128))])),_:1})],2),r("div",{class:c(["right-label-wrap",{"total-right-label-wrap":e.isChangeWindow}])},[(t(!0),s(y,null,p(e.categoryList,((e,l)=>(t(),s("div",{key:l,class:"edit-label-content"},[r("div",{class:"edit-label",id:`${e.classifyId}-${e.classifyName}`},[u(m(e.classifyName),1),i(" <span class=\"edit-label-type\">({{ v.multipleChoice == 2 ? '单' : '多' }}选)</span> ")],8,k),d(C,{categoryItem:e,selectedList:O.value,handleLabelChange:W},null,8,["categoryItem","selectedList"])])))),128))],2)])],512),[[g,e.categoryList.length>0]])],512))}});export{N as default};
@@ -41,6 +41,11 @@ declare const _default: import("vue").DefineComponent<{
41
41
  maxHeight: string;
42
42
  };
43
43
  closeTag: (selectItem: ISelectLabelItemType) => void;
44
+ formatActiveStyle: (activeItem: ISelectLabelItemType) => {
45
+ background: string;
46
+ color: string;
47
+ borderColor: string;
48
+ };
44
49
  handleEditLabel: () => void;
45
50
  handleLabelCancel: () => void;
46
51
  changeModalWindow: () => void;
@@ -1 +1 @@
1
- import{defineComponent as e,ref as l,reactive as i,watch as a,openBlock as t,createElementBlock as o,Fragment as n,createElementVNode as s,createBlock as d,unref as c,withCtx as r,renderList as p,createVNode as h,toDisplayString as m,createTextVNode as g,createCommentVNode as u,normalizeClass as x,normalizeStyle as b}from"vue";import{NSpace as f,NTag as C,NTooltip as y,NIcon as v,NModal as w}from"naive-ui";import{AddCircleOutline as L}from"@vicons/ionicons5";import W from"./LabelFormContent.vue.js";import _ from"../../../_virtual/plugin-vue_export-helper.js";const k={class:"c-iho-select-label"},H={key:1,class:"outexplicit"},z=s("span",null,"选择标签",-1),S={class:"svg-wrap"};var V=_(e({__name:"SelectLabel",props:{selectedList:{type:Array,default:()=>[]},categoryList:{type:Array,default:()=>[]},explicit:{type:Boolean,default:!1}},emits:["onChange"],setup(e,{emit:_}){const V=e,A=l(null),F=l(),I=i({labelVisible:!1,isChangeWindow:!1,modalWidth:"763px",modalHeight:"404px",maxHeight:"404px"}),O=()=>{V.explicit||(I.labelVisible=!0)},N=()=>{V.explicit||(I.modalWidth="763px",I.modalHeight="404px",I.maxHeight="404px",I.isChangeWindow=!1,I.labelVisible=!1)},j=()=>{I.isChangeWindow=!I.isChangeWindow;let e=document.body.clientHeight;I.modalWidth="763px"===I.modalWidth?"100%":"763px",I.modalHeight="404px"===I.modalHeight?e-110+"px":"404px",I.maxHeight="auto"===I.modalHeight?"404px":"none"},E=()=>{var e;null==(e=A.value)||e.handleLabelForm((e=>{_("onChange",[...e]),F.value=e,N()}))},J=()=>{E()};return a((()=>V.selectedList),(e=>{if(e){let l=Array.isArray(e)?e:[];F.value=JSON.parse(JSON.stringify(l))}}),{immediate:!0,deep:!0}),(l,i)=>(t(),o(n,null,[s("div",k,[e.explicit?u("v-if",!0):(t(),d(c(f),{key:0,align:"center"},{default:r((()=>[(t(!0),o(n,null,p(F.value,(e=>(t(),d(c(C),{bordered:!1,key:`${e.classifyId}-${e.labelCode}`,class:"select-label-active",size:"small",closable:"",onClose:l=>(e=>{const l=F.value||[],i=l.findIndex((l=>l.classifyId==e.classifyId&&l.labelCode==e.labelCode));i>-1&&l.splice(i,1),F.value=l,_("onChange",[...l])})(e)},{default:r((()=>[h(c(y),{placement:"top-start"},{trigger:r((()=>[s("span",null,m(e.labelShowText),1)])),default:r((()=>[s("span",null,m(e.labelShowText),1)])),_:2},1024)])),_:2},1032,["onClose"])))),128)),e.explicit?u("v-if",!0):(t(),o("span",{key:0,class:"form-add-icon form-add-icon-label",onClick:O},[h(c(v),{class:"add-icon",component:c(L)},null,8,["component"]),g(" 新增 ")]))])),_:1})),e.explicit?(t(),o("div",H,[h(W,{ref_key:"labelFormContentRef",ref:A,categoryList:e.categoryList,selectedList:e.selectedList,isChangeWindow:I.isChangeWindow,explicit:e.explicit,onExplicitOnChange:J},null,8,["categoryList","selectedList","isChangeWindow","explicit"])])):u("v-if",!0)]),u(" 弹窗 "),h(c(w),{preset:"dialog",class:x(["label-form-modal-wrap modal-wrap standard-modal standard-modal-white",{"modal-screen":I.isChangeWindow}]),show:I.labelVisible,"onUpdate:show":i[0]||(i[0]=e=>I.labelVisible=e),onPositiveClick:E,onNegativeClick:N,onClose:N,"mask-closable":!1,"close-on-esc":!1,"show-icon":!1,"negative-text":"取消","positive-text":"确定",style:b({width:I.modalWidth})},{header:r((()=>[z,s("div",S,[s("i",{onClick:j,class:x(["iconfont-select-label",I.isChangeWindow?"icon-iho-select-label-menzhenyishengzhanxitongtubiaozuixiaohua2":"icon-iho-select-label-menzhenyishengzhanxitongtubiaozuidahua"])},null,2)])])),default:r((()=>[h(W,{ref_key:"labelFormContentRef",ref:A,categoryList:e.categoryList,selectedList:F.value,isChangeWindow:I.isChangeWindow,explicit:e.explicit,onExplicitOnChange:J},null,8,["categoryList","selectedList","isChangeWindow","explicit"])])),_:1},8,["show","class","style"])],64))}}),[["__file","SelectLabel.vue"]]);export{V as default};
1
+ import e from"./SelectLabel.vue2.js";import l from"../../../_virtual/_plugin-vue_export-helper.js";var r=l(e,[["__file","SelectLabel.vue"]]);export{r as default};
@@ -0,0 +1 @@
1
+ import{defineComponent as e,ref as l,reactive as i,watch as a,openBlock as t,createElementBlock as o,Fragment as n,createElementVNode as s,createBlock as d,unref as c,withCtx as r,renderList as p,normalizeStyle as h,createVNode as g,toDisplayString as m,createTextVNode as u,createCommentVNode as x,normalizeClass as b}from"vue";import{NSpace as f,NTag as C,NTooltip as y,NIcon as v,NModal as w}from"naive-ui";import{AddCircleOutline as L}from"@vicons/ionicons5";import W from"./LabelFormContent.vue.js";const k={class:"c-iho-select-label"},H={key:1,class:"outexplicit"},_=s("span",null,"选择标签",-1),z={class:"svg-wrap"};var S=e({__name:"SelectLabel",props:{selectedList:{type:Array,default:()=>[]},categoryList:{type:Array,default:()=>[]},explicit:{type:Boolean,default:!1}},emits:["onChange"],setup(e,{emit:S}){const V=e,A=l(null),F=l(),I=i({labelVisible:!1,isChangeWindow:!1,modalWidth:"763px",modalHeight:"404px",maxHeight:"404px"}),O=()=>{V.explicit||(I.labelVisible=!0)},N=()=>{V.explicit||(I.modalWidth="763px",I.modalHeight="404px",I.maxHeight="404px",I.isChangeWindow=!1,I.labelVisible=!1)},E=()=>{I.isChangeWindow=!I.isChangeWindow;let e=document.body.clientHeight;I.modalWidth="763px"===I.modalWidth?"100%":"763px",I.modalHeight="404px"===I.modalHeight?e-110+"px":"404px",I.maxHeight="auto"===I.modalHeight?"404px":"none"},J=()=>{var e;null==(e=A.value)||e.handleLabelForm((e=>{S("onChange",[...e]),F.value=e,N()}))},R=()=>{J()};return a((()=>V.selectedList),(e=>{if(e){let l=Array.isArray(e)?e:[];F.value=JSON.parse(JSON.stringify(l))}}),{immediate:!0,deep:!0}),(l,i)=>(t(),o(n,null,[s("div",k,[e.explicit?x("v-if",!0):(t(),d(c(f),{key:0,align:"center"},{default:r((()=>[(t(!0),o(n,null,p(F.value,(e=>{return t(),d(c(C),{bordered:!1,key:`${e.classifyId}-${e.labelCode}`,class:"select-label-active",style:h((l=e,{background:l.backgroundColor,color:"#fff",borderColor:l.backgroundColor})),size:"small",closable:"",onClose:l=>(e=>{const l=F.value||[],i=l.findIndex((l=>l.classifyId==e.classifyId&&l.labelCode==e.labelCode));i>-1&&l.splice(i,1),F.value=l,S("onChange",[...l])})(e)},{default:r((()=>[g(c(y),{placement:"top-start",duration:0},{trigger:r((()=>[s("span",null,m(e.labelShowText),1)])),default:r((()=>[s("span",null,m(e.labelShowText),1)])),_:2},1024)])),_:2},1032,["style","onClose"]);var l})),128)),e.explicit?x("v-if",!0):(t(),o("span",{key:0,class:"form-add-icon form-add-icon-label",onClick:O},[g(c(v),{class:"add-icon",component:c(L)},null,8,["component"]),u(" 新增 ")]))])),_:1})),e.explicit?(t(),o("div",H,[g(W,{ref_key:"labelFormContentRef",ref:A,categoryList:e.categoryList,selectedList:e.selectedList,isChangeWindow:I.isChangeWindow,explicit:e.explicit,onExplicitOnChange:R},null,8,["categoryList","selectedList","isChangeWindow","explicit"])])):x("v-if",!0)]),x(" 弹窗 "),g(c(w),{preset:"dialog",class:b(["label-form-modal-wrap modal-wrap standard-modal standard-modal-white",{"modal-screen":I.isChangeWindow}]),show:I.labelVisible,"onUpdate:show":i[0]||(i[0]=e=>I.labelVisible=e),onPositiveClick:J,onNegativeClick:N,onClose:N,"mask-closable":!1,"close-on-esc":!1,"show-icon":!1,"negative-text":"取消","positive-text":"确定",style:h({width:I.modalWidth})},{header:r((()=>[_,s("div",z,[s("i",{onClick:E,class:b(["iconfont-select-label",I.isChangeWindow?"icon-iho-select-label-menzhenyishengzhanxitongtubiaozuixiaohua2":"icon-iho-select-label-menzhenyishengzhanxitongtubiaozuidahua"])},null,2)])])),default:r((()=>[g(W,{ref_key:"labelFormContentRef",ref:A,categoryList:e.categoryList,selectedList:F.value,isChangeWindow:I.isChangeWindow,explicit:e.explicit,onExplicitOnChange:R},null,8,["categoryList","selectedList","isChangeWindow","explicit"])])),_:1},8,["show","class","style"])],64))}});export{S as default};
@@ -1 +1 @@
1
- import{defineComponent as e,ref as l,openBlock as a,createElementBlock as t,unref as o,Fragment as s,renderList as c,createBlock as d,normalizeStyle as r,withCtx as n,createVNode as i,createElementVNode as b,toDisplayString as u}from"vue";import{NTag as p,NTooltip as y}from"naive-ui";import f from"../../../../_virtual/plugin-vue_export-helper.js";const g={class:"edit-content"},h={key:0,class:"label-disable-wrap"},m=[b("p",{class:"label-disable-title"},"无可选标签",-1),b("p",{class:"label-disable-desc"},"请联系管理员进行标签管理设置",-1)],k={key:1,class:"label-content"};var v=f(e({__name:"label-classify",props:{categoryItem:{type:Object,default:()=>({})},selectedList:{type:Array,default:()=>[]},handleLabelChange:{type:Function,default:()=>({})}},setup(e){var f;const v=e,C="rgb(85, 133, 245)";let _=l((null==(f=v.categoryItem)?void 0:f.labelList)||[]);const I=e=>v.selectedList.findIndex((l=>l.classifyId===v.categoryItem.classifyId&&l.labelCode===e.labelCode))>-1;function x(e){return I(e)?{background:e.backgroundColor||C,borderColor:e.backgroundColor||C}:{}}return(l,f)=>(a(),t("div",g,[o(_)&&0!==o(_).length?(a(),t("div",k,[(a(!0),t(s,null,c(o(_),(l=>(a(),d(o(p),{checkable:"",checked:I(l),"onUpdate:checked":a=>((e,l,a)=>{v.handleLabelChange(e,l,a)})(a,l,e.categoryItem),key:l.labelCode,style:r(x(l))},{default:n((()=>[i(o(y),{placement:"top-start"},{trigger:n((()=>[b("span",null,u(l.labelShowText),1)])),default:n((()=>[b("span",null,u(l.labelShowText),1)])),_:2},1024)])),_:2},1032,["checked","onUpdate:checked","style"])))),128))])):(a(),t("div",h,m))]))}}),[["__file","label-classify.vue"]]);export{v as default};
1
+ import e from"./label-classify.vue2.js";import l from"../../../../_virtual/_plugin-vue_export-helper.js";var r=l(e,[["__file","label-classify.vue"]]);export{r as default};
@@ -0,0 +1 @@
1
+ import{defineComponent as e,ref as l,openBlock as a,createElementBlock as t,unref as c,Fragment as d,renderList as o,createBlock as s,normalizeStyle as n,withCtx as r,createVNode as i,createElementVNode as b,toDisplayString as u}from"vue";import{NTag as p,NTooltip as y}from"naive-ui";const f={class:"edit-content"},g={key:0,class:"label-disable-wrap"},h=[b("p",{class:"label-disable-title"},"无可选标签",-1),b("p",{class:"label-disable-desc"},"请联系管理员进行标签管理设置",-1)],k={key:1,class:"label-content"};var m=e({__name:"label-classify",props:{categoryItem:{type:Object,default:()=>({})},selectedList:{type:Array,default:()=>[]},handleLabelChange:{type:Function,default:()=>({})}},setup(e){var m;const v=e,C="rgb(85, 133, 245)";let I=l((null==(m=v.categoryItem)?void 0:m.labelList)||[]);const L=e=>v.selectedList.findIndex((l=>l.classifyId===v.categoryItem.classifyId&&l.labelCode===e.labelCode))>-1;function x(e){return L(e)?{background:e.backgroundColor||C,borderColor:e.backgroundColor||C}:{}}return(l,m)=>(a(),t("div",f,[c(I)&&0!==c(I).length?(a(),t("div",k,[(a(!0),t(d,null,o(c(I),(l=>(a(),s(c(p),{checkable:"",checked:L(l),"onUpdate:checked":a=>((e,l,a)=>{v.handleLabelChange(e,l,a)})(a,l,e.categoryItem),key:l.labelCode,style:n(x(l))},{default:r((()=>[i(c(y),{placement:"top-start",duration:0},{trigger:r((()=>[b("span",null,u(l.labelShowText),1)])),default:r((()=>[b("span",null,u(l.labelShowText),1)])),_:2},1024)])),_:2},1032,["checked","onUpdate:checked","style"])))),128))])):(a(),t("div",g,h))]))}});export{m as default};
@@ -1 +1 @@
1
- @font-face{font-family:iho-select-label-iconfont;src:url(iho-select-label-iconfont.ttf) format("truetype")}.iconfont-select-label{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:iho-select-label-iconfont!important;font-size:14px;font-style:normal}.icon-iho-select-label-menzhenyishengzhanxitongtubiaozuixiaohua2:before{content:"\e778"}.icon-iho-select-label-menzhenyishengzhanxitongtubiaozuidahua:before{content:"\e779"}.c-iho-select-label .form-add-icon-label{align-items:center;color:#2d7aff;cursor:pointer;display:inline-flex;vertical-align:middle}.c-iho-select-label .n-tag{border:1px solid #e0e0e6;margin:0 8px 0 0;max-width:108px}.c-iho-select-label .n-tag .n-base-icon{color:#fff}.c-iho-select-label .n-tag .n-tag__content{align-items:center;display:inline-block;line-height:20px;max-width:80px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.c-iho-select-label .n-tag.select-label-active{background:var(--n-color-checked);border-color:var(--n-color-checked);color:var(--n-text-color-checked)}.c-iho-label-form-content{border-bottom:1px solid #e8e8e8;border-top:1px solid #e8e8e8;height:100%;width:100%}.c-iho-label-form-content .label-wrap{display:flex;height:100%;width:100%}.c-iho-label-form-content .label-wrap .left-label-wrap{border-right:1px solid #e8e8e8;max-height:404px;width:140px}.c-iho-label-form-content .label-wrap .left-label-wrap.total-left-label-wrap{height:calc(100vh - 109px);max-height:calc(100vh - 109px)}.c-iho-label-form-content .label-wrap .left-label-wrap.explicit-label-wrap{height:auto;overflow:hidden;overflow-y:auto;width:100%}.c-iho-label-form-content .label-wrap .left-label-wrap .n-anchor.n-anchor--block .n-anchor-link{font-size:14px;padding:10px 8px}.c-iho-label-form-content .label-wrap .left-label-wrap .n-anchor.n-anchor--block .n-anchor-link.n-anchor-link--active{background-color:#f2f2f2}.c-iho-label-form-content .label-wrap .right-label-wrap{flex:1;max-height:404px;overflow-y:auto}.c-iho-label-form-content .label-wrap .right-label-wrap.total-right-label-wrap{max-height:calc(100vh - 109px)}.c-iho-label-form-content .edit-label-type{font-size:12px;margin-left:4px}.c-iho-label-form-content .edit-label-content{margin-top:10px;padding:0 14px}.c-iho-label-form-content .edit-label-content .edit-content{margin-top:8px;width:100%}.c-iho-label-form-content .edit-label-content .edit-content .n-tag{border:1px solid #e0e0e6;margin:0 8px 8px 0;max-width:108px;text-align:center}.c-iho-label-form-content .edit-label-content .edit-content .n-tag .n-tag__content{align-items:center;display:inline-flex}.c-iho-label-form-content .edit-label-content .edit-content .n-tag .n-tag__content span{display:inline-block;height:100%;line-height:30px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:80px}.c-iho-label-form-content .edit-label-content .edit-content .n-tag.n-tag--checked{background:var(--n-color-checked);border-color:var(--n-color-checked);color:var(--n-text-color-checked)}.n-dialog__title .svg-wrap{margin:0 0 0 auto}.n-dialog__title .svg-wrap i{cursor:pointer;font-size:16px}
1
+ @font-face{font-family:iho-select-label-iconfont;src:url(iho-select-label-iconfont.ttf) format("truetype")}.iconfont-select-label{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:iho-select-label-iconfont!important;font-size:14px;font-style:normal}.icon-iho-select-label-menzhenyishengzhanxitongtubiaozuixiaohua2:before{content:"\e778"}.icon-iho-select-label-menzhenyishengzhanxitongtubiaozuidahua:before{content:"\e779"}.c-iho-select-label .form-add-icon-label{align-items:center;color:#2d7aff;cursor:pointer;display:inline-flex;vertical-align:middle}.c-iho-select-label .n-tag{border:1px solid #e0e0e6;margin:0 8px 0 0;max-width:108px}.c-iho-select-label .n-tag .n-base-icon{color:#fff}.c-iho-select-label .n-tag .n-tag__content{align-items:center;display:inline-block;line-height:20px;max-width:80px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.c-iho-label-form-content{border-bottom:1px solid #e8e8e8;border-top:1px solid #e8e8e8;height:100%;width:100%}.c-iho-label-form-content .label-wrap{display:flex;height:100%;width:100%}.c-iho-label-form-content .label-wrap .left-label-wrap{border-right:1px solid #e8e8e8;max-height:404px;width:140px}.c-iho-label-form-content .label-wrap .left-label-wrap.total-left-label-wrap{height:calc(100vh - 109px);max-height:calc(100vh - 109px)}.c-iho-label-form-content .label-wrap .left-label-wrap.explicit-label-wrap{height:auto;overflow:hidden;overflow-y:auto;width:100%}.c-iho-label-form-content .label-wrap .left-label-wrap .n-anchor.n-anchor--block .n-anchor-link{font-size:14px;padding:10px 8px}.c-iho-label-form-content .label-wrap .left-label-wrap .n-anchor.n-anchor--block .n-anchor-link.n-anchor-link--active{background-color:#f2f2f2}.c-iho-label-form-content .label-wrap .right-label-wrap{flex:1;max-height:404px;overflow-y:auto}.c-iho-label-form-content .label-wrap .right-label-wrap.total-right-label-wrap{max-height:calc(100vh - 109px)}.c-iho-label-form-content .edit-label-type{font-size:12px;margin-left:4px}.c-iho-label-form-content .edit-label-content{margin-top:10px;padding:0 14px}.c-iho-label-form-content .edit-label-content .edit-content{margin-top:8px;width:100%}.c-iho-label-form-content .edit-label-content .edit-content .n-tag{border:1px solid #e0e0e6;margin:0 8px 8px 0;max-width:108px;text-align:center}.c-iho-label-form-content .edit-label-content .edit-content .n-tag .n-tag__content{align-items:center;display:inline-flex}.c-iho-label-form-content .edit-label-content .edit-content .n-tag .n-tag__content span{display:inline-block;height:100%;line-height:30px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:80px}.n-dialog__title .svg-wrap{margin:0 0 0 auto}.n-dialog__title .svg-wrap i{cursor:pointer;font-size:16px}
@@ -2104,6 +2104,7 @@ declare const IhoTable: SFCWithInstall<import("vue").DefineComponent<{
2104
2104
  uuid?: string | undefined;
2105
2105
  isTree?: import("../../../es/shared/types").MaybeString<0 | 2 | 1 | 3> | undefined;
2106
2106
  isBatchSelect?: import("../../../es/shared/types").MaybeString<0 | 1> | undefined;
2107
+ isSingleSelect?: import("../../../es/shared/types").MaybeString<0 | 1> | undefined;
2107
2108
  hideSettingBtn?: import("../../../es/shared/types").MaybeString<0 | 1> | undefined;
2108
2109
  showSeq?: boolean | undefined;
2109
2110
  selectType?: "checkbox" | "radio" | null | undefined;
@@ -4521,6 +4522,7 @@ declare const IhoTable: SFCWithInstall<import("vue").DefineComponent<{
4521
4522
  uuid?: string | undefined;
4522
4523
  isTree?: import("../../../es/shared/types").MaybeString<0 | 2 | 1 | 3> | undefined;
4523
4524
  isBatchSelect?: import("../../../es/shared/types").MaybeString<0 | 1> | undefined;
4525
+ isSingleSelect?: import("../../../es/shared/types").MaybeString<0 | 1> | undefined;
4524
4526
  hideSettingBtn?: import("../../../es/shared/types").MaybeString<0 | 1> | undefined;
4525
4527
  showSeq?: boolean | undefined;
4526
4528
  selectType?: "checkbox" | "radio" | null | undefined;
@@ -2103,6 +2103,7 @@ declare const _default: import("vue").DefineComponent<{
2103
2103
  uuid?: string | undefined;
2104
2104
  isTree?: import("../../../../es/shared/types").MaybeString<0 | 2 | 1 | 3> | undefined;
2105
2105
  isBatchSelect?: import("../../../../es/shared/types").MaybeString<0 | 1> | undefined;
2106
+ isSingleSelect?: import("../../../../es/shared/types").MaybeString<0 | 1> | undefined;
2106
2107
  hideSettingBtn?: import("../../../../es/shared/types").MaybeString<0 | 1> | undefined;
2107
2108
  showSeq?: boolean | undefined;
2108
2109
  selectType?: "checkbox" | "radio" | null | undefined;
@@ -4520,6 +4521,7 @@ declare const _default: import("vue").DefineComponent<{
4520
4521
  uuid?: string | undefined;
4521
4522
  isTree?: import("../../../../es/shared/types").MaybeString<0 | 2 | 1 | 3> | undefined;
4522
4523
  isBatchSelect?: import("../../../../es/shared/types").MaybeString<0 | 1> | undefined;
4524
+ isSingleSelect?: import("../../../../es/shared/types").MaybeString<0 | 1> | undefined;
4523
4525
  hideSettingBtn?: import("../../../../es/shared/types").MaybeString<0 | 1> | undefined;
4524
4526
  showSeq?: boolean | undefined;
4525
4527
  selectType?: "checkbox" | "radio" | null | undefined;
@@ -1 +1 @@
1
- import{defineComponent as e,computed as t,provide as o,ref as a,watch as l,resolveComponent as n,openBlock as s,createElementBlock as r,unref as i,normalizeStyle as u,createBlock as c,resolveDynamicComponent as d,createElementVNode as f,createVNode as m,mergeProps as p,createSlots as v,renderList as b,withCtx as h,createCommentVNode as g,renderSlot as x,normalizeProps as k,guardReactiveProps as y}from"vue";import{useTheme as $}from"../../../shared/hooks/useTheme.js";import{useDebounceFn as C}from"@vueuse/core";import"date-fns";import{isString as D,isFunction as j,pick as _}from"lodash-es";import{widthAppend as w,uuidGenerator as I}from"../../../shared/utils/index.js";import{promiseTimeout as H}from"@vueuse/shared";import{VxeTableEventNameList as T,InjectionIhoTableEmits as A,InjectionIhoTableAnnotation as L,InjectionIhoTableUUID as R,InjectionIhoTableInstance as E,InjectionIhoTableConfig as F,InjectionIhoTableFieldList as O,InjectionIhoTableHandler as S}from"./constants/index.js";import{createTableHooks as W,applyTableConfigHooks as q,applyTableFieldHooks as z,createTableEventHandlers as B,createDomInsertComponent as G,createDataTransfer as J}from"./hooks/tapHooks/index.js";import{provideIhoTableEventListener as K}from"./hooks/tapHooks/useEventHooks.js";import{eventName2EventListener as M}from"./utils/index.js";import N from"../../../_virtual/plugin-vue_export-helper.js";const P=["id"];var Q=N(e({__name:"IhoTable",props:{tableConfig:{type:Object,default:()=>({})},fieldList:{type:Array,default:()=>[]},tableData:{type:Array,default:()=>[]},annotation:{type:Object}},emits:["formChange","settingClick","formClick","keyboard","rowDrag",...T],setup(e,{expose:T,emit:N}){var Q,U;const V=e,X=$({"--c-border-color":"#e2e2e2","--c-head-bg-color":"#f2f2f2","--c-hover-color":"#f7f7f7"}),Y=t((()=>{var e,t;const o=null!=(t=null==(e=V.tableConfig)?void 0:e.height)?t:"100%";return{height:"auto"===o?"100%":D(o)&&(o.includes("calc")||o.endsWith("%"))?o:w(o)}})),Z=K(),ee=function(e,...t){N(e,...t);const o=i(le)[M(e)];j(o)&&o(...t),Z.trigger(e,...t)};o(A,ee);const te=W();o(L,t((()=>V.annotation)));const oe=I();o(R,oe);const ae=a();o(E,ae);const le=a({uuid:null!=(U=null==(Q=V.tableConfig)?void 0:Q.uuid)?U:oe});o(F,le);const ne=C(se,10);function se(){le.value=q(te,V.tableConfig,{$table:ae,emits:ee}),le.value.uuid=oe}const re=a([]);o(O,re);const ie=C(ue,10);function ue(){re.value=z(te,V.fieldList,le.value,{$table:ae,emits:ee})}const ce=J(te,le,ae),de=a([]);async function fe(){var e;de.value=await ce(V.tableData),null==(e=ae.value)||e.recalculate(!0)}const me={updateTableDataRef:C(fe,10),updateConfigRef:ne,updateFieldListRef:ie};o(S,me);const pe=B({hooks:te,config:le,$table:ae,context:me,emits:ee}),ve=t((()=>({...le.value,...pe})));let be=!1,he=!1,ge=!1;const xe=C((()=>{be&&se(),he&&ue(),ge&&fe(),be=!1,he=!1,ge=!1}),10);l((()=>V.tableConfig),(()=>{be=!0,he=!0,ge=!0,xe()}),{deep:!0}),l((()=>V.fieldList),(()=>{he=!0,ge=!0,xe()}),{deep:!0}),l([()=>[...V.tableData],()=>{var e;return null==(e=V.tableData)?void 0:e.length}],(()=>{ge=!0,xe()})),l([()=>V.tableData,()=>{var e;return null==(e=V.tableData)?void 0:e.length}],(async()=>{var e,t;(null==(e=le.value.treeConfig)?void 0:e.expandAll)&&(await H(11),null==(t=ae.value)||t.setAllTreeExpand(!0))})),se(),ue(),fe();const{header:ke,footer:ye}=G(te);function $e(e){return _(e,["row","rowIndex","$rowIndex","column","columnIndex","$columnIndex","_columnIndex","checked","disabled","indeterminate"])}return T({$table:ae,async loadData(e){var t;null==(t=ae.value)||t.loadData(await ce(e))},setSort:(e,t)=>({field:e,value:t}),setFilter:(e,t)=>({field:e,value:t}),...te.exposeHooks.expose.call({},le,{$table:ae,emits:ee})}),te.setupHooks.setup.call(le,re,{$table:ae,emits:ee}),(e,t)=>{const o=n("vxe-grid");return s(),r("section",{class:"iho-table",id:i(oe),style:u(i(X))},[(s(),c(d(i(ke)))),f("section",{style:u(i(Y))},[m(o,p({ref_key:"$table",ref:ae},i(ve),{columns:re.value,data:de.value}),v({_:2},[b(e.$slots,((t,o)=>({name:o,fn:h((t=>[g(" 实际上所有的vxe-grid插槽都支持 "),x(e.$slots,o,k(y($e(t))))]))})))]),1040,["columns","data"])],4),(s(),c(d(i(ye))))],12,P)}}}),[["__file","IhoTable.vue"]]);export{Q as default};
1
+ import e from"./IhoTable.vue2.js";import r from"../../../_virtual/_plugin-vue_export-helper.js";var o=r(e,[["__file","IhoTable.vue"]]);export{o as default};
@@ -0,0 +1 @@
1
+ import{defineComponent as e,computed as t,provide as a,ref as o,watch as l,resolveComponent as n,openBlock as s,createElementBlock as r,unref as i,normalizeStyle as u,createBlock as d,resolveDynamicComponent as c,createElementVNode as f,createVNode as m,mergeProps as v,createSlots as p,renderList as b,withCtx as h,createCommentVNode as g,renderSlot as x,normalizeProps as k,guardReactiveProps as y}from"vue";import{useTheme as C}from"../../../shared/hooks/useTheme.js";import{useDebounceFn as D}from"@vueuse/core";import"date-fns";import{isString as $,isFunction as j,pick as w}from"lodash-es";import{widthAppend as I,uuidGenerator as H}from"../../../shared/utils/index.js";import{promiseTimeout as _}from"@vueuse/shared";import{VxeTableEventNameList as A,InjectionIhoTableEmits as L,InjectionIhoTableAnnotation as T,InjectionIhoTableUUID as R,InjectionIhoTableInstance as E,InjectionIhoTableConfig as F,InjectionIhoTableFieldList as O,InjectionIhoTableHandler as S}from"./constants/index.js";import{createTableHooks as W,applyTableConfigHooks as q,applyTableFieldHooks as z,createTableEventHandlers as B,createDomInsertComponent as G,createDataTransfer as J}from"./hooks/tapHooks/index.js";import{provideIhoTableEventListener as K}from"./hooks/tapHooks/useEventHooks.js";import{eventName2EventListener as M}from"./utils/index.js";const N=["id"];var P=e({__name:"IhoTable",props:{tableConfig:{type:Object,default:()=>({})},fieldList:{type:Array,default:()=>[]},tableData:{type:Array,default:()=>[]},annotation:{type:Object}},emits:["formChange","settingClick","formClick","keyboard","rowDrag",...A],setup(e,{expose:A,emit:P}){var Q,U;const V=e,X=C({"--c-border-color":"#e2e2e2","--c-head-bg-color":"#f2f2f2","--c-hover-color":"#f7f7f7"}),Y=t((()=>{var e,t;const a=null!=(t=null==(e=V.tableConfig)?void 0:e.height)?t:"100%";return{height:"auto"===a?"100%":$(a)&&(a.includes("calc")||a.endsWith("%"))?a:I(a)}})),Z=K(),ee=function(e,...t){P(e,...t);const a=i(le)[M(e)];j(a)&&a(...t),Z.trigger(e,...t)};a(L,ee);const te=W();a(T,t((()=>V.annotation)));const ae=H();a(R,ae);const oe=o();a(E,oe);const le=o({uuid:null!=(U=null==(Q=V.tableConfig)?void 0:Q.uuid)?U:ae});a(F,le);const ne=D(se,10);function se(){le.value=q(te,V.tableConfig,{$table:oe,emits:ee}),le.value.uuid=ae}const re=o([]);a(O,re);const ie=D(ue,10);function ue(){re.value=z(te,V.fieldList,le.value,{$table:oe,emits:ee})}const de=J(te,le,oe),ce=o([]);async function fe(){var e;ce.value=await de(V.tableData),null==(e=oe.value)||e.recalculate(!0)}const me={updateTableDataRef:D(fe,10),updateConfigRef:ne,updateFieldListRef:ie};a(S,me);const ve=B({hooks:te,config:le,$table:oe,context:me,emits:ee}),pe=t((()=>({...le.value,...ve})));let be=!1,he=!1,ge=!1;const xe=D((()=>{be&&se(),he&&ue(),ge&&fe(),be=!1,he=!1,ge=!1}),10);l((()=>V.tableConfig),(()=>{be=!0,he=!0,ge=!0,xe()}),{deep:!0}),l((()=>V.fieldList),(()=>{he=!0,ge=!0,xe()}),{deep:!0}),l([()=>[...V.tableData],()=>{var e;return null==(e=V.tableData)?void 0:e.length}],(()=>{ge=!0,xe()})),l([()=>V.tableData,()=>{var e;return null==(e=V.tableData)?void 0:e.length}],(async()=>{var e,t;(null==(e=le.value.treeConfig)?void 0:e.expandAll)&&(await _(11),null==(t=oe.value)||t.setAllTreeExpand(!0))})),se(),ue(),fe();const{header:ke,footer:ye}=G(te);function Ce(e){return w(e,["row","rowIndex","$rowIndex","column","columnIndex","$columnIndex","_columnIndex","checked","disabled","indeterminate"])}return A({$table:oe,async loadData(e){var t;null==(t=oe.value)||t.loadData(await de(e))},setSort:(e,t)=>({field:e,value:t}),setFilter:(e,t)=>({field:e,value:t}),reload(){var e,t;null==(e=oe.value)||e.loadColumn([]),null==(t=oe.value)||t.loadData([]),se(),ue(),fe()},...te.exposeHooks.expose.call({},le,{$table:oe,emits:ee})}),te.setupHooks.setup.call(le,re,{$table:oe,emits:ee}),(e,t)=>{const a=n("vxe-grid");return s(),r("section",{class:"iho-table",id:i(ae),style:u(i(X))},[(s(),d(c(i(ke)))),f("section",{style:u(i(Y))},[m(a,v({ref_key:"$table",ref:oe},i(pe),{columns:re.value,data:ce.value}),p({_:2},[b(e.$slots,((t,a)=>({name:a,fn:h((t=>[g(" 实际上所有的vxe-grid插槽都支持 "),x(e.$slots,a,k(y(Ce(t))))]))})))]),1040,["columns","data"])],4),(s(),d(c(i(ye))))],12,N)}}});export{P as default};
@@ -1 +1 @@
1
- import{mergeWith as e,isObject as o}from"lodash-es";import{HIGHEST_PRIORITY as i}from"../../constants/index.js";import{defineTablePlugin as t}from"../../hooks/useTablePlugin.js";import{IhoTableStatusHelper as s}from"../../utils/index.js";function n(){const n="defaultTablePlugin";return t({name:n,vxe(e){e.setup({zIndex:3e3})},apply(t){t.configHooks.config.tap({name:n,stage:i},(o=>{const i=e({border:!0,showSeq:!0,columnConfig:{resizable:!0},rowConfig:{height:36,useKey:!0,isHover:!0,isCurrent:!0,keyField:"theUniqueKey"},showOverflow:"tooltip",editConfig:{trigger:"click",mode:"cell"}},o,{height:o.height?"auto":void 0});return(s.isPositive(o.isBatchSelect)||o.selectType)&&(i.selectType=o.selectType||"checkbox"),i})),t.configHooks.mouseConfig.tap({name:n,stage:i},((e,i)=>o(i.keyboardConfig)?Object.assign({selected:!!i.keyboardConfig.isEdit},e):e))}})}export{n as defaultConfigPlugin};
1
+ import{mergeWith as e,isObject as o}from"lodash-es";import{HIGHEST_PRIORITY as i}from"../../constants/index.js";import{defineTablePlugin as t}from"../../hooks/useTablePlugin.js";import{IhoTableStatusHelper as s}from"../../utils/index.js";function n(){const n="defaultTablePlugin";return t({name:n,vxe(e){e.setup({zIndex:3e3})},apply(t){t.configHooks.config.tap({name:n,stage:i},(o=>{const i=e({border:!0,showSeq:!0,columnConfig:{resizable:!0},rowConfig:{height:36,useKey:!0,isHover:!0,isCurrent:!0,keyField:"theUniqueKey"},showOverflow:"tooltip",editConfig:{trigger:"click",mode:"cell"}},o,{height:o.height?"auto":void 0});return i.selectType=o.selectType||(s.isPositive(o.isBatchSelect)?"checkbox":s.isPositive(o.isSingleSelect)?"radio":void 0),i})),t.configHooks.mouseConfig.tap({name:n,stage:i},((e,i)=>o(i.keyboardConfig)?Object.assign({selected:!!i.keyboardConfig.isEdit},e):e))}})}export{n as defaultConfigPlugin};
@@ -1 +1 @@
1
- import{defineComponent as e,reactive as t,openBlock as a,createBlock as l,unref as o}from"vue";import r from"../../../../date-picker/index.js";import{subDays as n,subMonths as i}from"date-fns";import p from"../../../../../_virtual/plugin-vue_export-helper.js";var u=p(e({__name:"filter",props:{payload:{type:Object,required:!0}},setup(e){var p,u,d;const m=e,f=t((null==(d=null==(u=null==(p=m.payload)?void 0:p.column)?void 0:u.filters)?void 0:d[0])||{data:void 0}),v=t({"近一周":()=>[n(new Date,7).getTime(),(new Date).getTime()],"近一个月":()=>[i(new Date,1).getTime(),(new Date).getTime()]});function s(e,t){var a;f.value=t,(null==(a=m.payload)?void 0:a.$panel)&&(m.payload.$panel.changeOption(null,!!t,f),m.payload.$panel.confirmFilter(new CustomEvent("click")))}return(e,t)=>(a(),l(o(r),{type:"datetimerange",panel:"",clearable:"","default-time":["00:00:00","23:59:59"],"formatted-value":f.data,"onUpdate:formatted-value":t[0]||(t[0]=e=>f.data=e),shortcuts:v,onConfirm:s},null,8,["formatted-value","shortcuts"]))}}),[["__file","filter.vue"]]);export{u as default};
1
+ import e from"./filter.vue2.js";import r from"../../../../../_virtual/_plugin-vue_export-helper.js";var t=r(e,[["__file","filter.vue"]]);export{t as default};
@@ -0,0 +1 @@
1
+ import{defineComponent as e,reactive as a,openBlock as t,createBlock as l,unref as o}from"vue";import n from"../../../../date-picker/index.js";import{subDays as r,subMonths as i}from"date-fns";var d=e({__name:"filter",props:{payload:{type:Object,required:!0}},setup(e){var d,p,u;const m=e,f=a((null==(u=null==(p=null==(d=m.payload)?void 0:d.column)?void 0:p.filters)?void 0:u[0])||{data:void 0}),v=a({"近一周":()=>[r(new Date,7).getTime(),(new Date).getTime()],"近一个月":()=>[i(new Date,1).getTime(),(new Date).getTime()]});function c(e,a){var t;f.value=a,(null==(t=m.payload)?void 0:t.$panel)&&(m.payload.$panel.changeOption(null,!!a,f),m.payload.$panel.confirmFilter(new CustomEvent("click")))}return(e,a)=>(t(),l(o(n),{type:"datetimerange",panel:"",clearable:"","default-time":["00:00:00","23:59:59"],"formatted-value":f.data,"onUpdate:formatted-value":a[0]||(a[0]=e=>f.data=e),shortcuts:v,onConfirm:c},null,8,["formatted-value","shortcuts"]))}});export{d as default};