@fecp/designer 5.5.53 → 5.5.57
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/packages/dialog/useDialogDialog.mjs +1 -1
- package/es/designer/src/packages/dialogGlobal/index.vue.mjs +1 -1
- package/es/designer/src/packages/dialogGlobal/useDialogGlobalDialog.mjs +1 -1
- package/es/designer/src/packages/form/default.mjs +1 -0
- package/es/designer/src/packages/form/formSetting.vue.mjs +27 -20
- package/es/designer/src/packages/form/property/widgets.vue.mjs +2 -2
- package/es/designer/src/packages/table/index.vue.mjs +1 -1
- package/es/designer.css +299 -203
- package/es/packages/vue/src/components/details/main/Main.vue.mjs +7 -4
- package/es/packages/vue/src/components/details/main/index.mjs +2 -2
- package/es/packages/vue/src/components/forms/form/Form.vue.mjs +161 -67
- package/es/packages/vue/src/components/forms/form/FormAnchorNav.vue.mjs +109 -0
- package/es/packages/vue/src/components/forms/form/RightAnchorNav.vue.mjs +126 -0
- package/es/packages/vue/src/components/forms/h2/H2.vue.mjs +7 -4
- package/es/packages/vue/src/components/forms/subTable/SubTable.vue.mjs +3 -2
- package/es/packages/vue/src/components/layout/Layout.vue.mjs +9 -17
- package/es/packages/vue/src/components/table/DynamicQuery.vue.mjs +4 -2
- package/es/packages/vue/src/components/table/Table.vue.mjs +18 -1
- package/es/packages/vue/src/components/table/TableFilter.vue.mjs +3 -2
- package/es/packages/vue/src/utils/eventBus.mjs +5 -0
- package/lib/designer/package.json.js +1 -1
- package/lib/designer/src/packages/dialog/useDialogDialog.js +1 -1
- package/lib/designer/src/packages/dialogGlobal/index.vue.js +1 -1
- package/lib/designer/src/packages/dialogGlobal/useDialogGlobalDialog.js +1 -1
- package/lib/designer/src/packages/form/default.js +1 -0
- package/lib/designer/src/packages/form/formSetting.vue.js +33 -26
- package/lib/designer/src/packages/form/property/widgets.vue.js +2 -2
- package/lib/designer/src/packages/table/index.vue.js +1 -1
- package/lib/designer.css +299 -203
- package/lib/packages/vue/src/components/details/main/Main.vue.js +7 -4
- package/lib/packages/vue/src/components/forms/form/Form.vue.js +166 -72
- package/lib/packages/vue/src/components/forms/form/FormAnchorNav.vue.js +109 -0
- package/lib/packages/vue/src/components/forms/form/RightAnchorNav.vue.js +126 -0
- package/lib/packages/vue/src/components/forms/h2/H2.vue.js +7 -4
- package/lib/packages/vue/src/components/forms/subTable/SubTable.vue.js +3 -2
- package/lib/packages/vue/src/components/layout/Layout.vue.js +9 -17
- package/lib/packages/vue/src/components/table/DynamicQuery.vue.js +4 -2
- package/lib/packages/vue/src/components/table/Table.vue.js +18 -1
- package/lib/packages/vue/src/components/table/TableFilter.vue.js +3 -2
- package/lib/packages/vue/src/utils/eventBus.js +5 -0
- package/package.json +1 -1
|
@@ -3,6 +3,8 @@ import "../../../../../../node_modules/element-plus/es/index.mjs";
|
|
|
3
3
|
/* empty css */
|
|
4
4
|
/* empty css */
|
|
5
5
|
import { ref, createBlock, openBlock, withCtx, renderSlot } from "vue";
|
|
6
|
+
/* empty css */
|
|
7
|
+
import _export_sfc from "../../../../../../_virtual/_plugin-vue_export-helper.mjs";
|
|
6
8
|
import { ElMain } from "../../../../../../node_modules/element-plus/es/components/container/index.mjs";
|
|
7
9
|
import { ElScrollbar } from "../../../../../../node_modules/element-plus/es/components/scrollbar/index.mjs";
|
|
8
10
|
const _sfc_main = {
|
|
@@ -30,7 +32,7 @@ const _sfc_main = {
|
|
|
30
32
|
return (_ctx, _cache) => {
|
|
31
33
|
const _component_el_scrollbar = ElScrollbar;
|
|
32
34
|
const _component_el_main = ElMain;
|
|
33
|
-
return openBlock(), createBlock(_component_el_main, {
|
|
35
|
+
return openBlock(), createBlock(_component_el_main, { class: "fec-el-main" }, {
|
|
34
36
|
default: withCtx(() => [
|
|
35
37
|
props.scrollbar ? (openBlock(), createBlock(_component_el_scrollbar, {
|
|
36
38
|
key: 0,
|
|
@@ -40,16 +42,17 @@ const _sfc_main = {
|
|
|
40
42
|
style: { "flex": "1" }
|
|
41
43
|
}, {
|
|
42
44
|
default: withCtx(() => [
|
|
43
|
-
renderSlot(_ctx.$slots, "default")
|
|
45
|
+
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
44
46
|
]),
|
|
45
47
|
_: 3
|
|
46
|
-
}, 512)) : renderSlot(_ctx.$slots, "default", { key: 1 })
|
|
48
|
+
}, 512)) : renderSlot(_ctx.$slots, "default", { key: 1 }, void 0, true)
|
|
47
49
|
]),
|
|
48
50
|
_: 3
|
|
49
51
|
});
|
|
50
52
|
};
|
|
51
53
|
}
|
|
52
54
|
};
|
|
55
|
+
const component = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-3ba17464"]]);
|
|
53
56
|
export {
|
|
54
|
-
|
|
57
|
+
component as default
|
|
55
58
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import component from "./Main.vue.mjs";
|
|
2
2
|
import install from "../../../utils/install.mjs";
|
|
3
|
-
const main = install.withInstall("Main",
|
|
3
|
+
const main = install.withInstall("Main", component);
|
|
4
4
|
export {
|
|
5
5
|
main as default,
|
|
6
6
|
main
|
|
@@ -5,8 +5,9 @@ import "../../../../../../node_modules/element-plus/es/index.mjs";
|
|
|
5
5
|
/* empty css */
|
|
6
6
|
/* empty css */
|
|
7
7
|
/* empty css */
|
|
8
|
+
/* empty css */
|
|
8
9
|
/* empty css */
|
|
9
|
-
import { getCurrentInstance, ref, watch, onMounted, onBeforeUnmount, provide,
|
|
10
|
+
import { getCurrentInstance, ref, watch, onMounted, onBeforeUnmount, computed, provide, resolveDirective, withDirectives, createCommentVNode, createBlock, openBlock, withCtx, createVNode, normalizeStyle, unref, normalizeClass, createElementBlock, Fragment, renderList } from "vue";
|
|
10
11
|
import "../../../../../../node_modules/grid-layout-plus/es/index.mjs";
|
|
11
12
|
import { getCurrentVueInstance } from "../../../utils/getInstance.mjs";
|
|
12
13
|
import getJsonAsyncUtil from "../../../utils/getJsonAsyncUtil.mjs";
|
|
@@ -41,11 +42,15 @@ import { usePageEvents } from "../../../composables/usePageEvents.mjs";
|
|
|
41
42
|
import { header } from "../../details/header/index.mjs";
|
|
42
43
|
import { main } from "../../details/main/index.mjs";
|
|
43
44
|
import { footer } from "../../details/footer/index.mjs";
|
|
45
|
+
import FormAnchorNav from "./FormAnchorNav.vue.mjs";
|
|
46
|
+
import RightAnchorNav from "./RightAnchorNav.vue.mjs";
|
|
44
47
|
import { checkFilterMatch, checkFieldInFilterConfig, checkFieldInResultConfig } from "../../../utils/parseFilterConfig.mjs";
|
|
45
48
|
import hooks from "../../../../../../node_modules/moment/dist/moment.mjs";
|
|
49
|
+
import emitter from "../../../utils/eventBus.mjs";
|
|
46
50
|
/* empty css */
|
|
47
51
|
import { ElMessage } from "../../../../../../node_modules/element-plus/es/components/message/index.mjs";
|
|
48
52
|
import { ElContainer } from "../../../../../../node_modules/element-plus/es/components/container/index.mjs";
|
|
53
|
+
import { ElCol } from "../../../../../../node_modules/element-plus/es/components/col/index.mjs";
|
|
49
54
|
import { ElForm } from "../../../../../../node_modules/element-plus/es/components/form/index.mjs";
|
|
50
55
|
import De from "../../../../../../node_modules/grid-layout-plus/es/components/grid-layout.vue.mjs";
|
|
51
56
|
const _hoisted_1 = ["name", "value"];
|
|
@@ -106,6 +111,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
106
111
|
const emit = __emit;
|
|
107
112
|
const instance = getCurrentInstance();
|
|
108
113
|
const ctx = getCurrentVueInstance();
|
|
114
|
+
const fecFormRef = ref(null);
|
|
109
115
|
const formRef = ref(null);
|
|
110
116
|
const gridLayout = ref(null);
|
|
111
117
|
const configLoading = ref(true);
|
|
@@ -956,12 +962,63 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
956
962
|
});
|
|
957
963
|
}
|
|
958
964
|
});
|
|
959
|
-
|
|
965
|
+
const fieldsConfigArr = updatedLayoutData.filter((item) => !item.hidden);
|
|
966
|
+
gridLayoutFieldsData.value = sortLayoutItems(fieldsConfigArr);
|
|
960
967
|
(_a = gridLayout == null ? void 0 : gridLayout.value) == null ? void 0 : _a.resizeEvent();
|
|
961
968
|
};
|
|
969
|
+
function sortLayoutItems(arr) {
|
|
970
|
+
return [...arr].sort((a, b) => {
|
|
971
|
+
if (a.y !== b.y) {
|
|
972
|
+
return a.y - b.y;
|
|
973
|
+
}
|
|
974
|
+
return a.x - b.x;
|
|
975
|
+
});
|
|
976
|
+
}
|
|
977
|
+
const subTableCounts = ref({});
|
|
978
|
+
const navLinkCompId = ref("");
|
|
979
|
+
const anchorNavLinks = computed(() => {
|
|
980
|
+
var _a;
|
|
981
|
+
const baseId = (_a = gridLayoutFieldsData.value) == null ? void 0 : _a[0].id;
|
|
982
|
+
const list = gridLayoutFieldsData.value.map((item) => {
|
|
983
|
+
if (item.component.fieldType == "h2") {
|
|
984
|
+
return {
|
|
985
|
+
id: item.id,
|
|
986
|
+
title: item.component.label
|
|
987
|
+
};
|
|
988
|
+
} else if (item.component.titleMode == "label") {
|
|
989
|
+
return {
|
|
990
|
+
id: item.id,
|
|
991
|
+
title: item.component.label,
|
|
992
|
+
count: subTableCounts.value[item.id] ?? 0
|
|
993
|
+
};
|
|
994
|
+
} else {
|
|
995
|
+
return null;
|
|
996
|
+
}
|
|
997
|
+
}).filter(Boolean);
|
|
998
|
+
if (list.length == 0) {
|
|
999
|
+
return list;
|
|
1000
|
+
}
|
|
1001
|
+
return [{ id: baseId, title: "基本信息" }, ...list];
|
|
1002
|
+
});
|
|
1003
|
+
emitter.on("onSubTableDataLoaded", ({ subTableConfig, visibleData }) => {
|
|
1004
|
+
const id = subTableConfig.id;
|
|
1005
|
+
const count = (visibleData == null ? void 0 : visibleData.length) || 0;
|
|
1006
|
+
subTableCounts.value[id] = count;
|
|
1007
|
+
});
|
|
1008
|
+
const navType = computed(() => {
|
|
1009
|
+
var _a;
|
|
1010
|
+
if ((localConfig.navigationEnabled ?? false) && !props.isSubForm && ((_a = anchorNavLinks.value) == null ? void 0 : _a.length) > 0 && fecFormRef.value) {
|
|
1011
|
+
if (fecFormRef.value.$el.closest(".fec-layout-row")) {
|
|
1012
|
+
return "top";
|
|
1013
|
+
} else {
|
|
1014
|
+
return "right";
|
|
1015
|
+
}
|
|
1016
|
+
} else {
|
|
1017
|
+
return "";
|
|
1018
|
+
}
|
|
1019
|
+
});
|
|
962
1020
|
function initLinkage() {
|
|
963
1021
|
const changedFields = findChangedFields(formData.value, prevFormData.value);
|
|
964
|
-
console.log("🚀 ~ initLinkage ~ changedFields:", changedFields);
|
|
965
1022
|
if (changedFields.length > 0) {
|
|
966
1023
|
applyLinkageEffectsForChangedFields(changedFields);
|
|
967
1024
|
}
|
|
@@ -1026,95 +1083,132 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
1026
1083
|
});
|
|
1027
1084
|
return (_ctx, _cache) => {
|
|
1028
1085
|
const _component_el_form = ElForm;
|
|
1086
|
+
const _component_el_col = ElCol;
|
|
1029
1087
|
const _component_el_container = ElContainer;
|
|
1030
|
-
|
|
1088
|
+
const _directive_fec_layout = resolveDirective("fec-layout");
|
|
1089
|
+
return !configLoading.value ? withDirectives((openBlock(), createBlock(_component_el_container, {
|
|
1031
1090
|
key: 0,
|
|
1032
|
-
direction: "vertical",
|
|
1033
1091
|
class: "fec-form",
|
|
1034
1092
|
"data-id": localConfig.value.templateKey,
|
|
1035
1093
|
"data-name": localConfig.value.templateName,
|
|
1036
1094
|
"data-pkId": localConfig.value.pkId,
|
|
1037
|
-
"data-version": "v5"
|
|
1095
|
+
"data-version": "v5",
|
|
1096
|
+
ref_key: "fecFormRef",
|
|
1097
|
+
ref: fecFormRef
|
|
1038
1098
|
}, {
|
|
1039
1099
|
default: withCtx(() => [
|
|
1040
|
-
createVNode(
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
onActionClick: handleActionClick
|
|
1045
|
-
}, null, 8, ["showBack", "isApproval", "pageHeaderConfig"]),
|
|
1046
|
-
createVNode(unref(main), {
|
|
1047
|
-
scrollbar: !__props.isDialog
|
|
1100
|
+
createVNode(_component_el_col, {
|
|
1101
|
+
span: unref(navType) == "right" ? 21 : 24,
|
|
1102
|
+
class: "fec-form-col",
|
|
1103
|
+
style: normalizeStyle({ marginRight: unref(navType) == "right" ? "4px" : "0" })
|
|
1048
1104
|
}, {
|
|
1049
1105
|
default: withCtx(() => [
|
|
1050
|
-
createVNode(
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1106
|
+
createVNode(unref(header), {
|
|
1107
|
+
showBack: !__props.isSubForm && !__props.isDialog,
|
|
1108
|
+
isApproval: __props.isApproval,
|
|
1109
|
+
pageHeaderConfig: localConfig.value.pageHeaderConfig,
|
|
1110
|
+
onActionClick: handleActionClick
|
|
1111
|
+
}, null, 8, ["showBack", "isApproval", "pageHeaderConfig"]),
|
|
1112
|
+
unref(navType) == "top" ? (openBlock(), createBlock(FormAnchorNav, {
|
|
1113
|
+
key: 0,
|
|
1114
|
+
fecFormRef: fecFormRef.value,
|
|
1115
|
+
links: unref(anchorNavLinks),
|
|
1116
|
+
modelValue: navLinkCompId.value,
|
|
1117
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => navLinkCompId.value = $event)
|
|
1118
|
+
}, null, 8, ["fecFormRef", "links", "modelValue"])) : createCommentVNode("", true),
|
|
1119
|
+
createVNode(unref(main), {
|
|
1120
|
+
scrollbar: !__props.isDialog
|
|
1061
1121
|
}, {
|
|
1062
1122
|
default: withCtx(() => [
|
|
1063
|
-
createVNode(
|
|
1064
|
-
ref_key: "
|
|
1065
|
-
ref:
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
"
|
|
1069
|
-
|
|
1070
|
-
"
|
|
1071
|
-
"
|
|
1072
|
-
"
|
|
1073
|
-
"
|
|
1074
|
-
onLayoutUpdated: layoutUpdated
|
|
1123
|
+
createVNode(_component_el_form, {
|
|
1124
|
+
ref_key: "formRef",
|
|
1125
|
+
ref: formRef,
|
|
1126
|
+
model: formData.value,
|
|
1127
|
+
rules: formRules.value,
|
|
1128
|
+
"label-position": localConfig.value.labelPosition,
|
|
1129
|
+
style: { padding: "0", width: "100%" },
|
|
1130
|
+
class: normalizeClass({ "fec-el-form": !__props.isSubForm }),
|
|
1131
|
+
"validate-on-rule-change": false,
|
|
1132
|
+
size: "large",
|
|
1133
|
+
"scroll-to-error": ""
|
|
1075
1134
|
}, {
|
|
1076
|
-
|
|
1077
|
-
createVNode(unref(
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1135
|
+
default: withCtx(() => [
|
|
1136
|
+
createVNode(unref(De), {
|
|
1137
|
+
ref_key: "gridLayout",
|
|
1138
|
+
ref: gridLayout,
|
|
1139
|
+
layout: gridLayoutFieldsData.value,
|
|
1140
|
+
"onUpdate:layout": _cache[1] || (_cache[1] = ($event) => gridLayoutFieldsData.value = $event),
|
|
1141
|
+
"row-height": rowHeight.value,
|
|
1142
|
+
margin: [0, 0],
|
|
1143
|
+
"use-css-transforms": false,
|
|
1144
|
+
"col-num": localConfig.value.columns,
|
|
1145
|
+
"is-draggable": false,
|
|
1146
|
+
"is-resizable": false,
|
|
1147
|
+
onLayoutUpdated: layoutUpdated
|
|
1148
|
+
}, {
|
|
1149
|
+
item: withCtx(({ item: { component } }) => [
|
|
1150
|
+
createVNode(unref(FormItem), {
|
|
1151
|
+
ref: (el) => setFormItemRef(el, component),
|
|
1152
|
+
modelValue: formData.value[component.fieldName],
|
|
1153
|
+
"onUpdate:modelValue": ($event) => formData.value[component.fieldName] = $event,
|
|
1154
|
+
config: component,
|
|
1155
|
+
localConfig: localConfig.value,
|
|
1156
|
+
error: getFieldError(component.fieldName),
|
|
1157
|
+
formRef: formRef.value,
|
|
1158
|
+
formMode: formMode.value,
|
|
1159
|
+
onChange: handleFieldChange
|
|
1160
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "config", "localConfig", "error", "formRef", "formMode"])
|
|
1161
|
+
]),
|
|
1162
|
+
_: 1
|
|
1163
|
+
}, 8, ["layout", "row-height", "col-num"]),
|
|
1164
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(hiddenFields.value, (field) => {
|
|
1165
|
+
return openBlock(), createElementBlock("input", {
|
|
1166
|
+
key: field.fieldName,
|
|
1167
|
+
type: "hidden",
|
|
1168
|
+
name: field.fieldName,
|
|
1169
|
+
value: formData.value[field.fieldName]
|
|
1170
|
+
}, null, 8, _hoisted_1);
|
|
1171
|
+
}), 128))
|
|
1088
1172
|
]),
|
|
1089
1173
|
_: 1
|
|
1090
|
-
}, 8, ["
|
|
1091
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(hiddenFields.value, (field) => {
|
|
1092
|
-
return openBlock(), createElementBlock("input", {
|
|
1093
|
-
key: field.fieldName,
|
|
1094
|
-
type: "hidden",
|
|
1095
|
-
name: field.fieldName,
|
|
1096
|
-
value: formData.value[field.fieldName]
|
|
1097
|
-
}, null, 8, _hoisted_1);
|
|
1098
|
-
}), 128))
|
|
1174
|
+
}, 8, ["model", "rules", "label-position", "class"])
|
|
1099
1175
|
]),
|
|
1100
1176
|
_: 1
|
|
1101
|
-
}, 8, ["
|
|
1177
|
+
}, 8, ["scrollbar"]),
|
|
1178
|
+
!__props.isSubForm && !__props.isDialog && !__props.isApproval ? (openBlock(), createBlock(unref(footer), {
|
|
1179
|
+
key: 1,
|
|
1180
|
+
formMode: formMode.value,
|
|
1181
|
+
pageFooterConfig: localConfig.value.pageFooterConfig,
|
|
1182
|
+
onCustomButtonClick: handleCustomButtonClick
|
|
1183
|
+
}, null, 8, ["formMode", "pageFooterConfig"])) : createCommentVNode("", true)
|
|
1102
1184
|
]),
|
|
1103
1185
|
_: 1
|
|
1104
|
-
}, 8, ["
|
|
1105
|
-
|
|
1186
|
+
}, 8, ["span", "style"]),
|
|
1187
|
+
unref(navType) == "right" ? (openBlock(), createBlock(_component_el_col, {
|
|
1106
1188
|
key: 0,
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
},
|
|
1189
|
+
span: 3,
|
|
1190
|
+
class: "fec-form-col",
|
|
1191
|
+
style: { "margin-left": "4px" }
|
|
1192
|
+
}, {
|
|
1193
|
+
default: withCtx(() => [
|
|
1194
|
+
createVNode(RightAnchorNav, {
|
|
1195
|
+
fecFormRef: fecFormRef.value,
|
|
1196
|
+
links: unref(anchorNavLinks),
|
|
1197
|
+
modelValue: navLinkCompId.value,
|
|
1198
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => navLinkCompId.value = $event)
|
|
1199
|
+
}, null, 8, ["fecFormRef", "links", "modelValue"])
|
|
1200
|
+
]),
|
|
1201
|
+
_: 1
|
|
1202
|
+
})) : createCommentVNode("", true)
|
|
1111
1203
|
]),
|
|
1112
1204
|
_: 1
|
|
1113
|
-
}, 8, ["data-id", "data-name", "data-pkId"]))
|
|
1205
|
+
}, 8, ["data-id", "data-name", "data-pkId"])), [
|
|
1206
|
+
[_directive_fec_layout]
|
|
1207
|
+
]) : createCommentVNode("", true);
|
|
1114
1208
|
};
|
|
1115
1209
|
}
|
|
1116
1210
|
});
|
|
1117
|
-
const _Form = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
1211
|
+
const _Form = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-4da49520"]]);
|
|
1118
1212
|
export {
|
|
1119
1213
|
_Form as default
|
|
1120
1214
|
};
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { watch, createElementBlock, createCommentVNode, openBlock, createElementVNode, Fragment, renderList, withModifiers, normalizeClass, createTextVNode, toDisplayString } from "vue";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import _export_sfc from "../../../../../../_virtual/_plugin-vue_export-helper.mjs";
|
|
4
|
+
const _hoisted_1 = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "fec-form-nav"
|
|
7
|
+
};
|
|
8
|
+
const _hoisted_2 = { class: "fec-form-links" };
|
|
9
|
+
const _hoisted_3 = ["href", "onClick"];
|
|
10
|
+
const _hoisted_4 = { class: "fec-form-link-content" };
|
|
11
|
+
const _hoisted_5 = {
|
|
12
|
+
key: 0,
|
|
13
|
+
class: "tab-count"
|
|
14
|
+
};
|
|
15
|
+
const _sfc_main = {
|
|
16
|
+
__name: "FormAnchorNav",
|
|
17
|
+
props: {
|
|
18
|
+
links: {
|
|
19
|
+
type: Array,
|
|
20
|
+
default: () => []
|
|
21
|
+
},
|
|
22
|
+
modelValue: {
|
|
23
|
+
type: [String, Number],
|
|
24
|
+
default: ""
|
|
25
|
+
},
|
|
26
|
+
fecFormRef: {
|
|
27
|
+
type: Object
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
emits: ["change", "update:modelValue"],
|
|
31
|
+
setup(__props, { emit: __emit }) {
|
|
32
|
+
var _a;
|
|
33
|
+
const props = __props;
|
|
34
|
+
const emit = __emit;
|
|
35
|
+
watch(
|
|
36
|
+
() => props.links,
|
|
37
|
+
(newLinks) => {
|
|
38
|
+
if (newLinks.length && !props.modelValue) {
|
|
39
|
+
emit("update:modelValue", newLinks[0].id);
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
{ immediate: true }
|
|
43
|
+
);
|
|
44
|
+
let isClickScrolling = false;
|
|
45
|
+
function handleClick(e, link) {
|
|
46
|
+
e.preventDefault();
|
|
47
|
+
emit("update:modelValue", link.id);
|
|
48
|
+
emit("change", link);
|
|
49
|
+
const element = document.getElementById(link.id);
|
|
50
|
+
if (element) {
|
|
51
|
+
isClickScrolling = true;
|
|
52
|
+
element.scrollIntoView({ behavior: "smooth", block: "start" });
|
|
53
|
+
waitScrollEnd(() => {
|
|
54
|
+
isClickScrolling = false;
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
const scrollWrap = (_a = props.fecFormRef) == null ? void 0 : _a.$el.querySelector(".el-scrollbar__wrap");
|
|
59
|
+
scrollWrap == null ? void 0 : scrollWrap.addEventListener("scroll", onScroll);
|
|
60
|
+
function waitScrollEnd(callback) {
|
|
61
|
+
let timer = null;
|
|
62
|
+
if (!scrollWrap) return;
|
|
63
|
+
const handler = () => {
|
|
64
|
+
clearTimeout(timer);
|
|
65
|
+
timer = setTimeout(() => {
|
|
66
|
+
scrollWrap.removeEventListener("scroll", handler);
|
|
67
|
+
callback();
|
|
68
|
+
}, 150);
|
|
69
|
+
};
|
|
70
|
+
scrollWrap.addEventListener("scroll", handler);
|
|
71
|
+
}
|
|
72
|
+
function onScroll() {
|
|
73
|
+
if (isClickScrolling) return;
|
|
74
|
+
const top = scrollWrap.scrollTop;
|
|
75
|
+
let current = null;
|
|
76
|
+
for (const item of props.links) {
|
|
77
|
+
const el = document.getElementById(String(item.id));
|
|
78
|
+
if (!el) continue;
|
|
79
|
+
if (el.offsetTop <= top) current = item;
|
|
80
|
+
}
|
|
81
|
+
if (current) {
|
|
82
|
+
emit("update:modelValue", current.id);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return (_ctx, _cache) => {
|
|
86
|
+
return __props.links.length ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
87
|
+
createElementVNode("div", _hoisted_2, [
|
|
88
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.links, (link) => {
|
|
89
|
+
return openBlock(), createElementBlock("a", {
|
|
90
|
+
key: link.id,
|
|
91
|
+
href: `#${link.id}`,
|
|
92
|
+
class: normalizeClass(["fec-form-link-item", { "is-active": __props.modelValue == link.id }]),
|
|
93
|
+
onClick: withModifiers(($event) => handleClick($event, link), ["prevent"])
|
|
94
|
+
}, [
|
|
95
|
+
createElementVNode("span", _hoisted_4, [
|
|
96
|
+
createTextVNode(toDisplayString(link.title) + " ", 1),
|
|
97
|
+
link.count ? (openBlock(), createElementBlock("span", _hoisted_5, "(" + toDisplayString(link.count) + ")", 1)) : createCommentVNode("", true)
|
|
98
|
+
])
|
|
99
|
+
], 10, _hoisted_3);
|
|
100
|
+
}), 128))
|
|
101
|
+
])
|
|
102
|
+
])) : createCommentVNode("", true);
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
const FormAnchorNav = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-c1a977b4"]]);
|
|
107
|
+
export {
|
|
108
|
+
FormAnchorNav as default
|
|
109
|
+
};
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import "../../../../../../node_modules/element-plus/es/index.mjs";
|
|
2
|
+
/* empty css */
|
|
3
|
+
/* empty css */
|
|
4
|
+
/* empty css */
|
|
5
|
+
import { ref, watch, onMounted, createElementBlock, openBlock, createElementVNode, createVNode, createTextVNode, withCtx, Fragment, renderList, createBlock, withModifiers, createCommentVNode, toDisplayString } from "vue";
|
|
6
|
+
/* empty css */
|
|
7
|
+
import _export_sfc from "../../../../../../_virtual/_plugin-vue_export-helper.mjs";
|
|
8
|
+
import { ElAnchor, ElAnchorLink } from "../../../../../../node_modules/element-plus/es/components/anchor/index.mjs";
|
|
9
|
+
const _hoisted_1 = { class: "anchor-nav" };
|
|
10
|
+
const _hoisted_2 = { key: 0 };
|
|
11
|
+
const _sfc_main = {
|
|
12
|
+
__name: "RightAnchorNav",
|
|
13
|
+
props: {
|
|
14
|
+
links: {
|
|
15
|
+
type: Array,
|
|
16
|
+
default: () => []
|
|
17
|
+
},
|
|
18
|
+
modelValue: {
|
|
19
|
+
type: [String, Number],
|
|
20
|
+
default: ""
|
|
21
|
+
},
|
|
22
|
+
fecFormRef: {
|
|
23
|
+
type: Object
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
emits: ["change", "update:modelValue"],
|
|
27
|
+
setup(__props, { emit: __emit }) {
|
|
28
|
+
var _a;
|
|
29
|
+
const props = __props;
|
|
30
|
+
const anchorRef = ref();
|
|
31
|
+
const emit = __emit;
|
|
32
|
+
watch(
|
|
33
|
+
() => props.links,
|
|
34
|
+
(newLinks) => {
|
|
35
|
+
if (newLinks.length && !props.modelValue) {
|
|
36
|
+
emit("update:modelValue", newLinks[0].id);
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
{ immediate: true }
|
|
40
|
+
);
|
|
41
|
+
let isClickScrolling = false;
|
|
42
|
+
function handleClick(e, link) {
|
|
43
|
+
e.preventDefault();
|
|
44
|
+
emit("update:modelValue", link.id);
|
|
45
|
+
emit("change", link);
|
|
46
|
+
const element = document.getElementById(link.id);
|
|
47
|
+
if (element) {
|
|
48
|
+
isClickScrolling = true;
|
|
49
|
+
element.scrollIntoView({ behavior: "smooth", block: "start" });
|
|
50
|
+
waitScrollEnd(() => {
|
|
51
|
+
isClickScrolling = false;
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
const scrollWrap = (_a = props.fecFormRef) == null ? void 0 : _a.$el.querySelector(".el-scrollbar__wrap");
|
|
56
|
+
scrollWrap == null ? void 0 : scrollWrap.addEventListener("scroll", onScroll);
|
|
57
|
+
function waitScrollEnd(callback) {
|
|
58
|
+
let timer = null;
|
|
59
|
+
if (!scrollWrap) return;
|
|
60
|
+
const handler = () => {
|
|
61
|
+
clearTimeout(timer);
|
|
62
|
+
timer = setTimeout(() => {
|
|
63
|
+
scrollWrap.removeEventListener("scroll", handler);
|
|
64
|
+
callback();
|
|
65
|
+
}, 150);
|
|
66
|
+
};
|
|
67
|
+
scrollWrap.addEventListener("scroll", handler);
|
|
68
|
+
}
|
|
69
|
+
function onScroll() {
|
|
70
|
+
var _a2;
|
|
71
|
+
if (isClickScrolling) return;
|
|
72
|
+
const top = scrollWrap.scrollTop;
|
|
73
|
+
let current = null;
|
|
74
|
+
for (const item of props.links) {
|
|
75
|
+
const el = document.getElementById(String(item.id));
|
|
76
|
+
if (!el) continue;
|
|
77
|
+
if (el.offsetTop - 70 <= top) current = item;
|
|
78
|
+
}
|
|
79
|
+
if (current) {
|
|
80
|
+
emit("update:modelValue", current.id);
|
|
81
|
+
(_a2 = anchorRef.value) == null ? void 0 : _a2.scrollTo(`#${current.id}`);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
onMounted(() => {
|
|
85
|
+
var _a2;
|
|
86
|
+
(_a2 = anchorRef.value) == null ? void 0 : _a2.scrollTo(`#${props.modelValue}`);
|
|
87
|
+
});
|
|
88
|
+
return (_ctx, _cache) => {
|
|
89
|
+
const _component_el_anchor_link = ElAnchorLink;
|
|
90
|
+
const _component_el_anchor = ElAnchor;
|
|
91
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
92
|
+
_cache[0] || (_cache[0] = createElementVNode("div", { class: "anchor-title" }, [
|
|
93
|
+
createElementVNode("div", { class: "label-line" }),
|
|
94
|
+
createTextVNode(" 导航 ")
|
|
95
|
+
], -1)),
|
|
96
|
+
createVNode(_component_el_anchor, {
|
|
97
|
+
type: "underline",
|
|
98
|
+
offset: 70,
|
|
99
|
+
ref_key: "anchorRef",
|
|
100
|
+
ref: anchorRef
|
|
101
|
+
}, {
|
|
102
|
+
default: withCtx(() => [
|
|
103
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.links, (link) => {
|
|
104
|
+
return openBlock(), createBlock(_component_el_anchor_link, {
|
|
105
|
+
key: link.id,
|
|
106
|
+
href: `#${link.id}`,
|
|
107
|
+
onClick: withModifiers(($event) => handleClick($event, link), ["prevent"])
|
|
108
|
+
}, {
|
|
109
|
+
default: withCtx(() => [
|
|
110
|
+
createTextVNode(toDisplayString(link.title) + " ", 1),
|
|
111
|
+
link.count ? (openBlock(), createElementBlock("span", _hoisted_2, "(" + toDisplayString(link.count) + ")", 1)) : createCommentVNode("", true)
|
|
112
|
+
]),
|
|
113
|
+
_: 2
|
|
114
|
+
}, 1032, ["href", "onClick"]);
|
|
115
|
+
}), 128))
|
|
116
|
+
]),
|
|
117
|
+
_: 1
|
|
118
|
+
}, 512)
|
|
119
|
+
]);
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
const RightAnchorNav = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-a571766d"]]);
|
|
124
|
+
export {
|
|
125
|
+
RightAnchorNav as default
|
|
126
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createElementBlock, openBlock, createElementVNode, toDisplayString, renderSlot } from "vue";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import _export_sfc from "../../../../../../_virtual/_plugin-vue_export-helper.mjs";
|
|
4
|
-
const _hoisted_1 =
|
|
4
|
+
const _hoisted_1 = ["id"];
|
|
5
5
|
const _hoisted_2 = { class: "fec-label" };
|
|
6
6
|
const _hoisted_3 = { class: "fec-label-title" };
|
|
7
7
|
const _hoisted_4 = { class: "fec-label-sub-title" };
|
|
@@ -18,7 +18,10 @@ const _sfc_main = {
|
|
|
18
18
|
},
|
|
19
19
|
setup(__props) {
|
|
20
20
|
return (_ctx, _cache) => {
|
|
21
|
-
return openBlock(), createElementBlock("div",
|
|
21
|
+
return openBlock(), createElementBlock("div", {
|
|
22
|
+
class: "fec-h2",
|
|
23
|
+
id: __props.config.id
|
|
24
|
+
}, [
|
|
22
25
|
_cache[0] || (_cache[0] = createElementVNode("div", { class: "fec-label-line" }, null, -1)),
|
|
23
26
|
createElementVNode("div", _hoisted_2, [
|
|
24
27
|
createElementVNode("div", _hoisted_3, toDisplayString(__props.config.label), 1),
|
|
@@ -32,11 +35,11 @@ const _sfc_main = {
|
|
|
32
35
|
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
33
36
|
])
|
|
34
37
|
])
|
|
35
|
-
]);
|
|
38
|
+
], 8, _hoisted_1);
|
|
36
39
|
};
|
|
37
40
|
}
|
|
38
41
|
};
|
|
39
|
-
const _H2 = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
42
|
+
const _H2 = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-203f2333"]]);
|
|
40
43
|
export {
|
|
41
44
|
_H2 as default
|
|
42
45
|
};
|
|
@@ -201,8 +201,9 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
201
201
|
initSearchData: unref(initSearchData),
|
|
202
202
|
canLoadBySearchData: __props.config.reloadOnParamsChange,
|
|
203
203
|
readonly: __props.config.isSubTableReadOnly || __props.formMode == "query",
|
|
204
|
-
btnRollbackEvent: unref(btnRollbackEvent)
|
|
205
|
-
|
|
204
|
+
btnRollbackEvent: unref(btnRollbackEvent),
|
|
205
|
+
subTableConfig: __props.config
|
|
206
|
+
}, null, 8, ["templateKey", "mode", "titleMode", "hasPagination", "heightMode", "height", "maxHeight", "tableData", "initSearchData", "canLoadBySearchData", "readonly", "btnRollbackEvent", "subTableConfig"])
|
|
206
207
|
], 64);
|
|
207
208
|
};
|
|
208
209
|
}
|