sctj-components 1.0.37 → 1.0.39

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.
@@ -1,4 +1,4 @@
1
- import { computed as computed$1, resolveComponent, openBlock, createElementBlock, Fragment, renderList, unref, normalizeClass, toDisplayString, createBlock, withCtx, createTextVNode, createCommentVNode, createElementVNode, ref as ref$1, watch, mergeProps, createSlots, renderSlot, createVNode, TransitionGroup, useCssVars, withModifiers, normalizeStyle, nextTick, onMounted as onMounted$1, onUnmounted, isRef, withDirectives, vShow, onBeforeMount, getCurrentInstance, reactive, resolveDirective, toRefs, resolveDynamicComponent, withKeys, pushScopeId, popScopeId, useSlots, onBeforeUnmount, markRaw, shallowRef } from "vue";
1
+ import { computed as computed$1, resolveComponent, openBlock, createElementBlock, Fragment, renderList, unref, normalizeClass, toDisplayString, createBlock, withCtx, createTextVNode, createCommentVNode, createElementVNode, ref as ref$1, watch, mergeProps, createSlots, renderSlot, createVNode, TransitionGroup, useCssVars, withModifiers, normalizeStyle, nextTick, onMounted as onMounted$1, onUnmounted, isRef, withDirectives, vShow, onBeforeMount, getCurrentInstance, reactive, resolveDirective, toRefs, resolveDynamicComponent, withKeys, pushScopeId, popScopeId, shallowRef, useSlots, onBeforeUnmount, markRaw } from "vue";
2
2
  import VueOfficePdf from "@vue-office/pdf";
3
3
  import VueOfficeDocx from "@vue-office/docx";
4
4
  import VueOfficeExcel from "@vue-office/excel";
@@ -38,9 +38,9 @@ const _export_sfc = (sfc, props) => {
38
38
  }
39
39
  return target;
40
40
  };
41
- const _hoisted_1$k = { class: "dict-tag-container" };
41
+ const _hoisted_1$l = { class: "dict-tag-container" };
42
42
  const _hoisted_2$c = ["index"];
