@fecp/vue 1.1.5 → 1.1.6

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.
@@ -4,6 +4,7 @@
4
4
  /* empty css */
5
5
  import { createBlock, createCommentVNode, openBlock, normalizeClass, unref, createSlots, withCtx, createElementVNode, toDisplayString, createElementBlock, Fragment, renderList, createTextVNode } from "vue";
6
6
  import { ArrowLeft as arrow_left_default } from "../../../../../../node_modules/.pnpm/@element-plus_icons-vue@2.3.2_vue@3.5.13_typescript@5.7.3_/node_modules/@element-plus/icons-vue/dist/index.mjs";
7
+ import { getCurrentVueInstance } from "../../../utils/getInstance.mjs";
7
8
  /* empty css */
8
9
  import _export_sfc from "../../../../../../_virtual/_plugin-vue_export-helper.mjs";
9
10
  import { ElPageHeader } from "../../../../../../node_modules/.pnpm/element-plus@2.13.2_vue@3.5.13_typescript@5.7.3_/node_modules/element-plus/es/components/page-header/index.mjs";
@@ -19,10 +20,10 @@ const _sfc_main = {
19
20
  required: true
20
21
  }
21
22
  },
22
- emits: ["back", "action-click"],
23
+ emits: ["action-click"],
23
24
  setup(__props, { emit: __emit }) {
24
25
  const props = __props;
25
- console.log("🚀 ~ props:", props);
26
+ const ctx = getCurrentVueInstance();
26
27
  const emit = __emit;
27
28
  const getButtonType = (btnStyle) => {
28
29
  return "primary";
@@ -46,7 +47,7 @@ const _sfc_main = {
46
47
  return;
47
48
  }
48
49
  }
49
- emit("back");
50
+ ctx.$router.go(-1);
50
51
  };
51
52
  const handleActionClick = (action) => {
52
53
  emit("action-click", action);
@@ -95,7 +96,7 @@ const _sfc_main = {
95
96
  };
96
97
  }
97
98
  };
98
- const component = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-b995f3ee"]]);
99
+ const component = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-0d26d4e0"]]);
99
100
  export {
100
101
  component as default
101
102
  };
@@ -13,8 +13,6 @@ import _FormItem from "../formItem/FormItem.vue.mjs";
13
13
  import { createDataSource } from "../../../utils/datasource.mjs";
14
14
  import { generateFieldRules } from "./validation.mjs";
15
15
  import { cloneDeep } from "../../../utils/common.mjs";
16
- /* empty css */
17
- /* empty css */
18
16
  /* empty css */
19
17
  /* empty css */
20
18
  /* empty css */
@@ -27,6 +25,8 @@ import { footer } from "../../details/footer/index.mjs";
27
25
  import { checkFilterMatch } from "../../../utils/parseFilterConfig.mjs";
28
26
  import { calculate } from "../../../utils/formulajs/calculate.mjs";
29
27
  import hooks from "../../../../../../node_modules/.pnpm/moment@2.30.1/node_modules/moment/dist/moment.mjs";
28
+ /* empty css */
29
+ /* empty css */
30
30
  /* empty css */
31
31
  import _export_sfc from "../../../../../../_virtual/_plugin-vue_export-helper.mjs";
32
32
  import { ElContainer } from "../../../../../../node_modules/.pnpm/element-plus@2.13.2_vue@3.5.13_typescript@5.7.3_/node_modules/element-plus/es/components/container/index.mjs";
@@ -115,7 +115,12 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
115
115
  emit("loaded", option);
116
116
  rowHeight.value = option.labelPosition == "top" ? 1.5 : 1;
117
117
  localConfig.value = option;
118
- fieldsData.value = option.fieldsData.map((item) => item.component);
118
+ fieldsData.value = option.fieldsData.map((item) => {
119
+ if (option.formMode == "query") {
120
+ item.component.disabled = true;
121
+ }
122
+ return item.component;
123
+ });
119
124
  hiddenFields.value = option.hiddenFields || [];
