@kp-ui/lowcode 1.0.71 → 1.0.73
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.
- package/_virtual/virtual_svg-icons-register.js +2 -2
- package/index.js +12 -9
- package/package.json +3 -2
- package/src/components/CustomRender/components/AttachmentRender.vue2.js +8 -13
- package/src/components/TpfCollapse/TpfCollapseTitle.vue2.js +3 -4
- package/src/components/code-editor/index.vue2.js +3 -4
- package/src/components/form-designer/form-widget/container-widget/container-wrapper.vue.js +22 -30
- package/src/components/form-designer/form-widget/container-widget/data-table-widget.vue.js +2 -3
- package/src/components/form-designer/form-widget/container-widget/grid-col-widget.vue.js +15 -23
- package/src/components/form-designer/form-widget/container-widget/grid-sub-form-widget.vue.js +2 -3
- package/src/components/form-designer/form-widget/container-widget/grid-widget.vue.js +1 -1
- package/src/components/form-designer/form-widget/container-widget/sub-form-widget.vue.js +2 -3
- package/src/components/form-designer/form-widget/container-widget/tab-widget.vue.js +2 -3
- package/src/components/form-designer/form-widget/container-widget/table-cell-widget.vue.js +26 -21
- package/src/components/form-designer/form-widget/container-widget/table-widget.vue.js +2 -3
- package/src/components/form-designer/form-widget/container-widget/vf-box-item.vue.js +1 -1
- package/src/components/form-designer/form-widget/container-widget/vf-box-widget.vue.js +2 -3
- package/src/components/form-designer/form-widget/container-widget/vf-collapse-widget.vue.js +4 -8
- package/src/components/form-designer/form-widget/container-widget/vf-collapse-widget.vue2.js +1 -1
- package/src/components/form-designer/form-widget/container-widget/vf-dialog-widget.vue.js +2 -3
- package/src/components/form-designer/form-widget/container-widget/vf-drawer-widget.vue.js +2 -3
- package/src/components/form-designer/form-widget/field-widget/attachment-render-widget.vue.js +6 -8
- package/src/components/form-designer/form-widget/field-widget/bpmn-editor-widget.vue.js +5 -6
- package/src/components/form-designer/form-widget/field-widget/button-widget.vue.js +1 -1
- package/src/components/form-designer/form-widget/field-widget/cascader-widget.vue.js +2 -3
- package/src/components/form-designer/form-widget/field-widget/checkbox-widget.vue.js +5 -6
- package/src/components/form-designer/form-widget/field-widget/code-editor-widget.vue.js +1 -1
- package/src/components/form-designer/form-widget/field-widget/color-widget.vue.js +5 -6
- package/src/components/form-designer/form-widget/field-widget/date-range-widget.vue.js +2 -3
- package/src/components/form-designer/form-widget/field-widget/date-widget.vue.js +2 -3
- package/src/components/form-designer/form-widget/field-widget/divider-widget.vue.js +2 -2
- package/src/components/form-designer/form-widget/field-widget/divider-widget.vue2.js +1 -0
- package/src/components/form-designer/form-widget/field-widget/diy-compontent-widget.vue.js +4 -6
- package/src/components/form-designer/form-widget/field-widget/dropdown-widget.vue.js +1 -1
- package/src/components/form-designer/form-widget/field-widget/file-upload-widget.vue.js +9 -14
- package/src/components/form-designer/form-widget/field-widget/form-item-wrapper.vue.js +29 -41
- package/src/components/form-designer/form-widget/field-widget/html-text-widget.vue.js +3 -4
- package/src/components/form-designer/form-widget/field-widget/html-text-widget.vue2.js +1 -0
- package/src/components/form-designer/form-widget/field-widget/input-widget.vue.js +2 -3
- package/src/components/form-designer/form-widget/field-widget/number-widget.vue.js +2 -3
- package/src/components/form-designer/form-widget/field-widget/picture-upload-widget.vue.js +15 -12
- package/src/components/form-designer/form-widget/field-widget/radio-widget.vue.js +5 -6
- package/src/components/form-designer/form-widget/field-widget/rate-widget.vue.js +1 -1
- package/src/components/form-designer/form-widget/field-widget/rich-editor-widget.vue.js +1 -1
- package/src/components/form-designer/form-widget/field-widget/select-widget.vue.js +3 -5
- package/src/components/form-designer/form-widget/field-widget/slider-widget.vue.js +5 -6
- package/src/components/form-designer/form-widget/field-widget/slot-widget.vue.js +4 -6
- package/src/components/form-designer/form-widget/field-widget/static-content-wrapper.vue.js +19 -24
- package/src/components/form-designer/form-widget/field-widget/static-text-widget.vue.js +2 -2
- package/src/components/form-designer/form-widget/field-widget/static-text-widget.vue2.js +1 -0
- package/src/components/form-designer/form-widget/field-widget/switch-widget.vue.js +1 -1
- package/src/components/form-designer/form-widget/field-widget/textarea-widget.vue.js +2 -3
- package/src/components/form-designer/form-widget/field-widget/time-range-widget.vue.js +5 -6
- package/src/components/form-designer/form-widget/field-widget/time-widget.vue.js +5 -6
- package/src/components/form-designer/form-widget/field-widget/treeSelect-widget.vue.js +2 -3
- package/src/components/form-designer/form-widget/index.vue.js +10 -17
- package/{designer.js → src/components/form-designer/index.vue.js} +10 -11
- package/src/components/form-designer/setting-panel/form-crud-setting.vue.js +2 -4
- package/src/components/form-designer/setting-panel/form-setting.vue.js +14 -18
- package/src/components/form-designer/setting-panel/index.vue.js +206 -216
- package/src/components/form-designer/setting-panel/option-items-setting.vue.js +23 -28
- package/src/components/form-designer/setting-panel/property-editor/actionColumnPosition-editor.vue.js +1 -1
- package/src/components/form-designer/setting-panel/property-editor/actionColumnPosition-editor.vue2.js +1 -0
- package/src/components/form-designer/setting-panel/property-editor/button-list-editor.vue.js +3 -4
- package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-pagination-editor.vue.js +2 -2
- package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-selections-editor.vue.js +2 -2
- package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-showButtonsColumn-editor.vue.js +5 -6
- package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-tableColumns-editor.vue.js +2 -365
- package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-tableColumns-editor.vue2.js +361 -0
- package/src/components/form-designer/setting-panel/property-editor/container-grid/gutter-editor.vue.js +4 -6
- package/src/components/form-designer/setting-panel/property-editor/container-tab/tab-customClass-editor.vue.js +5 -6
- package/src/components/form-designer/setting-panel/property-editor/container-vf-dialog/bodyStyle-editor.vue.js +3 -4
- package/src/components/form-designer/setting-panel/property-editor/container-vf-drawer/vf-drawer-direction-editor.vue.js +8 -8
- package/src/components/form-designer/setting-panel/property-editor/disabled-editor.vue.js +2 -2
- package/src/components/form-designer/setting-panel/property-editor/field-button/shape-editor.vue.js +6 -6
- package/src/components/form-designer/setting-panel/property-editor/field-button/type-editor.vue.js +12 -12
- package/src/components/form-designer/setting-panel/property-editor/field-cascader/cascader-defaultValue-editor.vue.js +1 -2
- package/src/components/form-designer/setting-panel/property-editor/field-checkbox/checkbox-defaultValue-editor.vue.js +1 -2
- package/src/components/form-designer/setting-panel/property-editor/field-date/date-format-editor.vue.js +8 -8
- package/src/components/form-designer/setting-panel/property-editor/field-date/date-type-editor.vue.js +10 -10
- package/src/components/form-designer/setting-panel/property-editor/field-date/date-valueFormat-editor.vue.js +8 -8
- package/src/components/form-designer/setting-panel/property-editor/field-date-range/date-range-format-editor.vue.js +10 -10
- package/src/components/form-designer/setting-panel/property-editor/field-date-range/date-range-type-editor.vue.js +6 -6
- package/src/components/form-designer/setting-panel/property-editor/field-date-range/date-range-valueFormat-editor.vue.js +8 -8
- package/src/components/form-designer/setting-panel/property-editor/field-divider/contentPosition-editor.vue.js +6 -6
- package/src/components/form-designer/setting-panel/property-editor/field-divider/divider-direction-editor.vue.js +4 -4
- package/src/components/form-designer/setting-panel/property-editor/field-number/controlsPosition-editor.vue.js +4 -4
- package/src/components/form-designer/setting-panel/property-editor/field-radio/radio-defaultValue-editor.vue.js +1 -2
- package/src/components/form-designer/setting-panel/property-editor/field-select/select-defaultValue-editor.vue.js +1 -2
- package/src/components/form-designer/setting-panel/property-editor/field-time/time-format-editor.vue.js +4 -4
- package/src/components/form-designer/setting-panel/property-editor/field-time-range/time-range-format-editor.vue.js +4 -4
- package/src/components/form-designer/setting-panel/property-editor/hidden-editor.vue.js +2 -2
- package/src/components/form-designer/setting-panel/property-editor/type-editor.vue.js +4 -4
- package/src/components/form-designer/toolbar-panel/index.vue.js +2 -1045
- package/src/components/form-designer/toolbar-panel/index.vue2.js +1046 -0
- package/src/components/form-designer/widget-panel/index.vue.js +7 -13
- package/src/components/form-designer/widget-panel/widgetsConfig.js +2 -2
- package/src/components/form-render/container-item/grid-col-item.vue.js +2 -4
- package/src/components/form-render/container-item/grid-sub-form-item.vue.js +4 -8
- package/src/components/form-render/container-item/sub-form-item.vue.js +25 -38
- package/src/components/form-render/container-item/table-cell-item.vue.js +1 -2
- package/src/components/form-render/container-item/vf-collapse-item.vue.js +4 -6
- package/src/components/form-render/dynamic-dialog.vue.js +52 -64
- package/src/components/form-render/dynamic-drawer.vue.js +2 -3
- package/{render.js → src/components/form-render/index.vue.js} +71 -81
- package/src/components/http-editor/index.vue.js +16 -16
- package/src/components/public/ActionButtonListDialog.vue.js +23 -24
- package/src/components/public/CustomerModal/CustomerModal.vue.js +4 -0
- package/src/components/public/CustomerModal/CustomerModal.vue2.js +74 -0
- package/src/components/public/CustomerModal/useCustomerModal.js +34 -0
- package/src/components/public/QuillEditor/index.vue.js +1 -2
- package/src/components/public/methoad-item.vue.js +1 -2
- package/src/components/svg-icon/index.vue.js +2 -4
- package/src/hooks/useLowcode.js +106 -0
- package/stats.html +1 -1
- package/styles/style.css +1 -1
- package/types/install.d.ts +1 -2
- package/types/install.d.ts.map +1 -1
- package/types/src/components/public/CustomerModal/CustomerModal.d.ts +6 -0
- package/types/src/components/public/CustomerModal/CustomerModal.d.ts.map +1 -0
- package/types/src/hooks/useLowcode.d.ts +21 -0
- package/types/src/hooks/useLowcode.d.ts.map +1 -0
- package/types/designer.d.ts +0 -1
- package/types/index.d.ts +0 -1
- package/types/render.d.ts +0 -1
|
@@ -1,22 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import emitter from "
|
|
3
|
-
import comps from "
|
|
4
|
-
import { buildDefaultFormJson, getContainerWidgetByName, cloneFormConfigWithoutEventHandler, deepClone, getDSByName, overwriteObj, runDataSourceRequest, getAllContainerWidgets, getAllFieldWidgets, getDefaultFormConfig, traverseFieldWidgets, getFieldWidgetByName, traverseFieldWidgetsOfContainer, insertCustomCssToHead, insertGlobalFunctionsToHtml, generateId } from "
|
|
5
|
-
import i18n, { changeLocale } from "
|
|
6
|
-
import DynamicDialog from "./
|
|
7
|
-
import DynamicDrawer from "./
|
|
8
|
-
import { fmtHttpParams } from "
|
|
9
|
-
/* empty css
|
|
10
|
-
import _export_sfc from "
|
|
1
|
+
import { resolveComponent, createBlock, openBlock, withCtx, createElementVNode, normalizeStyle, createVNode, withModifiers, normalizeClass, createElementBlock, Fragment, renderList, resolveDynamicComponent, createSlots, renderSlot, mergeProps, render, h } from "vue";
|
|
2
|
+
import emitter from "../../utils/emitter.js";
|
|
3
|
+
import comps from "../form-designer/form-widget/field-widget/index.js";
|
|
4
|
+
import { buildDefaultFormJson, getContainerWidgetByName, cloneFormConfigWithoutEventHandler, deepClone, getDSByName, overwriteObj, runDataSourceRequest, getAllContainerWidgets, getAllFieldWidgets, getDefaultFormConfig, traverseFieldWidgets, getFieldWidgetByName, traverseFieldWidgetsOfContainer, insertCustomCssToHead, insertGlobalFunctionsToHtml, generateId } from "../../utils/util.js";
|
|
5
|
+
import i18n, { changeLocale } from "../../utils/i18n.js";
|
|
6
|
+
import DynamicDialog from "./dynamic-dialog.vue.js";
|
|
7
|
+
import DynamicDrawer from "./dynamic-drawer.vue.js";
|
|
8
|
+
import { fmtHttpParams } from "../../utils/request/fmtHttpParams.js";
|
|
9
|
+
/* empty css */
|
|
10
|
+
import _export_sfc from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
11
11
|
const _sfc_main = {
|
|
12
12
|
name: "VFormRender",
|
|
13
13
|
componentName: "VFormRender",
|
|
14
14
|
mixins: [emitter, i18n],
|
|
15
15
|
components: {
|
|
16
|
-
TpfConfigProvider: defineAsyncComponent(async () => {
|
|
17
|
-
const { TpfConfigProvider } = await import("tmgc2-share");
|
|
18
|
-
return TpfConfigProvider;
|
|
19
|
-
}),
|
|
20
16
|
...comps
|
|
21
17
|
},
|
|
22
18
|
props: {
|
|
@@ -1012,76 +1008,70 @@ const _sfc_main = {
|
|
|
1012
1008
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1013
1009
|
const _component_a_form = resolveComponent("a-form");
|
|
1014
1010
|
const _component_a_spin = resolveComponent("a-spin");
|
|
1015
|
-
|
|
1016
|
-
return openBlock(), createBlock(_component_TpfConfigProvider, null, {
|
|
1011
|
+
return openBlock(), createBlock(_component_a_spin, { spinning: $data.isLoading }, {
|
|
1017
1012
|
default: withCtx(() => [
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
(openBlock(
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
}, 8, ["layout", "class", "label-width", "model"])
|
|
1076
|
-
], 4)
|
|
1077
|
-
]),
|
|
1078
|
-
_: 3
|
|
1079
|
-
}, 8, ["spinning"])
|
|
1013
|
+
createElementVNode("div", {
|
|
1014
|
+
style: normalizeStyle($data.isLoading ? "min-height: 260px" : "")
|
|
1015
|
+
}, [
|
|
1016
|
+
createVNode(_component_a_form, {
|
|
1017
|
+
layout: $options.labelPosition,
|
|
1018
|
+
class: normalizeClass([[$options.customClass, $data.readModeFlag ? "readonly-mode-form" : ""], "render-form tpf-form"]),
|
|
1019
|
+
"label-width": $options.labelWidth,
|
|
1020
|
+
"validate-on-rule-change": false,
|
|
1021
|
+
model: $data.formDataModel,
|
|
1022
|
+
ref: "renderForm",
|
|
1023
|
+
onSubmit: _cache[0] || (_cache[0] = withModifiers(() => {
|
|
1024
|
+
}, ["prevent"]))
|
|
1025
|
+
}, {
|
|
1026
|
+
default: withCtx(() => [
|
|
1027
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList($options.widgetList, (widget, index) => {
|
|
1028
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
1029
|
+
"container" === widget.category ? (openBlock(), createBlock(resolveDynamicComponent($options.getContainerWidgetName(widget)), {
|
|
1030
|
+
widget,
|
|
1031
|
+
key: widget.id,
|
|
1032
|
+
data: $data.formDataModel[widget.options.name],
|
|
1033
|
+
"parent-list": $options.widgetList,
|
|
1034
|
+
"index-of-parent-list": index,
|
|
1035
|
+
"parent-widget": null,
|
|
1036
|
+
model: $data.formDataModel
|
|
1037
|
+
}, createSlots({ _: 2 }, [
|
|
1038
|
+
renderList(Object.keys(_ctx.$slots), (slot) => {
|
|
1039
|
+
return {
|
|
1040
|
+
name: slot,
|
|
1041
|
+
fn: withCtx((scope) => [
|
|
1042
|
+
renderSlot(_ctx.$slots, slot, mergeProps({ ref_for: true }, scope), void 0, true)
|
|
1043
|
+
])
|
|
1044
|
+
};
|
|
1045
|
+
})
|
|
1046
|
+
]), 1032, ["widget", "data", "parent-list", "index-of-parent-list", "model"])) : (openBlock(), createBlock(resolveDynamicComponent($options.getWidgetName(widget)), {
|
|
1047
|
+
field: widget,
|
|
1048
|
+
"form-model": $data.formDataModel,
|
|
1049
|
+
designer: null,
|
|
1050
|
+
key: widget.id,
|
|
1051
|
+
"parent-list": $options.widgetList,
|
|
1052
|
+
"index-of-parent-list": index,
|
|
1053
|
+
"parent-widget": null
|
|
1054
|
+
}, createSlots({ _: 2 }, [
|
|
1055
|
+
renderList(Object.keys(_ctx.$slots), (slot) => {
|
|
1056
|
+
return {
|
|
1057
|
+
name: slot,
|
|
1058
|
+
fn: withCtx((scope) => [
|
|
1059
|
+
renderSlot(_ctx.$slots, slot, mergeProps({ ref_for: true }, scope), void 0, true)
|
|
1060
|
+
])
|
|
1061
|
+
};
|
|
1062
|
+
})
|
|
1063
|
+
]), 1032, ["field", "form-model", "parent-list", "index-of-parent-list"]))
|
|
1064
|
+
], 64);
|
|
1065
|
+
}), 256))
|
|
1066
|
+
]),
|
|
1067
|
+
_: 3
|
|
1068
|
+
}, 8, ["layout", "class", "label-width", "model"])
|
|
1069
|
+
], 4)
|
|
1080
1070
|
]),
|
|
1081
1071
|
_: 3
|
|
1082
|
-
});
|
|
1072
|
+
}, 8, ["spinning"]);
|
|
1083
1073
|
}
|
|
1084
|
-
const
|
|
1074
|
+
const VFormRender = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-88794663"]]);
|
|
1085
1075
|
export {
|
|
1086
|
-
|
|
1076
|
+
VFormRender as default
|
|
1087
1077
|
};
|
|
@@ -116,27 +116,27 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
116
116
|
}, {
|
|
117
117
|
default: withCtx(() => [
|
|
118
118
|
createVNode(_component_a_radio_button, { value: "get" }, {
|
|
119
|
-
default: withCtx(() =>
|
|
119
|
+
default: withCtx(() => [
|
|
120
120
|
createTextVNode("get")
|
|
121
|
-
])
|
|
121
|
+
]),
|
|
122
122
|
_: 1
|
|
123
123
|
}),
|
|
124
124
|
createVNode(_component_a_radio_button, { value: "post" }, {
|
|
125
|
-
default: withCtx(() =>
|
|
125
|
+
default: withCtx(() => [
|
|
126
126
|
createTextVNode("post")
|
|
127
|
-
])
|
|
127
|
+
]),
|
|
128
128
|
_: 1
|
|
129
129
|
}),
|
|
130
130
|
createVNode(_component_a_radio_button, { value: "put" }, {
|
|
131
|
-
default: withCtx(() =>
|
|
131
|
+
default: withCtx(() => [
|
|
132
132
|
createTextVNode("put")
|
|
133
|
-
])
|
|
133
|
+
]),
|
|
134
134
|
_: 1
|
|
135
135
|
}),
|
|
136
136
|
createVNode(_component_a_radio_button, { value: "delete" }, {
|
|
137
|
-
default: withCtx(() =>
|
|
137
|
+
default: withCtx(() => [
|
|
138
138
|
createTextVNode("delete")
|
|
139
|
-
])
|
|
139
|
+
]),
|
|
140
140
|
_: 1
|
|
141
141
|
})
|
|
142
142
|
]),
|
|
@@ -201,9 +201,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
201
201
|
type: "primary",
|
|
202
202
|
onClick: ($event) => $options.deleteRequestParam(pIdx)
|
|
203
203
|
}, {
|
|
204
|
-
default: withCtx(() =>
|
|
204
|
+
default: withCtx(() => [
|
|
205
205
|
createTextVNode(" 删除 ")
|
|
206
|
-
])
|
|
206
|
+
]),
|
|
207
207
|
_: 2
|
|
208
208
|
}, 1032, ["onClick"])
|
|
209
209
|
]),
|
|
@@ -291,9 +291,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
291
291
|
type: "primary",
|
|
292
292
|
onClick: ($event) => $options.deleteRequestData(dIdx)
|
|
293
293
|
}, {
|
|
294
|
-
default: withCtx(() =>
|
|
294
|
+
default: withCtx(() => [
|
|
295
295
|
createTextVNode(" 删除 ")
|
|
296
|
-
])
|
|
296
|
+
]),
|
|
297
297
|
_: 2
|
|
298
298
|
}, 1032, ["onClick"])
|
|
299
299
|
]),
|
|
@@ -333,9 +333,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
333
333
|
onClick: $options.editReqDataHandlerCode,
|
|
334
334
|
class: normalizeClass([$props.optionModel.dataReqHandlerCode ? "button-text-highlight" : ""])
|
|
335
335
|
}, {
|
|
336
|
-
default: withCtx(() =>
|
|
336
|
+
default: withCtx(() => [
|
|
337
337
|
createTextVNode(" 处理函数配置 ")
|
|
338
|
-
])
|
|
338
|
+
]),
|
|
339
339
|
_: 1
|
|
340
340
|
}, 8, ["onClick", "class"])
|
|
341
341
|
]),
|
|
@@ -349,9 +349,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
349
349
|
onClick: $options.editDataHandlerCode,
|
|
350
350
|
class: normalizeClass([$props.optionModel.dataHandlerCode ? "button-text-highlight" : ""])
|
|
351
351
|
}, {
|
|
352
|
-
default: withCtx(() =>
|
|
352
|
+
default: withCtx(() => [
|
|
353
353
|
createTextVNode(" 处理函数配置 ")
|
|
354
|
-
])
|
|
354
|
+
]),
|
|
355
355
|
_: 1
|
|
356
356
|
}, 8, ["onClick", "class"])
|
|
357
357
|
]),
|
|
@@ -2,7 +2,6 @@ import _sfc_main from "./ActionButtonListDialog.vue2.js";
|
|
|
2
2
|
import { resolveComponent, createElementBlock, openBlock, Fragment, createVNode, createElementVNode, withCtx, createBlock, createCommentVNode, createTextVNode, normalizeClass, toDisplayString } from "vue";
|
|
3
3
|
/* empty css */
|
|
4
4
|
import _export_sfc from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
-
const _hoisted_1 = { class: "add-btn" };
|
|
6
5
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
7
6
|
const _component_a_input = resolveComponent("a-input");
|
|
8
7
|
const _component_a_select_option = resolveComponent("a-select-option");
|
|
@@ -36,39 +35,39 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
36
35
|
}, {
|
|
37
36
|
default: withCtx(() => [
|
|
38
37
|
createVNode(_component_a_select_option, { value: "primary" }, {
|
|
39
|
-
default: withCtx(() =>
|
|
38
|
+
default: withCtx(() => [
|
|
40
39
|
createTextVNode("primary")
|
|
41
|
-
])
|
|
40
|
+
]),
|
|
42
41
|
_: 1
|
|
43
42
|
}),
|
|
44
43
|
createVNode(_component_a_select_option, { value: "ghost" }, {
|
|
45
|
-
default: withCtx(() =>
|
|
44
|
+
default: withCtx(() => [
|
|
46
45
|
createTextVNode("ghost")
|
|
47
|
-
])
|
|
46
|
+
]),
|
|
48
47
|
_: 1
|
|
49
48
|
}),
|
|
50
49
|
createVNode(_component_a_select_option, { value: "dashed" }, {
|
|
51
|
-
default: withCtx(() =>
|
|
50
|
+
default: withCtx(() => [
|
|
52
51
|
createTextVNode("dashed")
|
|
53
|
-
])
|
|
52
|
+
]),
|
|
54
53
|
_: 1
|
|
55
54
|
}),
|
|
56
55
|
createVNode(_component_a_select_option, { value: "text" }, {
|
|
57
|
-
default: withCtx(() =>
|
|
56
|
+
default: withCtx(() => [
|
|
58
57
|
createTextVNode("text")
|
|
59
|
-
])
|
|
58
|
+
]),
|
|
60
59
|
_: 1
|
|
61
60
|
}),
|
|
62
61
|
createVNode(_component_a_select_option, { value: "link" }, {
|
|
63
|
-
default: withCtx(() =>
|
|
62
|
+
default: withCtx(() => [
|
|
64
63
|
createTextVNode("link")
|
|
65
|
-
])
|
|
64
|
+
]),
|
|
66
65
|
_: 1
|
|
67
66
|
}),
|
|
68
67
|
createVNode(_component_a_select_option, { value: "default" }, {
|
|
69
|
-
default: withCtx(() =>
|
|
68
|
+
default: withCtx(() => [
|
|
70
69
|
createTextVNode("default")
|
|
71
|
-
])
|
|
70
|
+
]),
|
|
72
71
|
_: 1
|
|
73
72
|
})
|
|
74
73
|
]),
|
|
@@ -83,21 +82,21 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
83
82
|
}, {
|
|
84
83
|
default: withCtx(() => [
|
|
85
84
|
createVNode(_component_a_select_option, { value: "default" }, {
|
|
86
|
-
default: withCtx(() =>
|
|
85
|
+
default: withCtx(() => [
|
|
87
86
|
createTextVNode("default")
|
|
88
|
-
])
|
|
87
|
+
]),
|
|
89
88
|
_: 1
|
|
90
89
|
}),
|
|
91
90
|
createVNode(_component_a_select_option, { value: "small" }, {
|
|
92
|
-
default: withCtx(() =>
|
|
91
|
+
default: withCtx(() => [
|
|
93
92
|
createTextVNode("small")
|
|
94
|
-
])
|
|
93
|
+
]),
|
|
95
94
|
_: 1
|
|
96
95
|
}),
|
|
97
96
|
createVNode(_component_a_select_option, { value: "large" }, {
|
|
98
|
-
default: withCtx(() =>
|
|
97
|
+
default: withCtx(() => [
|
|
99
98
|
createTextVNode("large")
|
|
100
|
-
])
|
|
99
|
+
]),
|
|
101
100
|
_: 1
|
|
102
101
|
})
|
|
103
102
|
]),
|
|
@@ -144,9 +143,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
144
143
|
onClick: ($event) => _ctx.editClickEvent("onClick", record, recordIndexs),
|
|
145
144
|
size: "small"
|
|
146
145
|
}, {
|
|
147
|
-
default: withCtx(() =>
|
|
146
|
+
default: withCtx(() => [
|
|
148
147
|
createTextVNode(" 点击事件 ")
|
|
149
|
-
])
|
|
148
|
+
]),
|
|
150
149
|
_: 2
|
|
151
150
|
}, 1032, ["class", "onClick"])) : createCommentVNode("", true),
|
|
152
151
|
column.dataIndex === "action" ? (openBlock(), createBlock(_component_a_button, {
|
|
@@ -155,15 +154,15 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
155
154
|
onClick: ($event) => _ctx.deleteOperationButton(index),
|
|
156
155
|
size: "small"
|
|
157
156
|
}, {
|
|
158
|
-
default: withCtx(() =>
|
|
157
|
+
default: withCtx(() => [
|
|
159
158
|
createTextVNode(" 删除 ")
|
|
160
|
-
])
|
|
159
|
+
]),
|
|
161
160
|
_: 2
|
|
162
161
|
}, 1032, ["onClick"])) : createCommentVNode("", true)
|
|
163
162
|
]),
|
|
164
163
|
_: 1
|
|
165
164
|
}, 8, ["data-source", "columns", "row-key"]),
|
|
166
|
-
createElementVNode("div",
|
|
165
|
+
createElementVNode("div", { class: "add-btn" }, [
|
|
167
166
|
createVNode(_component_a_button, {
|
|
168
167
|
type: "primary",
|
|
169
168
|
size: "default",
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { defineComponent, getCurrentInstance, useAttrs, ref, computed, onMounted, createBlock, openBlock, unref, mergeProps, withCtx, createVNode, nextTick } from "vue";
|
|
2
|
+
import { useLowcode } from "../../../hooks/useLowcode.js";
|
|
3
|
+
import _sfc_main$1 from "../../form-render/SubmitButtonRender.vue.js";
|
|
4
|
+
import VFormRender from "../../form-render/index.vue.js";
|
|
5
|
+
import { TpfModal } from "tmgc2-share";
|
|
6
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
7
|
+
__name: "CustomerModal",
|
|
8
|
+
props: {
|
|
9
|
+
type: {},
|
|
10
|
+
formCode: {}
|
|
11
|
+
},
|
|
12
|
+
setup(__props) {
|
|
13
|
+
const instance = getCurrentInstance();
|
|
14
|
+
const attrs = useAttrs() || {};
|
|
15
|
+
const visible = ref(false);
|
|
16
|
+
const props = __props;
|
|
17
|
+
const vfCtx = computed(() => {
|
|
18
|
+
var _a, _b;
|
|
19
|
+
return {
|
|
20
|
+
_id: ((_b = (_a = attrs == null ? void 0 : attrs.row) == null ? void 0 : _a.record) == null ? void 0 : _b._id) || null,
|
|
21
|
+
type: props.type,
|
|
22
|
+
instance,
|
|
23
|
+
...attrs
|
|
24
|
+
};
|
|
25
|
+
});
|
|
26
|
+
const {
|
|
27
|
+
vfdRef,
|
|
28
|
+
formConfig,
|
|
29
|
+
getComponentJson
|
|
30
|
+
} = useLowcode({
|
|
31
|
+
formCode: props.formCode,
|
|
32
|
+
type: props.type
|
|
33
|
+
});
|
|
34
|
+
const title = computed(() => {
|
|
35
|
+
if (props.type === "add") return "新增";
|
|
36
|
+
if (props.type === "edit") return "编辑";
|
|
37
|
+
if (props.type === "view") return "查看";
|
|
38
|
+
return "新增";
|
|
39
|
+
});
|
|
40
|
+
const show = async () => {
|
|
41
|
+
visible.value = true;
|
|
42
|
+
await nextTick();
|
|
43
|
+
await getComponentJson([]);
|
|
44
|
+
console.log("attrs", attrs);
|
|
45
|
+
};
|
|
46
|
+
onMounted(() => {
|
|
47
|
+
show();
|
|
48
|
+
});
|
|
49
|
+
return (_ctx, _cache) => {
|
|
50
|
+
return openBlock(), createBlock(unref(TpfModal), mergeProps({
|
|
51
|
+
visible: visible.value,
|
|
52
|
+
"onUpdate:visible": _cache[1] || (_cache[1] = ($event) => visible.value = $event)
|
|
53
|
+
}, _ctx.$attrs, {
|
|
54
|
+
title: title.value
|
|
55
|
+
}), {
|
|
56
|
+
footerRight: withCtx(() => [createVNode(_sfc_main$1, {
|
|
57
|
+
dialogVisible: visible.value,
|
|
58
|
+
"onUpdate:dialogVisible": _cache[0] || (_cache[0] = ($event) => visible.value = $event),
|
|
59
|
+
options: unref(formConfig),
|
|
60
|
+
ctx: unref(vfdRef)
|
|
61
|
+
}, null, 8, ["dialogVisible", "options", "ctx"])]),
|
|
62
|
+
default: withCtx(() => [createVNode(VFormRender, {
|
|
63
|
+
vfCtx: vfCtx.value,
|
|
64
|
+
ref_key: "vfdRef",
|
|
65
|
+
ref: vfdRef
|
|
66
|
+
}, null, 8, ["vfCtx"])]),
|
|
67
|
+
_: 1
|
|
68
|
+
}, 16, ["visible", "title"]);
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
export {
|
|
73
|
+
_sfc_main as default
|
|
74
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { defineAsyncComponent, createApp, createVNode, mergeProps } from "vue";
|
|
2
|
+
import { TpfConfigProvider } from "tmgc2-share";
|
|
3
|
+
const openCustomerModal = (ops, useMountApp) => {
|
|
4
|
+
console.log("ops: ", ops);
|
|
5
|
+
const {
|
|
6
|
+
type,
|
|
7
|
+
formCode,
|
|
8
|
+
...args
|
|
9
|
+
} = ops;
|
|
10
|
+
const div = document.createElement("div");
|
|
11
|
+
document.body.appendChild(div);
|
|
12
|
+
const Com = defineAsyncComponent(() => import("./CustomerModal.vue.js"));
|
|
13
|
+
const hide = (modal2) => {
|
|
14
|
+
modal2.unmount();
|
|
15
|
+
div.remove();
|
|
16
|
+
};
|
|
17
|
+
const onCancel = () => {
|
|
18
|
+
console.log("cancel");
|
|
19
|
+
hide(modal);
|
|
20
|
+
};
|
|
21
|
+
const modal = createApp(createVNode(TpfConfigProvider, null, {
|
|
22
|
+
default: () => [createVNode(Com, mergeProps({
|
|
23
|
+
"type": type,
|
|
24
|
+
"formCode": formCode
|
|
25
|
+
}, {
|
|
26
|
+
onCancel
|
|
27
|
+
}, args), null)]
|
|
28
|
+
}));
|
|
29
|
+
useMountApp(modal);
|
|
30
|
+
modal.mount(div);
|
|
31
|
+
};
|
|
32
|
+
export {
|
|
33
|
+
openCustomerModal
|
|
34
|
+
};
|
|
@@ -140,9 +140,8 @@ const _sfc_main = {
|
|
|
140
140
|
return { editor };
|
|
141
141
|
}
|
|
142
142
|
};
|
|
143
|
-
const _hoisted_1 = { ref: "editor" };
|
|
144
143
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
145
|
-
return openBlock(), createElementBlock("section",
|
|
144
|
+
return openBlock(), createElementBlock("section", { ref: "editor" }, null, 512);
|
|
146
145
|
}
|
|
147
146
|
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
148
147
|
export {
|
|
@@ -2,7 +2,6 @@ import { defineComponent, ref, resolveComponent, createElementBlock, openBlock,
|
|
|
2
2
|
import { useI18n } from "../../utils/i18n.js";
|
|
3
3
|
import CodeEditor from "../code-editor/index.vue.js";
|
|
4
4
|
import { message } from "ant-design-vue";
|
|
5
|
-
const _hoisted_1 = { class: "dialog-footer" };
|
|
6
5
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
7
6
|
__name: "methoad-item",
|
|
8
7
|
props: {
|
|
@@ -80,7 +79,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
80
79
|
width: 800
|
|
81
80
|
}, {
|
|
82
81
|
footer: withCtx(() => [
|
|
83
|
-
createElementVNode("div",
|
|
82
|
+
createElementVNode("div", { class: "dialog-footer" }, [
|
|
84
83
|
createVNode(_component_a_button, {
|
|
85
84
|
onClick: _cache[2] || (_cache[2] = ($event) => showFormEventDialogFlag.value = false)
|
|
86
85
|
}, {
|
|
@@ -41,16 +41,14 @@ const _sfc_main = {
|
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
|
-
const _hoisted_1 = ["xlink:href"];
|
|
45
|
-
const _hoisted_2 = { key: 0 };
|
|
46
44
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
47
45
|
return openBlock(), createElementBlock("svg", {
|
|
48
46
|
class: normalizeClass($options.svgClass),
|
|
49
47
|
"aria-hidden": "true",
|
|
50
48
|
style: normalizeStyle($options.getStyle)
|
|
51
49
|
}, [
|
|
52
|
-
createElementVNode("use", { "xlink:href": $options.iconName }, null, 8,
|
|
53
|
-
!!$props.title ? (openBlock(), createElementBlock("title",
|
|
50
|
+
createElementVNode("use", { "xlink:href": $options.iconName }, null, 8, ["xlink:href"]),
|
|
51
|
+
!!$props.title ? (openBlock(), createElementBlock("title", { key: 0 }, toDisplayString($props.title), 1)) : createCommentVNode("", true)
|
|
54
52
|
], 6);
|
|
55
53
|
}
|
|
56
54
|
const SvgIcon = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-dfe46d5e"]]);
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import VFormRender from "../components/form-render/index.vue.js";
|
|
2
|
+
import { basicFieldsEnums } from "../components/form-designer/widget-panel/basicFieldsEnums.js";
|
|
3
|
+
import { getUuidKey } from "@kp-ui/tool";
|
|
4
|
+
import { useDataQueryApi, useComRef, useRouteBackTab, routerReloadStatus } from "tmgc2-share";
|
|
5
|
+
import { ref } from "vue";
|
|
6
|
+
const useLowcode = (params) => {
|
|
7
|
+
const { formCode, entityCode, type } = params;
|
|
8
|
+
const useDataQuery = useDataQueryApi();
|
|
9
|
+
const vfdRef = useComRef(VFormRender);
|
|
10
|
+
const formConfig = ref();
|
|
11
|
+
const { routeBackTab } = useRouteBackTab();
|
|
12
|
+
const insertBtn = (list = []) => {
|
|
13
|
+
const btnId = getUuidKey();
|
|
14
|
+
const btnInfo = {
|
|
15
|
+
label: "提交",
|
|
16
|
+
name: btnId,
|
|
17
|
+
onCreated: `
|
|
18
|
+
const hidden = this.getFormRef().vfCtx?.type==='view';
|
|
19
|
+
this.setHidden(hidden)
|
|
20
|
+
`,
|
|
21
|
+
onClick: `(async()=>{
|
|
22
|
+
await this.getFormRef().onFormUpdate()
|
|
23
|
+
this.$message.success('保存成功')
|
|
24
|
+
const onCancel = this.getFormRef().vfCtx?.onCancel
|
|
25
|
+
if( typeof onCancel === 'function' ){
|
|
26
|
+
onCancel()
|
|
27
|
+
}
|
|
28
|
+
})()`
|
|
29
|
+
};
|
|
30
|
+
list.push(basicFieldsEnums.button(btnInfo));
|
|
31
|
+
return list;
|
|
32
|
+
};
|
|
33
|
+
const getInitRenderJSON = (list = []) => {
|
|
34
|
+
const res = list.reduce((t, v) => {
|
|
35
|
+
const fn = basicFieldsEnums[v.componentType];
|
|
36
|
+
if (fn) {
|
|
37
|
+
const json = fn({
|
|
38
|
+
name: v.entityPropertyCode,
|
|
39
|
+
label: v.entityPropertyName,
|
|
40
|
+
...v.options
|
|
41
|
+
});
|
|
42
|
+
t = [...t, json];
|
|
43
|
+
}
|
|
44
|
+
return t;
|
|
45
|
+
}, []);
|
|
46
|
+
return res.length ? insertBtn(res) : res;
|
|
47
|
+
};
|
|
48
|
+
const getComponentJson = async (list = []) => {
|
|
49
|
+
var _a, _b;
|
|
50
|
+
let json = { widgetList: [], formConfig: {} };
|
|
51
|
+
if (formCode && type) {
|
|
52
|
+
(_a = vfdRef.value) == null ? void 0 : _a.setLoading(true);
|
|
53
|
+
try {
|
|
54
|
+
const res = await useDataQuery.dataQueryDetail({ code: formCode }, "FormDefinitionManagement").then((res2) => res2.data.object || {});
|
|
55
|
+
json = JSON.parse(res.frontendDefinition || "{}");
|
|
56
|
+
} finally {
|
|
57
|
+
(_b = vfdRef.value) == null ? void 0 : _b.setLoading(false);
|
|
58
|
+
}
|
|
59
|
+
} else {
|
|
60
|
+
json.widgetList = getInitRenderJSON(list);
|
|
61
|
+
}
|
|
62
|
+
console.log("json: ", json);
|
|
63
|
+
formConfig.value = json.formConfig;
|
|
64
|
+
vfdRef.value.setFormJson(json);
|
|
65
|
+
return json;
|
|
66
|
+
};
|
|
67
|
+
const getFieldList = async () => {
|
|
68
|
+
if (!entityCode) {
|
|
69
|
+
getComponentJson([]);
|
|
70
|
+
return [];
|
|
71
|
+
}
|
|
72
|
+
const p = {
|
|
73
|
+
pageCode: "EntityPropertyFormItem",
|
|
74
|
+
conditions: [{ fieldCode: "entityCode", type: "EQ", value: entityCode }],
|
|
75
|
+
requiredFields: ["entityPropertyCode", "entityPropertyName", "valueType"],
|
|
76
|
+
page: 1,
|
|
77
|
+
pageSize: null,
|
|
78
|
+
sorts: []
|
|
79
|
+
};
|
|
80
|
+
const list = await useDataQuery.execute(p).then((res) => res.data.object.list);
|
|
81
|
+
getComponentJson(list);
|
|
82
|
+
return list;
|
|
83
|
+
};
|
|
84
|
+
const fieldListApi = async () => {
|
|
85
|
+
const list = await getFieldList();
|
|
86
|
+
return list.map((item) => ({
|
|
87
|
+
showName: item.entityPropertyName,
|
|
88
|
+
fieldCode: item.entityPropertyCode
|
|
89
|
+
}));
|
|
90
|
+
};
|
|
91
|
+
const goBack = (reloadStatus = routerReloadStatus.view) => {
|
|
92
|
+
routeBackTab(reloadStatus);
|
|
93
|
+
};
|
|
94
|
+
return {
|
|
95
|
+
goBack,
|
|
96
|
+
formConfig,
|
|
97
|
+
getInitRenderJSON,
|
|
98
|
+
vfdRef,
|
|
99
|
+
getComponentJson,
|
|
100
|
+
getFieldList,
|
|
101
|
+
fieldListApi
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
export {
|
|
105
|
+
useLowcode
|
|
106
|
+
};
|