43
- const _sfc_main$q = {
43
+ const _sfc_main$r = {
44
44
  __name: "index",
45
45
  props: {
46
46
  options: {
@@ -60,7 +60,7 @@ const _sfc_main$q = {
60
60
  });
61
61
  return (_ctx, _cache) => {
62
62
  const _component_el_tag = resolveComponent("el-tag");
63
- return openBlock(), createElementBlock("div", _hoisted_1$k, [
63
+ return openBlock(), createElementBlock("div", _hoisted_1$l, [
64
64
  (openBlock(true), createElementBlock(Fragment, null, renderList(__props.options, (item, index2) => {
65
65
  return openBlock(), createElementBlock(Fragment, null, [
66
66
  unref(values).includes(item.value) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
@@ -87,10 +87,10 @@ const _sfc_main$q = {
87
87
  };
88
88
  }
89
89
  };
90
- const SCTJDictTag = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["__scopeId", "data-v-659e1d01"]]);
90
+ const SCTJDictTag = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["__scopeId", "data-v-659e1d01"]]);
91
91
  const index_vue_vue_type_style_index_0_scope_true_lang = "";
92
- const _hoisted_1$j = ["xlink:href", "fill"];
93
- const _sfc_main$p = {
92
+ const _hoisted_1$k = ["xlink:href", "fill"];
93
+ const _sfc_main$q = {
94
94
  __name: "index",
95
95
  props: {
96
96
  iconClass: {
@@ -123,7 +123,7 @@ const _sfc_main$p = {
123
123
  createElementVNode("use", {
124
124
  "xlink:href": unref(iconName),
125
125
  fill: __props.color
126
- }, null, 8, _hoisted_1$j)
126
+ }, null, 8, _hoisted_1$k)
127
127
  ], 2);
128
128
  };
129
129
  }
@@ -132,14 +132,14 @@ const index$2 = "";
132
132
  const index$1 = "";
133
133
  const index_vue_vue_type_style_index_0_scoped_006fbc77_lang = "";
134
134
  const index_vue_vue_type_style_index_1_lang = "";
135
- const _hoisted_1$i = { class: "upload-file" };
135
+ const _hoisted_1$j = { class: "upload-file" };
136
136
  const _hoisted_2$b = { class: "el-upload__tip" };
137
137
  const _hoisted_3$9 = { style: { "color": "#f56c6c" } };
138
138
  const _hoisted_4$7 = { style: { "color": "#f56c6c" } };
139
139
  const _hoisted_5$6 = ["title"];
140
140
  const _hoisted_6$3 = { class: "ele-upload-list__item-content-action" };
141
141
  const _hoisted_7$3 = { style: { "width": "100%", "height": "100%", "overflow": "auto" } };
142
- const _sfc_main$o = {
142
+ const _sfc_main$p = {
143
143
  __name: "index",
144
144
  props: {
145
145
  modelValue: [String, Object, Array],
@@ -371,7 +371,7 @@ const _sfc_main$o = {
371
371
  const _component_el_icon = resolveComponent("el-icon");
372
372
  const _component_el_image = resolveComponent("el-image");
373
373
  const _component_el_dialog = resolveComponent("el-dialog");
374
- return openBlock(), createElementBlock("div", _hoisted_1$i, [
374
+ return openBlock(), createElementBlock("div", _hoisted_1$j, [
375
375
  !__props.disabled ? (openBlock(), createBlock(_component_el_upload, mergeProps({
376
376
  key: 0,
377
377
  multiple: "",
@@ -517,9 +517,9 @@ const _sfc_main$o = {
517
517
  };
518
518
  }
519
519
  };
520
- const SCTJFileUpload = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["__scopeId", "data-v-006fbc77"]]);
520
+ const SCTJFileUpload = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__scopeId", "data-v-006fbc77"]]);
521
521
  const index_vue_vue_type_style_index_0_scoped_672e5149_lang = "";
522
- const _hoisted_1$h = { class: "component-upload-image" };
522
+ const _hoisted_1$i = { class: "component-upload-image" };
523
523
  const _hoisted_2$a = {
524
524
  key: 0,
525
525
  class: "el-upload__tip"
@@ -527,7 +527,7 @@ const _hoisted_2$a = {
527
527
  const _hoisted_3$8 = { style: { "color": "#f56c6c" } };
528
528
  const _hoisted_4$6 = { style: { "color": "#f56c6c" } };
529
529
  const _hoisted_5$5 = ["src"];
530
- const _sfc_main$n = {
530
+ const _sfc_main$o = {
531
531
  __name: "index",
532
532
  props: {
533
533
  modelValue: {
@@ -728,7 +728,7 @@ const _sfc_main$n = {
728
728
  const _component_el_icon = resolveComponent("el-icon");
729
729
  const _component_el_upload = resolveComponent("el-upload");
730
730
  const _component_el_dialog = resolveComponent("el-dialog");
731
- return openBlock(), createElementBlock("div", _hoisted_1$h, [
731
+ return openBlock(), createElementBlock("div", _hoisted_1$i, [
732
732
  createVNode(_component_el_upload, mergeProps({
733
733
  disabled: props.disabled,
734
734
  multiple: "",
@@ -791,10 +791,10 @@ const _sfc_main$n = {
791
791
  };
792
792
  }
793
793
  };
794
- const SCTJImageUpload = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-672e5149"]]);
794
+ const SCTJImageUpload = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["__scopeId", "data-v-672e5149"]]);
795
795
  const index_vue_vue_type_style_index_0_scoped_e91fd2ba_lang = "";
796
- const _hoisted_1$g = { class: "image-slot" };
797
- const _sfc_main$m = {
796
+ const _hoisted_1$h = { class: "image-slot" };
797
+ const _sfc_main$n = {
798
798
  __name: "index",
799
799
  props: {
800
800
  enableDelete: {
@@ -908,7 +908,7 @@ const _sfc_main$m = {
908
908
  "preview-src-list": unref(realSrcList)
909
909
  }, {
910
910
  error: withCtx(() => [
911
- createElementVNode("div", _hoisted_1$g, [
911
+ createElementVNode("div", _hoisted_1$h, [
912
912
  createVNode(_component_el_icon, { class: "el-icon-picture-outline" }, {
913
913
  default: withCtx(() => [
914
914
  createVNode(unref(Picture))
@@ -925,7 +925,7 @@ const _sfc_main$m = {
925
925
  };
926
926
  }
927
927
  };
928
- const SCTJImagePreview = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-e91fd2ba"]]);
928
+ const SCTJImagePreview = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-e91fd2ba"]]);
929
929
  const icons = [
930
930
  "404",
931
931
  "bug",
@@ -1014,10 +1014,10 @@ const icons = [
1014
1014
  "zip"
1015
1015
  ];
1016
1016
  const index_vue_vue_type_style_index_0_scoped_37029e19_lang = "";
1017
- const _hoisted_1$f = { class: "icon-content" };
1017
+ const _hoisted_1$g = { class: "icon-content" };
1018
1018
  const _hoisted_2$9 = { class: "icon-list" };
1019
1019
  const _hoisted_3$7 = ["onClick"];
1020
- const _sfc_main$l = {
1020
+ const _sfc_main$m = {
1021
1021
  __name: "index",
1022
1022
  props: {
1023
1023
  modelValue: {
@@ -1108,12 +1108,12 @@ const _sfc_main$l = {
1108
1108
  unref(iconName) ? {
1109
1109
  name: "prefix",
1110
1110
  fn: withCtx(() => [
1111
- createVNode(_sfc_main$p, { "icon-class": unref(iconName) }, null, 8, ["icon-class"])
1111
+ createVNode(_sfc_main$q, { "icon-class": unref(iconName) }, null, 8, ["icon-class"])
1112
1112
  ]),
1113
1113
  key: "0"
1114
1114
  } : void 0
1115
1115
  ]), 1032, ["modelValue"]),
1116
- withDirectives(createElementVNode("div", _hoisted_1$f, [
1116
+ withDirectives(createElementVNode("div", _hoisted_1$g, [
1117
1117
  createElementVNode("div", null, [
1118
1118
  createVNode(_component_el_input, {
1119
1119
  modelValue: keyWord.value,
@@ -1141,7 +1141,7 @@ const _sfc_main$l = {
1141
1141
  key: index2,
1142
1142
  onClick: ($event) => selectedIcon(item)
1143
1143
  }, [
1144
- createVNode(_sfc_main$p, {
1144
+ createVNode(_sfc_main$q, {
1145
1145
  "icon-class": item,
1146
1146
  style: { "height": "30px", "width": "16px", "flex-shrink": "0" }
1147
1147
  }, null, 8, ["icon-class"]),
@@ -1156,7 +1156,7 @@ const _sfc_main$l = {
1156
1156
  };
1157
1157
  }
1158
1158
  };
1159
- const SCTJIconSelect = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__scopeId", "data-v-37029e19"]]);
1159
+ const SCTJIconSelect = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-37029e19"]]);
1160
1160
  function useMobile() {
1161
1161
  const isMobile = ref$1(false);
1162
1162
  const checkIsMobile = () => {
@@ -1183,7 +1183,7 @@ function useMobile() {
1183
1183
  checkIsMobile
1184
1184
  };
1185
1185
  }
1186
- const _sfc_main$k = {
1186
+ const _sfc_main$l = {
1187
1187
  __name: "index",
1188
1188
  props: {
1189
1189
  modelValue: {
@@ -1288,8 +1288,8 @@ const _sfc_main$k = {
1288
1288
  }
1289
1289
  };
1290
1290
  const index_vue_vue_type_style_index_0_scoped_a2fe1763_lang = "";
1291
- const _hoisted_1$e = { class: "el-tree-select" };
1292
- const _sfc_main$j = {
1291
+ const _hoisted_1$f = { class: "el-tree-select" };
1292
+ const _sfc_main$k = {
1293
1293
  __name: "index",
1294
1294
  props: {
1295
1295
  objMap: {
@@ -1383,7 +1383,7 @@ const _sfc_main$j = {
1383
1383
  const _component_el_tree = resolveComponent("el-tree");
1384
1384
  const _component_el_option = resolveComponent("el-option");
1385
1385
  const _component_el_select = resolveComponent("el-select");
1386
- return openBlock(), createElementBlock("div", _hoisted_1$e, [
1386
+ return openBlock(), createElementBlock("div", _hoisted_1$f, [
1387
1387
  createVNode(_component_el_select, {
1388
1388
  style: { "width": "100%" },
1389
1389
  modelValue: unref(valueId),
@@ -1423,14 +1423,14 @@ const _sfc_main$j = {
1423
1423
  };
1424
1424
  }
1425
1425
  };
1426
- const SCTJTreeSelect = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__scopeId", "data-v-a2fe1763"]]);
1427
- const index_vue_vue_type_style_index_0_scoped_8906f38f_lang = "";
1428
- const _hoisted_1$d = { class: "table-container" };
1429
- const _sfc_main$i = {
1426
+ const SCTJTreeSelect = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-v-a2fe1763"]]);
1427
+ const index_vue_vue_type_style_index_0_scoped_97e81d7d_lang = "";
1428
+ const _hoisted_1$e = { class: "table-container" };
1429
+ const _sfc_main$j = {
1430
1430
  __name: "index",
1431
1431
  props: {
1432
1432
  request: {
1433
- type: Function,
1433
+ type: [Function, String],
1434
1434
  default: () => {
1435
1435
  }
1436
1436
  },
@@ -1513,6 +1513,10 @@ const _sfc_main$i = {
1513
1513
  height: {
1514
1514
  type: String,
1515
1515
  default: "100%"
1516
+ },
1517
+ headers: {
1518
+ type: Object,
1519
+ default: () => ({})
1516
1520
  }
1517
1521
  },
1518
1522
  emits: ["selectionChange", "sortChange", "requestSuccess", "cellEnter", "cellLeave"],
@@ -1629,9 +1633,16 @@ const _sfc_main$i = {
1629
1633
  var _a;
1630
1634
  try {
1631
1635
  loading.value = true;
1632
- const res = await props.request({
1636
+ const res = typeof props.request == "function" ? await props.request({
1633
1637
  ...page,
1634
1638
  ...props.requestParams
1639
+ }) : await fetch(props.request, {
1640
+ method: "GET",
1641
+ params: {
1642
+ ...page,
1643
+ ...props.requestParams
1644
+ },
1645
+ headers: props.headers || {}
1635
1646
  });
1636
1647
  baseData.value = res == null ? void 0 : res[realResponseConfig.value.list];
1637
1648
  tableData.value = props.handleList ? props.handleList(res == null ? void 0 : res[realResponseConfig.value.list]) : res == null ? void 0 : res[realResponseConfig.value.list];
@@ -1666,7 +1677,7 @@ const _sfc_main$i = {
1666
1677
  class: "TJ-table-container",
1667
1678
  style: normalizeStyle({ height: __props.height })
1668
1679
  }, [
1669
- createElementVNode("div", _hoisted_1$d, [
1680
+ createElementVNode("div", _hoisted_1$e, [
1670
1681
  createVNode(_component_el_table, mergeProps({
1671
1682
  ref_key: "tableRef",
1672
1683
  ref: tableRef,
@@ -1746,18 +1757,18 @@ const _sfc_main$i = {
1746
1757
  };
1747
1758
  }
1748
1759
  };
1749
- const SCTJTable = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-8906f38f"]]);
1760
+ const SCTJTable = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__scopeId", "data-v-97e81d7d"]]);
1750
1761
  const index_vue_vue_type_style_index_0_scoped_45fb95db_lang = "";
1751
- const _sfc_main$h = {};
1752
- const _hoisted_1$c = { class: "table-container" };
1762
+ const _sfc_main$i = {};
1763
+ const _hoisted_1$d = { class: "table-container" };
1753
1764
  function _sfc_render(_ctx, _cache) {
1754
- return openBlock(), createElementBlock("div", _hoisted_1$c, [
1765
+ return openBlock(), createElementBlock("div", _hoisted_1$d, [
1755
1766
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
1756
1767
  ]);
1757
1768
  }
1758
- const SCTJTableContainer = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", _sfc_render], ["__scopeId", "data-v-45fb95db"]]);
1769
+ const SCTJTableContainer = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render", _sfc_render], ["__scopeId", "data-v-45fb95db"]]);
1759
1770
  const index_vue_vue_type_style_index_0_scoped_46df4461_lang = "";
1760
- const _sfc_main$g = {
1771
+ const _sfc_main$h = {
1761
1772
  __name: "index",
1762
1773
  props: {
1763
1774
  showSearch: {
@@ -1901,10 +1912,10 @@ const _sfc_main$g = {
1901
1912
  };
1902
1913
  }
1903
1914
  };
1904
- const SCTJRightToolbar = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-46df4461"]]);
1915
+ const SCTJRightToolbar = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-46df4461"]]);
1905
1916
  const index_vue_vue_type_style_index_0_scoped_056cfdde_lang = "";
1906
- const _hoisted_1$b = { class: "table-top-action-container" };
1907
- const _sfc_main$f = {
1917
+ const _hoisted_1$c = { class: "table-top-action-container" };
1918
+ const _sfc_main$g = {
1908
1919
  __name: "index",
1909
1920
  props: {
1910
1921
  showSearch: {
@@ -1931,7 +1942,7 @@ const _sfc_main$f = {
1931
1942
  emit("refresh");
1932
1943
  };
1933
1944
  return (_ctx, _cache) => {
1934
- return openBlock(), createElementBlock("div", _hoisted_1$b, [
1945
+ return openBlock(), createElementBlock("div", _hoisted_1$c, [
1935
1946
  renderSlot(_ctx.$slots, "left", {}, void 0, true),
1936
1947
  renderSlot(_ctx.$slots, "right", {}, () => [
1937
1948
  createVNode(SCTJRightToolbar, {
@@ -1945,10 +1956,10 @@ const _sfc_main$f = {
1945
1956
  };
1946
1957
  }
1947
1958
  };
1948
- const SCTJTableTopActionContainer = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-056cfdde"]]);
1949
- const index_vue_vue_type_style_index_0_scoped_d913f5c9_lang = "";
1950
- const _withScopeId$4 = (n) => (pushScopeId("data-v-d913f5c9"), n = n(), popScopeId(), n);
1951
- const _hoisted_1$a = {
1959
+ const SCTJTableTopActionContainer = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-056cfdde"]]);
1960
+ const index_vue_vue_type_style_index_0_scoped_a452313a_lang = "";
1961
+ const _withScopeId$4 = (n) => (pushScopeId("data-v-a452313a"), n = n(), popScopeId(), n);
1962
+ const _hoisted_1$b = {
1952
1963
  key: 0,
1953
1964
  class: "search-container"
1954
1965
  };
@@ -1962,7 +1973,7 @@ const _hoisted_5$4 = /* @__PURE__ */ _withScopeId$4(() => /* @__PURE__ */ create
1962
1973
  const _hoisted_6$2 = { class: "tag-container" };
1963
1974
  const _hoisted_7$2 = { class: "tag-name" };
1964
1975
  const _hoisted_8$2 = { class: "dialog-footer" };
1965
- const _sfc_main$e = {
1976
+ const _sfc_main$f = {
1966
1977
  __name: "index",
1967
1978
  props: {
1968
1979
  mode: {
@@ -1997,9 +2008,15 @@ const _sfc_main$e = {
1997
2008
  default: ""
1998
2009
  },
1999
2010
  request: {
2000
- type: Function,
2011
+ type: [Function, String],
2012
+ default: () => {
2013
+ },
2001
2014
  required: true
2002
2015
  },
2016
+ headers: {
2017
+ type: Object,
2018
+ default: () => ({})
2019
+ },
2003
2020
  selectOptions: {
2004
2021
  type: Object,
2005
2022
  default: () => ({
@@ -2099,7 +2116,13 @@ const _sfc_main$e = {
2099
2116
  var _a, _b;
2100
2117
  try {
2101
2118
  loading.value = true;
2102
- let res = await props.request(queryParams.value);
2119
+ let res = typeof props.request == "function" ? await props.request(queryParams.value) : await fetch(props.request, {
2120
+ method: "GET",
2121
+ params: {
2122
+ ...queryParams.value
2123
+ },
2124
+ headers: props.headers || {}
2125
+ });
2103
2126
  if (res.code !== 200)
2104
2127
  return;
2105
2128
  dataList.value = (_b = (_a = res == null ? void 0 : res.rows) != null ? _a : res.data) != null ? _b : [];
@@ -2226,7 +2249,7 @@ const _sfc_main$e = {
2226
2249
  ])
2227
2250
  ]),
2228
2251
  default: withCtx(() => [
2229
- unref(queryColumns).length ? (openBlock(), createElementBlock("div", _hoisted_1$a, [
2252
+ unref(queryColumns).length ? (openBlock(), createElementBlock("div", _hoisted_1$b, [
2230
2253
  createVNode(_component_el_card, { shadow: "hover" }, {
2231
2254
  default: withCtx(() => [
2232
2255
  createVNode(_component_el_form, {
@@ -2454,7 +2477,357 @@ const _sfc_main$e = {
2454
2477
  };
2455
2478
  }
2456
2479
  };
2457
- const SCTJDialogTable = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-d913f5c9"]]);
2480
+ const SCTJDialogTable = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-a452313a"]]);
2481
+ const index_vue_vue_type_style_index_0_scoped_80cb4921_lang = "";
2482
+ const _hoisted_1$a = { style: { "background": "#fff" } };
2483
+ const _sfc_main$e = {
2484
+ __name: "index",
2485
+ props: {
2486
+ tableData: {
2487
+ type: Array,
2488
+ default: () => []
2489
+ },
2490
+ showPagination: {
2491
+ type: Boolean,
2492
+ default: true
2493
+ },
2494
+ total: {
2495
+ type: Number,
2496
+ default: 0
2497
+ },
2498
+ stripe: {
2499
+ type: Boolean,
2500
+ default: true
2501
+ },
2502
+ currentPage: {
2503
+ type: Number,
2504
+ default: 1
2505
+ },
2506
+ pageSize: {
2507
+ type: Number,
2508
+ default: 5
2509
+ },
2510
+ loading: {
2511
+ type: Boolean,
2512
+ default: false
2513
+ },
2514
+ autoScroll: {
2515
+ type: Boolean,
2516
+ default: false
2517
+ },
2518
+ scrollSpeed: {
2519
+ type: Number,
2520
+ default: 50
2521
+ },
2522
+ scrollStep: {
2523
+ type: [Number, null],
2524
+ default: null
2525
+ },
2526
+ pauseOnHover: {
2527
+ type: Boolean,
2528
+ default: true
2529
+ },
2530
+ tableHeight: {
2531
+ type: [String, Number],
2532
+ default: 300
2533
+ },
2534
+ debug: {
2535
+ type: Boolean,
2536
+ default: false
2537
+ },
2538
+ summaryMethod: {
2539
+ type: Function
2540
+ },
2541
+ showSummary: {
2542
+ type: Boolean,
2543
+ default: false
2544
+ }
2545
+ },
2546
+ emits: ["query", "sortChange", "update:currentPage", "update:pageSize"],
2547
+ setup(__props, { expose, emit }) {
2548
+ const props = __props;
2549
+ const { isMobile } = useMobile();
2550
+ const tableRef = ref$1(null);
2551
+ const isHovered = ref$1(false);
2552
+ const scrollContainer = ref$1(null);
2553
+ const canAutoScroll = ref$1(false);
2554
+ const tableBodyWrapper = shallowRef(null);
2555
+ const animationFrameId = ref$1(null);
2556
+ const lastScrollTime = ref$1(0);
2557
+ const scrollMetrics = ref$1({
2558
+ scrollHeight: 0,
2559
+ clientHeight: 0,
2560
+ isScrollable: false
2561
+ });
2562
+ const current = computed$1({
2563
+ get() {
2564
+ return props.currentPage;
2565
+ },
2566
+ set(val) {
2567
+ emit("update:currentPage", val);
2568
+ }
2569
+ });
2570
+ const size = computed$1({
2571
+ get() {
2572
+ return props.pageSize;
2573
+ },
2574
+ set(val) {
2575
+ emit("update:pageSize", val);
2576
+ }
2577
+ });
2578
+ const getTableData = () => {
2579
+ emit("query");
2580
+ };
2581
+ const debounce = (func, wait) => {
2582
+ let timeout;
2583
+ return function executedFunction(...args) {
2584
+ const later = () => {
2585
+ clearTimeout(timeout);
2586
+ func(...args);
2587
+ };
2588
+ clearTimeout(timeout);
2589
+ timeout = setTimeout(later, wait);
2590
+ };
2591
+ };
2592
+ const debugLog = (message, data) => {
2593
+ };
2594
+ const getScrollContainer = () => {
2595
+ if (!tableBodyWrapper.value && scrollContainer.value) {
2596
+ tableBodyWrapper.value = scrollContainer.value.querySelector(".el-scrollbar__wrap");
2597
+ }
2598
+ return tableBodyWrapper.value;
2599
+ };
2600
+ const getScrollStep = () => {
2601
+ var _a;
2602
+ if (props.scrollStep)
2603
+ return props.scrollStep;
2604
+ if (scrollContainer.value) {
2605
+ let cell = scrollContainer.value.querySelector("td");
2606
+ return (_a = cell == null ? void 0 : cell.clientHeight) != null ? _a : 33;
2607
+ }
2608
+ };
2609
+ const updateScrollMetrics = () => {
2610
+ const wrapper = getScrollContainer();
2611
+ if (!wrapper)
2612
+ return false;
2613
+ const scrollHeight = wrapper.scrollHeight;
2614
+ const clientHeight = wrapper.clientHeight;
2615
+ const isScrollable = scrollHeight > clientHeight;
2616
+ if (scrollMetrics.value.scrollHeight !== scrollHeight || scrollMetrics.value.clientHeight !== clientHeight) {
2617
+ scrollMetrics.value = {
2618
+ scrollHeight,
2619
+ clientHeight,
2620
+ isScrollable
2621
+ };
2622
+ }
2623
+ return isScrollable;
2624
+ };
2625
+ const checkScrollable = () => {
2626
+ if (props.tableData.length === 0) {
2627
+ canAutoScroll.value = false;
2628
+ return false;
2629
+ }
2630
+ const isScrollable = updateScrollMetrics();
2631
+ canAutoScroll.value = isScrollable;
2632
+ return isScrollable;
2633
+ };
2634
+ const sortChange = (column) => {
2635
+ emit("sortChange", column);
2636
+ };
2637
+ const handleMouseEnter = () => {
2638
+ if (props.pauseOnHover) {
2639
+ isHovered.value = true;
2640
+ stopAutoScroll();
2641
+ }
2642
+ };
2643
+ const handleMouseLeave = () => {
2644
+ if (props.pauseOnHover) {
2645
+ isHovered.value = false;
2646
+ if (props.autoScroll && canAutoScroll.value) {
2647
+ startAutoScroll();
2648
+ }
2649
+ }
2650
+ };
2651
+ const scrollAnimation = (timestamp) => {
2652
+ if (!props.autoScroll || isHovered.value && props.pauseOnHover) {
2653
+ animationFrameId.value = null;
2654
+ return;
2655
+ }
2656
+ if (timestamp - lastScrollTime.value < props.scrollSpeed) {
2657
+ animationFrameId.value = requestAnimationFrame(scrollAnimation);
2658
+ return;
2659
+ }
2660
+ lastScrollTime.value = timestamp;
2661
+ const wrapper = getScrollContainer();
2662
+ if (!wrapper) {
2663
+ stopAutoScroll();
2664
+ return;
2665
+ }
2666
+ const scrollStep = getScrollStep();
2667
+ const currentScrollTop = wrapper.scrollTop;
2668
+ const { scrollHeight, clientHeight } = scrollMetrics.value;
2669
+ const newScrollTop = currentScrollTop + scrollStep;
2670
+ const maxScrollTop = scrollHeight - clientHeight;
2671
+ if (newScrollTop >= maxScrollTop) {
2672
+ wrapper.scrollTop = 0;
2673
+ } else {
2674
+ wrapper.scrollTop = newScrollTop;
2675
+ }
2676
+ animationFrameId.value = requestAnimationFrame(scrollAnimation);
2677
+ };
2678
+ const startAutoScroll = () => {
2679
+ debugLog("startAutoScroll \u88AB\u8C03\u7528", {
2680
+ hasAnimation: !!animationFrameId.value,
2681
+ autoScroll: props.autoScroll,
2682
+ loading: props.loading,
2683
+ canAutoScroll: canAutoScroll.value
2684
+ });
2685
+ if (animationFrameId.value || !props.autoScroll || props.loading || !canAutoScroll.value) {
2686
+ return;
2687
+ }
2688
+ lastScrollTime.value = 0;
2689
+ animationFrameId.value = requestAnimationFrame(scrollAnimation);
2690
+ };
2691
+ const stopAutoScroll = () => {
2692
+ if (animationFrameId.value) {
2693
+ cancelAnimationFrame(animationFrameId.value);
2694
+ animationFrameId.value = null;
2695
+ }
2696
+ };
2697
+ const debouncedDataUpdate = debounce(() => {
2698
+ tableBodyWrapper.value = null;
2699
+ if (checkScrollable() && props.autoScroll && !props.loading) {
2700
+ startAutoScroll();
2701
+ } else {
2702
+ stopAutoScroll();
2703
+ }
2704
+ }, 150);
2705
+ watch(() => props.autoScroll, (newVal) => {
2706
+ if (newVal && canAutoScroll.value) {
2707
+ nextTick(() => {
2708
+ startAutoScroll();
2709
+ });
2710
+ } else {
2711
+ stopAutoScroll();
2712
+ }
2713
+ });
2714
+ watch(() => props.tableData.length, () => {
2715
+ debugLog("\u6570\u636E\u957F\u5EA6\u53D8\u5316", { length: props.tableData.length });
2716
+ debouncedDataUpdate();
2717
+ });
2718
+ watch(() => props.loading, (newVal) => {
2719
+ if (newVal) {
2720
+ stopAutoScroll();
2721
+ } else if (props.autoScroll && canAutoScroll.value) {
2722
+ nextTick(() => {
2723
+ startAutoScroll();
2724
+ });
2725
+ }
2726
+ });
2727
+ onMounted$1(() => {
2728
+ nextTick(() => {
2729
+ var _a;
2730
+ scrollContainer.value = (_a = tableRef.value) == null ? void 0 : _a.$el;
2731
+ debugLog("scrollContainer \u8BBE\u7F6E\u5B8C\u6210", !!scrollContainer.value);
2732
+ const initializeScroll = () => {
2733
+ if (checkScrollable()) {
2734
+ if (props.autoScroll && !props.loading) {
2735
+ startAutoScroll();
2736
+ }
2737
+ }
2738
+ };
2739
+ setTimeout(initializeScroll, 100);
2740
+ });
2741
+ });
2742
+ onUnmounted(() => {
2743
+ var _a;
2744
+ stopAutoScroll();
2745
+ (_a = debouncedDataUpdate.cancel) == null ? void 0 : _a.call(debouncedDataUpdate);
2746
+ });
2747
+ expose({
2748
+ startAutoScroll,
2749
+ stopAutoScroll,
2750
+ checkScrollable,
2751
+ scrollToTop: () => {
2752
+ const wrapper = getScrollContainer();
2753
+ if (wrapper) {
2754
+ wrapper.scrollTop = 0;
2755
+ }
2756
+ },
2757
+ recheckAndStart: () => {
2758
+ tableBodyWrapper.value = null;
2759
+ if (checkScrollable() && props.autoScroll && !props.loading) {
2760
+ startAutoScroll();
2761
+ } else {
2762
+ stopAutoScroll();
2763
+ }
2764
+ }
2765
+ });
2766
+ return (_ctx, _cache) => {
2767
+ const _component_el_table = resolveComponent("el-table");
2768
+ const _component_el_pagination = resolveComponent("el-pagination");
2769
+ const _directive_loading = resolveDirective("loading");
2770
+ return openBlock(), createElementBlock("div", _hoisted_1$a, [
2771
+ withDirectives((openBlock(), createBlock(_component_el_table, mergeProps({
2772
+ size: unref(isMobile) ? "small" : "default",
2773
+ ref_key: "tableRef",
2774
+ ref: tableRef,
2775
+ data: props.tableData,
2776
+ height: __props.tableHeight,
2777
+ "max-height": __props.tableHeight,
2778
+ "highlight-current-row": false,
2779
+ onSortChange: sortChange,
2780
+ onMouseenter: handleMouseEnter,
2781
+ onMouseleave: handleMouseLeave,
2782
+ stripe: __props.stripe,
2783
+ showSummary: __props.showSummary,
2784
+ "summary-method": __props.summaryMethod,
2785
+ "cell-class-name": "cell-class-name",
2786
+ "header-row-class-name": "header-row-class-name",
2787
+ "row-class-name": "row-class-name"
2788
+ }, _ctx.$attrs), {
2789
+ default: withCtx(() => [
2790
+ renderSlot(_ctx.$slots, "default", {}, void 0, true)
2791
+ ]),
2792
+ _: 3
2793
+ }, 16, ["size", "data", "height", "max-height", "stripe", "showSummary", "summary-method"])), [
2794
+ [_directive_loading, __props.loading]
2795
+ ]),
2796
+ __props.showPagination && __props.total > 0 ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
2797
+ !unref(isMobile) ? (openBlock(), createBlock(_component_el_pagination, {
2798
+ key: 0,
2799
+ class: "pagination",
2800
+ background: "",
2801
+ onSizeChange: getTableData,
2802
+ onCurrentChange: getTableData,
2803
+ layout: "total, prev, pager, next",
2804
+ total: __props.total,
2805
+ "page-size": unref(size),
2806
+ "onUpdate:page-size": _cache[0] || (_cache[0] = ($event) => isRef(size) ? size.value = $event : null),
2807
+ "current-page": unref(current),
2808
+ "onUpdate:current-page": _cache[1] || (_cache[1] = ($event) => isRef(current) ? current.value = $event : null),
2809
+ small: ""
2810
+ }, null, 8, ["total", "page-size", "current-page"])) : (openBlock(), createBlock(_component_el_pagination, {
2811
+ key: 1,
2812
+ class: "pagination mobile-pagination",
2813
+ background: "",
2814
+ onSizeChange: getTableData,
2815
+ onCurrentChange: getTableData,
2816
+ layout: "total, prev, pager, next",
2817
+ total: __props.total,
2818
+ "page-size": unref(size),
2819
+ "onUpdate:page-size": _cache[2] || (_cache[2] = ($event) => isRef(size) ? size.value = $event : null),
2820
+ "current-page": unref(current),
2821
+ "onUpdate:current-page": _cache[3] || (_cache[3] = ($event) => isRef(current) ? current.value = $event : null),
2822
+ "pager-count": 5,
2823
+ small: ""
2824
+ }, null, 8, ["total", "page-size", "current-page"]))
2825
+ ], 64)) : createCommentVNode("", true)
2826
+ ]);
2827
+ };
2828
+ }
2829
+ };
2830
+ const SCTJScrollTable = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-80cb4921"]]);
2458
2831
  const _sfc_main$d = {
2459
2832
  __name: "index",
2460
2833
  setup(__props) {
@@ -9097,13 +9470,13 @@ const SCTJDwgViewer = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "dat
9097
9470
  const components = [
9098
9471
  { component: SCTJDictTag, name: "SCTJDictTag" },
9099
9472
  { component: SCTJTreeSelect, name: "SCTJTreeSelect" },
9100
- { component: _sfc_main$p, name: "SCTJIcon" },
9473
+ { component: _sfc_main$q, name: "SCTJIcon" },
9101
9474
  { component: SCTJFileUpload, name: "SCTJFileUpload" },
9102
9475
  { component: SCTJImageUpload, name: "SCTJImageUpload" },
9103
9476
  { component: SCTJImagePreview, name: "SCTJImagePreview" },
9104
9477
  { component: SCTJIconSelect, name: "SCTJIconSelect" },
9105
9478
  { component: SCTJSearch, name: "SCTJSearch" },
9106
- { component: _sfc_main$k, name: "SCTJDateRangePicker" },
9479
+ { component: _sfc_main$l, name: "SCTJDateRangePicker" },
9107
9480
  { component: SCTJTable, name: "SCTJTable" },
9108
9481
  { component: SCTJTableContainer, name: "SCTJTableContainer" },
9109
9482
  { component: SCTJTablePageContainer, name: "SCTJTablePageContainer" },
@@ -9117,6 +9490,7 @@ const components = [
9117
9490
  { component: _sfc_main$6, name: "SCTJIframe" },
9118
9491
  { component: _sfc_main$5, name: "SCTJImportDialog" },
9119
9492
  { component: SCTJDialogTable, name: "SCTJDialogTable" },
9493
+ { component: SCTJScrollTable, name: "SCTJScrollTable" },
9120
9494
  { component: SCTJMapViewer, name: "SCTJMapViewer" },
9121
9495
  { component: SCTJMapDrawingDialog, name: "SCTJMapDrawingDialog" },
9122
9496
  { component: SCTJBusinessMapDrawingDialog, name: "SCTJBusinessMapDrawingDialog" },
@@ -9132,13 +9506,13 @@ const index = {
9132
9506
  install,
9133
9507
  SCTJDictTag,
9134
9508
  SCTJTreeSelect,
9135
- SCTJIcon: _sfc_main$p,
9509
+ SCTJIcon: _sfc_main$q,
9136
9510
  SCTJFileUpload,
9137
9511
  SCTJImageUpload,
9138
9512
  SCTJImagePreview,
9139
9513
  SCTJIconSelect,
9140
9514
  SCTJSearch,
9141
- SCTJDateRangePicker: _sfc_main$k,
9515
+ SCTJDateRangePicker: _sfc_main$l,
9142
9516
  SCTJTable,
9143
9517
  SCTJTableContainer,
9144
9518
  SCTJTablePageContainer,
@@ -9152,6 +9526,7 @@ const index = {
9152
9526
  SCTJIframe: _sfc_main$6,
9153
9527
  SCTJImportDialog: _sfc_main$5,
9154
9528
  SCTJDialogTable,
9529
+ SCTJScrollTable,
9155
9530
  SCTJMapViewer,
9156
9531
  SCTJMapDrawingDialog,
9157
9532
  SCTJBusinessMapDrawingDialog,
@@ -9164,13 +9539,13 @@ export {
9164
9539
  _sfc_main$d as SCTJBtnContainer,
9165
9540
  SCTJBusinessMapDrawingDialog,
9166
9541
  SCTJCommonChart,
9167
- _sfc_main$k as SCTJDateRangePicker,
9542
+ _sfc_main$l as SCTJDateRangePicker,
9168
9543
  SCTJDialogTable,
9169
9544
  SCTJDictTag,
9170
9545
  SCTJDwgViewer,
9171
9546
  SCTJFileUpload,
9172
9547
  SCTJFlvPlayer,
9173
- _sfc_main$p as SCTJIcon,
9548
+ _sfc_main$q as SCTJIcon,
9174
9549
  SCTJIconSelect,
9175
9550
  _sfc_main$6 as SCTJIframe,
9176
9551
  SCTJImagePreview,
@@ -9180,6 +9555,7 @@ export {
9180
9555
  SCTJMapViewer,
9181
9556
  SCTJPieChart,
9182
9557
  SCTJRightToolbar,
9558
+ SCTJScrollTable,
9183
9559
  SCTJSearch,
9184
9560
  SCTJTable,
9185
9561
  SCTJTableContainer,