cnhis-design-vue 3.2.15-beta.2 → 3.2.15-beta.20

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 (209) hide show
  1. package/README.md +87 -87
  2. package/es/components/ai-chat/index.d.ts +9 -0
  3. package/es/components/ai-chat/src/Index.vue.d.ts +9 -0
  4. package/es/components/ai-chat/src/Index.vue2.js +1 -1
  5. package/es/components/ai-chat/src/components/ChatCard.js +1 -1
  6. package/es/components/ai-chat/src/components/ChatMain.js +1 -1
  7. package/es/components/ai-chat/src/components/ChatPatient.vue2.js +1 -1
  8. package/es/components/ai-chat/style/index.css +1 -1
  9. package/es/components/big-table/src/BigTable.vue2.js +1 -1
  10. package/es/components/branch-notice/index.d.ts +425 -9
  11. package/es/components/branch-notice/src/BranchNotice.vue.d.ts +378 -9
  12. package/es/components/branch-notice/src/BranchNotice.vue2.js +1 -1
  13. package/es/components/branch-notice/src/canstants.d.ts +2 -1
  14. package/es/components/branch-notice/src/canstants.js +1 -1
  15. package/es/components/branch-notice/src/components/NoticeItem.vue.d.ts +168 -44
  16. package/es/components/branch-notice/src/components/NoticeItem.vue.js +1 -0
  17. package/es/components/branch-notice/src/components/NoticeItem.vue2.js +1 -0
  18. package/es/components/branch-notice/src/components/NoticeItemAside.vue.d.ts +74 -5
  19. package/es/components/branch-notice/src/components/NoticeItemAside.vue.js +1 -0
  20. package/es/components/branch-notice/src/components/NoticeItemAside.vue2.js +1 -0
  21. package/es/components/branch-notice/src/components/NoticeOperationList.vue.js +1 -0
  22. package/es/components/branch-notice/src/components/NoticeOperationList.vue2.js +1 -0
  23. package/es/components/branch-notice/src/drawLine.js +1 -1
  24. package/es/components/branch-notice/src/hooks/useTheme.d.ts +1 -0
  25. package/es/components/branch-notice/src/hooks/useTheme.js +1 -0
  26. package/es/components/branch-notice/src/types.d.ts +22 -4
  27. package/es/components/branch-notice/style/index.css +1 -1
  28. package/es/components/button-print/src/components/IdentityVerification.vue2.js +1 -1
  29. package/es/components/button-print/src/components/NewPrintComponent.vue2.js +1 -1
  30. package/es/components/button-print/src/components/OldPrintComponent.vue2.js +1 -1
  31. package/es/components/card-reader-sdk/src/cardReaderSDK.js +1 -1
  32. package/es/components/classification/src/components/search-filter/index.vue2.js +1 -1
  33. package/es/components/classification/src/components/table-modal/index.vue2.js +1 -1
  34. package/es/components/classification/src/index.vue2.js +1 -1
  35. package/es/components/expand-field/src/components/FormBatchOptionsModal.vue2.js +1 -1
  36. package/es/components/expand-field/src/components/PersonModal.vue2.js +1 -1
  37. package/es/components/expand-field/src/components/form.vue2.js +1 -1
  38. package/es/components/expand-field/src/index.vue2.js +1 -1
  39. package/es/components/fabric-chart/src/FabricChart.vue2.js +1 -1
  40. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
  41. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.js +1 -1
  42. package/es/components/fabric-chart/src/hooks/electrocardiogram/hooks/useDetailEvent.js +1 -1
  43. package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogram.js +1 -1
  44. package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.js +1 -1
  45. package/es/components/fabric-chart/src/hooks/electrocardiogram/useMeasureInstrument.js +1 -1
  46. package/es/components/fabric-chart/src/hooks/index.d.ts +1 -0
  47. package/es/components/fabric-chart/src/hooks/index.js +1 -1
  48. package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcess.js +1 -1
  49. package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcessChart.js +1 -1
  50. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -1
  51. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useLeft.js +1 -1
  52. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.d.ts +1 -0
  53. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.js +1 -1
  54. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +1 -1
  55. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.js +1 -1
  56. package/es/components/fabric-chart/src/hooks/temperature/useBottom.js +1 -1
  57. package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
  58. package/es/components/fabric-chart/src/hooks/temperature/useLeft.js +1 -1
  59. package/es/components/fabric-chart/src/hooks/temperature/useOther.js +1 -1
  60. package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
  61. package/es/components/fabric-chart/src/hooks/temperature/useTop.js +1 -1
  62. package/es/components/fabric-chart/src/hooks/useCommon.d.ts +1 -2
  63. package/es/components/fabric-chart/src/hooks/useDraw.js +1 -1
  64. package/es/components/fabric-chart/src/hooks/{temperature/useShadow.d.ts → useShadow.d.ts} +2 -2
  65. package/es/components/fabric-chart/src/hooks/useShadow.js +1 -0
  66. package/es/components/fabric-chart/src/utils/index.d.ts +1 -0
  67. package/es/components/fabric-chart/src/utils/index.js +1 -1
  68. package/es/components/field-set/src/FieldColor.vue.d.ts +1 -1
  69. package/es/components/field-set/src/FieldColor.vue2.js +1 -1
  70. package/es/components/field-set/src/FieldFilter.vue.d.ts +3 -2
  71. package/es/components/field-set/src/FieldFilter.vue2.js +1 -1
  72. package/es/components/field-set/src/FieldSet.vue.d.ts +1 -1
  73. package/es/components/field-set/src/FieldSet.vue2.js +1 -1
  74. package/es/components/field-set/src/TableStyle.vue2.js +1 -1
  75. package/es/components/field-set/src/components/edit-dialog.vue2.js +1 -1
  76. package/es/components/field-set/src/components/edit-filter.vue2.js +1 -1
  77. package/es/components/field-set/src/components/table-row.vue.d.ts +1 -1
  78. package/es/components/field-set/src/components/table-row.vue2.js +1 -1
  79. package/es/components/field-set/src/constants/filter.js +1 -1
  80. package/es/components/field-set/src/constants/index.js +1 -1
  81. package/es/components/field-set/src/utils/index.js +1 -1
  82. package/es/components/form-config/index.d.ts +1021 -1
  83. package/es/components/form-config/src/FormConfig.vue.d.ts +1021 -1
  84. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +0 -1
  85. package/es/components/form-config/src/components/FormConfigEdit.vue2.js +1 -1
  86. package/es/components/form-config/src/components/FormConfigEventSetting.vue.d.ts +1019 -0
  87. package/es/components/form-config/src/components/FormConfigEventSetting.vue2.js +1 -1
  88. package/es/components/form-config/src/constants/index.js +1 -1
  89. package/es/components/form-config/src/hooks/useLocale.js +1 -1
  90. package/es/components/form-config/style/index.css +1 -1
  91. package/es/components/form-render/src/FormRender.vue2.js +1 -1
  92. package/es/components/form-render/src/components/renderer/combination/combination.js +1 -1
  93. package/es/components/form-render/src/components/renderer/complex.js +1 -1
  94. package/es/components/form-render/src/components/renderer/date.js +1 -1
  95. package/es/components/form-render/src/components/renderer/radio_checkbox.js +1 -1
  96. package/es/components/form-render/src/components/renderer/searchCascade.js +1 -1
  97. package/es/components/form-render/src/components/renderer/select.d.ts +6 -0
  98. package/es/components/form-render/src/components/renderer/select.js +1 -1
  99. package/es/components/form-render/src/components/renderer/switch.js +1 -1
  100. package/es/components/form-render/src/components/renderer/text.js +1 -1
  101. package/es/components/form-render/src/components/renderer/textarea.js +1 -1
  102. package/es/components/form-render/src/hooks/useAnchor.js +1 -1
  103. package/es/components/form-render/src/hooks/useBusinessBinding.js +1 -1
  104. package/es/components/form-render/src/hooks/useComplexOptions.js +1 -1
  105. package/es/components/form-render/src/hooks/useFieldNormalize.js +1 -1
  106. package/es/components/form-render/src/hooks/useFormValidator.js +1 -1
  107. package/es/components/form-render/src/hooks/useLowCodeReactions.js +1 -1
  108. package/es/components/form-render/src/hooks/usePresetScope.js +1 -1
  109. package/es/components/form-render/src/utils/index.js +1 -1
  110. package/es/components/iho-chat/index.d.ts +518 -83
  111. package/es/components/iho-chat/src/Index.vue.d.ts +518 -83
  112. package/es/components/iho-chat/src/Index.vue2.js +1 -1
  113. package/es/components/iho-chat/src/components/ChatAdd.vue.d.ts +33 -8
  114. package/es/components/iho-chat/src/components/ChatAdd.vue2.js +1 -1
  115. package/es/components/iho-chat/src/components/ChatFile.vue.d.ts +33 -8
  116. package/es/components/iho-chat/src/components/ChatFile.vue2.js +1 -1
  117. package/es/components/iho-chat/src/components/ChatFooter.vue.d.ts +33 -8
  118. package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +101 -26
  119. package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +34 -9
  120. package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
  121. package/es/components/iho-chat/src/components/ChatSearch.vue.d.ts +33 -34
  122. package/es/components/iho-chat/src/components/ChatSearch.vue2.js +1 -1
  123. package/es/components/iho-chat/src/components/ChatSet.vue.d.ts +34 -9
  124. package/es/components/iho-chat/src/components/ContextMenu.js +1 -1
  125. package/es/components/iho-chat/src/components/MultipleVideo.vue.d.ts +34 -8
  126. package/es/components/iho-chat/src/components/MultipleVideo.vue2.js +1 -1
  127. package/es/components/iho-chat/src/components/PersonProfile.vue.d.ts +1 -1
  128. package/es/components/iho-chat/src/components/SiderList.vue.d.ts +207 -4
  129. package/es/components/iho-chat/src/components/SiderList.vue2.js +1 -1
  130. package/es/components/iho-chat/src/components/Video.vue.d.ts +1 -0
  131. package/es/components/iho-chat/src/components/Video.vue2.js +1 -1
  132. package/es/components/iho-chat/src/components/userItemRender.d.ts +18 -0
  133. package/es/components/iho-chat/src/components/userItemRender.js +1 -0
  134. package/es/components/iho-chat/src/hooks/useData.d.ts +6 -2
  135. package/es/components/iho-chat/src/hooks/useData.js +1 -1
  136. package/es/components/iho-chat/src/hooks/useVideo.d.ts +1 -0
  137. package/es/components/iho-chat/src/hooks/useVideo.js +1 -1
  138. package/es/components/iho-chat/src/hooks/useWebSocket.js +1 -1
  139. package/es/components/iho-chat/src/types/index.d.ts +13 -0
  140. package/es/components/iho-chat/src/utils/index.js +1 -1
  141. package/es/components/iho-chat/style/iconfont.ttf +0 -0
  142. package/es/components/iho-chat/style/index.css +1 -1
  143. package/es/components/iho-table/src/plugins/dynamicFilterRenderPlugin/dynamicFilter.vue2.js +1 -1
  144. package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue2.js +1 -1
  145. package/es/components/iho-table/src/plugins/filterTextPlugin/filter.vue2.js +1 -1
  146. package/es/components/iho-table/style/index.css +1 -1
  147. package/es/components/index.css +1 -1
  148. package/es/components/info-header/src/components/patientInfo/index.vue2.js +1 -1
  149. package/es/components/keyboard/src/components/NumberPanel.vue2.js +1 -1
  150. package/es/components/map/src/Map.vue2.js +1 -1
  151. package/es/components/quick-search/src/index.vue2.js +1 -1
  152. package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
  153. package/es/components/scale-view/src/components/formitem/r-sign.js +1 -1
  154. package/es/components/scale-view/src/components/formitem/standard-modal.js +1 -1
  155. package/es/components/scale-view/src/hooks/scaleview-methods.js +1 -1
  156. package/es/components/scale-view/src/hooks/scaleview-submit.js +1 -1
  157. package/es/components/select-label/src/SelectLabel.vue2.js +1 -1
  158. package/es/components/select-label/src/ihoLabel/IhoSelectLabel.vue2.js +1 -1
  159. package/es/components/table-export-field/src/components/ExportModal.vue2.js +1 -1
  160. package/es/components/table-export-field/src/components/SaveProjectModal.vue2.js +1 -1
  161. package/es/components/table-filter/src/components/bi-filter/helpers/options.js +1 -1
  162. package/es/components/table-filter/src/components/render-widget/components/SelectDynamic.vue2.js +1 -1
  163. package/es/components/table-filter/src/components/render-widget/helpers/dateExtraMap.js +1 -1
  164. package/es/components/table-filter/src/tool/baseOptions.js +1 -1
  165. package/es/components/template-render/src/components/index.d.ts +23 -23
  166. package/es/components/tooth-bitmap/src/ToothBitmap.vue2.js +1 -1
  167. package/es/components/vod-chunk-upload/src/vod-chunk-upload/vod-chunk-upload.vue2.js +1 -1
  168. package/es/components/vod-chunk-upload/src/vod-upload-modal.js +1 -1
  169. package/es/shared/assets/img/ai__avatar.png.js +1 -1
  170. package/es/shared/assets/img/defaultCover/10review_successful.png.js +1 -1
  171. package/es/shared/assets/img/defaultCover/11review_fail.png.js +1 -1
  172. package/es/shared/assets/img/defaultCover/12no_setting.png.js +1 -1
  173. package/es/shared/assets/img/defaultCover/13no_menu_setting.png.js +1 -1
  174. package/es/shared/assets/img/defaultCover/14no_call_setting.png.js +1 -1
  175. package/es/shared/assets/img/defaultCover/15no_use_tag.png.js +1 -1
  176. package/es/shared/assets/img/defaultCover/16no_table_data.png.js +1 -1
  177. package/es/shared/assets/img/defaultCover/1location.png.js +1 -1
  178. package/es/shared/assets/img/defaultCover/2notfound.png.js +1 -1
  179. package/es/shared/assets/img/defaultCover/3loading.png.js +1 -1
  180. package/es/shared/assets/img/defaultCover/4no_permission.png.js +1 -1
  181. package/es/shared/assets/img/defaultCover/5no_data.png.js +1 -1
  182. package/es/shared/assets/img/defaultCover/6no_network.png.js +1 -1
  183. package/es/shared/assets/img/defaultCover/7no_doctor.png.js +1 -1
  184. package/es/shared/assets/img/defaultCover/8system_error.png.js +1 -1
  185. package/es/shared/assets/img/defaultCover/9system_upgrade.png.js +1 -1
  186. package/es/shared/assets/img/failure.png.js +1 -1
  187. package/es/shared/assets/img/logo.png.js +1 -1
  188. package/es/shared/assets/img/no-permission.png.js +1 -1
  189. package/es/shared/assets/img/nodata.png.js +1 -1
  190. package/es/shared/assets/img/notfound.png.js +1 -1
  191. package/es/shared/assets/img/qr.png.js +1 -1
  192. package/es/shared/assets/img/success.png.js +1 -1
  193. package/es/shared/assets/img/table_style_2.png.js +1 -1
  194. package/es/shared/assets/img/video.png.js +1 -1
  195. package/es/shared/assets/img/video_default_cover.png.js +1 -1
  196. package/es/shared/assets/img/xb_big.png.js +1 -1
  197. package/es/shared/assets/img/xb_small.png.js +1 -1
  198. package/es/shared/hooks/useLevelSearchCascader.js +1 -1
  199. package/es/shared/package.json.js +1 -1
  200. package/es/shared/types/business.d.ts +4 -0
  201. package/package.json +2 -2
  202. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  203. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
  204. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
  205. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
  206. package/es/components/fabric-chart/src/hooks/temperature/useShadow.js +0 -1
  207. package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
  208. package/es/shared/utils/fabricjs/index.d.ts +0 -6823
  209. package/es/shared/utils/tapable/index.d.ts +0 -139
