@fecp/designer 5.5.53 → 5.5.54

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.
Files changed (34) hide show
  1. package/es/designer/package.json.mjs +1 -1
  2. package/es/designer/src/packages/form/default.mjs +1 -0
  3. package/es/designer/src/packages/form/formSetting.vue.mjs +27 -20
  4. package/es/designer/src/packages/table/index.vue.mjs +1 -1
  5. package/es/designer.css +299 -203
  6. package/es/packages/vue/src/components/details/main/Main.vue.mjs +7 -4
  7. package/es/packages/vue/src/components/details/main/index.mjs +2 -2
  8. package/es/packages/vue/src/components/forms/form/Form.vue.mjs +157 -67
  9. package/es/packages/vue/src/components/forms/form/FormAnchorNav.vue.mjs +109 -0
  10. package/es/packages/vue/src/components/forms/form/RightAnchorNav.vue.mjs +126 -0
  11. package/es/packages/vue/src/components/forms/h2/H2.vue.mjs +7 -4
  12. package/es/packages/vue/src/components/forms/subTable/SubTable.vue.mjs +3 -2
  13. package/es/packages/vue/src/components/layout/Layout.vue.mjs +9 -17
  14. package/es/packages/vue/src/components/table/DynamicQuery.vue.mjs +4 -2
  15. package/es/packages/vue/src/components/table/Table.vue.mjs +18 -1
  16. package/es/packages/vue/src/components/table/TableFilter.vue.mjs +3 -2
  17. package/es/packages/vue/src/utils/eventBus.mjs +5 -0
  18. package/lib/designer/package.json.js +1 -1
  19. package/lib/designer/src/packages/form/default.js +1 -0
  20. package/lib/designer/src/packages/form/formSetting.vue.js +33 -26
  21. package/lib/designer/src/packages/table/index.vue.js +1 -1
  22. package/lib/designer.css +299 -203
  23. package/lib/packages/vue/src/components/details/main/Main.vue.js +7 -4
  24. package/lib/packages/vue/src/components/forms/form/Form.vue.js +162 -72
  25. package/lib/packages/vue/src/components/forms/form/FormAnchorNav.vue.js +109 -0
  26. package/lib/packages/vue/src/components/forms/form/RightAnchorNav.vue.js +126 -0
  27. package/lib/packages/vue/src/components/forms/h2/H2.vue.js +7 -4
  28. package/lib/packages/vue/src/components/forms/subTable/SubTable.vue.js +3 -2
  29. package/lib/packages/vue/src/components/layout/Layout.vue.js +9 -17
  30. package/lib/packages/vue/src/components/table/DynamicQuery.vue.js +4 -2
  31. package/lib/packages/vue/src/components/table/Table.vue.js +18 -1
  32. package/lib/packages/vue/src/components/table/TableFilter.vue.js +3 -2
  33. package/lib/packages/vue/src/utils/eventBus.js +5 -0
  34. 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, { style: { "padding": "0", "background-color": "#fff", "display": "flex" } }, {
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
- _sfc_main as default
57
+ component as default
55
58
  };
@@ -1,6 +1,6 @@
1
- import _sfc_main from "./Main.vue.mjs";
1
+ import component from "./Main.vue.mjs";
2
2
  import install from "../../../utils/install.mjs";
3
- const main = install.withInstall("Main", _sfc_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, createBlock, createCommentVNode, openBlock, withCtx, createVNode, unref, normalizeClass, createElementBlock, Fragment, renderList } from "vue";
10
+ import { getCurrentInstance, ref, watch, computed, onMounted, onBeforeUnmount, 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);
@@ -208,6 +214,17 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
208
214
  configLoading.value = false;
209
215
  }
210
216
  };
217
+ const navType = computed(() => {
218
+ if ((localConfig.navigationEnabled ?? true) && !props.isSubForm && fecFormRef.value) {
219
+ if (fecFormRef.value.$el.closest(".fec-layout-row")) {
220
+ return "top";
221
+ } else {
222
+ return "right";
223
+ }
224
+ } else {
225
+ return "";
226
+ }
227
+ });
211
228
  function layoutUpdated(layoutData) {
212
229
  emit("layoutUpdated", layoutData);
213
230
  }
