@kp-ui/lowcode 1.0.103 → 1.0.104

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 (51) hide show
  1. package/package.json +1 -1
  2. package/src/components/form-designer/form-widget/container-widget/vf-collapse-widget.vue.js +75 -100
  3. package/src/components/form-designer/form-widget/container-widget/vf-collapse-widget.vue.js.map +1 -1
  4. package/src/components/form-designer/form-widget/container-widget/vf-collapse-widget.vue2.js +4 -4
  5. package/src/components/form-designer/form-widget/container-widget/vf-collapse-widget.vue2.js.map +1 -1
  6. package/src/components/form-designer/form-widget/container-widget/vf-collapse-widget.vue4.js +2 -0
  7. package/src/components/form-designer/form-widget/container-widget/vf-collapse-widget.vue4.js.map +1 -0
  8. package/src/components/form-designer/form-widget/field-widget/code-editor-widget.vue.js +1 -1
  9. package/src/components/form-designer/form-widget/field-widget/code-editor-widget.vue.js.map +1 -1
  10. package/src/components/form-designer/form-widget/field-widget/fieldMixin.js.map +1 -1
  11. package/src/components/form-designer/form-widget/field-widget/index.js +1 -1
  12. package/src/components/form-designer/form-widget/field-widget/index.js.map +1 -1
  13. package/src/components/form-designer/form-widget/field-widget/tree-widget.vue.js +124 -0
  14. package/src/components/form-designer/form-widget/field-widget/tree-widget.vue.js.map +1 -0
  15. package/src/components/form-designer/index.vue.js +20 -24
  16. package/src/components/form-designer/index.vue.js.map +1 -1
  17. package/src/components/form-designer/setting-panel/index.vue.js +115 -121
  18. package/src/components/form-designer/setting-panel/index.vue.js.map +1 -1
  19. package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-dsEnabled-editor.vue.js +17 -17
  20. package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-dsEnabled-editor.vue.js.map +1 -1
  21. package/src/components/form-designer/setting-panel/property-editor/event-handler/onCheck-editor.vue.js +50 -0
  22. package/src/components/form-designer/setting-panel/property-editor/event-handler/onCheck-editor.vue.js.map +1 -0
  23. package/src/components/form-designer/setting-panel/property-editor/field-tree/tree-data-editor.vue.js +195 -0
  24. package/src/components/form-designer/setting-panel/property-editor/field-tree/tree-data-editor.vue.js.map +1 -0
  25. package/src/components/form-designer/setting-panel/property-editor/index.js +139 -137
  26. package/src/components/form-designer/setting-panel/property-editor/index.js.map +1 -1
  27. package/src/components/form-designer/setting-panel/propertyRegister.js +2 -0
  28. package/src/components/form-designer/setting-panel/propertyRegister.js.map +1 -1
  29. package/src/components/form-designer/widget-panel/advanced/tree-select.js.map +1 -1
  30. package/src/components/form-designer/widget-panel/advanced/tree.js +44 -0
  31. package/src/components/form-designer/widget-panel/advanced/tree.js.map +1 -0
  32. package/src/components/form-designer/widget-panel/advancedFieldsEnums.js +4 -2
  33. package/src/components/form-designer/widget-panel/advancedFieldsEnums.js.map +1 -1
  34. package/src/components/form-render/container-item/vf-collapse-item.vue.js +2 -2
  35. package/src/components/form-render/container-item/vf-collapse-item.vue.js.map +1 -1
  36. package/src/components/form-render/dynamic-dialog.vue.js +95 -105
  37. package/src/components/form-render/dynamic-dialog.vue.js.map +1 -1
  38. package/src/components/form-render/index.vue.js +60 -60
  39. package/src/components/form-render/index.vue.js.map +1 -1
  40. package/src/components/public/CustomerModal/CustomerModal.vue2.js +16 -15
  41. package/src/components/public/CustomerModal/CustomerModal.vue2.js.map +1 -1
  42. package/src/lang/zh-CN.js +1 -0
  43. package/src/lang/zh-CN.js.map +1 -1
  44. package/src/utils/executeFunction.js +20 -16
  45. package/src/utils/executeFunction.js.map +1 -1
  46. package/stats.html +1 -1
  47. package/styles/style.css +1 -1
  48. package/src/components/TpfCollapse/TpfCollapseTitle.vue.js +0 -8
  49. package/src/components/TpfCollapse/TpfCollapseTitle.vue.js.map +0 -1
  50. package/src/components/TpfCollapse/TpfCollapseTitle.vue2.js +0 -18
  51. package/src/components/TpfCollapse/TpfCollapseTitle.vue2.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"advancedFieldsEnums.js","sources":["../../../../../src/components/form-designer/widget-panel/advancedFieldsEnums.ts"],"sourcesContent":["import { cascader } from './advanced/cascader';\nimport { treeSelect } from './advanced/tree-select';\nimport { codeEditor } from './advanced/code-editor';\nimport { richEditor } from './advanced/rich-editor';\nimport { fileUpload } from './advanced/file-upload';\nimport { bpmnEditor } from './advanced/bpmn-editor';\n// import { slot } from './advanced/slot';\nimport { diyCompontent } from './advanced/diy-compontent';\n\nexport const advancedFieldsEnums = {\n // slot,\n diyCompontent,\n cascader,\n treeSelect,\n richEditor,\n codeEditor,\n fileUpload,\n bpmnEditor\n};\n"],"names":["advancedFieldsEnums","diyCompontent","cascader","treeSelect","richEditor","codeEditor","fileUpload","bpmnEditor"],"mappings":";;;;;;;AASO,MAAMA,IAAsB;AAAA;AAAA,EAE/B,eAAAC;AAAA,EACA,UAAAC;AAAA,EACA,YAAAC;AAAA,EACA,YAAAC;AAAA,EACA,YAAAC;AAAA,EACA,YAAAC;AAAA,EACA,YAAAC;AACJ;"}
1
+ {"version":3,"file":"advancedFieldsEnums.js","sources":["../../../../../src/components/form-designer/widget-panel/advancedFieldsEnums.ts"],"sourcesContent":["import { cascader } from './advanced/cascader';\nimport { treeSelect } from './advanced/tree-select';\nimport { codeEditor } from './advanced/code-editor';\nimport { richEditor } from './advanced/rich-editor';\nimport { fileUpload } from './advanced/file-upload';\nimport { bpmnEditor } from './advanced/bpmn-editor';\n// import { slot } from './advanced/slot';\nimport { diyCompontent } from './advanced/diy-compontent';\nimport { tree } from './advanced/tree';\n\nexport const advancedFieldsEnums = {\n // slot,\n diyCompontent,\n cascader,\n tree,\n treeSelect,\n richEditor,\n codeEditor,\n fileUpload,\n bpmnEditor\n};\n"],"names":["advancedFieldsEnums","diyCompontent","cascader","tree","treeSelect","richEditor","codeEditor","fileUpload","bpmnEditor"],"mappings":";;;;;;;;AAUO,MAAMA,IAAsB;AAAA;AAAA,EAE/B,eAAAC;AAAA,EACA,UAAAC;AAAA,EACA,MAAAC;AAAA,EACA,YAAAC;AAAA,EACA,YAAAC;AAAA,EACA,YAAAC;AAAA,EACA,YAAAC;AAAA,EACA,YAAAC;AACJ;"}
@@ -5,7 +5,7 @@ import M from "../../../utils/i18n.js";
5
5
  import T from "../../form-designer/form-widget/field-widget/index.js";
6
6
  import B from "../refMixin.js";
7
7
  import V from "./containerItemMixin.js";
8
- import z from "../../TpfCollapse/TpfCollapseTitle.vue.js";
8
+ import { TpfCollapseTitle as z } from "tmgc2-share";
9
9
  import J from "../../svg-icon/index.vue.js";
10
10
  /* empty css */
11
11
  /* empty css */
@@ -246,7 +246,7 @@ function G(t, _, e, Q, U, b) {
246
246
  [O, !e.widget.options.hidden]
247
247
  ]);
248
248
  }
