@fecp/vue 1.1.7 → 1.1.8
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/packages/mobile/src/components/base/card/Card.vue.mjs +2 -2
- package/es/packages/vue/index.mjs +6 -0
- package/es/packages/vue/src/api/index.mjs +6 -0
- package/es/packages/vue/src/components/all.mjs +6 -0
- package/es/packages/vue/src/components/forms/area/Area.vue.mjs +92 -0
- package/es/packages/vue/src/components/forms/area/index.mjs +7 -0
- package/es/packages/vue/src/components/forms/cascader/Cascader.vue.mjs +168 -0
- package/es/packages/vue/src/components/forms/cascader/index.mjs +7 -0
- package/es/packages/vue/src/components/forms/form/Form.vue.mjs +22 -8
- package/es/packages/vue/src/components/forms/formItem/FormItem.vue.mjs +4 -24
- package/es/packages/vue/src/components/forms/index.mjs +40 -0
- package/es/packages/vue/src/components/forms/industry/Industry.vue.mjs +92 -0
- package/es/packages/vue/src/components/forms/industry/index.mjs +7 -0
- package/es/packages/vue/src/components/forms/number/Number.vue.mjs +27 -2
- package/es/packages/vue/src/components/forms/text/Text.vue.mjs +4 -3
- package/es/packages/vue/src/components/forms/text/index.mjs +2 -2
- package/es/packages/vue/src/components/forms/textarea/Textarea.vue.mjs +5 -2
- package/es/packages/vue/src/components/forms/textarea/index.mjs +2 -2
- package/es/packages/vue/src/components/table/Table.vue.mjs +3 -3
- package/es/packages/vue/src/components/table/TableColumn.vue.mjs +46 -30
- package/es/packages/vue/src/components/table/TableFilter.vue.mjs +3 -3
- package/es/packages/vue/src/utils/datasource.mjs +1 -1
- package/es/packages/vue/src/utils/eventFlow/actionHandlers.mjs +5 -1
- package/es/vue.css +71 -51
- package/lib/packages/mobile/src/components/base/card/Card.vue.js +2 -2
- package/lib/packages/vue/index.js +15 -9
- package/lib/packages/vue/src/api/index.js +6 -0
- package/lib/packages/vue/src/components/all.js +12 -6
- package/lib/packages/vue/src/components/forms/area/Area.vue.js +92 -0
- package/lib/packages/vue/src/components/forms/area/index.js +7 -0
- package/lib/packages/vue/src/components/forms/cascader/Cascader.vue.js +168 -0
- package/lib/packages/vue/src/components/forms/cascader/index.js +7 -0
- package/lib/packages/vue/src/components/forms/form/Form.vue.js +22 -8
- package/lib/packages/vue/src/components/forms/formItem/FormItem.vue.js +16 -36
- package/lib/packages/vue/src/components/forms/index.js +40 -0
- package/lib/packages/vue/src/components/forms/industry/Industry.vue.js +92 -0
- package/lib/packages/vue/src/components/forms/industry/index.js +7 -0
- package/lib/packages/vue/src/components/forms/number/Number.vue.js +26 -1
- package/lib/packages/vue/src/components/forms/text/Text.vue.js +3 -2
- package/lib/packages/vue/src/components/forms/textarea/Textarea.vue.js +5 -2
- package/lib/packages/vue/src/components/table/Table.vue.js +3 -3
- package/lib/packages/vue/src/components/table/TableColumn.vue.js +45 -29
- package/lib/packages/vue/src/components/table/TableFilter.vue.js +3 -3
- package/lib/packages/vue/src/utils/datasource.js +1 -1
- package/lib/packages/vue/src/utils/eventFlow/actionHandlers.js +5 -1
- package/lib/vue.css +71 -51
- package/package.json +1 -1
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
/* empty css */
|
|
7
7
|
/* empty css */
|
|
8
8
|
import { createBlock, openBlock, withCtx, createVNode, renderSlot } from "vue";
|
|
9
|
-
/* empty css */
|
|
10
|
-
import _export_sfc from "../../../../../../_virtual/_plugin-vue_export-helper.mjs";
|
|
11
9
|
/* empty css */
|
|
12
10
|
/* empty css */
|
|
13
11
|
/* empty css */
|
|
14
12
|
/* empty css */
|
|
15
13
|
/* empty css */
|
|
14
|
+
/* empty css */
|
|
15
|
+
import _export_sfc from "../../../../../../_virtual/_plugin-vue_export-helper.mjs";
|
|
16
16
|
import { SwipeCell } from "../../../../../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/swipe-cell/index.mjs";
|
|
17
17
|
import { showConfirmDialog } from "../../../../../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/dialog/function-call.mjs";
|
|
18
18
|
import "../../../../../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/dialog/index.mjs";
|
|
@@ -23,6 +23,9 @@ import { Divider } from "./src/components/forms/divider/index.mjs";
|
|
|
23
23
|
import { H2 } from "./src/components/forms/h2/index.mjs";
|
|
24
24
|
import { SubForm } from "./src/components/forms/subForm/index.mjs";
|
|
25
25
|
import { SubTable } from "./src/components/forms/subTable/index.mjs";
|
|
26
|
+
import { Cascader } from "./src/components/forms/cascader/index.mjs";
|
|
27
|
+
import { Area } from "./src/components/forms/area/index.mjs";
|
|
28
|
+
import { Industry } from "./src/components/forms/industry/index.mjs";
|
|
26
29
|
import { header } from "./src/components/details/header/index.mjs";
|
|
27
30
|
import { footer } from "./src/components/details/footer/index.mjs";
|
|
28
31
|
import { main } from "./src/components/details/main/index.mjs";
|
|
@@ -43,12 +46,15 @@ const index = {
|
|
|
43
46
|
}
|
|
44
47
|
};
|
|
45
48
|
export {
|
|
49
|
+
Area,
|
|
50
|
+
Cascader,
|
|
46
51
|
Checkbox,
|
|
47
52
|
Date,
|
|
48
53
|
Divider,
|
|
49
54
|
Form,
|
|
50
55
|
FormItem,
|
|
51
56
|
H2,
|
|
57
|
+
Industry,
|
|
52
58
|
MultipleSelection,
|
|
53
59
|
Number,
|
|
54
60
|
Radio,
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
const api = {
|
|
2
2
|
findByTemplateKey: ($http, data) => {
|
|
3
3
|
return $http.post(`${$servers.base}/template/sysTemplate/findByTemplateKey`, data);
|
|
4
|
+
},
|
|
5
|
+
getDataDicArea4Cascader: ($http) => {
|
|
6
|
+
return $http.post(`${$servers.base}/parm/sysParmDic/getDataDicArea4Cascader`);
|
|
7
|
+
},
|
|
8
|
+
getDataDicTrade4Cascader: ($http) => {
|
|
9
|
+
return $http.post(`${$servers.base}/parm/sysParmDic/getDataDicTrade4Cascader`);
|
|
4
10
|
}
|
|
5
11
|
};
|
|
6
12
|
export {
|
|
@@ -15,16 +15,22 @@ import { Divider } from "./forms/divider/index.mjs";
|
|
|
15
15
|
import { H2 } from "./forms/h2/index.mjs";
|
|
16
16
|
import { SubForm } from "./forms/subForm/index.mjs";
|
|
17
17
|
import { SubTable } from "./forms/subTable/index.mjs";
|
|
18
|
+
import { Cascader } from "./forms/cascader/index.mjs";
|
|
19
|
+
import { Area } from "./forms/area/index.mjs";
|
|
20
|
+
import { Industry } from "./forms/industry/index.mjs";
|
|
18
21
|
import { header } from "./details/header/index.mjs";
|
|
19
22
|
import { footer } from "./details/footer/index.mjs";
|
|
20
23
|
import { main } from "./details/main/index.mjs";
|
|
21
24
|
export {
|
|
25
|
+
Area,
|
|
26
|
+
Cascader,
|
|
22
27
|
Checkbox,
|
|
23
28
|
Date,
|
|
24
29
|
Divider,
|
|
25
30
|
Form,
|
|
26
31
|
FormItem,
|
|
27
32
|
H2,
|
|
33
|
+
Industry,
|
|
28
34
|
MultipleSelection,
|
|
29
35
|
Number,
|
|
30
36
|
Radio,
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { ref, computed, createBlock, openBlock, unref, isRef } from "vue";
|
|
2
|
+
import { Cascader } from "../cascader/index.mjs";
|
|
3
|
+
import { getCurrentVueInstance } from "../../../utils/getInstance.mjs";
|
|
4
|
+
import api from "../../../api/index.mjs";
|
|
5
|
+
const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
6
|
+
inheritAttrs: false
|
|
7
|
+
}, {
|
|
8
|
+
__name: "Area",
|
|
9
|
+
props: {
|
|
10
|
+
config: {
|
|
11
|
+
type: Object,
|
|
12
|
+
required: true
|
|
13
|
+
},
|
|
14
|
+
modelValue: {
|
|
15
|
+
type: [String, Number, Array],
|
|
16
|
+
default: ""
|
|
17
|
+
},
|
|
18
|
+
placeholder: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: "请选择"
|
|
21
|
+
},
|
|
22
|
+
disabled: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: false
|
|
25
|
+
},
|
|
26
|
+
readonly: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: false
|
|
29
|
+
},
|
|
30
|
+
multiple: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: false
|
|
33
|
+
},
|
|
34
|
+
showFullPath: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: true
|
|
37
|
+
},
|
|
38
|
+
maxLevel: {
|
|
39
|
+
type: Number,
|
|
40
|
+
default: 10
|
|
41
|
+
},
|
|
42
|
+
checkStrictly: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: false
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
emits: ["update:modelValue", "change"],
|
|
48
|
+
setup(__props, { emit: __emit }) {
|
|
49
|
+
const props = __props;
|
|
50
|
+
const emit = __emit;
|
|
51
|
+
const propsData = ref({
|
|
52
|
+
value: "optCode",
|
|
53
|
+
label: "optName"
|
|
54
|
+
});
|
|
55
|
+
const ctx = getCurrentVueInstance();
|
|
56
|
+
const inputValue = computed({
|
|
57
|
+
get: () => {
|
|
58
|
+
return props.modelValue;
|
|
59
|
+
},
|
|
60
|
+
set: (val) => {
|
|
61
|
+
emit("update:modelValue", val);
|
|
62
|
+
emit("change", val);
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
const optionConfig = ref({
|
|
66
|
+
idField: "dicId",
|
|
67
|
+
pidField: "pdicId"
|
|
68
|
+
});
|
|
69
|
+
api.getDataDicArea4Cascader(ctx.$http).then((data) => {
|
|
70
|
+
optionConfig.value.options = data;
|
|
71
|
+
});
|
|
72
|
+
return (_ctx, _cache) => {
|
|
73
|
+
return openBlock(), createBlock(unref(Cascader), {
|
|
74
|
+
modelValue: unref(inputValue),
|
|
75
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(inputValue) ? inputValue.value = $event : null),
|
|
76
|
+
config: __props.config,
|
|
77
|
+
placeholder: __props.placeholder,
|
|
78
|
+
showFullPath: __props.showFullPath,
|
|
79
|
+
disabled: __props.disabled,
|
|
80
|
+
readonly: __props.readonly,
|
|
81
|
+
optionConfig: unref(optionConfig),
|
|
82
|
+
multiple: __props.multiple,
|
|
83
|
+
maxLevel: __props.maxLevel,
|
|
84
|
+
propsData: unref(propsData),
|
|
85
|
+
checkStrictly: __props.checkStrictly
|
|
86
|
+
}, null, 8, ["modelValue", "config", "placeholder", "showFullPath", "disabled", "readonly", "optionConfig", "multiple", "maxLevel", "propsData", "checkStrictly"]);
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
export {
|
|
91
|
+
_sfc_main as default
|
|
92
|
+
};
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
/* empty css */
|
|
2
|
+
/* empty css */
|
|
3
|
+
/* empty css */
|
|
4
|
+
/* empty css */
|
|
5
|
+
/* empty css */
|
|
6
|
+
/* empty css */
|
|
7
|
+
/* empty css */
|
|
8
|
+
/* empty css */
|
|
9
|
+
/* empty css */
|
|
10
|
+
import { inject, ref, computed, watch, nextTick, createBlock, openBlock, mergeProps, toHandlers } from "vue";
|
|
11
|
+
import { ElCascader } from "../../../../../../node_modules/.pnpm/element-plus@2.13.2_vue@3.5.13_typescript@5.7.3_/node_modules/element-plus/es/components/cascader/index.mjs";
|
|
12
|
+
const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
13
|
+
inheritAttrs: false
|
|
14
|
+
}, {
|
|
15
|
+
__name: "Cascader",
|
|
16
|
+
props: {
|
|
17
|
+
config: {
|
|
18
|
+
type: Object,
|
|
19
|
+
required: true
|
|
20
|
+
},
|
|
21
|
+
modelValue: {
|
|
22
|
+
type: [String, Number, Array],
|
|
23
|
+
default: ""
|
|
24
|
+
},
|
|
25
|
+
placeholder: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: "请选择"
|
|
28
|
+
},
|
|
29
|
+
disabled: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
default: false
|
|
32
|
+
},
|
|
33
|
+
readonly: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default: false
|
|
36
|
+
},
|
|
37
|
+
optionConfig: {
|
|
38
|
+
type: Object,
|
|
39
|
+
default: () => ({})
|
|
40
|
+
},
|
|
41
|
+
multiple: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
default: false
|
|
44
|
+
},
|
|
45
|
+
showFullPath: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
default: true
|
|
48
|
+
},
|
|
49
|
+
maxLevel: {
|
|
50
|
+
type: Number,
|
|
51
|
+
default: 10
|
|
52
|
+
},
|
|
53
|
+
propsData: {
|
|
54
|
+
type: Object,
|
|
55
|
+
default: () => ({})
|
|
56
|
+
},
|
|
57
|
+
checkStrictly: {
|
|
58
|
+
type: Boolean,
|
|
59
|
+
default: false
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
emits: ["update:modelValue", "change"],
|
|
63
|
+
setup(__props, { emit: __emit }) {
|
|
64
|
+
const props = __props;
|
|
65
|
+
const formData = inject("formData");
|
|
66
|
+
const emit = __emit;
|
|
67
|
+
const cascaderRef = ref(null);
|
|
68
|
+
const propsDataValue = computed(() => {
|
|
69
|
+
return {
|
|
70
|
+
...props.propsData,
|
|
71
|
+
multiple: props.multiple,
|
|
72
|
+
checkStrictly: props.checkStrictly
|
|
73
|
+
};
|
|
74
|
+
});
|
|
75
|
+
const inputValue = computed({
|
|
76
|
+
get: () => {
|
|
77
|
+
return props.modelValue;
|
|
78
|
+
},
|
|
79
|
+
set: (val) => {
|
|
80
|
+
emit("update:modelValue", val);
|
|
81
|
+
emit("change", val);
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
watch(inputValue, (val) => {
|
|
85
|
+
if (props.config.displayFieldName && val) {
|
|
86
|
+
nextTick(() => {
|
|
87
|
+
const displayValue = getDisplayPath();
|
|
88
|
+
console.log("🚀 ~ displayValue:", displayValue);
|
|
89
|
+
formData.value[props.config.displayFieldName] = displayValue;
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
const getDisplayPath = () => {
|
|
94
|
+
let checkedNodes = cascaderRef.value.getCheckedNodes();
|
|
95
|
+
let textArr = [];
|
|
96
|
+
checkedNodes.forEach((item) => {
|
|
97
|
+
let label;
|
|
98
|
+
if (props.showFullPath) {
|
|
99
|
+
label = item.text;
|
|
100
|
+
} else {
|
|
101
|
+
let pathLabels = item.pathLabels;
|
|
102
|
+
label = pathLabels[pathLabels.length - 1];
|
|
103
|
+
}
|
|
104
|
+
if (label) {
|
|
105
|
+
textArr.push(label);
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
return textArr.join("|");
|
|
109
|
+
};
|
|
110
|
+
const options = computed(() => {
|
|
111
|
+
if (!props.optionConfig) return [];
|
|
112
|
+
const optionList = props.optionConfig.options || [];
|
|
113
|
+
if (optionList.length > 0) {
|
|
114
|
+
return flatToTree(
|
|
115
|
+
optionList,
|
|
116
|
+
props.optionConfig.idField,
|
|
117
|
+
props.optionConfig.pidField,
|
|
118
|
+
props.maxLevel
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
return optionList;
|
|
122
|
+
});
|
|
123
|
+
function flatToTree(list, idKey = "id", pidKey = "pid", maxLevel = 10) {
|
|
124
|
+
const data = JSON.parse(JSON.stringify(list));
|
|
125
|
+
const nodeMap = {};
|
|
126
|
+
data.forEach((node) => {
|
|
127
|
+
nodeMap[node[idKey]] = node;
|
|
128
|
+
node.children = node.children || [];
|
|
129
|
+
node.level = 1;
|
|
130
|
+
});
|
|
131
|
+
const tree = [];
|
|
132
|
+
data.forEach((node) => {
|
|
133
|
+
const parentId = node[pidKey];
|
|
134
|
+
const parentNode = nodeMap[parentId];
|
|
135
|
+
if (parentNode && parentNode.level < maxLevel) {
|
|
136
|
+
node.level = parentNode.level + 1;
|
|
137
|
+
parentNode.children.push(node);
|
|
138
|
+
} else {
|
|
139
|
+
tree.push(node);
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
return tree;
|
|
143
|
+
}
|
|
144
|
+
return (_ctx, _cache) => {
|
|
145
|
+
const _component_el_cascader = ElCascader;
|
|
146
|
+
return openBlock(), createBlock(_component_el_cascader, mergeProps({
|
|
147
|
+
modelValue: inputValue.value,
|
|
148
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inputValue.value = $event)
|
|
149
|
+
}, toHandlers(__props.config.eventHandlers), {
|
|
150
|
+
options: options.value,
|
|
151
|
+
props: propsDataValue.value,
|
|
152
|
+
ref_key: "cascaderRef",
|
|
153
|
+
ref: cascaderRef,
|
|
154
|
+
clearable: "",
|
|
155
|
+
filterable: "",
|
|
156
|
+
disabled: __props.disabled,
|
|
157
|
+
placeholder: __props.placeholder,
|
|
158
|
+
"show-all-levels": __props.showFullPath,
|
|
159
|
+
style: [{ "width": "100%" }, {
|
|
160
|
+
pointerEvents: __props.readonly ? "none" : "auto"
|
|
161
|
+
}]
|
|
162
|
+
}), null, 16, ["modelValue", "options", "props", "disabled", "placeholder", "show-all-levels", "style"]);
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
export {
|
|
167
|
+
_sfc_main as default
|
|
168
|
+
};
|
|
@@ -175,7 +175,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
175
175
|
const dictionaryKeys = /* @__PURE__ */ new Set();
|
|
176
176
|
for (const component of fields) {
|
|
177
177
|
const fieldType = component.fieldType;
|
|
178
|
-
if ((fieldType === "select" || fieldType === "multipleSelection" || fieldType === "radio" || fieldType === "checkbox") && component.optionConfig) {
|
|
178
|
+
if ((fieldType === "select" || fieldType === "multipleSelection" || fieldType === "radio" || fieldType === "checkbox" || fieldType === "cascader") && component.optionConfig) {
|
|
179
179
|
const { optionSource, dataSourceValue, dictionaryValue } = component.optionConfig;
|
|
180
180
|
if (optionSource === "dataSource" && dataSourceValue) {
|
|
181
181
|
fieldDataSources.add(dataSourceValue);
|
|
@@ -241,7 +241,9 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
241
241
|
dataSourceValue,
|
|
242
242
|
dictionaryValue,
|
|
243
243
|
displayField,
|
|
244
|
-
valueField
|
|
244
|
+
valueField,
|
|
245
|
+
idField,
|
|
246
|
+
pidField
|
|
245
247
|
} = component.optionConfig;
|
|
246
248
|
if (optionSource === "dataSource" && dataSourceOptions.value[dataSourceValue]) {
|
|
247
249
|
const rawOptions = dataSourceOptions.value[dataSourceValue];
|
|
@@ -250,7 +252,8 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
250
252
|
component.optionConfig.options = rawOptions.map((item) => ({
|
|
251
253
|
label: item[labelField],
|
|
252
254
|
value: item[keyField],
|
|
253
|
-
disabled: item.disabled || false
|
|
255
|
+
disabled: item.disabled || false,
|
|
256
|
+
...item
|
|
254
257
|
}));
|
|
255
258
|
} else if (optionSource === "dictionary" && dictionaryOptions.value[dictionaryValue]) {
|
|
256
259
|
const rawOptions = dictionaryOptions.value[dictionaryValue];
|
|
@@ -298,7 +301,11 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
298
301
|
let gridLayoutData = cloneDeep(localConfig.value.fieldsData || []);
|
|
299
302
|
gridLayoutData = gridLayoutData.map((item) => {
|
|
300
303
|
item.isResizable = false;
|
|
301
|
-
|
|
304
|
+
const component = item.component;
|
|
305
|
+
if (component.fieldType == "divider" || component.fieldType == "h2") {
|
|
306
|
+
item.y = item.y * 40;
|
|
307
|
+
item.h = item.h * 40;
|
|
308
|
+
} else if (!item.fixedH) {
|
|
302
309
|
item.y = item.y * 60;
|
|
303
310
|
item.h = item.h * 60;
|
|
304
311
|
}
|
|
@@ -460,7 +467,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
460
467
|
const fieldName = field.fieldName;
|
|
461
468
|
const fieldType = field.fieldType;
|
|
462
469
|
const value = result[fieldName];
|
|
463
|
-
if (fieldName && (fieldType === "checkbox" || fieldType === "multipleSelection")) {
|
|
470
|
+
if (fieldName && (fieldType === "checkbox" || fieldType === "multipleSelection" || fieldType === "cascader" || fieldType === "area" || fieldType === "industry")) {
|
|
464
471
|
if (Array.isArray(value)) {
|
|
465
472
|
result[fieldName] = value.join("|");
|
|
466
473
|
}
|
|
@@ -488,7 +495,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
488
495
|
const fieldName = field.fieldName;
|
|
489
496
|
const fieldType = field.fieldType;
|
|
490
497
|
const value = processedData[fieldName];
|
|
491
|
-
if (fieldName && (fieldType === "checkbox" || fieldType === "multipleSelection")) {
|
|
498
|
+
if (fieldName && (fieldType === "checkbox" || fieldType === "multipleSelection" || fieldType === "cascader" || fieldType === "area" || fieldType === "industry")) {
|
|
492
499
|
if (typeof value === "string" && value.includes("|")) {
|
|
493
500
|
processedData[fieldName] = value.split("|");
|
|
494
501
|
} else if (typeof value === "string" && value !== "") {
|
|
@@ -496,6 +503,12 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
496
503
|
} else if (value === "" || value === null || value === void 0) {
|
|
497
504
|
processedData[fieldName] = [];
|
|
498
505
|
}
|
|
506
|
+
processedData[fieldName] = processedData[fieldName].map((item) => {
|
|
507
|
+
if (item.indexOf(",") > -1) {
|
|
508
|
+
return item.split(",");
|
|
509
|
+
}
|
|
510
|
+
return item;
|
|
511
|
+
});
|
|
499
512
|
} else if (fieldName && fieldType === "date" && value) {
|
|
500
513
|
const valueFormat = valueFormatMap[field.dateType] || "YYYYMMDD";
|
|
501
514
|
const formValueFormat = formValueFormatMap[field.dateType] || "YYYY-MM-DD";
|
|
@@ -545,7 +558,8 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
545
558
|
class: "fec-form",
|
|
546
559
|
"data-id": localConfig.value.templateKey,
|
|
547
560
|
"data-name": localConfig.value.templateName,
|
|
548
|
-
"data-pkId": localConfig.value.pkId
|
|
561
|
+
"data-pkId": localConfig.value.pkId,
|
|
562
|
+
"data-version": "v5"
|
|
549
563
|
}, {
|
|
550
564
|
default: withCtx(() => [
|
|
551
565
|
!configLoading.value && !__props.isSubForm ? (openBlock(), createBlock(unref(header), {
|
|
@@ -614,7 +628,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
614
628
|
};
|
|
615
629
|
}
|
|
616
630
|
});
|
|
617
|
-
const _Form = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
631
|
+
const _Form = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-caaa182c"]]);
|
|
618
632
|
export {
|
|
619
633
|
_Form as default
|
|
620
634
|
};
|
|
@@ -8,16 +8,7 @@ import { Divider } from "../divider/index.mjs";
|
|
|
8
8
|
import { H2 } from "../h2/index.mjs";
|
|
9
9
|
import { SubForm } from "../subForm/index.mjs";
|
|
10
10
|
import { SubTable } from "../subTable/index.mjs";
|
|
11
|
-
import
|
|
12
|
-
import _sfc_main$8 from "../textarea/Textarea.vue.mjs";
|
|
13
|
-
import _sfc_main$7 from "../number/Number.vue.mjs";
|
|
14
|
-
import _sfc_main$6 from "../date/Date.vue.mjs";
|
|
15
|
-
import _sfc_main$5 from "../select/Select.vue.mjs";
|
|
16
|
-
import _sfc_main$4 from "../multipleSelection/MultipleSelection.vue.mjs";
|
|
17
|
-
import _sfc_main$3 from "../radio/Radio.vue.mjs";
|
|
18
|
-
import _sfc_main$2 from "../checkbox/Checkbox.vue.mjs";
|
|
19
|
-
import _sfc_main$1 from "../switch/Switch.vue.mjs";
|
|
20
|
-
import _Upload from "../upload/Upload.vue.mjs";
|
|
11
|
+
import * as index from "../index.mjs";
|
|
21
12
|
/* empty css */
|
|
22
13
|
import _export_sfc from "../../../../../../_virtual/_plugin-vue_export-helper.mjs";
|
|
23
14
|
import { ElFormItem } from "../../../../../../node_modules/.pnpm/element-plus@2.13.2_vue@3.5.13_typescript@5.7.3_/node_modules/element-plus/es/components/form/index.mjs";
|
|
@@ -63,20 +54,9 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
63
54
|
function handleChange(config, val) {
|
|
64
55
|
emit("change", config, val);
|
|
65
56
|
}
|
|
66
|
-
const componentMap = {
|
|
67
|
-
text: TextComponent,
|
|
68
|
-
textarea: _sfc_main$8,
|
|
69
|
-
number: _sfc_main$7,
|
|
70
|
-
date: _sfc_main$6,
|
|
71
|
-
select: _sfc_main$5,
|
|
72
|
-
multipleSelection: _sfc_main$4,
|
|
73
|
-
radio: _sfc_main$3,
|
|
74
|
-
checkbox: _sfc_main$2,
|
|
75
|
-
switch: _sfc_main$1,
|
|
76
|
-
upload: _Upload
|
|
77
|
-
};
|
|
78
57
|
const componentType = computed(() => {
|
|
79
|
-
|
|
58
|
+
const key = props.config.fieldType.charAt(0).toUpperCase() + props.config.fieldType.slice(1);
|
|
59
|
+
return index[key];
|
|
80
60
|
});
|
|
81
61
|
const componentProps = computed(() => {
|
|
82
62
|
const fieldProps = { ...props.config };
|
|
@@ -175,7 +155,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
175
155
|
};
|
|
176
156
|
}
|
|
177
157
|
});
|
|
178
|
-
const _FormItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
158
|
+
const _FormItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-7ba9115b"]]);
|
|
179
159
|
export {
|
|
180
160
|
_FormItem as default
|
|
181
161
|
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Form } from "./form/index.mjs";
|
|
2
|
+
import { FormItem } from "./formItem/index.mjs";
|
|
3
|
+
import { Text } from "./text/index.mjs";
|
|
4
|
+
import { Textarea } from "./textarea/index.mjs";
|
|
5
|
+
import { Number } from "./number/index.mjs";
|
|
6
|
+
import { Date } from "./date/index.mjs";
|
|
7
|
+
import { Select } from "./select/index.mjs";
|
|
8
|
+
import { MultipleSelection } from "./multipleSelection/index.mjs";
|
|
9
|
+
import { Radio } from "./radio/index.mjs";
|
|
10
|
+
import { Checkbox } from "./checkbox/index.mjs";
|
|
11
|
+
import { Switch } from "./switch/index.mjs";
|
|
12
|
+
import { Upload } from "./upload/index.mjs";
|
|
13
|
+
import { Divider } from "./divider/index.mjs";
|
|
14
|
+
import { H2 } from "./h2/index.mjs";
|
|
15
|
+
import { SubForm } from "./subForm/index.mjs";
|
|
16
|
+
import { SubTable } from "./subTable/index.mjs";
|
|
17
|
+
import { Cascader } from "./cascader/index.mjs";
|
|
18
|
+
import { Area } from "./area/index.mjs";
|
|
19
|
+
import { Industry } from "./industry/index.mjs";
|
|
20
|
+
export {
|
|
21
|
+
Area,
|
|
22
|
+
Cascader,
|
|
23
|
+
Checkbox,
|
|
24
|
+
Date,
|
|
25
|
+
Divider,
|
|
26
|
+
Form,
|
|
27
|
+
FormItem,
|
|
28
|
+
H2,
|
|
29
|
+
Industry,
|
|
30
|
+
MultipleSelection,
|
|
31
|
+
Number,
|
|
32
|
+
Radio,
|
|
33
|
+
Select,
|
|
34
|
+
SubForm,
|
|
35
|
+
SubTable,
|
|
36
|
+
Switch,
|
|
37
|
+
Text,
|
|
38
|
+
Textarea,
|
|
39
|
+
Upload
|
|
40
|
+
};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { ref, computed, createBlock, openBlock, unref, isRef } from "vue";
|
|
2
|
+
import { Cascader } from "../cascader/index.mjs";
|
|
3
|
+
import { getCurrentVueInstance } from "../../../utils/getInstance.mjs";
|
|
4
|
+
import api from "../../../api/index.mjs";
|
|
5
|
+
const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
6
|
+
inheritAttrs: false
|
|
7
|
+
}, {
|
|
8
|
+
__name: "Industry",
|
|
9
|
+
props: {
|
|
10
|
+
config: {
|
|
11
|
+
type: Object,
|
|
12
|
+
required: true
|
|
13
|
+
},
|
|
14
|
+
modelValue: {
|
|
15
|
+
type: [String, Number, Array],
|
|
16
|
+
default: ""
|
|
17
|
+
},
|
|
18
|
+
placeholder: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: "请选择"
|
|
21
|
+
},
|
|
22
|
+
disabled: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: false
|
|
25
|
+
},
|
|
26
|
+
readonly: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: false
|
|
29
|
+
},
|
|
30
|
+
multiple: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: false
|
|
33
|
+
},
|
|
34
|
+
showFullPath: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: true
|
|
37
|
+
},
|
|
38
|
+
maxLevel: {
|
|
39
|
+
type: Number,
|
|
40
|
+
default: 10
|
|
41
|
+
},
|
|
42
|
+
checkStrictly: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: false
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
emits: ["update:modelValue", "change"],
|
|
48
|
+
setup(__props, { emit: __emit }) {
|
|
49
|
+
const props = __props;
|
|
50
|
+
const emit = __emit;
|
|
51
|
+
const propsData = ref({
|
|
52
|
+
value: "optCode",
|
|
53
|
+
label: "optName"
|
|
54
|
+
});
|
|
55
|
+
const ctx = getCurrentVueInstance();
|
|
56
|
+
const inputValue = computed({
|
|
57
|
+
get: () => {
|
|
58
|
+
return props.modelValue;
|
|
59
|
+
},
|
|
60
|
+
set: (val) => {
|
|
61
|
+
emit("update:modelValue", val);
|
|
62
|
+
emit("change", val);
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
const optionConfig = ref({
|
|
66
|
+
idField: "dicId",
|
|
67
|
+
pidField: "pdicId"
|
|
68
|
+
});
|
|
69
|
+
api.getDataDicTrade4Cascader(ctx.$http).then((data) => {
|
|
70
|
+
optionConfig.value.options = data;
|
|
71
|
+
});
|
|
72
|
+
return (_ctx, _cache) => {
|
|
73
|
+
return openBlock(), createBlock(unref(Cascader), {
|
|
74
|
+
modelValue: unref(inputValue),
|
|
75
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(inputValue) ? inputValue.value = $event : null),
|
|
76
|
+
config: __props.config,
|
|
77
|
+
placeholder: __props.placeholder,
|
|
78
|
+
showFullPath: __props.showFullPath,
|
|
79
|
+
disabled: __props.disabled,
|
|
80
|
+
readonly: __props.readonly,
|
|
81
|
+
optionConfig: unref(optionConfig),
|
|
82
|
+
multiple: __props.multiple,
|
|
83
|
+
maxLevel: __props.maxLevel,
|
|
84
|
+
propsData: unref(propsData),
|
|
85
|
+
checkStrictly: __props.checkStrictly
|
|
86
|
+
}, null, 8, ["modelValue", "config", "placeholder", "showFullPath", "disabled", "readonly", "optionConfig", "multiple", "maxLevel", "propsData", "checkStrictly"]);
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
export {
|
|
91
|
+
_sfc_main as default
|
|
92
|
+
};
|