@kp-ui/lowcode 2.15.0-beta.6 → 2.15.0-beta.7

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 (166) hide show
  1. package/package.json +6 -2
  2. package/src/components/FormRender/useFormContext.js +15 -15
  3. package/src/components/FormRender/useFormContext.js.map +1 -1
  4. package/src/components/bi-widget/echartBar/echart-bar-widget.vue.js +8 -0
  5. package/src/components/bi-widget/echartBar/echart-bar-widget.vue.js.map +1 -0
  6. package/src/components/bi-widget/echartBar/echart-bar-widget.vue2.js +43 -0
  7. package/src/components/bi-widget/echartBar/echart-bar-widget.vue2.js.map +1 -0
  8. package/src/components/bi-widget/echartBar/echart-bar.js +35 -0
  9. package/src/components/bi-widget/echartBar/echart-bar.js.map +1 -0
  10. package/src/components/bi-widget/index.js +13 -0
  11. package/src/components/bi-widget/index.js.map +1 -0
  12. package/src/components/{form-designer/designer.js → designer.js} +71 -76
  13. package/src/components/designer.js.map +1 -0
  14. package/src/components/form-designer/form-widget/RenderDesignerPC.vue.js +26 -0
  15. package/src/components/form-designer/form-widget/RenderDesignerPC.vue.js.map +1 -0
  16. package/src/components/form-designer/form-widget/RenderDesignerPC.vue2.js +5 -0
  17. package/src/components/form-designer/form-widget/RenderDesignerPC.vue2.js.map +1 -0
  18. package/src/components/form-designer/form-widget/RenderDesignerWigetList.vue.js +1 -1
  19. package/src/components/form-designer/form-widget/RenderDesignerWigetList.vue.js.map +1 -1
  20. package/src/components/form-designer/form-widget/bi/RenderDesignerBI.vue.js +8 -0
  21. package/src/components/form-designer/form-widget/bi/RenderDesignerBI.vue.js.map +1 -0
  22. package/src/components/form-designer/form-widget/bi/RenderDesignerBI.vue2.js +68 -0
  23. package/src/components/form-designer/form-widget/bi/RenderDesignerBI.vue2.js.map +1 -0
  24. package/src/components/form-designer/form-widget/bi/RenderDesignerBIWigetList.vue.js +8 -0
  25. package/src/components/form-designer/form-widget/bi/RenderDesignerBIWigetList.vue.js.map +1 -0
  26. package/src/components/form-designer/form-widget/bi/RenderDesignerBIWigetList.vue2.js +136 -0
  27. package/src/components/form-designer/form-widget/bi/RenderDesignerBIWigetList.vue2.js.map +1 -0
  28. package/src/components/form-designer/form-widget/bi/WidgetContextMenu.vue.js +8 -0
  29. package/src/components/form-designer/form-widget/bi/WidgetContextMenu.vue.js.map +1 -0
  30. package/src/components/form-designer/form-widget/bi/WidgetContextMenu.vue2.js +153 -0
  31. package/src/components/form-designer/form-widget/bi/WidgetContextMenu.vue2.js.map +1 -0
  32. package/src/components/form-designer/form-widget/bi/useRuler.js +66 -0
  33. package/src/components/form-designer/form-widget/bi/useRuler.js.map +1 -0
  34. package/src/components/form-designer/form-widget/container-widget/vf-box-widget.vue.js +2 -2
  35. package/src/components/form-designer/form-widget/container-widget/vf-box-widget.vue2.js +24 -21
  36. package/src/components/form-designer/form-widget/container-widget/vf-box-widget.vue2.js.map +1 -1
  37. package/src/components/form-designer/form-widget/container-widget/vf-collapse-widget.vue.js +2 -2
  38. package/src/components/form-designer/form-widget/container-widget/vf-collapse-widget.vue2.js +36 -34
  39. package/src/components/form-designer/form-widget/container-widget/vf-collapse-widget.vue2.js.map +1 -1
  40. package/src/components/form-designer/form-widget/field-widget/form-item-wrapper.vue.js +1 -1
  41. package/src/components/form-designer/form-widget/field-widget/form-item-wrapper.vue2.js +1 -1
  42. package/src/components/form-designer/form-widget/field-widget/form-item-wrapper.vue2.js.map +1 -1
  43. package/src/components/form-designer/form-widget/field-widget/index.js +1 -1
  44. package/src/components/form-designer/form-widget/field-widget/index.js.map +1 -1
  45. package/src/components/form-designer/form-widget/field-widget/useField.js +117 -117
  46. package/src/components/form-designer/form-widget/field-widget/useField.js.map +1 -1
  47. package/src/components/form-designer/form-widget/index.vue.js +2 -2
  48. package/src/components/form-designer/form-widget/index.vue2.js +47 -56
  49. package/src/components/form-designer/form-widget/index.vue2.js.map +1 -1
  50. package/src/components/form-designer/index.vue.js +74 -77
  51. package/src/components/form-designer/index.vue.js.map +1 -1
  52. package/src/components/form-designer/setting-panel/form-setting.vue.js +1 -1
  53. package/src/components/form-designer/setting-panel/form-setting.vue2.js +1 -1
  54. package/src/components/form-designer/setting-panel/form-setting.vue2.js.map +1 -1
  55. package/src/components/form-designer/setting-panel/index.vue.js +1 -1
  56. package/src/components/form-designer/setting-panel/index.vue2.js +1 -1
  57. package/src/components/form-designer/setting-panel/index.vue2.js.map +1 -1
  58. package/src/components/form-designer/setting-panel/option-items-setting.vue.js +2 -2
  59. package/src/components/form-designer/setting-panel/option-items-setting.vue2.js +1 -1
  60. package/src/components/form-designer/setting-panel/option-items-setting.vue2.js.map +1 -1
  61. package/src/components/form-designer/setting-panel/panel/PanelItemDrag.vue.js +51 -0
  62. package/src/components/form-designer/setting-panel/panel/PanelItemDrag.vue.js.map +1 -0
  63. package/src/components/form-designer/setting-panel/panel/PanelItemDragForBI.vue.js +51 -0
  64. package/src/components/form-designer/setting-panel/panel/PanelItemDragForBI.vue.js.map +1 -0
  65. package/src/components/form-designer/setting-panel/panel/PanelItemDragForBI.vue2.js +5 -0
  66. package/src/components/form-designer/setting-panel/panel/PanelItemDragForBI.vue2.js.map +1 -0
  67. package/src/components/form-designer/setting-panel/property-editor/boxModel-editor.vue.js +1 -1
  68. package/src/components/form-designer/setting-panel/property-editor/boxModel-editor.vue2.js +201 -255
  69. package/src/components/form-designer/setting-panel/property-editor/boxModel-editor.vue2.js.map +1 -1
  70. package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-customClass-editor.vue2.js +1 -1
  71. package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-customClass-editor.vue2.js.map +1 -1
  72. package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-dsEnabled-editor.vue2.js +1 -1
  73. package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-dsEnabled-editor.vue2.js.map +1 -1
  74. package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-tableColumns-editor.vue.js +1 -1
  75. package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-tableColumns-editor.vue2.js +1 -1
  76. package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-tableColumns-editor.vue2.js.map +1 -1
  77. package/src/components/form-designer/setting-panel/property-editor/container-grid/gutter-editor.vue.js +2 -2
  78. package/src/components/form-designer/setting-panel/property-editor/container-grid/gutter-editor.vue2.js +1 -1
  79. package/src/components/form-designer/setting-panel/property-editor/container-grid/gutter-editor.vue2.js.map +1 -1
  80. package/src/components/form-designer/setting-panel/property-editor/container-grid-col/grid-col-span-editor.vue2.js +1 -1
  81. package/src/components/form-designer/setting-panel/property-editor/container-grid-col/grid-col-span-editor.vue2.js.map +1 -1
  82. package/src/components/form-designer/setting-panel/property-editor/container-tab/tab-customClass-editor.vue.js +1 -1
  83. package/src/components/form-designer/setting-panel/property-editor/container-tab/tab-customClass-editor.vue2.js +1 -1
  84. package/src/components/form-designer/setting-panel/property-editor/container-tab/tab-customClass-editor.vue2.js.map +1 -1
  85. package/src/components/form-designer/setting-panel/property-editor/container-vf-dialog/height-editor.vue2.js.map +1 -1
  86. package/src/components/form-designer/setting-panel/property-editor/container-vf-dialog/width-editor.vue2.js +10 -10
  87. package/src/components/form-designer/setting-panel/property-editor/container-vf-dialog/width-editor.vue2.js.map +1 -1
  88. package/src/components/form-designer/setting-panel/property-editor/customClass-editor.vue2.js +1 -1
  89. package/src/components/form-designer/setting-panel/property-editor/customClass-editor.vue2.js.map +1 -1
  90. package/src/components/form-designer/setting-panel/property-editor/dsEnabled-editor.vue.js +5 -0
  91. package/src/components/form-designer/setting-panel/property-editor/dsEnabled-editor.vue.js.map +1 -0
  92. package/src/components/form-designer/setting-panel/property-editor/dsEnabled-editor.vue2.js +71 -0
  93. package/src/components/form-designer/setting-panel/property-editor/dsEnabled-editor.vue2.js.map +1 -0
  94. package/src/components/form-designer/setting-panel/property-editor/echart-bar-editor.vue.js +5 -0
  95. package/src/components/form-designer/setting-panel/property-editor/echart-bar-editor.vue.js.map +1 -0
  96. package/src/components/form-designer/setting-panel/property-editor/echart-bar-editor.vue2.js +81 -0
  97. package/src/components/form-designer/setting-panel/property-editor/echart-bar-editor.vue2.js.map +1 -0
  98. package/src/components/form-designer/setting-panel/property-editor/field-rate/rate-defaultValue-editor.vue2.js +1 -1
  99. package/src/components/form-designer/setting-panel/property-editor/field-rate/rate-defaultValue-editor.vue2.js.map +1 -1
  100. package/src/components/form-designer/setting-panel/property-editor/field-slider/range-editor.vue2.js +1 -1
  101. package/src/components/form-designer/setting-panel/property-editor/field-slider/range-editor.vue2.js.map +1 -1
  102. package/src/components/form-designer/setting-panel/property-editor/field-switch/switch-defaultValue-editor.vue2.js +1 -1
  103. package/src/components/form-designer/setting-panel/property-editor/field-switch/switch-defaultValue-editor.vue2.js.map +1 -1
  104. package/src/components/form-designer/setting-panel/property-editor/index.js +54 -54
  105. package/src/components/form-designer/setting-panel/property-editor/index.js.map +1 -1
  106. package/src/components/form-designer/setting-panel/property-editor/multiple-editor.vue2.js.map +1 -1
  107. package/src/components/form-designer/setting-panel/property-editor/optionItems-editor.vue2.js +1 -1
  108. package/src/components/form-designer/setting-panel/property-editor/optionItems-editor.vue2.js.map +1 -1
  109. package/src/components/form-designer/setting-panel/property-editor/rightSlotCss-editor.vue2.js +1 -1
  110. package/src/components/form-designer/setting-panel/property-editor/rightSlotCss-editor.vue2.js.map +1 -1
  111. package/src/components/form-designer/setting-panel/property-editor/type-editor.vue2.js.map +1 -1
  112. package/src/components/form-designer/setting-panel/property-editor/useEditor.js +1 -1
  113. package/src/components/form-designer/setting-panel/property-editor/useEditor.js.map +1 -1
  114. package/src/components/form-designer/setting-panel/propertyRegister.js +12 -10
  115. package/src/components/form-designer/setting-panel/propertyRegister.js.map +1 -1
  116. package/src/components/form-designer/toolbar-panel/PreviewDialog.vue.js +1 -1
  117. package/src/components/form-designer/toolbar-panel/PreviewDialog.vue.js.map +1 -1
  118. package/src/components/form-designer/toolbar-panel/index.vue.js +2 -2
  119. package/src/components/form-designer/toolbar-panel/index.vue2.js +137 -177
  120. package/src/components/form-designer/toolbar-panel/index.vue2.js.map +1 -1
  121. package/src/components/form-designer/widget-panel/containers/vf-box.js +4 -1
  122. package/src/components/form-designer/widget-panel/containers/vf-box.js.map +1 -1
  123. package/src/components/form-designer/widget-panel/containers/vf-collapse.js +6 -6
  124. package/src/components/form-designer/widget-panel/containers/vf-collapse.js.map +1 -1
  125. package/src/components/form-designer/widget-panel/index.vue.js +2 -2
  126. package/src/components/form-designer/widget-panel/index.vue2.js +74 -34
  127. package/src/components/form-designer/widget-panel/index.vue2.js.map +1 -1
  128. package/src/components/form-render/container-items/vf-box-widget.vue.js +2 -2
  129. package/src/components/form-render/container-items/vf-box-widget.vue2.js +19 -17
  130. package/src/components/form-render/container-items/vf-box-widget.vue2.js.map +1 -1
  131. package/src/components/form-render/container-items/vf-collapse-widget.vue.js +1 -1
  132. package/src/components/form-render/container-items/vf-collapse-widget.vue2.js +24 -22
  133. package/src/components/form-render/container-items/vf-collapse-widget.vue2.js.map +1 -1
  134. package/src/components/form-render/dynamic-dialog.vue.js +1 -0
  135. package/src/components/form-render/dynamic-dialog.vue.js.map +1 -1
  136. package/src/constants/EditorTypeEnum.js +1 -1
  137. package/src/constants/EditorTypeEnum.js.map +1 -1
  138. package/src/constants/LayoutTypeEnum.js +5 -0
  139. package/src/constants/LayoutTypeEnum.js.map +1 -0
  140. package/src/constants/WidgetTypeEnum.js +4 -3
  141. package/src/constants/WidgetTypeEnum.js.map +1 -1
  142. package/src/hooks/useDesigner.js +51 -0
  143. package/src/hooks/useDesigner.js.map +1 -0
  144. package/src/lang/en-US.js +1 -1
  145. package/src/lang/en-US.js.map +1 -1
  146. package/src/lang/zh-CN.js +5 -3
  147. package/src/lang/zh-CN.js.map +1 -1
  148. package/src/utils/util.js +1 -1
  149. package/src/utils/util.js.map +1 -1
  150. package/stats.html +1 -1
  151. package/styles/style.css +1 -1
  152. package/src/components/form-designer/designer.js.map +0 -1
  153. package/src/components/form-designer/form-widget/field-widget/bpmn-editor-widget copy.vue.js +0 -8
  154. package/src/components/form-designer/form-widget/field-widget/bpmn-editor-widget copy.vue.js.map +0 -1
  155. package/src/components/form-designer/form-widget/field-widget/bpmn-editor-widget copy.vue2.js +0 -58
  156. package/src/components/form-designer/form-widget/field-widget/bpmn-editor-widget copy.vue2.js.map +0 -1
  157. package/src/components/form-designer/form-widget/useFormDesigner.js +0 -34
  158. package/src/components/form-designer/form-widget/useFormDesigner.js.map +0 -1
  159. package/src/components/form-designer/setting-panel/property-editor/container-table-cell/cellHeight-editor.vue.js +0 -32
  160. package/src/components/form-designer/setting-panel/property-editor/container-table-cell/cellHeight-editor.vue.js.map +0 -1
  161. package/src/components/form-designer/setting-panel/property-editor/container-table-cell/cellWidth-editor.vue.js +0 -32
  162. package/src/components/form-designer/setting-panel/property-editor/container-table-cell/cellWidth-editor.vue.js.map +0 -1
  163. package/src/components/form-designer/widget-panel/PanelItemDrag.vue.js +0 -50
  164. package/src/components/form-designer/widget-panel/PanelItemDrag.vue.js.map +0 -1
  165. /package/src/components/form-designer/{widget-panel → setting-panel/panel}/PanelItemDrag.vue2.js +0 -0
  166. /package/src/components/form-designer/{widget-panel → setting-panel/panel}/PanelItemDrag.vue2.js.map +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"util.js","sources":["../../../src/utils/util.js"],"sourcesContent":["import Clipboard from 'clipboard';\nimport { getLocat } from '@kp-ui/tool';\nimport { isArray, isEmpty, cloneDeep } from 'lodash-es';\nimport {\n containers,\n advancedFields,\n basicFields,\n customFields\n} from '@/components/form-designer/widget-panel/widgetsConfig';\nexport function isNull(value) {\n return value === null || value === undefined;\n}\n\nexport function isNotNull(value) {\n return value !== null && value !== undefined;\n}\n\nexport function isEmptyStr(str) {\n //return (str === undefined) || (!str) || (!/[^\\s]/.test(str));\n return str === undefined || (!str && str !== 0 && str !== '0') || !/[^\\s]/.test(str);\n}\n\nexport const generateId = function () {\n return Math.floor(Math.random() * 100000 + Math.random() * 20000 + Math.random() * 5000);\n};\n\nexport const deepClone = function (origin) {\n return cloneDeep(origin);\n};\n\nexport const overwriteObj = function (obj1, obj2) {\n /* 浅拷贝对象属性,obj2覆盖obj1 */\n // for (let prop in obj2) {\n // if (obj2.hasOwnProperty(prop)) {\n // obj1[prop] = obj2[prop]\n // }\n // }\n\n Object.keys(obj2).forEach(prop => {\n obj1[prop] = obj2[prop];\n });\n};\n\nconst getComTypeMap = type => {\n const allWidgets = [...containers, ...basicFields, ...advancedFields, ...customFields];\n const map = new Map();\n allWidgets.forEach(item => {\n const type = item.type.replace(/-/g, '').toLowerCase();\n map.set(type, item);\n });\n return map.get(type.replace(/-/g, '').toLowerCase());\n};\n\nexport const fmtArray = a => {\n a = a.map(item => {\n item = overwriteDeep(item);\n return item;\n });\n return a;\n};\n\nexport const overwriteDeep = (a, ops) => {\n if (isArray(a)) {\n const res = fmtArray(a);\n return res;\n }\n let b = ops;\n const type = a.type;\n\n if (a.options) {\n if (type) {\n b = getComTypeMap(type) || b;\n }\n }\n\n for (const k in b) {\n if (typeof b[k] === 'object' && b[k] !== null) {\n a[k] = isEmpty(a[k]) ? b[k] : overwriteDeep(a[k], b[k]);\n } else {\n a[k] = a[k] === void 0 ? b[k] : a[k];\n }\n }\n return a;\n};\n\nexport const insertCustomCssToHead = function (cssCode, formId = '') {\n const head = document.getElementsByTagName('head')[0];\n\n const newStyle = document.createElement('style');\n newStyle.type = 'text/css';\n newStyle.rel = 'stylesheet';\n newStyle.id = !!formId ? 'vform-custom-css' + '-' + formId : 'vform-custom-css';\n try {\n newStyle.appendChild(document.createTextNode(cssCode));\n } catch (ex) {\n newStyle.styleSheet.cssText = cssCode;\n }\n\n head.appendChild(newStyle);\n};\n\nexport const insertGlobalFunctionsToHtml = function (functionsCode, formId = '') {\n const bodyEle = document.getElementsByTagName('body')[0];\n // let oldScriptEle = document.getElementById('v_form_global_functions');\n // !!oldScriptEle && bodyEle.removeChild(oldScriptEle); //先清除后插入!!\n // if (!!formId) {\n // oldScriptEle = document.getElementById('v_form_global_functions' + '-' + formId);\n // !!oldScriptEle && bodyEle.removeChild(oldScriptEle); //先清除后插入!!\n // }\n\n const newScriptEle = document.createElement('script');\n newScriptEle.id = !!formId\n ? 'v_form_global_functions' + '-' + formId\n : 'v_form_global_functions';\n newScriptEle.type = 'text/javascript';\n newScriptEle.innerHTML = functionsCode;\n bodyEle.appendChild(newScriptEle);\n};\n\nexport const optionExists = function (optionsObj, optionName) {\n if (!optionsObj) {\n return false;\n }\n\n return Object.keys(optionsObj).indexOf(optionName) > -1;\n};\n\nexport const loadRemoteScript = function (srcPath, callback) {\n /*加载远程js,加载成功后执行回调函数*/\n const sid = encodeURIComponent(srcPath);\n const oldScriptEle = document.getElementById(sid);\n\n if (!oldScriptEle) {\n let s = document.createElement('script');\n s.src = srcPath;\n s.id = sid;\n document.body.appendChild(s);\n\n s.onload = s.onreadystatechange = function (_, isAbort) {\n /* 借鉴自ace.js */\n if (\n isAbort ||\n !s.readyState ||\n s.readyState === 'loaded' ||\n s.readyState === 'complete'\n ) {\n s = s.onload = s.onreadystatechange = null;\n if (!isAbort) {\n callback();\n }\n }\n };\n }\n};\n\nexport function traverseFieldWidgets(\n widgetList,\n handler,\n parent = null,\n staticWidgetsIncluded = false\n) {\n if (!widgetList) {\n return;\n }\n\n widgetList.map(w => {\n if (w.formItemFlag || (w.formItemFlag === false && staticWidgetsIncluded)) {\n handler(w, parent);\n } else if (w.type === 'grid') {\n w.cols.map(col => {\n traverseFieldWidgets(col.widgetList, handler, w, staticWidgetsIncluded);\n });\n } else if (w.type === 'table') {\n w.rows.map(row => {\n row.cols.map(cell => {\n traverseFieldWidgets(cell.widgetList, handler, w, staticWidgetsIncluded);\n });\n });\n } else if (w.type === 'tab') {\n w.tabs.map(tab => {\n traverseFieldWidgets(tab.widgetList, handler, w, staticWidgetsIncluded);\n });\n } else if (w.type === 'sub-form' || w.type === 'grid-sub-form') {\n traverseFieldWidgets(w.widgetList, handler, w, staticWidgetsIncluded);\n } else if (w.category === 'container') {\n //自定义容器\n traverseFieldWidgets(w.widgetList, handler, w, staticWidgetsIncluded);\n }\n });\n}\n\nexport function traverseContainerWidgets(widgetList, handler) {\n if (!widgetList?.length) {\n return;\n }\n\n widgetList.map(w => {\n if (w.category === 'container') {\n handler(w);\n }\n\n if (w.type === 'grid') {\n w.cols.map(col => {\n traverseContainerWidgets(col.widgetList, handler);\n });\n } else if (w.type === 'table') {\n w.rows.map(row => {\n row.cols.map(cell => {\n traverseContainerWidgets(cell.widgetList, handler);\n });\n });\n } else if (w.type === 'tab') {\n w.tabs.map(tab => {\n traverseContainerWidgets(tab.widgetList, handler);\n });\n } else if (w.type === 'sub-form' || w.type === 'grid-sub-form') {\n traverseContainerWidgets(w.widgetList, handler);\n } else if (w.category === 'container') {\n //自定义容器\n traverseContainerWidgets(w.widgetList, handler);\n }\n });\n}\n\nexport function traverseAllWidgets(widgetList, handler) {\n if (!widgetList) {\n return;\n }\n\n widgetList.map(w => {\n handler(w);\n\n if (w.type === 'grid') {\n w.cols.map(col => {\n handler(col);\n traverseAllWidgets(col.widgetList, handler);\n });\n } else if (w.type === 'table') {\n w.rows.map(row => {\n row.cols.map(cell => {\n handler(cell);\n traverseAllWidgets(cell.widgetList, handler);\n });\n });\n } else if (w.type === 'tab') {\n w.tabs.map(tab => {\n traverseAllWidgets(tab.widgetList, handler);\n });\n } else if (w.type === 'sub-form' || w.type === 'grid-sub-form') {\n traverseAllWidgets(w.widgetList, handler);\n } else if (w.category === 'container') {\n //自定义容器\n traverseAllWidgets(w.widgetList, handler);\n }\n });\n}\n\nfunction handleWidgetForTraverse(widget, handler) {\n if (!!widget.category && widget.category === 'container') {\n traverseFieldWidgetsOfContainer(widget, handler);\n } else if (widget.formItemFlag) {\n handler(widget);\n }\n}\n\n/**\n * 遍历容器内的字段组件\n * @param con\n * @param handler\n */\nexport function traverseFieldWidgetsOfContainer(con, handler) {\n if (con.type === 'grid') {\n con.cols.forEach(col => {\n col.widgetList.forEach(cw => {\n handleWidgetForTraverse(cw, handler);\n });\n });\n } else if (con.type === 'table') {\n con.rows.forEach(row => {\n row.cols.forEach(cell => {\n cell.widgetList.forEach(cw => {\n handleWidgetForTraverse(cw, handler);\n });\n });\n });\n } else if (con.type === 'tab') {\n con.tabs.forEach(tab => {\n tab.widgetList.forEach(cw => {\n handleWidgetForTraverse(cw, handler);\n });\n });\n } else if (con.type === 'sub-form' || con.type === 'grid-sub-form') {\n con.widgetList.forEach(cw => {\n handleWidgetForTraverse(cw, handler);\n });\n } else if (con.category === 'container') {\n //自定义容器\n con.widgetList.forEach(cw => {\n handleWidgetForTraverse(cw, handler);\n });\n }\n}\n\nfunction handleContainerTraverse(widget, fieldHandler, containerHandler) {\n if (!!widget.category && widget.category === 'container') {\n traverseWidgetsOfContainer(widget, fieldHandler, containerHandler);\n } else if (widget.formItemFlag) {\n fieldHandler(widget);\n }\n}\n\n/**\n * 遍历容器内部的字段组件和容器组件\n * @param con\n * @param fieldHandler\n * @param containerHandler\n */\nexport function traverseWidgetsOfContainer(con, fieldHandler, containerHandler) {\n if (con.type === 'grid') {\n con.cols.forEach(col => {\n col.widgetList.forEach(cw => {\n handleContainerTraverse(cw, fieldHandler, containerHandler);\n });\n });\n } else if (con.type === 'table') {\n con.rows.forEach(row => {\n row.cols.forEach(cell => {\n cell.widgetList.forEach(cw => {\n handleContainerTraverse(cw, fieldHandler, containerHandler);\n });\n });\n });\n } else if (con.type === 'tab') {\n con.tabs.forEach(tab => {\n tab.widgetList.forEach(cw => {\n handleContainerTraverse(cw, fieldHandler, containerHandler);\n });\n });\n } else if (con.type === 'sub-form' || con.type === 'grid-sub-form') {\n con.widgetList.forEach(cw => {\n handleContainerTraverse(cw, fieldHandler, containerHandler);\n });\n } else if (con.category === 'container') {\n //自定义容器\n con.widgetList.forEach(cw => {\n handleContainerTraverse(cw, fieldHandler, containerHandler);\n });\n }\n}\n\n/**\n * 获取所有字段组件\n * @param widgetList\n * @param staticWidgetsIncluded 是否包含按钮等静态组件,默认不包含\n * @returns {[]}\n */\nexport function getAllFieldWidgets(widgetList, staticWidgetsIncluded = false) {\n if (!widgetList) {\n return [];\n }\n\n const result = [];\n const handlerFn = w => {\n result.push({\n type: w.type,\n name: w.options.name,\n field: w\n });\n };\n traverseFieldWidgets(widgetList, handlerFn, null, staticWidgetsIncluded);\n\n return result;\n}\n\n/**\n * 获取所有容器组件\n * @param widgetList\n * @returns {[]}\n */\nexport function getAllContainerWidgets(widgetList) {\n if (!widgetList) {\n return [];\n }\n\n const result = [];\n const handlerFn = w => {\n result.push({\n type: w.type,\n name: w.options.name,\n container: w\n });\n };\n traverseContainerWidgets(widgetList, handlerFn);\n\n return result;\n}\n\nexport function getFieldWidgetByName(widgetList, fieldName, staticWidgetsIncluded) {\n if (!widgetList) {\n return null;\n }\n\n let foundWidget = null;\n const handlerFn = widget => {\n if (widget.options.name === fieldName) {\n foundWidget = widget;\n }\n };\n\n traverseFieldWidgets(widgetList, handlerFn, null, staticWidgetsIncluded);\n return foundWidget;\n}\n\nexport function getContainerWidgetByName(widgetList, containerName) {\n if (!widgetList) {\n return null;\n }\n\n let foundContainer = null;\n const handlerFn = con => {\n if (con.options.name === containerName) {\n foundContainer = con;\n }\n };\n\n traverseContainerWidgets(widgetList, handlerFn);\n return foundContainer;\n}\n\nexport function getContainerWidgetById(widgetList, containerId) {\n if (!widgetList) {\n return null;\n }\n\n let foundContainer = null;\n const handlerFn = con => {\n if (con.id === containerId) {\n foundContainer = con;\n }\n };\n\n traverseContainerWidgets(widgetList, handlerFn);\n return foundContainer;\n}\n\nexport function copyToClipboard(content, clickEvent, $message, successMsg, errorMsg) {\n const clipboard = new Clipboard(clickEvent.target, {\n text: () => content\n });\n\n clipboard.on('success', () => {\n $message.success(successMsg);\n clipboard.destroy();\n });\n\n clipboard.on('error', () => {\n $message.error(errorMsg);\n clipboard.destroy();\n });\n\n clipboard.onClick(clickEvent);\n}\n\nexport function getQueryParam(variable) {\n const query = window.location.search.substring(1);\n const vars = query.split('&');\n for (let i = 0; i < vars.length; i++) {\n const pair = vars[i].split('=');\n if (pair[0] == variable) {\n return pair[1];\n }\n }\n\n return undefined;\n}\n\nexport function getDefaultFormConfig() {\n const { formCode = '' } = getLocat();\n\n return {\n labelWidth: 80,\n labelPosition: 'horizontal', //'left',\n size: '',\n labelAlign: 'right',\n cssCode: '',\n customClass: [],\n\n okButtonLabel: '',\n isEnterSubmit: 0,\n okButtonHidden: '',\n\n cancelButtonHidden: '',\n cancelButtonLabel: '',\n\n functions: '', //全局函数\n layoutType: 'PC',\n onFormCreated: '',\n onFormMounted: `\n if(!this.vfCtx) return\n if(!this.vfCtx._id) return\n const type = this.vfCtx.type\n this.setReadMode(type==='view')\n this.onFormDetail().then(res=>{\n this.setFormData({...res})\n })\n `,\n\n onFormDataChange: '',\n onOkButtonClick: `\n this.getFormRef().onFormUpdate().then(()=>{\n this.$message.success('保存成功!');\n })\n `,\n onCancelButtonClick: '',\n\n serveList: {\n list: [],\n vformUpdate: {\n http: {\n url: `/api/tmgc2-mgt/formDefinition/${formCode}/evaluate/formSubmit`,\n method: 'post',\n data: { _id: '${_id}' },\n params: {}\n },\n dataReqHandlerCode: `const d=data.data||{};\\n Object.keys(d).forEach(k=>{\\n if(d[k]==='null'){\\n d[k]=null\\n }\\n })\\nreturn {...data,data:d}`,\n dataHandlerCode: ''\n },\n vformDetail: {\n http: {\n url: `/api/tmgc2-mgt/formDefinition/${formCode}/evaluate/formLoad`,\n method: 'post',\n data: { _id: '${_id}' },\n params: {}\n },\n dataReqHandlerCode: `const d=data.data||{};\\n Object.keys(d).forEach(k=>{\\n if(d[k]==='null'){\\n d[k]=null\\n }\\n })\\nreturn {...data,data:d}`,\n dataHandlerCode: 'return data.data.object||{}'\n }\n }\n };\n}\n\nexport function buildDefaultFormJson() {\n return {\n widgetList: [],\n formConfig: deepClone(getDefaultFormConfig())\n };\n}\n\nexport function cloneFormConfigWithoutEventHandler(formConfig) {\n const newFC = deepClone(formConfig);\n newFC.onFormCreated = '';\n newFC.onFormMounted = '';\n newFC.onFormDataChange = '';\n\n return newFC;\n}\n\n/**\n * 转译选择项数据\n * @param rawData\n * @param widgetType\n * @param labelKey\n * @param valueKey\n * @returns {[]}\n */\nexport function translateOptionItems(rawData, widgetType, labelKey, valueKey) {\n if (['cascader', 'treeSelect', 'select'].includes(widgetType)) {\n // 级联选择不转译\n return deepClone(rawData);\n }\n\n const result = [];\n if (!!rawData && rawData.length > 0) {\n rawData.forEach(ri => {\n result.push({\n label: ri[labelKey],\n value: ri[valueKey]\n });\n });\n }\n\n return rawData; //result;\n}\n\n/**\n * 组装axios请求配置参数\n * @param arrayObj\n * @param DSV\n * @param VFR\n * @returns {{}}\n */\nexport function assembleAxiosConfig(arrayObj, DSV, VFR) {\n const result = {};\n if (!arrayObj || arrayObj.length <= 0) {\n return result;\n }\n\n arrayObj.map(ai => {\n if (ai.type === 'String') {\n result[ai.name] = String(ai.value);\n } else if (ai.type === 'Number') {\n result[ai.name] = Number(ai.value);\n } else if (ai.type === 'Boolean') {\n if (ai.value.toLowerCase() === 'false' || ai.value === '0') {\n result[ai.name] = false;\n } else if (ai.value.toLowerCase() === 'true' || ai.value === '1') {\n result[ai.name] = true;\n } else {\n result[ai.name] = null;\n }\n } else if (ai.type === 'Variable') {\n result[ai.name] = eval(ai.value);\n }\n });\n\n /* 加入如下两行日志打印代码,是为了防止编译打包时DSV、VFR参数被剔除!! begin */\n /* DSV、VFR入参没有在本函数中直接使用到,但在eval表达式中可能被使用到,故需确保DSV、VFR参数始终存在!! */\n console.log('test DSV: ', DSV);\n console.log('test VFR: ', VFR);\n /* 加入如下两行日志打印代码,是为了防止编译打包时DSV、VFR入参会被剔除!! end */\n\n return result;\n}\n\nfunction buildRequestConfig(dataSource, DSV, VFR, isSandbox) {\n const config = {};\n if (dataSource.requestURLType === 'String') {\n config.url = dataSource.requestURL;\n } else {\n config.url = eval(dataSource.requestURL);\n }\n config.method = dataSource.requestMethod;\n\n config.headers = assembleAxiosConfig(dataSource.headers, DSV, VFR);\n config.params = assembleAxiosConfig(dataSource.params, DSV, VFR);\n config.data = assembleAxiosConfig(dataSource.data, DSV, VFR);\n\n const chFn = new Function('config', 'isSandbox', 'DSV', 'VFR', dataSource.configHandlerCode);\n return chFn.call(null, config, isSandbox, DSV, VFR);\n}\n\nexport function getDSByName(formConfig, dsName) {\n let resultDS = null;\n if (!!dsName && !!formConfig.dataSources) {\n formConfig.dataSources.forEach(ds => {\n if (ds.uniqueName === dsName) {\n resultDS = ds;\n }\n });\n }\n\n return resultDS;\n}\n"],"names":["isNull","value","generateId","deepClone","origin","cloneDeep","overwriteObj","obj1","obj2","prop","insertCustomCssToHead","cssCode","formId","head","newStyle","insertGlobalFunctionsToHtml","functionsCode","bodyEle","newScriptEle","traverseFieldWidgets","widgetList","handler","parent","staticWidgetsIncluded","w","col","row","cell","tab","traverseContainerWidgets","handleWidgetForTraverse","widget","traverseFieldWidgetsOfContainer","con","cw","getAllFieldWidgets","result","getAllContainerWidgets","getContainerWidgetByName","containerName","foundContainer","copyToClipboard","content","clickEvent","$message","successMsg","errorMsg","clipboard","Clipboard","getDefaultFormConfig","formCode","getLocat","cloneFormConfigWithoutEventHandler","formConfig","newFC","translateOptionItems","rawData","widgetType","labelKey","valueKey","ri","getDSByName","dsName","resultDS","ds"],"mappings":";;;;AASO,SAASA,EAAOC,GAAO;AAC1B,SAAOA,KAAU;AACrB;AAWY,MAACC,IAAa,WAAY;AAClC,SAAO,KAAK,MAAM,KAAK,OAAM,IAAK,MAAS,KAAK,OAAM,IAAK,MAAQ,KAAK,OAAM,IAAK,GAAI;AAC3F,GAEaC,IAAY,SAAUC,GAAQ;AACvC,SAAOC,EAAUD,CAAM;AAC3B,GAEaE,IAAe,SAAUC,GAAMC,GAAM;AAQ9C,SAAO,KAAKA,CAAI,EAAE,QAAQ,CAAAC,MAAQ;AAC9B,IAAAF,EAAKE,CAAI,IAAID,EAAKC,CAAI;AAAA,EAC1B,CAAC;AACL,GA4CaC,IAAwB,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,KAAK,SAAQ;AAAA,UACrB,QAAQ,CAAA;AAAA,QAC5B;AAAA,QACgB,oBAAoB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QACpB,iBAAiB;AAAA,MACjC;AAAA,MACY,aAAa;AAAA,QACT,MAAM;AAAA,UACF,KAAK,iCAAiCA,CAAQ;AAAA,UAC9C,QAAQ;AAAA,UACR,MAAM,EAAE,KAAK,SAAQ;AAAA,UACrB,QAAQ,CAAA;AAAA,QAC5B;AAAA,QACgB,oBAAoB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QACpB,iBAAiB;AAAA,MACjC;AAAA,IACA;AAAA,EACA;AACA;AASO,SAASE,EAAmCC,GAAY;AAC3D,QAAMC,IAAQnD,EAAUkD,CAAU;AAClC,SAAAC,EAAM,gBAAgB,IACtBA,EAAM,gBAAgB,IACtBA,EAAM,mBAAmB,IAElBA;AACX;AAUO,SAASC,EAAqBC,GAASC,GAAYC,GAAUC,GAAU;AAC1E,MAAI,CAAC,YAAY,cAAc,QAAQ,EAAE,SAASF,CAAU;AAExD,WAAOtD,EAAUqD,CAAO;AAG5B,QAAMpB,IAAS,CAAA;AACf,SAAMoB,KAAWA,EAAQ,SAAS,KAC9BA,EAAQ,QAAQ,CAAAI,MAAM;AAClB,IAAAxB,EAAO,KAAK;AAAA,MACR,OAAOwB,EAAGF,CAAQ;AAAA,MAClB,OAAOE,EAAGD,CAAQ;AAAA,IAClC,CAAa;AAAA,EACL,CAAC,GAGEH;AACX;AA2DO,SAASK,EAAYR,GAAYS,GAAQ;AAC5C,MAAIC,IAAW;AACf,SAAMD,KAAYT,EAAW,eACzBA,EAAW,YAAY,QAAQ,CAAAW,MAAM;AACjC,IAAIA,EAAG,eAAeF,MAClBC,IAAWC;AAAA,EAEnB,CAAC,GAGED;AACX;"}
