@kp-ui/lowcode 1.0.68 → 1.0.69
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/package.json +2 -2
- package/packages/tmgc2-share/src/components/TpfCodeEditor/code-editor.vue.js +7 -0
- package/packages/tmgc2-share/src/components/TpfCodeEditor/code-editor.vue2.js +164 -0
- package/packages/tmgc2-share/src/components/TpfModal/index.vue.js +7 -0
- package/packages/tmgc2-share/src/components/TpfModal/index.vue2.js +173 -0
- package/packages/tmgc2-share/src/components/TpfModal/index.vue3.js +1 -0
- package/render.js +6 -7
- package/src/components/code-editor/code-modal-editor.vue.js +54 -67
- package/src/components/code-editor/code-modal-editor.vue2.js +1 -42
- package/src/components/form-designer/form-widget/index.vue.js +5 -3
- package/src/components/form-designer/setting-panel/form-setting.vue.js +1 -1
- package/src/components/form-designer/setting-panel/index.vue.js +24 -71
- package/src/components/form-designer/setting-panel/property-editor/button-list-editor.vue.js +2 -2
- package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-dsEnabled-editor.vue.js +7 -6
- 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-tableColumns-editor.vue.js +63 -62
- package/src/components/form-designer/setting-panel/property-editor/field-dropdown/dropdown-menuList-editor.vue.js +2 -2
- package/src/components/form-designer/toolbar-panel/index.vue.js +99 -108
- package/src/components/form-designer/widget-panel/index.vue.js +4 -2
- package/src/components/form-render/dynamic-dialog.vue.js +5 -6
- package/src/components/http-editor/index.vue.js +6 -5
- package/src/components/http-editor/index.vue2.js +2 -2
- package/src/components/public/ActionButtonListDialog.vue2.js +2 -2
- package/src/mixins/useDataTableMixin.js +8 -5
- package/styles/style.css +1 -1
- package/types/src/lang/en-US.d.ts +440 -0
- package/types/src/lang/en-US.d.ts.map +1 -0
- package/types/src/lang/en-US_extension.d.ts +24 -0
- package/types/src/lang/en-US_extension.d.ts.map +1 -0
- package/types/src/lang/en-US_render.d.ts +39 -0
- package/types/src/lang/en-US_render.d.ts.map +1 -0
- package/types/src/lang/zh-CN.d.ts +450 -0
- package/types/src/lang/zh-CN.d.ts.map +1 -0
- package/types/src/lang/zh-CN_extension.d.ts +24 -0
- package/types/src/lang/zh-CN_extension.d.ts.map +1 -0
- package/types/src/lang/zh-CN_render.d.ts +39 -0
- package/types/src/lang/zh-CN_render.d.ts.map +1 -0
- package/types/src/utils/i18n.d.ts +14 -0
- package/types/src/utils/i18n.d.ts.map +1 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
if (typeof window !== "undefined") {
|
|
2
2
|
let loadSvg = function() {
|
|
3
3
|
var body = document.body;
|
|
4
|
-
var svgDom = document.getElementById("
|
|
4
|
+
var svgDom = document.getElementById("__svg__icons__dom__1749546173066__");
|
|
5
5
|
if (!svgDom) {
|
|
6
6
|
svgDom = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
7
7
|
svgDom.style.position = "absolute";
|
|
8
8
|
svgDom.style.width = "0";
|
|
9
9
|
svgDom.style.height = "0";
|
|
10
|
-
svgDom.id = "
|
|
10
|
+
svgDom.id = "__svg__icons__dom__1749546173066__";
|
|
11
11
|
svgDom.setAttribute("xmlns", "http://www.w3.org/2000/svg");
|
|
12
12
|
svgDom.setAttribute("xmlns:link", "http://www.w3.org/1999/xlink");
|
|
13
13
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kp-ui/lowcode",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.69",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"types": "main.d.ts",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@element-plus/icons-vue": "^0.2.4",
|
|
12
|
-
"@kp-ui/tool": "1.0.
|
|
12
|
+
"@kp-ui/tool": "1.0.27",
|
|
13
13
|
"@surely-vue/table": "^5.0.3",
|
|
14
14
|
"animate.css": "^4.1.1",
|
|
15
15
|
"ant-design-vue": "3.2.20",
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import _sfc_main from "./code-editor.vue2.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import _export_sfc from "../../../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const codeEditor = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-6fc4d8d1"]]);
|
|
5
|
+
export {
|
|
6
|
+
codeEditor as default
|
|
7
|
+
};
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { defineComponent, ref, computed, watch, watchEffect, onMounted, createElementBlock, openBlock, createElementVNode } from "vue";
|
|
2
|
+
const _hoisted_1 = { class: "ace-container" };
|
|
3
|
+
const themePath = "ace/theme/sqlserver";
|
|
4
|
+
const modePath = "ace/mode/javascript";
|
|
5
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
6
|
+
__name: "code-editor",
|
|
7
|
+
props: {
|
|
8
|
+
value: {},
|
|
9
|
+
modelValue: {},
|
|
10
|
+
readonly: { type: Boolean },
|
|
11
|
+
mode: {},
|
|
12
|
+
userWorker: { type: Boolean }
|
|
13
|
+
},
|
|
14
|
+
emits: ["update:modelValue", "update:value"],
|
|
15
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
16
|
+
const props = __props;
|
|
17
|
+
const emit = __emit;
|
|
18
|
+
const aceRef = ref(null);
|
|
19
|
+
const aceEditor = ref(null);
|
|
20
|
+
const stop = ref(false);
|
|
21
|
+
const codeValue = computed(() => props.value || props.modelValue);
|
|
22
|
+
const isLoading = ref(false);
|
|
23
|
+
const setValue = (newValue) => {
|
|
24
|
+
if (aceEditor.value) {
|
|
25
|
+
aceEditor.value.getSession().setValue(newValue);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
const getEditorAnnotations = () => {
|
|
29
|
+
var _a;
|
|
30
|
+
return (_a = aceEditor.value) == null ? void 0 : _a.getSession().getAnnotations();
|
|
31
|
+
};
|
|
32
|
+
const setJsonMode = () => {
|
|
33
|
+
var _a;
|
|
34
|
+
(_a = aceEditor.value) == null ? void 0 : _a.getSession().setMode("ace/mode/json");
|
|
35
|
+
};
|
|
36
|
+
const setCssMode = () => {
|
|
37
|
+
var _a;
|
|
38
|
+
(_a = aceEditor.value) == null ? void 0 : _a.getSession().setMode("ace/mode/css");
|
|
39
|
+
};
|
|
40
|
+
const setGroovyMode = () => {
|
|
41
|
+
var _a;
|
|
42
|
+
(_a = aceEditor.value) == null ? void 0 : _a.getSession().setMode("ace/mode/groovy");
|
|
43
|
+
};
|
|
44
|
+
const addAutoCompletion = (ace) => {
|
|
45
|
+
const acData = [
|
|
46
|
+
{
|
|
47
|
+
meta: "VForm API",
|
|
48
|
+
caption: "getWidgetRef",
|
|
49
|
+
value: "getWidgetRef()",
|
|
50
|
+
score: 1
|
|
51
|
+
},
|
|
52
|
+
{ meta: "VForm API", caption: "getFormRef", value: "getFormRef()", score: 1 },
|
|
53
|
+
{
|
|
54
|
+
meta: "VForm API",
|
|
55
|
+
caption: "getParentFormRef",
|
|
56
|
+
value: "getParentFormRef()",
|
|
57
|
+
score: 1
|
|
58
|
+
}
|
|
59
|
+
//TODO: 待补充!!
|
|
60
|
+
];
|
|
61
|
+
const langTools = ace.require("ace/ext/language_tools");
|
|
62
|
+
langTools.addCompleter({
|
|
63
|
+
getCompletions: function(editor, session, pos, prefix, callback) {
|
|
64
|
+
if (prefix.length === 0) {
|
|
65
|
+
return callback(null, []);
|
|
66
|
+
} else {
|
|
67
|
+
return callback(null, acData);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
};
|
|
72
|
+
watch(
|
|
73
|
+
() => props.value,
|
|
74
|
+
(val) => {
|
|
75
|
+
if (stop.value) return;
|
|
76
|
+
if (val) {
|
|
77
|
+
setValue(val);
|
|
78
|
+
stop.value = true;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
);
|
|
82
|
+
const initEditor = async () => {
|
|
83
|
+
isLoading.value = true;
|
|
84
|
+
const ace = await import("ace-builds");
|
|
85
|
+
const ACE_BASE_PATH = "https://ks3-cn-beijing.ksyun.com/vform2021/ace-mini";
|
|
86
|
+
ace.config.set("basePath", ACE_BASE_PATH);
|
|
87
|
+
await Promise.all([
|
|
88
|
+
import("ace-builds/src-min-noconflict/theme-sqlserver"),
|
|
89
|
+
import("ace-builds/src-min-noconflict/mode-javascript"),
|
|
90
|
+
import("ace-builds/src-min-noconflict/ext-language_tools")
|
|
91
|
+
]);
|
|
92
|
+
if (props.mode === "json") {
|
|
93
|
+
await import("ace-builds/src-min-noconflict/mode-json");
|
|
94
|
+
} else if (props.mode === "css") {
|
|
95
|
+
await import("ace-builds/src-min-noconflict/mode-css");
|
|
96
|
+
} else if (props.mode === "groovy") {
|
|
97
|
+
await import("ace-builds/src-min-noconflict/mode-groovy");
|
|
98
|
+
}
|
|
99
|
+
addAutoCompletion(ace);
|
|
100
|
+
aceEditor.value = ace.edit(aceRef.value, {
|
|
101
|
+
minLines: 10,
|
|
102
|
+
// 最小行数,还未到最大行数时,编辑器会自动伸缩大小
|
|
103
|
+
fontSize: 12,
|
|
104
|
+
// 编辑器内字体大小
|
|
105
|
+
theme: themePath,
|
|
106
|
+
// 默认设置的主题
|
|
107
|
+
mode: modePath,
|
|
108
|
+
// 默认设置的语言模式
|
|
109
|
+
tabSize: 4,
|
|
110
|
+
// 制表符设置为2个空格大小
|
|
111
|
+
readOnly: props.readonly,
|
|
112
|
+
highlightActiveLine: true,
|
|
113
|
+
value: codeValue.value
|
|
114
|
+
});
|
|
115
|
+
aceEditor.value.setOptions({
|
|
116
|
+
enableBasicAutocompletion: true,
|
|
117
|
+
enableSnippets: true,
|
|
118
|
+
// 设置代码片段提示
|
|
119
|
+
enableLiveAutocompletion: true
|
|
120
|
+
// 设置自动提示
|
|
121
|
+
});
|
|
122
|
+
if (props.mode === "json") {
|
|
123
|
+
setJsonMode();
|
|
124
|
+
} else if (props.mode === "css") {
|
|
125
|
+
setCssMode();
|
|
126
|
+
} else if (props.mode === "groovy") {
|
|
127
|
+
setGroovyMode();
|
|
128
|
+
}
|
|
129
|
+
aceEditor.value.getSession().on("change", (ev) => {
|
|
130
|
+
var _a, _b;
|
|
131
|
+
emit("update:modelValue", (_a = aceEditor.value) == null ? void 0 : _a.getValue());
|
|
132
|
+
emit("update:value", (_b = aceEditor.value) == null ? void 0 : _b.getValue());
|
|
133
|
+
});
|
|
134
|
+
isLoading.value = false;
|
|
135
|
+
};
|
|
136
|
+
watchEffect(() => {
|
|
137
|
+
var _a;
|
|
138
|
+
(_a = aceEditor.value) == null ? void 0 : _a.setOptions({
|
|
139
|
+
readOnly: props.readonly,
|
|
140
|
+
mode: props.mode,
|
|
141
|
+
useWorker: props.userWorker
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
onMounted(() => {
|
|
145
|
+
initEditor();
|
|
146
|
+
});
|
|
147
|
+
__expose({
|
|
148
|
+
initEditor,
|
|
149
|
+
getEditorAnnotations
|
|
150
|
+
});
|
|
151
|
+
return (_ctx, _cache) => {
|
|
152
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
153
|
+
createElementVNode("div", {
|
|
154
|
+
class: "ace-editor",
|
|
155
|
+
ref_key: "aceRef",
|
|
156
|
+
ref: aceRef
|
|
157
|
+
}, null, 512)
|
|
158
|
+
]);
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
export {
|
|
163
|
+
_sfc_main as default
|
|
164
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import _sfc_main from "./index.vue2.js";
|
|
2
|
+
import "./index.vue3.js";
|
|
3
|
+
import _export_sfc from "../../../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-e452bc7b"]]);
|
|
5
|
+
export {
|
|
6
|
+
index as default
|
|
7
|
+
};
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { defineComponent, useAttrs, useSlots, ref, createBlock, openBlock, createVNode, Teleport, withDirectives, mergeProps, Fragment, resolveComponent, resolveDirective, isVNode } from "vue";
|
|
2
|
+
import { Modal } from "ant-design-vue";
|
|
3
|
+
import { FullscreenExitOutlined, FullscreenOutlined, CloseOutlined } from "@ant-design/icons-vue";
|
|
4
|
+
import { useVModel } from "../../../../../node_modules/.pnpm/@vueuse_core@11.3.0_vue@3.5.16_typescript@5.8.2_/node_modules/@vueuse/core/index.js";
|
|
5
|
+
import { getUuidKey } from "@kp-ui/tool";
|
|
6
|
+
import { useI18n } from "@kp-ui/i18n";
|
|
7
|
+
function _isSlot(s) {
|
|
8
|
+
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
9
|
+
}
|
|
10
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
11
|
+
__name: "index",
|
|
12
|
+
props: {
|
|
13
|
+
useFull: {
|
|
14
|
+
type: Boolean,
|
|
15
|
+
default: true
|
|
16
|
+
},
|
|
17
|
+
visible: {
|
|
18
|
+
type: Boolean
|
|
19
|
+
},
|
|
20
|
+
width: {
|
|
21
|
+
default: "600px"
|
|
22
|
+
},
|
|
23
|
+
height: {
|
|
24
|
+
default: "440px"
|
|
25
|
+
},
|
|
26
|
+
getContainer: {
|
|
27
|
+
type: Function,
|
|
28
|
+
default: () => document.body
|
|
29
|
+
},
|
|
30
|
+
draggable: {
|
|
31
|
+
type: Boolean
|
|
32
|
+
},
|
|
33
|
+
bodyStyle: {
|
|
34
|
+
default: () => ({})
|
|
35
|
+
},
|
|
36
|
+
title: {},
|
|
37
|
+
type: {
|
|
38
|
+
default: ""
|
|
39
|
+
},
|
|
40
|
+
saveButtonProps: {
|
|
41
|
+
default: () => ({})
|
|
42
|
+
},
|
|
43
|
+
saveText: {},
|
|
44
|
+
leftNum: {}
|
|
45
|
+
},
|
|
46
|
+
emits: ["update:visible", "save"],
|
|
47
|
+
setup(__props, {
|
|
48
|
+
emit: __emit
|
|
49
|
+
}) {
|
|
50
|
+
const {
|
|
51
|
+
t
|
|
52
|
+
} = useI18n();
|
|
53
|
+
const props = __props;
|
|
54
|
+
const emit = __emit;
|
|
55
|
+
const attrs = useAttrs();
|
|
56
|
+
const slots = useSlots();
|
|
57
|
+
const innerVisible = useVModel(props, "visible", emit);
|
|
58
|
+
const fullscreen = ref(false);
|
|
59
|
+
const ModalClass = getUuidKey();
|
|
60
|
+
const onClose = () => {
|
|
61
|
+
fullscreen.value = false;
|
|
62
|
+
emit("update:visible", false);
|
|
63
|
+
};
|
|
64
|
+
const DefaultRightBtn = () => {
|
|
65
|
+
if (props.type === "") return null;
|
|
66
|
+
if (props.type === "view") {
|
|
67
|
+
let _slot;
|
|
68
|
+
return createVNode(resolveComponent("a-button"), {
|
|
69
|
+
"class": "tpf-button",
|
|
70
|
+
"onClick": () => onClose()
|
|
71
|
+
}, _isSlot(_slot = t("lang.关闭")) ? _slot : {
|
|
72
|
+
default: () => [_slot]
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
if (props.type === "edit") {
|
|
76
|
+
let _slot2;
|
|
77
|
+
return createVNode(Fragment, null, [createVNode(resolveComponent("a-button"), {
|
|
78
|
+
"class": "tpf-button",
|
|
79
|
+
"onClick": () => onClose()
|
|
80
|
+
}, _isSlot(_slot2 = t("lang.取消")) ? _slot2 : {
|
|
81
|
+
default: () => [_slot2]
|
|
82
|
+
}), createVNode(resolveComponent("a-button"), mergeProps({
|
|
83
|
+
"class": "tpf-button"
|
|
84
|
+
}, {
|
|
85
|
+
type: "primary",
|
|
86
|
+
onClick: () => emit("save"),
|
|
87
|
+
...props.saveButtonProps
|
|
88
|
+
}), {
|
|
89
|
+
default: () => [props.saveText || t("lang.保存")]
|
|
90
|
+
})]);
|
|
91
|
+
}
|
|
92
|
+
return null;
|
|
93
|
+
};
|
|
94
|
+
const DefaultLeftText = () => {
|
|
95
|
+
if (typeof props.leftNum === "number") {
|
|
96
|
+
return createVNode("div", null, [`${t("lang.已选择")}${props.leftNum}${t("lang.条数据")}`]);
|
|
97
|
+
}
|
|
98
|
+
return null;
|
|
99
|
+
};
|
|
100
|
+
const vNode = () => {
|
|
101
|
+
const {
|
|
102
|
+
draggable,
|
|
103
|
+
getContainer,
|
|
104
|
+
height,
|
|
105
|
+
width,
|
|
106
|
+
useFull,
|
|
107
|
+
bodyStyle
|
|
108
|
+
} = props;
|
|
109
|
+
return createVNode(Teleport, {
|
|
110
|
+
"to": getContainer()
|
|
111
|
+
}, {
|
|
112
|
+
default: () => [withDirectives(createVNode("div", {
|
|
113
|
+
"class": ModalClass
|
|
114
|
+
}, [createVNode(Modal, mergeProps({
|
|
115
|
+
"transitionName": !innerVisible.value ? "" : "zoom",
|
|
116
|
+
"maskTransitionName": !innerVisible.value ? "" : "fade",
|
|
117
|
+
"title": props.title,
|
|
118
|
+
"destroyOnClose": true,
|
|
119
|
+
"bodyStyle": {
|
|
120
|
+
height,
|
|
121
|
+
overflow: "auto",
|
|
122
|
+
...bodyStyle
|
|
123
|
+
},
|
|
124
|
+
"class": `tpf-model ${fullscreen.value ? "fullscreen" : ""}`,
|
|
125
|
+
"centered": true,
|
|
126
|
+
"getContainer": () => document.querySelector(`.${ModalClass}`),
|
|
127
|
+
"keyboard": false,
|
|
128
|
+
"maskClosable": false,
|
|
129
|
+
"width": width,
|
|
130
|
+
"visible": innerVisible.value,
|
|
131
|
+
"onUpdate:visible": ($event) => innerVisible.value = $event
|
|
132
|
+
}, attrs), {
|
|
133
|
+
...slots,
|
|
134
|
+
closeIcon: () => {
|
|
135
|
+
const Com = fullscreen.value ? FullscreenExitOutlined : FullscreenOutlined;
|
|
136
|
+
return createVNode(resolveComponent("a-space"), {
|
|
137
|
+
"style": {
|
|
138
|
+
padding: "0 20px 0 0"
|
|
139
|
+
}
|
|
140
|
+
}, {
|
|
141
|
+
default: () => [useFull && createVNode("div", {
|
|
142
|
+
"style": {
|
|
143
|
+
padding: "0 6px"
|
|
144
|
+
},
|
|
145
|
+
"onClick": (e) => {
|
|
146
|
+
e.stopPropagation();
|
|
147
|
+
e.preventDefault();
|
|
148
|
+
fullscreen.value = !fullscreen.value;
|
|
149
|
+
}
|
|
150
|
+
}, [createVNode(Com, null, null)]), createVNode(CloseOutlined, {
|
|
151
|
+
"onClick": onClose
|
|
152
|
+
}, null)]
|
|
153
|
+
});
|
|
154
|
+
},
|
|
155
|
+
footer: () => createVNode(Fragment, null, [createVNode("div", {
|
|
156
|
+
"class": "footer-left",
|
|
157
|
+
"style": {
|
|
158
|
+
paddingTop: "5px"
|
|
159
|
+
}
|
|
160
|
+
}, [slots.footerLeft ? slots.footerLeft() : createVNode(DefaultLeftText, null, null)]), createVNode("div", {
|
|
161
|
+
"class": "footer-right"
|
|
162
|
+
}, [slots.footerRight ? slots.footerRight() : createVNode(DefaultRightBtn, null, null)])])
|
|
163
|
+
})]), [[resolveDirective("dragModal"), draggable]])]
|
|
164
|
+
});
|
|
165
|
+
};
|
|
166
|
+
return (_ctx, _cache) => {
|
|
167
|
+
return openBlock(), createBlock(vNode);
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
export {
|
|
172
|
+
_sfc_main as default
|
|
173
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/render.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { resolveComponent, createBlock, openBlock, withCtx, createVNode, createElementVNode, normalizeStyle, withModifiers, normalizeClass, createElementBlock, Fragment, renderList, resolveDynamicComponent, createSlots, renderSlot, mergeProps, render, h } from "vue";
|
|
2
2
|
import emitter from "./src/utils/emitter.js";
|
|
3
3
|
import comps from "./src/components/form-designer/form-widget/field-widget/index.js";
|
|
4
|
+
import { TpfConfigProvider } from "tmgc2-share";
|
|
4
5
|
import { buildDefaultFormJson, getContainerWidgetByName, cloneFormConfigWithoutEventHandler, deepClone, getDSByName, overwriteObj, runDataSourceRequest, getAllContainerWidgets, getAllFieldWidgets, getDefaultFormConfig, traverseFieldWidgets, getFieldWidgetByName, traverseFieldWidgetsOfContainer, insertCustomCssToHead, insertGlobalFunctionsToHtml, generateId } from "./src/utils/util.js";
|
|
5
6
|
import i18n, { changeLocale } from "./src/utils/i18n.js";
|
|
6
7
|
import DynamicDialog from "./src/components/form-render/dynamic-dialog.vue.js";
|
|
@@ -13,6 +14,7 @@ const _sfc_main = {
|
|
|
13
14
|
componentName: "VFormRender",
|
|
14
15
|
mixins: [emitter, i18n],
|
|
15
16
|
components: {
|
|
17
|
+
TpfConfigProvider,
|
|
16
18
|
...comps
|
|
17
19
|
},
|
|
18
20
|
props: {
|
|
@@ -1008,11 +1010,8 @@ const _sfc_main = {
|
|
|
1008
1010
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1009
1011
|
const _component_a_form = resolveComponent("a-form");
|
|
1010
1012
|
const _component_a_spin = resolveComponent("a-spin");
|
|
1011
|
-
const
|
|
1012
|
-
return openBlock(), createBlock(
|
|
1013
|
-
"component-size": $options.size,
|
|
1014
|
-
input: { autocomplete: "off" }
|
|
1015
|
-
}, {
|
|
1013
|
+
const _component_TpfConfigProvider = resolveComponent("TpfConfigProvider");
|
|
1014
|
+
return openBlock(), createBlock(_component_TpfConfigProvider, null, {
|
|
1016
1015
|
default: withCtx(() => [
|
|
1017
1016
|
createVNode(_component_a_spin, { spinning: $data.isLoading }, {
|
|
1018
1017
|
default: withCtx(() => [
|
|
@@ -1078,9 +1077,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1078
1077
|
}, 8, ["spinning"])
|
|
1079
1078
|
]),
|
|
1080
1079
|
_: 3
|
|
1081
|
-
}
|
|
1080
|
+
});
|
|
1082
1081
|
}
|
|
1083
|
-
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-
|
|
1082
|
+
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-40b57ee1"]]);
|
|
1084
1083
|
export {
|
|
1085
1084
|
index as default
|
|
1086
1085
|
};
|
|
@@ -1,70 +1,57 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"
|
|
15
|
-
centered: true,
|
|
16
|
-
"append-to-body": "",
|
|
17
|
-
"close-on-click-modal": false,
|
|
18
|
-
"close-on-press-escape": false,
|
|
19
|
-
"destroy-on-close": true,
|
|
20
|
-
width: 800
|
|
1
|
+
import { defineComponent, mergeModels, ref, useModel, createBlock, openBlock, unref } from "vue";
|
|
2
|
+
import { useOpenAntdModal, TpfCodeEditor } from "tmgc2-share";
|
|
3
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
4
|
+
...{
|
|
5
|
+
name: "code-modal-editor"
|
|
6
|
+
},
|
|
7
|
+
__name: "code-modal-editor",
|
|
8
|
+
props: /* @__PURE__ */ mergeModels({
|
|
9
|
+
isShowEventHeader: { type: Boolean, default: true },
|
|
10
|
+
fnParams: {},
|
|
11
|
+
eventHeader: {},
|
|
12
|
+
title: { default: "事件处理函数" },
|
|
13
|
+
readonly: { type: Boolean, default: false },
|
|
14
|
+
mode: { default: "javascript" }
|
|
21
15
|
}, {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
message: "}"
|
|
62
|
-
})) : createCommentVNode("", true)
|
|
63
|
-
]),
|
|
64
|
-
_: 1
|
|
65
|
-
}, 8, ["title", "visible"]);
|
|
66
|
-
}
|
|
67
|
-
const CodeModalEditor = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
16
|
+
"modelValue": { type: String, default: "" },
|
|
17
|
+
"modelModifiers": {}
|
|
18
|
+
}),
|
|
19
|
+
emits: /* @__PURE__ */ mergeModels(["save"], ["update:modelValue"]),
|
|
20
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
21
|
+
const currentCode = ref("");
|
|
22
|
+
const code = useModel(__props, "modelValue");
|
|
23
|
+
const emit = __emit;
|
|
24
|
+
const [codeEditorRef, openCodeEditor] = useOpenAntdModal();
|
|
25
|
+
const open = (value) => {
|
|
26
|
+
currentCode.value = value;
|
|
27
|
+
code.value = value;
|
|
28
|
+
openCodeEditor();
|
|
29
|
+
};
|
|
30
|
+
const hanldeSave = (value) => {
|
|
31
|
+
emit("save", value);
|
|
32
|
+
code.value = value;
|
|
33
|
+
};
|
|
34
|
+
__expose({
|
|
35
|
+
codeEditorRef,
|
|
36
|
+
open
|
|
37
|
+
});
|
|
38
|
+
return (_ctx, _cache) => {
|
|
39
|
+
return openBlock(), createBlock(unref(TpfCodeEditor), {
|
|
40
|
+
isShowEventHeader: _ctx.isShowEventHeader,
|
|
41
|
+
ref_key: "codeEditorRef",
|
|
42
|
+
ref: codeEditorRef,
|
|
43
|
+
"fn-params": _ctx.fnParams,
|
|
44
|
+
eventHeader: _ctx.eventHeader,
|
|
45
|
+
modelValue: currentCode.value,
|
|
46
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => currentCode.value = $event),
|
|
47
|
+
mode: _ctx.mode,
|
|
48
|
+
readonly: _ctx.readonly,
|
|
49
|
+
title: _ctx.title,
|
|
50
|
+
onSetCode: hanldeSave
|
|
51
|
+
}, null, 8, ["isShowEventHeader", "fn-params", "eventHeader", "modelValue", "mode", "readonly", "title"]);
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
});
|
|
68
55
|
export {
|
|
69
|
-
|
|
56
|
+
_sfc_main as default
|
|
70
57
|
};
|
|
@@ -1,45 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import i18n from "../../utils/i18n.js";
|
|
3
|
-
const _sfc_main = {
|
|
4
|
-
name: "code-modal-editor",
|
|
5
|
-
mixins: [i18n],
|
|
6
|
-
components: {
|
|
7
|
-
CodeEditor
|
|
8
|
-
},
|
|
9
|
-
props: {
|
|
10
|
-
eventHeader: String,
|
|
11
|
-
title: {
|
|
12
|
-
type: String,
|
|
13
|
-
default: "事件处理函数"
|
|
14
|
-
},
|
|
15
|
-
readonly: {
|
|
16
|
-
type: Boolean,
|
|
17
|
-
default: false
|
|
18
|
-
},
|
|
19
|
-
mode: {
|
|
20
|
-
type: String,
|
|
21
|
-
default: "javascript"
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
data() {
|
|
25
|
-
return {
|
|
26
|
-
showWidgetEventDialogFlag: false,
|
|
27
|
-
eventHandlerCode: ""
|
|
28
|
-
};
|
|
29
|
-
},
|
|
30
|
-
methods: {
|
|
31
|
-
open(val) {
|
|
32
|
-
const value = val;
|
|
33
|
-
this.showWidgetEventDialogFlag = true;
|
|
34
|
-
this.eventHandlerCode = value.trim();
|
|
35
|
-
},
|
|
36
|
-
saveEventHandler() {
|
|
37
|
-
const val = this.eventHandlerCode.trim();
|
|
38
|
-
this.showWidgetEventDialogFlag = false;
|
|
39
|
-
this.$emit("save", val);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
};
|
|
1
|
+
import _sfc_main from "./code-modal-editor.vue.js";
|
|
43
2
|
export {
|
|
44
3
|
_sfc_main as default
|
|
45
4
|
};
|
|
@@ -2,6 +2,7 @@ import comps from "./field-widget/index.js";
|
|
|
2
2
|
import i18n from "../../../utils/i18n.js";
|
|
3
3
|
import draggableComponent from "../../../lib/vuedraggable/src/vuedraggable.js";
|
|
4
4
|
import _sfc_main$1 from "../../form-render/SubmitButtonRender.vue.js";
|
|
5
|
+
import { TpfConfigProvider } from "tmgc2-share";
|
|
5
6
|
import { resolveComponent, createBlock, openBlock, withCtx, createElementVNode, createVNode, normalizeClass, createElementBlock, createCommentVNode, toDisplayString, normalizeStyle, mergeProps, resolveDynamicComponent } from "vue";
|
|
6
7
|
/* empty css */
|
|
7
8
|
import _export_sfc from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
@@ -11,6 +12,7 @@ const _sfc_main = {
|
|
|
11
12
|
mixins: [i18n],
|
|
12
13
|
components: {
|
|
13
14
|
Draggable: draggableComponent,
|
|
15
|
+
TpfConfigProvider,
|
|
14
16
|
SubmitButtonRender: _sfc_main$1,
|
|
15
17
|
...comps
|
|
16
18
|
},
|
|
@@ -154,8 +156,8 @@ const _hoisted_3 = { class: "transition-group-el" };
|
|
|
154
156
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
155
157
|
const _component_draggable = resolveComponent("draggable");
|
|
156
158
|
const _component_a_form = resolveComponent("a-form");
|
|
157
|
-
const
|
|
158
|
-
return openBlock(), createBlock(
|
|
159
|
+
const _component_TpfConfigProvider = resolveComponent("TpfConfigProvider");
|
|
160
|
+
return openBlock(), createBlock(_component_TpfConfigProvider, {
|
|
159
161
|
"component-size": $options.size,
|
|
160
162
|
input: { autocomplete: "off" }
|
|
161
163
|
}, {
|
|
@@ -217,7 +219,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
217
219
|
_: 1
|
|
218
220
|
}, 8, ["component-size"]);
|
|
219
221
|
}
|
|
220
|
-
const VFormWidget = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-
|
|
222
|
+
const VFormWidget = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-4011cefc"]]);
|
|
221
223
|
export {
|
|
222
224
|
VFormWidget as default
|
|
223
225
|
};
|
|
@@ -523,7 +523,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
523
523
|
])) : createCommentVNode("", true)
|
|
524
524
|
]);
|
|
525
525
|
}
|
|
526
|
-
const FormSetting = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
526
|
+
const FormSetting = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-becbd35b"]]);
|
|
527
527
|
export {
|
|
528
528
|
FormSetting as default
|
|
529
529
|
};
|