@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
|
@@ -99,7 +99,7 @@ class DataSourceManager {
|
|
|
99
99
|
const currentDs = this.getCurrentDataSource();
|
|
100
100
|
if (!currentDs) return {};
|
|
101
101
|
const config = {
|
|
102
|
-
url:
|
|
102
|
+
url: buildRequestUrl(currentDs),
|
|
103
103
|
method: currentDs.method
|
|
104
104
|
};
|
|
105
105
|
if (currentDs.contentType === "formData") {
|
|
@@ -347,11 +347,24 @@ class DataSourceManager {
|
|
|
347
347
|
this.events.error = [];
|
|
348
348
|
}
|
|
349
349
|
}
|
|
350
|
+
function resolveServerBase(serverName) {
|
|
351
|
+
const servers = typeof window !== "undefined" && window.$servers || {};
|
|
352
|
+
return servers[serverName] ?? serverName ?? "";
|
|
353
|
+
}
|
|
354
|
+
function buildRequestUrl(dataSource) {
|
|
355
|
+
const base = resolveServerBase(dataSource == null ? void 0 : dataSource.serverName).replace(/\/+$/, "");
|
|
356
|
+
const url = (dataSource == null ? void 0 : dataSource.url) || "";
|
|
357
|
+
if (/^https?:\/\//i.test(url)) return url;
|
|
358
|
+
if (/^https?:\/\//i.test(base)) return `${base}/${url.replace(/^\/+/, "")}`;
|
|
359
|
+
if (!base) return url;
|
|
360
|
+
return `/${base}${url}`;
|
|
361
|
+
}
|
|
350
362
|
function createDataSource(options = {}) {
|
|
351
363
|
return new DataSourceManager(options);
|
|
352
364
|
}
|
|
353
365
|
export {
|
|
354
366
|
DataSourceManager,
|
|
367
|
+
buildRequestUrl,
|
|
355
368
|
createDataSource,
|
|
356
369
|
DataSourceManager as default
|
|
357
370
|
};
|
|
@@ -44,32 +44,44 @@ const dateFormatter = (value, dateType, formatterType) => {
|
|
|
44
44
|
const textFormat = parseDateFormatter(formatterType, dateType);
|
|
45
45
|
return dateValue.format(textFormat);
|
|
46
46
|
};
|
|
47
|
-
const textFormatter = (value, dataFormatter) => {
|
|
47
|
+
const textFormatter = (value, dataFormatter, withUnit = false) => {
|
|
48
|
+
let text;
|
|
48
49
|
switch (dataFormatter) {
|
|
49
50
|
case "money(yuan)":
|
|
50
51
|
case "money(wanyuan)":
|
|
51
52
|
case "money(yi)":
|
|
52
|
-
|
|
53
|
+
text = moneyFormatter(value, dataFormatter);
|
|
54
|
+
break;
|
|
53
55
|
case "bankCard":
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
56
|
+
text = XEUtils.toValueString(value);
|
|
57
|
+
text = text.replace(/\s+/g, "");
|
|
58
|
+
text = XEUtils.commafy(text, {
|
|
57
59
|
spaceNumber: 4,
|
|
58
60
|
separator: " "
|
|
59
61
|
});
|
|
62
|
+
break;
|
|
60
63
|
case "percent":
|
|
61
|
-
|
|
62
|
-
|
|
64
|
+
text = XEUtils.multiply(XEUtils.toNumber(value), 100);
|
|
65
|
+
break;
|
|
63
66
|
case "thousand":
|
|
64
|
-
|
|
65
|
-
|
|
67
|
+
text = XEUtils.multiply(XEUtils.toNumber(value), 1e3);
|
|
68
|
+
break;
|
|
66
69
|
case "tenThousand":
|
|
67
|
-
|
|
68
|
-
|
|
70
|
+
text = XEUtils.multiply(XEUtils.toNumber(value), 1e4);
|
|
71
|
+
break;
|
|
69
72
|
default:
|
|
70
|
-
|
|
73
|
+
text = value;
|
|
74
|
+
break;
|
|
71
75
|
}
|
|
76
|
+
return withUnit ? appendUnit(text, dataFormatter) : text;
|
|
72
77
|
};
|
|
78
|
+
function appendUnit(text, dataFormatter) {
|
|
79
|
+
const unit = getUnit(dataFormatter);
|
|
80
|
+
if (!unit || text === null || text === void 0 || text === "" || text === "-") {
|
|
81
|
+
return text;
|
|
82
|
+
}
|
|
83
|
+
return `${text}${unit}`;
|
|
84
|
+
}
|
|
73
85
|
const moneyFormatter = (value, dataFormatter) => {
|
|
74
86
|
if (!value) {
|
|
75
87
|
return value;
|
|
@@ -7,7 +7,7 @@ import "../../../../../../node_modules/element-plus/es/index.mjs";
|
|
|
7
7
|
/* empty css */
|
|
8
8
|
/* empty css */
|
|
9
9
|
/* empty css */
|
|
10
|
-
import { getCurrentInstance, ref, watch, shallowRef, onMounted, onBeforeUnmount, computed, nextTick, provide, resolveDirective, withDirectives, createCommentVNode, createBlock, openBlock, normalizeClass, withCtx, createVNode, normalizeStyle, unref, createElementBlock, Fragment, renderList
|
|
10
|
+
import { getCurrentInstance, ref, watch, shallowRef, onMounted, onBeforeUnmount, computed, nextTick, provide, resolveDirective, withDirectives, createCommentVNode, createBlock, openBlock, normalizeClass, withCtx, createVNode, normalizeStyle, unref, createElementBlock, Fragment, renderList } from "vue";
|
|
11
11
|
import "../../../../../../node_modules/grid-layout-plus/es/index.mjs";
|
|
12
12
|
import { getCurrentVueInstance } from "../../../utils/getInstance.mjs";
|
|
13
13
|
import getJsonAsyncUtil from "../../../utils/getJsonAsyncUtil.mjs";
|
|
@@ -909,10 +909,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
909
909
|
const findChangedFields = (newData, oldData, onlyFieldNames) => {
|
|
910
910
|
const changedFields = [];
|
|
911
911
|
let allKeyList = [
|
|
912
|
-
.../* @__PURE__ */ new Set([
|
|
913
|
-
...Object.keys(newData || {}),
|
|
914
|
-
...Object.keys(oldData || {})
|
|
915
|
-
])
|
|
912
|
+
.../* @__PURE__ */ new Set([...Object.keys(newData || {}), ...Object.keys(oldData || {})])
|
|
916
913
|
];
|
|
917
914
|
if (onlyFieldNames && onlyFieldNames.size > 0) {
|
|
918
915
|
allKeyList = allKeyList.filter((k) => onlyFieldNames.has(k));
|
|
@@ -1273,6 +1270,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
1273
1270
|
{ deep: true }
|
|
1274
1271
|
);
|
|
1275
1272
|
function setFormItemHeight(id, fixedH, h) {
|
|
1273
|
+
var _a;
|
|
1276
1274
|
const item = gridLayoutFieldsData.value.find((item2) => item2.id == id);
|
|
1277
1275
|
if (!fixedH) {
|
|
1278
1276
|
item.h = h * 60;
|
|
@@ -1285,7 +1283,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
1285
1283
|
} else if (fixedH) {
|
|
1286
1284
|
oriItem.h = h / (localConfig.value.labelPosition == "top" ? 1.5 : 1);
|
|
1287
1285
|
}
|
|
1288
|
-
|
|
1286
|
+
(_a = gridLayout == null ? void 0 : gridLayout.value) == null ? void 0 : _a.resizeEvent();
|
|
1289
1287
|
}
|
|
1290
1288
|
provide("formData", formData);
|
|
1291
1289
|
provide("localConfig", localConfig);
|
|
@@ -1437,7 +1435,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
1437
1435
|
};
|
|
1438
1436
|
}
|
|
1439
1437
|
});
|
|
1440
|
-
const _Form = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
1438
|
+
const _Form = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-5540e585"]]);
|
|
1441
1439
|
export {
|
|
1442
1440
|
_Form as default
|
|
1443
1441
|
};
|
|
@@ -98,7 +98,7 @@ class DataSourceManager {
|
|
|
98
98
|
const currentDs = this.getCurrentDataSource();
|
|
99
99
|
if (!currentDs) return {};
|
|
100
100
|
const config = {
|
|
101
|
-
url:
|
|
101
|
+
url: buildRequestUrl(currentDs),
|
|
102
102
|
method: currentDs.method
|
|
103
103
|
};
|
|
104
104
|
if (currentDs.contentType === "formData") {
|
|
@@ -340,11 +340,24 @@ class DataSourceManager {
|
|
|
340
340
|
this.events.error = [];
|
|
341
341
|
}
|
|
342
342
|
}
|
|
343
|
+
function resolveServerBase(serverName) {
|
|
344
|
+
const servers = typeof window !== "undefined" && window.$servers || {};
|
|
345
|
+
return servers[serverName] ?? serverName ?? "";
|
|
346
|
+
}
|
|
347
|
+
function buildRequestUrl(dataSource) {
|
|
348
|
+
const base = resolveServerBase(dataSource == null ? void 0 : dataSource.serverName).replace(/\/+$/, "");
|
|
349
|
+
const url = (dataSource == null ? void 0 : dataSource.url) || "";
|
|
350
|
+
if (/^https?:\/\//i.test(url)) return url;
|
|
351
|
+
if (/^https?:\/\//i.test(base)) return `${base}/${url.replace(/^\/+/, "")}`;
|
|
352
|
+
if (!base) return url;
|
|
353
|
+
return `/${base}${url}`;
|
|
354
|
+
}
|
|
343
355
|
function createDataSource(options = {}) {
|
|
344
356
|
return new DataSourceManager(options);
|
|
345
357
|
}
|
|
346
358
|
export {
|
|
347
359
|
DataSourceManager,
|
|
360
|
+
buildRequestUrl,
|
|
348
361
|
createDataSource,
|
|
349
362
|
DataSourceManager as default
|
|
350
363
|
};
|
|
@@ -4,5 +4,30 @@ var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof win
|
|
|
4
4
|
function getDefaultExportFromCjs(x) {
|
|
5
5
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
6
6
|
}
|
|
7
|
+
function getAugmentedNamespace(n) {
|
|
8
|
+
if (n.__esModule) return n;
|
|
9
|
+
var f = n.default;
|
|
10
|
+
if (typeof f == "function") {
|
|
11
|
+
var a = function a2() {
|
|
12
|
+
if (this instanceof a2) {
|
|
13
|
+
return Reflect.construct(f, arguments, this.constructor);
|
|
14
|
+
}
|
|
15
|
+
return f.apply(this, arguments);
|
|
16
|
+
};
|
|
17
|
+
a.prototype = f.prototype;
|
|
18
|
+
} else a = {};
|
|
19
|
+
Object.defineProperty(a, "__esModule", { value: true });
|
|
20
|
+
Object.keys(n).forEach(function(k) {
|
|
21
|
+
var d = Object.getOwnPropertyDescriptor(n, k);
|
|
22
|
+
Object.defineProperty(a, k, d.get ? d : {
|
|
23
|
+
enumerable: true,
|
|
24
|
+
get: function() {
|
|
25
|
+
return n[k];
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
return a;
|
|
30
|
+
}
|
|
7
31
|
exports.commonjsGlobal = commonjsGlobal;
|
|
32
|
+
exports.getAugmentedNamespace = getAugmentedNamespace;
|
|
8
33
|
exports.getDefaultExportFromCjs = getDefaultExportFromCjs;
|
package/lib/_virtual/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
3
|
const _commonjsHelpers = require("./_commonjsHelpers.js");
|
|
4
|
-
const index = require("../node_modules/
|
|
5
|
-
var
|
|
6
|
-
const
|
|
7
|
-
exports.default =
|
|
4
|
+
const index = require("../node_modules/crypto-js/index.js");
|
|
5
|
+
var cryptoJsExports = index.__require();
|
|
6
|
+
const CryptoJS = /* @__PURE__ */ _commonjsHelpers.getDefaultExportFromCjs(cryptoJsExports);
|
|
7
|
+
exports.default = CryptoJS;
|
package/lib/_virtual/index2.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var objectRefsExports = index.__require();
|
|
6
|
-
const Refs = /* @__PURE__ */ _commonjsHelpers.getDefaultExportFromCjs(objectRefsExports);
|
|
7
|
-
exports.default = Refs;
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
var cryptoJs = { exports: {} };
|
|
4
|
+
exports.__module = cryptoJs;
|
package/lib/_virtual/index3.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
+
const _commonjsHelpers = require("./_commonjsHelpers.js");
|
|
4
|
+
const index = require("../node_modules/highlight.js/lib/index.js");
|
|
5
|
+
var libExports = /* @__PURE__ */ index.__require();
|
|
6
|
+
const HighlightJS = /* @__PURE__ */ _commonjsHelpers.getDefaultExportFromCjs(libExports);
|
|
7
|
+
exports.default = HighlightJS;
|
package/lib/_virtual/index4.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
+
const _commonjsHelpers = require("./_commonjsHelpers.js");
|
|
4
|
+
const index = require("../node_modules/object-refs/index.js");
|
|
5
|
+
var objectRefsExports = index.__require();
|
|
6
|
+
const Refs = /* @__PURE__ */ _commonjsHelpers.getDefaultExportFromCjs(objectRefsExports);
|
|
7
|
+
exports.default = Refs;
|
package/lib/_virtual/index5.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
const index = require("../node_modules/@braintree/sanitize-url/dist/index.js");
|
|
4
|
+
var distExports = index.__require();
|
|
5
|
+
exports.distExports = distExports;
|
package/lib/config-dev.js
CHANGED
|
@@ -18,16 +18,19 @@ const service = axios.default.create({
|
|
|
18
18
|
baseURL: env.default.api_base_url,
|
|
19
19
|
timeout: env.default.api_timeout
|
|
20
20
|
});
|
|
21
|
+
const isExternalUrl = (url) => /^https?:\/\//i.test(url || "");
|
|
21
22
|
service.interceptors.request.use(
|
|
22
23
|
(config) => {
|
|
23
24
|
removePending(config);
|
|
24
25
|
addPending(config);
|
|
25
|
-
if (config.url != "/login") {
|
|
26
|
+
if (!isExternalUrl(config.url) && config.url != "/login") {
|
|
26
27
|
config.headers.token = window.$store.getters.token;
|
|
27
28
|
config.headers.refreshToken = window.$store.getters.refreshToken;
|
|
28
29
|
}
|
|
29
|
-
config.
|
|
30
|
-
|
|
30
|
+
if (!isExternalUrl(config.url)) {
|
|
31
|
+
config.headers.crypto = env.default.data_crypto || false;
|
|
32
|
+
config.headers.sig = env.default.data_verify_sign || false;
|
|
33
|
+
}
|
|
31
34
|
return config;
|
|
32
35
|
},
|
|
33
36
|
(error) => {
|
|
@@ -36,7 +39,11 @@ service.interceptors.request.use(
|
|
|
36
39
|
);
|
|
37
40
|
service.interceptors.response.use(
|
|
38
41
|
(response) => {
|
|
42
|
+
var _a;
|
|
39
43
|
removePending(response.config);
|
|
44
|
+
if (isExternalUrl((_a = response.config) == null ? void 0 : _a.url)) {
|
|
45
|
+
return response.data;
|
|
46
|
+
}
|
|
40
47
|
const refreshToken = response.headers["refresh-token"];
|
|
41
48
|
const token = response.headers["token"];
|
|
42
49
|
if (token && refreshToken) {
|
|
@@ -31,8 +31,4 @@ const aes = {
|
|
|
31
31
|
en: (data) => getAesString(data, KP.key, KP.iv),
|
|
32
32
|
de: (data) => getDAesString(data, KP.key, KP.iv)
|
|
33
33
|
};
|
|
34
|
-
const sha256 = (data) => {
|
|
35
|
-
return index.default.SHA256(data).toString(index.default.enc.Hex);
|
|
36
|
-
};
|
|
37
34
|
exports.aes = aes;
|
|
38
|
-
exports.sha256 = sha256;
|
|
@@ -0,0 +1,152 @@
|
|
|
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
|
+
const Vue = require("vue");
|
|
7
|
+
const constants = require("./constants.js");
|
|
8
|
+
;/* empty css */
|
|
9
|
+
const _pluginVue_exportHelper = require("../../../../_virtual/_plugin-vue_export-helper.js");
|
|
10
|
+
const index = require("../../../../node_modules/element-plus/es/components/link/index.js");
|
|
11
|
+
const _hoisted_1 = {
|
|
12
|
+
key: 0,
|
|
13
|
+
class: "ai-diff-empty"
|
|
14
|
+
};
|
|
15
|
+
const _hoisted_2 = {
|
|
16
|
+
key: 1,
|
|
17
|
+
class: "ai-diff"
|
|
18
|
+
};
|
|
19
|
+
const _hoisted_3 = { class: "diff-body" };
|
|
20
|
+
const _hoisted_4 = { class: "sign" };
|
|
21
|
+
const _hoisted_5 = { class: "group-name" };
|
|
22
|
+
const _hoisted_6 = { class: "count" };
|
|
23
|
+
const _hoisted_7 = { class: "diff-list" };
|
|
24
|
+
const _hoisted_8 = { class: "row" };
|
|
25
|
+
const _hoisted_9 = { class: "name" };
|
|
26
|
+
const _hoisted_10 = { class: "extra" };
|
|
27
|
+
const _hoisted_11 = {
|
|
28
|
+
key: 0,
|
|
29
|
+
class: "change-list"
|
|
30
|
+
};
|
|
31
|
+
const _hoisted_12 = { class: "change-prop" };
|
|
32
|
+
const _hoisted_13 = ["title"];
|
|
33
|
+
const _hoisted_14 = ["title"];
|
|
34
|
+
const _hoisted_15 = {
|
|
35
|
+
key: 0,
|
|
36
|
+
class: "more-tip"
|
|
37
|
+
};
|
|
38
|
+
const _hoisted_16 = {
|
|
39
|
+
key: 0,
|
|
40
|
+
class: "diff-more"
|
|
41
|
+
};
|
|
42
|
+
const LIMIT = 8;
|
|
43
|
+
const _sfc_main = {
|
|
44
|
+
__name: "AiDiffTable",
|
|
45
|
+
props: {
|
|
46
|
+
model: { type: Object, default: () => null }
|
|
47
|
+
},
|
|
48
|
+
setup(__props) {
|
|
49
|
+
const props = __props;
|
|
50
|
+
const GROUPS = [
|
|
51
|
+
{ kind: "add", name: "新增", sign: "+", key: "adds" },
|
|
52
|
+
{ kind: "modify", name: "修改", sign: "~", key: "modifies" },
|
|
53
|
+
{ kind: "remove", name: "删除", sign: "-", key: "removes" }
|
|
54
|
+
];
|
|
55
|
+
const showAll = Vue.ref(false);
|
|
56
|
+
const allGroups = Vue.computed(
|
|
57
|
+
() => GROUPS.map((g) => {
|
|
58
|
+
var _a;
|
|
59
|
+
const list = ((_a = props.model) == null ? void 0 : _a[g.key]) || [];
|
|
60
|
+
return { ...g, list, total: list.length };
|
|
61
|
+
}).filter((g) => g.total > 0)
|
|
62
|
+
);
|
|
63
|
+
const total = Vue.computed(() => allGroups.value.reduce((n, g) => n + g.total, 0));
|
|
64
|
+
const overflow = Vue.computed(() => total.value > LIMIT);
|
|
65
|
+
const hasAny = Vue.computed(() => allGroups.value.length > 0);
|
|
66
|
+
const groups = Vue.computed(() => {
|
|
67
|
+
if (showAll.value) return allGroups.value;
|
|
68
|
+
let remain = LIMIT;
|
|
69
|
+
return allGroups.value.map((g) => {
|
|
70
|
+
const slice = g.list.slice(0, Math.max(0, remain));
|
|
71
|
+
remain -= slice.length;
|
|
72
|
+
return { ...g, list: slice, hidden: g.total - slice.length };
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
Vue.watch(
|
|
76
|
+
() => props.model,
|
|
77
|
+
() => {
|
|
78
|
+
showAll.value = false;
|
|
79
|
+
}
|
|
80
|
+
);
|
|
81
|
+
const nameOf = (it) => (it == null ? void 0 : it.label) || (it == null ? void 0 : it.fieldName) || "(未命名)";
|
|
82
|
+
const typeOf = (t) => {
|
|
83
|
+
var _a;
|
|
84
|
+
return ((_a = constants.AI_FIELD_TYPES[t]) == null ? void 0 : _a.label) || t || "";
|
|
85
|
+
};
|
|
86
|
+
const textOf = (v) => v === void 0 || v === null || v === "" ? "(空)" : String(v);
|
|
87
|
+
return (_ctx, _cache) => {
|
|
88
|
+
const _component_el_link = index.ElLink;
|
|
89
|
+
return !hasAny.value ? (Vue.openBlock(), Vue.createElementBlock("div", _hoisted_1, "本次没有产生变更")) : (Vue.openBlock(), Vue.createElementBlock("div", _hoisted_2, [
|
|
90
|
+
Vue.createElementVNode("div", _hoisted_3, [
|
|
91
|
+
(Vue.openBlock(true), Vue.createElementBlock(Vue.Fragment, null, Vue.renderList(groups.value, (g) => {
|
|
92
|
+
return Vue.openBlock(), Vue.createElementBlock("div", {
|
|
93
|
+
key: g.kind,
|
|
94
|
+
class: "diff-group"
|
|
95
|
+
}, [
|
|
96
|
+
Vue.createElementVNode("div", {
|
|
97
|
+
class: Vue.normalizeClass(["group-head", g.kind])
|
|
98
|
+
}, [
|
|
99
|
+
Vue.createElementVNode("span", _hoisted_4, Vue.toDisplayString(g.sign), 1),
|
|
100
|
+
Vue.createElementVNode("span", _hoisted_5, Vue.toDisplayString(g.name), 1),
|
|
101
|
+
Vue.createElementVNode("span", _hoisted_6, Vue.toDisplayString(g.total), 1)
|
|
102
|
+
], 2),
|
|
103
|
+
Vue.createElementVNode("ul", _hoisted_7, [
|
|
104
|
+
(Vue.openBlock(true), Vue.createElementBlock(Vue.Fragment, null, Vue.renderList(g.list, (it, i) => {
|
|
105
|
+
return Vue.openBlock(), Vue.createElementBlock("li", {
|
|
106
|
+
key: `${g.kind}-${i}`
|
|
107
|
+
}, [
|
|
108
|
+
Vue.createElementVNode("div", _hoisted_8, [
|
|
109
|
+
Vue.createElementVNode("span", _hoisted_9, Vue.toDisplayString(nameOf(it)), 1),
|
|
110
|
+
Vue.createElementVNode("span", _hoisted_10, Vue.toDisplayString(typeOf(it.fieldType)), 1)
|
|
111
|
+
]),
|
|
112
|
+
g.kind === "modify" ? (Vue.openBlock(), Vue.createElementBlock("ul", _hoisted_11, [
|
|
113
|
+
(Vue.openBlock(true), Vue.createElementBlock(Vue.Fragment, null, Vue.renderList(it.changes, (c, ci) => {
|
|
114
|
+
return Vue.openBlock(), Vue.createElementBlock("li", { key: ci }, [
|
|
115
|
+
Vue.createElementVNode("span", _hoisted_12, Vue.toDisplayString(Vue.unref(constants.getPropLabel)(c.prop)), 1),
|
|
116
|
+
Vue.createElementVNode("span", {
|
|
117
|
+
class: "val old",
|
|
118
|
+
title: textOf(c.oldValue)
|
|
119
|
+
}, Vue.toDisplayString(textOf(c.oldValue)), 9, _hoisted_13),
|
|
120
|
+
_cache[1] || (_cache[1] = Vue.createElementVNode("span", { class: "arrow" }, "→", -1)),
|
|
121
|
+
Vue.createElementVNode("span", {
|
|
122
|
+
class: "val new",
|
|
123
|
+
title: textOf(c.newValue)
|
|
124
|
+
}, Vue.toDisplayString(textOf(c.newValue)), 9, _hoisted_14)
|
|
125
|
+
]);
|
|
126
|
+
}), 128))
|
|
127
|
+
])) : Vue.createCommentVNode("", true)
|
|
128
|
+
]);
|
|
129
|
+
}), 128)),
|
|
130
|
+
g.hidden ? (Vue.openBlock(), Vue.createElementBlock("li", _hoisted_15, "…另有 " + Vue.toDisplayString(g.hidden) + " 项", 1)) : Vue.createCommentVNode("", true)
|
|
131
|
+
])
|
|
132
|
+
]);
|
|
133
|
+
}), 128))
|
|
134
|
+
]),
|
|
135
|
+
overflow.value ? (Vue.openBlock(), Vue.createElementBlock("div", _hoisted_16, [
|
|
136
|
+
Vue.createVNode(_component_el_link, {
|
|
137
|
+
type: "primary",
|
|
138
|
+
underline: false,
|
|
139
|
+
onClick: _cache[0] || (_cache[0] = ($event) => showAll.value = !showAll.value)
|
|
140
|
+
}, {
|
|
141
|
+
default: Vue.withCtx(() => [
|
|
142
|
+
Vue.createTextVNode(Vue.toDisplayString(showAll.value ? "收起" : `展开全部(共 ${total.value} 项)`), 1)
|
|
143
|
+
]),
|
|
144
|
+
_: 1
|
|
145
|
+
})
|
|
146
|
+
])) : Vue.createCommentVNode("", true)
|
|
147
|
+
]));
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
const AiDiffTable = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-582082a6"]]);
|
|
152
|
+
exports.default = AiDiffTable;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var _a, _b;
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const config = require("../../axios/config.js");
|
|
5
|
+
const env = require("../../utils/env.js");
|
|
6
|
+
const SERVER_PREFIX = ((_b = (_a = env.default) == null ? void 0 : _a.servers) == null ? void 0 : _b.base) || "base-server";
|
|
7
|
+
const FORM_CONFIG_GEN_API = `/${SERVER_PREFIX}/formConfig/generate`;
|
|
8
|
+
const GEN_TIMEOUT = 18e4;
|
|
9
|
+
async function generateFormConfig(params) {
|
|
10
|
+
const data = await config.default.post(FORM_CONFIG_GEN_API, params, {
|
|
11
|
+
timeout: GEN_TIMEOUT
|
|
12
|
+
});
|
|
13
|
+
const raw = (data == null ? void 0 : data.raw) ?? "";
|
|
14
|
+
const json = (data == null ? void 0 : data.json) ?? null;
|
|
15
|
+
if (!json && !raw.includes("```")) {
|
|
16
|
+
throw new Error(raw || "AI 未返回有效内容,请稍后重试");
|
|
17
|
+
}
|
|
18
|
+
return { raw, json };
|
|
19
|
+
}
|
|
20
|
+
exports.FORM_CONFIG_GEN_API = FORM_CONFIG_GEN_API;
|
|
21
|
+
exports.generateFormConfig = generateFormConfig;
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const index = require("../form/aside/index.js");
|
|
4
|
+
const constants = require("./constants.js");
|
|
5
|
+
const cloneDeep = require("../../../../node_modules/lodash-es/cloneDeep.js");
|
|
6
|
+
function getWidgetTemplate(fieldType) {
|
|
7
|
+
const found = findDefinition(fieldType);
|
|
8
|
+
if (!found) return { fieldType };
|
|
9
|
+
const tpl = cloneDeep.default(found);
|
|
10
|
+
if (constants.LAYOUT_FIELD_TYPES.includes(fieldType)) {
|
|
11
|
+
delete tpl.fieldName;
|
|
12
|
+
}
|
|
13
|
+
delete tpl.label;
|
|
14
|
+
return tpl;
|
|
15
|
+
}
|
|
16
|
+
function findDefinition(fieldType) {
|
|
17
|
+
let result = null;
|
|
18
|
+
(index.default || []).some((group) => {
|
|
19
|
+
return (group.children || []).some((child) => {
|
|
20
|
+
if (child.fieldType === fieldType) {
|
|
21
|
+
result = child;
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
return false;
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
return result;
|
|
28
|
+
}
|
|
29
|
+
function buildLayoutItem(payload, opts) {
|
|
30
|
+
const { columns, index: index2, position, width } = opts;
|
|
31
|
+
const id = String(Date.now()) + String(index2).padStart(3, "0");
|
|
32
|
+
const component = {
|
|
33
|
+
...getWidgetTemplate(payload.fieldType),
|
|
34
|
+
id,
|
|
35
|
+
type: "widgets",
|
|
36
|
+
...payload
|
|
37
|
+
};
|
|
38
|
+
const x = (position == null ? void 0 : position.x) ?? 0;
|
|
39
|
+
const y = (position == null ? void 0 : position.y) ?? 0;
|
|
40
|
+
const w = payload.width === "full" ? columns : 1;
|
|
41
|
+
return {
|
|
42
|
+
x,
|
|
43
|
+
y,
|
|
44
|
+
w,
|
|
45
|
+
h: constants.getDefaultHeight(payload.fieldType),
|
|
46
|
+
i: id,
|
|
47
|
+
moved: false,
|
|
48
|
+
isResizable: true,
|
|
49
|
+
component,
|
|
50
|
+
id
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
function applyChanges(params) {
|
|
54
|
+
const { editConfigData, diffResult, aiFormConfig = {} } = params;
|
|
55
|
+
const oldColumns = (editConfigData == null ? void 0 : editConfigData.columns) ?? 2;
|
|
56
|
+
const newColumns = Number.isFinite(aiFormConfig == null ? void 0 : aiFormConfig.columns) ? aiFormConfig.columns : oldColumns;
|
|
57
|
+
const originals = (editConfigData == null ? void 0 : editConfigData.fieldsData) || [];
|
|
58
|
+
const removedSet = /* @__PURE__ */ new Set();
|
|
59
|
+
(diffResult.removes || []).forEach((r) => {
|
|
60
|
+
if (r.selected) removedSet.add(r.item);
|
|
61
|
+
});
|
|
62
|
+
const surviving = originals.filter((item) => !(item && item.component && item.hidden !== true && removedSet.has(item))).map((item) => ({
|
|
63
|
+
item: cloneDeep.default(item)
|
|
64
|
+
}));
|
|
65
|
+
const modifyMap = /* @__PURE__ */ new Map();
|
|
66
|
+
(diffResult.modifies || []).forEach((m) => {
|
|
67
|
+
if (!m.selected) return;
|
|
68
|
+
modifyMap.set(m.key, m);
|
|
69
|
+
});
|
|
70
|
+
surviving.forEach(({ item }) => {
|
|
71
|
+
item.w = clampWidth(item.w, newColumns);
|
|
72
|
+
const c = item.component;
|
|
73
|
+
if (!c) return;
|
|
74
|
+
const key = c.fieldName || `${c.label || ""}|${c.fieldType}`;
|
|
75
|
+
const mod = modifyMap.get(key);
|
|
76
|
+
if (!mod) return;
|
|
77
|
+
mod.changes.forEach((ch) => {
|
|
78
|
+
if (!ch.selected) return;
|
|
79
|
+
c[ch.prop] = ch.newValue;
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
const maxY = originals.reduce((acc, it) => Math.max(acc, (it == null ? void 0 : it.y) || 0), 0);
|
|
83
|
+
const result = [];
|
|
84
|
+
const pendingAdds = (diffResult.adds || []).filter((a) => a.selected);
|
|
85
|
+
const anchorOnAdd = /* @__PURE__ */ new Map();
|
|
86
|
+
pendingAdds.forEach((a) => {
|
|
87
|
+
const anchorKey = a.insertAfter || "";
|
|
88
|
+
if (!anchorOnAdd.has(anchorKey)) anchorOnAdd.set(anchorKey, []);
|
|
89
|
+
anchorOnAdd.get(anchorKey).push(a);
|
|
90
|
+
});
|
|
91
|
+
const widthOf = (a) => a.width === "full" ? newColumns : 1;
|
|
92
|
+
let seq = 0;
|
|
93
|
+
surviving.forEach(({ item }) => {
|
|
94
|
+
result.push(item);
|
|
95
|
+
const c = item.component;
|
|
96
|
+
const key = c == null ? void 0 : c.fieldName;
|
|
97
|
+
if (!key) return;
|
|
98
|
+
const list = anchorOnAdd.get(key);
|
|
99
|
+
if (!list) return;
|
|
100
|
+
let cx = (item.x || 0) + (item.w || 1);
|
|
101
|
+
let cy = item.y || 0;
|
|
102
|
+
list.forEach((a) => {
|
|
103
|
+
if (cx + widthOf(a) > newColumns) {
|
|
104
|
+
cx = 0;
|
|
105
|
+
cy += 1;
|
|
106
|
+
}
|
|
107
|
+
result.push(
|
|
108
|
+
buildLayoutItem(a.payload, {
|
|
109
|
+
columns: newColumns,
|
|
110
|
+
index: seq++,
|
|
111
|
+
position: { x: cx, y: cy }
|
|
112
|
+
})
|
|
113
|
+
);
|
|
114
|
+
cx += widthOf(a);
|
|
115
|
+
});
|
|
116
|
+
anchorOnAdd.delete(key);
|
|
117
|
+
});
|
|
118
|
+
let tailX = 0;
|
|
119
|
+
let tailY = maxY + 1;
|
|
120
|
+
anchorOnAdd.forEach((list) => {
|
|
121
|
+
list.forEach((a) => {
|
|
122
|
+
if (tailX + widthOf(a) > newColumns) {
|
|
123
|
+
tailX = 0;
|
|
124
|
+
tailY += 1;
|
|
125
|
+
}
|
|
126
|
+
result.push(
|
|
127
|
+
buildLayoutItem(a.payload, {
|
|
128
|
+
columns: newColumns,
|
|
129
|
+
index: seq++,
|
|
130
|
+
position: { x: tailX, y: tailY },
|
|
131
|
+
width: a.width
|
|
132
|
+
})
|
|
133
|
+
);
|
|
134
|
+
tailX += widthOf(a);
|
|
135
|
+
});
|
|
136
|
+
});
|
|
137
|
+
return {
|
|
138
|
+
fieldsData: result,
|
|
139
|
+
formConfig: {
|
|
140
|
+
columns: newColumns,
|
|
141
|
+
...Number.isFinite(aiFormConfig == null ? void 0 : aiFormConfig.labelWidth) ? { labelWidth: aiFormConfig.labelWidth } : {},
|
|
142
|
+
...(aiFormConfig == null ? void 0 : aiFormConfig.labelPosition) ? { labelPosition: aiFormConfig.labelPosition } : {}
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
function clampWidth(w, columns) {
|
|
147
|
+
const n = Number(w);
|
|
148
|
+
if (!Number.isFinite(n) || n <= 0) return 1;
|
|
149
|
+
return Math.min(Math.floor(n), columns);
|
|
150
|
+
}
|
|
151
|
+
exports.applyChanges = applyChanges;
|
|
152
|
+
exports.buildLayoutItem = buildLayoutItem;
|
|
153
|
+
exports.getWidgetTemplate = getWidgetTemplate;
|