@@ -1 +1 @@
1
- import{defineComponent as e,ref as l,watchEffect as o,watch as n,inject as i,computed as a,reactive as t,openBlock as s,createElementBlock as d,createVNode as u,unref as r,withCtx as p,createTextVNode as c,normalizeStyle as v,createElementVNode as _,Fragment as f,renderList as m,createBlock as g,toDisplayString as h,withModifiers as y,createCommentVNode as b,normalizeClass as k}from"vue";import{useTheme as F}from"../../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{cloneDeep as w,isEmpty as x,isArray as C,union as O,omit as j}from"lodash-es";import"@vue/shared";import{traverse as B}from"../../../../shared/utils/index.js";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import{HelpCircleSharp as T}from"@vicons/ionicons5";import{useDialog as L,NButton as E,NModal as N,NScrollbar as U,NCollapse as z,NCollapseItem as q,NEllipsis as P,NThing as R,NSpace as $,NInputGroup as I,NSelect as A,NInput as D,NTooltip as V,NIcon as H,NEmpty as M}from"naive-ui";import"../../../../shared/hooks/useScrollLoading.js";import{conditionOppositeMap as S,connectionTypeOptions as W,connectionTypeOppositeMap as X,InjectionFieldList as G,conditionTypeOptions as J}from"../constants/index.js";const K={class:"form-config__connectionOperation"},Q={class:"form-config__connectionConditionHeaderDesc"},Y={class:"form-config__connectionCondition"},Z={class:"form-config__connectionConditionItem"},ee={style:{"margin-right":"8px"}},le={class:"form-config__connectionFieldType"},oe=["onClick"],ne={style:{display:"inline-flex","align-items":"center",gap:"4px","margin-bottom":"4px"}};var ie=e({__name:"FormConfigEventSetting",props:{modelValue:{default:()=>[]}},emits:["update:modelValue","validateFailure"],setup(e,{emit:ie}){const ae=e,te=F(),se=l([]),de=l("");function ue(){se.value.push({conObj:[]}),de.value=se.value.length-1+""}function re(e){return e.__oppositeBindField?`已绑定互斥联动: 联动${se.value.findIndex((l=>l===e.__oppositeBindField))+1}`:e.__oppositeTargetField?`已关联互斥联动: 联动${se.value.findIndex((l=>l===e.__oppositeTargetField))+1}`:void 0}function pe(e){return null==e?void 0:e.replace(/(AND|OR)/g,(e=>"AND"===e?"OR":"AND"))}function ce(e){var l;const o=e.__oppositeTargetField||{conObj:[]};return o.conObj=w(e.conObj),null==(l=o.conObj)||l.forEach((e=>{e.con=S[e.con]})),o.sqlExpression=pe(e.sqlExpression),W.forEach((({value:l})=>{x(e[l])?Reflect.deleteProperty(o,X[l]):o[X[l]]=w(e[l])})),o.__oppositeBindField=e,o}function ve(e,l){var o,n,i,a;return(null==(o=e.conObj)?void 0:o.length)===(null==(n=l.conObj)?void 0:n.length)&&(!(e.conObj&&l.conObj&&e.conObj.some((e=>!l.conObj.find((l=>{return n=l,(o=e).field_key===n.field_key&&o.con&&S[o.con]===n.con&&o.value===n.value;var o,n})))))&&(i=e.sqlExpression,a=l.sqlExpression,(!i&&!a||pe(i)===a)&&!W.some((({value:o})=>{return n=e[o],i=l[X[o]],!(n&&i?n.length===i.length&&n.every((e=>i.some((l=>e===l)))):!n&&!i);var n,i}))))}function _e(e){de.value=e[0]}function fe(e){const l=se.value[e];if(!l)return"";const o=l.conObj||[],n=W.reduce(((e,{value:o})=>(C(l[o])&&l[o].length&&e.push(...l[o].map(a)),e)),[]),i=O([...o.map((({field_key:e})=>a(e))),...n]).filter((e=>!!e));return i.length?`( 相关字段: ${i} )`:"";function a(e){var l,o;return null!=(o=null==(l=he.value.find((l=>e===l.key)))?void 0:l.name)?o:e}}o((()=>{se.value.forEach((e=>{e.__oppositeTargetField&&(e.__oppositeTargetField=ce(e))}))}));const me=l(!1);n(me,(e=>{e&&(se.value=w(ae.modelValue),se.value.forEach(((e,l)=>{if(e.__oppositeBindField||e.__oppositeTargetField)return;const o=se.value.find(((o,n)=>n!==l&&!o.__oppositeBindField&&!o.__oppositeTargetField&&ve(o,e)));o&&(o.__oppositeBindField=e,e.__oppositeTargetField=o)})))}));const ge=i(G,l([])),he=a((()=>{const e=[];return B(ge.value,(l=>{!["NEWLINE","LINE_BAR","COMPLEX","COMBINATION"].includes(l.type)&&e.push(l)})),e})),ye=t([]),be=L();async function ke(){var e,l;be.warning({title:"提示",content:"直接关闭弹窗会丢失已编辑的配置, 确定要关闭吗?",positiveText:(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.33"))||"确定",negativeText:(null==(l=window.getLanguageByCode)?void 0:l.call(window,"10010.1.32"))||"取消",onPositiveClick:()=>{me.value=!1,se.value=[]}})}async function Fe(){try{await function(){var e;const l=[];return null==(e=se.value)||e.forEach(((e,o)=>{const n=[];e.conObj&&e.conObj.length?e.conObj.forEach(((e,l)=>{e.field_key||n.push(`条件${l+1}字段为空`),e.con||n.push(`条件${l+1}判断类型为空`),["NULL","NOT_NULL"].includes(e.con)||!e.con||e.value||n.push(`条件${l+1}值为空`)})):n.push("联动条件为空"),W.every((({value:l})=>!e[l]||!e[l].length))&&n.push("联动字段为空"),n.length&&l.push(`联动${o+1}: ${n}`)})),l.length?Promise.reject(l):Promise.resolve()}(),me.value=!1,ie("update:modelValue",se.value.map((e=>j(e,["__oppositeBindField","__oppositeTargetField"]))))}catch(e){ie("validateFailure",e)}}return(e,l)=>(s(),d("section",null,[u(r(E),{size:"small",onClick:l[0]||(l[0]=e=>me.value=!0)},{default:p((()=>[c("调整联动绑定")])),_:1}),u(r(N),{show:me.value,"onUpdate:show":l[1]||(l[1]=e=>me.value=e),closable:!1,bordered:!1,"show-icon":!1,title:"联动绑定设置",preset:"dialog","mask-closable":!1,"close-on-esc":!1,style:v({width:"1000px",...r(te)}),class:"form-config__connectionModal"},{action:p((()=>[u(r(E),{size:"small",onClick:ke},{default:p((()=>{var e;return[c((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.32"))||"取消")]})),_:1}),u(r(E),{size:"small",onClick:Fe,type:"primary"},{default:p((()=>{var e;return[c((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.33"))||"确定")]})),_:1})])),default:p((()=>[_("header",K,[u(r(E),{onClick:ue,size:"small"},{default:p((()=>[c("新增联动")])),_:1})]),u(r(U),{style:{"max-height":"500px","min-height":"500px"}},{default:p((()=>[u(r(z),{accordion:"","expanded-names":de.value,"onUpdate:expandedNames":_e},{default:p((()=>[(s(!0),d(f,null,m(se.value,((e,l)=>(s(),g(r(q),{name:l+""},{header:p((()=>[c(" 联动"+h(l+1)+" ",1),u(r(P),{class:"form-config__connectionConditionHeaderDesc",style:{"max-width":"500px"}},{default:p((()=>[c(h(fe(l)),1)])),_:2},1024)])),"header-extra":p((()=>[e.__oppositeBindField||e.__oppositeTargetField?(s(),d(f,{key:1},[_("span",Q,"( "+h(re(e))+" )",1),u(r(E),{quaternary:"",type:"primary",size:"small",onClick:y((l=>function(e){const l=e.__oppositeTargetField||e.__oppositeBindField;l&&[l,e].forEach((e=>{Reflect.deleteProperty(e,"__oppositeBindField"),Reflect.deleteProperty(e,"__oppositeTargetField")}))}(e)),["stop"])},{default:p((()=>[c("解除互斥")])),_:2},1032,["onClick"])],64)):(s(),g(r(E),{key:0,onClick:y((l=>function(e){se.value.push(e.__oppositeTargetField=ce(e))}(e)),["stop"]),quaternary:"",type:"primary",size:"small"},{default:p((()=>[c(" 创建互斥条件 ")])),_:2},1032,["onClick"])),u(r(E),{onClick:y((e=>function(e){var l;const o=null==(l=se.value)?void 0:l.splice(e,1);null==o||o.forEach((e=>{const l=e.__oppositeTargetField||e.__oppositeBindField;l&&(Reflect.deleteProperty(l,"__oppositeTargetField"),Reflect.deleteProperty(l,"__oppositeBindField"))})),ye.splice(e,1),!de.value||+de.value<e||(de.value=de.value===e+""?"":+de.value-1+"")}(l)),["stop"]),quaternary:"",type:"error",size:"small"},{default:p((()=>{var e;return[c((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.88"))||"移除")]})),_:2},1032,["onClick"])])),default:p((()=>[u(r(R),{class:"form-config__connectionWrapper"},{default:p((()=>[u(r($),{justify:"space-between",wrap:!1},{default:p((()=>[_("section",Y,[_("header",null,[c(" 条件 "),e.__oppositeBindField?b("v-if",!0):(s(),g(r(E),{key:0,size:"small",quaternary:"",type:"primary",onClick:l=>{var o;C((o=e).conObj)?o.conObj.push({}):o.conObj=[{}]}},{default:p((()=>[c(" 添加条件 ")])),_:2},1032,["onClick"]))]),u(r(U),{style:{"max-height":"145px","min-height":"145px"},class:"form-config__connectionWrapper"},{default:p((()=>[(s(!0),d(f,null,m(e.conObj||[],((l,o)=>(s(),d("div",Z,[_("span",ee,h(o+1),1),u(r(I),{size:"small"},{default:p((()=>[u(r(A),{value:l.field_key,"onUpdate:value":e=>l.field_key=e,disabled:!!e.__oppositeBindField,placeholder:"请选择字段",options:r(he),"label-field":"name","value-field":"key",filterable:""},null,8,["value","onUpdate:value","disabled","options"]),u(r(A),{value:l.con,disabled:!!e.__oppositeBindField,"onUpdate:value":e=>function(e,l){e.con=l,["NOT_NULL","NULL"].includes(l)&&Reflect.deleteProperty(e,"value")}(l,e),placeholder:"请选择判断类型",options:r(J)},null,8,["value","disabled","onUpdate:value","options"]),l.con&&!["NULL","NOT_NULL"].includes(l.con)?(s(),g(r(D),{key:0,disabled:!!e.__oppositeBindField,value:l.value,"onUpdate:value":e=>l.value=e,placeholder:"请输入值",clearable:""},null,8,["disabled","value","onUpdate:value"])):b("v-if",!0)])),_:2},1024),u(r(E),{disabled:!!e.__oppositeBindField,quaternary:"",onClick:l=>function(e,l){C(e.conObj)&&e.conObj.splice(l,1)}(e,o),type:"error",size:"small"},{default:p((()=>{var e;return[c((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.88"))||"移除")]})),_:2},1032,["disabled","onClick"])])))),256))])),_:2},1024)]),_("section",le,[_("div",null,[(s(!0),d(f,null,m(r(W),(o=>{var n,i;return s(),d("div",{key:o.value,class:k({"is-active":ye[l]===o.value}),onClick:e=>ye[l]=o.value},h(o.label)+" ( "+h(null!=(i=null==(n=e[o.value])?void 0:n.length)?i:0)+" ) ",11,oe)})),128))]),_("div",null,[ye[l]?(s(),g(r(A),{key:0,value:e[ye[l]],"onUpdate:value":o=>e[ye[l]]=o,disabled:!!e.__oppositeBindField,multiple:"",placeholder:"请选择字段",options:r(he),"label-field":"name","value-field":"key",filterable:"","max-tag-count":10},null,8,["value","onUpdate:value","disabled","options"])):b("v-if",!0)])])])),_:2},1024),_("section",null,[_("label",null,[_("span",ne,[c(" 条件逻辑 "),u(r(V),null,{trigger:p((()=>[u(r(H),{size:"16",component:r(T)},null,8,["component"])])),default:p((()=>[c(" 非必填, 默认为需要全部满足. 示例: (1 AND 2) OR 3, 表示 条件1和2需要满足其一, 条件3必须满足 ")])),_:1})]),u(r(D),{value:e.sqlExpression,"onUpdate:value":l=>e.sqlExpression=l,disabled:!!e.__oppositeBindField,placeholder:"请输入条件逻辑"},null,8,["value","onUpdate:value","disabled"])])])])),_:2},1024)])),_:2},1032,["name"])))),256))])),_:1},8,["expanded-names"]),se.value.length?b("v-if",!0):(s(),g(r(M),{key:0,size:"huge",style:{"margin-top":"20px"},description:"无联动配置"}))])),_:1})])),_:1},8,["show","style"])]))}});export{ie as default};
1
+ import{defineComponent as e,ref as l,watchEffect as o,watch as n,inject as i,computed as a,reactive as t,h as d,openBlock as s,createElementBlock as u,createVNode as r,unref as p,withCtx as c,createTextVNode as v,normalizeStyle as _,createElementVNode as f,Fragment as m,renderList as g,createBlock as h,toDisplayString as y,withModifiers as F,createCommentVNode as b,normalizeClass as k}from"vue";import{useTheme as w}from"../../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{cloneDeep as C,isEmpty as O,isArray as x,union as j,isString as B,isObject as T,omit as E}from"lodash-es";import"@vue/shared";import{traverse as L}from"../../../../shared/utils/index.js";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import{HelpCircleSharp as N}from"@vicons/ionicons5";import{useDialog as U,NSelect as R,NButton as I,NModal as P,NScrollbar as z,NCollapse as V,NCollapseItem as q,NEllipsis as A,NThing as S,NSpace as $,NInputGroup as D,NInput as H,NTooltip as M,NIcon as W,NEmpty as X}from"naive-ui";import"../../../../shared/hooks/useScrollLoading.js";import{conditionOppositeMap as G,connectionTypeOptions as J,connectionTypeOppositeMap as K,InjectionFieldList as Q,conditionTypeOptions as Y}from"../constants/index.js";import Z from"../../../form-render/index.js";const ee={class:"form-config__connectionOperation"},le={class:"form-config__connectionConditionHeaderDesc"},oe={class:"form-config__connectionCondition"},ne={class:"form-config__connectionConditionItem"},ie={style:{"margin-right":"8px"}},ae={class:"form-config__connectionFieldType"},te=["onClick"],de={key:0},se={style:{display:"inline-flex","align-items":"center",gap:"4px","margin-bottom":"4px"}};var ue=e({__name:"FormConfigEventSetting",props:{modelValue:{default:()=>[]}},emits:["update:modelValue","validateFailure"],setup(ue,{emit:re}){var pe,ce;const ve=ue,_e=w(),fe=l([]),me=l("");function ge(){fe.value.push({conObj:[]}),me.value=fe.value.length-1+""}function he(e){return e.__oppositeBindField?`已绑定互斥联动: 联动${fe.value.findIndex((l=>l===e.__oppositeBindField))+1}`:e.__oppositeTargetField?`已关联互斥联动: 联动${fe.value.findIndex((l=>l===e.__oppositeTargetField))+1}`:void 0}function ye(e){return null==e?void 0:e.replace(/(AND|OR)/g,(e=>"AND"===e?"OR":"AND"))}function Fe(e){var l;const o=e.__oppositeTargetField||{conObj:[]};return o.conObj=C(e.conObj),null==(l=o.conObj)||l.forEach((e=>{e.con=G[e.con]})),o.sqlExpression=ye(e.sqlExpression),J.forEach((({value:l})=>{O(e[l])?Reflect.deleteProperty(o,K[l]):o[K[l]]=C(e[l])})),o.__oppositeBindField=e,o}function be(e,l){var o,n,i,a;return(null==(o=e.conObj)?void 0:o.length)===(null==(n=l.conObj)?void 0:n.length)&&(!(e.conObj&&l.conObj&&e.conObj.some((e=>!l.conObj.find((l=>{return n=l,(o=e).field_key===n.field_key&&o.con&&G[o.con]===n.con&&o.value===n.value;var o,n})))))&&(i=e.sqlExpression,a=l.sqlExpression,(!i&&!a||ye(i)===a)&&!J.some((({value:o})=>{return n=e[o],i=l[K[o]],!(n&&i?n.length===i.length&&n.every((e=>i.some((l=>e===l)))):!n&&!i);var n,i}))))}function ke(e){me.value=e[0]}function we(e){const l=fe.value[e];if(!l)return"";const o=l.conObj||[],n=J.reduce(((e,{value:o})=>(x(l[o])&&l[o].length&&e.push(...l[o].map(a)),e)),[]),i=j([...o.map((({field_key:e})=>a(e))),...n]).filter((e=>!!e));return i.length?`( 相关字段: ${i} )`:"";function a(e){var l,o;return null!=(o=null==(l=xe.value.find((l=>B(e)?e===l.key:!!T(e)&&Reflect.get(e,"field")===l.key)))?void 0:l.name)?o:e}}o((()=>{fe.value.forEach((e=>{e.__oppositeTargetField&&(e.__oppositeTargetField=Fe(e))}))}));const Ce=l(!1);n(Ce,(e=>{e&&(fe.value=C(ve.modelValue),fe.value.forEach(((e,l)=>{if(e.__oppositeBindField||e.__oppositeTargetField)return;const o=fe.value.find(((o,n)=>n!==l&&!o.__oppositeBindField&&!o.__oppositeTargetField&&be(o,e)));o&&(o.__oppositeBindField=e,e.__oppositeTargetField=o)})))}));const Oe=i(Q,l([])),xe=a((()=>{const e=[];return L(Oe.value,(l=>{!["NEWLINE","LINE_BAR","COMPLEX","COMBINATION"].includes(l.type)&&e.push(l)})),e})),je=a((()=>xe.value.filter((e=>["INPUT","SELECT","SEARCH","REMOTE_SEARCH"].includes(e.type))))),Be=t([]),Te=U();async function Ee(){var e,l;Te.warning({title:"提示",content:"直接关闭弹窗会丢失已编辑的配置, 确定要关闭吗?",positiveText:(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.27"))||"确定",negativeText:(null==(l=window.getLanguageByCode)?void 0:l.call(window,"10010.1.28"))||"取消",onPositiveClick:()=>{Ce.value=!1,fe.value=[]}})}async function Le(){try{await function(){var e;const l=[];return null==(e=fe.value)||e.forEach(((e,o)=>{const n=[];e.conObj&&e.conObj.length?e.conObj.forEach(((e,l)=>{e.field_key||n.push(`条件${l+1}字段为空`),e.con||n.push(`条件${l+1}判断类型为空`),["NULL","NOT_NULL"].includes(e.con)||!e.con||e.value||n.push(`条件${l+1}值为空`)})):n.push("联动条件为空"),J.every((({value:l})=>!e[l]||!e[l].length))&&n.push("联动字段为空"),n.length&&l.push(`联动${o+1}: ${n}`)})),l.length?Promise.reject(l):Promise.resolve()}(),Ce.value=!1,re("update:modelValue",fe.value.map((e=>E(e,["__oppositeBindField","__oppositeTargetField"]))))}catch(e){re("validateFailure",e)}}const Ne=[{alias:"值设置联动",val_key:"setValueField",html_type:"COMBINATION",elem_width:12,jsonCombination:!1,children:[{alias:(null==(pe=window.getLanguageByCode)?void 0:pe.call(window,"10010.1.9"))||"字段",val_key:"field",html_type:"SELECT2",elem_width:6,componentProps:{labelField:"name",valueField:"key"}},{alias:(null==(ce=window.getLanguageByCode)?void 0:ce.call(window,"10010.1.22"))||"值",elem_width:5,val_key:"value",html_type:"INPUT"}]}],Ue={SELECT2:e({inheritAttrs:!1,props:{value:{},onChange:{type:Function}},setup:e=>()=>d(R,{value:e.value,onUpdateValue:e.onChange,options:je.value,labelField:"name",valueField:"key",filterable:!0})})};return(e,l)=>(s(),u("section",null,[r(p(I),{size:"small",onClick:l[0]||(l[0]=e=>Ce.value=!0)},{default:c((()=>[v("调整联动绑定")])),_:1}),r(p(P),{show:Ce.value,"onUpdate:show":l[1]||(l[1]=e=>Ce.value=e),closable:!1,bordered:!1,"show-icon":!1,title:"联动绑定设置",preset:"dialog","mask-closable":!1,"close-on-esc":!1,style:_({width:"1100px",...p(_e)}),class:"form-config__connectionModal"},{action:c((()=>[r(p(I),{size:"small",onClick:Ee},{default:c((()=>{var e;return[v((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.28"))||"取消")]})),_:1}),r(p(I),{size:"small",onClick:Le,type:"primary"},{default:c((()=>{var e;return[v((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.27"))||"确定")]})),_:1})])),default:c((()=>[f("header",ee,[r(p(I),{onClick:ge,size:"small"},{default:c((()=>[v("新增联动")])),_:1})]),r(p(z),{style:{"max-height":"500px","min-height":"500px"}},{default:c((()=>[r(p(V),{accordion:"","expanded-names":me.value,"onUpdate:expandedNames":ke},{default:c((()=>[(s(!0),u(m,null,g(fe.value,((e,l)=>(s(),h(p(q),{name:l+""},{header:c((()=>[v(" 联动"+y(l+1)+" ",1),r(p(A),{class:"form-config__connectionConditionHeaderDesc",style:{"max-width":"500px"}},{default:c((()=>[v(y(we(l)),1)])),_:2},1024)])),"header-extra":c((()=>[e.__oppositeBindField||e.__oppositeTargetField?(s(),u(m,{key:1},[f("span",le,"( "+y(he(e))+" )",1),r(p(I),{quaternary:"",type:"primary",size:"small",onClick:F((l=>function(e){const l=e.__oppositeTargetField||e.__oppositeBindField;l&&[l,e].forEach((e=>{Reflect.deleteProperty(e,"__oppositeBindField"),Reflect.deleteProperty(e,"__oppositeTargetField")}))}(e)),["stop"])},{default:c((()=>[v("解除互斥")])),_:2},1032,["onClick"])],64)):(s(),h(p(I),{key:0,onClick:F((l=>function(e){fe.value.push(e.__oppositeTargetField=Fe(e))}(e)),["stop"]),quaternary:"",type:"primary",size:"small"},{default:c((()=>[v(" 创建互斥条件 ")])),_:2},1032,["onClick"])),r(p(I),{onClick:F((e=>function(e){var l;const o=null==(l=fe.value)?void 0:l.splice(e,1);null==o||o.forEach((e=>{const l=e.__oppositeTargetField||e.__oppositeBindField;l&&(Reflect.deleteProperty(l,"__oppositeTargetField"),Reflect.deleteProperty(l,"__oppositeBindField"))})),Be.splice(e,1),!me.value||+me.value<e||(me.value=me.value===e+""?"":+me.value-1+"")}(l)),["stop"]),quaternary:"",type:"error",size:"small"},{default:c((()=>{var e;return[v((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.88"))||"移除")]})),_:2},1032,["onClick"])])),default:c((()=>[r(p(S),{class:"form-config__connectionWrapper"},{default:c((()=>[r(p($),{justify:"space-between",wrap:!1},{default:c((()=>[f("section",oe,[f("header",null,[v(" 条件 "),e.__oppositeBindField?b("v-if",!0):(s(),h(p(I),{key:0,size:"small",quaternary:"",type:"primary",onClick:l=>{var o;x((o=e).conObj)?o.conObj.push({}):o.conObj=[{}]}},{default:c((()=>[v(" 添加条件 ")])),_:2},1032,["onClick"]))]),r(p(z),{style:{"max-height":"145px","min-height":"145px"},class:"form-config__connectionWrapper"},{default:c((()=>[(s(!0),u(m,null,g(e.conObj||[],((l,o)=>(s(),u("div",ne,[f("span",ie,y(o+1),1),r(p(D),{size:"small"},{default:c((()=>[r(p(R),{value:l.field_key,"onUpdate:value":e=>l.field_key=e,disabled:!!e.__oppositeBindField,placeholder:"请选择字段",options:p(xe),"label-field":"name","value-field":"key",filterable:""},null,8,["value","onUpdate:value","disabled","options"]),r(p(R),{value:l.con,disabled:!!e.__oppositeBindField,"onUpdate:value":e=>function(e,l){e.con=l,["NOT_NULL","NULL"].includes(l)&&Reflect.deleteProperty(e,"value")}(l,e),placeholder:"请选择判断类型",options:p(Y)},null,8,["value","disabled","onUpdate:value","options"]),l.con&&!["NULL","NOT_NULL"].includes(l.con)?(s(),h(p(H),{key:0,disabled:!!e.__oppositeBindField,value:l.value,"onUpdate:value":e=>l.value=e,placeholder:"请输入值",clearable:""},null,8,["disabled","value","onUpdate:value"])):b("v-if",!0)])),_:2},1024),r(p(I),{disabled:!!e.__oppositeBindField,quaternary:"",onClick:l=>function(e,l){x(e.conObj)&&e.conObj.splice(l,1)}(e,o),type:"error",size:"small"},{default:c((()=>{var e;return[v((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.88"))||"移除")]})),_:2},1032,["disabled","onClick"])])))),256))])),_:2},1024)]),f("section",ae,[f("div",null,[(s(!0),u(m,null,g(p(J),(o=>{var n,i;return s(),u("div",{key:o.value,class:k({"is-active":Be[l]===o.value}),onClick:e=>Be[l]=o.value},y(o.label)+" ( "+y(null!=(i=null==(n=e[o.value])?void 0:n.length)?i:0)+" ) ",11,te)})),128))]),f("div",null,["setValueField"===Be[l]?(s(),u("section",de,[r(p(Z),{"field-list":Ne,"initial-data":{setValueField:e.setValueField},"label-placement":"left",components:Ue,onFormChange:l=>function(e,l){l.setValueField=e.fieldInstance.form.getValuesIn("setValueField")}(l,e)},null,8,["initial-data","onFormChange"])])):Be[l]?(s(),h(p(R),{key:1,value:e[Be[l]],"onUpdate:value":o=>e[Be[l]]=o,disabled:!!e.__oppositeBindField,multiple:"",placeholder:"请选择字段",options:p(xe),"label-field":"name","value-field":"key",filterable:"","max-tag-count":10},null,8,["value","onUpdate:value","disabled","options"])):b("v-if",!0)])])])),_:2},1024),f("section",null,[f("label",null,[f("span",se,[v(" 条件逻辑 "),r(p(M),null,{trigger:c((()=>[r(p(W),{size:"16",component:p(N)},null,8,["component"])])),default:c((()=>[v(" 非必填, 默认为需要全部满足. 示例: (1 AND 2) OR 3, 表示 条件1和2需要满足其一, 条件3必须满足 ")])),_:1})]),r(p(H),{value:e.sqlExpression,"onUpdate:value":l=>e.sqlExpression=l,disabled:!!e.__oppositeBindField,placeholder:"请输入条件逻辑"},null,8,["value","onUpdate:value","disabled"])])])])),_:2},1024)])),_:2},1032,["name"])))),256))])),_:1},8,["expanded-names"]),fe.value.length?b("v-if",!0):(s(),h(p(X),{key:0,size:"huge",style:{"margin-top":"20px"},description:"无联动配置"}))])),_:1})])),_:1},8,["show","style"])]))}});export{ue as default};
@@ -1 +1 @@
1
- import{range as e}from"lodash-es";import{useFormConfigLocale as l}from"../hooks/useLocale.js";var a,o,n,i,d,u,t,E,L,v;function w(e){return new Map([["LINE_BAR",l("layoutArea.linebar")],["NEWLINE",l("layoutArea.linebreak")]]).get(e)||""}var r=(e=>(e.KEY="key",e.NAME="name",e.ALIAS="alias",e.NOTES="notes",e.DEFAULT_VALUE="defaultValue",e.LAYOUT_WIDTH_ENUM="layoutWidthEnum",e.DESC="desc",e.DEFAULT_EXPAND="defaultExpand",e.FOLD="fold",e.REQUIRED="required",e.EDITABLE="editable",e.SHOW="show",e.ROWS="initialHigh",e))(r||{});function c(){return{option:[{text:l("configArea.fullLine"),value:"ALL_LINE"},{text:l("configArea.halfLine"),value:"HALF_LINE"},{text:"5/6",value:"FIVE_SIX"},{text:"2/3",value:"TWO_THREE"},{text:"1/3",value:"ONE_THREE"},{text:"3/4",value:"THREE_FOUR"},{text:"1/4",value:"ONE_FOUR"},{text:"1/6",value:"ONE_SIX"},{text:"1/8",value:"ONE_EIGHT"}]}}function g(){return{option:e(1,11).map((e=>({text:`${e}`,value:e})))}}function b(){return{open:{value:!0},close:{value:!1}}}function F(){return{open:{value:!0},close:{value:!1}}}function N(){return{open:{value:!0},close:{value:!1}}}function s(){return{open:{value:!0},close:{value:!1}}}function I(){return{open:{value:!0},close:{value:!1}}}const S={EQ:"NEQ",NEQ:"EQ",CL:"NC",NC:"CL",NULL:"NOT_NULL",NOT_NULL:"NULL",BIG:"LESSEQ",BIGEQ:"LESS",LESS:"BIGEQ",LESSEQ:"BIG"},y=[{value:"EQ",label:(null==(a=window.getLanguageByCode)?void 0:a.call(window,"10010.1.317"))||"等于"},{value:"NEQ",label:(null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.318"))||"不等于"},{value:"CL",label:(null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.340"))||"包含"},{value:"NC",label:(null==(i=window.getLanguageByCode)?void 0:i.call(window,"10010.1.341"))||"不包含"},{value:"NULL",label:(null==(d=window.getLanguageByCode)?void 0:d.call(window,"10010.1.338"))||"为空"},{value:"NOT_NULL",label:(null==(u=window.getLanguageByCode)?void 0:u.call(window,"10010.1.339"))||"不为空"},{value:"BIG",label:(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.319"))||"大于"},{value:"BIGEQ",label:(null==(E=window.getLanguageByCode)?void 0:E.call(window,"10010.1.321"))||"大于等于"},{value:"LESS",label:(null==(L=window.getLanguageByCode)?void 0:L.call(window,"10010.1.320"))||"小于"},{value:"LESSEQ",label:(null==(v=window.getLanguageByCode)?void 0:v.call(window,"10010.1.322"))||"小于等于"}],C={showField:"hideField",hideField:"showField",requiredField:"notRequiredField",notRequiredField:"requiredField",enabledField:"disabledField",disabledField:"enabledField"},f=[{value:"showField",label:"显示字段"},{value:"hideField",label:"隐藏字段"},{value:"requiredField",label:"必填字段"},{value:"notRequiredField",label:"非必填字段"},{value:"enabledField",label:"启用字段"},{value:"disabledField",label:"禁用字段"}],_="__display",B=Symbol("InjectionFieldList"),m=Symbol("InjectionMaterialList"),A=Symbol("InjectionLowCodeReactions"),p=Symbol("InjectionActiveFieldItem"),O=Symbol("InjectionFormConfigEmit"),T=Symbol("InjectionFormConfigProps");export{r as EditAbleField,_ as FORM_CONFIG_GROUP,p as InjectionActiveFieldItem,B as InjectionFieldList,O as InjectionFormConfigEmit,T as InjectionFormConfigProps,A as InjectionLowCodeReactions,m as InjectionMaterialList,S as conditionOppositeMap,y as conditionTypeOptions,C as connectionTypeOppositeMap,f as connectionTypeOptions,w as getWidgetText,N as isEditOptionConfig,F as isNotFoldOptionConfig,s as isNullOptionConfig,b as isShowOptionConfig,I as isVisibleOptionConfig,g as rowsOptionConfig,c as widgetWidthOptionConfig};
1
+ import{range as e}from"lodash-es";import{useFormConfigLocale as l}from"../hooks/useLocale.js";var a,o,n,i,d,u,t,E,L,v;function w(e){return new Map([["LINE_BAR",l("layoutArea.linebar")],["NEWLINE",l("layoutArea.linebreak")]]).get(e)||""}var r=(e=>(e.KEY="key",e.NAME="name",e.ALIAS="alias",e.NOTES="notes",e.DEFAULT_VALUE="defaultValue",e.LAYOUT_WIDTH_ENUM="layoutWidthEnum",e.DESC="desc",e.DEFAULT_EXPAND="defaultExpand",e.FOLD="fold",e.REQUIRED="required",e.EDITABLE="editable",e.SHOW="show",e.ROWS="initialHigh",e))(r||{});function c(){return{option:[{text:l("configArea.fullLine"),value:"ALL_LINE"},{text:l("configArea.halfLine"),value:"HALF_LINE"},{text:"5/6",value:"FIVE_SIX"},{text:"2/3",value:"TWO_THREE"},{text:"1/3",value:"ONE_THREE"},{text:"3/4",value:"THREE_FOUR"},{text:"1/4",value:"ONE_FOUR"},{text:"1/6",value:"ONE_SIX"},{text:"1/8",value:"ONE_EIGHT"}]}}function g(){return{option:e(1,11).map((e=>({text:`${e}`,value:e})))}}function b(){return{open:{value:!0},close:{value:!1}}}function F(){return{open:{value:!0},close:{value:!1}}}function N(){return{open:{value:!0},close:{value:!1}}}function s(){return{open:{value:!0},close:{value:!1}}}function I(){return{open:{value:!0},close:{value:!1}}}const S={EQ:"NEQ",NEQ:"EQ",CL:"NC",NC:"CL",NULL:"NOT_NULL",NOT_NULL:"NULL",BIG:"LESSEQ",BIGEQ:"LESS",LESS:"BIGEQ",LESSEQ:"BIG"},y=[{value:"EQ",label:(null==(a=window.getLanguageByCode)?void 0:a.call(window,"10010.1.317"))||"等于"},{value:"NEQ",label:(null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.318"))||"不等于"},{value:"CL",label:(null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.340"))||"包含"},{value:"NC",label:(null==(i=window.getLanguageByCode)?void 0:i.call(window,"10010.1.341"))||"不包含"},{value:"NULL",label:(null==(d=window.getLanguageByCode)?void 0:d.call(window,"10010.1.338"))||"为空"},{value:"NOT_NULL",label:(null==(u=window.getLanguageByCode)?void 0:u.call(window,"10010.1.339"))||"不为空"},{value:"BIG",label:(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.319"))||"大于"},{value:"BIGEQ",label:(null==(E=window.getLanguageByCode)?void 0:E.call(window,"10010.1.321"))||"大于等于"},{value:"LESS",label:(null==(L=window.getLanguageByCode)?void 0:L.call(window,"10010.1.320"))||"小于"},{value:"LESSEQ",label:(null==(v=window.getLanguageByCode)?void 0:v.call(window,"10010.1.322"))||"小于等于"}],C={showField:"hideField",hideField:"showField",requiredField:"notRequiredField",notRequiredField:"requiredField",enabledField:"disabledField",disabledField:"enabledField"},f=[{value:"showField",label:"显示字段"},{value:"hideField",label:"隐藏字段"},{value:"requiredField",label:"必填字段"},{value:"notRequiredField",label:"非必填字段"},{value:"enabledField",label:"启用字段"},{value:"disabledField",label:"禁用字段"},{value:"setValueField",label:"字段设值"}],_="__display",B=Symbol("InjectionFieldList"),m=Symbol("InjectionMaterialList"),A=Symbol("InjectionLowCodeReactions"),p=Symbol("InjectionActiveFieldItem"),O=Symbol("InjectionFormConfigEmit"),T=Symbol("InjectionFormConfigProps");export{r as EditAbleField,_ as FORM_CONFIG_GROUP,p as InjectionActiveFieldItem,B as InjectionFieldList,O as InjectionFormConfigEmit,T as InjectionFormConfigProps,A as InjectionLowCodeReactions,m as InjectionMaterialList,S as conditionOppositeMap,y as conditionTypeOptions,C as connectionTypeOppositeMap,f as connectionTypeOptions,w as getWidgetText,N as isEditOptionConfig,F as isNotFoldOptionConfig,s as isNullOptionConfig,b as isShowOptionConfig,I as isVisibleOptionConfig,g as rowsOptionConfig,c as widgetWidthOptionConfig};
@@ -1 +1 @@
1
- import{deepMerge as o}from"../../../../shared/utils/index.js";import{property as e}from"lodash-es";import{reactive as n}from"vue";var l,i,a,d,w,g,t,u,r,c,y,v,L,B,C,s,m,f,p,h,N,b,x,O,T,A,S,k,E,j;const q=n({materialArea:{areaName:(null==(l=window.getLanguageByCode)?void 0:l.call(window,"10010.1.1"))||"物料区",createMaterialPlaceholder:(null==(i=window.getLanguageByCode)?void 0:i.call(window,"10010.1.2"))||"请选择额外物料",toString(){return this.areaName}},layoutArea:{areaName:(null==(a=window.getLanguageByCode)?void 0:a.call(window,"10010.1.3"))||"布局区",linebreak:(null==(d=window.getLanguageByCode)?void 0:d.call(window,"10010.1.4"))||"分行符",linebar:(null==(w=window.getLanguageByCode)?void 0:w.call(window,"10010.1.5"))||"分线栏",createLinebreak:(null==(g=window.getLanguageByCode)?void 0:g.call(window,"10010.1.6"))||"新建分行符",createLinebar:(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.7"))||"新建分线栏",toString(){return this.areaName}},configArea:{areaName:(null==(u=window.getLanguageByCode)?void 0:u.call(window,"10010.1.8"))||"配置区",field:(null==(r=window.getLanguageByCode)?void 0:r.call(window,"10010.1.9"))||"字段",name:(null==(c=window.getLanguageByCode)?void 0:c.call(window,"10010.1.10"))||"名称",alias:(null==(y=window.getLanguageByCode)?void 0:y.call(window,"10010.1.11"))||"别名",defaultValue:(null==(v=window.getLanguageByCode)?void 0:v.call(window,"10010.1.12"))||"默认值",width:(null==(L=window.getLanguageByCode)?void 0:L.call(window,"10010.1.13"))||"宽度",describeText:(null==(B=window.getLanguageByCode)?void 0:B.call(window,"10010.1.14"))||"说明文本",tips:(null==(C=window.getLanguageByCode)?void 0:C.call(window,"10010.1.15"))||"问号提示",isRequired:(null==(s=window.getLanguageByCode)?void 0:s.call(window,"10010.1.16"))||"是否必填",isEditable:(null==(m=window.getLanguageByCode)?void 0:m.call(window,"10010.1.17"))||"是否可编辑",isExpand:(null==(f=window.getLanguageByCode)?void 0:f.call(window,"10010.1.18"))||"是否默认展开",isFoldAble:(null==(p=window.getLanguageByCode)?void 0:p.call(window,"10010.1.19"))||"是否可折叠",isShow:(null==(h=window.getLanguageByCode)?void 0:h.call(window,"10010.1.20"))||"是否显示",modifyOptionTitle:(null==(N=window.getLanguageByCode)?void 0:N.call(window,"10010.1.21"))||"修改选项文本",modifyOptionName:(null==(b=window.getLanguageByCode)?void 0:b.call(window,"10010.1.22"))||"值",modifyOptionOriginText:(null==(x=window.getLanguageByCode)?void 0:x.call(window,"10010.1.23"))||"原文本",modifyOptionNewText:(null==(O=window.getLanguageByCode)?void 0:O.call(window,"10010.1.24"))||"调整后文本",rowsHeight:(null==(T=window.getLanguageByCode)?void 0:T.call(window,"10010.1.25"))||"高度",rowsTips:(null==(A=window.getLanguageByCode)?void 0:A.call(window,"10010.1.26"))||"默认为3行高度,可调整为1-10行高度",positiveBtn:(null==(S=window.getLanguageByCode)?void 0:S.call(window,"10010.1.33"))||"确定",negativeBtn:(null==(k=window.getLanguageByCode)?void 0:k.call(window,"10010.1.32"))||"取消",fullLine:(null==(E=window.getLanguageByCode)?void 0:E.call(window,"10010.1.29"))||"整行",halfLine:(null==(j=window.getLanguageByCode)?void 0:j.call(window,"10010.1.30"))||"半行",toString(){return this.areaName}}});function F(e){o(q,e),console.log(q)}function H(o){const n=e(o)(q);return n?n+"":""}export{F as registFormConfigLocale,H as useFormConfigLocale};
1
+ import{deepMerge as o}from"../../../../shared/utils/index.js";import{property as e}from"lodash-es";import{reactive as n}from"vue";var l,i,a,d,w,g,t,u,r,c,y,v,L,B,C,s,m,f,p,h,N,b,x,O,T,A,S,k,E,j;const q=n({materialArea:{areaName:(null==(l=window.getLanguageByCode)?void 0:l.call(window,"10010.1.1"))||"物料区",createMaterialPlaceholder:(null==(i=window.getLanguageByCode)?void 0:i.call(window,"10010.1.2"))||"请选择额外物料",toString(){return this.areaName}},layoutArea:{areaName:(null==(a=window.getLanguageByCode)?void 0:a.call(window,"10010.1.3"))||"布局区",linebreak:(null==(d=window.getLanguageByCode)?void 0:d.call(window,"10010.1.4"))||"分行符",linebar:(null==(w=window.getLanguageByCode)?void 0:w.call(window,"10010.1.5"))||"分线栏",createLinebreak:(null==(g=window.getLanguageByCode)?void 0:g.call(window,"10010.1.6"))||"新建分行符",createLinebar:(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.7"))||"新建分线栏",toString(){return this.areaName}},configArea:{areaName:(null==(u=window.getLanguageByCode)?void 0:u.call(window,"10010.1.8"))||"配置区",field:(null==(r=window.getLanguageByCode)?void 0:r.call(window,"10010.1.9"))||"字段",name:(null==(c=window.getLanguageByCode)?void 0:c.call(window,"10010.1.10"))||"名称",alias:(null==(y=window.getLanguageByCode)?void 0:y.call(window,"10010.1.11"))||"别名",defaultValue:(null==(v=window.getLanguageByCode)?void 0:v.call(window,"10010.1.12"))||"默认值",width:(null==(L=window.getLanguageByCode)?void 0:L.call(window,"10010.1.13"))||"宽度",describeText:(null==(B=window.getLanguageByCode)?void 0:B.call(window,"10010.1.14"))||"说明文本",tips:(null==(C=window.getLanguageByCode)?void 0:C.call(window,"10010.1.15"))||"问号提示",isRequired:(null==(s=window.getLanguageByCode)?void 0:s.call(window,"10010.1.16"))||"是否必填",isEditable:(null==(m=window.getLanguageByCode)?void 0:m.call(window,"10010.1.17"))||"是否可编辑",isExpand:(null==(f=window.getLanguageByCode)?void 0:f.call(window,"10010.1.18"))||"是否默认展开",isFoldAble:(null==(p=window.getLanguageByCode)?void 0:p.call(window,"10010.1.19"))||"是否可折叠",isShow:(null==(h=window.getLanguageByCode)?void 0:h.call(window,"10010.1.20"))||"是否显示",modifyOptionTitle:(null==(N=window.getLanguageByCode)?void 0:N.call(window,"10010.1.21"))||"修改选项文本",modifyOptionName:(null==(b=window.getLanguageByCode)?void 0:b.call(window,"10010.1.22"))||"值",modifyOptionOriginText:(null==(x=window.getLanguageByCode)?void 0:x.call(window,"10010.1.23"))||"原文本",modifyOptionNewText:(null==(O=window.getLanguageByCode)?void 0:O.call(window,"10010.1.24"))||"调整后文本",rowsHeight:(null==(T=window.getLanguageByCode)?void 0:T.call(window,"10010.1.25"))||"高度",rowsTips:(null==(A=window.getLanguageByCode)?void 0:A.call(window,"10010.1.26"))||"默认为3行高度,可调整为1-10行高度",positiveBtn:(null==(S=window.getLanguageByCode)?void 0:S.call(window,"10010.1.27"))||"确定",negativeBtn:(null==(k=window.getLanguageByCode)?void 0:k.call(window,"10010.1.28"))||"取消",fullLine:(null==(E=window.getLanguageByCode)?void 0:E.call(window,"10010.1.29"))||"整行",halfLine:(null==(j=window.getLanguageByCode)?void 0:j.call(window,"10010.1.30"))||"半行",toString(){return this.areaName}}});function F(e){o(q,e),console.log(q)}function H(o){const n=e(o)(q);return n?n+"":""}export{F as registFormConfigLocale,H as useFormConfigLocale};
@@ -1 +1 @@
1
- .form-config,.form-config__material{display:flex;justify-content:space-between}.form-config__material{border-radius:8px;box-sizing:border-box;flex-direction:column;flex-shrink:0;padding:16px;width:200px}.form-config__materialHeader{align-items:center;display:flex;height:40px;justify-content:space-between}.form-config__materialContent{border:1px dashed hsla(0,0%,50%,.35);border-radius:8px;box-sizing:border-box;display:flex;flex-direction:column;flex-shrink:0;flex:1;gap:8px;max-height:var(--max-height);min-height:200px;overflow-y:auto;padding:16px}.form-config__materialExtraList{margin-top:12px}.form-config__displayWrapper{border-radius:8px;box-sizing:border-box;flex-shrink:0;flex:1;min-width:400px;padding:16px 0}.form-config__displayHeader{align-items:center;display:flex;height:40px;justify-content:space-between}.form-config__displayContent{border:1px dashed hsla(0,0%,50%,.35);border-radius:8px;box-sizing:border-box;display:grid!important;flex-shrink:0;gap:8px;grid-template-columns:repeat(24,minmax(0,1fr));height:fit-content;max-height:var(--max-height);overflow-y:auto;padding:16px}.form-config__displayContentItem{grid-column:span var(--item-column) /span var(--item-column);position:relative}.form-config__config{border-radius:8px;box-sizing:border-box;flex-shrink:0;padding:16px;width:240px}.form-config__configHeader{align-items:center;display:flex;height:40px;justify-content:space-between}.form-config__configContent{border:none;border-radius:8px;box-sizing:border-box;flex-shrink:0;max-height:var(--max-height);min-height:38px;overflow-y:auto;padding:16px}.form-config__renderer{box-sizing:border-box;cursor:move;justify-content:flex-start;width:100%}.form-config__renderer--default{align-items:center;box-sizing:border-box;display:flex;padding:8px 0;position:relative;user-select:none;width:100%}.form-config__renderer--defaultWrapper{align-items:center;border-radius:2px;box-sizing:border-box;display:inline-flex;height:34px;padding:0 14px;transition:all .3s linear}.form-config__renderer--defaultWrapper.is-disabled{background-color:transparent;border:1px dashed var(--c-primary-color)}.form-config__renderer--defaultWrapper:not(.is-disabled){background-color:rgba(46,51,56,.05);border:1px dashed transparent}.form-config__renderer--defaultWrapper:not(.is-disabled):hover{background-color:rgba(46,51,56,.09)}.form-config__renderer--defaultWrapper:not(.is-disabled):active{background-color:rgba(46,51,56,.15)}.form-config__renderer--complex{border:1px dashed var(--c-primary-color);border-radius:8px;padding:8px;transition:all .3s linear}.form-config__renderer--complexHeader{display:flex;justify-content:center;margin-top:-8px;padding:8px;position:relative}.form-config__renderer--complex--grid{display:grid!important;gap:8px;grid-column:span var(--item-column) /span var(--item-column);grid-template-columns:repeat(24,minmax(0,1fr));min-height:24px}.form-config__renderer--complex--flex{display:flex;min-height:24px}.form-config .is-required{padding-left:16px!important}.form-config .is-required:before{color:red;content:"*";left:8px;position:absolute}.form-config .is-extra:before{border-bottom:6px solid transparent;border-left:6px solid var(--c-primary-color);border-right:6px solid transparent;border-top:6px solid var(--c-primary-color);content:"";height:0;left:0;position:absolute;top:0;width:0}.form-config .is-active--text{color:var(--c-primary-color)!important}.form-config .is-active,.form-config .is-active--shadow{box-shadow:0 0 0 1px var(--c-primary-color)}.form-config .is-active{color:var(--c-primary-color)!important}.form-config .is-choosing{box-shadow:inset var(--c-primary-color) 0 0 0 2px;opacity:.7}.form-config .is-choosing-area{background:hsla(0,0%,50%,.1)}.form-config [is-hovering=true] .form-config__renderer--closeButton{visibility:visible}.form-config .form-config__renderer--closeButton{position:absolute;right:4px;top:50%;transform:translateY(-50%);visibility:hidden}.form-config__connectionModal .n-collapse .n-collapse-item:not(:first-of-type){margin-top:4px}.form-config__connectionModal .n-collapse .n-collapse-item .n-collapse-item__header{padding-top:4px}.form-config__connectionOperation{margin-bottom:8px}.form-config__connectionWrapper{border:1px solid #e5e5e5;border-radius:4px;padding:8px}.form-config__connectionCondition{width:450px}.form-config__connectionCondition>header{align-items:center;display:flex;gap:12px}.form-config__connectionConditionHeaderDesc{color:#a5a5a5;display:inline-block;margin-left:12px}.form-config__connectionConditionItem{align-items:center;display:flex;margin-bottom:4px}.form-config__connectionConditionItem>div:first-of-type{flex:1}.form-config__connectionFieldType{display:flex;height:100%}.form-config__connectionFieldType>div:first-of-type{display:flex;flex-direction:column;height:100%;justify-content:space-between;margin-right:-1px}.form-config__connectionFieldType>div:first-of-type>div{background:#f5f5f5;border:1px solid #e5e5e5;cursor:pointer;padding:2px 4px 2px 8px}.form-config__connectionFieldType>div:first-of-type>div:not(:last-of-type){margin-bottom:4px}.form-config__connectionFieldType>div:first-of-type>div.is-active{background:#fff;border-right-color:#fff;color:var(--c-primary-color);z-index:1}.form-config__connectionFieldType>div:nth-of-type(2){border:1px solid #e5e5e5;padding:8px;width:300px}
1
+ .form-config,.form-config__material{display:flex;justify-content:space-between}.form-config__material{border-radius:8px;box-sizing:border-box;flex-direction:column;flex-shrink:0;padding:16px;width:200px}.form-config__materialHeader{align-items:center;display:flex;height:40px;justify-content:space-between}.form-config__materialContent{border:1px dashed hsla(0,0%,50%,.35);border-radius:8px;box-sizing:border-box;display:flex;flex-direction:column;flex-shrink:0;flex:1;gap:8px;max-height:var(--max-height);min-height:200px;overflow-y:auto;padding:16px}.form-config__materialExtraList{margin-top:12px}.form-config__displayWrapper{border-radius:8px;box-sizing:border-box;flex-shrink:0;flex:1;min-width:400px;padding:16px 0}.form-config__displayHeader{align-items:center;display:flex;height:40px;justify-content:space-between}.form-config__displayContent{border:1px dashed hsla(0,0%,50%,.35);border-radius:8px;box-sizing:border-box;display:grid!important;flex-shrink:0;gap:8px;grid-template-columns:repeat(24,minmax(0,1fr));height:fit-content;max-height:var(--max-height);overflow-y:auto;padding:16px}.form-config__displayContentItem{grid-column:span var(--item-column) /span var(--item-column);position:relative}.form-config__config{border-radius:8px;box-sizing:border-box;flex-shrink:0;padding:16px;width:240px}.form-config__configHeader{align-items:center;display:flex;height:40px;justify-content:space-between}.form-config__configContent{border:none;border-radius:8px;box-sizing:border-box;flex-shrink:0;max-height:var(--max-height);min-height:38px;overflow-y:auto;padding:16px}.form-config__renderer{box-sizing:border-box;cursor:move;justify-content:flex-start;width:100%}.form-config__renderer--default{align-items:center;box-sizing:border-box;display:flex;padding:8px 0;position:relative;user-select:none;width:100%}.form-config__renderer--defaultWrapper{align-items:center;border-radius:2px;box-sizing:border-box;display:inline-flex;height:34px;padding:0 14px;transition:all .3s linear}.form-config__renderer--defaultWrapper.is-disabled{background-color:transparent;border:1px dashed var(--c-primary-color)}.form-config__renderer--defaultWrapper:not(.is-disabled){background-color:rgba(46,51,56,.05);border:1px dashed transparent}.form-config__renderer--defaultWrapper:not(.is-disabled):hover{background-color:rgba(46,51,56,.09)}.form-config__renderer--defaultWrapper:not(.is-disabled):active{background-color:rgba(46,51,56,.15)}.form-config__renderer--complex{border:1px dashed var(--c-primary-color);border-radius:8px;padding:8px;transition:all .3s linear}.form-config__renderer--complexHeader{display:flex;justify-content:center;margin-top:-8px;padding:8px;position:relative}.form-config__renderer--complex--grid{display:grid!important;gap:8px;grid-column:span var(--item-column) /span var(--item-column);grid-template-columns:repeat(24,minmax(0,1fr));min-height:24px}.form-config__renderer--complex--flex{display:flex;min-height:24px}.form-config .is-required{padding-left:16px!important}.form-config .is-required:before{color:red;content:"*";left:8px;position:absolute}.form-config .is-extra:before{border-bottom:6px solid transparent;border-left:6px solid var(--c-primary-color);border-right:6px solid transparent;border-top:6px solid var(--c-primary-color);content:"";height:0;left:0;position:absolute;top:0;width:0}.form-config .is-active--text{color:var(--c-primary-color)!important}.form-config .is-active,.form-config .is-active--shadow{box-shadow:0 0 0 1px var(--c-primary-color)}.form-config .is-active{color:var(--c-primary-color)!important}.form-config .is-choosing{box-shadow:inset var(--c-primary-color) 0 0 0 2px;opacity:.7}.form-config .is-choosing-area{background:hsla(0,0%,50%,.1)}.form-config [is-hovering=true] .form-config__renderer--closeButton{visibility:visible}.form-config .form-config__renderer--closeButton{position:absolute;right:4px;top:50%;transform:translateY(-50%);visibility:hidden}.form-config__connectionModal .n-collapse .n-collapse-item:not(:first-of-type){margin-top:4px}.form-config__connectionModal .n-collapse .n-collapse-item .n-collapse-item__header{padding-top:4px}.form-config__connectionOperation{margin-bottom:8px}.form-config__connectionWrapper{border:1px solid #e5e5e5;border-radius:4px;padding:8px}.form-config__connectionCondition{width:450px}.form-config__connectionCondition>header{align-items:center;display:flex;gap:12px}.form-config__connectionConditionHeaderDesc{color:#a5a5a5;display:inline-block;margin-left:12px}.form-config__connectionConditionItem{align-items:center;display:flex;margin-bottom:4px}.form-config__connectionConditionItem>div:first-of-type{flex:1}.form-config__connectionFieldType{display:flex;height:100%}.form-config__connectionFieldType>div:first-of-type{display:flex;flex-direction:column;height:100%;justify-content:space-between;margin-right:-1px}.form-config__connectionFieldType>div:first-of-type>div{background:#f5f5f5;border:1px solid #e5e5e5;cursor:pointer;padding:2px 4px 2px 8px}.form-config__connectionFieldType>div:first-of-type>div:not(:last-of-type){margin-bottom:4px}.form-config__connectionFieldType>div:first-of-type>div.is-active{background:#fff;border-right-color:#fff;color:var(--c-primary-color);z-index:1}.form-config__connectionFieldType>div:nth-of-type(2){border:1px solid #e5e5e5;height:210px;max-height:210px;overflow-y:auto;padding:8px;width:400px}
@@ -1 +1 @@
1
- import{defineComponent as e,ref as o,provide as t,computed as r,nextTick as a,onUnmounted as s,openBlock as i,createBlock as l,unref as n,mergeProps as m,withCtx as p,createElementBlock as u,createVNode as d,isRef as c,Fragment as f,renderList as h,createCommentVNode as y,createElementVNode as g,normalizeStyle as v,toDisplayString as b,renderSlot as j}from"vue";import{useTheme as k}from"../../../shared/hooks/useTheme.js";import{useElementSize as C}from"@vueuse/core";import"date-fns";import{isNumber as F,cloneDeep as S}from"lodash-es";import"@vue/shared";import"../../../shared/utils/index.js";import"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{NForm as w,NTabs as x,NTabPane as A,NConfigProvider as B}from"naive-ui";import{useVersion as L}from"../../../shared/hooks/useVersion.js";import"../../../shared/hooks/useScrollLoading.js";import{createForm as R,onFormMount as H,onFieldValueChange as O,onFieldMount as T,onFieldUnmount as I,onFieldReact as V}from"@formily/core";import{Path as N}from"@formily/path";import{FormProvider as _,FormConsumer as D}from"@formily/vue";import{InjectionFormColumnWidth as W,InjectionFormLifeCycleCaller as U,InjectionFormGraph as E}from"./constants/index.js";import"./utils/business.js";import{createObjSchema as q}from"./utils/schema.js";import{useAnchor as P}from"./hooks/useAnchor.js";import"../index.js";import{useComplexOptionsSpan as G}from"./hooks/useComplexOptions.js";import{useFieldListAdaptor as M}from"./hooks/useFieldListAdaptor.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{useFieldVisitor as K}from"./hooks/useFieldVisitor.js";import{useFormContext as z}from"./hooks/useFormContext.js";import{useFormDomEvent as J,useFormExposeEvent as Q}from"./hooks/useFormEvent.js";import{useFormGraph as $}from"./hooks/useFormGraph.js";import{useFormRenderLifeCycle as X}from"./hooks/useFormRenderLifeCycle.js";import{validateMessageLocale as Y}from"./hooks/useFormValidator.js";import{useLowCodeEvent as Z}from"./hooks/useLowCodeEvent.js";import{useLowCodeReactions as ee}from"./hooks/useLowCodeReactions.js";import{useNuiThemeOverrides as oe}from"./hooks/useNuiThemeOverrides.js";import{useOperationalForm as te}from"./hooks/useOperationalForm.js";import{useWordbookSetting as re}from"./hooks/useWordbookSetting.js";import{useNewLowCodeReactions as ae}from"./hooks/useNewLowCodeReactions.js";const se={key:0,style:{height:"54px"}},ie={style:{"white-space":"pre"}};var le=e({__name:"FormRender",props:{fieldList:{type:Array},initialData:{type:Object,default:()=>({})},fieldVisitor:{type:Object},column:{type:Number,default:24},maxHeight:{type:[Number,String],default:""},anchor:{type:Boolean,default:!1},parallelism:{type:Number,default:5},businessFormatter:{type:Function},schema:{type:Object},components:{type:Object,default:()=>({})},scope:{type:Object,default:()=>({})},annotation:{type:Object},annotationShortcuts:{type:Array},consumer:{type:Boolean,default:!1},uuid:{type:String},lifeCycle:{type:Object},requestInstance:{type:Object},enterToNextWidget:{type:[Boolean,Function],default:!0},autoExpand:Boolean,lowCodeReactions:{type:Array},newLowCodeReactions:{type:Array},operationalForm:{type:Array},dateOperationalForm:{type:Object},operationalFormInit:{type:Boolean,default:!0},linebarAutoHidden:{type:Boolean},bordered:{type:[Boolean,String],default:!0},labelPlacementOverwrite:Boolean,outBordered:{type:Boolean,default:!1},uniqueCacheData:{type:Boolean,default:!1},forceClearable:Boolean,wordSplitFilter:{type:Boolean,default:!0},selectMode:Boolean,selectedFields:{type:Array},linebarDirection:{type:String,default:"vertical"},linebarTextDirection:{type:String,default:"horizontal"},linebarWidth:{type:[Number,String],default:120},autoWidth:{type:[Boolean,Number],default:!1},incrementalRender:{type:Boolean,default:!1},feedbackType:{type:String,default:"default"}},emits:["formChange","annotationChange","scroll","update:selectedFields","linebarChange","ready"],setup(e,{expose:le,emit:ne}){const me=e,pe=k(),{nuiThemeOverrides:ue}=oe();Y();const de=o(),{width:ce}=C(de);t(W,r((()=>ce.value?(ce.value-16*(me.column-1))/24:0)));const fe=r((()=>F(me.maxHeight)?me.maxHeight+"px":me.maxHeight)),{SchemaField:he,businessCollector:ye,formItemDepsCollector:ge,changeContextCollector:ve,asyncQueue:be,formUUID:je}=z(me,ne),{anchorBarRef:ke,currentAnchor:Ce,updateAnchorList:Fe,anchorIdList:Se,onScroll:we,generateAnchorList:xe}=P(me,ne,de,ge),{callLifeCycle:Ae}=X(me);t(U,Ae),Ae("onSetup");const{observeFormGraph:Be,setGraph:Le,removeGraph:Re}=$();t(E,Be);const{lowCodeEventTrigger:He}=Z(),Oe=o(!0),Te=R({initialValues:me.initialData,effects(e){const o={};H((()=>{Object.assign(o,S(e.values))})),O("*",(t=>{const r=N.getIn(o,t.path);N.setIn(o,t.path,t.value);const a=t.props.name.toString();ye.trigger(e,a),ge.trigger(t.path),Oe.value&&ne("formChange",{fieldInstance:t,fieldKey:a,oldValue:r,fieldName:t.title,value:t.value,context:ve.getContext(a,t.value)}),He(t),Ie(a),Ve(a),Ne.trigger(a),_e.trigger(a,t.value)})),T("*",Le),T("*",(e=>{const o=e.props.name.toString();Ie(o),Ve(o),me.operationalFormInit&&Ne.trigger(o)})),I("*",Re),me.anchor&&V("*",Fe)}}),{lowCodeReactionsHandler:Ie}=ee(r((()=>me.lowCodeReactions)),Te),{newLowCodeReactionsHandler:Ve}=ae(r((()=>me.newLowCodeReactions)),Te),Ne=te(me,Te),_e=re().create(Te,ve),{schemaAdaptor:De}=M(ye,me.lifeCycle);let We=me.fieldList||[],Ue=[];const Ee=r((()=>{let e=!1;const o=me.schema?me.schema:me.fieldList?(We!==me.fieldList&&0!==We.length||(e=!0),We=K().traverse(S(me.fieldList),me.fieldVisitor),q(De(We,me))):q({});return me.incrementalRender&&e&&(Ue=[],Object.values(o.properties).forEach((e=>{var o;"visible"===e["x-display"]&&"LINEBAR"===e["x-component"]&&!1!==(null==(o=e["x-component-props"])?void 0:o.show)&&(Ue.push(e),e["x-component-props"].show=!1)})),qe()),o}));function qe(){Ue.length&&setTimeout((()=>{const e=Ue.shift();e&&(ge.trigger(N.parse(e.name),!0),Te.setFieldState(e.name,(e=>{e.componentProps.show=!0})),Ue.length?qe():a().then((()=>{ne("ready")})))}),300)}const{onKeydown:Pe}=J({formModel:Te,formRenderRef:de,props:me,formUUID:je}),{clearSpan:Ge}=G();s((()=>Ge(je)));const Me=Q({formModel:Te,formRenderRef:de,formItemDepsCollector:ge,businessCollector:ye,wordbookSettingHandler:_e,operationalFormHandler:Ne,getFieldList:()=>We,formUUID:je,changeContextCollector:ve,emitFormChange:Oe});return le({formModel:Te,validate:(e="*",o={})=>Me.validate(e,o),getFormValues:(e=!0)=>Me.getFormValues(e),setFormValues:async(e,o={})=>Me.setFormValues(e,o),setFieldState(e,o){Me.setFieldState(e,o)},resetFields(e="*"){Me.resetFields(e)},queryWidget:async e=>Me.queryWidget(e),getFieldList:()=>We,applySelectedSetting:e=>Me.applySelectedSetting(e),async reload(){console.error("reload function is abstract,it should be overwrite!")},async optionInited(e={}){if(await a(),be.activeTasks)return new Promise((o=>{var t;const r=()=>{o(),be.onActiveTaskChange=null};be.onActiveTaskChange=()=>{be.activeTasks||r()},setTimeout(r,null!=(t=e.timeout)?t:5e3)}))},updateAnchor(){xe(Te)},getTextFormValues:()=>Me.getTextFormValues()}),(o,t)=>(i(),l(n(w),m({class:["form-render",{"form-render--out-border":e.outBordered}],"require-mark-placement":"left",style:n(pe)},n(L)(),{uuid:n(je)}),{default:p((()=>[e.anchor?(i(),u("section",se,[d(n(x),{value:n(Ce),"onUpdate:value":t[0]||(t[0]=e=>c(Ce)?Ce.value=e:null),type:"line",ref_key:"anchorBarRef",ref:ke},{default:p((()=>[(i(!0),u(f,null,h(n(Se),(e=>(i(),l(n(A),{name:e.name,tab:e.title,key:e.name},null,8,["name","tab"])))),128))])),_:1},8,["value"])])):y("v-if",!0),d(n(B),{"theme-overrides":n(ue)},{default:p((()=>[g("section",{class:"form-render__wrapper",style:v({"--column":e.column,"--form-height":n(fe)}),ref_key:"formRenderRef",ref:de,onScroll:t[1]||(t[1]=(...e)=>n(we)&&n(we)(...e)),onKeydownCapture:t[2]||(t[2]=(...e)=>n(Pe)&&n(Pe)(...e))},[d(n(_),{form:n(Te)},{default:p((()=>[d(n(he),{schema:n(Ee)},null,8,["schema"]),e.consumer?(i(),l(n(D),{key:0},{default:p((({form:e})=>[g("div",ie,b(JSON.stringify(e.values,null,2)),1)])),_:1})):y("v-if",!0),j(o.$slots,"default")])),_:3},8,["form"])],36)])),_:3},8,["theme-overrides"])])),_:3},16,["class","style","uuid"]))}});export{le as default};
1
+ import{defineComponent as e,ref as o,provide as t,computed as r,nextTick as a,onUnmounted as s,openBlock as i,createBlock as l,unref as n,mergeProps as m,withCtx as p,createElementBlock as d,createVNode as u,isRef as c,Fragment as f,renderList as h,createCommentVNode as y,createElementVNode as g,normalizeStyle as v,toDisplayString as b,renderSlot as j}from"vue";import{useTheme as k}from"../../../shared/hooks/useTheme.js";import{useElementSize as C}from"@vueuse/core";import"date-fns";import{isNumber as F,cloneDeep as S}from"lodash-es";import"@vue/shared";import"../../../shared/utils/index.js";import"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{NForm as w,NTabs as x,NTabPane as A,NConfigProvider as B}from"naive-ui";import{useVersion as L}from"../../../shared/hooks/useVersion.js";import"../../../shared/hooks/useScrollLoading.js";import{createForm as R,onFormMount as H,onFieldValueChange as O,onFieldMount as T,onFieldUnmount as I,onFieldReact as V}from"@formily/core";import{Path as N}from"@formily/path";import{FormProvider as _,FormConsumer as D}from"@formily/vue";import{InjectionFormColumnWidth as W,InjectionFormLifeCycleCaller as U,InjectionFormGraph as E}from"./constants/index.js";import"./components/renderer/text.js";import"./utils/business.js";import{createObjSchema as q}from"./utils/schema.js";import{useAnchor as P}from"./hooks/useAnchor.js";import"../index.js";import{useComplexOptionsSpan as G}from"./hooks/useComplexOptions.js";import{useFieldListAdaptor as M}from"./hooks/useFieldListAdaptor.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{useFieldVisitor as K}from"./hooks/useFieldVisitor.js";import{useFormContext as z}from"./hooks/useFormContext.js";import{useFormDomEvent as J,useFormExposeEvent as Q}from"./hooks/useFormEvent.js";import{useFormGraph as $}from"./hooks/useFormGraph.js";import{useFormRenderLifeCycle as X}from"./hooks/useFormRenderLifeCycle.js";import{validateMessageLocale as Y}from"./hooks/useFormValidator.js";import{useLowCodeEvent as Z}from"./hooks/useLowCodeEvent.js";import{useLowCodeReactions as ee}from"./hooks/useLowCodeReactions.js";import{useNuiThemeOverrides as oe}from"./hooks/useNuiThemeOverrides.js";import{useOperationalForm as te}from"./hooks/useOperationalForm.js";import{useWordbookSetting as re}from"./hooks/useWordbookSetting.js";import{useNewLowCodeReactions as ae}from"./hooks/useNewLowCodeReactions.js";const se={key:0,style:{height:"54px"}},ie={style:{"white-space":"pre"}};var le=e({__name:"FormRender",props:{fieldList:{type:Array},initialData:{type:Object,default:()=>({})},fieldVisitor:{type:Object},column:{type:Number,default:24},maxHeight:{type:[Number,String],default:""},anchor:{type:Boolean,default:!1},parallelism:{type:Number,default:5},businessFormatter:{type:Function},schema:{type:Object},components:{type:Object,default:()=>({})},scope:{type:Object,default:()=>({})},annotation:{type:Object},annotationShortcuts:{type:Array},consumer:{type:Boolean,default:!1},uuid:{type:String},lifeCycle:{type:Object},requestInstance:{type:Object},enterToNextWidget:{type:[Boolean,Function],default:!0},autoExpand:Boolean,lowCodeReactions:{type:Array},newLowCodeReactions:{type:Array},operationalForm:{type:Array},dateOperationalForm:{type:Object},operationalFormInit:{type:Boolean,default:!0},linebarAutoHidden:{type:Boolean},bordered:{type:[Boolean,String],default:!0},labelPlacementOverwrite:Boolean,outBordered:{type:Boolean,default:!1},uniqueCacheData:{type:Boolean,default:!1},forceClearable:Boolean,wordSplitFilter:{type:Boolean,default:!0},selectMode:Boolean,selectedFields:{type:Array},linebarDirection:{type:String,default:"vertical"},linebarTextDirection:{type:String,default:"horizontal"},linebarWidth:{type:[Number,String],default:120},autoWidth:{type:[Boolean,Number],default:!1},incrementalRender:{type:Boolean,default:!1},feedbackType:{type:String,default:"default"}},emits:["formChange","annotationChange","scroll","update:selectedFields","linebarChange","ready"],setup(e,{expose:le,emit:ne}){const me=e,pe=k(),{nuiThemeOverrides:de}=oe();Y();const ue=o(),{width:ce}=C(ue);t(W,r((()=>ce.value?(ce.value-16*(me.column-1))/24:0)));const fe=r((()=>F(me.maxHeight)?me.maxHeight+"px":me.maxHeight)),{SchemaField:he,businessCollector:ye,formItemDepsCollector:ge,changeContextCollector:ve,asyncQueue:be,formUUID:je}=z(me,ne),{anchorBarRef:ke,currentAnchor:Ce,updateAnchorList:Fe,anchorIdList:Se,onScroll:we,generateAnchorList:xe}=P(me,ne,ue,ge),{callLifeCycle:Ae}=X(me);t(U,Ae),Ae("onSetup");const{observeFormGraph:Be,setGraph:Le,removeGraph:Re}=$();t(E,Be);const{lowCodeEventTrigger:He}=Z(),Oe=o(!0),Te=R({initialValues:me.initialData,effects(e){const o={};H((()=>{Object.assign(o,S(e.values))})),O("*",(t=>{const r=N.getIn(o,t.path);N.setIn(o,t.path,t.value);const a=t.props.name.toString();ye.trigger(e,a),ge.trigger(t.path),Oe.value&&ne("formChange",{fieldInstance:t,fieldKey:a,oldValue:r,fieldName:t.title,value:t.value,context:ve.getContext(a,t.value)}),He(t),Ie(a),Ve(a),Ne.trigger(a),_e.trigger(a,t.value)})),T("*",Le),T("*",(e=>{const o=e.props.name.toString();Ie(o),Ve(o),me.operationalFormInit&&Ne.trigger(o)})),I("*",Re),me.anchor&&V("*",Fe)}}),{lowCodeReactionsHandler:Ie}=ee(r((()=>me.lowCodeReactions)),Te),{newLowCodeReactionsHandler:Ve}=ae(r((()=>me.newLowCodeReactions)),Te),Ne=te(me,Te),_e=re().create(Te,ve),{schemaAdaptor:De}=M(ye,me.lifeCycle);let We=me.fieldList||[],Ue=[];const Ee=r((()=>{let e=!1;const o=me.schema?me.schema:me.fieldList?(We!==me.fieldList&&0!==We.length||(e=!0),We=K().traverse(S(me.fieldList),me.fieldVisitor),q(De(We,me))):q({});return me.incrementalRender&&e&&(Ue=[],Object.values(o.properties).forEach((e=>{var o;"visible"===e["x-display"]&&"LINEBAR"===e["x-component"]&&!1!==(null==(o=e["x-component-props"])?void 0:o.show)&&(Ue.push(e),e["x-component-props"].show=!1)})),qe()),o}));function qe(){Ue.length&&setTimeout((()=>{const e=Ue.shift();e&&(ge.trigger(N.parse(e.name),!0),Te.setFieldState(e.name,(e=>{e.componentProps.show=!0})),Ue.length?qe():a().then((()=>{ne("ready")})))}),300)}const{onKeydown:Pe}=J({formModel:Te,formRenderRef:ue,props:me,formUUID:je}),{clearSpan:Ge}=G();s((()=>Ge(je)));const Me=Q({formModel:Te,formRenderRef:ue,formItemDepsCollector:ge,businessCollector:ye,wordbookSettingHandler:_e,operationalFormHandler:Ne,getFieldList:()=>We,formUUID:je,changeContextCollector:ve,emitFormChange:Oe});return le({formModel:Te,validate:(e="*",o={})=>Me.validate(e,o),getFormValues:(e=!0)=>Me.getFormValues(e),setFormValues:async(e,o={})=>Me.setFormValues(e,o),setFieldState(e,o){Me.setFieldState(e,o)},resetFields(e="*"){Me.resetFields(e)},queryWidget:async e=>Me.queryWidget(e),getFieldList:()=>We,applySelectedSetting:e=>Me.applySelectedSetting(e),async reload(){console.error("reload function is abstract,it should be overwrite!")},async optionInited(e={}){if(await a(),be.activeTasks)return new Promise((o=>{var t;const r=()=>{o(),be.onActiveTaskChange=null};be.onActiveTaskChange=()=>{be.activeTasks||r()},setTimeout(r,null!=(t=e.timeout)?t:5e3)}))},updateAnchor(){xe(Te)},getTextFormValues:()=>Me.getTextFormValues()}),(o,t)=>(i(),l(n(w),m({class:["form-render",{"form-render--out-border":e.outBordered}],"require-mark-placement":"left",style:n(pe)},n(L)(),{uuid:n(je)}),{default:p((()=>[e.anchor?(i(),d("section",se,[u(n(x),{value:n(Ce),"onUpdate:value":t[0]||(t[0]=e=>c(Ce)?Ce.value=e:null),type:"line",ref_key:"anchorBarRef",ref:ke},{default:p((()=>[(i(!0),d(f,null,h(n(Se),(e=>(i(),l(n(A),{name:e.name,tab:e.title,key:e.name},null,8,["name","tab"])))),128))])),_:1},8,["value"])])):y("v-if",!0),u(n(B),{"theme-overrides":n(de)},{default:p((()=>[g("section",{class:"form-render__wrapper",style:v({"--column":e.column,"--form-height":n(fe)}),ref_key:"formRenderRef",ref:ue,onScroll:t[1]||(t[1]=(...e)=>n(we)&&n(we)(...e)),onKeydownCapture:t[2]||(t[2]=(...e)=>n(Pe)&&n(Pe)(...e))},[u(n(_),{form:n(Te)},{default:p((()=>[u(n(he),{schema:n(Ee)},null,8,["schema"]),e.consumer?(i(),l(n(D),{key:0},{default:p((({form:e})=>[g("div",ie,b(JSON.stringify(e.values,null,2)),1)])),_:1})):y("v-if",!0),j(o.$slots,"default")])),_:3},8,["form"])],36)])),_:3},8,["theme-overrides"])])),_:3},16,["class","style","uuid"]))}});export{le as default};
@@ -1 +1 @@
1
- import{defineComponent as e,inject as o,createVNode as r}from"vue";import{isObjectField as t}from"@formily/core";import{connect as i,RecursionField as n}from"@formily/vue";import{range as m}from"lodash-es";import"../../../../index.js";import{InjectionBusinessCollector as s,InjectionFormGlobalProps as a}from"../../../constants/index.js";import"../../../../../../shared/utils/index.js";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"@vueuse/core";import"naive-ui";import"../../../utils/business.js";import{createObjSchema as u}from"../../../utils/schema.js";import{useCombination as l}from"./hooks/useCombination.js";import{useFormField as p}from"../../../hooks/useFormField.js";import{useFieldListAdaptor as c}from"../../../hooks/useFieldListAdaptor.js";const f=i(e({name:"FormCombination",props:{title:{type:String,default:""},value:{type:Array},maxGroupNum:{type:Number},minGroupNum:{type:Number,default:1},disabled:{type:Boolean},properties:{type:Array,default:()=>[]},combinationItemDeletable:{type:[Boolean,Function],default:!0},showLabel:Boolean,onInput:{},onBlur:{},onChange:{}},emits:["update:value"],setup(e){const{field:i,fieldKey:f}=p(),{currentGroupNum:d,renderRemoveBtn:v,renderHeader:y}=l(e);function b(){d.value++}const h=o(s),j=o(a),{schemaAdaptor:C}=c(h,j.lifeCycle);return()=>r("section",{class:"form-render__combination"},[y({onClick:b}),m(d.value).map(((o,m)=>r("section",{class:"form-render__combinationContent"},[r(n,{schema:u(C(e.properties)),name:m},null),v({onClick:()=>async function(o){if(d.value>e.minGroupNum)d.value--,await i.value.remove(o);else{const e=i.value.query(`${f.value}.${o}`).take();if(!e||!t(e))return;await e.reset()}}(m),class:"form-render__combinationClose"},m)])))])}}));export{f as COMBINATION};
1
+ import{defineComponent as e,inject as o,createVNode as r}from"vue";import{isObjectField as t}from"@formily/core";import{connect as i,RecursionField as n}from"@formily/vue";import{range as m}from"lodash-es";import"../../../../index.js";import{InjectionBusinessCollector as s,InjectionFormGlobalProps as a}from"../../../constants/index.js";import"../../../../../../shared/utils/index.js";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"@vueuse/core";import"naive-ui";import"../text.js";import"../../../utils/business.js";import{createObjSchema as u}from"../../../utils/schema.js";import{useCombination as l}from"./hooks/useCombination.js";import{useFormField as p}from"../../../hooks/useFormField.js";import{useFieldListAdaptor as c}from"../../../hooks/useFieldListAdaptor.js";const f=i(e({name:"FormCombination",props:{title:{type:String,default:""},value:{type:Array},maxGroupNum:{type:Number},minGroupNum:{type:Number,default:1},disabled:{type:Boolean},properties:{type:Array,default:()=>[]},combinationItemDeletable:{type:[Boolean,Function],default:!0},showLabel:Boolean,onInput:{},onBlur:{},onChange:{}},emits:["update:value"],setup(e){const{field:i,fieldKey:f}=p(),{currentGroupNum:d,renderRemoveBtn:v,renderHeader:y}=l(e);function b(){d.value++}const h=o(s),j=o(a),{schemaAdaptor:C}=c(h,j.lifeCycle);return()=>r("section",{class:"form-render__combination"},[y({onClick:b}),m(d.value).map(((o,m)=>r("section",{class:"form-render__combinationContent"},[r(n,{schema:u(C(e.properties)),name:m},null),v({onClick:()=>async function(o){if(d.value>e.minGroupNum)d.value--,await i.value.remove(o);else{const e=i.value.query(`${f.value}.${o}`).take();if(!e||!t(e))return;await e.reset()}}(m),class:"form-render__combinationClose"},m)])))])}}));export{f as COMBINATION};
@@ -1 +1 @@
1
- import{defineComponent as e,createVNode as r}from"vue";import{connect as t,mapProps as o}from"@formily/vue";import"../../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"@vueuse/core";import"lodash-es";import"naive-ui";import"../../utils/business.js";import{assignUpdateValue as s}from"../../utils/schema.js";const i=t(e({props:{onChange:{},span:{type:Number,default:6},display:{type:String,default:"grid"},wrapperStyle:{type:Object,default:()=>({})}},setup:(e,{slots:t})=>()=>r("section",{class:"form-render__complex"},[r("section",{class:`form-render__complexContent--${e.display}`,style:e.wrapperStyle},[t.default&&t.default()])])}),o(s));export{i as COMPLEX};
1
+ import{defineComponent as e,createVNode as t}from"vue";import{connect as r,mapProps as o}from"@formily/vue";import"../../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"@vueuse/core";import"lodash-es";import"naive-ui";import"./text.js";import"../../utils/business.js";import{assignUpdateValue as s}from"../../utils/schema.js";const i=r(e({props:{onChange:{},span:{type:Number,default:6},display:{type:String,default:"grid"},wrapperStyle:{type:Object,default:()=>({})}},setup:(e,{slots:r})=>()=>t("section",{class:"form-render__complex"},[t("section",{class:`form-render__complexContent--${e.display}`,style:e.wrapperStyle},[r.default&&r.default()])])}),o(s));export{i as COMPLEX};
@@ -1 +1 @@
1
- import{defineComponent as e,computed as t,watch as a,ref as o,onMounted as i,createVNode as n,mergeProps as r}from"vue";import{generateTimeFormat as u}from"../../../../../shared/utils/index.js";import{connect as l,mapProps as s}from"@formily/vue";import{isObject as d,useEventListener as m}from"@vueuse/core";import{format as v}from"date-fns";import c from"../../../../date-picker/index.js";import{useCommonInjection as p}from"../../hooks/useCommonInjection.js";import"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"lodash-es";import"naive-ui";import"../../utils/business.js";import{assignUpdateValue as f,assignClearBindVisited as y}from"../../utils/schema.js";const b=l(e({props:{onChange:{},disabled:{type:Boolean},value:{type:String},validate:{type:Object},valueFormat:{type:String,default:"yyyy-MM-dd"},allowedInvalidValue:{type:String,default:"-"},dbclickToCurrent:{type:Boolean,default:!0}},emits:["update:value"],setup(e,{emit:l}){const{injectValueValidate:s,injectValueBindKey:f}=p();function y(){var t;return"currTime"===(null==(t=e.validate)?void 0:t.min_date)}function b(){var t;return"currTime"===(null==(t=e.validate)?void 0:t.max_date)}function w(e){return y()&&e<Date.now()-864e5||b()&&e>Date.now()}function D(e){const t=new Date(e),a=new Date,o=new Date(t);o.setHours(0),o.setMinutes(0),o.setSeconds(0);const i=new Date(t);i.setHours(23),i.setMinutes(59),i.setSeconds(59);const n=o>a,r=i<a,u=t.getHours(),l=a.getHours(),s=a.getMinutes();return{isHourDisabled:function(e){return y()&&!n&&e<l||b()&&!r&&e>l},isMinuteDisabled:function(e){if(u===l)return y()&&!n&&e<s||b()&&!r&&e>s;return y()&&!n&&u<l||b()&&!r&&u>l}}}s((()=>e.value));const j=t((()=>{const t={};if(d(e.validate)){const{min_date:a,max_date:o}=e.validate;(a||o)&&(t.isDateDisabled=w,t.isTimeDisabled=D)}return t})),g=t((()=>({valueFormat:e.valueFormat,format:e.valueFormat,timePickerProps:{format:u(e.valueFormat)}})));function h(t){return t?t===e.allowedInvalidValue?t:v(new Date(t),e.valueFormat):null}a((()=>e.value),(e=>{e&&h(e)!==e&&l("update:value",h(e))}));const k=t({get:()=>h(e.value),set:e=>{l("update:value",e)}}),F=f(k),V=o();return i((()=>{var t;if(!e.dbclickToCurrent)return;const a=null==(t=V.value)?void 0:t.$el;if(!a)return;const o=a.querySelector("input");o&&m(a,"dblclick",(()=>function(t){e.disabled||(t.value=v(Date.now(),e.valueFormat),t.dispatchEvent(new Event("input")))}(o)))})),()=>n(c,r({ref:V,key:F.value,disabled:e.disabled,allowedInvalidValue:e.allowedInvalidValue},j.value,g.value,{"formatted-value":k.value,"onUpdate:formatted-value":e=>k.value=e}),null)}}),s(f,y));export{b as DATE};
1
+ import{defineComponent as e,computed as t,watch as a,ref as o,onMounted as i,createVNode as n,mergeProps as r}from"vue";import{generateTimeFormat as u}from"../../../../../shared/utils/index.js";import{connect as l,mapProps as s}from"@formily/vue";import{isObject as d,useEventListener as m}from"@vueuse/core";import{format as v}from"date-fns";import c from"../../../../date-picker/index.js";import{useCommonInjection as p}from"../../hooks/useCommonInjection.js";import"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"lodash-es";import"naive-ui";import"./text.js";import"../../utils/business.js";import{assignUpdateValue as f,assignClearBindVisited as y}from"../../utils/schema.js";const b=l(e({props:{onChange:{},disabled:{type:Boolean},value:{type:String},validate:{type:Object},valueFormat:{type:String,default:"yyyy-MM-dd"},allowedInvalidValue:{type:String,default:"-"},dbclickToCurrent:{type:Boolean,default:!0}},emits:["update:value"],setup(e,{emit:l}){const{injectValueValidate:s,injectValueBindKey:f}=p();function y(){var t;return"currTime"===(null==(t=e.validate)?void 0:t.min_date)}function b(){var t;return"currTime"===(null==(t=e.validate)?void 0:t.max_date)}function w(e){return y()&&e<Date.now()-864e5||b()&&e>Date.now()}function D(e){const t=new Date(e),a=new Date,o=new Date(t);o.setHours(0),o.setMinutes(0),o.setSeconds(0);const i=new Date(t);i.setHours(23),i.setMinutes(59),i.setSeconds(59);const n=o>a,r=i<a,u=t.getHours(),l=a.getHours(),s=a.getMinutes();return{isHourDisabled:function(e){return y()&&!n&&e<l||b()&&!r&&e>l},isMinuteDisabled:function(e){if(u===l)return y()&&!n&&e<s||b()&&!r&&e>s;return y()&&!n&&u<l||b()&&!r&&u>l}}}s((()=>e.value));const j=t((()=>{const t={};if(d(e.validate)){const{min_date:a,max_date:o}=e.validate;(a||o)&&(t.isDateDisabled=w,t.isTimeDisabled=D)}return t})),g=t((()=>({valueFormat:e.valueFormat,format:e.valueFormat,timePickerProps:{format:u(e.valueFormat)}})));function h(t){return t?t===e.allowedInvalidValue?t:v(new Date(t),e.valueFormat):null}a((()=>e.value),(e=>{e&&h(e)!==e&&l("update:value",h(e))}));const k=t({get:()=>h(e.value),set:e=>{l("update:value",e)}}),F=f(k),V=o();return i((()=>{var t;if(!e.dbclickToCurrent)return;const a=null==(t=V.value)?void 0:t.$el;if(!a)return;const o=a.querySelector("input");o&&m(a,"dblclick",(()=>function(t){e.disabled||(t.value=v(Date.now(),e.valueFormat),t.dispatchEvent(new Event("input")))}(o)))})),()=>n(c,r({ref:V,key:F.value,disabled:e.disabled,allowedInvalidValue:e.allowedInvalidValue},j.value,g.value,{"formatted-value":k.value,"onUpdate:formatted-value":e=>k.value=e}),null)}}),s(f,y));export{b as DATE};
@@ -1 +1 @@
1
- import{defineComponent as e,computed as t,inject as l,createVNode as a,mergeProps as o,isVNode as n}from"vue";import i from"../../../../../shared/components/CancelRadio/CancelRadio.js";import{connect as r,mapProps as u}from"@formily/vue";import{cloneDeep as s,isArray as d,xor as c,isNumber as p,isEmpty as v}from"lodash-es";import{NCheckboxGroup as m,NCheckbox as f,NRadioGroup as h}from"naive-ui";import"../../../index.js";import{InjectionChangeContextCollector as y}from"../../constants/index.js";import{useComplexOptions as g}from"../../hooks/useComplexOptions.js";import"../../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"@vueuse/core";import"../../utils/business.js";import{assignUpdateValue as j,createVisitedSetter as b}from"../../utils/schema.js";import{useUrlConfigOptions as x,useAutographOptions as C}from"../../hooks/useFormRenderOptions.js";import{useCommonInjection as F}from"../../hooks/useCommonInjection.js";import{useFormField as k}from"../../hooks/useFormField.js";function S(i,r,u){return e({name:i,props:{value:{type:[String,Number,Object,Array]},options:{type:Array,default:()=>[]},urlConfig:{type:Object},autograph:{type:String},lazyRequest:{type:Boolean,default:!1},requestCache:{type:Boolean,default:!0},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},wordbook:{type:Object},vertical:{type:Boolean,default:!1},childFieldStrategy:{type:String,default:"checked"},childWidthMode:{type:String,default:"outer"},clearable:Boolean,selectAll:Boolean,onChange:{}},emits:["update:value"],setup(e,{emit:i,attrs:h}){const{field:j,fieldKey:S}=k();const w=t({get(){return t=e.value,p(t)?t+"":t;var t},set(e){i("update:value",e)}}),{renderComplexOption:O}=g(e,w),{labelKey:B,valueKey:_,fullOptions:K}=e.urlConfig?x(e,w):C(e,w);l(y).setContext(S.value,(e=>{return{currentOption:s((t=e,d(t)?function(e){const t=K.value.reduce(((e,t)=>(e[t[_.value]]=t,e)),{});return e.map((e=>t[e]))}(t):(l=t,K.value.find((e=>e[_.value]===l))))),labelField:B.value,valueField:_.value};var t,l}));const{injectValueBindKey:W,injectValueValidate:R}=F();R(w);const A=W(w);function I(){w.value=null}const M=t({get:()=>d(w.value)&&w.value.length===K.value.length,set(e){const t=e?K.value.map((e=>e[_.value])):[];c(t,w.value).length&&(w.value=t)}}),V=t((()=>d(e.value)&&e.value.length&&e.value.length<K.value.length));function P(t){let l;const o={display:"flex",alignItems:"center"};if(t.__spanPercent&&"inner"===e.childWidthMode){const e=`${t.__spanPercent}%`;o.maxWidth=e,function(e,t){return!v(t.childrenFields)&&(d(e)?e.includes(t[_.value]):e===t[_.value])}(w.value,t)&&(o.width=e)}return a(u,{key:t[_.value],value:t[_.value],disabled:t.disabled,currentValue:w.value,cancelable:e.clearable,onCancel:I,style:o},"function"==typeof(i=l=O({value:w.value,option:t,valueKey:_.value,labelKey:B.value,childFieldStrategy:e.childFieldStrategy,childWidthMode:e.childWidthMode}))||"[object Object]"===Object.prototype.toString.call(i)&&!n(i)?l:{default:()=>[l]});var i}return()=>{const t=K.value.map((e=>{var t;const l=null==(t=e.childrenFields)?void 0:t.reduce(((e,t)=>e+ +(t.elem_width||3)),0);return{...e,__spanPercent:(l||0)/12*100}})),l={display:"flex",flexDirection:e.vertical?"column":"row",flexWrap:"wrap",justifyItems:"flex-start",alignItems:e.vertical?"flex-start":"center",width:"100%"},n=a(r,o({key:A.value,value:w.value,"onUpdate:value":e=>w.value=e,onClick:b(j),style:{width:"100%"}},h),{default:()=>[a("section",{style:l},[t.map(P)])]});return e.selectAll?a("section",null,[[r!==m?null:a(f,{checked:M.value,"onUpdate:checked":e=>M.value=e,indeterminate:V.value},{default:()=>{var e;return(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.37"))||"全选"}}),n]]):n}}})}const w=r(S("FormRadio",h,i),u({dataSource:"options"},j)),O=r(S("FormCheckbox",m,f),u({dataSource:"options"},j));export{O as CHECKBOX,w as RADIO};
1
+ import{defineComponent as e,computed as t,inject as l,createVNode as a,mergeProps as o,isVNode as n}from"vue";import i from"../../../../../shared/components/CancelRadio/CancelRadio.js";import{connect as r,mapProps as u}from"@formily/vue";import{cloneDeep as s,isArray as d,xor as c,isNumber as p,isEmpty as v}from"lodash-es";import{NCheckboxGroup as m,NCheckbox as f,NRadioGroup as h}from"naive-ui";import"../../../index.js";import{InjectionChangeContextCollector as y}from"../../constants/index.js";import{useComplexOptions as g}from"../../hooks/useComplexOptions.js";import"../../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"@vueuse/core";import"./text.js";import"../../utils/business.js";import{assignUpdateValue as j,createVisitedSetter as b}from"../../utils/schema.js";import{useUrlConfigOptions as x,useAutographOptions as C}from"../../hooks/useFormRenderOptions.js";import{useCommonInjection as F}from"../../hooks/useCommonInjection.js";import{useFormField as k}from"../../hooks/useFormField.js";function S(i,r,u){return e({name:i,props:{value:{type:[String,Number,Object,Array]},options:{type:Array,default:()=>[]},urlConfig:{type:Object},autograph:{type:String},lazyRequest:{type:Boolean,default:!1},requestCache:{type:Boolean,default:!0},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},wordbook:{type:Object},vertical:{type:Boolean,default:!1},childFieldStrategy:{type:String,default:"checked"},childWidthMode:{type:String,default:"outer"},clearable:Boolean,selectAll:Boolean,onChange:{}},emits:["update:value"],setup(e,{emit:i,attrs:h}){const{field:j,fieldKey:S}=k();const w=t({get(){return t=e.value,p(t)?t+"":t;var t},set(e){i("update:value",e)}}),{renderComplexOption:O}=g(e,w),{labelKey:B,valueKey:_,fullOptions:K}=e.urlConfig?x(e,w):C(e,w);l(y).setContext(S.value,(e=>{return{currentOption:s((t=e,d(t)?function(e){const t=K.value.reduce(((e,t)=>(e[t[_.value]]=t,e)),{});return e.map((e=>t[e]))}(t):(l=t,K.value.find((e=>e[_.value]===l))))),labelField:B.value,valueField:_.value};var t,l}));const{injectValueBindKey:W,injectValueValidate:R}=F();R(w);const A=W(w);function I(){w.value=null}const M=t({get:()=>d(w.value)&&w.value.length===K.value.length,set(e){const t=e?K.value.map((e=>e[_.value])):[];c(t,w.value).length&&(w.value=t)}}),V=t((()=>d(e.value)&&e.value.length&&e.value.length<K.value.length));function P(t){let l;const o={display:"flex",alignItems:"center"};if(t.__spanPercent&&"inner"===e.childWidthMode){const e=`${t.__spanPercent}%`;o.maxWidth=e,function(e,t){return!v(t.childrenFields)&&(d(e)?e.includes(t[_.value]):e===t[_.value])}(w.value,t)&&(o.width=e)}return a(u,{key:t[_.value],value:t[_.value],disabled:t.disabled,currentValue:w.value,cancelable:e.clearable,onCancel:I,style:o},"function"==typeof(i=l=O({value:w.value,option:t,valueKey:_.value,labelKey:B.value,childFieldStrategy:e.childFieldStrategy,childWidthMode:e.childWidthMode}))||"[object Object]"===Object.prototype.toString.call(i)&&!n(i)?l:{default:()=>[l]});var i}return()=>{const t=K.value.map((e=>{var t;const l=null==(t=e.childrenFields)?void 0:t.reduce(((e,t)=>e+ +(t.elem_width||3)),0);return{...e,__spanPercent:(l||0)/12*100}})),l={display:"flex",flexDirection:e.vertical?"column":"row",flexWrap:"wrap",justifyItems:"flex-start",alignItems:e.vertical?"flex-start":"center",width:"100%"},n=a(r,o({key:A.value,value:w.value,"onUpdate:value":e=>w.value=e,onClick:b(j),style:{width:"100%"}},h),{default:()=>[a("section",{style:l},[t.map(P)])]});return e.selectAll?a("section",null,[[r!==m?null:a(f,{checked:M.value,"onUpdate:checked":e=>M.value=e,indeterminate:V.value},{default:()=>{var e;return(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.37"))||"全选"}}),n]]):n}}})}const w=r(S("FormRadio",h,i),u({dataSource:"options"},j)),O=r(S("FormCheckbox",m,f),u({dataSource:"options"},j));export{O as CHECKBOX,w as RADIO};
@@ -1 +1 @@
1
- import{defineComponent as e,ref as t,computed as a,inject as l,watch as o,createVNode as r,nextTick as n}from"vue";import{connect as u,mapProps as i}from"@formily/vue";import{last as s,isEqual as c,isArray as p,isString as d}from"lodash-es";import{NCascader as v}from"naive-ui";import"../../../index.js";import{useCommonInjection as m}from"../../hooks/useCommonInjection.js";import{InjectionChangeContextCollector as f,InjectionAsyncQueue as h,InjectionFormUUID as y}from"../../constants/index.js";import"@formily/path";import"@vueuse/core";import"../../../../../shared/utils/index.js";import"@formily/core";import"@vicons/ionicons5";import"@vue/shared";import"../../utils/business.js";import{assignUpdateValue as k,createVisitedSetter as j,traverseDependKey as g}from"../../utils/schema.js";import"date-fns";import"../../hooks/useComplexOptions.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"@vueuse/shared";import"../../../../../shared/hooks/selectHooks/useSearchContent.js";import"../../../../../shared/hooks/useScrollLoading.js";import"./index.js";import{useFormField as b}from"../../hooks/useFormField.js";import"@formily/reactive";import"../../hooks/useFormValidator.js";const C=u(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:u,emit:i}){const k=t(),{field:C,title:S,fieldKey:F}=b(),w=t(1),A=t(!0);const H=a((()=>{var t,a,l;return null!=(l=null!=(a=null==(t=e.urlConfig)?void 0:t.nameKey)?a:e.labelField)?l:"text"})),x=a((()=>{var t,a,l;return null!=(l=null!=(a=null==(t=e.urlConfig)?void 0:t.valueKey)?a:e.valueField)?l:"value"}));l(f).setContext(F.value,(()=>({labelField:H.value,valueField:x.value})));const q=a((()=>{var t;try{const a=Array.isArray(e.value)?e.value:JSON.parse(e.value||"");if(!Array.isArray(a)||!a.length)return null;const l=null==(t=s(a))?void 0:t[x.value];return null!=l?l:a.map((e=>e[H.value])).join(" / ")}catch(e){return null}}));function K(e,t,a){i("update:value",p(a)?a.map((function(e){return{...e,label:e[H.value],children:void 0,parent:void 0,mergeItemValue:void 0}})):null)}const L=l(h);async function V(t){e.filterable?await async function(){if(!e.urlConfig||k.value&&e.requestCache)return;const t=await L.addAsync({...e.urlConfig,params:{lvlnr:"1"},key:F.value,cache:e.requestCache,payload:{field:C.value,labelKey:H.value,valueKey:x.value}});function a(e,t,o){const r=[...o,...l(e)],n={[H.value]:e[H.value],[x.value]:e[x.value],depth:t+1,isLeaf:!0,keyword:e.keyword,mergeItemValue:r};return p(e.children)&&(n.children=e.children.map((e=>a(e,t+1,r))),n.isLeaf=!e.children.length),w.value=Math.max(w.value,t+1),n}function l(e){let t=[];if(d(e[H.value])&&(t=[...t,e[H.value]]),d(e.keyword)&&e.keyword.length>0){const a=e.keyword.split(",");t=[...t,...a]}return t}k.value=t.map((e=>a(e,0,[])))}():await async function(t){if(o(e,t))return;const a=await L.addAsync(r(s(t),i(e),S.value,t));if(!a.length&&t)return t.isLeaf=!0,K(0,0,n(t)),void(N.value=!1);const l=a.map((e=>u(e,s(t))));function o(e,t){return!i(e)||!t&&k.value&&e.requestCache||s(t)>=s(e)-1}function r(t,a,l,o){const r={lvlnr:t+1+""};return o&&a.dependKey&&g(a.dependKey,((e,t)=>{r[t]=o[e]})),{params:r,...a,key:l,cache:e.requestCache}}function n(e){let t=e;const a=[e];for(;t.parent;)a.unshift(t.parent),t=t.parent;return a}function u(a,l){return{[H.value]:a[H.value],[x.value]:a[x.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:k.value=l}(t),await I()}const B=`form-render__cascade--menu-${l(y)}`;async function I(){await n();const e=document.querySelector(`.${B} .v-vl`);e&&e.dispatchEvent(new CustomEvent("scroll"))}function E(t,a){if(!t||!a)return!1;const{mergeItemValue:l}=a;return!(e.checkStrategy.includes("child")&&a.depth<w.value)&&(l.length>0&&l.some((e=>e.includes(t.trim()))))}const{injectValueValidate:O,injectValueWatchFromEmpty:W,injectValueBindKey:z}=m();W((()=>e.value),V),O((()=>e.value)),o((()=>e.urlConfig),(async(t,a)=>{c(t,a)||(k.value=null,A.value?e.lazyRequest||(V(),A.value=!A.value):await V())}),{immediate:!0});const N=t(!1);function P(e){N.value=!!e,e&&V()}const R=a((()=>k.value||e.options||[])),U=a((()=>!e.filterable)),$=z(q);return()=>r(v,{key:$.value,remote:U.value,filterable:e.filterable,"menu-props":{class:B,onClick:I},"check-strategy":e.checkStrategy,show:!!N.value,"onUpdate:show":P,value:q.value,filter:E,"onUpdate:value":K,labelField:H.value,valueField:x.value,options:R.value,onLoad:V,onFocus:j(C)},u)}}),i({dataSource:"options"},k));export{C as SEARCH_CASCADER};
1
+ import{defineComponent as e,ref as t,computed as a,inject as l,watch as o,createVNode as r,nextTick as n}from"vue";import{connect as u,mapProps as i}from"@formily/vue";import{last as s,isEqual as c,isArray as p,isString as d}from"lodash-es";import{NCascader as v}from"naive-ui";import"../../../index.js";import{useCommonInjection as m}from"../../hooks/useCommonInjection.js";import{InjectionChangeContextCollector as f,InjectionAsyncQueue as h,InjectionFormUUID as y}from"../../constants/index.js";import"@formily/path";import"@vueuse/core";import"../../../../../shared/utils/index.js";import"@formily/core";import"@vicons/ionicons5";import"@vue/shared";import"./text.js";import"../../utils/business.js";import{assignUpdateValue as k,createVisitedSetter as j,traverseDependKey as g}from"../../utils/schema.js";import"date-fns";import"../../hooks/useComplexOptions.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"@vueuse/shared";import"../../../../../shared/hooks/selectHooks/useSearchContent.js";import"../../../../../shared/hooks/useScrollLoading.js";import"./index.js";import{useFormField as b}from"../../hooks/useFormField.js";import"@formily/reactive";import"../../hooks/useFormValidator.js";const C=u(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:u,emit:i}){const k=t(),{field:C,title:S,fieldKey:F}=b(),w=t(1),A=t(!0);const x=a((()=>{var t,a,l;return null!=(l=null!=(a=null==(t=e.urlConfig)?void 0:t.nameKey)?a:e.labelField)?l:"text"})),H=a((()=>{var t,a,l;return null!=(l=null!=(a=null==(t=e.urlConfig)?void 0:t.valueKey)?a:e.valueField)?l:"value"}));l(f).setContext(F.value,(()=>({labelField:x.value,valueField:H.value})));const q=a((()=>{var t;try{const a=Array.isArray(e.value)?e.value:JSON.parse(e.value||"");if(!Array.isArray(a)||!a.length)return null;const l=null==(t=s(a))?void 0:t[H.value];return null!=l?l:a.map((e=>e[x.value])).join(" / ")}catch(e){return null}}));function K(e,t,a){i("update:value",p(a)?a.map((function(e){return{...e,label:e[x.value],children:void 0,parent:void 0,mergeItemValue:void 0}})):null)}const L=l(h);async function V(t){e.filterable?await async function(){if(!e.urlConfig||k.value&&e.requestCache)return;const t=await L.addAsync({...e.urlConfig,params:{lvlnr:"1"},key:F.value,cache:e.requestCache,payload:{field:C.value,labelKey:x.value,valueKey:H.value}});function a(e,t,o){const r=[...o,...l(e)],n={[x.value]:e[x.value],[H.value]:e[H.value],depth:t+1,isLeaf:!0,keyword:e.keyword,mergeItemValue:r};return p(e.children)&&(n.children=e.children.map((e=>a(e,t+1,r))),n.isLeaf=!e.children.length),w.value=Math.max(w.value,t+1),n}function l(e){let t=[];if(d(e[x.value])&&(t=[...t,e[x.value]]),d(e.keyword)&&e.keyword.length>0){const a=e.keyword.split(",");t=[...t,...a]}return t}k.value=t.map((e=>a(e,0,[])))}():await async function(t){if(o(e,t))return;const a=await L.addAsync(r(s(t),i(e),S.value,t));if(!a.length&&t)return t.isLeaf=!0,K(0,0,n(t)),void(N.value=!1);const l=a.map((e=>u(e,s(t))));function o(e,t){return!i(e)||!t&&k.value&&e.requestCache||s(t)>=s(e)-1}function r(t,a,l,o){const r={lvlnr:t+1+""};return o&&a.dependKey&&g(a.dependKey,((e,t)=>{r[t]=o[e]})),{params:r,...a,key:l,cache:e.requestCache}}function n(e){let t=e;const a=[e];for(;t.parent;)a.unshift(t.parent),t=t.parent;return a}function u(a,l){return{[x.value]:a[x.value],[H.value]:a[H.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:k.value=l}(t),await I()}const B=`form-render__cascade--menu-${l(y)}`;async function I(){await n();const e=document.querySelector(`.${B} .v-vl`);e&&e.dispatchEvent(new CustomEvent("scroll"))}function E(t,a){if(!t||!a)return!1;const{mergeItemValue:l}=a;return!(e.checkStrategy.includes("child")&&a.depth<w.value)&&(l.length>0&&l.some((e=>e.includes(t.trim()))))}const{injectValueValidate:O,injectValueWatchFromEmpty:W,injectValueBindKey:z}=m();W((()=>e.value),V),O((()=>e.value)),o((()=>e.urlConfig),(async(t,a)=>{c(t,a)||(k.value=null,A.value?e.lazyRequest||(V(),A.value=!A.value):await V())}),{immediate:!0});const N=t(!1);function P(e){N.value=!!e,e&&V()}const R=a((()=>k.value||e.options||[])),U=a((()=>!e.filterable)),$=z(q);return()=>r(v,{key:$.value,remote:U.value,filterable:e.filterable,"menu-props":{class:B,onClick:I},"check-strategy":e.checkStrategy,show:!!N.value,"onUpdate:show":P,value:q.value,filter:E,"onUpdate:value":K,labelField:x.value,valueField:H.value,options:R.value,onLoad:V,onFocus:j(C)},u)}}),i({dataSource:"options"},k));export{C as SEARCH_CASCADER};
@@ -113,6 +113,9 @@ export declare const SELECT: import("vue").DefineComponent<{
113
113
  type: BooleanConstructor;
114
114
  };