@@ -956,12 +973,48 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
956
973
  });
957
974
  }
958
975
  });
959
- gridLayoutFieldsData.value = updatedLayoutData.filter((item) => !item.hidden);
976
+ const fieldsConfigArr = updatedLayoutData.filter((item) => !item.hidden);
977
+ gridLayoutFieldsData.value = sortLayoutItems(fieldsConfigArr);
960
978
  (_a = gridLayout == null ? void 0 : gridLayout.value) == null ? void 0 : _a.resizeEvent();
961
979
  };
980
+ function sortLayoutItems(arr) {
981
+ return [...arr].sort((a, b) => {
982
+ if (a.y !== b.y) {
983
+ return a.y - b.y;
984
+ }
985
+ return a.x - b.x;
986
+ });
987
+ }
988
+ const subTableCounts = ref({});
989
+ const navLinkCompId = ref("");
990
+ const anchorNavLinks = computed(() => {
991
+ var _a;
992
+ const baseId = (_a = gridLayoutFieldsData.value) == null ? void 0 : _a[0].id;
993
+ const list = gridLayoutFieldsData.value.map((item) => {
994
+ if (item.component.fieldType == "h2") {
995
+ return {
996
+ id: item.id,
997
+ title: item.component.label
998
+ };
999
+ } else if (item.component.titleMode == "label") {
1000
+ return {
1001
+ id: item.id,
1002
+ title: item.component.label,
1003
+ count: subTableCounts.value[item.id] ?? 0
1004
+ };
1005
+ } else {
1006
+ return null;
1007
+ }
1008
+ }).filter(Boolean);
1009
+ return [{ id: baseId, title: "基本信息" }, ...list];
1010
+ });
1011
+ emitter.on("onSubTableDataLoaded", ({ subTableConfig, visibleData }) => {
1012
+ const id = subTableConfig.id;
1013
+ const count = (visibleData == null ? void 0 : visibleData.length) || 0;
1014
+ subTableCounts.value[id] = count;
1015
+ });
962
1016
  function initLinkage() {
963
1017
  const changedFields = findChangedFields(formData.value, prevFormData.value);
964
- console.log("🚀 ~ initLinkage ~ changedFields:", changedFields);
965
1018
  if (changedFields.length > 0) {
966
1019
  applyLinkageEffectsForChangedFields(changedFields);
967
1020
  }
@@ -1026,95 +1079,132 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
1026
1079
  });
