@fecp/designer 5.5.51 → 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 (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 +157 -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 +7 -3
  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 +26 -7
  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 +162 -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 +7 -3
  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 +25 -6
  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);
@@ -210,6 +216,17 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
210
216
  configLoading.value = false;
211
217
  }
212
218
  };
219
+ const navType = Vue.computed(() => {
220
+ if ((localConfig.navigationEnabled ?? true) && !props.isSubForm && fecFormRef.value) {
221
+ if (fecFormRef.value.$el.closest(".fec-layout-row")) {
222
+ return "top";
223
+ } else {
224
+ return "right";
225
+ }
226
+ } else {
227
+ return "";
228
+ }
229
+ });
213
230
  function layoutUpdated(layoutData) {
214
231
  emit("layoutUpdated", layoutData);
215
232
  }
@@ -958,12 +975,48 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
958
975
  });
959
976
  }
960
977
  });
961
- gridLayoutFieldsData.value = updatedLayoutData.filter((item) => !item.hidden);
978
+ const fieldsConfigArr = updatedLayoutData.filter((item) => !item.hidden);
979
+ gridLayoutFieldsData.value = sortLayoutItems(fieldsConfigArr);
962
980
  (_a = gridLayout == null ? void 0 : gridLayout.value) == null ? void 0 : _a.resizeEvent();
963
981
  };
982
+ function sortLayoutItems(arr) {
983
+ return [...arr].sort((a, b) => {
984
+ if (a.y !== b.y) {
985
+ return a.y - b.y;
986
+ }
987
+ return a.x - b.x;
988
+ });
989
+ }
990
+ const subTableCounts = Vue.ref({});
991
+ const navLinkCompId = Vue.ref("");
992
+ const anchorNavLinks = Vue.computed(() => {
993
+ var _a;
994
+ const baseId = (_a = gridLayoutFieldsData.value) == null ? void 0 : _a[0].id;
995
+ const list = gridLayoutFieldsData.value.map((item) => {
996
+ if (item.component.fieldType == "h2") {
997
+ return {
998
+ id: item.id,
999
+ title: item.component.label
1000
+ };
1001
+ } else if (item.component.titleMode == "label") {
1002
+ return {
1003
+ id: item.id,
1004
+ title: item.component.label,
1005
+ count: subTableCounts.value[item.id] ?? 0
1006
+ };
1007
+ } else {
1008
+ return null;
1009
+ }
1010
+ }).filter(Boolean);
1011
+ return [{ id: baseId, title: "基本信息" }, ...list];
1012
+ });
1013
+ eventBus.default.on("onSubTableDataLoaded", ({ subTableConfig, visibleData }) => {
1014
+ const id = subTableConfig.id;
1015
+ const count = (visibleData == null ? void 0 : visibleData.length) || 0;
1016
+ subTableCounts.value[id] = count;
1017
+ });
964
1018
  function initLinkage() {
965
1019
  const changedFields = findChangedFields(formData.value, prevFormData.value);
966
- console.log("🚀 ~ initLinkage ~ changedFields:", changedFields);
967
1020
  if (changedFields.length > 0) {
968
1021
  applyLinkageEffectsForChangedFields(changedFields);
969
1022
  }
@@ -1027,94 +1080,131 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
1027
1080
  hasSaveButton
1028
1081
  });