249
- const re = /* @__PURE__ */ A(E, [["render", G], ["__scopeId", "data-v-fe658f37"]]);
249
+ const re = /* @__PURE__ */ A(E, [["render", G], ["__scopeId", "data-v-dd25bb5f"]]);
250
250
  export {
251
251
  re as default
252
252
  };
@@ -1 +1 @@
1
- {"version":3,"file":"vf-collapse-item.vue.js","sources":["../../../../../src/components/form-render/container-item/vf-collapse-item.vue"],"sourcesContent":["<template>\n <container-item-wrapper v-show=\"!widget.options.hidden\" :widget=\"widget\">\n <div class=\"tpf-collapse\">\n <div class=\"tpf-collapse-header\">\n <a-space :size=\"5\">\n <TpfCollapseTitle :title=\"widget.options.title\" />\n <SvgIcon\n :icon-class=\"\n widget.options.isCollapse\n ? widget.options.collapseIcon\n : widget.options.unCollapseIcon\n \"\n size=\"24px\"\n shadow\n cursor\n @click=\"toggleCollapse\"\n />\n </a-space>\n <div :class=\"['header-right', rightSlotCss]\" v-if=\"!widget.options.isCollapse\">\n <template\n v-if=\"!!widget.headerRightSlotList && widget.headerRightSlotList.length > 0\"\n >\n <template v-for=\"(subWidget, swIdx) in widget.headerRightSlotList\">\n <template v-if=\"'container' === subWidget.category\">\n <component\n :is=\"getComponentByContainer(subWidget)\"\n :widget=\"subWidget\"\n :key=\"swIdx\"\n :parent-list=\"widget.headerRightSlotList\"\n :index-of-parent-list=\"swIdx\"\n :parent-widget=\"widget\"\n :sub-form-row-id=\"subFormRowId\"\n :sub-form-row-index=\"subFormRowIndex\"\n :sub-form-col-index=\"subFormColIndex\"\n :data=\"model[widget.options.name]\"\n >\n <!-- 递归传递插槽!!! -->\n <template\n v-for=\"slot in Object.keys($slots)\"\n v-slot:[slot]=\"scope\"\n >\n <slot :name=\"slot\" v-bind=\"scope\"></slot>\n </template>\n </component>\n </template>\n <template v-else>\n <component\n :is=\"subWidget.type + '-widget'\"\n :field=\"subWidget\"\n :designer=\"null\"\n :key=\"swIdx\"\n :parent-list=\"widget.headerRightSlotList\"\n :index-of-parent-list=\"swIdx\"\n :parent-widget=\"widget\"\n >\n <!-- 递归传递插槽!!! -->\n <template\n v-for=\"slot in Object.keys($slots)\"\n v-slot:[slot]=\"scope\"\n >\n <slot :name=\"slot\" v-bind=\"scope\"></slot>\n </template>\n </component>\n </template>\n </template>\n </template>\n </div>\n </div>\n <Transition\n mode=\"out-in\"\n appear\n enter-active-class=\"animate__animated animate__fadeIn animate__faster\"\n leave-active-class=\"animate__animated animate__fadeOut animate__faster\"\n >\n <div\n :class=\"['tpf-collapse-content']\"\n :style=\"{\n height: widget.options.height || 'unset',\n ...JSON.parse(widget.options.bodyStyle || '{}')\n }\"\n v-show=\"!widget.options.isCollapse\"\n >\n <template\n v-if=\"!!widget.defaultSlotsList && widget.defaultSlotsList.length > 0\"\n >\n <template v-for=\"(subWidget, swIdx) in widget.defaultSlotsList\">\n <template v-if=\"'container' === subWidget.category\">\n <component\n :is=\"getComponentByContainer(subWidget)\"\n :widget=\"subWidget\"\n :key=\"swIdx\"\n :parent-list=\"widget.defaultSlotsList\"\n :index-of-parent-list=\"swIdx\"\n :parent-widget=\"widget\"\n :sub-form-row-id=\"subFormRowId\"\n :sub-form-row-index=\"subFormRowIndex\"\n :sub-form-col-index=\"subFormColIndex\"\n :data=\"model[subWidget.options.name]\"\n :model=\"model\"\n >\n <!-- 递归传递插槽!!! -->\n <template\n v-for=\"slot in Object.keys($slots)\"\n v-slot:[slot]=\"scope\"\n >\n <slot :name=\"slot\" v-bind=\"scope\"></slot>\n </template>\n </component>\n </template>\n <template v-else>\n <component\n :is=\"subWidget.type + '-widget'\"\n :field=\"subWidget\"\n :designer=\"null\"\n :key=\"swIdx\"\n :parent-list=\"widget.defaultSlotsList\"\n :index-of-parent-list=\"swIdx\"\n :parent-widget=\"widget\"\n >\n <!-- 递归传递插槽!!! -->\n <template\n v-for=\"slot in Object.keys($slots)\"\n v-slot:[slot]=\"scope\"\n >\n <slot :name=\"slot\" v-bind=\"scope\"></slot>\n </template>\n </component>\n </template>\n </template>\n </template>\n </div>\n </Transition>\n </div>\n </container-item-wrapper>\n</template>\n\n<script>\n import ContainerItemWrapper from '@/components/form-render/container-item/container-item-wrapper.vue';\n import emitter from '@/utils/emitter';\n import { defineAsyncComponent } from 'vue';\n\n import i18n from '@/utils/i18n';\n\n import FieldComponents from '@/components/form-designer/form-widget/field-widget/index';\n import refMixin from '@/components/form-render/refMixin';\n import containerItemMixin from '@/components/form-render/container-item/containerItemMixin';\n import TpfCollapseTitle from '@/components/TpfCollapse/TpfCollapseTitle.vue';\n import SvgIcon from '@/components/svg-icon/index.vue';\n export default {\n name: 'VfCollapseItem',\n componentName: 'ContainerItem', // 必须固定为ContainerItem,用于接收父级组件的broadcast事件\n mixins: [emitter, i18n, refMixin, containerItemMixin],\n components: {\n ContainerItemWrapper,\n TpfCollapseTitle,\n SvgIcon,\n ...FieldComponents,\n VFormRender: defineAsyncComponent(() => import('@/components/form-render/index.vue'))\n },\n props: {\n widget: Object,\n parentWidget: Object,\n parentList: Array,\n indexOfParentList: Number,\n model: {\n type: Object,\n default: () => ({})\n },\n subFormRowIndex: {\n /* 子表单组件行索引,从0开始计数 */ type: Number,\n default: -1\n },\n subFormColIndex: {\n /* 子表单组件列索引,从0开始计数 */ type: Number,\n default: -1\n },\n subFormRowId: {\n /* 子表单组件行Id,唯一id且不可变 */ type: String,\n default: ''\n },\n formJson: {\n type: Object\n },\n formData: {\n type: Object,\n default: () => ({})\n },\n optionData: {\n //prop传入的选项数据\n type: Object,\n default: () => ({})\n },\n globalDsv: {\n // 全局数据源变量\n type: Object,\n default: () => ({})\n },\n parentFormRef: {\n type: Object,\n default: null\n },\n extraData: {\n type: Object,\n default: () => ({})\n },\n wrapperId: {\n type: String,\n default: null\n }\n },\n inject: ['refList', 'sfRefList', 'globalModel', 'getFormConfig', 'getGlobalDsv'],\n data() {\n return {};\n },\n computed: {\n rightSlotCss() {\n return this.widget.options.rightSlotCss || '';\n },\n formConfig() {\n return this.getFormConfig();\n }\n },\n created() {\n this.initRefList();\n this.handleOnCreated();\n },\n mounted() {\n this.loadFormCode(this.widget.options.formCode);\n this.$nextTick(() => {\n this.handleOnMounted();\n });\n },\n beforeUnmount() {\n this.unregisterFromRefList();\n },\n methods: {\n toggleCollapse() {\n this.widget.options.isCollapse = !this.widget.options.isCollapse;\n },\n async loadFormCode(formCode) {\n if (formCode) {\n const res = await this.$http\n .get(`/api/tmgc2-query/dataQuery/detail/FormDefinitionManagement`, {\n params: { code: formCode }\n })\n .then(res => res.data.object.frontendDefinition || '{}');\n this.$refs.dFormRef.setFormJson(JSON.parse(res));\n }\n },\n\n handleOnCreated() {\n if (!!this.widget.options.onCreated) {\n const customFunc = new Function(this.widget.options.onCreated);\n customFunc.call(this);\n }\n },\n\n handleOnMounted() {\n if (!!this.widget.options.onMounted) {\n const customFunc = new Function(this.widget.options.onMounted);\n customFunc.call(this);\n }\n },\n getFormRef() {\n return this.$refs.dFormRef;\n }\n }\n };\n</script>\n\n<style lang=\"scss\" scoped>\n .collapse-container {\n margin: 2px;\n\n .form-widget-list {\n min-height: 28px;\n }\n }\n</style>\n\n<style scoped>\n :deep(.ant-table) .table-striped td {\n background-color: #fafafa;\n }\n</style>\n\n<style lang=\"less\" scoped>\n .tpf-collapse {\n width: 100%;\n background-color: transparent;\n box-sizing: border-box;\n\n .tpf-collapse-header {\n padding: 10px 0;\n box-sizing: border-box;\n display: flex;\n height: 50px;\n justify-content: space-between;\n background-color: #f7f8fa;\n .header-right {\n margin-right: 10px;\n }\n }\n\n .tpf-collapse-content {\n overflow: hidden;\n background-color: #fff;\n border-radius: 6px;\n min-height: 200px;\n padding: 10px 12px;\n\n :deep(.ant-card-bordered) {\n border-color: transparent;\n }\n }\n }\n</style>\n"],"names":["_sfc_main","emitter","i18n","refMixin","containerItemMixin","ContainerItemWrapper","TpfCollapseTitle","SvgIcon","FieldComponents","defineAsyncComponent","formCode","res","_hoisted_1","_hoisted_2","_createBlock","_component_container_item_wrapper","$props","_createElementVNode","_createVNode","_component_a_space","_component_TpfCollapseTitle","_component_SvgIcon","$options","_createElementBlock","_openBlock","_Fragment","subWidget","swIdx","_resolveDynamicComponent","_ctx","_renderList","slot","_withCtx","scope","_renderSlot","_mergeProps","_Transition","_normalizeStyle"],"mappings":";;;;;;;;;;;;;AAoJI,MAAKA,IAAU;AAAA,EACX,MAAM;AAAA,EACN,eAAe;AAAA;AAAA,EACf,QAAQ,CAACC,GAASC,GAAMC,GAAUC,CAAkB;AAAA,EACpD,YAAY;AAAA,IACR,sBAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,SAAAC;AAAA,IACA,GAAGC;AAAAA,IACH,aAAaC,EAAqB,MAAM,OAAO,iBAAoC,CAAC;AAAA;EAExF,OAAO;AAAA,IACH,QAAQ;AAAA,IACR,cAAc;AAAA,IACd,YAAY;AAAA,IACZ,mBAAmB;AAAA,IACnB,OAAO;AAAA,MACH,MAAM;AAAA,MACN,SAAS,OAAO,CAAA;AAAA;IAEpB,iBAAiB;AAAA;AAAA,MACS,MAAM;AAAA,MAC5B,SAAS;AAAA;IAEb,iBAAiB;AAAA;AAAA,MACS,MAAM;AAAA,MAC5B,SAAS;AAAA;IAEb,cAAc;AAAA;AAAA,MACc,MAAM;AAAA,MAC9B,SAAS;AAAA;IAEb,UAAU;AAAA,MACN,MAAM;AAAA;IAEV,UAAU;AAAA,MACN,MAAM;AAAA,MACN,SAAS,OAAO,CAAA;AAAA;I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5CU,GAAWC;gBACOD,EAAU,aAAV,oBAC5BZ,EAoBYc,EAnBHC,EAAA,wBAAwBH,CAAS,CAAA,GAAA;AAAA,kBACrC,QAAQA;AAAA,kBACR,KAAKC;AAAA,kBACL,eAAaX,EAAA,OAAO;AAAA,kBACpB,wBAAsBW;AAAA,kBACtB,iBAAeX,EAAA;AAAA,kBACf,mBAAiBA,EAAA;AAAA,kBACjB,sBAAoBA,EAAA;AAAA,kBACpB,sBAAoBA,EAAA;AAAA,kBACpB,MAAMA,EAAA,MAAMU,EAAU,QAAQ,IAAI;AAAA,kBAClC,OAAOV,EAAA;AAAA;kBAIWc,EAAA,OAAO,KAAKD,EAAA,MAAM,IAA1BE;0BACAA;AAAA,oBAEP,IAAAC,EAAA,CAAyCC,MAFrB;AAAA,sBAEpBC,EAAyCL,EAAA,QAA5BE,GAAbI,EAAyC,iBAAdF,CAAK,GAAA,QAAA,EAAA;AAAA;;uLAKxCnB,EAgBYc,EAfHF,EAAU,OAAI,SAAA,GAAA;AAAA,kBAClB,OAAOA;AAAA,kBACP,UAAU;AAAA,kBACV,KAAKC;AAAA,kBACL,eAAaX,EAAA,OAAO;AAAA,kBACpB,wBAAsBW;AAAA,kBACtB,iBAAeX,EAAA;AAAA;kBAIGc,EAAA,OAAO,KAAKD,EAAA,MAAM,IAA1BE;0BACAA;AAAA,oBAEP,IAAAC,EAAA,CAAyCC,MAFrB;AAAA,sBAEpBC,EAAyCL,EAAA,QAA5BE,GAAbI,EAAyC,iBAAdF,CAAK,GAAA,QAAA,EAAA;AAAA;;;;;mBA5C3CjB,EAAA,OAAO,QAAQ,UAAU;AAAA;;;;;;;;SA/EjBA,EAAA,OAAO,QAAQ,MAAM;AAAA;;;"}
1
+ {"version":3,"file":"vf-collapse-item.vue.js","sources":["../../../../../src/components/form-render/container-item/vf-collapse-item.vue"],"sourcesContent":["<template>\n <container-item-wrapper v-show=\"!widget.options.hidden\" :widget=\"widget\">\n <div class=\"tpf-collapse\">\n <div class=\"tpf-collapse-header\">\n <a-space :size=\"5\">\n <TpfCollapseTitle :title=\"widget.options.title\" />\n <SvgIcon\n :icon-class=\"\n widget.options.isCollapse\n ? widget.options.collapseIcon\n : widget.options.unCollapseIcon\n \"\n size=\"24px\"\n shadow\n cursor\n @click=\"toggleCollapse\"\n />\n </a-space>\n <div :class=\"['header-right', rightSlotCss]\" v-if=\"!widget.options.isCollapse\">\n <template\n v-if=\"!!widget.headerRightSlotList && widget.headerRightSlotList.length > 0\"\n >\n <template v-for=\"(subWidget, swIdx) in widget.headerRightSlotList\">\n <template v-if=\"'container' === subWidget.category\">\n <component\n :is=\"getComponentByContainer(subWidget)\"\n :widget=\"subWidget\"\n :key=\"swIdx\"\n :parent-list=\"widget.headerRightSlotList\"\n :index-of-parent-list=\"swIdx\"\n :parent-widget=\"widget\"\n :sub-form-row-id=\"subFormRowId\"\n :sub-form-row-index=\"subFormRowIndex\"\n :sub-form-col-index=\"subFormColIndex\"\n :data=\"model[widget.options.name]\"\n >\n <!-- 递归传递插槽!!! -->\n <template\n v-for=\"slot in Object.keys($slots)\"\n v-slot:[slot]=\"scope\"\n >\n <slot :name=\"slot\" v-bind=\"scope\"></slot>\n </template>\n </component>\n </template>\n <template v-else>\n <component\n :is=\"subWidget.type + '-widget'\"\n :field=\"subWidget\"\n :designer=\"null\"\n :key=\"swIdx\"\n :parent-list=\"widget.headerRightSlotList\"\n :index-of-parent-list=\"swIdx\"\n :parent-widget=\"widget\"\n >\n <!-- 递归传递插槽!!! -->\n <template\n v-for=\"slot in Object.keys($slots)\"\n v-slot:[slot]=\"scope\"\n >\n <slot :name=\"slot\" v-bind=\"scope\"></slot>\n </template>\n </component>\n </template>\n </template>\n </template>\n </div>\n </div>\n <Transition\n mode=\"out-in\"\n appear\n enter-active-class=\"animate__animated animate__fadeIn animate__faster\"\n leave-active-class=\"animate__animated animate__fadeOut animate__faster\"\n >\n <div\n :class=\"['tpf-collapse-content']\"\n :style=\"{\n height: widget.options.height || 'unset',\n ...JSON.parse(widget.options.bodyStyle || '{}')\n }\"\n v-show=\"!widget.options.isCollapse\"\n >\n <template\n v-if=\"!!widget.defaultSlotsList && widget.defaultSlotsList.length > 0\"\n >\n <template v-for=\"(subWidget, swIdx) in widget.defaultSlotsList\">\n <template v-if=\"'container' === subWidget.category\">\n <component\n :is=\"getComponentByContainer(subWidget)\"\n :widget=\"subWidget\"\n :key=\"swIdx\"\n :parent-list=\"widget.defaultSlotsList\"\n :index-of-parent-list=\"swIdx\"\n :parent-widget=\"widget\"\n :sub-form-row-id=\"subFormRowId\"\n :sub-form-row-index=\"subFormRowIndex\"\n :sub-form-col-index=\"subFormColIndex\"\n :data=\"model[subWidget.options.name]\"\n :model=\"model\"\n >\n <!-- 递归传递插槽!!! -->\n <template\n v-for=\"slot in Object.keys($slots)\"\n v-slot:[slot]=\"scope\"\n >\n <slot :name=\"slot\" v-bind=\"scope\"></slot>\n </template>\n </component>\n </template>\n <template v-else>\n <component\n :is=\"subWidget.type + '-widget'\"\n :field=\"subWidget\"\n :designer=\"null\"\n :key=\"swIdx\"\n :parent-list=\"widget.defaultSlotsList\"\n :index-of-parent-list=\"swIdx\"\n :parent-widget=\"widget\"\n >\n <!-- 递归传递插槽!!! -->\n <template\n v-for=\"slot in Object.keys($slots)\"\n v-slot:[slot]=\"scope\"\n >\n <slot :name=\"slot\" v-bind=\"scope\"></slot>\n </template>\n </component>\n </template>\n </template>\n </template>\n </div>\n </Transition>\n </div>\n </container-item-wrapper>\n</template>\n\n<script>\n import ContainerItemWrapper from '@/components/form-render/container-item/container-item-wrapper.vue';\n import emitter from '@/utils/emitter';\n import { defineAsyncComponent } from 'vue';\n\n import i18n from '@/utils/i18n';\n\n import FieldComponents from '@/components/form-designer/form-widget/field-widget/index';\n import refMixin from '@/components/form-render/refMixin';\n import containerItemMixin from '@/components/form-render/container-item/containerItemMixin';\n import { TpfCollapseTitle } from 'tmgc2-share';\n import SvgIcon from '@/components/svg-icon/index.vue';\n export default {\n name: 'VfCollapseItem',\n componentName: 'ContainerItem', // 必须固定为ContainerItem,用于接收父级组件的broadcast事件\n mixins: [emitter, i18n, refMixin, containerItemMixin],\n components: {\n ContainerItemWrapper,\n TpfCollapseTitle,\n SvgIcon,\n ...FieldComponents,\n VFormRender: defineAsyncComponent(() => import('@/components/form-render/index.vue'))\n },\n props: {\n widget: Object,\n parentWidget: Object,\n parentList: Array,\n indexOfParentList: Number,\n model: {\n type: Object,\n default: () => ({})\n },\n subFormRowIndex: {\n /* 子表单组件行索引,从0开始计数 */ type: Number,\n default: -1\n },\n subFormColIndex: {\n /* 子表单组件列索引,从0开始计数 */ type: Number,\n default: -1\n },\n subFormRowId: {\n /* 子表单组件行Id,唯一id且不可变 */ type: String,\n default: ''\n },\n formJson: {\n type: Object\n },\n formData: {\n type: Object,\n default: () => ({})\n },\n optionData: {\n //prop传入的选项数据\n type: Object,\n default: () => ({})\n },\n globalDsv: {\n // 全局数据源变量\n type: Object,\n default: () => ({})\n },\n parentFormRef: {\n type: Object,\n default: null\n },\n extraData: {\n type: Object,\n default: () => ({})\n },\n wrapperId: {\n type: String,\n default: null\n }\n },\n inject: ['refList', 'sfRefList', 'globalModel', 'getFormConfig', 'getGlobalDsv'],\n data() {\n return {};\n },\n computed: {\n rightSlotCss() {\n return this.widget.options.rightSlotCss || '';\n },\n formConfig() {\n return this.getFormConfig();\n }\n },\n created() {\n this.initRefList();\n this.handleOnCreated();\n },\n mounted() {\n this.loadFormCode(this.widget.options.formCode);\n this.$nextTick(() => {\n this.handleOnMounted();\n });\n },\n beforeUnmount() {\n this.unregisterFromRefList();\n },\n methods: {\n toggleCollapse() {\n this.widget.options.isCollapse = !this.widget.options.isCollapse;\n },\n async loadFormCode(formCode) {\n if (formCode) {\n const res = await this.$http\n .get(`/api/tmgc2-query/dataQuery/detail/FormDefinitionManagement`, {\n params: { code: formCode }\n })\n .then(res => res.data.object.frontendDefinition || '{}');\n this.$refs.dFormRef.setFormJson(JSON.parse(res));\n }\n },\n\n handleOnCreated() {\n if (!!this.widget.options.onCreated) {\n const customFunc = new Function(this.widget.options.onCreated);\n customFunc.call(this);\n }\n },\n\n handleOnMounted() {\n if (!!this.widget.options.onMounted) {\n const customFunc = new Function(this.widget.options.onMounted);\n customFunc.call(this);\n }\n },\n getFormRef() {\n return this.$refs.dFormRef;\n }\n }\n };\n</script>\n\n<style lang=\"scss\" scoped>\n .collapse-container {\n margin: 2px;\n\n .form-widget-list {\n min-height: 28px;\n }\n }\n</style>\n\n<style scoped>\n :deep(.ant-table) .table-striped td {\n background-color: #fafafa;\n }\n</style>\n\n<style lang=\"less\" scoped>\n .tpf-collapse {\n width: 100%;\n background-color: transparent;\n box-sizing: border-box;\n\n .tpf-collapse-header {\n padding: 10px 0;\n box-sizing: border-box;\n display: flex;\n height: 50px;\n justify-content: space-between;\n background-color: #f7f8fa;\n .header-right {\n margin-right: 10px;\n }\n }\n\n .tpf-collapse-content {\n overflow: hidden;\n background-color: #fff;\n border-radius: 6px;\n min-height: 200px;\n padding: 10px 12px;\n\n :deep(.ant-card-bordered) {\n border-color: transparent;\n }\n }\n }\n</style>\n"],"names":["_sfc_main","emitter","i18n","refMixin","containerItemMixin","ContainerItemWrapper","TpfCollapseTitle","SvgIcon","FieldComponents","defineAsyncComponent","formCode","res","_hoisted_1","_hoisted_2","_createBlock","_component_container_item_wrapper","$props","_createElementVNode","_createVNode","_component_a_space","_component_TpfCollapseTitle","_component_SvgIcon","$options","_createElementBlock","_openBlock","_Fragment","subWidget","swIdx","_resolveDynamicComponent","_ctx","_renderList","slot","_withCtx","scope","_renderSlot","_mergeProps","_Transition","_normalizeStyle"],"mappings":";;;;;;;;;;;;;AAoJI,MAAKA,IAAU;AAAA,EACX,MAAM;AAAA,EACN,eAAe;AAAA;AAAA,EACf,QAAQ,CAACC,GAASC,GAAMC,GAAUC,CAAkB;AAAA,EACpD,YAAY;AAAA,IACR,sBAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,SAAAC;AAAA,IACA,GAAGC;AAAAA,IACH,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BACtB,iBAAeX,EAAA;AAAA;kBAIGc,EAAA,OAAO,KAAKD,EAAA,MAAM,IAA1BE;0BACAA;AAAA,oBAEP,IAAAC,EAAA,CAAyCC,MAFrB;AAAA,sBAEpBC,EAAyCL,EAAA,QAA5BE,GAAbI,EAAyC,iBAAdF,CAAK,GAAA,QAAA,EAAA;AAAA;;;;;mBA5C3CjB,EAAA,OAAO,QAAQ,UAAU;AAAA;;;;;;;;SA/EjBA,EAAA,OAAO,QAAQ,MAAM;AAAA;;;"}
@@ -1,7 +1,7 @@
1
- import { defineComponent as N, defineAsyncComponent as E, ref as C, getCurrentInstance as M, computed as R, onBeforeUnmount as S, resolveDirective as I, createBlock as L, openBlock as D, unref as c, withCtx as m, createVNode as p, mergeProps as P, withDirectives as V, createElementBlock as W, nextTick as U } from "vue";
2
- import { useComRef as A, TpfConfigProvider as H, TpfModal as q, http as z } from "tmgc2-share";
1
+ import { defineComponent as T, defineAsyncComponent as E, ref as b, getCurrentInstance as S, computed as F, onBeforeUnmount as L, resolveDirective as V, createBlock as I, openBlock as y, unref as f, mergeProps as N, withCtx as C, withDirectives as P, createElementBlock as U, createVNode as R, nextTick as W } from "vue";
2
+ import { useComRef as A, TpfModal as H, http as q } from "tmgc2-share";
3
3
  import Q from "./SubmitButtonRender.vue.js";
