@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.
Files changed (125) hide show
  1. package/_virtual/virtual_svg-icons-register.js +2 -2
  2. package/index.js +12 -9
  3. package/package.json +3 -2
  4. package/src/components/CustomRender/components/AttachmentRender.vue2.js +8 -13
  5. package/src/components/TpfCollapse/TpfCollapseTitle.vue2.js +3 -4
  6. package/src/components/code-editor/index.vue2.js +3 -4
  7. package/src/components/form-designer/form-widget/container-widget/container-wrapper.vue.js +22 -30
  8. package/src/components/form-designer/form-widget/container-widget/data-table-widget.vue.js +2 -3
  9. package/src/components/form-designer/form-widget/container-widget/grid-col-widget.vue.js +15 -23
  10. package/src/components/form-designer/form-widget/container-widget/grid-sub-form-widget.vue.js +2 -3
  11. package/src/components/form-designer/form-widget/container-widget/grid-widget.vue.js +1 -1
  12. package/src/components/form-designer/form-widget/container-widget/sub-form-widget.vue.js +2 -3
  13. package/src/components/form-designer/form-widget/container-widget/tab-widget.vue.js +2 -3
  14. package/src/components/form-designer/form-widget/container-widget/table-cell-widget.vue.js +26 -21
  15. package/src/components/form-designer/form-widget/container-widget/table-widget.vue.js +2 -3
  16. package/src/components/form-designer/form-widget/container-widget/vf-box-item.vue.js +1 -1
  17. package/src/components/form-designer/form-widget/container-widget/vf-box-widget.vue.js +2 -3
  18. package/src/components/form-designer/form-widget/container-widget/vf-collapse-widget.vue.js +4 -8
  19. package/src/components/form-designer/form-widget/container-widget/vf-collapse-widget.vue2.js +1 -1
  20. package/src/components/form-designer/form-widget/container-widget/vf-dialog-widget.vue.js +2 -3
  21. package/src/components/form-designer/form-widget/container-widget/vf-drawer-widget.vue.js +2 -3
  22. package/src/components/form-designer/form-widget/field-widget/attachment-render-widget.vue.js +6 -8
  23. package/src/components/form-designer/form-widget/field-widget/bpmn-editor-widget.vue.js +5 -6
  24. package/src/components/form-designer/form-widget/field-widget/button-widget.vue.js +1 -1
  25. package/src/components/form-designer/form-widget/field-widget/cascader-widget.vue.js +2 -3
  26. package/src/components/form-designer/form-widget/field-widget/checkbox-widget.vue.js +5 -6
  27. package/src/components/form-designer/form-widget/field-widget/code-editor-widget.vue.js +1 -1
  28. package/src/components/form-designer/form-widget/field-widget/color-widget.vue.js +5 -6
  29. package/src/components/form-designer/form-widget/field-widget/date-range-widget.vue.js +2 -3
  30. package/src/components/form-designer/form-widget/field-widget/date-widget.vue.js +2 -3
  31. package/src/components/form-designer/form-widget/field-widget/divider-widget.vue.js +2 -2
  32. package/src/components/form-designer/form-widget/field-widget/divider-widget.vue2.js +1 -0
  33. package/src/components/form-designer/form-widget/field-widget/diy-compontent-widget.vue.js +4 -6
  34. package/src/components/form-designer/form-widget/field-widget/dropdown-widget.vue.js +1 -1
  35. package/src/components/form-designer/form-widget/field-widget/file-upload-widget.vue.js +9 -14
  36. package/src/components/form-designer/form-widget/field-widget/form-item-wrapper.vue.js +29 -41
  37. package/src/components/form-designer/form-widget/field-widget/html-text-widget.vue.js +3 -4
  38. package/src/components/form-designer/form-widget/field-widget/html-text-widget.vue2.js +1 -0
  39. package/src/components/form-designer/form-widget/field-widget/input-widget.vue.js +2 -3
  40. package/src/components/form-designer/form-widget/field-widget/number-widget.vue.js +2 -3
  41. package/src/components/form-designer/form-widget/field-widget/picture-upload-widget.vue.js +15 -12
  42. package/src/components/form-designer/form-widget/field-widget/radio-widget.vue.js +5 -6
  43. package/src/components/form-designer/form-widget/field-widget/rate-widget.vue.js +1 -1
  44. package/src/components/form-designer/form-widget/field-widget/rich-editor-widget.vue.js +1 -1
  45. package/src/components/form-designer/form-widget/field-widget/select-widget.vue.js +3 -5
  46. package/src/components/form-designer/form-widget/field-widget/slider-widget.vue.js +5 -6
  47. package/src/components/form-designer/form-widget/field-widget/slot-widget.vue.js +4 -6
  48. package/src/components/form-designer/form-widget/field-widget/static-content-wrapper.vue.js +19 -24
  49. package/src/components/form-designer/form-widget/field-widget/static-text-widget.vue.js +2 -2
  50. package/src/components/form-designer/form-widget/field-widget/static-text-widget.vue2.js +1 -0
  51. package/src/components/form-designer/form-widget/field-widget/switch-widget.vue.js +1 -1
  52. package/src/components/form-designer/form-widget/field-widget/textarea-widget.vue.js +2 -3
  53. package/src/components/form-designer/form-widget/field-widget/time-range-widget.vue.js +5 -6
  54. package/src/components/form-designer/form-widget/field-widget/time-widget.vue.js +5 -6
  55. package/src/components/form-designer/form-widget/field-widget/treeSelect-widget.vue.js +2 -3
  56. package/src/components/form-designer/form-widget/index.vue.js +10 -17
  57. package/{designer.js → src/components/form-designer/index.vue.js} +10 -11
  58. package/src/components/form-designer/setting-panel/form-crud-setting.vue.js +2 -4
  59. package/src/components/form-designer/setting-panel/form-setting.vue.js +14 -18
  60. package/src/components/form-designer/setting-panel/index.vue.js +206 -216
  61. package/src/components/form-designer/setting-panel/option-items-setting.vue.js +23 -28
  62. package/src/components/form-designer/setting-panel/property-editor/actionColumnPosition-editor.vue.js +1 -1
  63. package/src/components/form-designer/setting-panel/property-editor/actionColumnPosition-editor.vue2.js +1 -0
  64. package/src/components/form-designer/setting-panel/property-editor/button-list-editor.vue.js +3 -4
  65. package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-pagination-editor.vue.js +2 -2
  66. package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-selections-editor.vue.js +2 -2
  67. package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-showButtonsColumn-editor.vue.js +5 -6
  68. package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-tableColumns-editor.vue.js +2 -365
  69. package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-tableColumns-editor.vue2.js +361 -0
  70. package/src/components/form-designer/setting-panel/property-editor/container-grid/gutter-editor.vue.js +4 -6
  71. package/src/components/form-designer/setting-panel/property-editor/container-tab/tab-customClass-editor.vue.js +5 -6
  72. package/src/components/form-designer/setting-panel/property-editor/container-vf-dialog/bodyStyle-editor.vue.js +3 -4
  73. package/src/components/form-designer/setting-panel/property-editor/container-vf-drawer/vf-drawer-direction-editor.vue.js +8 -8
  74. package/src/components/form-designer/setting-panel/property-editor/disabled-editor.vue.js +2 -2
  75. package/src/components/form-designer/setting-panel/property-editor/field-button/shape-editor.vue.js +6 -6
  76. package/src/components/form-designer/setting-panel/property-editor/field-button/type-editor.vue.js +12 -12
  77. package/src/components/form-designer/setting-panel/property-editor/field-cascader/cascader-defaultValue-editor.vue.js +1 -2
  78. package/src/components/form-designer/setting-panel/property-editor/field-checkbox/checkbox-defaultValue-editor.vue.js +1 -2
  79. package/src/components/form-designer/setting-panel/property-editor/field-date/date-format-editor.vue.js +8 -8
  80. package/src/components/form-designer/setting-panel/property-editor/field-date/date-type-editor.vue.js +10 -10
  81. package/src/components/form-designer/setting-panel/property-editor/field-date/date-valueFormat-editor.vue.js +8 -8
  82. package/src/components/form-designer/setting-panel/property-editor/field-date-range/date-range-format-editor.vue.js +10 -10
  83. package/src/components/form-designer/setting-panel/property-editor/field-date-range/date-range-type-editor.vue.js +6 -6
  84. package/src/components/form-designer/setting-panel/property-editor/field-date-range/date-range-valueFormat-editor.vue.js +8 -8
  85. package/src/components/form-designer/setting-panel/property-editor/field-divider/contentPosition-editor.vue.js +6 -6
  86. package/src/components/form-designer/setting-panel/property-editor/field-divider/divider-direction-editor.vue.js +4 -4
  87. package/src/components/form-designer/setting-panel/property-editor/field-number/controlsPosition-editor.vue.js +4 -4
  88. package/src/components/form-designer/setting-panel/property-editor/field-radio/radio-defaultValue-editor.vue.js +1 -2
  89. package/src/components/form-designer/setting-panel/property-editor/field-select/select-defaultValue-editor.vue.js +1 -2
  90. package/src/components/form-designer/setting-panel/property-editor/field-time/time-format-editor.vue.js +4 -4
  91. package/src/components/form-designer/setting-panel/property-editor/field-time-range/time-range-format-editor.vue.js +4 -4
  92. package/src/components/form-designer/setting-panel/property-editor/hidden-editor.vue.js +2 -2
  93. package/src/components/form-designer/setting-panel/property-editor/type-editor.vue.js +4 -4
  94. package/src/components/form-designer/toolbar-panel/index.vue.js +2 -1045
  95. package/src/components/form-designer/toolbar-panel/index.vue2.js +1046 -0
  96. package/src/components/form-designer/widget-panel/index.vue.js +7 -13
  97. package/src/components/form-designer/widget-panel/widgetsConfig.js +2 -2
  98. package/src/components/form-render/container-item/grid-col-item.vue.js +2 -4
  99. package/src/components/form-render/container-item/grid-sub-form-item.vue.js +4 -8
  100. package/src/components/form-render/container-item/sub-form-item.vue.js +25 -38
  101. package/src/components/form-render/container-item/table-cell-item.vue.js +1 -2
  102. package/src/components/form-render/container-item/vf-collapse-item.vue.js +4 -6
  103. package/src/components/form-render/dynamic-dialog.vue.js +52 -64
  104. package/src/components/form-render/dynamic-drawer.vue.js +2 -3
  105. package/{render.js → src/components/form-render/index.vue.js} +71 -81
  106. package/src/components/http-editor/index.vue.js +16 -16
  107. package/src/components/public/ActionButtonListDialog.vue.js +23 -24
  108. package/src/components/public/CustomerModal/CustomerModal.vue.js +4 -0
  109. package/src/components/public/CustomerModal/CustomerModal.vue2.js +74 -0
  110. package/src/components/public/CustomerModal/useCustomerModal.js +34 -0
  111. package/src/components/public/QuillEditor/index.vue.js +1 -2
  112. package/src/components/public/methoad-item.vue.js +1 -2
  113. package/src/components/svg-icon/index.vue.js +2 -4
  114. package/src/hooks/useLowcode.js +106 -0
  115. package/stats.html +1 -1
  116. package/styles/style.css +1 -1
  117. package/types/install.d.ts +1 -2
  118. package/types/install.d.ts.map +1 -1
  119. package/types/src/components/public/CustomerModal/CustomerModal.d.ts +6 -0
  120. package/types/src/components/public/CustomerModal/CustomerModal.d.ts.map +1 -0
  121. package/types/src/hooks/useLowcode.d.ts +21 -0
  122. package/types/src/hooks/useLowcode.d.ts.map +1 -0
  123. package/types/designer.d.ts +0 -1
  124. package/types/index.d.ts +0 -1
  125. package/types/render.d.ts +0 -1