1027
1080
  return (_ctx, _cache) => {
1028
1081
  const _component_el_form = ElForm;
1082
+ const _component_el_col = ElCol;
1029
1083
  const _component_el_container = ElContainer;
1030
- return !configLoading.value ? (openBlock(), createBlock(_component_el_container, {
1084
+ const _directive_fec_layout = resolveDirective("fec-layout");
1085
+ return !configLoading.value ? withDirectives((openBlock(), createBlock(_component_el_container, {
1031
1086
  key: 0,
1032
- direction: "vertical",
1033
1087
  class: "fec-form",
1034
1088
  "data-id": localConfig.value.templateKey,
1035
1089
  "data-name": localConfig.value.templateName,
1036
1090
  "data-pkId": localConfig.value.pkId,
1037
- "data-version": "v5"
1091
+ "data-version": "v5",
1092
+ ref_key: "fecFormRef",
1093
+ ref: fecFormRef
1038
1094
  }, {
1039
1095
  default: withCtx(() => [
1040
- createVNode(unref(header), {
1041
- showBack: !__props.isSubForm && !__props.isDialog,
1042
- isApproval: __props.isApproval,
1043
- pageHeaderConfig: localConfig.value.pageHeaderConfig,
1044
- onActionClick: handleActionClick
1045
- }, null, 8, ["showBack", "isApproval", "pageHeaderConfig"]),
1046
- createVNode(unref(main), {
1047
- scrollbar: !__props.isDialog
1096
+ createVNode(_component_el_col, {
1097
+ span: unref(navType) == "right" ? 21 : 24,
1098
+ class: "fec-form-col",
1099
+ style: normalizeStyle({ marginRight: unref(navType) == "right" ? "4px" : "0" })
1048
1100
  }, {
1049
1101
  default: withCtx(() => [
1050
- createVNode(_component_el_form, {
1051
- ref_key: "formRef",
1052
- ref: formRef,
1053
- model: formData.value,
1054
- rules: formRules.value,
1055
- "label-position": localConfig.value.labelPosition,
1056
- style: { padding: "0", width: "100%" },
1057
- class: normalizeClass({ "fec-el-form": !__props.isSubForm }),
1058
- "validate-on-rule-change": false,
1059
- size: "large",
1060
- "scroll-to-error": ""
1102
+ createVNode(unref(header), {
1103
+ showBack: !__props.isSubForm && !__props.isDialog,
1104
+ isApproval: __props.isApproval,
1105
+ pageHeaderConfig: localConfig.value.pageHeaderConfig,
1106
+ onActionClick: handleActionClick
1107
+ }, null, 8, ["showBack", "isApproval", "pageHeaderConfig"]),
1108
+ unref(navType) == "top" ? (openBlock(), createBlock(FormAnchorNav, {
1109
+ key: 0,
1110
+ fecFormRef: fecFormRef.value,
1111
+ links: unref(anchorNavLinks),
1112
+ modelValue: navLinkCompId.value,
1113
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => navLinkCompId.value = $event)
1114
+ }, null, 8, ["fecFormRef", "links", "modelValue"])) : createCommentVNode("", true),
1115
+ createVNode(unref(main), {
1116
+ scrollbar: !__props.isDialog
1061
1117
  }, {
1062
1118
  default: withCtx(() => [
1063
- createVNode(unref(De), {
1064
- ref_key: "gridLayout",
1065
- ref: gridLayout,
1066
- layout: gridLayoutFieldsData.value,
1067
- "onUpdate:layout": _cache[0] || (_cache[0] = ($event) => gridLayoutFieldsData.value = $event),
1068
- "row-height": rowHeight.value,
1069
- margin: [0, 0],
1070
- "use-css-transforms": false,
1071
- "col-num": localConfig.value.columns,
1072
- "is-draggable": false,
1073
- "is-resizable": false,
1074
- onLayoutUpdated: layoutUpdated
1119
+ createVNode(_component_el_form, {
1120
+ ref_key: "formRef",
1121
+ ref: formRef,
1122
+ model: formData.value,
1123
+ rules: formRules.value,
1124
+ "label-position": localConfig.value.labelPosition,
1125
+ style: { padding: "0", width: "100%" },
1126
+ class: normalizeClass({ "fec-el-form": !__props.isSubForm }),
1127
+ "validate-on-rule-change": false,
1128
+ size: "large",
1129
+ "scroll-to-error": ""
1075
1130
  }, {
1076
- item: withCtx(({ item: { component } }) => [
1077
- createVNode(unref(FormItem), {
1078
- ref: (el) => setFormItemRef(el, component),
1079
- modelValue: formData.value[component.fieldName],
1080
- "onUpdate:modelValue": ($event) => formData.value[component.fieldName] = $event,
1081
- config: component,
1082
- localConfig: localConfig.value,
1083
- error: getFieldError(component.fieldName),
1084
- formRef: formRef.value,
1085
- formMode: formMode.value,
1086
- onChange: handleFieldChange
1087
- }, null, 8, ["modelValue", "onUpdate:modelValue", "config", "localConfig", "error", "formRef", "formMode"])
1131
+ default: withCtx(() => [
1132
+ createVNode(unref(De), {
1133
+ ref_key: "gridLayout",
1134
+ ref: gridLayout,
1135
+ layout: gridLayoutFieldsData.value,
1136
+ "onUpdate:layout": _cache[1] || (_cache[1] = ($event) => gridLayoutFieldsData.value = $event),
1137
+ "row-height": rowHeight.value,
1138
+ margin: [0, 0],
1139
+ "use-css-transforms": false,
1140
+ "col-num": localConfig.value.columns,
1141
+ "is-draggable": false,
1142
+ "is-resizable": false,
1143
+ onLayoutUpdated: layoutUpdated
1144
+ }, {
1145
+ item: withCtx(({ item: { component } }) => [
1146
+ createVNode(unref(FormItem), {
1147
+ ref: (el) => setFormItemRef(el, component),
1148
+ modelValue: formData.value[component.fieldName],
1149
+ "onUpdate:modelValue": ($event) => formData.value[component.fieldName] = $event,
1150
+ config: component,
1151
+ localConfig: localConfig.value,
1152
+ error: getFieldError(component.fieldName),
1153
+ formRef: formRef.value,
1154
+ formMode: formMode.value,
1155
+ onChange: handleFieldChange
1156
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "config", "localConfig", "error", "formRef", "formMode"])
1157
+ ]),
1158
+ _: 1
1159
+ }, 8, ["layout", "row-height", "col-num"]),
1160
+ (openBlock(true), createElementBlock(Fragment, null, renderList(hiddenFields.value, (field) => {
1161
+ return openBlock(), createElementBlock("input", {
1162
+ key: field.fieldName,
1163
+ type: "hidden",
1164
+ name: field.fieldName,
1165
+ value: formData.value[field.fieldName]
1166
+ }, null, 8, _hoisted_1);
1167
+ }), 128))
1088
1168
  ]),
1089
1169
  _: 1
1090
- }, 8, ["layout", "row-height", "col-num"]),
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))
1170
+ }, 8, ["model", "rules", "label-position", "class"])
1099
1171
  ]),
1100
1172
  _: 1
1101
- }, 8, ["model", "rules", "label-position", "class"])
1173
+ }, 8, ["scrollbar"]),
1174
+ !__props.isSubForm && !__props.isDialog && !__props.isApproval ? (openBlock(), createBlock(unref(footer), {
1175
+ key: 1,
1176
+ formMode: formMode.value,
1177
+ pageFooterConfig: localConfig.value.pageFooterConfig,
1178
+ onCustomButtonClick: handleCustomButtonClick
1179
+ }, null, 8, ["formMode", "pageFooterConfig"])) : createCommentVNode("", true)
1102
1180
  ]),
1103
1181
  _: 1
1104
- }, 8, ["scrollbar"]),
1105
- !__props.isSubForm && !__props.isDialog && !__props.isApproval ? (openBlock(), createBlock(unref(footer), {
1182
+ }, 8, ["span", "style"]),
1183
+ unref(navType) == "right" ? (openBlock(), createBlock(_component_el_col, {
1106
1184
  key: 0,
1107
- formMode: formMode.value,
1108
- pageFooterConfig: localConfig.value.pageFooterConfig,
1109
- onCustomButtonClick: handleCustomButtonClick
1110
- }, null, 8, ["formMode", "pageFooterConfig"])) : createCommentVNode("", true)
1185
+ span: 3,
1186
+ class: "fec-form-col",
1187
+ style: { "margin-left": "4px" }
1188
+ }, {
1189
+ default: withCtx(() => [
1190
+ createVNode(RightAnchorNav, {
1191
+ fecFormRef: fecFormRef.value,
1192
+ links: unref(anchorNavLinks),
1193
+ modelValue: navLinkCompId.value,
1194
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => navLinkCompId.value = $event)
1195
+ }, null, 8, ["fecFormRef", "links", "modelValue"])
1196
+ ]),
1197
+ _: 1
1198
+ })) : createCommentVNode("", true)
1111
1199
  ]),
1112
1200
  _: 1
1113
- }, 8, ["data-id", "data-name", "data-pkId"])) : createCommentVNode("", true);
1201
+ }, 8, ["data-id", "data-name", "data-pkId"])), [
1202
+ [_directive_fec_layout]
1203
+ ]) : createCommentVNode("", true);
1114
1204
  };
1115
1205
  }
1116
1206
  });
1117
- const _Form = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-0a538ee8"]]);
1207
+ const _Form = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-45303517"]]);
1118
1208
  export {
1119
1209
  _Form as default
1120
1210
  };
@@ -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 = { class: "fec-h2" };
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", _hoisted_1, [
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-6852826d"]]);
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
- }, null, 8, ["templateKey", "mode", "titleMode", "hasPagination", "heightMode", "height", "maxHeight", "tableData", "initSearchData", "canLoadBySearchData", "readonly", "btnRollbackEvent"])
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
  }