@fecp/designer 5.4.6 → 5.4.9
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/designer/package.json.mjs +1 -1
- package/es/designer/src/components/FieldMapping.vue2.mjs +1 -1
- package/es/designer/src/components/FieldSetMapping.vue2.mjs +1 -1
- package/es/designer/src/components/OptionConfig.vue.mjs +39 -12
- package/es/designer.css +94 -94
- package/es/packages/vue/src/components/dialog/DialogRenderer.vue2.mjs +2 -2
- package/es/packages/vue/src/components/forms/checkbox/Checkbox.vue.mjs +17 -2
- package/es/packages/vue/src/components/forms/form/Form.vue.mjs +26 -8
- package/es/packages/vue/src/components/forms/radio/Radio.vue.mjs +17 -2
- package/es/packages/vue/src/components/forms/select/Select.vue.mjs +17 -2
- package/es/packages/vue/src/components/forms/textarea/Textarea.vue.mjs +1 -2
- package/es/packages/vue/src/utils/common.mjs +20 -4
- package/es/packages/vue/src/utils/datasource.mjs +6 -2
- package/lib/designer/package.json.js +1 -1
- package/lib/designer/src/components/FieldMapping.vue2.js +1 -1
- package/lib/designer/src/components/FieldSetMapping.vue2.js +1 -1
- package/lib/designer/src/components/OptionConfig.vue.js +38 -11
- package/lib/designer.css +94 -94
- package/lib/packages/vue/src/components/dialog/DialogRenderer.vue2.js +2 -2
- package/lib/packages/vue/src/components/forms/checkbox/Checkbox.vue.js +16 -1
- package/lib/packages/vue/src/components/forms/form/Form.vue.js +26 -8
- package/lib/packages/vue/src/components/forms/radio/Radio.vue.js +16 -1
- package/lib/packages/vue/src/components/forms/select/Select.vue.js +16 -1
- package/lib/packages/vue/src/components/forms/textarea/Textarea.vue.js +1 -2
- package/lib/packages/vue/src/utils/common.js +19 -3
- package/lib/packages/vue/src/utils/datasource.js +6 -2
- package/package.json +1 -1
|
@@ -5,6 +5,7 @@ require("../../../../../../node_modules/element-plus/es/index.js");
|
|
|
5
5
|
;/* empty css */
|
|
6
6
|
;/* empty css */
|
|
7
7
|
const vue = require("vue");
|
|
8
|
+
const common = require("../../../utils/common.js");
|
|
8
9
|
const index = require("../../../../../../node_modules/element-plus/es/components/radio/index.js");
|
|
9
10
|
const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
10
11
|
inheritAttrs: false
|
|
@@ -39,6 +40,9 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
39
40
|
emits: ["update:modelValue", "change"],
|
|
40
41
|
setup(__props, { emit: __emit }) {
|
|
41
42
|
const props = __props;
|
|
43
|
+
const formData = vue.inject("formData", null);
|
|
44
|
+
const fieldsData = vue.inject("fieldsData", []);
|
|
45
|
+
const hiddenFields = vue.inject("hiddenFields", []);
|
|
42
46
|
const emit = __emit;
|
|
43
47
|
const inputValue = vue.computed({
|
|
44
48
|
get: () => props.modelValue,
|
|
@@ -51,6 +55,16 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
51
55
|
var _a;
|
|
52
56
|
return ((_a = props.optionConfig) == null ? void 0 : _a.options) || [];
|
|
53
57
|
});
|
|
58
|
+
function handlerChange(val) {
|
|
59
|
+
common.setFormDataByFieldMapping(
|
|
60
|
+
val,
|
|
61
|
+
false,
|
|
62
|
+
options.value,
|
|
63
|
+
props.optionConfig.fieldMapping,
|
|
64
|
+
formData,
|
|
65
|
+
[...fieldsData.value, ...hiddenFields.value]
|
|
66
|
+
);
|
|
67
|
+
}
|
|
54
68
|
return (_ctx, _cache) => {
|
|
55
69
|
const _component_el_radio = index.ElRadio;
|
|
56
70
|
const _component_el_radio_group = index.ElRadioGroup;
|
|
@@ -61,7 +75,8 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
61
75
|
disabled: __props.disabled,
|
|
62
76
|
style: {
|
|
63
77
|
pointerEvents: __props.readonly ? "none" : "auto"
|
|
64
|
-
}
|
|
78
|
+
},
|
|
79
|
+
onChange: handlerChange
|
|
65
80
|
}), {
|
|
66
81
|
default: vue.withCtx(() => [
|
|
67
82
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(options.value, (option) => {
|
|
@@ -9,6 +9,7 @@ require("../../../../../../node_modules/element-plus/es/index.js");
|
|
|
9
9
|
;/* empty css */
|
|
10
10
|
;/* empty css */
|
|
11
11
|
const vue = require("vue");
|
|
12
|
+
const common = require("../../../utils/common.js");
|
|
12
13
|
const index = require("../../../../../../node_modules/element-plus/es/components/select/index.js");
|
|
13
14
|
const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
14
15
|
inheritAttrs: false
|
|
@@ -55,6 +56,9 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
55
56
|
emits: ["update:modelValue", "change"],
|
|
56
57
|
setup(__props, { emit: __emit }) {
|
|
57
58
|
const props = __props;
|
|
59
|
+
const formData = vue.inject("formData", null);
|
|
60
|
+
const fieldsData = vue.inject("fieldsData", []);
|
|
61
|
+
const hiddenFields = vue.inject("hiddenFields", []);
|
|
58
62
|
const emit = __emit;
|
|
59
63
|
const inputValue = vue.computed({
|
|
60
64
|
get: () => props.modelValue,
|
|
@@ -67,6 +71,16 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
67
71
|
if (!props.optionConfig) return [];
|
|
68
72
|
return props.optionConfig.options || [];
|
|
69
73
|
});
|
|
74
|
+
function handlerChange(val) {
|
|
75
|
+
common.setFormDataByFieldMapping(
|
|
76
|
+
val,
|
|
77
|
+
props.multiple,
|
|
78
|
+
options.value,
|
|
79
|
+
props.optionConfig.fieldMapping,
|
|
80
|
+
formData,
|
|
81
|
+
[...fieldsData.value, ...hiddenFields.value]
|
|
82
|
+
);
|
|
83
|
+
}
|
|
70
84
|
return (_ctx, _cache) => {
|
|
71
85
|
const _component_el_option = index.ElOption;
|
|
72
86
|
const _component_el_select = index.ElSelect;
|
|
@@ -81,7 +95,8 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
81
95
|
filterable: __props.filterable,
|
|
82
96
|
style: [{ "width": "100%" }, {
|
|
83
97
|
pointerEvents: __props.readonly ? "none" : "auto"
|
|
84
|
-
}]
|
|
98
|
+
}],
|
|
99
|
+
onChange: handlerChange
|
|
85
100
|
}), {
|
|
86
101
|
default: vue.withCtx(() => [
|
|
87
102
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(options.value, (option) => {
|
|
@@ -78,7 +78,6 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
78
78
|
"show-word-limit": __props.showWordCount,
|
|
79
79
|
rows: __props.rows,
|
|
80
80
|
autosize: __props.autosize,
|
|
81
|
-
clearable: "",
|
|
82
81
|
resize: "none",
|
|
83
82
|
onChange: handleChange
|
|
84
83
|
}), null, 16, ["modelValue", "placeholder", "disabled", "readonly", "maxlength", "show-word-limit", "rows", "autosize"])
|
|
@@ -86,5 +85,5 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
86
85
|
};
|
|
87
86
|
}
|
|
88
87
|
});
|
|
89
|
-
const _Textarea = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-
|
|
88
|
+
const _Textarea = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-34bc3c06"]]);
|
|
90
89
|
exports.default = _Textarea;
|
|
@@ -33,9 +33,7 @@ const handleSearchData = (filterValues, completeFilterFields) => {
|
|
|
33
33
|
Object.keys(filterValues).forEach((key) => {
|
|
34
34
|
const value = filterValues[key];
|
|
35
35
|
if (value !== "" && value !== null && value !== void 0) {
|
|
36
|
-
const fieldConfig = completeFilterFields.find(
|
|
37
|
-
(field) => field.id == key
|
|
38
|
-
);
|
|
36
|
+
const fieldConfig = completeFilterFields.find((field) => field.id == key);
|
|
39
37
|
const fieldName = (fieldConfig == null ? void 0 : fieldConfig.fieldName) || key;
|
|
40
38
|
const maxKey = `${key}_max`;
|
|
41
39
|
const maxValue = filterValues[maxKey];
|
|
@@ -54,7 +52,25 @@ const handleSearchData = (filterValues, completeFilterFields) => {
|
|
|
54
52
|
});
|
|
55
53
|
return filters;
|
|
56
54
|
};
|
|
55
|
+
const setFormDataByFieldMapping = (value, multiple, options, fieldMapping, formData, fields) => {
|
|
56
|
+
let selectedOptions = [];
|
|
57
|
+
if (multiple) {
|
|
58
|
+
selectedOptions = options.filter((opt) => value.includes(opt.value));
|
|
59
|
+
} else {
|
|
60
|
+
selectedOptions = options.filter((opt) => opt.value == value);
|
|
61
|
+
}
|
|
62
|
+
if (fieldMapping && Array.isArray(fieldMapping)) {
|
|
63
|
+
fieldMapping.forEach((item) => {
|
|
64
|
+
const field = fields.find((field2) => field2.id === item.field);
|
|
65
|
+
if (field) {
|
|
66
|
+
const values = selectedOptions.map((row) => row[item.value]);
|
|
67
|
+
formData.value[field.fieldName] = values.join(",");
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
};
|
|
57
72
|
exports.cloneDeep = cloneDeep;
|
|
58
73
|
exports.handleSearchData = handleSearchData;
|
|
59
74
|
exports.isEqual = isEqual;
|
|
60
75
|
exports.removeEmptyValues = removeEmptyValues;
|
|
76
|
+
exports.setFormDataByFieldMapping = setFormDataByFieldMapping;
|
|
@@ -19,7 +19,9 @@ class DataSourceManager {
|
|
|
19
19
|
this.currentDataSourceId = options.currentDataSourceId;
|
|
20
20
|
this.pagination = options.pagination || false;
|
|
21
21
|
this.sortRules = vue.reactive(options.sortRules || []);
|
|
22
|
-
this.originalSortRules = JSON.parse(
|
|
22
|
+
this.originalSortRules = JSON.parse(
|
|
23
|
+
JSON.stringify(options.sortRules || [])
|
|
24
|
+
);
|
|
23
25
|
this.showSuccessMessage = options.showSuccessMessage || false;
|
|
24
26
|
this.loading = false;
|
|
25
27
|
this.error = null;
|
|
@@ -255,7 +257,9 @@ class DataSourceManager {
|
|
|
255
257
|
* 更新排序
|
|
256
258
|
*/
|
|
257
259
|
updateSort(field, order) {
|
|
258
|
-
const existingIndex = this.sortRules.findIndex(
|
|
260
|
+
const existingIndex = this.sortRules.findIndex(
|
|
261
|
+
(rule) => rule.field === field
|
|
262
|
+
);
|
|
259
263
|
if (!order) {
|
|
260
264
|
if (existingIndex > -1) {
|
|
261
265
|
this.sortRules.splice(existingIndex, 1);
|