120
125
  loadFormData();
121
126
  await loadFieldDataSources();
@@ -131,6 +136,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
131
136
  }
132
137
  }
133
138
  } catch (error) {
139
+ debugger;
134
140
  console.error("加载配置失败:", error);
135
141
  ElMessage.error("加载配置失败");
136
142
  } finally {
@@ -299,10 +305,6 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
299
305
  }
300
306
  return item;
301
307
  });
302
- console.log(
303
- "🚀 ~ localConfig.value.fieldsData:",
304
- localConfig.value.fieldsData
305
- );
306
308
  const linkedConfig = localConfig.value.linkedConfig || {};
307
309
  const dataLink = (linkedConfig == null ? void 0 : linkedConfig.dataLink) || [];
308
310
  const fields = [...fieldsData.value, ...hiddenFields.value];
@@ -411,7 +413,6 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
411
413
  });
412
414
  }
413
415
  });
414
- console.log("🚀 ~ gridLayoutData:", gridLayoutData);
415
416
  return gridLayoutData;
416
417
  });
417
418
  const getFieldError = (fieldName) => {
@@ -611,7 +612,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
611
612
  };
612
613
  }
613
614
  });
614
- const _Form = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-5ea07f4a"]]);
615
+ const _Form = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-4a93bf45"]]);
615
616
  export {
616
617
  _Form as default
617
618
  };
@@ -55,7 +55,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
55
55
  });