115
115
  wordSplitFilter: {};
116
+ unMatchedOption: {
117
+ type: FunctionConstructor;
118
+ };
116
119
  }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:value" | "postRecommend" | "patternChange")[], "update:value" | "postRecommend" | "patternChange", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
117
120
  value: {
118
121
  type: PropType<ArrayAble<string | number> | null>;
@@ -223,6 +226,9 @@ export declare const SELECT: import("vue").DefineComponent<{
223
226
  type: BooleanConstructor;
224
227
  };
225
228
  wordSplitFilter: {};
229
+ unMatchedOption: {
230
+ type: FunctionConstructor;
231
+ };
226
232
  }>> & {
227
233
  "onUpdate:value"?: ((...args: any[]) => any) | undefined;
228
234
  onPostRecommend?: ((...args: any[]) => any) | undefined;
@@ -1 +1 @@
1
- import{defineComponent as e,computed as o,watch as t,inject as l,useAttrs as a,ref as r,createVNode as s,mergeProps as n,toRaw as u}from"vue";import{arrayed as i}from"../../../../../shared/utils/index.js";import{NSelect as p}from"naive-ui";import"@vueuse/core";import"date-fns";import{cloneDeep as m,isArray as d,isObject as c,omit as v,xor as y}from"lodash-es";import"@vue/shared";import{useSelectAllowModify as f}from"../../../../../shared/hooks/selectHooks/useSelectAllowModify.js";import"../../../../../shared/hooks/selectHooks/useSearchContent.js";import{useSelectRenders as h}from"../../../../../shared/hooks/selectHooks/useSelectRenders.js";import"../../../../../shared/hooks/useScrollLoading.js";import{connect as b,mapProps as j}from"@formily/vue";import{useCommonInjection as S,useSelectOptionProps as g}from"../../hooks/useCommonInjection.js";import{useComplexOptions as k,useComplexOptionsSpan as C}from"../../hooks/useComplexOptions.js";import{InjectionChangeContextCollector as F,InjectionFormUUID as B}from"../../constants/index.js";import"@formily/path";import"@formily/core";import"@vicons/ionicons5";import"../../utils/business.js";import{assignUpdateValue as w,assignClearBindVisited as A,createVisitedSetter as H}from"../../utils/schema.js";import"../../../index.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"./index.js";import"@vueuse/shared";import{useFormField as O}from"../../hooks/useFormField.js";import"@formily/reactive";import{useUrlConfigOptions as K,useAutographOptions as R,useRecommendOptions as x}from"../../hooks/useFormRenderOptions.js";import"../../hooks/useFormValidator.js";const V=b(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"},showField:{type:String},allowCreate:Boolean,shouldSave:Boolean,allowModify:Boolean,showCustomValue:Boolean,cursorPlacement:{type:String,default:"end"},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},useLoading:{type:Boolean,default:!0},multiple:{type:Boolean},deletable:{type:Boolean,default:!0},selectAll:{type:Boolean},searchByValue:{type:Boolean},wordSplitFilter:{}},emits:["update:value","postRecommend","patternChange"],setup(e,{slots:b,emit:j}){const w=o({get:()=>e.value,async set(e){j("update:value",e),G(e)}}),{labelKey:A,valueKey:V,showKey:L,fetchData:P,searchContent:_,fullOptions:N,filterOptions:I,remoteOptions:W,loading:q}=e.urlConfig?K(e,w):R(e,w);t(_,(e=>{j("patternChange",{pattern:e,options:ue.value})}));const{modifyEvent:E,modifyAbleRef:z,getOptionsWithCreated:M}=f(e,{searchContent:_,labelKey:A,valueKey:V,valueRef:w,fullOptions:N}),{renderComplexOption:T,hasComplexOption:U}=k(e,w),{getRecommend:D,postRecommend:G,sortedOptions:J}=x(e,I,j,A,V),{field:Q,fieldKey:X}=O();l(F).setContext(X.value,(e=>({currentOption:m(function(e){const o=M(N.value);return d(e)?function(e){const t=o.reduce(((e,o)=>(e[o[V.value]]=o,e)),{});return e.map((e=>t[e]))}(e):(t=e,o.find((e=>e[V.value]===t)));var t}(e)),labelField:A.value,valueField:V.value})));const Y=async e=>(_.value=e,Promise.allSettled([P(e),D(e)])),{injectValueValidate:Z,injectValueWatchFromEmpty:$,injectValueBindKey:ee}=S();$(w,(()=>e.lazyRequest&&Y())),Z(w);const oe=ee(w),{menuProps:te,nodeProps:le}=g(),{renderTag:ae,renderLabel:re,renderSelectAll:se,titleRef:ne}=h(e,{labelKey:A,valueKey:V,valueRef:w,showKey:L,searchContent:_}),ue=o((()=>M(z.value?N.value:J.value))),ie=a(),pe=o((()=>{if(e.allowCreate||e.showCustomValue)return w.value;const o=e.multiple&&d(w.value);return N.value.find((e=>o?w.value.includes(e[V.value]):e[V.value]===w.value))?w.value:null})),me=r(!1);async function de(e){e&&await Y(),me.value=e}async function ce(e,o){await E.updateValue(e,o),W.value&&o&&i(o).forEach((e=>{if(!c(e))return;const o=e;o.created&&o.shouldSave&&W.value.push(v(u(o),["created","shouldSave"]))}))}const ve=l(B),{getSpan:ye}=C(),fe=H(Q,E.focus);function he(o){if(!e.multiple)return;const t=o?ue.value.map((e=>e[V.value])):[];y(t,e.value).length&&(w.value=t)}function be(o){let t=b;return e.multiple&&e.selectAll&&(t={action:()=>se(he),...b}),s(p,n({title:ne.value,key:oe.value,multiple:e.multiple,remote:!0,filterable:!0,loading:q.value,value:pe.value,onUpdateValue:ce,"menu-props":te,"node-props":le,labelField:A.value,valueField:V.value,options:ue.value,onSearch:Y,show:me.value,"onUpdate:show":de,onFocus:fe,onBlur:E.blur,renderLabel:re,renderTag:ae},o,ie),t)}return()=>{var e,o;if(!U.value)return be();const t=null!=(o=null==(e=Q.value.decoratorProps)?void 0:e.span)?o:6,l=ye(ve,Q.value.address);return s("section",{class:"form-render__selectChildField",style:{"--column":l+t}},[be({class:"form-render__selectChildFieldItem",style:{"--form-item-column":t}}),N.value.map((e=>T({option:e,value:w.value,valueKey:V.value,labelKey:A.value,childFieldStrategy:"checked",renderLabel:!1,attrs:{class:"form-render__selectChildFieldItem",style:{"--form-item-column":l}}})))])}}}),j({dataSource:"options"},w,A));export{V as SELECT};
1
+ import{defineComponent as e,computed as t,watch as o,inject as l,useAttrs as a,ref as r,createVNode as s,mergeProps as n,toRaw as u}from"vue";import{arrayed as i}from"../../../../../shared/utils/index.js";import{NSelect as p}from"naive-ui";import"@vueuse/core";import"date-fns";import{cloneDeep as m,isArray as d,isFunction as c,isObject as v,omit as y,xor as f}from"lodash-es";import"@vue/shared";import{useSelectAllowModify as h}from"../../../../../shared/hooks/selectHooks/useSelectAllowModify.js";import"../../../../../shared/hooks/selectHooks/useSearchContent.js";import{useSelectRenders as j}from"../../../../../shared/hooks/selectHooks/useSelectRenders.js";import"../../../../../shared/hooks/useScrollLoading.js";import{connect as b,mapProps as S}from"@formily/vue";import{useCommonInjection as g,useSelectOptionProps as k}from"../../hooks/useCommonInjection.js";import{useComplexOptions as C,useComplexOptionsSpan as F}from"../../hooks/useComplexOptions.js";import{InjectionChangeContextCollector as B,InjectionFormUUID as O}from"../../constants/index.js";import"@formily/path";import"@formily/core";import"@vicons/ionicons5";import"./text.js";import"../../utils/business.js";import{assignUpdateValue as w,assignClearBindVisited as A,createVisitedSetter as H}from"../../utils/schema.js";import"../../../index.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"./index.js";import"@vueuse/shared";import{useFormField as K}from"../../hooks/useFormField.js";import"@formily/reactive";import{useUrlConfigOptions as R,useAutographOptions as x,useRecommendOptions as V}from"../../hooks/useFormRenderOptions.js";import"../../hooks/useFormValidator.js";const L=b(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"},showField:{type:String},allowCreate:Boolean,shouldSave:Boolean,allowModify:Boolean,showCustomValue:Boolean,cursorPlacement:{type:String,default:"end"},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},useLoading:{type:Boolean,default:!0},multiple:{type:Boolean},deletable:{type:Boolean,default:!0},selectAll:{type:Boolean},searchByValue:{type:Boolean},wordSplitFilter:{},unMatchedOption:{type:Function}},emits:["update:value","postRecommend","patternChange"],setup(e,{slots:b,emit:S}){const w=t({get:()=>e.value,async set(e){S("update:value",e),J(e)}}),{labelKey:A,valueKey:L,showKey:P,fetchData:_,searchContent:M,fullOptions:N,filterOptions:I,remoteOptions:W,loading:q}=e.urlConfig?R(e,w):x(e,w);o(M,(e=>{S("patternChange",{pattern:e,options:ie.value})}));const{modifyEvent:E,modifyAbleRef:z,getOptionsWithCreated:T}=h(e,{searchContent:M,labelKey:A,valueKey:L,valueRef:w,fullOptions:N}),{renderComplexOption:U,hasComplexOption:D}=C(e,w),{getRecommend:G,postRecommend:J,sortedOptions:Q}=V(e,I,S,A,L),{field:X,fieldKey:Y}=K();l(B).setContext(Y.value,(e=>({currentOption:m(function(e){const t=T(N.value);return d(e)?function(e){const o=t.reduce(((e,t)=>(e[t[L.value]]=t,e)),{});return e.map((e=>o[e]))}(e):(o=e,t.find((e=>e[L.value]===o)));var o}(e)),labelField:A.value,valueField:L.value})));const Z=async e=>(M.value=e,Promise.allSettled([_(e),G(e)])),{injectValueValidate:$,injectValueWatchFromEmpty:ee,injectValueBindKey:te}=g();ee(w,(()=>e.lazyRequest&&Z())),$(w);const oe=te(w),{menuProps:le,nodeProps:ae}=k(),{renderTag:re,renderLabel:se,renderSelectAll:ne,titleRef:ue}=j(e,{labelKey:A,valueKey:L,valueRef:w,showKey:P,searchContent:M}),ie=t((()=>T(z.value?N.value:Q.value))),pe=a(),me=t((()=>{var t;return c(e.unMatchedOption)?o()?w.value:null==(t=e.unMatchedOption(w.value))?void 0:t[A.value]:e.allowCreate||e.showCustomValue||o()?w.value:null;function o(){const t=e.multiple&&d(w.value);return!!N.value.find((e=>t?w.value.includes(e[L.value]):e[L.value]===w.value))}})),de=r(!1);async function ce(e){e&&await Z(),de.value=e}async function ve(e,t){await E.updateValue(e,t),W.value&&t&&i(t).forEach((e=>{if(!v(e))return;const t=e;t.created&&t.shouldSave&&W.value.push(y(u(t),["created","shouldSave"]))}))}const ye=l(O),{getSpan:fe}=F(),he=H(X,E.focus);function je(t){if(!e.multiple)return;const o=t?ie.value.map((e=>e[L.value])):[];f(o,e.value).length&&(w.value=o)}function be(t){let o=b;return e.multiple&&e.selectAll&&(o={action:()=>ne(je),...b}),s(p,n({title:ue.value,key:oe.value,multiple:e.multiple,remote:!0,filterable:!0,loading:q.value,value:me.value,onUpdateValue:ve,"menu-props":le,"node-props":ae,labelField:A.value,valueField:L.value,options:ie.value,onSearch:Z,show:de.value,"onUpdate:show":ce,onFocus:he,onBlur:E.blur,renderLabel:se,renderTag:re},t,pe),o)}return()=>{var e,t;if(!D.value)return be();const o=null!=(t=null==(e=X.value.decoratorProps)?void 0:e.span)?t:6,l=fe(ye,X.value.address);return s("section",{class:"form-render__selectChildField",style:{"--column":l+o}},[be({class:"form-render__selectChildFieldItem",style:{"--form-item-column":o}}),N.value.map((e=>U({option:e,value:w.value,valueKey:L.value,labelKey:A.value,childFieldStrategy:"checked",renderLabel:!1,attrs:{class:"form-render__selectChildFieldItem",style:{"--form-item-column":l}}})))])}}}),S({dataSource:"options"},w,A));export{L as SELECT};
@@ -1 +1 @@
1
- import{defineComponent as e,useAttrs as o,ref as i,computed as l,createVNode as t,mergeProps as u,createTextVNode as r}from"vue";import{NSwitch as n,NModal as a,NCheckbox as d}from"naive-ui";import"../../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"@vueuse/core";import"lodash-es";import"../../utils/business.js";import{assignUpdateValue as s,assignValueBindKey as v}from"../../utils/schema.js";import{connect as p,mapProps as c}from"@formily/vue";import"../../../index.js";import{useFormField as m}from"../../hooks/useFormField.js";const w=p(e({name:"FormSwitch",props:{value:{},openDescription:{type:Object},closeDescription:{type:Object},showMode:{type:String,default:"SWITCH"},onChange:{}},emits:["update:value"],setup(e,{emit:s}){const v=o(),p=i(!1),{field:c,fieldKey:w}=m(),h=l((()=>{var e,o;return null==(o=null==(e=c.value.decoratorProps)?void 0:e.fieldItem)?void 0:o.requiredReminderContent})),f=l((()=>{var o,i;return null==(i=null==(o=e.openDescription)?void 0:o.value)||i})),g=l((()=>{var o,i;return null!=(i=null==(o=e.closeDescription)?void 0:o.value)&&i})),y=()=>{var o,i;return r(null!=(i=null==(o=e.openDescription)?void 0:o.describe)?i:"")},C=()=>{var o,i;return r(null!=(i=null==(o=e.closeDescription)?void 0:o.describe)?i:"")},j=l({get:()=>e.value===f.value,set(o){if(!h.value||"SWITCH"!==e.showMode||o)return s("update:value",o?f.value:g.value);p.value=!0}});function k(){s("update:value",g.value)}return()=>{return"SWITCH"===e.showMode?[t(n,u({value:j.value,"onUpdate:value":e=>j.value=e},v),{checked:y,unchecked:C}),h.value?t(a,{show:p.value,"onUpdate:show":e=>p.value=e,"display-directive":"show",preset:"dialog",title:(null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.428"))||"确认","positive-text":(null==(i=window.getLanguageByCode)?void 0:i.call(window,"10010.1.428"))||"确认","negative-text":(null==(l=window.getLanguageByCode)?void 0:l.call(window,"10010.1.32"))||"取消",content:h.value,onPositiveClick:k},null):null]:t(d,{checked:j.value,"onUpdate:checked":e=>j.value=e},{default:y});var o,i,l}}}),c(s,v));export{w as SWITCH};
1
+ import{defineComponent as e,useAttrs as o,ref as i,computed as l,createVNode as t,mergeProps as r,createTextVNode as u}from"vue";import{NSwitch as n,NModal as a,NCheckbox as d}from"naive-ui";import"../../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"@vueuse/core";import"lodash-es";import"./text.js";import"../../utils/business.js";import{assignUpdateValue as s,assignValueBindKey as v}from"../../utils/schema.js";import{connect as p,mapProps as c}from"@formily/vue";import"../../../index.js";import{useFormField as m}from"../../hooks/useFormField.js";const w=p(e({name:"FormSwitch",props:{value:{},openDescription:{type:Object},closeDescription:{type:Object},showMode:{type:String,default:"SWITCH"},onChange:{}},emits:["update:value"],setup(e,{emit:s}){const v=o(),p=i(!1),{field:c,fieldKey:w}=m(),h=l((()=>{var e,o;return null==(o=null==(e=c.value.decoratorProps)?void 0:e.fieldItem)?void 0:o.requiredReminderContent})),f=l((()=>{var o,i;return null==(i=null==(o=e.openDescription)?void 0:o.value)||i})),g=l((()=>{var o,i;return null!=(i=null==(o=e.closeDescription)?void 0:o.value)&&i})),y=()=>{var o,i;return u(null!=(i=null==(o=e.openDescription)?void 0:o.describe)?i:"")},C=()=>{var o,i;return u(null!=(i=null==(o=e.closeDescription)?void 0:o.describe)?i:"")},j=l({get:()=>e.value===f.value,set(o){if(!h.value||"SWITCH"!==e.showMode||o)return s("update:value",o?f.value:g.value);p.value=!0}});function k(){s("update:value",g.value)}return()=>{return"SWITCH"===e.showMode?[t(n,r({value:j.value,"onUpdate:value":e=>j.value=e},v),{checked:y,unchecked:C}),h.value?t(a,{show:p.value,"onUpdate:show":e=>p.value=e,"display-directive":"show",preset:"dialog",title:(null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.428"))||"确认","positive-text":(null==(i=window.getLanguageByCode)?void 0:i.call(window,"10010.1.428"))||"确认","negative-text":(null==(l=window.getLanguageByCode)?void 0:l.call(window,"10010.1.28"))||"取消",content:h.value,onPositiveClick:k},null):null]:t(d,{checked:j.value,"onUpdate:checked":e=>j.value=e},{default:y});var o,i,l}}}),c(s,v));export{w as SWITCH};
@@ -1 +1 @@
1
- import{defineComponent as e,computed as t,inject as n,createVNode as o}from"vue";import{connect as r,mapProps as l,RecursionField as i}from"@formily/vue";import{isString as s}from"lodash-es";import"../../../index.js";import{InjectionBusinessCollector as a,InjectionFormGlobalProps as u}from"../../constants/index.js";import{createSlot as m,replace2Any as c}from"../../utils/index.js";import{useFieldListAdaptor as p}from"../../hooks/useFieldListAdaptor.js";import{createObjSchema as d}from"../../utils/schema.js";const f=r(e({name:"FORM_TEXT",props:{content:{},fieldItem:{type:Object},value:{},onChange:{}},setup(e){function r(t,n=!1,r=!0){return r?o("div",{style:n?{display:"flex",alignItems:"center"}:{}},[l()]):l();function l(){var n,r;return null==(r=(n=m(t,e,(e=>s(e)?e=c(e.replace("\n","<br>"),[{from:"<br>",to:o("i",{style:{width:"100%",height:"4px"}},null)},{from:" ",to:o("i",{style:{display:"inline-block",width:"4px"}},null)}]):[e]))).default)?void 0:r.call(n)}}const l=t((()=>{var t,n;return null!=(n=null==(t=e.fieldItem)?void 0:t.__textEnhance)?n:[]})),f=t((()=>l.value.length&&l.value.some((e=>"widget"===e.type)))),v=n(a),h=n(u),{schemaAdaptor:y}=p(v,h.lifeCycle);return()=>{var t;return f.value?o("div",{style:{display:"flex",alignItems:"center"}},[l.value.map((e=>{if("text"===e.type)return r(e.content,!0,!1);if(s(e.content))return r(e.content,!0,!1);const t={...e.content};return t.decoratorProps={...t.decoratorProps,showLabel:!1,showFeedback:!1},o(i,{basePath:".",schema:d(y([t]))},null)}))]):r(null!=(t=e.content)?t:e.value)}}}),l((e=>{var t;return{...e,content:null==(t=e.fieldItem)?void 0:t.content}})));export{f as TEXT};
1
+ import{defineComponent as e,computed as t,inject as n,createVNode as o}from"vue";import{connect as r,mapProps as l,RecursionField as i}from"@formily/vue";import{isString as s}from"lodash-es";import"../../../index.js";import{InjectionBusinessCollector as a,InjectionFormGlobalProps as u}from"../../constants/index.js";import{useFieldListAdaptor as m}from"../../hooks/useFieldListAdaptor.js";import{createObjSchema as c}from"../../utils/schema.js";import{createSlot as p,replace2Any as d}from"../../utils/index.js";const f=r(e({name:"FORM_TEXT",props:{content:{},fieldItem:{type:Object},value:{},onChange:{}},setup(e){function r(t,n=!1,r=!0){return r?o("div",{style:n?{display:"flex",alignItems:"center"}:{}},[l()]):l();function l(){var n,r;return null==(r=(n=p(t,e,(e=>s(e)?e=d(e.replace("\n","<br>"),[{from:"<br>",to:o("i",{style:{width:"100%",height:"4px"}},null)},{from:" ",to:o("i",{style:{display:"inline-block",width:"4px"}},null)}]):[e]))).default)?void 0:r.call(n)}}const l=t((()=>{var t,n;return null!=(n=null==(t=e.fieldItem)?void 0:t.__textEnhance)?n:[]})),f=t((()=>l.value.length&&l.value.some((e=>"widget"===e.type)))),v=n(a),h=n(u),{schemaAdaptor:y}=m(v,h.lifeCycle);return()=>{var t;return f.value?o("div",{style:{display:"flex",alignItems:"center"}},[l.value.map((e=>{if("text"===e.type)return r(e.content,!0,!1);if(s(e.content))return r(e.content,!0,!1);const t={...e.content};return t.decoratorProps={...t.decoratorProps,showLabel:!1,showFeedback:!1},o(i,{basePath:".",schema:c(y([t]))},null)}))]):r(null!=(t=e.content)?t:e.value)}}}),l((e=>{var t;return{...e,content:null==(t=e.fieldItem)?void 0:t.content}})));export{f as TEXT};
@@ -1 +1 @@
1
- import{defineComponent as e,computed as o,inject as r,createVNode as t,mergeProps as i}from"vue";import{InjectionFormGlobalProps as s}from"../../constants/index.js";import{useCommonInjection as u}from"../../hooks/useCommonInjection.js";import"../../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"@vueuse/core";import"lodash-es";import{NInput as m}from"naive-ui";import"../../utils/business.js";import{assignUpdateValue as a,assignClearBindVisited as l}from"../../utils/schema.js";import{connect as n,mapProps as p,useField as v}from"@formily/vue";const d=n(e({name:"FormTextarea",props:{value:{type:String},rows:{type:Number}},emits:["update:value"],setup(e,{emit:a}){const l=o({get:()=>e.value,set:e=>a("update:value",e)}),n=u().injectValueBindKey(l),p=v(),d=r(s,{}),c=o((()=>{var e,o,r;return null!=(r=null==(o=null==(e=p.value.decoratorProps)?void 0:e.fieldItem)?void 0:o.bordered)?r:d.bordered})),f=o((()=>"underline"===c.value?{autosize:{minRows:e.rows,maxRows:99}}:{rows:e.rows}));return()=>t(m,i({type:"textarea"},f.value,{key:n.value,value:l.value,"onUpdate:value":e=>l.value=e}),null)}}),p(a,l));export{d as TEXTAREA};
1
+ import{defineComponent as e,computed as o,inject as r,createVNode as t,mergeProps as i}from"vue";import{InjectionFormGlobalProps as s}from"../../constants/index.js";import{useCommonInjection as u}from"../../hooks/useCommonInjection.js";import"../../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"@vueuse/core";import"lodash-es";import{NInput as m}from"naive-ui";import"./text.js";import"../../utils/business.js";import{assignUpdateValue as a,assignClearBindVisited as l}from"../../utils/schema.js";import{connect as n,mapProps as p,useField as v}from"@formily/vue";const d=n(e({name:"FormTextarea",props:{value:{type:String},rows:{type:Number}},emits:["update:value"],setup(e,{emit:a}){const l=o({get:()=>e.value,set:e=>a("update:value",e)}),n=u().injectValueBindKey(l),p=v(),d=r(s,{}),c=o((()=>{var e,o,r;return null!=(r=null==(o=null==(e=p.value.decoratorProps)?void 0:e.fieldItem)?void 0:o.bordered)?r:d.bordered})),f=o((()=>"underline"===c.value?{autosize:{minRows:e.rows,maxRows:99}}:{rows:e.rows}));return()=>t(m,i({type:"textarea"},f.value,{key:n.value,value:l.value,"onUpdate:value":e=>l.value=e}),null)}}),p(a,l));export{d as TEXTAREA};
@@ -1 +1 @@
1
- import{doAnimation as e}from"../../../../shared/utils/anime.js";import{Path as o}from"@formily/path";import{useDebounceFn as r,watchOnce as t}from"@vueuse/core";import{ref as n,nextTick as i,computed as l}from"vue";import"../../../../shared/utils/index.js";import"@formily/core";import"@vicons/ionicons5";import"@vue/shared";import"lodash-es";import"naive-ui";import"../utils/business.js";import{createLinebarId as s}from"../utils/schema.js";function a(a,u,c,m){const v=n(),p=n(""),f=n([]),d=r((async function(e){var o;f.value=Object.values(e.fields).reduce(((e,o)=>{var r,t,n,i;return"LINEBAR"===o.componentType&&"visible"===o.selfDisplay&&e.push({title:null!=(t=null==(r=o.componentProps)?void 0:r.title)?t:o.title,name:o.address.toString(),index:null!=(i=null==(n=o.decoratorProps)?void 0:n._index)?i:0}),e}),[]).sort(((e,o)=>e.index-o.index)),await i(),null==(o=v.value)||o.syncBarPosition()}),100);let h=!1;async function y(r){h=!0;try{if(!c.value)return;m.trigger(o.parse(r),!0),await i();const t=c.value.querySelector(`#${s(r)}`);if(!t)return;await new Promise((o=>{e(c.value.scrollTop,t.offsetTop,300,(e=>{var o;null==(o=c.value)||o.scrollTo({top:e})}),"easeInSine",(()=>setTimeout(o,300)))}))}finally{h=!1}}const T=r((function(e){var o;if(h||!c.value)return;const{scrollTop:r,clientHeight:t}=c.value,n=f.value.find(((e,o,n)=>{const i=n[o+1];if(!i)return!0;const l=c.value.querySelector(`#${s(i.name)}`);return l?l.offsetTop>r+t/2:void 0}))||f.value[f.value.length-1];p.value=null!=(o=null==n?void 0:n.name)?o:"",u("scroll",e)}),300);t(f,(e=>{var o,r;p.value=null!=(r=null==(o=e[0])?void 0:o.name)?r:""}));return{currentAnchor:l({get:()=>p.value,async set(e){p.value=e,await new Promise((e=>setTimeout(e,100))),await y(e)}}),onScroll:T,anchorIdList:f,generateAnchorList:d,updateAnchorList:function(e){"LINEBAR"===e.componentType&&e.selfDisplay&&d(e.form)},scrollTo:y,anchorBarRef:v}}export{a as useAnchor};
1
+ import{doAnimation as e}from"../../../../shared/utils/anime.js";import{Path as o}from"@formily/path";import{useDebounceFn as r,watchOnce as t}from"@vueuse/core";import{ref as n,nextTick as i,computed as l}from"vue";import"../../../../shared/utils/index.js";import"@formily/core";import"@vicons/ionicons5";import"@vue/shared";import"lodash-es";import"naive-ui";import"../components/renderer/text.js";import"../utils/business.js";import{createLinebarId as s}from"../utils/schema.js";function a(a,u,c,m){const p=n(),v=n(""),f=n([]),d=r((async function(e){var o;f.value=Object.values(e.fields).reduce(((e,o)=>{var r,t,n,i;return"LINEBAR"===o.componentType&&"visible"===o.selfDisplay&&e.push({title:null!=(t=null==(r=o.componentProps)?void 0:r.title)?t:o.title,name:o.address.toString(),index:null!=(i=null==(n=o.decoratorProps)?void 0:n._index)?i:0}),e}),[]).sort(((e,o)=>e.index-o.index)),await i(),null==(o=p.value)||o.syncBarPosition()}),100);let h=!1;async function y(r){h=!0;try{if(!c.value)return;m.trigger(o.parse(r),!0),await i();const t=c.value.querySelector(`#${s(r)}`);if(!t)return;await new Promise((o=>{e(c.value.scrollTop,t.offsetTop,300,(e=>{var o;null==(o=c.value)||o.scrollTo({top:e})}),"easeInSine",(()=>setTimeout(o,300)))}))}finally{h=!1}}const T=r((function(e){var o;if(h||!c.value)return;const{scrollTop:r,clientHeight:t}=c.value,n=f.value.find(((e,o,n)=>{const i=n[o+1];if(!i)return!0;const l=c.value.querySelector(`#${s(i.name)}`);return l?l.offsetTop>r+t/2:void 0}))||f.value[f.value.length-1];v.value=null!=(o=null==n?void 0:n.name)?o:"",u("scroll",e)}),300);t(f,(e=>{var o,r;v.value=null!=(r=null==(o=e[0])?void 0:o.name)?r:""}));return{currentAnchor:l({get:()=>v.value,async set(e){v.value=e,await new Promise((e=>setTimeout(e,100))),await y(e)}}),onScroll:T,anchorIdList:f,generateAnchorList:d,updateAnchorList:function(e){"LINEBAR"===e.componentType&&e.selfDisplay&&d(e.form)},scrollTo:y,anchorBarRef:p}}export{a as useAnchor};
@@ -1 +1 @@
1
- import{isField as e}from"@formily/core";import{Path as t}from"@formily/path";import{isString as s}from"@vueuse/core";import{format as i}from"date-fns";import{isFunction as r,isNumber as n}from"lodash-es";import{FIELD_BUSINESS_TYPE as l}from"../constants/index.js";import"vue";import"../../../../shared/utils/index.js";import"@vicons/ionicons5";import"@vue/shared";import"naive-ui";import{isIdCard as a,parseIdCard as o,parseAgeFromContext as u,parseBirthday as h,parseAge2Birthday as y}from"../utils/business.js";class c{constructor(e){this.businessFormatter=e,this.triggerDisabled=!1,this.typeLockMap=new Map,this.typeCollector=new Map,this.fieldNameCollector=new Map,this.changeHandlerMap=new Map([])}formatter(...e){return r(this.businessFormatter)?this.businessFormatter(...e):e[0].value}collect(e,t){this.typeCollector.set(e,t),this.fieldNameCollector.set(t.val_key,e)}getField(e){return this.typeCollector.get(e)}getFieldInstanceByType(e,t){const s=this.getField(t);return s?e.query(s.val_key).take():null}getType(e){return this.fieldNameCollector.get(e)}getValueByField(t,s){const i=t.query(s).take();return e(i)?i.value:null}getValueByType(e,t){const s=this.getField(t);return s?this.getValueByField(e,s.val_key):null}setValueByType(e,i,r,n){const l=this.getField(i);l&&e.setFieldState(l.val_key,(e=>{e.value!==r&&(!this.typeLockMap.get(i)&&this.typeLockMap.set(i,1),this.triggerDisabled&&s(this.triggerDisabled)&&t.parse(this.triggerDisabled).match(l.val_key)||(e.value=this.formatter({value:r,type:i,fieldKey:l.val_key,from:n})))}))}registerChangeBusiness(e,t){return this.changeHandlerMap.set(e,t),this}trigger(e,t,s="change"){var i;if(!0===this.triggerDisabled)return;const r=this.getType(t);if(!r)return;if("change"===s&&this.typeLockMap.get(r))return this.typeLockMap.set(r,0);const n="change"===s?this.changeHandlerMap:null;n&&(null==(i=n.get(r))||i.call(this,e))}}function g(){function e(){var e;const t=this.getField(l.BIRTHDAY);return null!=(e=null==t?void 0:t.date_format)?e:"yyyy-MM-dd HH:mm"}function t(t){const r=this.getValueByType(t,l.ID_CARD);if(!r||!s(r)||!a(r))return;const n=o(r),{age:h,ageUnit:y}=u(n);null!=y&&this.setValueByType(t,l.AGE_UNIT,y,l.ID_CARD),null!=h&&this.setValueByType(t,l.AGE,h,l.ID_CARD),null!=n.sex&&this.setValueByType(t,l.SEX,n.sex,l.ID_CARD),null!=n.birthday&&this.setValueByType(t,l.BIRTHDAY,i(new Date(n.birthday),e.call(this)),l.ID_CARD)}function r(e){const t=this.getValueByType(e,l.BIRTHDAY);if(!s(t))return;const{age:i,ageUnit:r}=u(h(t));this.setValueByType(e,l.AGE_UNIT,r,l.BIRTHDAY),this.setValueByType(e,l.AGE,i,l.BIRTHDAY)}function g(t){return function(i){const r=this.getValueByType(i,l.AGE),a=this.getValueByType(i,l.AGE_UNIT);(s(r)||n(r))&&""!==r&&s(a)&&""!==a&&this.setValueByType(i,l.BIRTHDAY,y(+r,a,e.call(this)),t)}}return{create:function(e){return new c(e).registerChangeBusiness(l.ID_CARD,t).registerChangeBusiness(l.AGE_UNIT,g(l.AGE_UNIT)).registerChangeBusiness(l.AGE,g(l.AGE)).registerChangeBusiness(l.BIRTHDAY,r)}}}export{c as BusinessCollector,g as useBusinessBinding};
1
+ import{isField as e}from"@formily/core";import{Path as t}from"@formily/path";import{isString as s}from"@vueuse/core";import{format as i}from"date-fns";import{isFunction as r,isNumber as n}from"lodash-es";import{FIELD_BUSINESS_TYPE as l}from"../constants/index.js";import"vue";import"../../../../shared/utils/index.js";import"@vicons/ionicons5";import"@vue/shared";import"naive-ui";import"../components/renderer/text.js";import{isIdCard as a,parseIdCard as o,parseAgeFromContext as u,parseBirthday as h,parseAge2Birthday as y}from"../utils/business.js";class p{constructor(e){this.businessFormatter=e,this.triggerDisabled=!1,this.typeLockMap=new Map,this.typeCollector=new Map,this.fieldNameCollector=new Map,this.changeHandlerMap=new Map([])}formatter(...e){return r(this.businessFormatter)?this.businessFormatter(...e):e[0].value}collect(e,t){this.typeCollector.set(e,t),this.fieldNameCollector.set(t.val_key,e)}getField(e){return this.typeCollector.get(e)}getFieldInstanceByType(e,t){const s=this.getField(t);return s?e.query(s.val_key).take():null}getType(e){return this.fieldNameCollector.get(e)}getValueByField(t,s){const i=t.query(s).take();return e(i)?i.value:null}getValueByType(e,t){const s=this.getField(t);return s?this.getValueByField(e,s.val_key):null}setValueByType(e,i,r,n){const l=this.getField(i);l&&e.setFieldState(l.val_key,(e=>{e.value!==r&&(!this.typeLockMap.get(i)&&this.typeLockMap.set(i,1),this.triggerDisabled&&s(this.triggerDisabled)&&t.parse(this.triggerDisabled).match(l.val_key)||(e.value=this.formatter({value:r,type:i,fieldKey:l.val_key,from:n})))}))}registerChangeBusiness(e,t){return this.changeHandlerMap.set(e,t),this}trigger(e,t,s="change"){var i;if(!0===this.triggerDisabled)return;const r=this.getType(t);if(!r)return;if("change"===s&&this.typeLockMap.get(r))return this.typeLockMap.set(r,0);const n="change"===s?this.changeHandlerMap:null;n&&(null==(i=n.get(r))||i.call(this,e))}}function c(){function e(){var e;const t=this.getField(l.BIRTHDAY);return null!=(e=null==t?void 0:t.date_format)?e:"yyyy-MM-dd HH:mm"}function t(t){const r=this.getValueByType(t,l.ID_CARD);if(!r||!s(r)||!a(r))return;const n=o(r),{age:h,ageUnit:y}=u(n);null!=y&&this.setValueByType(t,l.AGE_UNIT,y,l.ID_CARD),null!=h&&this.setValueByType(t,l.AGE,h,l.ID_CARD),null!=n.sex&&this.setValueByType(t,l.SEX,n.sex,l.ID_CARD),null!=n.birthday&&this.setValueByType(t,l.BIRTHDAY,i(new Date(n.birthday),e.call(this)),l.ID_CARD)}function r(e){const t=this.getValueByType(e,l.BIRTHDAY);if(!s(t))return;const{age:i,ageUnit:r}=u(h(t));this.setValueByType(e,l.AGE_UNIT,r,l.BIRTHDAY),this.setValueByType(e,l.AGE,i,l.BIRTHDAY)}function c(t){return function(i){const r=this.getValueByType(i,l.AGE),a=this.getValueByType(i,l.AGE_UNIT);(s(r)||n(r))&&""!==r&&s(a)&&""!==a&&this.setValueByType(i,l.BIRTHDAY,y(+r,a,e.call(this)),t)}}return{create:function(e){return new p(e).registerChangeBusiness(l.ID_CARD,t).registerChangeBusiness(l.AGE_UNIT,c(l.AGE_UNIT)).registerChangeBusiness(l.AGE,c(l.AGE)).registerChangeBusiness(l.BIRTHDAY,r)}}}export{p as BusinessCollector,c as useBusinessBinding};
@@ -1 +1 @@
1
- import{reactive as e,computed as t,createVNode as r,mergeProps as n,defineComponent as l,inject as o,provide as i,watch as s,onUnmounted as a,onMounted as d,withModifiers as c}from"vue";import{checkInSetupEnv as u}from"../../../../shared/utils/index.js";import{useField as p,useForm as m,RecursionField as f}from"@formily/vue";import{isArray as h,noop as v,isEmpty as y}from"lodash-es";import"../../index.js";import{InjectionFormUUID as g,InjectionBusinessCollector as x}from"../constants/index.js";import{useFieldListAdaptor as b}from"./useFieldListAdaptor.js";import{createObjSchema as F}from"../utils/schema.js";import{renderOptionLabel as S,renderDescOption as j}from"../utils/index.js";const O=e(new Map);function M(e,t,r=0){O.set(e,O.get(e)||{});O.get(e)[t+""]=r}function W(e,t,r=!0){const n=O.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=O.get(e);r&&Reflect.deleteProperty(r,t+"")}function E(e){O.delete(e)}const K=l({props:{fieldItems:{type:Array,default:()=>[]},childFieldStrategy:{type:String,default:"checked"},childWidthMode:{type:String,default:"outer"},name:{type:String,required:!0}},setup(e){const l=o(g),u=o(x),h=p(),y=o(l+"_virtualParent",""),S=`${y?y+".":""}${h.value.address}`;function j(e){return`${S}.${e}`}i(l+"_virtualParent",S);const{schemaAdaptor:O}=b(u);function E(t){var r,n,l,o;return Object.assign(t,{"x-decorator-props":{...t["x-decorator-props"],labelPlacement:"left",isOptionChildField:!0},"x-component-props":{...t["x-component-props"],childFieldStrategy:null!=(n=null==(r=t["x-component-props"])?void 0:r.childFieldStrategy)?n:e.childFieldStrategy,childWidthMode:null!=(o=null==(l=t["x-component-props"])?void 0:l.childWidthMode)?o:e.childWidthMode,size:"small"}})}const K=t((()=>{const t=O(e.fieldItems);return Object.values(t).forEach(E),F(t)}));s(K,(()=>{return e=K.value,void Object.values(e.properties||{}).forEach((e=>{var t;M(l,j(e.name),null==(t=null==e?void 0:e["x-decorator-props"])?void 0:t.span)}));var e}),{immediate:!0});const P=m();function _(){return e.fieldItems.map((e=>P.value.query(e.val_key).take()))}a((()=>{var e;_().forEach((e=>{e&&e.setDisplay("none")})),e=K.value,Object.values(e.properties||{}).forEach((e=>{$(l,j(e.name))}))})),d((()=>{_().forEach((e=>{e&&e.setDisplay("visible")}))}));const k=c(v,["stop"]),C=["onClick","onKeydown","onKeyup","onKeypress"].reduce(((e,t)=>(e[t]=k,e)),{});return()=>{return r("section",n({class:"form-render__labelField",style:{"--column":(e=K.value,Object.values(e.properties||{}).reduce(((e,t)=>e+W(l,j(t.name))),0)),flex:"1"}},C),[r(f,{basePath:".",schema:K.value},null)]);var e}}});function P(e,l){u();const o=t((()=>e.options.some((e=>h(e.childrenFields)&&e.childrenFields.length))));function i(e,t,r="value"){return!y(t.childrenFields)&&(h(e)?e.includes(t[r]):e===t[r])}return{renderComplexOption:function({value:e,option:t,valueKey:l="value",labelKey:s="label",childFieldStrategy:a,childWidthMode:d,renderLabel:c=!0,attrs:u}){return[function(){const e=S(t,s);return c?t.desc?j(e,t):e:null}(),o.value&&("all"===a||i(e,t,l))?r(K,n({fieldItems:t.childrenFields,name:t[l],childFieldStrategy:a,childWidthMode:d},u),null):null]},valueRef:l,hasComplexOption:o}}function _(){return{getSpan:W,setSpan:M,deleteSpan:$,clearSpan:E}}export{P as useComplexOptions,_ as useComplexOptionsSpan};
1
+ import{reactive as e,computed as t,createVNode as r,mergeProps as n,defineComponent as l,inject as o,provide as i,watch as s,onUnmounted as a,onMounted as d,withModifiers as c}from"vue";import{checkInSetupEnv as u}from"../../../../shared/utils/index.js";import{useField as p,useForm as m,RecursionField as f}from"@formily/vue";import{isArray as h,noop as v,isEmpty as y}from"lodash-es";import"../../index.js";import{InjectionFormUUID as g,InjectionBusinessCollector as x}from"../constants/index.js";import{renderOptionLabel as b,renderDescOption as F}from"../utils/index.js";import{useFieldListAdaptor as S}from"./useFieldListAdaptor.js";import{createObjSchema as j}from"../utils/schema.js";const O=e(new Map);function M(e,t,r=0){O.set(e,O.get(e)||{});O.get(e)[t+""]=r}function W(e,t,r=!0){const n=O.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=O.get(e);r&&Reflect.deleteProperty(r,t+"")}function E(e){O.delete(e)}const K=l({props:{fieldItems:{type:Array,default:()=>[]},childFieldStrategy:{type:String,default:"checked"},childWidthMode:{type:String,default:"outer"},name:{type:String,required:!0}},setup(e){const l=o(g),u=o(x),h=p(),y=o(l+"_virtualParent",""),b=`${y?y+".":""}${h.value.address}`;function F(e){return`${b}.${e}`}i(l+"_virtualParent",b);const{schemaAdaptor:O}=S(u);function E(t){var r,n,l,o;return Object.assign(t,{"x-decorator-props":{...t["x-decorator-props"],labelPlacement:"left",isOptionChildField:!0},"x-component-props":{...t["x-component-props"],childFieldStrategy:null!=(n=null==(r=t["x-component-props"])?void 0:r.childFieldStrategy)?n:e.childFieldStrategy,childWidthMode:null!=(o=null==(l=t["x-component-props"])?void 0:l.childWidthMode)?o:e.childWidthMode,size:"small"}})}const K=t((()=>{const t=O(e.fieldItems);return Object.values(t).forEach(E),j(t)}));s(K,(()=>{return e=K.value,void Object.values(e.properties||{}).forEach((e=>{var t;M(l,F(e.name),null==(t=null==e?void 0:e["x-decorator-props"])?void 0:t.span)}));var e}),{immediate:!0});const P=m();function _(){return e.fieldItems.map((e=>P.value.query(e.val_key).take()))}a((()=>{var e;_().forEach((e=>{e&&e.setDisplay("none")})),e=K.value,Object.values(e.properties||{}).forEach((e=>{$(l,F(e.name))}))})),d((()=>{_().forEach((e=>{e&&e.setDisplay("visible")}))}));const k=c(v,["stop"]),C=["onClick","onKeydown","onKeyup","onKeypress"].reduce(((e,t)=>(e[t]=k,e)),{});return()=>{return r("section",n({class:"form-render__labelField",style:{"--column":(e=K.value,Object.values(e.properties||{}).reduce(((e,t)=>e+W(l,F(t.name))),0)),flex:"1"}},C),[r(f,{basePath:".",schema:K.value},null)]);var e}}});function P(e,l){u();const o=t((()=>e.options.some((e=>h(e.childrenFields)&&e.childrenFields.length))));function i(e,t,r="value"){return!y(t.childrenFields)&&(h(e)?e.includes(t[r]):e===t[r])}return{renderComplexOption:function({value:e,option:t,valueKey:l="value",labelKey:s="label",childFieldStrategy:a,childWidthMode:d,renderLabel:c=!0,attrs:u}){return[function(){const e=b(t,s);return c?t.desc?F(e,t):e:null}(),o.value&&("all"===a||i(e,t,l))?r(K,n({fieldItems:t.childrenFields,name:t[l],childFieldStrategy:a,childWidthMode:d},u),null):null]},valueRef:l,hasComplexOption:o}}function _(){return{getSpan:W,setSpan:M,deleteSpan:$,clearSpan:E}}export{P as useComplexOptions,_ as useComplexOptionsSpan};
@@ -1 +1 @@
1
- import{arrayed as e,traverse as t}from"../../../../shared/utils/index.js";import"../../../../shared/utils/tapable/SyncHook.js";import"../../../../shared/utils/tapable/SyncBailHook.js";import l from"../../../../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{format as a}from"date-fns";import{isString as r}from"lodash-es";import"../../index.js";import{FIELD_BUSINESS_TYPE as o}from"../constants/index.js";import{isNegative as _,isPositive as i,FieldListFilter as s,findItemByValCondition as n,parseEnhanceText as p}from"../utils/index.js";import{transformDateFormat as u}from"../utils/business.js";function c(){const c=new l(["fieldList","props"]),m=new l(["fieldItem","props"]);m.tap("__forceClearable",((e,t)=>(t.forceClearable&&(e.componentProps={...e.componentProps,clearable:!0}),e))),m.tap({name:"__fieldAlias",before:"__labelPlacementOverwrite"},(e=>("BOTTOM"===e.inputBorder&&(e.bordered="underline"),null!=e.title_h_layout&&(e.decoratorProps={...e.decoratorProps},_(e.title_h_layout)?e.decoratorProps.labelPlacement="top":i(e.title_h_layout)&&(e.decoratorProps.labelPlacement="left")),r(e.lineBarLayoutDirection)&&(e.linebarDirection=e.lineBarLayoutDirection.toLowerCase()),e))),m.tap("__labelPlacementOverwrite",((e,t)=>(t.labelPlacementOverwrite&&(e.decoratorProps={...e.decoratorProps,labelPlacement:void 0}),e))),m.tap("__time",(e=>("DATE"===e.html_type&&"time"===u(e.date_format)&&(e.html_type="TIME"),e))),m.tap("__block",(e=>(["CHECKBOX_BLOCK","RADIO_BLOCK"].includes(e.html_type)&&(e.__vertical=!0),e))),m.tap("__age",(t=>("AGE"===t.html_type&&(t.html_type="INPUT_NUMBER",t.reactions=t.reactions?e(t.reactions):[],t.reactions.push({target:t.val_key_unit,fulfill:{state:{disabled:"{{$self.disabled}}"}}}),t.suffixConfig=[{validate:{obj_type:o.AGE_UNIT},val_key:t.val_key_unit,html_type:"SELECT",option:t.option,urlConfig:t.urlConfig}]),t))),m.tap({name:"__multiple_select",before:"__defaultValue"},(e=>{const{html_type:t,multi_select:l,__multiple:a}=e;return e.__multiple="SEARCH"!==t&&("SEARCH_MORE"===t||("SELECT"===t?_(l):a)),e})),m.tap("__defaultValue",(e=>{switch(e.html_type){case"TIME":"current"===e.default_val&&(e.default_val=a(new Date,e.date_format||"HH:mm:ss"));break;case"DATE":"current"===e.default_val&&(e.default_val=a(new Date,e.date_format||"yyyy-MM-dd"));break;case"CHECKBOX":case"CHECKBOX_BLOCK":r(e.default_val)&&e.default_val&&(e.default_val=e.default_val.split(","));break;case"SELECT":case"SEARCH":case"SEARCH_MORE":r(e.default_val)&&e.default_val&&(e.default_val=e.__multiple?e.default_val.split(","):e.default_val)}return e}));const d=[[["SEARCH","PHONE_TYPE","IDCARD_TYPE","SEARCH_MORE"],"SELECT"],["DIGITAL","INPUT_NUMBER"],["CHECKBOX_BLOCK","CHECKBOX"],["RADIO_BLOCK","RADIO"],[["DATE-INPUT","DATETIME-INPUT"],"DATE"],["SWITCH_COMPONENT","SWITCH"],["SLIDER_COMPONENT","SLIDER"],["LEVEL_SEARCH_CASCADE","LEVEL_SEARCH_CASCADER"],["SEARCH_CASCADE","SEARCH_CASCADER"]];m.tap("__normalize",(e=>(d.some((([t,l])=>(Array.isArray(t)?t.includes(e.html_type):t===e.html_type)&&(e.html_type=l))),e)));const E=new Map([[["SELECT","SEARCH","SEARCH_MORE"],new Map([["H_TILE",e=>e.html_type=e.__multiple?"CHECKBOX":"RADIO"],["V_TILE",e=>{e.html_type=e.__multiple?"CHECKBOX":"RADIO",e.__vertical=!0}]])],["RADIO",new Map([["DROPDOWN",e=>e.html_type="SELECT"]])],["CHECKBOX",new Map([["DROPDOWN",e=>{e.__multiple=!0,e.html_type="SELECT"}]])]]);return m.tap({stage:9999,name:"__show_mode"},(t=>t.show_mode?([...E].some((([l,a])=>{if(!e(l).includes(t.html_type))return;const r=a.get(t.show_mode);return r&&r(t),!0})),t):t)),c.tap("__out_bordered",((e,{column:t,outBordered:l})=>e)),c.tap("__prefix/suffix",(e=>{const l=[];return t(e,(t=>{["prefix","suffix"].forEach((a=>{const o=t[a];if(!r(o))return;const _=o.match("#{(.+)}");if(!_)return;const i=r(_[1])&&n(e,(e=>e.val_key===_[1].trim()));i&&(Reflect.deleteProperty(t,a),t[`${a}Config`]=t[`${a}Config`]||[],t[`${a}Config`].push(i),l.push(i))}))}),["children","properties"]),l.length?s(e,(e=>l.includes(e))):e})),c.tap("__textEnhance",(e=>{const l=[];return t(e,(t=>{if("TEXT"!==t.html_type||!r(t.default_val))return;const a=p(t.default_val);t.__textEnhance=a,a.forEach((a=>{if("text"===a.type)return;const r=n(e,(e=>[e.name,e.val_key].includes(a.content)));r&&(Reflect.deleteProperty(t,"default_val"),l.push(r),a.content=r)}))}),["children","properties"]),s(e,(e=>l.includes(e)))})),{FieldNormalizeWaterfallHook:m,FieldListNormalizeWaterfallHook:c}}export{c as useFieldNormalize};
1
+ import{arrayed as e,traverse as t}from"../../../../shared/utils/index.js";import"../../../../shared/utils/tapable/SyncHook.js";import"../../../../shared/utils/tapable/SyncBailHook.js";import a from"../../../../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{format as l}from"date-fns";import{isString as o,isEmpty as r}from"lodash-es";import"../../index.js";import{FIELD_BUSINESS_TYPE as _}from"../constants/index.js";import{isNegative as i,isPositive as s,FieldListFilter as n,findItemByValCondition as p,parseEnhanceText as c}from"../utils/index.js";import{transformDateFormat as u}from"../utils/business.js";function d(){const d=new a(["fieldList","props"]),m=new a(["fieldItem","props"]);m.tap("__forceClearable",((e,t)=>(t.forceClearable&&(e.componentProps={...e.componentProps,clearable:!0}),e))),m.tap({name:"__fieldAlias",before:"__labelPlacementOverwrite"},(e=>("BOTTOM"===e.inputBorder&&(e.bordered="underline"),null!=e.title_h_layout&&(e.decoratorProps={...e.decoratorProps},i(e.title_h_layout)?e.decoratorProps.labelPlacement="top":s(e.title_h_layout)&&(e.decoratorProps.labelPlacement="left")),o(e.lineBarLayoutDirection)&&(e.linebarDirection=e.lineBarLayoutDirection.toLowerCase()),e))),m.tap("__labelPlacementOverwrite",((e,t)=>(t.labelPlacementOverwrite&&(e.decoratorProps={...e.decoratorProps,labelPlacement:void 0}),e))),m.tap("__time",(e=>("DATE"===e.html_type&&"time"===u(e.date_format)&&(e.html_type="TIME"),e))),m.tap("__block",(e=>(["CHECKBOX_BLOCK","RADIO_BLOCK"].includes(e.html_type)&&(e.__vertical=!0),e))),m.tap("__age",(t=>("AGE"===t.html_type&&(t.html_type="INPUT_NUMBER",t.reactions=t.reactions?e(t.reactions):[],t.reactions.push({target:t.val_key_unit,fulfill:{state:{disabled:"{{$self.disabled}}"}}}),t.suffixConfig=[{validate:{obj_type:_.AGE_UNIT},val_key:t.val_key_unit,html_type:"SELECT",option:t.option,urlConfig:t.urlConfig}]),t))),m.tap({name:"__multiple_select",before:"__defaultValue"},(e=>{const{html_type:t,multi_select:a,__multiple:l}=e;return e.__multiple="SEARCH"!==t&&("SEARCH_MORE"===t||("SELECT"===t?i(a):l)),e})),m.tap("__defaultValue",(e=>{switch(e.html_type){case"TIME":"current"===e.default_val&&(e.default_val=l(new Date,e.date_format||"HH:mm:ss"));break;case"DATE":"current"===e.default_val&&(e.default_val=l(new Date,e.date_format||"yyyy-MM-dd"));break;case"CHECKBOX":case"CHECKBOX_BLOCK":o(e.default_val)&&e.default_val&&(e.default_val=e.default_val.split(","));break;case"SELECT":case"SEARCH":case"SEARCH_MORE":o(e.default_val)&&e.default_val&&(e.default_val=e.__multiple?e.default_val.split(","):e.default_val)}return e}));const E=[[["SEARCH","PHONE_TYPE","IDCARD_TYPE","SEARCH_MORE"],"SELECT"],["DIGITAL","INPUT_NUMBER"],["CHECKBOX_BLOCK","CHECKBOX"],["RADIO_BLOCK","RADIO"],[["DATE-INPUT","DATETIME-INPUT"],"DATE"],["SWITCH_COMPONENT","SWITCH"],["SLIDER_COMPONENT","SLIDER"],["LEVEL_SEARCH_CASCADE","LEVEL_SEARCH_CASCADER"],["SEARCH_CASCADE","SEARCH_CASCADER"]];m.tap("__normalize",(e=>(E.some((([t,a])=>(Array.isArray(t)?t.includes(e.html_type):t===e.html_type)&&(e.html_type=a))),e)));const f=new Map([[["SELECT","SEARCH","SEARCH_MORE"],new Map([["H_TILE",e=>e.html_type=e.__multiple?"CHECKBOX":"RADIO"],["V_TILE",e=>{e.html_type=e.__multiple?"CHECKBOX":"RADIO",e.__vertical=!0}]])],["RADIO",new Map([["DROPDOWN",e=>e.html_type="SELECT"]])],["CHECKBOX",new Map([["DROPDOWN",e=>{e.__multiple=!0,e.html_type="SELECT"}]])]]);return m.tap({stage:9999,name:"__show_mode"},(t=>t.show_mode?([...f].some((([a,l])=>{if(!e(a).includes(t.html_type))return;const o=l.get(t.show_mode);return o&&o(t),!0})),t):t)),d.tap("__out_bordered",((e,{column:t,outBordered:a})=>e)),d.tap("__prefix/suffix",(e=>{const a=[];return t(e,(t=>{["prefix","suffix"].forEach((l=>{const r=t[l];if(!o(r))return;const _=r.match("#{(.+)}");if(!_)return;const i=o(_[1])&&p(e,(e=>e.val_key===_[1].trim()));i&&(Reflect.deleteProperty(t,l),t[`${l}Config`]=t[`${l}Config`]||[],t[`${l}Config`].push(i),a.push(i))}))}),["children","properties"]),a.length?n(e,(e=>a.includes(e))):e})),d.tap("__checkboxOrRadioEnhance",(e=>{const a=[];return t(e,(t=>{["CHECKBOX","RADIO","RADIO_BLOCK","CHECKBOX_BLOCK"].includes(t.html_type)&&!r(t.option)&&t.option.forEach((t=>{const l=c(t.text||"");t.__textEnhance=l,l.forEach((t=>{if("text"===t.type)return;const l=p(e,(e=>[e.name,e.val_key].includes(t.content)));l&&(a.push(l),t.content=l)}))}))})),n(e,(e=>a.includes(e)))})),d.tap("__textEnhance",(e=>{const a=[];return t(e,(t=>{if("TEXT"!==t.html_type||!o(t.default_val))return;const l=c(t.default_val);t.__textEnhance=l,l.forEach((l=>{if("text"===l.type)return;const o=p(e,(e=>[e.name,e.val_key].includes(l.content)));o&&(Reflect.deleteProperty(t,"default_val"),a.push(o),l.content=o)}))}),["children","properties"]),n(e,(e=>a.includes(e)))})),{FieldNormalizeWaterfallHook:m,FieldListNormalizeWaterfallHook:d}}export{d as useFieldNormalize};
@@ -1 +1 @@
1
- import{arrayed as e}from"../../../../shared/utils/index.js";import{once as a,isNumber as i,isString as m}from"lodash-es";import"vue";import{registerValidateLocale as r,registerValidateRules as s}from"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import{isFunction as l}from"@vueuse/core";import"naive-ui";import{isIdCard as u}from"../utils/business.js";function n(){const a=new Map([["mobile",({validate:e})=>({format:"phone",message:null==e?void 0:e.message})],["integer",({validate:e})=>({format:"integer",message:null==e?void 0:e.message})],["number",({validate:e})=>({format:"number",message:null==e?void 0:e.message})],["id_card",({validate:e})=>({validator(a){var i;if(null!=a&&""!==a)return m(a)&&u(a)?void 0:null!=(i=null==e?void 0:e.message)?i:"该字段不是合法的身份证格式"}})],["regular",({validate:e,regular_expression:a,regular_error_tip:i})=>({pattern:a||(null==e?void 0:e.regular_expression)||"",message:i||(null==e?void 0:e.regular_error_tip)||(null==e?void 0:e.message)||"格式错误"})]]),i={triggerType:"onBlur"};return{createValidatorSchema:function(m){const r=[],{validate:{vali_obj:s,max_length:u,min_length:n,message:o,max_value:t,min_value:g,decimal_length:v}={},validator:d}=m;if(d&&e(d).forEach((e=>{l(e)&&r.push({validator:(a,i,r)=>e(a,m,r)})})),u&&r.push({max:u,message:o}),n&&r.push({min:n,message:o}),t&&r.push({maximum:t,message:o}),g&&r.push({minimum:g,message:o}),null!=v&&r.push(((e,a)=>{const i=null!=a?a:`小数位数最多${e}位`;return{validator(a){var m;return(null==(m=String(a).split(".")[1])?void 0:m.length)>e?i:""}}})(+v,o)),s){const e=a.get(s)||(({validate:e})=>({format:s,message:null==e?void 0:e.message}));r.push(Object.assign({},i,e(m)))}return r}}}const o=a((()=>{r({"zh-CN":{required:"${alias||name}为必填"}}),s({maximum:(e,a)=>i(Number(a.maximum))&&null!=e&&""!==e&&"/"!==e?(m(e)&&(e=+e),!i(e)||isNaN(e)?"":e>Number(a.maximum)&&a.message||""):"",minimum:(e,a)=>i(Number(a.minimum))&&null!=e&&""!==e&&"/"!==e?(m(e)&&(e=+e),!i(e)||isNaN(e)?"":e<Number(a.minimum)&&a.message||""):""})}));export{n as useFormValidator,o as validateMessageLocale};
1
+ import{arrayed as e}from"../../../../shared/utils/index.js";import{once as r,isNumber as a,isString as i}from"lodash-es";import"vue";import{registerValidateLocale as m,registerValidateRules as s}from"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import{isFunction as l}from"@vueuse/core";import"naive-ui";import"../components/renderer/text.js";import{isIdCard as n}from"../utils/business.js";function o(){const r=new Map([["mobile",({validate:e})=>({format:"phone",message:null==e?void 0:e.message})],["integer",({validate:e})=>({format:"integer",message:null==e?void 0:e.message})],["number",({validate:e})=>({format:"number",message:null==e?void 0:e.message})],["id_card",({validate:e})=>({validator(r){var a;if(null!=r&&""!==r)return i(r)&&n(r)?void 0:null!=(a=null==e?void 0:e.message)?a:"该字段不是合法的身份证格式"}})],["regular",({validate:e,regular_expression:r,regular_error_tip:a})=>({pattern:r||(null==e?void 0:e.regular_expression)||"",message:a||(null==e?void 0:e.regular_error_tip)||(null==e?void 0:e.message)||"格式错误"})]]),a={triggerType:"onBlur"};return{createValidatorSchema:function(i){const m=[],{validate:{vali_obj:s,max_length:n,min_length:o,message:t,max_value:u,min_value:g,decimal_length:d}={},validator:v}=i;if(v&&e(v).forEach((e=>{l(e)&&m.push({validator:(r,a,m)=>e(r,i,m)})})),n&&m.push({max:n,message:t}),o&&m.push({min:o,message:t}),u&&m.push({maximum:u,message:t}),g&&m.push({minimum:g,message:t}),null!=d&&m.push(((e,r)=>{const a=null!=r?r:`小数位数最多${e}位`;return{validator(r){var i;return(null==(i=String(r).split(".")[1])?void 0:i.length)>e?a:""}}})(+d,t)),s){const e=r.get(s)||(({validate:e})=>({format:s,message:null==e?void 0:e.message}));m.push(Object.assign({},a,e(i)))}return m}}}const t=r((()=>{m({"zh-CN":{required:"${alias||name}为必填"}}),s({maximum:(e,r)=>a(Number(r.maximum))&&null!=e&&""!==e&&"/"!==e?(i(e)&&(e=+e),!a(e)||isNaN(e)?"":e>Number(r.maximum)&&r.message||""):"",minimum:(e,r)=>a(Number(r.minimum))&&null!=e&&""!==e&&"/"!==e?(i(e)&&(e=+e),!a(e)||isNaN(e)?"":e<Number(r.minimum)&&r.message||""):""})}));export{o as useFormValidator,t as validateMessageLocale};
@@ -1 +1 @@
1
- import"../../../../shared/utils/index.js";import{isField as e}from"@formily/core";import{isArray as i}from"lodash-es";import{computed as t,unref as r}from"vue";import{isMatchLowCodeConditionsWithSqlExpression as o}from"../../../../shared/utils/business.js";function n(n,l){const s={hideField:a(((e,i)=>{var t;i.isRestoreDefault?(e.value=null!=(t=e.initialValue)?t:null,e.setDisplay("hidden")):e.setDisplay("none")})),showField:a((e=>e.setDisplay("visible"))),requiredField:a((e=>e.required=!0)),notRequiredField:a((e=>{e.required=!1,e.validate()})),enabledField:a((e=>e.editable=!0)),disabledField:a((e=>e.editable=!1))};function a(i){return(t,r)=>{t.forEach((t=>{const o=l.query(t).take();o&&e(o)&&i(o,r)}))}}const u=t((()=>r(n)?r(n).reduce(((e,t)=>(i(t.conObj)&&t.conObj.forEach((i=>e.push(i.field_key))),e)),[]):[]));function d(e){Object.entries(e).forEach((([i,t])=>s[i]&&s[i](t,e)))}return{lowCodeReactionsHandler:function(e){const i=r(n);if(!i||!u.value.includes(e))return;const t=l.getFormState().values;i.forEach((i=>{(function(e,i){return!!i.conObj&&i.conObj.some((i=>i.field_key===e))})(e,i)&&o(t,i)&&d(i)}))},triggerAllReactionsHandler:function(){const e=r(n);if(!e)return;const i=l.getFormState().values;e.forEach((e=>{o(i,e)&&d(e)}))}}}export{n as useLowCodeReactions};
1
+ import"../../../../shared/utils/index.js";import{isField as e}from"@formily/core";import{isArray as i}from"lodash-es";import{computed as t,unref as r}from"vue";import{isMatchLowCodeConditionsWithSqlExpression as o}from"../../../../shared/utils/business.js";function n(n,l){const s={hideField:a(((e,i)=>{var t;i.isRestoreDefault?(e.value=null!=(t=e.initialValue)?t:null,e.setDisplay("hidden")):e.setDisplay("none")})),showField:a((e=>e.setDisplay("visible"))),requiredField:a((e=>e.required=!0)),notRequiredField:a((e=>{e.required=!1,e.validate()})),enabledField:a((e=>e.editable=!0)),disabledField:a((e=>e.editable=!1)),setValueField:a((e=>{}))};function a(i){return(t,r)=>{t.forEach((t=>{const o=l.query(t).take();o&&e(o)&&i(o,r)}))}}const u=t((()=>r(n)?r(n).reduce(((e,t)=>(i(t.conObj)&&t.conObj.forEach((i=>e.push(i.field_key))),e)),[]):[]));function d(e){Object.entries(e).forEach((([i,t])=>s[i]&&s[i](t,e)))}return{lowCodeReactionsHandler:function(e){const i=r(n);if(!i||!u.value.includes(e))return;const t=l.getFormState().values;i.forEach((i=>{(function(e,i){return!!i.conObj&&i.conObj.some((i=>i.field_key===e))})(e,i)&&o(t,i)&&d(i)}))},triggerAllReactionsHandler:function(){const e=r(n);if(!e)return;const i=l.getFormState().values;e.forEach((e=>{o(i,e)&&d(e)}))}}}export{n as useLowCodeReactions};
@@ -1 +1 @@
1
- import{isString as i,isEmpty as e}from"lodash-es";import"vue";import"../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"@vueuse/core";import"naive-ui";import{isIdCard as r,isMobile as s}from"../utils/business.js";function o(){return{isIdCard:e=>i(e)&&r(e),isMobile:e=>i(e)&&s(e),isEmail:e=>i(e)&&/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(e),isNumber:e=>i(e)&&/\d+/.test(e),hasVisible(i){if(e(i))return!1;const r=i.slice(0,i.length/2),s=i.slice(i.length/2).map((i=>null==i?void 0:i[0]));return r.some(((i,e)=>(!i||"visible"===i)&&"LINE_BREAKS"!==s[e]))}}}export{o as usePresetScope};
1
+ import{isString as i,isEmpty as e}from"lodash-es";import"vue";import"../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"@vueuse/core";import"naive-ui";import"../components/renderer/text.js";import{isIdCard as r,isMobile as o}from"../utils/business.js";function s(){return{isIdCard:e=>i(e)&&r(e),isMobile:e=>i(e)&&o(e),isEmail:e=>i(e)&&/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(e),isNumber:e=>i(e)&&/\d+/.test(e),hasVisible(i){if(e(i))return!1;const r=i.slice(0,i.length/2),o=i.slice(i.length/2).map((i=>null==i?void 0:i[0]));return r.some(((i,e)=>(!i||"visible"===i)&&"LINE_BREAKS"!==o[e]))}}}export{s as usePresetScope};
@@ -1 +1 @@
1
- import{inject as e,provide as t,computed as n,createVNode as r,Fragment as o}from"vue";import{widthAppend as i,traverse as u,arrayed as c}from"../../../../shared/utils/index.js";import{isGeneralField as s}from"@formily/core";import{Path as f}from"@formily/path";import{HelpCircleSharp as l}from"@vicons/ionicons5";import{isObject as a}from"@vue/shared";import{useMemoize as p}from"@vueuse/core";import{isString as d,isFunction as m,omit as h,castArray as E,flattenDeep as T}from"lodash-es";import{NTooltip as g,NIcon as x}from"naive-ui";import{NESTED_FORM_ITEM_TYPE as y}from"../constants/index.js";export{businessDateParser,isForeignerID,isIdCard,isMobile,parseAge2Birthday,parseAgeFromContext,parseBirthday,parseIdCard,transformDateFormat}from"./business.js";function v(e){console.warn(`[FormRender]: ${e}`)}function R(e){return"1"===e||!0===e||1===e}function I(e){return"0"===e||!1===e||0===e}function D(e,t,n=["children","properties","suffixConfig"],r="val_key",o="default_val"){return function e(t,r){r.forEach((r=>{a(r)&&(null!=u(r)&&null==t[i(r)]&&f.setIn(t,i(r),u(r)),n.forEach((n=>{r[n]&&(t[i(r)]||(t[i(r)]={}),e(t[i(r)],c(r[n])))})))}))}(e,t),e;function i(e){return e[r]}function u(e){return e[o]}}function A(n,r){let o=e(n,null);return o||(o=r(),t(n,o)),o}function W(e){return e&&d(e)?+e:e}function P(e,t,n){if(a(e)&&!m(e)){const n={};return Object.entries(e).forEach((([e,r])=>{m(r)&&(n[e]=()=>r(t))})),n}return{default:()=>m(e)?e(t):n?n(e):[e]}}function _(e,t){return n((()=>{const n={};return e.prefix&&(n.prefix=()=>r(o,null,[P(e.prefix,e,t).default()])),e.suffix&&(n.suffix=()=>r(o,null,[P(e.suffix,e,t).default()])),n}))}function G(e,t){return d(e)&&e?e.replace(/\$\{([^}]*)}/g,(function(e,n){const r=n.split("||");for(const e of r){const n=t[e.trim()];if(n)return n}return""})):""}function S(e){return e.reduce(((e,t)=>(d(t.extendKey)&&t.extendKey&&e.push(t),b(t)&&e.push(...S(t.children||[])),e)),[])}function j(e,t){const n=S(e);if(!n.length)return t;const r={},o=new Map;return Object.entries(t).forEach((([e,i])=>{const u=n.find((t=>t.val_key===e));if(!u)return r[e]=i;const{val_key:c,extendKey:s}=u,l=o.get(s)||{};o.set(s,l);const a=f.getIn(t,e);null!=a&&f.setIn(l,c,a)})),[...o.entries()].forEach((([e,t])=>{r[e]=JSON.stringify(t)})),r}function w(e,t){const n=S(e);if(!n.length)return t;const r=p((e=>{try{return a(t[e])?t[e]:JSON.parse(t[e])||{}}catch(e){return{}}})),o=h(t,n.map((e=>e.extendKey)));return n.forEach((({val_key:e,extendKey:t})=>{Reflect.has(o,e)||(o[e]=r(t)[e])})),o}function $(e){return e&&y.includes(e)}function b(e){return $(s(e)?e.componentType:e.html_type)}function B(e,t){var n;const o=null!=(n=e.title)?n:e[t];return r("span",{title:o,style:{display:"inline-flex",flexDirection:"column",alignItems:"center","justify-content":"center"}},[e.imageBase64?r("img",{src:e.imageBase64,style:{width:i(e.imageWidth||80),height:i(e.imageHeight||80),marginBottom:"4px"}},null):null,e[t]])}function K(e,t){return r("section",{style:{display:"flex",alignItems:"center",gap:"4px"}},[e,t.desc?r(g,null,{trigger:()=>r(x,{component:l},null),default:()=>t.desc}):null])}function X(e,t){return f.parse(e.startsWith(".")?e:`.${e}`,t).toString()}function k(e){return e.replace(/&lt;/g,"<").replace(/&gt;/g,">")}function C(e,t){return e.reduce(((e,n)=>(t(n)||(e.push(n),n.properties&&(n.properties=C(n.properties,t)),n.children&&(n.children=C(n.children,t))),e)),[])}function F(e,t){let n=null;return u(e,((e,r)=>{t(e)&&(n=e,r())}),["children","properties"]),n}var O=function(e){return e[e.PREPARE=0]="PREPARE",e[e.TEXT=1]="TEXT",e[e.WIDGET_START=2]="WIDGET_START",e[e.WIDGET=3]="WIDGET",e}(O||{});function N(e){const t=[...e],n=[];let r=O.PREPARE,o="";function i(e){switch(r=e,r){case O.PREPARE:case O.WIDGET_START:case O.WIDGET:o=""}}function u(e="text",t=o){n.push({type:e,content:t})}function c(){const e=n.pop();e&&("text"===e.type?o=e.content:n.push(e))}return t.forEach(((e,n)=>{const s=n===t.length-1;switch(r){case O.PREPARE:return"#"===e?(i(O.WIDGET_START),void(s&&u())):(i(O.TEXT),o=e,void(s&&u()));case O.TEXT:return"#"===e?void(s?(o+=e,u()):(u(),i(O.WIDGET_START))):(o+=e,void(s&&u()));case O.WIDGET_START:return"{"!==e||s?(c(),i(O.TEXT),o+=`#${e}`,void(s&&u())):void i(O.WIDGET);case O.WIDGET:return"}"===e?(u("widget"),void i(O.PREPARE)):"#"===e?(c(),u(),i(O.WIDGET_START),o+=`#${e}`,void(s&&u())):(o+=e,void(s&&u("text",`#{${o}`)))}})),n}function J(e,t){let n=E(e);return t.forEach((({from:e,to:t})=>{n.forEach(((r,o)=>{d(r)&&(n[o]=r.split(e).map(((e,n,r)=>[e,n<r.length-1?t:null])))})),n=T(n)})),n}function M(e){return"Enter"===e.code||"NumpadEnter"===e.code}export{C as FieldListFilter,j as combineExtendKey,_ as createInputSlot,P as createSlot,k as editorUnescape,F as findItemByValCondition,v as formRenderLog,X as getAbsoluteKey,A as injectOrProvide,M as isEnter,I as isNegative,b as isNestedFieldType,$ as isNestedType,R as isPositive,D as mergeDeepProperties,N as parseEnhanceText,W as parseNumberFromMaybeString,K as renderDescOption,B as renderOptionLabel,J as replace2Any,w as splitExtendKey,G as validateMessageParser};
1
+ import{inject as e,provide as t,computed as n,createVNode as r,Fragment as o}from"vue";import{widthAppend as i,traverse as u,arrayed as c}from"../../../../shared/utils/index.js";import{isGeneralField as s}from"@formily/core";import{Path as f}from"@formily/path";import{HelpCircleSharp as l}from"@vicons/ionicons5";import{isObject as a}from"@vue/shared";import{useMemoize as p}from"@vueuse/core";import{isString as d,isFunction as m,omit as h,castArray as E,flattenDeep as T}from"lodash-es";import{NTooltip as g,NIcon as x}from"naive-ui";import{NESTED_FORM_ITEM_TYPE as y}from"../constants/index.js";import{TEXT as v}from"../components/renderer/text.js";export{businessDateParser,isForeignerID,isIdCard,isMobile,parseAge2Birthday,parseAgeFromContext,parseBirthday,parseIdCard,transformDateFormat}from"./business.js";function I(e){console.warn(`[FormRender]: ${e}`)}function R(e){return"1"===e||!0===e||1===e}function D(e){return"0"===e||!1===e||0===e}function A(e,t,n=["children","properties","suffixConfig"],r="val_key",o="default_val"){return function e(t,r){r.forEach((r=>{a(r)&&(null!=u(r)&&null==t[i(r)]&&f.setIn(t,i(r),u(r)),n.forEach((n=>{r[n]&&(t[i(r)]||(t[i(r)]={}),e(t[i(r)],c(r[n])))})))}))}(e,t),e;function i(e){return e[r]}function u(e){return e[o]}}function W(n,r){let o=e(n,null);return o||(o=r(),t(n,o)),o}function P(e){return e&&d(e)?+e:e}function _(e,t,n){if(a(e)&&!m(e)){const n={};return Object.entries(e).forEach((([e,r])=>{m(r)&&(n[e]=()=>r(t))})),n}return{default:()=>m(e)?e(t):n?n(e):[e]}}function G(e,t){return n((()=>{const n={};return e.prefix&&(n.prefix=()=>r(o,null,[_(e.prefix,e,t).default()])),e.suffix&&(n.suffix=()=>r(o,null,[_(e.suffix,e,t).default()])),n}))}function S(e,t){return d(e)&&e?e.replace(/\$\{([^}]*)}/g,(function(e,n){const r=n.split("||");for(const e of r){const n=t[e.trim()];if(n)return n}return""})):""}function j(e){return e.reduce(((e,t)=>(d(t.extendKey)&&t.extendKey&&e.push(t),B(t)&&e.push(...j(t.children||[])),e)),[])}function w(e,t){const n=j(e);if(!n.length)return t;const r={},o=new Map;return Object.entries(t).forEach((([e,i])=>{const u=n.find((t=>t.val_key===e));if(!u)return r[e]=i;const{val_key:c,extendKey:s}=u,l=o.get(s)||{};o.set(s,l);const a=f.getIn(t,e);null!=a&&f.setIn(l,c,a)})),[...o.entries()].forEach((([e,t])=>{r[e]=JSON.stringify(t)})),r}function $(e,t){const n=j(e);if(!n.length)return t;const r=p((e=>{try{return a(t[e])?t[e]:JSON.parse(t[e])||{}}catch(e){return{}}})),o=h(t,n.map((e=>e.extendKey)));return n.forEach((({val_key:e,extendKey:t})=>{Reflect.has(o,e)||(o[e]=r(t)[e])})),o}function b(e){return e&&y.includes(e)}function B(e){return b(s(e)?e.componentType:e.html_type)}function K(e,t){var n;const o=null!=(n=e.title)?n:e[t];return r("span",{title:o,style:{display:"inline-flex",flexDirection:"column",alignItems:"center","justify-content":"center"}},[e.imageBase64?r("img",{src:e.imageBase64,style:{width:i(e.imageWidth||80),height:i(e.imageHeight||80),marginBottom:"4px"}},null):null,r(v,{content:e[t],fieldItem:e},null)])}function X(e,t){return r("section",{style:{display:"flex",alignItems:"center",gap:"4px"}},[e,t.desc?r(g,null,{trigger:()=>r(x,{component:l},null),default:()=>t.desc}):null])}function k(e,t){return f.parse(e.startsWith(".")?e:`.${e}`,t).toString()}function C(e){return e.replace(/&lt;/g,"<").replace(/&gt;/g,">")}function F(e,t){return e.reduce(((e,n)=>(t(n)||(e.push(n),n.properties&&(n.properties=F(n.properties,t)),n.children&&(n.children=F(n.children,t))),e)),[])}function O(e,t){let n=null;return u(e,((e,r)=>{t(e)&&(n=e,r())}),["children","properties"]),n}var N=function(e){return e[e.PREPARE=0]="PREPARE",e[e.TEXT=1]="TEXT",e[e.WIDGET_START=2]="WIDGET_START",e[e.WIDGET=3]="WIDGET",e}(N||{});function J(e){const t=[...e],n=[];let r=N.PREPARE,o="";function i(e){switch(r=e,r){case N.PREPARE:case N.WIDGET_START:case N.WIDGET:o=""}}function u(e="text",t=o){n.push({type:e,content:t})}function c(){const e=n.pop();e&&("text"===e.type?o=e.content:n.push(e))}return t.forEach(((e,n)=>{const s=n===t.length-1;switch(r){case N.PREPARE:return"#"===e?(i(N.WIDGET_START),void(s&&u())):(i(N.TEXT),o=e,void(s&&u()));case N.TEXT:return"#"===e?void(s?(o+=e,u()):(u(),i(N.WIDGET_START))):(o+=e,void(s&&u()));case N.WIDGET_START:return"{"!==e||s?(c(),i(N.TEXT),o+=`#${e}`,void(s&&u())):void i(N.WIDGET);case N.WIDGET:return"}"===e?(u("widget"),void i(N.PREPARE)):"#"===e?(c(),u(),i(N.WIDGET_START),o+=`#${e}`,void(s&&u())):(o+=e,void(s&&u("text",`#{${o}`)))}})),n}function M(e,t){let n=E(e);return t.forEach((({from:e,to:t})=>{n.forEach(((r,o)=>{d(r)&&(n[o]=r.split(e).map(((e,n,r)=>[e,n<r.length-1?t:null])))})),n=T(n)})),n}function H(e){return"Enter"===e.code||"NumpadEnter"===e.code}export{F as FieldListFilter,w as combineExtendKey,G as createInputSlot,_ as createSlot,C as editorUnescape,O as findItemByValCondition,I as formRenderLog,k as getAbsoluteKey,W as injectOrProvide,H as isEnter,D as isNegative,B as isNestedFieldType,b as isNestedType,R as isPositive,A as mergeDeepProperties,J as parseEnhanceText,P as parseNumberFromMaybeString,X as renderDescOption,K as renderOptionLabel,M as replace2Any,$ as splitExtendKey,S as validateMessageParser};