@dazhicheng/ui 1.5.266 → 1.6.1

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 (182) hide show
  1. package/dist/components/tt-api-component/index.js +4 -3
  2. package/dist/components/tt-api-component/index.vue2.js +4 -3
  3. package/dist/components/tt-area/TtArea.vue.js +1 -1
  4. package/dist/components/tt-area/TtArea.vue3.js +8 -7
  5. package/dist/components/tt-button/index.js +5 -4
  6. package/dist/components/tt-button/index.vue2.js +4 -3
  7. package/dist/components/tt-checkbox/index.js +4 -3
  8. package/dist/components/tt-checkbox/index.vue.js +4 -3
  9. package/dist/components/tt-drawer/index.js +4 -3
  10. package/dist/components/tt-drawer/src/RenderDrawer.vue.js +4 -3
  11. package/dist/components/tt-drawer/src/components/DrawerFooter.vue.js +8 -7
  12. package/dist/components/tt-drawer/src/components/DrawerHeader.vue.js +2 -2
  13. package/dist/components/tt-drawer/src/components/DrawerHeader.vue2.js +3 -2
  14. package/dist/components/tt-drawer/src/hooks/useResizable.js +2 -2
  15. package/dist/components/tt-drawer/src/props.js +3 -2
  16. package/dist/components/tt-drawer/src/utils/drawer-api.js +4 -2
  17. package/dist/components/tt-empty/index.js +9 -8
  18. package/dist/components/tt-form/index.js +10 -9
  19. package/dist/components/tt-form/src/components/ExpandableArrow.vue2.js +3 -2
  20. package/dist/components/tt-form/src/components/FormActions.vue2.js +4 -2
  21. package/dist/components/tt-form/src/form/FormDescription.vue.js +3 -2
  22. package/dist/components/tt-form/src/form/FormItem.vue.js +6 -5
  23. package/dist/components/tt-form/src/form/FormLabel.vue.js +8 -7
  24. package/dist/components/tt-form/src/form/RenderContent.vue.js +4 -3
  25. package/dist/components/tt-form/src/form-render/FormField.vue2.js +30 -28
  26. package/dist/components/tt-form/src/form-render/FormLabel.vue2.js +4 -2
  27. package/dist/components/tt-form/src/form-render/array-register/FormArrayRegister.d.ts +3 -3
  28. package/dist/components/tt-form/src/form-render/array-register/FormArrayRegister.js +1 -0
  29. package/dist/components/tt-form/src/form-render/array-register/utils.js +6 -4
  30. package/dist/components/tt-form/src/form-render/dependencies.js +19 -18
  31. package/dist/components/tt-form/src/form-render/form.vue2.js +4 -2
  32. package/dist/components/tt-form/src/form-render/helper.js +15 -14
  33. package/dist/components/tt-form/src/form-render/rootWrapperClass.js +3 -2
  34. package/dist/components/tt-form/src/formApi.js +3 -2
  35. package/dist/components/tt-form/src/group-form/GroupForm.vue2.js +4 -3
  36. package/dist/components/tt-form/src/group-form/GroupSection.vue2.js +2 -0
  37. package/dist/components/tt-form/src/group-form/LazyFormField.vue.js +4 -2
  38. package/dist/components/tt-form/src/group-form/groupFormApi.js +4 -3
  39. package/dist/components/tt-form/src/hooks/useForwardPriorityValues.js +3 -2
  40. package/dist/components/tt-form/src/hooks/useSelectCollapse.js +28 -27
  41. package/dist/components/tt-form/src/index.vue2.js +3 -2
  42. package/dist/components/tt-form/src/useFormContext.js +11 -10
  43. package/dist/components/tt-form-item-error-tooltip/index.js +5 -4
  44. package/dist/components/tt-form-item-error-tooltip/index.vue.js +4 -3
  45. package/dist/components/tt-icon/index.js +6 -5
  46. package/dist/components/tt-icon/index.vue.js +2 -2
  47. package/dist/components/tt-image/index.js +6 -5
  48. package/dist/components/tt-image/src/components/ImageViewer.js +7 -6
  49. package/dist/components/tt-loading/index.js +4 -3
  50. package/dist/components/tt-loading/src/directive.js +24 -23
  51. package/dist/components/tt-loading/src/loading.vue.js +2 -2
  52. package/dist/components/tt-log/index.js +4 -3
  53. package/dist/components/tt-log/index.vue.js +3 -2
  54. package/dist/components/tt-modal/index.js +3 -2
  55. package/dist/components/tt-modal/src/RenderModal.vue.js +3 -2
  56. package/dist/components/tt-modal/src/components/ModalFooter.vue2.js +3 -2
  57. package/dist/components/tt-modal/src/components/ModalHeader.vue2.js +3 -2
  58. package/dist/components/tt-modal/src/components/ModalWrapper.vue.js +15 -14
  59. package/dist/components/tt-modal/src/props.js +3 -2
  60. package/dist/components/tt-modal/src/utils/modal-api.js +4 -2
  61. package/dist/components/tt-modal-form/index.vue.js +4 -3
  62. package/dist/components/tt-nav-anchor/index.js +4 -3
  63. package/dist/components/tt-nav-anchor/src/TtNavAnchor.vue.js +15 -14
  64. package/dist/components/tt-panel-select/index.js +4 -3
  65. package/dist/components/tt-panel-select/src/components/PanelMiddle.vue.d.ts +2 -2
  66. package/dist/components/tt-panel-select/src/hooks/usePanelData.js +95 -87
  67. package/dist/components/tt-panel-select/src/index.vue.js +4 -2
  68. package/dist/components/tt-radio-group/index.js +4 -3
  69. package/dist/components/tt-radio-group/index.vue.js +7 -6
  70. package/dist/components/tt-select/index.js +4 -3
  71. package/dist/components/tt-select/src/Select.vue.d.ts +12 -12
  72. package/dist/components/tt-select/src/Select.vue.js +4 -3
  73. package/dist/components/tt-select/src/components/SelectTable.vue.d.ts +116 -7
  74. package/dist/components/tt-select/src/components/SelectTable.vue.js +3 -2
  75. package/dist/components/tt-select/src/components/Table.vue.d.ts +8 -8
  76. package/dist/components/tt-select/src/components/Table.vue.js +3 -2
  77. package/dist/components/tt-select/src/hooks/useDataSource.js +4 -3
  78. package/dist/components/tt-select/src/hooks/useKeyboard.d.ts +7 -1
  79. package/dist/components/tt-select/src/hooks/useSelect.js +3 -2
  80. package/dist/components/tt-select/src/hooks/useSelectTableEvent.d.ts +1 -1
  81. package/dist/components/tt-select/src/hooks/useSelectTableEvent.js +28 -27
  82. package/dist/components/tt-select/src/props.d.ts +2 -2
  83. package/dist/components/tt-table/index.d.ts +526 -361
  84. package/dist/components/tt-table/index.js +7 -5
  85. package/dist/components/tt-table/src/Table.vue.d.ts +308 -218
  86. package/dist/components/tt-table/src/Table.vue.js +406 -618
  87. package/dist/components/tt-table/src/TableForm.vue.d.ts +384 -19
  88. package/dist/components/tt-table/src/TableForm.vue.js +219 -229
  89. package/dist/components/tt-table/src/components/TableAction.vue.js +110 -131
  90. package/dist/components/tt-table/src/components/TableButtons.js +30 -29
  91. package/dist/components/tt-table/src/components/TableColumnModal.vue2.js +88 -84
  92. package/dist/components/tt-table/src/components/TableToolbarTools.vue.d.ts +80 -0
  93. package/dist/components/tt-table/src/components/{TableToobalTools.vue.js → TableToolbarTools.vue.js} +34 -35
  94. package/dist/components/tt-table/src/components/TableToolbarTools.vue2.js +4 -0
  95. package/dist/components/tt-table/src/emits.d.ts +10 -1
  96. package/dist/components/tt-table/src/emits.js +2 -1
  97. package/dist/components/tt-table/src/hooks/useColumnPersistence.d.ts +19 -0
  98. package/dist/components/tt-table/src/hooks/useColumnPersistence.js +64 -0
  99. package/dist/components/tt-table/src/hooks/useColumns.d.ts +505 -21
  100. package/dist/components/tt-table/src/hooks/useColumns.js +101 -245
  101. package/dist/components/tt-table/src/hooks/useGridProps.d.ts +36 -0
  102. package/dist/components/tt-table/src/hooks/useGridProps.js +121 -0
  103. package/dist/components/tt-table/src/hooks/useKeyboardNav.d.ts +11 -0
  104. package/dist/components/tt-table/src/hooks/useKeyboardNav.js +98 -0
  105. package/dist/components/tt-table/src/hooks/usePagination.d.ts +14 -8
  106. package/dist/components/tt-table/src/hooks/usePagination.js +30 -33
  107. package/dist/components/tt-table/src/hooks/useQuery.d.ts +41 -0
  108. package/dist/components/tt-table/src/hooks/useQuery.js +148 -0
  109. package/dist/components/tt-table/src/hooks/useRowIdentity.d.ts +22 -0
  110. package/dist/components/tt-table/src/hooks/useRowIdentity.js +97 -0
  111. package/dist/components/tt-table/src/hooks/useRowSelection.d.ts +24 -12
  112. package/dist/components/tt-table/src/hooks/useRowSelection.js +95 -70
  113. package/dist/components/tt-table/src/hooks/{useLeftRightSlot.d.ts → useSideSlot.d.ts} +25 -17
  114. package/dist/components/tt-table/src/hooks/useSideSlot.js +78 -0
  115. package/dist/components/tt-table/src/hooks/useSyncProps.d.ts +12 -0
  116. package/dist/components/tt-table/src/hooks/useSyncProps.js +56 -0
  117. package/dist/components/tt-table/src/hooks/useTableData.d.ts +71 -0
  118. package/dist/components/tt-table/src/hooks/useTableData.js +308 -0
  119. package/dist/components/tt-table/src/hooks/useTableFooter.d.ts +15 -0
  120. package/dist/components/tt-table/src/hooks/useTableFooter.js +47 -0
  121. package/dist/components/tt-table/src/hooks/useTableForm.d.ts +10 -5
  122. package/dist/components/tt-table/src/hooks/useTableForm.js +56 -48
  123. package/dist/components/tt-table/src/hooks/useTableMethods.d.ts +165 -0
  124. package/dist/components/tt-table/src/hooks/useTableMethods.js +183 -0
  125. package/dist/components/tt-table/src/hooks/useTableRender.d.ts +57 -55
  126. package/dist/components/tt-table/src/props.d.ts +326 -153
  127. package/dist/components/tt-table/src/props.js +125 -271
  128. package/dist/components/tt-table/src/table-defaults.d.ts +25 -0
  129. package/dist/components/tt-table/src/table-defaults.js +71 -0
  130. package/dist/components/tt-table/src/table-mutation-events.d.ts +43 -0
  131. package/dist/components/tt-table/src/table-mutation-events.js +71 -0
  132. package/dist/components/tt-table/src/types/table.d.ts +223 -88
  133. package/dist/components/tt-table/src/types/tableAction.d.ts +23 -0
  134. package/dist/components/tt-table/src/types/tableForm.d.ts +15 -26
  135. package/dist/components/tt-table/src/utils/action-tab-index.d.ts +2 -0
  136. package/dist/components/tt-table/src/utils/action-tab-index.js +51 -0
  137. package/dist/components/tt-table/src/utils/context.js +26 -12
  138. package/dist/components/tt-table/src/utils/table-api.d.ts +136 -58
  139. package/dist/components/tt-table/src/utils/table-api.js +200 -165
  140. package/dist/components/tt-table/src/utils/table-form-api.d.ts +11 -11
  141. package/dist/components/tt-table/src/utils/table-form-api.js +35 -23
  142. package/dist/components/tt-text/index.js +4 -3
  143. package/dist/components/tt-upload/index.js +6 -5
  144. package/dist/components/tt-upload/src/TtUpload.vue.js +4 -3
  145. package/dist/components/types.d.ts +0 -20
  146. package/dist/directives/disabled-tip/index.js +9 -8
  147. package/dist/hooks/useFormSchemasLink.js +4 -3
  148. package/dist/hooks/useFormat.d.ts +35 -71
  149. package/dist/hooks/useFormat.js +28 -39
  150. package/dist/hooks/usePanelSelectSchemas.js +4 -3
  151. package/dist/hooks/useScreenshotOss.js +16 -15
  152. package/dist/hooks/useSetup.js +0 -3
  153. package/dist/packages/hooks/src/useDebounce.js +6 -5
  154. package/dist/packages/hooks/src/useElementScreenshot.js +4 -3
  155. package/dist/packages/hooks/src/usePriorityValue.js +5 -4
  156. package/dist/packages/utils/src/format.js +48 -0
  157. package/dist/packages/utils/src/is.js +20 -18
  158. package/dist/packages/utils/src/tool.js +76 -149
  159. package/dist/plugins/default/renderCellContent.js +4 -3
  160. package/dist/plugins/vxeTable/switchStatus.js +14 -13
  161. package/dist/style.css +1 -1
  162. package/package.json +3 -3
  163. package/dist/components/tt-table/src/components/TableToobalTools.vue.d.ts +0 -576
  164. package/dist/components/tt-table/src/components/TableToobalTools.vue2.js +0 -4
  165. package/dist/components/tt-table/src/enum.d.ts +0 -2
  166. package/dist/components/tt-table/src/hooks/useCellArea.d.ts +0 -15
  167. package/dist/components/tt-table/src/hooks/useCellArea.js +0 -15
  168. package/dist/components/tt-table/src/hooks/useCustomColumns.d.ts +0 -20
  169. package/dist/components/tt-table/src/hooks/useCustomColumns.js +0 -65
  170. package/dist/components/tt-table/src/hooks/useDataSource.d.ts +0 -29
  171. package/dist/components/tt-table/src/hooks/useDataSource.js +0 -232
  172. package/dist/components/tt-table/src/hooks/useLeftRightSlot.js +0 -64
  173. package/dist/components/tt-table/src/hooks/useTable.d.ts +0 -7
  174. package/dist/components/tt-table/src/hooks/useTableEvent.d.ts +0 -101
  175. package/dist/components/tt-table/src/hooks/useTableEvent.js +0 -197
  176. package/dist/components/tt-table/src/hooks/useTableFormEvent.d.ts +0 -10
  177. package/dist/components/tt-table/src/hooks/useTableHeight.d.ts +0 -15
  178. package/dist/components/tt-table/src/hooks/useTableSlot.d.ts +0 -11
  179. package/dist/components/tt-table/src/hooks/useTableSlot.js +0 -17
  180. package/dist/components/tt-table/src/utils/filters.d.ts +0 -109
  181. package/dist/components/tt-table/src/utils/vxeTable.d.ts +0 -28
  182. package/dist/packages/utils/src/check.js +0 -10