1029
1082
  return (_ctx, _cache) => {
1030
- const _component_el_form = index$5.ElForm;
1083
+ const _component_el_form = index$6.ElForm;
1084
+ const _component_el_col = index$3.ElCol;
1031
1085
  const _component_el_container = index$2.ElContainer;
1032
- return !configLoading.value ? (Vue.openBlock(), Vue.createBlock(_component_el_container, {
1086
+ const _directive_fec_layout = Vue.resolveDirective("fec-layout");
1087
+ return !configLoading.value ? Vue.withDirectives((Vue.openBlock(), Vue.createBlock(_component_el_container, {
1033
1088
  key: 0,
1034
- direction: "vertical",
1035
1089
  class: "fec-form",
1036
1090
  "data-id": localConfig.value.templateKey,
1037
1091
  "data-name": localConfig.value.templateName,
1038
1092
  "data-pkId": localConfig.value.pkId,
1039
- "data-version": "v5"
1093
+ "data-version": "v5",
1094
+ ref_key: "fecFormRef",
1095
+ ref: fecFormRef
1040
1096
  }, {
1041
1097
  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
1098
+ Vue.createVNode(_component_el_col, {
1099
+ span: Vue.unref(navType) == "right" ? 21 : 24,
1100
+ class: "fec-form-col",
1101
+ style: Vue.normalizeStyle({ marginRight: Vue.unref(navType) == "right" ? "4px" : "0" })
1050
1102
  }, {
1051
1103
  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": ""
1104
+ Vue.createVNode(Vue.unref(index$4.header), {
1105
+ showBack: !__props.isSubForm && !__props.isDialog,
1106
+ isApproval: __props.isApproval,
1107
+ pageHeaderConfig: localConfig.value.pageHeaderConfig,
1108
+ onActionClick: handleActionClick
1109
+ }, null, 8, ["showBack", "isApproval", "pageHeaderConfig"]),
1110
+ Vue.unref(navType) == "top" ? (Vue.openBlock(), Vue.createBlock(FormAnchorNav.default, {
1111
+ key: 0,
1112
+ fecFormRef: fecFormRef.value,
1113
+ links: Vue.unref(anchorNavLinks),
1114
+ modelValue: navLinkCompId.value,
1115
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => navLinkCompId.value = $event)
1116
+ }, null, 8, ["fecFormRef", "links", "modelValue"])) : Vue.createCommentVNode("", true),
1117
+ Vue.createVNode(Vue.unref(index$5.main), {
1118
+ scrollbar: !__props.isDialog
1063
1119
  }, {
1064
1120
  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
1121
+ Vue.createVNode(_component_el_form, {
1122
+ ref_key: "formRef",
1123
+ ref: formRef,
1124
+ model: formData.value,
1125
+ rules: formRules.value,
1126
+ "label-position": localConfig.value.labelPosition,
1127
+ style: { padding: "0", width: "100%" },
1128
+ class: Vue.normalizeClass({ "fec-el-form": !__props.isSubForm }),
1129
+ "validate-on-rule-change": false,
1130
+ size: "large",
1131
+ "scroll-to-error": ""
1077
1132
  }, {
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"])
1133
+ default: Vue.withCtx(() => [
1134
+ Vue.createVNode(Vue.unref(gridLayout_vue.default), {
1135
+ ref_key: "gridLayout",
1136
+ ref: gridLayout,
1137
+ layout: gridLayoutFieldsData.value,
1138
+ "onUpdate:layout": _cache[1] || (_cache[1] = ($event) => gridLayoutFieldsData.value = $event),
1139
+ "row-height": rowHeight.value,
1140
+ margin: [0, 0],
1141
+ "use-css-transforms": false,
1142
+ "col-num": localConfig.value.columns,
1143
+ "is-draggable": false,
1144
+ "is-resizable": false,
1145
+ onLayoutUpdated: layoutUpdated
1146
+ }, {
1147
+ item: Vue.withCtx(({ item: { component } }) => [
1148
+ Vue.createVNode(Vue.unref(index$7.FormItem), {
1149
+ ref: (el) => setFormItemRef(el, component),
1150
+ modelValue: formData.value[component.fieldName],
1151
+ "onUpdate:modelValue": ($event) => formData.value[component.fieldName] = $event,
1152
+ config: component,
1153
+ localConfig: localConfig.value,
1154
+ error: getFieldError(component.fieldName),
1155
+ formRef: formRef.value,
1156
+ formMode: formMode.value,
1157
+ onChange: handleFieldChange
1158
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "config", "localConfig", "error", "formRef", "formMode"])
1159
+ ]),
1160
+ _: 1
1161
+ }, 8, ["layout", "row-height", "col-num"]),
1162
+ (Vue.openBlock(true), Vue.createElementBlock(Vue.Fragment, null, Vue.renderList(hiddenFields.value, (field) => {
1163
+ return Vue.openBlock(), Vue.createElementBlock("input", {
1164
+ key: field.fieldName,
1165
+ type: "hidden",
1166
+ name: field.fieldName,
1167
+ value: formData.value[field.fieldName]
1168
+ }, null, 8, _hoisted_1);
1169
+ }), 128))
1090
1170
  ]),
1091
1171
  _: 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))
1172
+ }, 8, ["model", "rules", "label-position", "class"])
1101
1173
  ]),
1102
1174
  _: 1
1103
- }, 8, ["model", "rules", "label-position", "class"])
1175
+ }, 8, ["scrollbar"]),
1176
+ !__props.isSubForm && !__props.isDialog && !__props.isApproval ? (Vue.openBlock(), Vue.createBlock(Vue.unref(index$8.footer), {
1177
+ key: 1,
1178
+ formMode: formMode.value,
1179
+ pageFooterConfig: localConfig.value.pageFooterConfig,
1180
+ onCustomButtonClick: handleCustomButtonClick
1181
+ }, null, 8, ["formMode", "pageFooterConfig"])) : Vue.createCommentVNode("", true)
1104
1182
  ]),
1105
1183
  _: 1
1106
- }, 8, ["scrollbar"]),
1107
- !__props.isSubForm && !__props.isDialog && !__props.isApproval ? (Vue.openBlock(), Vue.createBlock(Vue.unref(index$7.footer), {
1184
+ }, 8, ["span", "style"]),
1185
+ Vue.unref(navType) == "right" ? (Vue.openBlock(), Vue.createBlock(_component_el_col, {
1108
1186
  key: 0,
1109
- formMode: formMode.value,
1110
- pageFooterConfig: localConfig.value.pageFooterConfig,
1111
- onCustomButtonClick: handleCustomButtonClick
1112
- }, null, 8, ["formMode", "pageFooterConfig"])) : Vue.createCommentVNode("", true)
1187
+ span: 3,
1188
+ class: "fec-form-col",
1189
+ style: { "margin-left": "4px" }
1190
+ }, {
1191
+ default: Vue.withCtx(() => [
1192
+ Vue.createVNode(RightAnchorNav.default, {
1193
+ fecFormRef: fecFormRef.value,
1194
+ links: Vue.unref(anchorNavLinks),
1195
+ modelValue: navLinkCompId.value,
1196
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => navLinkCompId.value = $event)
1197
+ }, null, 8, ["fecFormRef", "links", "modelValue"])
1198
+ ]),
1199
+ _: 1
1200
+ })) : Vue.createCommentVNode("", true)
1113
1201
  ]),
