el-plus 0.0.17 → 0.0.19

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 (144) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/index.css +1 -1
  3. package/dist/index.full.js +241 -115
  4. package/dist/index.full.min.js +1 -1
  5. package/dist/index.full.min.js.map +1 -1
  6. package/dist/index.full.min.mjs +1 -1
  7. package/dist/index.full.min.mjs.map +1 -1
  8. package/dist/index.full.mjs +240 -115
  9. package/es/components/date-picker-range/index.d.ts +3 -3
  10. package/es/components/date-picker-range/src/date-picker-range.vue.d.ts +1 -1
  11. package/es/components/form/src/form-item-vue.d.ts +2 -2
  12. package/es/components/form/src/form-item.d.ts +1 -1
  13. package/es/components/form/src/form-item.mjs.map +1 -1
  14. package/es/components/form/src/hooks/use-form-item.mjs +3 -1
  15. package/es/components/form/src/hooks/use-form-item.mjs.map +1 -1
  16. package/es/components/index.d.ts +1 -0
  17. package/es/components/index.mjs +2 -0
  18. package/es/components/index.mjs.map +1 -1
  19. package/es/components/input/style/css.d.ts +1 -1
  20. package/es/components/input/style/css.mjs +1 -1
  21. package/es/components/input/style/index.d.ts +1 -1
  22. package/es/components/input/style/index.mjs +1 -1
  23. package/es/components/link/index.d.ts +118 -0
  24. package/es/components/link/index.mjs +8 -0
  25. package/es/components/link/index.mjs.map +1 -0
  26. package/es/components/link/src/link.d.ts +30 -0
  27. package/es/components/link/src/link.mjs +19 -0
  28. package/es/components/link/src/link.mjs.map +1 -0
  29. package/es/components/link/src/link.vue.d.ts +73 -0
  30. package/es/components/link/src/link.vue.mjs +6 -0
  31. package/es/components/link/src/link.vue.mjs.map +1 -0
  32. package/es/components/link/src/link.vue2.mjs +52 -0
  33. package/es/components/link/src/link.vue2.mjs.map +1 -0
  34. package/es/components/link/style/css.d.ts +2 -0
  35. package/es/components/link/style/css.mjs +5 -0
  36. package/es/components/link/style/css.mjs.map +1 -0
  37. package/es/components/link/style/index.d.ts +2 -0
  38. package/es/components/link/style/index.mjs +5 -0
  39. package/es/components/link/style/index.mjs.map +1 -0
  40. package/es/components/search-list-page/index.d.ts +51 -30
  41. package/es/components/search-list-page/src/search-list-page.d.ts +1 -1
  42. package/es/components/search-list-page/src/search-list-page.mjs +3 -3
  43. package/es/components/search-list-page/src/search-list-page.mjs.map +1 -1
  44. package/es/components/search-list-page/src/search-list-page.vue.d.ts +16 -11
  45. package/es/components/search-list-page/src/search-list-page.vue2.mjs +4 -3
  46. package/es/components/search-list-page/src/search-list-page.vue2.mjs.map +1 -1
  47. package/es/components/search-list-page/src/use-search-list-page.d.ts +15 -9
  48. package/es/components/search-list-page/src/use-search-list-page.mjs +4 -4
  49. package/es/components/search-list-page/src/use-search-list-page.mjs.map +1 -1
  50. package/es/components/table/index.d.ts +11 -6
  51. package/es/components/table/src/table.d.ts +2 -1
  52. package/es/components/table/src/table.mjs +2 -2
  53. package/es/components/table/src/table.mjs.map +1 -1
  54. package/es/components/table/src/table.vue.d.ts +4 -3
  55. package/es/components/table/src/table.vue2.mjs +4 -3
  56. package/es/components/table/src/table.vue2.mjs.map +1 -1
  57. package/es/components/table/src/use-table.d.ts +71 -12
  58. package/es/components/table/src/use-table.mjs +98 -38
  59. package/es/components/table/src/use-table.mjs.map +1 -1
  60. package/es/components.mjs +3 -1
  61. package/es/components.mjs.map +1 -1
  62. package/es/hooks/dialog/use-dialog.d.ts +2 -0
  63. package/es/hooks/dialog/use-dialog.mjs +4 -3
  64. package/es/hooks/dialog/use-dialog.mjs.map +1 -1
  65. package/es/index.mjs +2 -0
  66. package/es/index.mjs.map +1 -1
  67. package/es/package.json.mjs +1 -1
  68. package/es/utils/file.d.ts +18 -0
  69. package/es/utils/file.mjs +133 -0
  70. package/es/utils/file.mjs.map +1 -0
  71. package/es/utils/http/core/types.d.ts +1 -0
  72. package/global.d.ts +6 -4
  73. package/lib/components/date-picker-range/index.d.ts +3 -3
  74. package/lib/components/date-picker-range/src/date-picker-range.vue.d.ts +1 -1
  75. package/lib/components/form/src/form-item-vue.d.ts +2 -2
  76. package/lib/components/form/src/form-item.d.ts +1 -1
  77. package/lib/components/form/src/form-item.js.map +1 -1
  78. package/lib/components/form/src/hooks/use-form-item.js +3 -1
  79. package/lib/components/form/src/hooks/use-form-item.js.map +1 -1
  80. package/lib/components/index.d.ts +1 -0
  81. package/lib/components/index.js +4 -0
  82. package/lib/components/index.js.map +1 -1
  83. package/lib/components/input/style/css.d.ts +1 -1
  84. package/lib/components/input/style/css.js +1 -1
  85. package/lib/components/input/style/index.d.ts +1 -1
  86. package/lib/components/input/style/index.js +1 -1
  87. package/lib/components/link/index.d.ts +118 -0
  88. package/lib/components/link/index.js +14 -0
  89. package/lib/components/link/index.js.map +1 -0
  90. package/lib/components/link/src/link.d.ts +30 -0
  91. package/lib/components/link/src/link.js +21 -0
  92. package/lib/components/link/src/link.js.map +1 -0
  93. package/lib/components/link/src/link.vue.d.ts +73 -0
  94. package/lib/components/link/src/link.vue.js +10 -0
  95. package/lib/components/link/src/link.vue.js.map +1 -0
  96. package/lib/components/link/src/link.vue2.js +56 -0
  97. package/lib/components/link/src/link.vue2.js.map +1 -0
  98. package/lib/components/link/style/css.d.ts +2 -0
  99. package/lib/components/link/style/css.js +7 -0
  100. package/lib/components/link/style/css.js.map +1 -0
  101. package/lib/components/link/style/index.d.ts +2 -0
  102. package/lib/components/link/style/index.js +7 -0
  103. package/lib/components/link/style/index.js.map +1 -0
  104. package/lib/components/search-list-page/index.d.ts +51 -30
  105. package/lib/components/search-list-page/src/search-list-page.d.ts +1 -1
  106. package/lib/components/search-list-page/src/search-list-page.js +3 -3
  107. package/lib/components/search-list-page/src/search-list-page.js.map +1 -1
  108. package/lib/components/search-list-page/src/search-list-page.vue.d.ts +16 -11
  109. package/lib/components/search-list-page/src/search-list-page.vue2.js +3 -2
  110. package/lib/components/search-list-page/src/search-list-page.vue2.js.map +1 -1
  111. package/lib/components/search-list-page/src/use-search-list-page.d.ts +15 -9
  112. package/lib/components/search-list-page/src/use-search-list-page.js +4 -4
  113. package/lib/components/search-list-page/src/use-search-list-page.js.map +1 -1
  114. package/lib/components/table/index.d.ts +11 -6
  115. package/lib/components/table/src/table.d.ts +2 -1
  116. package/lib/components/table/src/table.js +2 -2
  117. package/lib/components/table/src/table.js.map +1 -1
  118. package/lib/components/table/src/table.vue.d.ts +4 -3
  119. package/lib/components/table/src/table.vue2.js +4 -3
  120. package/lib/components/table/src/table.vue2.js.map +1 -1
  121. package/lib/components/table/src/use-table.d.ts +71 -12
  122. package/lib/components/table/src/use-table.js +97 -37
  123. package/lib/components/table/src/use-table.js.map +1 -1
  124. package/lib/components.js +3 -1
  125. package/lib/components.js.map +1 -1
  126. package/lib/hooks/dialog/use-dialog.d.ts +2 -0
  127. package/lib/hooks/dialog/use-dialog.js +4 -3
  128. package/lib/hooks/dialog/use-dialog.js.map +1 -1
  129. package/lib/index.js +10 -6
  130. package/lib/index.js.map +1 -1
  131. package/lib/package.json.js +1 -1
  132. package/lib/utils/file.d.ts +18 -0
  133. package/lib/utils/file.js +136 -0
  134. package/lib/utils/file.js.map +1 -0
  135. package/lib/utils/http/core/types.d.ts +1 -0
  136. package/package.json +1 -1
  137. package/theme-chalk/custom-column.css +1 -1
  138. package/theme-chalk/index.css +1 -1
  139. package/theme-chalk/link.css +1 -0
  140. package/theme-chalk/src/custom-column.scss +6 -4
  141. package/theme-chalk/src/index.scss +2 -1
  142. package/theme-chalk/src/link.scss +6 -0
  143. package/theme-chalk/src/table.scss +20 -1
  144. package/theme-chalk/table.css +1 -1
