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