1
+ {"version":3,"file":"util.js","sources":["../../../src/utils/util.js"],"sourcesContent":["import Clipboard from 'clipboard';\nimport { getLocat } from '@kp-ui/tool';\nimport { isArray, isEmpty, cloneDeep } from 'lodash-es';\nimport {\n containers,\n advancedFields,\n basicFields,\n customFields\n} from '@/components/form-designer/widget-panel/widgetsConfig';\nexport function isNull(value) {\n return value === null || value === undefined;\n}\n\nexport function isNotNull(value) {\n return value !== null && value !== undefined;\n}\n\nexport function isEmptyStr(str) {\n //return (str === undefined) || (!str) || (!/[^\\s]/.test(str));\n return str === undefined || (!str && str !== 0 && str !== '0') || !/[^\\s]/.test(str);\n}\n\nexport const generateId = function () {\n return Math.floor(Math.random() * 100000 + Math.random() * 20000 + Math.random() * 5000);\n};\n\nexport const deepClone = function (origin) {\n return cloneDeep(origin);\n};\n\nexport const overwriteObj = function (obj1, obj2) {\n /* 浅拷贝对象属性,obj2覆盖obj1 */\n // for (let prop in obj2) {\n // if (obj2.hasOwnProperty(prop)) {\n // obj1[prop] = obj2[prop]\n // }\n // }\n\n Object.keys(obj2).forEach(prop => {\n obj1[prop] = obj2[prop];\n });\n};\n\nconst getComTypeMap = type => {\n const allWidgets = [...containers, ...basicFields, ...advancedFields, ...customFields];\n const map = new Map();\n allWidgets.forEach(item => {\n const type = item.type.replace(/-/g, '').toLowerCase();\n map.set(type, item);\n });\n return map.get(type.replace(/-/g, '').toLowerCase());\n};\n\nexport const fmtArray = a => {\n a = a.map(item => {\n item = overwriteDeep(item);\n return item;\n });\n return a;\n};\n\nexport const overwriteDeep = (a, ops) => {\n if (isArray(a)) {\n const res = fmtArray(a);\n return res;\n }\n let b = ops;\n const type = a.type;\n\n if (a.options) {\n if (type) {\n b = getComTypeMap(type) || b;\n }\n }\n\n for (const k in b) {\n if (typeof b[k] === 'object' && b[k] !== null) {\n a[k] = isEmpty(a[k]) ? b[k] : overwriteDeep(a[k], b[k]);\n } else {\n a[k] = a[k] === void 0 ? b[k] : a[k];\n }\n }\n return a;\n};\n\nexport const insertCustomCssToHead = function (cssCode, formId = '') {\n const head = document.getElementsByTagName('head')[0];\n\n const newStyle = document.createElement('style');\n newStyle.type = 'text/css';\n newStyle.rel = 'stylesheet';\n newStyle.id = !!formId ? 'vform-custom-css' + '-' + formId : 'vform-custom-css';\n console.log(cssCode);\n\n try {\n newStyle.appendChild(document.createTextNode(cssCode));\n } catch (ex) {\n newStyle.styleSheet.cssText = cssCode;\n }\n\n head.appendChild(newStyle);\n};\n\nexport const insertGlobalFunctionsToHtml = function (functionsCode, formId = '') {\n const bodyEle = document.getElementsByTagName('body')[0];\n // let oldScriptEle = document.getElementById('v_form_global_functions');\n // !!oldScriptEle && bodyEle.removeChild(oldScriptEle); //先清除后插入!!\n // if (!!formId) {\n // oldScriptEle = document.getElementById('v_form_global_functions' + '-' + formId);\n // !!oldScriptEle && bodyEle.removeChild(oldScriptEle); //先清除后插入!!\n // }\n\n const newScriptEle = document.createElement('script');\n newScriptEle.id = !!formId\n ? 'v_form_global_functions' + '-' + formId\n : 'v_form_global_functions';\n newScriptEle.type = 'text/javascript';\n newScriptEle.innerHTML = functionsCode;\n bodyEle.appendChild(newScriptEle);\n};\n\nexport const optionExists = function (optionsObj, optionName) {\n if (!optionsObj) {\n return false;\n }\n\n return Object.keys(optionsObj).indexOf(optionName) > -1;\n};\n\nexport const loadRemoteScript = function (srcPath, callback) {\n /*加载远程js,加载成功后执行回调函数*/\n const sid = encodeURIComponent(srcPath);\n const oldScriptEle = document.getElementById(sid);\n\n if (!oldScriptEle) {\n let s = document.createElement('script');\n s.src = srcPath;\n s.id = sid;\n document.body.appendChild(s);\n\n s.onload = s.onreadystatechange = function (_, isAbort) {\n /* 借鉴自ace.js */\n if (\n isAbort ||\n !s.readyState ||\n s.readyState === 'loaded' ||\n s.readyState === 'complete'\n ) {\n s = s.onload = s.onreadystatechange = null;\n if (!isAbort) {\n callback();\n }\n }\n };\n }\n};\n\nexport function traverseFieldWidgets(\n widgetList,\n handler,\n parent = null,\n staticWidgetsIncluded = false\n) {\n if (!widgetList) {\n return;\n }\n\n widgetList.map(w => {\n if (w.formItemFlag || (w.formItemFlag === false && staticWidgetsIncluded)) {\n handler(w, parent);\n } else if (w.type === 'grid') {\n w.cols.map(col => {\n traverseFieldWidgets(col.widgetList, handler, w, staticWidgetsIncluded);\n });\n } else if (w.type === 'table') {\n w.rows.map(row => {\n row.cols.map(cell => {\n traverseFieldWidgets(cell.widgetList, handler, w, staticWidgetsIncluded);\n });\n });\n } else if (w.type === 'tab') {\n w.tabs.map(tab => {\n traverseFieldWidgets(tab.widgetList, handler, w, staticWidgetsIncluded);\n });\n } else if (w.type === 'sub-form' || w.type === 'grid-sub-form') {\n traverseFieldWidgets(w.widgetList, handler, w, staticWidgetsIncluded);\n } else if (w.category === 'container') {\n //自定义容器\n traverseFieldWidgets(w.widgetList, handler, w, staticWidgetsIncluded);\n }\n });\n}\n\nexport function traverseContainerWidgets(widgetList, handler) {\n if (!widgetList?.length) {\n return;\n }\n\n widgetList.map(w => {\n if (w.category === 'container') {\n handler(w);\n }\n\n if (w.type === 'grid') {\n w.cols.map(col => {\n traverseContainerWidgets(col.widgetList, handler);\n });\n } else if (w.type === 'table') {\n w.rows.map(row => {\n row.cols.map(cell => {\n traverseContainerWidgets(cell.widgetList, handler);\n });\n });\n } else if (w.type === 'tab') {\n w.tabs.map(tab => {\n traverseContainerWidgets(tab.widgetList, handler);\n });\n } else if (w.type === 'sub-form' || w.type === 'grid-sub-form') {\n traverseContainerWidgets(w.widgetList, handler);\n } else if (w.category === 'container') {\n //自定义容器\n traverseContainerWidgets(w.widgetList, handler);\n }\n });\n}\n\nexport function traverseAllWidgets(widgetList, handler) {\n if (!widgetList) {\n return;\n }\n\n widgetList.map(w => {\n handler(w);\n\n if (w.type === 'grid') {\n w.cols.map(col => {\n handler(col);\n traverseAllWidgets(col.widgetList, handler);\n });\n } else if (w.type === 'table') {\n w.rows.map(row => {\n row.cols.map(cell => {\n handler(cell);\n traverseAllWidgets(cell.widgetList, handler);\n });\n });\n } else if (w.type === 'tab') {\n w.tabs.map(tab => {\n traverseAllWidgets(tab.widgetList, handler);\n });\n } else if (w.type === 'sub-form' || w.type === 'grid-sub-form') {\n traverseAllWidgets(w.widgetList, handler);\n } else if (w.category === 'container') {\n //自定义容器\n traverseAllWidgets(w.widgetList, handler);\n }\n });\n}\n\nfunction handleWidgetForTraverse(widget, handler) {\n if (!!widget.category && widget.category === 'container') {\n traverseFieldWidgetsOfContainer(widget, handler);\n } else if (widget.formItemFlag) {\n handler(widget);\n }\n}\n\n/**\n * 遍历容器内的字段组件\n * @param con\n * @param handler\n */\nexport function traverseFieldWidgetsOfContainer(con, handler) {\n if (con.type === 'grid') {\n con.cols.forEach(col => {\n col.widgetList.forEach(cw => {\n handleWidgetForTraverse(cw, handler);\n });\n });\n } else if (con.type === 'table') {\n con.rows.forEach(row => {\n row.cols.forEach(cell => {\n cell.widgetList.forEach(cw => {\n handleWidgetForTraverse(cw, handler);\n });\n });\n });\n } else if (con.type === 'tab') {\n con.tabs.forEach(tab => {\n tab.widgetList.forEach(cw => {\n handleWidgetForTraverse(cw, handler);\n });\n });\n } else if (con.type === 'sub-form' || con.type === 'grid-sub-form') {\n con.widgetList.forEach(cw => {\n handleWidgetForTraverse(cw, handler);\n });\n } else if (con.category === 'container') {\n //自定义容器\n con.widgetList.forEach(cw => {\n handleWidgetForTraverse(cw, handler);\n });\n }\n}\n\nfunction handleContainerTraverse(widget, fieldHandler, containerHandler) {\n if (!!widget.category && widget.category === 'container') {\n traverseWidgetsOfContainer(widget, fieldHandler, containerHandler);\n } else if (widget.formItemFlag) {\n fieldHandler(widget);\n }\n}\n\n/**\n * 遍历容器内部的字段组件和容器组件\n * @param con\n * @param fieldHandler\n * @param containerHandler\n */\nexport function traverseWidgetsOfContainer(con, fieldHandler, containerHandler) {\n if (con.type === 'grid') {\n con.cols.forEach(col => {\n col.widgetList.forEach(cw => {\n handleContainerTraverse(cw, fieldHandler, containerHandler);\n });\n });\n } else if (con.type === 'table') {\n con.rows.forEach(row => {\n row.cols.forEach(cell => {\n cell.widgetList.forEach(cw => {\n handleContainerTraverse(cw, fieldHandler, containerHandler);\n });\n });\n });\n } else if (con.type === 'tab') {\n con.tabs.forEach(tab => {\n tab.widgetList.forEach(cw => {\n handleContainerTraverse(cw, fieldHandler, containerHandler);\n });\n });\n } else if (con.type === 'sub-form' || con.type === 'grid-sub-form') {\n con.widgetList.forEach(cw => {\n handleContainerTraverse(cw, fieldHandler, containerHandler);\n });\n } else if (con.category === 'container') {\n //自定义容器\n con.widgetList.forEach(cw => {\n handleContainerTraverse(cw, fieldHandler, containerHandler);\n });\n }\n}\n\n/**\n * 获取所有字段组件\n * @param widgetList\n * @param staticWidgetsIncluded 是否包含按钮等静态组件,默认不包含\n * @returns {[]}\n */\nexport function getAllFieldWidgets(widgetList, staticWidgetsIncluded = false) {\n if (!widgetList) {\n return [];\n }\n\n const result = [];\n const handlerFn = w => {\n result.push({\n type: w.type,\n name: w.options.name,\n field: w\n });\n };\n traverseFieldWidgets(widgetList, handlerFn, null, staticWidgetsIncluded);\n\n return result;\n}\n\n/**\n * 获取所有容器组件\n * @param widgetList\n * @returns {[]}\n */\nexport function getAllContainerWidgets(widgetList) {\n if (!widgetList) {\n return [];\n }\n\n const result = [];\n const handlerFn = w => {\n result.push({\n type: w.type,\n name: w.options.name,\n container: w\n });\n };\n traverseContainerWidgets(widgetList, handlerFn);\n\n return result;\n}\n\nexport function getFieldWidgetByName(widgetList, fieldName, staticWidgetsIncluded) {\n if (!widgetList) {\n return null;\n }\n\n let foundWidget = null;\n const handlerFn = widget => {\n if (widget.options.name === fieldName) {\n foundWidget = widget;\n }\n };\n\n traverseFieldWidgets(widgetList, handlerFn, null, staticWidgetsIncluded);\n return foundWidget;\n}\n\nexport function getContainerWidgetByName(widgetList, containerName) {\n if (!widgetList) {\n return null;\n }\n\n let foundContainer = null;\n const handlerFn = con => {\n if (con.options.name === containerName) {\n foundContainer = con;\n }\n };\n\n traverseContainerWidgets(widgetList, handlerFn);\n return foundContainer;\n}\n\nexport function getContainerWidgetById(widgetList, containerId) {\n if (!widgetList) {\n return null;\n }\n\n let foundContainer = null;\n const handlerFn = con => {\n if (con.id === containerId) {\n foundContainer = con;\n }\n };\n\n traverseContainerWidgets(widgetList, handlerFn);\n return foundContainer;\n}\n\nexport function copyToClipboard(content, clickEvent, $message, successMsg, errorMsg) {\n const clipboard = new Clipboard(clickEvent.target, {\n text: () => content\n });\n\n clipboard.on('success', () => {\n $message.success(successMsg);\n clipboard.destroy();\n });\n\n clipboard.on('error', () => {\n $message.error(errorMsg);\n clipboard.destroy();\n });\n\n clipboard.onClick(clickEvent);\n}\n\nexport function getQueryParam(variable) {\n const query = window.location.search.substring(1);\n const vars = query.split('&');\n for (let i = 0; i < vars.length; i++) {\n const pair = vars[i].split('=');\n if (pair[0] == variable) {\n return pair[1];\n }\n }\n\n return undefined;\n}\n\nexport function getDefaultFormConfig() {\n const { formCode = '' } = getLocat();\n\n return {\n labelWidth: 80,\n labelPosition: 'horizontal', //'left',\n size: '',\n labelAlign: 'right',\n cssCode: '',\n customClass: [],\n\n okButtonLabel: '',\n isEnterSubmit: 0,\n okButtonHidden: '',\n\n cancelButtonHidden: '',\n cancelButtonLabel: '',\n\n functions: '', //全局函数\n layoutType: 'PC',\n onFormCreated: '',\n onFormMounted: `\n if(!this.vfCtx) return\n if(!this.vfCtx._id) return\n const type = this.vfCtx.type\n this.setReadMode(type==='view')\n this.onFormDetail().then(res=>{\n this.setFormData({...res})\n })\n `,\n\n onFormDataChange: '',\n onOkButtonClick: `\n this.getFormRef().onFormUpdate().then(()=>{\n this.$message.success('保存成功!');\n })\n `,\n onCancelButtonClick: '',\n\n serveList: {\n list: [],\n vformUpdate: {\n http: {\n url: `/api/tmgc2-mgt/formDefinition/${formCode}/evaluate/formSubmit`,\n method: 'post',\n data: { _id: '${_id}' },\n params: {}\n },\n dataReqHandlerCode: `const d=data.data||{};\\n Object.keys(d).forEach(k=>{\\n if(d[k]==='null'){\\n d[k]=null\\n }\\n })\\nreturn {...data,data:d}`,\n dataHandlerCode: ''\n },\n vformDetail: {\n http: {\n url: `/api/tmgc2-mgt/formDefinition/${formCode}/evaluate/formLoad`,\n method: 'post',\n data: { _id: '${_id}' },\n params: {}\n },\n dataReqHandlerCode: `const d=data.data||{};\\n Object.keys(d).forEach(k=>{\\n if(d[k]==='null'){\\n d[k]=null\\n }\\n })\\nreturn {...data,data:d}`,\n dataHandlerCode: 'return data.data.object||{}'\n }\n }\n };\n}\n\nexport function buildDefaultFormJson() {\n return {\n widgetList: [],\n formConfig: deepClone(getDefaultFormConfig())\n };\n}\n\nexport function cloneFormConfigWithoutEventHandler(formConfig) {\n const newFC = deepClone(formConfig);\n newFC.onFormCreated = '';\n newFC.onFormMounted = '';\n newFC.onFormDataChange = '';\n\n return newFC;\n}\n\n/**\n * 转译选择项数据\n * @param rawData\n * @param widgetType\n * @param labelKey\n * @param valueKey\n * @returns {[]}\n */\nexport function translateOptionItems(rawData, widgetType, labelKey, valueKey) {\n if (['cascader', 'treeSelect', 'select'].includes(widgetType)) {\n // 级联选择不转译\n return deepClone(rawData);\n }\n\n const result = [];\n if (!!rawData && rawData.length > 0) {\n rawData.forEach(ri => {\n result.push({\n label: ri[labelKey],\n value: ri[valueKey]\n });\n });\n }\n\n return rawData; //result;\n}\n\nexport function getDSByName(formConfig, dsName) {\n let resultDS = null;\n if (!!dsName && !!formConfig.dataSources) {\n formConfig.dataSources.forEach(ds => {\n if (ds.uniqueName === dsName) {\n resultDS = ds;\n }\n });\n }\n\n return resultDS;\n}\n"],"names":["isNull","value","generateId","deepClone","origin","cloneDeep","overwriteObj","obj1","obj2","prop","insertCustomCssToHead","cssCode","formId","head","newStyle","insertGlobalFunctionsToHtml","functionsCode","bodyEle","newScriptEle","traverseFieldWidgets","widgetList","handler","parent","staticWidgetsIncluded","w","col","row","cell","tab","traverseContainerWidgets","handleWidgetForTraverse","widget","traverseFieldWidgetsOfContainer","con","cw","getAllFieldWidgets","result","getAllContainerWidgets","getContainerWidgetByName","containerName","foundContainer","copyToClipboard","content","clickEvent","$message","successMsg","errorMsg","clipboard","Clipboard","getDefaultFormConfig","formCode","getLocat","cloneFormConfigWithoutEventHandler","formConfig","newFC","translateOptionItems","rawData","widgetType","labelKey","valueKey","ri","getDSByName","dsName","resultDS","ds"],"mappings":";;;;AASO,SAASA,EAAOC,GAAO;AAC1B,SAAOA,KAAU;AACrB;AAWY,MAACC,IAAa,WAAY;AAClC,SAAO,KAAK,MAAM,KAAK,OAAM,IAAK,MAAS,KAAK,OAAM,IAAK,MAAQ,KAAK,OAAM,IAAK,GAAI;AAC3F,GAEaC,IAAY,SAAUC,GAAQ;AACvC,SAAOC,EAAUD,CAAM;AAC3B,GAEaE,IAAe,SAAUC,GAAMC,GAAM;AAQ9C,SAAO,KAAKA,CAAI,EAAE,QAAQ,CAAAC,MAAQ;AAC9B,IAAAF,EAAKE,CAAI,IAAID,EAAKC,CAAI;AAAA,EAC1B,CAAC;AACL,GA4CaC,IAAwB,SAAUC,GAASC,IAAS,IAAI;AACjE,QAAMC,IAAO,SAAS,qBAAqB,MAAM,EAAE,CAAC,GAE9CC,IAAW,SAAS,cAAc,OAAO;AAC/C,EAAAA,EAAS,OAAO,YAChBA,EAAS,MAAM,cACfA,EAAS,KAAOF,IAAS,sBAA2BA,IAAS,oBAC7D,QAAQ,IAAID,CAAO;AAEnB,MAAI;AACA,IAAAG,EAAS,YAAY,SAAS,eAAeH,CAAO,CAAC;AAAA,EACzD,QAAa;AACT,IAAAG,EAAS,WAAW,UAAUH;AAAA,EAClC;AAEA,EAAAE,EAAK,YAAYC,CAAQ;AAC7B,GAEaC,IAA8B,SAAUC,GAAeJ,IAAS,IAAI;AAC7E,QAAMK,IAAU,SAAS,qBAAqB,MAAM,EAAE,CAAC,GAQjDC,IAAe,SAAS,cAAc,QAAQ;AACpD,EAAAA,EAAa,KAAON,IACd,6BAAkCA,IAClC,2BACNM,EAAa,OAAO,mBACpBA,EAAa,YAAYF,GACzBC,EAAQ,YAAYC,CAAY;AACpC;AAsCO,SAASC,EACZC,GACAC,GACAC,IAAS,MACTC,IAAwB,IAC1B;AAC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