56
56
  const initSearchData = computed(() => {
57
57
  if (props.config.dataSourceFrom == "self") {
58
- const fields = props.localConfig.fieldsData.map((item2) => item2.component);
58
+ const fields = props.localConfig.fieldsData.map((item) => item.component);
59
59
  const params = parseRouteParams(
60
60
  props.config.subTableParams,
61
61
  formData.value,
@@ -68,13 +68,13 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
68
68
  });
69
69
  function subTableLoaded(subOption) {
70
70
  const foundItem = props.localConfig.fieldsData.find(
71
- (item2) => item2.id == props.config.id
71
+ (item) => item.id == props.config.id
72
72
  );
73
73
  const titleHeight = config.titleMode != "none" ? 60 : 0;
74
74
  if (foundItem) {
75
75
  foundItem.fixedH = true;
76
- item.y = item.y * props.config.subTableHeight + titleHeight;
77
76
  foundItem.h = props.config.subTableHeight + titleHeight;
77
+ foundItem.y = foundItem.y * foundItem.h;
78
78
  gridLayout.value.resizeEvent();
79
79
  }
80
80
  }
@@ -1,11 +1,10 @@
1
1
  /* empty css */
2
- /* empty css */
3
2
  /* empty css */
4
3
  /* empty css */
5
4
  /* empty css */
6
5
  /* empty css */
7
6
  /* empty css */
8
- import { ref, getCurrentInstance, computed, reactive, watch, onMounted, onUnmounted, createBlock, openBlock, withCtx, createElementBlock, createCommentVNode, normalizeStyle, createElementVNode, withDirectives, unref, createVNode, createSlots, renderList, renderSlot, normalizeProps, guardReactiveProps } from "vue";
7
+ import { ref, getCurrentInstance, computed, reactive, watch, onMounted, onUnmounted, createBlock, openBlock, withCtx, createElementBlock, createCommentVNode, normalizeStyle, createElementVNode, createVNode, unref, createSlots, renderList, renderSlot, normalizeProps, guardReactiveProps } from "vue";
9
8
  import "../../../../../node_modules/.pnpm/vxe-table@4.17.47_vue@3.5.13_typescript@5.7.3_/node_modules/vxe-table/es/components.mjs";
10
9
  /* empty css */
11
10
  import { createDataSource } from "../../utils/datasource.mjs";
@@ -14,19 +13,18 @@ import CustomButtons from "./CustomButtons.vue.mjs";
14
13
  import TableColumn from "./TableColumn.vue.mjs";
15
14
  import TableFilter from "./TableFilter.vue.mjs";
16
15
  import { getCurrentVueInstance } from "../../utils/getInstance.mjs";
17
- /* empty css */
18
- /* empty css */
19
16
  /* empty css */
20
17
  /* empty css */
21
18
  /* empty css */
22
19
  /* empty css */
23
20
  import { useEventFlow } from "../../utils/eventFlow/eventFlowHandler.mjs";
24
21
  import getJsonAsyncUtil from "../../utils/getJsonAsyncUtil.mjs";
22
+ /* empty css */
23
+ /* empty css */
25
24
  /* empty css */
26
25
  import _export_sfc from "../../../../../_virtual/_plugin-vue_export-helper.mjs";
27
26
  import { ElContainer } from "../../../../../node_modules/.pnpm/element-plus@2.13.2_vue@3.5.13_typescript@5.7.3_/node_modules/element-plus/es/components/container/index.mjs";
28
27
  import { VxeTable } from "../../../../../node_modules/.pnpm/vxe-table@4.17.47_vue@3.5.13_typescript@5.7.3_/node_modules/vxe-table/es/table/index.mjs";
29
- import vLoading from "../../../../../node_modules/.pnpm/element-plus@2.13.2_vue@3.5.13_typescript@5.7.3_/node_modules/element-plus/es/components/loading/src/directive.mjs";
30
28
  import { ElMessage } from "../../../../../node_modules/.pnpm/element-plus@2.13.2_vue@3.5.13_typescript@5.7.3_/node_modules/element-plus/es/components/message/index.mjs";
31
29
  const _hoisted_1 = { class: "fec-table" };
32
30
  const _sfc_main = /* @__PURE__ */ Object.assign({
@@ -107,13 +105,6 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
107
105
  }
108
106
  return ((_a = dataSourceManager.value) == null ? void 0 : _a.getData().list) || [];
109
107
  });
110
- const loading = computed(() => {
111
- var _a;
112
- if (props.tableData && props.tableData.length > 0) {
113
- return false;
114
- }
115
- return ((_a = dataSourceManager.value) == null ? void 0 : _a.getLoading()) || false;
116
- });
117
108
  const isPagination = computed(() => {
118
109
  var _a;
119
110
  if (props.isSubTable) {
@@ -430,6 +421,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
430
421
  localConfig.value = option;
431
422
  emit("loaded", option);
432
423
  } catch (error) {
424
+ debugger;
433
425
  console.error("加载配置失败:", error);
434
426
  ElMessage.error("加载配置失败");
435
427
  } finally {
@@ -467,7 +459,6 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
467
459
  });
468
460
  return (_ctx, _cache) => {
469
461
  const _component_el_container = ElContainer;
470
- const _directive_loading = vLoading;
471
462
  return openBlock(), createBlock(_component_el_container, {
472
463
  direction: "vertical",
473
464
  style: { "height": "100%" }
@@ -495,7 +486,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
495
486
  onClick: handleCustomBtnClick
496
487
  }, null, 8, ["custom-btns"])) : createCommentVNode("", true),
497
488
  createElementVNode("div", _hoisted_1, [
498
- withDirectives((openBlock(), createBlock(unref(VxeTable), {
489
+ createVNode(unref(VxeTable), {
499
490
  ref_key: "tableRef",
500
491
  ref: tableRef,
501
492
  data: displayData.value,
@@ -538,9 +529,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
538
529
  ];
539
530
  }),
540
531
  _: 3
541
- }, 8, ["data", "auto-resize", "height", "export-config"])), [
542
- [_directive_loading, loading.value]
543
- ])
532
+ }, 8, ["data", "auto-resize", "height", "export-config"])
544
533
  ]),
545
534
  isPagination.value ? (openBlock(), createBlock(Pagination, {
546
535
  key: 2,
@@ -555,7 +544,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
555
544
  };
556
545
  }
557
546
  });