@@ -1,1050 +1,7 @@
1
- import { defineAsyncComponent, resolveComponent, createElementBlock, openBlock, createElementVNode, createVNode, createBlock, createCommentVNode, withCtx, normalizeStyle, createTextVNode, toDisplayString, Fragment, renderList, renderSlot, normalizeClass } from "vue";
2
- import { traverseAllWidgets, generateId, copyToClipboard, getQueryParam, addWindowResizeHandler } from "../../../utils/util.js";
3
- import i18n from "../../../utils/i18n.js";
4
- import { generateCode } from "../../../utils/code-generator.js";
5
- import { saveAs } from "file-saver";
6
- import axios from "axios";
7
- import SvgIcon from "../../svg-icon/index.vue.js";
8
- import { fmtHttpParams } from "../../../utils/request/fmtHttpParams.js";
9
- import { getLocat } from "@kp-ui/tool";
10
- import { cloneDeep } from "lodash-es";
1
+ import _sfc_main from "./index.vue2.js";
11
2
  /* empty css */
12
3
  import _export_sfc from "../../../../_virtual/_plugin-vue_export-helper.js";
13
- const _sfc_main = {
14
- name: "ToolbarPanel",
15
- mixins: [i18n],
16
- components: {
17
- VFormRender: defineAsyncComponent(() => import("../../../../render.js")),
18
- CodeEditor: defineAsyncComponent(async () => {
19
- const { TpfCodeEditor } = await import("tmgc2-share");
20
- return TpfCodeEditor;
21
- }),
22
- TpfModal: defineAsyncComponent(async () => {
23
- const { TpfModal } = await import("tmgc2-share");
24
- return TpfModal;
25
- }),
26
- SvgIcon
27
- },
28
- props: {
29
- leftWidth: Number,
30
- rightWidth: Number,
31
- changeRightWidth: Function,
32
- changeLeftWidth: Function,
33
- designer: Object,
34
- saveJsonApi: Function,
35
- globalDsv: {
36
- type: Object,
37
- default: () => ({})
38
- }
39
- },
40
- inject: ["getDesignerConfig"],
41
- data() {
42
- return {
43
- cloneDeep,
44
- vfCtx: { type: "add", ...getLocat() },
45
- designerConfig: this.getDesignerConfig(),
46
- toolbarWidth: 460,
47
- showPreviewDialogFlag: false,
48
- showImportJsonDialogFlag: false,
49
- showExportJsonDialogFlag: false,
50
- showExportCodeDialogFlag: false,
51
- showFormDataDialogFlag: false,
52
- showExportSFCDialogFlag: false,
53
- showNodeTreeDrawerFlag: false,
54
- nodeTreeData: [],
55
- importTemplate: "",
56
- jsonContent: "",
57
- jsonRawContent: "",
58
- formDataJson: "",
59
- formDataRawJson: "",
60
- vueCode: "",
61
- htmlCode: "",
62
- sfcCode: "",
63
- sfcCodeV3: "",
64
- activeCodeTab: "vue",
65
- activeSFCTab: "vue2",
66
- testFormData: {
67
- // 'userName': '666888',
68
- // 'productItems': [
69
- // {'pName': 'iPhone12', 'pNum': 10},
70
- // {'pName': 'P50', 'pNum': 16},
71
- // ]
72
- select62173: 2
73
- },
74
- testOptionData: {
75
- select62173: [
76
- { label: "01", value: 1 },
77
- { label: "22", value: 2 },
78
- { label: "333", value: 3 }
79
- ],
80
- select001: [
81
- { label: "辣椒", value: 1 },
82
- { label: "菠萝", value: 2 },
83
- { label: "丑橘子", value: 3 }
84
- ]
85
- }
86
- };
87
- },
88
- computed: {
89
- formJson() {
90
- return {
91
- // widgetList: this.designer.widgetList,
92
- // formConfig: this.designer.formConfig
93
- widgetList: cloneDeep(this.designer.widgetList),
94
- formConfig: cloneDeep(this.designer.formConfig)
95
- };
96
- },
97
- undoDisabled() {
98
- return !this.designer.undoEnabled();
99
- },
100
- redoDisabled() {
101
- return !this.designer.redoEnabled();
102
- },
103
- layoutType() {
104
- return this.designer.getLayoutType();
105
- },
106
- designerDsv() {
107
- return this.globalDsv;
108
- }
109
- },
110
- watch: {
111
- "designer.widgetList": {
112
- deep: true,
113
- handler(val) {
114
- }
115
- }
116
- },
117
- mounted() {
118
- const maxTBWidth = this.designerConfig.toolbarMaxWidth || 460;
119
- const minTBWidth = this.designerConfig.toolbarMinWidth || 300;
120
- const newTBWidth = window.innerWidth - 260 - 300 - 320 - 80;
121
- this.toolbarWidth = newTBWidth >= maxTBWidth ? maxTBWidth : newTBWidth <= minTBWidth ? minTBWidth : newTBWidth;
122
- addWindowResizeHandler(() => {
123
- this.$nextTick(() => {
124
- const newTBWidth2 = window.innerWidth - 260 - 300 - 320 - 80;
125
- this.toolbarWidth = newTBWidth2 >= maxTBWidth ? maxTBWidth : newTBWidth2 <= minTBWidth ? minTBWidth : newTBWidth2;
126
- });
127
- });
128
- },
129
- methods: {
130
- saveJson() {
131
- if (this.saveJsonApi) {
132
- this.saveJsonApi(this.formJson);
133
- }
134
- },
135
- setReadMode() {
136
- this.$refs.preForm.setFormData({
137
- fileupload26481: [
138
- {
139
- // fileCode: '88927836217345',
140
- // fileSavePath: 'file/',
141
- // fileSaveName: '88927836217345.xlsx',
142
- // fileName: '备料清单导入模板.xlsx',
143
- // fileType: '.xlsx',
144
- // fileSize: 11239,
145
- // name: '备料清单导入模板.xlsx',
146
- // uid: '__AUTO__1717584897101_0__',
147
- fileCode: "89046755221505",
148
- fileName: "首页-透明工厂.png",
149
- guidebookId: 89046782484481,
150
- id: 89046782484482
151
- }
152
- ]
153
- });
154
- },
155
- showToolButton(configName) {
156
- if (this.designerConfig[configName] === void 0) {
157
- return true;
158
- }
159
- return !!this.designerConfig[configName];
160
- },
161
- buildTreeNodeOfWidget(widget, treeNode) {
162
- const curNode = {
163
- id: widget.id,
164
- label: widget.options.label || widget.type
165
- //selectable: true,
166
- };
167
- treeNode.push(curNode);
168
- if (widget.category === void 0) {
169
- return;
170
- }
171
- curNode.children = [];
172
- if (widget.type === "grid") {
173
- widget.cols.map((col) => {
174
- const colNode = {
175
- id: col.id,
176
- label: col.options.name || widget.type,
177
- children: []
178
- };
179
- curNode.children.push(colNode);
180
- col.widgetList.map((wChild) => {
181
- this.buildTreeNodeOfWidget(wChild, colNode.children);
182
- });
183
- });
184
- } else if (widget.type === "table") {
185
- widget.rows.map((row) => {
186
- const rowNode = {
187
- id: row.id,
188
- label: "table-row",
189
- selectable: false,
190
- children: []
191
- };
192
- curNode.children.push(rowNode);
193
- row.cols.map((cell) => {
194
- if (!!cell.merged) {
195
- return;
196
- }
197
- const rowChildren = rowNode.children;
198
- const cellNode = {
199
- id: cell.id,
200
- label: "table-cell",
201
- children: []
202
- };
203
- rowChildren.push(cellNode);
204
- cell.widgetList.map((wChild) => {
205
- this.buildTreeNodeOfWidget(wChild, cellNode.children);
206
- });
207
- });
208
- });
209
- } else if (widget.type === "tab") {
210
- widget.tabs.map((tab) => {
211
- const tabNode = {
212
- id: tab.id,
213
- label: tab.options.name || widget.type,
214
- selectable: false,
215
- children: []
216
- };
217
- curNode.children.push(tabNode);
218
- tab.widgetList.map((wChild) => {
219
- this.buildTreeNodeOfWidget(wChild, tabNode.children);
220
- });
221
- });
222
- } else if (widget.type === "sub-form") {
223
- widget.widgetList.map((wChild) => {
224
- this.buildTreeNodeOfWidget(wChild, curNode.children);
225
- });
226
- } else if (widget.category === "container") {
227
- widget.widgetList.map((wChild) => {
228
- this.buildTreeNodeOfWidget(wChild, curNode.children);
229
- });
230
- }
231
- },
232
- refreshNodeTree() {
233
- this.nodeTreeData.length = 0;
234
- this.designer.widgetList.forEach((wItem) => {
235
- this.buildTreeNodeOfWidget(wItem, this.nodeTreeData);
236
- });
237
- },
238
- showNodeTreeDrawer() {
239
- this.refreshNodeTree();
240
- this.showNodeTreeDrawerFlag = true;
241
- this.$nextTick(() => {
242
- if (!!this.designer.selectedId) ;
243
- });
244
- },
245
- undoHistory() {
246
- this.designer.undoHistoryStep();
247
- },
248
- redoHistory() {
249
- this.designer.redoHistoryStep();
250
- },
251
- changeLayoutType(newType) {
252
- this.designer.changeLayoutType(newType);
253
- },
254
- clearFormWidget() {
255
- this.designer.clearDesigner();
256
- this.designer.formWidget.clearWidgetRefList();
257
- this.$message.success("ok");
258
- },
259
- previewForm() {
260
- this.showPreviewDialogFlag = true;
261
- },
262
- saveAsFile(fileContent, defaultFileName) {
263
- const value = "json.json";
264
- if (getQueryParam("vscode") == 1) {
265
- this.vsSaveFile(value, fileContent);
266
- return;
267
- }
268
- const fileBlob = new Blob([fileContent], { type: "text/plain;charset=utf-8" });
269
- saveAs(fileBlob, value);
270
- },
271
- vsSaveFile(fileName, fileContent) {
272
- const msgObj = {
273
- cmd: "writeFile",
274
- data: {
275
- fileName,
276
- code: fileContent
277
- }
278
- };
279
- window.parent.postMessage(msgObj, "*");
280
- },
281
- importJson() {
282
- this.importTemplate = JSON.stringify(this.designer.getImportTemplate(), null, " ");
283
- this.showImportJsonDialogFlag = true;
284
- },
285
- doJsonImport() {
286
- try {
287
- const importObj = JSON.parse(this.importTemplate);
288
- if (!importObj || !importObj.formConfig) {
289
- throw new Error(this.i18nt("designer.hint.invalidJsonFormat"));
290
- }
291
- this.designer.loadFormJson(importObj);
292
- this.showImportJsonDialogFlag = false;
293
- this.$message.success(this.i18nt("designer.hint.importJsonSuccess"));
294
- this.designer.emitHistoryChange();
295
- this.designer.emitEvent("form-json-imported", []);
296
- } catch (ex) {
297
- this.$message.error(ex + "");
298
- }
299
- },
300
- exportJson() {
301
- const widgetList = cloneDeep(this.designer.widgetList);
302
- const formConfig = cloneDeep(this.designer.formConfig);
303
- this.jsonContent = JSON.stringify({ widgetList, formConfig }, null, " ");
304
- this.jsonRawContent = JSON.stringify({ widgetList, formConfig });
305
- this.showExportJsonDialogFlag = true;
306
- },
307
- copyFormJson(e) {
308
- copyToClipboard(
309
- this.jsonRawContent,
310
- e,
311
- this.$message,
312
- this.i18nt("designer.hint.copyJsonSuccess"),
313
- this.i18nt("designer.hint.copyJsonFail")
314
- );
315
- },
316
- saveFormJson() {
317
- this.saveAsFile(this.jsonContent, `vform${generateId()}.json`);
318
- },
319
- exportCode() {
320
- this.vueCode = generateCode(this.formJson);
321
- this.htmlCode = generateCode(this.formJson, "html");
322
- this.showExportCodeDialogFlag = true;
323
- },
324
- copyVueCode(e) {
325
- copyToClipboard(
326
- this.vueCode,
327
- e,
328
- this.$message,
329
- this.i18nt("designer.hint.copyVueCodeSuccess"),
330
- this.i18nt("designer.hint.copyVueCodeFail")
331
- );
332
- },
333
- copyHtmlCode(e) {
334
- copyToClipboard(
335
- this.htmlCode,
336
- e,
337
- this.$message,
338
- this.i18nt("designer.hint.copyHtmlCodeSuccess"),
339
- this.i18nt("designer.hint.copyHtmlCodeFail")
340
- );
341
- },
342
- saveVueCode() {
343
- this.saveAsFile(this.vueCode, `vform${generateId()}.vue`);
344
- },
345
- saveHtmlCode() {
346
- this.saveAsFile(this.htmlCode, `vform${generateId()}.html`);
347
- },
348
- generateSFC() {
349
- },
350
- copyV2SFC(e) {
351
- copyToClipboard(
352
- this.sfcCode,
353
- e,
354
- this.$message,
355
- this.i18nt("designer.hint.copySFCSuccess"),
356
- this.i18nt("designer.hint.copySFCFail")
357
- );
358
- },
359
- copyV3SFC(e) {
360
- copyToClipboard(
361
- this.sfcCodeV3,
362
- e,
363
- this.$message,
364
- this.i18nt("designer.hint.copySFCSuccess"),
365
- this.i18nt("designer.hint.copySFCFail")
366
- );
367
- },
368
- saveV2SFC() {
369
- this.saveAsFile(this.sfcCode, `vformV2-${generateId()}.vue`);
370
- },
371
- saveV3SFC() {
372
- this.saveAsFile(this.sfcCodeV3, `vformV3-${generateId()}.vue`);
373
- },
374
- async insertData() {
375
- const data = await this.$refs["preForm"].getFormData();
376
- const formConfig = this.designer.formConfig;
377
- const res = await fmtHttpParams.call(this, formConfig.serveList.vformUpdate, data);
378
- console.log("res: insertData", res);
379
- },
380
- async showData() {
381
- const formConfig = this.designer.formConfig;
382
- const { id: _id } = getLocat();
383
- const dsResult = await fmtHttpParams(formConfig.serveList.vformDetail, { _id });
384
- const leaveDates = [
385
- { date: "2024-10-28" },
386
- { date: "2024-10-29" },
387
- { date: "2024-10-20" }
388
- ];
389
- this.$refs["preForm"].getWidgetRef("leaveDates").setValue(leaveDates);
390
- this.$refs.preForm.setFormData({
391
- ...dsResult
392
- });
393
- this.$refs.preForm.setReadMode(true);
394
- },
395
- getFormData() {
396
- this.$refs["preForm"].getFormData().then((formData) => {
397
- console.log("formData: ", formData);
398
- this.formDataJson = JSON.stringify(formData, null, " ");
399
- this.formDataRawJson = JSON.stringify(formData);
400
- this.showFormDataDialogFlag = true;
401
- }).catch((error) => {
402
- this.$message.error(error);
403
- });
404
- },
405
- copyFormDataJson(e) {
406
- copyToClipboard(
407
- this.formDataRawJson,
408
- e,
409
- this.$message,
410
- this.i18nt("designer.hint.copyJsonSuccess"),
411
- this.i18nt("designer.hint.copyJsonFail")
412
- );
413
- },
414
- saveFormData() {
415
- this.saveAsFile(this.htmlCode, `formData${generateId()}.json`);
416
- },
417
- resetForm() {
418
- this.$refs["preForm"].resetForm();
419
- },
420
- setFormDisabled() {
421
- this.$refs["preForm"].disableForm();
422
- },
423
- setFormEnabled() {
424
- this.$refs["preForm"].enableForm();
425
- },
426
- testLoadForm() {
427
- axios.get(
428
- "https://www.fastmock.site/mock/e9710039bb5f11262d1a0f2f0bbe08c8/vform3/getFS"
429
- ).then((res) => {
430
- const newFormJson = res.data;
431
- this.$refs.preForm.setFormJson(newFormJson);
432
- this.$nextTick(() => {
433
- const newFormData = { input30696: "668899" };
434
- this.$refs.preForm.setFormData(newFormData);
435
- });
436
- }).catch((err) => {
437
- });
438
- },
439
- async testSetFormJson() {
440
- const { widgetList } = await import("./widgetList.js");
441
- const newFormJson = {
442
- widgetList,
443
- formConfig: {
444
- labelWidth: 150,
445
- labelPosition: "horizontal",
446
- size: "",
447
- labelAlign: "label-right-align",
448
- cssCode: "",
449
- customClass: [],
450
- functions: "",
451
- onFormCreated: "",
452
- onFormDataChange: "",
453
- handleOnSubmit: "",
454
- onFormValidate: ""
455
- }
456
- };
457
- this.$refs.preForm.setFormJson(newFormJson);
458
- this.$nextTick(() => {
459
- this.$refs.preForm.setFormData({
460
- input12931: "asdf",
461
- input23031: "input23031",
462
- textarea21654: "textarea21654",
463
- input113152: "input113152",
464
- input40240: "input40240"
465
- });
466
- });
467
- },
468
- testSetFormData() {
469
- const testFD = {
470
- input89263: "899668"
471
- };
472
- this.$refs.preForm.setFormData(testFD);
473
- },
474
- testReloadOptionData() {
475
- this.testOptionData["select001"].push({
476
- label: "aaa",
477
- value: 888
478
- });
479
- this.$refs.preForm.reloadOptionData();
480
- },
481
- handleFormChange(fieldName, newValue, oldValue, formModel) {
482
- console.log("formModel", formModel);
483
- },
484
- testOnAppendButtonClick(clickedWidget) {
485
- console.log("test", clickedWidget);
486
- },
487
- testOnButtonClick(button) {
488
- console.log("test", button);
489
- },
490
- onMyEmitTest(aaa) {
491
- console.log("-----", aaa);
492
- },
493
- findWidgetById(wId) {
494
- let foundW = null;
495
- traverseAllWidgets(this.designer.widgetList, (w) => {
496
- if (w.id === wId) {
497
- foundW = w;
498
- }
499
- });
500
- return foundW;
501
- },
502
- onNodeTreeClick(nodeData, node, nodeEl) {
503
- if (nodeData.selectable !== void 0 && !nodeData.selectable) {
504
- this.$message.info(this.i18nt("designer.hint.currentNodeCannotBeSelected"));
505
- } else {
506
- const selectedId = nodeData.id;
507
- const foundW = this.findWidgetById(selectedId);
508
- if (!!foundW) {
509
- this.designer.setSelected(foundW);
510
- }
511
- }
512
- }
513
- }
514
- };
515
- const _hoisted_1 = { class: "toolbar-container" };
516
- const _hoisted_2 = { class: "left-toolbar" };
517
- const _hoisted_3 = { class: "right-toolbar" };
518
- const _hoisted_4 = { class: "right-toolbar-con" };
519
- const _hoisted_5 = { class: "dialog-footer" };
520
- const _hoisted_6 = { class: "dialog-footer" };
521
- const _hoisted_7 = { class: "dialog-footer" };
522
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
523
- const _component_svg_icon = resolveComponent("svg-icon");
524
- const _component_a_button = resolveComponent("a-button");
525
- const _component_a_radio_button = resolveComponent("a-radio-button");
526
- const _component_a_radio_group = resolveComponent("a-radio-group");
527
- const _component_a_tree = resolveComponent("a-tree");
528
- const _component_a_drawer = resolveComponent("a-drawer");
529
- const _component_VFormRender = resolveComponent("VFormRender");
530
- const _component_TpfModal = resolveComponent("TpfModal");
531
- const _component_a_alert = resolveComponent("a-alert");
532
- const _component_code_editor = resolveComponent("code-editor");
533
- const _component_a_modal = resolveComponent("a-modal");
534
- const _component_CodeEditor = resolveComponent("CodeEditor");
535
- const _component_a_tab_pane = resolveComponent("a-tab-pane");
536
- const _component_a_tabs = resolveComponent("a-tabs");
537
- return openBlock(), createElementBlock("div", _hoisted_1, [
538
- createElementVNode("div", _hoisted_2, [
539
- createVNode(_component_a_button, {
540
- type: "link",
541
- onClick: _cache[0] || (_cache[0] = ($event) => $props.changeLeftWidth())
542
- }, {
543
- default: withCtx(() => [
544
- createVNode(_component_svg_icon, {
545
- style: normalizeStyle(`transform:${$props.leftWidth === 0 ? "rotate(180deg)" : "rotate(0deg)"}`),
546
- "icon-class": "a-ipadarrow_back"
547
- }, null, 8, ["style"])
548
- ]),
549
- _: 1
550
- }),
551
- createVNode(_component_a_button, {
552
- type: "link",
553
- disabled: $options.undoDisabled,
554
- title: _ctx.i18nt("designer.toolbar.undoHint"),
555
- onClick: $options.undoHistory
556
- }, {
557
- default: withCtx(() => [
558
- createVNode(_component_svg_icon, { "icon-class": "undo" })
559
- ]),
560
- _: 1
561
- }, 8, ["disabled", "title", "onClick"]),
562
- createVNode(_component_a_button, {
563
- type: "link",
564
- disabled: $options.redoDisabled,
565
- title: _ctx.i18nt("designer.toolbar.redoHint"),
566
- onClick: $options.redoHistory
567
- }, {
568
- default: withCtx(() => [
569
- createVNode(_component_svg_icon, { "icon-class": "redo" })
570
- ]),
571
- _: 1
572
- }, 8, ["disabled", "title", "onClick"]),
573
- createVNode(_component_a_radio_group, {
574
- value: $options.layoutType,
575
- "onUpdate:value": _cache[4] || (_cache[4] = ($event) => $options.layoutType = $event)
576
- }, {
577
- default: withCtx(() => [
578
- createVNode(_component_a_radio_button, {
579
- value: "PC",
580
- type: $options.layoutType === "PC" ? "primary" : "",
581
- onClick: _cache[1] || (_cache[1] = ($event) => $options.changeLayoutType("PC"))
582
- }, {
583
- default: withCtx(() => [
584
- createTextVNode(toDisplayString(_ctx.i18nt("designer.toolbar.pcLayout")), 1)
585
- ]),
586
- _: 1
587
- }, 8, ["type"]),
588
- createVNode(_component_a_radio_button, {
589
- value: "Pad",
590
- type: $options.layoutType === "Pad" ? "primary" : "",
591
- onClick: _cache[2] || (_cache[2] = ($event) => $options.changeLayoutType("Pad"))
592
- }, {
593
- default: withCtx(() => [
594
- createTextVNode(toDisplayString(_ctx.i18nt("designer.toolbar.padLayout")), 1)
595
- ]),
596
- _: 1
597
- }, 8, ["type"]),
598
- createVNode(_component_a_radio_button, {
599
- type: $options.layoutType === "H5" ? "primary" : "",
600
- onClick: _cache[3] || (_cache[3] = ($event) => $options.changeLayoutType("H5")),
601
- value: "H5"
602
- }, {
603
- default: withCtx(() => [
604
- createTextVNode(toDisplayString(_ctx.i18nt("designer.toolbar.mobileLayout")), 1)
605
- ]),
606
- _: 1
607
- }, 8, ["type"])
608
- ]),
609
- _: 1
610
- }, 8, ["value"])
611
- ]),
612
- createVNode(_component_a_drawer, {
613
- title: _ctx.i18nt("designer.toolbar.nodeTreeTitle"),
614
- direction: "ltr",
615
- visible: $data.showNodeTreeDrawerFlag,
616
- "onUpdate:visible": _cache[5] || (_cache[5] = ($event) => $data.showNodeTreeDrawerFlag = $event),
617
- width: 280,
618
- "destroy-on-close": true,
619
- class: "node-tree-drawer"
620
- }, {
621
- default: withCtx(() => [
622
- createVNode(_component_a_tree, {
623
- ref: "nodeTree",
624
- treeData: $data.nodeTreeData,
625
- "default-expand-all": "",
626
- "highlight-current": "",
627
- class: "node-tree",
628
- "icon-class": "el-icon-arrow-right",
629
- fieldNames: { children: "children", title: "label", key: "id" }
630
- }, null, 8, ["treeData"])
631
- ]),
632
- _: 1
633
- }, 8, ["title", "visible"]),
634
- createElementVNode("div", _hoisted_3, [
635
- createElementVNode("div", _hoisted_4, [
636
- $options.showToolButton("clearDesignerButton") ? (openBlock(), createBlock(_component_a_button, {
637
- key: 0,
638
- type: "link",
639
- onClick: $options.clearFormWidget
640
- }, {
641
- default: withCtx(() => [
642
- createVNode(_component_svg_icon, { "icon-class": "el-delete" }),
643
- createTextVNode(toDisplayString(_ctx.i18nt("designer.toolbar.clear")), 1)
644
- ]),
645
- _: 1
646
- }, 8, ["onClick"])) : createCommentVNode("", true),
647
- $options.showToolButton("previewFormButton") ? (openBlock(), createBlock(_component_a_button, {
648
- key: 1,
649
- type: "link",
650
- onClick: $options.previewForm
651
- }, {
652
- default: withCtx(() => [
653
- createVNode(_component_svg_icon, { "icon-class": "el-view" }),
654
- createTextVNode(toDisplayString(_ctx.i18nt("designer.toolbar.preview")), 1)
655
- ]),
656
- _: 1
657
- }, 8, ["onClick"])) : createCommentVNode("", true),
658
- $options.showToolButton("importJsonButton") ? (openBlock(), createBlock(_component_a_button, {
659
- key: 2,
660
- type: "link",
661
- onClick: $options.importJson
662
- }, {
663
- default: withCtx(() => [
664
- createTextVNode(toDisplayString(_ctx.i18nt("designer.toolbar.importJson")), 1)
665
- ]),
666
- _: 1
667
- }, 8, ["onClick"])) : createCommentVNode("", true),
668
- $options.showToolButton("exportJsonButton") ? (openBlock(), createBlock(_component_a_button, {
669
- key: 3,
670
- type: "link",
671
- onClick: $options.exportJson
672
- }, {
673
- default: withCtx(() => [
674
- createTextVNode(toDisplayString(_ctx.i18nt("designer.toolbar.exportJson")), 1)
675
- ]),
676
- _: 1
677
- }, 8, ["onClick"])) : createCommentVNode("", true),
678
- $options.showToolButton("exportCodeButton") ? (openBlock(), createBlock(_component_a_button, {
679
- key: 4,
680
- type: "link",
681
- onClick: $options.saveJson
682
- }, {
683
- default: withCtx(() => _cache[23] || (_cache[23] = [
684
- createTextVNode(" 保存 ")
685
- ])),
686
- _: 1
687
- }, 8, ["onClick"])) : createCommentVNode("", true),
688
- createVNode(_component_a_button, {
689
- type: "link",
690
- onClick: _cache[6] || (_cache[6] = ($event) => $props.changeRightWidth())
691
- }, {
692
- default: withCtx(() => [
693
- createVNode(_component_svg_icon, {
694
- style: normalizeStyle(`transform:${$props.rightWidth === 0 ? "rotate(0deg)" : "rotate(180deg)"}`),
695
- "icon-class": "a-ipadarrow_back"
696
- }, null, 8, ["style"])
697
- ]),
698
- _: 1
699
- }),
700
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.$slots, (idx, slotName) => {
701
- return renderSlot(_ctx.$slots, slotName, {}, void 0, true);
702
- }), 256))
703
- ])
704
- ]),
705
- createVNode(_component_TpfModal, {
706
- title: _ctx.i18nt("designer.toolbar.preview"),
707
- visible: $data.showPreviewDialogFlag,
708
- "onUpdate:visible": _cache[8] || (_cache[8] = ($event) => $data.showPreviewDialogFlag = $event),
709
- "show-close": true,
710
- "close-on-click-modal": false,
711
- "close-on-press-escape": false,
712
- center: "",
713
- "destroy-on-close": true,
714
- "append-to-body": true,
715
- class: "drag-dialog",
716
- width: "75%",
717
- fullscreen: $options.layoutType === "H5" || $options.layoutType === "Pad"
718
- }, {
719
- footerRight: withCtx(() => [
720
- createVNode(_component_a_button, { onClick: $options.showData }, {
721
- default: withCtx(() => _cache[24] || (_cache[24] = [
722
- createTextVNode("数据回显")
723
- ])),
724
- _: 1
725
- }, 8, ["onClick"]),
726
- createVNode(_component_a_button, {
727
- type: "primary",
728
- onClick: $options.getFormData
729
- }, {
730
- default: withCtx(() => [
731
- createTextVNode(toDisplayString(_ctx.i18nt("designer.hint.getFormData")), 1)
732
- ]),
733
- _: 1
734
- }, 8, ["onClick"]),
735
- createVNode(_component_a_button, {
736
- type: "primary",
737
- onClick: $options.resetForm
738
- }, {
739
- default: withCtx(() => [
740
- createTextVNode(toDisplayString(_ctx.i18nt("designer.hint.resetForm")), 1)
741
- ]),
742
- _: 1
743
- }, 8, ["onClick"]),
744
- createVNode(_component_a_button, {
745
- type: "primary",
746
- onClick: $options.setFormDisabled
747
- }, {
748
- default: withCtx(() => [
749
- createTextVNode(toDisplayString(_ctx.i18nt("designer.hint.disableForm")), 1)
750
- ]),
751
- _: 1
752
- }, 8, ["onClick"]),
753
- createVNode(_component_a_button, {
754
- type: "primary",
755
- onClick: $options.setFormEnabled
756
- }, {
757
- default: withCtx(() => [
758
- createTextVNode(toDisplayString(_ctx.i18nt("designer.hint.enableForm")), 1)
759
- ]),
760
- _: 1
761
- }, 8, ["onClick"]),
762
- createVNode(_component_a_button, {
763
- onClick: _cache[7] || (_cache[7] = ($event) => $data.showPreviewDialogFlag = false)
764
- }, {
765
- default: withCtx(() => [
766
- createTextVNode(toDisplayString(_ctx.i18nt("designer.hint.closePreview")), 1)
767
- ]),
768
- _: 1
769
- })
770
- ]),
771
- default: withCtx(() => [
772
- createElementVNode("div", null, [
773
- createElementVNode("div", {
774
- class: normalizeClass(["form-render-wrapper", [
775
- $options.layoutType === "H5" ? "h5-layout" : $options.layoutType === "Pad" ? "pad-layout" : ""
776
- ]])
777
- }, [
778
- createVNode(_component_VFormRender, {
779
- vfCtx: $data.vfCtx,
780
- ref: "preForm",
781
- "form-json": $data.cloneDeep($options.formJson),
782
- "form-data": $data.testFormData,
783
- "preview-state": true,
784
- "option-data": $data.testOptionData,
785
- "global-dsv": $options.designerDsv,
786
- onMyEmitTest: $options.onMyEmitTest,
787
- onAppendButtonClick: $options.testOnAppendButtonClick,
788
- onButtonClick: $options.testOnButtonClick,
789
- onFormChange: $options.handleFormChange
790
- }, null, 8, ["vfCtx", "form-json", "form-data", "option-data", "global-dsv", "onMyEmitTest", "onAppendButtonClick", "onButtonClick", "onFormChange"])
791
- ], 2)
792
- ])
793
- ]),
794
- _: 1
795
- }, 8, ["title", "visible", "fullscreen"]),
796
- createVNode(_component_a_modal, {
797
- title: _ctx.i18nt("designer.toolbar.importJson"),
798
- visible: $data.showImportJsonDialogFlag,
799
- "onUpdate:visible": _cache[11] || (_cache[11] = ($event) => $data.showImportJsonDialogFlag = $event),
800
- "show-close": true,
801
- class: "drag-dialog",
802
- "append-to-body": true,
803
- center: "",
804
- width: "1200px",
805
- "close-on-click-modal": false,
806
- "close-on-press-escape": false,
807
- "destroy-on-close": true
808
- }, {
809
- footer: withCtx(() => [
810
- createElementVNode("div", _hoisted_5, [
811
- createVNode(_component_a_button, {
812
- type: "primary",
813
- onClick: $options.doJsonImport
814
- }, {
815
- default: withCtx(() => [
816
- createTextVNode(toDisplayString(_ctx.i18nt("designer.hint.import")), 1)
817
- ]),
818
- _: 1
819
- }, 8, ["onClick"]),
820
- createVNode(_component_a_button, {
821
- onClick: _cache[10] || (_cache[10] = ($event) => $data.showImportJsonDialogFlag = false)
822
- }, {
823
- default: withCtx(() => [
824
- createTextVNode(toDisplayString(_ctx.i18nt("designer.hint.cancel")), 1)
825
- ]),
826
- _: 1
827
- })
828
- ])
829
- ]),
830
- default: withCtx(() => [
831
- createVNode(_component_a_alert, {
832
- type: "info",
833
- message: _ctx.i18nt("designer.hint.importJsonHint"),
834
- "show-icon": "",
835
- class: "alert-padding"
836
- }, null, 8, ["message"]),
837
- createVNode(_component_code_editor, {
838
- mode: "json",
839
- readonly: false,
840
- modelValue: $data.importTemplate,
841
- "onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => $data.importTemplate = $event)
842
- }, null, 8, ["modelValue"])
843
- ]),
844
- _: 1
845
- }, 8, ["title", "visible"]),
846
- createVNode(_component_a_modal, {
847
- title: _ctx.i18nt("designer.toolbar.exportJson"),
848
- visible: $data.showExportJsonDialogFlag,
849
- "onUpdate:visible": _cache[14] || (_cache[14] = ($event) => $data.showExportJsonDialogFlag = $event),
850
- "show-close": true,
851
- class: "drag-dialog",
852
- center: "",
853
- "append-to-body": "",
854
- width: "1200px",
855
- "close-on-click-modal": false,
856
- "close-on-press-escape": false,
857
- "destroy-on-close": true
858
- }, {
859
- footer: withCtx(() => [
860
- createElementVNode("div", _hoisted_6, [
861
- createVNode(_component_a_button, {
862
- type: "primary",
863
- class: "copy-json-btn",
864
- "data-clipboard-text": $data.jsonRawContent,
865
- onClick: $options.copyFormJson
866
- }, {
867
- default: withCtx(() => [
868
- createTextVNode(toDisplayString(_ctx.i18nt("designer.hint.copyJson")), 1)
869
- ]),
870
- _: 1
871
- }, 8, ["data-clipboard-text", "onClick"]),
872
- createVNode(_component_a_button, { onClick: $options.saveFormJson }, {
873
- default: withCtx(() => [
874
- createTextVNode(toDisplayString(_ctx.i18nt("designer.hint.saveFormJson")), 1)
875
- ]),
876
- _: 1
877
- }, 8, ["onClick"]),
878
- createVNode(_component_a_button, {
879
- onClick: _cache[13] || (_cache[13] = ($event) => $data.showExportJsonDialogFlag = false)
880
- }, {
881
- default: withCtx(() => [
882
- createTextVNode(toDisplayString(_ctx.i18nt("designer.hint.closePreview")), 1)
883
- ]),
884
- _: 1
885
- })
886
- ])
887
- ]),
888
- default: withCtx(() => [
889
- createVNode(_component_code_editor, {
890
- mode: "json",
891
- readonly: true,
892
- modelValue: $data.jsonContent,
893
- "onUpdate:modelValue": _cache[12] || (_cache[12] = ($event) => $data.jsonContent = $event)
894
- }, null, 8, ["modelValue"])
895
- ]),
896
- _: 1
897
- }, 8, ["title", "visible"]),
898
- createVNode(_component_TpfModal, {
899
- title: _ctx.i18nt("designer.hint.exportFormData"),
900
- visible: $data.showFormDataDialogFlag,
901
- "onUpdate:visible": _cache[17] || (_cache[17] = ($event) => $data.showFormDataDialogFlag = $event),
902
- width: "1200px"
903
- }, {
904
- footerRight: withCtx(() => [
905
- createVNode(_component_a_button, {
906
- type: "primary",
907
- class: "copy-form-data-json-btn",
908
- "data-clipboard-text": $data.formDataRawJson,
909
- onClick: $options.copyFormDataJson
910
- }, {
911
- default: withCtx(() => [
912
- createTextVNode(toDisplayString(_ctx.i18nt("designer.hint.copyFormData")), 1)
913
- ]),
914
- _: 1
915
- }, 8, ["data-clipboard-text", "onClick"]),
916
- createVNode(_component_a_button, { onClick: $options.saveFormData }, {
917
- default: withCtx(() => [
918
- createTextVNode(toDisplayString(_ctx.i18nt("designer.hint.saveFormData")), 1)
919
- ]),
920
- _: 1
921
- }, 8, ["onClick"]),
922
- createVNode(_component_a_button, {
923
- onClick: _cache[16] || (_cache[16] = ($event) => $data.showFormDataDialogFlag = false)
924
- }, {
925
- default: withCtx(() => [
926
- createTextVNode(toDisplayString(_ctx.i18nt("designer.hint.closePreview")), 1)
927
- ]),
928
- _: 1
929
- })
930
- ]),
931
- default: withCtx(() => [
932
- createVNode(_component_CodeEditor, {
933
- mode: "json",
934
- readonly: true,
935
- modelValue: $data.formDataJson,
936
- "onUpdate:modelValue": _cache[15] || (_cache[15] = ($event) => $data.formDataJson = $event)
937
- }, null, 8, ["modelValue"])
938
- ]),
939
- _: 1
940
- }, 8, ["title", "visible"]),
941
- $data.showExportSFCDialogFlag ? (openBlock(), createBlock(_component_a_modal, {
942
- key: 0,
943
- title: _ctx.i18nt("designer.toolbar.generateSFC"),
944
- visible: $data.showExportSFCDialogFlag,
945
- "onUpdate:visible": _cache[22] || (_cache[22] = ($event) => $data.showExportSFCDialogFlag = $event),
946
- "append-to-body": "",
947
- "show-close": true,
948
- class: "drag-dialog",
949
- center: "",
950
- width: "65%",
951
- "close-on-click-modal": false,
952
- "close-on-press-escape": false,
953
- "destroy-on-close": true
954
- }, {
955
- footer: withCtx(() => [
956
- createElementVNode("div", _hoisted_7, [
957
- createVNode(_component_a_button, {
958
- type: "primary",
959
- class: "copy-vue2-sfc-btn",
960
- "data-clipboard-text": $data.sfcCode,
961
- onClick: $options.copyV2SFC
962
- }, {
963
- default: withCtx(() => [
964
- createTextVNode(toDisplayString(_ctx.i18nt("designer.hint.copyVue2SFC")), 1)
965
- ]),
966
- _: 1
967
- }, 8, ["data-clipboard-text", "onClick"]),
968
- createVNode(_component_a_button, {
969
- type: "primary",
970
- class: "copy-vue3-sfc-btn",
971
- "data-clipboard-text": $data.sfcCodeV3,
972
- onClick: $options.copyV3SFC
973
- }, {
974
- default: withCtx(() => [
975
- createTextVNode(toDisplayString(_ctx.i18nt("designer.hint.copyVue3SFC")), 1)
976
- ]),
977
- _: 1
978
- }, 8, ["data-clipboard-text", "onClick"]),
979
- createVNode(_component_a_button, { onClick: $options.saveV2SFC }, {
980
- default: withCtx(() => [
981
- createTextVNode(toDisplayString(_ctx.i18nt("designer.hint.saveVue2SFC")), 1)
982
- ]),
983
- _: 1
984
- }, 8, ["onClick"]),
985
- createVNode(_component_a_button, { onClick: $options.saveV3SFC }, {
986
- default: withCtx(() => [
987
- createTextVNode(toDisplayString(_ctx.i18nt("designer.hint.saveVue3SFC")), 1)
988
- ]),
989
- _: 1
990
- }, 8, ["onClick"]),
991
- createVNode(_component_a_button, {
992
- onClick: _cache[21] || (_cache[21] = ($event) => $data.showExportSFCDialogFlag = false)
993
- }, {
994
- default: withCtx(() => [
995
- createTextVNode(toDisplayString(_ctx.i18nt("designer.hint.closePreview")), 1)
996
- ]),
997
- _: 1
998
- })
999
- ])
1000
- ]),
1001
- default: withCtx(() => [
1002
- createVNode(_component_a_tabs, {
1003
- type: "border-card",
1004
- class: "no-box-shadow no-padding",
1005
- activeKey: $data.activeSFCTab,
1006
- "onUpdate:activeKey": _cache[20] || (_cache[20] = ($event) => $data.activeSFCTab = $event)
1007
- }, {
1008
- default: withCtx(() => [
1009
- createVNode(_component_a_tab_pane, {
1010
- tab: "Vue2",
1011
- key: "vue2"
1012
- }, {
1013
- default: withCtx(() => [
1014
- createVNode(_component_code_editor, {
1015
- mode: "html",
1016
- readonly: true,
1017
- modelValue: $data.sfcCode,
1018
- "onUpdate:modelValue": _cache[18] || (_cache[18] = ($event) => $data.sfcCode = $event),
1019
- "user-worker": false
1020
- }, null, 8, ["modelValue"])
1021
- ]),
1022
- _: 1
1023
- }),
1024
- createVNode(_component_a_tab_pane, {
1025
- tab: "Vue3",
1026
- key: "vue3"
1027
- }, {
1028
- default: withCtx(() => [
1029
- createVNode(_component_code_editor, {
1030
- mode: "html",
1031
- readonly: true,
1032
- modelValue: $data.sfcCodeV3,
1033
- "onUpdate:modelValue": _cache[19] || (_cache[19] = ($event) => $data.sfcCodeV3 = $event),
1034
- "user-worker": false
1035
- }, null, 8, ["modelValue"])
1036
- ]),
1037
- _: 1
1038
- })
1039
- ]),
1040
- _: 1
1041
- }, 8, ["activeKey"])
1042
- ]),
1043
- _: 1
1044
- }, 8, ["title", "visible"])) : createCommentVNode("", true)
1045
- ]);
1046
- }
1047
- const ToolbarPanel = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-c255c476"]]);
4
+ const ToolbarPanel = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-c98bfce3"]]);
1048
5
  export {
1049
6
  ToolbarPanel as default
1050
7
  };