1114
1202
  _: 1
1115
- }, 8, ["data-id", "data-name", "data-pkId"])) : Vue.createCommentVNode("", true);
1203
+ }, 8, ["data-id", "data-name", "data-pkId"])), [
1204
+ [_directive_fec_layout]
1205
+ ]) : Vue.createCommentVNode("", true);
1116
1206
  };
1117
1207
  }
1118
1208
  });
1119
- const _Form = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-0a538ee8"]]);
1209
+ const _Form = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-45303517"]]);
1120
1210
  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;
@@ -38,6 +38,9 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
38
38
  Vue.inject("gridLayout");
39
39
  const setFormItemHeight = Vue.inject("setFormItemHeight");
40
40
  const handleEvent = Vue.inject("handleEvent");
41
+ const heightMode = Vue.computed(() => {
42
+ return props.config.subTableHeightType || "auto";
43
+ });
41
44
  const btnRollbackEvent = Vue.computed(() => {
42
45
  const btnRollback = props.config.btnRollback || [];
43
46
  const data = {};
@@ -193,15 +196,16 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
193
196
  mode: __props.config.subTableMode,
194
197
  titleMode: __props.config.titleMode,
195
198
  hasPagination: __props.config.isSubTablePagination,
196
- heightMode: __props.config.subTableHeightType,
199
+ heightMode: Vue.unref(heightMode),
197
200
  height: __props.config.subTableHeight,
198
201
  maxHeight: __props.config.subTableMaxHeight,
199
202
  tableData: Vue.unref(subTableData),
200
203
  initSearchData: Vue.unref(initSearchData),
201
204
  canLoadBySearchData: __props.config.reloadOnParamsChange,
202
205
  readonly: __props.config.isSubTableReadOnly || __props.formMode == "query",
203
- btnRollbackEvent: Vue.unref(btnRollbackEvent)
204
- }, 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"])
205
209
  ], 64);
206
210
  };
207
211
  }