@fecp/designer 5.6.30 → 5.6.31
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/es/_virtual/_commonjsHelpers.mjs +25 -0
- package/es/_virtual/index.mjs +4 -4
- package/es/_virtual/index2.mjs +2 -5
- package/es/_virtual/index3.mjs +5 -3
- package/es/_virtual/index4.mjs +5 -2
- package/es/_virtual/index5.mjs +3 -2
- package/es/_virtual/index6.mjs +4 -0
- package/es/_virtual/index7.mjs +4 -0
- package/es/config-dev.js +2 -0
- package/es/designer/package.json.mjs +1 -1
- package/es/designer/src/axios/config.mjs +10 -3
- package/es/designer/src/axios/crypto.mjs +1 -5
- package/es/designer/src/packages/aiForm/AiDiffTable.vue.mjs +152 -0
- package/es/designer/src/packages/aiForm/api.mjs +21 -0
- package/es/designer/src/packages/aiForm/apply.mjs +153 -0
- package/es/designer/src/packages/aiForm/compressConfig.mjs +69 -0
- package/es/designer/src/packages/aiForm/constants.mjs +184 -0
- package/es/designer/src/packages/aiForm/diff.mjs +140 -0
- package/es/designer/src/packages/aiForm/index.vue.mjs +301 -0
- package/es/designer/src/packages/aiForm/normalizeFieldList.mjs +138 -0
- package/es/designer/src/packages/aiForm/parseAiResult.mjs +245 -0
- package/es/designer/src/packages/aiForm/prompt.mjs +130 -0
- package/es/designer/src/packages/aiForm/useAiFormDrawer.mjs +16 -0
- package/es/designer/src/packages/dataSource/dataSource.vue.mjs +45 -30
- package/es/designer/src/packages/form/headerBtn.vue.mjs +4 -1
- package/es/designer/src/packages/form/index.vue.mjs +16 -2
- package/es/designer/src/packages/utils/datasource.mjs +14 -1
- package/es/designer.css +444 -153
- package/es/node_modules/@braintree/sanitize-url/dist/index.mjs +1 -1
- package/es/node_modules/diagram-js/lib/model/index.mjs +1 -1
- package/es/node_modules/element-plus/es/utils/vue/icon.mjs +1 -1
- package/es/node_modules/highlight.js/es/index.mjs +1 -1
- package/es/node_modules/mermaid/dist/chunks/mermaid.core/c4Diagram-LMCZKHZV.mjs +1 -1
- package/es/node_modules/mermaid/dist/chunks/mermaid.core/chunk-32BRIVSS.mjs +1 -1
- package/es/node_modules/mermaid/dist/chunks/mermaid.core/chunk-ICXQ74PX.mjs +1 -1
- package/es/node_modules/mermaid/dist/chunks/mermaid.core/classDiagram-OUVF2IWQ.mjs +1 -1
- package/es/node_modules/mermaid/dist/chunks/mermaid.core/classDiagram-v2-EOCWNBFH.mjs +1 -1
- package/es/node_modules/mermaid/dist/chunks/mermaid.core/flowDiagram-23GEKE2U.mjs +1 -1
- package/es/node_modules/mermaid/dist/chunks/mermaid.core/ganttDiagram-NO4QXBWP.mjs +1 -1
- package/es/node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-DBY2YBRQ.mjs +1 -1
- package/es/node_modules/mermaid/dist/chunks/mermaid.core/stateDiagram-2N3HPSRC.mjs +1 -1
- package/es/node_modules/mermaid/dist/chunks/mermaid.core/stateDiagram-v2-6OUMAXLB.mjs +1 -1
- package/es/node_modules/mermaid/dist/chunks/mermaid.core/swimlanesDiagram-G3AALYLV.mjs +1 -1
- package/es/node_modules/object-refs/index.mjs +1 -1
- package/es/packages/mobile/src/axios/config.mjs +8 -4
- package/es/packages/mobile/src/components/ai/MarkdownRenderer/MarkdownRenderer.vue.mjs +1 -1
- package/es/packages/mobile/src/components/custom/approvalBar/ApprovalBar.vue.mjs +53 -13
- package/es/packages/mobile/src/components/custom/approvalBar/FlowUserSelect.vue.mjs +215 -0
- package/es/packages/mobile/src/components/dataDisplay/cardList/CardList.vue.mjs +19 -15
- package/es/packages/mobile/src/utils/datasource.mjs +14 -1
- package/es/packages/mobile/src/utils/formatterUtil.mjs +24 -12
- package/es/packages/vue/src/components/forms/form/Form.vue.mjs +5 -7
- package/es/packages/vue/src/utils/datasource.mjs +14 -1
- package/lib/_virtual/_commonjsHelpers.js +25 -0
- package/lib/_virtual/index.js +4 -4
- package/lib/_virtual/index2.js +3 -6
- package/lib/_virtual/index3.js +6 -4
- package/lib/_virtual/index4.js +6 -3
- package/lib/_virtual/index5.js +3 -2
- package/lib/_virtual/index6.js +4 -0
- package/lib/_virtual/index7.js +4 -0
- package/lib/config-dev.js +2 -0
- package/lib/designer/package.json.js +1 -1
- package/lib/designer/src/axios/config.js +10 -3
- package/lib/designer/src/axios/crypto.js +0 -4
- package/lib/designer/src/packages/aiForm/AiDiffTable.vue.js +152 -0
- package/lib/designer/src/packages/aiForm/api.js +21 -0
- package/lib/designer/src/packages/aiForm/apply.js +153 -0
- package/lib/designer/src/packages/aiForm/compressConfig.js +69 -0
- package/lib/designer/src/packages/aiForm/constants.js +184 -0
- package/lib/designer/src/packages/aiForm/diff.js +140 -0
- package/lib/designer/src/packages/aiForm/index.vue.js +301 -0
- package/lib/designer/src/packages/aiForm/normalizeFieldList.js +138 -0
- package/lib/designer/src/packages/aiForm/parseAiResult.js +245 -0
- package/lib/designer/src/packages/aiForm/prompt.js +130 -0
- package/lib/designer/src/packages/aiForm/useAiFormDrawer.js +16 -0
- package/lib/designer/src/packages/dataSource/dataSource.vue.js +44 -29
- package/lib/designer/src/packages/form/headerBtn.vue.js +4 -1
- package/lib/designer/src/packages/form/index.vue.js +15 -1
- package/lib/designer/src/packages/utils/datasource.js +14 -1
- package/lib/designer.css +444 -153
- package/lib/node_modules/@braintree/sanitize-url/dist/index.js +1 -1
- package/lib/node_modules/diagram-js/lib/model/index.js +1 -1
- package/lib/node_modules/highlight.js/es/index.js +1 -1
- package/lib/node_modules/mermaid/dist/chunks/mermaid.core/c4Diagram-LMCZKHZV.js +1 -1
- package/lib/node_modules/mermaid/dist/chunks/mermaid.core/chunk-32BRIVSS.js +1 -1
- package/lib/node_modules/mermaid/dist/chunks/mermaid.core/chunk-ICXQ74PX.js +1 -1
- package/lib/node_modules/mermaid/dist/chunks/mermaid.core/classDiagram-OUVF2IWQ.js +1 -1
- package/lib/node_modules/mermaid/dist/chunks/mermaid.core/classDiagram-v2-EOCWNBFH.js +1 -1
- package/lib/node_modules/mermaid/dist/chunks/mermaid.core/flowDiagram-23GEKE2U.js +1 -1
- package/lib/node_modules/mermaid/dist/chunks/mermaid.core/ganttDiagram-NO4QXBWP.js +1 -1
- package/lib/node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-DBY2YBRQ.js +1 -1
- package/lib/node_modules/mermaid/dist/chunks/mermaid.core/stateDiagram-2N3HPSRC.js +1 -1
- package/lib/node_modules/mermaid/dist/chunks/mermaid.core/stateDiagram-v2-6OUMAXLB.js +1 -1
- package/lib/node_modules/mermaid/dist/chunks/mermaid.core/swimlanesDiagram-G3AALYLV.js +1 -1
- package/lib/node_modules/object-refs/index.js +1 -1
- package/lib/packages/mobile/src/axios/config.js +8 -4
- package/lib/packages/mobile/src/components/ai/MarkdownRenderer/MarkdownRenderer.vue.js +1 -1
- package/lib/packages/mobile/src/components/custom/approvalBar/ApprovalBar.vue.js +52 -12
- package/lib/packages/mobile/src/components/custom/approvalBar/FlowUserSelect.vue.js +215 -0
- package/lib/packages/mobile/src/components/dataDisplay/cardList/CardList.vue.js +19 -15
- package/lib/packages/mobile/src/utils/datasource.js +14 -1
- package/lib/packages/mobile/src/utils/formatterUtil.js +24 -12
- package/lib/packages/vue/src/components/forms/form/Form.vue.js +4 -6
- package/lib/packages/vue/src/utils/datasource.js +14 -1
- package/package.json +1 -1
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const constants = require("./constants.js");
|
|
4
|
+
function extractDataSources(editConfigData) {
|
|
5
|
+
const list = editConfigData == null ? void 0 : editConfigData.dataSources;
|
|
6
|
+
if (!Array.isArray(list) || !list.length) return [];
|
|
7
|
+
return list.map((ds) => ({
|
|
8
|
+
id: ds.id,
|
|
9
|
+
name: ds.name || "",
|
|
10
|
+
url: ds.url || ""
|
|
11
|
+
}));
|
|
12
|
+
}
|
|
13
|
+
function extractDictionaries(editConfigData) {
|
|
14
|
+
const fields = (editConfigData == null ? void 0 : editConfigData.fieldsData) || [];
|
|
15
|
+
const set = /* @__PURE__ */ new Set();
|
|
16
|
+
fields.forEach((item) => {
|
|
17
|
+
var _a, _b;
|
|
18
|
+
const key = (_b = (_a = item == null ? void 0 : item.component) == null ? void 0 : _a.optionConfig) == null ? void 0 : _b.dictionaryValue;
|
|
19
|
+
if (key) set.add(key);
|
|
20
|
+
});
|
|
21
|
+
return [...set];
|
|
22
|
+
}
|
|
23
|
+
function getVisibleLayoutItems(editConfigData) {
|
|
24
|
+
const fields = (editConfigData == null ? void 0 : editConfigData.fieldsData) || [];
|
|
25
|
+
return fields.filter((item) => item && item.component && item.hidden !== true).sort((a, b) => {
|
|
26
|
+
if (a.y !== b.y) return (a.y || 0) - (b.y || 0);
|
|
27
|
+
return (a.x || 0) - (b.x || 0);
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
function compressComponent(component) {
|
|
31
|
+
const fieldType = component.fieldType;
|
|
32
|
+
const result = {};
|
|
33
|
+
if (!constants.AI_FIELD_TYPES[fieldType]) {
|
|
34
|
+
return { fieldType, label: component.label || "", _unsupported: true };
|
|
35
|
+
}
|
|
36
|
+
const allowed = constants.getAllowedProps(fieldType);
|
|
37
|
+
for (const key of allowed) {
|
|
38
|
+
if (component[key] !== void 0) {
|
|
39
|
+
result[key] = component[key];
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return result;
|
|
43
|
+
}
|
|
44
|
+
function compressFormConfig(editConfigData) {
|
|
45
|
+
if (!editConfigData) return null;
|
|
46
|
+
const items = getVisibleLayoutItems(editConfigData);
|
|
47
|
+
if (!items.length) return null;
|
|
48
|
+
const fields = items.map((item) => compressComponent(item.component));
|
|
49
|
+
return {
|
|
50
|
+
columns: editConfigData.columns ?? 2,
|
|
51
|
+
labelWidth: editConfigData.labelWidth ?? 120,
|
|
52
|
+
labelPosition: editConfigData.labelPosition ?? "right",
|
|
53
|
+
fields
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
function buildAiInput(editConfigData, opts = {}) {
|
|
57
|
+
const { includeCurrentConfig = true } = opts;
|
|
58
|
+
return {
|
|
59
|
+
currentConfig: includeCurrentConfig ? compressFormConfig(editConfigData) : null,
|
|
60
|
+
dataSources: extractDataSources(editConfigData),
|
|
61
|
+
dictionaries: extractDictionaries(editConfigData)
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
exports.buildAiInput = buildAiInput;
|
|
65
|
+
exports.compressComponent = compressComponent;
|
|
66
|
+
exports.compressFormConfig = compressFormConfig;
|
|
67
|
+
exports.extractDataSources = extractDataSources;
|
|
68
|
+
exports.extractDictionaries = extractDictionaries;
|
|
69
|
+
exports.getVisibleLayoutItems = getVisibleLayoutItems;
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const AI_FIELD_TYPES = {
|
|
4
|
+
// 输入类
|
|
5
|
+
text: { label: "单行文本", group: "input", height: 1 },
|
|
6
|
+
textarea: { label: "多行文本", group: "input", height: 2 },
|
|
7
|
+
number: { label: "数字", group: "input", height: 1 },
|
|
8
|
+
date: { label: "日期时间", group: "date", height: 1 },
|
|
9
|
+
// 选择类
|
|
10
|
+
select: { label: "下拉单选", group: "select", height: 1 },
|
|
11
|
+
multipleSelection: { label: "下拉多选", group: "select", height: 1 },
|
|
12
|
+
radio: { label: "单选框", group: "select", height: 1 },
|
|
13
|
+
checkbox: { label: "多选框", group: "select", height: 1 },
|
|
14
|
+
switch: { label: "开关", group: "select", height: 1 },
|
|
15
|
+
// 自包含高级类(无需外部资源 id)
|
|
16
|
+
richText: { label: "富文本", group: "advanced", height: 2 },
|
|
17
|
+
area: { label: "区域选择", group: "advanced", height: 1 },
|
|
18
|
+
industry: { label: "行业选择", group: "advanced", height: 1 },
|
|
19
|
+
// 布局/展示类
|
|
20
|
+
subTitle: { label: "子标题", group: "layout", height: 1 },
|
|
21
|
+
h2: { label: "标题", group: "layout", height: 1 },
|
|
22
|
+
blank: { label: "空白占位", group: "layout", height: 1 },
|
|
23
|
+
divider: { label: "分割线", group: "layout", height: 1 }
|
|
24
|
+
};
|
|
25
|
+
const OPTION_FIELD_TYPES = [
|
|
26
|
+
"select",
|
|
27
|
+
"multipleSelection",
|
|
28
|
+
"radio",
|
|
29
|
+
"checkbox"
|
|
30
|
+
];
|
|
31
|
+
const LAYOUT_FIELD_TYPES = ["subTitle", "h2", "blank", "divider"];
|
|
32
|
+
const AI_COMMON_PROPS = [
|
|
33
|
+
"fieldType",
|
|
34
|
+
// 控件类型,必填
|
|
35
|
+
"label",
|
|
36
|
+
// 中文标题,必填
|
|
37
|
+
"fieldName",
|
|
38
|
+
// 英文字段名,非布局类必填
|
|
39
|
+
"required",
|
|
40
|
+
// 是否必填
|
|
41
|
+
"requiredMessage",
|
|
42
|
+
// 必填提示语
|
|
43
|
+
"placeholder",
|
|
44
|
+
// 输入提示
|
|
45
|
+
"tooltip",
|
|
46
|
+
// 字段说明
|
|
47
|
+
"defaultValue",
|
|
48
|
+
// 默认值
|
|
49
|
+
"disabled",
|
|
50
|
+
// 是否禁用
|
|
51
|
+
"displayMode",
|
|
52
|
+
// all | edit | query
|
|
53
|
+
"maxLength",
|
|
54
|
+
// 最大长度
|
|
55
|
+
"validationType",
|
|
56
|
+
// 校验类型
|
|
57
|
+
"validationMessage",
|
|
58
|
+
// 校验提示语
|
|
59
|
+
"width",
|
|
60
|
+
// half | full,布局档位,不落入 component
|
|
61
|
+
"insertAfter"
|
|
62
|
+
// 插入锚点(某个 fieldName 之后),不落入 component
|
|
63
|
+
];
|
|
64
|
+
const AI_PROPS_BY_TYPE = {
|
|
65
|
+
number: [
|
|
66
|
+
"format",
|
|
67
|
+
// number | yuan | wan | million | percentage | permillage | permillion
|
|
68
|
+
"hasDecimalPlaces",
|
|
69
|
+
"decimalPlaces",
|
|
70
|
+
"minValue",
|
|
71
|
+
"maxValue",
|
|
72
|
+
"prefix",
|
|
73
|
+
"suffix"
|
|
74
|
+
],
|
|
75
|
+
text: ["prefix", "suffix"],
|
|
76
|
+
textarea: ["prefix", "suffix"],
|
|
77
|
+
date: [
|
|
78
|
+
"dateType",
|
|
79
|
+
// date | week | month | year | datetime
|
|
80
|
+
"dateValueType",
|
|
81
|
+
// string | date | timestamp
|
|
82
|
+
"dateRange"
|
|
83
|
+
// "" | beforeToday | afterToday
|
|
84
|
+
],
|
|
85
|
+
select: ["optionStyle"],
|
|
86
|
+
multipleSelection: ["optionStyle"],
|
|
87
|
+
radio: ["optionStyle"],
|
|
88
|
+
checkbox: ["optionStyle"],
|
|
89
|
+
area: ["multiple", "showFullPath", "maxLevel"],
|
|
90
|
+
industry: ["multiple", "showFullPath", "maxLevel"],
|
|
91
|
+
h2: ["subLabel"]
|
|
92
|
+
};
|
|
93
|
+
const AI_OPTION_CONFIG_PROP = "optionConfig";
|
|
94
|
+
const AI_OPTION_SOURCES = ["custom", "dataSource", "dictionary"];
|
|
95
|
+
const AI_VALIDATION_TYPES = [
|
|
96
|
+
"none",
|
|
97
|
+
"idCard",
|
|
98
|
+
"creditCode",
|
|
99
|
+
"zipCode",
|
|
100
|
+
"fax",
|
|
101
|
+
"bankCard",
|
|
102
|
+
"email",
|
|
103
|
+
"mobile",
|
|
104
|
+
"phone",
|
|
105
|
+
"mobilePhone",
|
|
106
|
+
"regex",
|
|
107
|
+
"custom"
|
|
108
|
+
];
|
|
109
|
+
const AI_DISPLAY_MODES = ["all", "edit", "query"];
|
|
110
|
+
const AI_WIDTH_MODES = ["half", "full"];
|
|
111
|
+
const AI_NUMBER_FORMATS = [
|
|
112
|
+
"number",
|
|
113
|
+
"yuan",
|
|
114
|
+
"wan",
|
|
115
|
+
"million",
|
|
116
|
+
"percentage",
|
|
117
|
+
"permillage",
|
|
118
|
+
"permillion"
|
|
119
|
+
];
|
|
120
|
+
function getAllowedProps(fieldType) {
|
|
121
|
+
const extra = AI_PROPS_BY_TYPE[fieldType] || [];
|
|
122
|
+
const props = [...AI_COMMON_PROPS, ...extra];
|
|
123
|
+
if (OPTION_FIELD_TYPES.includes(fieldType)) {
|
|
124
|
+
props.push(AI_OPTION_CONFIG_PROP);
|
|
125
|
+
}
|
|
126
|
+
if (LAYOUT_FIELD_TYPES.includes(fieldType)) {
|
|
127
|
+
return props.filter(
|
|
128
|
+
(p) => ["fieldType", "label", "width", "insertAfter", "subLabel"].includes(p)
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
return props;
|
|
132
|
+
}
|
|
133
|
+
function getDefaultHeight(fieldType) {
|
|
134
|
+
var _a;
|
|
135
|
+
return ((_a = AI_FIELD_TYPES[fieldType]) == null ? void 0 : _a.height) || 1;
|
|
136
|
+
}
|
|
137
|
+
const PROP_LABELS = {
|
|
138
|
+
label: "标题",
|
|
139
|
+
fieldName: "字段名",
|
|
140
|
+
required: "必填",
|
|
141
|
+
requiredMessage: "必填提示",
|
|
142
|
+
placeholder: "输入提示",
|
|
143
|
+
tooltip: "字段说明",
|
|
144
|
+
defaultValue: "默认值",
|
|
145
|
+
disabled: "禁用",
|
|
146
|
+
displayMode: "显示场景",
|
|
147
|
+
maxLength: "最大长度",
|
|
148
|
+
validationType: "校验类型",
|
|
149
|
+
validationMessage: "校验提示",
|
|
150
|
+
format: "格式",
|
|
151
|
+
hasDecimalPlaces: "允许小数",
|
|
152
|
+
decimalPlaces: "小数位",
|
|
153
|
+
minValue: "最小值",
|
|
154
|
+
maxValue: "最大值",
|
|
155
|
+
prefix: "前缀",
|
|
156
|
+
suffix: "后缀",
|
|
157
|
+
dateType: "日期类型",
|
|
158
|
+
dateValueType: "日期值类型",
|
|
159
|
+
dateRange: "日期范围",
|
|
160
|
+
optionStyle: "选项样式",
|
|
161
|
+
optionConfig: "选项配置",
|
|
162
|
+
subLabel: "副标题",
|
|
163
|
+
multiple: "多选",
|
|
164
|
+
showFullPath: "显示全路径",
|
|
165
|
+
maxLevel: "最大层级"
|
|
166
|
+
};
|
|
167
|
+
function getPropLabel(prop) {
|
|
168
|
+
return PROP_LABELS[prop] || prop;
|
|
169
|
+
}
|
|
170
|
+
exports.AI_COMMON_PROPS = AI_COMMON_PROPS;
|
|
171
|
+
exports.AI_DISPLAY_MODES = AI_DISPLAY_MODES;
|
|
172
|
+
exports.AI_FIELD_TYPES = AI_FIELD_TYPES;
|
|
173
|
+
exports.AI_NUMBER_FORMATS = AI_NUMBER_FORMATS;
|
|
174
|
+
exports.AI_OPTION_CONFIG_PROP = AI_OPTION_CONFIG_PROP;
|
|
175
|
+
exports.AI_OPTION_SOURCES = AI_OPTION_SOURCES;
|
|
176
|
+
exports.AI_PROPS_BY_TYPE = AI_PROPS_BY_TYPE;
|
|
177
|
+
exports.AI_VALIDATION_TYPES = AI_VALIDATION_TYPES;
|
|
178
|
+
exports.AI_WIDTH_MODES = AI_WIDTH_MODES;
|
|
179
|
+
exports.LAYOUT_FIELD_TYPES = LAYOUT_FIELD_TYPES;
|
|
180
|
+
exports.OPTION_FIELD_TYPES = OPTION_FIELD_TYPES;
|
|
181
|
+
exports.PROP_LABELS = PROP_LABELS;
|
|
182
|
+
exports.getAllowedProps = getAllowedProps;
|
|
183
|
+
exports.getDefaultHeight = getDefaultHeight;
|
|
184
|
+
exports.getPropLabel = getPropLabel;
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const constants = require("./constants.js");
|
|
4
|
+
const compressConfig = require("./compressConfig.js");
|
|
5
|
+
function diffAiFields(aiFields, editConfigData) {
|
|
6
|
+
const visibleItems = compressConfig.getVisibleLayoutItems(editConfigData);
|
|
7
|
+
const oldByName = /* @__PURE__ */ new Map();
|
|
8
|
+
const oldByLayoutKey = /* @__PURE__ */ new Map();
|
|
9
|
+
visibleItems.forEach((item) => {
|
|
10
|
+
const c = item.component;
|
|
11
|
+
if (constants.LAYOUT_FIELD_TYPES.includes(c.fieldType)) {
|
|
12
|
+
oldByLayoutKey.set(`${c.label || ""}|${c.fieldType}`, item);
|
|
13
|
+
} else if (c.fieldName) {
|
|
14
|
+
oldByName.set(c.fieldName, item);
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
const adds = [];
|
|
18
|
+
const modifies = [];
|
|
19
|
+
const matchedItems = /* @__PURE__ */ new Set();
|
|
20
|
+
const usedLayoutKeys = /* @__PURE__ */ new Set();
|
|
21
|
+
(aiFields || []).forEach((fi) => {
|
|
22
|
+
let oldItem = null;
|
|
23
|
+
let key = null;
|
|
24
|
+
if (constants.LAYOUT_FIELD_TYPES.includes(fi.fieldType)) {
|
|
25
|
+
const lk = `${fi.label || ""}|${fi.fieldType}`;
|
|
26
|
+
oldItem = oldByLayoutKey.get(lk) || null;
|
|
27
|
+
if (oldItem && !usedLayoutKeys.has(lk)) {
|
|
28
|
+
usedLayoutKeys.add(lk);
|
|
29
|
+
key = lk;
|
|
30
|
+
} else {
|
|
31
|
+
oldItem = null;
|
|
32
|
+
}
|
|
33
|
+
} else if (fi.fieldName) {
|
|
34
|
+
key = fi.fieldName;
|
|
35
|
+
oldItem = oldByName.get(fi.fieldName) || null;
|
|
36
|
+
}
|
|
37
|
+
if (!oldItem) {
|
|
38
|
+
adds.push({
|
|
39
|
+
kind: "add",
|
|
40
|
+
key: key || `add_${adds.length}`,
|
|
41
|
+
fieldType: fi.fieldType,
|
|
42
|
+
label: fi.label || "",
|
|
43
|
+
fieldName: fi.fieldName || "",
|
|
44
|
+
width: fi.width || "",
|
|
45
|
+
insertAfter: fi.insertAfter || "",
|
|
46
|
+
payload: stripDirectives(fi),
|
|
47
|
+
selected: true
|
|
48
|
+
});
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
matchedItems.add(oldItem);
|
|
52
|
+
const changes = diffProps(fi, oldItem.component);
|
|
53
|
+
if (changes.length) {
|
|
54
|
+
modifies.push({
|
|
55
|
+
kind: "modify",
|
|
56
|
+
key,
|
|
57
|
+
fieldType: fi.fieldType,
|
|
58
|
+
label: fi.label || oldItem.component.label || "",
|
|
59
|
+
changes,
|
|
60
|
+
selected: true
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
const removes = visibleItems.filter((item) => !matchedItems.has(item)).map((item) => ({
|
|
65
|
+
kind: "remove",
|
|
66
|
+
key: item.component.fieldName || `remove_${item.id}`,
|
|
67
|
+
fieldType: item.component.fieldType,
|
|
68
|
+
label: item.component.label || item.component.fieldName || "",
|
|
69
|
+
selected: true,
|
|
70
|
+
item
|
|
71
|
+
}));
|
|
72
|
+
return {
|
|
73
|
+
adds,
|
|
74
|
+
removes,
|
|
75
|
+
modifies,
|
|
76
|
+
stats: {
|
|
77
|
+
add: adds.length,
|
|
78
|
+
remove: removes.length,
|
|
79
|
+
modify: modifies.length
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
function stripDirectives(fi) {
|
|
84
|
+
const out = { ...fi };
|
|
85
|
+
delete out.width;
|
|
86
|
+
delete out.insertAfter;
|
|
87
|
+
return out;
|
|
88
|
+
}
|
|
89
|
+
function diffProps(aiField, oldComponent) {
|
|
90
|
+
const changes = [];
|
|
91
|
+
Object.keys(aiField).forEach((prop) => {
|
|
92
|
+
if (["fieldType", "fieldName", "width", "insertAfter"].includes(prop)) return;
|
|
93
|
+
const nv = aiField[prop];
|
|
94
|
+
const ov = oldComponent[prop];
|
|
95
|
+
if (isEqualValue(nv, ov)) return;
|
|
96
|
+
changes.push({
|
|
97
|
+
prop,
|
|
98
|
+
oldValue: readable(ov),
|
|
99
|
+
newValue: readable(nv),
|
|
100
|
+
selected: true
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
return changes;
|
|
104
|
+
}
|
|
105
|
+
function isEqualValue(a, b) {
|
|
106
|
+
if (a === b) return true;
|
|
107
|
+
if (a === void 0 || b === void 0) return false;
|
|
108
|
+
if (isEmptyish(a) && isEmptyish(b)) return true;
|
|
109
|
+
if (typeof a === "object" || typeof b === "object") {
|
|
110
|
+
try {
|
|
111
|
+
return JSON.stringify(a) === JSON.stringify(b);
|
|
112
|
+
} catch (e) {
|
|
113
|
+
return false;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return String(a) === String(b);
|
|
117
|
+
}
|
|
118
|
+
function isEmptyish(v) {
|
|
119
|
+
if (v === null || v === void 0) return true;
|
|
120
|
+
if (v === "") return true;
|
|
121
|
+
if (Array.isArray(v)) return v.length === 0;
|
|
122
|
+
if (typeof v === "object") return Object.keys(v).length === 0;
|
|
123
|
+
return false;
|
|
124
|
+
}
|
|
125
|
+
function readable(v) {
|
|
126
|
+
if (v === void 0) return "(空)";
|
|
127
|
+
if (v === null) return "(空)";
|
|
128
|
+
if (v === "") return "(空)";
|
|
129
|
+
if (typeof v === "boolean") return v ? "是" : "否";
|
|
130
|
+
if (typeof v === "object") {
|
|
131
|
+
try {
|
|
132
|
+
return JSON.stringify(v);
|
|
133
|
+
} catch (e) {
|
|
134
|
+
return String(v);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return String(v);
|
|
138
|
+
}
|
|
139
|
+
exports.diffAiFields = diffAiFields;
|
|
140
|
+
exports.diffProps = diffProps;
|
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
+
require("../../../../node_modules/element-plus/es/index.js");
|
|
4
|
+
;/* empty css */
|
|
5
|
+
;/* empty css */
|
|
6
|
+
;/* empty css */
|
|
7
|
+
;/* empty css */
|
|
8
|
+
;/* empty css */
|
|
9
|
+
;/* empty css */
|
|
10
|
+
;/* empty css */
|
|
11
|
+
;/* empty css */
|
|
12
|
+
const Vue = require("vue");
|
|
13
|
+
const eventBus = require("../utils/eventBus.js");
|
|
14
|
+
const common = require("../utils/common.js");
|
|
15
|
+
const AiDiffTable = require("./AiDiffTable.vue.js");
|
|
16
|
+
const compressConfig = require("./compressConfig.js");
|
|
17
|
+
const normalizeFieldList = require("./normalizeFieldList.js");
|
|
18
|
+
const prompt = require("./prompt.js");
|
|
19
|
+
const api = require("./api.js");
|
|
20
|
+
const parseAiResult = require("./parseAiResult.js");
|
|
21
|
+
const diff = require("./diff.js");
|
|
22
|
+
const apply = require("./apply.js");
|
|
23
|
+
;/* empty css */
|
|
24
|
+
const _pluginVue_exportHelper = require("../../../../_virtual/_plugin-vue_export-helper.js");
|
|
25
|
+
const index = require("../../../../node_modules/element-plus/es/components/drawer/index.js");
|
|
26
|
+
const index$1 = require("../../../../node_modules/element-plus/es/components/input/index.js");
|
|
27
|
+
const index$2 = require("../../../../node_modules/element-plus/es/components/collapse/index.js");
|
|
28
|
+
const index$3 = require("../../../../node_modules/element-plus/es/components/button/index.js");
|
|
29
|
+
const index$4 = require("../../../../node_modules/element-plus/es/components/alert/index.js");
|
|
30
|
+
const index$5 = require("../../../../node_modules/element-plus/es/components/message/index.js");
|
|
31
|
+
const cloneDeep = require("../../../../node_modules/lodash-es/cloneDeep.js");
|
|
32
|
+
const _hoisted_1 = { class: "ai-form-drawer" };
|
|
33
|
+
const _hoisted_2 = { class: "ctx-bar" };
|
|
34
|
+
const _hoisted_3 = {
|
|
35
|
+
key: 0,
|
|
36
|
+
class: "dot"
|
|
37
|
+
};
|
|
38
|
+
const _hoisted_4 = { key: 1 };
|
|
39
|
+
const _hoisted_5 = { class: "block" };
|
|
40
|
+
const _hoisted_6 = { class: "block" };
|
|
41
|
+
const _hoisted_7 = {
|
|
42
|
+
key: 1,
|
|
43
|
+
class: "block"
|
|
44
|
+
};
|
|
45
|
+
const drawerSize = "600px";
|
|
46
|
+
const _sfc_main = {
|
|
47
|
+
__name: "index",
|
|
48
|
+
props: {
|
|
49
|
+
modelValue: { type: Boolean, default: false }
|
|
50
|
+
},
|
|
51
|
+
emits: ["update:modelValue"],
|
|
52
|
+
setup(__props, { emit: __emit }) {
|
|
53
|
+
const props = __props;
|
|
54
|
+
const emit = __emit;
|
|
55
|
+
const visible = Vue.computed({
|
|
56
|
+
get: () => props.modelValue,
|
|
57
|
+
set: (val) => emit("update:modelValue", val)
|
|
58
|
+
});
|
|
59
|
+
const requirement = Vue.ref("");
|
|
60
|
+
const fieldListRaw = Vue.ref("");
|
|
61
|
+
const generating = Vue.ref(false);
|
|
62
|
+
const errorMessage = Vue.ref("");
|
|
63
|
+
const diffResult = Vue.ref(null);
|
|
64
|
+
const aiFormConfig = Vue.ref({});
|
|
65
|
+
const applied = Vue.ref(false);
|
|
66
|
+
const lastSnapshot = Vue.ref(null);
|
|
67
|
+
const sessionId = Vue.ref(createSessionId());
|
|
68
|
+
const canGenerate = Vue.computed(() => requirement.value.trim().length > 0 && !generating.value);
|
|
69
|
+
Vue.watch(visible, (val) => {
|
|
70
|
+
if (!val) return;
|
|
71
|
+
sessionId.value = createSessionId();
|
|
72
|
+
applied.value = false;
|
|
73
|
+
diffResult.value = null;
|
|
74
|
+
lastSnapshot.value = null;
|
|
75
|
+
errorMessage.value = "";
|
|
76
|
+
});
|
|
77
|
+
const editConfig = Vue.computed(() => common.getEditConfigData() || {});
|
|
78
|
+
const fieldCount = Vue.computed(() => (editConfig.value.fieldsData || []).length);
|
|
79
|
+
const columns = Vue.computed(() => editConfig.value.columns ?? 2);
|
|
80
|
+
const dsCount = Vue.computed(() => (editConfig.value.dataSources || []).length);
|
|
81
|
+
const dictCount = Vue.computed(() => {
|
|
82
|
+
const list = editConfig.value.fieldsData || [];
|
|
83
|
+
const set = /* @__PURE__ */ new Set();
|
|
84
|
+
list.forEach((it) => {
|
|
85
|
+
var _a, _b;
|
|
86
|
+
const key = (_b = (_a = it == null ? void 0 : it.component) == null ? void 0 : _a.optionConfig) == null ? void 0 : _b.dictionaryValue;
|
|
87
|
+
if (key) set.add(key);
|
|
88
|
+
});
|
|
89
|
+
return set.size;
|
|
90
|
+
});
|
|
91
|
+
async function handleGenerate() {
|
|
92
|
+
if (!canGenerate.value) return;
|
|
93
|
+
errorMessage.value = "";
|
|
94
|
+
diffResult.value = null;
|
|
95
|
+
applied.value = false;
|
|
96
|
+
aiFormConfig.value = {};
|
|
97
|
+
generating.value = true;
|
|
98
|
+
try {
|
|
99
|
+
const cfg = common.getEditConfigData();
|
|
100
|
+
const aiInput = compressConfig.buildAiInput(cfg);
|
|
101
|
+
const fieldList = normalizeFieldList.normalizeFieldList(fieldListRaw.value);
|
|
102
|
+
const payload = {
|
|
103
|
+
sessionId: sessionId.value,
|
|
104
|
+
scene: "formConfig",
|
|
105
|
+
systemPrompt: prompt.SYSTEM_PROMPT,
|
|
106
|
+
prompt: requirement.value.trim(),
|
|
107
|
+
currentConfig: aiInput.currentConfig,
|
|
108
|
+
dataSources: aiInput.dataSources,
|
|
109
|
+
dictionaries: aiInput.dictionaries,
|
|
110
|
+
fieldList,
|
|
111
|
+
history: []
|
|
112
|
+
};
|
|
113
|
+
payload.userPrompt = prompt.buildUserPrompt({
|
|
114
|
+
requirement: requirement.value.trim(),
|
|
115
|
+
currentConfig: aiInput.currentConfig,
|
|
116
|
+
dataSources: aiInput.dataSources,
|
|
117
|
+
dictionaries: aiInput.dictionaries,
|
|
118
|
+
fieldList,
|
|
119
|
+
history: []
|
|
120
|
+
});
|
|
121
|
+
const res = await api.generateFormConfig(payload);
|
|
122
|
+
const parsed = parseAiResult.parseAiResult(res.json ?? res.raw);
|
|
123
|
+
if (!parsed.ok) {
|
|
124
|
+
errorMessage.value = parsed.reason || "生成失败,请调整描述后重试。";
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
aiFormConfig.value = parsed.config.formConfig || {};
|
|
128
|
+
const next = diff.diffAiFields(parsed.config.fields, cfg);
|
|
129
|
+
const s = next.stats;
|
|
130
|
+
if (!s.add && !s.modify && !s.remove) {
|
|
131
|
+
diffResult.value = null;
|
|
132
|
+
index$5.ElMessage.info("AI 返回的配置与当前表单一致,没有需要应用的变更");
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
diffResult.value = next;
|
|
136
|
+
applied.value = true;
|
|
137
|
+
applyToCanvas(cfg);
|
|
138
|
+
index$5.ElMessage.success("AI 配置已应用到表单");
|
|
139
|
+
} catch (e) {
|
|
140
|
+
errorMessage.value = (e == null ? void 0 : e.message) || "请求失败,请稍后重试。";
|
|
141
|
+
} finally {
|
|
142
|
+
generating.value = false;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
function applyToCanvas(cfg) {
|
|
146
|
+
const target = cfg || common.getEditConfigData();
|
|
147
|
+
const { fieldsData, formConfig } = apply.applyChanges({
|
|
148
|
+
editConfigData: target,
|
|
149
|
+
diffResult: diffResult.value,
|
|
150
|
+
aiFormConfig: aiFormConfig.value
|
|
151
|
+
});
|
|
152
|
+
lastSnapshot.value = cloneDeep.default({
|
|
153
|
+
fieldsData: target.fieldsData || [],
|
|
154
|
+
columns: target.columns,
|
|
155
|
+
labelWidth: target.labelWidth,
|
|
156
|
+
labelPosition: target.labelPosition
|
|
157
|
+
});
|
|
158
|
+
target.fieldsData = fieldsData;
|
|
159
|
+
target.columns = formConfig.columns;
|
|
160
|
+
if (formConfig.labelWidth != null) target.labelWidth = formConfig.labelWidth;
|
|
161
|
+
if (formConfig.labelPosition) target.labelPosition = formConfig.labelPosition;
|
|
162
|
+
common.setEditConfigData(target);
|
|
163
|
+
eventBus.default.emit("refreshFormFields");
|
|
164
|
+
}
|
|
165
|
+
function handleUndo() {
|
|
166
|
+
if (!lastSnapshot.value) return;
|
|
167
|
+
const snap = cloneDeep.default(lastSnapshot.value);
|
|
168
|
+
const cfg = common.getEditConfigData();
|
|
169
|
+
cfg.fieldsData = snap.fieldsData;
|
|
170
|
+
cfg.columns = snap.columns;
|
|
171
|
+
cfg.labelWidth = snap.labelWidth;
|
|
172
|
+
cfg.labelPosition = snap.labelPosition;
|
|
173
|
+
common.setEditConfigData(cfg);
|
|
174
|
+
eventBus.default.emit("refreshFormFields");
|
|
175
|
+
lastSnapshot.value = null;
|
|
176
|
+
diffResult.value = null;
|
|
177
|
+
applied.value = false;
|
|
178
|
+
index$5.ElMessage.success("已撤销本次 AI 改动");
|
|
179
|
+
}
|
|
180
|
+
function createSessionId() {
|
|
181
|
+
return `formConfig_${Date.now()}_${Math.random().toString(36).slice(2, 8)}`;
|
|
182
|
+
}
|
|
183
|
+
return (_ctx, _cache) => {
|
|
184
|
+
const _component_el_input = index$1.ElInput;
|
|
185
|
+
const _component_el_collapse_item = index$2.ElCollapseItem;
|
|
186
|
+
const _component_el_collapse = index$2.ElCollapse;
|
|
187
|
+
const _component_el_button = index$3.ElButton;
|
|
188
|
+
const _component_el_alert = index$4.ElAlert;
|
|
189
|
+
const _component_el_drawer = index.ElDrawer;
|
|
190
|
+
return Vue.openBlock(), Vue.createBlock(_component_el_drawer, {
|
|
191
|
+
modelValue: visible.value,
|
|
192
|
+
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => visible.value = $event),
|
|
193
|
+
title: "AI 表单助手",
|
|
194
|
+
direction: "rtl",
|
|
195
|
+
size: drawerSize,
|
|
196
|
+
"append-to-body": "",
|
|
197
|
+
"close-on-click-modal": false,
|
|
198
|
+
class: "ai-form-drawer-root"
|
|
199
|
+
}, {
|
|
200
|
+
footer: Vue.withCtx(() => [
|
|
201
|
+
Vue.createVNode(_component_el_button, {
|
|
202
|
+
onClick: _cache[2] || (_cache[2] = ($event) => visible.value = false)
|
|
203
|
+
}, {
|
|
204
|
+
default: Vue.withCtx(() => _cache[9] || (_cache[9] = [
|
|
205
|
+
Vue.createTextVNode("关闭")
|
|
206
|
+
])),
|
|
207
|
+
_: 1
|
|
208
|
+
}),
|
|
209
|
+
lastSnapshot.value ? (Vue.openBlock(), Vue.createBlock(_component_el_button, {
|
|
210
|
+
key: 0,
|
|
211
|
+
type: "warning",
|
|
212
|
+
plain: "",
|
|
213
|
+
disabled: generating.value,
|
|
214
|
+
onClick: handleUndo
|
|
215
|
+
}, {
|
|
216
|
+
default: Vue.withCtx(() => _cache[10] || (_cache[10] = [
|
|
217
|
+
Vue.createTextVNode(" 撤销本次 AI 改动 ")
|
|
218
|
+
])),
|
|
219
|
+
_: 1
|
|
220
|
+
}, 8, ["disabled"])) : Vue.createCommentVNode("", true)
|
|
221
|
+
]),
|
|
222
|
+
default: Vue.withCtx(() => [
|
|
223
|
+
Vue.createElementVNode("div", _hoisted_1, [
|
|
224
|
+
Vue.createElementVNode("div", _hoisted_2, [
|
|
225
|
+
Vue.createElementVNode("span", null, "当前表单:" + Vue.toDisplayString(fieldCount.value) + " 个字段 / " + Vue.toDisplayString(columns.value) + " 列", 1),
|
|
226
|
+
_cache[4] || (_cache[4] = Vue.createElementVNode("span", { class: "dot" }, "·", -1)),
|
|
227
|
+
Vue.createElementVNode("span", null, "数据源 " + Vue.toDisplayString(dsCount.value) + " 个", 1),
|
|
228
|
+
dictCount.value ? (Vue.openBlock(), Vue.createElementBlock("span", _hoisted_3, "·")) : Vue.createCommentVNode("", true),
|
|
229
|
+
dictCount.value ? (Vue.openBlock(), Vue.createElementBlock("span", _hoisted_4, "已知字典 " + Vue.toDisplayString(dictCount.value) + " 个", 1)) : Vue.createCommentVNode("", true)
|
|
230
|
+
]),
|
|
231
|
+
Vue.createElementVNode("div", _hoisted_5, [
|
|
232
|
+
_cache[5] || (_cache[5] = Vue.createElementVNode("div", { class: "block-title" }, "需求描述", -1)),
|
|
233
|
+
Vue.createVNode(_component_el_input, {
|
|
234
|
+
modelValue: requirement.value,
|
|
235
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => requirement.value = $event),
|
|
236
|
+
type: "textarea",
|
|
237
|
+
rows: 4,
|
|
238
|
+
resize: "none",
|
|
239
|
+
maxlength: "1000",
|
|
240
|
+
"show-word-limit": "",
|
|
241
|
+
placeholder: "描述你要生成的表单,或要对当前表单做什么修改。例如:新增一个出差申请表单,包含申请人、出差事由、起止日期、费用预算",
|
|
242
|
+
onKeydown: Vue.withKeys(Vue.withModifiers(handleGenerate, ["ctrl"]), ["enter"])
|
|
243
|
+
}, null, 8, ["modelValue", "onKeydown"])
|
|
244
|
+
]),
|
|
245
|
+
Vue.createElementVNode("div", _hoisted_6, [
|
|
246
|
+
Vue.createVNode(_component_el_collapse, null, {
|
|
247
|
+
default: Vue.withCtx(() => [
|
|
248
|
+
Vue.createVNode(_component_el_collapse_item, {
|
|
249
|
+
name: "fieldList",
|
|
250
|
+
title: "字段清单(可选)"
|
|
251
|
+
}, {
|
|
252
|
+
default: Vue.withCtx(() => [
|
|
253
|
+
_cache[6] || (_cache[6] = Vue.createElementVNode("div", { class: "hint" }, " 粘贴 CREATE TABLE 或 Java 实体类,AI 会优先采用其中的字段名、类型与注释。不填则由 AI 自行设计。 ", -1)),
|
|
254
|
+
Vue.createVNode(_component_el_input, {
|
|
255
|
+
modelValue: fieldListRaw.value,
|
|
256
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => fieldListRaw.value = $event),
|
|
257
|
+
type: "textarea",
|
|
258
|
+
rows: 6,
|
|
259
|
+
resize: "none",
|
|
260
|
+
placeholder: "例如:CREATE TABLE t_contract ( customer_name varchar(100) COMMENT '客户名称', amount decimal(18,2) COMMENT '合同金额' );"
|
|
261
|
+
}, null, 8, ["modelValue"])
|
|
262
|
+
]),
|
|
263
|
+
_: 1
|
|
264
|
+
})
|
|
265
|
+
]),
|
|
266
|
+
_: 1
|
|
267
|
+
})
|
|
268
|
+
]),
|
|
269
|
+
Vue.createVNode(_component_el_button, {
|
|
270
|
+
class: "gen-btn",
|
|
271
|
+
type: "primary",
|
|
272
|
+
loading: generating.value,
|
|
273
|
+
disabled: !canGenerate.value,
|
|
274
|
+
onClick: handleGenerate
|
|
275
|
+
}, {
|
|
276
|
+
default: Vue.withCtx(() => [
|
|
277
|
+
Vue.createTextVNode(Vue.toDisplayString(generating.value ? "AI 正在生成,请稍候…" : "生成表单配置"), 1)
|
|
278
|
+
]),
|
|
279
|
+
_: 1
|
|
280
|
+
}, 8, ["loading", "disabled"]),
|
|
281
|
+
errorMessage.value ? (Vue.openBlock(), Vue.createBlock(_component_el_alert, {
|
|
282
|
+
key: 0,
|
|
283
|
+
class: "block",
|
|
284
|
+
type: "error",
|
|
285
|
+
closable: false,
|
|
286
|
+
title: errorMessage.value
|
|
287
|
+
}, null, 8, ["title"])) : Vue.createCommentVNode("", true),
|
|
288
|
+
applied.value ? (Vue.openBlock(), Vue.createElementBlock("div", _hoisted_7, [
|
|
289
|
+
_cache[7] || (_cache[7] = Vue.createElementVNode("div", { class: "block-title" }, "本次已应用到表单", -1)),
|
|
290
|
+
Vue.createVNode(AiDiffTable.default, { model: diffResult.value }, null, 8, ["model"]),
|
|
291
|
+
_cache[8] || (_cache[8] = Vue.createElementVNode("div", { class: "undo-hint" }, " AI 改动已直接写入画布,不满意可点右下角「撤销本次 AI 改动」。 ", -1))
|
|
292
|
+
])) : Vue.createCommentVNode("", true)
|
|
293
|
+
])
|
|
294
|
+
]),
|
|
295
|
+
_: 1
|
|
296
|
+
}, 8, ["modelValue"]);
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
};
|
|
300
|
+
const AiFormDrawer = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-ae307597"]]);
|
|
301
|
+
exports.default = AiFormDrawer;
|