element-less 0.0.73 → 0.0.74
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/custom/dynamic/common/aiSystemPrompt.d.ts +6 -0
- package/custom/dynamic/common/propertys/checkbox.d.ts +3 -0
- package/custom/dynamic/common/propertys/radio.d.ts +9 -0
- package/custom/dynamic/common/propertys/select.d.ts +9 -0
- package/custom/dynamic/common/propertys/table.d.ts +145 -17
- package/custom/dynamic/designerView/index.d.ts +76 -0
- package/custom/dynamic/designerView/src/designerView.d.ts +24 -0
- package/custom/dynamic/designerView/src/designerView.vue.d.ts +48 -0
- package/element-less.cjs +1 -1
- package/element-less.iife.js +1 -1
- package/element-less.js +1 -1
- package/element-less.umd.cjs +1 -1
- package/{index-C0SJ8qh4.js → index-BkcWYzI_.js} +797 -96
- package/index-DjrC26ts.cjs +1 -0
- package/inner-0Qwbn1gV.cjs +1 -0
- package/{inner-BVkvNO8N.js → inner-Ba84wZRD.js} +3 -3
- package/{innerItem-COru-kKY.js → innerItem-5Au5l5Jf.js} +1 -1
- package/{innerItem-DQulGWbl.cjs → innerItem-vGvvhSD8.cjs} +1 -1
- package/{mode-csharp-CFYsL6uB.cjs → mode-csharp-C2oUrQH_.cjs} +1 -1
- package/{mode-csharp-D6MaIFhw.js → mode-csharp-DpcfdC7v.js} +1 -1
- package/{mode-css-Dy8BzF_i.js → mode-css-Bw3HxevP.js} +1 -1
- package/{mode-css-BgjQCLpV.cjs → mode-css-DaOZ-Kyt.cjs} +1 -1
- package/{mode-javascript-8sxvp2xm.js → mode-javascript-B4nfmHwI.js} +1 -1
- package/{mode-javascript-BvlHrr1N.cjs → mode-javascript-BW2Gtk1B.cjs} +1 -1
- package/{mode-json-DoxC9nzJ.js → mode-json-B_6Rc56R.js} +1 -1
- package/{mode-json-BHDlkzCk.cjs → mode-json-Dj69lfnz.cjs} +1 -1
- package/{mode-mysql-Bg657uIn.cjs → mode-mysql-CGxHP8j2.cjs} +1 -1
- package/{mode-mysql-B7vGuPt6.js → mode-mysql-D25NsOyA.js} +1 -1
- package/package.json +1 -1
- package/style.css +1 -1
- package/index-BaFF5Gyj.cjs +0 -1
- package/inner-AI6AnYRd.cjs +0 -1
|
@@ -42503,6 +42503,13 @@ const _sfc_main$1_ = /* @__PURE__ */ defineComponent({
|
|
|
42503
42503
|
tableData.push(newRow);
|
|
42504
42504
|
emits2("update:editStatus", true);
|
|
42505
42505
|
}
|
|
42506
|
+
function handleEditCellChange(column, row, val) {
|
|
42507
|
+
const syncTo = column.syncTo;
|
|
42508
|
+
if (syncTo && (!row[syncTo] || row[syncTo] === row[column.prop])) {
|
|
42509
|
+
row[syncTo] = val;
|
|
42510
|
+
}
|
|
42511
|
+
row[column.prop] = val;
|
|
42512
|
+
}
|
|
42506
42513
|
setValue({
|
|
42507
42514
|
"menuClick": handleMenuCommand,
|
|
42508
42515
|
setEditData,
|
|
@@ -42633,7 +42640,7 @@ const _sfc_main$1_ = /* @__PURE__ */ defineComponent({
|
|
|
42633
42640
|
requiredMessage: column.requiredMessage,
|
|
42634
42641
|
prop: column.prop,
|
|
42635
42642
|
modelValue: slotProps.row[column.prop],
|
|
42636
|
-
"onUpdate:modelValue": (
|
|
42643
|
+
"onUpdate:modelValue": (val) => handleEditCellChange(column, slotProps.row, val)
|
|
42637
42644
|
}, { ref_for: true }, (column.editComponent || {}).props || {}, {
|
|
42638
42645
|
aIndex: slotProps.$index
|
|
42639
42646
|
}), null, 16, ["required", "requiredMessage", "prop", "modelValue", "onUpdate:modelValue", "aIndex"]))
|
|
@@ -42812,7 +42819,7 @@ const _sfc_main$1_ = /* @__PURE__ */ defineComponent({
|
|
|
42812
42819
|
};
|
|
42813
42820
|
}
|
|
42814
42821
|
});
|
|
42815
|
-
const Table$1 = /* @__PURE__ */ _export_sfc$1(_sfc_main$1_, [["__scopeId", "data-v-
|
|
42822
|
+
const Table$1 = /* @__PURE__ */ _export_sfc$1(_sfc_main$1_, [["__scopeId", "data-v-b7ccc2a8"]]);
|
|
42816
42823
|
const ElsTable = withInstall$1(Table$1);
|
|
42817
42824
|
const treeProps = buildProps({
|
|
42818
42825
|
...formItemProps$1,
|
|
@@ -51808,6 +51815,7 @@ const property_radio = [
|
|
|
51808
51815
|
"id": "label",
|
|
51809
51816
|
"label": "Label",
|
|
51810
51817
|
"prop": "label",
|
|
51818
|
+
"syncTo": "value",
|
|
51811
51819
|
"width": "",
|
|
51812
51820
|
"showSummary": false,
|
|
51813
51821
|
"sortable": false,
|
|
@@ -52014,6 +52022,7 @@ const property_radio = [
|
|
|
52014
52022
|
"id": "label",
|
|
52015
52023
|
"label": "Label",
|
|
52016
52024
|
"prop": "label",
|
|
52025
|
+
"syncTo": "value",
|
|
52017
52026
|
"width": "",
|
|
52018
52027
|
"showSummary": false,
|
|
52019
52028
|
"sortable": false,
|
|
@@ -52219,6 +52228,7 @@ const property_radio = [
|
|
|
52219
52228
|
"id": "label",
|
|
52220
52229
|
"label": "Label",
|
|
52221
52230
|
"prop": "label",
|
|
52231
|
+
"syncTo": "value",
|
|
52222
52232
|
"width": "",
|
|
52223
52233
|
"showSummary": false,
|
|
52224
52234
|
"sortable": false,
|
|
@@ -52840,6 +52850,7 @@ const property_checkbox = [
|
|
|
52840
52850
|
{
|
|
52841
52851
|
"label": "Label",
|
|
52842
52852
|
"prop": "label",
|
|
52853
|
+
"syncTo": "value",
|
|
52843
52854
|
"width": "",
|
|
52844
52855
|
"showSummary": false,
|
|
52845
52856
|
"sortable": false,
|
|
@@ -53341,6 +53352,7 @@ const property_select = [
|
|
|
53341
53352
|
"id": "label",
|
|
53342
53353
|
"label": "Label",
|
|
53343
53354
|
"prop": "label",
|
|
53355
|
+
"syncTo": "value",
|
|
53344
53356
|
"width": "",
|
|
53345
53357
|
"showSummary": false,
|
|
53346
53358
|
"sortable": false,
|
|
@@ -53547,6 +53559,7 @@ const property_select = [
|
|
|
53547
53559
|
"id": "label",
|
|
53548
53560
|
"label": "Label",
|
|
53549
53561
|
"prop": "label",
|
|
53562
|
+
"syncTo": "value",
|
|
53550
53563
|
"width": "",
|
|
53551
53564
|
"showSummary": false,
|
|
53552
53565
|
"sortable": false,
|
|
@@ -53752,6 +53765,7 @@ const property_select = [
|
|
|
53752
53765
|
"id": "label",
|
|
53753
53766
|
"label": "Label",
|
|
53754
53767
|
"prop": "label",
|
|
53768
|
+
"syncTo": "value",
|
|
53755
53769
|
"width": "",
|
|
53756
53770
|
"showSummary": false,
|
|
53757
53771
|
"sortable": false,
|
|
@@ -67138,45 +67152,109 @@ const property_table = [
|
|
|
67138
67152
|
"name": "default",
|
|
67139
67153
|
"children": [
|
|
67140
67154
|
{
|
|
67141
|
-
"keyID": "
|
|
67155
|
+
"keyID": "key_data_tip_nocolumns",
|
|
67156
|
+
"keyName": "",
|
|
67157
|
+
"keyCode": "",
|
|
67158
|
+
"children": [],
|
|
67159
|
+
"dataType": "None",
|
|
67160
|
+
"dataTypeName": "None",
|
|
67161
|
+
"arrayDataTypeName": "",
|
|
67162
|
+
"arrayDataType": "",
|
|
67163
|
+
"componentGroup": "Show",
|
|
67164
|
+
"componentTypeLabel": "页面提示",
|
|
67165
|
+
"componentTypeName": "Tip",
|
|
67166
|
+
"componentName": "ElsTip",
|
|
67167
|
+
"componentType": "Tip",
|
|
67168
|
+
"formItem": false,
|
|
67169
|
+
"componentShow": true,
|
|
67170
|
+
"icon": "tips",
|
|
67171
|
+
"slots": [],
|
|
67172
|
+
"config": {
|
|
67173
|
+
"formConfig": {},
|
|
67174
|
+
"baseConfig": {
|
|
67175
|
+
"title": "请先配置列",
|
|
67176
|
+
"content": "请先在「列配置」中添加列,然后再配置数据列表"
|
|
67177
|
+
},
|
|
67178
|
+
"advancedConfig": {
|
|
67179
|
+
"style": "",
|
|
67180
|
+
"vif": "!globalData._parentGlobalData?.config?.baseConfig?.columns?.length",
|
|
67181
|
+
"disabled": "",
|
|
67182
|
+
"eventChange": ""
|
|
67183
|
+
},
|
|
67184
|
+
"arrayConfig": {}
|
|
67185
|
+
}
|
|
67186
|
+
},
|
|
67187
|
+
{
|
|
67188
|
+
"keyID": "key_data_table",
|
|
67142
67189
|
"keyName": "数据列表",
|
|
67143
67190
|
"keyCode": "default",
|
|
67144
67191
|
"children": [],
|
|
67145
|
-
"dataType": "
|
|
67146
|
-
"dataTypeName": "
|
|
67192
|
+
"dataType": "Array",
|
|
67193
|
+
"dataTypeName": "Array",
|
|
67147
67194
|
"arrayDataTypeName": "",
|
|
67148
67195
|
"arrayDataType": "",
|
|
67149
|
-
"componentGroup": "
|
|
67150
|
-
"componentTypeLabel": "
|
|
67151
|
-
"componentTypeName": "
|
|
67152
|
-
"componentName": "
|
|
67153
|
-
"componentType": "
|
|
67196
|
+
"componentGroup": "Show",
|
|
67197
|
+
"componentTypeLabel": "Table表格",
|
|
67198
|
+
"componentTypeName": "Table",
|
|
67199
|
+
"componentName": "ElsTable",
|
|
67200
|
+
"componentType": "Table",
|
|
67154
67201
|
"formItem": true,
|
|
67155
67202
|
"componentShow": true,
|
|
67156
|
-
"icon": "
|
|
67203
|
+
"icon": "table",
|
|
67157
67204
|
"slots": [],
|
|
67158
67205
|
"config": {
|
|
67159
|
-
"formConfig": {
|
|
67160
|
-
|
|
67161
|
-
"
|
|
67162
|
-
"
|
|
67163
|
-
"
|
|
67164
|
-
"
|
|
67165
|
-
"
|
|
67166
|
-
"
|
|
67167
|
-
"
|
|
67168
|
-
"
|
|
67169
|
-
"
|
|
67206
|
+
"formConfig": {},
|
|
67207
|
+
"baseConfig": {
|
|
67208
|
+
"rowKey": "_id",
|
|
67209
|
+
"columns": [],
|
|
67210
|
+
"re_columns": ":globalData._parentGlobalData?.config?.baseConfig?.columns?.map(c=>({label:c.label,prop:c.prop,isEdit:true,editComponent:{name:'els-input',props:{}}}))||[]",
|
|
67211
|
+
"height": "",
|
|
67212
|
+
"maxHeight": "400",
|
|
67213
|
+
"align": "center",
|
|
67214
|
+
"isEdit": true,
|
|
67215
|
+
"dragRow": true,
|
|
67216
|
+
"hasPage": false
|
|
67217
|
+
},
|
|
67218
|
+
"advancedConfig": {
|
|
67219
|
+
"style": "",
|
|
67220
|
+
"vif": "globalData._parentGlobalData?.config?.baseConfig?.columns?.length",
|
|
67221
|
+
"disabled": "",
|
|
67222
|
+
"eventChange": ""
|
|
67170
67223
|
},
|
|
67224
|
+
"arrayConfig": {}
|
|
67225
|
+
},
|
|
67226
|
+
"value": []
|
|
67227
|
+
},
|
|
67228
|
+
{
|
|
67229
|
+
"keyID": "key_data_addrow_btn",
|
|
67230
|
+
"keyName": "Button按钮",
|
|
67231
|
+
"keyCode": "",
|
|
67232
|
+
"children": [],
|
|
67233
|
+
"dataType": "None",
|
|
67234
|
+
"dataTypeName": "None",
|
|
67235
|
+
"arrayDataTypeName": "",
|
|
67236
|
+
"arrayDataType": "",
|
|
67237
|
+
"componentGroup": "Show",
|
|
67238
|
+
"componentTypeLabel": "Button按钮",
|
|
67239
|
+
"componentTypeName": "Button",
|
|
67240
|
+
"componentName": "ElButton",
|
|
67241
|
+
"componentType": "Button",
|
|
67242
|
+
"formItem": false,
|
|
67243
|
+
"componentShow": true,
|
|
67244
|
+
"icon": "button",
|
|
67245
|
+
"slots": [],
|
|
67246
|
+
"config": {
|
|
67247
|
+
"formConfig": {},
|
|
67171
67248
|
"baseConfig": {
|
|
67172
|
-
"
|
|
67173
|
-
"
|
|
67174
|
-
"
|
|
67175
|
-
"
|
|
67249
|
+
"innerContent": "新增行",
|
|
67250
|
+
"type": "info",
|
|
67251
|
+
"text": true,
|
|
67252
|
+
"bg": true,
|
|
67253
|
+
"eventClick": "const cols=globalData._parentGlobalData?.config?.baseConfig?.columns||[];const row={_id:utils.shortid()};cols.forEach(c=>{row[c.prop]=''});refs['key_data_table']?.addRow(row)"
|
|
67176
67254
|
},
|
|
67177
67255
|
"advancedConfig": {
|
|
67178
|
-
"style": "
|
|
67179
|
-
"vif": "",
|
|
67256
|
+
"style": "margin-top:8px",
|
|
67257
|
+
"vif": "globalData._parentGlobalData?.config?.baseConfig?.columns?.length",
|
|
67180
67258
|
"disabled": "",
|
|
67181
67259
|
"eventChange": ""
|
|
67182
67260
|
},
|
|
@@ -67215,7 +67293,8 @@ const property_table = [
|
|
|
67215
67293
|
"bg": true,
|
|
67216
67294
|
"type": "info"
|
|
67217
67295
|
},
|
|
67218
|
-
"function_confirm": ""
|
|
67296
|
+
"function_confirm": "const rows=slotValue?.default?.default;if(Array.isArray(rows)){globalData.config.baseConfig.data=rows.map(({_id:_,...r})=>r)}return Promise.resolve(true)",
|
|
67297
|
+
"function_open": "if(slotValue)slotValue['default']={default:(globalData.config.baseConfig.data||[]).map(r=>({...r,_id:utils.shortid()}))}"
|
|
67219
67298
|
},
|
|
67220
67299
|
"advancedConfig": {},
|
|
67221
67300
|
"arrayConfig": {
|
|
@@ -67273,6 +67352,7 @@ const property_table = [
|
|
|
67273
67352
|
"id": "label",
|
|
67274
67353
|
"label": "列名称",
|
|
67275
67354
|
"prop": "label",
|
|
67355
|
+
"syncTo": "prop",
|
|
67276
67356
|
"width": "",
|
|
67277
67357
|
"showSummary": false,
|
|
67278
67358
|
"sortable": false,
|
|
@@ -74975,7 +75055,7 @@ const _sfc_main$1l = /* @__PURE__ */ defineComponent({
|
|
|
74975
75055
|
emits: /* @__PURE__ */ mergeModels(["removeItem"], ["update:children"]),
|
|
74976
75056
|
setup(__props, { emit: __emit }) {
|
|
74977
75057
|
const DynamicDesignerInnerItem = defineAsyncComponent(() => {
|
|
74978
|
-
return import("./innerItem-
|
|
75058
|
+
return import("./innerItem-5Au5l5Jf.js");
|
|
74979
75059
|
});
|
|
74980
75060
|
const { getValue: getValue2 } = useProps();
|
|
74981
75061
|
const tagID = getValue2("tagID");
|
|
@@ -76013,10 +76093,10 @@ const _sfc_main$1j = /* @__PURE__ */ defineComponent({
|
|
|
76013
76093
|
emits: ["update:modelValue"],
|
|
76014
76094
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
76015
76095
|
const DynamicRenderInner = defineAsyncComponent(() => {
|
|
76016
|
-
return import("./inner-
|
|
76096
|
+
return import("./inner-Ba84wZRD.js").then((n) => n.i);
|
|
76017
76097
|
});
|
|
76018
76098
|
const DynamicRenderForm = defineAsyncComponent(() => {
|
|
76019
|
-
return import("./inner-
|
|
76099
|
+
return import("./inner-Ba84wZRD.js").then((n) => n.f);
|
|
76020
76100
|
});
|
|
76021
76101
|
const props2 = __props;
|
|
76022
76102
|
const { getValue: getValue2, setValue, formNodeProps } = useProps(props2);
|
|
@@ -76256,10 +76336,10 @@ const _sfc_main$1i = /* @__PURE__ */ defineComponent({
|
|
|
76256
76336
|
emits: ["update:modelValue"],
|
|
76257
76337
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
76258
76338
|
const DynamicRenderInnerAsync = defineAsyncComponent(() => {
|
|
76259
|
-
return import("./inner-
|
|
76339
|
+
return import("./inner-Ba84wZRD.js").then((n) => n.i);
|
|
76260
76340
|
});
|
|
76261
76341
|
const DynamicRenderFormAsync = defineAsyncComponent(() => {
|
|
76262
|
-
return import("./inner-
|
|
76342
|
+
return import("./inner-Ba84wZRD.js").then((n) => n.f);
|
|
76263
76343
|
});
|
|
76264
76344
|
const props2 = __props;
|
|
76265
76345
|
const { getValue: getValue2, setValue, formNodeProps } = useProps(props2);
|
|
@@ -78630,6 +78710,9 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
|
78630
78710
|
});
|
|
78631
78711
|
const setSlotVisible = getValue2("setSlotVisible", () => {
|
|
78632
78712
|
});
|
|
78713
|
+
const triggerAiGenerate = getValue2("triggerAiGenerate", () => {
|
|
78714
|
+
});
|
|
78715
|
+
const aiUrl = getValue2("aiUrl", "");
|
|
78633
78716
|
const slotVisible = ref();
|
|
78634
78717
|
function handleRemove(item) {
|
|
78635
78718
|
removeItem(item);
|
|
@@ -78639,21 +78722,34 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
|
78639
78722
|
setSlotVisible();
|
|
78640
78723
|
slotVisible.value = !slotVisible.value;
|
|
78641
78724
|
}
|
|
78725
|
+
const arrayTypeLabelMap = {
|
|
78726
|
+
String: "字符串数组",
|
|
78727
|
+
Number: "数字数组",
|
|
78728
|
+
Bool: "Bool数组",
|
|
78729
|
+
Object: "对象数组"
|
|
78730
|
+
};
|
|
78731
|
+
function formatDataTypeLabel(item) {
|
|
78732
|
+
if (item.dataTypeName === "Array") {
|
|
78733
|
+
return item.arrayDataTypeName ? arrayTypeLabelMap[item.arrayDataTypeName] || `${item.arrayDataTypeName}数组` : "数组";
|
|
78734
|
+
}
|
|
78735
|
+
if (item.dataTypeName === "Object") return "对象表单";
|
|
78736
|
+
return item.dataTypeName;
|
|
78737
|
+
}
|
|
78642
78738
|
return (_ctx, _cache) => {
|
|
78643
78739
|
const _component_View = resolveComponent("View");
|
|
78644
78740
|
const _component_el_icon = resolveComponent("el-icon");
|
|
78645
78741
|
const _component_ArrowDown = resolveComponent("ArrowDown");
|
|
78646
78742
|
const _component_ArrowUp = resolveComponent("ArrowUp");
|
|
78743
|
+
const _component_MagicStick = resolveComponent("MagicStick");
|
|
78647
78744
|
const _component_Delete = resolveComponent("Delete");
|
|
78648
78745
|
const _component_Rank = resolveComponent("Rank");
|
|
78649
78746
|
return openBlock(), createElementBlock(Fragment$1, null, [
|
|
78650
78747
|
!__props.nodeItem.excludeFromResult && (__props.nodeItem.componentGroup == "Form" || __props.nodeItem.formItem && __props.nodeItem.keyCode) ? (openBlock(), createElementBlock("span", _hoisted_1$l, [
|
|
78651
78748
|
createElementVNode("span", null, toDisplayString(__props.nodeItem.keyCode), 1),
|
|
78652
|
-
createElementVNode("span", null, toDisplayString(__props.nodeItem
|
|
78653
|
-
<${__props.nodeItem.arrayDataTypeName ? __props.nodeItem.arrayDataTypeName : "T"}>` : __props.nodeItem.dataTypeName), 1)
|
|
78749
|
+
createElementVNode("span", null, toDisplayString(formatDataTypeLabel(__props.nodeItem)), 1)
|
|
78654
78750
|
])) : createCommentVNode("", true),
|
|
78655
78751
|
createElementVNode("span", _hoisted_2$e, [
|
|
78656
|
-
__props.nodeItem.componentTypeLabel != "
|
|
78752
|
+
__props.nodeItem.componentTypeLabel != "对象表单" && __props.nodeItem.componentTypeLabel != "数组" ? (openBlock(), createElementBlock("span", _hoisted_3$d, toDisplayString(__props.nodeItem.componentTypeLabel), 1)) : createCommentVNode("", true),
|
|
78657
78753
|
__props.nodeItem.config.advancedConfig.vif ? (openBlock(), createBlock(_component_el_icon, {
|
|
78658
78754
|
key: 1,
|
|
78659
78755
|
title: "v-if:" + __props.nodeItem.config.advancedConfig.vif
|
|
@@ -78667,7 +78763,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
|
78667
78763
|
key: 2,
|
|
78668
78764
|
onClick: handleSetSlotVisible
|
|
78669
78765
|
}, [
|
|
78670
|
-
_cache[
|
|
78766
|
+
_cache[2] || (_cache[2] = createTextVNode("插槽", -1)),
|
|
78671
78767
|
!slotVisible.value ? (openBlock(), createBlock(_component_el_icon, { key: 0 }, {
|
|
78672
78768
|
default: withCtx(() => [
|
|
78673
78769
|
createVNode(_component_ArrowDown)
|
|
@@ -78680,9 +78776,19 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
|
78680
78776
|
_: 1
|
|
78681
78777
|
}))
|
|
78682
78778
|
])) : createCommentVNode("", true),
|
|
78779
|
+
unref(aiUrl) && __props.nodeItem.componentGroup === "Container" ? (openBlock(), createBlock(_component_el_icon, {
|
|
78780
|
+
key: 3,
|
|
78781
|
+
onClick: _cache[0] || (_cache[0] = ($event) => unref(triggerAiGenerate)(__props.nodeItem)),
|
|
78782
|
+
title: "AI生成"
|
|
78783
|
+
}, {
|
|
78784
|
+
default: withCtx(() => [
|
|
78785
|
+
createVNode(_component_MagicStick)
|
|
78786
|
+
]),
|
|
78787
|
+
_: 1
|
|
78788
|
+
})) : createCommentVNode("", true),
|
|
78683
78789
|
createVNode(_component_el_icon, {
|
|
78684
78790
|
class: "el-icon-remove",
|
|
78685
|
-
onClick: _cache[
|
|
78791
|
+
onClick: _cache[1] || (_cache[1] = ($event) => handleRemove(__props.nodeItem))
|
|
78686
78792
|
}, {
|
|
78687
78793
|
default: withCtx(() => [
|
|
78688
78794
|
createVNode(_component_Delete)
|
|
@@ -78700,7 +78806,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
|
78700
78806
|
};
|
|
78701
78807
|
}
|
|
78702
78808
|
});
|
|
78703
|
-
const DynamicDesignerViewOperate = /* @__PURE__ */ _export_sfc$1(_sfc_main$z, [["__scopeId", "data-v-
|
|
78809
|
+
const DynamicDesignerViewOperate = /* @__PURE__ */ _export_sfc$1(_sfc_main$z, [["__scopeId", "data-v-5b4a8315"]]);
|
|
78704
78810
|
const _hoisted_1$k = { key: 1 };
|
|
78705
78811
|
const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
78706
78812
|
__name: "wrap",
|
|
@@ -79074,7 +79180,7 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
|
79074
79180
|
default: withCtx(() => [
|
|
79075
79181
|
createElementVNode("div", _hoisted_2$d, [
|
|
79076
79182
|
createElementVNode("div", _hoisted_3$c, [
|
|
79077
|
-
createVNode(
|
|
79183
|
+
createVNode(DynamicDesignerViewBody, {
|
|
79078
79184
|
renderData: slot.children,
|
|
79079
79185
|
minHeight: "100",
|
|
79080
79186
|
isMobile: unref(isMobile)
|
|
@@ -79212,7 +79318,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
79212
79318
|
}, {
|
|
79213
79319
|
default: withCtx(() => [
|
|
79214
79320
|
createVNode(unref(draggable), mergeProps({
|
|
79215
|
-
class: [{ "els-dynamic-designer-empty": nodeItem.value.children.length == 0 }],
|
|
79321
|
+
class: [{ "els-dynamic-designer-empty": nodeItem.value.children.length == 0 && nodeItem.value.componentTypeName !== "Form" }, { "els-dynamic-array-undetermined": nodeItem.value.dataTypeName === "Array" && !nodeItem.value.arrayDataTypeName }],
|
|
79216
79322
|
list: nodeItem.value.children
|
|
79217
79323
|
}, { group: "dragGroup", ghostClass: "ghost", animation: 300 }, {
|
|
79218
79324
|
style: [{ "min-height": "50px" }],
|
|
@@ -79239,7 +79345,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
79239
79345
|
};
|
|
79240
79346
|
}
|
|
79241
79347
|
});
|
|
79242
|
-
const DynamicDesignerViewForm = /* @__PURE__ */ _export_sfc$1(_sfc_main$v, [["__scopeId", "data-v-
|
|
79348
|
+
const DynamicDesignerViewForm = /* @__PURE__ */ _export_sfc$1(_sfc_main$v, [["__scopeId", "data-v-d658c3e9"]]);
|
|
79243
79349
|
const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
79244
79350
|
__name: "body",
|
|
79245
79351
|
props: /* @__PURE__ */ mergeModels({
|
|
@@ -79331,6 +79437,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
79331
79437
|
};
|
|
79332
79438
|
}
|
|
79333
79439
|
});
|
|
79440
|
+
const DynamicDesignerViewBody = /* @__PURE__ */ _export_sfc$1(_sfc_main$u, [["__scopeId", "data-v-82f9f850"]]);
|
|
79334
79441
|
const designerViewProps = buildProps({
|
|
79335
79442
|
...formItemProps$1,
|
|
79336
79443
|
/**
|
|
@@ -79427,6 +79534,14 @@ const designerViewProps = buildProps({
|
|
|
79427
79534
|
toolbar: {
|
|
79428
79535
|
type: Array
|
|
79429
79536
|
},
|
|
79537
|
+
/** AI 生成接口地址,有值时显示 AI 按钮 */
|
|
79538
|
+
aiUrl: { type: String },
|
|
79539
|
+
/** AI 系统提示词(不传则用内置默认) */
|
|
79540
|
+
aiSystemPrompt: { type: String },
|
|
79541
|
+
/** 自定义 AI 请求体构造 (systemPrompt, userPrompt) => body */
|
|
79542
|
+
aiBuildRequest: { type: Function },
|
|
79543
|
+
/** 自定义 AI 响应提取 (responseData) => string */
|
|
79544
|
+
aiPickResponse: { type: Function },
|
|
79430
79545
|
/**
|
|
79431
79546
|
* @description 左侧宽度
|
|
79432
79547
|
*/
|
|
@@ -79469,6 +79584,496 @@ const designerViewProps = buildProps({
|
|
|
79469
79584
|
default: () => []
|
|
79470
79585
|
}
|
|
79471
79586
|
});
|
|
79587
|
+
const AI_SYSTEM_PROMPT = `你是一个低代码表单配置生成器。根据用户描述,输出符合以下格式的 JSON 数组。只输出 JSON,不要有任何额外文字、注释或代码块标记。
|
|
79588
|
+
|
|
79589
|
+
# 节点结构
|
|
79590
|
+
|
|
79591
|
+
每个节点必须包含以下字段:
|
|
79592
|
+
- keyID: 唯一ID,格式 "key_" + 6位数字(如 "key_123456")
|
|
79593
|
+
- keyName: 显示名称(中文)
|
|
79594
|
+
- keyCode: 字段名(小驼峰,容器类节点为空字符串"")
|
|
79595
|
+
- componentType: 组件类型(见下方清单;Object/Array 数据节点不填此字段)
|
|
79596
|
+
- dataType: 数据类型(String/Number/Bool/Object/Array/None)
|
|
79597
|
+
- arrayDataType: 数组元素类型,仅当 dataType="Array" 时填写(Object/String/Number/Bool)
|
|
79598
|
+
- children: 子节点数组(叶子节点为 [])
|
|
79599
|
+
- config: 包含 formConfig、baseConfig、advancedConfig、arrayConfig 四个对象
|
|
79600
|
+
|
|
79601
|
+
不要输出 componentName、componentGroup、dataTypeName、formItem 等字段(由系统自动填充)。
|
|
79602
|
+
|
|
79603
|
+
# 组件清单
|
|
79604
|
+
|
|
79605
|
+
## 表单组件(有字段值输出,需填 keyCode)
|
|
79606
|
+
|
|
79607
|
+
| componentType | dataType | 说明 | 常用 baseConfig |
|
|
79608
|
+
|---|---|---|---|
|
|
79609
|
+
| Input | String | 单行输入框 | placeholder, clearable, maxlength, showWordLimit, isTrim, width, prefixIcon, suffixIcon |
|
|
79610
|
+
| Textarea | String | 多行文本 | placeholder, rows, maxlength, clearable, resize, width |
|
|
79611
|
+
| InputNumber | Number | 数字输入框 | min, max, step, precision, controls-position, width |
|
|
79612
|
+
| Slider | Number | 滑块 | min, max, step, showInput |
|
|
79613
|
+
| Switch | Bool/String/Number | 开关 | active-text, inactive-text, active-value, inactive-value |
|
|
79614
|
+
| Select | String/Number/Bool | 下拉选择 | data[{label,value}], multiple, filterable, clearable, placeholder, width, url, labelField, valueField |
|
|
79615
|
+
| Radio | String/Number/Bool | 单选 | type(radio/button), data[{label,value}], width, url |
|
|
79616
|
+
| Checkbox | String | 多选 | type(checkbox/button), data[{label,value}], width, url |
|
|
79617
|
+
| Cascader | String | 级联选择 | url, labelField, valueField, childrenField, clearable, multiple |
|
|
79618
|
+
| Datepicker | String/Number | 日期选择 | type(date/daterange/datetime/datetimerange/year/month/monthrange), format, valueFormat, clearable, width |
|
|
79619
|
+
| Timepicker | String/Number | 时间选择 | format, valueFormat, clearable, width |
|
|
79620
|
+
| Switch | Bool | 开关 | active-text, inactive-text |
|
|
79621
|
+
| Tree | String/Number | 树形选择 | url, labelField, valueField, clearable, multiple |
|
|
79622
|
+
| ColorPicker | String | 取色器 | showAlpha |
|
|
79623
|
+
| UploadPic | String | 上传图片 | width, height, limit |
|
|
79624
|
+
| UploadMutiPic | String | 上传图集(多图)| width, height, limit |
|
|
79625
|
+
| UploadFile | String | 上传文件 | accept, limit |
|
|
79626
|
+
| WangEditor | String | 富文本编辑器 | height |
|
|
79627
|
+
| AceEditor | String | 代码编辑器 | mode(javascript/json/html/css/python/sql), height |
|
|
79628
|
+
| JsonEditor | String/Object | JSON 编辑器 | height |
|
|
79629
|
+
| DataModal | String/Object/Array | 弹窗选择 | title, width, buttonLabel |
|
|
79630
|
+
| Caption | None/String | 分隔描述(formItem:true)| title, description, type(primary/success/warning/danger) |
|
|
79631
|
+
| Table | Array | 数据表格(formItem:true)| columns[{label,prop,width,sortable}], data, hasPage, maxHeight, url |
|
|
79632
|
+
|
|
79633
|
+
## 容器组件(不含字段值,keyCode 为 "",dataType 为 None)
|
|
79634
|
+
|
|
79635
|
+
| componentType | 说明 | 主要 baseConfig |
|
|
79636
|
+
|---|---|---|
|
|
79637
|
+
| Row | 栅格行,子节点必须是 Col | gutter(默认10), justify(start/end/center/space-between/space-around), align(top/middle/bottom) |
|
|
79638
|
+
| Col | 栅格列,必须在 Row 内 | span(1-24,合计24), offset |
|
|
79639
|
+
| Card | 卡片容器 | header, shadow(always/hover/never) |
|
|
79640
|
+
| Collapse | 折叠面板,子节点是 CollapseItem | accordion |
|
|
79641
|
+
| CollapseItem | 折叠节点,必须在 Collapse 内 | title, name |
|
|
79642
|
+
| Tabs | 标签页,子节点是 TabPane | type(border-card/card), tabPosition(top/right/bottom/left) |
|
|
79643
|
+
| TabPane | 标签选项,必须在 Tabs 内 | label, name |
|
|
79644
|
+
| Dialog | 对话框 | title, width, fullscreen |
|
|
79645
|
+
| Drawer | 抽屉 | title, size, direction(rtl/ltr/ttb/btt) |
|
|
79646
|
+
| Html | 通用 div | display(flex), flex-wrap, justify-content, align-items, width, height, padding, background |
|
|
79647
|
+
| FormItem | 表单项容器 | label, labelWidth |
|
|
79648
|
+
| FormQuery | 查询表单(Object类型) | labelWidth |
|
|
79649
|
+
| RequestForm | 接口请求表单 | url, method(GET/POST), buttonLabel |
|
|
79650
|
+
|
|
79651
|
+
## 展示组件(不含字段值,keyCode 为 "")
|
|
79652
|
+
|
|
79653
|
+
| componentType | 说明 | 主要 baseConfig |
|
|
79654
|
+
|---|---|---|
|
|
79655
|
+
| Button | 普通按钮 | innerContent, type(primary/success/warning/danger/info), plain, text, round, eventClick |
|
|
79656
|
+
| ButtonSearch | 查询按钮 | innerContent |
|
|
79657
|
+
| ButtonExport | 导出按钮 | innerContent |
|
|
79658
|
+
| Tip | 提示块 | title, content, type(primary/warning) |
|
|
79659
|
+
| Alert | 警告提示 | title, type(success/warning/info/error), description, closable |
|
|
79660
|
+
| Tag | 标签 | innerContent, type(success/info/warning/danger) |
|
|
79661
|
+
| Link | 链接 | innerContent, href, type, underline |
|
|
79662
|
+
| Text | 文本 | innerContent, type, size |
|
|
79663
|
+
| Image | 图片 | src, width, height, fit(fill/contain/cover/none) |
|
|
79664
|
+
| Tooltip | 文字提示 | content, placement(top/bottom/left/right), effect(dark/light) |
|
|
79665
|
+
|
|
79666
|
+
## Object/Array 数据节点(无 componentType,由 dataType 驱动)
|
|
79667
|
+
|
|
79668
|
+
- dataType="Object":对象节点,children 放子字段,输出 {keyCode: {子字段...}}
|
|
79669
|
+
- dataType="Array" + arrayDataType="Object":对象数组节点(不含 componentType),children 定义数组元素的字段结构,每个子节点就是一行数据的字段
|
|
79670
|
+
- dataType="Array" + arrayDataType="String/Number":简单值数组
|
|
79671
|
+
- 这类节点没有 componentType 字段
|
|
79672
|
+
|
|
79673
|
+
## Table 可编辑表格(推荐用于对象数组)
|
|
79674
|
+
|
|
79675
|
+
当需要让用户在表格中编辑多行数据时,使用 componentType="Table",dataType="Array"。
|
|
79676
|
+
Table 通过 baseConfig.columns 定义列,每列需要 id(随机字符串)、label(列标题)、prop(字段名)、editComponent(编辑组件)。
|
|
79677
|
+
设置 isEdit:true 开启行内编辑,canAddRow:true 允许新增行。
|
|
79678
|
+
|
|
79679
|
+
Table 节点的 slots 数组中每个 slot 对应一列的编辑插槽(name 格式为 "edit-{列id}"),slot.children 为空时使用 editComponent 默认编辑器,也可以在 children 中放入自定义组件。
|
|
79680
|
+
|
|
79681
|
+
Table 节点格式:
|
|
79682
|
+
\`\`\`json
|
|
79683
|
+
{
|
|
79684
|
+
"keyID": "key_xxxxxx",
|
|
79685
|
+
"keyCode": "列表字段名",
|
|
79686
|
+
"keyName": "显示名称",
|
|
79687
|
+
"dataType": "Array",
|
|
79688
|
+
"arrayDataType": "",
|
|
79689
|
+
"componentType": "Table",
|
|
79690
|
+
"children": [],
|
|
79691
|
+
"slots": [
|
|
79692
|
+
{ "name": "edit-{列id1}", "label": "{列1标题} 编辑", "children": [] },
|
|
79693
|
+
{ "name": "edit-{列id2}", "label": "{列2标题} 编辑", "children": [] }
|
|
79694
|
+
],
|
|
79695
|
+
"config": {
|
|
79696
|
+
"formConfig": {},
|
|
79697
|
+
"baseConfig": {
|
|
79698
|
+
"rowKey": "",
|
|
79699
|
+
"url": "",
|
|
79700
|
+
"data": {},
|
|
79701
|
+
"columns": [
|
|
79702
|
+
{ "id": "{列id1}", "label": "{列1标题}", "prop": "{字段名1}", "type": "default", "width": "", "editComponent": { "name": "els-input", "props": {} } },
|
|
79703
|
+
{ "id": "{列id2}", "label": "{列2标题}", "prop": "{字段名2}", "type": "default", "width": "", "editComponent": { "name": "els-input", "props": {} } }
|
|
79704
|
+
],
|
|
79705
|
+
"align": "center",
|
|
79706
|
+
"isEdit": true,
|
|
79707
|
+
"canAddRow": true,
|
|
79708
|
+
"hasPage": false,
|
|
79709
|
+
"maxHeight": ""
|
|
79710
|
+
},
|
|
79711
|
+
"advancedConfig": {},
|
|
79712
|
+
"arrayConfig": {}
|
|
79713
|
+
}
|
|
79714
|
+
}
|
|
79715
|
+
\`\`\`
|
|
79716
|
+
列 id 使用8位随机字母数字串,slot name 格式必须与列 id 保持一致("edit-" + 列id)。
|
|
79717
|
+
|
|
79718
|
+
# 配置说明
|
|
79719
|
+
|
|
79720
|
+
## formConfig(字段级表单配置)
|
|
79721
|
+
- re_required: 必填表达式("" 不必填,"true" 始终必填,"currNode['field']?.value=='A'" 条件必填)
|
|
79722
|
+
- requiredMessage: 必填提示文字
|
|
79723
|
+
- validType: 内置验证(email/phone/idcard/url)
|
|
79724
|
+
- validExpression: 自定义验证表达式
|
|
79725
|
+
- validMessage: 验证失败提示
|
|
79726
|
+
- tip: 字段提示文字
|
|
79727
|
+
- tipPosition: 提示位置(left/right/top)
|
|
79728
|
+
|
|
79729
|
+
## advancedConfig(高级配置,所有组件均支持)
|
|
79730
|
+
- vif: 条件显示表达式(true显示,false隐藏)。访问其他字段用 currNode['keyCode'].value
|
|
79731
|
+
- disabled: 禁用表达式,同上
|
|
79732
|
+
- eventChange: 值变化时触发的 JS 代码
|
|
79733
|
+
- style: 动态样式字符串
|
|
79734
|
+
|
|
79735
|
+
# 配置案例
|
|
79736
|
+
|
|
79737
|
+
## 案例1 - 基本表单
|
|
79738
|
+
\`\`\`json
|
|
79739
|
+
[
|
|
79740
|
+
{
|
|
79741
|
+
"keyID": "key_001001",
|
|
79742
|
+
"keyCode": "username",
|
|
79743
|
+
"keyName": "用户名",
|
|
79744
|
+
"componentType": "Input",
|
|
79745
|
+
"dataType": "String",
|
|
79746
|
+
"arrayDataType": "",
|
|
79747
|
+
"children": [],
|
|
79748
|
+
"config": {
|
|
79749
|
+
"formConfig": { "re_required": "true", "requiredMessage": "请输入用户名" },
|
|
79750
|
+
"baseConfig": { "placeholder": "请输入用户名", "clearable": true, "maxlength": "50" },
|
|
79751
|
+
"advancedConfig": { "style": "", "vif": "", "disabled": "", "eventChange": "" },
|
|
79752
|
+
"arrayConfig": {}
|
|
79753
|
+
}
|
|
79754
|
+
},
|
|
79755
|
+
{
|
|
79756
|
+
"keyID": "key_001002",
|
|
79757
|
+
"keyCode": "gender",
|
|
79758
|
+
"keyName": "性别",
|
|
79759
|
+
"componentType": "Radio",
|
|
79760
|
+
"dataType": "String",
|
|
79761
|
+
"arrayDataType": "",
|
|
79762
|
+
"children": [],
|
|
79763
|
+
"config": {
|
|
79764
|
+
"formConfig": {},
|
|
79765
|
+
"baseConfig": { "type": "radio", "data": [{"label": "男", "value": "male"}, {"label": "女", "value": "female"}] },
|
|
79766
|
+
"advancedConfig": { "style": "", "vif": "", "disabled": "", "eventChange": "" },
|
|
79767
|
+
"arrayConfig": {}
|
|
79768
|
+
}
|
|
79769
|
+
},
|
|
79770
|
+
{
|
|
79771
|
+
"keyID": "key_001003",
|
|
79772
|
+
"keyCode": "role",
|
|
79773
|
+
"keyName": "角色",
|
|
79774
|
+
"componentType": "Select",
|
|
79775
|
+
"dataType": "String",
|
|
79776
|
+
"arrayDataType": "",
|
|
79777
|
+
"children": [],
|
|
79778
|
+
"config": {
|
|
79779
|
+
"formConfig": {},
|
|
79780
|
+
"baseConfig": { "data": [{"label": "管理员", "value": "admin"}, {"label": "普通用户", "value": "user"}], "placeholder": "请选择角色", "clearable": true },
|
|
79781
|
+
"advancedConfig": { "style": "", "vif": "", "disabled": "", "eventChange": "" },
|
|
79782
|
+
"arrayConfig": {}
|
|
79783
|
+
}
|
|
79784
|
+
}
|
|
79785
|
+
]
|
|
79786
|
+
\`\`\`
|
|
79787
|
+
|
|
79788
|
+
## 案例2 - 栅格布局(Row + Col)
|
|
79789
|
+
\`\`\`json
|
|
79790
|
+
[
|
|
79791
|
+
{
|
|
79792
|
+
"keyID": "row_002001",
|
|
79793
|
+
"keyCode": "",
|
|
79794
|
+
"keyName": "栅格行",
|
|
79795
|
+
"componentType": "Row",
|
|
79796
|
+
"dataType": "None",
|
|
79797
|
+
"arrayDataType": "",
|
|
79798
|
+
"children": [
|
|
79799
|
+
{
|
|
79800
|
+
"keyID": "col_002001",
|
|
79801
|
+
"keyCode": "",
|
|
79802
|
+
"keyName": "左列",
|
|
79803
|
+
"componentType": "Col",
|
|
79804
|
+
"dataType": "None",
|
|
79805
|
+
"arrayDataType": "",
|
|
79806
|
+
"children": [
|
|
79807
|
+
{
|
|
79808
|
+
"keyID": "key_002001",
|
|
79809
|
+
"keyCode": "startDate",
|
|
79810
|
+
"keyName": "开始日期",
|
|
79811
|
+
"componentType": "Datepicker",
|
|
79812
|
+
"dataType": "String",
|
|
79813
|
+
"arrayDataType": "",
|
|
79814
|
+
"children": [],
|
|
79815
|
+
"config": { "formConfig": {}, "baseConfig": { "type": "date", "valueFormat": "YYYY-MM-DD", "clearable": true }, "advancedConfig": { "style": "", "vif": "", "disabled": "", "eventChange": "" }, "arrayConfig": {} }
|
|
79816
|
+
}
|
|
79817
|
+
],
|
|
79818
|
+
"config": { "formConfig": {}, "baseConfig": { "span": 12 }, "advancedConfig": {}, "arrayConfig": {} }
|
|
79819
|
+
},
|
|
79820
|
+
{
|
|
79821
|
+
"keyID": "col_002002",
|
|
79822
|
+
"keyCode": "",
|
|
79823
|
+
"keyName": "右列",
|
|
79824
|
+
"componentType": "Col",
|
|
79825
|
+
"dataType": "None",
|
|
79826
|
+
"arrayDataType": "",
|
|
79827
|
+
"children": [
|
|
79828
|
+
{
|
|
79829
|
+
"keyID": "key_002002",
|
|
79830
|
+
"keyCode": "endDate",
|
|
79831
|
+
"keyName": "结束日期",
|
|
79832
|
+
"componentType": "Datepicker",
|
|
79833
|
+
"dataType": "String",
|
|
79834
|
+
"arrayDataType": "",
|
|
79835
|
+
"children": [],
|
|
79836
|
+
"config": { "formConfig": {}, "baseConfig": { "type": "date", "valueFormat": "YYYY-MM-DD", "clearable": true }, "advancedConfig": { "style": "", "vif": "", "disabled": "", "eventChange": "" }, "arrayConfig": {} }
|
|
79837
|
+
}
|
|
79838
|
+
],
|
|
79839
|
+
"config": { "formConfig": {}, "baseConfig": { "span": 12 }, "advancedConfig": {}, "arrayConfig": {} }
|
|
79840
|
+
}
|
|
79841
|
+
],
|
|
79842
|
+
"config": { "formConfig": {}, "baseConfig": { "gutter": 10 }, "advancedConfig": {}, "arrayConfig": {} }
|
|
79843
|
+
}
|
|
79844
|
+
]
|
|
79845
|
+
\`\`\`
|
|
79846
|
+
|
|
79847
|
+
## 案例3 - Object 嵌套对象
|
|
79848
|
+
\`\`\`json
|
|
79849
|
+
[
|
|
79850
|
+
{
|
|
79851
|
+
"keyID": "key_003001",
|
|
79852
|
+
"keyCode": "address",
|
|
79853
|
+
"keyName": "地址",
|
|
79854
|
+
"dataType": "Object",
|
|
79855
|
+
"arrayDataType": "",
|
|
79856
|
+
"children": [
|
|
79857
|
+
{
|
|
79858
|
+
"keyID": "key_003002",
|
|
79859
|
+
"keyCode": "province",
|
|
79860
|
+
"keyName": "省份",
|
|
79861
|
+
"componentType": "Input",
|
|
79862
|
+
"dataType": "String",
|
|
79863
|
+
"arrayDataType": "",
|
|
79864
|
+
"children": [],
|
|
79865
|
+
"config": { "formConfig": {}, "baseConfig": { "placeholder": "请输入省份" }, "advancedConfig": { "style": "", "vif": "", "disabled": "", "eventChange": "" }, "arrayConfig": {} }
|
|
79866
|
+
},
|
|
79867
|
+
{
|
|
79868
|
+
"keyID": "key_003003",
|
|
79869
|
+
"keyCode": "city",
|
|
79870
|
+
"keyName": "城市",
|
|
79871
|
+
"componentType": "Input",
|
|
79872
|
+
"dataType": "String",
|
|
79873
|
+
"arrayDataType": "",
|
|
79874
|
+
"children": [],
|
|
79875
|
+
"config": { "formConfig": {}, "baseConfig": { "placeholder": "请输入城市" }, "advancedConfig": { "style": "", "vif": "", "disabled": "", "eventChange": "" }, "arrayConfig": {} }
|
|
79876
|
+
}
|
|
79877
|
+
],
|
|
79878
|
+
"config": { "formConfig": {}, "baseConfig": {}, "advancedConfig": {}, "arrayConfig": {} }
|
|
79879
|
+
}
|
|
79880
|
+
]
|
|
79881
|
+
\`\`\`
|
|
79882
|
+
|
|
79883
|
+
## 案例4 - 普通对象数组(无 componentType,dataType=Array + arrayDataType=Object)
|
|
79884
|
+
|
|
79885
|
+
这种方式生成嵌套表单,每行数据是一个对象,children 定义每个对象的字段:
|
|
79886
|
+
\`\`\`json
|
|
79887
|
+
[
|
|
79888
|
+
{
|
|
79889
|
+
"keyID": "key_arr001",
|
|
79890
|
+
"keyCode": "members",
|
|
79891
|
+
"keyName": "成员列表",
|
|
79892
|
+
"dataType": "Array",
|
|
79893
|
+
"arrayDataType": "Object",
|
|
79894
|
+
"children": [
|
|
79895
|
+
{
|
|
79896
|
+
"keyID": "key_arr002",
|
|
79897
|
+
"keyCode": "name",
|
|
79898
|
+
"keyName": "姓名",
|
|
79899
|
+
"componentType": "Input",
|
|
79900
|
+
"dataType": "String",
|
|
79901
|
+
"arrayDataType": "",
|
|
79902
|
+
"children": [],
|
|
79903
|
+
"config": { "formConfig": {}, "baseConfig": { "placeholder": "请输入姓名" }, "advancedConfig": { "style": "", "vif": "", "disabled": "", "eventChange": "" }, "arrayConfig": {} }
|
|
79904
|
+
},
|
|
79905
|
+
{
|
|
79906
|
+
"keyID": "key_arr003",
|
|
79907
|
+
"keyCode": "age",
|
|
79908
|
+
"keyName": "年龄",
|
|
79909
|
+
"componentType": "InputNumber",
|
|
79910
|
+
"dataType": "Number",
|
|
79911
|
+
"arrayDataType": "",
|
|
79912
|
+
"children": [],
|
|
79913
|
+
"config": { "formConfig": {}, "baseConfig": { "min": "0", "max": "150" }, "advancedConfig": { "style": "", "vif": "", "disabled": "", "eventChange": "" }, "arrayConfig": {} }
|
|
79914
|
+
}
|
|
79915
|
+
],
|
|
79916
|
+
"config": { "formConfig": {}, "baseConfig": {}, "advancedConfig": {}, "arrayConfig": {} }
|
|
79917
|
+
}
|
|
79918
|
+
]
|
|
79919
|
+
\`\`\`
|
|
79920
|
+
|
|
79921
|
+
## 案例5 - Table 可编辑表格(推荐,比对象数组更直观)
|
|
79922
|
+
|
|
79923
|
+
Table 表格适合需要用户编辑多行数据的场景,isEdit:true 开启行内编辑,canAddRow:true 允许新增行:
|
|
79924
|
+
\`\`\`json
|
|
79925
|
+
[
|
|
79926
|
+
{
|
|
79927
|
+
"keyID": "key_tbl001",
|
|
79928
|
+
"keyCode": "users",
|
|
79929
|
+
"keyName": "用户列表",
|
|
79930
|
+
"dataType": "Array",
|
|
79931
|
+
"arrayDataType": "",
|
|
79932
|
+
"componentType": "Table",
|
|
79933
|
+
"children": [],
|
|
79934
|
+
"slots": [
|
|
79935
|
+
{ "name": "edit-AbC12345", "label": "姓名 编辑", "children": [] },
|
|
79936
|
+
{ "name": "edit-DeF67890", "label": "年龄 编辑", "children": [] },
|
|
79937
|
+
{ "name": "edit-GhI11223", "label": "部门 编辑", "children": [] }
|
|
79938
|
+
],
|
|
79939
|
+
"config": {
|
|
79940
|
+
"formConfig": {},
|
|
79941
|
+
"baseConfig": {
|
|
79942
|
+
"rowKey": "",
|
|
79943
|
+
"url": "",
|
|
79944
|
+
"data": {},
|
|
79945
|
+
"columns": [
|
|
79946
|
+
{ "id": "AbC12345", "label": "姓名", "prop": "name", "type": "default", "width": "", "editComponent": { "name": "els-input", "props": {} } },
|
|
79947
|
+
{ "id": "DeF67890", "label": "年龄", "prop": "age", "type": "default", "width": "100", "editComponent": { "name": "els-input-number", "props": { "min": 0 } } },
|
|
79948
|
+
{ "id": "GhI11223", "label": "部门", "prop": "dept", "type": "default", "width": "", "editComponent": { "name": "els-input", "props": {} } }
|
|
79949
|
+
],
|
|
79950
|
+
"align": "center",
|
|
79951
|
+
"isEdit": true,
|
|
79952
|
+
"canAddRow": true,
|
|
79953
|
+
"hasPage": false,
|
|
79954
|
+
"maxHeight": ""
|
|
79955
|
+
},
|
|
79956
|
+
"advancedConfig": {},
|
|
79957
|
+
"arrayConfig": {}
|
|
79958
|
+
}
|
|
79959
|
+
}
|
|
79960
|
+
]
|
|
79961
|
+
\`\`\`
|
|
79962
|
+
|
|
79963
|
+
## 案例6 - 条件显示/禁用(advancedConfig.vif / disabled)
|
|
79964
|
+
\`\`\`json
|
|
79965
|
+
[
|
|
79966
|
+
{
|
|
79967
|
+
"keyID": "key_004001",
|
|
79968
|
+
"keyCode": "isVip",
|
|
79969
|
+
"keyName": "是否VIP",
|
|
79970
|
+
"componentType": "Switch",
|
|
79971
|
+
"dataType": "Bool",
|
|
79972
|
+
"arrayDataType": "",
|
|
79973
|
+
"children": [],
|
|
79974
|
+
"config": {
|
|
79975
|
+
"formConfig": {},
|
|
79976
|
+
"baseConfig": { "active-text": "是", "inactive-text": "否" },
|
|
79977
|
+
"advancedConfig": { "style": "", "vif": "", "disabled": "", "eventChange": "" },
|
|
79978
|
+
"arrayConfig": {}
|
|
79979
|
+
}
|
|
79980
|
+
},
|
|
79981
|
+
{
|
|
79982
|
+
"keyID": "key_004002",
|
|
79983
|
+
"keyCode": "vipLevel",
|
|
79984
|
+
"keyName": "VIP等级",
|
|
79985
|
+
"componentType": "Select",
|
|
79986
|
+
"dataType": "String",
|
|
79987
|
+
"arrayDataType": "",
|
|
79988
|
+
"children": [],
|
|
79989
|
+
"config": {
|
|
79990
|
+
"formConfig": {},
|
|
79991
|
+
"baseConfig": { "data": [{"label": "黄金", "value": "gold"}, {"label": "铂金", "value": "platinum"}, {"label": "钻石", "value": "diamond"}], "placeholder": "请选择VIP等级" },
|
|
79992
|
+
"advancedConfig": { "style": "", "vif": "currNode['isVip']?.value == true", "disabled": "", "eventChange": "" },
|
|
79993
|
+
"arrayConfig": {}
|
|
79994
|
+
}
|
|
79995
|
+
},
|
|
79996
|
+
{
|
|
79997
|
+
"keyID": "key_004003",
|
|
79998
|
+
"keyCode": "country",
|
|
79999
|
+
"keyName": "国家",
|
|
80000
|
+
"componentType": "Select",
|
|
80001
|
+
"dataType": "String",
|
|
80002
|
+
"arrayDataType": "",
|
|
80003
|
+
"children": [],
|
|
80004
|
+
"config": {
|
|
80005
|
+
"formConfig": {},
|
|
80006
|
+
"baseConfig": { "data": [{"label": "中国", "value": "CN"}, {"label": "美国", "value": "US"}], "clearable": true, "placeholder": "请选择国家" },
|
|
80007
|
+
"advancedConfig": { "style": "", "vif": "", "disabled": "", "eventChange": "" },
|
|
80008
|
+
"arrayConfig": {}
|
|
80009
|
+
}
|
|
80010
|
+
},
|
|
80011
|
+
{
|
|
80012
|
+
"keyID": "key_004004",
|
|
80013
|
+
"keyCode": "province",
|
|
80014
|
+
"keyName": "省份",
|
|
80015
|
+
"componentType": "Input",
|
|
80016
|
+
"dataType": "String",
|
|
80017
|
+
"arrayDataType": "",
|
|
80018
|
+
"children": [],
|
|
80019
|
+
"config": {
|
|
80020
|
+
"formConfig": { "re_required": "currNode['country']?.value == 'CN'", "requiredMessage": "请输入省份" },
|
|
80021
|
+
"baseConfig": { "placeholder": "请输入省份" },
|
|
80022
|
+
"advancedConfig": { "style": "", "vif": "currNode['country']?.value == 'CN'", "disabled": "", "eventChange": "" },
|
|
80023
|
+
"arrayConfig": {}
|
|
80024
|
+
}
|
|
80025
|
+
}
|
|
80026
|
+
]
|
|
80027
|
+
\`\`\`
|
|
80028
|
+
|
|
80029
|
+
## 案例5 - 必填验证与格式校验
|
|
80030
|
+
\`\`\`json
|
|
80031
|
+
[
|
|
80032
|
+
{
|
|
80033
|
+
"keyID": "key_005001",
|
|
80034
|
+
"keyCode": "email",
|
|
80035
|
+
"keyName": "邮箱",
|
|
80036
|
+
"componentType": "Input",
|
|
80037
|
+
"dataType": "String",
|
|
80038
|
+
"arrayDataType": "",
|
|
80039
|
+
"children": [],
|
|
80040
|
+
"config": {
|
|
80041
|
+
"formConfig": { "re_required": "true", "requiredMessage": "请输入邮箱", "validType": "email", "validMessage": "请输入正确的邮箱格式", "tip": "用于接收通知", "tipPosition": "right" },
|
|
80042
|
+
"baseConfig": { "placeholder": "请输入邮箱地址", "clearable": true },
|
|
80043
|
+
"advancedConfig": { "style": "", "vif": "", "disabled": "", "eventChange": "" },
|
|
80044
|
+
"arrayConfig": {}
|
|
80045
|
+
}
|
|
80046
|
+
},
|
|
80047
|
+
{
|
|
80048
|
+
"keyID": "key_005002",
|
|
80049
|
+
"keyCode": "phone",
|
|
80050
|
+
"keyName": "手机号",
|
|
80051
|
+
"componentType": "Input",
|
|
80052
|
+
"dataType": "String",
|
|
80053
|
+
"arrayDataType": "",
|
|
80054
|
+
"children": [],
|
|
80055
|
+
"config": {
|
|
80056
|
+
"formConfig": { "re_required": "true", "requiredMessage": "请输入手机号", "validType": "phone", "validMessage": "请输入正确的11位手机号" },
|
|
80057
|
+
"baseConfig": { "placeholder": "请输入手机号", "maxlength": "11" },
|
|
80058
|
+
"advancedConfig": { "style": "", "vif": "", "disabled": "", "eventChange": "" },
|
|
80059
|
+
"arrayConfig": {}
|
|
80060
|
+
}
|
|
80061
|
+
}
|
|
80062
|
+
]
|
|
80063
|
+
\`\`\``;
|
|
80064
|
+
async function callAI(url, userPrompt, options2) {
|
|
80065
|
+
var _a, _b, _c;
|
|
80066
|
+
const sys = (options2 == null ? void 0 : options2.systemPrompt) || AI_SYSTEM_PROMPT;
|
|
80067
|
+
const body = (options2 == null ? void 0 : options2.buildRequest) ? options2.buildRequest(sys, userPrompt) : { system: sys, user: userPrompt };
|
|
80068
|
+
const res = await fetch(url, {
|
|
80069
|
+
method: "POST",
|
|
80070
|
+
headers: { "Content-Type": "application/json" },
|
|
80071
|
+
body: JSON.stringify(body)
|
|
80072
|
+
});
|
|
80073
|
+
const data = await res.json();
|
|
80074
|
+
const text = (options2 == null ? void 0 : options2.pickResponse) ? options2.pickResponse(data) : ((_c = (_b = (_a = data == null ? void 0 : data.choices) == null ? void 0 : _a[0]) == null ? void 0 : _b.message) == null ? void 0 : _c.content) ?? (data == null ? void 0 : data.content) ?? (data == null ? void 0 : data.data) ?? "";
|
|
80075
|
+
return JSON.parse(text);
|
|
80076
|
+
}
|
|
79472
80077
|
const useDesign = defineStore("dynamic-design", () => {
|
|
79473
80078
|
const queue = ref([]);
|
|
79474
80079
|
const pointer = ref(-1);
|
|
@@ -79694,7 +80299,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
79694
80299
|
const objectData = ref([
|
|
79695
80300
|
{
|
|
79696
80301
|
keyID: "id_" + utils.randomNumber().toString(),
|
|
79697
|
-
keyName: "
|
|
80302
|
+
keyName: "对象表单",
|
|
79698
80303
|
keyCode: "key_" + utils.randomNumber().toString(),
|
|
79699
80304
|
children: [],
|
|
79700
80305
|
dataType: (_a = currDynamicDataType.value.find((cele) => cele.type == "Object")) == null ? void 0 : _a.value,
|
|
@@ -79703,7 +80308,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
79703
80308
|
arrayDataType: "",
|
|
79704
80309
|
componentGroup: "Form",
|
|
79705
80310
|
componentTypeName: "",
|
|
79706
|
-
componentTypeLabel: "
|
|
80311
|
+
componentTypeLabel: "对象表单",
|
|
79707
80312
|
componentName: "",
|
|
79708
80313
|
componentType: "",
|
|
79709
80314
|
formItem: true,
|
|
@@ -79722,14 +80327,14 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
79722
80327
|
},
|
|
79723
80328
|
{
|
|
79724
80329
|
keyID: "id_" + utils.randomNumber().toString(),
|
|
79725
|
-
keyName: "
|
|
80330
|
+
keyName: "数组",
|
|
79726
80331
|
keyCode: "key_" + utils.randomNumber().toString(),
|
|
79727
80332
|
children: [],
|
|
79728
80333
|
dataType: (_b = currDynamicDataType.value.find((cele) => cele.type == "Array")) == null ? void 0 : _b.value,
|
|
79729
80334
|
dataTypeName: "Array",
|
|
79730
80335
|
componentGroup: "Form",
|
|
79731
80336
|
componentTypeName: "",
|
|
79732
|
-
componentTypeLabel: "
|
|
80337
|
+
componentTypeLabel: "数组",
|
|
79733
80338
|
componentName: "",
|
|
79734
80339
|
componentType: "",
|
|
79735
80340
|
arrayDataTypeName: "",
|
|
@@ -80364,8 +80969,46 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
80364
80969
|
const parentSiblings = ((parentCtx == null ? void 0 : parentCtx.siblings) || []).filter(isFormField).map(toFieldItem);
|
|
80365
80970
|
const parentSelf = isFormField(ctx.parent) ? [toFieldItem(ctx.parent)] : [];
|
|
80366
80971
|
return [...parentSelf, ...parentSiblings];
|
|
80972
|
+
},
|
|
80973
|
+
triggerAiGenerate: (targetNode) => handleAiGenerate(targetNode),
|
|
80974
|
+
get aiUrl() {
|
|
80975
|
+
return props2.aiUrl;
|
|
80976
|
+
}
|
|
80977
|
+
});
|
|
80978
|
+
const aiPrompt = ref("");
|
|
80979
|
+
const aiGenerating = ref(false);
|
|
80980
|
+
const showAiDialog = ref(false);
|
|
80981
|
+
const aiTargetNode = ref(null);
|
|
80982
|
+
function handleAiGenerate(targetNode) {
|
|
80983
|
+
aiTargetNode.value = targetNode;
|
|
80984
|
+
showAiDialog.value = true;
|
|
80985
|
+
}
|
|
80986
|
+
async function confirmAiGenerate() {
|
|
80987
|
+
if (!aiPrompt.value.trim()) return;
|
|
80988
|
+
aiGenerating.value = true;
|
|
80989
|
+
try {
|
|
80990
|
+
const nodes = await callAI(props2.aiUrl, aiPrompt.value, {
|
|
80991
|
+
systemPrompt: props2.aiSystemPrompt,
|
|
80992
|
+
buildRequest: props2.aiBuildRequest,
|
|
80993
|
+
pickResponse: props2.aiPickResponse
|
|
80994
|
+
});
|
|
80995
|
+
const processed = dynamicHandler.compatibleVersion(nodes);
|
|
80996
|
+
dynamicHandler.initConfig(processed);
|
|
80997
|
+
dynamicHandler.initConfigType(processed);
|
|
80998
|
+
if (aiTargetNode.value) {
|
|
80999
|
+
aiTargetNode.value.children.push(...processed);
|
|
81000
|
+
} else {
|
|
81001
|
+
renderData.value.length = 0;
|
|
81002
|
+
renderData.value.push(...processed);
|
|
81003
|
+
}
|
|
81004
|
+
showAiDialog.value = false;
|
|
81005
|
+
aiPrompt.value = "";
|
|
81006
|
+
} catch (e) {
|
|
81007
|
+
ProxyElsMessage.error("AI 生成失败,请检查接口地址或重试");
|
|
81008
|
+
} finally {
|
|
81009
|
+
aiGenerating.value = false;
|
|
80367
81010
|
}
|
|
80368
|
-
}
|
|
81011
|
+
}
|
|
80369
81012
|
function handleMenuCommand(menu) {
|
|
80370
81013
|
if (menu.Action === "copy") {
|
|
80371
81014
|
handleCopyNode();
|
|
@@ -80398,6 +81041,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
80398
81041
|
const _component_el_icon = resolveComponent("el-icon");
|
|
80399
81042
|
const _component_el_link = resolveComponent("el-link");
|
|
80400
81043
|
const _component_Delete = resolveComponent("Delete");
|
|
81044
|
+
const _component_MagicStick = resolveComponent("MagicStick");
|
|
80401
81045
|
const _component_ElsJsonEditor = resolveComponent("ElsJsonEditor");
|
|
80402
81046
|
const _component_els_data_modal = resolveComponent("els-data-modal");
|
|
80403
81047
|
const _component_View = resolveComponent("View");
|
|
@@ -80414,6 +81058,8 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
80414
81058
|
const _component_ElsJsonViewer = resolveComponent("ElsJsonViewer");
|
|
80415
81059
|
const _component_els_dialog = resolveComponent("els-dialog");
|
|
80416
81060
|
const _component_els_menu_context = resolveComponent("els-menu-context");
|
|
81061
|
+
const _component_el_input = resolveComponent("el-input");
|
|
81062
|
+
const _component_el_dialog = resolveComponent("el-dialog");
|
|
80417
81063
|
return openBlock(), createElementBlock(Fragment$1, null, [
|
|
80418
81064
|
createElementVNode("div", mergeProps({
|
|
80419
81065
|
ref_key: "designer",
|
|
@@ -80761,13 +81407,13 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
80761
81407
|
}, {
|
|
80762
81408
|
default: withCtx(() => [
|
|
80763
81409
|
createVNode(_component_els_option, null, {
|
|
80764
|
-
default: withCtx(() => [..._cache[
|
|
81410
|
+
default: withCtx(() => [..._cache[25] || (_cache[25] = [
|
|
80765
81411
|
createTextVNode("PC", -1)
|
|
80766
81412
|
])]),
|
|
80767
81413
|
_: 1
|
|
80768
81414
|
}),
|
|
80769
81415
|
createVNode(_component_els_option, null, {
|
|
80770
|
-
default: withCtx(() => [..._cache[
|
|
81416
|
+
default: withCtx(() => [..._cache[26] || (_cache[26] = [
|
|
80771
81417
|
createTextVNode("H5", -1)
|
|
80772
81418
|
])]),
|
|
80773
81419
|
_: 1
|
|
@@ -80789,7 +81435,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
80789
81435
|
]),
|
|
80790
81436
|
_: 1
|
|
80791
81437
|
}),
|
|
80792
|
-
_cache[
|
|
81438
|
+
_cache[27] || (_cache[27] = createTextVNode("返回 ", -1))
|
|
80793
81439
|
]),
|
|
80794
81440
|
_: 1
|
|
80795
81441
|
})) : createCommentVNode("", true),
|
|
@@ -80805,12 +81451,28 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
80805
81451
|
]),
|
|
80806
81452
|
_: 1
|
|
80807
81453
|
}),
|
|
80808
|
-
_cache[
|
|
81454
|
+
_cache[28] || (_cache[28] = createTextVNode("清空 ", -1))
|
|
80809
81455
|
]),
|
|
80810
81456
|
_: 1
|
|
80811
81457
|
})) : createCommentVNode("", true),
|
|
80812
|
-
!_ctx.toolbar || _ctx.toolbar.includes("
|
|
81458
|
+
props2.aiUrl && (!_ctx.toolbar || _ctx.toolbar.includes("ai")) ? (openBlock(), createBlock(_component_el_link, {
|
|
80813
81459
|
key: 2,
|
|
81460
|
+
type: "primary",
|
|
81461
|
+
onClick: _cache[3] || (_cache[3] = ($event) => handleAiGenerate(null))
|
|
81462
|
+
}, {
|
|
81463
|
+
default: withCtx(() => [
|
|
81464
|
+
createVNode(_component_el_icon, null, {
|
|
81465
|
+
default: withCtx(() => [
|
|
81466
|
+
createVNode(_component_MagicStick)
|
|
81467
|
+
]),
|
|
81468
|
+
_: 1
|
|
81469
|
+
}),
|
|
81470
|
+
_cache[29] || (_cache[29] = createTextVNode("AI生成 ", -1))
|
|
81471
|
+
]),
|
|
81472
|
+
_: 1
|
|
81473
|
+
})) : createCommentVNode("", true),
|
|
81474
|
+
!_ctx.toolbar || _ctx.toolbar.includes("import") ? (openBlock(), createBlock(_component_els_data_modal, {
|
|
81475
|
+
key: 3,
|
|
80814
81476
|
title: "导入配置",
|
|
80815
81477
|
open: handleOpenImport,
|
|
80816
81478
|
componentName: "el-link",
|
|
@@ -80823,16 +81485,16 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
80823
81485
|
default: withCtx(() => [
|
|
80824
81486
|
createVNode(_component_ElsJsonEditor, {
|
|
80825
81487
|
modelValue: importJSON.value,
|
|
80826
|
-
"onUpdate:modelValue": _cache[
|
|
81488
|
+
"onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => importJSON.value = $event),
|
|
80827
81489
|
style: { "height": "500px" }
|
|
80828
81490
|
}, null, 8, ["modelValue"])
|
|
80829
81491
|
]),
|
|
80830
81492
|
_: 1
|
|
80831
81493
|
})) : createCommentVNode("", true),
|
|
80832
81494
|
!_ctx.toolbar || _ctx.toolbar.includes("preview") ? (openBlock(), createBlock(_component_el_link, {
|
|
80833
|
-
key:
|
|
81495
|
+
key: 4,
|
|
80834
81496
|
type: "primary",
|
|
80835
|
-
onClick: _cache[
|
|
81497
|
+
onClick: _cache[5] || (_cache[5] = ($event) => viewPriview.value = !viewPriview.value)
|
|
80836
81498
|
}, {
|
|
80837
81499
|
default: withCtx(() => [
|
|
80838
81500
|
createVNode(_component_el_icon, null, {
|
|
@@ -80841,12 +81503,12 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
80841
81503
|
]),
|
|
80842
81504
|
_: 1
|
|
80843
81505
|
}),
|
|
80844
|
-
_cache[
|
|
81506
|
+
_cache[30] || (_cache[30] = createTextVNode("预览 ", -1))
|
|
80845
81507
|
]),
|
|
80846
81508
|
_: 1
|
|
80847
81509
|
})) : createCommentVNode("", true),
|
|
80848
81510
|
_ctx.onSave && (!_ctx.toolbar || _ctx.toolbar.includes("save")) ? (openBlock(), createBlock(_component_el_link, {
|
|
80849
|
-
key:
|
|
81511
|
+
key: 5,
|
|
80850
81512
|
type: "primary",
|
|
80851
81513
|
onClick: handleSave
|
|
80852
81514
|
}, {
|
|
@@ -80857,7 +81519,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
80857
81519
|
]),
|
|
80858
81520
|
_: 1
|
|
80859
81521
|
}),
|
|
80860
|
-
_cache[
|
|
81522
|
+
_cache[31] || (_cache[31] = createTextVNode("保存 ", -1))
|
|
80861
81523
|
]),
|
|
80862
81524
|
_: 1
|
|
80863
81525
|
})) : createCommentVNode("", true)
|
|
@@ -80886,15 +81548,15 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
80886
81548
|
})
|
|
80887
81549
|
]),
|
|
80888
81550
|
createElementVNode("div", _hoisted_15$2, [
|
|
80889
|
-
_cache[
|
|
81551
|
+
_cache[33] || (_cache[33] = createElementVNode("div", null, "页面已有Form表单", -1)),
|
|
80890
81552
|
createElementVNode("div", null, [
|
|
80891
81553
|
createVNode(_component_el_button, {
|
|
80892
81554
|
type: "info",
|
|
80893
|
-
onClick: _cache[
|
|
81555
|
+
onClick: _cache[6] || (_cache[6] = ($event) => {
|
|
80894
81556
|
startCreate.value = true;
|
|
80895
81557
|
})
|
|
80896
81558
|
}, {
|
|
80897
|
-
default: withCtx(() => [..._cache[
|
|
81559
|
+
default: withCtx(() => [..._cache[32] || (_cache[32] = [
|
|
80898
81560
|
createTextVNode("直接进入", -1)
|
|
80899
81561
|
])]),
|
|
80900
81562
|
_: 1
|
|
@@ -80915,13 +81577,13 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
80915
81577
|
})
|
|
80916
81578
|
]),
|
|
80917
81579
|
createElementVNode("div", _hoisted_17$1, [
|
|
80918
|
-
_cache[
|
|
81580
|
+
_cache[35] || (_cache[35] = createElementVNode("div", null, " 没有Form表单创建一个 ", -1)),
|
|
80919
81581
|
createElementVNode("div", null, [
|
|
80920
81582
|
createVNode(_component_el_button, {
|
|
80921
81583
|
type: "primary",
|
|
80922
81584
|
onClick: createRootForm
|
|
80923
81585
|
}, {
|
|
80924
|
-
default: withCtx(() => [..._cache[
|
|
81586
|
+
default: withCtx(() => [..._cache[34] || (_cache[34] = [
|
|
80925
81587
|
createTextVNode("创建表单", -1)
|
|
80926
81588
|
])]),
|
|
80927
81589
|
_: 1
|
|
@@ -80934,17 +81596,17 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
80934
81596
|
])
|
|
80935
81597
|
])
|
|
80936
81598
|
])) : (openBlock(), createElementBlock("div", _hoisted_18$1, [
|
|
80937
|
-
deviceType.value == "H5" ? (openBlock(), createBlock(
|
|
81599
|
+
deviceType.value == "H5" ? (openBlock(), createBlock(DynamicDesignerViewBody, {
|
|
80938
81600
|
key: 0,
|
|
80939
81601
|
isMobile: true,
|
|
80940
81602
|
renderData: renderData.value
|
|
80941
|
-
}, null, 8, ["renderData"])) : (openBlock(), createBlock(
|
|
81603
|
+
}, null, 8, ["renderData"])) : (openBlock(), createBlock(DynamicDesignerViewBody, {
|
|
80942
81604
|
key: 1,
|
|
80943
81605
|
type: deviceType.value,
|
|
80944
81606
|
renderData: renderData.value
|
|
80945
81607
|
}, null, 8, ["type", "renderData"])),
|
|
80946
81608
|
!renderData.value.length || renderData.value.length && renderData.value[0].componentType === "Form" && !renderData.value[0].children.length ? (openBlock(), createBlock(_component_el_empty, { key: 2 }, {
|
|
80947
|
-
description: withCtx(() => [..._cache[
|
|
81609
|
+
description: withCtx(() => [..._cache[36] || (_cache[36] = [
|
|
80948
81610
|
createTextVNode("请点击拖动", -1),
|
|
80949
81611
|
createElementVNode("span", { class: "txt-red" }, "左侧", -1),
|
|
80950
81612
|
createTextVNode("组件到此处", -1)
|
|
@@ -80960,7 +81622,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
80960
81622
|
key: 0,
|
|
80961
81623
|
stretch: "",
|
|
80962
81624
|
modelValue: selectProperty.value,
|
|
80963
|
-
"onUpdate:modelValue": _cache[
|
|
81625
|
+
"onUpdate:modelValue": _cache[12] || (_cache[12] = ($event) => selectProperty.value = $event)
|
|
80964
81626
|
}, {
|
|
80965
81627
|
default: withCtx(() => [
|
|
80966
81628
|
!_ctx.rightToolbar || _ctx.rightToolbar.includes("base") ? (openBlock(), createBlock(_component_el_tab_pane, {
|
|
@@ -80995,7 +81657,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
80995
81657
|
default: withCtx(() => [
|
|
80996
81658
|
createVNode(DynamicRenderAsync, {
|
|
80997
81659
|
modelValue: currSelectItem.value.config.baseConfig,
|
|
80998
|
-
"onUpdate:modelValue": _cache[
|
|
81660
|
+
"onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => currSelectItem.value.config.baseConfig = $event),
|
|
80999
81661
|
globalData: currSelectItem.value,
|
|
81000
81662
|
defaultValueConfig: { "Number": void 0, "Bool": void 0 },
|
|
81001
81663
|
isMobile: false,
|
|
@@ -81022,7 +81684,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
81022
81684
|
default: withCtx(() => [
|
|
81023
81685
|
createVNode(DynamicRenderAsync, {
|
|
81024
81686
|
modelValue: currSelectItem.value.config.arrayConfig,
|
|
81025
|
-
"onUpdate:modelValue": _cache[
|
|
81687
|
+
"onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => currSelectItem.value.config.arrayConfig = $event),
|
|
81026
81688
|
defaultValueConfig: { "Number": void 0, "Bool": void 0 },
|
|
81027
81689
|
isMobile: false,
|
|
81028
81690
|
config: unref(property_array),
|
|
@@ -81047,7 +81709,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
81047
81709
|
default: withCtx(() => [
|
|
81048
81710
|
createVNode(DynamicRenderAsync, {
|
|
81049
81711
|
modelValue: currSelectItem.value.config.formConfig,
|
|
81050
|
-
"onUpdate:modelValue": _cache[
|
|
81712
|
+
"onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => currSelectItem.value.config.formConfig = $event),
|
|
81051
81713
|
defaultValueConfig: { "Number": void 0, "Bool": void 0 },
|
|
81052
81714
|
isMobile: false,
|
|
81053
81715
|
config: unref(property_formItem),
|
|
@@ -81073,12 +81735,12 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
81073
81735
|
default: withCtx(() => [
|
|
81074
81736
|
createVNode(SpacingEditor, {
|
|
81075
81737
|
modelValue: currSelectItem.value.config.advancedConfig,
|
|
81076
|
-
"onUpdate:modelValue": _cache[
|
|
81738
|
+
"onUpdate:modelValue": _cache[10] || (_cache[10] = ($event) => currSelectItem.value.config.advancedConfig = $event)
|
|
81077
81739
|
}, null, 8, ["modelValue"]),
|
|
81078
81740
|
createVNode(_component_el_divider, { style: { "margin": "4px 0 8px" } }),
|
|
81079
81741
|
createVNode(DynamicRenderAsync, {
|
|
81080
81742
|
modelValue: currSelectItem.value.config.advancedConfig,
|
|
81081
|
-
"onUpdate:modelValue": _cache[
|
|
81743
|
+
"onUpdate:modelValue": _cache[11] || (_cache[11] = (v) => Object.assign(currSelectItem.value.config.advancedConfig, v)),
|
|
81082
81744
|
isMobile: false,
|
|
81083
81745
|
config: unref(property_advanced),
|
|
81084
81746
|
appendComponentTypes: conditionBuilderTypes,
|
|
@@ -81104,10 +81766,10 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
81104
81766
|
], 16),
|
|
81105
81767
|
createVNode(_component_els_dialog, {
|
|
81106
81768
|
modelValue: viewPriview.value,
|
|
81107
|
-
"onUpdate:modelValue": _cache[
|
|
81769
|
+
"onUpdate:modelValue": _cache[19] || (_cache[19] = ($event) => viewPriview.value = $event),
|
|
81108
81770
|
class: "preview-dialog",
|
|
81109
81771
|
"destroy-on-close": "",
|
|
81110
|
-
onClose: _cache[
|
|
81772
|
+
onClose: _cache[20] || (_cache[20] = ($event) => {
|
|
81111
81773
|
formValue.value = {};
|
|
81112
81774
|
}),
|
|
81113
81775
|
width: deviceType.value == "PC" ? "1300" : "500px",
|
|
@@ -81117,11 +81779,11 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
81117
81779
|
}, {
|
|
81118
81780
|
header: withCtx(() => [
|
|
81119
81781
|
createElementVNode("div", _hoisted_20$1, [
|
|
81120
|
-
_cache[
|
|
81782
|
+
_cache[39] || (_cache[39] = createElementVNode("div", null, null, -1)),
|
|
81121
81783
|
createElementVNode("div", _hoisted_21$1, [
|
|
81122
81784
|
createElementVNode("div", {
|
|
81123
81785
|
class: normalizeClass(["tab-item", { active: previewTab.value === "preview" }]),
|
|
81124
|
-
onClick: _cache[
|
|
81786
|
+
onClick: _cache[13] || (_cache[13] = ($event) => previewTab.value = "preview")
|
|
81125
81787
|
}, [
|
|
81126
81788
|
createVNode(_component_el_icon, null, {
|
|
81127
81789
|
default: withCtx(() => [
|
|
@@ -81129,11 +81791,11 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
81129
81791
|
]),
|
|
81130
81792
|
_: 1
|
|
81131
81793
|
}),
|
|
81132
|
-
_cache[
|
|
81794
|
+
_cache[37] || (_cache[37] = createTextVNode(" 效果预览 ", -1))
|
|
81133
81795
|
], 2),
|
|
81134
81796
|
createElementVNode("div", {
|
|
81135
81797
|
class: normalizeClass(["tab-item", { active: previewTab.value === "properties" }]),
|
|
81136
|
-
onClick: _cache[
|
|
81798
|
+
onClick: _cache[14] || (_cache[14] = ($event) => previewTab.value = "properties")
|
|
81137
81799
|
}, [
|
|
81138
81800
|
createVNode(_component_el_icon, null, {
|
|
81139
81801
|
default: withCtx(() => [
|
|
@@ -81141,10 +81803,10 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
81141
81803
|
]),
|
|
81142
81804
|
_: 1
|
|
81143
81805
|
}),
|
|
81144
|
-
_cache[
|
|
81806
|
+
_cache[38] || (_cache[38] = createTextVNode(" 数据模型 ", -1))
|
|
81145
81807
|
], 2)
|
|
81146
81808
|
]),
|
|
81147
|
-
_cache[
|
|
81809
|
+
_cache[40] || (_cache[40] = createElementVNode("div", { class: "header-actions" }, null, -1))
|
|
81148
81810
|
])
|
|
81149
81811
|
]),
|
|
81150
81812
|
default: withCtx(() => [
|
|
@@ -81155,8 +81817,8 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
81155
81817
|
withDirectives(createElementVNode("div", _hoisted_23, [
|
|
81156
81818
|
deviceType.value === "H5" ? (openBlock(), createElementBlock("div", _hoisted_24, [
|
|
81157
81819
|
createElementVNode("div", _hoisted_25, [
|
|
81158
|
-
_cache[
|
|
81159
|
-
_cache[
|
|
81820
|
+
_cache[41] || (_cache[41] = createElementVNode("span", { class: "time" }, "10:40", -1)),
|
|
81821
|
+
_cache[42] || (_cache[42] = createElementVNode("div", { class: "camera" }, null, -1)),
|
|
81160
81822
|
createElementVNode("div", _hoisted_26, [
|
|
81161
81823
|
createVNode(_component_el_icon, null, {
|
|
81162
81824
|
default: withCtx(() => [
|
|
@@ -81177,9 +81839,9 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
81177
81839
|
default: withCtx(() => [
|
|
81178
81840
|
createVNode(DynamicRender, {
|
|
81179
81841
|
modelValue: formValue.value,
|
|
81180
|
-
"onUpdate:modelValue": _cache[
|
|
81842
|
+
"onUpdate:modelValue": _cache[15] || (_cache[15] = ($event) => formValue.value = $event),
|
|
81181
81843
|
"label-value": labelValue.value,
|
|
81182
|
-
"onUpdate:labelValue": _cache[
|
|
81844
|
+
"onUpdate:labelValue": _cache[16] || (_cache[16] = ($event) => labelValue.value = $event),
|
|
81183
81845
|
defaultValueConfig: { "Number": void 0, "Bool": void 0 },
|
|
81184
81846
|
config: renderData.value,
|
|
81185
81847
|
isMobile: true
|
|
@@ -81188,7 +81850,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
81188
81850
|
_: 1
|
|
81189
81851
|
})
|
|
81190
81852
|
]),
|
|
81191
|
-
_cache[
|
|
81853
|
+
_cache[43] || (_cache[43] = createElementVNode("div", { class: "mobile-home-bar" }, null, -1))
|
|
81192
81854
|
])) : (openBlock(), createElementBlock("div", _hoisted_28, [
|
|
81193
81855
|
createElementVNode("div", _hoisted_29, [
|
|
81194
81856
|
createVNode(_component_el_scrollbar, null, {
|
|
@@ -81196,9 +81858,9 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
81196
81858
|
createElementVNode("div", _hoisted_30, [
|
|
81197
81859
|
createVNode(DynamicRender, {
|
|
81198
81860
|
modelValue: formValue.value,
|
|
81199
|
-
"onUpdate:modelValue": _cache[
|
|
81861
|
+
"onUpdate:modelValue": _cache[17] || (_cache[17] = ($event) => formValue.value = $event),
|
|
81200
81862
|
"label-value": labelValue.value,
|
|
81201
|
-
"onUpdate:labelValue": _cache[
|
|
81863
|
+
"onUpdate:labelValue": _cache[18] || (_cache[18] = ($event) => labelValue.value = $event),
|
|
81202
81864
|
defaultValueConfig: { "Number": void 0, "Bool": void 0 },
|
|
81203
81865
|
config: renderData.value,
|
|
81204
81866
|
isMobile: false
|
|
@@ -81234,16 +81896,55 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
81234
81896
|
ref: "contentMenu",
|
|
81235
81897
|
data: unref(contextMenus),
|
|
81236
81898
|
modelValue: unref(contextMenuVisible),
|
|
81237
|
-
"onUpdate:modelValue": _cache[
|
|
81899
|
+
"onUpdate:modelValue": _cache[21] || (_cache[21] = ($event) => isRef(contextMenuVisible) ? contextMenuVisible.value = $event : contextMenuVisible = $event),
|
|
81238
81900
|
positionLeft: unref(contextMenuPositionLeft),
|
|
81239
81901
|
positionTop: unref(contextMenuPositionTop),
|
|
81240
81902
|
onClick: handleMenuCommand
|
|
81241
|
-
}, null, 8, ["data", "modelValue", "positionLeft", "positionTop"])
|
|
81903
|
+
}, null, 8, ["data", "modelValue", "positionLeft", "positionTop"]),
|
|
81904
|
+
createVNode(_component_el_dialog, {
|
|
81905
|
+
modelValue: showAiDialog.value,
|
|
81906
|
+
"onUpdate:modelValue": _cache[24] || (_cache[24] = ($event) => showAiDialog.value = $event),
|
|
81907
|
+
title: "AI 生成表单",
|
|
81908
|
+
width: "500px",
|
|
81909
|
+
"close-on-click-modal": false,
|
|
81910
|
+
"append-to-body": ""
|
|
81911
|
+
}, {
|
|
81912
|
+
footer: withCtx(() => [
|
|
81913
|
+
createVNode(_component_el_button, {
|
|
81914
|
+
onClick: _cache[23] || (_cache[23] = ($event) => showAiDialog.value = false)
|
|
81915
|
+
}, {
|
|
81916
|
+
default: withCtx(() => [..._cache[44] || (_cache[44] = [
|
|
81917
|
+
createTextVNode("取消", -1)
|
|
81918
|
+
])]),
|
|
81919
|
+
_: 1
|
|
81920
|
+
}),
|
|
81921
|
+
createVNode(_component_el_button, {
|
|
81922
|
+
type: "primary",
|
|
81923
|
+
loading: aiGenerating.value,
|
|
81924
|
+
onClick: confirmAiGenerate
|
|
81925
|
+
}, {
|
|
81926
|
+
default: withCtx(() => [..._cache[45] || (_cache[45] = [
|
|
81927
|
+
createTextVNode("生成", -1)
|
|
81928
|
+
])]),
|
|
81929
|
+
_: 1
|
|
81930
|
+
}, 8, ["loading"])
|
|
81931
|
+
]),
|
|
81932
|
+
default: withCtx(() => [
|
|
81933
|
+
createVNode(_component_el_input, {
|
|
81934
|
+
modelValue: aiPrompt.value,
|
|
81935
|
+
"onUpdate:modelValue": _cache[22] || (_cache[22] = ($event) => aiPrompt.value = $event),
|
|
81936
|
+
type: "textarea",
|
|
81937
|
+
rows: 5,
|
|
81938
|
+
placeholder: "描述要生成的表单,例如:用户注册表单,包含姓名、手机号、邮箱、密码字段,其中手机号和邮箱必填"
|
|
81939
|
+
}, null, 8, ["modelValue"])
|
|
81940
|
+
]),
|
|
81941
|
+
_: 1
|
|
81942
|
+
}, 8, ["modelValue"])
|
|
81242
81943
|
], 64);
|
|
81243
81944
|
};
|
|
81244
81945
|
}
|
|
81245
81946
|
});
|
|
81246
|
-
const DesignerView = /* @__PURE__ */ _export_sfc$1(_sfc_main$t, [["__scopeId", "data-v-
|
|
81947
|
+
const DesignerView = /* @__PURE__ */ _export_sfc$1(_sfc_main$t, [["__scopeId", "data-v-4d6c4873"]]);
|
|
81247
81948
|
const ElsDesignerView = withInstall$1(DesignerView);
|
|
81248
81949
|
(function(Prism2) {
|
|
81249
81950
|
var string = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
|
|
@@ -81982,31 +82683,31 @@ let AceEditor$1 = class AceEditor extends TBaseFormItem {
|
|
|
81982
82683
|
__publicField(this, "editor", ref());
|
|
81983
82684
|
onMounted(() => {
|
|
81984
82685
|
if (props2.language === "json") {
|
|
81985
|
-
const currModule = import("./mode-json-
|
|
82686
|
+
const currModule = import("./mode-json-B_6Rc56R.js").then((n) => n.m);
|
|
81986
82687
|
currModule.then((res) => {
|
|
81987
82688
|
ace.config.setModuleUrl("ace/mode/json", res);
|
|
81988
82689
|
this.init();
|
|
81989
82690
|
});
|
|
81990
82691
|
} else if (props2.language === "javascript") {
|
|
81991
|
-
const currModule = import("./mode-javascript-
|
|
82692
|
+
const currModule = import("./mode-javascript-B4nfmHwI.js").then((n) => n.m);
|
|
81992
82693
|
currModule.then((res) => {
|
|
81993
82694
|
ace.config.setModuleUrl("ace/mode/javascript", res);
|
|
81994
82695
|
this.init();
|
|
81995
82696
|
});
|
|
81996
82697
|
} else if (props2.language === "csharp") {
|
|
81997
|
-
const currModule = import("./mode-csharp-
|
|
82698
|
+
const currModule = import("./mode-csharp-DpcfdC7v.js").then((n) => n.m);
|
|
81998
82699
|
currModule.then((res) => {
|
|
81999
82700
|
ace.config.setModuleUrl("ace/mode/csharp", res);
|
|
82000
82701
|
this.init();
|
|
82001
82702
|
});
|
|
82002
82703
|
} else if (props2.language === "mysql") {
|
|
82003
|
-
const currModule = import("./mode-mysql-
|
|
82704
|
+
const currModule = import("./mode-mysql-D25NsOyA.js").then((n) => n.m);
|
|
82004
82705
|
currModule.then((res) => {
|
|
82005
82706
|
ace.config.setModuleUrl("ace/mode/mysql", res);
|
|
82006
82707
|
this.init();
|
|
82007
82708
|
});
|
|
82008
82709
|
} else if (props2.language === "css") {
|
|
82009
|
-
const currModule = import("./mode-css-
|
|
82710
|
+
const currModule = import("./mode-css-Bw3HxevP.js").then((n) => n.m);
|
|
82010
82711
|
currModule.then((res) => {
|
|
82011
82712
|
ace.config.setModuleUrl("ace/mode/css", res);
|
|
82012
82713
|
this.init();
|