@@ -1,15 +1,16 @@
1
- /*! ElPlus v0.0.17 */
1
+ /*! ElPlus v0.0.19 */
2
2
 
3
- import { useAttrs, getCurrentInstance, inject, provide, ref, nextTick, defineComponent, computed, createVNode, Fragment, withDirectives, resolveComponent, mergeProps, resolveDirective, useTemplateRef, createTextVNode, h, mergeModels, useModel, createElementBlock, openBlock, normalizeStyle, normalizeClass, unref, createCommentVNode, withCtx, renderSlot, renderList, createBlock, vShow, toDisplayString, reactive, useSlots, watch, onMounted, createSlots, normalizeProps, guardReactiveProps, markRaw, Transition, shallowReactive, isVNode, render, createElementVNode } from 'vue';
4
- import { buttonProps, useLocale as useLocale$1, ElLoading, ElMessage, ElMessageBox, formProps as formProps$1, formEmits as formEmits$1, ElTooltip, formItemProps as formItemProps$1, ElFormItem, ElForm, ElRow, ElCol, inputProps as inputProps$1, inputEmits as inputEmits$1, ElDialog, ElButton, ElTable, selectProps as selectProps$1, selectEmits as selectEmits$1, ElIcon, ElPageHeader, datePickerProps } from 'element-plus';
3
+ import { useAttrs, getCurrentInstance, inject, provide, ref, nextTick, defineComponent, computed, createVNode, Fragment, withDirectives, resolveComponent, mergeProps, resolveDirective, useTemplateRef, createTextVNode, h, mergeModels, useModel, createElementBlock, openBlock, normalizeStyle, normalizeClass, unref, createCommentVNode, withCtx, renderSlot, renderList, createBlock, vShow, toDisplayString, reactive, useSlots, watch, onMounted, createSlots, normalizeProps, guardReactiveProps, markRaw, Transition, shallowReactive, isVNode, render, createElementVNode, toRaw } from 'vue';
4
+ import { buttonProps, useLocale as useLocale$1, ElLoading, ElMessage, ElMessageBox, formProps as formProps$1, formEmits as formEmits$1, ElTooltip, formItemProps as formItemProps$1, ElFormItem, ElForm, ElRow, ElCol, inputProps as inputProps$1, inputEmits as inputEmits$1, ElDialog, ElButton, ElTable, ElIcon, selectProps as selectProps$1, selectEmits as selectEmits$1, ElPageHeader, datePickerProps, linkProps as linkProps$1 } from 'element-plus';
5
5
  import { isFunction } from '@vue/shared';