4
- const $ = { class: "dialog-content" }, oe = /* @__PURE__ */ N({
4
+ const $ = { class: "dialog-content" }, ee = /* @__PURE__ */ T({
5
5
  name: "dynamic-dialog",
6
6
  __name: "dynamic-dialog",
7
7
  props: {
@@ -43,132 +43,122 @@ const $ = { class: "dialog-content" }, oe = /* @__PURE__ */ N({
43
43
  default: null
44
44
  }
45
45
  },
46
- setup(t, { expose: h }) {
47
- const g = E(() => import("./index.vue.js")), o = t, r = C(!1), a = C(!1), l = A(g), i = M(), x = R(() => ({
46
+ setup(n, { expose: D }) {
47
+ const u = E(() => import("./index.vue.js")), o = n, i = b(!1), l = b(!1), a = A(u), d = S(), h = F(() => ({
48
48
  ...o.parentFormRef,
49
- parentDom: i,
50
- getParentFormRef: y
51
- })), O = R(() => o.options.cancelButtonHidden && o.options.okButtonHidden ? { footer: null } : {});
52
- S(() => {
53
- console.log(o.parentFormRef), o.parentFormRef.setChildFormRef(null);
49
+ parentDom: d,
50
+ getParentFormRef: v
51
+ })), x = F(() => o.options.cancelButtonHidden && o.options.okButtonHidden ? { footer: null } : {});
52
+ L(() => {
53
+ var e, t;
54
+ console.log(o.parentFormRef), (t = (e = o.parentFormRef) == null ? void 0 : e.setChildFormRef) == null || t.call(e, null);
54
55
  });
55
- const v = async () => {
56
+ const m = async () => {
57
+ var e, t;
56
58
  if (o.options.formCode) {
57
- r.value = !0;
59
+ i.value = !0;
58
60
  try {
59
- const e = await z.get("/api/tmgc2-query/dataQuery/detail/FormDefinitionManagement", {
61
+ const s = await q.get("/api/tmgc2-query/dataQuery/detail/FormDefinitionManagement", {
60
62
  params: { code: o.options.formCode }
61
- }).then((s) => s.data.object.frontendDefinition || "{}"), n = JSON.parse(e);
62
- console.log("formJson: ", n), l.value.setFormJson(n);
63
+ }).then((M) => M.data.object.frontendDefinition || "{}"), r = JSON.parse(s);
64
+ console.log("formJson: ", r), (t = (e = a.value) == null ? void 0 : e.setFormJson) == null || t.call(e, r);
63
65
  } catch {
64
66
  }
65
- r.value = !1;
67
+ i.value = !1;
66
68
  }
69
+ }, O = (e) => {
70
+ console.log("setLoading", e), i.value = e;
67
71
  }, w = (e) => {
68
- console.log("setLoading", e), r.value = e;
72
+ a.value.setFormJson(e);
69
73
  }, k = (e) => {
70
- l.value.setFormJson(e);
71
- }, B = (e) => {
72
74
  o.options.title = e;
73
- }, T = () => {
74
- a.value = !0;
75
75
  }, j = () => {
76
- a.value = !0, U(() => {
76
+ l.value = !0;
77
+ }, B = () => {
78
+ l.value = !0, W(() => {
77
79
  var e;
78
- o.options.readMode && l.value.setReadMode(!0), v(), console.log(l.value), (e = l.value) == null || e.setDialogOrDrawerRef(i), o.parentFormRef && o.parentFormRef.setChildFormRef(l.value), F();
80
+ o.options.readMode && a.value.setReadMode(!0), m(), console.log(a.value), (e = a.value) == null || e.setDialogOrDrawerRef(d), o.parentFormRef && o.parentFormRef.setChildFormRef(a.value), g();
79
81
  });
80
82
  }, J = () => {
81
- o.options.onDialogBeforeClose && new Function("done", o.options.onDialogBeforeClose).call(i) === !1 || (a.value = !1, setTimeout(d, 150));
82
- }, d = () => {
83
- const e = document.getElementById("vf-dynamic-dialog-wrapper" + o.wrapperId);
84
- e && document.body.removeChild(e);
85
- }, f = () => o.options.onDialogBeforeClose ? new Function(o.options.onDialogBeforeClose).call(i) : !0, b = () => {
86
- f() && (a.value = !1, setTimeout(d, 150));
87
- }, F = () => {
88
- o.options.onDialogOpened && new Function(o.options.onDialogOpened).call(i);
89
- }, y = () => o.parentFormRef;
90
- return h({
91
- loadFormCode: v,
92
- setLoading: w,
93
- setFormJson: k,
94
- setTitle: B,
95
- beforeOpen: T,
96
- show: j,
83
+ o.options.onDialogBeforeClose && new Function("done", o.options.onDialogBeforeClose).call(d) === !1 || (l.value = !1);
84
+ }, c = () => o.options.onDialogBeforeClose ? new Function(o.options.onDialogBeforeClose).call(d) : !0, p = () => {
85
+ c() && (l.value = !1);
86
+ }, g = () => {
87
+ o.options.onDialogOpened && new Function(o.options.onDialogOpened).call(d);
88
+ }, v = () => o.parentFormRef;
89
+ return D({
90
+ loadFormCode: m,
91
+ setLoading: O,
92
+ setFormJson: w,
93
+ setTitle: k,
94
+ beforeOpen: j,
95
+ show: B,
97
96
  close: J,
98
- deleteWrapperNode: d,
99
- handleBeforeClose: f,
100
- handleCloseEvent: b,
101
- handleOpenedEvent: F,
102
- getParentFormRef: y,
103
- getFormRef: () => (console.log("getFormRef"), l.value),
104
- getWidgetRef: (e, n = !1) => l.value.getWidgetRef(e, n),
97
+ handleBeforeClose: c,
98
+ handleCloseEvent: p,
99
+ handleOpenedEvent: g,
100
+ getParentFormRef: v,
101
+ getFormRef: () => (console.log("getFormRef"), a.value),
102
+ getWidgetRef: (e, t = !1) => a.value.getWidgetRef(e, t),
105
103
  updateTable: () => {
106
- var e, n, s;
107
- (s = (n = (e = o.vfCtx) == null ? void 0 : e.parent) == null ? void 0 : n.exposed) != null && s.updateTable && o.vfCtx.parent.exposed.updateTable();
104
+ var e, t, s;
105
+ (s = (t = (e = o.vfCtx) == null ? void 0 : e.parent) == null ? void 0 : t.exposed) != null && s.updateTable && o.vfCtx.parent.exposed.updateTable();
108
106
  },
109
107
  getExtraData: () => o.extraData
110
- }), (e, n) => {
111
- const s = I("loading");
112
- return D(), L(c(H), null, {
113
- default: m(() => [
114
- p(c(q), P({
115
- class: "tpf-model design-model",
116
- transitionName: a.value ? "zoom" : "",
117
- maskTransitionName: a.value ? "fade" : "",
118
- destroyOnClose: !0,
119
- title: t.options.title,
120
- bodyStyle: {
121
- height: t.options.height,
122
- overflow: "auto",
123
- ...JSON.parse(t.options.bodyStyle || "{}")
124
- },
125
- centered: !0,
126
- visible: a.value,
127
- "onUpdate:visible": n[1] || (n[1] = (u) => a.value = u),
128
- width: t.options.width,
129
- mask: t.options.showModal,
130
- maskClosable: t.options.closeOnClickModal,
131
- keyboard: t.options.closeOnPressEscape,
132
- onCancel: b
133
- }, O.value), {
134
- footerRight: m(() => [
135
- p(Q, {
136
- "dialog-visible": a.value,
137
- "onUpdate:dialogVisible": n[0] || (n[0] = (u) => a.value = u),
138
- handleBeforeClose: f,
139
- deleteWrapperNode: d,
140
- options: t.options,
141
- ctx: c(l)
142
- }, null, 8, ["dialog-visible", "options", "ctx"])
143
- ]),
144
- default: m(() => [
145
- V((D(), W("div", $, [
146
- p(c(g), {
147
- isLoading: r.value,
148
- ref_key: "dFormRef",
149
- ref: l,
150
- "form-json": t.formJson,
151
- "form-data": t.formData,
152
- vfCtx: t.vfCtx,
153
- "option-data": t.optionData,
154
- "global-dsv": t.globalDsv,
155
- "parent-form": x.value,
156
- "disabled-mode": t.options.disabledMode,
157
- "dynamic-creation": !0
158
- }, null, 8, ["isLoading", "form-json", "form-data", "vfCtx", "option-data", "global-dsv", "parent-form", "disabled-mode"])
159
- ])), [
160
- [s, r.value]
161
- ])
162
- ]),
163
- _: 1
164
- }, 16, ["transitionName", "maskTransitionName", "title", "bodyStyle", "visible", "width", "mask", "maskClosable", "keyboard"])
108
+ }), (e, t) => {
109
+ const s = V("loading");
110
+ return y(), I(f(H), N({
111
+ class: "tpf-model design-model",
112
+ destroyOnClose: !0,
113
+ title: n.options.title,
114
+ bodyStyle: {
115
+ height: n.options.height,
116
+ overflow: "auto",
117
+ ...JSON.parse(n.options.bodyStyle || "{}")
118
+ },
119
+ centered: !0,
120
+ visible: l.value,
121
+ "onUpdate:visible": t[1] || (t[1] = (r) => l.value = r),
122
+ width: n.options.width,
123
+ mask: n.options.showModal,
124
+ maskClosable: n.options.closeOnClickModal,
125
+ keyboard: n.options.closeOnPressEscape,
126
+ onCancel: p
127
+ }, x.value), {
128
+ footerRight: C(() => [
129
+ R(Q, {
130
+ "dialog-visible": l.value,
131
+ "onUpdate:dialogVisible": t[0] || (t[0] = (r) => l.value = r),
132
+ handleBeforeClose: c,
133
+ options: n.options,
134
+ ctx: f(a)
135
+ }, null, 8, ["dialog-visible", "options", "ctx"])
136
+ ]),
137
+ default: C(() => [
138
+ P((y(), U("div", $, [
139
+ R(f(u), {
140
+ isLoading: i.value,
141
+ ref_key: "dFormRef",
142
+ ref: a,
143
+ "form-json": n.formJson,
144
+ "form-data": n.formData,
145
+ vfCtx: n.vfCtx,
146
+ "option-data": n.optionData,
147
+ "global-dsv": n.globalDsv,
148
+ "parent-form": h.value,
149
+ "disabled-mode": n.options.disabledMode,
150
+ "dynamic-creation": !0
151
+ }, null, 8, ["isLoading", "form-json", "form-data", "vfCtx", "option-data", "global-dsv", "parent-form", "disabled-mode"])
152
+ ])), [
153
+ [s, i.value]
154
+ ])
165
155
  ]),
166
156
  _: 1
167
- });
157
+ }, 16, ["title", "bodyStyle", "visible", "width", "mask", "maskClosable", "keyboard"]);
168
158
  };
169
159
  }
170
160
  });
171
161
  export {
172
- oe as default
162
+ ee as default
173
163
  };
174
164
  //# sourceMappingURL=dynamic-dialog.vue.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dynamic-dialog.vue.js","sources":["../../../../src/components/form-render/dynamic-dialog.vue"],"sourcesContent":["<template>\n <TpfConfigProvider>\n <TpfModal\n class=\"tpf-model design-model\"\n :transitionName=\"!dialogVisible ? '' : 'zoom'\"\n :maskTransitionName=\"!dialogVisible ? '' : 'fade'\"\n :destroyOnClose=\"true\"\n :title=\"options.title\"\n :bodyStyle=\"{\n height: options.height,\n overflow: 'auto',\n ...JSON.parse(options.bodyStyle || '{}')\n }\"\n :centered=\"true\"\n v-model:visible=\"dialogVisible\"\n :width=\"options.width\"\n :mask=\"options.showModal\"\n :maskClosable=\"options.closeOnClickModal\"\n :keyboard=\"options.closeOnPressEscape\"\n @cancel=\"handleCloseEvent\"\n v-bind=\"otherAttrs\"\n >\n <div v-loading=\"isLoading\" class=\"dialog-content\">\n <VFormRender\n :isLoading=\"isLoading\"\n ref=\"dFormRef\"\n :form-json=\"formJson\"\n :form-data=\"formData\"\n :vfCtx=\"vfCtx\"\n :option-data=\"optionData\"\n :global-dsv=\"globalDsv\"\n :parent-form=\"parentForm\"\n :disabled-mode=\"options.disabledMode\"\n :dynamic-creation=\"true\"\n />\n </div>\n <template #footerRight>\n <SubmitButtonRender\n v-model:dialog-visible=\"dialogVisible\"\n :handleBeforeClose=\"handleBeforeClose\"\n :deleteWrapperNode=\"deleteWrapperNode\"\n :options=\"options\"\n :ctx=\"dFormRef\"\n />\n </template>\n </TpfModal>\n </TpfConfigProvider>\n</template>\n\n<script lang=\"ts\" setup>\n import {\n ref,\n computed,\n nextTick,\n onBeforeUnmount,\n getCurrentInstance,\n defineAsyncComponent\n } from 'vue';\n import { http, useComRef, TpfModal, TpfConfigProvider } from 'tmgc2-share';\n import SubmitButtonRender from './SubmitButtonRender.vue';\n const VFormRender = defineAsyncComponent(() => import('./index.vue'));\n\n defineOptions({\n name: 'dynamic-dialog'\n });\n\n const props = defineProps({\n options: {\n type: Object,\n default: () => ({})\n },\n formJson: {\n type: Object\n },\n formData: {\n type: Object,\n default: () => ({})\n },\n vfCtx: {\n type: Object,\n default: () => ({})\n },\n optionData: {\n //prop传入的选项数据\n type: Object,\n default: () => ({})\n },\n globalDsv: {\n // 全局数据源变量\n type: Object,\n default: () => ({})\n },\n parentFormRef: {\n type: Object,\n default: null\n },\n extraData: {\n type: Object,\n default: () => ({})\n },\n wrapperId: {\n type: String,\n default: null\n }\n });\n\n const isLoading = ref(false);\n const dialogVisible = ref(false);\n const dFormRef = useComRef(VFormRender);\n const currentInstance = getCurrentInstance();\n\n // 计算属性\n const parentForm = computed(() => {\n return {\n ...props.parentFormRef,\n parentDom: currentInstance,\n getParentFormRef\n };\n });\n\n const otherAttrs = computed(() => {\n if (props.options.cancelButtonHidden && props.options.okButtonHidden) {\n return { footer: null };\n }\n return {};\n });\n\n // 生命周期钩子\n onBeforeUnmount(() => {\n console.log(props.parentFormRef);\n props.parentFormRef.setChildFormRef(null);\n });\n\n // 方法\n const loadFormCode = async () => {\n if (props.options.formCode) {\n isLoading.value = true;\n try {\n const res = await http\n .get(`/api/tmgc2-query/dataQuery/detail/FormDefinitionManagement`, {\n params: { code: props.options.formCode }\n })\n .then(res => res.data.object.frontendDefinition || '{}');\n const formJson = JSON.parse(res);\n console.log('formJson: ', formJson);\n dFormRef.value.setFormJson(formJson);\n } catch (error) {}\n isLoading.value = false;\n }\n };\n\n const setLoading = status => {\n console.log('setLoading', status);\n isLoading.value = status;\n };\n\n const setFormJson = formJson => {\n dFormRef.value.setFormJson(formJson);\n };\n\n const setTitle = title => {\n props.options.title = title;\n };\n\n const beforeOpen = () => {\n dialogVisible.value = true;\n };\n\n const show = () => {\n dialogVisible.value = true;\n\n //设置readMode模式\n nextTick(() => {\n if (!!props.options.readMode) {\n dFormRef.value.setReadMode(true);\n }\n loadFormCode();\n console.log(dFormRef.value);\n dFormRef.value?.setDialogOrDrawerRef(currentInstance);\n if (props.parentFormRef) {\n props.parentFormRef.setChildFormRef(dFormRef.value);\n }\n handleOpenedEvent();\n });\n };\n\n const close = () => {\n if (!!props.options.onDialogBeforeClose) {\n const customFn = new Function('done', props.options.onDialogBeforeClose);\n const closeResult = customFn.call(currentInstance);\n if (closeResult === false) {\n return;\n }\n }\n\n dialogVisible.value = false;\n setTimeout(deleteWrapperNode, 150);\n };\n\n const deleteWrapperNode = () => {\n const wrapperNode = document.getElementById('vf-dynamic-dialog-wrapper' + props.wrapperId);\n if (!!wrapperNode) {\n document.body.removeChild(wrapperNode);\n }\n };\n\n const handleBeforeClose = () => {\n if (!!props.options.onDialogBeforeClose) {\n const customFn = new Function(props.options.onDialogBeforeClose);\n return customFn.call(currentInstance);\n }\n\n return true;\n };\n\n const handleCloseEvent = () => {\n if (!handleBeforeClose()) return;\n dialogVisible.value = false;\n setTimeout(deleteWrapperNode, 150);\n };\n\n const handleOpenedEvent = () => {\n if (!!props.options.onDialogOpened) {\n const customFn = new Function(props.options.onDialogOpened);\n customFn.call(currentInstance);\n }\n };\n\n const getParentFormRef = () => {\n return props.parentFormRef;\n };\n\n const getFormRef = () => {\n console.log('getFormRef');\n return dFormRef.value;\n };\n\n const getWidgetRef = (widgetName, showError = false) => {\n return dFormRef.value.getWidgetRef(widgetName, showError);\n };\n\n const updateTable = () => {\n if (props.vfCtx?.parent?.exposed?.updateTable) {\n props.vfCtx.parent.exposed.updateTable();\n }\n };\n\n const getExtraData = () => {\n return props.extraData;\n };\n\n // 暴露方法给父组件\n defineExpose({\n loadFormCode,\n setLoading,\n setFormJson,\n setTitle,\n beforeOpen,\n show,\n close,\n deleteWrapperNode,\n handleBeforeClose,\n handleCloseEvent,\n handleOpenedEvent,\n getParentFormRef,\n getFormRef,\n getWidgetRef,\n updateTable,\n getExtraData\n });\n</script>\n\n<style lang=\"less\">\n .dialog-content {\n display: flex;\n flex: 1;\n flex-direction: column;\n }\n</style>\n"],"names":["VFormRender","defineAsyncComponent","props","__props","isLoading","ref","dialogVisible","dFormRef","useComRef","currentInstance","getCurrentInstance","parentForm","computed","getParentFormRef","otherAttrs","onBeforeUnmount","loadFormCode","res","http","formJson","setLoading","status","setFormJson","setTitle","title","beforeOpen","show","nextTick","_a","handleOpenedEvent","close","deleteWrapperNode","wrapperNode","handleBeforeClose","handleCloseEvent","__expose","widgetName","showError","_c","_b","_createBlock","_unref","TpfConfigProvider","_createVNode","_mergeProps","$event","SubmitButtonRender","_withDirectives","_openBlock","_createElementBlock","_hoisted_1"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4DI,UAAMA,IAAcC,EAAqB,MAAM,OAAO,gBAAa,CAAC,GAM9DC,IAAQC,GAwCRC,IAAYC,EAAI,EAAK,GACrBC,IAAgBD,EAAI,EAAK,GACzBE,IAAWC,EAAUR,CAAW,GAChCS,IAAkBC,EAAA,GAGlBC,IAAaC,EAAS,OACjB;AAAA,MACH,GAAGV,EAAM;AAAA,MACT,WAAWO;AAAA,MACX,kBAAAI;AAAA,IAAA,EAEP,GAEKC,IAAaF,EAAS,MACpBV,EAAM,QAAQ,sBAAsBA,EAAM,QAAQ,iBAC3C,EAAE,QAAQ,KAAA,IAEd,CAAA,CACV;AAGD,IAAAa,EAAgB,MAAM;AAClB,cAAQ,IAAIb,EAAM,aAAa,GAC/BA,EAAM,cAAc,gBAAgB,IAAI;AAAA,IAC5C,CAAC;AAGD,UAAMc,IAAe,YAAY;AAC7B,UAAId,EAAM,QAAQ,UAAU;AACxB,QAAAE,EAAU,QAAQ;AAClB,YAAI;AACA,gBAAMa,IAAM,MAAMC,EACb,IAAI,8DAA8D;AAAA,YAC/D,QAAQ,EAAE,MAAMhB,EAAM,QAAQ,SAAA;AAAA,UAAS,CAC1C,EACA,KAAK,CAAAe,MAAOA,EAAI,KAAK,OAAO,sBAAsB,IAAI,GACrDE,IAAW,KAAK,MAAMF,CAAG;AAC/B,kBAAQ,IAAI,cAA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ACH,SAASG,EAAA;AAAA,uDAAAA,EAAa,QAAAuC;AAAA,YAC7B,OAAO1C,EAAA,QAAQ;AAAA,YACf,MAAMA,EAAA,QAAQ;AAAA,YACd,cAAcA,EAAA,QAAQ;AAAA,YACtB,UAAUA,EAAA,QAAQ;AAAA,YAClB,UAAQ+B;AAAA,UAAA,GACDpB,EAAA,KAAU,GAAA;AAAA,YAgBP,eACP,MAME;AAAA,cANF6B,EAMEG,GAAA;AAAA,gBALU,kBAAgBxC,EAAA;AAAA,iEAAAA,EAAa,QAAAuC;AAAA,gBACpC,mBAAAZ;AAAA,gBACA,mBAAAF;AAAA,gBACA,SAAS5B,EAAA;AAAA,gBACT,KAAKsC,EAAAlC,CAAA;AAAA,cAAA;;uBApBd,MAaM;AAAA,cAbNwC,GAAAC,EAAA,GAAAC,EAaM,OAbNC,GAaM;AAAA,gBAZFP,EAWEF,EAAAzC,CAAA,GAAA;AAAA,kBAVG,WAAWI,EAAA;AAAA,2BACR;AAAA,kBAAJ,KAAIG;AAAA,kBACH,aAAWJ,EAAA;AAAA,kBACX,aAAWA,EAAA;AAAA,kBACX,OAAOA,EAAA;AAAA,kBACP,eAAaA,EAAA;AAAA,kBACb,cAAYA,EAAA;AAAA,kBACZ,eAAaQ,EAAA;AAAA,kBACb,iBAAeR,EAAA,QAAQ;AAAA,kBACvB,oBAAkB;AAAA,gBAAA;;oBAXXC,EAAA,KAAS;AAAA,cAAA;;;;;;;;;;"}
1
+ {"version":3,"file":"dynamic-dialog.vue.js","sources":["../../../../src/components/form-render/dynamic-dialog.vue"],"sourcesContent":["<template>\n <TpfModal\n class=\"tpf-model design-model\"\n :destroyOnClose=\"true\"\n :title=\"options.title\"\n :bodyStyle=\"{\n height: options.height,\n overflow: 'auto',\n ...JSON.parse(options.bodyStyle || '{}')\n }\"\n :centered=\"true\"\n v-model:visible=\"dialogVisible\"\n :width=\"options.width\"\n :mask=\"options.showModal\"\n :maskClosable=\"options.closeOnClickModal\"\n :keyboard=\"options.closeOnPressEscape\"\n @cancel=\"handleCloseEvent\"\n v-bind=\"otherAttrs\"\n >\n <div v-loading=\"isLoading\" class=\"dialog-content\">\n <VFormRender\n :isLoading=\"isLoading\"\n ref=\"dFormRef\"\n :form-json=\"formJson\"\n :form-data=\"formData\"\n :vfCtx=\"vfCtx\"\n :option-data=\"optionData\"\n :global-dsv=\"globalDsv\"\n :parent-form=\"parentForm\"\n :disabled-mode=\"options.disabledMode\"\n :dynamic-creation=\"true\"\n />\n </div>\n <template #footerRight>\n <SubmitButtonRender\n v-model:dialog-visible=\"dialogVisible\"\n :handleBeforeClose=\"handleBeforeClose\"\n :options=\"options\"\n :ctx=\"dFormRef\"\n />\n </template>\n </TpfModal>\n</template>\n\n<script lang=\"ts\" setup>\n import {\n ref,\n computed,\n nextTick,\n onBeforeUnmount,\n getCurrentInstance,\n defineAsyncComponent\n } from 'vue';\n import { http, useComRef, TpfModal } from 'tmgc2-share';\n import SubmitButtonRender from './SubmitButtonRender.vue';\n const VFormRender = defineAsyncComponent(() => import('./index.vue'));\n\n defineOptions({\n name: 'dynamic-dialog'\n });\n\n const props = defineProps({\n options: {\n type: Object,\n default: () => ({})\n },\n formJson: {\n type: Object\n },\n formData: {\n type: Object,\n default: () => ({})\n },\n vfCtx: {\n type: Object,\n default: () => ({})\n },\n optionData: {\n //prop传入的选项数据\n type: Object,\n default: () => ({})\n },\n globalDsv: {\n // 全局数据源变量\n type: Object,\n default: () => ({})\n },\n parentFormRef: {\n type: Object,\n default: null\n },\n extraData: {\n type: Object,\n default: () => ({})\n },\n wrapperId: {\n type: String,\n default: null\n }\n });\n\n const isLoading = ref(false);\n const dialogVisible = ref(false);\n const dFormRef = useComRef(VFormRender);\n const currentInstance = getCurrentInstance();\n\n // 计算属性\n const parentForm = computed(() => {\n return {\n ...props.parentFormRef,\n parentDom: currentInstance,\n getParentFormRef\n };\n });\n\n const otherAttrs = computed(() => {\n if (props.options.cancelButtonHidden && props.options.okButtonHidden) {\n return { footer: null };\n }\n return {};\n });\n\n // 生命周期钩子\n onBeforeUnmount(() => {\n console.log(props.parentFormRef);\n props.parentFormRef?.setChildFormRef?.(null);\n });\n\n // 方法\n const loadFormCode = async () => {\n if (props.options.formCode) {\n isLoading.value = true;\n try {\n const res = await http\n .get(`/api/tmgc2-query/dataQuery/detail/FormDefinitionManagement`, {\n params: { code: props.options.formCode }\n })\n .then(res => res.data.object.frontendDefinition || '{}');\n const formJson = JSON.parse(res);\n console.log('formJson: ', formJson);\n dFormRef.value?.setFormJson?.(formJson);\n } catch (error) {}\n isLoading.value = false;\n }\n };\n\n const setLoading = status => {\n console.log('setLoading', status);\n isLoading.value = status;\n };\n\n const setFormJson = formJson => {\n dFormRef.value.setFormJson(formJson);\n };\n\n const setTitle = title => {\n props.options.title = title;\n };\n\n const beforeOpen = () => {\n dialogVisible.value = true;\n };\n\n const show = () => {\n dialogVisible.value = true;\n\n //设置readMode模式\n nextTick(() => {\n if (!!props.options.readMode) {\n dFormRef.value.setReadMode(true);\n }\n loadFormCode();\n console.log(dFormRef.value);\n dFormRef.value?.setDialogOrDrawerRef(currentInstance);\n if (props.parentFormRef) {\n props.parentFormRef.setChildFormRef(dFormRef.value);\n }\n handleOpenedEvent();\n });\n };\n\n const close = () => {\n if (!!props.options.onDialogBeforeClose) {\n const customFn = new Function('done', props.options.onDialogBeforeClose);\n const closeResult = customFn.call(currentInstance);\n if (closeResult === false) {\n return;\n }\n }\n\n dialogVisible.value = false;\n };\n\n const handleBeforeClose = () => {\n if (!!props.options.onDialogBeforeClose) {\n const customFn = new Function(props.options.onDialogBeforeClose);\n return customFn.call(currentInstance);\n }\n\n return true;\n };\n\n const handleCloseEvent = () => {\n if (!handleBeforeClose()) return;\n dialogVisible.value = false;\n };\n\n const handleOpenedEvent = () => {\n if (!!props.options.onDialogOpened) {\n const customFn = new Function(props.options.onDialogOpened);\n customFn.call(currentInstance);\n }\n };\n\n const getParentFormRef = () => {\n return props.parentFormRef;\n };\n\n const getFormRef = () => {\n console.log('getFormRef');\n return dFormRef.value;\n };\n\n const getWidgetRef = (widgetName, showError = false) => {\n return dFormRef.value.getWidgetRef(widgetName, showError);\n };\n\n const updateTable = () => {\n if (props.vfCtx?.parent?.exposed?.updateTable) {\n props.vfCtx.parent.exposed.updateTable();\n }\n };\n\n const getExtraData = () => {\n return props.extraData;\n };\n\n // 暴露方法给父组件\n defineExpose({\n loadFormCode,\n setLoading,\n setFormJson,\n setTitle,\n beforeOpen,\n show,\n close,\n handleBeforeClose,\n handleCloseEvent,\n handleOpenedEvent,\n getParentFormRef,\n getFormRef,\n getWidgetRef,\n updateTable,\n getExtraData\n });\n</script>\n\n<style lang=\"less\">\n .dialog-content {\n display: flex;\n flex: 1;\n flex-direction: column;\n }\n</style>\n"],"names":["VFormRender","defineAsyncComponent","props","__props","isLoading","ref","dialogVisible","dFormRef","useComRef","currentInstance","getCurrentInstance","parentForm","computed","getParentFormRef","otherAttrs","onBeforeUnmount","_b","_a","loadFormCode","res","http","formJson","setLoading","status","setFormJson","setTitle","title","beforeOpen","show","nextTick","handleOpenedEvent","close","handleBeforeClose","handleCloseEvent","__expose","widgetName","showError","_c","_openBlock","_createBlock","_unref","_mergeProps","$event","_createVNode","SubmitButtonRender","_withDirectives","_createElementBlock","_hoisted_1"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuDI,UAAMA,IAAcC,EAAqB,MAAM,OAAO,gBAAa,CAAC,GAM9DC,IAAQC,GAwCRC,IAAYC,EAAI,EAAK,GACrBC,IAAgBD,EAAI,EAAK,GACzBE,IAAWC,EAAUR,CAAW,GAChCS,IAAkBC,EAAA,GAGlBC,IAAaC,EAAS,OACjB;AAAA,MACH,GAAGV,EAAM;AAAA,MACT,WAAWO;AAAA,MACX,kBAAAI;AAAA,IAAA,EAEP,GAEKC,IAAaF,EAAS,MACpBV,EAAM,QAAQ,sBAAsBA,EAAM,QAAQ,iBAC3C,EAAE,QAAQ,KAAA,IAEd,CAAA,CACV;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