558
- const Table = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-42f50d67"]]);
547
+ const Table = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-cb5d0f5a"]]);
559
548
  export {
560
549
  Table as default
561
550
  };
@@ -7,6 +7,7 @@ import { CopyDocument as copy_document_default } from "../../../../../node_modul
7
7
  import { checkFilterMatch } from "../../utils/parseFilterConfig.mjs";
8
8
  /* empty css */
9
9
  /* empty css */
10
+ /* empty css */
10
11
  /* empty css */
11
12
  /* empty css */
12
13
  /* empty css */
@@ -2,6 +2,7 @@ import { onUnmounted, onBeforeUnmount, onMounted } from "vue";
2
2
  /* empty css */
3
3
  /* empty css */
4
4
  /* empty css */
5
+ /* empty css */
5
6
  /* empty css */
6
7
  /* empty css */
7
8
  /* empty css */
@@ -3,6 +3,8 @@ import { parseRouteParams } from "./parseRouteParams.mjs";
3
3
  /* empty css */
4
4
  /* empty css */
5
5
  /* empty css */
6
+ /* empty css */
7
+ import { ElLoading } from "../../../../node_modules/.pnpm/element-plus@2.13.2_vue@3.5.13_typescript@5.7.3_/node_modules/element-plus/es/components/loading/index.mjs";
6
8
  import { ElMessage } from "../../../../node_modules/.pnpm/element-plus@2.13.2_vue@3.5.13_typescript@5.7.3_/node_modules/element-plus/es/components/message/index.mjs";
7
9
  class DataSourceManager {
8
10
  constructor(options = {}) {
@@ -25,6 +27,11 @@ class DataSourceManager {
25
27
  loaded: [],
26
28
  error: []
27
29
  };
30
+ this.LoadingInstance = {
31
+ target: null,
32
+ // 保存Loading实例
33
+ count: 0
34
+ };
28
35
  }
29
36
  /**
30
37
  * 获取当前数据源配置
@@ -122,6 +129,17 @@ class DataSourceManager {
122
129
  }
123
130
  this.loading = true;
124
131
  this.error = null;
132
+ this.LoadingInstance.count++;
133
+ if (this.LoadingInstance.count === 1) {
134
+ this.LoadingInstance.target = ElLoading.service({
135
+ fullscreen: true,
136
+ lock: true,
137
+ text: "拼命加载中",
138
+ // spinner: loadingSvg,
139
+ background: "rgba(0, 0, 0, 0)",
140
+ customClass: "h-loading"
141
+ });
142
+ }
125
143
  try {
126
144
  const params = this.buildRequestParams(extraParams);
127
145
  const requestConfig = this.getRequestConfig();
@@ -187,7 +205,7 @@ class DataSourceManager {
187
205
  this.emit("error", err);
188
206
  throw err;
189
207
  } finally {
190
- this.loading = false;
208
+ this.closeLoading();
191
209
  }
192
210
  }
193
211
  /**
@@ -270,6 +288,15 @@ class DataSourceManager {
270
288
  getLoading() {
271
289
  return this.loading;
272
290
  }
291
+ closeLoading() {
292
+ if (this.LoadingInstance.count > 0) {
293
+ this.LoadingInstance.count--;
294
+ }
295
+ if (this.LoadingInstance.count === 0 && this.LoadingInstance.target) {
296
+ this.LoadingInstance.target.close();
297
+ this.LoadingInstance.target = null;
298
+ }
299
+ }
273
300
  /**
274
301
  * 获取错误信息
275
302
  */
@@ -2,8 +2,6 @@ import { createDataSource } from "../datasource.mjs";
2
2
  import { parseRouteParams } from "../parseRouteParams.mjs";
3
3
  import { removeEmptyValues } from "../common.mjs";
4
4
  /* empty css */
5
- /* empty css */
6
- /* empty css */
7
5
  /* empty css */
8
6
  /* empty css */
9
7
  /* empty css */