6
6
  import axios from 'axios';
7
7
  import Cookies from 'js-cookie';
8
8
  import defu from 'defu';
9
9
  import * as qs from 'qs';
10
10
  import elTableProps from 'element-plus/es/components/table/src/table/defaults';
11
- import { ArrowUp, ArrowDown } from '@element-plus/icons-vue';
11
+ import { ArrowUp, ArrowDown, EditPen } from '@element-plus/icons-vue';
12
12
  import mitt from 'mitt';
13
+ import { cloneDeep } from 'lodash-unified';
13
14
  import { useToggle } from '@vueuse/core';
14
15
  import { useRouter, useRoute } from 'vue-router';
15
16
 
@@ -937,7 +938,9 @@ const useFormItemSlots = (props) => {
937
938
  });
938
939
  }
939
940
  if (render) {
940
- scopedSlots.default = render;
941
+ scopedSlots.default = () => {
942
+ return render(attrs["table-scope"]);
943
+ };
941
944
  }
942
945
  return {
943
946
  scopedSlots
@@ -1042,7 +1045,7 @@ var EpFormItem = /* @__PURE__ */ defineComponent({
1042
1045
  }
1043
1046
  });
1044
1047
 
1045
- var _sfc_main$8 = /* @__PURE__ */ defineComponent({
1048
+ var _sfc_main$9 = /* @__PURE__ */ defineComponent({
1046
1049
  ...{
1047
1050
  name: "EpForm",
1048
1051
  inheritAttrs: false
@@ -1140,7 +1143,7 @@ var _sfc_main$8 = /* @__PURE__ */ defineComponent({
1140
1143
  }
1141
1144
  });
1142
1145
 
1143
- const EpForm = withInstall(_sfc_main$8);
1146
+ const EpForm = withInstall(_sfc_main$9);
1144
1147
 
1145
1148
  const { t: t$2 } = useLocale();
1146
1149
  const inputProps = {
@@ -1169,7 +1172,7 @@ const inputEmits = {
1169
1172
  };
1170
1173
  const inputEmitsKeys = Object.keys(inputEmits);
1171
1174
 
1172
- var _sfc_main$7 = /* @__PURE__ */ defineComponent({
1175
+ var _sfc_main$8 = /* @__PURE__ */ defineComponent({
1173
1176
  ...{
1174
1177
  name: "EpInput",
1175
1178
  inheritAttrs: false
@@ -1303,7 +1306,7 @@ var _sfc_main$7 = /* @__PURE__ */ defineComponent({
1303
1306
  }
1304
1307
  });
1305
1308
 
1306
- const EpInput = withInstall(_sfc_main$7);
1309
+ const EpInput = withInstall(_sfc_main$8);
1307
1310
 
1308
1311
  function _isSlot$1(s) {
1309
1312
  return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
@@ -1396,6 +1399,7 @@ const useDialog = (options = {}) => {
1396
1399
  } = useLocale();
1397
1400
  const {
1398
1401
  scopedSlots = {},
1402
+ instance,
1399
1403
  render: render$1,
1400
1404
  destroyOnClose,
1401
1405
  onConfirm,
@@ -1471,10 +1475,10 @@ const useDialog = (options = {}) => {
1471
1475
  });
1472
1476
  if (render$1) {
1473
1477
  const container = document.createElement("div");
1474
- const instance = getCurrentInstance();
1478
+ const newInstance = instance || getCurrentInstance();
1475
1479
  const vnode = h(Dialog);
1476
- if (instance && instance.appContext) {
1477
- vnode.appContext = instance.appContext;
1480
+ if (newInstance && newInstance.appContext) {
1481
+ vnode.appContext = newInstance.appContext;
1478
1482
  }
1479
1483
  render(vnode, container);
1480
1484
  document.body.appendChild(container);
@@ -1624,7 +1628,7 @@ const gotoTaskTrace = (workflowId) => {
1624
1628
  }
1625
1629
  };
1626
1630
 
1627
- var _sfc_main$6 = /* @__PURE__ */ defineComponent({
1631
+ var _sfc_main$7 = /* @__PURE__ */ defineComponent({
1628
1632
  ...{
1629
1633
  name: "EpCustomColumn",
1630
1634
  inheritAttrs: false
@@ -1829,7 +1833,7 @@ var _sfc_main$6 = /* @__PURE__ */ defineComponent({
1829
1833
  }
1830
1834
  });
1831
1835
 
1832
- const EpCustomColumn = withInstall(_sfc_main$6);
1836
+ const EpCustomColumn = withInstall(_sfc_main$7);
1833
1837
 
1834
1838
  const inheritTableProps = {
1835
1839
  ...elTableProps,
@@ -1903,8 +1907,8 @@ const expandTableProps = {
1903
1907
  type: Array,
1904
1908
  default: () => []
1905
1909
  },
1906
- // 链接列
1907
- linkProps: {
1910
+ // 格式化列
1911
+ formatColumns: {
1908
1912
  type: Array,
1909
1913
  default: () => []
1910
1914
  },
@@ -1926,6 +1930,38 @@ const expandTablePropsKeys = Object.keys(expandTableProps);
1926
1930
  const tableEmits = [...ElTable.emits, "single-selection-change"];
1927
1931
  const tableEmitsKeys = tableEmits;
1928
1932
 
1933
+ const bem$1 = createNameSpace("form-dialog");
1934
+ const useFormDialog = (options = {}) => {
1935
+ const {
1936
+ dialogProps,
1937
+ title,
1938
+ ...formProps
1939
+ } = options;
1940
+ const formRef = ref();
1941
+ let formData = formProps.formData || reactive({});
1942
+ return useDialog({
1943
+ class: bem$1.b(),
1944
+ width: "80%",
1945
+ title,
1946
+ render: (props) => {
1947
+ return createVNode(EpForm, mergeProps({
1948
+ "ref": formRef,
1949
+ "modelValue": formData,
1950
+ "onUpdate:modelValue": ($event) => formData = $event
1951
+ }, {
1952
+ col: 1,
1953
+ "label-width": "auto",
1954
+ ...formProps
1955
+ }), null);
1956
+ },
1957
+ onConfirm: async (resolve) => {
1958
+ await formRef.value.validate();
1959
+ resolve(formData);
1960
+ },
1961
+ ...dialogProps
1962
+ });
1963
+ };
1964
+
1929
1965
  const useTable$1 = (props) => {
1930
1966
  const elFormRef = useTemplateRef("elFormRef");
1931
1967
  const elTableRef = useTemplateRef("elTableRef");
@@ -1961,14 +1997,11 @@ const useTable$1 = (props) => {
1961
1997
  }
1962
1998
  });
1963
1999
  const customColumns = ref([]);
2000
+ const attrs = useAttrs();
1964
2001
  const search = async (init = false, isPagination = false) => {
1965
- if (props.customColumnModule) {
1966
- loading.value = true;
1967
- const columns = await bus.once("loadedCustomColumn");
1968
- customColumns.value = columns;
1969
- bus.on("loadedCustomColumn", (columns2) => {
1970
- customColumns.value = columns2;
1971
- });
2002
+ const beforeSearch = attrs["before-search"];
2003
+ if (typeof beforeSearch === "function") {
2004
+ await beforeSearch?.();
1972
2005
  }
1973
2006
  if (init) {
1974
2007
  pagination.pageNo = 1;
@@ -1986,7 +2019,8 @@ const useTable$1 = (props) => {
1986
2019
  if (props.api) {
1987
2020
  requestFn({
1988
2021
  pageNo: pagination.pageNo,
1989
- pageSize: pagination.pageSize
2022
+ pageSize: pagination.pageSize,
2023
+ pageNum: pagination.pageNo
1990
2024
  });
1991
2025
  } else if (props.data?.length) {
1992
2026
  customData.value = props.data;
@@ -1997,9 +2031,20 @@ const useTable$1 = (props) => {
1997
2031
  pagination,
1998
2032
  paginationProps
1999
2033
  } = usePagination(props, search);
2000
- if (props.isInitSearch) {
2001
- search(true);
2002
- }
2034
+ (async () => {
2035
+ if (props.isInitSearch) {
2036
+ if (props.customColumnModule) {
2037
+ loading.value = true;
2038
+ const columns = await bus.once("loadedCustomColumn");
2039
+ loading.value = false;
2040
+ customColumns.value = columns;
2041
+ bus.on("loadedCustomColumn", (columns2) => {
2042
+ customColumns.value = columns2;
2043
+ });
2044
+ }
2045
+ search(true);
2046
+ }
2047
+ })();
2003
2048
  const validate = () => {
2004
2049
  return elFormRef.value.validate();
2005
2050
  };
@@ -2063,6 +2108,7 @@ const usePagination = function(props, search) {
2063
2108
  };
2064
2109
  };
2065
2110
  const useTableColumn = (props, tableData, customColumns) => {
2111
+ const instance = getCurrentInstance();
2066
2112
  const columnProps = (column) => {
2067
2113
  const attrs = {
2068
2114
  "show-overflow-tooltip": true,
@@ -2075,16 +2121,50 @@ const useTableColumn = (props, tableData, customColumns) => {
2075
2121
  if (typeof column.required === "function") {
2076
2122
  required = column.required();
2077
2123
  }
2078
- if (required) {
2079
- attrs["renderHeader"] = (data) => {
2080
- const {
2081
- column: column2
2082
- } = data;
2083
- return createVNode("span", null, [createVNode("span", {
2084
- "style": "color:var(--el-color-danger)"
2085
- }, [createTextVNode(" * ")]), column2.label]);
2086
- };
2087
- }
2124
+ const editable = column.editable;
2125
+ attrs["renderHeader"] = () => {
2126
+ return createVNode("span", null, [required ? createVNode("span", {
2127
+ "style": "color:var(--el-color-danger)"
2128
+ }, [createTextVNode(" * ")]) : "", createVNode("span", {
2129
+ "class": {
2130
+ "is-edit": editable
2131
+ },
2132
+ "onClick": editable ? async () => {
2133
+ const cloneColumn = {
2134
+ ...column
2135
+ };
2136
+ delete cloneColumn.editable;
2137
+ const rawRender = cloneColumn.render;
2138
+ const formData = reactive({});
2139
+ if (rawRender) {
2140
+ cloneColumn.render = () => {
2141
+ return rawRender({
2142
+ row: formData
2143
+ });
2144
+ };
2145
+ }
2146
+ const formDialog = useFormDialog({
2147
+ title: cloneColumn.label,
2148
+ dialogProps: {
2149
+ destroyOnClose: true,
2150
+ instance
2151
+ },
2152
+ formItemList: [cloneColumn],
2153
+ formData
2154
+ // formData: reactive({}),
2155
+ });
2156
+ const data = await formDialog.open();
2157
+ (tableData.value || []).forEach((item) => {
2158
+ item[column.prop] = data[column.prop];
2159
+ });
2160
+ if (typeof editable === "function") {
2161
+ editable(toRaw(data));
2162
+ }
2163
+ } : void 0
2164
+ }, [column.label, editable ? createVNode(ElIcon, null, {
2165
+ default: () => [createVNode(EditPen, null, null)]
2166
+ }) : ""])]);
2167
+ };
2088
2168
  }
2089
2169
  if (column.filter) {
2090
2170
  const arr = tableData.value.map((item) => item[column.prop]);
@@ -2098,29 +2178,31 @@ const useTableColumn = (props, tableData, customColumns) => {
2098
2178
  return row[column.prop] === value;
2099
2179
  };
2100
2180
  }
2181
+ if (column.type === "EpLink") {
2182
+ attrs.className = "table-column-link";
2183
+ }
2101
2184
  return {
2102
2185
  ...attrs,
2103
2186
  ...prepareProps(column)
2104
2187
  };
2105
2188
  };
2106
2189
  const columnList = computed(() => {
2107
- let columns = props.columns;
2108
- if (props.customColumnModule) {
2109
- columns = customColumns.value;
2110
- }
2111
- return columns.filter((column) => {
2112
- if (props.linkProps.length) {
2113
- const linkColumn = props.linkProps.find((item) => item.prop === column.prop);
2114
- if (linkColumn) {
2115
- column.type = "EpButtons";
2116
- column.className = "table-column-link";
2117
- column.props = {
2118
- list: [linkColumn],
2119
- type: "text",
2120
- ...column.props
2190
+ const columns = props.customColumnModule ? customColumns.value : props.columns;
2191
+ return columns.map((column) => {
2192
+ let newColumn = {
2193
+ ...column
2194
+ };
2195
+ if (props.formatColumns.length) {
2196
+ const formatColumn = props.formatColumns.find((item) => item.prop === column.prop);
2197
+ if (formatColumn) {
2198
+ newColumn = {
2199
+ ...newColumn,
2200
+ ...formatColumn
2121
2201
  };
2122
2202
  }
2123
2203
  }
2204
+ return newColumn;
2205
+ }).filter((column) => {
2124
2206
  if ("show" in column) {
2125
2207
  return typeof column.show === "function" ? column.show(column) : column.show;
2126
2208
  } else if ("hide" in column) {
@@ -2135,7 +2217,8 @@ const useTableColumn = (props, tableData, customColumns) => {
2135
2217
  };
2136
2218
  };
2137
2219
  const useTableFormItem = (props) => {
2138
- const formItemProps = (scope, item) => {
2220
+ const formItemProps = (scope, rawItem) => {
2221
+ const item = cloneDeep(rawItem);
2139
2222
  let required = item.required;
2140
2223
  if (typeof required === "function") {
2141
2224
  required = required();
@@ -2170,10 +2253,19 @@ const useTableFormItem = (props) => {
2170
2253
  }
2171
2254
  });
2172
2255
  }
2256
+ if (item.type === "EpLink") {
2257
+ (item.props ? item.props : item.props = {}).content = item.props.content || scope.row[item.prop];
2258
+ }
2173
2259
  for (const key in item) {
2174
2260
  if (key.startsWith("on") && typeof item[key] === "function") {
2175
2261
  const fn = item[key];
2176
- item[key] = (...args) => fn(...args, scope);
2262
+ item[key] = (...args) => {
2263
+ let event;
2264
+ if (args[0] instanceof Event) {
2265
+ event = args.shift();
2266
+ }
2267
+ return fn(...args, scope, event);
2268
+ };
2177
2269
  }
2178
2270
  }
2179
2271
  return {
@@ -2195,7 +2287,7 @@ const useTableFormItem = (props) => {
2195
2287
  };
2196
2288
  };
2197
2289
 
2198
- var _sfc_main$5 = /* @__PURE__ */ defineComponent({
2290
+ var _sfc_main$6 = /* @__PURE__ */ defineComponent({
2199
2291
  ...{
2200
2292
  name: "EpTable",
2201
2293
  inheritAttrs: false
@@ -2343,12 +2435,13 @@ var _sfc_main$5 = /* @__PURE__ */ defineComponent({
2343
2435
  }, {
2344
2436
  ref_for: true
2345
2437
  }, unref(columnProps)(item)), {
2346
- default: withCtx((scope) => [item.type ? (openBlock(), createBlock(unref(EpFormItem), mergeProps({
2438
+ default: withCtx((scope) => [item.type || item.render ? (openBlock(), createBlock(unref(EpFormItem), mergeProps({
2347
2439
  key: 0,
2348
- "form-data": scope.row
2440
+ "form-data": scope.row,
2441
+ "table-scope": scope
2349
2442
  }, {
2350
2443
  ref_for: true
2351
- }, unref(formItemProps)(scope, item)), null, 16, ["form-data"])) : (openBlock(), createElementBlock(Fragment, {
2444
+ }, unref(formItemProps)(scope, item)), null, 16, ["form-data", "table-scope"])) : (openBlock(), createElementBlock(Fragment, {
2352
2445
  key: 1
2353
2446
  }, [createTextVNode(toDisplayString(scope.row[item.prop]), 1)], 64))]),
2354
2447
  _: 2
@@ -2380,7 +2473,7 @@ var _sfc_main$5 = /* @__PURE__ */ defineComponent({
2380
2473
  }
2381
2474
  });
2382
2475
 
2383
- const EpTable = withInstall(_sfc_main$5);
2476
+ const EpTable = withInstall(_sfc_main$6);
2384
2477
 
2385
2478
  const searchListPageProps = {
2386
2479
  ...apiProps,
@@ -2414,9 +2507,9 @@ const searchListPageProps = {
2414
2507
  actionButtons: {
2415
2508
  ...tableProps.actionButtons
2416
2509
  },
2417
- // 链接列
2418
- linkProps: {
2419
- ...tableProps.linkProps
2510
+ // 格式化列
2511
+ formatColumns: {
2512
+ ...tableProps.formatColumns
2420
2513
  },
2421
2514
  showSelectionCol: Boolean,
2422
2515
  showSingleSelectionCol: Boolean,
@@ -2471,7 +2564,8 @@ const useSearchListPage = (props, config = {}) => {
2471
2564
  search,
2472
2565
  reset,
2473
2566
  tableRef,
2474
- formRef
2567
+ formRef,
2568
+ beforeSearch: validate
2475
2569
  };
2476
2570
  };
2477
2571
  const useTable = (props, config) => {
@@ -2488,7 +2582,7 @@ const useTable = (props, config) => {
2488
2582
  showSelectionCol: props.showSelectionCol,
2489
2583
  showSingleSelectionCol: props.showSingleSelectionCol,
2490
2584
  actionButtons: props.actionButtons,
2491
- linkProps: props.linkProps,
2585
+ formatColumns: props.formatColumns,
2492
2586
  api: props.api,
2493
2587
  reqData: props.formData,
2494
2588
  customColumnModule: props.customColumnModule,
@@ -2608,12 +2702,11 @@ const useButtons$1 = (props, { validate, resetFields, tableRef }) => {
2608
2702
  };
2609
2703
  });
2610
2704
  const search = async (isInitSearch = false) => {
2611
- await validate();
2612
2705
  tableRef.value.search(isInitSearch);
2613
2706
  };
2614
2707
  const reset = async () => {
2615
2708
  resetFields();
2616
- search();
2709
+ search(true);
2617
2710
  };
2618
2711
  const searchButtons = [
2619
2712
  {
@@ -2634,7 +2727,7 @@ const useButtons$1 = (props, { validate, resetFields, tableRef }) => {
2634
2727
  };
2635
2728
  };
2636
2729
 
2637
- var _sfc_main$4 = /* @__PURE__ */ defineComponent({
2730
+ var _sfc_main$5 = /* @__PURE__ */ defineComponent({
2638
2731
  ...{ name: "EpSearchListPage" },
2639
2732
  __name: "search-list-page",
2640
2733
  props: searchListPageProps,
@@ -2649,7 +2742,8 @@ var _sfc_main$4 = /* @__PURE__ */ defineComponent({
2649
2742
  reset,
2650
2743
  tableRef,
2651
2744
  formRef,
2652
- tableProps
2745
+ tableProps,
2746
+ beforeSearch
2653
2747
  } = useSearchListPage(props);
2654
2748
  __expose({
2655
2749
  search,
@@ -2680,13 +2774,13 @@ var _sfc_main$4 = /* @__PURE__ */ defineComponent({
2680
2774
  ], 2)
2681
2775
  ]),
2682
2776
  renderSlot(_ctx.$slots, "tableBefore"),
2683
- createVNode(unref(EpTable), normalizeProps(guardReactiveProps(unref(tableProps))), null, 16)
2777
+ createVNode(unref(EpTable), mergeProps(unref(tableProps), { "before-search": unref(beforeSearch) }), null, 16, ["before-search"])
2684
2778
  ], 6);
2685
2779
  };
2686
2780
  }
2687
2781
  });
2688
2782
 
2689
- const EpSearchListPage = withInstall(_sfc_main$4);
2783
+ const EpSearchListPage = withInstall(_sfc_main$5);
2690
2784
 
2691
2785
  const inheritSelectProps = {
2692
2786
  ...selectProps$1,
@@ -2812,7 +2906,7 @@ function useSelect(props, emit) {
2812
2906
  };
2813
2907
  }
2814
2908
 
2815
- var _sfc_main$3 = /* @__PURE__ */ defineComponent({
2909
+ var _sfc_main$4 = /* @__PURE__ */ defineComponent({
2816
2910
  ...{
2817
2911
  name: "EpSelect",
2818
2912
  inheritAttrs: false
@@ -2891,7 +2985,7 @@ var _sfc_main$3 = /* @__PURE__ */ defineComponent({
2891
2985
  }
2892
2986
  });
2893
2987
 
2894
- const EpSelect = withInstall(_sfc_main$3);
2988
+ const EpSelect = withInstall(_sfc_main$4);
2895
2989
 
2896
2990
  const titleProps = {
2897
2991
  // 右侧按钮
@@ -2947,7 +3041,7 @@ const useTitle = (emit) => {
2947
3041
  };
2948
3042
  };
2949
3043
 
2950
- var _sfc_main$2 = /* @__PURE__ */ defineComponent({
3044
+ var _sfc_main$3 = /* @__PURE__ */ defineComponent({
2951
3045
  ...{
2952
3046
  name: "EpTitle",
2953
3047
  inheritAttrs: false
@@ -3010,7 +3104,7 @@ var _sfc_main$2 = /* @__PURE__ */ defineComponent({
3010
3104
  }
3011
3105
  });
3012
3106
 
3013
- const EpTitle = withInstall(_sfc_main$2);
3107
+ const EpTitle = withInstall(_sfc_main$3);
3014
3108
 
3015
3109
  const headerProps = {
3016
3110
  // 页面模式
@@ -3121,7 +3215,7 @@ const useButtons = (props, emit) => {
3121
3215
  };
3122
3216
  };
3123
3217
 
3124
- var _sfc_main$1 = /* @__PURE__ */ defineComponent({
3218
+ var _sfc_main$2 = /* @__PURE__ */ defineComponent({
3125
3219
  ...{
3126
3220
  name: "EpHeader",
3127
3221
  inheritAttrs: false
@@ -3154,7 +3248,7 @@ var _sfc_main$1 = /* @__PURE__ */ defineComponent({
3154
3248
  }
3155
3249
  });
3156
3250
 
3157
- const EpHeader = withInstall(_sfc_main$1);
3251
+ const EpHeader = withInstall(_sfc_main$2);
3158
3252
 
3159
3253
  const { t } = useLocale();
3160
3254
  const datePickerRangeProps = {
@@ -3224,7 +3318,7 @@ const datePickerRangeProps = {
3224
3318
  };
3225
3319
  const datePickerRangeEmits = {};
3226
3320
 
3227
- var _sfc_main = /* @__PURE__ */ defineComponent({
3321
+ var _sfc_main$1 = /* @__PURE__ */ defineComponent({
3228
3322
  ...{
3229
3323
  name: "EpDatePickerRange",
3230
3324
  inheritAttrs: false
@@ -3280,7 +3374,69 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
3280
3374
  }
3281
3375
  });
3282
3376
 
3283
- const EpDatePickerRange = withInstall(_sfc_main);
3377
+ const EpDatePickerRange = withInstall(_sfc_main$1);
3378
+
3379
+ const linkProps = {
3380
+ ...linkProps$1,
3381
+ content: {
3382
+ type: String
3383
+ },
3384
+ type: {
3385
+ ...linkProps$1.type,
3386
+ default: "primary"
3387
+ },
3388
+ underline: {
3389
+ ...linkProps$1.underline,
3390
+ default: "never"
3391
+ }
3392
+ };
3393
+
3394
+ var _sfc_main = /* @__PURE__ */ defineComponent({
3395
+ ...{
3396
+ name: "EpLink",
3397
+ inheritAttrs: false
3398
+ },
3399
+ __name: "link",
3400
+ props: linkProps,
3401
+ setup(__props) {
3402
+ const bem = createNameSpace("link");
3403
+ const props = __props;
3404
+ const attrs = useAttrs();
3405
+ const slots = computed(() => {
3406
+ return Object.keys(useSlots());
3407
+ });
3408
+ return (_ctx, _cache) => {
3409
+ const _component_el_link = resolveComponent("el-link");
3410
+ return openBlock(), createBlock(_component_el_link, mergeProps({
3411
+ class: `${unref(bem).b()} ${unref(prepareClassNames)()}`,
3412
+ style: {
3413
+ ...unref(prepareStyles)()
3414
+ }
3415
+ }, {
3416
+ ...props,
3417
+ ...unref(attrs)
3418
+ }), createSlots({
3419
+ default: withCtx(() => [
3420
+ _ctx.content ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
3421
+ createTextVNode(toDisplayString(_ctx.content), 1)
3422
+ ], 64)) : createCommentVNode("", true)
3423
+ ]),
3424
+ _: 2
3425
+ }, [
3426
+ renderList(slots.value, (name) => {
3427
+ return {
3428
+ name,
3429
+ fn: withCtx((scope) => [
3430
+ renderSlot(_ctx.$slots, name, normalizeProps(guardReactiveProps(scope)))
3431
+ ])
3432
+ };
3433
+ })
3434
+ ]), 1040, ["class", "style"]);
3435
+ };
3436
+ }
3437
+ });
3438
+
3439
+ const EpLink = withInstall(_sfc_main);
3284
3440
 
3285
3441
  var components = [
3286
3442
  EpButtons,
@@ -3292,10 +3448,11 @@ var components = [
3292
3448
  EpTitle,
3293
3449
  EpHeader,
3294
3450
  EpDatePickerRange,
3295
- EpCustomColumn
3451
+ EpCustomColumn,
3452
+ EpLink
3296
3453
  ];
3297
3454
 
3298
- var version = "0.0.17";
3455
+ var version = "0.0.19";
3299
3456
 
3300
3457
  var globalProperties = {
3301
3458
  install(app) {
@@ -3308,7 +3465,7 @@ var plugins = /*#__PURE__*/Object.freeze({
3308
3465
  globalProperties: globalProperties
3309
3466
  });
3310
3467
 
3311
- const bem$1 = createNameSpace("choose-dialog");
3468
+ const bem = createNameSpace("choose-dialog");
3312
3469
  const useChooseDialog = (options = {}) => {
3313
3470
  const {
3314
3471
  t
@@ -3325,12 +3482,12 @@ const useChooseDialog = (options = {}) => {
3325
3482
  if (!showSingleSelectionCol) {
3326
3483
  scopedSlots.footerPrepend = () => {
3327
3484
  return createVNode("span", {
3328
- "class": bem$1.e("selected-count")
3485
+ "class": bem.e("selected-count")
3329
3486
  }, [t("ep.chooseDialog.selected"), selections.length, t("ep.chooseDialog.unit")]);
3330
3487
  };
3331
3488
  }
3332
3489
  return useDialog({
3333
- class: bem$1.b(),
3490
+ class: bem.b(),
3334
3491
  width: "80%",
3335
3492
  showFooter: !showSingleSelectionCol,
3336
3493
  scopedSlots,
@@ -3367,38 +3524,6 @@ const useChooseDialog = (options = {}) => {
3367
3524
  });
3368
3525
  };
3369
3526
 
3370
- const bem = createNameSpace("form-dialog");
3371
- const useFormDialog = (options = {}) => {
3372
- const {
3373
- dialogProps,
3374
- title,
3375
- ...formProps
3376
- } = options;
3377
- const formRef = ref();
3378
- let formData = formProps.formData || reactive({});
3379
- return useDialog({
3380
- class: bem.b(),
3381
- width: "80%",
3382
- title,
3383
- render: (props) => {
3384
- return createVNode(EpForm, mergeProps({
3385
- "ref": formRef,
3386
- "modelValue": formData,
3387
- "onUpdate:modelValue": ($event) => formData = $event
3388
- }, {
3389
- col: 1,
3390
- "label-width": "auto",
3391
- ...formProps
3392
- }), null);
3393
- },
3394
- onConfirm: async (resolve) => {
3395
- await formRef.value.validate();
3396
- resolve(formData);
3397
- },
3398
- ...dialogProps
3399
- });
3400
- };
3401
-
3402
3527
  const useNavigation = () => {
3403
3528
  const router = useRouter();
3404
3529
  const $goto = (r) => {
@@ -3475,4 +3600,4 @@ const plugin = {
3475
3600
  version
3476
3601
  };
3477
3602
 
3478
- export { EpButtons, EpCustomColumn, EpDatePickerRange, EpForm, EpFormItem, EpHeader, EpInput, EpSearchListPage, EpSelect, EpTable, EpTitle, buttonsProps, customColumnEmits, customColumnProps, datePickerRangeEmits, datePickerRangeProps, plugin as default, expandFormItemPropsKeys, expandFormPropsKeys, expandSelectPropsKeys, expandTablePropsKeys, formEmits, formEmitsKeys, formItemProps, formProps, headerEmits, headerProps, inheritSelectProps, inputEmits, inputEmitsKeys, inputProps, install, searchListPageProps, selectEmits, selectEmitsKeys, selectProps, tableEmits, tableEmitsKeys, tableProps, titleEmits, titleProps, useChooseDialog, useDialog, useFormDialog, useLocale, useNavigation, useRequest, useTemplatePromise, vPermisson as vPermission, vRepeatClick };
3603
+ export { EpButtons, EpCustomColumn, EpDatePickerRange, EpForm, EpFormItem, EpHeader, EpInput, EpLink, EpSearchListPage, EpSelect, EpTable, EpTitle, buttonsProps, customColumnEmits, customColumnProps, datePickerRangeEmits, datePickerRangeProps, plugin as default, expandFormItemPropsKeys, expandFormPropsKeys, expandSelectPropsKeys, expandTablePropsKeys, formEmits, formEmitsKeys, formItemProps, formProps, headerEmits, headerProps, inheritSelectProps, inputEmits, inputEmitsKeys, inputProps, install, linkProps, searchListPageProps, selectEmits, selectEmitsKeys, selectProps, tableEmits, tableEmitsKeys, tableProps, titleEmits, titleProps, useChooseDialog, useDialog, useFormDialog, useLocale, useNavigation, useRequest, useTemplatePromise, vPermisson as vPermission, vRepeatClick };