@@ -1,22 +1,31 @@
1
- var n = Object.defineProperty;
2
- var h = (r, t, e) => t in r ? n(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
3
- var s = (r, t, e) => h(r, typeof t != "symbol" ? t + "" : t, e);
1
+ var h = Object.defineProperty;
2
+ var b = (r, t, e) => t in r ? h(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
3
+ var s = (r, t, e) => b(r, typeof t != "symbol" ? t + "" : t, e);
4
4
  import "axios";
5
5
  import "element-plus";
6
- import { isFunction as d } from "../../../../packages/utils/src/is.js";
7
- import { reactive as i, computed as u, toValue as b } from "vue";
8
- import { bindMethods as c } from "../../../../packages/utils/src/tool.js";
6
+ import { isFunction as c } from "../../../../packages/utils/src/is.js";
7
+ import { reactive as i, computed as u, toValue as f } from "vue";
8
+ import "dayjs";
9
+ import "numeral";
10
+ import { bindMethods as d } from "../../../../packages/utils/src/tool.js";
9
11
  import { mergeWithArrayOverride as a } from "../../../../packages/utils/src/merge.js";
10
12
  import "../../../../node_modules/.pnpm/decimal.js@10.6.0/node_modules/decimal.js/decimal.js";
11
- import { StateHandler as f } from "../../../../packages/utils/src/stateHandler.js";
13
+ import { StateHandler as O } from "../../../../packages/utils/src/stateHandler.js";
12
14
  import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/aes.js";
13
15
  import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-utf8.js";
14
16
  import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js";
15
17
  import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
16
18
  import "lodash-es";
17
- import { Store as S, useStore as A } from "@tanstack/vue-store";
18
- import { getDefaultState as y, TableApi as O } from "./table-api.js";
19
- class U {
19
+ import { Store as A, useStore as S } from "@tanstack/vue-store";
20
+ import { getDefaultState as y, TableApi as j } from "./table-api.js";
21
+ function g(r) {
22
+ if (!r) return;
23
+ const t = {};
24
+ return Object.keys(r).forEach((e) => {
25
+ e !== "data" && Object.assign(t, { [e]: r[e] });
26
+ }), t;
27
+ }
28
+ class q {
20
29
  /**
21
30
  * 构造函数,初始化 store、tableApi、状态等
22
31
  * @param options 表单+表格配置项
@@ -39,25 +48,27 @@ class U {
39
48
  /**
40
49
  * 当前选中的行 key 数组(响应式)
41
50
  */
42
- s(this, "selectedKeys", u(() => b(this.tableApi.selectedKeys) ?? []));
43
- const e = { ...t }, o = y();
44
- this.store = new S(
51
+ s(this, "selectedKeys", u(() => f(this.tableApi.selectedKeys) ?? []));
52
+ const e = { ...t }, o = g(t.table);
53
+ o && (e.table = o);
54
+ const p = y();
55
+ this.store = new A(
45
56
  a(e, {
46
57
  useSearchForm: !0,
47
- table: o,
48
- tableRowId: o.tableRowId || "id"
58
+ table: p,
59
+ tableRowId: p.tableRowId || "id"
49
60
  }),
50
61
  {
51
62
  onUpdate: () => {
52
63
  this.state = this.store.state;
53
64
  }
54
65
  }
55
- ), this.state = this.store.state, this.stateHandler = new f();
56
- const p = new O({
66
+ ), this.state = this.store.state, this.stateHandler = new O();
67
+ const n = new j({
57
68
  ...this.state.table,
58
69
  useSearchForm: this.state.useSearchForm || !1
59
- }), l = p;
60
- l.useStore = (m) => A(p.store, m), Object.setPrototypeOf(this.tableApi, l), c(this);
70
+ }), m = n;
71
+ m.useStore = (l) => S(n.store, l), Object.setPrototypeOf(this.tableApi, m), d(this);
61
72
  }
62
73
  /**
63
74
  * 组件挂载时调用,注入表单和表格实例
@@ -73,14 +84,14 @@ class U {
73
84
  * @param stateOrFn 新状态或返回新状态的函数
74
85
  */
75
86
  setState(t) {
76
- d(t) ? this.store.setState((e) => a(t(e), e)) : this.store.setState((e) => a(t, e));
87
+ c(t) ? this.store.setState((e) => a(t(e), e)) : this.store.setState((e) => a(t, e));
77
88
  }
78
89
  /**
79
90
  * 重新加载表格数据
80
91
  * @param data 可选的查询参数
81
92
  */
82
93
  async reload(t) {
83
- this.tableForm.reload(t);
94
+ await this.tableForm.reload(t);
84
95
  }
85
96
  /**
86
97
  * 获取表单实例
@@ -125,9 +136,10 @@ class U {
125
136
  * 组件卸载时调用,重置挂载状态
126
137
  */
127
138
  unmount() {
128
- this.isMounted = !1, this.stateHandler.reset();
139
+ var t;
140
+ this.isMounted = !1, (t = this.tableApi) == null || t.unmount(), Object.setPrototypeOf(this.grid, Object.prototype), Object.setPrototypeOf(this.formApi, Object.prototype), Object.setPrototypeOf(this.tableForm, Object.prototype), this.stateHandler.reset();
129
141
  }
130
142
  }
131
143
  export {
132
- U as TableFormApi
144
+ q as TableFormApi
133
145
  };
@@ -3,6 +3,7 @@ import "element-plus";
3
3
  import "dayjs";
4
4
  import "vue";
5
5
  import { withInstall as t } from "../../packages/utils/src/install.js";
6
+ import "numeral";
6
7
  import "xe-utils";
7
8
  import "dayjs/plugin/utc";
8
9
  import "dayjs/plugin/timezone";
@@ -13,8 +14,8 @@ import "../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb
13
14
  import "../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
14
15
  import "lodash-es";
15
16
  import o from "./index.vue.js";
16
- const h = t(o);
17
+ const w = t(o);
17
18
  export {
18
- h as TtText,
19
- h as default
19
+ w as TtText,
20
+ w as default
20
21
  };
@@ -3,6 +3,7 @@ import "element-plus";
3
3
  import "dayjs";
4
4
  import "vue";
5
5
  import { withInstall as o } from "../../packages/utils/src/install.js";
6
+ import "numeral";
6
7
  import "xe-utils";
7
8
  import "dayjs/plugin/utc";
8
9
  import "dayjs/plugin/timezone";
@@ -13,10 +14,10 @@ import "../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb
13
14
  import "../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
14
15
  import "lodash-es";
15
16
  import t from "./src/TtUpload.vue.js";
16
- import { ttUploadProps as I } from "./src/typing.js";
17
- const h = o(t);
17
+ import { ttUploadProps as P } from "./src/typing.js";
18
+ const u = o(t);
18
19
  export {
19
- h as TtUpload,
20
- h as default,
21
- I as ttUploadProps
20
+ u as TtUpload,
21
+ u as default,
22
+ P as ttUploadProps
22
23
  };
@@ -9,8 +9,9 @@ import { useDesign as ge } from "../../../packages/hooks/src/useDesign.js";
9
9
  import "axios";
10
10
  import { ElMessage as p, ElImageViewer as _e, ElUpload as he } from "element-plus";
11
11
  import { isString as ye, isNumber as Ue } from "../../../packages/utils/src/is.js";
12
- import "xe-utils";
13
12
  import "dayjs";
13
+ import "numeral";
14
+ import "xe-utils";
14
15
  import "dayjs/plugin/utc";
15
16
  import "dayjs/plugin/timezone";
16
17
  import "../../../node_modules/.pnpm/decimal.js@10.6.0/node_modules/decimal.js/decimal.js";
@@ -25,7 +26,7 @@ import { TtText as V } from "../../tt-text/index.js";
25
26
  import { ttUploadProps as $e } from "./typing.js";
26
27
  import { GlobalConfig as F } from "../../../hooks/useSetup.js";
27
28
  import { useModalRender as Se } from "../../tt-modal/src/hooks/useModalRender.js";
28
- const Qe = /* @__PURE__ */ de({
29
+ const Ze = /* @__PURE__ */ de({
29
30
  name: "TtUpload",
30
31
  __name: "TtUpload",
31
32
  props: /* @__PURE__ */ z($e, {
@@ -314,5 +315,5 @@ const Qe = /* @__PURE__ */ de({
314
315
  }
315
316
  });
316
317
  export {
317
- Qe as default
318
+ Ze as default
318
319
  };
@@ -80,17 +80,6 @@ export type TtUiGlobalConfig = {
80
80
  * @default-id
81
81
  */
82
82
  tableRowId?: string;
83
- /**
84
- * 请求的状态码
85
- * @default-200
86
- * @deprecated
87
- */
88
- resultCode?: string | number;
89
- /**
90
- * loading text
91
- * @default-loading text
92
- */
93
- loadingText?: string;
94
83
  /**
95
84
  * empty text
96
85
  * @default-暂无数据
@@ -130,11 +119,6 @@ export type TtUiGlobalConfig = {
130
119
  * 表格边框
131
120
  */
132
121
  border?: "full" | "inner" | "outer" | "none" | boolean;
133
- /**
134
- * 是否开启缓存
135
- * @default-false 不开启
136
- */
137
- useCache?: boolean;
138
122
  /**
139
123
  * 是否显示右边刷新按钮
140
124
  * @default-true 显示
@@ -155,12 +139,8 @@ export type TtUiGlobalConfig = {
155
139
  * @default-true 显示
156
140
  */
157
141
  showSetColumn?: boolean;
158
- /** 是否显示自定义行距 */
159
- showLineHeight?: boolean;
160
142
  /** 自定义函数 */
161
143
  customizeColumn?: TtTableProps["customizeColumn"];
162
- /** 外部插槽 */
163
- getSyncSlotComponent?: TtTableProps["getSyncSlotComponent"];
164
144
  /**
165
145
  * 表格斑马线
166
146
  * @default- false
@@ -1,9 +1,10 @@
1
1
  import "axios";
2
2
  import { ElTooltip as b } from "element-plus";
3
3
  import { isArray as l, isObject as m } from "../../packages/utils/src/is.js";
4
- import { shallowRef as v, toValue as s, h as p, createVNode as g, render as h } from "vue";
5
- import "xe-utils";
4
+ import { shallowRef as v, toValue as p, h as s, createVNode as g, render as h } from "vue";
6
5
  import "dayjs";
6
+ import "numeral";
7
+ import "xe-utils";
7
8
  import "dayjs/plugin/utc";
8
9
  import "dayjs/plugin/timezone";
9
10
  import "../../node_modules/.pnpm/decimal.js@10.6.0/node_modules/decimal.js/decimal.js";
@@ -16,10 +17,10 @@ let n;
16
17
  const d = v();
17
18
  function V(e) {
18
19
  if (l(e) && e.length > 0)
19
- return e.filter((t) => s(t.condition) ?? !0).map((t) => t.message);
20
+ return e.filter((t) => p(t.condition) ?? !0).map((t) => t.message);
20
21
  if (m(e)) {
21
22
  const t = e;
22
- return !!s(t.condition) ? t.message : null;
23
+ return !!p(t.condition) ? t.message : null;
23
24
  }
24
25
  return typeof e == "string" ? e : null;
25
26
  }
@@ -27,7 +28,7 @@ function x(e) {
27
28
  return l(e) && e.length > 0 ? e[0].placement || "bottom" : m(e) && e.placement || "bottom";
28
29
  }
29
30
  function y(e, t, o = "bottom") {
30
- if (d.value = Array.isArray(t) ? t.map((r) => p("div", {}, r)) : t, n)
31
+ if (d.value = Array.isArray(t) ? t.map((r) => s("div", {}, r)) : t, n)
31
32
  n.props.trigger = "hover", n.props.virtualRef = e, n.props.placement = o, n.exposed.updatePopper(), n.exposed.onOpen();
32
33
  else {
33
34
  const r = g(
@@ -44,7 +45,7 @@ function y(e, t, o = "bottom") {
44
45
  popperClass: "!z-[9999]"
45
46
  },
46
47
  {
47
- content: () => p(
48
+ content: () => s(
48
49
  "div",
49
50
  {
50
51
  style: {
@@ -75,7 +76,7 @@ async function a(e, t) {
75
76
  const o = t.value, r = V(o), i = x(o);
76
77
  e.boundingValue = e.boundingValue || { listened: !1, messages: r, placement: i }, e.boundingValue.messages = r, e.boundingValue.placement = i, !((u = e.boundingValue) != null && u.listened) && (r != null && r.length) && (e.addEventListener("mouseenter", c), e.addEventListener("mouseleave", f), e.boundingValue.listened = !0);
77
78
  }
78
- const N = {
79
+ const q = {
79
80
  created: a,
80
81
  beforeMount: a,
81
82
  updated: a,
@@ -85,5 +86,5 @@ const N = {
85
86
  }
86
87
  };
87
88
  export {
88
- N as default
89
+ q as default
89
90
  };
@@ -3,8 +3,9 @@ import "axios";
3
3
  import { ElSelectV2 as Z } from "element-plus";
4
4
  import { isFunction as q } from "../packages/utils/src/is.js";
5
5
  import "vue";
6
- import "xe-utils";
7
6
  import "dayjs";
7
+ import "numeral";
8
+ import "xe-utils";
8
9
  import "dayjs/plugin/utc";
9
10
  import "dayjs/plugin/timezone";
10
11
  import "../node_modules/.pnpm/decimal.js@10.6.0/node_modules/decimal.js/decimal.js";
@@ -286,7 +287,7 @@ function no(r = {}, u = z) {
286
287
  dataSource: I
287
288
  };
288
289
  }
289
- function Po() {
290
+ function So() {
290
291
  const r = {
291
292
  options: {},
292
293
  codes: [...z]
@@ -337,5 +338,5 @@ function Po() {
337
338
  return u;
338
339
  }
339
340
  export {
340
- Po as useFormSchemasLink
341
+ So as useFormSchemasLink
341
342
  };
@@ -1,73 +1,37 @@
1
- import { default as dayjs } from 'dayjs';
2
- type ILabelFormatType = "period" | "month";
3
- type FormatReturnType = {
4
- /**
5
- * 生成表单验证规则
6
- * @param message - 验证失败时的提示信息
7
- * @param trigger - 触发验证的时机,默认为'change'
8
- * @returns 验证规则数组
9
- */
10
- formatFormRole: (message: string, trigger?: string) => {
11
- required: boolean;
12
- message: string;
13
- trigger: string;
14
- }[];
15
- /**
16
- * 格式化日期时间
17
- * @param date - 要格式化的日期,可以是字符串、数字、Date对象或dayjs对象
18
- * @param format - 格式化模板,默认为'YYYY-MM-DD HH:mm:ss'
19
- * @returns 格式化后的日期时间字符串,无效日期返回'--'
20
- */
21
- formatToDateTime: (date: string | number | Date | dayjs.Dayjs | null | undefined, format?: string) => string;
22
- /**
23
- * 格式化日期
24
- * @param date - 要格式化的日期,可以是字符串、数字、Date对象或dayjs对象
25
- * @param format - 格式化模板,默认为'YYYY-MM-DD'
26
- * @param isTimeStamp - 是否为时间戳格式,默认为false
27
- * @returns 格式化后的日期字符串,无效日期返回'--'
28
- */
29
- formatToDate: (date: string | number | Date | dayjs.Dayjs | null | undefined, format?: string, isTimeStamp?: boolean) => string;
30
- /**
31
- * 格式化金额数据
32
- * @param val - 要格式化的金额,可以是数字或字符串
33
- * @param format - 格式化模板,默认为'0,0.00'
34
- * @returns 格式化后的金额字符串
35
- */
36
- formatAmount: (val: number | string, format?: string) => string;
37
- /**
38
- * 格式化金额为千分位并保留两位小数
39
- * @param val - 要格式化的数值
40
- * @param format - 格式化模板,默认为'0,0.00'
41
- * @returns 格式化后的金额字符串
42
- */
43
- formatAmountOfPlace: (val: number, format?: string) => string;
44
- /**
45
- * 将千分位格式的金额字符串转换为数值
46
- * @param val - 要转换的金额字符串或数值
47
- * @returns 转换后的数值
48
- */
49
- formatPlaceOfAmount: (val: string | number) => number;
50
- /**
51
- * 格式化金额但不四舍五入
52
- * @param str - 要格式化的金额字符串或数字
53
- * @param index - 要保留的小数位数
54
- * @returns 格式化后的金额字符串
55
- */
56
- formatDecimal: (str: string | number, index: number) => string;
57
- /**
58
- * 格式化文件大小
59
- * @param bytes - 文件大小(字节)
60
- * @param decimalPoint - 保留的小数位数,默认为2
61
- * @returns 格式化后的文件大小字符串(带单位)
62
- */
63
- formatFileSize: (bytes: number, decimalPoint?: number) => string;
64
- /**
65
- * 格式化期间(年月)
66
- * @param val - 要格式化的期间值,可以是数字或字符串
67
- * @param formatType - 格式化类型,'period'表示期间,'month'表示月份
68
- * @returns 格式化后的期间字符串
69
- */
70
- formatPeriod: (val: number | string, formatType?: ILabelFormatType) => string;
1
+ import { formatAmount, formatAmountOfPlace, formatDecimal, formatFileSize, formatPeriod, formatPlaceOfAmount, formatToDate, formatToDateTime } from '../../../utils/src';
2
+ /**
3
+ * 生成表单验证规则
4
+ *
5
+ * 留在 ui 包:它产出的是 element-plus 表单的校验规则,不属于数据格式化。
6
+ * @param message 验证失败时的提示信息
7
+ * @param trigger 触发验证的时机,默认 `change`
8
+ * @returns 校验规则数组
9
+ */
10
+ declare function formatFormRole(message: string, trigger?: string): {
11
+ required: boolean;
12
+ message: string;
13
+ trigger: string;
14
+ }[];
15
+ /**
16
+ * 格式化方法集合。
17
+ *
18
+ * 除 `formatFormRole` 外的实现都在 `@dazhicheng/utils` 的 `format` 模块,这里只做转发,
19
+ * 保证 hook 与直接 `import { formatAmount } from "@dazhicheng/utils"` 拿到的是同一份实现。
20
+ * 返回类型交给推断,避免 hook 侧与 utils 侧维护两套签名。
21
+ * @returns 格式化方法集合
22
+ * @example
23
+ * const { formatAmount, formatToDate } = useFormat();
24
+ * formatAmount(1234.5); // "1,234.50"
25
+ */
26
+ export declare function useFormat(): {
27
+ formatFormRole: typeof formatFormRole;
28
+ formatToDateTime: typeof formatToDateTime;
29
+ formatToDate: typeof formatToDate;
30
+ formatAmount: typeof formatAmount;
31
+ formatAmountOfPlace: typeof formatAmountOfPlace;
32
+ formatPlaceOfAmount: typeof formatPlaceOfAmount;
33
+ formatDecimal: typeof formatDecimal;
34
+ formatFileSize: typeof formatFileSize;
35
+ formatPeriod: typeof formatPeriod;
71
36
  };
72
- export declare function useFormat(): FormatReturnType;
73
37
  export {};
@@ -1,44 +1,33 @@
1
- import m from "dayjs";
2
- import f from "numeral";
3
- const i = "YYYY-MM-DD HH:mm:ss", a = "YYYY-MM-DD";
4
- function F() {
1
+ import "axios";
2
+ import "element-plus";
3
+ import "dayjs";
4
+ import "vue";
5
+ import { formatPeriod as t, formatFileSize as m, formatDecimal as i, formatPlaceOfAmount as e, formatAmountOfPlace as a, formatAmount as p, formatToDate as f, formatToDateTime as n } from "../packages/utils/src/format.js";
6
+ import "xe-utils";
7
+ import "dayjs/plugin/utc";
8
+ import "dayjs/plugin/timezone";
9
+ import "../node_modules/.pnpm/decimal.js@10.6.0/node_modules/decimal.js/decimal.js";
10
+ import "../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/aes.js";
11
+ import "../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-utf8.js";
12
+ import "../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js";
13
+ import "../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
14
+ import "lodash-es";
15
+ function u(o, r = "change") {
16
+ return [{ required: !0, message: o, trigger: r }];
17
+ }
18
+ function z() {
5
19
  return {
6
- formatFormRole: (t, r = "change") => [{ required: !0, message: t, trigger: r }],
7
- formatToDateTime: (t, r = i) => m(t).isValid() ? m(t).format(r) : "--",
8
- formatToDate: (t, r = a, o = !1) => o ? t ? m(+t).format(r) : "--" : m(t).isValid() ? m(t).format(r) : "--",
9
- formatAmount: (t, r = "0,0.00") => t ? f(t).format(r) : "0.00",
10
- formatAmountOfPlace: (t, r = "0,0.00") => t ? f(t).format(r) : "0.00",
11
- formatPlaceOfAmount: (t) => {
12
- if (t) {
13
- const r = f(t).format("0,0.00");
14
- return f(r).value();
15
- }
16
- return 0;
17
- },
18
- formatDecimal: (t, r) => {
19
- let o = Number.parseFloat(t.toString());
20
- if (Number.isNaN(o)) return "";
21
- o = Math.round(o * 10 ** r) / 10 ** r;
22
- let e = o.toString(), n = e.indexOf(".");
23
- for (n < 0 && (n = e.length, e += "."); e.length <= n + r; ) e += "0";
24
- return e;
25
- },
26
- formatFileSize: (t, r = 2) => {
27
- if (t === 0) return "0 Bytes";
28
- const o = 1e3, e = ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"], n = Math.floor(Math.log(t) / Math.log(o));
29
- return `${Number.parseFloat((t / o ** n).toFixed(r))} ${e[n]}`;
30
- },
31
- formatPeriod: (t, r = "period") => {
32
- if (!t) return "";
33
- typeof t == "number" && (t = t.toString()), typeof t == "string" && (t = t.replace(/[-.]/g, ""));
34
- const o = t.slice(0, 4), e = t.slice(4, 6), n = {
35
- period: "期",
36
- month: "月"
37
- };
38
- return r === "period" ? `${o}年${e}${n[r]}` : ` ${e}/${o}`;
39
- }
20
+ formatFormRole: u,
21
+ formatToDateTime: n,
22
+ formatToDate: f,
23
+ formatAmount: p,
24
+ formatAmountOfPlace: a,
25
+ formatPlaceOfAmount: e,
26
+ formatDecimal: i,
27
+ formatFileSize: m,
28
+ formatPeriod: t
40
29
  };
41
30
  }
42
31
  export {
43
- F as useFormat
32
+ z as useFormat
44
33
  };
@@ -2,8 +2,9 @@ import "axios";
2
2
  import "element-plus";
3
3
  import { isFunction as f } from "../packages/utils/src/is.js";
4
4
  import "vue";
5
- import "xe-utils";
6
5
  import "dayjs";
6
+ import "numeral";
7
+ import "xe-utils";
7
8
  import "dayjs/plugin/utc";
8
9
  import "dayjs/plugin/timezone";
9
10
  import "../node_modules/.pnpm/decimal.js@10.6.0/node_modules/decimal.js/decimal.js";
@@ -70,7 +71,7 @@ function v(t, n) {
70
71
  const r = (s = t.value) == null ? void 0 : s[n];
71
72
  return Array.isArray(r) ? r : [];
72
73
  }
73
- function Be(t, n = {}) {
74
+ function De(t, n = {}) {
74
75
  const r = [...new Set(t.map((e) => e.code))], s = t.reduce(
75
76
  (e, c) => (e[c.code] = (e[c.code] || 0) + 1, e),
76
77
  {}
@@ -216,5 +217,5 @@ function Be(t, n = {}) {
216
217
  };
217
218
  }
218
219
  export {
219
- Be as usePanelSelectSchemas
220
+ De as usePanelSelectSchemas
220
221
  };
@@ -3,6 +3,7 @@ import "axios";
3
3
  import "element-plus";
4
4
  import "dayjs";
5
5
  import "vue";
6
+ import "numeral";
6
7
  import "xe-utils";
7
8
  import "dayjs/plugin/utc";
8
9
  import "dayjs/plugin/timezone";
@@ -24,17 +25,17 @@ function h(r, e) {
24
25
  }
25
26
  function d(r) {
26
27
  return new Promise((e, s) => {
27
- const n = new FileReader();
28
- n.onload = () => e(n.result), n.onerror = () => s(n.error ?? new Error("Blob 转 DataURL 失败")), n.readAsDataURL(r);
28
+ const o = new FileReader();
29
+ o.onload = () => e(o.result), o.onerror = () => s(o.error ?? new Error("Blob 转 DataURL 失败")), o.readAsDataURL(r);
29
30
  });
30
31
  }
31
32
  async function x(r, e, s) {
32
- const o = `${s || e.dir || "notice"}/${Date.now()}_${r.name}`, t = new FormData();
33
- t.append("key", o), t.append("policy", e.policy), t.append("x-oss-signature-version", e.version), t.append("x-oss-signature", e.signature), t.append("x-oss-credential", e.x_oss_credential), t.append("x-oss-date", e.x_oss_date), t.append("x-oss-security-token", e.security_token), e.callback && t.append("callback", e.callback), t.append("success_action_status", "200"), t.append("file", r);
33
+ const n = `${s || e.dir || "notice"}/${Date.now()}_${r.name}`, t = new FormData();
34
+ t.append("key", n), t.append("policy", e.policy), t.append("x-oss-signature-version", e.version), t.append("x-oss-signature", e.signature), t.append("x-oss-credential", e.x_oss_credential), t.append("x-oss-date", e.x_oss_date), t.append("x-oss-security-token", e.security_token), e.callback && t.append("callback", e.callback), t.append("success_action_status", "200"), t.append("file", r);
34
35
  const a = await fetch(e.host, { method: "POST", body: t });
35
36
  if (!a.ok && a.status !== 203)
36
37
  throw new Error(`OSS 上传失败: ${a.status}`);
37
- return o;
38
+ return n;
38
39
  }
39
40
  function k(r) {
40
41
  const e = r ?? g.uploadOssApi;
@@ -43,21 +44,21 @@ function k(r) {
43
44
  return e;
44
45
  }
45
46
  async function p(r, e) {
46
- const s = k(e == null ? void 0 : e.uploadOssApi), n = (e == null ? void 0 : e.format) ?? "png", o = (e == null ? void 0 : e.fileName) ?? O(n), t = h(r, o), a = await s(t), c = await x(t, a, e == null ? void 0 : e.ossDir);
47
+ const s = k(e == null ? void 0 : e.uploadOssApi), o = (e == null ? void 0 : e.format) ?? "png", n = (e == null ? void 0 : e.fileName) ?? O(o), t = h(r, n), a = await s(t), c = await x(t, a, e == null ? void 0 : e.ossDir);
47
48
  return { blob: r, file: t, ossKey: c };
48
49
  }
49
- function L() {
50
+ function G() {
50
51
  const r = y();
51
- async function e(o, t) {
52
- const a = await r.captureToBlob(o, t);
52
+ async function e(n, t) {
53
+ const a = await r.captureToBlob(n, t);
53
54
  return p(a, t);
54
55
  }
55
- async function s(o, t) {
56
- const a = await r.captureToBlob(o, t), [c, i] = await Promise.all([d(a), p(a, t)]);
56
+ async function s(n, t) {
57
+ const a = await r.captureToBlob(n, t), [c, i] = await Promise.all([d(a), p(a, t)]);
57
58
  return { ...i, dataUrl: c };
58
59
  }
59
- async function n(o, t) {
60
- const { ossDir: a, fileName: c, uploadOssApi: i, output: m, ...f } = t, u = await r.captureComponent(o, {
60
+ async function o(n, t) {
61
+ const { ossDir: a, fileName: c, uploadOssApi: i, output: m, ...f } = t, u = await r.captureComponent(n, {
61
62
  ...f,
62
63
  output: "blob"
63
64
  }), b = {
@@ -75,10 +76,10 @@ function L() {
75
76
  return {
76
77
  captureToBlob: e,
77
78
  captureToDataUrl: s,
78
- captureComponent: n,
79
+ captureComponent: o,
79
80
  isCapturing: r.isCapturing
80
81
  };
81
82
  }
82
83
  export {
83
- L as useScreenshotOss
84
+ G as useScreenshotOss
84
85
  };
@@ -15,8 +15,6 @@ const i = {
15
15
  totalField: "total",
16
16
  dataField: "list",
17
17
  tableRowId: "id",
18
- resultCode: 200,
19
- loadingText: "加载中...",
20
18
  emptyText: "暂无数据",
21
19
  noSearchText: "请先点击查询",
22
20
  keyboardConfig: {
@@ -33,7 +31,6 @@ const i = {
33
31
  showSetting: !0,
34
32
  showRefresh: !0,
35
33
  showExport: !1,
36
- useCache: !1,
37
34
  defaultDisplayFields: [],
38
35
  isReloadResetToFirstPage: !0,
39
36
  stripe: !0,
@@ -1,7 +1,8 @@
1
1
  import "axios";
2
2
  import "element-plus";
3
3
  import "dayjs";
4
- import "vue";
4
+ import { getCurrentScope as p, onScopeDispose as i } from "vue";
5
+ import "numeral";
5
6
  import { debounce as m } from "../../utils/src/tool.js";
6
7
  import "../../../node_modules/.pnpm/decimal.js@10.6.0/node_modules/decimal.js/decimal.js";
7
8
  import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/aes.js";
@@ -9,9 +10,9 @@ import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-u
9
10
  import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js";
10
11
  import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
11
12
  import "lodash-es";
12
- function h(r, t, i) {
13
- const o = m(r, t, i);
14
- return {
13
+ function g(r, t, e) {
14
+ const o = m(r, t ?? 200, e);
15
+ return p() && i(o.cancel), {
15
16
  /**
16
17
  * 防抖函数,保持原函数的返回类型
17
18
  * 如果原函数是异步的,返回 Promise;如果是同步的,返回原始类型
@@ -28,5 +29,5 @@ function h(r, t, i) {
28
29
  };
29
30
  }
30
31
  export {
31
- h as useDebounceFn
32
+ g as useDebounceFn
32
33
  };